summaryrefslogtreecommitdiff
path: root/libs/ardour/ardour
diff options
context:
space:
mode:
authorRobin Gareus <robin@gareus.org>2016-10-23 22:25:40 +0200
committerRobin Gareus <robin@gareus.org>2016-10-23 22:25:40 +0200
commit57d1f68cd6ef3b55fd43462b92dbed91b7c250ac (patch)
treee1168cc7b4bc0532728b2fa3b9b5504e7151b2aa /libs/ardour/ardour
parent7e861bd12e345073c8e86bf08bbc0f103be323c7 (diff)
Introduce "virtual" async MIDI ports
This allows to flush an async MIDI port's ringbuffer at cycle-start, to makes its data available as "input/source" during process(), while collecting data in the background for the next cycle. This facilitates virtual MIDI Ports for eg. Control Surface Pads: output from a surface, input to Ardour channels.
Diffstat (limited to 'libs/ardour/ardour')
-rw-r--r--libs/ardour/ardour/async_midi_port.h5
1 files changed, 4 insertions, 1 deletions
diff --git a/libs/ardour/ardour/async_midi_port.h b/libs/ardour/ardour/async_midi_port.h
index 46d5f94a91..4e578b5ed1 100644
--- a/libs/ardour/ardour/async_midi_port.h
+++ b/libs/ardour/ardour/async_midi_port.h
@@ -47,8 +47,10 @@ class LIBARDOUR_API AsyncMIDIPort : public ARDOUR::MidiPort, public MIDI::Port {
AsyncMIDIPort (std::string const &, PortFlags);
~AsyncMIDIPort ();
- /* called from an RT context */
+ bool flush_at_cycle_start () const { return _flush_at_cycle_start; }
+ void set_flush_at_cycle_start (bool en) { _flush_at_cycle_start = en; }
+ /* called from an RT context */
void cycle_start (pframes_t nframes);
void cycle_end (pframes_t nframes);
@@ -79,6 +81,7 @@ class LIBARDOUR_API AsyncMIDIPort : public ARDOUR::MidiPort, public MIDI::Port {
private:
bool _currently_in_cycle;
MIDI::timestamp_t _last_write_timestamp;
+ bool _flush_at_cycle_start;
bool have_timer;
boost::function<framecnt_t (void)> timer;
RingBuffer< Evoral::Event<double> > output_fifo;