summaryrefslogtreecommitdiffstats
path: root/src/serialisation/serialisation.cpp
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2009-12-19 21:37:50 +0000
committerDavid Robillard <d@drobilla.net>2009-12-19 21:37:50 +0000
commit19045ab92aa7e996971584a0dc8780d1d58b498b (patch)
tree619c73deb7fd64ce31c5167490d1ae186dbb2695 /src/serialisation/serialisation.cpp
parent4613a2e15f1122ecf6830171de0ab18dc22fefff (diff)
downloadingen-19045ab92aa7e996971584a0dc8780d1d58b498b.tar.gz
ingen-19045ab92aa7e996971584a0dc8780d1d58b498b.tar.bz2
ingen-19045ab92aa7e996971584a0dc8780d1d58b498b.zip
New ingen module (library, not e.g. LV2 plugin) design.
Much cleaner interface and general usage of Ingen as a library. git-svn-id: http://svn.drobilla.net/lad/trunk/ingen@2314 a436a847-0d15-0410-975c-d299462d15a1
Diffstat (limited to 'src/serialisation/serialisation.cpp')
-rw-r--r--src/serialisation/serialisation.cpp36
1 files changed, 19 insertions, 17 deletions
diff --git a/src/serialisation/serialisation.cpp b/src/serialisation/serialisation.cpp
index 09c4f798..a453f000 100644
--- a/src/serialisation/serialisation.cpp
+++ b/src/serialisation/serialisation.cpp
@@ -16,31 +16,33 @@
*/
#include "raul/Atom.hpp"
+#include "module/Module.hpp"
#include "module/World.hpp"
-#include "serialisation.hpp"
#include "Parser.hpp"
#include "Serialiser.hpp"
-namespace Ingen {
-namespace Serialisation {
+using namespace Ingen;
+struct IngenModule : public Shared::Module {
+ void load(Shared::World* world) {
+ world->parser = SharedPtr<Serialisation::Parser>(
+ new Serialisation::Parser());
+ world->serialiser = SharedPtr<Serialisation::Serialiser>(
+ new Serialisation::Serialiser(*world, world->store));
+ }
+};
-Ingen::Serialisation::Parser*
-new_parser()
-{
- return new Parser();
-}
-
+static IngenModule* module = NULL;
-Ingen::Serialisation::Serialiser*
-new_serialiser(Ingen::Shared::World* world, SharedPtr<Shared::Store> store)
-{
- assert(world->rdf_world);
- return new Serialiser(*world, store);
-}
+extern "C" {
+Shared::Module*
+ingen_module_load() {
+ if (!module)
+ module = new IngenModule();
+ return module;
+}
-} // namespace Serialisation
-} // namespace Ingen
+} // extern "C"