13
0

a more nuanced version of the "do-not-automatically-disconnect-selection-follows-input

This commit is contained in:
Paul Davis 2019-03-06 19:46:51 -07:00
parent 66f73f40db
commit 8b212bfa12

View File

@ -756,6 +756,18 @@ Session::rewire_selected_midi (boost::shared_ptr<MidiTrack> new_midi_target)
}
for (vector<string>::const_iterator p = msp.begin(); p != msp.end(); ++p) {
PortManager::MidiPortInformation mpi (AudioEngine::instance()->midi_port_information (*p));
/* if a port is marked for control data, do not
* disconnect it from everything since it may also be
* used via a control surface or some other
* functionality.
*/
if (!(mpi.properties & MidiPortControl)) {
/* disconnect the port from everything */
AudioEngine::instance()->disconnect (*p);
}
/* connect it to the new target */
new_midi_target->input()->connect (new_midi_target->input()->nth(0), (*p), this);
}