summaryrefslogtreecommitdiffstats
path: root/src/libs/client/ModelEngineInterface.cpp
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2006-09-14 02:27:02 +0000
committerDavid Robillard <d@drobilla.net>2006-09-14 02:27:02 +0000
commitcc384f6f622cc10fd83616256080b80dc2123aaf (patch)
tree9a5f0d7f14e04ad7effcda8be6b5924b4d61e361 /src/libs/client/ModelEngineInterface.cpp
parent5525b33b79b7a920cf374704e67fc6b16fe5f77c (diff)
downloadingen-cc384f6f622cc10fd83616256080b80dc2123aaf.tar.gz
ingen-cc384f6f622cc10fd83616256080b80dc2123aaf.tar.bz2
ingen-cc384f6f622cc10fd83616256080b80dc2123aaf.zip
Cleaned up client-side model code significantly (made everything private
so only Store can change the state of models). Extremely broken, just committing to move code between machines :). git-svn-id: http://svn.drobilla.net/lad/ingen@133 a436a847-0d15-0410-975c-d299462d15a1
Diffstat (limited to 'src/libs/client/ModelEngineInterface.cpp')
-rw-r--r--src/libs/client/ModelEngineInterface.cpp25
1 files changed, 14 insertions, 11 deletions
diff --git a/src/libs/client/ModelEngineInterface.cpp b/src/libs/client/ModelEngineInterface.cpp
index 7cc2ae22..3add8854 100644
--- a/src/libs/client/ModelEngineInterface.cpp
+++ b/src/libs/client/ModelEngineInterface.cpp
@@ -25,17 +25,19 @@ namespace Client {
/** Load a node.
*/
void
-ModelEngineInterface::create_node_from_model(const NodeModel* nm)
+ModelEngineInterface::create_node_with_data(const string& plugin_uri,
+ const Path& path,
+ bool is_polyphonic,
+ const MetadataMap& initial_data)
{
// Load by URI
- if (nm->plugin()->uri().length() > 0) {
- create_node(nm->path().c_str(),
- nm->plugin()->type_string(),
- nm->plugin()->uri().c_str(),
- nm->polyphonic());
+ if (plugin_uri.length() > 0) {
+ create_node(path, plugin_uri, is_polyphonic);
// Load by libname, label
} else {
+ cerr << "FIXME: non-uri" << endl;
+ #if 0
//assert(nm->plugin()->lib_name().length() > 0);
assert(nm->plugin()->plug_label().length() > 0);
@@ -44,9 +46,10 @@ ModelEngineInterface::create_node_from_model(const NodeModel* nm)
nm->plugin()->lib_name().c_str(),
nm->plugin()->plug_label().c_str(),
nm->polyphonic());
+ #endif
}
- set_all_metadata(nm);
+ set_metadata_map(path, initial_data);
}
@@ -56,17 +59,17 @@ void
ModelEngineInterface::create_patch_from_model(const PatchModel* pm)
{
create_patch(pm->path().c_str(), pm->poly());
- set_all_metadata(pm);
+ set_metadata_map(pm->path(), pm->metadata());
}
/** Set all pieces of metadata in a model.
*/
void
-ModelEngineInterface::set_all_metadata(const ObjectModel* m)
+ModelEngineInterface::set_metadata_map(const Path& subject, const MetadataMap& data)
{
- for (MetadataMap::const_iterator i = m->metadata().begin(); i != m->metadata().end(); ++i)
- set_metadata(m->path(), i->first, i->second);
+ for (MetadataMap::const_iterator i = data.begin(); i != data.end(); ++i)
+ set_metadata(subject, i->first, i->second);
}