diff options
Diffstat (limited to 'src/libs/module')
-rw-r--r-- | src/libs/module/Makefile.am | 22 | ||||
-rw-r--r-- | src/libs/module/Module.cpp | 90 | ||||
-rw-r--r-- | src/libs/module/Module.hpp | 35 | ||||
-rw-r--r-- | src/libs/module/World.hpp | 78 | ||||
-rw-r--r-- | src/libs/module/global.cpp | 74 | ||||
-rw-r--r-- | src/libs/module/global.hpp | 33 | ||||
-rw-r--r-- | src/libs/module/wscript | 17 |
7 files changed, 0 insertions, 349 deletions
diff --git a/src/libs/module/Makefile.am b/src/libs/module/Makefile.am deleted file mode 100644 index 84d499e4..00000000 --- a/src/libs/module/Makefile.am +++ /dev/null @@ -1,22 +0,0 @@ -noinst_LTLIBRARIES = libingen_module.la - -libingen_module_la_CXXFLAGS = \ - @INGEN_CFLAGS@ \ - @GLIBMM_CFLAGS@ \ - @REDLANDMM_CFLAGS@ \ - @RAUL_CFLAGS@ \ - @SLV2_CFLAGS@ \ - -DINGEN_MODULE_DIR=\"$(libdir)/ingen\" - -libingen_module_la_LIBADD = \ - @GLIBMM_LIBS@ \ - @REDLANDMM_LIBS@ \ - @RAUL_LIBS@ \ - @SLV2_LIBS@ - -libingen_module_la_SOURCES = \ - global.hpp \ - global.cpp \ - World.hpp \ - Module.hpp \ - Module.cpp diff --git a/src/libs/module/Module.cpp b/src/libs/module/Module.cpp deleted file mode 100644 index 8d1399b1..00000000 --- a/src/libs/module/Module.cpp +++ /dev/null @@ -1,90 +0,0 @@ -/* This file is part of Ingen. - * Copyright (C) 2007 Dave 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 <string> -#include <sstream> -#include <iostream> -#include <glibmm/module.h> -#include <glibmm/miscutils.h> -#include <glibmm/fileutils.h> -#include <raul/SharedPtr.hpp> - -#ifndef INGEN_MODULE_DIR -#error This file expects INGEN_MODULE_DIR to be defined. -#endif - -using namespace std; - -namespace Ingen { -namespace Shared { - - -/** Load a dynamic module from the default path. - * - * This will check in the directories specified in the environment variable - * 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" - */ -SharedPtr<Glib::Module> -load_module(const string& name) -{ - Glib::Module* module = NULL; - - // Search INGEN_MODULE_PATH first - bool module_path_found; - string module_path = Glib::getenv("INGEN_MODULE_PATH", module_path_found); - if (module_path_found) { - string dir; - istringstream iss(module_path); - while (getline(iss, dir, ':')) { - - string filename = Glib::Module::build_path(dir, name); - if (Glib::file_test(filename, Glib::FILE_TEST_EXISTS)) { - module = new Glib::Module(filename, Glib::MODULE_BIND_LAZY); - - if (*module) { - cerr << "Loaded module \"" << name << "\" from " << filename << endl; - return SharedPtr<Glib::Module>(module); - } else { - delete module; - cerr << Glib::Module::get_last_error() << endl; - } - } - } - } - - // Try default directory if not found - module = new Glib::Module( - Glib::Module::build_path(INGEN_MODULE_DIR, name), - Glib::MODULE_BIND_LAZY); - - if (*module) { - cerr << "Loaded module \"" << name << "\" from " << INGEN_MODULE_DIR << endl; - return SharedPtr<Glib::Module>(module); - } else { - cerr << "Unable to load module \"" << name << "\", is Ingen installed?" << endl - << "Use ./ingen.dev to run from the source tree." << endl; - return SharedPtr<Glib::Module>(); - } -} - - -} // namespace Shared -} // namespace Ingen - diff --git a/src/libs/module/Module.hpp b/src/libs/module/Module.hpp deleted file mode 100644 index 2d9ba382..00000000 --- a/src/libs/module/Module.hpp +++ /dev/null @@ -1,35 +0,0 @@ -/* This file is part of Ingen. - * Copyright (C) 2007 Dave 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 <string> -#include <glibmm/module.h> -#include <raul/SharedPtr.hpp> - -namespace Ingen { -namespace Shared { - - -/** Load a dynamic module from the default path. - * - * \param name The base name of the module, e.g. "ingen_serialisation" - */ -SharedPtr<Glib::Module> load_module(const std::string& name); - - -} // namespace Shared -} // namespace Ingen - diff --git a/src/libs/module/World.hpp b/src/libs/module/World.hpp deleted file mode 100644 index dbbac2bd..00000000 --- a/src/libs/module/World.hpp +++ /dev/null @@ -1,78 +0,0 @@ -/* This file is part of Ingen. - * Copyright (C) 2007 Dave 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_WORLD_HPP -#define INGEN_WORLD_HPP - -#include CONFIG_H_PATH - -#include <string> -#include <glibmm/module.h> -#include <raul/SharedPtr.hpp> -#include "shared/LV2Features.hpp" - -#ifdef HAVE_SLV2 -#include <slv2/slv2.h> -#endif - -namespace Redland { class World; } - -namespace Ingen { -class Engine; - -namespace Serialisation { class Serialiser; class Parser; } -using Serialisation::Serialiser; -using Serialisation::Parser; - -namespace Shared { -class EngineInterface; -class Store; - - -/** The "world" all Ingen modules may share. - * - * This is required for shared access to things like Redland, so locking can - * take place centrally and the engine/gui using the same library won't - * explode horribly. - * - * Hopefully at some point in the future it can allow some fun things like - * scripting bindings that play with all loaded components of - * The Ingen System(TM) and whatnot. - */ -struct World { -#ifdef HAVE_SLV2 - SLV2World slv2_world; - LV2Features* lv2_features; -#endif - - Redland::World* rdf_world; - - SharedPtr<EngineInterface> engine; - SharedPtr<Engine> local_engine; - SharedPtr<Serialiser> serialiser; - SharedPtr<Parser> parser; - SharedPtr<Store> store; - - SharedPtr<Glib::Module> serialisation_module; -}; - - -} // namespace Shared -} // namespace Ingen - -#endif // INGEN_WORLD_HPP - diff --git a/src/libs/module/global.cpp b/src/libs/module/global.cpp deleted file mode 100644 index c78f9fc3..00000000 --- a/src/libs/module/global.cpp +++ /dev/null @@ -1,74 +0,0 @@ -/* This file is part of Ingen. - * Copyright (C) 2007 Dave 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 <iostream> -#include <redlandmm/World.hpp> -#include "global.hpp" -#include "World.hpp" - -#include CONFIG_H_PATH -#ifdef HAVE_SLV2 -#include <slv2/slv2.h> -#endif - -using namespace std; - -namespace Ingen { -namespace Shared { - -static World* world = NULL; - - -World* -get_world() -{ - static World* world = NULL; - - if (!world) { - world = new 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(); - slv2_world_load_all(world->slv2_world); -#endif - world->engine.reset(); - world->local_engine.reset(); - } - - return world; -} - - -void -destroy_world() -{ - if (world) { -#ifdef HAVE_SLV2 - slv2_world_free(world->slv2_world); - delete world->lv2_features; -#endif - delete world->rdf_world; - delete world; - world = NULL; - } -} - - -} // namesace Shared -} // namespace Ingen - diff --git a/src/libs/module/global.hpp b/src/libs/module/global.hpp deleted file mode 100644 index 1aa46be6..00000000 --- a/src/libs/module/global.hpp +++ /dev/null @@ -1,33 +0,0 @@ -/* This file is part of Ingen. - * Copyright (C) 2007 Dave 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_GLOBAL_H -#define INGEN_GLOBAL_H - -namespace Ingen { -namespace Shared { - -class World; - -World* get_world(); -void destroy_world(); - -} // namesace Shared -} // namespace Ingen - -#endif // INGEN_GLOBAL_H - diff --git a/src/libs/module/wscript b/src/libs/module/wscript deleted file mode 100644 index e202342d..00000000 --- a/src/libs/module/wscript +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env python -import Params - -def build(bld): - dir = Params.g_options.moduledir or bld.env()['PREFIX'] + 'lib/ingen' - obj = bld.create_obj('cpp', 'shlib') - obj.source = ''' - Module.cpp - global.cpp - ''' - obj.includes = ['..', '../../common', '../..'] - obj.defines = 'INGEN_MODULE_DIR=\\\"' + dir + '\\\"' - obj.name = 'libingen_module' - obj.target = 'ingen_module' - obj.uselib = 'GLIBMM SLV2 RAUL REDLANDMM' - obj.vnum = '0.0.0' - |