13
0

Automation - more toggled controller twiddling.

This commit is contained in:
nick_m 2015-10-03 05:08:26 +10:00
parent 1648000108
commit ffed94d89b
3 changed files with 32 additions and 32 deletions

View File

@ -197,28 +197,26 @@ AutomationController::toggled ()
{
ArdourButton* but = dynamic_cast<ArdourButton*>(_widget);
const AutoState as = _controllable->automation_state ();
const double where = _controllable->session ().audible_frame ();
const bool to_list = _controllable->list () && _controllable->session().transport_rolling () && (as == Touch || as == Write);
if (but) {
if (_controllable->session().transport_rolling()) {
if (_controllable->automation_state() == Touch && _controllable->list()->in_new_write_pass ()) {
_controllable->alist()->start_write_pass ( _controllable->session().audible_frame());
}
if (_controllable->list()) {
_controllable->list()->set_in_write_pass(true, false, _controllable->session().audible_frame());
if (to_list) {
if (as == Touch && _controllable->list ()->in_new_write_pass ()) {
_controllable->alist ()->start_write_pass (where);
}
_controllable->list ()->set_in_write_pass (true, false, where);
}
_controllable->set_double (!but->get_active (), _controllable->session ().transport_frame (), to_list);
_controllable->set_double (!but->get_active (), where, to_list);
const bool was_active = _controllable->get_value() >= 0.5;
if (was_active && but->get_active()) {
_adjustment->set_value(0.0);
but->set_active(false);
} else if (!was_active && !but->get_active()) {
_adjustment->set_value(1.0);
but->set_active(true);
const bool active = _controllable->get_double (to_list, where) >= 0.5;
if (active && !but->get_active ()) {
_adjustment->set_value (1.0);
but->set_active (true);
} else if (!active && but->get_active ()) {
_adjustment->set_value (0.0);
but->set_active (false);
}
}
}

View File

@ -397,17 +397,19 @@ Automatable::transport_stopped (framepos_t now)
const bool list_did_write = !l->in_new_write_pass ();
l->stop_touch (true, now);
if (list_did_write) {
c->commit_transaction ();
}
l->write_pass_finished (now, Config->get_automation_thinning_factor());
if (l->automation_state() == Write) {
l->write_pass_finished (now, Config->get_automation_thinning_factor ());
if (l->automation_state () == Write) {
l->set_automation_state (Touch);
}
if (l->automation_playback()) {
c->set_value(c->list()->eval(now));
if (l->automation_playback ()) {
c->set_value (c->list ()->eval (now));
}
}
}

View File

@ -3900,22 +3900,22 @@ 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. */
/* this is a tweak of ControlList::automation_write ()
as currently MuteControllable can't be touching.
bool to_list = _list && ((AutomationList*)_list.get())->automation_write();
*/
AutomationList* alist = (AutomationList*)_list.get();
const AutoState as = alist->automation_state ();
const bool to_list = _list && _session.transport_rolling () && (as == Touch || as == Write);
const bool to_list = _list && ((AutomationList*)_list.get ())->automation_write ();
const double where = _session.audible_frame ();
if (to_list) {
if (as == Touch && _list->in_new_write_pass ()) {
alist->start_write_pass (_session.audible_frame ());
}
_list->set_in_write_pass (true, false, _session.audible_frame ());
/* Note that we really need this:
* if (as == Touch && _list->in_new_write_pass ()) {
* alist->start_write_pass (_session.audible_frame ());
* }
* here in the case of the user calling from a GUI or whatever.
* Without the ability to distinguish between user and
* automation-initiated changes, we lose the "touch mute"
* behaviour we have in AutomationController::toggled ().
*/
_list->set_in_write_pass (true, false, where);
}
Control::set_double (muted, _session.transport_frame(), to_list);
Control::set_double (muted, where, to_list);
}
void