#define __ardour_mute_master_h__
#include "evoral/Parameter.hpp"
-#include "ardour/automation_control.h"
-#include "ardour/automation_list.h"
+#include "pbd/signals.h"
+#include "pbd/stateful.h"
+#include <string>
+
+#include "ardour/session_handle.h"
namespace ARDOUR {
class Session;
-class MuteMaster : public AutomationControl
+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 mute (bool yn);
-
- /* Controllable interface */
+ void set_mute_points (const std::string& mute_point);
+ void set_mute_points (MutePoint);
+ MutePoint mute_points() const { return _mute_point; }
- void set_value (float); /* note: float is used as a bitfield of MutePoints */
- float get_value () const;
+ void set_solo_level (SoloLevel);
- sigc::signal<void> MutePointChanged;
+ PBD::Signal0<void> MutePointChanged;
XMLNode& get_state();
int set_state(const XMLNode&, int version);
private:
- AutomationList* _automation;
- MutePoint _mute_point;
+ volatile MutePoint _mute_point;
+ volatile bool _self_muted;
+ volatile uint32_t _muted_by_others;
+ volatile SoloLevel _solo_level;
};
} // namespace ARDOUR