Commit 04670509 authored by Jonathan Wilkes's avatar Jonathan Wilkes

Merge branch 'pranay_36/purr-data-pd-l2ork_port_midi'

parents 2784e336 0be9d17b
...@@ -666,38 +666,21 @@ void midi_alsa_setndevs(int in, int out); ...@@ -666,38 +666,21 @@ void midi_alsa_setndevs(int in, int out);
void glob_midi_setapi(void *dummy, t_floatarg f) void glob_midi_setapi(void *dummy, t_floatarg f)
{ {
int newapi = f; int newapi = f;
if (newapi) if (newapi != sys_midiapi)
{ {
if (newapi == sys_midiapi)
{
//if (!midi_isopen())
// s_reopen_midi();
}
else
{
#ifdef USEAPI_ALSA #ifdef USEAPI_ALSA
if (sys_midiapi == API_ALSA) if (sys_midiapi == API_ALSA)
sys_alsa_close_midi(); sys_alsa_close_midi();
else else
#endif #endif
sys_close_midi(); sys_close_midi();
sys_midiapi = newapi; sys_midiapi = newapi;
/* bash device params back to default */ sys_reopen_midi();
// midi_nmidiindev = midi_nmidioutdev = 1; }
//midi_midiindev[0] = midi_midioutdev[0] = DEFAULTMIDIDEV;
//midi_midichindev[0] = midi_midichoutdev[0] = SYS_DEFAULTCH;
sys_reopen_midi();
}
#ifdef USEAPI_ALSA #ifdef USEAPI_ALSA
midi_alsa_setndevs(midi_nmidiindev, midi_nmidioutdev); midi_alsa_setndevs(midi_nmidiindev, midi_nmidioutdev);
#endif #endif
glob_midi_properties(0, 0); glob_midi_properties(0, (midi_nmidiindev > 1 || midi_nmidioutdev > 1));
}
else //if (midi_isopen())
{
sys_close_midi();
//midi_state = 0;
}
} }
extern t_class *glob_pdobject; extern t_class *glob_pdobject;
...@@ -808,9 +791,9 @@ void glob_midi_properties(t_pd *dummy, t_floatarg flongform) ...@@ -808,9 +791,9 @@ void glob_midi_properties(t_pd *dummy, t_floatarg flongform)
if (sys_midiapi == API_ALSA) if (sys_midiapi == API_ALSA)
{ {
// sprintf(buf, // sprintf(buf,
//"pdtk_alsa_midi_dialog %%s " // "pdtk_alsa_midi_dialog %%s "
//"%d %d %d %d %d %d %d %d " // "%d %d %d %d %d %d %d %d "
//"%d 1\n", // "%d 1\n",
// midiindev1, midiindev2, midiindev3, midiindev4, // midiindev1, midiindev2, midiindev3, midiindev4,
// midioutdev1, midioutdev2, midioutdev3, midioutdev4, // midioutdev1, midioutdev2, midioutdev3, midioutdev4,
// (flongform != 0)); // (flongform != 0));
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment