From 012890277d8c3124bc8dd1df20b8e016c8d6d811 Mon Sep 17 00:00:00 2001 From: David Robillard Date: Tue, 31 Jul 2007 16:24:31 +0000 Subject: SWIG building fixes. Applied patch from silverblade to fix Raul Process cmd line parameters. Fixed launching internal engine from Connect dialog. Fix nasty crashes caused by overly hasty last commit. git-svn-id: http://svn.drobilla.net/lad/ingen@662 a436a847-0d15-0410-975c-d299462d15a1 --- src/bindings/Makefile.am | 10 ++++++---- src/libs/gui/App.cpp | 2 +- src/libs/gui/App.hpp | 4 ++-- src/libs/gui/ConnectWindow.cpp | 34 ++++++++++++++++++++++++---------- src/libs/gui/ConnectWindow.hpp | 2 ++ src/libs/gui/LoadRemotePatchWindow.cpp | 6 +++--- src/libs/gui/PatchCanvas.cpp | 2 +- src/libs/gui/ThreadedLoader.cpp | 4 ++-- src/libs/gui/UploadPatchWindow.cpp | 2 +- src/libs/module/module.cpp | 2 +- 10 files changed, 43 insertions(+), 25 deletions(-) (limited to 'src') diff --git a/src/bindings/Makefile.am b/src/bindings/Makefile.am index 8935eebb..083cb5a6 100644 --- a/src/bindings/Makefile.am +++ b/src/bindings/Makefile.am @@ -14,15 +14,17 @@ libingen_bindings_la_SOURCES = ingen_wrap.cxx swig: ingen.i swig -c++ -Wall $(FLAGS) -python ingen.i +ingen_wrap.cxx: swig + libingen_bindings_la: swig ingen_wrap.cxx -all-local: +all-local: swig ln -sf .libs/libingen_bindings.so _ingen.so #libtool --mode=compile g++ -fPIC -shared $(CXXFLAGS) $(FLAGS) $(LIBS) -I/usr/include/python2.4 ingen_wrap.cxx -o libingen_python.so.0.0.0 endif clean-local: - rm *.cxx - rm *.so - rm *.o + rm -f *.cxx + rm -f *.so + rm -f *.o diff --git a/src/libs/gui/App.cpp b/src/libs/gui/App.cpp index d2407c9f..add26d8c 100644 --- a/src/libs/gui/App.cpp +++ b/src/libs/gui/App.cpp @@ -78,7 +78,7 @@ App::App(Ingen::Shared::World* world) glade_xml->get_widget_derived("config_win", _config_window); glade_xml->get_widget("about_win", _about_dialog); - Raul::RDF::World& rdf_world = world->rdf_world; + Raul::RDF::World& rdf_world = *world->rdf_world; rdf_world.add_prefix("xsd", "http://www.w3.org/2001/XMLSchema#"); rdf_world.add_prefix("ingen", "http://drobilla.net/ns/ingen#"); diff --git a/src/libs/gui/App.hpp b/src/libs/gui/App.hpp index 4ef36718..fd90426b 100644 --- a/src/libs/gui/App.hpp +++ b/src/libs/gui/App.hpp @@ -114,8 +114,8 @@ protected: SharedPtr _engine; SharedPtr _client; - SharedPtr _store; - SharedPtr _loader; + SharedPtr _store; + SharedPtr _loader; Configuration* _configuration; diff --git a/src/libs/gui/ConnectWindow.cpp b/src/libs/gui/ConnectWindow.cpp index 703d784e..a1c89c88 100644 --- a/src/libs/gui/ConnectWindow.cpp +++ b/src/libs/gui/ConnectWindow.cpp @@ -100,6 +100,8 @@ ConnectWindow::ConnectWindow(BaseObjectType* cobject, const Glib::RefPtr engine) } else { _icon->set(Gtk::Stock::DISCONNECT, Gtk::ICON_SIZE_LARGE_TOOLBAR); _progress_bar->set_fraction(0.0); - _url_entry->set_sensitive(true); _connect_button->set_sensitive(true); _disconnect_button->set_sensitive(false); - _port_spinbutton->set_sensitive(false); - _launch_radio->set_sensitive(true); + if (_new_engine) _internal_radio->set_sensitive(true); else _internal_radio->set_sensitive(false); - server_toggled(); + + _server_radio->set_sensitive(true); + _launch_radio->set_sensitive(true); + + if ( _mode == CONNECT_REMOTE ) + _url_entry->set_sensitive(true); + else if ( _mode == LAUNCH_REMOTE ) + _port_spinbutton->set_sensitive(true); _progress_label->set_text(string("Disconnected")); } @@ -186,6 +193,13 @@ ConnectWindow::connect() _disconnect_button->set_label("gtk-cancel"); _disconnect_button->set_sensitive(true); + // Avoid user messing with our parameters whilst we're trying to connect. + _server_radio->set_sensitive(false); + _launch_radio->set_sensitive(false); + _internal_radio->set_sensitive(false); + _url_entry->set_sensitive(false); + _port_spinbutton->set_sensitive(false); + _connect_stage = 0; if (_mode == CONNECT_REMOTE) { @@ -207,7 +221,7 @@ ConnectWindow::connect() int port = _port_spinbutton->get_value_as_int(); char port_str[6]; snprintf(port_str, 6, "%u", port); - const string cmd = string("ingen --port=").append(port_str); + const string cmd = string("ingen -e --engine-port=").append(port_str); if (Raul::Process::launch(cmd)) { SharedPtr engine( @@ -229,11 +243,11 @@ ConnectWindow::connect() } else if (_mode == INTERNAL) { assert(_new_engine); - SharedPtr engine(_new_engine(App::instance().world())); + _engine = SharedPtr(_new_engine(App::instance().world())); - engine->start_jack_driver(); + _engine->start_jack_driver(); - SharedPtr engine_interface = engine->new_queued_interface(); + SharedPtr engine_interface = _engine->new_queued_interface(); ThreadedSigClientInterface* tsci = new ThreadedSigClientInterface(Ingen::event_queue_size); SharedPtr client(tsci); @@ -242,10 +256,10 @@ ConnectWindow::connect() engine_interface->set_responder(SharedPtr(new Ingen::DirectResponder(client, 1))); - engine->activate(); + _engine->activate(); Glib::signal_timeout().connect( - sigc::mem_fun(engine.get(), &Ingen::Engine::main_iteration), 1000); + sigc::mem_fun(_engine.get(), &Ingen::Engine::main_iteration), 1000); Glib::signal_timeout().connect( sigc::mem_fun(this, &ConnectWindow::gtk_callback), 100); diff --git a/src/libs/gui/ConnectWindow.hpp b/src/libs/gui/ConnectWindow.hpp index 2ea86f0a..f8cd8db8 100644 --- a/src/libs/gui/ConnectWindow.hpp +++ b/src/libs/gui/ConnectWindow.hpp @@ -78,6 +78,8 @@ private: SharedPtr _engine_module; Ingen::Engine* (*_new_engine)(Ingen::Shared::World* world); + SharedPtr _engine; + Gtk::Image* _icon; Gtk::ProgressBar* _progress_bar; Gtk::Label* _progress_label; diff --git a/src/libs/gui/LoadRemotePatchWindow.cpp b/src/libs/gui/LoadRemotePatchWindow.cpp index 276a0485..b5caf351 100644 --- a/src/libs/gui/LoadRemotePatchWindow.cpp +++ b/src/libs/gui/LoadRemotePatchWindow.cpp @@ -66,17 +66,17 @@ LoadRemotePatchWindow::present(SharedPtr patch, MetadataMap data) set_patch(patch); _initial_data = data; - RDF::Model model(App::instance().world()->rdf_world, + RDF::Model model(*App::instance().world()->rdf_world, "http://rdf.drobilla.net/ingen_patches/index.ttl", "http://rdf.drobilla.net/ingen_patches/"); - RDF::Query query(App::instance().world()->rdf_world, Glib::ustring( + RDF::Query query(*App::instance().world()->rdf_world, Glib::ustring( "SELECT DISTINCT ?name ?uri WHERE {" " ?uri a ingen:Patch ;" " doap:name ?name ." "}")); - RDF::Query::Results results = query.run(App::instance().world()->rdf_world, model); + RDF::Query::Results results = query.run(*App::instance().world()->rdf_world, model); for (RDF::Query::Results::iterator i = results.begin(); i != results.end(); ++i) { Gtk::TreeModel::iterator iter = _liststore->append(); diff --git a/src/libs/gui/PatchCanvas.cpp b/src/libs/gui/PatchCanvas.cpp index 0e591445..3f2423c0 100644 --- a/src/libs/gui/PatchCanvas.cpp +++ b/src/libs/gui/PatchCanvas.cpp @@ -453,7 +453,7 @@ PatchCanvas::destroy_selection() void PatchCanvas::copy_selection() { - Serializer serializer(App::instance().world()->rdf_world); + Serializer serializer(*App::instance().world()->rdf_world); serializer.start_to_string(); for (list >::iterator m = _selected_items.begin(); m != _selected_items.end(); ++m) { diff --git a/src/libs/gui/ThreadedLoader.cpp b/src/libs/gui/ThreadedLoader.cpp index 630303b6..22b0a8d9 100644 --- a/src/libs/gui/ThreadedLoader.cpp +++ b/src/libs/gui/ThreadedLoader.cpp @@ -32,7 +32,7 @@ ThreadedLoader::ThreadedLoader(SharedPtr engine) : _serialisation_module(Ingen::Shared::load_module("ingen_serialisation")) , _engine(engine) , _deprecated_loader(engine) - , _serializer(App::instance().world()->rdf_world) + , _serializer(*App::instance().world()->rdf_world) { set_name("Loader"); @@ -97,7 +97,7 @@ ThreadedLoader::load_patch(bool merge, _events.push_back(sigc::hide_return(sigc::bind( sigc::mem_fun(_loader.get(), &Ingen::Serialisation::Loader::load), App::instance().engine(), - &App::instance().world()->rdf_world, + App::instance().world()->rdf_world, data_base_uri, engine_parent, (engine_name) ? engine_name.get() : "", diff --git a/src/libs/gui/UploadPatchWindow.cpp b/src/libs/gui/UploadPatchWindow.cpp index aec4d8e6..0aaddde8 100644 --- a/src/libs/gui/UploadPatchWindow.cpp +++ b/src/libs/gui/UploadPatchWindow.cpp @@ -248,7 +248,7 @@ UploadPatchWindow::upload_clicked() _upload_progress->set_fraction(0.0); _upload_progress->set_text(""); - Serializer s(App::instance().world()->rdf_world); + Serializer s(*App::instance().world()->rdf_world); s.start_to_string(); s.serialize(_patch); const string str = s.finish(); diff --git a/src/libs/module/module.cpp b/src/libs/module/module.cpp index 4e342670..68ddc2b5 100644 --- a/src/libs/module/module.cpp +++ b/src/libs/module/module.cpp @@ -26,7 +26,7 @@ namespace Ingen { namespace Shared { -World* world; +World* world = NULL; World* get_world() -- cgit v1.2.1