13
0

tentative steps in infrastructure for displaying clip data during capture

This commit is contained in:
Paul Davis 2024-10-10 13:30:52 -06:00
parent 6193535a31
commit 62a4df52c7
2 changed files with 39 additions and 26 deletions

View File

@ -966,6 +966,8 @@ class LIBARDOUR_API TriggerBox : public Processor, public std::enable_shared_fro
void maybe_capture (BufferSet& bufs, samplepos_t start_sample, samplepos_t end_sample, double speed, pframes_t nframes);
void finish_recording (BufferSet& bufs);
void set_armed (SlotArmInfo*);
SlotArmInfo* capture_info() const { return _arm_info; }
PBD::Signal0<void> Captured;
/* These four are accessed (read/write) only from process() context */

View File

@ -3633,7 +3633,7 @@ TriggerBox::maybe_capture (BufferSet& bufs, samplepos_t start_sample, samplepos_
/* Audio */
const size_t n_buffers = bufs.count().n_audio();
size_t n_buffers = bufs.count().n_audio();
if (n_buffers) {
@ -3646,6 +3646,11 @@ TriggerBox::maybe_capture (BufferSet& bufs, samplepos_t start_sample, samplepos_
}
}
n_buffers = bufs.count().n_midi();
bool send_signal = false;
if (n_buffers) {
/* MIDI */
MidiBuffer& buf = bufs.get_midi (0);
@ -3676,9 +3681,15 @@ TriggerBox::maybe_capture (BufferSet& bufs, samplepos_t start_sample, samplepos_
const samplepos_t event_time (start_sample + ev.time() - ai->start.samples());
if (!ai->end || (event_time < ai->end.samples())) {
ai->midi_buf->write (tmap->quarters_at_sample (event_time), ev.event_type(), ev.size(), ev.buffer());
send_signal = true;
}
}
}
}
if (send_signal) {
Captured(); /* EMIT SIGNAL */
}
if (reached_end) {
finish_recording (bufs);