summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2011-04-28 18:19:28 +0000
committerDavid Robillard <d@drobilla.net>2011-04-28 18:19:28 +0000
commit30b375cc910a2ce70d869cfc3496a0d06b7e1775 (patch)
tree8e2ab572b40059f40e5ecb88dc43e7728858be54 /src
parentf936a6da1f4885db54365d81ee5959e84d359e85 (diff)
downloadingen-30b375cc910a2ce70d869cfc3496a0d06b7e1775.tar.gz
ingen-30b375cc910a2ce70d869cfc3496a0d06b7e1775.tar.bz2
ingen-30b375cc910a2ce70d869cfc3496a0d06b7e1775.zip
Improve RingBuffer implementation.
Previous implementation was broken when written to full capacity, and this version is significantly faster as well. git-svn-id: http://svn.drobilla.net/lad/trunk/ingen@3213 a436a847-0d15-0410-975c-d299462d15a1
Diffstat (limited to 'src')
-rw-r--r--src/server/ConnectionImpl.cpp2
-rw-r--r--src/server/EventSink.cpp6
-rw-r--r--src/server/LV2Plugin.cpp4
-rw-r--r--src/server/MessageContext.cpp2
4 files changed, 8 insertions, 6 deletions
diff --git a/src/server/ConnectionImpl.cpp b/src/server/ConnectionImpl.cpp
index 1e339910..8da76aeb 100644
--- a/src/server/ConnectionImpl.cpp
+++ b/src/server/ConnectionImpl.cpp
@@ -76,7 +76,7 @@ ConnectionImpl::get_sources(Context& context, uint32_t voice,
IntrusivePtr<Buffer> buf = context.engine().buffer_factory()->get(
dst_port()->buffer_type(), sizeof(LV2_Atom) + obj.size);
void* data = buf->port_data(PortType::MESSAGE, context.offset());
- _queue->full_read(sizeof(LV2_Atom) + obj.size, (LV2_Atom*)data);
+ _queue->read(sizeof(LV2_Atom) + obj.size, (LV2_Atom*)data);
srcs[num_srcs++] = buf;
} else if (must_mix()) {
// Mixing down voices: every src voice mixed into every dst voice
diff --git a/src/server/EventSink.cpp b/src/server/EventSink.cpp
index bb81f3ec..e80713dd 100644
--- a/src/server/EventSink.cpp
+++ b/src/server/EventSink.cpp
@@ -46,14 +46,14 @@ bool
EventSink::read(uint32_t event_buffer_size, uint8_t* event_buffer)
{
uint32_t read_size;
- bool success = _events.full_read(sizeof(uint32_t), (uint8_t*)&read_size);
- if (!success)
+ uint32_t s = _events.read(sizeof(uint32_t), (uint8_t*)&read_size);
+ if (!s)
return false;
assert(read_size <= event_buffer_size);
if (read_size > 0)
- return _events.full_read(read_size, event_buffer);
+ return _events.read(read_size, event_buffer);
else
return false;
}
diff --git a/src/server/LV2Plugin.cpp b/src/server/LV2Plugin.cpp
index ed25d1ac..703a8616 100644
--- a/src/server/LV2Plugin.cpp
+++ b/src/server/LV2Plugin.cpp
@@ -19,6 +19,8 @@
#include <string>
#include <glibmm.h>
+#include "raul/log.hpp"
+
#include "sord/sordmm.hpp"
#include "shared/LV2URIMap.hpp"
@@ -98,7 +100,7 @@ LV2Plugin::library_path() const
if (v) {
_library_path = slv2_uri_to_path(slv2_value_as_uri(v));
} else {
- warn << uri() << " has no library path" << endl;
+ Raul::warn << uri() << " has no library path" << std::endl;
return empty_string;
}
}
diff --git a/src/server/MessageContext.cpp b/src/server/MessageContext.cpp
index 0ac385bd..d24abba8 100644
--- a/src/server/MessageContext.cpp
+++ b/src/server/MessageContext.cpp
@@ -70,7 +70,7 @@ MessageContext::_run()
// Enqueue (and thereby sort) requests from audio thread
while (has_requests()) {
- _requests.full_read(sizeof(Request), &req);
+ _requests.read(sizeof(Request), &req);
if (req.node) {
_queue.insert(req);
} else {