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 , top_button_table (1, 2)
91 , middle_button_table (1, 2)
92 , bottom_button_table (1, 2)
93 , meter_point_label (_("pre"))
94 , midi_input_enable_button (0)
99 /* the editor mixer strip: don't destroy it every time
100 the underlying route goes away.
103 self_destruct = false;
107 MixerStrip::MixerStrip (Mixer_UI& mx, Session* sess, boost::shared_ptr<Route> rt, bool in_mixer)
111 , _mixer_owned (in_mixer)
112 , processor_box (sess, sigc::mem_fun(*this, &MixerStrip::plugin_selector), mx.selection(), this, in_mixer)
115 , button_table (3, 1)
116 , middle_button_table (2, 2)
117 , bottom_button_table (1, 2)
118 , meter_point_label (_("pre"))
119 , midi_input_enable_button (0)
132 ignore_comment_edit = false;
133 ignore_toggle = false;
139 /* the length of this string determines the width of the mixer strip when it is set to `wide' */
140 longest_label = "longest label";
144 img = manage (new Gtk::Image (::get_icon("strip_width")));
147 width_button.add (*img);
149 img = manage (new Gtk::Image (::get_icon("hide")));
152 hide_button.add (*img);
154 input_label.set_text (_("Input"));
155 ARDOUR_UI::instance()->set_tip (&input_button, _("Button 1 to choose inputs from a port matrix, button 3 to select inputs from a menu"), "");
156 input_button.add (input_label);
157 input_button.set_name ("MixerIOButton");
158 input_label.set_name ("MixerIOButtonLabel");
159 input_button_box.pack_start (input_button, true, true);
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");
188 monitor_input_button->set_name ("MixerMonitorInputButton");
189 monitor_disk_button->set_name ("MixerMonitorInputButton");
191 solo_isolated_led = manage (new LED);
192 solo_isolated_led->show ();
193 solo_isolated_led->set_diameter (6);
194 solo_isolated_led->set_no_show_all (true);
195 solo_isolated_led->set_name (X_("SoloIsolatedLED"));
196 solo_isolated_led->add_events (Gdk::BUTTON_PRESS_MASK|Gdk::BUTTON_RELEASE_MASK);
197 solo_isolated_led->signal_button_release_event().connect (sigc::mem_fun (*this, &RouteUI::solo_isolate_button_release));
198 UI::instance()->set_tip (solo_isolated_led, _("Isolate Solo"), "");
200 solo_safe_led = manage (new LED);
201 solo_safe_led->show ();
202 solo_safe_led->set_diameter (6);
203 solo_safe_led->set_no_show_all (true);
204 solo_safe_led->set_name (X_("SoloSafeLED"));
205 solo_safe_led->add_events (Gdk::BUTTON_PRESS_MASK|Gdk::BUTTON_RELEASE_MASK);
206 solo_safe_led->signal_button_release_event().connect (sigc::mem_fun (*this, &RouteUI::solo_safe_button_release));
207 UI::instance()->set_tip (solo_safe_led, _("Lock Solo Status"), "");
209 _iso_label = manage (new Label (_("iso")));
210 _safe_label = manage (new Label (_("lock")));
212 _iso_label->set_name (X_("SoloLEDLabel"));
213 _safe_label->set_name (X_("SoloLEDLabel"));
216 _safe_label->show ();
218 solo_led_table.set_spacings (0);
219 solo_led_table.set_border_width (1);
220 solo_led_table.attach (*_iso_label, 0, 1, 0, 1, Gtk::FILL, Gtk::FILL);
221 solo_led_table.attach (*solo_isolated_led, 1, 2, 0, 1, Gtk::FILL, Gtk::FILL);
222 solo_led_table.attach (*_safe_label, 0, 1, 1, 2, Gtk::FILL, Gtk::FILL);
223 solo_led_table.attach (*solo_safe_led, 1, 2, 1, 2, Gtk::FILL, Gtk::FILL);
224 solo_led_table.show ();
226 top_button_table.set_homogeneous (true);
227 top_button_table.set_spacings (0);
228 top_button_table.attach (*monitor_input_button, 0, 1, 0, 1);
229 top_button_table.attach (*monitor_disk_button, 1, 2, 0, 1);
230 top_button_table.show ();
232 below_panner_box.set_border_width (2);
233 below_panner_box.set_spacing (2);
234 below_panner_box.pack_end (solo_led_table, false, false);
235 below_panner_box.show ();
237 button_table.set_homogeneous (true);
238 button_table.set_spacings (0);
240 button_table.attach (name_button, 0, 1, 0, 1);
241 button_table.attach (input_button_box, 0, 1, 1, 2);
242 button_table.attach (_invert_button_box, 0, 1, 2, 3);
244 middle_button_table.set_homogeneous (true);
245 middle_button_table.set_spacings (0);
246 middle_button_table.attach (*mute_button, 0, 1, 0, 1);
247 middle_button_table.attach (*solo_button, 1, 2, 0, 1);
249 bottom_button_table.set_col_spacings (0);
250 bottom_button_table.set_homogeneous (true);
251 bottom_button_table.attach (group_button, 0, 1, 0, 1);
253 name_button.add (name_label);
254 name_button.set_name ("MixerNameButton");
255 Gtkmm2ext::set_size_request_to_display_given_text (name_button, longest_label.c_str(), 2, 2);
257 name_label.set_name ("MixerNameButtonLabel");
258 ARDOUR_UI::instance()->set_tip (&group_button, _("Mix group"), "");
259 group_button.add (group_label);
260 group_button.set_name ("MixerGroupButton");
261 Gtkmm2ext::set_size_request_to_display_given_text (group_button, "Group", 2, 2);
262 group_label.set_name ("MixerGroupButtonLabel");
264 global_vpacker.set_border_width (0);
265 global_vpacker.set_spacing (0);
267 width_button.set_name ("MixerWidthButton");
268 hide_button.set_name ("MixerHideButton");
269 top_event_box.set_name ("MixerTopEventBox");
271 width_button.signal_clicked().connect (sigc::mem_fun(*this, &MixerStrip::width_clicked));
272 hide_button.signal_clicked().connect (sigc::mem_fun(*this, &MixerStrip::hide_clicked));
274 width_hide_box.pack_start (width_button, false, true);
275 width_hide_box.pack_start (top_event_box, true, true);
276 width_hide_box.pack_end (hide_button, false, true);
278 whvbox.pack_start (width_hide_box, true, true);
280 global_vpacker.pack_start (whvbox, Gtk::PACK_SHRINK);
281 global_vpacker.pack_start (button_table, Gtk::PACK_SHRINK);
282 global_vpacker.pack_start (processor_box, true, true);
283 global_vpacker.pack_start (panners, Gtk::PACK_SHRINK);
284 global_vpacker.pack_start (top_button_table, Gtk::PACK_SHRINK);
285 global_vpacker.pack_start (below_panner_box, Gtk::PACK_SHRINK);
286 global_vpacker.pack_start (middle_button_table, Gtk::PACK_SHRINK);
287 global_vpacker.pack_start (gpm, Gtk::PACK_SHRINK);
288 global_vpacker.pack_start (bottom_button_table, Gtk::PACK_SHRINK);
289 global_vpacker.pack_start (output_button, Gtk::PACK_SHRINK);
291 global_frame.add (global_vpacker);
292 global_frame.set_shadow_type (Gtk::SHADOW_IN);
293 global_frame.set_name ("BaseFrame");
297 /* force setting of visible selected status */
300 set_selected (false);
305 _session->engine().Stopped.connect (*this, invalidator (*this), boost::bind (&MixerStrip::engine_stopped, this), gui_context());
306 _session->engine().Running.connect (*this, invalidator (*this), boost::bind (&MixerStrip::engine_running, this), gui_context());
308 input_button.signal_button_press_event().connect (sigc::mem_fun(*this, &MixerStrip::input_press), false);
309 output_button.signal_button_press_event().connect (sigc::mem_fun(*this, &MixerStrip::output_press), false);
311 /* we don't need this if its not an audio track, but we don't know that yet and it doesn't
315 rec_enable_button->set_name ("MixerRecordEnableButton");
317 /* ditto for this button and busses */
319 name_button.signal_button_press_event().connect (sigc::mem_fun(*this, &MixerStrip::name_button_button_press), false);
320 group_button.signal_button_press_event().connect (sigc::mem_fun(*this, &MixerStrip::select_route_group), false);
324 /* start off as a passthru strip. we'll correct this, if necessary,
325 in update_diskstream_display().
328 /* start off as a passthru strip. we'll correct this, if necessary,
329 in update_diskstream_display().
333 set_name ("MidiTrackStripBase");
335 set_name ("AudioTrackStripBase");
337 add_events (Gdk::BUTTON_RELEASE_MASK|
338 Gdk::ENTER_NOTIFY_MASK|
339 Gdk::LEAVE_NOTIFY_MASK|
341 Gdk::KEY_RELEASE_MASK);
343 set_flags (get_flags() | Gtk::CAN_FOCUS);
345 SwitchIO.connect (sigc::mem_fun (*this, &MixerStrip::switch_io));
347 AudioEngine::instance()->PortConnectedOrDisconnected.connect (
348 *this, invalidator (*this), boost::bind (&MixerStrip::port_connected_or_disconnected, this, _1, _3), gui_context ()
352 MixerStrip::~MixerStrip ()
354 CatchDeletion (this);
356 delete input_selector;
357 delete output_selector;
358 delete comment_window;
362 MixerStrip::set_route (boost::shared_ptr<Route> rt)
364 if (rec_enable_button->get_parent()) {
365 below_panner_box.remove (*rec_enable_button);
368 if (show_sends_button->get_parent()) {
369 below_panner_box.remove (*show_sends_button);
372 processor_box.set_route (rt);
374 RouteUI::set_route (rt);
376 /* map the current state */
379 update_solo_display ();
381 delete input_selector;
384 delete output_selector;
387 revert_to_default_display ();
389 if (route()->is_master()) {
390 solo_button->hide ();
391 below_panner_box.hide ();
393 solo_button->show ();
394 below_panner_box.show ();
397 if (_mixer_owned && (route()->is_master() || route()->is_monitor())) {
399 if (scrollbar_height == 0) {
400 HScrollbar scrollbar;
401 Gtk::Requisition requisition(scrollbar.size_request ());
402 scrollbar_height = requisition.height;
405 spacer = manage (new EventBox);
406 spacer->set_size_request (-1, scrollbar_height);
407 global_vpacker.pack_start (*spacer, false, false);
411 monitor_input_button->show ();
412 monitor_disk_button->show ();
414 monitor_input_button->hide();
415 monitor_disk_button->hide ();
418 if (is_midi_track()) {
419 if (midi_input_enable_button == 0) {
420 Image* img = manage (new Image (get_icon (X_("midi_socket_small"))));
421 midi_input_enable_button = manage (new StatefulToggleButton);
422 midi_input_enable_button->set_name ("MixerMidiInputEnableButton");
423 midi_input_enable_button->set_image (*img);
424 midi_input_enable_button->signal_button_press_event().connect (sigc::mem_fun (*this, &MixerStrip::input_active_button_press), false);
425 midi_input_enable_button->signal_button_release_event().connect (sigc::mem_fun (*this, &MixerStrip::input_active_button_release), false);
426 ARDOUR_UI::instance()->set_tip (midi_input_enable_button, _("Enable/Disable MIDI input"));
428 input_button_box.remove (*midi_input_enable_button);
430 /* get current state */
431 midi_input_status_changed ();
432 input_button_box.pack_start (*midi_input_enable_button, false, false);
434 midi_track()->InputActiveChanged.connect (route_connections, invalidator (*this), boost::bind (&MixerStrip::midi_input_status_changed, this), gui_context());
436 if (midi_input_enable_button) {
437 /* removal from the container will delete it */
438 input_button_box.remove (*midi_input_enable_button);
439 midi_input_enable_button = 0;
443 if (is_audio_track()) {
444 boost::shared_ptr<AudioTrack> at = audio_track();
445 at->FreezeChange.connect (route_connections, invalidator (*this), boost::bind (&MixerStrip::map_frozen, this), gui_context());
448 if (has_audio_outputs ()) {
456 below_panner_box.pack_start (*rec_enable_button);
457 rec_enable_button->set_sensitive (_session->writable());
458 rec_enable_button->show();
464 if (!_route->is_master()) {
465 below_panner_box.pack_start (*show_sends_button);
466 show_sends_button->show();
470 meter_point_label.set_text (meter_point_string (_route->meter_point()));
472 delete route_ops_menu;
475 _route->meter_change.connect (route_connections, invalidator (*this), bind (&MixerStrip::meter_changed, this), gui_context());
476 _route->route_group_changed.connect (route_connections, invalidator (*this), boost::bind (&MixerStrip::route_group_changed, this), gui_context());
478 if (_route->panner_shell()) {
479 _route->panner_shell()->Changed.connect (route_connections, invalidator (*this), boost::bind (&MixerStrip::connect_to_pan, this), gui_context());
482 if (is_audio_track()) {
483 audio_track()->DiskstreamChanged.connect (route_connections, invalidator (*this), boost::bind (&MixerStrip::diskstream_changed, this), gui_context());
486 _route->comment_changed.connect (route_connections, invalidator (*this), ui_bind (&MixerStrip::comment_changed, this, _1), gui_context());
488 set_stuff_from_route ();
490 /* now force an update of all the various elements */
493 update_solo_display ();
496 route_group_changed ();
499 panners.setup_pan ();
501 update_diskstream_display ();
502 update_input_display ();
503 update_output_display ();
505 add_events (Gdk::BUTTON_RELEASE_MASK);
507 processor_box.show ();
509 if (!route()->is_master() && !route()->is_monitor()) {
510 /* we don't allow master or control routes to be hidden */
515 width_hide_box.show();
518 global_vpacker.show();
520 middle_button_table.show();
521 bottom_button_table.show();
523 gain_unit_button.show();
524 gain_unit_label.show();
525 meter_point_button.show();
526 meter_point_label.show();
527 diskstream_button.show();
528 diskstream_label.show();
529 input_button_box.show_all();
530 output_button.show();
541 MixerStrip::set_stuff_from_route ()
543 /* if width is not set, it will be set by the MixerUI or editor */
545 string str = gui_property ("strip-width");
547 set_width_enum (Width (string_2_enum (str, _width)), this);
552 MixerStrip::set_width_enum (Width w, void* owner)
554 /* always set the gpm width again, things may be hidden */
557 panners.set_width (w);
559 boost::shared_ptr<AutomationList> gain_automation = _route->gain_control()->alist();
561 _width_owner = owner;
565 if (_width_owner == this) {
566 set_gui_property ("strip-width", enum_2_string (_width));
573 if (show_sends_button) {
574 ((Gtk::Label*)show_sends_button->get_child())->set_text (_("Sends"));
577 ((Gtk::Label*)gpm.gain_automation_style_button.get_child())->set_text (
578 gpm.astyle_string(gain_automation->automation_style()));
579 ((Gtk::Label*)gpm.gain_automation_state_button.get_child())->set_text (
580 gpm.astate_string(gain_automation->automation_state()));
582 if (_route->panner()) {
583 ((Gtk::Label*)panners.pan_automation_style_button.get_child())->set_text (
584 panners.astyle_string(_route->panner()->automation_style()));
585 ((Gtk::Label*)panners.pan_automation_state_button.get_child())->set_text (
586 panners.astate_string(_route->panner()->automation_state()));
590 _safe_label->show ();
592 Gtkmm2ext::set_size_request_to_display_given_text (name_button, "long", 2, 2);
593 set_size_request (-1, -1);
597 if (show_sends_button) {
598 ((Gtk::Label*)show_sends_button->get_child())->set_text (_("Snd"));
601 ((Gtk::Label*)gpm.gain_automation_style_button.get_child())->set_text (
602 gpm.short_astyle_string(gain_automation->automation_style()));
603 ((Gtk::Label*)gpm.gain_automation_state_button.get_child())->set_text (
604 gpm.short_astate_string(gain_automation->automation_state()));
606 if (_route->panner()) {
607 ((Gtk::Label*)panners.pan_automation_style_button.get_child())->set_text (
608 panners.short_astyle_string(_route->panner()->automation_style()));
609 ((Gtk::Label*)panners.pan_automation_state_button.get_child())->set_text (
610 panners.short_astate_string(_route->panner()->automation_state()));
614 _safe_label->hide ();
616 Gtkmm2ext::set_size_request_to_display_given_text (name_button, longest_label.c_str(), 2, 2);
617 set_size_request (max (50, gpm.get_gm_width()), -1);
621 processor_box.set_width (w);
623 update_input_display ();
624 update_output_display ();
625 route_group_changed ();
631 MixerStrip::set_packed (bool yn)
636 set_gui_property ("visible", true);
638 set_gui_property ("visible", false);
643 struct RouteCompareByName {
644 bool operator() (boost::shared_ptr<Route> a, boost::shared_ptr<Route> b) {
645 return a->name().compare (b->name()) < 0;
650 MixerStrip::output_press (GdkEventButton *ev)
652 using namespace Menu_Helpers;
653 if (!_session->engine().connected()) {
654 MessageDialog msg (_("Not connected to JACK - no I/O changes are possible"));
659 MenuList& citems = output_menu.items();
660 switch (ev->button) {
663 edit_output_configuration ();
668 output_menu.set_name ("ArdourContextMenu");
670 output_menu_bundles.clear ();
672 citems.push_back (MenuElem (_("Disconnect"), sigc::mem_fun (*(static_cast<RouteUI*>(this)), &RouteUI::disconnect_output)));
673 citems.push_back (SeparatorElem());
675 ARDOUR::BundleList current = _route->output()->bundles_connected ();
677 boost::shared_ptr<ARDOUR::BundleList> b = _session->bundles ();
679 /* give user bundles first chance at being in the menu */
681 for (ARDOUR::BundleList::iterator i = b->begin(); i != b->end(); ++i) {
682 if (boost::dynamic_pointer_cast<UserBundle> (*i)) {
683 maybe_add_bundle_to_output_menu (*i, current);
687 for (ARDOUR::BundleList::iterator i = b->begin(); i != b->end(); ++i) {
688 if (boost::dynamic_pointer_cast<UserBundle> (*i) == 0) {
689 maybe_add_bundle_to_output_menu (*i, current);
693 boost::shared_ptr<ARDOUR::RouteList> routes = _session->get_routes ();
694 RouteList copy = *routes;
695 copy.sort (RouteCompareByName ());
696 for (ARDOUR::RouteList::const_iterator i = copy.begin(); i != copy.end(); ++i) {
697 maybe_add_bundle_to_output_menu ((*i)->input()->bundle(), current);
700 if (citems.size() == 2) {
701 /* no routes added; remove the separator */
705 output_menu.popup (1, ev->time);
716 MixerStrip::edit_output_configuration ()
718 if (output_selector == 0) {
720 boost::shared_ptr<Send> send;
721 boost::shared_ptr<IO> output;
723 if ((send = boost::dynamic_pointer_cast<Send>(_current_delivery)) != 0) {
724 if (!boost::dynamic_pointer_cast<InternalSend>(send)) {
725 output = send->output();
727 output = _route->output ();
730 output = _route->output ();
733 output_selector = new IOSelectorWindow (_session, output);
736 if (output_selector->is_visible()) {
737 output_selector->get_toplevel()->get_window()->raise();
739 output_selector->present ();
744 MixerStrip::edit_input_configuration ()
746 if (input_selector == 0) {
747 input_selector = new IOSelectorWindow (_session, _route->input());
750 if (input_selector->is_visible()) {
751 input_selector->get_toplevel()->get_window()->raise();
753 input_selector->present ();
758 MixerStrip::input_press (GdkEventButton *ev)
760 using namespace Menu_Helpers;
762 MenuList& citems = input_menu.items();
763 input_menu.set_name ("ArdourContextMenu");
766 if (!_session->engine().connected()) {
767 MessageDialog msg (_("Not connected to JACK - no I/O changes are possible"));
772 if (_session->actively_recording() && _route->record_enabled())
775 switch (ev->button) {
778 edit_input_configuration ();
783 citems.push_back (MenuElem (_("Disconnect"), sigc::mem_fun (*(static_cast<RouteUI*>(this)), &RouteUI::disconnect_input)));
784 citems.push_back (SeparatorElem());
785 input_menu_bundles.clear ();
787 ARDOUR::BundleList current = _route->input()->bundles_connected ();
789 boost::shared_ptr<ARDOUR::BundleList> b = _session->bundles ();
791 /* give user bundles first chance at being in the menu */
793 for (ARDOUR::BundleList::iterator i = b->begin(); i != b->end(); ++i) {
794 if (boost::dynamic_pointer_cast<UserBundle> (*i)) {
795 maybe_add_bundle_to_input_menu (*i, current);
799 for (ARDOUR::BundleList::iterator i = b->begin(); i != b->end(); ++i) {
800 if (boost::dynamic_pointer_cast<UserBundle> (*i) == 0) {
801 maybe_add_bundle_to_input_menu (*i, current);
805 boost::shared_ptr<ARDOUR::RouteList> routes = _session->get_routes ();
806 RouteList copy = *routes;
807 copy.sort (RouteCompareByName ());
808 for (ARDOUR::RouteList::const_iterator i = copy.begin(); i != copy.end(); ++i) {
809 maybe_add_bundle_to_input_menu ((*i)->output()->bundle(), current);
812 if (citems.size() == 2) {
813 /* no routes added; remove the separator */
817 input_menu.popup (1, ev->time);
827 MixerStrip::bundle_input_toggled (boost::shared_ptr<ARDOUR::Bundle> c)
833 ARDOUR::BundleList current = _route->input()->bundles_connected ();
835 if (std::find (current.begin(), current.end(), c) == current.end()) {
836 _route->input()->connect_ports_to_bundle (c, this);
838 _route->input()->disconnect_ports_from_bundle (c, this);
843 MixerStrip::bundle_output_toggled (boost::shared_ptr<ARDOUR::Bundle> c)
849 ARDOUR::BundleList current = _route->output()->bundles_connected ();
851 if (std::find (current.begin(), current.end(), c) == current.end()) {
852 _route->output()->connect_ports_to_bundle (c, this);
854 _route->output()->disconnect_ports_from_bundle (c, this);
859 MixerStrip::maybe_add_bundle_to_input_menu (boost::shared_ptr<Bundle> b, ARDOUR::BundleList const & current)
861 using namespace Menu_Helpers;
863 if (b->ports_are_outputs() == false || b->nchannels() != _route->n_inputs()) {
867 list<boost::shared_ptr<Bundle> >::iterator i = input_menu_bundles.begin ();
868 while (i != input_menu_bundles.end() && b->has_same_ports (*i) == false) {
872 if (i != input_menu_bundles.end()) {
876 input_menu_bundles.push_back (b);
878 MenuList& citems = input_menu.items();
880 std::string n = b->name ();
881 replace_all (n, "_", " ");
883 citems.push_back (CheckMenuElem (n, sigc::bind (sigc::mem_fun(*this, &MixerStrip::bundle_input_toggled), b)));
885 if (std::find (current.begin(), current.end(), b) != current.end()) {
886 ignore_toggle = true;
887 dynamic_cast<CheckMenuItem *> (&citems.back())->set_active (true);
888 ignore_toggle = false;
893 MixerStrip::maybe_add_bundle_to_output_menu (boost::shared_ptr<Bundle> b, ARDOUR::BundleList const & current)
895 using namespace Menu_Helpers;
897 if (b->ports_are_inputs() == false || b->nchannels() != _route->n_outputs()) {
901 list<boost::shared_ptr<Bundle> >::iterator i = output_menu_bundles.begin ();
902 while (i != output_menu_bundles.end() && b->has_same_ports (*i) == false) {
906 if (i != output_menu_bundles.end()) {
910 output_menu_bundles.push_back (b);
912 MenuList& citems = output_menu.items();
914 std::string n = b->name ();
915 replace_all (n, "_", " ");
917 citems.push_back (CheckMenuElem (n, sigc::bind (sigc::mem_fun(*this, &MixerStrip::bundle_output_toggled), b)));
919 if (std::find (current.begin(), current.end(), b) != current.end()) {
920 ignore_toggle = true;
921 dynamic_cast<CheckMenuItem *> (&citems.back())->set_active (true);
922 ignore_toggle = false;
927 MixerStrip::update_diskstream_display ()
931 if (input_selector) {
932 input_selector->hide_all ();
935 route_color_changed ();
939 show_passthru_color ();
944 MixerStrip::connect_to_pan ()
946 ENSURE_GUI_THREAD (*this, &MixerStrip::connect_to_pan)
948 panstate_connection.disconnect ();
949 panstyle_connection.disconnect ();
951 if (!_route->panner()) {
955 boost::shared_ptr<Pannable> p = _route->pannable ();
957 p->automation_state_changed.connect (panstate_connection, invalidator (*this), boost::bind (&PannerUI::pan_automation_state_changed, &panners), gui_context());
958 p->automation_style_changed.connect (panstyle_connection, invalidator (*this), boost::bind (&PannerUI::pan_automation_style_changed, &panners), gui_context());
960 panners.panshell_changed ();
965 * Output port labelling
966 * =====================
968 * Case 1: Each output has one connection, all connections are to system:playback_%i
969 * out 1 -> system:playback_1
970 * out 2 -> system:playback_2
971 * out 3 -> system:playback_3
974 * Case 2: Each output has one connection, all connections are to ardour:track_x/in 1
975 * out 1 -> ardour:track_x/in 1
976 * out 2 -> ardour:track_x/in 2
977 * Display as: track_x
979 * Case 3: Each output has one connection, all connections are to Jack client "program x"
980 * out 1 -> program x:foo
981 * out 2 -> program x:foo
982 * Display as: program x
984 * Case 4: No connections (Disconnected)
987 * Default case (unusual routing):
988 * Display as: *number of connections*
992 * .-----------------------------------------------.
994 * | out 1 -> ardour:master/in 1, jamin:input/in 1 |
995 * | out 2 -> ardour:master/in 2, jamin:input/in 2 |
996 * '-----------------------------------------------'
997 * .-----------------------------------------------.
1000 * '-----------------------------------------------'
1004 MixerStrip::update_io_button (boost::shared_ptr<ARDOUR::Route> route, Width width, bool for_input)
1009 vector<string> port_connections;
1011 uint32_t total_connection_count = 0;
1012 uint32_t io_connection_count = 0;
1013 uint32_t ardour_connection_count = 0;
1014 uint32_t system_connection_count = 0;
1015 uint32_t other_connection_count = 0;
1017 ostringstream label;
1018 string label_string;
1020 bool have_label = false;
1021 bool each_io_has_one_connection = true;
1023 string connection_name;
1024 string ardour_track_name;
1025 string other_connection_type;
1026 string system_ports;
1029 ostringstream tooltip;
1030 char * tooltip_cstr;
1032 tooltip << route->name();
1035 io_count = route->n_inputs().n_total();
1037 io_count = route->n_outputs().n_total();
1040 for (io_index = 0; io_index < io_count; ++io_index) {
1042 port = route->input()->nth (io_index);
1044 port = route->output()->nth (io_index);
1047 port_connections.clear ();
1048 port->get_connections(port_connections);
1049 io_connection_count = 0;
1051 if (!port_connections.empty()) {
1052 for (vector<string>::iterator i = port_connections.begin(); i != port_connections.end(); ++i) {
1053 string& connection_name (*i);
1055 if (io_connection_count == 0) {
1056 tooltip << endl << port->name().substr(port->name().find("/") + 1) << " -> " << connection_name;
1058 tooltip << ", " << connection_name;
1061 if (connection_name.find("ardour:") == 0) {
1062 if (ardour_track_name.empty()) {
1063 // "ardour:Master/in 1" -> "ardour:Master/"
1064 string::size_type slash = connection_name.find("/");
1065 if (slash != string::npos) {
1066 ardour_track_name = connection_name.substr(0, slash + 1);
1070 if (connection_name.find(ardour_track_name) == 0) {
1071 ++ardour_connection_count;
1073 } else if (connection_name.find("system:") == 0) {
1075 // "system:capture_123" -> "123"
1076 system_port = connection_name.substr(15);
1078 // "system:playback_123" -> "123"
1079 system_port = connection_name.substr(16);
1082 if (system_ports.empty()) {
1083 system_ports += system_port;
1085 system_ports += "/" + system_port;
1088 ++system_connection_count;
1090 if (other_connection_type.empty()) {
1091 // "jamin:in 1" -> "jamin:"
1092 other_connection_type = connection_name.substr(0, connection_name.find(":") + 1);
1095 if (connection_name.find(other_connection_type) == 0) {
1096 ++other_connection_count;
1100 ++total_connection_count;
1101 ++io_connection_count;
1105 if (io_connection_count != 1) {
1106 each_io_has_one_connection = false;
1110 if (total_connection_count == 0) {
1111 tooltip << endl << _("Disconnected");
1114 tooltip_cstr = new char[tooltip.str().size() + 1];
1115 strcpy(tooltip_cstr, tooltip.str().c_str());
1118 ARDOUR_UI::instance()->set_tip (&input_button, tooltip_cstr, "");
1120 ARDOUR_UI::instance()->set_tip (&output_button, tooltip_cstr, "");
1123 if (each_io_has_one_connection) {
1124 if ((total_connection_count == ardour_connection_count)) {
1125 // all connections are to the same track in ardour
1126 // "ardour:Master/" -> "Master"
1127 string::size_type slash = ardour_track_name.find("/");
1128 if (slash != string::npos) {
1129 label << ardour_track_name.substr(7, slash - 7);
1133 else if (total_connection_count == system_connection_count) {
1134 // all connections are to system ports
1135 label << system_ports;
1138 else if (total_connection_count == other_connection_count) {
1139 // all connections are to the same external program eg jamin
1140 // "jamin:" -> "jamin"
1141 label << other_connection_type.substr(0, other_connection_type.size() - 1);
1147 if (total_connection_count == 0) {
1151 // Odd configuration
1152 label << "*" << total_connection_count << "*";
1158 label_string = label.str().substr(0, 6);
1161 label_string = label.str().substr(0, 3);
1166 input_label.set_text (label_string);
1168 output_label.set_text (label_string);
1173 MixerStrip::update_input_display ()
1175 update_io_button (_route, _width, true);
1176 panners.setup_pan ();
1180 MixerStrip::update_output_display ()
1182 update_io_button (_route, _width, false);
1183 gpm.setup_meters ();
1184 panners.setup_pan ();
1188 MixerStrip::fast_update ()
1190 gpm.update_meters ();
1194 MixerStrip::diskstream_changed ()
1196 Gtkmm2ext::UI::instance()->call_slot (invalidator (*this), boost::bind (&MixerStrip::update_diskstream_display, this));
1200 MixerStrip::port_connected_or_disconnected (Port* a, Port* b)
1202 if (_route->input()->has_port (a) || _route->input()->has_port (b)) {
1203 update_input_display ();
1204 set_width_enum (_width, this);
1207 if (_route->output()->has_port (a) || _route->output()->has_port (b)) {
1208 update_output_display ();
1209 set_width_enum (_width, this);
1214 MixerStrip::comment_editor_done_editing ()
1216 ignore_toggle = true;
1217 _comment_menu_item->set_active (false);
1218 ignore_toggle = false;
1220 string const str = comment_area->get_buffer()->get_text();
1221 if (str == _route->comment ()) {
1225 _route->set_comment (str, this);
1229 MixerStrip::toggle_comment ()
1231 if (ignore_toggle) {
1235 if (comment_window == 0) {
1236 setup_comment_editor ();
1239 if (comment_window->is_visible ()) {
1240 comment_window->hide ();
1245 title = _route->name();
1246 title += _(": comment editor");
1248 comment_window->set_title (title);
1249 comment_window->present();
1253 MixerStrip::setup_comment_editor ()
1255 comment_window = new ArdourDialog ("", false); // title will be reset to show route
1256 comment_window->set_position (Gtk::WIN_POS_MOUSE);
1257 comment_window->set_skip_taskbar_hint (true);
1258 comment_window->signal_hide().connect (sigc::mem_fun(*this, &MixerStrip::comment_editor_done_editing));
1259 comment_window->set_default_size (400, 200);
1261 comment_area = manage (new TextView());
1262 comment_area->set_name ("MixerTrackCommentArea");
1263 comment_area->set_wrap_mode (WRAP_WORD);
1264 comment_area->set_editable (true);
1265 comment_area->get_buffer()->set_text (_route->comment());
1266 comment_area->show ();
1268 comment_window->get_vbox()->pack_start (*comment_area);
1269 comment_window->get_action_area()->hide();
1273 MixerStrip::comment_changed (void *src)
1275 ENSURE_GUI_THREAD (*this, &MixerStrip::comment_changed, src)
1278 ignore_comment_edit = true;
1280 comment_area->get_buffer()->set_text (_route->comment());
1282 ignore_comment_edit = false;
1287 MixerStrip::select_route_group (GdkEventButton *ev)
1289 using namespace Menu_Helpers;
1291 if (ev->button == 1) {
1293 if (group_menu == 0) {
1295 PropertyList* plist = new PropertyList();
1297 plist->add (Properties::gain, true);
1298 plist->add (Properties::mute, true);
1299 plist->add (Properties::solo, true);
1301 group_menu = new RouteGroupMenu (_session, plist);
1305 r.push_back (route ());
1306 group_menu->build (r);
1307 group_menu->menu()->popup (1, ev->time);
1314 MixerStrip::route_group_changed ()
1316 ENSURE_GUI_THREAD (*this, &MixerStrip::route_group_changed)
1318 RouteGroup *rg = _route->route_group();
1321 group_label.set_text (PBD::short_version (rg->name(), 5));
1325 group_label.set_text (_("Grp"));
1328 group_label.set_text (_("~G"));
1335 MixerStrip::route_color_changed ()
1337 name_button.modify_bg (STATE_NORMAL, color());
1338 top_event_box.modify_bg (STATE_NORMAL, color());
1339 reset_strip_style ();
1343 MixerStrip::show_passthru_color ()
1345 reset_strip_style ();
1349 MixerStrip::build_route_ops_menu ()
1351 using namespace Menu_Helpers;
1352 route_ops_menu = new Menu;
1353 route_ops_menu->set_name ("ArdourContextMenu");
1355 MenuList& items = route_ops_menu->items();
1357 items.push_back (CheckMenuElem (_("Comments..."), sigc::mem_fun (*this, &MixerStrip::toggle_comment)));
1358 _comment_menu_item = dynamic_cast<CheckMenuItem*> (&items.back ());
1359 items.push_back (MenuElem (_("Save As Template..."), sigc::mem_fun(*this, &RouteUI::save_as_template)));
1360 items.push_back (MenuElem (_("Rename..."), sigc::mem_fun(*this, &RouteUI::route_rename)));
1361 rename_menu_item = &items.back();
1362 items.push_back (SeparatorElem());
1363 items.push_back (CheckMenuElem (_("Active")));
1364 CheckMenuItem* i = dynamic_cast<CheckMenuItem *> (&items.back());
1365 i->set_active (_route->active());
1366 i->signal_activate().connect (sigc::bind (sigc::mem_fun (*this, &RouteUI::set_route_active), !_route->active(), false));
1368 items.push_back (SeparatorElem());
1370 items.push_back (MenuElem (_("Adjust Latency..."), sigc::mem_fun (*this, &RouteUI::adjust_latency)));
1372 items.push_back (SeparatorElem());
1373 items.push_back (CheckMenuElem (_("Protect Against Denormals"), sigc::mem_fun (*this, &RouteUI::toggle_denormal_protection)));
1374 denormal_menu_item = dynamic_cast<CheckMenuItem *> (&items.back());
1375 denormal_menu_item->set_active (_route->denormal_protection());
1377 if (!Profile->get_sae()) {
1378 items.push_back (SeparatorElem());
1379 items.push_back (MenuElem (_("Remote Control ID..."), sigc::mem_fun (*this, &RouteUI::open_remote_control_id_dialog)));
1382 items.push_back (SeparatorElem());
1383 items.push_back (MenuElem (_("Remove"), sigc::bind (sigc::mem_fun(*this, &RouteUI::remove_this_route), false)));
1387 MixerStrip::name_button_button_press (GdkEventButton* ev)
1389 if (ev->button == 3) {
1390 list_route_operations ();
1392 /* do not allow rename if the track is record-enabled */
1393 rename_menu_item->set_sensitive (!_route->record_enabled());
1394 route_ops_menu->popup (1, ev->time);
1396 } else if (ev->button == 1) {
1397 revert_to_default_display ();
1404 MixerStrip::list_route_operations ()
1406 delete route_ops_menu;
1407 build_route_ops_menu ();
1411 MixerStrip::set_selected (bool yn)
1413 AxisView::set_selected (yn);
1415 global_frame.set_shadow_type (Gtk::SHADOW_ETCHED_OUT);
1416 global_frame.set_name ("MixerStripSelectedFrame");
1418 global_frame.set_shadow_type (Gtk::SHADOW_IN);
1419 global_frame.set_name ("MixerStripFrame");
1421 global_frame.queue_draw ();
1425 MixerStrip::name_changed ()
1429 RouteUI::property_changed (PropertyChange (ARDOUR::Properties::name));
1432 name_label.set_text (PBD::short_version (_route->name(), 5));
1438 MixerStrip::width_clicked ()
1442 set_width_enum (Narrow, this);
1445 set_width_enum (Wide, this);
1451 MixerStrip::hide_clicked ()
1453 // LAME fix to reset the button status for when it is redisplayed (part 1)
1454 hide_button.set_sensitive(false);
1457 Hiding(); /* EMIT_SIGNAL */
1459 _mixer.hide_strip (this);
1463 hide_button.set_sensitive(true);
1467 MixerStrip::set_embedded (bool yn)
1473 MixerStrip::map_frozen ()
1475 ENSURE_GUI_THREAD (*this, &MixerStrip::map_frozen)
1477 boost::shared_ptr<AudioTrack> at = audio_track();
1480 switch (at->freeze_state()) {
1481 case AudioTrack::Frozen:
1482 processor_box.set_sensitive (false);
1483 hide_redirect_editors ();
1486 processor_box.set_sensitive (true);
1487 // XXX need some way, maybe, to retoggle redirect editors
1494 MixerStrip::hide_redirect_editors ()
1496 _route->foreach_processor (sigc::mem_fun (*this, &MixerStrip::hide_processor_editor));
1500 MixerStrip::hide_processor_editor (boost::weak_ptr<Processor> p)
1502 boost::shared_ptr<Processor> processor (p.lock ());
1507 Gtk::Window* w = processor_box.get_processor_ui (processor);
1515 MixerStrip::reset_strip_style ()
1517 if (_current_delivery && boost::dynamic_pointer_cast<Send>(_current_delivery)) {
1519 gpm.set_fader_name ("SendStripBase");
1523 if (is_midi_track()) {
1524 if (_route->active()) {
1525 set_name ("MidiTrackStripBase");
1526 gpm.set_meter_strip_name ("MidiTrackMetrics");
1528 set_name ("MidiTrackStripBaseInactive");
1529 gpm.set_meter_strip_name ("MidiTrackMetricsInactive");
1531 gpm.set_fader_name ("MidiTrackFader");
1532 } else if (is_audio_track()) {
1533 if (_route->active()) {
1534 set_name ("AudioTrackStripBase");
1535 gpm.set_meter_strip_name ("AudioTrackMetrics");
1537 set_name ("AudioTrackStripBaseInactive");
1538 gpm.set_meter_strip_name ("AudioTrackMetricsInactive");
1540 gpm.set_fader_name ("AudioTrackFader");
1542 if (_route->active()) {
1543 set_name ("AudioBusStripBase");
1544 gpm.set_meter_strip_name ("AudioBusMetrics");
1546 set_name ("AudioBusStripBaseInactive");
1547 gpm.set_meter_strip_name ("AudioBusMetricsInactive");
1549 gpm.set_fader_name ("AudioBusFader");
1551 /* (no MIDI busses yet) */
1557 MixerStrip::route_group() const
1559 return _route->route_group();
1563 MixerStrip::engine_stopped ()
1568 MixerStrip::engine_running ()
1573 MixerStrip::meter_point_string (MeterPoint mp)
1584 case MeterPostFader:
1599 /** Called when the metering point has changed */
1601 MixerStrip::meter_changed ()
1603 meter_point_label.set_text (meter_point_string (_route->meter_point()));
1604 gpm.setup_meters ();
1605 // reset peak when meter point changes
1606 gpm.reset_peak_display();
1610 MixerStrip::switch_io (boost::shared_ptr<Route> target)
1612 /* don't respond to switch IO signal outside of the mixer window */
1614 if (!_mixer_owned) {
1618 if (_route == target || _route->is_master()) {
1619 /* don't change the display for the target or the master bus */
1621 } else if (!is_track() && show_sends_button) {
1622 /* make sure our show sends button is inactive, and we no longer blink,
1623 since we're not the target.
1625 send_blink_connection.disconnect ();
1626 show_sends_button->set_active (false);
1627 show_sends_button->set_state (STATE_NORMAL);
1631 /* switch back to default */
1632 revert_to_default_display ();
1636 boost::shared_ptr<Send> send = _route->internal_send_for (target);
1641 revert_to_default_display ();
1646 MixerStrip::drop_send ()
1648 boost::shared_ptr<Send> current_send;
1650 if (_current_delivery && (current_send = boost::dynamic_pointer_cast<Send>(_current_delivery))) {
1651 current_send->set_metering (false);
1654 send_gone_connection.disconnect ();
1655 input_button.set_sensitive (true);
1656 output_button.set_sensitive (true);
1657 group_button.set_sensitive (true);
1658 set_invert_sensitive (true);
1659 meter_point_button.set_sensitive (true);
1660 mute_button->set_sensitive (true);
1661 solo_button->set_sensitive (true);
1662 rec_enable_button->set_sensitive (true);
1663 solo_isolated_led->set_sensitive (true);
1664 solo_safe_led->set_sensitive (true);
1665 monitor_input_button->set_sensitive (true);
1666 monitor_disk_button->set_sensitive (true);
1670 MixerStrip::set_current_delivery (boost::shared_ptr<Delivery> d)
1672 _current_delivery = d;
1673 DeliveryChanged (_current_delivery);
1677 MixerStrip::show_send (boost::shared_ptr<Send> send)
1683 set_current_delivery (send);
1685 send->set_metering (true);
1686 _current_delivery->DropReferences.connect (send_gone_connection, invalidator (*this), boost::bind (&MixerStrip::revert_to_default_display, this), gui_context());
1688 gain_meter().set_controls (_route, send->meter(), send->amp());
1689 gain_meter().setup_meters ();
1691 panner_ui().set_panner (_current_delivery->panner_shell(), _current_delivery->panner());
1692 panner_ui().setup_pan ();
1694 input_button.set_sensitive (false);
1695 group_button.set_sensitive (false);
1696 set_invert_sensitive (false);
1697 meter_point_button.set_sensitive (false);
1698 mute_button->set_sensitive (false);
1699 solo_button->set_sensitive (false);
1700 rec_enable_button->set_sensitive (false);
1701 solo_isolated_led->set_sensitive (false);
1702 solo_safe_led->set_sensitive (false);
1703 monitor_input_button->set_sensitive (false);
1704 monitor_disk_button->set_sensitive (false);
1706 if (boost::dynamic_pointer_cast<InternalSend>(send)) {
1707 output_button.set_sensitive (false);
1710 reset_strip_style ();
1714 MixerStrip::revert_to_default_display ()
1716 if (show_sends_button) {
1717 show_sends_button->set_active (false);
1722 set_current_delivery (_route->main_outs ());
1724 gain_meter().set_controls (_route, _route->shared_peak_meter(), _route->amp());
1725 gain_meter().setup_meters ();
1727 panner_ui().set_panner (_route->main_outs()->panner_shell(), _route->main_outs()->panner());
1728 panner_ui().setup_pan ();
1730 reset_strip_style ();
1734 MixerStrip::set_button_names ()
1738 rec_enable_button_label.set_text (_("Rec"));
1739 mute_button_label.set_text (_("Mute"));
1740 monitor_input_button_label.set_text (_("In"));
1741 monitor_disk_button_label.set_text (_("Disk"));
1742 if (_route && _route->solo_safe()) {
1743 solo_button_label.set_text (X_("!"));
1745 if (!Config->get_solo_control_is_listen_control()) {
1746 solo_button_label.set_text (_("Solo"));
1748 switch (Config->get_listen_position()) {
1749 case AfterFaderListen:
1750 solo_button_label.set_text (_("AFL"));
1752 case PreFaderListen:
1753 solo_button_label.set_text (_("PFL"));
1761 rec_enable_button_label.set_text (_("R"));
1762 mute_button_label.set_text (_("M"));
1763 monitor_input_button_label.set_text (_("I"));
1764 monitor_disk_button_label.set_text (_("D"));
1765 if (_route && _route->solo_safe()) {
1766 solo_button_label.set_text (X_("!"));
1767 if (!Config->get_solo_control_is_listen_control()) {
1768 solo_button_label.set_text (_("S"));
1770 switch (Config->get_listen_position()) {
1771 case AfterFaderListen:
1772 solo_button_label.set_text (_("A"));
1774 case PreFaderListen:
1775 solo_button_label.set_text (_("P"));
1786 MixerStrip::on_key_press_event (GdkEventKey* ev)
1788 GdkEventButton fake;
1789 fake.type = GDK_BUTTON_PRESS;
1791 fake.state = ev->state;
1793 switch (ev->keyval) {
1805 rec_enable_press (&fake);
1810 show_sends_press (&fake);
1815 if (ev->state & Keyboard::PrimaryModifier) {
1825 _route->set_gain (1.0, this);
1838 MixerStrip::on_key_release_event (GdkEventKey* ev)
1840 GdkEventButton fake;
1841 fake.type = GDK_BUTTON_RELEASE;
1843 fake.state = ev->state;
1845 switch (ev->keyval) {
1847 mute_release (&fake);
1852 solo_release (&fake);
1857 rec_enable_release (&fake);
1862 show_sends_release (&fake);
1878 MixerStrip::on_enter_notify_event (GdkEventCrossing*)
1880 Keyboard::magic_widget_grab_focus ();
1885 MixerStrip::on_leave_notify_event (GdkEventCrossing* ev)
1887 switch (ev->detail) {
1888 case GDK_NOTIFY_INFERIOR:
1891 Keyboard::magic_widget_drop_focus ();
1898 MixerStrip::plugin_selector()
1900 return _mixer.plugin_selector();
1904 MixerStrip::hide_things ()
1906 processor_box.hide_things ();
1910 MixerStrip::input_active_button_press (GdkEventButton*)
1912 /* nothing happens on press */
1917 MixerStrip::input_active_button_release (GdkEventButton* ev)
1919 boost::shared_ptr<MidiTrack> mt = midi_track ();
1925 if (mt->input_active()) {
1926 if (Keyboard::modifier_state_contains (ev->state, Keyboard::ModifierMask (Keyboard::PrimaryModifier|Keyboard::SecondaryModifier))) {
1927 /* turn all other tracks using this input off */
1928 _session->set_exclusive_input_active (mt, false);
1930 mt->set_input_active (false);
1934 if (Keyboard::modifier_state_contains (ev->state, Keyboard::ModifierMask (Keyboard::PrimaryModifier|Keyboard::SecondaryModifier))) {
1935 /* turn all other tracks using this input on */
1936 _session->set_exclusive_input_active (mt, true);
1938 mt->set_input_active (true);
1946 MixerStrip::midi_input_status_changed ()
1948 if (midi_input_enable_button) {
1949 boost::shared_ptr<MidiTrack> mt = midi_track ();
1951 midi_input_enable_button->set_active (mt->input_active ());
1956 MixerStrip::state_id () const
1958 return string_compose ("strip %1", _route->id().to_s());