From 92ebdc5a6aa5c779821374c240a47e01718807a3 Mon Sep 17 00:00:00 2001 From: David Robillard Date: Sun, 3 Feb 2013 16:30:35 +0000 Subject: Fix compilation with GCC 4.6. git-svn-id: http://svn.drobilla.net/lad/trunk/ingen@5038 a436a847-0d15-0410-975c-d299462d15a1 --- src/gui/ingen_gui.cpp | 18 ++++++++++++------ src/gui/ingen_gui_lv2.cpp | 46 +++++++++++++++++++++++++--------------------- 2 files changed, 37 insertions(+), 27 deletions(-) (limited to 'src/gui') diff --git a/src/gui/ingen_gui.cpp b/src/gui/ingen_gui.cpp index 999b2431..d8dc59ab 100644 --- a/src/gui/ingen_gui.cpp +++ b/src/gui/ingen_gui.cpp @@ -17,23 +17,29 @@ #include "ingen/Module.hpp" #include "App.hpp" -struct IngenGUIModule : public Ingen::Module { - void load(Ingen::World* world) { - app = Ingen::GUI::App::create(world); +namespace Ingen { +namespace GUI { + +struct GUIModule : public Module { + void load(World* world) { + app = GUI::App::create(world); } - void run(Ingen::World* world) { + void run(World* world) { app->run(); } - Ingen::SPtr app; + SPtr app; }; +} // namespace GUI +} // namespace Ingen + extern "C" { Ingen::Module* ingen_module_load() { - return new IngenGUIModule(); + return new Ingen::GUI::GUIModule(); } } // extern "C" diff --git a/src/gui/ingen_gui_lv2.cpp b/src/gui/ingen_gui_lv2.cpp index d95ea82f..8f258e99 100644 --- a/src/gui/ingen_gui_lv2.cpp +++ b/src/gui/ingen_gui_lv2.cpp @@ -30,9 +30,11 @@ #define INGEN_LV2_UI_URI "http://drobilla.net/ns/ingen#GraphUIGtk2" +namespace Ingen { + /** A sink that writes atoms to a port via the UI extension. */ -struct IngenLV2AtomSink : public Ingen::AtomSink { - IngenLV2AtomSink(Ingen::URIs& uris, +struct IngenLV2AtomSink : public AtomSink { + IngenLV2AtomSink(URIs& uris, LV2UI_Write_Function ui_write, LV2UI_Controller ui_controller) : _uris(uris) @@ -49,7 +51,7 @@ struct IngenLV2AtomSink : public Ingen::AtomSink { return true; } - Ingen::URIs& _uris; + URIs& _uris; LV2UI_Write_Function _ui_write; LV2UI_Controller _ui_controller; }; @@ -63,18 +65,20 @@ struct IngenLV2UI { , sink(NULL) {} - int argc; - char** argv; - Ingen::Forge* forge; - Ingen::World* world; - IngenLV2AtomSink* sink; - Ingen::SPtr app; - Ingen::SPtr view; - Ingen::SPtr engine; - Ingen::SPtr reader; - Ingen::SPtr client; + int argc; + char** argv; + Forge* forge; + World* world; + IngenLV2AtomSink* sink; + SPtr app; + SPtr view; + SPtr engine; + SPtr reader; + SPtr client; }; +} // namespace Ingen + static LV2UI_Handle instantiate(const LV2UI_Descriptor* descriptor, const char* plugin_uri, @@ -86,7 +90,7 @@ instantiate(const LV2UI_Descriptor* descriptor, { Ingen::set_bundle_path(bundle_path); - IngenLV2UI* ui = new IngenLV2UI(); + Ingen::IngenLV2UI* ui = new Ingen::IngenLV2UI(); LV2_URID_Map* map = NULL; LV2_URID_Unmap* unmap = NULL; @@ -110,11 +114,11 @@ instantiate(const LV2UI_Descriptor* descriptor, return NULL; } - ui->sink = new IngenLV2AtomSink( + ui->sink = new Ingen::IngenLV2AtomSink( ui->world->uris(), write_function, controller); // Set up an engine interface that writes LV2 atoms - ui->engine = Ingen::SPtr( + ui->engine = SPtr( new Ingen::AtomWriter( ui->world->uri_map(), ui->world->uris(), *ui->sink)); @@ -122,11 +126,11 @@ instantiate(const LV2UI_Descriptor* descriptor, // Create App and client ui->app = Ingen::GUI::App::create(ui->world); - ui->client = Ingen::SPtr( + ui->client = SPtr( new Ingen::Client::SigClientInterface()); ui->app->attach(ui->client); - ui->reader = Ingen::SPtr( + ui->reader = SPtr( new Ingen::AtomReader(ui->world->uri_map(), ui->world->uris(), ui->world->log(), @@ -141,7 +145,7 @@ instantiate(const LV2UI_Descriptor* descriptor, ui->app->store()->put(Ingen::Node::root_uri(), props); // Create a GraphBox for the root and set as the UI widget - Ingen::SPtr root = + SPtr root = Ingen::dynamic_ptr_cast( ui->app->store()->object(Raul::Path("/"))); ui->view = Ingen::GUI::GraphBox::create(*ui->app, root); @@ -157,7 +161,7 @@ instantiate(const LV2UI_Descriptor* descriptor, static void cleanup(LV2UI_Handle handle) { - IngenLV2UI* ui = (IngenLV2UI*)handle; + Ingen::IngenLV2UI* ui = (Ingen::IngenLV2UI*)handle; delete ui; } @@ -168,7 +172,7 @@ port_event(LV2UI_Handle handle, uint32_t format, const void* buffer) { - IngenLV2UI* ui = (IngenLV2UI*)handle; + Ingen::IngenLV2UI* ui = (Ingen::IngenLV2UI*)handle; const LV2_Atom* atom = (const LV2_Atom*)buffer; ui->reader->write(atom); } -- cgit v1.2.1