summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/URIs.cpp2
-rw-r--r--src/server/Engine.cpp3
-rw-r--r--src/server/ingen_lv2.cpp17
3 files changed, 18 insertions, 4 deletions
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) {