diff --git a/libs/ardour/ardour/triggerbox.h b/libs/ardour/ardour/triggerbox.h index 05c11ecba1..0a78b6e4ba 100644 --- a/libs/ardour/ardour/triggerbox.h +++ b/libs/ardour/ardour/triggerbox.h @@ -445,9 +445,13 @@ class LIBARDOUR_API TriggerBox : public Processor void request_stop_all (); - /* only valid when called by Triggers from within ::process_state_requests() */ - bool currently_playing() const { return _currently_playing; } - void set_next (uint64_t which); + Trigger* currently_playing() const { return _currently_playing; } + + /* Returns a negative value is there is no active Trigger, or a value between 0 + * and 1.0 if there is, corresponding to the value of position_as_fraction() for + * the active Trigger. + */ + double position_as_fraction() const; void queue_explict (Trigger*); Trigger* get_next_trigger (); diff --git a/libs/ardour/triggerbox.cc b/libs/ardour/triggerbox.cc index 7fa530b722..a9a68ca9bb 100644 --- a/libs/ardour/triggerbox.cc +++ b/libs/ardour/triggerbox.cc @@ -2401,6 +2401,16 @@ TriggerBox::reload (BufferSet& bufs, int32_t slot, void* ptr) all_triggers[slot]->reload (bufs, ptr); } +double +TriggerBox::position_as_fraction () const +{ + Trigger* cp = _currently_playing; + if (!cp) { + return -1; + } + return cp->position_as_fraction (); +} + /* Thread */ MultiAllocSingleReleasePool* TriggerBoxThread::Request::pool = 0;