From 602e31074b30167baace71ccfff1f58a6b3f0626 Mon Sep 17 00:00:00 2001 From: David Robillard Date: Sun, 17 Aug 2008 18:58:24 +0000 Subject: More serialization work. Preliminary copy/paste (nodes only) git-svn-id: http://svn.drobilla.net/lad/ingen@1418 a436a847-0d15-0410-975c-d299462d15a1 --- src/libs/engine/EngineStore.cpp | 14 +------------- src/libs/engine/GraphObjectImpl.hpp | 2 ++ src/libs/engine/LV2Plugin.cpp | 17 ++++++++++++++--- src/libs/engine/LV2Plugin.hpp | 5 ++++- 4 files changed, 21 insertions(+), 17 deletions(-) (limited to 'src/libs/engine') diff --git a/src/libs/engine/EngineStore.cpp b/src/libs/engine/EngineStore.cpp index 5f5e41e5..9fcd3806 100644 --- a/src/libs/engine/EngineStore.cpp +++ b/src/libs/engine/EngineStore.cpp @@ -82,19 +82,7 @@ EngineStore::add(GraphObject* obj) assert(ThreadManager::current_thread_id() == THREAD_PRE_PROCESS); - if (find(o->path()) != end()) { - cerr << "[EngineStore] ERROR: Attempt to add duplicate object " << o->path() << endl; - return; - } - - insert(make_pair(o->path(), o)); - - NodeImpl* node = dynamic_cast(o); - if (node) { - for (uint32_t i=0; i < node->num_ports(); ++i) { - add(node->port_impl(i)); - } - } + Store::add(obj); } diff --git a/src/libs/engine/GraphObjectImpl.hpp b/src/libs/engine/GraphObjectImpl.hpp index d1896b1b..bee10c98 100644 --- a/src/libs/engine/GraphObjectImpl.hpp +++ b/src/libs/engine/GraphObjectImpl.hpp @@ -87,6 +87,8 @@ public: const Variables& variables() const { return _variables; } const Properties& properties() const { return _properties; } + Variables& variables() { return _variables; } + Properties& properties() { return _properties; } /** The Patch this object is a child of. */ virtual PatchImpl* parent_patch() const; diff --git a/src/libs/engine/LV2Plugin.cpp b/src/libs/engine/LV2Plugin.cpp index 871050e4..53d317b4 100644 --- a/src/libs/engine/LV2Plugin.cpp +++ b/src/libs/engine/LV2Plugin.cpp @@ -47,9 +47,8 @@ LV2Plugin::symbol() const const string LV2Plugin::name() const { - SLV2Value name = slv2_plugin_get_name(_slv2_plugin); - if (name) - return slv2_value_as_string(name); + if (_name) + return slv2_value_as_string(_name); else return "(no name)"; } @@ -70,9 +69,21 @@ LV2Plugin::instantiate(const string& name, delete n; n = NULL; } + + return n; } + + +void +LV2Plugin::slv2_plugin(SLV2Plugin p) +{ + _slv2_plugin = p; + if (_name) + slv2_value_free(_name); + _name = slv2_plugin_get_name(_slv2_plugin); +} } // namespace Ingen diff --git a/src/libs/engine/LV2Plugin.hpp b/src/libs/engine/LV2Plugin.hpp index effdefdc..827e7e89 100644 --- a/src/libs/engine/LV2Plugin.hpp +++ b/src/libs/engine/LV2Plugin.hpp @@ -53,6 +53,8 @@ class LV2Plugin : public PluginImpl public: LV2Plugin(SharedPtr lv2_info, const string& uri) : PluginImpl(Plugin::LV2, uri) + , _name(NULL) + , _slv2_plugin(NULL) , _lv2_info(lv2_info) {} @@ -68,9 +70,10 @@ public: SharedPtr lv2_info() const { return _lv2_info; } SLV2Plugin slv2_plugin() const { return _slv2_plugin; } - void slv2_plugin(SLV2Plugin p) { _slv2_plugin = p; } + void slv2_plugin(SLV2Plugin p); private: + SLV2Value _name; SLV2Plugin _slv2_plugin; SharedPtr _lv2_info; }; -- cgit v1.2.1