diff options
author | Paul Davis <paul@linuxaudiosystems.com> | 2016-03-07 14:59:40 -0500 |
---|---|---|
committer | Paul Davis <paul@linuxaudiosystems.com> | 2016-05-31 15:30:39 -0400 |
commit | 1f6800d421fc41e6797e0bc3b6e78a6e07e97120 (patch) | |
tree | a08ec9f91927f3f0c438e4b749b351a146ebc92f /libs/ardour/ardour/vca.h | |
parent | a03d969a978126d72f0825096d9d9ec89816a0d9 (diff) |
redesign Route and VCA objects to inherit from ARDOUR::Stripable
Diffstat (limited to 'libs/ardour/ardour/vca.h')
-rw-r--r-- | libs/ardour/ardour/vca.h | 93 |
1 files changed, 74 insertions, 19 deletions
diff --git a/libs/ardour/ardour/vca.h b/libs/ardour/ardour/vca.h index 15850242cc..cca83a13f2 100644 --- a/libs/ardour/ardour/vca.h +++ b/libs/ardour/ardour/vca.h @@ -21,60 +21,112 @@ #include <string> #include <boost/shared_ptr.hpp> +#include <boost/enable_shared_from_this.hpp> #include "pbd/controllable.h" #include "pbd/statefuldestructible.h" #include "ardour/automatable.h" -#include "ardour/session_handle.h" +#include "ardour/stripable.h" namespace ARDOUR { class GainControl; class Route; -class LIBARDOUR_API VCA : public SessionHandleRef, public PBD::StatefulDestructible, public Automatable { +class LIBARDOUR_API VCA : public Stripable, public Automatable, public boost::enable_shared_from_this<VCA> { public: VCA (Session& session, uint32_t num, const std::string& name); - VCA (Session& session, XMLNode const&, int version); ~VCA(); - std::string name() const { return _name; } uint32_t number () const { return _number; } + uint32_t remote_control_id() const; - void set_name (std::string const&); - - void set_value (double val, PBD::Controllable::GroupControlDisposition group_override); - double get_value () const; - - boost::shared_ptr<GainControl> control() const { return _control; } - + int init (); XMLNode& get_state(); int set_state (XMLNode const&, int version); void add_solo_mute_target (boost::shared_ptr<Route>); void remove_solo_mute_target (boost::shared_ptr<Route>); - void set_solo (bool yn); bool soloed () const; - - void set_mute (bool yn); bool muted () const; - PBD::Signal0<void> SoloChange; - PBD::Signal0<void> MuteChange; - static std::string default_name_template (); static int next_vca_number (); static std::string xml_node_name; + virtual boost::shared_ptr<GainControl> gain_control() const { return _gain_control; } + virtual boost::shared_ptr<AutomationControl> solo_control() const { return _solo_control; } + virtual boost::shared_ptr<AutomationControl> mute_control() const { return _mute_control; } + + /* null Stripable API, because VCAs don't have any of this */ + + virtual boost::shared_ptr<PeakMeter> peak_meter() { return boost::shared_ptr<PeakMeter>(); } + virtual boost::shared_ptr<const PeakMeter> peak_meter() const { return boost::shared_ptr<PeakMeter>(); } + virtual boost::shared_ptr<AutomationControl> phase_control() const { return boost::shared_ptr<AutomationControl>(); } + virtual boost::shared_ptr<AutomationControl> trim_control() const { return boost::shared_ptr<AutomationControl>(); } + virtual boost::shared_ptr<AutomationControl> monitoring_control() const { return boost::shared_ptr<AutomationControl>(); } + virtual boost::shared_ptr<AutomationControl> recenable_control() const { return boost::shared_ptr<AutomationControl>(); } + virtual boost::shared_ptr<AutomationControl> pan_azimuth_control() const { return boost::shared_ptr<AutomationControl>(); } + virtual boost::shared_ptr<AutomationControl> pan_elevation_control() const { return boost::shared_ptr<AutomationControl>(); } + virtual boost::shared_ptr<AutomationControl> pan_width_control() const { return boost::shared_ptr<AutomationControl>(); } + virtual boost::shared_ptr<AutomationControl> pan_frontback_control() const { return boost::shared_ptr<AutomationControl>(); } + virtual boost::shared_ptr<AutomationControl> pan_lfe_control() const { return boost::shared_ptr<AutomationControl>(); } + virtual uint32_t eq_band_cnt () const { return 0; } + virtual std::string eq_band_name (uint32_t) const { return std::string(); } + virtual boost::shared_ptr<AutomationControl> eq_gain_controllable (uint32_t band) const { return boost::shared_ptr<AutomationControl>(); } + virtual boost::shared_ptr<AutomationControl> eq_freq_controllable (uint32_t band) const { return boost::shared_ptr<AutomationControl>(); } + virtual boost::shared_ptr<AutomationControl> eq_q_controllable (uint32_t band) const { return boost::shared_ptr<AutomationControl>(); } + virtual boost::shared_ptr<AutomationControl> eq_shape_controllable (uint32_t band) const { return boost::shared_ptr<AutomationControl>(); } + virtual boost::shared_ptr<AutomationControl> eq_enable_controllable () const { return boost::shared_ptr<AutomationControl>(); } + virtual boost::shared_ptr<AutomationControl> eq_hpf_controllable () const { return boost::shared_ptr<AutomationControl>(); } + virtual boost::shared_ptr<AutomationControl> comp_enable_controllable () const { return boost::shared_ptr<AutomationControl>(); } + virtual boost::shared_ptr<AutomationControl> comp_threshold_controllable () const { return boost::shared_ptr<AutomationControl>(); } + virtual boost::shared_ptr<AutomationControl> comp_speed_controllable () const { return boost::shared_ptr<AutomationControl>(); } + virtual boost::shared_ptr<AutomationControl> comp_mode_controllable () const { return boost::shared_ptr<AutomationControl>(); } + virtual boost::shared_ptr<AutomationControl> comp_makeup_controllable () const { return boost::shared_ptr<AutomationControl>(); } + virtual boost::shared_ptr<AutomationControl> comp_redux_controllable () const { return boost::shared_ptr<AutomationControl>(); } + virtual std::string comp_mode_name (uint32_t mode) const { return std::string(); } + virtual std::string comp_speed_name (uint32_t mode) const { return std::string(); } + virtual boost::shared_ptr<AutomationControl> send_level_controllable (uint32_t n) const { return boost::shared_ptr<AutomationControl>(); } + virtual boost::shared_ptr<AutomationControl> send_enable_controllable (uint32_t n) const { return boost::shared_ptr<AutomationControl>(); } + virtual std::string send_name (uint32_t n) const { return std::string(); } + virtual boost::shared_ptr<AutomationControl> master_send_enable_controllable () const { return boost::shared_ptr<AutomationControl>(); } + private: + class VCASoloControllable : public AutomationControl { + public: + VCASoloControllable (std::string const & name, boost::shared_ptr<VCA> vca); + void set_value (double, PBD::Controllable::GroupControlDisposition group_override); + void set_value_unchecked (double); + double get_value () const; + private: + void _set_value (double, PBD::Controllable::GroupControlDisposition group_override); + boost::weak_ptr<VCA> _vca; + }; + + class VCAMuteControllable : public AutomationControl { + public: + VCAMuteControllable (std::string const & name, boost::shared_ptr<VCA> vca); + void set_value (double, PBD::Controllable::GroupControlDisposition group_override); + void set_value_unchecked (double); + double get_value () const; + private: + void _set_value (double, PBD::Controllable::GroupControlDisposition group_override); + boost::weak_ptr<VCA> _vca; + }; + + friend class VCASoloControllable; + friend class VCAMuteControllable; + uint32_t _number; - std::string _name; - boost::shared_ptr<GainControl> _control; RouteList solo_mute_targets; PBD::ScopedConnectionList solo_mute_connections; mutable Glib::Threads::RWLock solo_mute_lock; + boost::shared_ptr<GainControl> _gain_control; + boost::shared_ptr<VCASoloControllable> _solo_control; + boost::shared_ptr<VCAMuteControllable> _mute_control; bool _solo_requested; bool _mute_requested; @@ -84,6 +136,9 @@ class LIBARDOUR_API VCA : public SessionHandleRef, public PBD::StatefulDestructi bool soloed_locked () const; bool muted_locked () const; + void set_solo (bool yn); + void set_mute (bool yn); + }; } /* namespace */ |