summaryrefslogtreecommitdiffstats
path: root/src/engine/QueuedEngineInterface.cpp
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2009-05-27 17:42:51 +0000
committerDavid Robillard <d@drobilla.net>2009-05-27 17:42:51 +0000
commitc11ecf0fd10641218326ae384e80413ba3cdf46c (patch)
tree52ea61f88167a2e7eacc8fa5ff0ee39ee25b2e7e /src/engine/QueuedEngineInterface.cpp
parent8feac4ed0e764c677d4d208377e956c6db94d2dd (diff)
downloadingen-c11ecf0fd10641218326ae384e80413ba3cdf46c.tar.gz
ingen-c11ecf0fd10641218326ae384e80413ba3cdf46c.tar.bz2
ingen-c11ecf0fd10641218326ae384e80413ba3cdf46c.zip
Remove 'new_patch', 'new_node', and 'new_port' from interface in favour of generic 'put'.
git-svn-id: http://svn.drobilla.net/lad/trunk/ingen@2011 a436a847-0d15-0410-975c-d299462d15a1
Diffstat (limited to 'src/engine/QueuedEngineInterface.cpp')
-rw-r--r--src/engine/QueuedEngineInterface.cpp57
1 files changed, 29 insertions, 28 deletions
diff --git a/src/engine/QueuedEngineInterface.cpp b/src/engine/QueuedEngineInterface.cpp
index e19261f7..a1192c03 100644
--- a/src/engine/QueuedEngineInterface.cpp
+++ b/src/engine/QueuedEngineInterface.cpp
@@ -23,6 +23,7 @@
#include "Engine.hpp"
#include "AudioDriver.hpp"
+using namespace std;
using namespace Raul;
namespace Ingen {
@@ -149,36 +150,36 @@ QueuedEngineInterface::bundle_end()
// Object commands
-bool
-QueuedEngineInterface::new_object(const GraphObject* object)
-{
- return false;
-}
-
-
-void
-QueuedEngineInterface::new_patch(const Path& path,
- uint32_t poly)
-{
- push_queued(new CreatePatchEvent(_engine, _responder, now(), path, poly));
-}
-
-
-// FIXME: use index
-void QueuedEngineInterface::new_port(const Path& path,
- const URI& type,
- uint32_t index,
- bool direction)
-{
- push_queued(new CreatePortEvent(_engine, _responder, now(), path, type, direction, this));
-}
-
void
-QueuedEngineInterface::new_node(const Path& path,
- const URI& plugin_uri)
-{
- push_queued(new CreateNodeEvent(_engine, _responder, now(), path, plugin_uri, true));
+QueuedEngineInterface::put(const Path& path,
+ const Resource::Properties& properties)
+{
+ typedef Resource::Properties::const_iterator iterator;
+ cerr << "ENGINE PUT " << path << " {" << endl;
+ for (iterator i = properties.begin(); i != properties.end(); ++i)
+ cerr << "\t" << i->first << " = " << i->second << " :: " << i->second.type() << endl;
+ cerr << "}" << endl;
+
+ bool is_patch = false, is_node = false, is_port = false, is_output = false;
+ DataType data_type(DataType::UNKNOWN);
+ ResourceImpl::type(properties, is_patch, is_node, is_port, is_output, data_type);
+
+ if (is_patch) {
+ uint32_t poly = 1;
+ iterator p = properties.find("ingen:polyphony");
+ if (p != properties.end() && p->second.is_valid() && p->second.type() == Atom::INT)
+ poly = p->second.get_int32();
+ push_queued(new CreatePatchEvent(
+ _engine, _responder, now(), path, poly, properties));
+ } else if (is_node) {
+ const iterator p = properties.find("rdf:instanceOf");
+ push_queued(new CreateNodeEvent(
+ _engine, _responder, now(), path, p->second.get_uri(), true, properties));
+ } else if (is_port) {
+ push_queued(new CreatePortEvent(
+ _engine, _responder, now(), path, data_type.uri(), is_output, this, properties));
+ }
}