diff options
author | David Robillard <d@drobilla.net> | 2007-09-30 17:36:38 +0000 |
---|---|---|
committer | David Robillard <d@drobilla.net> | 2007-09-30 17:36:38 +0000 |
commit | c40ddfc0eebbcb3333d6cc9e3df7fb62ecb45941 (patch) | |
tree | 6e73d5d43284335031cee32f9225b698f315a59d /src/libs/engine/MidiDriver.hpp | |
parent | 829075dff9fe5d0b3f243f9e40256563a5f8e09a (diff) | |
download | ingen-c40ddfc0eebbcb3333d6cc9e3df7fb62ecb45941.tar.gz ingen-c40ddfc0eebbcb3333d6cc9e3df7fb62ecb45941.tar.bz2 ingen-c40ddfc0eebbcb3333d6cc9e3df7fb62ecb45941.zip |
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
Diffstat (limited to 'src/libs/engine/MidiDriver.hpp')
-rw-r--r-- | src/libs/engine/MidiDriver.hpp | 24 |
1 files changed, 21 insertions, 3 deletions
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) {} }; |