summaryrefslogtreecommitdiffstats
path: root/src/engine/events/SetMetadataEvent.cpp
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2009-05-13 04:05:32 +0000
committerDavid Robillard <d@drobilla.net>2009-05-13 04:05:32 +0000
commit19928bb583e72802746b89e322f71ecc0fcb7427 (patch)
tree95912dc84d8c9dcf57939398514feaf148c1cd63 /src/engine/events/SetMetadataEvent.cpp
parent96f839e64de70a23210847e322d24690299287fe (diff)
downloadingen-19928bb583e72802746b89e322f71ecc0fcb7427.tar.gz
ingen-19928bb583e72802746b89e322f71ecc0fcb7427.tar.bz2
ingen-19928bb583e72802746b89e322f71ecc0fcb7427.zip
The great ID refactoring of 2009.
Path is now actually URI (scheme path: for now). Therefore ingen nodes and such live in the same namespace as ... well, everything. Including plugins. Thar be profit, laddies. git-svn-id: http://svn.drobilla.net/lad/trunk/ingen@1992 a436a847-0d15-0410-975c-d299462d15a1
Diffstat (limited to 'src/engine/events/SetMetadataEvent.cpp')
-rw-r--r--src/engine/events/SetMetadataEvent.cpp23
1 files changed, 6 insertions, 17 deletions
diff --git a/src/engine/events/SetMetadataEvent.cpp b/src/engine/events/SetMetadataEvent.cpp
index e0b51f2b..679433a9 100644
--- a/src/engine/events/SetMetadataEvent.cpp
+++ b/src/engine/events/SetMetadataEvent.cpp
@@ -36,8 +36,8 @@ SetMetadataEvent::SetMetadataEvent(
SharedPtr<Responder> responder,
SampleCount timestamp,
bool property,
- const string& path,
- const string& key,
+ const Path& path,
+ const URI& key,
const Atom& value)
: QueuedEvent(engine, responder, timestamp)
, _error(NO_ERROR)
@@ -56,12 +56,6 @@ SetMetadataEvent::SetMetadataEvent(
void
SetMetadataEvent::pre_process()
{
- if (!Path::is_valid(_path)) {
- _error = INVALID_PATH;
- QueuedEvent::pre_process();
- return;
- }
-
_object = _engine.engine_store()->find_object(_path);
if (_object == NULL) {
_error = NOT_FOUND;
@@ -79,10 +73,10 @@ SetMetadataEvent::pre_process()
_patch = dynamic_cast<PatchImpl*>(_object);
- if (_key == "ingen:broadcast") {
+ if (_key.str() == "ingen:broadcast") {
_special_type = ENABLE_BROADCAST;
} else if (_patch) {
- if (!_property && _key == "ingen:enabled") {
+ if (!_property && _key.str() == "ingen:enabled") {
if (_value.type() == Atom::BOOL) {
_special_type = ENABLE;
if (_value.get_bool() && !_patch->compiled_patch())
@@ -90,13 +84,13 @@ SetMetadataEvent::pre_process()
} else {
_error = BAD_TYPE;
}
- } else if (!_property && _key == "ingen:polyphonic") {
+ } else if (!_property && _key.str() == "ingen:polyphonic") {
if (_value.type() == Atom::BOOL) {
_special_type = POLYPHONIC;
} else {
_error = BAD_TYPE;
}
- } else if (_property && _key == "ingen:polyphony") {
+ } else if (_property && _key.str() == "ingen:polyphony") {
if (_value.type() == Atom::INT) {
_special_type = POLYPHONY;
_patch->prepare_internal_poly(_value.get_int32());
@@ -165,11 +159,6 @@ SetMetadataEvent::post_process()
case INTERNAL:
_responder->respond_error("Internal error");
break;
- case INVALID_PATH:
- _responder->respond_error((boost::format(
- "Invalid path '%1%' setting '%2%'")
- % _path % _key).str());
- break;
case BAD_TYPE:
_responder->respond_error((boost::format("Bad type for '%1%'") % _key).str());
break;