summaryrefslogtreecommitdiffstats
path: root/src/server/BufferFactory.hpp
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2012-03-19 20:16:46 +0000
committerDavid Robillard <d@drobilla.net>2012-03-19 20:16:46 +0000
commit254b434f0a79fea54bd963e8ff2e845a5b0cd3a6 (patch)
treeddf849fc5b64d1096846c28c1f1a742f54c3adff /src/server/BufferFactory.hpp
parentbc3afd8380d59c750c8f8e9bf1ed1b8d4a6826e9 (diff)
downloadingen-254b434f0a79fea54bd963e8ff2e845a5b0cd3a6.tar.gz
ingen-254b434f0a79fea54bd963e8ff2e845a5b0cd3a6.tar.bz2
ingen-254b434f0a79fea54bd963e8ff2e845a5b0cd3a6.zip
Partially functioning communication between Ingen LV2 plugin and UI.
git-svn-id: http://svn.drobilla.net/lad/trunk/ingen@4078 a436a847-0d15-0410-975c-d299462d15a1
Diffstat (limited to 'src/server/BufferFactory.hpp')
-rw-r--r--src/server/BufferFactory.hpp35
1 files changed, 18 insertions, 17 deletions
diff --git a/src/server/BufferFactory.hpp b/src/server/BufferFactory.hpp
index 15d5ebb8..6f700fce 100644
--- a/src/server/BufferFactory.hpp
+++ b/src/server/BufferFactory.hpp
@@ -25,9 +25,12 @@
#undef nil
#include <glibmm/thread.h>
+#include "raul/Atom.hpp"
#include "raul/AtomicPtr.hpp"
#include "raul/RingBuffer.hpp"
#include "raul/SharedPtr.hpp"
+#include "ingen/shared/Forge.hpp"
+#include "ingen/shared/URIs.hpp"
#include "PortType.hpp"
#include "types.hpp"
@@ -50,33 +53,32 @@ public:
typedef boost::intrusive_ptr<Buffer> Ref;
- static size_t audio_buffer_size(SampleCount nframes);
- size_t default_buffer_size(PortType type);
+ static uint32_t audio_buffer_size(SampleCount nframes);
+ uint32_t default_buffer_size(LV2_URID type);
- Ref get(PortType type, size_t size=0, bool force_create=false);
+ Ref get(LV2_URID type, uint32_t capacity, bool force_create=false);
Ref silent_buffer();
void set_block_length(SampleCount block_length);
- Raul::Forge& forge();
- Ingen::Shared::URIs& uris() { assert(_uris); return *_uris.get(); }
+ Ingen::Forge& forge();
+ Ingen::Shared::URIs& uris() { assert(_uris); return *_uris.get(); }
+ Engine& engine() { return _engine; }
private:
friend class Buffer;
void recycle(Buffer* buf);
- Ref create(PortType type, size_t size=0);
-
- inline Raul::AtomicPtr<Buffer>& free_list(PortType type) {
- switch (type.symbol()) {
- case PortType::AUDIO:
- case PortType::CV: return _free_audio;
- case PortType::CONTROL: return _free_control;
- case PortType::EVENTS: return _free_event;
- case PortType::VALUE:
- case PortType::MESSAGE: return _free_object;
- default: throw;
+ Ref create(LV2_URID type, uint32_t capacity=0);
+
+ inline Raul::AtomicPtr<Buffer>& free_list(LV2_URID type) {
+ if (type == _uris->atom_Float) {
+ return _free_control;
+ } else if (type == _uris->atom_Sound) {
+ return _free_audio;
+ } else {
+ return _free_object;
}
}
@@ -84,7 +86,6 @@ private:
Raul::AtomicPtr<Buffer> _free_audio;
Raul::AtomicPtr<Buffer> _free_control;
- Raul::AtomicPtr<Buffer> _free_event;
Raul::AtomicPtr<Buffer> _free_object;
Glib::Mutex _mutex;