triggerbox: fix responses to "Play Cues" button being clicked

Session handles the case when the button is used to enable cue triggering, by
forcing a locate to the current transport position.

TriggerBox now connects to the correct configuration object to notice when cue
triggering is disabled, and sets _cancel_locate_armed appropriately.
This commit is contained in:
Paul Davis 2022-05-27 23:05:34 -06:00
parent fd879ca45d
commit c1f92861c6
2 changed files with 9 additions and 15 deletions

View File

@ -4415,6 +4415,12 @@ Session::config_changed (std::string p, bool ours)
_master_out->set_volume_applies_to_output (true);
master_volume ()->set_value (GAIN_COEFF_UNITY, Controllable::NoGroup);
}
} else if (p == "cue-behavior") {
bool follow = (config.get_cue_behavior() & FollowCues);
std::cerr << "cue behavior changed, follow = " << follow << std::endl;
if (follow && !transport_state_rolling() && !loading()) {
request_locate (transport_sample(), true);
}
}
set_dirty ();

View File

@ -2900,6 +2900,7 @@ TriggerBox::TriggerBox (Session& s, DataType dt)
}
Config->ParameterChanged.connect_same_thread (*this, boost::bind (&TriggerBox::parameter_changed, this, _1));
_session.config.ParameterChanged.connect_same_thread (*this, boost::bind (&TriggerBox::parameter_changed, this, _1));
}
void
@ -2919,21 +2920,8 @@ TriggerBox::parameter_changed (std::string const & param)
reconnect_to_default ();
} else if (param == "cue-behavior") {
bool follow = (_session.config.get_cue_behavior() & FollowCues);
if (follow) {
/* XXX this is all wrong. We have to do the
* fast_forward() call from something like the butler
* thread, as we do when a locate happens (and we are
* following cues).
*
* FIX ME.
*/
if (!_session.transport_state_rolling()) {
fast_forward (_session.cue_events(), _session.transport_sample());
}
} else {
const bool follow = (_session.config.get_cue_behavior() & FollowCues);
if (!follow) {
cancel_locate_armed ();
}
}