2 Copyright (C) 2000-2006 Paul Davis
4 This program is free software; you can redistribute it and/or modify
5 it under the terms of the GNU General Public License as published by
6 the Free Software Foundation; either version 2 of the License, or
7 (at your option) any later version.
9 This program is distributed in the hope that it will be useful,
10 but WITHOUT ANY WARRANTY; without even the implied warranty of
11 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 GNU General Public License for more details.
14 You should have received a copy of the GNU General Public License
15 along with this program; if not, write to the Free Software
16 Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
22 #include <sigc++/bind.h>
24 #include "pbd/convert.h"
25 #include "pbd/enumwriter.h"
26 #include "pbd/replace_all.h"
28 #include <gtkmm2ext/gtk_ui.h>
29 #include <gtkmm2ext/utils.h>
30 #include <gtkmm2ext/choice.h>
31 #include <gtkmm2ext/doi.h>
32 #include <gtkmm2ext/slider_controller.h>
33 #include <gtkmm2ext/bindable_button.h>
35 #include "ardour/ardour.h"
36 #include "ardour/amp.h"
37 #include "ardour/session.h"
38 #include "ardour/audioengine.h"
39 #include "ardour/internal_send.h"
40 #include "ardour/route.h"
41 #include "ardour/route_group.h"
42 #include "ardour/audio_track.h"
43 #include "ardour/midi_track.h"
44 #include "ardour/pannable.h"
45 #include "ardour/panner.h"
46 #include "ardour/panner_shell.h"
47 #include "ardour/send.h"
48 #include "ardour/processor.h"
49 #include "ardour/profile.h"
50 #include "ardour/ladspa_plugin.h"
51 #include "ardour/user_bundle.h"
52 #include "ardour/port.h"
54 #include "ardour_ui.h"
55 #include "ardour_dialog.h"
56 #include "mixer_strip.h"
60 #include "public_editor.h"
62 #include "io_selector.h"
64 #include "gui_thread.h"
65 #include "route_group_menu.h"
69 using namespace ARDOUR
;
72 using namespace Gtkmm2ext
;
75 sigc::signal
<void,boost::shared_ptr
<Route
> > MixerStrip::SwitchIO
;
77 int MixerStrip::scrollbar_height
= 0;
78 PBD::Signal1
<void,MixerStrip
*> MixerStrip::CatchDeletion
;
80 MixerStrip::MixerStrip (Mixer_UI
& mx
, Session
* sess
, bool in_mixer
)
84 , _mixer_owned (in_mixer
)
85 , processor_box (sess
, boost::bind (&MixerStrip::plugin_selector
, this), mx
.selection(), this, in_mixer
)
89 , solo_led_table (2, 2)
90 , middle_button_table (1, 2)
91 , bottom_button_table (1, 2)
92 , meter_point_label (_("pre"))
93 , midi_input_enable_button (0)
98 /* the editor mixer strip: don't destroy it every time
99 the underlying route goes away.
102 self_destruct
= false;
106 MixerStrip::MixerStrip (Mixer_UI
& mx
, Session
* sess
, boost::shared_ptr
<Route
> rt
, bool in_mixer
)
110 , _mixer_owned (in_mixer
)
111 , processor_box (sess
, sigc::mem_fun(*this, &MixerStrip::plugin_selector
), mx
.selection(), this, in_mixer
)
114 , button_table (3, 1)
115 , middle_button_table (1, 2)
116 , bottom_button_table (1, 2)
117 , meter_point_label (_("pre"))
118 , midi_input_enable_button (0)
131 ignore_comment_edit
= false;
132 ignore_toggle
= false;
138 /* the length of this string determines the width of the mixer strip when it is set to `wide' */
139 longest_label
= "longest label";
143 img
= manage (new Gtk::Image (::get_icon("strip_width")));
146 width_button
.add (*img
);
148 img
= manage (new Gtk::Image (::get_icon("hide")));
151 hide_button
.add (*img
);
153 input_label
.set_text (_("Input"));
154 ARDOUR_UI::instance()->set_tip (&input_button
, _("Button 1 to choose inputs from a port matrix, button 3 to select inputs from a menu"), "");
155 input_button
.add (input_label
);
156 input_button
.set_name ("MixerIOButton");
157 input_label
.set_name ("MixerIOButtonLabel");
158 input_button_box
.pack_start (input_button
, true, true);
160 output_label
.set_text (_("Output"));
161 ARDOUR_UI::instance()->set_tip (&output_button
, _("Button 1 to choose outputs from a port matrix, button 3 to select inputs from a menu"), "");
162 output_button
.add (output_label
);
163 output_button
.set_name ("MixerIOButton");
164 output_label
.set_name ("MixerIOButtonLabel");
165 Gtkmm2ext::set_size_request_to_display_given_text (output_button
, longest_label
.c_str(), 4, 4);
167 ARDOUR_UI::instance()->set_tip (&meter_point_button
, _("Select metering point"), "");
168 meter_point_button
.add (meter_point_label
);
169 meter_point_button
.set_name ("MixerStripMeterPreButton");
170 meter_point_label
.set_name ("MixerStripMeterPreButton");
172 /* TRANSLATORS: this string should be longest of the strings
173 used to describe meter points. In english, it's "input".
175 set_size_request_to_display_given_text (meter_point_button
, _("tupni"), 5, 5);
177 bottom_button_table
.attach (meter_point_button
, 1, 2, 0, 1);
179 meter_point_button
.signal_button_press_event().connect (sigc::mem_fun (gpm
, &GainMeter::meter_press
), false);
180 meter_point_button
.signal_button_release_event().connect (sigc::mem_fun (gpm
, &GainMeter::meter_release
), false);
182 hide_button
.set_events (hide_button
.get_events() & ~(Gdk::ENTER_NOTIFY_MASK
|Gdk::LEAVE_NOTIFY_MASK
));
184 mute_button
->set_name ("MixerMuteButton");
185 solo_button
->set_name ("MixerSoloButton");
187 solo_isolated_led
= manage (new LED
);
188 solo_isolated_led
->show ();
189 solo_isolated_led
->set_diameter (6);
190 solo_isolated_led
->set_no_show_all (true);
191 solo_isolated_led
->set_name (X_("SoloIsolatedLED"));
192 solo_isolated_led
->add_events (Gdk::BUTTON_PRESS_MASK
|Gdk::BUTTON_RELEASE_MASK
);
193 solo_isolated_led
->signal_button_release_event().connect (sigc::mem_fun (*this, &RouteUI::solo_isolate_button_release
));
194 UI::instance()->set_tip (solo_isolated_led
, _("Isolate Solo"), "");
196 solo_safe_led
= manage (new LED
);
197 solo_safe_led
->show ();
198 solo_safe_led
->set_diameter (6);
199 solo_safe_led
->set_no_show_all (true);
200 solo_safe_led
->set_name (X_("SoloSafeLED"));
201 solo_safe_led
->add_events (Gdk::BUTTON_PRESS_MASK
|Gdk::BUTTON_RELEASE_MASK
);
202 solo_safe_led
->signal_button_release_event().connect (sigc::mem_fun (*this, &RouteUI::solo_safe_button_release
));
203 UI::instance()->set_tip (solo_safe_led
, _("Lock Solo Status"), "");
205 _iso_label
= manage (new Label (_("iso")));
206 _safe_label
= manage (new Label (_("lock")));
208 _iso_label
->set_name (X_("SoloLEDLabel"));
209 _safe_label
->set_name (X_("SoloLEDLabel"));
212 _safe_label
->show ();
214 solo_led_table
.set_spacings (0);
215 solo_led_table
.set_border_width (1);
216 solo_led_table
.attach (*_iso_label
, 0, 1, 0, 1, Gtk::FILL
, Gtk::FILL
);
217 solo_led_table
.attach (*solo_isolated_led
, 1, 2, 0, 1, Gtk::FILL
, Gtk::FILL
);
218 solo_led_table
.attach (*_safe_label
, 0, 1, 1, 2, Gtk::FILL
, Gtk::FILL
);
219 solo_led_table
.attach (*solo_safe_led
, 1, 2, 1, 2, Gtk::FILL
, Gtk::FILL
);
221 solo_led_table
.show ();
222 below_panner_box
.set_border_width (2);
223 below_panner_box
.set_spacing (2);
224 below_panner_box
.pack_end (solo_led_table
, false, false);
225 below_panner_box
.show ();
227 button_table
.set_homogeneous (true);
228 button_table
.set_spacings (0);
230 button_table
.attach (name_button
, 0, 1, 0, 1);
231 button_table
.attach (input_button_box
, 0, 1, 1, 2);
232 button_table
.attach (_invert_button_box
, 0, 1, 2, 3);
234 middle_button_table
.set_homogeneous (true);
235 middle_button_table
.set_spacings (0);
236 middle_button_table
.attach (*mute_button
, 0, 1, 0, 1);
237 middle_button_table
.attach (*solo_button
, 1, 2, 0, 1);
239 bottom_button_table
.set_col_spacings (0);
240 bottom_button_table
.set_homogeneous (true);
241 bottom_button_table
.attach (group_button
, 0, 1, 0, 1);
243 name_button
.add (name_label
);
244 name_button
.set_name ("MixerNameButton");
245 Gtkmm2ext::set_size_request_to_display_given_text (name_button
, longest_label
.c_str(), 2, 2);
247 name_label
.set_name ("MixerNameButtonLabel");
248 ARDOUR_UI::instance()->set_tip (&group_button
, _("Mix group"), "");
249 group_button
.add (group_label
);
250 group_button
.set_name ("MixerGroupButton");
251 Gtkmm2ext::set_size_request_to_display_given_text (group_button
, "Group", 2, 2);
252 group_label
.set_name ("MixerGroupButtonLabel");
254 global_vpacker
.set_border_width (0);
255 global_vpacker
.set_spacing (0);
257 width_button
.set_name ("MixerWidthButton");
258 hide_button
.set_name ("MixerHideButton");
259 top_event_box
.set_name ("MixerTopEventBox");
261 width_button
.signal_clicked().connect (sigc::mem_fun(*this, &MixerStrip::width_clicked
));
262 hide_button
.signal_clicked().connect (sigc::mem_fun(*this, &MixerStrip::hide_clicked
));
264 width_hide_box
.pack_start (width_button
, false, true);
265 width_hide_box
.pack_start (top_event_box
, true, true);
266 width_hide_box
.pack_end (hide_button
, false, true);
268 whvbox
.pack_start (width_hide_box
, true, true);
270 global_vpacker
.pack_start (whvbox
, Gtk::PACK_SHRINK
);
271 global_vpacker
.pack_start (button_table
, Gtk::PACK_SHRINK
);
272 global_vpacker
.pack_start (processor_box
, true, true);
273 global_vpacker
.pack_start (panners
, Gtk::PACK_SHRINK
);
274 global_vpacker
.pack_start (below_panner_box
, Gtk::PACK_SHRINK
);
275 global_vpacker
.pack_start (middle_button_table
, Gtk::PACK_SHRINK
);
276 global_vpacker
.pack_start (gpm
, Gtk::PACK_SHRINK
);
277 global_vpacker
.pack_start (bottom_button_table
, Gtk::PACK_SHRINK
);
278 global_vpacker
.pack_start (output_button
, Gtk::PACK_SHRINK
);
280 global_frame
.add (global_vpacker
);
281 global_frame
.set_shadow_type (Gtk::SHADOW_IN
);
282 global_frame
.set_name ("BaseFrame");
286 /* force setting of visible selected status */
289 set_selected (false);
294 _session
->engine().Stopped
.connect (*this, invalidator (*this), boost::bind (&MixerStrip::engine_stopped
, this), gui_context());
295 _session
->engine().Running
.connect (*this, invalidator (*this), boost::bind (&MixerStrip::engine_running
, this), gui_context());
297 input_button
.signal_button_press_event().connect (sigc::mem_fun(*this, &MixerStrip::input_press
), false);
298 output_button
.signal_button_press_event().connect (sigc::mem_fun(*this, &MixerStrip::output_press
), false);
300 /* we don't need this if its not an audio track, but we don't know that yet and it doesn't
304 rec_enable_button
->set_name ("MixerRecordEnableButton");
306 /* ditto for this button and busses */
308 name_button
.signal_button_press_event().connect (sigc::mem_fun(*this, &MixerStrip::name_button_button_press
), false);
309 group_button
.signal_button_press_event().connect (sigc::mem_fun(*this, &MixerStrip::select_route_group
), false);
313 /* start off as a passthru strip. we'll correct this, if necessary,
314 in update_diskstream_display().
317 /* start off as a passthru strip. we'll correct this, if necessary,
318 in update_diskstream_display().
322 set_name ("MidiTrackStripBase");
324 set_name ("AudioTrackStripBase");
326 add_events (Gdk::BUTTON_RELEASE_MASK
|
327 Gdk::ENTER_NOTIFY_MASK
|
328 Gdk::LEAVE_NOTIFY_MASK
|
330 Gdk::KEY_RELEASE_MASK
);
332 set_flags (get_flags() | Gtk::CAN_FOCUS
);
334 SwitchIO
.connect (sigc::mem_fun (*this, &MixerStrip::switch_io
));
336 AudioEngine::instance()->PortConnectedOrDisconnected
.connect (
337 *this, invalidator (*this), boost::bind (&MixerStrip::port_connected_or_disconnected
, this, _1
, _2
), gui_context ()
341 MixerStrip::~MixerStrip ()
343 CatchDeletion (this);
345 delete input_selector
;
346 delete output_selector
;
347 delete comment_window
;
351 MixerStrip::set_route (boost::shared_ptr
<Route
> rt
)
353 if (rec_enable_button
->get_parent()) {
354 below_panner_box
.remove (*rec_enable_button
);
357 if (show_sends_button
->get_parent()) {
358 below_panner_box
.remove (*show_sends_button
);
361 processor_box
.set_route (rt
);
363 RouteUI::set_route (rt
);
365 /* map the current state */
368 update_solo_display ();
370 delete input_selector
;
373 delete output_selector
;
376 revert_to_default_display ();
378 if (set_color_from_route()) {
379 set_color (unique_random_color());
382 if (route()->is_master()) {
383 solo_button
->hide ();
384 below_panner_box
.hide ();
386 solo_button
->show ();
387 below_panner_box
.show ();
390 if (_mixer_owned
&& (route()->is_master() || route()->is_monitor())) {
392 if (scrollbar_height
== 0) {
393 HScrollbar scrollbar
;
394 Gtk::Requisition
requisition(scrollbar
.size_request ());
395 scrollbar_height
= requisition
.height
;
398 spacer
= manage (new EventBox
);
399 spacer
->set_size_request (-1, scrollbar_height
);
400 global_vpacker
.pack_start (*spacer
, false, false);
403 if (is_midi_track()) {
404 if (midi_input_enable_button
== 0) {
405 Image
* img
= manage (new Image (get_icon (X_("midi_socket_small"))));
406 midi_input_enable_button
= manage (new StatefulToggleButton
);
407 midi_input_enable_button
->set_name ("MixerMidiInputEnableButton");
408 midi_input_enable_button
->set_image (*img
);
409 midi_input_enable_button
->signal_button_press_event().connect (sigc::mem_fun (*this, &MixerStrip::input_active_button_press
), false);
410 midi_input_enable_button
->signal_button_release_event().connect (sigc::mem_fun (*this, &MixerStrip::input_active_button_release
), false);
411 ARDOUR_UI::instance()->set_tip (midi_input_enable_button
, _("Enable/Disable MIDI input"));
413 input_button_box
.remove (*midi_input_enable_button
);
415 /* get current state */
416 midi_input_status_changed ();
417 input_button_box
.pack_start (*midi_input_enable_button
, false, false);
419 midi_track()->InputActiveChanged
.connect (route_connections
, invalidator (*this), boost::bind (&MixerStrip::midi_input_status_changed
, this), gui_context());
421 if (midi_input_enable_button
) {
422 /* removal from the container will delete it */
423 input_button_box
.remove (*midi_input_enable_button
);
424 midi_input_enable_button
= 0;
428 if (is_audio_track()) {
429 boost::shared_ptr
<AudioTrack
> at
= audio_track();
430 at
->FreezeChange
.connect (route_connections
, invalidator (*this), boost::bind (&MixerStrip::map_frozen
, this), gui_context());
433 if (has_audio_outputs ()) {
441 below_panner_box
.pack_start (*rec_enable_button
);
442 rec_enable_button
->set_sensitive (_session
->writable());
443 rec_enable_button
->show();
449 if (!_route
->is_master()) {
450 below_panner_box
.pack_start (*show_sends_button
);
451 show_sends_button
->show();
455 meter_point_label
.set_text (meter_point_string (_route
->meter_point()));
457 delete route_ops_menu
;
460 _route
->meter_change
.connect (route_connections
, invalidator (*this), bind (&MixerStrip::meter_changed
, this), gui_context());
461 _route
->route_group_changed
.connect (route_connections
, invalidator (*this), boost::bind (&MixerStrip::route_group_changed
, this), gui_context());
463 if (_route
->panner()) {
464 _route
->panner_shell()->Changed
.connect (route_connections
, invalidator (*this), boost::bind (&MixerStrip::connect_to_pan
, this), gui_context());
467 if (is_audio_track()) {
468 audio_track()->DiskstreamChanged
.connect (route_connections
, invalidator (*this), boost::bind (&MixerStrip::diskstream_changed
, this), gui_context());
471 _route
->comment_changed
.connect (route_connections
, invalidator (*this), ui_bind (&MixerStrip::comment_changed
, this, _1
), gui_context());
472 _route
->gui_changed
.connect (route_connections
, invalidator (*this), ui_bind (&MixerStrip::route_gui_changed
, this, _1
, _2
), gui_context());
474 set_stuff_from_route ();
476 /* now force an update of all the various elements */
479 update_solo_display ();
482 route_group_changed ();
485 panners
.setup_pan ();
487 update_diskstream_display ();
488 update_input_display ();
489 update_output_display ();
491 add_events (Gdk::BUTTON_RELEASE_MASK
);
493 processor_box
.show ();
495 if (!route()->is_master() && !route()->is_monitor()) {
496 /* we don't allow master or control routes to be hidden */
501 width_hide_box
.show();
504 global_vpacker
.show();
506 middle_button_table
.show();
507 bottom_button_table
.show();
509 gain_unit_button
.show();
510 gain_unit_label
.show();
511 meter_point_button
.show();
512 meter_point_label
.show();
513 diskstream_button
.show();
514 diskstream_label
.show();
515 input_button_box
.show_all();
516 output_button
.show();
527 MixerStrip::set_stuff_from_route ()
529 /* if width is not set, it will be set by the MixerUI or editor */
531 string str
= gui_property ("strip-width");
533 set_width_enum (Width (string_2_enum (str
, _width
)), this);
538 MixerStrip::set_width_enum (Width w
, void* owner
)
540 /* always set the gpm width again, things may be hidden */
543 panners
.set_width (w
);
545 boost::shared_ptr
<AutomationList
> gain_automation
= _route
->gain_control()->alist();
547 _width_owner
= owner
;
551 if (_width_owner
== this) {
552 set_gui_property ("strip-width", enum_2_string (_width
));
559 if (show_sends_button
) {
560 ((Gtk::Label
*)show_sends_button
->get_child())->set_text (_("Sends"));
563 ((Gtk::Label
*)gpm
.gain_automation_style_button
.get_child())->set_text (
564 gpm
.astyle_string(gain_automation
->automation_style()));
565 ((Gtk::Label
*)gpm
.gain_automation_state_button
.get_child())->set_text (
566 gpm
.astate_string(gain_automation
->automation_state()));
568 if (_route
->panner()) {
569 ((Gtk::Label
*)panners
.pan_automation_style_button
.get_child())->set_text (
570 panners
.astyle_string(_route
->panner()->automation_style()));
571 ((Gtk::Label
*)panners
.pan_automation_state_button
.get_child())->set_text (
572 panners
.astate_string(_route
->panner()->automation_state()));
576 _safe_label
->show ();
578 Gtkmm2ext::set_size_request_to_display_given_text (name_button
, "long", 2, 2);
579 set_size_request (-1, -1);
583 if (show_sends_button
) {
584 ((Gtk::Label
*)show_sends_button
->get_child())->set_text (_("Snd"));
587 ((Gtk::Label
*)gpm
.gain_automation_style_button
.get_child())->set_text (
588 gpm
.short_astyle_string(gain_automation
->automation_style()));
589 ((Gtk::Label
*)gpm
.gain_automation_state_button
.get_child())->set_text (
590 gpm
.short_astate_string(gain_automation
->automation_state()));
592 if (_route
->panner()) {
593 ((Gtk::Label
*)panners
.pan_automation_style_button
.get_child())->set_text (
594 panners
.short_astyle_string(_route
->panner()->automation_style()));
595 ((Gtk::Label
*)panners
.pan_automation_state_button
.get_child())->set_text (
596 panners
.short_astate_string(_route
->panner()->automation_state()));
600 _safe_label
->hide ();
602 Gtkmm2ext::set_size_request_to_display_given_text (name_button
, longest_label
.c_str(), 2, 2);
603 set_size_request (max (50, gpm
.get_gm_width()), -1);
607 processor_box
.set_width (w
);
609 update_input_display ();
610 update_output_display ();
611 route_group_changed ();
617 MixerStrip::set_packed (bool yn
)
622 set_gui_property ("visible", true);
624 set_gui_property ("visible", false);
629 struct RouteCompareByName
{
630 bool operator() (boost::shared_ptr
<Route
> a
, boost::shared_ptr
<Route
> b
) {
631 return a
->name().compare (b
->name()) < 0;
636 MixerStrip::output_press (GdkEventButton
*ev
)
638 using namespace Menu_Helpers
;
639 if (!_session
->engine().connected()) {
640 MessageDialog
msg (_("Not connected to JACK - no I/O changes are possible"));
645 MenuList
& citems
= output_menu
.items();
646 switch (ev
->button
) {
649 edit_output_configuration ();
654 output_menu
.set_name ("ArdourContextMenu");
656 output_menu_bundles
.clear ();
658 citems
.push_back (MenuElem (_("Disconnect"), sigc::mem_fun (*(static_cast<RouteUI
*>(this)), &RouteUI::disconnect_output
)));
659 citems
.push_back (SeparatorElem());
661 ARDOUR::BundleList current
= _route
->output()->bundles_connected ();
663 boost::shared_ptr
<ARDOUR::BundleList
> b
= _session
->bundles ();
665 /* give user bundles first chance at being in the menu */
667 for (ARDOUR::BundleList::iterator i
= b
->begin(); i
!= b
->end(); ++i
) {
668 if (boost::dynamic_pointer_cast
<UserBundle
> (*i
)) {
669 maybe_add_bundle_to_output_menu (*i
, current
);
673 for (ARDOUR::BundleList::iterator i
= b
->begin(); i
!= b
->end(); ++i
) {
674 if (boost::dynamic_pointer_cast
<UserBundle
> (*i
) == 0) {
675 maybe_add_bundle_to_output_menu (*i
, current
);
679 boost::shared_ptr
<ARDOUR::RouteList
> routes
= _session
->get_routes ();
680 RouteList copy
= *routes
;
681 copy
.sort (RouteCompareByName ());
682 for (ARDOUR::RouteList::const_iterator i
= copy
.begin(); i
!= copy
.end(); ++i
) {
683 maybe_add_bundle_to_output_menu ((*i
)->input()->bundle(), current
);
686 if (citems
.size() == 2) {
687 /* no routes added; remove the separator */
691 output_menu
.popup (1, ev
->time
);
702 MixerStrip::edit_output_configuration ()
704 if (output_selector
== 0) {
706 boost::shared_ptr
<Send
> send
;
707 boost::shared_ptr
<IO
> output
;
709 if ((send
= boost::dynamic_pointer_cast
<Send
>(_current_delivery
)) != 0) {
710 if (!boost::dynamic_pointer_cast
<InternalSend
>(send
)) {
711 output
= send
->output();
713 output
= _route
->output ();
716 output
= _route
->output ();
719 output_selector
= new IOSelectorWindow (_session
, output
);
722 if (output_selector
->is_visible()) {
723 output_selector
->get_toplevel()->get_window()->raise();
725 output_selector
->present ();
730 MixerStrip::edit_input_configuration ()
732 if (input_selector
== 0) {
733 input_selector
= new IOSelectorWindow (_session
, _route
->input());
736 if (input_selector
->is_visible()) {
737 input_selector
->get_toplevel()->get_window()->raise();
739 input_selector
->present ();
744 MixerStrip::input_press (GdkEventButton
*ev
)
746 using namespace Menu_Helpers
;
748 MenuList
& citems
= input_menu
.items();
749 input_menu
.set_name ("ArdourContextMenu");
752 if (!_session
->engine().connected()) {
753 MessageDialog
msg (_("Not connected to JACK - no I/O changes are possible"));
758 if (_session
->actively_recording() && _route
->record_enabled())
761 switch (ev
->button
) {
764 edit_input_configuration ();
769 citems
.push_back (MenuElem (_("Disconnect"), sigc::mem_fun (*(static_cast<RouteUI
*>(this)), &RouteUI::disconnect_input
)));
770 citems
.push_back (SeparatorElem());
771 input_menu_bundles
.clear ();
773 ARDOUR::BundleList current
= _route
->input()->bundles_connected ();
775 boost::shared_ptr
<ARDOUR::BundleList
> b
= _session
->bundles ();
777 /* give user bundles first chance at being in the menu */
779 for (ARDOUR::BundleList::iterator i
= b
->begin(); i
!= b
->end(); ++i
) {
780 if (boost::dynamic_pointer_cast
<UserBundle
> (*i
)) {
781 maybe_add_bundle_to_input_menu (*i
, current
);
785 for (ARDOUR::BundleList::iterator i
= b
->begin(); i
!= b
->end(); ++i
) {
786 if (boost::dynamic_pointer_cast
<UserBundle
> (*i
) == 0) {
787 maybe_add_bundle_to_input_menu (*i
, current
);
791 boost::shared_ptr
<ARDOUR::RouteList
> routes
= _session
->get_routes ();
792 RouteList copy
= *routes
;
793 copy
.sort (RouteCompareByName ());
794 for (ARDOUR::RouteList::const_iterator i
= copy
.begin(); i
!= copy
.end(); ++i
) {
795 maybe_add_bundle_to_input_menu ((*i
)->output()->bundle(), current
);
798 if (citems
.size() == 2) {
799 /* no routes added; remove the separator */
803 input_menu
.popup (1, ev
->time
);
813 MixerStrip::bundle_input_toggled (boost::shared_ptr
<ARDOUR::Bundle
> c
)
819 ARDOUR::BundleList current
= _route
->input()->bundles_connected ();
821 if (std::find (current
.begin(), current
.end(), c
) == current
.end()) {
822 _route
->input()->connect_ports_to_bundle (c
, this);
824 _route
->input()->disconnect_ports_from_bundle (c
, this);
829 MixerStrip::bundle_output_toggled (boost::shared_ptr
<ARDOUR::Bundle
> c
)
835 ARDOUR::BundleList current
= _route
->output()->bundles_connected ();
837 if (std::find (current
.begin(), current
.end(), c
) == current
.end()) {
838 _route
->output()->connect_ports_to_bundle (c
, this);
840 _route
->output()->disconnect_ports_from_bundle (c
, this);
845 MixerStrip::maybe_add_bundle_to_input_menu (boost::shared_ptr
<Bundle
> b
, ARDOUR::BundleList
const & current
)
847 using namespace Menu_Helpers
;
849 if (b
->ports_are_outputs() == false || b
->nchannels() != _route
->n_inputs()) {
853 list
<boost::shared_ptr
<Bundle
> >::iterator i
= input_menu_bundles
.begin ();
854 while (i
!= input_menu_bundles
.end() && b
->has_same_ports (*i
) == false) {
858 if (i
!= input_menu_bundles
.end()) {
862 input_menu_bundles
.push_back (b
);
864 MenuList
& citems
= input_menu
.items();
866 std::string n
= b
->name ();
867 replace_all (n
, "_", " ");
869 citems
.push_back (CheckMenuElem (n
, sigc::bind (sigc::mem_fun(*this, &MixerStrip::bundle_input_toggled
), b
)));
871 if (std::find (current
.begin(), current
.end(), b
) != current
.end()) {
872 ignore_toggle
= true;
873 dynamic_cast<CheckMenuItem
*> (&citems
.back())->set_active (true);
874 ignore_toggle
= false;
879 MixerStrip::maybe_add_bundle_to_output_menu (boost::shared_ptr
<Bundle
> b
, ARDOUR::BundleList
const & current
)
881 using namespace Menu_Helpers
;
883 if (b
->ports_are_inputs() == false || b
->nchannels() != _route
->n_outputs()) {
887 list
<boost::shared_ptr
<Bundle
> >::iterator i
= output_menu_bundles
.begin ();
888 while (i
!= output_menu_bundles
.end() && b
->has_same_ports (*i
) == false) {
892 if (i
!= output_menu_bundles
.end()) {
896 output_menu_bundles
.push_back (b
);
898 MenuList
& citems
= output_menu
.items();
900 std::string n
= b
->name ();
901 replace_all (n
, "_", " ");
903 citems
.push_back (CheckMenuElem (n
, sigc::bind (sigc::mem_fun(*this, &MixerStrip::bundle_output_toggled
), b
)));
905 if (std::find (current
.begin(), current
.end(), b
) != current
.end()) {
906 ignore_toggle
= true;
907 dynamic_cast<CheckMenuItem
*> (&citems
.back())->set_active (true);
908 ignore_toggle
= false;
913 MixerStrip::update_diskstream_display ()
917 if (input_selector
) {
918 input_selector
->hide_all ();
925 show_passthru_color ();
930 MixerStrip::connect_to_pan ()
932 ENSURE_GUI_THREAD (*this, &MixerStrip::connect_to_pan
)
934 panstate_connection
.disconnect ();
935 panstyle_connection
.disconnect ();
937 if (!_route
->panner()) {
941 boost::shared_ptr
<Pannable
> p
= _route
->pannable ();
943 p
->automation_state_changed
.connect (panstate_connection
, invalidator (*this), boost::bind (&PannerUI::pan_automation_state_changed
, &panners
), gui_context());
944 p
->automation_style_changed
.connect (panstyle_connection
, invalidator (*this), boost::bind (&PannerUI::pan_automation_style_changed
, &panners
), gui_context());
946 panners
.panshell_changed ();
951 * Output port labelling
952 * =====================
954 * Case 1: Each output has one connection, all connections are to system:playback_%i
955 * out 1 -> system:playback_1
956 * out 2 -> system:playback_2
957 * out 3 -> system:playback_3
960 * Case 2: Each output has one connection, all connections are to ardour:track_x/in 1
961 * out 1 -> ardour:track_x/in 1
962 * out 2 -> ardour:track_x/in 2
963 * Display as: track_x
965 * Case 3: Each output has one connection, all connections are to Jack client "program x"
966 * out 1 -> program x:foo
967 * out 2 -> program x:foo
968 * Display as: program x
970 * Case 4: No connections (Disconnected)
973 * Default case (unusual routing):
974 * Display as: *number of connections*
978 * .-----------------------------------------------.
980 * | out 1 -> ardour:master/in 1, jamin:input/in 1 |
981 * | out 2 -> ardour:master/in 2, jamin:input/in 2 |
982 * '-----------------------------------------------'
983 * .-----------------------------------------------.
986 * '-----------------------------------------------'
990 MixerStrip::update_io_button (boost::shared_ptr
<ARDOUR::Route
> route
, Width width
, bool for_input
)
995 vector
<string
> port_connections
;
997 uint32_t total_connection_count
= 0;
998 uint32_t io_connection_count
= 0;
999 uint32_t ardour_connection_count
= 0;
1000 uint32_t system_connection_count
= 0;
1001 uint32_t other_connection_count
= 0;
1003 ostringstream label
;
1004 string label_string
;
1006 bool have_label
= false;
1007 bool each_io_has_one_connection
= true;
1009 string connection_name
;
1010 string ardour_track_name
;
1011 string other_connection_type
;
1012 string system_ports
;
1015 ostringstream tooltip
;
1016 char * tooltip_cstr
;
1018 tooltip
<< route
->name();
1021 io_count
= route
->n_inputs().n_total();
1023 io_count
= route
->n_outputs().n_total();
1026 for (io_index
= 0; io_index
< io_count
; ++io_index
) {
1028 port
= route
->input()->nth (io_index
);
1030 port
= route
->output()->nth (io_index
);
1033 port_connections
.clear ();
1034 port
->get_connections(port_connections
);
1035 io_connection_count
= 0;
1037 if (!port_connections
.empty()) {
1038 for (vector
<string
>::iterator i
= port_connections
.begin(); i
!= port_connections
.end(); ++i
) {
1039 string
& connection_name (*i
);
1041 if (io_connection_count
== 0) {
1042 tooltip
<< endl
<< port
->name().substr(port
->name().find("/") + 1) << " -> " << connection_name
;
1044 tooltip
<< ", " << connection_name
;
1047 if (connection_name
.find("ardour:") == 0) {
1048 if (ardour_track_name
.empty()) {
1049 // "ardour:Master/in 1" -> "ardour:Master/"
1050 string::size_type slash
= connection_name
.find("/");
1051 if (slash
!= string::npos
) {
1052 ardour_track_name
= connection_name
.substr(0, slash
+ 1);
1056 if (connection_name
.find(ardour_track_name
) == 0) {
1057 ++ardour_connection_count
;
1059 } else if (connection_name
.find("system:") == 0) {
1061 // "system:capture_123" -> "123"
1062 system_port
= connection_name
.substr(15);
1064 // "system:playback_123" -> "123"
1065 system_port
= connection_name
.substr(16);
1068 if (system_ports
.empty()) {
1069 system_ports
+= system_port
;
1071 system_ports
+= "/" + system_port
;
1074 ++system_connection_count
;
1076 if (other_connection_type
.empty()) {
1077 // "jamin:in 1" -> "jamin:"
1078 other_connection_type
= connection_name
.substr(0, connection_name
.find(":") + 1);
1081 if (connection_name
.find(other_connection_type
) == 0) {
1082 ++other_connection_count
;
1086 ++total_connection_count
;
1087 ++io_connection_count
;
1091 if (io_connection_count
!= 1) {
1092 each_io_has_one_connection
= false;
1096 if (total_connection_count
== 0) {
1097 tooltip
<< endl
<< _("Disconnected");
1100 tooltip_cstr
= new char[tooltip
.str().size() + 1];
1101 strcpy(tooltip_cstr
, tooltip
.str().c_str());
1104 ARDOUR_UI::instance()->set_tip (&input_button
, tooltip_cstr
, "");
1106 ARDOUR_UI::instance()->set_tip (&output_button
, tooltip_cstr
, "");
1109 if (each_io_has_one_connection
) {
1110 if ((total_connection_count
== ardour_connection_count
)) {
1111 // all connections are to the same track in ardour
1112 // "ardour:Master/" -> "Master"
1113 string::size_type slash
= ardour_track_name
.find("/");
1114 if (slash
!= string::npos
) {
1115 label
<< ardour_track_name
.substr(7, slash
- 7);
1119 else if (total_connection_count
== system_connection_count
) {
1120 // all connections are to system ports
1121 label
<< system_ports
;
1124 else if (total_connection_count
== other_connection_count
) {
1125 // all connections are to the same external program eg jamin
1126 // "jamin:" -> "jamin"
1127 label
<< other_connection_type
.substr(0, other_connection_type
.size() - 1);
1133 if (total_connection_count
== 0) {
1137 // Odd configuration
1138 label
<< "*" << total_connection_count
<< "*";
1144 label_string
= label
.str().substr(0, 6);
1147 label_string
= label
.str().substr(0, 3);
1152 input_label
.set_text (label_string
);
1154 output_label
.set_text (label_string
);
1159 MixerStrip::update_input_display ()
1161 update_io_button (_route
, _width
, true);
1162 panners
.setup_pan ();
1166 MixerStrip::update_output_display ()
1168 update_io_button (_route
, _width
, false);
1169 gpm
.setup_meters ();
1170 panners
.setup_pan ();
1174 MixerStrip::fast_update ()
1176 gpm
.update_meters ();
1180 MixerStrip::diskstream_changed ()
1182 Gtkmm2ext::UI::instance()->call_slot (invalidator (*this), boost::bind (&MixerStrip::update_diskstream_display
, this));
1186 MixerStrip::port_connected_or_disconnected (Port
* a
, Port
* b
)
1188 if (_route
->input()->has_port (a
) || _route
->input()->has_port (b
)) {
1189 update_input_display ();
1190 set_width_enum (_width
, this);
1193 if (_route
->output()->has_port (a
) || _route
->output()->has_port (b
)) {
1194 update_output_display ();
1195 set_width_enum (_width
, this);
1200 MixerStrip::comment_editor_done_editing ()
1202 ignore_toggle
= true;
1203 _comment_menu_item
->set_active (false);
1204 ignore_toggle
= false;
1206 string
const str
= comment_area
->get_buffer()->get_text();
1207 if (str
== _route
->comment ()) {
1211 _route
->set_comment (str
, this);
1215 MixerStrip::toggle_comment ()
1217 if (ignore_toggle
) {
1221 if (comment_window
== 0) {
1222 setup_comment_editor ();
1225 if (comment_window
->is_visible ()) {
1226 comment_window
->hide ();
1231 title
= _route
->name();
1232 title
+= _(": comment editor");
1234 comment_window
->set_title (title
);
1235 comment_window
->present();
1239 MixerStrip::setup_comment_editor ()
1241 comment_window
= new ArdourDialog ("", false); // title will be reset to show route
1242 comment_window
->set_position (Gtk::WIN_POS_MOUSE
);
1243 comment_window
->set_skip_taskbar_hint (true);
1244 comment_window
->signal_hide().connect (sigc::mem_fun(*this, &MixerStrip::comment_editor_done_editing
));
1245 comment_window
->set_default_size (400, 200);
1247 comment_area
= manage (new TextView());
1248 comment_area
->set_name ("MixerTrackCommentArea");
1249 comment_area
->set_wrap_mode (WRAP_WORD
);
1250 comment_area
->set_editable (true);
1251 comment_area
->get_buffer()->set_text (_route
->comment());
1252 comment_area
->show ();
1254 comment_window
->get_vbox()->pack_start (*comment_area
);
1255 comment_window
->get_action_area()->hide();
1259 MixerStrip::comment_changed (void *src
)
1261 ENSURE_GUI_THREAD (*this, &MixerStrip::comment_changed
, src
)
1264 ignore_comment_edit
= true;
1266 comment_area
->get_buffer()->set_text (_route
->comment());
1268 ignore_comment_edit
= false;
1273 MixerStrip::select_route_group (GdkEventButton
*ev
)
1275 using namespace Menu_Helpers
;
1277 if (ev
->button
== 1) {
1279 if (group_menu
== 0) {
1281 PropertyList
* plist
= new PropertyList();
1283 plist
->add (Properties::gain
, true);
1284 plist
->add (Properties::mute
, true);
1285 plist
->add (Properties::solo
, true);
1287 group_menu
= new RouteGroupMenu (_session
, plist
);
1291 r
.push_back (route ());
1292 group_menu
->build (r
);
1293 group_menu
->menu()->popup (1, ev
->time
);
1300 MixerStrip::route_group_changed ()
1302 ENSURE_GUI_THREAD (*this, &MixerStrip::route_group_changed
)
1304 RouteGroup
*rg
= _route
->route_group();
1307 group_label
.set_text (PBD::short_version (rg
->name(), 5));
1311 group_label
.set_text (_("Grp"));
1314 group_label
.set_text (_("~G"));
1322 MixerStrip::route_gui_changed (string what_changed
, void*)
1324 ENSURE_GUI_THREAD (*this, &MixerStrip::route_gui_changed
, what_changed
, ignored
)
1326 if (what_changed
== "color") {
1327 if (set_color_from_route () == 0) {
1328 show_route_color ();
1334 MixerStrip::show_route_color ()
1336 name_button
.modify_bg (STATE_NORMAL
, color());
1337 top_event_box
.modify_bg (STATE_NORMAL
, color());
1338 reset_strip_style ();
1342 MixerStrip::show_passthru_color ()
1344 reset_strip_style ();
1348 MixerStrip::build_route_ops_menu ()
1350 using namespace Menu_Helpers
;
1351 route_ops_menu
= new Menu
;
1352 route_ops_menu
->set_name ("ArdourContextMenu");
1354 MenuList
& items
= route_ops_menu
->items();
1356 items
.push_back (CheckMenuElem (_("Comments..."), sigc::mem_fun (*this, &MixerStrip::toggle_comment
)));
1357 _comment_menu_item
= dynamic_cast<CheckMenuItem
*> (&items
.back ());
1358 items
.push_back (MenuElem (_("Save As Template..."), sigc::mem_fun(*this, &RouteUI::save_as_template
)));
1359 items
.push_back (MenuElem (_("Rename..."), sigc::mem_fun(*this, &RouteUI::route_rename
)));
1360 rename_menu_item
= &items
.back();
1361 items
.push_back (SeparatorElem());
1362 items
.push_back (CheckMenuElem (_("Active")));
1363 CheckMenuItem
* i
= dynamic_cast<CheckMenuItem
*> (&items
.back());
1364 i
->set_active (_route
->active());
1365 i
->signal_activate().connect (sigc::bind (sigc::mem_fun (*this, &RouteUI::set_route_active
), !_route
->active(), false));
1367 items
.push_back (SeparatorElem());
1369 items
.push_back (MenuElem (_("Adjust Latency..."), sigc::mem_fun (*this, &RouteUI::adjust_latency
)));
1371 items
.push_back (SeparatorElem());
1372 items
.push_back (CheckMenuElem (_("Protect Against Denormals"), sigc::mem_fun (*this, &RouteUI::toggle_denormal_protection
)));
1373 denormal_menu_item
= dynamic_cast<CheckMenuItem
*> (&items
.back());
1374 denormal_menu_item
->set_active (_route
->denormal_protection());
1376 if (!Profile
->get_sae()) {
1377 items
.push_back (SeparatorElem());
1378 items
.push_back (MenuElem (_("Remote Control ID..."), sigc::mem_fun (*this, &RouteUI::open_remote_control_id_dialog
)));
1381 items
.push_back (SeparatorElem());
1382 items
.push_back (MenuElem (_("Remove"), sigc::bind (sigc::mem_fun(*this, &RouteUI::remove_this_route
), false)));
1386 MixerStrip::name_button_button_press (GdkEventButton
* ev
)
1388 if (ev
->button
== 3) {
1389 list_route_operations ();
1391 /* do not allow rename if the track is record-enabled */
1392 rename_menu_item
->set_sensitive (!_route
->record_enabled());
1393 route_ops_menu
->popup (1, ev
->time
);
1395 } else if (ev
->button
== 1) {
1396 revert_to_default_display ();
1403 MixerStrip::list_route_operations ()
1405 delete route_ops_menu
;
1406 build_route_ops_menu ();
1410 MixerStrip::set_selected (bool yn
)
1412 AxisView::set_selected (yn
);
1414 global_frame
.set_shadow_type (Gtk::SHADOW_ETCHED_OUT
);
1415 global_frame
.set_name ("MixerStripSelectedFrame");
1417 global_frame
.set_shadow_type (Gtk::SHADOW_IN
);
1418 global_frame
.set_name ("MixerStripFrame");
1420 global_frame
.queue_draw ();
1424 MixerStrip::name_changed ()
1428 RouteUI::property_changed (PropertyChange (ARDOUR::Properties::name
));
1431 name_label
.set_text (PBD::short_version (_route
->name(), 5));
1437 MixerStrip::width_clicked ()
1441 set_width_enum (Narrow
, this);
1444 set_width_enum (Wide
, this);
1450 MixerStrip::hide_clicked ()
1452 // LAME fix to reset the button status for when it is redisplayed (part 1)
1453 hide_button
.set_sensitive(false);
1456 Hiding(); /* EMIT_SIGNAL */
1458 _mixer
.hide_strip (this);
1462 hide_button
.set_sensitive(true);
1466 MixerStrip::set_embedded (bool yn
)
1472 MixerStrip::map_frozen ()
1474 ENSURE_GUI_THREAD (*this, &MixerStrip::map_frozen
)
1476 boost::shared_ptr
<AudioTrack
> at
= audio_track();
1479 switch (at
->freeze_state()) {
1480 case AudioTrack::Frozen
:
1481 processor_box
.set_sensitive (false);
1482 hide_redirect_editors ();
1485 processor_box
.set_sensitive (true);
1486 // XXX need some way, maybe, to retoggle redirect editors
1493 MixerStrip::hide_redirect_editors ()
1495 _route
->foreach_processor (sigc::mem_fun (*this, &MixerStrip::hide_processor_editor
));
1499 MixerStrip::hide_processor_editor (boost::weak_ptr
<Processor
> p
)
1501 boost::shared_ptr
<Processor
> processor (p
.lock ());
1506 Gtk::Window
* w
= processor_box
.get_processor_ui (processor
);
1514 MixerStrip::reset_strip_style ()
1516 if (_current_delivery
&& boost::dynamic_pointer_cast
<Send
>(_current_delivery
)) {
1518 gpm
.set_fader_name ("SendStripBase");
1522 if (is_midi_track()) {
1523 if (_route
->active()) {
1524 set_name ("MidiTrackStripBase");
1525 gpm
.set_meter_strip_name ("MidiTrackMetrics");
1527 set_name ("MidiTrackStripBaseInactive");
1528 gpm
.set_meter_strip_name ("MidiTrackMetricsInactive");
1530 gpm
.set_fader_name ("MidiTrackFader");
1531 } else if (is_audio_track()) {
1532 if (_route
->active()) {
1533 set_name ("AudioTrackStripBase");
1534 gpm
.set_meter_strip_name ("AudioTrackMetrics");
1536 set_name ("AudioTrackStripBaseInactive");
1537 gpm
.set_meter_strip_name ("AudioTrackMetricsInactive");
1539 gpm
.set_fader_name ("AudioTrackFader");
1541 if (_route
->active()) {
1542 set_name ("AudioBusStripBase");
1543 gpm
.set_meter_strip_name ("AudioBusMetrics");
1545 set_name ("AudioBusStripBaseInactive");
1546 gpm
.set_meter_strip_name ("AudioBusMetricsInactive");
1548 gpm
.set_fader_name ("AudioBusFader");
1550 /* (no MIDI busses yet) */
1556 MixerStrip::route_group() const
1558 return _route
->route_group();
1562 MixerStrip::engine_stopped ()
1567 MixerStrip::engine_running ()
1572 MixerStrip::meter_point_string (MeterPoint mp
)
1583 case MeterPostFader
:
1598 /** Called when the metering point has changed */
1600 MixerStrip::meter_changed ()
1602 meter_point_label
.set_text (meter_point_string (_route
->meter_point()));
1603 gpm
.setup_meters ();
1604 // reset peak when meter point changes
1605 gpm
.reset_peak_display();
1609 MixerStrip::switch_io (boost::shared_ptr
<Route
> target
)
1611 /* don't respond to switch IO signal outside of the mixer window */
1613 if (!_mixer_owned
) {
1617 if (_route
== target
|| _route
->is_master()) {
1618 /* don't change the display for the target or the master bus */
1620 } else if (!is_track() && show_sends_button
) {
1621 /* make sure our show sends button is inactive, and we no longer blink,
1622 since we're not the target.
1624 send_blink_connection
.disconnect ();
1625 show_sends_button
->set_active (false);
1626 show_sends_button
->set_state (STATE_NORMAL
);
1630 /* switch back to default */
1631 revert_to_default_display ();
1635 boost::shared_ptr
<Send
> send
= _route
->internal_send_for (target
);
1640 revert_to_default_display ();
1645 MixerStrip::drop_send ()
1647 boost::shared_ptr
<Send
> current_send
;
1649 if (_current_delivery
&& (current_send
= boost::dynamic_pointer_cast
<Send
>(_current_delivery
))) {
1650 current_send
->set_metering (false);
1653 send_gone_connection
.disconnect ();
1654 input_button
.set_sensitive (true);
1655 output_button
.set_sensitive (true);
1656 group_button
.set_sensitive (true);
1657 set_invert_sensitive (true);
1658 meter_point_button
.set_sensitive (true);
1659 mute_button
->set_sensitive (true);
1660 solo_button
->set_sensitive (true);
1661 rec_enable_button
->set_sensitive (true);
1662 solo_isolated_led
->set_sensitive (true);
1663 solo_safe_led
->set_sensitive (true);
1667 MixerStrip::set_current_delivery (boost::shared_ptr
<Delivery
> d
)
1669 _current_delivery
= d
;
1670 DeliveryChanged (_current_delivery
);
1674 MixerStrip::show_send (boost::shared_ptr
<Send
> send
)
1680 set_current_delivery (send
);
1682 send
->set_metering (true);
1683 _current_delivery
->DropReferences
.connect (send_gone_connection
, invalidator (*this), boost::bind (&MixerStrip::revert_to_default_display
, this), gui_context());
1685 gain_meter().set_controls (_route
, send
->meter(), send
->amp());
1686 gain_meter().setup_meters ();
1688 panner_ui().set_panner (_current_delivery
->panner_shell(), _current_delivery
->panner());
1689 panner_ui().setup_pan ();
1691 input_button
.set_sensitive (false);
1692 group_button
.set_sensitive (false);
1693 set_invert_sensitive (false);
1694 meter_point_button
.set_sensitive (false);
1695 mute_button
->set_sensitive (false);
1696 solo_button
->set_sensitive (false);
1697 rec_enable_button
->set_sensitive (false);
1698 solo_isolated_led
->set_sensitive (false);
1699 solo_safe_led
->set_sensitive (false);
1701 if (boost::dynamic_pointer_cast
<InternalSend
>(send
)) {
1702 output_button
.set_sensitive (false);
1705 reset_strip_style ();
1709 MixerStrip::revert_to_default_display ()
1711 if (show_sends_button
) {
1712 show_sends_button
->set_active (false);
1717 set_current_delivery (_route
->main_outs ());
1719 gain_meter().set_controls (_route
, _route
->shared_peak_meter(), _route
->amp());
1720 gain_meter().setup_meters ();
1722 panner_ui().set_panner (_route
->main_outs()->panner_shell(), _route
->main_outs()->panner());
1723 panner_ui().setup_pan ();
1725 reset_strip_style ();
1729 MixerStrip::set_button_names ()
1733 rec_enable_button_label
.set_text (_("Rec"));
1734 mute_button_label
.set_text (_("Mute"));
1735 if (_route
&& _route
->solo_safe()) {
1736 solo_button_label
.set_text (X_("!"));
1738 if (!Config
->get_solo_control_is_listen_control()) {
1739 solo_button_label
.set_text (_("Solo"));
1741 switch (Config
->get_listen_position()) {
1742 case AfterFaderListen
:
1743 solo_button_label
.set_text (_("AFL"));
1745 case PreFaderListen
:
1746 solo_button_label
.set_text (_("PFL"));
1754 rec_enable_button_label
.set_text (_("R"));
1755 mute_button_label
.set_text (_("M"));
1756 if (_route
&& _route
->solo_safe()) {
1757 solo_button_label
.set_text (X_("!"));
1758 if (!Config
->get_solo_control_is_listen_control()) {
1759 solo_button_label
.set_text (_("S"));
1761 switch (Config
->get_listen_position()) {
1762 case AfterFaderListen
:
1763 solo_button_label
.set_text (_("A"));
1765 case PreFaderListen
:
1766 solo_button_label
.set_text (_("P"));
1777 MixerStrip::on_key_press_event (GdkEventKey
* ev
)
1779 GdkEventButton fake
;
1780 fake
.type
= GDK_BUTTON_PRESS
;
1782 fake
.state
= ev
->state
;
1784 switch (ev
->keyval
) {
1796 rec_enable_press (&fake
);
1801 show_sends_press (&fake
);
1806 if (ev
->state
& Keyboard::PrimaryModifier
) {
1816 _route
->set_gain (1.0, this);
1829 MixerStrip::on_key_release_event (GdkEventKey
* ev
)
1831 GdkEventButton fake
;
1832 fake
.type
= GDK_BUTTON_RELEASE
;
1834 fake
.state
= ev
->state
;
1836 switch (ev
->keyval
) {
1838 mute_release (&fake
);
1843 solo_release (&fake
);
1848 rec_enable_release (&fake
);
1853 show_sends_release (&fake
);
1869 MixerStrip::on_enter_notify_event (GdkEventCrossing
*)
1871 Keyboard::magic_widget_grab_focus ();
1876 MixerStrip::on_leave_notify_event (GdkEventCrossing
* ev
)
1878 switch (ev
->detail
) {
1879 case GDK_NOTIFY_INFERIOR
:
1882 Keyboard::magic_widget_drop_focus ();
1889 MixerStrip::plugin_selector()
1891 return _mixer
.plugin_selector();
1895 MixerStrip::hide_things ()
1897 processor_box
.hide_things ();
1901 MixerStrip::input_active_button_press (GdkEventButton
* ev
)
1903 /* nothing happens on press */
1908 MixerStrip::input_active_button_release (GdkEventButton
* ev
)
1910 boost::shared_ptr
<MidiTrack
> mt
= midi_track ();
1916 if (mt
->input_active()) {
1917 if (Keyboard::modifier_state_contains (ev
->state
, Keyboard::ModifierMask (Keyboard::PrimaryModifier
|Keyboard::SecondaryModifier
))) {
1918 /* turn all other tracks using this input off */
1919 _session
->set_exclusive_input_active (mt
, false);
1921 mt
->set_input_active (false);
1925 if (Keyboard::modifier_state_contains (ev
->state
, Keyboard::ModifierMask (Keyboard::PrimaryModifier
|Keyboard::SecondaryModifier
))) {
1926 /* turn all other tracks using this input on */
1927 _session
->set_exclusive_input_active (mt
, true);
1929 mt
->set_input_active (true);
1937 MixerStrip::midi_input_status_changed ()
1939 if (midi_input_enable_button
) {
1940 boost::shared_ptr
<MidiTrack
> mt
= midi_track ();
1942 midi_input_enable_button
->set_active (mt
->input_active ());
1947 MixerStrip::state_id () const
1949 return string_compose ("strip %1", _route
->id().to_s());