summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2009-05-28 22:28:05 +0000
committerDavid Robillard <d@drobilla.net>2009-05-28 22:28:05 +0000
commit304454c63ea00b57b55bc2023e1d52fb51e8ef7f (patch)
tree9f3afdc3629139c0b43a3d9dfd10fc98f376ab28
parent72e4e4c0c5c7d459f3a80e8cc9cdc755db61f23b (diff)
downloadingen-304454c63ea00b57b55bc2023e1d52fb51e8ef7f.tar.gz
ingen-304454c63ea00b57b55bc2023e1d52fb51e8ef7f.tar.bz2
ingen-304454c63ea00b57b55bc2023e1d52fb51e8ef7f.zip
Fix loading connections inside subpatches to patch ports.
git-svn-id: http://svn.drobilla.net/lad/trunk/ingen@2039 a436a847-0d15-0410-975c-d299462d15a1
-rw-r--r--src/client/ClientStore.cpp4
-rw-r--r--src/engine/QueuedEngineInterface.cpp5
-rw-r--r--src/engine/QueuedEvent.hpp6
-rw-r--r--src/engine/events/CreatePortEvent.cpp3
-rw-r--r--src/engine/events/SetMetadataEvent.cpp27
-rw-r--r--src/serialisation/Parser.cpp5
6 files changed, 22 insertions, 28 deletions
diff --git a/src/client/ClientStore.cpp b/src/client/ClientStore.cpp
index 0079010c..cdfeb276 100644
--- a/src/client/ClientStore.cpp
+++ b/src/client/ClientStore.cpp
@@ -268,10 +268,10 @@ void
ClientStore::put(const URI& uri, const Resource::Properties& properties)
{
typedef Resource::Properties::const_iterator iterator;
- cerr << "CLIENT PUT " << uri << " {" << endl;
+ /*cerr << "CLIENT PUT " << uri << " {" << endl;
for (iterator i = properties.begin(); i != properties.end(); ++i)
cerr << "\t" << i->first << " = " << i->second << " :: " << i->second.type() << endl;
- cerr << "}" << endl;
+ cerr << "}" << endl;*/
bool is_path = Path::is_valid(uri.str());
bool is_meta = uri.substr(0, 8) == "meta:#";
diff --git a/src/engine/QueuedEngineInterface.cpp b/src/engine/QueuedEngineInterface.cpp
index a6a3f1cd..cce6bb9d 100644
--- a/src/engine/QueuedEngineInterface.cpp
+++ b/src/engine/QueuedEngineInterface.cpp
@@ -155,16 +155,15 @@ void
QueuedEngineInterface::put(const URI& uri,
const Resource::Properties& properties)
{
- cerr << "PUT " << uri << endl;
size_t hash = uri.find("#");
bool meta = (hash != string::npos);
Path path(meta ? (string("/") + uri.chop_start("#")) : uri.str());
typedef Resource::Properties::const_iterator iterator;
- cerr << "ENGINE PUT " << path << " (" << path << ") {" << endl;
+ /*cerr << "ENGINE PUT " << path << " (" << path << ") {" << endl;
for (iterator i = properties.begin(); i != properties.end(); ++i)
cerr << "\t" << i->first << " = " << i->second << " :: " << i->second.type() << endl;
- cerr << "}" << endl;
+ cerr << "}" << endl;*/
push_queued(new SetMetadataEvent(_engine, _responder, now(), this, meta, path, properties));
}
diff --git a/src/engine/QueuedEvent.hpp b/src/engine/QueuedEvent.hpp
index 6bc6a898..71c29624 100644
--- a/src/engine/QueuedEvent.hpp
+++ b/src/engine/QueuedEvent.hpp
@@ -60,9 +60,9 @@ protected:
bool blocking = false,
QueuedEventSource* source = NULL)
: Event(engine, responder, time)
+ , _source(source)
, _pre_processed(false)
, _blocking(blocking)
- , _source(source)
{
if (blocking)
assert(_source);
@@ -71,14 +71,14 @@ protected:
// NULL event base (for internal events only!)
QueuedEvent(Engine& engine)
: Event(engine, SharedPtr<Responder>(), 0)
+ , _source(NULL)
, _pre_processed(false)
, _blocking(false)
- , _source(NULL)
{}
+ QueuedEventSource* _source;
bool _pre_processed;
bool _blocking;
- QueuedEventSource* _source;
};
diff --git a/src/engine/events/CreatePortEvent.cpp b/src/engine/events/CreatePortEvent.cpp
index e954c56d..8136e3ae 100644
--- a/src/engine/events/CreatePortEvent.cpp
+++ b/src/engine/events/CreatePortEvent.cpp
@@ -153,9 +153,6 @@ CreatePortEvent::execute(ProcessContext& context)
_engine.midi_driver()->add_port(_driver_port);
}
}
-
- if (_source)
- _source->unblock();
}
diff --git a/src/engine/events/SetMetadataEvent.cpp b/src/engine/events/SetMetadataEvent.cpp
index 0349ba29..24dbce88 100644
--- a/src/engine/events/SetMetadataEvent.cpp
+++ b/src/engine/events/SetMetadataEvent.cpp
@@ -30,6 +30,7 @@
#include "CreatePatchEvent.hpp"
#include "CreateNodeEvent.hpp"
#include "CreatePortEvent.hpp"
+#include "QueuedEventSource.hpp"
using namespace std;
@@ -82,7 +83,6 @@ SetMetadataEvent::pre_process()
if (is_graph_object && !_object) {
Path path(_subject.str());
- cerr << "CREATE NEW GRAPH OBJECT" << 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);
@@ -115,7 +115,8 @@ SetMetadataEvent::pre_process()
for (Properties::iterator p = _properties.begin(); p != _properties.end(); ++p) {
const Raul::URI& key = p->first;
const Raul::Atom& value = p->second;
- GraphObjectImpl* obj = dynamic_cast<GraphObjectImpl*>(_object);
+ GraphObjectImpl* obj = dynamic_cast<GraphObjectImpl*>(_object);
+ SpecialType op = NONE;
if (obj) {
if (_is_meta)
obj->meta().set_property(key, value);
@@ -125,11 +126,11 @@ SetMetadataEvent::pre_process()
_patch = dynamic_cast<PatchImpl*>(_object);
if (key.str() == "ingen:broadcast") {
- _types.push_back(ENABLE_BROADCAST);
+ op = ENABLE_BROADCAST;
} else if (_patch) {
if (key.str() == "ingen:enabled") {
if (value.type() == Atom::BOOL) {
- _types.push_back(ENABLE);
+ op = ENABLE;
if (value.get_bool() && !_patch->compiled_patch())
_compiled_patch = _patch->compile();
} else {
@@ -137,29 +138,25 @@ SetMetadataEvent::pre_process()
}
} else if (key.str() == "ingen:polyphonic") {
if (value.type() == Atom::BOOL) {
- _types.push_back(POLYPHONIC);
+ op = POLYPHONIC;
} else {
_error = BAD_TYPE;
}
} else if (key.str() == "ingen:polyphony") {
if (value.type() == Atom::INT) {
- _types.push_back(POLYPHONY);
+ op = POLYPHONY;
_patch->prepare_internal_poly(value.get_int32());
} else {
_error = BAD_TYPE;
}
- } else {
- _object->set_property(key, value);
- _types.push_back(NONE);
}
- if (_error != NO_ERROR)
- break;
}
- } else {
- _types.push_back(NONE);
}
- _object->set_property(key, value);
+ if (_error != NO_ERROR)
+ break;
+
+ _types.push_back(op);
}
QueuedEvent::pre_process();
@@ -177,6 +174,8 @@ SetMetadataEvent::execute(ProcessContext& context)
if (_create_event) {
QueuedEvent::execute(context);
_create_event->execute(context);
+ if (_blocking)
+ _source->unblock();
return;
}
diff --git a/src/serialisation/Parser.cpp b/src/serialisation/Parser.cpp
index 34d1d24c..02e08308 100644
--- a/src/serialisation/Parser.cpp
+++ b/src/serialisation/Parser.cpp
@@ -582,12 +582,11 @@ Parser::parse_patch(
continue;
}
- cerr << "FIXME: PARSE PATCH" << endl;
- //target->put(port_path, i->second);
+ target->put(port_path, i->second);
}
- parse_connections(world, target, model, subject, "/");
parse_properties(world, target, model, subject_node, patch_path, data);
+ parse_connections(world, target, model, subject, "/");
/* Enable */