13
0

start to accumulate trigger properties

They will need to become properties eventually, I think
This commit is contained in:
Paul Davis 2021-07-18 12:52:12 -06:00
parent aa4e578780
commit 50d68a6a34
2 changed files with 36 additions and 1 deletions

View File

@ -42,14 +42,40 @@ class TriggerBox;
class LIBARDOUR_API Trigger {
public:
Trigger() : _running (false) {}
Trigger();
virtual ~Trigger() {}
virtual void bang (TriggerBox&, Temporal::Beats const &, samplepos_t) = 0;
bool running() const { return _running; }
enum LaunchStyle {
Loop, /* runs till stopped, reclick just restarts */
Gate, /* runs till mouse up/note off then to next quantization */
Toggle, /* runs till "clicked" again */
Repeat, /* plays only quantization extent until mouse up/note off */
};
LaunchStyle launch_style() const { return _launch_style; }
void set_launch_style (LaunchStyle);
enum FollowAction {
Stop,
QueuedTrigger, /* DP-style */
NextTrigger, /* Live-style, and below */
PrevTrigger,
FirstTrigger,
LastTrigger,
AnyTrigger,
OtherTrigger,
};
FollowAction follow_action() const { return _follow_action; }
void set_follow_action (FollowAction);
protected:
bool _running;
LaunchStyle _launch_style;
FollowAction _follow_action;
};
class LIBARDOUR_API AudioTrigger : public Trigger {

View File

@ -193,6 +193,15 @@ TriggerBox::set_state (const XMLNode&, int version)
}
/*--------------------*/
Trigger::Trigger ()
: _running (false)
, _launch_style (Loop)
, _follow_action (Stop)
{
}
/*--------------------*/
AudioTrigger::AudioTrigger (boost::shared_ptr<AudioRegion> r)