From 19928bb583e72802746b89e322f71ecc0fcb7427 Mon Sep 17 00:00:00 2001 From: David Robillard Date: Wed, 13 May 2009 04:05:32 +0000 Subject: 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 --- src/engine/events/SetMetadataEvent.cpp | 23 ++++++----------------- 1 file changed, 6 insertions(+), 17 deletions(-) (limited to 'src/engine/events/SetMetadataEvent.cpp') 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, 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(_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; -- cgit v1.2.1