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/pannable.h"
44 #include "ardour/panner.h"
45 #include "ardour/panner_shell.h"
46 #include "ardour/send.h"
47 #include "ardour/processor.h"
48 #include "ardour/profile.h"
49 #include "ardour/ladspa_plugin.h"
50 #include "ardour/user_bundle.h"
51 #include "ardour/port.h"
53 #include "ardour_ui.h"
54 #include "ardour_dialog.h"
55 #include "mixer_strip.h"
59 #include "public_editor.h"
61 #include "io_selector.h"
63 #include "gui_thread.h"
64 #include "route_group_menu.h"
68 using namespace ARDOUR
;
71 using namespace Gtkmm2ext
;
74 sigc::signal
<void,boost::shared_ptr
<Route
> > MixerStrip::SwitchIO
;
76 int MixerStrip::scrollbar_height
= 0;
77 PBD::Signal1
<void,MixerStrip
*> MixerStrip::CatchDeletion
;
79 MixerStrip::MixerStrip (Mixer_UI
& mx
, Session
* sess
, bool in_mixer
)
83 , _mixer_owned (in_mixer
)
84 , processor_box (sess
, boost::bind (&MixerStrip::plugin_selector
, this), mx
.selection(), this, in_mixer
)
88 , solo_led_table (2, 2)
89 , middle_button_table (1, 2)
90 , bottom_button_table (1, 2)
91 , meter_point_label (_("pre"))
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, 1)
113 , middle_button_table (1, 2)
114 , bottom_button_table (1, 2)
115 , meter_point_label (_("pre"))
127 _marked_for_display
= false;
129 ignore_comment_edit
= false;
130 ignore_toggle
= false;
136 /* the length of this string determines the width of the mixer strip when it is set to `wide' */
137 longest_label
= "longest label";
141 img
= manage (new Gtk::Image (::get_icon("strip_width")));
144 width_button
.add (*img
);
146 img
= manage (new Gtk::Image (::get_icon("hide")));
149 hide_button
.add (*img
);
151 input_label
.set_text (_("Input"));
152 ARDOUR_UI::instance()->set_tip (&input_button
, _("Button 1 to choose inputs from a port matrix, button 3 to select inputs from a menu"), "");
153 input_button
.add (input_label
);
154 input_button
.set_name ("MixerIOButton");
155 input_label
.set_name ("MixerIOButtonLabel");
157 Gtkmm2ext::set_size_request_to_display_given_text (input_button
, longest_label
.c_str(), 4, 4);
159 output_label
.set_text (_("Output"));
160 ARDOUR_UI::instance()->set_tip (&output_button
, _("Button 1 to choose outputs from a port matrix, button 3 to select inputs from a menu"), "");
161 output_button
.add (output_label
);
162 output_button
.set_name ("MixerIOButton");
163 output_label
.set_name ("MixerIOButtonLabel");
164 Gtkmm2ext::set_size_request_to_display_given_text (output_button
, longest_label
.c_str(), 4, 4);
166 ARDOUR_UI::instance()->set_tip (&meter_point_button
, _("Select metering point"), "");
167 meter_point_button
.add (meter_point_label
);
168 meter_point_button
.set_name ("MixerStripMeterPreButton");
169 meter_point_label
.set_name ("MixerStripMeterPreButton");
171 /* TRANSLATORS: this string should be longest of the strings
172 used to describe meter points. In english, it's "input".
174 set_size_request_to_display_given_text (meter_point_button
, _("tupni"), 5, 5);
176 bottom_button_table
.attach (meter_point_button
, 1, 2, 0, 1);
178 meter_point_button
.signal_button_press_event().connect (sigc::mem_fun (gpm
, &GainMeter::meter_press
), false);
179 meter_point_button
.signal_button_release_event().connect (sigc::mem_fun (gpm
, &GainMeter::meter_release
), false);
181 hide_button
.set_events (hide_button
.get_events() & ~(Gdk::ENTER_NOTIFY_MASK
|Gdk::LEAVE_NOTIFY_MASK
));
183 mute_button
->set_name ("MixerMuteButton");
184 solo_button
->set_name ("MixerSoloButton");
186 solo_isolated_led
= manage (new LED
);
187 solo_isolated_led
->show ();
188 solo_isolated_led
->set_diameter (6);
189 solo_isolated_led
->set_no_show_all (true);
190 solo_isolated_led
->set_name (X_("SoloIsolatedLED"));
191 solo_isolated_led
->add_events (Gdk::BUTTON_PRESS_MASK
|Gdk::BUTTON_RELEASE_MASK
);
192 solo_isolated_led
->signal_button_release_event().connect (sigc::mem_fun (*this, &RouteUI::solo_isolate_button_release
));
193 UI::instance()->set_tip (solo_isolated_led
, _("Isolate Solo"), "");
195 solo_safe_led
= manage (new LED
);
196 solo_safe_led
->show ();
197 solo_safe_led
->set_diameter (6);
198 solo_safe_led
->set_no_show_all (true);
199 solo_safe_led
->set_name (X_("SoloSafeLED"));
200 solo_safe_led
->add_events (Gdk::BUTTON_PRESS_MASK
|Gdk::BUTTON_RELEASE_MASK
);
201 solo_safe_led
->signal_button_release_event().connect (sigc::mem_fun (*this, &RouteUI::solo_safe_button_release
));
202 UI::instance()->set_tip (solo_safe_led
, _("Lock Solo Status"), "");
204 _iso_label
= manage (new Label (_("iso")));
205 _safe_label
= manage (new Label (_("lock")));
207 _iso_label
->set_name (X_("SoloLEDLabel"));
208 _safe_label
->set_name (X_("SoloLEDLabel"));
211 _safe_label
->show ();
213 solo_led_table
.set_spacings (0);
214 solo_led_table
.set_border_width (1);
215 solo_led_table
.attach (*_iso_label
, 0, 1, 0, 1, Gtk::FILL
, Gtk::FILL
);
216 solo_led_table
.attach (*solo_isolated_led
, 1, 2, 0, 1, Gtk::FILL
, Gtk::FILL
);
217 solo_led_table
.attach (*_safe_label
, 0, 1, 1, 2, Gtk::FILL
, Gtk::FILL
);
218 solo_led_table
.attach (*solo_safe_led
, 1, 2, 1, 2, Gtk::FILL
, Gtk::FILL
);
220 solo_led_table
.show ();
221 below_panner_box
.set_border_width (2);
222 below_panner_box
.set_spacing (2);
223 below_panner_box
.pack_end (solo_led_table
, false, false);
224 below_panner_box
.show ();
226 button_table
.set_homogeneous (true);
227 button_table
.set_spacings (0);
229 button_table
.attach (name_button
, 0, 1, 0, 1);
230 button_table
.attach (input_button
, 0, 1, 1, 2);
231 button_table
.attach (_invert_button_box
, 0, 1, 2, 3);
233 middle_button_table
.set_homogeneous (true);
234 middle_button_table
.set_spacings (0);
235 middle_button_table
.attach (*mute_button
, 0, 1, 0, 1);
236 middle_button_table
.attach (*solo_button
, 1, 2, 0, 1);
238 bottom_button_table
.set_col_spacings (0);
239 bottom_button_table
.set_homogeneous (true);
240 bottom_button_table
.attach (group_button
, 0, 1, 0, 1);
242 name_button
.add (name_label
);
243 name_button
.set_name ("MixerNameButton");
244 Gtkmm2ext::set_size_request_to_display_given_text (name_button
, longest_label
.c_str(), 2, 2);
246 name_label
.set_name ("MixerNameButtonLabel");
247 ARDOUR_UI::instance()->set_tip (&group_button
, _("Mix group"), "");
248 group_button
.add (group_label
);
249 group_button
.set_name ("MixerGroupButton");
250 Gtkmm2ext::set_size_request_to_display_given_text (group_button
, "Group", 2, 2);
251 group_label
.set_name ("MixerGroupButtonLabel");
253 global_vpacker
.set_border_width (0);
254 global_vpacker
.set_spacing (0);
256 width_button
.set_name ("MixerWidthButton");
257 hide_button
.set_name ("MixerHideButton");
258 top_event_box
.set_name ("MixerTopEventBox");
260 width_button
.signal_clicked().connect (sigc::mem_fun(*this, &MixerStrip::width_clicked
));
261 hide_button
.signal_clicked().connect (sigc::mem_fun(*this, &MixerStrip::hide_clicked
));
263 width_hide_box
.pack_start (width_button
, false, true);
264 width_hide_box
.pack_start (top_event_box
, true, true);
265 width_hide_box
.pack_end (hide_button
, false, true);
267 whvbox
.pack_start (width_hide_box
, true, true);
269 global_vpacker
.pack_start (whvbox
, Gtk::PACK_SHRINK
);
270 global_vpacker
.pack_start (button_table
, Gtk::PACK_SHRINK
);
271 global_vpacker
.pack_start (processor_box
, true, true);
272 global_vpacker
.pack_start (panners
, Gtk::PACK_SHRINK
);
273 global_vpacker
.pack_start (below_panner_box
, Gtk::PACK_SHRINK
);
274 global_vpacker
.pack_start (middle_button_table
, Gtk::PACK_SHRINK
);
275 global_vpacker
.pack_start (gpm
, Gtk::PACK_SHRINK
);
276 global_vpacker
.pack_start (bottom_button_table
, Gtk::PACK_SHRINK
);
277 global_vpacker
.pack_start (output_button
, Gtk::PACK_SHRINK
);
279 global_frame
.add (global_vpacker
);
280 global_frame
.set_shadow_type (Gtk::SHADOW_IN
);
281 global_frame
.set_name ("BaseFrame");
285 /* force setting of visible selected status */
288 set_selected (false);
293 _session
->engine().Stopped
.connect (*this, invalidator (*this), boost::bind (&MixerStrip::engine_stopped
, this), gui_context());
294 _session
->engine().Running
.connect (*this, invalidator (*this), boost::bind (&MixerStrip::engine_running
, this), gui_context());
296 input_button
.signal_button_press_event().connect (sigc::mem_fun(*this, &MixerStrip::input_press
), false);
297 output_button
.signal_button_press_event().connect (sigc::mem_fun(*this, &MixerStrip::output_press
), false);
299 /* we don't need this if its not an audio track, but we don't know that yet and it doesn't
303 rec_enable_button
->set_name ("MixerRecordEnableButton");
305 /* ditto for this button and busses */
307 name_button
.signal_button_press_event().connect (sigc::mem_fun(*this, &MixerStrip::name_button_button_press
), false);
308 group_button
.signal_button_press_event().connect (sigc::mem_fun(*this, &MixerStrip::select_route_group
), false);
312 /* start off as a passthru strip. we'll correct this, if necessary,
313 in update_diskstream_display().
316 /* start off as a passthru strip. we'll correct this, if necessary,
317 in update_diskstream_display().
321 set_name ("MidiTrackStripBase");
323 set_name ("AudioTrackStripBase");
325 add_events (Gdk::BUTTON_RELEASE_MASK
|
326 Gdk::ENTER_NOTIFY_MASK
|
327 Gdk::LEAVE_NOTIFY_MASK
|
329 Gdk::KEY_RELEASE_MASK
);
331 set_flags (get_flags() | Gtk::CAN_FOCUS
);
333 SwitchIO
.connect (sigc::mem_fun (*this, &MixerStrip::switch_io
));
335 AudioEngine::instance()->PortConnectedOrDisconnected
.connect (
336 *this, invalidator (*this), boost::bind (&MixerStrip::port_connected_or_disconnected
, this, _1
, _2
), gui_context ()
340 MixerStrip::~MixerStrip ()
342 CatchDeletion (this);
344 delete input_selector
;
345 delete output_selector
;
346 delete comment_window
;
350 MixerStrip::set_route (boost::shared_ptr
<Route
> rt
)
352 if (rec_enable_button
->get_parent()) {
353 below_panner_box
.remove (*rec_enable_button
);
356 if (show_sends_button
->get_parent()) {
357 below_panner_box
.remove (*show_sends_button
);
360 processor_box
.set_route (rt
);
362 RouteUI::set_route (rt
);
364 /* map the current state */
367 update_solo_display ();
369 delete input_selector
;
372 delete output_selector
;
375 revert_to_default_display ();
377 if (set_color_from_route()) {
378 set_color (unique_random_color());
381 if (route()->is_master()) {
382 solo_button
->hide ();
383 below_panner_box
.hide ();
385 solo_button
->show ();
386 below_panner_box
.show ();
389 if (_mixer_owned
&& (route()->is_master() || route()->is_monitor())) {
391 if (scrollbar_height
== 0) {
392 HScrollbar scrollbar
;
393 Gtk::Requisition
requisition(scrollbar
.size_request ());
394 scrollbar_height
= requisition
.height
;
397 spacer
= manage (new EventBox
);
398 spacer
->set_size_request (-1, scrollbar_height
);
399 global_vpacker
.pack_start (*spacer
, false, false);
402 if (is_audio_track()) {
403 boost::shared_ptr
<AudioTrack
> at
= audio_track();
404 at
->FreezeChange
.connect (route_connections
, invalidator (*this), boost::bind (&MixerStrip::map_frozen
, this), gui_context());
407 if (has_audio_outputs ()) {
415 below_panner_box
.pack_start (*rec_enable_button
);
416 rec_enable_button
->set_sensitive (_session
->writable());
417 rec_enable_button
->show();
423 if (!_route
->is_master()) {
424 below_panner_box
.pack_start (*show_sends_button
);
425 show_sends_button
->show();
429 meter_point_label
.set_text (meter_point_string (_route
->meter_point()));
431 delete route_ops_menu
;
434 _route
->meter_change
.connect (route_connections
, invalidator (*this), bind (&MixerStrip::meter_changed
, this), gui_context());
435 _route
->route_group_changed
.connect (route_connections
, invalidator (*this), boost::bind (&MixerStrip::route_group_changed
, this), gui_context());
437 if (_route
->panner()) {
438 _route
->panner_shell()->Changed
.connect (route_connections
, invalidator (*this), boost::bind (&MixerStrip::connect_to_pan
, this), gui_context());
441 if (is_audio_track()) {
442 audio_track()->DiskstreamChanged
.connect (route_connections
, invalidator (*this), boost::bind (&MixerStrip::diskstream_changed
, this), gui_context());
445 _route
->comment_changed
.connect (route_connections
, invalidator (*this), ui_bind (&MixerStrip::comment_changed
, this, _1
), gui_context());
446 _route
->gui_changed
.connect (route_connections
, invalidator (*this), ui_bind (&MixerStrip::route_gui_changed
, this, _1
, _2
), gui_context());
448 set_stuff_from_route ();
450 /* now force an update of all the various elements */
453 update_solo_display ();
456 route_group_changed ();
459 panners
.setup_pan ();
461 update_diskstream_display ();
462 update_input_display ();
463 update_output_display ();
465 add_events (Gdk::BUTTON_RELEASE_MASK
);
467 processor_box
.show ();
469 if (!route()->is_master() && !route()->is_monitor()) {
470 /* we don't allow master or control routes to be hidden */
475 width_hide_box
.show();
478 global_vpacker
.show();
480 middle_button_table
.show();
481 bottom_button_table
.show();
483 gain_unit_button
.show();
484 gain_unit_label
.show();
485 meter_point_button
.show();
486 meter_point_label
.show();
487 diskstream_button
.show();
488 diskstream_label
.show();
491 output_button
.show();
502 MixerStrip::set_stuff_from_route ()
508 /* if width is not set, it will be set by the MixerUI or editor */
510 if ((prop
= xml_node
->property ("strip-width")) != 0) {
511 set_width_enum (Width (string_2_enum (prop
->value(), _width
)), this);
514 if ((prop
= xml_node
->property ("shown-mixer")) != 0) {
515 if (prop
->value() == "no") {
516 _marked_for_display
= false;
518 _marked_for_display
= true;
521 /* backwards compatibility */
522 _marked_for_display
= true;
527 MixerStrip::set_width_enum (Width w
, void* owner
)
529 /* always set the gpm width again, things may be hidden */
532 panners
.set_width (w
);
534 boost::shared_ptr
<AutomationList
> gain_automation
= _route
->gain_control()->alist();
536 _width_owner
= owner
;
542 if (_width_owner
== this) {
543 xml_node
->add_property ("strip-width", enum_2_string (_width
));
550 if (show_sends_button
) {
551 ((Gtk::Label
*)show_sends_button
->get_child())->set_text (_("Sends"));
554 ((Gtk::Label
*)gpm
.gain_automation_style_button
.get_child())->set_text (
555 gpm
.astyle_string(gain_automation
->automation_style()));
556 ((Gtk::Label
*)gpm
.gain_automation_state_button
.get_child())->set_text (
557 gpm
.astate_string(gain_automation
->automation_state()));
559 if (_route
->panner()) {
560 ((Gtk::Label
*)panners
.pan_automation_style_button
.get_child())->set_text (
561 panners
.astyle_string(_route
->panner()->automation_style()));
562 ((Gtk::Label
*)panners
.pan_automation_state_button
.get_child())->set_text (
563 panners
.astate_string(_route
->panner()->automation_state()));
567 _safe_label
->show ();
569 Gtkmm2ext::set_size_request_to_display_given_text (name_button
, "long", 2, 2);
570 set_size_request (-1, -1);
574 if (show_sends_button
) {
575 ((Gtk::Label
*)show_sends_button
->get_child())->set_text (_("Snd"));
578 ((Gtk::Label
*)gpm
.gain_automation_style_button
.get_child())->set_text (
579 gpm
.short_astyle_string(gain_automation
->automation_style()));
580 ((Gtk::Label
*)gpm
.gain_automation_state_button
.get_child())->set_text (
581 gpm
.short_astate_string(gain_automation
->automation_state()));
583 if (_route
->panner()) {
584 ((Gtk::Label
*)panners
.pan_automation_style_button
.get_child())->set_text (
585 panners
.short_astyle_string(_route
->panner()->automation_style()));
586 ((Gtk::Label
*)panners
.pan_automation_state_button
.get_child())->set_text (
587 panners
.short_astate_string(_route
->panner()->automation_state()));
591 _safe_label
->hide ();
593 Gtkmm2ext::set_size_request_to_display_given_text (name_button
, longest_label
.c_str(), 2, 2);
594 set_size_request (max (50, gpm
.get_gm_width()), -1);
598 processor_box
.set_width (w
);
600 update_input_display ();
601 update_output_display ();
602 route_group_changed ();
608 MixerStrip::set_packed (bool yn
)
615 xml_node
->add_property ("shown-mixer", "yes");
617 xml_node
->add_property ("shown-mixer", "no");
622 struct RouteCompareByName
{
623 bool operator() (boost::shared_ptr
<Route
> a
, boost::shared_ptr
<Route
> b
) {
624 return a
->name().compare (b
->name()) < 0;
629 MixerStrip::output_press (GdkEventButton
*ev
)
631 using namespace Menu_Helpers
;
632 if (!_session
->engine().connected()) {
633 MessageDialog
msg (_("Not connected to JACK - no I/O changes are possible"));
638 MenuList
& citems
= output_menu
.items();
639 switch (ev
->button
) {
642 edit_output_configuration ();
647 output_menu
.set_name ("ArdourContextMenu");
649 output_menu_bundles
.clear ();
651 citems
.push_back (MenuElem (_("Disconnect"), sigc::mem_fun (*(static_cast<RouteUI
*>(this)), &RouteUI::disconnect_output
)));
652 citems
.push_back (SeparatorElem());
654 ARDOUR::BundleList current
= _route
->output()->bundles_connected ();
656 boost::shared_ptr
<ARDOUR::BundleList
> b
= _session
->bundles ();
658 /* give user bundles first chance at being in the menu */
660 for (ARDOUR::BundleList::iterator i
= b
->begin(); i
!= b
->end(); ++i
) {
661 if (boost::dynamic_pointer_cast
<UserBundle
> (*i
)) {
662 maybe_add_bundle_to_output_menu (*i
, current
);
666 for (ARDOUR::BundleList::iterator i
= b
->begin(); i
!= b
->end(); ++i
) {
667 if (boost::dynamic_pointer_cast
<UserBundle
> (*i
) == 0) {
668 maybe_add_bundle_to_output_menu (*i
, current
);
672 boost::shared_ptr
<ARDOUR::RouteList
> routes
= _session
->get_routes ();
673 RouteList copy
= *routes
;
674 copy
.sort (RouteCompareByName ());
675 for (ARDOUR::RouteList::const_iterator i
= copy
.begin(); i
!= copy
.end(); ++i
) {
676 maybe_add_bundle_to_output_menu ((*i
)->input()->bundle(), current
);
679 if (citems
.size() == 2) {
680 /* no routes added; remove the separator */
684 output_menu
.popup (1, ev
->time
);
695 MixerStrip::edit_output_configuration ()
697 if (output_selector
== 0) {
699 boost::shared_ptr
<Send
> send
;
700 boost::shared_ptr
<IO
> output
;
702 if ((send
= boost::dynamic_pointer_cast
<Send
>(_current_delivery
)) != 0) {
703 if (!boost::dynamic_pointer_cast
<InternalSend
>(send
)) {
704 output
= send
->output();
706 output
= _route
->output ();
709 output
= _route
->output ();
712 output_selector
= new IOSelectorWindow (_session
, output
);
715 if (output_selector
->is_visible()) {
716 output_selector
->get_toplevel()->get_window()->raise();
718 output_selector
->present ();
723 MixerStrip::edit_input_configuration ()
725 if (input_selector
== 0) {
726 input_selector
= new IOSelectorWindow (_session
, _route
->input());
729 if (input_selector
->is_visible()) {
730 input_selector
->get_toplevel()->get_window()->raise();
732 input_selector
->present ();
737 MixerStrip::input_press (GdkEventButton
*ev
)
739 using namespace Menu_Helpers
;
741 MenuList
& citems
= input_menu
.items();
742 input_menu
.set_name ("ArdourContextMenu");
745 if (!_session
->engine().connected()) {
746 MessageDialog
msg (_("Not connected to JACK - no I/O changes are possible"));
751 if (_session
->actively_recording() && _route
->record_enabled())
754 switch (ev
->button
) {
757 edit_input_configuration ();
762 citems
.push_back (MenuElem (_("Disconnect"), sigc::mem_fun (*(static_cast<RouteUI
*>(this)), &RouteUI::disconnect_input
)));
763 citems
.push_back (SeparatorElem());
764 input_menu_bundles
.clear ();
766 ARDOUR::BundleList current
= _route
->input()->bundles_connected ();
768 boost::shared_ptr
<ARDOUR::BundleList
> b
= _session
->bundles ();
770 /* give user bundles first chance at being in the menu */
772 for (ARDOUR::BundleList::iterator i
= b
->begin(); i
!= b
->end(); ++i
) {
773 if (boost::dynamic_pointer_cast
<UserBundle
> (*i
)) {
774 maybe_add_bundle_to_input_menu (*i
, current
);
778 for (ARDOUR::BundleList::iterator i
= b
->begin(); i
!= b
->end(); ++i
) {
779 if (boost::dynamic_pointer_cast
<UserBundle
> (*i
) == 0) {
780 maybe_add_bundle_to_input_menu (*i
, current
);
784 boost::shared_ptr
<ARDOUR::RouteList
> routes
= _session
->get_routes ();
785 RouteList copy
= *routes
;
786 copy
.sort (RouteCompareByName ());
787 for (ARDOUR::RouteList::const_iterator i
= copy
.begin(); i
!= copy
.end(); ++i
) {
788 maybe_add_bundle_to_input_menu ((*i
)->output()->bundle(), current
);
791 if (citems
.size() == 2) {
792 /* no routes added; remove the separator */
796 input_menu
.popup (1, ev
->time
);
806 MixerStrip::bundle_input_toggled (boost::shared_ptr
<ARDOUR::Bundle
> c
)
812 ARDOUR::BundleList current
= _route
->input()->bundles_connected ();
814 if (std::find (current
.begin(), current
.end(), c
) == current
.end()) {
815 _route
->input()->connect_ports_to_bundle (c
, this);
817 _route
->input()->disconnect_ports_from_bundle (c
, this);
822 MixerStrip::bundle_output_toggled (boost::shared_ptr
<ARDOUR::Bundle
> c
)
828 ARDOUR::BundleList current
= _route
->output()->bundles_connected ();
830 if (std::find (current
.begin(), current
.end(), c
) == current
.end()) {
831 _route
->output()->connect_ports_to_bundle (c
, this);
833 _route
->output()->disconnect_ports_from_bundle (c
, this);
838 MixerStrip::maybe_add_bundle_to_input_menu (boost::shared_ptr
<Bundle
> b
, ARDOUR::BundleList
const & current
)
840 using namespace Menu_Helpers
;
842 if (b
->ports_are_outputs() == false || b
->nchannels() != _route
->n_inputs()) {
846 list
<boost::shared_ptr
<Bundle
> >::iterator i
= input_menu_bundles
.begin ();
847 while (i
!= input_menu_bundles
.end() && b
->has_same_ports (*i
) == false) {
851 if (i
!= input_menu_bundles
.end()) {
855 input_menu_bundles
.push_back (b
);
857 MenuList
& citems
= input_menu
.items();
859 std::string n
= b
->name ();
860 replace_all (n
, "_", " ");
862 citems
.push_back (CheckMenuElem (n
, sigc::bind (sigc::mem_fun(*this, &MixerStrip::bundle_input_toggled
), b
)));
864 if (std::find (current
.begin(), current
.end(), b
) != current
.end()) {
865 ignore_toggle
= true;
866 dynamic_cast<CheckMenuItem
*> (&citems
.back())->set_active (true);
867 ignore_toggle
= false;
872 MixerStrip::maybe_add_bundle_to_output_menu (boost::shared_ptr
<Bundle
> b
, ARDOUR::BundleList
const & current
)
874 using namespace Menu_Helpers
;
876 if (b
->ports_are_inputs() == false || b
->nchannels() != _route
->n_outputs()) {
880 list
<boost::shared_ptr
<Bundle
> >::iterator i
= output_menu_bundles
.begin ();
881 while (i
!= output_menu_bundles
.end() && b
->has_same_ports (*i
) == false) {
885 if (i
!= output_menu_bundles
.end()) {
889 output_menu_bundles
.push_back (b
);
891 MenuList
& citems
= output_menu
.items();
893 std::string n
= b
->name ();
894 replace_all (n
, "_", " ");
896 citems
.push_back (CheckMenuElem (n
, sigc::bind (sigc::mem_fun(*this, &MixerStrip::bundle_output_toggled
), b
)));
898 if (std::find (current
.begin(), current
.end(), b
) != current
.end()) {
899 ignore_toggle
= true;
900 dynamic_cast<CheckMenuItem
*> (&citems
.back())->set_active (true);
901 ignore_toggle
= false;
906 MixerStrip::update_diskstream_display ()
910 if (input_selector
) {
911 input_selector
->hide_all ();
918 show_passthru_color ();
923 MixerStrip::connect_to_pan ()
925 ENSURE_GUI_THREAD (*this, &MixerStrip::connect_to_pan
)
927 panstate_connection
.disconnect ();
928 panstyle_connection
.disconnect ();
930 if (!_route
->panner()) {
934 boost::shared_ptr
<Pannable
> p
= _route
->pannable ();
936 p
->automation_state_changed
.connect (panstate_connection
, invalidator (*this), boost::bind (&PannerUI::pan_automation_state_changed
, &panners
), gui_context());
937 p
->automation_style_changed
.connect (panstyle_connection
, invalidator (*this), boost::bind (&PannerUI::pan_automation_style_changed
, &panners
), gui_context());
939 panners
.panshell_changed ();
944 * Output port labelling
945 * =====================
947 * Case 1: Each output has one connection, all connections are to system:playback_%i
948 * out 1 -> system:playback_1
949 * out 2 -> system:playback_2
950 * out 3 -> system:playback_3
953 * Case 2: Each output has one connection, all connections are to ardour:track_x/in 1
954 * out 1 -> ardour:track_x/in 1
955 * out 2 -> ardour:track_x/in 2
956 * Display as: track_x
958 * Case 3: Each output has one connection, all connections are to Jack client "program x"
959 * out 1 -> program x:foo
960 * out 2 -> program x:foo
961 * Display as: program x
963 * Case 4: No connections (Disconnected)
966 * Default case (unusual routing):
967 * Display as: *number of connections*
971 * .-----------------------------------------------.
973 * | out 1 -> ardour:master/in 1, jamin:input/in 1 |
974 * | out 2 -> ardour:master/in 2, jamin:input/in 2 |
975 * '-----------------------------------------------'
976 * .-----------------------------------------------.
979 * '-----------------------------------------------'
983 MixerStrip::update_io_button (boost::shared_ptr
<ARDOUR::Route
> route
, Width width
, bool for_input
)
988 vector
<string
> port_connections
;
990 uint32_t total_connection_count
= 0;
991 uint32_t io_connection_count
= 0;
992 uint32_t ardour_connection_count
= 0;
993 uint32_t system_connection_count
= 0;
994 uint32_t other_connection_count
= 0;
999 bool have_label
= false;
1000 bool each_io_has_one_connection
= true;
1002 string connection_name
;
1003 string ardour_track_name
;
1004 string other_connection_type
;
1005 string system_ports
;
1008 ostringstream tooltip
;
1009 char * tooltip_cstr
;
1011 tooltip
<< route
->name();
1014 io_count
= route
->n_inputs().n_total();
1016 io_count
= route
->n_outputs().n_total();
1019 for (io_index
= 0; io_index
< io_count
; ++io_index
) {
1021 port
= route
->input()->nth (io_index
);
1023 port
= route
->output()->nth (io_index
);
1026 port_connections
.clear ();
1027 port
->get_connections(port_connections
);
1028 io_connection_count
= 0;
1030 if (!port_connections
.empty()) {
1031 for (vector
<string
>::iterator i
= port_connections
.begin(); i
!= port_connections
.end(); ++i
) {
1032 string
& connection_name (*i
);
1034 if (io_connection_count
== 0) {
1035 tooltip
<< endl
<< port
->name().substr(port
->name().find("/") + 1) << " -> " << connection_name
;
1037 tooltip
<< ", " << connection_name
;
1040 if (connection_name
.find("ardour:") == 0) {
1041 if (ardour_track_name
.empty()) {
1042 // "ardour:Master/in 1" -> "ardour:Master/"
1043 string::size_type slash
= connection_name
.find("/");
1044 if (slash
!= string::npos
) {
1045 ardour_track_name
= connection_name
.substr(0, slash
+ 1);
1049 if (connection_name
.find(ardour_track_name
) == 0) {
1050 ++ardour_connection_count
;
1052 } else if (connection_name
.find("system:") == 0) {
1054 // "system:capture_123" -> "123"
1055 system_port
= connection_name
.substr(15);
1057 // "system:playback_123" -> "123"
1058 system_port
= connection_name
.substr(16);
1061 if (system_ports
.empty()) {
1062 system_ports
+= system_port
;
1064 system_ports
+= "/" + system_port
;
1067 ++system_connection_count
;
1069 if (other_connection_type
.empty()) {
1070 // "jamin:in 1" -> "jamin:"
1071 other_connection_type
= connection_name
.substr(0, connection_name
.find(":") + 1);
1074 if (connection_name
.find(other_connection_type
) == 0) {
1075 ++other_connection_count
;
1079 ++total_connection_count
;
1080 ++io_connection_count
;
1084 if (io_connection_count
!= 1) {
1085 each_io_has_one_connection
= false;
1089 if (total_connection_count
== 0) {
1090 tooltip
<< endl
<< _("Disconnected");
1093 tooltip_cstr
= new char[tooltip
.str().size() + 1];
1094 strcpy(tooltip_cstr
, tooltip
.str().c_str());
1097 ARDOUR_UI::instance()->set_tip (&input_button
, tooltip_cstr
, "");
1099 ARDOUR_UI::instance()->set_tip (&output_button
, tooltip_cstr
, "");
1102 if (each_io_has_one_connection
) {
1103 if ((total_connection_count
== ardour_connection_count
)) {
1104 // all connections are to the same track in ardour
1105 // "ardour:Master/" -> "Master"
1106 string::size_type slash
= ardour_track_name
.find("/");
1107 if (slash
!= string::npos
) {
1108 label
<< ardour_track_name
.substr(7, slash
- 7);
1112 else if (total_connection_count
== system_connection_count
) {
1113 // all connections are to system ports
1114 label
<< system_ports
;
1117 else if (total_connection_count
== other_connection_count
) {
1118 // all connections are to the same external program eg jamin
1119 // "jamin:" -> "jamin"
1120 label
<< other_connection_type
.substr(0, other_connection_type
.size() - 1);
1126 if (total_connection_count
== 0) {
1130 // Odd configuration
1131 label
<< "*" << total_connection_count
<< "*";
1137 label_string
= label
.str().substr(0, 6);
1140 label_string
= label
.str().substr(0, 3);
1145 input_label
.set_text (label_string
);
1147 output_label
.set_text (label_string
);
1152 MixerStrip::update_input_display ()
1154 update_io_button (_route
, _width
, true);
1155 panners
.setup_pan ();
1159 MixerStrip::update_output_display ()
1161 update_io_button (_route
, _width
, false);
1162 gpm
.setup_meters ();
1163 panners
.setup_pan ();
1167 MixerStrip::fast_update ()
1169 gpm
.update_meters ();
1173 MixerStrip::diskstream_changed ()
1175 Gtkmm2ext::UI::instance()->call_slot (invalidator (*this), boost::bind (&MixerStrip::update_diskstream_display
, this));
1179 MixerStrip::port_connected_or_disconnected (Port
* a
, Port
* b
)
1181 if (_route
->input()->has_port (a
) || _route
->input()->has_port (b
)) {
1182 update_input_display ();
1183 set_width_enum (_width
, this);
1186 if (_route
->output()->has_port (a
) || _route
->output()->has_port (b
)) {
1187 update_output_display ();
1188 set_width_enum (_width
, this);
1193 MixerStrip::comment_editor_done_editing ()
1195 ignore_toggle
= true;
1196 _comment_menu_item
->set_active (false);
1197 ignore_toggle
= false;
1199 string
const str
= comment_area
->get_buffer()->get_text();
1200 if (str
== _route
->comment ()) {
1204 _route
->set_comment (str
, this);
1208 MixerStrip::toggle_comment ()
1210 if (ignore_toggle
) {
1214 if (comment_window
== 0) {
1215 setup_comment_editor ();
1218 if (comment_window
->is_visible ()) {
1219 comment_window
->hide ();
1224 title
= _route
->name();
1225 title
+= _(": comment editor");
1227 comment_window
->set_title (title
);
1228 comment_window
->present();
1232 MixerStrip::setup_comment_editor ()
1234 comment_window
= new ArdourDialog ("", false); // title will be reset to show route
1235 comment_window
->set_position (Gtk::WIN_POS_MOUSE
);
1236 comment_window
->set_skip_taskbar_hint (true);
1237 comment_window
->signal_hide().connect (sigc::mem_fun(*this, &MixerStrip::comment_editor_done_editing
));
1238 comment_window
->set_default_size (400, 200);
1240 comment_area
= manage (new TextView());
1241 comment_area
->set_name ("MixerTrackCommentArea");
1242 comment_area
->set_wrap_mode (WRAP_WORD
);
1243 comment_area
->set_editable (true);
1244 comment_area
->get_buffer()->set_text (_route
->comment());
1245 comment_area
->show ();
1247 comment_window
->get_vbox()->pack_start (*comment_area
);
1248 comment_window
->get_action_area()->hide();
1252 MixerStrip::comment_changed (void *src
)
1254 ENSURE_GUI_THREAD (*this, &MixerStrip::comment_changed
, src
)
1257 ignore_comment_edit
= true;
1259 comment_area
->get_buffer()->set_text (_route
->comment());
1261 ignore_comment_edit
= false;
1266 MixerStrip::select_route_group (GdkEventButton
*ev
)
1268 using namespace Menu_Helpers
;
1270 if (ev
->button
== 1) {
1272 if (group_menu
== 0) {
1274 PropertyList
* plist
= new PropertyList();
1276 plist
->add (Properties::gain
, true);
1277 plist
->add (Properties::mute
, true);
1278 plist
->add (Properties::solo
, true);
1280 group_menu
= new RouteGroupMenu (_session
, plist
);
1284 r
.push_back (route ());
1285 group_menu
->build (r
);
1286 group_menu
->menu()->popup (1, ev
->time
);
1293 MixerStrip::route_group_changed ()
1295 ENSURE_GUI_THREAD (*this, &MixerStrip::route_group_changed
)
1297 RouteGroup
*rg
= _route
->route_group();
1300 group_label
.set_text (PBD::short_version (rg
->name(), 5));
1304 group_label
.set_text (_("Grp"));
1307 group_label
.set_text (_("~G"));
1315 MixerStrip::route_gui_changed (string what_changed
, void*)
1317 ENSURE_GUI_THREAD (*this, &MixerStrip::route_gui_changed
, what_changed
, ignored
)
1319 if (what_changed
== "color") {
1320 if (set_color_from_route () == 0) {
1321 show_route_color ();
1327 MixerStrip::show_route_color ()
1329 name_button
.modify_bg (STATE_NORMAL
, color());
1330 top_event_box
.modify_bg (STATE_NORMAL
, color());
1331 reset_strip_style ();
1335 MixerStrip::show_passthru_color ()
1337 reset_strip_style ();
1341 MixerStrip::build_route_ops_menu ()
1343 using namespace Menu_Helpers
;
1344 route_ops_menu
= new Menu
;
1345 route_ops_menu
->set_name ("ArdourContextMenu");
1347 MenuList
& items
= route_ops_menu
->items();
1349 items
.push_back (CheckMenuElem (_("Comments..."), sigc::mem_fun (*this, &MixerStrip::toggle_comment
)));
1350 _comment_menu_item
= dynamic_cast<CheckMenuItem
*> (&items
.back ());
1351 items
.push_back (MenuElem (_("Save As Template..."), sigc::mem_fun(*this, &RouteUI::save_as_template
)));
1352 items
.push_back (MenuElem (_("Rename..."), sigc::mem_fun(*this, &RouteUI::route_rename
)));
1353 rename_menu_item
= &items
.back();
1354 items
.push_back (SeparatorElem());
1355 items
.push_back (CheckMenuElem (_("Active")));
1356 CheckMenuItem
* i
= dynamic_cast<CheckMenuItem
*> (&items
.back());
1357 i
->set_active (_route
->active());
1358 i
->signal_activate().connect (sigc::bind (sigc::mem_fun (*this, &RouteUI::set_route_active
), !_route
->active(), false));
1360 items
.push_back (SeparatorElem());
1362 items
.push_back (MenuElem (_("Adjust Latency..."), sigc::mem_fun (*this, &RouteUI::adjust_latency
)));
1364 items
.push_back (SeparatorElem());
1365 items
.push_back (CheckMenuElem (_("Protect Against Denormals"), sigc::mem_fun (*this, &RouteUI::toggle_denormal_protection
)));
1366 denormal_menu_item
= dynamic_cast<CheckMenuItem
*> (&items
.back());
1367 denormal_menu_item
->set_active (_route
->denormal_protection());
1369 if (!Profile
->get_sae()) {
1370 items
.push_back (SeparatorElem());
1371 items
.push_back (MenuElem (_("Remote Control ID..."), sigc::mem_fun (*this, &RouteUI::open_remote_control_id_dialog
)));
1374 items
.push_back (SeparatorElem());
1375 items
.push_back (MenuElem (_("Remove"), sigc::bind (sigc::mem_fun(*this, &RouteUI::remove_this_route
), false)));
1379 MixerStrip::name_button_button_press (GdkEventButton
* ev
)
1381 if (ev
->button
== 3) {
1382 list_route_operations ();
1384 /* do not allow rename if the track is record-enabled */
1385 rename_menu_item
->set_sensitive (!_route
->record_enabled());
1386 route_ops_menu
->popup (1, ev
->time
);
1388 } else if (ev
->button
== 1) {
1389 revert_to_default_display ();
1396 MixerStrip::list_route_operations ()
1398 delete route_ops_menu
;
1399 build_route_ops_menu ();
1403 MixerStrip::set_selected (bool yn
)
1405 AxisView::set_selected (yn
);
1407 global_frame
.set_shadow_type (Gtk::SHADOW_ETCHED_OUT
);
1408 global_frame
.set_name ("MixerStripSelectedFrame");
1410 global_frame
.set_shadow_type (Gtk::SHADOW_IN
);
1411 global_frame
.set_name ("MixerStripFrame");
1413 global_frame
.queue_draw ();
1417 MixerStrip::name_changed ()
1421 RouteUI::property_changed (PropertyChange (ARDOUR::Properties::name
));
1424 name_label
.set_text (PBD::short_version (_route
->name(), 5));
1430 MixerStrip::width_clicked ()
1434 set_width_enum (Narrow
, this);
1437 set_width_enum (Wide
, this);
1443 MixerStrip::hide_clicked ()
1445 // LAME fix to reset the button status for when it is redisplayed (part 1)
1446 hide_button
.set_sensitive(false);
1449 Hiding(); /* EMIT_SIGNAL */
1451 _mixer
.hide_strip (this);
1455 hide_button
.set_sensitive(true);
1459 MixerStrip::set_embedded (bool yn
)
1465 MixerStrip::map_frozen ()
1467 ENSURE_GUI_THREAD (*this, &MixerStrip::map_frozen
)
1469 boost::shared_ptr
<AudioTrack
> at
= audio_track();
1472 switch (at
->freeze_state()) {
1473 case AudioTrack::Frozen
:
1474 processor_box
.set_sensitive (false);
1475 hide_redirect_editors ();
1478 processor_box
.set_sensitive (true);
1479 // XXX need some way, maybe, to retoggle redirect editors
1486 MixerStrip::hide_redirect_editors ()
1488 _route
->foreach_processor (sigc::mem_fun (*this, &MixerStrip::hide_processor_editor
));
1492 MixerStrip::hide_processor_editor (boost::weak_ptr
<Processor
> p
)
1494 boost::shared_ptr
<Processor
> processor (p
.lock ());
1499 Gtk::Window
* w
= processor_box
.get_processor_ui (processor
);
1507 MixerStrip::reset_strip_style ()
1509 if (_current_delivery
&& boost::dynamic_pointer_cast
<Send
>(_current_delivery
)) {
1511 gpm
.set_fader_name ("SendStripBase");
1515 if (is_midi_track()) {
1516 if (_route
->active()) {
1517 set_name ("MidiTrackStripBase");
1518 gpm
.set_meter_strip_name ("MidiTrackMetrics");
1520 set_name ("MidiTrackStripBaseInactive");
1521 gpm
.set_meter_strip_name ("MidiTrackMetricsInactive");
1523 gpm
.set_fader_name ("MidiTrackFader");
1524 } else if (is_audio_track()) {
1525 if (_route
->active()) {
1526 set_name ("AudioTrackStripBase");
1527 gpm
.set_meter_strip_name ("AudioTrackMetrics");
1529 set_name ("AudioTrackStripBaseInactive");
1530 gpm
.set_meter_strip_name ("AudioTrackMetricsInactive");
1532 gpm
.set_fader_name ("AudioTrackFader");
1534 if (_route
->active()) {
1535 set_name ("AudioBusStripBase");
1536 gpm
.set_meter_strip_name ("AudioBusMetrics");
1538 set_name ("AudioBusStripBaseInactive");
1539 gpm
.set_meter_strip_name ("AudioBusMetricsInactive");
1541 gpm
.set_fader_name ("AudioBusFader");
1543 /* (no MIDI busses yet) */
1549 MixerStrip::route_group() const
1551 return _route
->route_group();
1555 MixerStrip::engine_stopped ()
1560 MixerStrip::engine_running ()
1565 MixerStrip::meter_point_string (MeterPoint mp
)
1576 case MeterPostFader
:
1591 /** Called when the metering point has changed */
1593 MixerStrip::meter_changed ()
1595 meter_point_label
.set_text (meter_point_string (_route
->meter_point()));
1596 gpm
.setup_meters ();
1597 // reset peak when meter point changes
1598 gpm
.reset_peak_display();
1602 MixerStrip::switch_io (boost::shared_ptr
<Route
> target
)
1604 /* don't respond to switch IO signal outside of the mixer window */
1606 if (!_mixer_owned
) {
1610 if (_route
== target
|| _route
->is_master()) {
1611 /* don't change the display for the target or the master bus */
1613 } else if (!is_track() && show_sends_button
) {
1614 /* make sure our show sends button is inactive, and we no longer blink,
1615 since we're not the target.
1617 send_blink_connection
.disconnect ();
1618 show_sends_button
->set_active (false);
1619 show_sends_button
->set_state (STATE_NORMAL
);
1623 /* switch back to default */
1624 revert_to_default_display ();
1628 boost::shared_ptr
<Send
> send
= _route
->internal_send_for (target
);
1633 revert_to_default_display ();
1638 MixerStrip::drop_send ()
1640 boost::shared_ptr
<Send
> current_send
;
1642 if (_current_delivery
&& (current_send
= boost::dynamic_pointer_cast
<Send
>(_current_delivery
))) {
1643 current_send
->set_metering (false);
1646 send_gone_connection
.disconnect ();
1647 input_button
.set_sensitive (true);
1648 output_button
.set_sensitive (true);
1649 group_button
.set_sensitive (true);
1650 set_invert_sensitive (true);
1651 meter_point_button
.set_sensitive (true);
1652 mute_button
->set_sensitive (true);
1653 solo_button
->set_sensitive (true);
1654 rec_enable_button
->set_sensitive (true);
1655 solo_isolated_led
->set_sensitive (true);
1656 solo_safe_led
->set_sensitive (true);
1660 MixerStrip::set_current_delivery (boost::shared_ptr
<Delivery
> d
)
1662 _current_delivery
= d
;
1663 DeliveryChanged (_current_delivery
);
1667 MixerStrip::show_send (boost::shared_ptr
<Send
> send
)
1673 set_current_delivery (send
);
1675 send
->set_metering (true);
1676 _current_delivery
->DropReferences
.connect (send_gone_connection
, invalidator (*this), boost::bind (&MixerStrip::revert_to_default_display
, this), gui_context());
1678 gain_meter().set_controls (_route
, send
->meter(), send
->amp());
1679 gain_meter().setup_meters ();
1681 panner_ui().set_panner (_current_delivery
->panner_shell(), _current_delivery
->panner());
1682 panner_ui().setup_pan ();
1684 input_button
.set_sensitive (false);
1685 group_button
.set_sensitive (false);
1686 set_invert_sensitive (false);
1687 meter_point_button
.set_sensitive (false);
1688 mute_button
->set_sensitive (false);
1689 solo_button
->set_sensitive (false);
1690 rec_enable_button
->set_sensitive (false);
1691 solo_isolated_led
->set_sensitive (false);
1692 solo_safe_led
->set_sensitive (false);
1694 if (boost::dynamic_pointer_cast
<InternalSend
>(send
)) {
1695 output_button
.set_sensitive (false);
1698 reset_strip_style ();
1702 MixerStrip::revert_to_default_display ()
1704 if (show_sends_button
) {
1705 show_sends_button
->set_active (false);
1710 set_current_delivery (_route
->main_outs ());
1712 gain_meter().set_controls (_route
, _route
->shared_peak_meter(), _route
->amp());
1713 gain_meter().setup_meters ();
1715 panner_ui().set_panner (_route
->main_outs()->panner_shell(), _route
->main_outs()->panner());
1716 panner_ui().setup_pan ();
1718 reset_strip_style ();
1722 MixerStrip::set_button_names ()
1726 rec_enable_button_label
.set_text (_("Rec"));
1727 mute_button_label
.set_text (_("Mute"));
1728 if (_route
&& _route
->solo_safe()) {
1729 solo_button_label
.set_text (X_("!"));
1731 if (!Config
->get_solo_control_is_listen_control()) {
1732 solo_button_label
.set_text (_("Solo"));
1734 switch (Config
->get_listen_position()) {
1735 case AfterFaderListen
:
1736 solo_button_label
.set_text (_("AFL"));
1738 case PreFaderListen
:
1739 solo_button_label
.set_text (_("PFL"));
1747 rec_enable_button_label
.set_text (_("R"));
1748 mute_button_label
.set_text (_("M"));
1749 if (_route
&& _route
->solo_safe()) {
1750 solo_button_label
.set_text (X_("!"));
1751 if (!Config
->get_solo_control_is_listen_control()) {
1752 solo_button_label
.set_text (_("S"));
1754 switch (Config
->get_listen_position()) {
1755 case AfterFaderListen
:
1756 solo_button_label
.set_text (_("A"));
1758 case PreFaderListen
:
1759 solo_button_label
.set_text (_("P"));
1770 MixerStrip::on_key_press_event (GdkEventKey
* ev
)
1772 GdkEventButton fake
;
1773 fake
.type
= GDK_BUTTON_PRESS
;
1775 fake
.state
= ev
->state
;
1777 switch (ev
->keyval
) {
1789 cerr
<< "Stole that r\n";
1790 rec_enable_press (&fake
);
1795 show_sends_press (&fake
);
1800 if (ev
->state
& Keyboard::PrimaryModifier
) {
1810 _route
->set_gain (1.0, this);
1823 MixerStrip::on_key_release_event (GdkEventKey
* ev
)
1825 GdkEventButton fake
;
1826 fake
.type
= GDK_BUTTON_RELEASE
;
1828 fake
.state
= ev
->state
;
1830 switch (ev
->keyval
) {
1832 mute_release (&fake
);
1837 solo_release (&fake
);
1842 cerr
<< "Stole that r\n";
1843 rec_enable_release (&fake
);
1848 show_sends_release (&fake
);
1864 MixerStrip::on_enter_notify_event (GdkEventCrossing
*)
1866 Keyboard::magic_widget_grab_focus ();
1871 MixerStrip::on_leave_notify_event (GdkEventCrossing
* ev
)
1873 switch (ev
->detail
) {
1874 case GDK_NOTIFY_INFERIOR
:
1877 Keyboard::magic_widget_drop_focus ();
1884 MixerStrip::plugin_selector()
1886 return _mixer
.plugin_selector();
1890 MixerStrip::hide_things ()
1892 processor_box
.hide_things ();