Compare commits

...

3 Commits

Author SHA1 Message Date
0847dc8a37 when disconnecting a MIDI port for follows-selection, get ALL connections
without the 3rd argument, we only get information about ports that we own.
2024-06-14 22:17:41 -06:00
cf58a157e3 extend PortManager API to include 3rd argument used by backend get_connections()
Value is defaulted so this does not change behavior at all
2024-06-14 22:17:30 -06:00
7982d69cb3 no need to set up midi input enable button for every ::set_route()
And additionally, do not pack it into the same container over and over, since that
generates gtk error messages
2024-06-14 22:17:22 -06:00
4 changed files with 16 additions and 13 deletions

View File

@ -351,6 +351,14 @@ MixerStrip::init ()
global_vpacker.pack_start (output_button, Gtk::PACK_SHRINK);
global_vpacker.pack_start (_comment_button, Gtk::PACK_SHRINK);
midi_input_enable_button.set_size_request (PX_SCALE(19), PX_SCALE(19));
midi_input_enable_button.set_name ("midi input button");
midi_input_enable_button.set_elements ((ArdourButton::Element)(ArdourButton::Edge|ArdourButton::Body|ArdourButton::VectorIcon));
midi_input_enable_button.set_icon (ArdourIcon::DinMidi);
midi_input_enable_button.signal_button_press_event().connect (sigc::mem_fun (*this, &MixerStrip::input_active_button_press), false);
midi_input_enable_button.signal_button_release_event().connect (sigc::mem_fun (*this, &MixerStrip::input_active_button_release), false);
set_tooltip (midi_input_enable_button, _("Enable/Disable MIDI input"));
#ifndef MIXBUS
//add a spacer underneath the master bus;
//this fills the area that is taken up by the scrollbar on the tracks;
@ -684,15 +692,9 @@ MixerStrip::set_route (std::shared_ptr<Route> rt)
update_trim_control();
if (is_midi_track()) {
midi_input_enable_button.set_size_request (PX_SCALE(19), PX_SCALE(19));
midi_input_enable_button.set_name ("midi input button");
midi_input_enable_button.set_elements ((ArdourButton::Element)(ArdourButton::Edge|ArdourButton::Body|ArdourButton::VectorIcon));
midi_input_enable_button.set_icon (ArdourIcon::DinMidi);
midi_input_enable_button.signal_button_press_event().connect (sigc::mem_fun (*this, &MixerStrip::input_active_button_press), false);
midi_input_enable_button.signal_button_release_event().connect (sigc::mem_fun (*this, &MixerStrip::input_active_button_release), false);
set_tooltip (midi_input_enable_button, _("Enable/Disable MIDI input"));
input_button_box.pack_start (midi_input_enable_button, false, false);
if (!midi_input_enable_button.get_parent()) {
input_button_box.pack_start (midi_input_enable_button, false, false);
}
/* get current state */
midi_input_status_changed ();

View File

@ -151,7 +151,7 @@ public:
bool connected (const std::string&);
bool physically_connected (const std::string&);
int get_connections (const std::string&, std::vector<std::string>&);
int get_connections (const std::string&, std::vector<std::string>&, bool process_context_safe = true);
/* Naming */

View File

@ -749,7 +749,7 @@ PortManager::physically_connected (const string& port_name)
}
int
PortManager::get_connections (const string& port_name, std::vector<std::string>& s)
PortManager::get_connections (const string& port_name, std::vector<std::string>& s, bool process_context_safe)
{
if (!_backend) {
s.clear ();
@ -763,7 +763,7 @@ PortManager::get_connections (const string& port_name, std::vector<std::string>&
return 0;
}
return _backend->get_connections (handle, s);
return _backend->get_connections (handle, s, process_context_safe);
}
int

View File

@ -744,7 +744,8 @@ Session::disconnect_port_for_rewire (std::string const& port) const
bool keep_ctrl = mpf & MidiPortControl;
vector<string> port_connections;
AudioEngine::instance()->get_connections (port, port_connections);
AudioEngine::instance()->get_connections (port, port_connections, false);
for (vector<string>::iterator i = port_connections.begin(); i != port_connections.end(); ++i) {
/* test if (*i) is a control-surface input port */