diff options
Diffstat (limited to 'libs/ardour/ardour')
-rw-r--r-- | libs/ardour/ardour/automation_control.h | 1 | ||||
-rw-r--r-- | libs/ardour/ardour/mute_master.h | 14 | ||||
-rw-r--r-- | libs/ardour/ardour/route.h | 54 | ||||
-rw-r--r-- | libs/ardour/ardour/session_solo_notifications.h | 53 | ||||
-rw-r--r-- | libs/ardour/ardour/vca.h | 13 |
5 files changed, 59 insertions, 76 deletions
diff --git a/libs/ardour/ardour/automation_control.h b/libs/ardour/ardour/automation_control.h index 9462a79748..455e8891c1 100644 --- a/libs/ardour/ardour/automation_control.h +++ b/libs/ardour/ardour/automation_control.h @@ -156,6 +156,7 @@ public: Masters _masters; PBD::ScopedConnectionList masters_connections; + virtual void master_changed (bool from_self, GroupControlDisposition gcd); void master_going_away (boost::weak_ptr<AutomationControl>); virtual void recompute_masters_ratios (double val) { /* do nothing by default */} virtual double get_masters_value_locked () const; diff --git a/libs/ardour/ardour/mute_master.h b/libs/ardour/ardour/mute_master.h index d88cbdcd39..14597cb56b 100644 --- a/libs/ardour/ardour/mute_master.h +++ b/libs/ardour/ardour/mute_master.h @@ -66,17 +66,21 @@ class LIBARDOUR_API MuteMaster : public SessionHandleRef, public PBD::Stateful void set_soloed_by_others (bool yn) { _soloed_by_others = yn; } void set_solo_ignore (bool yn) { _solo_ignore = yn; } + void mod_muted_by_others (int32_t delta); + bool muted_by_others () const { return _muted_by_others; } + PBD::Signal0<void> MutePointChanged; XMLNode& get_state(); int set_state(const XMLNode&, int version); private: - volatile MutePoint _mute_point; - volatile bool _muted_by_self; - volatile bool _soloed_by_self; - volatile bool _soloed_by_others; - volatile bool _solo_ignore; + MutePoint _mute_point; + bool _muted_by_self; + bool _soloed_by_self; + bool _soloed_by_others; + bool _solo_ignore; + int32_t _muted_by_others; }; } // namespace ARDOUR diff --git a/libs/ardour/ardour/route.h b/libs/ardour/ardour/route.h index 0afafe82eb..9abe56afcb 100644 --- a/libs/ardour/ardour/route.h +++ b/libs/ardour/ardour/route.h @@ -160,7 +160,8 @@ public: bool muted () const; void set_mute (bool yn, PBD::Controllable::GroupControlDisposition); - bool muted_by_others() const; + bool muted_by_others_soloing () const; + bool muted_by_others () const; /* controls use set_solo() to modify this route's solo state */ @@ -508,17 +509,57 @@ public: }; class SoloControllable : public BooleanRouteAutomationControl { - public: + public: SoloControllable (std::string name, boost::shared_ptr<Route>); void set_value (double, PBD::Controllable::GroupControlDisposition group_override); void set_value_unchecked (double); double get_value () const; - private: + + /* Export additional API so that objects that only get access + * to a Controllable/AutomationControl can do more fine-grained + * operations with respect to solo. Obviously, they would need + * to dynamic_cast<Route::SoloControllable> first. + * + * Solo state is not representable by a single scalar value, + * so this AutomationControl maps set_value() and get_value() + * to r->set_self_solo() and r->soloed() respectively. This + * means that the Controllable is technically asymmetric. It is + * possible to call ::set_value (0.0) to disable (self)solo, + * and then call ::get_value() and get a return of 1.0 because + * the Route owner is soloed by upstream/downstream. + */ + + void set_self_solo (bool yn) { + boost::shared_ptr<Route> r(_route.lock()); if (r) r->set_self_solo (yn); + } + void mod_solo_by_others_upstream (int32_t delta) { + boost::shared_ptr<Route> r(_route.lock()); if (r) r->mod_solo_by_others_upstream (delta); + } + void mod_solo_by_others_downstream (int32_t delta) { + boost::shared_ptr<Route> r(_route.lock()); if (r) r->mod_solo_by_others_downstream (delta); + } + bool soloed_by_others () const { + boost::shared_ptr<Route> r(_route.lock()); if (r) return r->soloed_by_others(); else return false; + } + bool soloed_by_others_upstream () const { + boost::shared_ptr<Route> r(_route.lock()); if (r) return r->soloed_by_others_upstream(); else return false; + } + bool soloed_by_others_downstream () const { + boost::shared_ptr<Route> r(_route.lock()); if (r) return r->soloed_by_others_downstream(); else return false; + } + bool self_soloed () const { + boost::shared_ptr<Route> r(_route.lock()); if (r) return r->self_soloed(); else return false; + } + + protected: + void master_changed (bool, PBD::Controllable::GroupControlDisposition); + + private: void _set_value (double, PBD::Controllable::GroupControlDisposition group_override); }; struct MuteControllable : public BooleanRouteAutomationControl { - public: + public: MuteControllable (std::string name, boost::shared_ptr<Route>); void set_value (double, PBD::Controllable::GroupControlDisposition group_override); void set_value_unchecked (double); @@ -526,7 +567,10 @@ public: /* Pretend to change value, but do not affect actual route mute. */ void set_superficial_value(bool muted); - private: + protected: + void master_changed (bool, PBD::Controllable::GroupControlDisposition); + + private: boost::weak_ptr<Route> _route; void _set_value (double, PBD::Controllable::GroupControlDisposition group_override); }; diff --git a/libs/ardour/ardour/session_solo_notifications.h b/libs/ardour/ardour/session_solo_notifications.h deleted file mode 100644 index bfb2e7d333..0000000000 --- a/libs/ardour/ardour/session_solo_notifications.h +++ /dev/null @@ -1,53 +0,0 @@ -/* - Copyright (C) 2016 Paul Davis - - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software - Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. - -*/ - -#ifndef __libardour_session_solo_notifications_h__ -#define __libardour_session_solo_notifications_h__ - -#include <boost/shared_ptr.hpp> -#include "pbd/controllable.h" - -namespace ARDOUR { - -class Route; - -template<typename T> -class SessionSoloNotifications -{ - public: - void solo_changed (bool self_solo_change, PBD::Controllable::GroupControlDisposition gcd, boost::shared_ptr<Route> route) { - static_cast<T*>(this)->_route_solo_changed (self_solo_change, gcd, route); - } - - void listen_changed (PBD::Controllable::GroupControlDisposition gcd, boost::shared_ptr<Route> route) { - static_cast<T*>(this)->_route_listen_changed (gcd, route); - } - - void mute_changed () { - static_cast<T*>(this)->_route_mute_changed (); - } - - void solo_isolated_changed (boost::shared_ptr<Route> route) { - static_cast<T*>(this)->_route_solo_isolated_changed (route); - } -}; - -} /* namespace */ - -#endif /* __libardour_session_solo_notifications_h__ */ diff --git a/libs/ardour/ardour/vca.h b/libs/ardour/ardour/vca.h index 82e0e7acd2..dc48ffa480 100644 --- a/libs/ardour/ardour/vca.h +++ b/libs/ardour/ardour/vca.h @@ -46,11 +46,6 @@ class LIBARDOUR_API VCA : public Stripable, public Automatable, public boost::en XMLNode& get_state(); int set_state (XMLNode const&, int version); - void add_solo_target (boost::shared_ptr<Route>); - void remove_solo_target (boost::shared_ptr<Route>); - void add_mute_target (boost::shared_ptr<Route>); - void remove_mute_target (boost::shared_ptr<Route>); - bool soloed () const; bool muted () const; @@ -128,14 +123,6 @@ class LIBARDOUR_API VCA : public Stripable, public Automatable, public boost::en uint32_t _number; - RouteList solo_targets; - PBD::ScopedConnectionList solo_connections; - mutable Glib::Threads::RWLock solo_lock; - - RouteList mute_targets; - PBD::ScopedConnectionList mute_connections; - mutable Glib::Threads::RWLock mute_lock; - boost::shared_ptr<GainControl> _gain_control; boost::shared_ptr<VCASoloControllable> _solo_control; boost::shared_ptr<VCAMuteControllable> _mute_control; |