diff options
author | David Robillard <d@drobilla.net> | 2013-06-08 21:41:07 +0000 |
---|---|---|
committer | David Robillard <d@drobilla.net> | 2013-06-08 21:41:07 +0000 |
commit | 1b38fdcc778ca6b82efc549243d4312645441c50 (patch) | |
tree | e398816aa57963654a73a93ff4d65a05776c0d37 | |
parent | 29eb3c251811e4f34b95312c75e9c6510df5a6c3 (diff) | |
download | ingen-1b38fdcc778ca6b82efc549243d4312645441c50.tar.gz ingen-1b38fdcc778ca6b82efc549243d4312645441c50.tar.bz2 ingen-1b38fdcc778ca6b82efc549243d4312645441c50.zip |
Specify rsz:minimumSize for main control ports.
Fix running as an LV2 plugin at very low block sizes.
git-svn-id: http://svn.drobilla.net/lad/trunk/ingen@5128 a436a847-0d15-0410-975c-d299462d15a1
-rw-r--r-- | ingen/URIs.hpp | 1 | ||||
-rw-r--r-- | src/URIs.cpp | 2 | ||||
-rw-r--r-- | src/server/Engine.cpp | 3 | ||||
-rw-r--r-- | src/server/ingen_lv2.cpp | 17 |
4 files changed, 19 insertions, 4 deletions
diff --git a/ingen/URIs.hpp b/ingen/URIs.hpp index 4cbe62a6..42d06e10 100644 --- a/ingen/URIs.hpp +++ b/ingen/URIs.hpp @@ -149,6 +149,7 @@ public: const Quark pprops_logarithmic; const Quark rdf_type; const Quark rdfs_seeAlso; + const Quark rsz_minimumSize; const Quark time_Position; const Quark time_bar; const Quark time_barBeat; diff --git a/src/URIs.cpp b/src/URIs.cpp index d2d3d9fa..fcb3f8d4 100644 --- a/src/URIs.cpp +++ b/src/URIs.cpp @@ -23,6 +23,7 @@ #include "lv2/lv2plug.in/ns/ext/morph/morph.h" #include "lv2/lv2plug.in/ns/ext/patch/patch.h" #include "lv2/lv2plug.in/ns/ext/port-props/port-props.h" +#include "lv2/lv2plug.in/ns/ext/resize-port/resize-port.h" #include "lv2/lv2plug.in/ns/ext/time/time.h" #include "lv2/lv2plug.in/ns/lv2core/lv2.h" @@ -137,6 +138,7 @@ URIs::URIs(Forge& f, URIMap* map) , pprops_logarithmic (forge, map, LV2_PORT_PROPS__logarithmic) , rdf_type (forge, map, NS_RDF "type") , rdfs_seeAlso (forge, map, NS_RDFS "seeAlso") + , rsz_minimumSize (forge, map, LV2_RESIZE_PORT__minimumSize) , time_Position (forge, map, LV2_TIME__Position) , time_bar (forge, map, LV2_TIME__bar) , time_barBeat (forge, map, LV2_TIME__barBeat) diff --git a/src/server/Engine.cpp b/src/server/Engine.cpp index 755e0d65..5c36f5c2 100644 --- a/src/server/Engine.cpp +++ b/src/server/Engine.cpp @@ -232,6 +232,9 @@ Engine::activate() control_properties.insert( make_pair(uris.atom_bufferType, Resource::Property(uris.atom_Sequence))); + control_properties.insert( + make_pair(uris.rsz_minimumSize, + forge.make(4096))); // Add control input Resource::Properties in_properties(control_properties); diff --git a/src/server/ingen_lv2.cpp b/src/server/ingen_lv2.cpp index 0f3c2092..6f50847b 100644 --- a/src/server/ingen_lv2.cpp +++ b/src/server/ingen_lv2.cpp @@ -87,6 +87,12 @@ class LV2Driver; void signal_main(ProcessContext& context, LV2Driver* driver); +inline size_t +ui_ring_size(SampleCount block_length) +{ + return std::max((size_t)8192, (size_t)block_length * 16); +} + class LV2Driver : public Ingen::Server::Driver , public Ingen::AtomSink { @@ -102,8 +108,8 @@ public: , _writer(engine.world()->uri_map(), engine.world()->uris(), *this) - , _from_ui(block_length * sizeof(float)) // FIXME: size - , _to_ui(block_length * sizeof(float)) // FIXME: size + , _from_ui(ui_ring_size(block_length)) + , _to_ui(ui_ring_size(block_length)) , _root_graph(NULL) , _notify_capacity(0) , _block_length(block_length) @@ -337,7 +343,9 @@ public: break; } - if (seq->atom.size + sizeof(LV2_Atom) + atom.size > _notify_capacity) { + if (seq->atom.size + lv2_atom_pad_size( + sizeof(LV2_Atom_Event) + atom.size) + > _notify_capacity) { break; // Output port buffer full, resume next time } @@ -354,7 +362,8 @@ public: } read += lv2_atom_total_size(&ev->body); - seq->atom.size += sizeof(LV2_Atom_Event) + ev->body.size; + seq->atom.size += lv2_atom_pad_size( + sizeof(LV2_Atom_Event) + ev->body.size); } if (_to_ui_overflow) { |