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/panner.h"
44 #include "ardour/send.h"
45 #include "ardour/processor.h"
46 #include "ardour/profile.h"
47 #include "ardour/ladspa_plugin.h"
48 #include "ardour/user_bundle.h"
49 #include "ardour/port.h"
51 #include "ardour_ui.h"
52 #include "ardour_dialog.h"
53 #include "mixer_strip.h"
57 #include "public_editor.h"
59 #include "io_selector.h"
61 #include "gui_thread.h"
62 #include "route_group_menu.h"
66 using namespace ARDOUR;
69 using namespace Gtkmm2ext;
72 sigc::signal<void,boost::shared_ptr<Route> > MixerStrip::SwitchIO;
74 int MixerStrip::scrollbar_height = 0;
75 PBD::Signal1<void,MixerStrip*> MixerStrip::CatchDeletion;
77 MixerStrip::MixerStrip (Mixer_UI& mx, Session* sess, bool in_mixer)
81 , _mixer_owned (in_mixer)
82 , processor_box (sess, boost::bind (&MixerStrip::plugin_selector, this), mx.selection(), this, in_mixer)
85 , _mono_button (_("Mono"))
87 , solo_led_table (2, 2)
88 , middle_button_table (1, 2)
89 , bottom_button_table (1, 2)
90 , meter_point_label (_("pre"))
91 , comment_button (_("Comments"))
96 /* the editor mixer strip: don't destroy it every time
97 the underlying route goes away.
100 self_destruct = false;
104 MixerStrip::MixerStrip (Mixer_UI& mx, Session* sess, boost::shared_ptr<Route> rt, bool in_mixer)
108 , _mixer_owned (in_mixer)
109 , processor_box (sess, sigc::mem_fun(*this, &MixerStrip::plugin_selector), mx.selection(), this, in_mixer)
112 , button_table (3, 2)
113 , middle_button_table (1, 2)
114 , bottom_button_table (1, 2)
115 , meter_point_label (_("pre"))
116 , comment_button (_("Comments"))
128 _marked_for_display = false;
130 ignore_comment_edit = false;
131 ignore_toggle = false;
137 /* the length of this string determines the width of the mixer strip when it is set to `wide' */
138 longest_label = "longest label";
142 img = manage (new Gtk::Image (::get_icon("strip_width")));
145 width_button.add (*img);
147 img = manage (new Gtk::Image (::get_icon("hide")));
150 hide_button.add (*img);
152 input_label.set_text (_("Input"));
153 ARDOUR_UI::instance()->set_tip (&input_button, _("Button 1 to choose inputs from a port matrix, button 3 to select inputs from a menu"), "");
154 input_button.add (input_label);
155 input_button.set_name ("MixerIOButton");
156 input_label.set_name ("MixerIOButtonLabel");
158 Gtkmm2ext::set_size_request_to_display_given_text (input_button, longest_label.c_str(), 4, 4);
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 Label* iso_label = manage (new Label (_("iso")));
206 Label* safe_label = manage (new Label (_("lock")));
208 iso_label->set_name (X_("SoloLEDLabel"));
209 safe_label->set_name (X_("SoloLEDLabel"));
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 solo_led_box.pack_end (solo_led_table, false, false);
223 solo_led_box.show ();
225 button_table.set_homogeneous (true);
226 button_table.set_spacings (0);
228 button_table.attach (name_button, 0, 2, 0, 1);
229 button_table.attach (input_button, 0, 2, 1, 2);
230 button_table.attach (_invert_button_box, 0, 2, 3, 4);
232 middle_button_table.set_homogeneous (true);
233 middle_button_table.set_spacings (0);
234 middle_button_table.attach (*mute_button, 0, 1, 0, 1);
235 middle_button_table.attach (*solo_button, 1, 2, 0, 1);
237 bottom_button_table.set_col_spacings (0);
238 bottom_button_table.set_homogeneous (true);
239 bottom_button_table.attach (group_button, 0, 1, 0, 1);
241 name_button.add (name_label);
242 name_button.set_name ("MixerNameButton");
243 Gtkmm2ext::set_size_request_to_display_given_text (name_button, longest_label.c_str(), 2, 2);
245 name_label.set_name ("MixerNameButtonLabel");
246 ARDOUR_UI::instance()->set_tip (&group_button, _("Mix group"), "");
247 group_button.add (group_label);
248 group_button.set_name ("MixerGroupButton");
249 Gtkmm2ext::set_size_request_to_display_given_text (group_button, "Group", 2, 2);
250 group_label.set_name ("MixerGroupButtonLabel");
252 comment_button.set_name ("MixerCommentButton");
253 comment_button.signal_clicked().connect (sigc::mem_fun(*this, &MixerStrip::comment_button_clicked));
255 _mono_button.set_name ("MixerMonoButton");
256 _mono_button.signal_clicked().connect (sigc::mem_fun (*this, &MixerStrip::mono_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 global_vpacker.pack_start (panners, Gtk::PACK_SHRINK);
284 global_vpacker.pack_start (_mono_button, Gtk::PACK_SHRINK);
285 global_vpacker.pack_start (output_button, Gtk::PACK_SHRINK);
286 global_vpacker.pack_start (comment_button, Gtk::PACK_SHRINK);
288 global_frame.add (global_vpacker);
289 global_frame.set_shadow_type (Gtk::SHADOW_IN);
290 global_frame.set_name ("BaseFrame");
294 /* force setting of visible selected status */
297 set_selected (false);
302 _session->engine().Stopped.connect (*this, invalidator (*this), boost::bind (&MixerStrip::engine_stopped, this), gui_context());
303 _session->engine().Running.connect (*this, invalidator (*this), boost::bind (&MixerStrip::engine_running, this), gui_context());
305 input_button.signal_button_press_event().connect (sigc::mem_fun(*this, &MixerStrip::input_press), false);
306 output_button.signal_button_press_event().connect (sigc::mem_fun(*this, &MixerStrip::output_press), false);
308 /* we don't need this if its not an audio track, but we don't know that yet and it doesn't
312 rec_enable_button->set_name ("MixerRecordEnableButton");
314 /* ditto for this button and busses */
316 name_button.signal_button_press_event().connect (sigc::mem_fun(*this, &MixerStrip::name_button_button_press), false);
317 group_button.signal_button_press_event().connect (sigc::mem_fun(*this, &MixerStrip::select_route_group), false);
321 /* start off as a passthru strip. we'll correct this, if necessary,
322 in update_diskstream_display().
325 /* start off as a passthru strip. we'll correct this, if necessary,
326 in update_diskstream_display().
330 set_name ("MidiTrackStripBase");
332 set_name ("AudioTrackStripBase");
334 add_events (Gdk::BUTTON_RELEASE_MASK|
335 Gdk::ENTER_NOTIFY_MASK|
336 Gdk::LEAVE_NOTIFY_MASK|
338 Gdk::KEY_RELEASE_MASK);
340 set_flags (get_flags() | Gtk::CAN_FOCUS);
342 SwitchIO.connect (sigc::mem_fun (*this, &MixerStrip::switch_io));
345 MixerStrip::~MixerStrip ()
347 CatchDeletion (this);
349 delete input_selector;
350 delete output_selector;
351 delete comment_window;
355 MixerStrip::set_route (boost::shared_ptr<Route> rt)
357 if (rec_enable_button->get_parent()) {
358 button_table.remove (*rec_enable_button);
361 if (show_sends_button->get_parent()) {
362 button_table.remove (*show_sends_button);
365 RouteUI::set_route (rt);
367 /* map the current state */
370 update_solo_display ();
372 delete input_selector;
375 delete output_selector;
378 revert_to_default_display ();
380 processor_box.set_route (rt);
382 if (set_color_from_route()) {
383 set_color (unique_random_color());
386 if (route()->is_master()) {
387 solo_button->hide ();
388 solo_led_box.hide ();
390 solo_button->show ();
391 solo_led_box.show ();
394 if (_mixer_owned && (route()->is_master() || route()->is_monitor())) {
396 if (scrollbar_height == 0) {
397 HScrollbar scrollbar;
398 Gtk::Requisition requisition(scrollbar.size_request ());
399 scrollbar_height = requisition.height;
402 spacer = manage (new EventBox);
403 spacer->set_size_request (-1, scrollbar_height);
404 global_vpacker.pack_start (*spacer, false, false);
407 if (is_audio_track()) {
408 boost::shared_ptr<AudioTrack> at = audio_track();
409 at->FreezeChange.connect (route_connections, invalidator (*this), boost::bind (&MixerStrip::map_frozen, this), gui_context());
412 if (has_audio_outputs ()) {
413 _mono_button.show ();
416 _mono_button.hide ();
422 button_table.attach (*rec_enable_button, 0, 2, 2, 3);
423 rec_enable_button->set_sensitive (_session->writable());
424 rec_enable_button->show();
430 if (!_route->is_master()) {
431 button_table.attach (*show_sends_button, 0, 2, 2, 3);
432 show_sends_button->show();
436 switch (_route->meter_point()) {
438 meter_point_label.set_text (_("input"));
442 meter_point_label.set_text (_("pre"));
446 meter_point_label.set_text (_("post"));
450 meter_point_label.set_text (_("custom"));
454 delete route_ops_menu;
457 ARDOUR_UI::instance()->set_tip (comment_button, _route->comment().empty() ?
458 _("Click to Add/Edit Comments"):
461 _route->meter_change.connect (route_connections, invalidator (*this), bind (&MixerStrip::meter_changed, this), gui_context());
462 _route->input()->changed.connect (route_connections, invalidator (*this), ui_bind (&MixerStrip::input_changed, this, _1, _2), gui_context());
463 _route->output()->changed.connect (route_connections, invalidator (*this), ui_bind (&MixerStrip::output_changed, this, _1, _2), gui_context());
464 _route->route_group_changed.connect (route_connections, invalidator (*this), boost::bind (&MixerStrip::route_group_changed, this), gui_context());
466 if (_route->panner()) {
467 _route->panner()->Changed.connect (route_connections, invalidator (*this), boost::bind (&MixerStrip::connect_to_pan, this), gui_context());
470 if (is_audio_track()) {
471 audio_track()->DiskstreamChanged.connect (route_connections, invalidator (*this), boost::bind (&MixerStrip::diskstream_changed, this), gui_context());
474 _route->comment_changed.connect (route_connections, invalidator (*this), ui_bind (&MixerStrip::comment_changed, this, _1), gui_context());
475 _route->gui_changed.connect (route_connections, invalidator (*this), ui_bind (&MixerStrip::route_gui_changed, this, _1, _2), gui_context());
477 set_stuff_from_route ();
479 /* now force an update of all the various elements */
482 update_solo_display ();
485 route_group_changed ();
489 panners.setup_pan ();
491 update_diskstream_display ();
492 update_input_display ();
493 update_output_display ();
495 add_events (Gdk::BUTTON_RELEASE_MASK);
497 processor_box.show();
499 if (!route()->is_master() && !route()->is_monitor()) {
500 /* we don't allow master or control routes to be hidden */
505 width_hide_box.show();
508 global_vpacker.show();
510 middle_button_table.show();
511 bottom_button_table.show();
512 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 || b->nchannels() != _route->n_inputs()) {
876 list<boost::shared_ptr<Bundle> >::iterator i = input_menu_bundles.begin ();
877 while (i != input_menu_bundles.end() && b->has_same_ports (*i) == false) {
881 if (i != input_menu_bundles.end()) {
885 input_menu_bundles.push_back (b);
887 MenuList& citems = input_menu.items();
889 std::string n = b->name ();
890 replace_all (n, "_", " ");
892 citems.push_back (CheckMenuElem (n, sigc::bind (sigc::mem_fun(*this, &MixerStrip::bundle_input_toggled), b)));
894 if (std::find (current.begin(), current.end(), b) != current.end()) {
895 ignore_toggle = true;
896 dynamic_cast<CheckMenuItem *> (&citems.back())->set_active (true);
897 ignore_toggle = false;
902 MixerStrip::maybe_add_bundle_to_output_menu (boost::shared_ptr<Bundle> b, ARDOUR::BundleList const & current)
904 using namespace Menu_Helpers;
906 if (b->ports_are_inputs() == false || b->nchannels() != _route->n_outputs()) {
910 list<boost::shared_ptr<Bundle> >::iterator i = output_menu_bundles.begin ();
911 while (i != output_menu_bundles.end() && b->has_same_ports (*i) == false) {
915 if (i != output_menu_bundles.end()) {
919 output_menu_bundles.push_back (b);
921 MenuList& citems = output_menu.items();
923 std::string n = b->name ();
924 replace_all (n, "_", " ");
926 citems.push_back (CheckMenuElem (n, sigc::bind (sigc::mem_fun(*this, &MixerStrip::bundle_output_toggled), b)));
928 if (std::find (current.begin(), current.end(), b) != current.end()) {
929 ignore_toggle = true;
930 dynamic_cast<CheckMenuItem *> (&citems.back())->set_active (true);
931 ignore_toggle = false;
936 MixerStrip::update_diskstream_display ()
940 if (input_selector) {
941 input_selector->hide_all ();
948 show_passthru_color ();
953 MixerStrip::connect_to_pan ()
955 ENSURE_GUI_THREAD (*this, &MixerStrip::connect_to_pan)
957 panstate_connection.disconnect ();
958 panstyle_connection.disconnect ();
960 if (!_route->panner()) {
964 boost::shared_ptr<ARDOUR::AutomationControl> pan_control
965 = boost::dynamic_pointer_cast<ARDOUR::AutomationControl>(
966 _route->panner()->control(Evoral::Parameter(PanAutomation)));
969 pan_control->alist()->automation_state_changed.connect (panstate_connection, invalidator (*this), boost::bind (&PannerUI::pan_automation_state_changed, &panners), gui_context());
970 pan_control->alist()->automation_style_changed.connect (panstyle_connection, invalidator (*this), boost::bind (&PannerUI::pan_automation_style_changed, &panners), gui_context());
973 panners.pan_changed (this);
978 * Output port labelling
979 * =====================
981 * Case 1: Each output has one connection, all connections are to system:playback_%i
982 * out 1 -> system:playback_1
983 * out 2 -> system:playback_2
984 * out 3 -> system:playback_3
987 * Case 2: Each output has one connection, all connections are to ardour:track_x/in 1
988 * out 1 -> ardour:track_x/in 1
989 * out 2 -> ardour:track_x/in 2
990 * Display as: track_x
992 * Case 3: Each output has one connection, all connections are to Jack client "program x"
993 * out 1 -> program x:foo
994 * out 2 -> program x:foo
995 * Display as: program x
997 * Case 4: No connections (Disconnected)
1000 * Default case (unusual routing):
1001 * Display as: *number of connections*
1005 * .-----------------------------------------------.
1007 * | out 1 -> ardour:master/in 1, jamin:input/in 1 |
1008 * | out 2 -> ardour:master/in 2, jamin:input/in 2 |
1009 * '-----------------------------------------------'
1010 * .-----------------------------------------------.
1013 * '-----------------------------------------------'
1017 MixerStrip::update_io_button (boost::shared_ptr<ARDOUR::Route> route, Width width, bool for_input)
1022 vector<string> port_connections;
1024 uint32_t total_connection_count = 0;
1025 uint32_t io_connection_count = 0;
1026 uint32_t ardour_connection_count = 0;
1027 uint32_t system_connection_count = 0;
1028 uint32_t other_connection_count = 0;
1030 ostringstream label;
1031 string label_string;
1034 bool have_label = false;
1035 bool each_io_has_one_connection = true;
1037 string connection_name;
1038 string ardour_track_name;
1039 string other_connection_type;
1040 string system_ports;
1043 ostringstream tooltip;
1044 char * tooltip_cstr;
1046 tooltip << route->name();
1049 io_count = route->n_inputs().n_total();
1051 io_count = route->n_outputs().n_total();
1054 for (io_index = 0; io_index < io_count; ++io_index) {
1056 port = route->input()->nth (io_index);
1058 port = route->output()->nth (io_index);
1061 port_connections.clear ();
1062 port->get_connections(port_connections);
1063 io_connection_count = 0;
1065 if (!port_connections.empty()) {
1066 for (vector<string>::iterator i = port_connections.begin(); i != port_connections.end(); ++i) {
1067 string& connection_name (*i);
1069 if (io_connection_count == 0) {
1070 tooltip << endl << port->name().substr(port->name().find("/") + 1) << " -> " << connection_name;
1072 tooltip << ", " << connection_name;
1075 if (connection_name.find("ardour:") == 0) {
1076 if (ardour_track_name.empty()) {
1077 // "ardour:Master/in 1" -> "ardour:Master/"
1078 string::size_type slash = connection_name.find("/");
1079 if (slash != string::npos) {
1080 ardour_track_name = connection_name.substr(0, slash + 1);
1084 if (connection_name.find(ardour_track_name) == 0) {
1085 ++ardour_connection_count;
1087 } else if (connection_name.find("system:") == 0) {
1089 // "system:capture_123" -> "123"
1090 system_port = connection_name.substr(15);
1092 // "system:playback_123" -> "123"
1093 system_port = connection_name.substr(16);
1096 if (system_ports.empty()) {
1097 system_ports += system_port;
1099 system_ports += "/" + system_port;
1102 ++system_connection_count;
1104 if (other_connection_type.empty()) {
1105 // "jamin:in 1" -> "jamin:"
1106 other_connection_type = connection_name.substr(0, connection_name.find(":") + 1);
1109 if (connection_name.find(other_connection_type) == 0) {
1110 ++other_connection_count;
1114 ++total_connection_count;
1115 ++io_connection_count;
1119 if (io_connection_count != 1) {
1120 each_io_has_one_connection = false;
1124 if (total_connection_count == 0) {
1125 tooltip << endl << _("Disconnected");
1128 tooltip_cstr = new char[tooltip.str().size() + 1];
1129 strcpy(tooltip_cstr, tooltip.str().c_str());
1132 ARDOUR_UI::instance()->set_tip (&input_button, tooltip_cstr, "");
1134 ARDOUR_UI::instance()->set_tip (&output_button, tooltip_cstr, "");
1137 if (each_io_has_one_connection) {
1138 if ((total_connection_count == ardour_connection_count)) {
1139 // all connections are to the same track in ardour
1140 // "ardour:Master/" -> "Master"
1141 string::size_type slash = ardour_track_name.find("/");
1142 if (slash != string::npos) {
1143 label << ardour_track_name.substr(7, slash - 7);
1147 else if (total_connection_count == system_connection_count) {
1148 // all connections are to system ports
1149 label << system_ports;
1152 else if (total_connection_count == other_connection_count) {
1153 // all connections are to the same external program eg jamin
1154 // "jamin:" -> "jamin"
1155 label << other_connection_type.substr(0, other_connection_type.size() - 1);
1161 if (total_connection_count == 0) {
1165 // Odd configuration
1166 label << "*" << total_connection_count << "*";
1172 label_string = label.str().substr(0, 6);
1175 label_string = label.str().substr(0, 3);
1179 label_cstr = new char[label_string.size() + 1];
1180 strcpy(label_cstr, label_string.c_str());
1183 input_label.set_text (label_cstr);
1185 output_label.set_text (label_cstr);
1190 MixerStrip::update_input_display ()
1192 update_io_button (_route, _width, true);
1193 panners.setup_pan ();
1197 MixerStrip::update_output_display ()
1199 update_io_button (_route, _width, false);
1200 gpm.setup_meters ();
1201 panners.setup_pan ();
1205 MixerStrip::fast_update ()
1207 gpm.update_meters ();
1211 MixerStrip::diskstream_changed ()
1213 Gtkmm2ext::UI::instance()->call_slot (invalidator (*this), boost::bind (&MixerStrip::update_diskstream_display, this));
1217 MixerStrip::input_changed (IOChange /*change*/, void */*src*/)
1219 Gtkmm2ext::UI::instance()->call_slot (invalidator (*this), boost::bind (&MixerStrip::update_input_display, this));
1220 set_width_enum (_width, this);
1224 MixerStrip::output_changed (IOChange /*change*/, void */*src*/)
1226 Gtkmm2ext::UI::instance()->call_slot (invalidator (*this), boost::bind (&MixerStrip::update_output_display, this));
1227 set_width_enum (_width, this);
1232 MixerStrip::comment_editor_done_editing()
1234 string str = comment_area->get_buffer()->get_text();
1235 if (_route->comment() != str) {
1236 _route->set_comment (str, this);
1241 if (! str.empty()) {
1242 comment_button.modify_bg (STATE_NORMAL, color());
1243 ((Gtk::Label*)comment_button.get_child())->set_text (_("*Comments*"));
1245 comment_button.unset_bg (STATE_NORMAL);
1246 ((Gtk::Label*)comment_button.get_child())->set_text (_("Comments"));
1251 if (! str.empty()) {
1252 comment_button.modify_bg (STATE_NORMAL, color());
1253 ((Gtk::Label*)comment_button.get_child())->set_text (_("*Cmt*"));
1255 comment_button.unset_bg (STATE_NORMAL);
1256 ((Gtk::Label*)comment_button.get_child())->set_text (_("Cmt"));
1261 ARDOUR_UI::instance()->set_tip (comment_button,
1262 str.empty() ? _("Click to Add/Edit Comments") : str);
1268 MixerStrip::comment_button_clicked ()
1270 if (comment_window == 0) {
1271 setup_comment_editor ();
1274 int x, y, cw_width, cw_height;
1276 if (comment_window->is_visible()) {
1277 comment_window->hide ();
1281 comment_window->get_size (cw_width, cw_height);
1282 comment_window->get_position(x, y);
1283 comment_window->move(x, y - (cw_height / 2) - 45);
1285 half the dialog height minus the comments button height
1286 with some window decoration fudge thrown in.
1289 comment_window->show();
1290 comment_window->present();
1294 MixerStrip::setup_comment_editor ()
1297 title = _route->name();
1298 title += _(": comment editor");
1300 comment_window = new ArdourDialog (title, false);
1301 comment_window->set_position (Gtk::WIN_POS_MOUSE);
1302 comment_window->set_skip_taskbar_hint (true);
1303 comment_window->signal_hide().connect (sigc::mem_fun(*this, &MixerStrip::comment_editor_done_editing));
1305 comment_area = manage (new TextView());
1306 comment_area->set_name ("MixerTrackCommentArea");
1307 comment_area->set_size_request (110, 178);
1308 comment_area->set_wrap_mode (WRAP_WORD);
1309 comment_area->set_editable (true);
1310 comment_area->get_buffer()->set_text (_route->comment());
1311 comment_area->show ();
1313 comment_window->get_vbox()->pack_start (*comment_area);
1314 comment_window->get_action_area()->hide();
1318 MixerStrip::comment_changed (void *src)
1320 ENSURE_GUI_THREAD (*this, &MixerStrip::comment_changed, src)
1323 ignore_comment_edit = true;
1325 comment_area->get_buffer()->set_text (_route->comment());
1327 ignore_comment_edit = false;
1332 MixerStrip::set_route_group (RouteGroup *rg)
1338 MixerStrip::select_route_group (GdkEventButton *ev)
1340 using namespace Menu_Helpers;
1342 if (ev->button == 1) {
1344 if (group_menu == 0) {
1346 PropertyList* plist = new PropertyList();
1348 plist->add (Properties::gain, true);
1349 plist->add (Properties::mute, true);
1350 plist->add (Properties::solo, true);
1352 group_menu = new RouteGroupMenu (_session, plist);
1353 group_menu->GroupSelected.connect (sigc::mem_fun (*this, &MixerStrip::set_route_group));
1356 group_menu->popup (1, ev->time);
1363 MixerStrip::route_group_changed ()
1365 ENSURE_GUI_THREAD (*this, &MixerStrip::route_group_changed)
1367 RouteGroup *rg = _route->route_group();
1370 group_label.set_text (PBD::short_version (rg->name(), 5));
1374 group_label.set_text (_("Grp"));
1377 group_label.set_text (_("~G"));
1385 MixerStrip::route_gui_changed (string what_changed, void* ignored)
1387 ENSURE_GUI_THREAD (*this, &MixerStrip::route_gui_changed, what_changed, ignored)
1389 if (what_changed == "color") {
1390 if (set_color_from_route () == 0) {
1391 show_route_color ();
1397 MixerStrip::show_route_color ()
1399 name_button.modify_bg (STATE_NORMAL, color());
1400 top_event_box.modify_bg (STATE_NORMAL, color());
1401 route_active_changed ();
1405 MixerStrip::show_passthru_color ()
1407 route_active_changed ();
1411 MixerStrip::build_route_ops_menu ()
1413 using namespace Menu_Helpers;
1414 route_ops_menu = new Menu;
1415 route_ops_menu->set_name ("ArdourContextMenu");
1417 MenuList& items = route_ops_menu->items();
1419 items.push_back (MenuElem (_("Save As Template..."), sigc::mem_fun(*this, &RouteUI::save_as_template)));
1420 items.push_back (MenuElem (_("Rename..."), sigc::mem_fun(*this, &RouteUI::route_rename)));
1421 rename_menu_item = &items.back();
1422 items.push_back (SeparatorElem());
1423 items.push_back (CheckMenuElem (_("Active"), sigc::mem_fun (*this, &RouteUI::toggle_route_active)));
1424 route_active_menu_item = dynamic_cast<CheckMenuItem *> (&items.back());
1425 route_active_menu_item->set_active (_route->active());
1427 items.push_back (SeparatorElem());
1429 items.push_back (MenuElem (_("Adjust Latency..."), sigc::mem_fun (*this, &RouteUI::adjust_latency)));
1431 items.push_back (SeparatorElem());
1432 items.push_back (CheckMenuElem (_("Protect Against Denormals"), sigc::mem_fun (*this, &RouteUI::toggle_denormal_protection)));
1433 denormal_menu_item = dynamic_cast<CheckMenuItem *> (&items.back());
1434 denormal_menu_item->set_active (_route->denormal_protection());
1436 if (!Profile->get_sae()) {
1437 items.push_back (SeparatorElem());
1438 items.push_back (MenuElem (_("Remote Control ID..."), sigc::mem_fun (*this, &RouteUI::open_remote_control_id_dialog)));
1441 items.push_back (SeparatorElem());
1442 items.push_back (MenuElem (_("Remove"), sigc::mem_fun(*this, &RouteUI::remove_this_route)));
1446 MixerStrip::name_button_button_press (GdkEventButton* ev)
1448 if (ev->button == 3) {
1449 list_route_operations ();
1451 /* do not allow rename if the track is record-enabled */
1452 rename_menu_item->set_sensitive (!_route->record_enabled());
1453 route_ops_menu->popup (1, ev->time);
1455 } else if (ev->button == 1) {
1456 revert_to_default_display ();
1463 MixerStrip::list_route_operations ()
1465 if (route_ops_menu == 0) {
1466 build_route_ops_menu ();
1471 MixerStrip::set_selected (bool yn)
1473 AxisView::set_selected (yn);
1475 global_frame.set_shadow_type (Gtk::SHADOW_ETCHED_OUT);
1476 global_frame.set_name ("MixerStripSelectedFrame");
1478 global_frame.set_shadow_type (Gtk::SHADOW_IN);
1479 global_frame.set_name ("MixerStripFrame");
1481 global_frame.queue_draw ();
1485 MixerStrip::name_changed ()
1489 RouteUI::property_changed (PropertyChange (ARDOUR::Properties::name));
1492 name_label.set_text (PBD::short_version (_route->name(), 5));
1498 MixerStrip::width_clicked ()
1502 set_width_enum (Narrow, this);
1505 set_width_enum (Wide, this);
1511 MixerStrip::hide_clicked ()
1513 // LAME fix to reset the button status for when it is redisplayed (part 1)
1514 hide_button.set_sensitive(false);
1517 Hiding(); /* EMIT_SIGNAL */
1519 _mixer.hide_strip (this);
1523 hide_button.set_sensitive(true);
1527 MixerStrip::set_embedded (bool yn)
1533 MixerStrip::map_frozen ()
1535 ENSURE_GUI_THREAD (*this, &MixerStrip::map_frozen)
1537 boost::shared_ptr<AudioTrack> at = audio_track();
1540 switch (at->freeze_state()) {
1541 case AudioTrack::Frozen:
1542 processor_box.set_sensitive (false);
1545 processor_box.set_sensitive (true);
1546 // XXX need some way, maybe, to retoggle redirect editors
1551 hide_redirect_editors ();
1555 MixerStrip::hide_redirect_editors ()
1557 _route->foreach_processor (sigc::mem_fun (*this, &MixerStrip::hide_processor_editor));
1561 MixerStrip::hide_processor_editor (boost::weak_ptr<Processor> p)
1563 boost::shared_ptr<Processor> processor (p.lock ());
1568 void* gui = processor->get_gui ();
1571 static_cast<Gtk::Widget*>(gui)->hide ();
1576 MixerStrip::route_active_changed ()
1578 RouteUI::route_active_changed ();
1579 reset_strip_style ();
1583 MixerStrip::reset_strip_style ()
1585 if (_current_delivery && boost::dynamic_pointer_cast<Send>(_current_delivery)) {
1587 gpm.set_fader_name ("SendStripBase");
1591 if (is_midi_track()) {
1592 if (_route->active()) {
1593 set_name ("MidiTrackStripBase");
1594 gpm.set_meter_strip_name ("MidiTrackStripBase");
1596 set_name ("MidiTrackStripBaseInactive");
1597 gpm.set_meter_strip_name ("MidiTrackStripBaseInactive");
1599 gpm.set_fader_name ("MidiTrackFader");
1600 } else if (is_audio_track()) {
1601 if (_route->active()) {
1602 set_name ("AudioTrackStripBase");
1603 gpm.set_meter_strip_name ("AudioTrackMetrics");
1605 set_name ("AudioTrackStripBaseInactive");
1606 gpm.set_meter_strip_name ("AudioTrackMetricsInactive");
1608 gpm.set_fader_name ("AudioTrackFader");
1610 if (_route->active()) {
1611 set_name ("AudioBusStripBase");
1612 gpm.set_meter_strip_name ("AudioBusMetrics");
1614 set_name ("AudioBusStripBaseInactive");
1615 gpm.set_meter_strip_name ("AudioBusMetricsInactive");
1617 gpm.set_fader_name ("AudioBusFader");
1619 /* (no MIDI busses yet) */
1625 MixerStrip::route_group() const
1627 return _route->route_group();
1631 MixerStrip::engine_stopped ()
1636 MixerStrip::engine_running ()
1640 /** Called when the metering point has changed */
1642 MixerStrip::meter_changed ()
1644 ENSURE_GUI_THREAD (*this, &MixerStrip::meter_changed)
1646 switch (_route->meter_point()) {
1648 meter_point_label.set_text (_("input"));
1652 meter_point_label.set_text (_("pre"));
1655 case MeterPostFader:
1656 meter_point_label.set_text (_("post"));
1660 meter_point_label.set_text (_("custom"));
1664 gpm.setup_meters ();
1665 // reset peak when meter point changes
1666 gpm.reset_peak_display();
1670 MixerStrip::switch_io (boost::shared_ptr<Route> target)
1672 /* don't respond to switch IO signal outside of the mixer window */
1674 if (!_mixer_owned) {
1678 if (_route == target || _route->is_master()) {
1679 /* don't change the display for the target or the master bus */
1681 } else if (!is_track() && show_sends_button) {
1682 /* make sure our show sends button is inactive, and we no longer blink,
1683 since we're not the target.
1685 send_blink_connection.disconnect ();
1686 show_sends_button->set_active (false);
1687 show_sends_button->set_state (STATE_NORMAL);
1691 /* switch back to default */
1692 revert_to_default_display ();
1696 boost::shared_ptr<Send> send = _route->internal_send_for (target);
1701 revert_to_default_display ();
1706 MixerStrip::drop_send ()
1708 boost::shared_ptr<Send> current_send;
1710 if (_current_delivery && (current_send = boost::dynamic_pointer_cast<Send>(_current_delivery))) {
1711 current_send->set_metering (false);
1714 send_gone_connection.disconnect ();
1715 input_button.set_sensitive (true);
1716 output_button.set_sensitive (true);
1720 MixerStrip::show_send (boost::shared_ptr<Send> send)
1726 _current_delivery = send;
1728 send->set_metering (true);
1729 _current_delivery->DropReferences.connect (send_gone_connection, invalidator (*this), boost::bind (&MixerStrip::revert_to_default_display, this), gui_context());
1731 gain_meter().set_controls (_route, send->meter(), send->amp());
1732 gain_meter().setup_meters ();
1734 panner_ui().set_panner (_current_delivery->panner());
1735 panner_ui().setup_pan ();
1737 input_button.set_sensitive (false);
1739 if (boost::dynamic_pointer_cast<InternalSend>(send)) {
1740 output_button.set_sensitive (false);
1743 reset_strip_style ();
1747 MixerStrip::revert_to_default_display ()
1749 if (show_sends_button) {
1750 show_sends_button->set_active (false);
1755 _current_delivery = _route->main_outs();
1757 gain_meter().set_controls (_route, _route->shared_peak_meter(), _route->amp());
1758 gain_meter().setup_meters ();
1760 panner_ui().set_panner (_route->main_outs()->panner());
1761 panner_ui().setup_pan ();
1763 reset_strip_style ();
1767 MixerStrip::set_button_names ()
1771 rec_enable_button_label.set_text (_("Rec"));
1772 mute_button_label.set_text (_("Mute"));
1773 if (_route && _route->solo_safe()) {
1774 solo_button_label.set_text (X_("!"));
1776 if (!Config->get_solo_control_is_listen_control()) {
1777 solo_button_label.set_text (_("Solo"));
1779 switch (Config->get_listen_position()) {
1780 case AfterFaderListen:
1781 solo_button_label.set_text (_("AFL"));
1783 case PreFaderListen:
1784 solo_button_label.set_text (_("PFL"));
1792 rec_enable_button_label.set_text (_("R"));
1793 mute_button_label.set_text (_("M"));
1794 if (_route && _route->solo_safe()) {
1795 solo_button_label.set_text (X_("!"));
1796 if (!Config->get_solo_control_is_listen_control()) {
1797 solo_button_label.set_text (_("S"));
1799 switch (Config->get_listen_position()) {
1800 case AfterFaderListen:
1801 solo_button_label.set_text (_("A"));
1803 case PreFaderListen:
1804 solo_button_label.set_text (_("P"));
1815 MixerStrip::on_key_press_event (GdkEventKey* ev)
1817 GdkEventButton fake;
1818 fake.type = GDK_BUTTON_PRESS;
1820 fake.state = ev->state;
1822 switch (ev->keyval) {
1834 cerr << "Stole that r\n";
1835 rec_enable_press (&fake);
1840 show_sends_press (&fake);
1845 if (ev->state & Keyboard::PrimaryModifier) {
1855 _route->set_gain (1.0, this);
1868 MixerStrip::on_key_release_event (GdkEventKey* ev)
1870 GdkEventButton fake;
1871 fake.type = GDK_BUTTON_RELEASE;
1873 fake.state = ev->state;
1875 switch (ev->keyval) {
1877 mute_release (&fake);
1882 solo_release (&fake);
1887 cerr << "Stole that r\n";
1888 rec_enable_release (&fake);
1893 show_sends_release (&fake);
1909 MixerStrip::on_enter_notify_event (GdkEventCrossing*)
1911 Keyboard::magic_widget_grab_focus ();
1917 MixerStrip::on_leave_notify_event (GdkEventCrossing* ev)
1919 switch (ev->detail) {
1920 case GDK_NOTIFY_INFERIOR:
1923 Keyboard::magic_widget_drop_focus ();
1930 MixerStrip::mono_button_clicked ()
1932 panners.set_mono (_mono_button.get_active ());
1936 MixerStrip::plugin_selector()
1938 return _mixer.plugin_selector();