diff options
author | David Robillard <d@drobilla.net> | 2012-04-05 00:15:54 +0000 |
---|---|---|
committer | David Robillard <d@drobilla.net> | 2012-04-05 00:15:54 +0000 |
commit | 338e83d9dc2aca8ced4358df7dae13e11a5c71a7 (patch) | |
tree | c58e6d936fe1fff99c962edecebd28b047f375b2 /libs/ardour/ardour/lv2_plugin.h | |
parent | daad719546d96bfe9ce7e8e1b7fc8f66c4189b71 (diff) |
Implement LV2 worker extension.
This is done by way of a generic Worker object/thread, which currently just
applies to one LV2 plugin, but the idea is to share one thread and set of
buffers among many plugins. The same pattern may also be useful elsewhere in
Ardour. The responding part gets a bit tricker when sharing a worker between
plugins, it's not a blocker, and I'm lazy, sooo here's this.
This commit also adds a new portable in-process semaphore to PBD. The existing
one is pretty weird and uses a named semaphore on OSX for reasons unknown to
me. Perhaps as a quick fix to avoid POSIX semaphores being utterly broken on
OSX? It would probably be a good idea to replace that with this new one, which
uses Mach kernel semaphores on OSX which work well, though I am not sure how
pedantically real-time safe they are to signal.
git-svn-id: svn://localhost/ardour2/branches/3.0@11790 d708f5d6-7413-0410-9779-e7cbd77b26cf
Diffstat (limited to 'libs/ardour/ardour/lv2_plugin.h')
-rw-r--r-- | libs/ardour/ardour/lv2_plugin.h | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/libs/ardour/ardour/lv2_plugin.h b/libs/ardour/ardour/lv2_plugin.h index 49d349f844..0c8ecaa34e 100644 --- a/libs/ardour/ardour/lv2_plugin.h +++ b/libs/ardour/ardour/lv2_plugin.h @@ -26,6 +26,7 @@ #include "ardour/plugin.h" #include "ardour/uri_map.h" +#include "ardour/worker.h" #include "pbd/ringbuffer.h" namespace ARDOUR { @@ -33,7 +34,7 @@ namespace ARDOUR { class AudioEngine; class Session; -class LV2Plugin : public ARDOUR::Plugin +class LV2Plugin : public ARDOUR::Plugin, public ARDOUR::Workee { public: LV2Plugin (ARDOUR::AudioEngine& engine, @@ -129,6 +130,9 @@ class LV2Plugin : public ARDOUR::Plugin void enable_ui_emmission(); void emit_to_ui(void* controller, UIMessageSink sink); + void work(uint32_t size, const void* data); + void work_response(uint32_t size, const void* data); + static URIMap _uri_map; static uint32_t _midi_event_type_ev; @@ -195,6 +199,7 @@ class LV2Plugin : public ARDOUR::Plugin LV2_Feature _data_access_feature; LV2_Feature _instance_access_feature; LV2_Feature _make_path_feature; + LV2_Feature _work_schedule_feature; mutable unsigned _state_version; |