diff options
author | David Robillard <d@drobilla.net> | 2011-04-15 20:20:58 +0000 |
---|---|---|
committer | David Robillard <d@drobilla.net> | 2011-04-15 20:20:58 +0000 |
commit | 42b469037c1b2bb55cd400a24cabfa29e7ae1ab2 (patch) | |
tree | 1b2e6310cb6fc7fe9b6066349d71ef1c1a9c829f | |
parent | a25b29c2e0843964ad82870c102857e3a83fad61 (diff) | |
download | ingen-42b469037c1b2bb55cd400a24cabfa29e7ae1ab2.tar.gz ingen-42b469037c1b2bb55cd400a24cabfa29e7ae1ab2.tar.bz2 ingen-42b469037c1b2bb55cd400a24cabfa29e7ae1ab2.zip |
Remove pointless module interface to ingen_module (World).
Having a dlopen interface to this code makes no sense since it must be linked against to load modules in the first place.
git-svn-id: http://svn.drobilla.net/lad/trunk/ingen@3146 a436a847-0d15-0410-975c-d299462d15a1
-rw-r--r-- | src/engine/ingen_lv2.cpp | 13 | ||||
-rw-r--r-- | src/gui/ThreadedLoader.cpp | 1 | ||||
-rw-r--r-- | src/ingen/main.cpp | 9 | ||||
-rw-r--r-- | src/module/World.cpp | 14 | ||||
-rw-r--r-- | src/module/World.hpp | 14 | ||||
-rw-r--r-- | src/module/ingen_module.cpp | 35 | ||||
-rw-r--r-- | src/module/ingen_module.hpp | 33 | ||||
-rw-r--r-- | src/module/wscript | 1 | ||||
-rw-r--r-- | src/shared/LV2Features.hpp | 6 |
9 files changed, 21 insertions, 105 deletions
diff --git a/src/engine/ingen_lv2.cpp b/src/engine/ingen_lv2.cpp index b259de11..f09540ed 100644 --- a/src/engine/ingen_lv2.cpp +++ b/src/engine/ingen_lv2.cpp @@ -41,7 +41,6 @@ #include "engine/ThreadManager.hpp" #include "ingen/EngineInterface.hpp" #include "module/World.hpp" -#include "module/ingen_module.hpp" #include "serialisation/Parser.hpp" #include "shared/Configuration.hpp" #include "shared/runtime_paths.hpp" @@ -258,9 +257,9 @@ ingen_instantiate(const LV2_Descriptor* descriptor, } IngenPlugin* plugin = (IngenPlugin*)malloc(sizeof(IngenPlugin)); - plugin->world = ingen_world_new(&lib.conf, lib.argc, lib.argv); + plugin->world = new World(&lib.conf, lib.argc, lib.argv); if (!plugin->world->load("ingen_serialisation")) { - ingen_world_free(plugin->world); + delete plugin->world; return NULL; } @@ -350,7 +349,7 @@ ingen_cleanup(LV2_Handle instance) IngenPlugin* me = (IngenPlugin*)instance; me->world->set_local_engine(SharedPtr<Ingen::Engine>()); me->world->set_engine(SharedPtr<Ingen::EngineInterface>()); - ingen_world_free(me->world); + delete me->world; free(instance); } @@ -387,9 +386,9 @@ Lib::Lib() Ingen::Shared::set_bundle_path_from_code((void*)&lv2_descriptor); - Ingen::Shared::World* world = ingen_world_new(&conf, argc, argv); + Ingen::Shared::World* world = new Ingen::Shared::World(&conf, argc, argv); if (!world->load("ingen_serialisation")) { - ingen_world_free(world); + delete world; return; } @@ -407,7 +406,7 @@ Lib::Lib() i->file_uri))); } - ingen_world_free(world); + delete world; } /** Library destructor (called on shared library unload) */ diff --git a/src/gui/ThreadedLoader.cpp b/src/gui/ThreadedLoader.cpp index c60d8c4c..e6618c51 100644 --- a/src/gui/ThreadedLoader.cpp +++ b/src/gui/ThreadedLoader.cpp @@ -19,7 +19,6 @@ #include "raul/log.hpp" #include "module/World.hpp" #include "module/Module.hpp" -#include "module/ingen_module.hpp" #include "serialisation/names.hpp" #include "App.hpp" #include "ThreadedLoader.hpp" diff --git a/src/ingen/main.cpp b/src/ingen/main.cpp index 3a27b46b..65d316b7 100644 --- a/src/ingen/main.cpp +++ b/src/ingen/main.cpp @@ -40,7 +40,6 @@ #include "engine/Engine.hpp" #include "ingen/EngineInterface.hpp" #include "module/World.hpp" -#include "module/ingen_module.hpp" #include "serialisation/Parser.hpp" #include "shared/Configuration.hpp" #include "shared/runtime_paths.hpp" @@ -60,7 +59,7 @@ ingen_interrupt(int) cout << "ingen: Interrupted" << endl; if (world->local_engine()) world->local_engine()->quit(); - ingen_world_free(world); + delete world; exit(EXIT_FAILURE); } @@ -69,7 +68,7 @@ ingen_try(bool cond, const char* msg) { if (!cond) { cerr << "ingen: Error: " << msg << endl; - ingen_world_free(world); + delete world; exit(EXIT_FAILURE); } } @@ -106,7 +105,7 @@ main(int argc, char** argv) g_type_init(); #endif - Ingen::Shared::World* world = ingen_world_new(&conf, argc, argv); + Ingen::Shared::World* world = new Ingen::Shared::World(&conf, argc, argv); #if INGEN_JACK_SESSION if (conf.option("uuid").get_string()) { @@ -225,7 +224,7 @@ main(int argc, char** argv) if (world->local_engine()) world->local_engine()->deactivate(); - ingen_world_free(world); + delete world; return 0; } diff --git a/src/module/World.cpp b/src/module/World.cpp index 48fe7753..6667cb9f 100644 --- a/src/module/World.cpp +++ b/src/module/World.cpp @@ -106,6 +106,8 @@ public: , uris(new Shared::LV2URIMap()) #ifdef HAVE_SLV2 , slv2_world(slv2_world_new()) +#else + , slv2_world(NULL) #endif { #ifdef HAVE_SLV2 @@ -140,10 +142,10 @@ public: interface_factories.clear(); script_runners.clear(); - #ifdef HAVE_SLV2 +#ifdef HAVE_SLV2 slv2_world_free(slv2_world); slv2_world = NULL; - #endif +#endif delete rdf_world; rdf_world = NULL; @@ -175,12 +177,8 @@ public: SharedPtr<Serialisation::Serialiser> serialiser; SharedPtr<Serialisation::Parser> parser; SharedPtr<Store> store; -#ifdef HAVE_SLV2 SLV2World slv2_world; -#endif -#ifdef INGEN_JACK_SESSION std::string jack_uuid; -#endif }; @@ -286,8 +284,6 @@ World::add_interface_factory(const std::string& scheme, InterfaceFactory factory } -#ifdef INGEN_JACK_SESSION - void World::set_jack_uuid(const std::string& uuid) { @@ -301,8 +297,6 @@ World::jack_uuid() return _impl->jack_uuid; } -#endif // INGEN_JACK_SESSION - } // namespace Shared } // namespace Ingen diff --git a/src/module/World.hpp b/src/module/World.hpp index dededc44..29d904b2 100644 --- a/src/module/World.hpp +++ b/src/module/World.hpp @@ -30,7 +30,6 @@ #include "raul/SharedPtr.hpp" #include "ingen-config.h" -#include "module/ingen_module.hpp" #ifdef HAVE_SLV2 typedef struct _SLV2World* SLV2World; @@ -64,6 +63,9 @@ class WorldImpl; */ class World : public boost::noncopyable { public: + World(Raul::Configuration* conf, int& argc, char**& argv); + virtual ~World(); + virtual bool load(const char* name); virtual void unload_all(); @@ -102,22 +104,12 @@ public: virtual LV2Features* lv2_features(); -#ifdef HAVE_SLV2 virtual SLV2World slv2_world(); -#endif -#ifdef INGEN_JACK_SESSION virtual void set_jack_uuid(const std::string& uuid); virtual std::string jack_uuid(); -#endif private: - friend Ingen::Shared::World* ::ingen_world_new(Raul::Configuration*, int&, char**&); - World(Raul::Configuration* conf, int& argc, char**& argv); - - friend void ::ingen_world_free(Ingen::Shared::World* world); - virtual ~World(); - WorldImpl* _impl; }; diff --git a/src/module/ingen_module.cpp b/src/module/ingen_module.cpp deleted file mode 100644 index 8bebeab4..00000000 --- a/src/module/ingen_module.cpp +++ /dev/null @@ -1,35 +0,0 @@ -/* This file is part of Ingen. - * Copyright (C) 2007-2009 David Robillard <http://drobilla.net> - * - * Ingen is free software; you can redistribute it and/or modify it under the - * terms of the GNU General Public License as published by the Free Software - * Foundation; either version 2 of the License, or (at your option) 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 General Public License for details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - */ - -#include "World.hpp" -#include "ingen_module.hpp" - -extern "C" { - -Ingen::Shared::World* -ingen_world_new(Raul::Configuration* conf, int& argc, char**& argv) -{ - return new Ingen::Shared::World(conf, argc, argv); -} - -void -ingen_world_free(Ingen::Shared::World* world) -{ - delete world; -} - -} // extern "C" diff --git a/src/module/ingen_module.hpp b/src/module/ingen_module.hpp deleted file mode 100644 index eff0d8ea..00000000 --- a/src/module/ingen_module.hpp +++ /dev/null @@ -1,33 +0,0 @@ -/* This file is part of Ingen. - * Copyright (C) 2007-2009 David Robillard <http://drobilla.net> - * - * Ingen is free software; you can redistribute it and/or modify it under the - * terms of the GNU General Public License as published by the Free Software - * Foundation; either version 2 of the License, or (at your option) 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 General Public License for details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - */ - -#ifndef INGEN_MODULE_HPP -#define INGEN_MODULE_HPP - -namespace Raul { class Configuration; } - -namespace Ingen { namespace Shared { class World; } } - -extern "C" { - -Ingen::Shared::World* ingen_world_new(Raul::Configuration* conf, int& argc, char**& argv); -void ingen_world_free(Ingen::Shared::World* world); - -} // extern "C" - -#endif // INGEN_MODULE_HPP - diff --git a/src/module/wscript b/src/module/wscript index c15f17b7..a904c806 100644 --- a/src/module/wscript +++ b/src/module/wscript @@ -8,7 +8,6 @@ def build(bld): obj = bld(features = 'cxx cxxshlib') obj.source = ''' World.cpp - ingen_module.cpp ''' obj.export_includes = ['.'] obj.includes = ['.', '..', '../..', '../../include'] diff --git a/src/shared/LV2Features.hpp b/src/shared/LV2Features.hpp index 386e4ea8..f47a53b3 100644 --- a/src/shared/LV2Features.hpp +++ b/src/shared/LV2Features.hpp @@ -41,7 +41,8 @@ public: class Feature { public: virtual ~Feature() {} - virtual SharedPtr<LV2_Feature> feature(Shared::World* world, Node* node) = 0; + virtual SharedPtr<LV2_Feature> feature(Shared::World* world, + Node* node) = 0; }; class FeatureArray { @@ -72,7 +73,8 @@ public: void add_feature(const std::string& uri, SharedPtr<Feature> feature); - SharedPtr<LV2Features::FeatureArray> lv2_features(Shared::World* world, Node* node) const; + SharedPtr<FeatureArray> lv2_features(Shared::World* world, + Node* node) const; private: typedef std::map< std::string, SharedPtr<Feature> > Features; |