13
0

triggerbox: add skeleton for push/pop of cue-affected trigger properties

This commit is contained in:
Paul Davis 2021-12-29 12:41:11 -07:00
parent 88e9db30e3
commit 27dfbecd54
2 changed files with 36 additions and 0 deletions

View File

@ -287,6 +287,24 @@ class LIBARDOUR_API Trigger : public PBD::Stateful {
PBD::Property<bool> _isolated;
PBD::Property<color_t> _color;
struct CueModifiedProperties {
FollowAction follow_action;
LaunchStyle launch_style;
CueModifiedProperties() : follow_action (NextTrigger), launch_style (Toggle), _valid (false) {}
CueModifiedProperties (FollowAction fa, LaunchStyle ls) : follow_action (fa), launch_style (ls), _valid (true) {}
bool valid() const { return _valid; }
void invalidate() { _valid = false; }
private:
bool _valid;
};
CueModifiedProperties pre_cue_properties;
void push_cue_properties ();
void pop_cue_properties ();
/* computed from data */
double _barcnt; /* our estimate of the number of bars in the region */

View File

@ -112,6 +112,24 @@ Trigger::Trigger (uint32_t n, TriggerBox& b)
add_property (_color);
}
void
Trigger::push_cue_properties ()
{
/* must be called from RT process context */
pre_cue_properties = CueModifiedProperties (_follow_action0, _launch_style);
}
void
Trigger::pop_cue_properties ()
{
/* must be called from RT process context */
if (pre_cue_properties.valid()) {
_follow_action0 = pre_cue_properties.follow_action;
_launch_style = pre_cue_properties.launch_style;
pre_cue_properties.invalidate ();
}
}
void
Trigger::request_trigger_delete (Trigger* t)
{