summaryrefslogtreecommitdiffstats
path: root/src/engine/mix.hpp
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2010-02-26 02:23:52 +0000
committerDavid Robillard <d@drobilla.net>2010-02-26 02:23:52 +0000
commitf982e4b62ebba89ead634169ebe4e281cc7df46a (patch)
treee26ac29eebbdc1fa4cf034913a1cb944fa74b4d9 /src/engine/mix.hpp
parent52e49500bb78974d43bdfd30b2ec9b2a4522dd25 (diff)
downloadingen-f982e4b62ebba89ead634169ebe4e281cc7df46a.tar.gz
ingen-f982e4b62ebba89ead634169ebe4e281cc7df46a.tar.bz2
ingen-f982e4b62ebba89ead634169ebe4e281cc7df46a.zip
Fix queued connections (e.g. event input => print).
git-svn-id: http://svn.drobilla.net/lad/trunk/ingen@2495 a436a847-0d15-0410-975c-d299462d15a1
Diffstat (limited to 'src/engine/mix.hpp')
-rw-r--r--src/engine/mix.hpp13
1 files changed, 8 insertions, 5 deletions
diff --git a/src/engine/mix.hpp b/src/engine/mix.hpp
index ad12bad0..e84a63e6 100644
--- a/src/engine/mix.hpp
+++ b/src/engine/mix.hpp
@@ -28,19 +28,19 @@ using namespace Raul;
namespace Ingen {
inline void
-mix(Context& context, Buffer* dst, const Buffer*const* srcs, uint32_t num_srcs)
+mix(Context& context, Buffer* dst, const IntrusivePtr<Buffer>* srcs, uint32_t num_srcs)
{
using Shared::PortType;
switch (dst->type().symbol()) {
case PortType::AUDIO:
case PortType::CONTROL:
// Copy the first source
- dst->copy(context, srcs[0]);
+ dst->copy(context, srcs[0].get());
// Mix in the rest
for (uint32_t i = 1; i < num_srcs; ++i) {
assert(srcs[i]->type() == PortType::AUDIO || srcs[i]->type() == PortType::CONTROL);
- ((AudioBuffer*)dst)->accumulate(context, (AudioBuffer*)srcs[i]);
+ ((AudioBuffer*)dst)->accumulate(context, (AudioBuffer*)srcs[i].get());
}
break;
@@ -55,7 +55,7 @@ mix(Context& context, Buffer* dst, const Buffer*const* srcs, uint32_t num_srcs)
while (true) {
const EventBuffer* first = NULL;
for (uint32_t i = 0; i < num_srcs; ++i) {
- const EventBuffer* const src = (const EventBuffer*)srcs[i];
+ const EventBuffer* const src = (const EventBuffer*)srcs[i].get();
if (src->is_valid()) {
if (!first || src->get_event()->frames < first->get_event()->frames)
first = src;
@@ -76,7 +76,10 @@ mix(Context& context, Buffer* dst, const Buffer*const* srcs, uint32_t num_srcs)
break;
default:
- error << "Mix of unsupported buffer types" << std::endl;
+ if (num_srcs == 1)
+ dst->copy(context, srcs[0].get());
+ else
+ error << "Mix of unsupported buffer types" << std::endl;
return;
}
}