diff options
Diffstat (limited to 'src/progs/patch_loader/patch_loader.cpp')
-rw-r--r-- | src/progs/patch_loader/patch_loader.cpp | 36 |
1 files changed, 29 insertions, 7 deletions
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("/"), ""); } |