From c40ddfc0eebbcb3333d6cc9e3df7fb62ecb45941 Mon Sep 17 00:00:00 2001 From: David Robillard Date: Sun, 30 Sep 2007 17:36:38 +0000 Subject: Better driver interface for input/output. MIDI output (pass-through anyway, plugin->output is still screwy). Fix crash on failure to instantiate LV2 plugin. git-svn-id: http://svn.drobilla.net/lad/ingen@786 a436a847-0d15-0410-975c-d299462d15a1 --- src/libs/engine/MidiDriver.hpp | 24 +++++++++++++++++++++--- 1 file changed, 21 insertions(+), 3 deletions(-) (limited to 'src/libs/engine/MidiDriver.hpp') diff --git a/src/libs/engine/MidiDriver.hpp b/src/libs/engine/MidiDriver.hpp index acf88a3e..13b87726 100644 --- a/src/libs/engine/MidiDriver.hpp +++ b/src/libs/engine/MidiDriver.hpp @@ -25,6 +25,8 @@ namespace Ingen { +class ProcessContext; + /** Midi driver abstract base class. * @@ -35,8 +37,23 @@ class MidiDriver : public Driver public: MidiDriver() : Driver(DataType::MIDI) {} - /** Prepare events (however neccessary) for the specified block (realtime safe) */ - virtual void prepare_block(const SampleCount block_start, const SampleCount block_end) = 0; + /** Prepare input for the specified (upcoming) cycle. + * + * Realtime safe, run in audio thread before executing the graph for a cycle. + */ + virtual void pre_process(ProcessContext& context, + SampleCount nframes, + FrameTime start, + FrameTime end) = 0; + + /** Prepare output for the specified (just completed) cycle. + * + * Realtime safe, run in audio thread after executing the graph for a cycle. + */ + virtual void post_process(ProcessContext& context, + SampleCount nframes, + FrameTime start, + FrameTime end) = 0; }; @@ -73,7 +90,8 @@ public: void add_port(DriverPort* port) {} DriverPort* remove_port(const Raul::Path& path) { return NULL; } - void prepare_block(const SampleCount block_start, const SampleCount block_end) {} + void pre_process(ProcessContext& context, SampleCount nframes, FrameTime start, FrameTime end) {} + void post_process(ProcessContext& context, SampleCount nframes, FrameTime start, FrameTime end) {} }; -- cgit v1.2.1