Add a dedicated export method to MidiRegion
[ardour.git] / libs / ardour / solo_control.cc
index 8514da36ecc1ac31f654764d87b6bc3ca9c754c0..c31644b02665f57005e78d73b7c1945621507785 100644 (file)
@@ -21,7 +21,7 @@
 #include "ardour/session.h"
 #include "ardour/solo_control.h"
 
-#include "i18n.h"
+#include "pbd/i18n.h"
 
 using namespace ARDOUR;
 using namespace std;
@@ -177,8 +177,7 @@ double
 SoloControl::get_value () const
 {
        if (slaved()) {
-               Glib::Threads::RWLock::ReaderLock lm (master_lock);
-               return get_masters_value_locked () ? 1.0 : 0.0;
+               return self_soloed() || get_masters_value ();
        }
 
        if (_list && boost::dynamic_pointer_cast<AutomationList>(_list)->automation_playback()) {
@@ -186,7 +185,7 @@ SoloControl::get_value () const
                return AutomationControl::get_value();
        }
 
-       return soloed() ? 1.0 : 0.0;
+       return soloed();
 }
 
 void
@@ -257,14 +256,22 @@ SoloControl::master_changed (bool /*from self*/, GroupControlDisposition, boost:
 
        _transition_into_solo = 0;
 
+       /* Notice that we call get_boolean_masters() BEFORE we call
+        * update_boolean_masters_records(), in order to know what
+        * our master state was BEFORE it gets changed.
+        */
+
+
        if (m->get_value()) {
                /* this master is now enabled */
                if (!self_soloed() && get_boolean_masters() == 0) {
+                       /* not self-soloed, wasn't soloed by masters before */
                        send_signal = true;
                        _transition_into_solo = 1;
                }
        } else {
                if (!self_soloed() && get_boolean_masters() == 1) {
+                       /* not self-soloed, soloed by just 1 master before */
                        _transition_into_solo = -1;
                        send_signal = true;
                }
@@ -328,3 +335,9 @@ SoloControl::pre_remove_master (boost::shared_ptr<AutomationControl> m)
                _transition_into_solo = 0;
        }
 }
+
+bool
+SoloControl::can_solo () const
+{
+       return _soloable.can_solo ();
+}