diff options
author | Paul Davis <paul@linuxaudiosystems.com> | 2017-05-05 12:31:49 +0100 |
---|---|---|
committer | Paul Davis <paul@linuxaudiosystems.com> | 2017-05-05 18:56:25 +0100 |
commit | dc0139d4af4d246f6dcafb04425e3f1198c347c3 (patch) | |
tree | 096fa3207a951ec2d5e0338d207adac3f9872996 /gtk2_ardour/mixer_ui.cc | |
parent | 0c035778e162bd5934fc0070e43a26ffb4c8825a (diff) |
use CoreSelection for track selection
Diffstat (limited to 'gtk2_ardour/mixer_ui.cc')
-rw-r--r-- | gtk2_ardour/mixer_ui.cc | 28 |
1 files changed, 26 insertions, 2 deletions
diff --git a/gtk2_ardour/mixer_ui.cc b/gtk2_ardour/mixer_ui.cc index 4c5d60d6c7..b70ceef37d 100644 --- a/gtk2_ardour/mixer_ui.cc +++ b/gtk2_ardour/mixer_ui.cc @@ -48,6 +48,7 @@ #include "ardour/midi_track.h" #include "ardour/plugin_manager.h" #include "ardour/route_group.h" +#include "ardour/selection.h" #include "ardour/session.h" #include "ardour/vca.h" #include "ardour/vca_manager.h" @@ -110,6 +111,7 @@ Mixer_UI::Mixer_UI () , _maximised (false) , _show_mixer_list (true) , myactions (X_("mixer")) + , _selection (*this, *this) { register_actions (); load_bindings (); @@ -683,6 +685,8 @@ Mixer_UI::remove_strip (MixerStrip* strip) void Mixer_UI::presentation_info_changed (PropertyChange const & what_changed) { + _selection.presentation_info_changed (what_changed); + PropertyChange soh; soh.add (Properties::selected); soh.add (Properties::order); @@ -850,7 +854,7 @@ Mixer_UI::sync_treeview_from_presentation_info (PropertyChange const & what_chan for (list<MixerStrip *>::const_iterator i = strips.begin(); i != strips.end(); ++i) { boost::shared_ptr<Stripable> stripable = (*i)->stripable(); - if (stripable && stripable->presentation_info().selected()) { + if (stripable && stripable->is_selected()) { _selection.add (*i); } else { _selection.remove (*i); @@ -891,7 +895,7 @@ Mixer_UI::strip_by_stripable (boost::shared_ptr<Stripable> s) const } AxisView* -Mixer_UI::axis_by_stripable (boost::shared_ptr<Stripable> s) const +Mixer_UI::axis_view_by_stripable (boost::shared_ptr<Stripable> s) const { for (list<MixerStrip *>::const_iterator i = strips.begin(); i != strips.end(); ++i) { if ((*i)->stripable() == s) { @@ -902,6 +906,18 @@ Mixer_UI::axis_by_stripable (boost::shared_ptr<Stripable> s) const return 0; } +AxisView* +Mixer_UI::axis_view_by_control (boost::shared_ptr<AutomationControl> c) const +{ + for (list<MixerStrip *>::const_iterator i = strips.begin(); i != strips.end(); ++i) { + if ((*i)->control() == c) { + return (*i); + } + } + + return 0; +} + bool Mixer_UI::strip_button_release_event (GdkEventButton *ev, MixerStrip *strip) { @@ -1000,6 +1016,7 @@ Mixer_UI::set_session (Session* sess) } if (!_session) { + _selection.clear (); return; } @@ -1029,6 +1046,13 @@ Mixer_UI::set_session (Session* sess) if (_visible) { show_window(); } + + /* catch up on selection state, etc. */ + + PropertyChange sc; + sc.add (Properties::selected); + _selection.presentation_info_changed (sc); + start_updating (); } |