summaryrefslogtreecommitdiffstats
path: root/src/libs/gui
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2008-08-16 18:45:27 +0000
committerDavid Robillard <d@drobilla.net>2008-08-16 18:45:27 +0000
commit42936aa5d924ca89fe3d887fd0ffeb7a281b547e (patch)
tree0bc295b9f021bee109822782af4c15504b25efa4 /src/libs/gui
parent1116f096282e47c4f85c4681906bacf2516d5a01 (diff)
downloadingen-42936aa5d924ca89fe3d887fd0ffeb7a281b547e.tar.gz
ingen-42936aa5d924ca89fe3d887fd0ffeb7a281b547e.tar.bz2
ingen-42936aa5d924ca89fe3d887fd0ffeb7a281b547e.zip
Add missing Store.cpp.
More serialisation work. git-svn-id: http://svn.drobilla.net/lad/ingen@1402 a436a847-0d15-0410-975c-d299462d15a1
Diffstat (limited to 'src/libs/gui')
-rw-r--r--src/libs/gui/App.cpp42
-rw-r--r--src/libs/gui/App.hpp4
-rw-r--r--src/libs/gui/PatchCanvas.cpp2
-rw-r--r--src/libs/gui/UploadPatchWindow.cpp3
4 files changed, 24 insertions, 27 deletions
diff --git a/src/libs/gui/App.cpp b/src/libs/gui/App.cpp
index a0a877d5..34f04f35 100644
--- a/src/libs/gui/App.cpp
+++ b/src/libs/gui/App.cpp
@@ -73,18 +73,6 @@ App::App(Ingen::Shared::World* world)
, _world(world)
, _enable_signal(true)
{
- // FIXME: defer loading of serialisation module until needed
- if (!world->serialisation_module)
- world->serialisation_module = Ingen::Shared::load_module("ingen_serialisation");
-
- if (world->serialisation_module)
- if (!world->serialiser)
- world->serialiser = SharedPtr<Serialiser>(
- Ingen::Serialisation::new_serialiser(world));
-
- if (!world->serialiser)
- cerr << "WARNING: Failed to load ingen_serialisation module, save disabled." << endl;
-
Glib::RefPtr<Gnome::Glade::Xml> glade_xml = GladeFactory::new_glade_reference();
glade_xml->get_widget_derived("connect_win", _connect_window);
@@ -93,18 +81,7 @@ App::App(Ingen::Shared::World* world)
glade_xml->get_widget("about_win", _about_dialog);
_about_dialog->property_program_name() = "Ingen";
- Redland::World& rdf_world = *world->rdf_world;
-
- rdf_world.add_prefix("xsd", "http://www.w3.org/2001/XMLSchema#");
- rdf_world.add_prefix("ingen", "http://drobilla.net/ns/ingen#");
- rdf_world.add_prefix("ingenuity", "http://drobilla.net/ns/ingenuity#");
- rdf_world.add_prefix("lv2", "http://lv2plug.in/ns/lv2core#");
- rdf_world.add_prefix("lv2_midi", "http://lv2plug.in/ns/ext/midi");
- rdf_world.add_prefix("rdfs", "http://www.w3.org/2000/01/rdf-schema#");
- rdf_world.add_prefix("doap", "http://usefulinc.com/ns/doap#");
- rdf_world.add_prefix("dc", "http://purl.org/dc/elements/1.1/");
-
- PluginModel::set_rdf_world(rdf_world);
+ PluginModel::set_rdf_world(*world->rdf_world);
#ifdef HAVE_SLV2
PluginModel::set_slv2_world(world->slv2_world);
@@ -197,6 +174,23 @@ App::detach()
_world->engine.reset();
}
}
+
+
+const SharedPtr<Serialiser>&
+App::serialiser()
+{
+ if (!_serialiser) {
+ if (!_world->serialisation_module)
+ _world->serialisation_module = Ingen::Shared::load_module("ingen_serialisation");
+
+ if (_world->serialisation_module)
+ _serialiser = SharedPtr<Serialiser>(Ingen::Serialisation::new_serialiser(_world, _store));
+
+ if (!_serialiser)
+ cerr << "WARNING: Failed to load ingen_serialisation module, save disabled." << endl;
+ }
+ return _serialiser;
+}
void
diff --git a/src/libs/gui/App.hpp b/src/libs/gui/App.hpp
index c6a6c66c..a13259ad 100644
--- a/src/libs/gui/App.hpp
+++ b/src/libs/gui/App.hpp
@@ -106,7 +106,8 @@ public:
const SharedPtr<SigClientInterface>& client() const { return _client; }
const SharedPtr<ClientStore>& store() const { return _store; }
const SharedPtr<ThreadedLoader>& loader() const { return _loader; }
- const SharedPtr<Serialiser>& serialiser() const { return _world->serialiser; }
+
+ const SharedPtr<Serialiser>& serialiser();
static inline App& instance() { assert(_instance); return *_instance; }
@@ -139,6 +140,7 @@ protected:
SharedPtr<SigClientInterface> _client;
SharedPtr<ClientStore> _store;
+ SharedPtr<Serialiser> _serialiser;
SharedPtr<ThreadedLoader> _loader;
Configuration* _configuration;
diff --git a/src/libs/gui/PatchCanvas.cpp b/src/libs/gui/PatchCanvas.cpp
index c92eeb43..59011721 100644
--- a/src/libs/gui/PatchCanvas.cpp
+++ b/src/libs/gui/PatchCanvas.cpp
@@ -539,7 +539,7 @@ PatchCanvas::destroy_selection()
void
PatchCanvas::copy_selection()
{
- Serialiser serialiser(*App::instance().world());
+ Serialiser serialiser(*App::instance().world(), App::instance().store());
serialiser.start_to_string("");
for (list<boost::shared_ptr<Item> >::iterator m = _selected_items.begin(); m != _selected_items.end(); ++m) {
diff --git a/src/libs/gui/UploadPatchWindow.cpp b/src/libs/gui/UploadPatchWindow.cpp
index b14f7e2c..2ca54f3c 100644
--- a/src/libs/gui/UploadPatchWindow.cpp
+++ b/src/libs/gui/UploadPatchWindow.cpp
@@ -24,6 +24,7 @@
#include <redlandmm/Query.hpp>
#include "module/global.hpp"
#include "module/World.hpp"
+#include "client/ClientStore.hpp"
#include "interface/EngineInterface.hpp"
#include "serialisation/Serialiser.hpp"
#include "client/PatchModel.hpp"
@@ -247,7 +248,7 @@ UploadPatchWindow::upload_clicked()
_upload_progress->set_fraction(0.0);
_upload_progress->set_text("");
- Serialiser s(*App::instance().world());
+ Serialiser s(*App::instance().world(), App::instance().store());
const string uri = string("http://rdf.drobilla.net/ingen_patches/")
.append(symbol).append(".ingen.ttl");