X-Git-Url: https://git.carlh.net/gitweb/?a=blobdiff_plain;f=libs%2Fardour%2Froute.cc;h=44b0acb50ab3b710c8d25cde480b66ed2d9cf19e;hb=11bd4eed89f79927f2f7d8cab50a60380cf9e49e;hp=69b37fb7c3f7ff79622902bafc92d23d45e80efb;hpb=d9c9acaa80d1701b210eae82f5a365cb3e63c56a;p=ardour.git diff --git a/libs/ardour/route.cc b/libs/ardour/route.cc index 69b37fb7c3..44b0acb50a 100644 --- a/libs/ardour/route.cc +++ b/libs/ardour/route.cc @@ -72,6 +72,7 @@ Route::Route (Session& sess, string name, Flag flg, DataType default_type) , AutomatableControls (sess) , _flags (flg) , _solo_control (new SoloControllable (X_("solo"), *this)) + , _mute_control (new MuteControllable (X_("mute"), *this)) , _mute_master (new MuteMaster (sess, name)) , _default_type (default_type) @@ -102,6 +103,7 @@ Route::Route (Session& sess, const XMLNode& node, DataType default_type) : SessionObject (sess, "toBeReset") , AutomatableControls (sess) , _solo_control (new SoloControllable (X_("solo"), *this)) + , _mute_control (new MuteControllable (X_("mute"), *this)) , _mute_master (new MuteMaster (sess, "toBeReset")) , _default_type (default_type) { @@ -142,10 +144,10 @@ Route::init () /* add standard controls */ _solo_control->set_flags (Controllable::Flag (_solo_control->flags() | Controllable::Toggle)); - _mute_master->set_flags (Controllable::Flag (_solo_control->flags() | Controllable::Toggle)); + _mute_control->set_flags (Controllable::Flag (_solo_control->flags() | Controllable::Toggle)); add_control (_solo_control); - add_control (_mute_master); + add_control (_mute_control); /* input and output objects */ @@ -165,8 +167,14 @@ Route::~Route () { DEBUG_TRACE (DEBUG::Destruction, string_compose ("route %1 destructor\n", _name)); + /* do this early so that we don't get incoming signals as we are going through destruction + */ + + drop_connections (); + /* don't use clear_processors here, as it depends on the session which may - be half-destroyed by now */ + be half-destroyed by now + */ Glib::RWLock::WriterLock lm (_processor_lock); for (ProcessorList::iterator i = _processors.begin(); i != _processors.end(); ++i) { @@ -2846,14 +2854,60 @@ void Route::SoloControllable::set_value (float val) { bool bval = ((val >= 0.5f) ? true: false); +# if 0 + this is how it should be done + boost::shared_ptr rl (new RouteList); + rl->push_back (route); + + if (Config->get_solo_control_is_listen_control()) { + _session.set_listen (rl, bval); + } else { + _session.set_solo (rl, bval); + } +#else route.set_solo (bval, this); +#endif } float Route::SoloControllable::get_value (void) const { - return route.self_soloed() ? 1.0f : 0.0f; + if (Config->get_solo_control_is_listen_control()) { + return route.listening() ? 1.0f : 0.0f; + } else { + return route.self_soloed() ? 1.0f : 0.0f; + } +} + +Route::MuteControllable::MuteControllable (std::string name, Route& r) + : AutomationControl (r.session(), Evoral::Parameter (MuteAutomation), + boost::shared_ptr(), name) + , route (r) +{ + boost::shared_ptr gl(new AutomationList(Evoral::Parameter(MuteAutomation))); + set_list (gl); +} + +void +Route::MuteControllable::set_value (float val) +{ + bool bval = ((val >= 0.5f) ? true: false); +# if 0 + this is how it should be done + + boost::shared_ptr rl (new RouteList); + rl->push_back (route); + _session.set_mute (rl, bval); +#else + route.set_mute (bval, this); +#endif +} + +float +Route::MuteControllable::get_value (void) const +{ + return route.muted() ? 1.0f : 0.0f; } void