From 14764da12f3808da0c40b643ac8224716f060729 Mon Sep 17 00:00:00 2001 From: David Robillard Date: Tue, 19 Aug 2008 02:33:04 +0000 Subject: Remove weird virtual inheritance interface overlay thing from client in favour of wrappers. git-svn-id: http://svn.drobilla.net/lad/ingen@1445 a436a847-0d15-0410-975c-d299462d15a1 --- src/libs/gui/App.cpp | 5 ++++- src/libs/gui/App.hpp | 8 ++++++-- src/libs/gui/ConnectWindow.cpp | 27 ++++++++------------------- 3 files changed, 18 insertions(+), 22 deletions(-) (limited to 'src/libs/gui') diff --git a/src/libs/gui/App.cpp b/src/libs/gui/App.cpp index 408b7503..64a89f8a 100644 --- a/src/libs/gui/App.cpp +++ b/src/libs/gui/App.cpp @@ -142,7 +142,8 @@ App::run(int argc, char** argv, Ingen::Shared::World* world) void -App::attach(SharedPtr client) +App::attach(SharedPtr client, + SharedPtr handle) { assert( ! _client); assert( ! _store); @@ -151,6 +152,7 @@ App::attach(SharedPtr client) _world->engine->register_client(client.get()); _client = client; + _handle = handle; _store = SharedPtr(new ClientStore(_world->engine, client)); _loader = SharedPtr(new ThreadedLoader(_world->engine)); @@ -171,6 +173,7 @@ App::detach() _loader.reset(); _store.reset(); _client.reset(); + _handle.reset(); _world->engine.reset(); } } diff --git a/src/libs/gui/App.hpp b/src/libs/gui/App.hpp index d4caef21..8d16a1c4 100644 --- a/src/libs/gui/App.hpp +++ b/src/libs/gui/App.hpp @@ -37,6 +37,7 @@ namespace Ingen { class Engine; namespace Shared { class EngineInterface; + class ClientInterface; class World; } namespace Client { @@ -85,7 +86,9 @@ public: void error_message(const string& msg); - void attach(SharedPtr client); + void attach(SharedPtr client, + SharedPtr handle=SharedPtr()); + void detach(); bool gtk_main_iteration(); @@ -106,7 +109,7 @@ public: Glib::RefPtr icon_from_path(const string& path, int size); - const SharedPtr engine() const { return _world->engine; } + const SharedPtr& engine() const { return _world->engine; } const SharedPtr& client() const { return _client; } const SharedPtr& store() const { return _store; } const SharedPtr& loader() const { return _loader; } @@ -143,6 +146,7 @@ protected: static App* _instance; SharedPtr _client; + SharedPtr _handle; SharedPtr _store; SharedPtr _serialiser; SharedPtr _loader; diff --git a/src/libs/gui/ConnectWindow.cpp b/src/libs/gui/ConnectWindow.cpp index f1b0912a..03f8408a 100644 --- a/src/libs/gui/ConnectWindow.cpp +++ b/src/libs/gui/ConnectWindow.cpp @@ -44,19 +44,6 @@ namespace Ingen { namespace GUI { -// Paste together some interfaces to get the combination we want - - -struct OSCSigEmitter : public OSCClientReceiver, public ThreadedSigClientInterface { - OSCSigEmitter(size_t queue_size, int listen_port) - : Ingen::Shared::ClientInterface() - , OSCClientReceiver(listen_port) - , ThreadedSigClientInterface(queue_size) - { - } -}; - - // ConnectWindow @@ -170,9 +157,10 @@ ConnectWindow::connect(bool existing) world->engine = SharedPtr(new OSCEngineSender(url)); } - OSCSigEmitter* ose = new OSCSigEmitter(1024, 16181); // FIXME: args - SharedPtr client(ose); - App::instance().attach(client); + // FIXME: static args + SharedPtr tsci(new ThreadedSigClientInterface(1024)); + SharedPtr client(new OSCClientReceiver(16181, tsci)); + App::instance().attach(tsci, client); Glib::signal_timeout().connect( sigc::mem_fun(App::instance(), &App::gtk_main_iteration), 40, G_PRIORITY_DEFAULT); @@ -191,9 +179,10 @@ ConnectWindow::connect(bool existing) world->engine = SharedPtr( new OSCEngineSender(string("osc.udp://localhost:").append(port_str))); - OSCSigEmitter* ose = new OSCSigEmitter(1024, 16181); // FIXME: args - SharedPtr client(ose); - App::instance().attach(client); + // FIXME: static args + SharedPtr tsci(new ThreadedSigClientInterface(1024)); + SharedPtr client(new OSCClientReceiver(16181, tsci)); + App::instance().attach(tsci, client); Glib::signal_timeout().connect( sigc::mem_fun(App::instance(), &App::gtk_main_iteration), 40, G_PRIORITY_DEFAULT); -- cgit v1.2.1