From 629fb50716083c71146340de97eb8651679ca9fb Mon Sep 17 00:00:00 2001 From: David Robillard Date: Tue, 31 Jul 2012 00:14:50 +0000 Subject: Merge Ingen::Shared namespace into Ingen namespace and core libingen library. git-svn-id: http://svn.drobilla.net/lad/trunk/ingen@4579 a436a847-0d15-0410-975c-d299462d15a1 --- src/bindings/ingen.i | 19 ++++++------------- src/bindings/ingen_bindings.cpp | 12 ++++++------ src/bindings/ingen_bindings.hpp | 2 -- 3 files changed, 12 insertions(+), 21 deletions(-) (limited to 'src/bindings') diff --git a/src/bindings/ingen.i b/src/bindings/ingen.i index 6b39eb33..b29a61ce 100644 --- a/src/bindings/ingen.i +++ b/src/bindings/ingen.i @@ -9,8 +9,6 @@ #include "Client.hpp" %} -/*%ignore Ingen::Shared::EngineInterface;*/ - %include "../../ingen/CommonInterface.hpp" %include "../../ingen/ClientInterface.hpp" %include "../../ingen/EngineInterface.hpp" @@ -21,34 +19,29 @@ // generate directors for all classes that have virtual methods %feature("director"); %feature("director") Ingen::ClientInterface; -//%feature("director") Ingen::Shared::EngineInterface; -typedef Ingen::Shared::World World; -namespace Ingen { namespace Shared { +typedef Ingen::World World; +namespace Ingen { %extend World { World() { - if (!Ingen::Shared::ingen_world) { + if (!Ingen::ingen_world) { fprintf(stderr, "ERROR: World uninitialized (running within Ingen?)\n"); abort(); } else { - return Ingen::Shared::ingen_world; + return Ingen::ingen_world; } } void iteration() { - Ingen::Shared::script_iteration($self); + Ingen::script_iteration($self); } /*LILVWorld lilv() { return $self->me->lilv_world; }*/ }; -} } +} %include "Client.hpp" %feature("director") Client; - - -/*SharedPtr engine() { return $self->me->engine; }*/ - diff --git a/src/bindings/ingen_bindings.cpp b/src/bindings/ingen_bindings.cpp index 6c92d7bb..39fd9fbf 100644 --- a/src/bindings/ingen_bindings.cpp +++ b/src/bindings/ingen_bindings.cpp @@ -18,10 +18,10 @@ #include "raul/log.hpp" #include "ingen_bindings.hpp" #include "server/Engine.hpp" -#include "ingen/shared/World.hpp" +#include "ingen/World.hpp" bool -run(Ingen::Shared::World* world, const char* filename) +run(Ingen::World* world, const char* filename) { ingen_world = world; @@ -38,22 +38,22 @@ run(Ingen::Shared::World* world, const char* filename) } } -struct IngenBindingsModule : public Ingen::Shared::Module { - void load(Ingen::Shared::World* world) { +struct IngenBindingsModule : public Ingen::Module { + void load(Ingen::World* world) { world->script_runners.insert(make_pair("application/x-python", &run)); } }; extern "C" { -Ingen::Shared::Module* +Ingen::Module* ingen_module_load() { return new IngenBindingsModule(); } void -script_iteration(Ingen::Shared::World* world) +script_iteration(Ingen::World* world) { if (world->engine()) world->engine()->main_iteration(); diff --git a/src/bindings/ingen_bindings.hpp b/src/bindings/ingen_bindings.hpp index 90ac4b0b..90358cd8 100644 --- a/src/bindings/ingen_bindings.hpp +++ b/src/bindings/ingen_bindings.hpp @@ -18,7 +18,6 @@ #define INGEN_BINDINGS_HPP namespace Ingen { -namespace Shared { class World; extern World* ingen_world; @@ -28,7 +27,6 @@ extern "C" { void script_iteration(World* world); } -} // namespace Shared } // namespace Ingen #endif // INGEN_BINDINGS_HPP -- cgit v1.2.1