diff options
Diffstat (limited to 'src/progs/patch_loader')
-rw-r--r-- | src/progs/patch_loader/Makefile.am | 6 | ||||
-rw-r--r-- | src/progs/patch_loader/new_patch_loader.cpp | 2 | ||||
-rw-r--r-- | src/progs/patch_loader/patch_loader.cpp | 36 |
3 files changed, 33 insertions, 11 deletions
diff --git a/src/progs/patch_loader/Makefile.am b/src/progs/patch_loader/Makefile.am index 9913411a..f16cc495 100644 --- a/src/progs/patch_loader/Makefile.am +++ b/src/progs/patch_loader/Makefile.am @@ -1,11 +1,11 @@ EXTRA_DIST = README -ingen_load_CXXFLAGS = -I$(top_srcdir)/src/libs/client -I$(top_srcdir)/src/common @LSIGCPP_CFLAGS@ @RAUL_CFLAGS@ @GLIBMM_CFLAGS@ @RASQAL_CFLAGS@ -ingen_load_LDADD = ../../libs/client/libingenclient.la @RAUL_LIBS@ @LSIGCPP_LIBS@ @GLIBMM_LIBS@ @RASQAL_LIBS@ +ingen_load_CXXFLAGS = -I$(top_srcdir)/src/libs -I$(top_srcdir)/src/common @LSIGCPP_CFLAGS@ @RAUL_CFLAGS@ @GLIBMM_CFLAGS@ @RASQAL_CFLAGS@ -DINGEN_MODULE_DIR=\"$(libdir)/ingen\" +ingen_load_LDADD = ../../libs/client/libingen_client.la ../../libs/module/libingen_module.la @RAUL_LIBS@ @LSIGCPP_LIBS@ @GLIBMM_LIBS@ @RASQAL_LIBS@ bin_PROGRAMS = ingen_load -#ingen_load_DEPENDENCIES = ../../libs/client/libingenclient.la +#ingen_load_DEPENDENCIES = ../../libs/client/libingen_client.la ingen_load_SOURCES = \ patch_loader.cpp \ diff --git a/src/progs/patch_loader/new_patch_loader.cpp b/src/progs/patch_loader/new_patch_loader.cpp index 6c879f43..cee48827 100644 --- a/src/progs/patch_loader/new_patch_loader.cpp +++ b/src/progs/patch_loader/new_patch_loader.cpp @@ -17,8 +17,8 @@ #include <iostream> #include <unistd.h> +#include <raul/Path.h> #include "cmdline.h" // generated by gengetopt -#include "raul/Path.h" #include "OSCEngineInterface.h" #include "PatchLibrarian.h" diff --git a/src/progs/patch_loader/patch_loader.cpp b/src/progs/patch_loader/patch_loader.cpp index cc3c1903..57bba0e0 100644 --- a/src/progs/patch_loader/patch_loader.cpp +++ b/src/progs/patch_loader/patch_loader.cpp @@ -17,16 +17,20 @@ #include <iostream> #include <unistd.h> +#include <glibmm/module.h> #include <raul/Path.h> #include <raul/RDFWorld.h> -#include "OSCModelEngineInterface.h" -#include "Loader.h" -#include "PatchModel.h" +#include "client/OSCEngineSender.h" +#include "client/PatchModel.h" +#include "module/Module.h" +#include "serialisation/serialisation.h" +#include "serialisation/Loader.h" #include "cmdline.h" // generated by gengetopt -using std::cout; using std::endl; - +using namespace std; using namespace Ingen::Client; +using namespace Ingen::Serialisation; + int main(int argc, char** argv) { @@ -60,7 +64,7 @@ int main(int argc, char** argv) rdf_world.add_prefix("rdfs", "http://www.w3.org/2000/01/rdf-schema#"); rdf_world.add_prefix("doap", "http://usefulinc.com/ns/doap#"); - SharedPtr<OSCModelEngineInterface> engine(new OSCModelEngineInterface(engine_url)); + SharedPtr<OSCEngineSender> engine(new OSCEngineSender(engine_url)); /* Connect to engine */ engine->attach(-1, client_port); @@ -76,11 +80,29 @@ int main(int argc, char** argv) * engine->wait_for_response(); */ + SharedPtr<Glib::Module> module = Ingen::Shared::load_module("ingen_serialisation"); + + if (!module) { + cerr << "Unable to load ingen_serialisation module, exiting." << endl; + return -1; + } + + Loader* (*new_loader)() = NULL; + + bool found = module->get_symbol("new_loader", (void*&)new_loader); + + if (!found) { + cerr << "Unable to find module entry point, exiting." << endl; + return -1; + } + + SharedPtr<Loader> loader(new_loader()); + // Load patches for (uint i=0; i < args_info.inputs_num; ++i) { cerr << "FIXME: load patch under root" << endl; cerr << "Load " << args_info.inputs[i] << endl; - Ingen::Serialisation::load(engine, &rdf_world, + loader->load(engine, &rdf_world, string("file:") + args_info.inputs[i], Path("/"), ""); } |