add correct implementation for cancel all solo to BasicUI
authorPaul Davis <paul@linuxaudiosystems.com>
Fri, 17 Jun 2016 03:31:11 +0000 (23:31 -0400)
committerPaul Davis <paul@linuxaudiosystems.com>
Tue, 27 Sep 2016 19:59:29 +0000 (14:59 -0500)
libs/surfaces/control_protocol/basic_ui.cc
libs/surfaces/control_protocol/control_protocol/basic_ui.h

index 74c2802a7aa15856bedd91d583f073c2b41cb2af..6ec3fb0003d67c02ad168ed48f7b6da3500fafa1 100644 (file)
@@ -24,6 +24,7 @@
 #include "ardour/session.h"
 #include "ardour/location.h"
 #include "ardour/tempo.h"
+#include "ardour/utils.h"
 
 #include "control_protocol/basic_ui.h"
 
@@ -495,6 +496,51 @@ BasicUI::sample_to_timecode (framepos_t sample, Timecode::Time& timecode, bool u
        session->sample_to_timecode (sample, *((Timecode::Time*)&timecode), use_offset, use_subframes);
 }
 
+void
+BasicUI::toggle_selection (PresentationInfo::order_t o, PresentationInfo::Flag flags)
+{
+       boost::shared_ptr<Stripable> s = session->get_remote_nth_stripable (o, flags);
+
+       if (s) {
+               s->presentation_info().set_selected (!s->presentation_info().selected());
+       }
+}
+
+void
+BasicUI::clear_stripable_selection ()
+{
+       session->clear_stripable_selection ();
+}
+
+void
+BasicUI::toggle_stripable_selection (boost::shared_ptr<Stripable> s)
+{
+       session->toggle_stripable_selection (s);
+}
+
+void
+BasicUI::add_stripable_selection (boost::shared_ptr<Stripable> s)
+{
+       session->add_stripable_selection (s);
+}
+
+void
+BasicUI::set_stripable_selection (boost::shared_ptr<Stripable> s)
+{
+       session->set_stripable_selection (s);
+}
+
+
+void
+BasicUI::cancel_all_solo ()
+{
+       if (session) {
+               StripableList sl;
+               session->get_stripables (sl);
+               session->set_controls (stripable_list_to_control_list (sl, &Stripable::solo_control), 0.0, PBD::Controllable::NoGroup);
+       }
+}
+
 #if 0
 this stuff is waiting to go in so that all UIs can offer complex solo/mute functionality
 
index 43ebcfa9e71977c0f4b7288141415cd1d5cb2190..a09c28e6275b8c18e6124ef2c1c8c72feb7c920b 100644 (file)
@@ -83,7 +83,7 @@ class LIBCONTROLCP_API BasicUI {
        void redo ();
        void toggle_punch_in ();
        void toggle_punch_out ();
-       
+
        void mark_in();
        void mark_out();
 
@@ -94,6 +94,8 @@ class LIBCONTROLCP_API BasicUI {
        void toggle_monitor_dim();
        void toggle_monitor_mono();
 
+       void cancel_all_solo ();
+
        void quick_snapshot_stay ();
        void quick_snapshot_switch ();
 
@@ -108,7 +110,7 @@ class LIBCONTROLCP_API BasicUI {
        void set_record_enable (bool yn);
        bool get_record_enabled ();
 
-       //editor visibility stuff  (why do we have to make explicit numbers here?  because "gui actions" don't accept args 
+       //editor visibility stuff  (why do we have to make explicit numbers here?  because "gui actions" don't accept args
        void fit_1_track();
        void fit_2_tracks();
        void fit_4_tracks();