summaryrefslogtreecommitdiffstats
path: root/src/engine/events
diff options
context:
space:
mode:
Diffstat (limited to 'src/engine/events')
-rw-r--r--src/engine/events/CreateNodeEvent.cpp14
-rw-r--r--src/engine/events/CreateNodeEvent.hpp17
-rw-r--r--src/engine/events/CreatePatchEvent.cpp12
-rw-r--r--src/engine/events/CreatePatchEvent.hpp11
-rw-r--r--src/engine/events/CreatePortEvent.cpp18
-rw-r--r--src/engine/events/CreatePortEvent.hpp15
6 files changed, 67 insertions, 20 deletions
diff --git a/src/engine/events/CreateNodeEvent.cpp b/src/engine/events/CreateNodeEvent.cpp
index fea858f1..6f3ed834 100644
--- a/src/engine/events/CreateNodeEvent.cpp
+++ b/src/engine/events/CreateNodeEvent.cpp
@@ -38,8 +38,16 @@ using namespace Raul;
namespace Ingen {
-
-CreateNodeEvent::CreateNodeEvent(Engine& engine, SharedPtr<Responder> responder, SampleCount timestamp, const Path& path, const URI& plugin_uri, bool polyphonic)
+using namespace Shared;
+
+CreateNodeEvent::CreateNodeEvent(
+ Engine& engine,
+ SharedPtr<Responder> responder,
+ SampleCount timestamp,
+ const Path& path,
+ const URI& plugin_uri,
+ bool polyphonic,
+ const Resource::Properties& properties)
: QueuedEvent(engine, responder, timestamp)
, _path(path)
, _plugin_uri(plugin_uri)
@@ -48,6 +56,7 @@ CreateNodeEvent::CreateNodeEvent(Engine& engine, SharedPtr<Responder> responder,
, _node(NULL)
, _compiled_patch(NULL)
, _node_already_exists(false)
+ , _properties(properties)
{
string uri = _plugin_uri.str();
if (uri.substr(0, 3) == "om:") {
@@ -80,6 +89,7 @@ CreateNodeEvent::pre_process()
if (_patch && plugin) {
_node = plugin->instantiate(_path.name(), _polyphonic, _patch, _engine);
+ _node->variables().insert(_properties.begin(), _properties.end());
if (_node != NULL) {
_node->activate();
diff --git a/src/engine/events/CreateNodeEvent.hpp b/src/engine/events/CreateNodeEvent.hpp
index 7065cb84..b8dbf082 100644
--- a/src/engine/events/CreateNodeEvent.hpp
+++ b/src/engine/events/CreateNodeEvent.hpp
@@ -20,6 +20,7 @@
#include <string>
#include "QueuedEvent.hpp"
+#include "interface/Resource.hpp"
namespace Ingen {
@@ -35,12 +36,14 @@ class CompiledPatch;
class CreateNodeEvent : public QueuedEvent
{
public:
- CreateNodeEvent(Engine& engine,
- SharedPtr<Responder> responder,
- SampleCount timestamp,
- const Raul::Path& node_path,
- const Raul::URI& plugin_uri,
- bool poly);
+ CreateNodeEvent(
+ Engine& engine,
+ SharedPtr<Responder> responder,
+ SampleCount timestamp,
+ const Raul::Path& node_path,
+ const Raul::URI& plugin_uri,
+ bool poly,
+ const Shared::Resource::Properties& properties);
void pre_process();
void execute(ProcessContext& context);
@@ -57,6 +60,8 @@ private:
NodeImpl* _node;
CompiledPatch* _compiled_patch; ///< Patch's new process order
bool _node_already_exists;
+
+ Shared::Resource::Properties _properties;
};
diff --git a/src/engine/events/CreatePatchEvent.cpp b/src/engine/events/CreatePatchEvent.cpp
index 574d909b..f4a60760 100644
--- a/src/engine/events/CreatePatchEvent.cpp
+++ b/src/engine/events/CreatePatchEvent.cpp
@@ -32,8 +32,16 @@ using namespace Raul;
namespace Ingen {
+using namespace Shared;
-CreatePatchEvent::CreatePatchEvent(Engine& engine, SharedPtr<Responder> responder, SampleCount timestamp, const Raul::Path& path, int poly)
+
+CreatePatchEvent::CreatePatchEvent(
+ Engine& engine,
+ SharedPtr<Responder> responder,
+ SampleCount timestamp,
+ const Raul::Path& path,
+ int poly,
+ const Resource::Properties& properties)
: QueuedEvent(engine, responder, timestamp)
, _path(path)
, _patch(NULL)
@@ -41,6 +49,7 @@ CreatePatchEvent::CreatePatchEvent(Engine& engine, SharedPtr<Responder> responde
, _compiled_patch(NULL)
, _poly(poly)
, _error(NO_ERROR)
+ , _properties(properties)
{
}
@@ -74,6 +83,7 @@ CreatePatchEvent::pre_process()
poly = _poly;
_patch = new PatchImpl(_engine, path.name(), poly, _parent, _engine.audio_driver()->sample_rate(), _engine.audio_driver()->buffer_size(), _poly);
+ _patch->properties().insert(_properties.begin(), _properties.end());
if (_parent != NULL) {
_parent->add_node(new PatchImpl::Nodes::Node(_patch));
diff --git a/src/engine/events/CreatePatchEvent.hpp b/src/engine/events/CreatePatchEvent.hpp
index 796306f8..44b47d8c 100644
--- a/src/engine/events/CreatePatchEvent.hpp
+++ b/src/engine/events/CreatePatchEvent.hpp
@@ -19,6 +19,7 @@
#define CREATEPATCHEVENT_H
#include "QueuedEvent.hpp"
+#include "interface/Resource.hpp"
namespace Ingen {
@@ -33,7 +34,13 @@ class CompiledPatch;
class CreatePatchEvent : public QueuedEvent
{
public:
- CreatePatchEvent(Engine& engine, SharedPtr<Responder> responder, SampleCount timestamp, const Raul::Path& path, int poly);
+ CreatePatchEvent(
+ Engine& engine,
+ SharedPtr<Responder> responder,
+ SampleCount timestamp,
+ const Raul::Path& path,
+ int poly,
+ const Shared::Resource::Properties& properties);
void pre_process();
void execute(ProcessContext& context);
@@ -48,6 +55,8 @@ private:
CompiledPatch* _compiled_patch;
int _poly;
ErrorType _error;
+
+ Shared::Resource::Properties _properties;
};
diff --git a/src/engine/events/CreatePortEvent.cpp b/src/engine/events/CreatePortEvent.cpp
index 69ef7364..38c3587c 100644
--- a/src/engine/events/CreatePortEvent.cpp
+++ b/src/engine/events/CreatePortEvent.cpp
@@ -41,13 +41,15 @@ namespace Ingen {
using namespace Shared;
-CreatePortEvent::CreatePortEvent(Engine& engine,
- SharedPtr<Responder> responder,
- SampleCount timestamp,
- const Raul::Path& path,
- const Raul::URI& type,
- bool is_output,
- QueuedEventSource* source)
+CreatePortEvent::CreatePortEvent(
+ Engine& engine,
+ SharedPtr<Responder> responder,
+ SampleCount timestamp,
+ const Raul::Path& path,
+ const Raul::URI& type,
+ bool is_output,
+ QueuedEventSource* source,
+ const Resource::Properties& properties)
: QueuedEvent(engine, responder, timestamp, true, source)
, _error(NO_ERROR)
, _path(path)
@@ -57,6 +59,7 @@ CreatePortEvent::CreatePortEvent(Engine& engine,
, _patch(NULL)
, _patch_port(NULL)
, _driver_port(NULL)
+ , _properties(properties)
{
/* This is blocking because of the two different sets of Patch ports, the array used in the
* audio thread (inherited from NodeBase), and the arrays used in the pre processor thread.
@@ -93,6 +96,7 @@ CreatePortEvent::pre_process()
const uint32_t old_num_ports = _patch->num_ports();
_patch_port = _patch->create_port(_path.name(), _data_type, buffer_size, _is_output);
+ _patch_port->properties().insert(_properties.begin(), _properties.end());
if (_patch_port) {
diff --git a/src/engine/events/CreatePortEvent.hpp b/src/engine/events/CreatePortEvent.hpp
index 4304e362..ab65eabd 100644
--- a/src/engine/events/CreatePortEvent.hpp
+++ b/src/engine/events/CreatePortEvent.hpp
@@ -22,8 +22,7 @@
#include "raul/Path.hpp"
#include "raul/Array.hpp"
#include "interface/DataType.hpp"
-
-template <typename T> class Array;
+#include "interface/Resource.hpp"
namespace Ingen {
@@ -39,7 +38,15 @@ class DriverPort;
class CreatePortEvent : public QueuedEvent
{
public:
- CreatePortEvent(Engine& engine, SharedPtr<Responder> responder, SampleCount timestamp, const Raul::Path& path, const Raul::URI& type, bool is_output, QueuedEventSource* source);
+ CreatePortEvent(
+ Engine& engine,
+ SharedPtr<Responder> responder,
+ SampleCount timestamp,
+ const Raul::Path& path,
+ const Raul::URI& type,
+ bool is_output,
+ QueuedEventSource* source,
+ const Shared::Resource::Properties& properties);
void pre_process();
void execute(ProcessContext& context);
@@ -63,6 +70,8 @@ private:
Raul::Array<PortImpl*>* _ports_array; ///< New (external) ports array for Patch
DriverPort* _driver_port; ///< Driver (eg Jack) port if this is a toplevel port
bool _succeeded;
+
+ Shared::Resource::Properties _properties;
};