Mute automation via normal mute button.
This commit is contained in:
parent
d36b5c78bd
commit
e584ae0bf9
|
@ -394,15 +394,18 @@ class LIBARDOUR_API Route : public SessionObject, public Automatable, public Rou
|
|||
void set_value (double);
|
||||
double get_value () const;
|
||||
|
||||
/* Pretend to change value, but do not affect actual route mute. */
|
||||
void set_superficial_value(bool muted);
|
||||
|
||||
private:
|
||||
boost::weak_ptr<Route> _route;
|
||||
};
|
||||
|
||||
boost::shared_ptr<AutomationControl> solo_control() const {
|
||||
boost::shared_ptr<SoloControllable> solo_control() const {
|
||||
return _solo_control;
|
||||
}
|
||||
|
||||
boost::shared_ptr<AutomationControl> mute_control() const {
|
||||
boost::shared_ptr<MuteControllable> mute_control() const {
|
||||
return _mute_control;
|
||||
}
|
||||
|
||||
|
|
|
@ -3409,7 +3409,7 @@ Route::SoloControllable::SoloControllable (std::string name, boost::shared_ptr<R
|
|||
void
|
||||
Route::SoloControllable::set_value (double val)
|
||||
{
|
||||
bool bval = ((val >= 0.5f) ? true: false);
|
||||
const bool bval = ((val >= 0.5) ? true : false);
|
||||
|
||||
boost::shared_ptr<RouteList> rl (new RouteList);
|
||||
|
||||
|
@ -3455,38 +3455,52 @@ Route::MuteControllable::MuteControllable (std::string name, boost::shared_ptr<R
|
|||
set_list (gl);
|
||||
}
|
||||
|
||||
void
|
||||
Route::MuteControllable::set_superficial_value(bool muted)
|
||||
{
|
||||
/* Note we can not use AutomationControl::set_value here since it will emit
|
||||
Changed(), but the value will not be correct to the observer. */
|
||||
|
||||
bool to_list = _list && ((AutomationList*)_list.get())->automation_write();
|
||||
|
||||
Control::set_double (muted, _session.transport_frame(), to_list);
|
||||
}
|
||||
|
||||
void
|
||||
Route::MuteControllable::set_value (double val)
|
||||
{
|
||||
bool bval = ((val >= 0.5f) ? true: false);
|
||||
|
||||
// boost::shared_ptr<RouteList> rl (new RouteList);
|
||||
const bool bval = ((val >= 0.5) ? true : false);
|
||||
|
||||
boost::shared_ptr<Route> r = _route.lock ();
|
||||
if (!r) {
|
||||
return;
|
||||
}
|
||||
|
||||
/* I don't know why this apparently "should" be done via the RT event
|
||||
system, but doing so causes a ton of annoying errors... */
|
||||
// rl->push_back (r);
|
||||
// _session.set_mute (rl, bval);
|
||||
if (_list && ((AutomationList*)_list.get())->automation_playback()) {
|
||||
// Playing back automation, set route mute directly
|
||||
r->set_mute (bval, this);
|
||||
} else {
|
||||
// Set from user, queue mute event
|
||||
boost::shared_ptr<RouteList> rl (new RouteList);
|
||||
rl->push_back (r);
|
||||
_session.set_mute (rl, bval, Session::rt_cleanup);
|
||||
}
|
||||
|
||||
/* ... but this seems to work. */
|
||||
r->set_mute (bval, this);
|
||||
|
||||
AutomationControl::set_value(bval);
|
||||
// Set superficial/automation value to drive controller (and possibly record)
|
||||
set_superficial_value(bval);
|
||||
}
|
||||
|
||||
double
|
||||
Route::MuteControllable::get_value () const
|
||||
{
|
||||
boost::shared_ptr<Route> r = _route.lock ();
|
||||
if (!r) {
|
||||
return 0;
|
||||
if (_list && ((AutomationList*)_list.get())->automation_playback()) {
|
||||
// Playing back automation, get the value from the list
|
||||
return AutomationControl::get_value();
|
||||
}
|
||||
|
||||
return r->muted() ? 1.0f : 0.0f;
|
||||
// Not playing back automation, get the actual route mute value
|
||||
boost::shared_ptr<Route> r = _route.lock ();
|
||||
return (r && r->muted()) ? 1.0 : 0.0;
|
||||
}
|
||||
|
||||
void
|
||||
|
|
|
@ -143,6 +143,12 @@ Session::rt_set_listen (boost::shared_ptr<RouteList> rl, bool yn, bool /*group_o
|
|||
void
|
||||
Session::set_mute (boost::shared_ptr<RouteList> rl, bool yn, SessionEvent::RTeventCallback after, bool group_override)
|
||||
{
|
||||
/* Set superficial value of mute controls for automation. */
|
||||
for (RouteList::iterator i = rl->begin(); i != rl->end(); ++i) {
|
||||
boost::shared_ptr<Route::MuteControllable> mc = (*i)->mute_control();
|
||||
mc->set_superficial_value(yn);
|
||||
}
|
||||
|
||||
queue_event (get_rt_event (rl, yn, after, group_override, &Session::rt_set_mute));
|
||||
}
|
||||
|
||||
|
|
|
@ -50,7 +50,7 @@ public:
|
|||
|
||||
virtual ~Control() {}
|
||||
|
||||
virtual void set_double (double val, double frame=0, bool to_list=false);
|
||||
virtual void set_double (double val, double frame=0, bool to_list=false);
|
||||
virtual double get_double (bool from_list=false, double frame=0) const;
|
||||
|
||||
/** Get the latest user-set value
|
||||
|
|
Loading…
Reference in New Issue
Block a user