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/stop_signal.h>
32 #include <gtkmm2ext/doi.h>
33 #include <gtkmm2ext/slider_controller.h>
34 #include <gtkmm2ext/bindable_button.h>
36 #include "ardour/ardour.h"
37 #include "ardour/amp.h"
38 #include "ardour/session.h"
39 #include "ardour/audioengine.h"
40 #include "ardour/internal_send.h"
41 #include "ardour/route.h"
42 #include "ardour/route_group.h"
43 #include "ardour/audio_track.h"
44 #include "ardour/panner.h"
45 #include "ardour/send.h"
46 #include "ardour/processor.h"
47 #include "ardour/profile.h"
48 #include "ardour/ladspa_plugin.h"
49 #include "ardour/user_bundle.h"
50 #include "ardour/port.h"
52 #include "ardour_ui.h"
53 #include "ardour_dialog.h"
54 #include "mixer_strip.h"
58 #include "public_editor.h"
60 #include "io_selector.h"
62 #include "gui_thread.h"
63 #include "route_group_menu.h"
67 using namespace ARDOUR;
70 using namespace Gtkmm2ext;
73 sigc::signal<void,boost::shared_ptr<Route> > MixerStrip::SwitchIO;
75 int MixerStrip::scrollbar_height = 0;
76 PBD::Signal1<void,MixerStrip*> MixerStrip::CatchDeletion;
78 MixerStrip::MixerStrip (Mixer_UI& mx, Session* sess, bool in_mixer)
82 , _mixer_owned (in_mixer)
83 , processor_box (sess, boost::bind (&MixerStrip::plugin_selector, this), mx.selection(), this, in_mixer)
86 , _mono_button (_("Mono"))
88 , solo_led_table (2, 2)
89 , middle_button_table (1, 2)
90 , bottom_button_table (1, 2)
91 , meter_point_label (_("pre"))
92 , comment_button (_("Comments"))
97 /* the editor mixer strip: don't destroy it every time
98 the underlying route goes away.
101 self_destruct = false;
105 MixerStrip::MixerStrip (Mixer_UI& mx, Session* sess, boost::shared_ptr<Route> rt, bool in_mixer)
109 , _mixer_owned (in_mixer)
110 , processor_box (sess, sigc::mem_fun(*this, &MixerStrip::plugin_selector), mx.selection(), this, in_mixer)
113 , button_table (3, 2)
114 , middle_button_table (1, 2)
115 , bottom_button_table (1, 2)
116 , meter_point_label (_("pre"))
117 , comment_button (_("Comments"))
129 _marked_for_display = false;
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");
159 Gtkmm2ext::set_size_request_to_display_given_text (input_button, longest_label.c_str(), 4, 4);
161 output_label.set_text (_("Output"));
162 ARDOUR_UI::instance()->set_tip (&output_button, _("Button 1 to choose outputs from a port matrix, button 3 to select inputs from a menu"), "");
163 output_button.add (output_label);
164 output_button.set_name ("MixerIOButton");
165 output_label.set_name ("MixerIOButtonLabel");
166 Gtkmm2ext::set_size_request_to_display_given_text (output_button, longest_label.c_str(), 4, 4);
168 ARDOUR_UI::instance()->set_tip (&meter_point_button, _("Select metering point"), "");
169 meter_point_button.add (meter_point_label);
170 meter_point_button.set_name ("MixerStripMeterPreButton");
171 meter_point_label.set_name ("MixerStripMeterPreButton");
173 /* TRANSLATORS: this string should be longest of the strings
174 used to describe meter points. In english, it's "input".
176 set_size_request_to_display_given_text (meter_point_button, _("tupni"), 5, 5);
178 bottom_button_table.attach (meter_point_button, 1, 2, 0, 1);
180 meter_point_button.signal_button_press_event().connect (sigc::mem_fun (gpm, &GainMeter::meter_press), false);
181 meter_point_button.signal_button_release_event().connect (sigc::mem_fun (gpm, &GainMeter::meter_release), false);
183 hide_button.set_events (hide_button.get_events() & ~(Gdk::ENTER_NOTIFY_MASK|Gdk::LEAVE_NOTIFY_MASK));
185 mute_button->set_name ("MixerMuteButton");
186 solo_button->set_name ("MixerSoloButton");
187 invert_button->set_name ("MixerInvertButton");
189 solo_isolated_led = manage (new LED);
190 solo_isolated_led->show ();
191 solo_isolated_led->set_diameter (6);
192 solo_isolated_led->set_no_show_all (true);
193 solo_isolated_led->set_name (X_("SoloIsolatedLED"));
194 solo_isolated_led->add_events (Gdk::BUTTON_PRESS_MASK|Gdk::BUTTON_RELEASE_MASK);
195 solo_isolated_led->signal_button_release_event().connect (sigc::mem_fun (*this, &RouteUI::solo_isolate_button_release));
196 UI::instance()->set_tip (solo_isolated_led, _("Isolate Solo"), "");
198 solo_safe_led = manage (new LED);
199 solo_safe_led->show ();
200 solo_safe_led->set_diameter (6);
201 solo_safe_led->set_no_show_all (true);
202 solo_safe_led->set_name (X_("SoloSafeLED"));
203 solo_safe_led->add_events (Gdk::BUTTON_PRESS_MASK|Gdk::BUTTON_RELEASE_MASK);
204 solo_safe_led->signal_button_release_event().connect (sigc::mem_fun (*this, &RouteUI::solo_safe_button_release));
205 UI::instance()->set_tip (solo_safe_led, _("Lock Solo Status"), "");
207 Label* iso_label = manage (new Label (_("iso")));
208 Label* safe_label = manage (new Label (_("lock")));
210 iso_label->set_name (X_("SoloLEDLabel"));
211 safe_label->set_name (X_("SoloLEDLabel"));
216 solo_led_table.set_spacings (0);
217 solo_led_table.set_border_width (1);
218 solo_led_table.attach (*iso_label, 0, 1, 0, 1, Gtk::FILL, Gtk::FILL);
219 solo_led_table.attach (*solo_isolated_led, 1, 2, 0, 1, Gtk::FILL, Gtk::FILL);
220 solo_led_table.attach (*safe_label, 0, 1, 1, 2, Gtk::FILL, Gtk::FILL);
221 solo_led_table.attach (*solo_safe_led, 1, 2, 1, 2, Gtk::FILL, Gtk::FILL);
223 solo_led_table.show ();
224 solo_led_box.pack_end (solo_led_table, false, false);
225 solo_led_box.show ();
227 button_table.set_homogeneous (true);
228 button_table.set_spacings (0);
230 button_table.attach (name_button, 0, 2, 0, 1);
231 button_table.attach (input_button, 0, 2, 1, 2);
232 button_table.attach (*invert_button, 0, 2, 3, 4);
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 comment_button.set_name ("MixerCommentButton");
256 comment_button.signal_clicked().connect (sigc::mem_fun(*this, &MixerStrip::comment_button_clicked));
258 global_vpacker.set_border_width (0);
259 global_vpacker.set_spacing (0);
261 width_button.set_name ("MixerWidthButton");
262 hide_button.set_name ("MixerHideButton");
263 top_event_box.set_name ("MixerTopEventBox");
265 width_button.signal_clicked().connect (sigc::mem_fun(*this, &MixerStrip::width_clicked));
266 hide_button.signal_clicked().connect (sigc::mem_fun(*this, &MixerStrip::hide_clicked));
268 width_hide_box.pack_start (width_button, false, true);
269 width_hide_box.pack_start (top_event_box, true, true);
270 width_hide_box.pack_end (hide_button, false, true);
271 gain_meter_alignment.set_padding(0, 4, 0, 0);
272 gain_meter_alignment.add(gpm);
274 whvbox.pack_start (width_hide_box, true, true);
276 global_vpacker.pack_start (whvbox, Gtk::PACK_SHRINK);
277 global_vpacker.pack_start (button_table,Gtk::PACK_SHRINK);
278 global_vpacker.pack_start (processor_box, true, true);
279 global_vpacker.pack_start (solo_led_box,Gtk::PACK_SHRINK);
280 global_vpacker.pack_start (middle_button_table,Gtk::PACK_SHRINK);
281 global_vpacker.pack_start (gain_meter_alignment,Gtk::PACK_SHRINK);
282 global_vpacker.pack_start (bottom_button_table,Gtk::PACK_SHRINK);
283 if (!is_midi_track()) {
284 global_vpacker.pack_start (panners, Gtk::PACK_SHRINK);
286 global_vpacker.pack_start (_mono_button, Gtk::PACK_SHRINK);
287 global_vpacker.pack_start (output_button, Gtk::PACK_SHRINK);
288 global_vpacker.pack_start (comment_button, Gtk::PACK_SHRINK);
290 global_frame.add (global_vpacker);
291 global_frame.set_shadow_type (Gtk::SHADOW_IN);
292 global_frame.set_name ("BaseFrame");
296 /* force setting of visible selected status */
299 set_selected (false);
304 _session->engine().Stopped.connect (*this, invalidator (*this), boost::bind (&MixerStrip::engine_stopped, this), gui_context());
305 _session->engine().Running.connect (*this, invalidator (*this), boost::bind (&MixerStrip::engine_running, this), gui_context());
307 input_button.signal_button_press_event().connect (sigc::mem_fun(*this, &MixerStrip::input_press), false);
308 output_button.signal_button_press_event().connect (sigc::mem_fun(*this, &MixerStrip::output_press), false);
310 /* we don't need this if its not an audio track, but we don't know that yet and it doesn't
314 rec_enable_button->set_name ("MixerRecordEnableButton");
316 /* ditto for this button and busses */
318 name_button.signal_button_press_event().connect (sigc::mem_fun(*this, &MixerStrip::name_button_button_press), false);
319 group_button.signal_button_press_event().connect (sigc::mem_fun(*this, &MixerStrip::select_route_group), false);
323 /* start off as a passthru strip. we'll correct this, if necessary,
324 in update_diskstream_display().
327 /* start off as a passthru strip. we'll correct this, if necessary,
328 in update_diskstream_display().
332 set_name ("MidiTrackStripBase");
334 set_name ("AudioTrackStripBase");
336 add_events (Gdk::BUTTON_RELEASE_MASK|
337 Gdk::ENTER_NOTIFY_MASK|
338 Gdk::LEAVE_NOTIFY_MASK|
340 Gdk::KEY_RELEASE_MASK);
342 set_flags (get_flags() | Gtk::CAN_FOCUS);
344 SwitchIO.connect (sigc::mem_fun (*this, &MixerStrip::switch_io));
347 MixerStrip::~MixerStrip ()
349 CatchDeletion (this);
351 delete input_selector;
352 delete output_selector;
353 delete comment_window;
357 MixerStrip::set_route (boost::shared_ptr<Route> rt)
359 if (rec_enable_button->get_parent()) {
360 button_table.remove (*rec_enable_button);
363 if (show_sends_button->get_parent()) {
364 button_table.remove (*show_sends_button);
367 RouteUI::set_route (rt);
369 /* map the current state */
372 update_solo_display ();
374 delete input_selector;
377 delete output_selector;
380 revert_to_default_display ();
382 processor_box.set_route (rt);
384 if (set_color_from_route()) {
385 set_color (unique_random_color());
388 if (route()->is_master()) {
389 solo_button->hide ();
390 solo_led_box.hide ();
392 solo_button->show ();
393 solo_led_box.show ();
396 if (_mixer_owned && (route()->is_master() || route()->is_monitor())) {
398 if (scrollbar_height == 0) {
399 HScrollbar scrollbar;
400 Gtk::Requisition requisition(scrollbar.size_request ());
401 scrollbar_height = requisition.height;
404 spacer = manage (new EventBox);
405 spacer->set_size_request (-1, scrollbar_height);
406 global_vpacker.pack_start (*spacer, false, false);
409 if (is_audio_track()) {
410 boost::shared_ptr<AudioTrack> at = audio_track();
411 at->FreezeChange.connect (route_connections, invalidator (*this), boost::bind (&MixerStrip::map_frozen, this), gui_context());
416 button_table.attach (*rec_enable_button, 0, 2, 2, 3);
417 rec_enable_button->set_sensitive (_session->writable());
418 rec_enable_button->show();
424 if (!_route->is_master()) {
425 button_table.attach (*show_sends_button, 0, 2, 2, 3);
426 show_sends_button->show();
430 invert_button->set_active (_route->phase_invert ());
432 _mono_button.set_name ("MixerMonoButton");
433 _mono_button.signal_clicked().connect (sigc::mem_fun (*this, &MixerStrip::mono_button_clicked));
435 switch (_route->meter_point()) {
437 meter_point_label.set_text (_("input"));
441 meter_point_label.set_text (_("pre"));
445 meter_point_label.set_text (_("post"));
449 meter_point_label.set_text (_("custom"));
453 delete route_ops_menu;
456 ARDOUR_UI::instance()->set_tip (comment_button, _route->comment().empty() ?
457 _("Click to Add/Edit Comments"):
460 _route->meter_change.connect (route_connections, invalidator (*this), bind (&MixerStrip::meter_changed, this), gui_context());
461 _route->input()->changed.connect (route_connections, invalidator (*this), ui_bind (&MixerStrip::input_changed, this, _1, _2), gui_context());
462 _route->output()->changed.connect (route_connections, invalidator (*this), ui_bind (&MixerStrip::output_changed, this, _1, _2), gui_context());
463 _route->route_group_changed.connect (route_connections, invalidator (*this), boost::bind (&MixerStrip::route_group_changed, this), gui_context());
465 if (_route->panner()) {
466 _route->panner()->Changed.connect (route_connections, invalidator (*this), boost::bind (&MixerStrip::connect_to_pan, this), gui_context());
469 if (is_audio_track()) {
470 audio_track()->DiskstreamChanged.connect (route_connections, invalidator (*this), boost::bind (&MixerStrip::diskstream_changed, this), gui_context());
473 _route->comment_changed.connect (route_connections, invalidator (*this), ui_bind (&MixerStrip::comment_changed, this, _1), gui_context());
474 _route->gui_changed.connect (route_connections, invalidator (*this), ui_bind (&MixerStrip::route_gui_changed, this, _1, _2), gui_context());
476 set_stuff_from_route ();
478 /* now force an update of all the various elements */
481 update_solo_display ();
484 route_group_changed ();
488 panners.setup_pan ();
490 update_diskstream_display ();
491 update_input_display ();
492 update_output_display ();
494 add_events (Gdk::BUTTON_RELEASE_MASK);
496 processor_box.show();
498 if (!route()->is_master() && !route()->is_monitor()) {
499 /* we don't allow master or control routes to be hidden */
504 width_hide_box.show();
507 global_vpacker.show();
509 middle_button_table.show();
510 bottom_button_table.show();
511 processor_box.show_all ();
514 gain_meter_alignment.show ();
515 gain_unit_button.show();
516 gain_unit_label.show();
517 meter_point_button.show();
518 meter_point_label.show();
519 diskstream_button.show();
520 diskstream_label.show();
523 output_button.show();
527 comment_button.show();
535 MixerStrip::set_stuff_from_route ()
541 /* if width is not set, it will be set by the MixerUI or editor */
543 if ((prop = xml_node->property ("strip-width")) != 0) {
544 set_width_enum (Width (string_2_enum (prop->value(), _width)), this);
547 if ((prop = xml_node->property ("shown-mixer")) != 0) {
548 if (prop->value() == "no") {
549 _marked_for_display = false;
551 _marked_for_display = true;
554 /* backwards compatibility */
555 _marked_for_display = true;
560 MixerStrip::set_width_enum (Width w, void* owner)
562 /* always set the gpm width again, things may be hidden */
565 panners.set_width (w);
567 boost::shared_ptr<AutomationList> gain_automation = _route->gain_control()->alist();
569 _width_owner = owner;
575 if (_width_owner == this) {
576 xml_node->add_property ("strip-width", enum_2_string (_width));
583 if (show_sends_button) {
584 ((Gtk::Label*)show_sends_button->get_child())->set_text (_("Sends"));
587 if (_route->comment() == "") {
588 comment_button.unset_bg (STATE_NORMAL);
589 ((Gtk::Label*)comment_button.get_child())->set_text (_("Comments"));
591 comment_button.modify_bg (STATE_NORMAL, color());
592 ((Gtk::Label*)comment_button.get_child())->set_text (_("*Comments*"));
595 ((Gtk::Label*)gpm.gain_automation_style_button.get_child())->set_text (
596 gpm.astyle_string(gain_automation->automation_style()));
597 ((Gtk::Label*)gpm.gain_automation_state_button.get_child())->set_text (
598 gpm.astate_string(gain_automation->automation_state()));
600 if (_route->panner()) {
601 ((Gtk::Label*)panners.pan_automation_style_button.get_child())->set_text (
602 panners.astyle_string(_route->panner()->automation_style()));
603 ((Gtk::Label*)panners.pan_automation_state_button.get_child())->set_text (
604 panners.astate_string(_route->panner()->automation_state()));
607 Gtkmm2ext::set_size_request_to_display_given_text (name_button, "long", 2, 2);
608 set_size_request (-1, -1);
612 if (show_sends_button) {
613 ((Gtk::Label*)show_sends_button->get_child())->set_text (_("Snd"));
616 if (_route->comment() == "") {
617 comment_button.unset_bg (STATE_NORMAL);
618 ((Gtk::Label*)comment_button.get_child())->set_text (_("Cmt"));
620 comment_button.modify_bg (STATE_NORMAL, color());
621 ((Gtk::Label*)comment_button.get_child())->set_text (_("*Cmt*"));
624 ((Gtk::Label*)gpm.gain_automation_style_button.get_child())->set_text (
625 gpm.short_astyle_string(gain_automation->automation_style()));
626 ((Gtk::Label*)gpm.gain_automation_state_button.get_child())->set_text (
627 gpm.short_astate_string(gain_automation->automation_state()));
629 if (_route->panner()) {
630 ((Gtk::Label*)panners.pan_automation_style_button.get_child())->set_text (
631 panners.short_astyle_string(_route->panner()->automation_style()));
632 ((Gtk::Label*)panners.pan_automation_state_button.get_child())->set_text (
633 panners.short_astate_string(_route->panner()->automation_state()));
636 Gtkmm2ext::set_size_request_to_display_given_text (name_button, longest_label.c_str(), 2, 2);
637 set_size_request (max (50, gpm.get_gm_width()), -1);
641 processor_box.set_width (w);
643 update_input_display ();
644 update_output_display ();
645 route_group_changed ();
651 MixerStrip::set_packed (bool yn)
658 xml_node->add_property ("shown-mixer", "yes");
660 xml_node->add_property ("shown-mixer", "no");
666 MixerStrip::output_press (GdkEventButton *ev)
668 using namespace Menu_Helpers;
669 if (!_session->engine().connected()) {
670 MessageDialog msg (_("Not connected to JACK - no I/O changes are possible"));
675 MenuList& citems = output_menu.items();
676 switch (ev->button) {
679 edit_output_configuration ();
684 output_menu.set_name ("ArdourContextMenu");
686 output_menu_bundles.clear ();
688 citems.push_back (MenuElem (_("Disconnect"), sigc::mem_fun (*(static_cast<RouteUI*>(this)), &RouteUI::disconnect_output)));
689 citems.push_back (SeparatorElem());
691 ARDOUR::BundleList current = _route->output()->bundles_connected ();
693 boost::shared_ptr<ARDOUR::BundleList> b = _session->bundles ();
695 /* give user bundles first chance at being in the menu */
697 for (ARDOUR::BundleList::iterator i = b->begin(); i != b->end(); ++i) {
698 if (boost::dynamic_pointer_cast<UserBundle> (*i)) {
699 maybe_add_bundle_to_output_menu (*i, current);
703 for (ARDOUR::BundleList::iterator i = b->begin(); i != b->end(); ++i) {
704 if (boost::dynamic_pointer_cast<UserBundle> (*i) == 0) {
705 maybe_add_bundle_to_output_menu (*i, current);
709 boost::shared_ptr<ARDOUR::RouteList> routes = _session->get_routes ();
710 for (ARDOUR::RouteList::const_iterator i = routes->begin(); i != routes->end(); ++i) {
711 maybe_add_bundle_to_output_menu ((*i)->input()->bundle(), current);
714 if (citems.size() == 2) {
715 /* no routes added; remove the separator */
719 output_menu.popup (1, ev->time);
730 MixerStrip::edit_output_configuration ()
732 if (output_selector == 0) {
734 boost::shared_ptr<Send> send;
735 boost::shared_ptr<IO> output;
737 if ((send = boost::dynamic_pointer_cast<Send>(_current_delivery)) != 0) {
738 if (!boost::dynamic_pointer_cast<InternalSend>(send)) {
739 output = send->output();
741 output = _route->output ();
744 output = _route->output ();
747 output_selector = new IOSelectorWindow (_session, output);
750 if (output_selector->is_visible()) {
751 output_selector->get_toplevel()->get_window()->raise();
753 output_selector->present ();
758 MixerStrip::edit_input_configuration ()
760 if (input_selector == 0) {
761 input_selector = new IOSelectorWindow (_session, _route->input());
764 if (input_selector->is_visible()) {
765 input_selector->get_toplevel()->get_window()->raise();
767 input_selector->present ();
772 MixerStrip::input_press (GdkEventButton *ev)
774 using namespace Menu_Helpers;
776 MenuList& citems = input_menu.items();
777 input_menu.set_name ("ArdourContextMenu");
780 if (!_session->engine().connected()) {
781 MessageDialog msg (_("Not connected to JACK - no I/O changes are possible"));
786 switch (ev->button) {
789 edit_input_configuration ();
794 citems.push_back (MenuElem (_("Disconnect"), sigc::mem_fun (*(static_cast<RouteUI*>(this)), &RouteUI::disconnect_input)));
795 citems.push_back (SeparatorElem());
796 input_menu_bundles.clear ();
798 ARDOUR::BundleList current = _route->input()->bundles_connected ();
800 boost::shared_ptr<ARDOUR::BundleList> b = _session->bundles ();
802 /* give user bundles first chance at being in the menu */
804 for (ARDOUR::BundleList::iterator i = b->begin(); i != b->end(); ++i) {
805 if (boost::dynamic_pointer_cast<UserBundle> (*i)) {
806 maybe_add_bundle_to_input_menu (*i, current);
810 for (ARDOUR::BundleList::iterator i = b->begin(); i != b->end(); ++i) {
811 if (boost::dynamic_pointer_cast<UserBundle> (*i) == 0) {
812 maybe_add_bundle_to_input_menu (*i, current);
816 boost::shared_ptr<ARDOUR::RouteList> routes = _session->get_routes ();
817 for (ARDOUR::RouteList::const_iterator i = routes->begin(); i != routes->end(); ++i) {
818 maybe_add_bundle_to_input_menu ((*i)->output()->bundle(), current);
821 if (citems.size() == 2) {
822 /* no routes added; remove the separator */
826 input_menu.popup (1, ev->time);
836 MixerStrip::bundle_input_toggled (boost::shared_ptr<ARDOUR::Bundle> c)
842 ARDOUR::BundleList current = _route->input()->bundles_connected ();
844 if (std::find (current.begin(), current.end(), c) == current.end()) {
845 _route->input()->connect_ports_to_bundle (c, this);
847 _route->input()->disconnect_ports_from_bundle (c, this);
852 MixerStrip::bundle_output_toggled (boost::shared_ptr<ARDOUR::Bundle> c)
858 ARDOUR::BundleList current = _route->output()->bundles_connected ();
860 if (std::find (current.begin(), current.end(), c) == current.end()) {
861 _route->output()->connect_ports_to_bundle (c, this);
863 _route->output()->disconnect_ports_from_bundle (c, this);
868 MixerStrip::maybe_add_bundle_to_input_menu (boost::shared_ptr<Bundle> b, ARDOUR::BundleList const & current)
870 using namespace Menu_Helpers;
872 if (b->ports_are_outputs() == false ||
873 route()->input()->default_type() != b->type() ||
874 b->nchannels() != _route->n_inputs().get (b->type ())) {
879 list<boost::shared_ptr<Bundle> >::iterator i = input_menu_bundles.begin ();
880 while (i != input_menu_bundles.end() && b->has_same_ports (*i) == false) {
884 if (i != input_menu_bundles.end()) {
888 input_menu_bundles.push_back (b);
890 MenuList& citems = input_menu.items();
892 std::string n = b->name ();
893 replace_all (n, "_", " ");
895 citems.push_back (CheckMenuElem (n, sigc::bind (sigc::mem_fun(*this, &MixerStrip::bundle_input_toggled), b)));
897 if (std::find (current.begin(), current.end(), b) != current.end()) {
898 ignore_toggle = true;
899 dynamic_cast<CheckMenuItem *> (&citems.back())->set_active (true);
900 ignore_toggle = false;
905 MixerStrip::maybe_add_bundle_to_output_menu (boost::shared_ptr<Bundle> b, ARDOUR::BundleList const & current)
907 using namespace Menu_Helpers;
909 if (b->ports_are_inputs() == false ||
910 route()->output()->default_type() != b->type() ||
911 b->nchannels() != _route->n_outputs().get (b->type ())) {
916 list<boost::shared_ptr<Bundle> >::iterator i = output_menu_bundles.begin ();
917 while (i != output_menu_bundles.end() && b->has_same_ports (*i) == false) {
921 if (i != output_menu_bundles.end()) {
925 output_menu_bundles.push_back (b);
927 MenuList& citems = output_menu.items();
929 std::string n = b->name ();
930 replace_all (n, "_", " ");
932 citems.push_back (CheckMenuElem (n, sigc::bind (sigc::mem_fun(*this, &MixerStrip::bundle_output_toggled), b)));
934 if (std::find (current.begin(), current.end(), b) != current.end()) {
935 ignore_toggle = true;
936 dynamic_cast<CheckMenuItem *> (&citems.back())->set_active (true);
937 ignore_toggle = false;
942 MixerStrip::update_diskstream_display ()
946 if (input_selector) {
947 input_selector->hide_all ();
954 show_passthru_color ();
959 MixerStrip::connect_to_pan ()
961 ENSURE_GUI_THREAD (*this, &MixerStrip::connect_to_pan)
963 panstate_connection.disconnect ();
964 panstyle_connection.disconnect ();
966 if (!_route->panner()) {
970 boost::shared_ptr<ARDOUR::AutomationControl> pan_control
971 = boost::dynamic_pointer_cast<ARDOUR::AutomationControl>(
972 _route->panner()->control(Evoral::Parameter(PanAutomation)));
975 pan_control->alist()->automation_state_changed.connect (panstate_connection, invalidator (*this), boost::bind (&PannerUI::pan_automation_state_changed, &panners), gui_context());
976 pan_control->alist()->automation_style_changed.connect (panstyle_connection, invalidator (*this), boost::bind (&PannerUI::pan_automation_style_changed, &panners), gui_context());
979 panners.pan_changed (this);
984 * Output port labelling
985 * =====================
987 * Case 1: Each output has one connection, all connections are to system:playback_%i
988 * out 1 -> system:playback_1
989 * out 2 -> system:playback_2
990 * out 3 -> system:playback_3
993 * Case 2: Each output has one connection, all connections are to ardour:track_x/in 1
994 * out 1 -> ardour:track_x/in 1
995 * out 2 -> ardour:track_x/in 2
996 * Display as: track_x
998 * Case 3: Each output has one connection, all connections are to Jack client "program x"
999 * out 1 -> program x:foo
1000 * out 2 -> program x:foo
1001 * Display as: program x
1003 * Case 4: No connections (Disconnected)
1006 * Default case (unusual routing):
1007 * Display as: *number of connections*
1011 * .-----------------------------------------------.
1013 * | out 1 -> ardour:master/in 1, jamin:input/in 1 |
1014 * | out 2 -> ardour:master/in 2, jamin:input/in 2 |
1015 * '-----------------------------------------------'
1016 * .-----------------------------------------------.
1019 * '-----------------------------------------------'
1023 MixerStrip::update_io_button (boost::shared_ptr<ARDOUR::Route> route, Width width, bool for_input)
1028 vector<string> port_connections;
1030 uint32_t total_connection_count = 0;
1031 uint32_t io_connection_count = 0;
1032 uint32_t ardour_connection_count = 0;
1033 uint32_t system_connection_count = 0;
1034 uint32_t other_connection_count = 0;
1036 ostringstream label;
1037 string label_string;
1040 bool have_label = false;
1041 bool each_io_has_one_connection = true;
1043 string connection_name;
1044 string ardour_track_name;
1045 string other_connection_type;
1046 string system_ports;
1049 ostringstream tooltip;
1050 char * tooltip_cstr;
1052 tooltip << route->name();
1055 io_count = route->n_inputs().n_total();
1057 io_count = route->n_outputs().n_total();
1060 for (io_index = 0; io_index < io_count; ++io_index) {
1062 port = route->input()->nth (io_index);
1064 port = route->output()->nth (io_index);
1067 port_connections.clear ();
1068 port->get_connections(port_connections);
1069 io_connection_count = 0;
1071 if (!port_connections.empty()) {
1072 for (vector<string>::iterator i = port_connections.begin(); i != port_connections.end(); ++i) {
1073 string& connection_name (*i);
1075 if (io_connection_count == 0) {
1076 tooltip << endl << port->name().substr(port->name().find("/") + 1) << " -> " << connection_name;
1078 tooltip << ", " << connection_name;
1081 if (connection_name.find("ardour:") == 0) {
1082 if (ardour_track_name.empty()) {
1083 // "ardour:Master/in 1" -> "ardour:Master/"
1084 string::size_type slash = connection_name.find("/");
1085 if (slash != string::npos) {
1086 ardour_track_name = connection_name.substr(0, slash + 1);
1090 if (connection_name.find(ardour_track_name) == 0) {
1091 ++ardour_connection_count;
1093 } else if (connection_name.find("system:") == 0) {
1095 // "system:capture_123" -> "123"
1096 system_port = connection_name.substr(15);
1098 // "system:playback_123" -> "123"
1099 system_port = connection_name.substr(16);
1102 if (system_ports.empty()) {
1103 system_ports += system_port;
1105 system_ports += "/" + system_port;
1108 ++system_connection_count;
1110 if (other_connection_type.empty()) {
1111 // "jamin:in 1" -> "jamin:"
1112 other_connection_type = connection_name.substr(0, connection_name.find(":") + 1);
1115 if (connection_name.find(other_connection_type) == 0) {
1116 ++other_connection_count;
1120 ++total_connection_count;
1121 ++io_connection_count;
1125 if (io_connection_count != 1) {
1126 each_io_has_one_connection = false;
1130 if (total_connection_count == 0) {
1131 tooltip << endl << _("Disconnected");
1134 tooltip_cstr = new char[tooltip.str().size() + 1];
1135 strcpy(tooltip_cstr, tooltip.str().c_str());
1138 ARDOUR_UI::instance()->set_tip (&input_button, tooltip_cstr, "");
1140 ARDOUR_UI::instance()->set_tip (&output_button, tooltip_cstr, "");
1143 if (each_io_has_one_connection) {
1144 if ((total_connection_count == ardour_connection_count)) {
1145 // all connections are to the same track in ardour
1146 // "ardour:Master/" -> "Master"
1147 string::size_type slash = ardour_track_name.find("/");
1148 if (slash != string::npos) {
1149 label << ardour_track_name.substr(7, slash - 7);
1153 else if (total_connection_count == system_connection_count) {
1154 // all connections are to system ports
1155 label << system_ports;
1158 else if (total_connection_count == other_connection_count) {
1159 // all connections are to the same external program eg jamin
1160 // "jamin:" -> "jamin"
1161 label << other_connection_type.substr(0, other_connection_type.size() - 1);
1167 if (total_connection_count == 0) {
1171 // Odd configuration
1172 label << "*" << total_connection_count << "*";
1178 label_string = label.str().substr(0, 6);
1181 label_string = label.str().substr(0, 3);
1185 label_cstr = new char[label_string.size() + 1];
1186 strcpy(label_cstr, label_string.c_str());
1189 input_label.set_text (label_cstr);
1191 output_label.set_text (label_cstr);
1196 MixerStrip::update_input_display ()
1198 update_io_button (_route, _width, true);
1199 panners.setup_pan ();
1203 MixerStrip::update_output_display ()
1205 update_io_button (_route, _width, false);
1206 gpm.setup_meters ();
1207 panners.setup_pan ();
1211 MixerStrip::fast_update ()
1213 gpm.update_meters ();
1217 MixerStrip::diskstream_changed ()
1219 Gtkmm2ext::UI::instance()->call_slot (invalidator (*this), boost::bind (&MixerStrip::update_diskstream_display, this));
1223 MixerStrip::input_changed (IOChange /*change*/, void */*src*/)
1225 Gtkmm2ext::UI::instance()->call_slot (invalidator (*this), boost::bind (&MixerStrip::update_input_display, this));
1226 set_width_enum (_width, this);
1230 MixerStrip::output_changed (IOChange /*change*/, void */*src*/)
1232 Gtkmm2ext::UI::instance()->call_slot (invalidator (*this), boost::bind (&MixerStrip::update_output_display, this));
1233 set_width_enum (_width, this);
1238 MixerStrip::comment_editor_done_editing()
1240 string str = comment_area->get_buffer()->get_text();
1241 if (_route->comment() != str) {
1242 _route->set_comment (str, this);
1247 if (! str.empty()) {
1248 comment_button.modify_bg (STATE_NORMAL, color());
1249 ((Gtk::Label*)comment_button.get_child())->set_text (_("*Comments*"));
1251 comment_button.unset_bg (STATE_NORMAL);
1252 ((Gtk::Label*)comment_button.get_child())->set_text (_("Comments"));
1257 if (! str.empty()) {
1258 comment_button.modify_bg (STATE_NORMAL, color());
1259 ((Gtk::Label*)comment_button.get_child())->set_text (_("*Cmt*"));
1261 comment_button.unset_bg (STATE_NORMAL);
1262 ((Gtk::Label*)comment_button.get_child())->set_text (_("Cmt"));
1267 ARDOUR_UI::instance()->set_tip (comment_button,
1268 str.empty() ? _("Click to Add/Edit Comments") : str);
1274 MixerStrip::comment_button_clicked ()
1276 if (comment_window == 0) {
1277 setup_comment_editor ();
1280 int x, y, cw_width, cw_height;
1282 if (comment_window->is_visible()) {
1283 comment_window->hide ();
1287 comment_window->get_size (cw_width, cw_height);
1288 comment_window->get_position(x, y);
1289 comment_window->move(x, y - (cw_height / 2) - 45);
1291 half the dialog height minus the comments button height
1292 with some window decoration fudge thrown in.
1295 comment_window->show();
1296 comment_window->present();
1300 MixerStrip::setup_comment_editor ()
1303 title = _route->name();
1304 title += _(": comment editor");
1306 comment_window = new ArdourDialog (title, false);
1307 comment_window->set_position (Gtk::WIN_POS_MOUSE);
1308 comment_window->set_skip_taskbar_hint (true);
1309 comment_window->signal_hide().connect (sigc::mem_fun(*this, &MixerStrip::comment_editor_done_editing));
1311 comment_area = manage (new TextView());
1312 comment_area->set_name ("MixerTrackCommentArea");
1313 comment_area->set_size_request (110, 178);
1314 comment_area->set_wrap_mode (WRAP_WORD);
1315 comment_area->set_editable (true);
1316 comment_area->get_buffer()->set_text (_route->comment());
1317 comment_area->show ();
1319 comment_window->get_vbox()->pack_start (*comment_area);
1320 comment_window->get_action_area()->hide();
1324 MixerStrip::comment_changed (void *src)
1326 ENSURE_GUI_THREAD (*this, &MixerStrip::comment_changed, src)
1329 ignore_comment_edit = true;
1331 comment_area->get_buffer()->set_text (_route->comment());
1333 ignore_comment_edit = false;
1338 MixerStrip::set_route_group (RouteGroup *rg)
1344 MixerStrip::select_route_group (GdkEventButton *ev)
1346 using namespace Menu_Helpers;
1348 if (ev->button == 1) {
1350 if (group_menu == 0) {
1352 PropertyList* plist = new PropertyList();
1354 plist->add (Properties::gain, true);
1355 plist->add (Properties::mute, true);
1356 plist->add (Properties::solo, true);
1358 group_menu = new RouteGroupMenu (_session, plist);
1359 group_menu->GroupSelected.connect (sigc::mem_fun (*this, &MixerStrip::set_route_group));
1362 group_menu->popup (1, ev->time);
1369 MixerStrip::route_group_changed ()
1371 ENSURE_GUI_THREAD (*this, &MixerStrip::route_group_changed)
1373 RouteGroup *rg = _route->route_group();
1376 group_label.set_text (PBD::short_version (rg->name(), 5));
1380 group_label.set_text (_("Grp"));
1383 group_label.set_text (_("~G"));
1391 MixerStrip::route_gui_changed (string what_changed, void* ignored)
1393 ENSURE_GUI_THREAD (*this, &MixerStrip::route_gui_changed, what_changed, ignored)
1395 if (what_changed == "color") {
1396 if (set_color_from_route () == 0) {
1397 show_route_color ();
1403 MixerStrip::show_route_color ()
1405 name_button.modify_bg (STATE_NORMAL, color());
1406 top_event_box.modify_bg (STATE_NORMAL, color());
1407 route_active_changed ();
1411 MixerStrip::show_passthru_color ()
1413 route_active_changed ();
1417 MixerStrip::build_route_ops_menu ()
1419 using namespace Menu_Helpers;
1420 route_ops_menu = new Menu;
1421 route_ops_menu->set_name ("ArdourContextMenu");
1423 MenuList& items = route_ops_menu->items();
1425 items.push_back (MenuElem (_("Save As Template"), sigc::mem_fun(*this, &RouteUI::save_as_template)));
1426 items.push_back (MenuElem (_("Rename"), sigc::mem_fun(*this, &RouteUI::route_rename)));
1427 rename_menu_item = &items.back();
1428 items.push_back (SeparatorElem());
1429 items.push_back (CheckMenuElem (_("Active"), sigc::mem_fun (*this, &RouteUI::toggle_route_active)));
1430 route_active_menu_item = dynamic_cast<CheckMenuItem *> (&items.back());
1431 route_active_menu_item->set_active (_route->active());
1433 items.push_back (SeparatorElem());
1435 items.push_back (MenuElem (_("Adjust latency"), sigc::mem_fun (*this, &RouteUI::adjust_latency)));
1437 items.push_back (SeparatorElem());
1438 items.push_back (CheckMenuElem (_("Protect against denormals"), sigc::mem_fun (*this, &RouteUI::toggle_denormal_protection)));
1439 denormal_menu_item = dynamic_cast<CheckMenuItem *> (&items.back());
1440 denormal_menu_item->set_active (_route->denormal_protection());
1442 if (!Profile->get_sae()) {
1443 items.push_back (SeparatorElem());
1444 items.push_back (MenuElem (_("Remote Control ID..."), sigc::mem_fun (*this, &RouteUI::open_remote_control_id_dialog)));
1447 items.push_back (SeparatorElem());
1448 items.push_back (MenuElem (_("Remove"), sigc::mem_fun(*this, &RouteUI::remove_this_route)));
1452 MixerStrip::name_button_button_press (GdkEventButton* ev)
1454 if (ev->button == 3) {
1455 list_route_operations ();
1457 /* do not allow rename if the track is record-enabled */
1458 rename_menu_item->set_sensitive (!_route->record_enabled());
1459 route_ops_menu->popup (1, ev->time);
1461 } else if (ev->button == 1) {
1462 revert_to_default_display ();
1469 MixerStrip::list_route_operations ()
1471 if (route_ops_menu == 0) {
1472 build_route_ops_menu ();
1477 MixerStrip::set_selected (bool yn)
1479 AxisView::set_selected (yn);
1481 global_frame.set_shadow_type (Gtk::SHADOW_ETCHED_OUT);
1482 global_frame.set_name ("MixerStripSelectedFrame");
1484 global_frame.set_shadow_type (Gtk::SHADOW_IN);
1485 global_frame.set_name ("MixerStripFrame");
1487 global_frame.queue_draw ();
1491 MixerStrip::name_changed ()
1495 RouteUI::property_changed (PropertyChange (ARDOUR::Properties::name));
1498 name_label.set_text (PBD::short_version (_route->name(), 5));
1504 MixerStrip::width_clicked ()
1508 set_width_enum (Narrow, this);
1511 set_width_enum (Wide, this);
1517 MixerStrip::hide_clicked ()
1519 // LAME fix to reset the button status for when it is redisplayed (part 1)
1520 hide_button.set_sensitive(false);
1523 Hiding(); /* EMIT_SIGNAL */
1525 _mixer.hide_strip (this);
1529 hide_button.set_sensitive(true);
1533 MixerStrip::set_embedded (bool yn)
1539 MixerStrip::map_frozen ()
1541 ENSURE_GUI_THREAD (*this, &MixerStrip::map_frozen)
1543 boost::shared_ptr<AudioTrack> at = audio_track();
1546 switch (at->freeze_state()) {
1547 case AudioTrack::Frozen:
1548 processor_box.set_sensitive (false);
1551 processor_box.set_sensitive (true);
1552 // XXX need some way, maybe, to retoggle redirect editors
1557 hide_redirect_editors ();
1561 MixerStrip::hide_redirect_editors ()
1563 _route->foreach_processor (sigc::mem_fun (*this, &MixerStrip::hide_processor_editor));
1567 MixerStrip::hide_processor_editor (boost::weak_ptr<Processor> p)
1569 boost::shared_ptr<Processor> processor (p.lock ());
1574 void* gui = processor->get_gui ();
1577 static_cast<Gtk::Widget*>(gui)->hide ();
1582 MixerStrip::route_active_changed ()
1584 RouteUI::route_active_changed ();
1585 reset_strip_style ();
1589 MixerStrip::reset_strip_style ()
1591 if (_current_delivery && boost::dynamic_pointer_cast<Send>(_current_delivery)) {
1593 gpm.set_fader_name ("SendStripBase");
1597 if (is_midi_track()) {
1598 if (_route->active()) {
1599 set_name ("MidiTrackStripBase");
1600 gpm.set_meter_strip_name ("MidiTrackStripBase");
1602 set_name ("MidiTrackStripBaseInactive");
1603 gpm.set_meter_strip_name ("MidiTrackStripBaseInactive");
1605 gpm.set_fader_name ("MidiTrackFader");
1606 } else if (is_audio_track()) {
1607 if (_route->active()) {
1608 set_name ("AudioTrackStripBase");
1609 gpm.set_meter_strip_name ("AudioTrackMetrics");
1611 set_name ("AudioTrackStripBaseInactive");
1612 gpm.set_meter_strip_name ("AudioTrackMetricsInactive");
1614 gpm.set_fader_name ("AudioTrackFader");
1616 if (_route->active()) {
1617 set_name ("AudioBusStripBase");
1618 gpm.set_meter_strip_name ("AudioBusMetrics");
1620 set_name ("AudioBusStripBaseInactive");
1621 gpm.set_meter_strip_name ("AudioBusMetricsInactive");
1623 gpm.set_fader_name ("AudioBusFader");
1625 /* (no MIDI busses yet) */
1631 MixerStrip::route_group() const
1633 return _route->route_group();
1637 MixerStrip::engine_stopped ()
1642 MixerStrip::engine_running ()
1646 /** Called when the metering point has changed */
1648 MixerStrip::meter_changed ()
1650 ENSURE_GUI_THREAD (*this, &MixerStrip::meter_changed)
1652 switch (_route->meter_point()) {
1654 meter_point_label.set_text (_("input"));
1658 meter_point_label.set_text (_("pre"));
1661 case MeterPostFader:
1662 meter_point_label.set_text (_("post"));
1666 meter_point_label.set_text (_("custom"));
1670 gpm.setup_meters ();
1671 // reset peak when meter point changes
1672 gpm.reset_peak_display();
1676 MixerStrip::switch_io (boost::shared_ptr<Route> target)
1678 /* don't respond to switch IO signal outside of the mixer window */
1680 if (!_mixer_owned) {
1684 if (_route == target || _route->is_master()) {
1685 /* don't change the display for the target or the master bus */
1687 } else if (!is_track() && show_sends_button) {
1688 /* make sure our show sends button is inactive, and we no longer blink,
1689 since we're not the target.
1691 send_blink_connection.disconnect ();
1692 show_sends_button->set_active (false);
1693 show_sends_button->set_state (STATE_NORMAL);
1697 /* switch back to default */
1698 revert_to_default_display ();
1702 boost::shared_ptr<Send> send = _route->internal_send_for (target);
1707 revert_to_default_display ();
1712 MixerStrip::drop_send ()
1714 boost::shared_ptr<Send> current_send;
1716 if (_current_delivery && (current_send = boost::dynamic_pointer_cast<Send>(_current_delivery))) {
1717 current_send->set_metering (false);
1720 send_gone_connection.disconnect ();
1721 input_button.set_sensitive (true);
1722 output_button.set_sensitive (true);
1726 MixerStrip::show_send (boost::shared_ptr<Send> send)
1732 _current_delivery = send;
1734 send->set_metering (true);
1735 _current_delivery->DropReferences.connect (send_gone_connection, invalidator (*this), boost::bind (&MixerStrip::revert_to_default_display, this), gui_context());
1737 gain_meter().set_controls (_route, send->meter(), send->amp());
1738 gain_meter().setup_meters ();
1740 panner_ui().set_panner (_current_delivery->panner());
1741 panner_ui().setup_pan ();
1743 input_button.set_sensitive (false);
1745 if (boost::dynamic_pointer_cast<InternalSend>(send)) {
1746 output_button.set_sensitive (false);
1749 reset_strip_style ();
1753 MixerStrip::revert_to_default_display ()
1755 if (show_sends_button) {
1756 show_sends_button->set_active (false);
1761 _current_delivery = _route->main_outs();
1763 gain_meter().set_controls (_route, _route->shared_peak_meter(), _route->amp());
1764 gain_meter().setup_meters ();
1766 panner_ui().set_panner (_route->main_outs()->panner());
1767 panner_ui().setup_pan ();
1769 reset_strip_style ();
1773 MixerStrip::set_button_names ()
1775 invert_button_label.set_text (X_("Ø"));
1779 rec_enable_button_label.set_text (_("Rec"));
1780 mute_button_label.set_text (_("Mute"));
1781 if (_route && _route->solo_safe()) {
1782 solo_button_label.set_text (X_("!"));
1784 if (!Config->get_solo_control_is_listen_control()) {
1785 solo_button_label.set_text (_("Solo"));
1787 switch (Config->get_listen_position()) {
1788 case AfterFaderListen:
1789 solo_button_label.set_text (_("AFL"));
1791 case PreFaderListen:
1792 solo_button_label.set_text (_("PFL"));
1800 rec_enable_button_label.set_text (_("R"));
1801 mute_button_label.set_text (_("M"));
1802 if (_route && _route->solo_safe()) {
1803 solo_button_label.set_text (X_("!"));
1804 if (!Config->get_solo_control_is_listen_control()) {
1805 solo_button_label.set_text (_("S"));
1807 switch (Config->get_listen_position()) {
1808 case AfterFaderListen:
1809 solo_button_label.set_text (_("A"));
1811 case PreFaderListen:
1812 solo_button_label.set_text (_("P"));
1823 MixerStrip::on_key_press_event (GdkEventKey* ev)
1825 GdkEventButton fake;
1826 fake.type = GDK_BUTTON_PRESS;
1828 fake.state = ev->state;
1830 switch (ev->keyval) {
1842 rec_enable_press (&fake);
1847 show_sends_press (&fake);
1852 if (ev->state & Keyboard::PrimaryModifier) {
1862 _route->set_gain (1.0, this);
1875 MixerStrip::on_key_release_event (GdkEventKey* ev)
1877 GdkEventButton fake;
1878 fake.type = GDK_BUTTON_RELEASE;
1880 fake.state = ev->state;
1882 switch (ev->keyval) {
1884 mute_release (&fake);
1889 solo_release (&fake);
1894 rec_enable_release (&fake);
1899 show_sends_release (&fake);
1915 MixerStrip::on_enter_notify_event (GdkEventCrossing*)
1917 Keyboard::magic_widget_grab_focus ();
1923 MixerStrip::on_leave_notify_event (GdkEventCrossing* ev)
1925 switch (ev->detail) {
1926 case GDK_NOTIFY_INFERIOR:
1929 Keyboard::magic_widget_drop_focus ();
1936 MixerStrip::mono_button_clicked ()
1938 panners.set_mono (_mono_button.get_active ());
1942 MixerStrip::plugin_selector()
1944 return _mixer.plugin_selector();