#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 {
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