X-Git-Url: https://main.carlh.net/gitweb/?a=blobdiff_plain;f=libs%2Fardour%2Fardour%2Fvca.h;h=710447fb93839802231edc18945ad10da3af310a;hb=eaa1dacf5fc9537cfff36e2339bd07aab348aa2e;hp=a4e2e9f4df8199cdfe7ee7aab43bbd204a55297e;hpb=f44cac5cc60c0ad93da3a44db2517f09cc82f345;p=ardour.git diff --git a/libs/ardour/ardour/vca.h b/libs/ardour/ardour/vca.h index a4e2e9f4df..710447fb93 100644 --- a/libs/ardour/ardour/vca.h +++ b/libs/ardour/ardour/vca.h @@ -21,39 +21,141 @@ #include #include +#include + +#include #include "pbd/controllable.h" +#include "pbd/statefuldestructible.h" -#include "ardour/session_handle.h" +#include "ardour/automatable.h" +#include "ardour/muteable.h" +#include "ardour/monitorable.h" +#include "ardour/recordable.h" +#include "ardour/soloable.h" +#include "ardour/slavable.h" +#include "ardour/stripable.h" namespace ARDOUR { -class GainControl; class Route; - -class LIBARDOUR_API VCA : public SessionHandleRef { +class GainControl; +class SoloControl; +class MuteControl; +class MonitorControl; + +class LIBARDOUR_API VCA : public Stripable, + public Soloable, + public Muteable, + public Automatable, + public Recordable, + public Monitorable, + public boost::enable_shared_from_this { public: - VCA (Session& session, const std::string& name, uint32_t num); + VCA (Session& session, int32_t num, const std::string& name); + ~VCA(); + + int32_t number () const { return _number; } + + int init (); + XMLNode& get_state(); + int set_state (XMLNode const&, int version); + + PBD::Signal0 Drop; /* signal to slaves to drop control by this VCA */ + + /* Slavable API */ + + bool slaved_to (boost::shared_ptr) const; + bool slaved () const; - std::string name() const { return _name; } - uint32_t number () const { return _number; } + /* Soloable API */ - void set_value (double val, PBD::Controllable::GroupControlDisposition group_override); - double get_value () const; + void clear_all_solo_state (); - boost::shared_ptr control() const { return _control; } + bool soloed () const; + void push_solo_upstream (int32_t) {} + void push_solo_isolate_upstream (int32_t) {} + bool can_solo() const { return true; } + bool is_safe () const { return false; } - void add (boost::shared_ptr); - void remove (boost::shared_ptr); + /* Muteable API */ + + bool can_be_muted_by_others () const { return true; } + bool muted_by_others_soloing() const { return false; } + + /* Recordable API */ + + int prep_record_enabled (bool yn) { return 0; } + bool can_be_record_enabled() { return true; } + bool can_be_record_safe() { return true; } + + /* Monitorable API */ + + MonitorState monitoring_state() const; static std::string default_name_template (); - static int next_vca_number (); + static int32_t next_vca_number (); + static std::string xml_node_name; + + /* used by Session to save/restore the atomic counter */ + static int32_t get_next_vca_number (); + static void set_next_vca_number (int32_t); + + boost::shared_ptr gain_control() const { return _gain_control; } + boost::shared_ptr solo_control() const { return _solo_control; } + boost::shared_ptr mute_control() const { return _mute_control; } + + /* null Stripable API, because VCAs don't have any of this */ + + boost::shared_ptr solo_isolate_control() const { return boost::shared_ptr(); } + boost::shared_ptr solo_safe_control() const { return boost::shared_ptr(); } + boost::shared_ptr peak_meter() { return boost::shared_ptr(); } + boost::shared_ptr peak_meter() const { return boost::shared_ptr(); } + boost::shared_ptr phase_control() const { return boost::shared_ptr(); } + boost::shared_ptr trim_control() const { return boost::shared_ptr(); } + boost::shared_ptr pan_azimuth_control() const { return boost::shared_ptr(); } + boost::shared_ptr pan_elevation_control() const { return boost::shared_ptr(); } + boost::shared_ptr pan_width_control() const { return boost::shared_ptr(); } + boost::shared_ptr pan_frontback_control() const { return boost::shared_ptr(); } + boost::shared_ptr pan_lfe_control() const { return boost::shared_ptr(); } + uint32_t eq_band_cnt () const { return 0; } + std::string eq_band_name (uint32_t) const { return std::string(); } + boost::shared_ptr eq_gain_controllable (uint32_t band) const { return boost::shared_ptr(); } + boost::shared_ptr eq_freq_controllable (uint32_t band) const { return boost::shared_ptr(); } + boost::shared_ptr eq_q_controllable (uint32_t band) const { return boost::shared_ptr(); } + boost::shared_ptr eq_shape_controllable (uint32_t band) const { return boost::shared_ptr(); } + boost::shared_ptr eq_enable_controllable () const { return boost::shared_ptr(); } + boost::shared_ptr eq_hpf_controllable () const { return boost::shared_ptr(); } + boost::shared_ptr comp_enable_controllable () const { return boost::shared_ptr(); } + boost::shared_ptr comp_threshold_controllable () const { return boost::shared_ptr(); } + boost::shared_ptr comp_speed_controllable () const { return boost::shared_ptr(); } + boost::shared_ptr comp_mode_controllable () const { return boost::shared_ptr(); } + boost::shared_ptr comp_makeup_controllable () const { return boost::shared_ptr(); } + boost::shared_ptr comp_redux_controllable () const { return boost::shared_ptr(); } + std::string comp_mode_name (uint32_t mode) const { return std::string(); } + std::string comp_speed_name (uint32_t mode) const { return std::string(); } + boost::shared_ptr send_level_controllable (uint32_t n) const { return boost::shared_ptr(); } + boost::shared_ptr send_enable_controllable (uint32_t n) const { return boost::shared_ptr(); } + std::string send_name (uint32_t n) const { return std::string(); } + boost::shared_ptr master_send_enable_controllable () const { return boost::shared_ptr(); } + boost::shared_ptr monitor_control() const { return boost::shared_ptr(); } + boost::shared_ptr monitoring_control() const { return boost::shared_ptr(); } + private: - uint32_t _number; - std::string _name; - boost::shared_ptr _control; + int32_t _number; + + boost::shared_ptr _gain_control; + boost::shared_ptr _solo_control; + boost::shared_ptr _mute_control; + + + static int32_t next_number; + static Glib::Threads::Mutex number_lock; - static gint next_number; + void solo_target_going_away (boost::weak_ptr); + void mute_target_going_away (boost::weak_ptr); + bool soloed_locked () const; + bool muted_locked () const; }; } /* namespace */