From d6823fa9b29bcff74ca180e6d389d8a21cf88d1f Mon Sep 17 00:00:00 2001 From: David Robillard Date: Sun, 17 Aug 2008 03:10:58 +0000 Subject: There! Loader uses only CommonInterface and is now able to parse into a client or engine. Proper OSC serialisation of boolean atoms. Remove patch_enabled and patch_disabled calls/signals/etc in favour of new generic "property" mechanism (courtesy of which much more killed API is to come). git-svn-id: http://svn.drobilla.net/lad/ingen@1410 a436a847-0d15-0410-975c-d299462d15a1 --- src/libs/engine/QueuedEngineInterface.cpp | 32 +++++++++++++++++-------------- 1 file changed, 18 insertions(+), 14 deletions(-) (limited to 'src/libs/engine/QueuedEngineInterface.cpp') diff --git a/src/libs/engine/QueuedEngineInterface.cpp b/src/libs/engine/QueuedEngineInterface.cpp index 6593ec81..6deeb727 100644 --- a/src/libs/engine/QueuedEngineInterface.cpp +++ b/src/libs/engine/QueuedEngineInterface.cpp @@ -145,7 +145,9 @@ QueuedEngineInterface::new_patch(const string& path, } +// FIXME: use index void QueuedEngineInterface::new_port(const string& path, + uint32_t index, const string& data_type, bool direction) { @@ -210,20 +212,6 @@ QueuedEngineInterface::set_polyphonic(const string& path, bool poly) } -void -QueuedEngineInterface::enable_patch(const string& patch_path) -{ - push_queued(new EnablePatchEvent(_engine, _responder, now(), patch_path, true)); -} - - -void -QueuedEngineInterface::disable_patch(const string& patch_path) -{ - push_queued(new EnablePatchEvent(_engine, _responder, now(), patch_path, false)); -} - - void QueuedEngineInterface::connect(const string& src_port_path, const string& dst_port_path) @@ -321,6 +309,22 @@ QueuedEngineInterface::set_variable(const string& path, push_queued(new SetMetadataEvent(_engine, _responder, now(), path, predicate, value)); } + +void +QueuedEngineInterface::set_property(const string& path, + const string& predicate, + const Atom& value) +{ + // FIXME: implement generically + if (predicate == "ingen:enabled") { + if (value.type() == Atom::BOOL) { + push_queued(new EnablePatchEvent(_engine, _responder, now(), path, value.get_bool())); + return; + } + } + cerr << "WARNING: Unknown property \"" << predicate << "\" ignored" << endl; +} + // Requests // -- cgit v1.2.1