2 Copyright (C) 2000-2006 Paul Davis
4 This program is free software; you can redistribute it and/or modify
5 it under the terms of the GNU General Public License as published by
6 the Free Software Foundation; either version 2 of the License, or
7 (at your option) any later version.
9 This program is distributed in the hope that it will be useful,
10 but WITHOUT ANY WARRANTY; without even the implied warranty of
11 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 GNU General Public License for more details.
14 You should have received a copy of the GNU General Public License
15 along with this program; if not, write to the Free Software
16 Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
22 #include <sigc++/bind.h>
24 #include "pbd/convert.h"
25 #include "pbd/enumwriter.h"
26 #include "pbd/replace_all.h"
28 #include <gtkmm2ext/gtk_ui.h>
29 #include <gtkmm2ext/utils.h>
30 #include <gtkmm2ext/choice.h>
31 #include <gtkmm2ext/doi.h>
32 #include <gtkmm2ext/slider_controller.h>
33 #include <gtkmm2ext/bindable_button.h>
35 #include "ardour/ardour.h"
36 #include "ardour/amp.h"
37 #include "ardour/session.h"
38 #include "ardour/audioengine.h"
39 #include "ardour/internal_send.h"
40 #include "ardour/route.h"
41 #include "ardour/route_group.h"
42 #include "ardour/audio_track.h"
43 #include "ardour/midi_track.h"
44 #include "ardour/pannable.h"
45 #include "ardour/panner.h"
46 #include "ardour/panner_shell.h"
47 #include "ardour/send.h"
48 #include "ardour/processor.h"
49 #include "ardour/profile.h"
50 #include "ardour/ladspa_plugin.h"
51 #include "ardour/user_bundle.h"
52 #include "ardour/port.h"
54 #include "ardour_ui.h"
55 #include "ardour_dialog.h"
56 #include "mixer_strip.h"
60 #include "public_editor.h"
62 #include "io_selector.h"
64 #include "gui_thread.h"
65 #include "route_group_menu.h"
69 using namespace ARDOUR;
72 using namespace Gtkmm2ext;
75 sigc::signal<void,boost::shared_ptr<Route> > MixerStrip::SwitchIO;
77 int MixerStrip::scrollbar_height = 0;
78 PBD::Signal1<void,MixerStrip*> MixerStrip::CatchDeletion;
80 MixerStrip::MixerStrip (Mixer_UI& mx, Session* sess, bool in_mixer)
84 , _mixer_owned (in_mixer)
85 , processor_box (sess, boost::bind (&MixerStrip::plugin_selector, this), mx.selection(), this, in_mixer)
89 , solo_led_table (2, 2)
90 , middle_button_table (1, 2)
91 , bottom_button_table (1, 2)
92 , meter_point_label (_("pre"))
93 , midi_input_enable_button (0)
98 /* the editor mixer strip: don't destroy it every time
99 the underlying route goes away.
102 self_destruct = false;
106 MixerStrip::MixerStrip (Mixer_UI& mx, Session* sess, boost::shared_ptr<Route> rt, bool in_mixer)
110 , _mixer_owned (in_mixer)
111 , processor_box (sess, sigc::mem_fun(*this, &MixerStrip::plugin_selector), mx.selection(), this, in_mixer)
114 , button_table (3, 1)
115 , middle_button_table (1, 2)
116 , bottom_button_table (1, 2)
117 , meter_point_label (_("pre"))
118 , midi_input_enable_button (0)
131 ignore_comment_edit = false;
132 ignore_toggle = false;
138 /* the length of this string determines the width of the mixer strip when it is set to `wide' */
139 longest_label = "longest label";
143 img = manage (new Gtk::Image (::get_icon("strip_width")));
146 width_button.add (*img);
148 img = manage (new Gtk::Image (::get_icon("hide")));
151 hide_button.add (*img);
153 input_label.set_text (_("Input"));
154 ARDOUR_UI::instance()->set_tip (&input_button, _("Button 1 to choose inputs from a port matrix, button 3 to select inputs from a menu"), "");
155 input_button.add (input_label);
156 input_button.set_name ("MixerIOButton");
157 input_label.set_name ("MixerIOButtonLabel");
158 input_button_box.pack_start (input_button, true, true);
160 output_label.set_text (_("Output"));
161 ARDOUR_UI::instance()->set_tip (&output_button, _("Button 1 to choose outputs from a port matrix, button 3 to select inputs from a menu"), "");
162 output_button.add (output_label);
163 output_button.set_name ("MixerIOButton");
164 output_label.set_name ("MixerIOButtonLabel");
165 Gtkmm2ext::set_size_request_to_display_given_text (output_button, longest_label.c_str(), 4, 4);
167 ARDOUR_UI::instance()->set_tip (&meter_point_button, _("Select metering point"), "");
168 meter_point_button.add (meter_point_label);
169 meter_point_button.set_name ("MixerStripMeterPreButton");
170 meter_point_label.set_name ("MixerStripMeterPreButton");
172 /* TRANSLATORS: this string should be longest of the strings
173 used to describe meter points. In english, it's "input".
175 set_size_request_to_display_given_text (meter_point_button, _("tupni"), 5, 5);
177 bottom_button_table.attach (meter_point_button, 1, 2, 0, 1);
179 meter_point_button.signal_button_press_event().connect (sigc::mem_fun (gpm, &GainMeter::meter_press), false);
180 meter_point_button.signal_button_release_event().connect (sigc::mem_fun (gpm, &GainMeter::meter_release), false);
182 hide_button.set_events (hide_button.get_events() & ~(Gdk::ENTER_NOTIFY_MASK|Gdk::LEAVE_NOTIFY_MASK));
184 mute_button->set_name ("MixerMuteButton");
185 solo_button->set_name ("MixerSoloButton");
187 solo_isolated_led = manage (new LED);
188 solo_isolated_led->show ();
189 solo_isolated_led->set_diameter (6);
190 solo_isolated_led->set_no_show_all (true);
191 solo_isolated_led->set_name (X_("SoloIsolatedLED"));
192 solo_isolated_led->add_events (Gdk::BUTTON_PRESS_MASK|Gdk::BUTTON_RELEASE_MASK);
193 solo_isolated_led->signal_button_release_event().connect (sigc::mem_fun (*this, &RouteUI::solo_isolate_button_release));
194 UI::instance()->set_tip (solo_isolated_led, _("Isolate Solo"), "");
196 solo_safe_led = manage (new LED);
197 solo_safe_led->show ();
198 solo_safe_led->set_diameter (6);
199 solo_safe_led->set_no_show_all (true);
200 solo_safe_led->set_name (X_("SoloSafeLED"));
201 solo_safe_led->add_events (Gdk::BUTTON_PRESS_MASK|Gdk::BUTTON_RELEASE_MASK);
202 solo_safe_led->signal_button_release_event().connect (sigc::mem_fun (*this, &RouteUI::solo_safe_button_release));
203 UI::instance()->set_tip (solo_safe_led, _("Lock Solo Status"), "");
205 _iso_label = manage (new Label (_("iso")));
206 _safe_label = manage (new Label (_("lock")));
208 _iso_label->set_name (X_("SoloLEDLabel"));
209 _safe_label->set_name (X_("SoloLEDLabel"));
212 _safe_label->show ();
214 solo_led_table.set_spacings (0);
215 solo_led_table.set_border_width (1);
216 solo_led_table.attach (*_iso_label, 0, 1, 0, 1, Gtk::FILL, Gtk::FILL);
217 solo_led_table.attach (*solo_isolated_led, 1, 2, 0, 1, Gtk::FILL, Gtk::FILL);
218 solo_led_table.attach (*_safe_label, 0, 1, 1, 2, Gtk::FILL, Gtk::FILL);
219 solo_led_table.attach (*solo_safe_led, 1, 2, 1, 2, Gtk::FILL, Gtk::FILL);
221 solo_led_table.show ();
222 below_panner_box.set_border_width (2);
223 below_panner_box.set_spacing (2);
224 below_panner_box.pack_end (solo_led_table, false, false);
225 below_panner_box.show ();
227 button_table.set_homogeneous (true);
228 button_table.set_spacings (0);
230 button_table.attach (name_button, 0, 1, 0, 1);
231 button_table.attach (input_button_box, 0, 1, 1, 2);
232 button_table.attach (_invert_button_box, 0, 1, 2, 3);
234 middle_button_table.set_homogeneous (true);
235 middle_button_table.set_spacings (0);
236 middle_button_table.attach (*mute_button, 0, 1, 0, 1);
237 middle_button_table.attach (*solo_button, 1, 2, 0, 1);
239 bottom_button_table.set_col_spacings (0);
240 bottom_button_table.set_homogeneous (true);
241 bottom_button_table.attach (group_button, 0, 1, 0, 1);
243 name_button.add (name_label);
244 name_button.set_name ("MixerNameButton");
245 Gtkmm2ext::set_size_request_to_display_given_text (name_button, longest_label.c_str(), 2, 2);
247 name_label.set_name ("MixerNameButtonLabel");
248 ARDOUR_UI::instance()->set_tip (&group_button, _("Mix group"), "");
249 group_button.add (group_label);
250 group_button.set_name ("MixerGroupButton");
251 Gtkmm2ext::set_size_request_to_display_given_text (group_button, "Group", 2, 2);
252 group_label.set_name ("MixerGroupButtonLabel");
254 global_vpacker.set_border_width (0);
255 global_vpacker.set_spacing (0);
257 width_button.set_name ("MixerWidthButton");
258 hide_button.set_name ("MixerHideButton");
259 top_event_box.set_name ("MixerTopEventBox");
261 width_button.signal_clicked().connect (sigc::mem_fun(*this, &MixerStrip::width_clicked));
262 hide_button.signal_clicked().connect (sigc::mem_fun(*this, &MixerStrip::hide_clicked));
264 width_hide_box.pack_start (width_button, false, true);
265 width_hide_box.pack_start (top_event_box, true, true);
266 width_hide_box.pack_end (hide_button, false, true);
268 whvbox.pack_start (width_hide_box, true, true);
270 global_vpacker.pack_start (whvbox, Gtk::PACK_SHRINK);
271 global_vpacker.pack_start (button_table, Gtk::PACK_SHRINK);
272 global_vpacker.pack_start (processor_box, true, true);
273 global_vpacker.pack_start (panners, Gtk::PACK_SHRINK);
274 global_vpacker.pack_start (below_panner_box, Gtk::PACK_SHRINK);
275 global_vpacker.pack_start (middle_button_table, Gtk::PACK_SHRINK);
276 global_vpacker.pack_start (gpm, Gtk::PACK_SHRINK);
277 global_vpacker.pack_start (bottom_button_table, Gtk::PACK_SHRINK);
278 global_vpacker.pack_start (output_button, Gtk::PACK_SHRINK);
280 global_frame.add (global_vpacker);
281 global_frame.set_shadow_type (Gtk::SHADOW_IN);
282 global_frame.set_name ("BaseFrame");
286 /* force setting of visible selected status */
289 set_selected (false);
294 _session->engine().Stopped.connect (*this, invalidator (*this), boost::bind (&MixerStrip::engine_stopped, this), gui_context());
295 _session->engine().Running.connect (*this, invalidator (*this), boost::bind (&MixerStrip::engine_running, this), gui_context());
297 input_button.signal_button_press_event().connect (sigc::mem_fun(*this, &MixerStrip::input_press), false);
298 output_button.signal_button_press_event().connect (sigc::mem_fun(*this, &MixerStrip::output_press), false);
300 /* we don't need this if its not an audio track, but we don't know that yet and it doesn't
304 rec_enable_button->set_name ("MixerRecordEnableButton");
306 /* ditto for this button and busses */
308 name_button.signal_button_press_event().connect (sigc::mem_fun(*this, &MixerStrip::name_button_button_press), false);
309 group_button.signal_button_press_event().connect (sigc::mem_fun(*this, &MixerStrip::select_route_group), false);
313 /* start off as a passthru strip. we'll correct this, if necessary,
314 in update_diskstream_display().
317 /* start off as a passthru strip. we'll correct this, if necessary,
318 in update_diskstream_display().
322 set_name ("MidiTrackStripBase");
324 set_name ("AudioTrackStripBase");
326 add_events (Gdk::BUTTON_RELEASE_MASK|
327 Gdk::ENTER_NOTIFY_MASK|
328 Gdk::LEAVE_NOTIFY_MASK|
330 Gdk::KEY_RELEASE_MASK);
332 set_flags (get_flags() | Gtk::CAN_FOCUS);
334 SwitchIO.connect (sigc::mem_fun (*this, &MixerStrip::switch_io));
336 AudioEngine::instance()->PortConnectedOrDisconnected.connect (
337 *this, invalidator (*this), boost::bind (&MixerStrip::port_connected_or_disconnected, this, _1, _2), gui_context ()
341 MixerStrip::~MixerStrip ()
343 CatchDeletion (this);
345 delete input_selector;
346 delete output_selector;
347 delete comment_window;
351 MixerStrip::set_route (boost::shared_ptr<Route> rt)
353 if (rec_enable_button->get_parent()) {
354 below_panner_box.remove (*rec_enable_button);
357 if (show_sends_button->get_parent()) {
358 below_panner_box.remove (*show_sends_button);
361 processor_box.set_route (rt);
363 RouteUI::set_route (rt);
365 /* map the current state */
368 update_solo_display ();
370 delete input_selector;
373 delete output_selector;
376 revert_to_default_display ();
378 if (route()->is_master()) {
379 solo_button->hide ();
380 below_panner_box.hide ();
382 solo_button->show ();
383 below_panner_box.show ();
386 if (_mixer_owned && (route()->is_master() || route()->is_monitor())) {
388 if (scrollbar_height == 0) {
389 HScrollbar scrollbar;
390 Gtk::Requisition requisition(scrollbar.size_request ());
391 scrollbar_height = requisition.height;
394 spacer = manage (new EventBox);
395 spacer->set_size_request (-1, scrollbar_height);
396 global_vpacker.pack_start (*spacer, false, false);
399 if (is_midi_track()) {
400 if (midi_input_enable_button == 0) {
401 Image* img = manage (new Image (get_icon (X_("midi_socket_small"))));
402 midi_input_enable_button = manage (new StatefulToggleButton);
403 midi_input_enable_button->set_name ("MixerMidiInputEnableButton");
404 midi_input_enable_button->set_image (*img);
405 midi_input_enable_button->signal_button_press_event().connect (sigc::mem_fun (*this, &MixerStrip::input_active_button_press), false);
406 midi_input_enable_button->signal_button_release_event().connect (sigc::mem_fun (*this, &MixerStrip::input_active_button_release), false);
407 ARDOUR_UI::instance()->set_tip (midi_input_enable_button, _("Enable/Disable MIDI input"));
409 input_button_box.remove (*midi_input_enable_button);
411 /* get current state */
412 midi_input_status_changed ();
413 input_button_box.pack_start (*midi_input_enable_button, false, false);
415 midi_track()->InputActiveChanged.connect (route_connections, invalidator (*this), boost::bind (&MixerStrip::midi_input_status_changed, this), gui_context());
417 if (midi_input_enable_button) {
418 /* removal from the container will delete it */
419 input_button_box.remove (*midi_input_enable_button);
420 midi_input_enable_button = 0;
424 if (is_audio_track()) {
425 boost::shared_ptr<AudioTrack> at = audio_track();
426 at->FreezeChange.connect (route_connections, invalidator (*this), boost::bind (&MixerStrip::map_frozen, this), gui_context());
429 if (has_audio_outputs ()) {
437 below_panner_box.pack_start (*rec_enable_button);
438 rec_enable_button->set_sensitive (_session->writable());
439 rec_enable_button->show();
445 if (!_route->is_master()) {
446 below_panner_box.pack_start (*show_sends_button);
447 show_sends_button->show();
451 meter_point_label.set_text (meter_point_string (_route->meter_point()));
453 delete route_ops_menu;
456 _route->meter_change.connect (route_connections, invalidator (*this), bind (&MixerStrip::meter_changed, this), gui_context());
457 _route->route_group_changed.connect (route_connections, invalidator (*this), boost::bind (&MixerStrip::route_group_changed, this), gui_context());
459 if (_route->panner_shell()) {
460 _route->panner_shell()->Changed.connect (route_connections, invalidator (*this), boost::bind (&MixerStrip::connect_to_pan, this), gui_context());
463 if (is_audio_track()) {
464 audio_track()->DiskstreamChanged.connect (route_connections, invalidator (*this), boost::bind (&MixerStrip::diskstream_changed, this), gui_context());
467 _route->comment_changed.connect (route_connections, invalidator (*this), ui_bind (&MixerStrip::comment_changed, this, _1), gui_context());
469 set_stuff_from_route ();
471 /* now force an update of all the various elements */
474 update_solo_display ();
477 route_group_changed ();
480 panners.setup_pan ();
482 update_diskstream_display ();
483 update_input_display ();
484 update_output_display ();
486 add_events (Gdk::BUTTON_RELEASE_MASK);
488 processor_box.show ();
490 if (!route()->is_master() && !route()->is_monitor()) {
491 /* we don't allow master or control routes to be hidden */
496 width_hide_box.show();
499 global_vpacker.show();
501 middle_button_table.show();
502 bottom_button_table.show();
504 gain_unit_button.show();
505 gain_unit_label.show();
506 meter_point_button.show();
507 meter_point_label.show();
508 diskstream_button.show();
509 diskstream_label.show();
510 input_button_box.show_all();
511 output_button.show();
522 MixerStrip::set_stuff_from_route ()
524 /* if width is not set, it will be set by the MixerUI or editor */
526 string str = gui_property ("strip-width");
528 set_width_enum (Width (string_2_enum (str, _width)), this);
533 MixerStrip::set_width_enum (Width w, void* owner)
535 /* always set the gpm width again, things may be hidden */
538 panners.set_width (w);
540 boost::shared_ptr<AutomationList> gain_automation = _route->gain_control()->alist();
542 _width_owner = owner;
546 if (_width_owner == this) {
547 set_gui_property ("strip-width", enum_2_string (_width));
554 if (show_sends_button) {
555 ((Gtk::Label*)show_sends_button->get_child())->set_text (_("Sends"));
558 ((Gtk::Label*)gpm.gain_automation_style_button.get_child())->set_text (
559 gpm.astyle_string(gain_automation->automation_style()));
560 ((Gtk::Label*)gpm.gain_automation_state_button.get_child())->set_text (
561 gpm.astate_string(gain_automation->automation_state()));
563 if (_route->panner()) {
564 ((Gtk::Label*)panners.pan_automation_style_button.get_child())->set_text (
565 panners.astyle_string(_route->panner()->automation_style()));
566 ((Gtk::Label*)panners.pan_automation_state_button.get_child())->set_text (
567 panners.astate_string(_route->panner()->automation_state()));
571 _safe_label->show ();
573 Gtkmm2ext::set_size_request_to_display_given_text (name_button, "long", 2, 2);
574 set_size_request (-1, -1);
578 if (show_sends_button) {
579 ((Gtk::Label*)show_sends_button->get_child())->set_text (_("Snd"));
582 ((Gtk::Label*)gpm.gain_automation_style_button.get_child())->set_text (
583 gpm.short_astyle_string(gain_automation->automation_style()));
584 ((Gtk::Label*)gpm.gain_automation_state_button.get_child())->set_text (
585 gpm.short_astate_string(gain_automation->automation_state()));
587 if (_route->panner()) {
588 ((Gtk::Label*)panners.pan_automation_style_button.get_child())->set_text (
589 panners.short_astyle_string(_route->panner()->automation_style()));
590 ((Gtk::Label*)panners.pan_automation_state_button.get_child())->set_text (
591 panners.short_astate_string(_route->panner()->automation_state()));
595 _safe_label->hide ();
597 Gtkmm2ext::set_size_request_to_display_given_text (name_button, longest_label.c_str(), 2, 2);
598 set_size_request (max (50, gpm.get_gm_width()), -1);
602 processor_box.set_width (w);
604 update_input_display ();
605 update_output_display ();
606 route_group_changed ();
612 MixerStrip::set_packed (bool yn)
617 set_gui_property ("visible", true);
619 set_gui_property ("visible", false);
624 struct RouteCompareByName {
625 bool operator() (boost::shared_ptr<Route> a, boost::shared_ptr<Route> b) {
626 return a->name().compare (b->name()) < 0;
631 MixerStrip::output_press (GdkEventButton *ev)
633 using namespace Menu_Helpers;
634 if (!_session->engine().connected()) {
635 MessageDialog msg (_("Not connected to JACK - no I/O changes are possible"));
640 MenuList& citems = output_menu.items();
641 switch (ev->button) {
644 edit_output_configuration ();
649 output_menu.set_name ("ArdourContextMenu");
651 output_menu_bundles.clear ();
653 citems.push_back (MenuElem (_("Disconnect"), sigc::mem_fun (*(static_cast<RouteUI*>(this)), &RouteUI::disconnect_output)));
654 citems.push_back (SeparatorElem());
656 ARDOUR::BundleList current = _route->output()->bundles_connected ();
658 boost::shared_ptr<ARDOUR::BundleList> b = _session->bundles ();
660 /* give user bundles first chance at being in the menu */
662 for (ARDOUR::BundleList::iterator i = b->begin(); i != b->end(); ++i) {
663 if (boost::dynamic_pointer_cast<UserBundle> (*i)) {
664 maybe_add_bundle_to_output_menu (*i, current);
668 for (ARDOUR::BundleList::iterator i = b->begin(); i != b->end(); ++i) {
669 if (boost::dynamic_pointer_cast<UserBundle> (*i) == 0) {
670 maybe_add_bundle_to_output_menu (*i, current);
674 boost::shared_ptr<ARDOUR::RouteList> routes = _session->get_routes ();
675 RouteList copy = *routes;
676 copy.sort (RouteCompareByName ());
677 for (ARDOUR::RouteList::const_iterator i = copy.begin(); i != copy.end(); ++i) {
678 maybe_add_bundle_to_output_menu ((*i)->input()->bundle(), current);
681 if (citems.size() == 2) {
682 /* no routes added; remove the separator */
686 output_menu.popup (1, ev->time);
697 MixerStrip::edit_output_configuration ()
699 if (output_selector == 0) {
701 boost::shared_ptr<Send> send;
702 boost::shared_ptr<IO> output;
704 if ((send = boost::dynamic_pointer_cast<Send>(_current_delivery)) != 0) {
705 if (!boost::dynamic_pointer_cast<InternalSend>(send)) {
706 output = send->output();
708 output = _route->output ();
711 output = _route->output ();
714 output_selector = new IOSelectorWindow (_session, output);
717 if (output_selector->is_visible()) {
718 output_selector->get_toplevel()->get_window()->raise();
720 output_selector->present ();
725 MixerStrip::edit_input_configuration ()
727 if (input_selector == 0) {
728 input_selector = new IOSelectorWindow (_session, _route->input());
731 if (input_selector->is_visible()) {
732 input_selector->get_toplevel()->get_window()->raise();
734 input_selector->present ();
739 MixerStrip::input_press (GdkEventButton *ev)
741 using namespace Menu_Helpers;
743 MenuList& citems = input_menu.items();
744 input_menu.set_name ("ArdourContextMenu");
747 if (!_session->engine().connected()) {
748 MessageDialog msg (_("Not connected to JACK - no I/O changes are possible"));
753 if (_session->actively_recording() && _route->record_enabled())
756 switch (ev->button) {
759 edit_input_configuration ();
764 citems.push_back (MenuElem (_("Disconnect"), sigc::mem_fun (*(static_cast<RouteUI*>(this)), &RouteUI::disconnect_input)));
765 citems.push_back (SeparatorElem());
766 input_menu_bundles.clear ();
768 ARDOUR::BundleList current = _route->input()->bundles_connected ();
770 boost::shared_ptr<ARDOUR::BundleList> b = _session->bundles ();
772 /* give user bundles first chance at being in the menu */
774 for (ARDOUR::BundleList::iterator i = b->begin(); i != b->end(); ++i) {
775 if (boost::dynamic_pointer_cast<UserBundle> (*i)) {
776 maybe_add_bundle_to_input_menu (*i, current);
780 for (ARDOUR::BundleList::iterator i = b->begin(); i != b->end(); ++i) {
781 if (boost::dynamic_pointer_cast<UserBundle> (*i) == 0) {
782 maybe_add_bundle_to_input_menu (*i, current);
786 boost::shared_ptr<ARDOUR::RouteList> routes = _session->get_routes ();
787 RouteList copy = *routes;
788 copy.sort (RouteCompareByName ());
789 for (ARDOUR::RouteList::const_iterator i = copy.begin(); i != copy.end(); ++i) {
790 maybe_add_bundle_to_input_menu ((*i)->output()->bundle(), current);
793 if (citems.size() == 2) {
794 /* no routes added; remove the separator */
798 input_menu.popup (1, ev->time);
808 MixerStrip::bundle_input_toggled (boost::shared_ptr<ARDOUR::Bundle> c)
814 ARDOUR::BundleList current = _route->input()->bundles_connected ();
816 if (std::find (current.begin(), current.end(), c) == current.end()) {
817 _route->input()->connect_ports_to_bundle (c, this);
819 _route->input()->disconnect_ports_from_bundle (c, this);
824 MixerStrip::bundle_output_toggled (boost::shared_ptr<ARDOUR::Bundle> c)
830 ARDOUR::BundleList current = _route->output()->bundles_connected ();
832 if (std::find (current.begin(), current.end(), c) == current.end()) {
833 _route->output()->connect_ports_to_bundle (c, this);
835 _route->output()->disconnect_ports_from_bundle (c, this);
840 MixerStrip::maybe_add_bundle_to_input_menu (boost::shared_ptr<Bundle> b, ARDOUR::BundleList const & current)
842 using namespace Menu_Helpers;
844 if (b->ports_are_outputs() == false || b->nchannels() != _route->n_inputs()) {
848 list<boost::shared_ptr<Bundle> >::iterator i = input_menu_bundles.begin ();
849 while (i != input_menu_bundles.end() && b->has_same_ports (*i) == false) {
853 if (i != input_menu_bundles.end()) {
857 input_menu_bundles.push_back (b);
859 MenuList& citems = input_menu.items();
861 std::string n = b->name ();
862 replace_all (n, "_", " ");
864 citems.push_back (CheckMenuElem (n, sigc::bind (sigc::mem_fun(*this, &MixerStrip::bundle_input_toggled), b)));
866 if (std::find (current.begin(), current.end(), b) != current.end()) {
867 ignore_toggle = true;
868 dynamic_cast<CheckMenuItem *> (&citems.back())->set_active (true);
869 ignore_toggle = false;
874 MixerStrip::maybe_add_bundle_to_output_menu (boost::shared_ptr<Bundle> b, ARDOUR::BundleList const & current)
876 using namespace Menu_Helpers;
878 if (b->ports_are_inputs() == false || b->nchannels() != _route->n_outputs()) {
882 list<boost::shared_ptr<Bundle> >::iterator i = output_menu_bundles.begin ();
883 while (i != output_menu_bundles.end() && b->has_same_ports (*i) == false) {
887 if (i != output_menu_bundles.end()) {
891 output_menu_bundles.push_back (b);
893 MenuList& citems = output_menu.items();
895 std::string n = b->name ();
896 replace_all (n, "_", " ");
898 citems.push_back (CheckMenuElem (n, sigc::bind (sigc::mem_fun(*this, &MixerStrip::bundle_output_toggled), b)));
900 if (std::find (current.begin(), current.end(), b) != current.end()) {
901 ignore_toggle = true;
902 dynamic_cast<CheckMenuItem *> (&citems.back())->set_active (true);
903 ignore_toggle = false;
908 MixerStrip::update_diskstream_display ()
912 if (input_selector) {
913 input_selector->hide_all ();
916 route_color_changed ();
920 show_passthru_color ();
925 MixerStrip::connect_to_pan ()
927 ENSURE_GUI_THREAD (*this, &MixerStrip::connect_to_pan)
929 panstate_connection.disconnect ();
930 panstyle_connection.disconnect ();
932 if (!_route->panner()) {
936 boost::shared_ptr<Pannable> p = _route->pannable ();
938 p->automation_state_changed.connect (panstate_connection, invalidator (*this), boost::bind (&PannerUI::pan_automation_state_changed, &panners), gui_context());
939 p->automation_style_changed.connect (panstyle_connection, invalidator (*this), boost::bind (&PannerUI::pan_automation_style_changed, &panners), gui_context());
941 panners.panshell_changed ();
946 * Output port labelling
947 * =====================
949 * Case 1: Each output has one connection, all connections are to system:playback_%i
950 * out 1 -> system:playback_1
951 * out 2 -> system:playback_2
952 * out 3 -> system:playback_3
955 * Case 2: Each output has one connection, all connections are to ardour:track_x/in 1
956 * out 1 -> ardour:track_x/in 1
957 * out 2 -> ardour:track_x/in 2
958 * Display as: track_x
960 * Case 3: Each output has one connection, all connections are to Jack client "program x"
961 * out 1 -> program x:foo
962 * out 2 -> program x:foo
963 * Display as: program x
965 * Case 4: No connections (Disconnected)
968 * Default case (unusual routing):
969 * Display as: *number of connections*
973 * .-----------------------------------------------.
975 * | out 1 -> ardour:master/in 1, jamin:input/in 1 |
976 * | out 2 -> ardour:master/in 2, jamin:input/in 2 |
977 * '-----------------------------------------------'
978 * .-----------------------------------------------.
981 * '-----------------------------------------------'
985 MixerStrip::update_io_button (boost::shared_ptr<ARDOUR::Route> route, Width width, bool for_input)
990 vector<string> port_connections;
992 uint32_t total_connection_count = 0;
993 uint32_t io_connection_count = 0;
994 uint32_t ardour_connection_count = 0;
995 uint32_t system_connection_count = 0;
996 uint32_t other_connection_count = 0;
1001 bool have_label = false;
1002 bool each_io_has_one_connection = true;
1004 string connection_name;
1005 string ardour_track_name;
1006 string other_connection_type;
1007 string system_ports;
1010 ostringstream tooltip;
1011 char * tooltip_cstr;
1013 tooltip << route->name();
1016 io_count = route->n_inputs().n_total();
1018 io_count = route->n_outputs().n_total();
1021 for (io_index = 0; io_index < io_count; ++io_index) {
1023 port = route->input()->nth (io_index);
1025 port = route->output()->nth (io_index);
1028 port_connections.clear ();
1029 port->get_connections(port_connections);
1030 io_connection_count = 0;
1032 if (!port_connections.empty()) {
1033 for (vector<string>::iterator i = port_connections.begin(); i != port_connections.end(); ++i) {
1034 string& connection_name (*i);
1036 if (io_connection_count == 0) {
1037 tooltip << endl << port->name().substr(port->name().find("/") + 1) << " -> " << connection_name;
1039 tooltip << ", " << connection_name;
1042 if (connection_name.find("ardour:") == 0) {
1043 if (ardour_track_name.empty()) {
1044 // "ardour:Master/in 1" -> "ardour:Master/"
1045 string::size_type slash = connection_name.find("/");
1046 if (slash != string::npos) {
1047 ardour_track_name = connection_name.substr(0, slash + 1);
1051 if (connection_name.find(ardour_track_name) == 0) {
1052 ++ardour_connection_count;
1054 } else if (connection_name.find("system:") == 0) {
1056 // "system:capture_123" -> "123"
1057 system_port = connection_name.substr(15);
1059 // "system:playback_123" -> "123"
1060 system_port = connection_name.substr(16);
1063 if (system_ports.empty()) {
1064 system_ports += system_port;
1066 system_ports += "/" + system_port;
1069 ++system_connection_count;
1071 if (other_connection_type.empty()) {
1072 // "jamin:in 1" -> "jamin:"
1073 other_connection_type = connection_name.substr(0, connection_name.find(":") + 1);
1076 if (connection_name.find(other_connection_type) == 0) {
1077 ++other_connection_count;
1081 ++total_connection_count;
1082 ++io_connection_count;
1086 if (io_connection_count != 1) {
1087 each_io_has_one_connection = false;
1091 if (total_connection_count == 0) {
1092 tooltip << endl << _("Disconnected");
1095 tooltip_cstr = new char[tooltip.str().size() + 1];
1096 strcpy(tooltip_cstr, tooltip.str().c_str());
1099 ARDOUR_UI::instance()->set_tip (&input_button, tooltip_cstr, "");
1101 ARDOUR_UI::instance()->set_tip (&output_button, tooltip_cstr, "");
1104 if (each_io_has_one_connection) {
1105 if ((total_connection_count == ardour_connection_count)) {
1106 // all connections are to the same track in ardour
1107 // "ardour:Master/" -> "Master"
1108 string::size_type slash = ardour_track_name.find("/");
1109 if (slash != string::npos) {
1110 label << ardour_track_name.substr(7, slash - 7);
1114 else if (total_connection_count == system_connection_count) {
1115 // all connections are to system ports
1116 label << system_ports;
1119 else if (total_connection_count == other_connection_count) {
1120 // all connections are to the same external program eg jamin
1121 // "jamin:" -> "jamin"
1122 label << other_connection_type.substr(0, other_connection_type.size() - 1);
1128 if (total_connection_count == 0) {
1132 // Odd configuration
1133 label << "*" << total_connection_count << "*";
1139 label_string = label.str().substr(0, 6);
1142 label_string = label.str().substr(0, 3);
1147 input_label.set_text (label_string);
1149 output_label.set_text (label_string);
1154 MixerStrip::update_input_display ()
1156 update_io_button (_route, _width, true);
1157 panners.setup_pan ();
1161 MixerStrip::update_output_display ()
1163 update_io_button (_route, _width, false);
1164 gpm.setup_meters ();
1165 panners.setup_pan ();
1169 MixerStrip::fast_update ()
1171 gpm.update_meters ();
1175 MixerStrip::diskstream_changed ()
1177 Gtkmm2ext::UI::instance()->call_slot (invalidator (*this), boost::bind (&MixerStrip::update_diskstream_display, this));
1181 MixerStrip::port_connected_or_disconnected (Port* a, Port* b)
1183 if (_route->input()->has_port (a) || _route->input()->has_port (b)) {
1184 update_input_display ();
1185 set_width_enum (_width, this);
1188 if (_route->output()->has_port (a) || _route->output()->has_port (b)) {
1189 update_output_display ();
1190 set_width_enum (_width, this);
1195 MixerStrip::comment_editor_done_editing ()
1197 ignore_toggle = true;
1198 _comment_menu_item->set_active (false);
1199 ignore_toggle = false;
1201 string const str = comment_area->get_buffer()->get_text();
1202 if (str == _route->comment ()) {
1206 _route->set_comment (str, this);
1210 MixerStrip::toggle_comment ()
1212 if (ignore_toggle) {
1216 if (comment_window == 0) {
1217 setup_comment_editor ();
1220 if (comment_window->is_visible ()) {
1221 comment_window->hide ();
1226 title = _route->name();
1227 title += _(": comment editor");
1229 comment_window->set_title (title);
1230 comment_window->present();
1234 MixerStrip::setup_comment_editor ()
1236 comment_window = new ArdourDialog ("", false); // title will be reset to show route
1237 comment_window->set_position (Gtk::WIN_POS_MOUSE);
1238 comment_window->set_skip_taskbar_hint (true);
1239 comment_window->signal_hide().connect (sigc::mem_fun(*this, &MixerStrip::comment_editor_done_editing));
1240 comment_window->set_default_size (400, 200);
1242 comment_area = manage (new TextView());
1243 comment_area->set_name ("MixerTrackCommentArea");
1244 comment_area->set_wrap_mode (WRAP_WORD);
1245 comment_area->set_editable (true);
1246 comment_area->get_buffer()->set_text (_route->comment());
1247 comment_area->show ();
1249 comment_window->get_vbox()->pack_start (*comment_area);
1250 comment_window->get_action_area()->hide();
1254 MixerStrip::comment_changed (void *src)
1256 ENSURE_GUI_THREAD (*this, &MixerStrip::comment_changed, src)
1259 ignore_comment_edit = true;
1261 comment_area->get_buffer()->set_text (_route->comment());
1263 ignore_comment_edit = false;
1268 MixerStrip::select_route_group (GdkEventButton *ev)
1270 using namespace Menu_Helpers;
1272 if (ev->button == 1) {
1274 if (group_menu == 0) {
1276 PropertyList* plist = new PropertyList();
1278 plist->add (Properties::gain, true);
1279 plist->add (Properties::mute, true);
1280 plist->add (Properties::solo, true);
1282 group_menu = new RouteGroupMenu (_session, plist);
1286 r.push_back (route ());
1287 group_menu->build (r);
1288 group_menu->menu()->popup (1, ev->time);
1295 MixerStrip::route_group_changed ()
1297 ENSURE_GUI_THREAD (*this, &MixerStrip::route_group_changed)
1299 RouteGroup *rg = _route->route_group();
1302 group_label.set_text (PBD::short_version (rg->name(), 5));
1306 group_label.set_text (_("Grp"));
1309 group_label.set_text (_("~G"));
1316 MixerStrip::route_color_changed ()
1318 name_button.modify_bg (STATE_NORMAL, color());
1319 top_event_box.modify_bg (STATE_NORMAL, color());
1320 reset_strip_style ();
1324 MixerStrip::show_passthru_color ()
1326 reset_strip_style ();
1330 MixerStrip::build_route_ops_menu ()
1332 using namespace Menu_Helpers;
1333 route_ops_menu = new Menu;
1334 route_ops_menu->set_name ("ArdourContextMenu");
1336 MenuList& items = route_ops_menu->items();
1338 items.push_back (CheckMenuElem (_("Comments..."), sigc::mem_fun (*this, &MixerStrip::toggle_comment)));
1339 _comment_menu_item = dynamic_cast<CheckMenuItem*> (&items.back ());
1340 items.push_back (MenuElem (_("Save As Template..."), sigc::mem_fun(*this, &RouteUI::save_as_template)));
1341 items.push_back (MenuElem (_("Rename..."), sigc::mem_fun(*this, &RouteUI::route_rename)));
1342 rename_menu_item = &items.back();
1343 items.push_back (SeparatorElem());
1344 items.push_back (CheckMenuElem (_("Active")));
1345 CheckMenuItem* i = dynamic_cast<CheckMenuItem *> (&items.back());
1346 i->set_active (_route->active());
1347 i->signal_activate().connect (sigc::bind (sigc::mem_fun (*this, &RouteUI::set_route_active), !_route->active(), false));
1349 items.push_back (SeparatorElem());
1351 items.push_back (MenuElem (_("Adjust Latency..."), sigc::mem_fun (*this, &RouteUI::adjust_latency)));
1353 items.push_back (SeparatorElem());
1354 items.push_back (CheckMenuElem (_("Protect Against Denormals"), sigc::mem_fun (*this, &RouteUI::toggle_denormal_protection)));
1355 denormal_menu_item = dynamic_cast<CheckMenuItem *> (&items.back());
1356 denormal_menu_item->set_active (_route->denormal_protection());
1358 if (!Profile->get_sae()) {
1359 items.push_back (SeparatorElem());
1360 items.push_back (MenuElem (_("Remote Control ID..."), sigc::mem_fun (*this, &RouteUI::open_remote_control_id_dialog)));
1363 items.push_back (SeparatorElem());
1364 items.push_back (MenuElem (_("Remove"), sigc::bind (sigc::mem_fun(*this, &RouteUI::remove_this_route), false)));
1368 MixerStrip::name_button_button_press (GdkEventButton* ev)
1370 if (ev->button == 3) {
1371 list_route_operations ();
1373 /* do not allow rename if the track is record-enabled */
1374 rename_menu_item->set_sensitive (!_route->record_enabled());
1375 route_ops_menu->popup (1, ev->time);
1377 } else if (ev->button == 1) {
1378 revert_to_default_display ();
1385 MixerStrip::list_route_operations ()
1387 delete route_ops_menu;
1388 build_route_ops_menu ();
1392 MixerStrip::set_selected (bool yn)
1394 AxisView::set_selected (yn);
1396 global_frame.set_shadow_type (Gtk::SHADOW_ETCHED_OUT);
1397 global_frame.set_name ("MixerStripSelectedFrame");
1399 global_frame.set_shadow_type (Gtk::SHADOW_IN);
1400 global_frame.set_name ("MixerStripFrame");
1402 global_frame.queue_draw ();
1406 MixerStrip::name_changed ()
1410 RouteUI::property_changed (PropertyChange (ARDOUR::Properties::name));
1413 name_label.set_text (PBD::short_version (_route->name(), 5));
1419 MixerStrip::width_clicked ()
1423 set_width_enum (Narrow, this);
1426 set_width_enum (Wide, this);
1432 MixerStrip::hide_clicked ()
1434 // LAME fix to reset the button status for when it is redisplayed (part 1)
1435 hide_button.set_sensitive(false);
1438 Hiding(); /* EMIT_SIGNAL */
1440 _mixer.hide_strip (this);
1444 hide_button.set_sensitive(true);
1448 MixerStrip::set_embedded (bool yn)
1454 MixerStrip::map_frozen ()
1456 ENSURE_GUI_THREAD (*this, &MixerStrip::map_frozen)
1458 boost::shared_ptr<AudioTrack> at = audio_track();
1461 switch (at->freeze_state()) {
1462 case AudioTrack::Frozen:
1463 processor_box.set_sensitive (false);
1464 hide_redirect_editors ();
1467 processor_box.set_sensitive (true);
1468 // XXX need some way, maybe, to retoggle redirect editors
1475 MixerStrip::hide_redirect_editors ()
1477 _route->foreach_processor (sigc::mem_fun (*this, &MixerStrip::hide_processor_editor));
1481 MixerStrip::hide_processor_editor (boost::weak_ptr<Processor> p)
1483 boost::shared_ptr<Processor> processor (p.lock ());
1488 Gtk::Window* w = processor_box.get_processor_ui (processor);
1496 MixerStrip::reset_strip_style ()
1498 if (_current_delivery && boost::dynamic_pointer_cast<Send>(_current_delivery)) {
1500 gpm.set_fader_name ("SendStripBase");
1504 if (is_midi_track()) {
1505 if (_route->active()) {
1506 set_name ("MidiTrackStripBase");
1507 gpm.set_meter_strip_name ("MidiTrackMetrics");
1509 set_name ("MidiTrackStripBaseInactive");
1510 gpm.set_meter_strip_name ("MidiTrackMetricsInactive");
1512 gpm.set_fader_name ("MidiTrackFader");
1513 } else if (is_audio_track()) {
1514 if (_route->active()) {
1515 set_name ("AudioTrackStripBase");
1516 gpm.set_meter_strip_name ("AudioTrackMetrics");
1518 set_name ("AudioTrackStripBaseInactive");
1519 gpm.set_meter_strip_name ("AudioTrackMetricsInactive");
1521 gpm.set_fader_name ("AudioTrackFader");
1523 if (_route->active()) {
1524 set_name ("AudioBusStripBase");
1525 gpm.set_meter_strip_name ("AudioBusMetrics");
1527 set_name ("AudioBusStripBaseInactive");
1528 gpm.set_meter_strip_name ("AudioBusMetricsInactive");
1530 gpm.set_fader_name ("AudioBusFader");
1532 /* (no MIDI busses yet) */
1538 MixerStrip::route_group() const
1540 return _route->route_group();
1544 MixerStrip::engine_stopped ()
1549 MixerStrip::engine_running ()
1554 MixerStrip::meter_point_string (MeterPoint mp)
1565 case MeterPostFader:
1580 /** Called when the metering point has changed */
1582 MixerStrip::meter_changed ()
1584 meter_point_label.set_text (meter_point_string (_route->meter_point()));
1585 gpm.setup_meters ();
1586 // reset peak when meter point changes
1587 gpm.reset_peak_display();
1591 MixerStrip::switch_io (boost::shared_ptr<Route> target)
1593 /* don't respond to switch IO signal outside of the mixer window */
1595 if (!_mixer_owned) {
1599 if (_route == target || _route->is_master()) {
1600 /* don't change the display for the target or the master bus */
1602 } else if (!is_track() && show_sends_button) {
1603 /* make sure our show sends button is inactive, and we no longer blink,
1604 since we're not the target.
1606 send_blink_connection.disconnect ();
1607 show_sends_button->set_active (false);
1608 show_sends_button->set_state (STATE_NORMAL);
1612 /* switch back to default */
1613 revert_to_default_display ();
1617 boost::shared_ptr<Send> send = _route->internal_send_for (target);
1622 revert_to_default_display ();
1627 MixerStrip::drop_send ()
1629 boost::shared_ptr<Send> current_send;
1631 if (_current_delivery && (current_send = boost::dynamic_pointer_cast<Send>(_current_delivery))) {
1632 current_send->set_metering (false);
1635 send_gone_connection.disconnect ();
1636 input_button.set_sensitive (true);
1637 output_button.set_sensitive (true);
1638 group_button.set_sensitive (true);
1639 set_invert_sensitive (true);
1640 meter_point_button.set_sensitive (true);
1641 mute_button->set_sensitive (true);
1642 solo_button->set_sensitive (true);
1643 rec_enable_button->set_sensitive (true);
1644 solo_isolated_led->set_sensitive (true);
1645 solo_safe_led->set_sensitive (true);
1649 MixerStrip::set_current_delivery (boost::shared_ptr<Delivery> d)
1651 _current_delivery = d;
1652 DeliveryChanged (_current_delivery);
1656 MixerStrip::show_send (boost::shared_ptr<Send> send)
1662 set_current_delivery (send);
1664 send->set_metering (true);
1665 _current_delivery->DropReferences.connect (send_gone_connection, invalidator (*this), boost::bind (&MixerStrip::revert_to_default_display, this), gui_context());
1667 gain_meter().set_controls (_route, send->meter(), send->amp());
1668 gain_meter().setup_meters ();
1670 panner_ui().set_panner (_current_delivery->panner_shell(), _current_delivery->panner());
1671 panner_ui().setup_pan ();
1673 input_button.set_sensitive (false);
1674 group_button.set_sensitive (false);
1675 set_invert_sensitive (false);
1676 meter_point_button.set_sensitive (false);
1677 mute_button->set_sensitive (false);
1678 solo_button->set_sensitive (false);
1679 rec_enable_button->set_sensitive (false);
1680 solo_isolated_led->set_sensitive (false);
1681 solo_safe_led->set_sensitive (false);
1683 if (boost::dynamic_pointer_cast<InternalSend>(send)) {
1684 output_button.set_sensitive (false);
1687 reset_strip_style ();
1691 MixerStrip::revert_to_default_display ()
1693 if (show_sends_button) {
1694 show_sends_button->set_active (false);
1699 set_current_delivery (_route->main_outs ());
1701 gain_meter().set_controls (_route, _route->shared_peak_meter(), _route->amp());
1702 gain_meter().setup_meters ();
1704 panner_ui().set_panner (_route->main_outs()->panner_shell(), _route->main_outs()->panner());
1705 panner_ui().setup_pan ();
1707 reset_strip_style ();
1711 MixerStrip::set_button_names ()
1715 rec_enable_button_label.set_text (_("Rec"));
1716 mute_button_label.set_text (_("Mute"));
1717 if (_route && _route->solo_safe()) {
1718 solo_button_label.set_text (X_("!"));
1720 if (!Config->get_solo_control_is_listen_control()) {
1721 solo_button_label.set_text (_("Solo"));
1723 switch (Config->get_listen_position()) {
1724 case AfterFaderListen:
1725 solo_button_label.set_text (_("AFL"));
1727 case PreFaderListen:
1728 solo_button_label.set_text (_("PFL"));
1736 rec_enable_button_label.set_text (_("R"));
1737 mute_button_label.set_text (_("M"));
1738 if (_route && _route->solo_safe()) {
1739 solo_button_label.set_text (X_("!"));
1740 if (!Config->get_solo_control_is_listen_control()) {
1741 solo_button_label.set_text (_("S"));
1743 switch (Config->get_listen_position()) {
1744 case AfterFaderListen:
1745 solo_button_label.set_text (_("A"));
1747 case PreFaderListen:
1748 solo_button_label.set_text (_("P"));
1759 MixerStrip::on_key_press_event (GdkEventKey* ev)
1761 GdkEventButton fake;
1762 fake.type = GDK_BUTTON_PRESS;
1764 fake.state = ev->state;
1766 switch (ev->keyval) {
1778 rec_enable_press (&fake);
1783 show_sends_press (&fake);
1788 if (ev->state & Keyboard::PrimaryModifier) {
1798 _route->set_gain (1.0, this);
1811 MixerStrip::on_key_release_event (GdkEventKey* ev)
1813 GdkEventButton fake;
1814 fake.type = GDK_BUTTON_RELEASE;
1816 fake.state = ev->state;
1818 switch (ev->keyval) {
1820 mute_release (&fake);
1825 solo_release (&fake);
1830 rec_enable_release (&fake);
1835 show_sends_release (&fake);
1851 MixerStrip::on_enter_notify_event (GdkEventCrossing*)
1853 Keyboard::magic_widget_grab_focus ();
1858 MixerStrip::on_leave_notify_event (GdkEventCrossing* ev)
1860 switch (ev->detail) {
1861 case GDK_NOTIFY_INFERIOR:
1864 Keyboard::magic_widget_drop_focus ();
1871 MixerStrip::plugin_selector()
1873 return _mixer.plugin_selector();
1877 MixerStrip::hide_things ()
1879 processor_box.hide_things ();
1883 MixerStrip::input_active_button_press (GdkEventButton* ev)
1885 /* nothing happens on press */
1890 MixerStrip::input_active_button_release (GdkEventButton* ev)
1892 boost::shared_ptr<MidiTrack> mt = midi_track ();
1898 if (mt->input_active()) {
1899 if (Keyboard::modifier_state_contains (ev->state, Keyboard::ModifierMask (Keyboard::PrimaryModifier|Keyboard::SecondaryModifier))) {
1900 /* turn all other tracks using this input off */
1901 _session->set_exclusive_input_active (mt, false);
1903 mt->set_input_active (false);
1907 if (Keyboard::modifier_state_contains (ev->state, Keyboard::ModifierMask (Keyboard::PrimaryModifier|Keyboard::SecondaryModifier))) {
1908 /* turn all other tracks using this input on */
1909 _session->set_exclusive_input_active (mt, true);
1911 mt->set_input_active (true);
1919 MixerStrip::midi_input_status_changed ()
1921 if (midi_input_enable_button) {
1922 boost::shared_ptr<MidiTrack> mt = midi_track ();
1924 midi_input_enable_button->set_active (mt->input_active ());
1929 MixerStrip::state_id () const
1931 return string_compose ("strip %1", _route->id().to_s());