triggerbox: fix cue playback and recording

Somewhat alarmed that gcc (at least) allows if (cue_recording ...) to be
used just like if (_cue_recording) even though the former is a class method
and the latter is a class member.
This commit is contained in:
Paul Davis 2022-01-27 11:36:04 -07:00
parent 0dc19a2b31
commit 15f0e4dbbf
3 changed files with 10 additions and 6 deletions

View file

@ -1354,7 +1354,7 @@ public:
PBD::TimingStats dsp_stats[NTT];
int32_t first_cue_within (samplepos_t s, samplepos_t e);
int32_t first_cue_within (samplepos_t s, samplepos_t e, bool& was_recorded);
void cue_bang (int32_t);
protected:

View file

@ -1628,10 +1628,12 @@ Session::sync_cues_from_list (Locations::LocationList const & locs)
}
int32_t
Session::first_cue_within (samplepos_t s, samplepos_t e)
Session::first_cue_within (samplepos_t s, samplepos_t e, bool& was_recorded)
{
int32_t active_cue = _active_cue.load ();
was_recorded = false;
if (active_cue >= 0) {
return active_cue;
}
@ -1645,6 +1647,7 @@ Session::first_cue_within (samplepos_t s, samplepos_t e)
if (si != _cue_events.end()) {
if (si->time < e) {
was_recorded = true;
return si->cue;
}
}

View file

@ -2692,10 +2692,11 @@ TriggerBox::run (BufferSet& bufs, samplepos_t start_sample, samplepos_t end_samp
_sidechain->run (bufs, start_sample, end_sample, speed, nframes, true);
}
if (!_cue_recording) {
int32_t cue_bang = _session.first_cue_within (start_sample, end_sample);
bool was_recorded;
int32_t cue_bang = _session.first_cue_within (start_sample, end_sample, was_recorded);
if (cue_bang >= 0) {
std::cerr << " CUE BANG " << cue_bang << std::endl;
if (!_cue_recording || !was_recorded) {
_active_scene = cue_bang;
}
}