Small cleanup: add constructor to InterThreadInfo.
[ardour.git] / libs / ardour / ardour / mute_master.h
index 0e3c10b795b02e6a2250c3b59cdbcef84e02fecb..a0207f9817e83180354b6b28afd7f8ee659500bc 100644 (file)
 #include "evoral/Parameter.hpp"
 #include "pbd/signals.h"
 #include "pbd/stateful.h"
+#include <string>
+
+#include "ardour/session_handle.h"
 
 namespace ARDOUR {
 
 class Session;
 
-class MuteMaster : public PBD::Stateful
+class MuteMaster : public SessionHandleRef, public PBD::Stateful
 {
   public:
        enum MutePoint {
@@ -43,27 +46,43 @@ class MuteMaster : public PBD::Stateful
        MuteMaster (Session& s, const std::string& name);
        ~MuteMaster() {}
 
-       bool muted_pre_fader() const  { return _mute_point & PreFader; }
-       bool muted_post_fader() const { return _mute_point & PostFader; }
-       bool muted_listen() const     { return _mute_point & Listen; }
-       bool muted_main () const      { return _mute_point & Main; }
+       bool self_muted() const { return _self_muted && (_mute_point != MutePoint (0)); }
+       bool muted_by_others() const { return _muted_by_others && (_mute_point != MutePoint (0)); }
+       bool muted() const { return (_self_muted || (_muted_by_others > 0)) && (_mute_point != MutePoint (0)); }
+        bool muted_at (MutePoint mp) const { return (_self_muted || (_muted_by_others > 0)) && (_mute_point & mp); }
+        bool self_muted_at (MutePoint mp) const { return _self_muted && (_mute_point & mp); }
+        bool muted_by_others_at (MutePoint mp) const { return (_muted_by_others > 0) && (_mute_point & mp); }
 
-       bool muted_at (MutePoint mp) const { return _mute_point & mp; }
-       bool muted() const { return _mute_point != MutePoint (0); }
+       bool muted_pre_fader() const  { return muted_at (PreFader); }
+       bool muted_post_fader() const { return muted_at (PostFader); }
+       bool muted_listen() const     { return muted_at (Listen); }
+        bool muted_main () const      { return muted_at (Main); }
 
        gain_t mute_gain_at (MutePoint) const;
 
-       void clear_mute ();
+        void set_self_muted (bool yn) { _self_muted = yn; }
+        void mod_muted_by_others (int delta);
+        void clear_muted_by_others ();
+
        void mute_at (MutePoint);
        void unmute_at (MutePoint);
 
+       void set_mute_points (const std::string& mute_point);
+        void set_mute_points (MutePoint);
+        MutePoint mute_points() const { return _mute_point; }
+
+        void set_solo_level (SoloLevel);
+
        PBD::Signal0<void> MutePointChanged;
 
        XMLNode& get_state();
        int set_state(const XMLNode&, int version);
 
   private:
-       MutePoint _mute_point;
+       volatile MutePoint _mute_point;
+        volatile bool      _self_muted;
+        volatile uint32_t  _muted_by_others;
+        volatile SoloLevel _solo_level;
 };
 
 } // namespace ARDOUR