From ec9540a559c40046123a2ac4be83faf90b79fbb0 Mon Sep 17 00:00:00 2001 From: David Robillard Date: Mon, 8 Oct 2007 17:13:34 +0000 Subject: Dynamically load Serialiser from serialisation module, make it actually work, etc. git-svn-id: http://svn.drobilla.net/lad/ingen@850 a436a847-0d15-0410-975c-d299462d15a1 --- src/libs/gui/App.cpp | 25 ++++++++++++++++++++----- 1 file changed, 20 insertions(+), 5 deletions(-) (limited to 'src/libs/gui/App.cpp') diff --git a/src/libs/gui/App.cpp b/src/libs/gui/App.cpp index 255af745..ef81b0cc 100644 --- a/src/libs/gui/App.cpp +++ b/src/libs/gui/App.cpp @@ -65,12 +65,27 @@ App* App::_instance = 0; App::App(Ingen::Shared::World* world) -: _configuration(new Configuration()), - _about_dialog(NULL), - _window_factory(new WindowFactory()), - _world(world), - _enable_signal(true) + : _serialisation_module(Ingen::Shared::load_module("ingen_serialisation")) + , _configuration(new Configuration()) + , _about_dialog(NULL) + , _window_factory(new WindowFactory()) + , _world(world) + , _enable_signal(true) { + if (_serialisation_module) { + Serialiser* (*new_serialiser)(Ingen::Shared::World*) = NULL; + + bool found = _serialisation_module->get_symbol("new_serialiser", (void*&)new_serialiser); + + if (found) + _serialiser = SharedPtr(new_serialiser(world)); + } + + if ( ! _serialiser) { + cerr << "WARNING: Failed to load ingen_serialisation module, save disabled." << endl; + cerr << "(If you are running from the source tree, source set_dev_environment.sh)" << endl; + } + Glib::RefPtr glade_xml = GladeFactory::new_glade_reference(); glade_xml->get_widget_derived("connect_win", _connect_window); -- cgit v1.2.1