add Session::reconnect_midi_scene_ports()
This commit is contained in:
parent
2f95da983b
commit
511f609a14
@ -980,6 +980,8 @@ class LIBARDOUR_API Session : public PBD::StatefulDestructible, public PBD::Scop
|
||||
|
||||
MIDI::MachineControl& mmc() { return *_mmc; }
|
||||
|
||||
void reconnect_midi_scene_ports (bool);
|
||||
|
||||
protected:
|
||||
friend class AudioEngine;
|
||||
void set_block_size (pframes_t nframes);
|
||||
|
@ -2375,6 +2375,40 @@ Session::reconnect_existing_routes (bool withLock, bool reconnect_master, bool r
|
||||
*/
|
||||
}
|
||||
|
||||
void
|
||||
Session::reconnect_midi_scene_ports(bool inputs)
|
||||
{
|
||||
if (inputs) {
|
||||
scene_in()->disconnect_all ();
|
||||
|
||||
std::vector<EngineStateController::MidiPortState> midi_port_states;
|
||||
EngineStateController::instance()->get_physical_midi_input_states (midi_port_states);
|
||||
|
||||
std::vector<EngineStateController::MidiPortState>::iterator state_iter = midi_port_states.begin();
|
||||
|
||||
for (; state_iter != midi_port_states.end(); ++state_iter) {
|
||||
if (state_iter->active && state_iter->available && state_iter->connected) {
|
||||
scene_in()->connect (state_iter->name);
|
||||
}
|
||||
}
|
||||
|
||||
} else {
|
||||
scene_out()->disconnect_all ();
|
||||
|
||||
std::vector<EngineStateController::MidiPortState> midi_port_states;
|
||||
EngineStateController::instance()->get_physical_midi_output_states (midi_port_states);
|
||||
|
||||
std::vector<EngineStateController::MidiPortState>::iterator state_iter = midi_port_states.begin();
|
||||
|
||||
for (; state_iter != midi_port_states.end(); ++state_iter) {
|
||||
if (state_iter->active && state_iter->available && state_iter->connected) {
|
||||
scene_out()->connect (state_iter->name);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/** Caller must not hold process lock
|
||||
* @param name_template string to use for the start of the name, or "" to use "Audio".
|
||||
|
Loading…
Reference in New Issue
Block a user