+ /* start off as a passthru strip. we'll correct this, if necessary,
+ in update_diskstream_display().
+ */
+
+ if (is_midi_track()) {
+ set_name ("MidiTrackStripBase");
+ } else {
+ set_name ("AudioTrackStripBase");
+ }
+
+ add_events (Gdk::BUTTON_RELEASE_MASK|
+ Gdk::ENTER_NOTIFY_MASK|
+ Gdk::LEAVE_NOTIFY_MASK|
+ Gdk::KEY_PRESS_MASK|
+ Gdk::KEY_RELEASE_MASK);
+
+ set_flags (get_flags() | Gtk::CAN_FOCUS);
+
+ AudioEngine::instance()->PortConnectedOrDisconnected.connect (
+ *this, invalidator (*this), boost::bind (&MixerStrip::port_connected_or_disconnected, this, _1, _3), gui_context ()
+ );
+
+ /* Add the widgets under visibility control to the VisibilityGroup; the names used here
+ must be the same as those used in RCOptionEditor so that the configuration changes
+ are recognised when they occur.
+ */
+ _visibility.add (&_invert_button_box, X_("PhaseInvert"), _("Phase Invert"));
+ _visibility.add (solo_safe_led, X_("SoloSafe"), _("Solo Safe"), true, boost::bind (&MixerStrip::override_solo_visibility, this));
+ _visibility.add (solo_isolated_led, X_("SoloIsolated"), _("Solo Isolated"), true, boost::bind (&MixerStrip::override_solo_visibility, this));
+ _visibility.add (&_comment_button, X_("Comments"), _("Comments"));
+ _visibility.add (&group_button, X_("Group"), _("Group"));
+ _visibility.add (&meter_point_button, X_("MeterPoint"), _("Meter Point"));
+
+ parameter_changed (X_("mixer-strip-visibility"));
+
+ Config->ParameterChanged.connect (_config_connection, MISSING_INVALIDATOR, boost::bind (&MixerStrip::parameter_changed, this, _1), gui_context());
+
+ gpm.LevelMeterButtonPress.connect_same_thread (_level_meter_connection, boost::bind (&MixerStrip::level_meter_button_press, this, _1));
+}
+
+MixerStrip::~MixerStrip ()
+{
+ CatchDeletion (this);
+
+ delete input_selector;
+ delete output_selector;
+ delete comment_window;
+}
+
+void
+MixerStrip::set_route (boost::shared_ptr<Route> rt)
+{
+ if (rec_enable_button->get_parent()) {
+ rec_solo_table.remove (*rec_enable_button);
+ }
+
+ if (show_sends_button->get_parent()) {
+ rec_solo_table.remove (*show_sends_button);
+ }
+
+ RouteUI::set_route (rt);
+
+ /* ProcessorBox needs access to _route so that it can read
+ GUI object state.
+ */
+ processor_box.set_route (rt);
+
+ /* map the current state */
+
+ mute_changed (0);
+ update_solo_display ();
+
+ delete input_selector;
+ input_selector = 0;
+
+ delete output_selector;
+ output_selector = 0;
+
+ revert_to_default_display ();
+
+ /* unpack these from the parent and stuff them into our own
+ table
+ */
+
+ if (gpm.peak_display.get_parent()) {
+ gpm.peak_display.get_parent()->remove (gpm.peak_display);
+ }
+ if (gpm.gain_display.get_parent()) {
+ gpm.gain_display.get_parent()->remove (gpm.gain_display);
+ }
+
+ middle_button_table.attach (gpm.gain_display,0,1,1,2);
+ middle_button_table.attach (gpm.peak_display,1,2,1,2);
+
+ if (solo_button->get_parent()) {
+ middle_button_table.remove (*solo_button);
+ }
+
+ if (mute_button->get_parent()) {
+ middle_button_table.remove (*mute_button);
+ }
+
+ if (route()->is_master()) {
+ middle_button_table.attach (*mute_button, 0, 2, 0, 1);
+ solo_button->hide ();
+ mute_button->show ();
+ rec_solo_table.hide ();
+ } else {
+ middle_button_table.attach (*mute_button, 0, 1, 0, 1);
+ middle_button_table.attach (*solo_button, 1, 2, 0, 1);
+ mute_button->show ();
+ solo_button->show ();
+ rec_solo_table.show ();
+ }
+
+ if (_mixer_owned && (route()->is_master() || route()->is_monitor())) {
+
+ if (scrollbar_height == 0) {
+ HScrollbar scrollbar;
+ Gtk::Requisition requisition(scrollbar.size_request ());
+ scrollbar_height = requisition.height;
+ }
+
+ spacer = manage (new EventBox);
+ spacer->set_size_request (-1, scrollbar_height);
+ global_vpacker.pack_start (*spacer, false, false);
+ }
+
+ if (is_track()) {
+ monitor_input_button->show ();
+ monitor_disk_button->show ();
+ } else {
+ monitor_input_button->hide();
+ monitor_disk_button->hide ();
+ }
+
+ if (is_midi_track()) {
+ if (midi_input_enable_button == 0) {
+ midi_input_enable_button = manage (new ArdourButton);
+ midi_input_enable_button->set_name ("midi input button");
+ midi_input_enable_button->set_image (::get_icon (X_("midi_socket_small")));
+ midi_input_enable_button->signal_button_press_event().connect (sigc::mem_fun (*this, &MixerStrip::input_active_button_press), false);
+ midi_input_enable_button->signal_button_release_event().connect (sigc::mem_fun (*this, &MixerStrip::input_active_button_release), false);
+ ARDOUR_UI::instance()->set_tip (midi_input_enable_button, _("Enable/Disable MIDI input"));
+ } else {
+ input_button_box.remove (*midi_input_enable_button);
+ }
+ /* get current state */
+ midi_input_status_changed ();
+ input_button_box.pack_start (*midi_input_enable_button, false, false);
+ /* follow changes */
+ midi_track()->InputActiveChanged.connect (route_connections, invalidator (*this), boost::bind (&MixerStrip::midi_input_status_changed, this), gui_context());
+ } else {
+ if (midi_input_enable_button) {
+ /* removal from the container will delete it */
+ input_button_box.remove (*midi_input_enable_button);
+ midi_input_enable_button = 0;
+ }
+ }
+
+ if (is_audio_track()) {
+ boost::shared_ptr<AudioTrack> at = audio_track();
+ at->FreezeChange.connect (route_connections, invalidator (*this), boost::bind (&MixerStrip::map_frozen, this), gui_context());
+ }
+
+ if (is_track ()) {
+
+ rec_solo_table.attach (*rec_enable_button, 0, 1, 0, 2);
+ rec_enable_button->set_sensitive (_session->writable());
+ rec_enable_button->show();
+
+ } else {
+
+ /* non-master bus */
+
+ if (!_route->is_master()) {
+ rec_solo_table.attach (*show_sends_button, 0, 1, 0, 2);
+ show_sends_button->show();
+ }
+ }
+
+ meter_point_button.set_text (meter_point_string (_route->meter_point()));
+
+ delete route_ops_menu;
+ route_ops_menu = 0;
+
+ _route->meter_change.connect (route_connections, invalidator (*this), bind (&MixerStrip::meter_changed, this), gui_context());
+ _route->route_group_changed.connect (route_connections, invalidator (*this), boost::bind (&MixerStrip::route_group_changed, this), gui_context());
+
+ if (_route->panner_shell()) {
+ _route->panner_shell()->Changed.connect (route_connections, invalidator (*this), boost::bind (&MixerStrip::connect_to_pan, this), gui_context());
+ }
+
+ if (is_audio_track()) {
+ audio_track()->DiskstreamChanged.connect (route_connections, invalidator (*this), boost::bind (&MixerStrip::diskstream_changed, this), gui_context());
+ }
+
+ _route->comment_changed.connect (route_connections, invalidator (*this), boost::bind (&MixerStrip::comment_changed, this, _1), gui_context());
+ _route->PropertyChanged.connect (route_connections, invalidator (*this), boost::bind (&MixerStrip::property_changed, this, _1), gui_context());
+
+ set_stuff_from_route ();