Fixed switching MIDI devices.

This commit is contained in:
severak 2019-10-21 14:47:41 +02:00
parent 310b7ddf50
commit bcf68eb32a
1 changed files with 4 additions and 2 deletions

View File

@ -160,6 +160,7 @@ function len:valuechanged_cb()
end
end
-- TODO - tohle přepsat na jedno okno
function midi_setup:action()
local devices , sel2id = {}, {}
for i=0,midiwire.device_count()-1 do
@ -170,11 +171,12 @@ function midi_setup:action()
end
local selected = iup.ListDialog(1, "select MIDI output", #devices, devices, 1, 1, #devices)
if selected>-1 and sel2id[selected+1] then
if selected>-1 and sel2id[selected+1] then
midiwire.close_out(mout)
if sel2id[selected+1]==0 then
-- Microsoft GS Wavetable Synth
mout = midiwire.open_out(sel2id[selected+1])
chan = 9
chan = 10
else
mout = midiwire.open_out(sel2id[selected+1])
chan = iup.Scanf("Select port\nchannel number%2.2%d\n", 1)