summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/server/InternalBlock.cpp22
-rw-r--r--src/server/InternalBlock.hpp6
2 files changed, 26 insertions, 2 deletions
diff --git a/src/server/InternalBlock.cpp b/src/server/InternalBlock.cpp
index ef9af87e..e26bdc10 100644
--- a/src/server/InternalBlock.cpp
+++ b/src/server/InternalBlock.cpp
@@ -1,6 +1,6 @@
/*
This file is part of Ingen.
- Copyright 2007-2015 David Robillard <http://drobilla.net/>
+ Copyright 2007-2016 David Robillard <http://drobilla.net/>
Ingen is free software: you can redistribute it and/or modify it under the
terms of the GNU Affero General Public License as published by the Free
@@ -15,7 +15,9 @@
*/
#include "Buffer.hpp"
+#include "Engine.hpp"
#include "InternalBlock.hpp"
+#include "InternalPlugin.hpp"
#include "PortImpl.hpp"
namespace Ingen {
@@ -29,6 +31,24 @@ InternalBlock::InternalBlock(PluginImpl* plugin,
: BlockImpl(plugin, symbol, poly, parent, rate)
{}
+BlockImpl*
+InternalBlock::duplicate(Engine& engine,
+ const Raul::Symbol& symbol,
+ GraphImpl* parent)
+{
+ BufferFactory& bufs = *engine.buffer_factory();
+
+ BlockImpl* copy = reinterpret_cast<InternalPlugin*>(_plugin)->instantiate(
+ bufs, symbol, _polyphonic, parent_graph(), engine);
+
+ for (size_t i = 0; i < num_ports(); ++i) {
+ const Atom& value = port_impl(i)->value();
+ copy->port_impl(i)->set_property(bufs.uris().ingen_value, value);
+ copy->port_impl(i)->set_value(value);
+ }
+
+ return copy;
+}
void
InternalBlock::pre_process(RunContext& context)
diff --git a/src/server/InternalBlock.hpp b/src/server/InternalBlock.hpp
index 6ba25311..a57bd89f 100644
--- a/src/server/InternalBlock.hpp
+++ b/src/server/InternalBlock.hpp
@@ -1,6 +1,6 @@
/*
This file is part of Ingen.
- Copyright 2007-2015 David Robillard <http://drobilla.net/>
+ Copyright 2007-2016 David Robillard <http://drobilla.net/>
Ingen is free software: you can redistribute it and/or modify it under the
terms of the GNU Affero General Public License as published by the Free
@@ -35,6 +35,10 @@ public:
GraphImpl* parent,
SampleRate rate);
+ BlockImpl* duplicate(Engine& engine,
+ const Raul::Symbol& symbol,
+ GraphImpl* parent);
+
virtual void pre_process(RunContext& context);
};