X-Git-Url: https://main.carlh.net/gitweb/?a=blobdiff_plain;f=gtk2_ardour%2Fmixer_ui.cc;h=13269bb1c768ec9556fb1e0166129a4f95149512;hb=18060e597e536e8ff53fc423360d48d802f76f23;hp=1a4a897a72de5924e289a668bed814bed495bcf2;hpb=1f5ebc54853446a786925941bd014666e75221d2;p=ardour.git diff --git a/gtk2_ardour/mixer_ui.cc b/gtk2_ardour/mixer_ui.cc index 1a4a897a72..13269bb1c7 100644 --- a/gtk2_ardour/mixer_ui.cc +++ b/gtk2_ardour/mixer_ui.cc @@ -349,6 +349,7 @@ Mixer_UI::Mixer_UI () favorite_plugins_display.show(); MixerStrip::CatchDeletion.connect (*this, invalidator (*this), boost::bind (&Mixer_UI::remove_strip, this, _1), gui_context()); + VCAMasterStrip::CatchDeletion.connect (*this, invalidator (*this), boost::bind (&Mixer_UI::remove_master, this, _1), gui_context()); /* handle escape */ @@ -535,7 +536,7 @@ Mixer_UI::add_stripables (StripableList& slist) row[stripable_columns.strip] = vms; row[stripable_columns.stripable] = vca; - vms->CatchDeletion.connect (*this, invalidator (*this), boost::bind (&Mixer_UI::remove_master, this, _1), gui_context()); + vms->signal_button_release_event().connect (sigc::bind (sigc::mem_fun(*this, &Mixer_UI::vca_button_release_event), vms)); } else if ((route = boost::dynamic_pointer_cast (*s))) { @@ -828,6 +829,20 @@ Mixer_UI::sync_treeview_from_presentation_info (PropertyChange const & what_chan if (!_selection.axes.empty() && !PublicEditor::instance().track_selection_change_without_scroll ()) { move_stripable_into_view ((*_selection.axes.begin())->stripable()); } + + TreeModel::Children rows = track_model->children(); + for (TreeModel::Children::const_iterator i = rows.begin(); i != rows.end(); ++i) { + AxisView* av = (*i)[stripable_columns.strip]; + VCAMasterStrip* vms = dynamic_cast (av); + if (!vms) { + continue; + } + if (vms->vca() && vms->vca()->is_selected()) { + _selection.add (vms); + } else { + _selection.remove (vms); + } + } } redisplay_track_list (); @@ -867,6 +882,15 @@ Mixer_UI::axis_view_by_stripable (boost::shared_ptr s) const } } + TreeModel::Children rows = track_model->children(); + for (TreeModel::Children::const_iterator i = rows.begin(); i != rows.end(); ++i) { + AxisView* av = (*i)[stripable_columns.strip]; + VCAMasterStrip* vms = dynamic_cast (av); + if (vms && vms->stripable () == s) { + return av; + } + } + return 0; } @@ -903,6 +927,11 @@ Mixer_UI::strip_button_release_event (GdkEventButton *ev, MixerStrip *strip) /* de-select others */ _selection.set (strip); } + PublicEditor& pe = PublicEditor::instance(); + TimeAxisView* tav = pe.time_axis_view_from_stripable (strip->stripable()); + if (tav) { + pe.set_selected_mixer_strip (*tav); + } } else { if (Keyboard::modifier_state_equals (ev->state, Keyboard::PrimaryModifier)) { _selection.add (strip, true); @@ -967,6 +996,13 @@ Mixer_UI::strip_button_release_event (GdkEventButton *ev, MixerStrip *strip) return true; } +bool +Mixer_UI::vca_button_release_event (GdkEventButton *ev, VCAMasterStrip *strip) +{ + _selection.set (strip); + return true; +} + void Mixer_UI::set_session (Session* sess) { @@ -2019,7 +2055,7 @@ Mixer_UI::scroller_drag_data_received (const Glib::RefPtr& con if (!pip->is_instrument ()) { continue; } - ARDOUR_UI::instance()->session_add_midi_track ((RouteGroup*) 0, 1, _("MIDI"), Config->get_strict_io (), pip, ppp->_preset.valid ? &ppp->_preset : 0, PresentationInfo::max_order); + ARDOUR_UI::instance()->session_add_midi_route (true, (RouteGroup*) 0, 1, _("MIDI"), Config->get_strict_io (), pip, ppp->_preset.valid ? &ppp->_preset : 0, PresentationInfo::max_order); ok = true; }