Hi, another LUA question/
How does one toggle the status of the “Enable/Disable MIDI Input” of a MIDI track (the MIDI plug icon) ?
While I can successfully connect the input I want to that track using the MidiPort:connect method; I thought the MidiPort:set_input_active (bool) method would be the one to toggle that switch but nothing happens …
Any hints ?
function factory () return function ()
local sel = Editor:get_selection ()
-- for each selected track/bus
for r in sel.tracks:routelist ():iter () do
if not r:to_track ():isnil () and not r:to_track ():to_midi_track ():isnil () then
local inputmidiport = r:input():midi(0)
inputmidiport:disconnect_all()
inputmidiport:connect("Hydrogen-midi:TX")
inputmidiport:set_input_active(true)
end
end
end end