diff options
author | David Robillard <d@drobilla.net> | 2011-02-19 05:10:29 +0000 |
---|---|---|
committer | David Robillard <d@drobilla.net> | 2011-02-19 05:10:29 +0000 |
commit | 6b18de71d1c603255b263a64434005306f152f13 (patch) | |
tree | 09c6e87acca1fe76bc74b3b549fee7ad09751993 /src/gui | |
parent | 8e07e115429a0869593d4f29dc3e6cf5c8b25049 (diff) | |
download | ingen-6b18de71d1c603255b263a64434005306f152f13.tar.gz ingen-6b18de71d1c603255b263a64434005306f152f13.tar.bz2 ingen-6b18de71d1c603255b263a64434005306f152f13.zip |
Save/load patches as nested bundles (fix ticket #520).
Sane (context-based, ala RDF quads) approach to the problem of externally visible / internally visible properties.
git-svn-id: http://svn.drobilla.net/lad/trunk/ingen@2993 a436a847-0d15-0410-975c-d299462d15a1
Diffstat (limited to 'src/gui')
-rw-r--r-- | src/gui/NewSubpatchWindow.cpp | 9 | ||||
-rw-r--r-- | src/gui/NodeModule.cpp | 4 | ||||
-rw-r--r-- | src/gui/PatchCanvas.cpp | 6 | ||||
-rw-r--r-- | src/gui/PatchPortModule.cpp | 6 | ||||
-rw-r--r-- | src/gui/PatchView.cpp | 4 | ||||
-rw-r--r-- | src/gui/PortPropertiesWindow.cpp | 2 |
6 files changed, 13 insertions, 18 deletions
diff --git a/src/gui/NewSubpatchWindow.cpp b/src/gui/NewSubpatchWindow.cpp index 44fb54b0..13ea0c47 100644 --- a/src/gui/NewSubpatchWindow.cpp +++ b/src/gui/NewSubpatchWindow.cpp @@ -96,14 +96,17 @@ NewSubpatchWindow::ok_clicked() const Path path = _patch->path().base() + Path::nameify(_name_entry->get_text()); const uint32_t poly = _poly_spinbutton->get_value_as_int(); + // Create patch Resource::Properties props; props.insert(make_pair(app.uris().rdf_type, app.uris().ingen_Patch)); props.insert(make_pair(app.uris().ingen_polyphony, Atom(int32_t(poly)))); - app.engine()->put(ResourceImpl::meta_uri(path), props); + props.insert(make_pair(app.uris().ingen_enabled, Atom(bool(true)))); + app.engine()->put(path, props, Resource::INTERNAL); + // Set external (node perspective) properties props = _initial_data; - props.insert(make_pair(app.uris().ingen_enabled, bool(true))); - app.engine()->put(path, props); + props.insert(make_pair(app.uris().rdf_type, app.uris().ingen_Patch)); + app.engine()->put(path, _initial_data, Resource::EXTERNAL); hide(); } diff --git a/src/gui/NodeModule.cpp b/src/gui/NodeModule.cpp index 44748aeb..52f14772 100644 --- a/src/gui/NodeModule.cpp +++ b/src/gui/NodeModule.cpp @@ -94,9 +94,6 @@ NodeModule::create(boost::shared_ptr<PatchCanvas> canvas, SharedPtr<NodeModel> n else ret = boost::shared_ptr<NodeModule>(new NodeModule(canvas, node)); - for (GraphObject::Properties::const_iterator m = node->meta().properties().begin(); m != node->meta().properties().end(); ++m) - ret->property_changed(m->first, m->second); - for (GraphObject::Properties::const_iterator m = node->properties().begin(); m != node->properties().end(); ++m) ret->property_changed(m->first, m->second); @@ -392,6 +389,7 @@ NodeModule::store_location() add.insert(make_pair(uris.ingenui_canvas_x, Atom(x))); add.insert(make_pair(uris.ingenui_canvas_y, Atom(y))); App::instance().engine()->delta(_node->path(), remove, add); + // FIXME: context } } diff --git a/src/gui/PatchCanvas.cpp b/src/gui/PatchCanvas.cpp index 3ee6e3cb..ce8c0892 100644 --- a/src/gui/PatchCanvas.cpp +++ b/src/gui/PatchCanvas.cpp @@ -645,8 +645,10 @@ PatchCanvas::copy_selection() for (list<boost::shared_ptr<FlowCanvas::Connection> >::iterator c = _selected_connections.begin(); c != _selected_connections.end(); ++c) { boost::shared_ptr<Connection> connection = boost::dynamic_pointer_cast<Connection>(*c); - if (connection) - serialiser.serialise_connection(_patch, connection->model()); + if (connection) { + Sord::URI subject(*App::instance().world()->rdf_world(), _patch->path().str()); + serialiser.serialise_connection(subject, connection->model()); + } } string result = serialiser.finish(); diff --git a/src/gui/PatchPortModule.cpp b/src/gui/PatchPortModule.cpp index cbfb6f03..b8e74a8f 100644 --- a/src/gui/PatchPortModule.cpp +++ b/src/gui/PatchPortModule.cpp @@ -64,10 +64,6 @@ PatchPortModule::create(boost::shared_ptr<PatchCanvas> canvas, SharedPtr<PortMod ret->set_port(port); ret->set_menu(port->menu()); - for (GraphObject::Properties::const_iterator m = model->meta().properties().begin(); - m != model->meta().properties().end(); ++m) - ret->property_changed(m->first, m->second); - for (GraphObject::Properties::const_iterator m = model->properties().begin(); m != model->properties().end(); ++m) ret->property_changed(m->first, m->second); @@ -104,7 +100,7 @@ PatchPortModule::store_location() Shared::Resource::Properties props; props.insert(make_pair(uris.ingenui_canvas_x, Atom(x))); props.insert(make_pair(uris.ingenui_canvas_y, Atom(y))); - App::instance().engine()->put(_model->meta_uri(), props); + App::instance().engine()->put(_model->path(), props, Resource::INTERNAL); } } diff --git a/src/gui/PatchView.cpp b/src/gui/PatchView.cpp index 21717f55..1313f65e 100644 --- a/src/gui/PatchView.cpp +++ b/src/gui/PatchView.cpp @@ -77,10 +77,6 @@ PatchView::set_patch(SharedPtr<PatchModel> patch) _poly_spin->set_value(patch->internal_poly()); - for (GraphObject::Properties::const_iterator i = patch->meta().properties().begin(); - i != patch->meta().properties().end(); ++i) - property_changed(i->first, i->second); - for (GraphObject::Properties::const_iterator i = patch->properties().begin(); i != patch->properties().end(); ++i) property_changed(i->first, i->second); diff --git a/src/gui/PortPropertiesWindow.cpp b/src/gui/PortPropertiesWindow.cpp index 7ba5ba28..5cfe33ef 100644 --- a/src/gui/PortPropertiesWindow.cpp +++ b/src/gui/PortPropertiesWindow.cpp @@ -157,7 +157,7 @@ PortPropertiesWindow::ok() Shared::Resource::Properties props; props.insert(make_pair(uris.lv2_minimum, float(_min_spinner->get_value()))); props.insert(make_pair(uris.lv2_maximum, float(_max_spinner->get_value()))); - App::instance().engine()->put(_port_model->meta().uri(), props); + App::instance().engine()->put(_port_model->path(), props); hide(); } |