summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/Parser.cpp (renamed from src/serialisation/Parser.cpp)4
-rw-r--r--src/Serialiser.cpp (renamed from src/serialisation/Serialiser.cpp)4
-rw-r--r--src/World.cpp65
-rw-r--r--src/gui/App.cpp5
-rw-r--r--src/gui/App.hpp6
-rw-r--r--src/gui/GraphCanvas.cpp16
-rw-r--r--src/gui/Style.cpp2
-rw-r--r--src/gui/ThreadedLoader.cpp11
-rw-r--r--src/gui/ThreadedLoader.hpp6
-rw-r--r--src/gui/wscript2
-rw-r--r--src/ingen/ingen.cpp7
-rw-r--r--src/serialisation/serialisation.cpp43
-rw-r--r--src/serialisation/wscript30
-rw-r--r--src/server/JackDriver.cpp4
-rw-r--r--src/server/ingen_lv2.cpp8
-rw-r--r--src/wscript2
16 files changed, 60 insertions, 155 deletions
diff --git a/src/serialisation/Parser.cpp b/src/Parser.cpp
index 663a7833..b0bf88e6 100644
--- a/src/serialisation/Parser.cpp
+++ b/src/Parser.cpp
@@ -26,10 +26,10 @@
#include "ingen/Atom.hpp"
#include "ingen/Interface.hpp"
#include "ingen/Log.hpp"
+#include "ingen/Parser.hpp"
#include "ingen/URIMap.hpp"
#include "ingen/URIs.hpp"
#include "ingen/World.hpp"
-#include "ingen/serialisation/Parser.hpp"
#include "lv2/lv2plug.in/ns/ext/atom/atom.h"
#include "serd/serd.h"
#include "sord/sordmm.hpp"
@@ -40,7 +40,6 @@ using namespace std;
typedef set<Sord::Node> RDFNodes;
namespace Ingen {
-namespace Serialisation {
static std::string
relative_uri(const std::string& base, const std::string& uri, bool leading_slash)
@@ -651,5 +650,4 @@ Parser::parse_string(Ingen::World* world,
return actual_base;
}
-} // namespace Serialisation
} // namespace Ingen
diff --git a/src/serialisation/Serialiser.cpp b/src/Serialiser.cpp
index 775736ae..2114cc00 100644
--- a/src/serialisation/Serialiser.cpp
+++ b/src/Serialiser.cpp
@@ -35,11 +35,11 @@
#include "ingen/Node.hpp"
#include "ingen/Plugin.hpp"
#include "ingen/Resource.hpp"
+#include "ingen/Serialiser.hpp"
#include "ingen/Store.hpp"
#include "ingen/URIMap.hpp"
#include "ingen/URIs.hpp"
#include "ingen/World.hpp"
-#include "ingen/serialisation/Serialiser.hpp"
#include "lv2/lv2plug.in/ns/ext/state/state.h"
#include "lv2/lv2plug.in/ns/extensions/ui/ui.h"
#include "raul/Path.hpp"
@@ -51,7 +51,6 @@ using namespace Sord;
using namespace Ingen;
namespace Ingen {
-namespace Serialisation {
struct Serialiser::Impl {
typedef Resource::Properties Properties;
@@ -543,5 +542,4 @@ Serialiser::Impl::serialise_properties(Sord::Node id,
serd_env_free(env);
}
-} // namespace Serialisation
} // namespace Ingen
diff --git a/src/World.cpp b/src/World.cpp
index badbf353..615c761d 100644
--- a/src/World.cpp
+++ b/src/World.cpp
@@ -26,6 +26,8 @@
#include "ingen/LV2Features.hpp"
#include "ingen/Log.hpp"
#include "ingen/Module.hpp"
+#include "ingen/Parser.hpp"
+#include "ingen/Serialiser.hpp"
#include "ingen/URIMap.hpp"
#include "ingen/URIs.hpp"
#include "ingen/World.hpp"
@@ -40,12 +42,9 @@ namespace Ingen {
class EngineBase;
class Interface;
-class Store;
-
-namespace Serialisation {
class Parser;
class Serialiser;
-}
+class Store;
/** Load a dynamic module from the default path.
*
@@ -53,7 +52,7 @@ class Serialiser;
* INGEN_MODULE_PATH (typical colon delimited format), then the default module
* installation directory (ie /usr/local/lib/ingen), in that order.
*
- * \param name The base name of the module, e.g. "ingen_serialisation"
+ * \param name The base name of the module, e.g. "ingen_jack"
*/
static Glib::Module*
ingen_load_module(Log& log, const string& name)
@@ -202,23 +201,23 @@ public:
typedef std::map<const std::string, ScriptRunner> ScriptRunners;
ScriptRunners script_runners;
- int& argc;
- char**& argv;
- LV2Features* lv2_features;
- Sord::World* rdf_world;
- URIMap* uri_map;
- Forge* forge;
- URIs* uris;
- LV2_Log_Log* lv2_log;
- Log log;
- Configuration conf;
- SPtr<Interface> interface;
- SPtr<EngineBase> engine;
- SPtr<Serialisation::Serialiser> serialiser;
- SPtr<Serialisation::Parser> parser;
- SPtr<Store> store;
- LilvWorld* lilv_world;
- std::string jack_uuid;
+ int& argc;
+ char**& argv;
+ LV2Features* lv2_features;
+ Sord::World* rdf_world;
+ URIMap* uri_map;
+ Forge* forge;
+ URIs* uris;
+ LV2_Log_Log* lv2_log;
+ Log log;
+ Configuration conf;
+ SPtr<Interface> interface;
+ SPtr<EngineBase> engine;
+ SPtr<Serialiser> serialiser;
+ SPtr<Parser> parser;
+ SPtr<Store> store;
+ LilvWorld* lilv_world;
+ std::string jack_uuid;
};
World::World(int& argc,
@@ -228,6 +227,8 @@ World::World(int& argc,
LV2_Log_Log* log)
: _impl(new Impl(argc, argv, map, unmap, log))
{
+ _impl->serialiser = SPtr<Serialiser>(new Serialiser(*this));
+ _impl->parser = SPtr<Parser>(new Parser());
}
World::~World()
@@ -235,17 +236,15 @@ World::~World()
delete _impl;
}
-void World::set_engine(SPtr<EngineBase> e) { _impl->engine = e; }
-void World::set_interface(SPtr<Interface> i) { _impl->interface = i; }
-void World::set_parser(SPtr<Serialisation::Parser> p) { _impl->parser = p; }
-void World::set_serialiser(SPtr<Serialisation::Serialiser> s) { _impl->serialiser = s; }
-void World::set_store(SPtr<Store> s) { _impl->store = s; }
-
-SPtr<EngineBase> World::engine() { return _impl->engine; }
-SPtr<Interface> World::interface() { return _impl->interface; }
-SPtr<Serialisation::Parser> World::parser() { return _impl->parser; }
-SPtr<Serialisation::Serialiser> World::serialiser() { return _impl->serialiser; }
-SPtr<Store> World::store() { return _impl->store; }
+void World::set_engine(SPtr<EngineBase> e) { _impl->engine = e; }
+void World::set_interface(SPtr<Interface> i) { _impl->interface = i; }
+void World::set_store(SPtr<Store> s) { _impl->store = s; }
+
+SPtr<EngineBase> World::engine() { return _impl->engine; }
+SPtr<Interface> World::interface() { return _impl->interface; }
+SPtr<Parser> World::parser() { return _impl->parser; }
+SPtr<Serialiser> World::serialiser() { return _impl->serialiser; }
+SPtr<Store> World::store() { return _impl->store; }
int& World::argc() { return _impl->argc; }
char**& World::argv() { return _impl->argv; }
diff --git a/src/gui/App.cpp b/src/gui/App.cpp
index 730243a7..b0f6f28b 100644
--- a/src/gui/App.cpp
+++ b/src/gui/App.cpp
@@ -188,12 +188,9 @@ App::request_plugins_if_necessary()
}
}
-SPtr<Serialisation::Serialiser>
+SPtr<Serialiser>
App::serialiser()
{
- if (!_world->serialiser())
- _world->load_module("serialisation");
-
return _world->serialiser();
}
diff --git a/src/gui/App.hpp b/src/gui/App.hpp
index f875c7c6..0ce37ebd 100644
--- a/src/gui/App.hpp
+++ b/src/gui/App.hpp
@@ -37,6 +37,7 @@ namespace Ingen {
class Interface;
class Log;
class Port;
+class Serialiser;
class World;
namespace Client {
class ClientStore;
@@ -45,9 +46,6 @@ class PluginModel;
class PortModel;
class SigClientInterface;
}
-namespace Serialisation {
-class Serialiser;
-}
}
namespace Ingen {
@@ -116,7 +114,7 @@ public:
SPtr<Client::ClientStore> store() const { return _store; }
SPtr<ThreadedLoader> loader() const { return _loader; }
- SPtr<Serialisation::Serialiser> serialiser();
+ SPtr<Serialiser> serialiser();
static SPtr<App> create(Ingen::World* world);
void run();
diff --git a/src/gui/GraphCanvas.cpp b/src/gui/GraphCanvas.cpp
index 12c60638..c3b8b937 100644
--- a/src/gui/GraphCanvas.cpp
+++ b/src/gui/GraphCanvas.cpp
@@ -29,13 +29,13 @@
#include "ingen/Configuration.hpp"
#include "ingen/Interface.hpp"
#include "ingen/Log.hpp"
+#include "ingen/Serialiser.hpp"
#include "ingen/World.hpp"
#include "ingen/client/BlockModel.hpp"
#include "ingen/client/ClientStore.hpp"
#include "ingen/client/GraphModel.hpp"
#include "ingen/client/PluginModel.hpp"
#include "ingen/ingen.h"
-#include "ingen/serialisation/Serialiser.hpp"
#include "lv2/lv2plug.in/ns/ext/atom/atom.h"
#include "App.hpp"
@@ -563,7 +563,7 @@ GraphCanvas::destroy_selection()
static void
serialise_node(GanvNode* node, void* data)
{
- Serialisation::Serialiser* serialiser = (Serialisation::Serialiser*)data;
+ Serialiser* serialiser = (Serialiser*)data;
if (!GANV_IS_MODULE(node)) {
return;
}
@@ -584,7 +584,7 @@ serialise_node(GanvNode* node, void* data)
static void
serialise_arc(GanvEdge* arc, void* data)
{
- Serialisation::Serialiser* serialiser = (Serialisation::Serialiser*)data;
+ Serialiser* serialiser = (Serialiser*)data;
if (!GANV_IS_EDGE(arc)) {
return;
}
@@ -598,7 +598,7 @@ serialise_arc(GanvEdge* arc, void* data)
void
GraphCanvas::copy_selection()
{
- Serialisation::Serialiser serialiser(*_app.world());
+ Serialiser serialiser(*_app.world());
serialiser.start_to_string(_graph->path(), _graph->base_uri());
for_each_selected_node(serialise_node, &serialiser);
@@ -614,10 +614,10 @@ GraphCanvas::paste()
{
typedef Node::Properties::const_iterator PropIter;
- const Glib::ustring str = Gtk::Clipboard::get()->wait_for_text();
- SPtr<Serialisation::Parser> parser = _app.loader()->parser();
- const URIs& uris = _app.uris();
- const Raul::Path& parent = _graph->path();
+ const Glib::ustring str = Gtk::Clipboard::get()->wait_for_text();
+ SPtr<Parser> parser = _app.loader()->parser();
+ const URIs& uris = _app.uris();
+ const Raul::Path& parent = _graph->path();
if (!parser) {
_app.log().error("Unable to load parser, paste unavailable\n");
return;
diff --git a/src/gui/Style.cpp b/src/gui/Style.cpp
index 342cb142..699398e4 100644
--- a/src/gui/Style.cpp
+++ b/src/gui/Style.cpp
@@ -22,9 +22,9 @@
#include "ganv/Port.hpp"
#include "ingen/Log.hpp"
+#include "ingen/Parser.hpp"
#include "ingen/client/PluginModel.hpp"
#include "ingen/client/PortModel.hpp"
-#include "ingen/serialisation/Parser.hpp"
#include "App.hpp"
#include "Style.hpp"
diff --git a/src/gui/ThreadedLoader.cpp b/src/gui/ThreadedLoader.cpp
index 93cccdf1..6e57c383 100644
--- a/src/gui/ThreadedLoader.cpp
+++ b/src/gui/ThreadedLoader.cpp
@@ -49,15 +49,10 @@ ThreadedLoader::~ThreadedLoader()
_thread.join();
}
-SPtr<Serialisation::Parser>
+SPtr<Parser>
ThreadedLoader::parser()
{
- Ingen::World* world = _app.world();
-
- if (!world->parser())
- world->load_module("serialisation");
-
- return world->parser();
+ return _app.world()->parser();
}
void
@@ -95,7 +90,7 @@ ThreadedLoader::load_graph(bool merge,
_events.push_back(
sigc::hide_return(
sigc::bind(sigc::mem_fun(world->parser().get(),
- &Ingen::Serialisation::Parser::parse_file),
+ &Ingen::Parser::parse_file),
_app.world(),
_app.world()->interface().get(),
document_uri,
diff --git a/src/gui/ThreadedLoader.hpp b/src/gui/ThreadedLoader.hpp
index 68f6a3f1..c197a605 100644
--- a/src/gui/ThreadedLoader.hpp
+++ b/src/gui/ThreadedLoader.hpp
@@ -27,8 +27,8 @@
#include <glibmm/thread.h>
#include "ingen/Interface.hpp"
-#include "ingen/serialisation/Parser.hpp"
-#include "ingen/serialisation/Serialiser.hpp"
+#include "ingen/Parser.hpp"
+#include "ingen/Serialiser.hpp"
#include "raul/Semaphore.hpp"
namespace Ingen {
@@ -62,7 +62,7 @@ public:
void save_graph(SPtr<const Client::GraphModel> model,
const std::string& filename);
- SPtr<Serialisation::Parser> parser();
+ SPtr<Parser> parser();
private:
void save_graph_event(SPtr<const Client::GraphModel> model,
diff --git a/src/gui/wscript b/src/gui/wscript
index 9ca90ee6..e75b064b 100644
--- a/src/gui/wscript
+++ b/src/gui/wscript
@@ -31,7 +31,7 @@ def build(bld):
name = 'libingen_gui',
target = 'ingen_gui',
install_path = '${LIBDIR}',
- use = 'libingen libingen_client libingen_serialisation')
+ use = 'libingen libingen_client')
autowaf.use_lib(bld, obj, '''
GANV
GLADEMM
diff --git a/src/ingen/ingen.cpp b/src/ingen/ingen.cpp
index e6aea823..3f68369c 100644
--- a/src/ingen/ingen.cpp
+++ b/src/ingen/ingen.cpp
@@ -31,10 +31,10 @@
#include "ingen/EngineBase.hpp"
#include "ingen/Interface.hpp"
#include "ingen/Log.hpp"
+#include "ingen/Parser.hpp"
#include "ingen/World.hpp"
#include "ingen/client/ThreadedSigClientInterface.hpp"
#include "ingen/runtime_paths.hpp"
-#include "ingen/serialisation/Parser.hpp"
#include "ingen/types.hpp"
#ifdef WITH_BINDINGS
#include "bindings/ingen_bindings.hpp"
@@ -145,11 +145,6 @@ main(int argc, char** argv)
// Load necessary modules before activating engine (and Jack driver)
- if (conf.option("load").is_valid() || !conf.files().empty()) {
- ingen_try(world->load_module("serialisation"),
- "Unable to load serialisation module");
- }
-
if (conf.option("gui").get<int32_t>()) {
ingen_try(world->load_module("gui"),
"Unable to load GUI module");
diff --git a/src/serialisation/serialisation.cpp b/src/serialisation/serialisation.cpp
deleted file mode 100644
index b335845e..00000000
--- a/src/serialisation/serialisation.cpp
+++ /dev/null
@@ -1,43 +0,0 @@
-/*
- This file is part of Ingen.
- Copyright 2007-2012 David Robillard <http://drobilla.net/>
-
- Ingen is free software: you can redistribute it and/or modify it under the
- terms of the GNU Affero General Public License as published by the Free
- Software Foundation, either version 3 of the License, or any later version.
-
- Ingen is distributed in the hope that it will be useful, but WITHOUT ANY
- WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
- A PARTICULAR PURPOSE. See the GNU Affero General Public License for details.
-
- You should have received a copy of the GNU Affero General Public License
- along with Ingen. If not, see <http://www.gnu.org/licenses/>.
-*/
-
-#include "ingen/Module.hpp"
-#include "ingen/World.hpp"
-
-#include "ingen/serialisation/Parser.hpp"
-#include "ingen/serialisation/Serialiser.hpp"
-
-using namespace Ingen;
-
-struct IngenSerialisationModule : public Ingen::Module {
- virtual void load(Ingen::World* world) {
- world->set_parser(
- SPtr<Serialisation::Parser>(
- new Serialisation::Parser()));
- world->set_serialiser(
- SPtr<Serialisation::Serialiser>(
- new Serialisation::Serialiser(*world)));
- }
-};
-
-extern "C" {
-
-Ingen::Module*
-ingen_module_load() {
- return new IngenSerialisationModule();
-}
-
-} // extern "C"
diff --git a/src/serialisation/wscript b/src/serialisation/wscript
deleted file mode 100644
index 82aeffd4..00000000
--- a/src/serialisation/wscript
+++ /dev/null
@@ -1,30 +0,0 @@
-#!/usr/bin/env python
-from waflib.extras import autowaf as autowaf
-
-def build(bld):
- obj = bld(features = 'c cshlib cxx cxxshlib',
- source = ['Parser.cpp',
- 'Serialiser.cpp',
- 'serialisation.cpp'],
- export_includes = ['../..'],
- includes = ['.', '../..'],
- name = 'libingen_serialisation',
- target = 'ingen_serialisation',
- install_path = '${LIBDIR}',
- use = 'libingen')
- autowaf.use_lib(bld, obj, 'GLIBMM LV2 LILV RAUL SERD SORD SRATOM')
-
- if bld.env.BUILD_TESTS:
- obj = bld(features = 'c cshlib cxx cxxshlib',
- source = ['Parser.cpp',
- 'Serialiser.cpp',
- 'serialisation.cpp'],
- export_includes = ['../..'],
- includes = ['.', '../..'],
- name = 'libingen_serialisation_profiled',
- target = 'ingen_serialisation_profiled',
- install_path = '',
- use = 'libingen_profiled',
- lib = bld.env.INGEN_TEST_LIBS,
- cxxflags = bld.env.INGEN_TEST_CXXFLAGS)
- autowaf.use_lib(bld, obj, 'GLIBMM LV2 LILV RAUL SERD SORD SRATOM')
diff --git a/src/server/JackDriver.cpp b/src/server/JackDriver.cpp
index 3452c163..efe19169 100644
--- a/src/server/JackDriver.cpp
+++ b/src/server/JackDriver.cpp
@@ -23,7 +23,7 @@
#ifdef INGEN_JACK_SESSION
#include <jack/session.h>
#include <boost/format.hpp>
-#include "ingen/serialisation/Serialiser.hpp"
+#include "ingen/Serialiser.hpp"
#endif
#ifdef HAVE_JACK_METADATA
#include <jack/metadata.h>
@@ -525,7 +525,7 @@ JackDriver::_session_cb(jack_session_event_t* event)
% jack_get_client_name(_client)
% event->client_uuid).str();
- SPtr<Serialisation::Serialiser> serialiser = _engine.world()->serialiser();
+ SPtr<Serialiser> serialiser = _engine.world()->serialiser();
if (serialiser) {
SPtr<Node> root(_engine.root_graph(), NullDeleter<Node>);
serialiser->write_bundle(root, string("file://") + event->session_dir);
diff --git a/src/server/ingen_lv2.cpp b/src/server/ingen_lv2.cpp
index cf81fd73..596e24e6 100644
--- a/src/server/ingen_lv2.cpp
+++ b/src/server/ingen_lv2.cpp
@@ -34,12 +34,12 @@
#include "ingen/Configuration.hpp"
#include "ingen/Interface.hpp"
#include "ingen/Log.hpp"
+#include "ingen/Parser.hpp"
+#include "ingen/Serialiser.hpp"
#include "ingen/Store.hpp"
#include "ingen/World.hpp"
#include "ingen/ingen.h"
#include "ingen/runtime_paths.hpp"
-#include "ingen/serialisation/Parser.hpp"
-#include "ingen/serialisation/Serialiser.hpp"
#include "ingen/types.hpp"
#include "raul/Semaphore.hpp"
@@ -539,10 +539,6 @@ ingen_instantiate(const LV2_Descriptor* descriptor,
plugin->map = map;
plugin->world = new Ingen::World(
plugin->argc, plugin->argv, map, unmap, log);
- if (!plugin->world->load_module("serialisation")) {
- delete plugin->world;
- return NULL;
- }
LV2_URID bufsz_max = map->map(map->handle, LV2_BUF_SIZE__maxBlockLength);
LV2_URID bufsz_seq = map->map(map->handle, LV2_BUF_SIZE__sequenceSize);
diff --git a/src/wscript b/src/wscript
index fbca8fe9..02ad63c3 100644
--- a/src/wscript
+++ b/src/wscript
@@ -10,7 +10,9 @@ def build(bld):
'Forge.cpp',
'LV2Features.cpp',
'Log.cpp',
+ 'Parser.cpp',
'Resource.cpp',
+ 'Serialiser.cpp',
'Store.cpp',
'URIMap.cpp',
'URIs.cpp',