diff options
author | David Robillard <d@drobilla.net> | 2009-12-19 21:37:50 +0000 |
---|---|---|
committer | David Robillard <d@drobilla.net> | 2009-12-19 21:37:50 +0000 |
commit | 19045ab92aa7e996971584a0dc8780d1d58b498b (patch) | |
tree | 619c73deb7fd64ce31c5167490d1ae186dbb2695 /src/module/ingen_module.cpp | |
parent | 4613a2e15f1122ecf6830171de0ab18dc22fefff (diff) | |
download | ingen-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/module/ingen_module.cpp')
-rw-r--r-- | src/module/ingen_module.cpp | 29 |
1 files changed, 10 insertions, 19 deletions
diff --git a/src/module/ingen_module.cpp b/src/module/ingen_module.cpp index c9a6d9d4..5faefebc 100644 --- a/src/module/ingen_module.cpp +++ b/src/module/ingen_module.cpp @@ -15,36 +15,30 @@ * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ -#include <iostream> #include "redlandmm/World.hpp" #include "shared/LV2Features.hpp" #include "ingen_module.hpp" #include "World.hpp" - #include "ingen-config.h" #ifdef HAVE_SLV2 #include "slv2/slv2.h" #endif -using namespace std; - -namespace Ingen { -namespace Shared { - -static World* world = NULL; +extern "C" { +static Ingen::Shared::World* world = NULL; -World* -get_world() +Ingen::Shared::World* +ingen_get_world() { - static World* world = NULL; + static Ingen::Shared::World* world = NULL; if (!world) { - world = new World(); + world = new Ingen::Shared::World(); world->rdf_world = new Redland::World(); #ifdef HAVE_SLV2 world->slv2_world = slv2_world_new_using_rdf_world(world->rdf_world->world()); - world->lv2_features = new LV2Features(); + world->lv2_features = new Ingen::Shared::LV2Features(); slv2_world_load_all(world->slv2_world); #endif world->engine.reset(); @@ -54,11 +48,11 @@ get_world() return world; } - void -destroy_world() +ingen_destroy_world() { if (world) { + world->unload_all(); #ifdef HAVE_SLV2 slv2_world_free(world->slv2_world); delete world->lv2_features; @@ -69,7 +63,4 @@ destroy_world() } } - -} // namesace Shared -} // namespace Ingen - +} // extern "C" |