diff options
author | David Robillard <d@drobilla.net> | 2008-08-17 18:58:24 +0000 |
---|---|---|
committer | David Robillard <d@drobilla.net> | 2008-08-17 18:58:24 +0000 |
commit | 602e31074b30167baace71ccfff1f58a6b3f0626 (patch) | |
tree | eb7b85c99532af48adfe6322e2b620ac31c62f76 /src/libs/engine | |
parent | 0e47cf5e7153a96875a64754291fad1cdbf26da7 (diff) | |
download | ingen-602e31074b30167baace71ccfff1f58a6b3f0626.tar.gz ingen-602e31074b30167baace71ccfff1f58a6b3f0626.tar.bz2 ingen-602e31074b30167baace71ccfff1f58a6b3f0626.zip |
More serialization work.
Preliminary copy/paste (nodes only)
git-svn-id: http://svn.drobilla.net/lad/ingen@1418 a436a847-0d15-0410-975c-d299462d15a1
Diffstat (limited to 'src/libs/engine')
-rw-r--r-- | src/libs/engine/EngineStore.cpp | 14 | ||||
-rw-r--r-- | src/libs/engine/GraphObjectImpl.hpp | 2 | ||||
-rw-r--r-- | src/libs/engine/LV2Plugin.cpp | 17 | ||||
-rw-r--r-- | src/libs/engine/LV2Plugin.hpp | 5 |
4 files changed, 21 insertions, 17 deletions
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<NodeImpl*>(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<LV2Info> lv2_info, const string& uri) : PluginImpl(Plugin::LV2, uri) + , _name(NULL) + , _slv2_plugin(NULL) , _lv2_info(lv2_info) {} @@ -68,9 +70,10 @@ public: SharedPtr<LV2Info> 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<LV2Info> _lv2_info; }; |