triggerbox: fix use of cues container without checking for content (and drop goto)
This commit is contained in:
parent
8f9ad771b3
commit
774268ada8
@ -895,6 +895,7 @@ class LIBARDOUR_API TriggerBox : public Processor
|
|||||||
void reload (BufferSet& bufs, int32_t slot, void* ptr);
|
void reload (BufferSet& bufs, int32_t slot, void* ptr);
|
||||||
|
|
||||||
void cancel_locate_armed ();
|
void cancel_locate_armed ();
|
||||||
|
void fast_forward_nothing_to_do ();
|
||||||
|
|
||||||
PBD::ScopedConnection stop_all_connection;
|
PBD::ScopedConnection stop_all_connection;
|
||||||
|
|
||||||
|
@ -2964,6 +2964,15 @@ TriggerBox::cancel_locate_armed ()
|
|||||||
_cancel_locate_armed = true;
|
_cancel_locate_armed = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
TriggerBox::fast_forward_nothing_to_do ()
|
||||||
|
{
|
||||||
|
cancel_locate_armed ();
|
||||||
|
if (tracker) {
|
||||||
|
tracker->reset ();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
TriggerBox::fast_forward (CueEvents const & cues, samplepos_t transport_position)
|
TriggerBox::fast_forward (CueEvents const & cues, samplepos_t transport_position)
|
||||||
{
|
{
|
||||||
@ -2974,10 +2983,11 @@ TriggerBox::fast_forward (CueEvents const & cues, samplepos_t transport_position
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
PBD::Unwinder<bool> uw (_fast_forwarding, true);
|
if (cues.empty() || (cues.front().time > transport_position)) {
|
||||||
|
DEBUG_TRACE (DEBUG::Triggers, string_compose ("%1: nothing to be done, cp = %2\n", order(), _currently_playing));
|
||||||
using namespace Temporal;
|
fast_forward_nothing_to_do ();
|
||||||
TempoMap::SharedPtr tmap (TempoMap::use());
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
CueEvents::const_reverse_iterator c = cues.rbegin ();
|
CueEvents::const_reverse_iterator c = cues.rbegin ();
|
||||||
samplepos_t pos = c->time;
|
samplepos_t pos = c->time;
|
||||||
@ -2988,10 +2998,10 @@ TriggerBox::fast_forward (CueEvents const & cues, samplepos_t transport_position
|
|||||||
bool will_start;
|
bool will_start;
|
||||||
uint32_t cnt = 0;
|
uint32_t cnt = 0;
|
||||||
|
|
||||||
if (cues.empty() || (cues.front().time > transport_position)) {
|
using namespace Temporal;
|
||||||
DEBUG_TRACE (DEBUG::Triggers, string_compose ("%1: nothing to be done, cp = %2\n", order(), _currently_playing));
|
TempoMap::SharedPtr tmap (TempoMap::use());
|
||||||
goto nothing_to_do;
|
|
||||||
}
|
PBD::Unwinder<bool> uw (_fast_forwarding, true);
|
||||||
|
|
||||||
/* Walk backwards through cues to find the first one that is either a
|
/* Walk backwards through cues to find the first one that is either a
|
||||||
* stop-all cue or references a non-cue-isolated trigger, and is
|
* stop-all cue or references a non-cue-isolated trigger, and is
|
||||||
@ -3021,7 +3031,8 @@ TriggerBox::fast_forward (CueEvents const & cues, samplepos_t transport_position
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
if (c == cues.rend() || (c->cue == CueRecord::stop_all) | (c->time == transport_position)) {
|
if (c == cues.rend() || (c->cue == CueRecord::stop_all) | (c->time == transport_position)) {
|
||||||
goto nothing_to_do;
|
fast_forward_nothing_to_do ();
|
||||||
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
trig = all_triggers[c->cue];
|
trig = all_triggers[c->cue];
|
||||||
@ -3029,7 +3040,8 @@ TriggerBox::fast_forward (CueEvents const & cues, samplepos_t transport_position
|
|||||||
cnt = 0;
|
cnt = 0;
|
||||||
|
|
||||||
if (!trig->region()) {
|
if (!trig->region()) {
|
||||||
goto nothing_to_do;
|
fast_forward_nothing_to_do ();
|
||||||
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
while (pos < transport_position) {
|
while (pos < transport_position) {
|
||||||
@ -3054,7 +3066,8 @@ TriggerBox::fast_forward (CueEvents const & cues, samplepos_t transport_position
|
|||||||
subsequent trigger to follow this
|
subsequent trigger to follow this
|
||||||
one.
|
one.
|
||||||
*/
|
*/
|
||||||
goto nothing_to_do;
|
fast_forward_nothing_to_do ();
|
||||||
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
@ -3113,10 +3126,7 @@ TriggerBox::fast_forward (CueEvents const & cues, samplepos_t transport_position
|
|||||||
/* nothing to do */
|
/* nothing to do */
|
||||||
DEBUG_TRACE (DEBUG::Triggers, string_compose ("%1: no trigger to be rolled (%2 >= %3, trigger = %4)\n", order(), pos, transport_position, trig));
|
DEBUG_TRACE (DEBUG::Triggers, string_compose ("%1: no trigger to be rolled (%2 >= %3, trigger = %4)\n", order(), pos, transport_position, trig));
|
||||||
_currently_playing = 0;
|
_currently_playing = 0;
|
||||||
_locate_armed = false;
|
fast_forward_nothing_to_do ();
|
||||||
if (tracker) {
|
|
||||||
tracker->reset ();
|
|
||||||
}
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -3163,14 +3173,6 @@ TriggerBox::fast_forward (CueEvents const & cues, samplepos_t transport_position
|
|||||||
}
|
}
|
||||||
|
|
||||||
return;
|
return;
|
||||||
|
|
||||||
nothing_to_do:
|
|
||||||
cancel_locate_armed ();
|
|
||||||
if (tracker) {
|
|
||||||
tracker->reset ();
|
|
||||||
}
|
|
||||||
return;
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
|
Loading…
Reference in New Issue
Block a user