summaryrefslogtreecommitdiffstats
path: root/src/libs/gui
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2008-08-19 02:33:04 +0000
committerDavid Robillard <d@drobilla.net>2008-08-19 02:33:04 +0000
commit14764da12f3808da0c40b643ac8224716f060729 (patch)
treedfb40da4d1a0c23c05923e78319aa95f172f9e57 /src/libs/gui
parent353944ee388081b5fa280847fb202a4f27c81735 (diff)
downloadingen-14764da12f3808da0c40b643ac8224716f060729.tar.gz
ingen-14764da12f3808da0c40b643ac8224716f060729.tar.bz2
ingen-14764da12f3808da0c40b643ac8224716f060729.zip
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
Diffstat (limited to 'src/libs/gui')
-rw-r--r--src/libs/gui/App.cpp5
-rw-r--r--src/libs/gui/App.hpp8
-rw-r--r--src/libs/gui/ConnectWindow.cpp27
3 files changed, 18 insertions, 22 deletions
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<SigClientInterface> client)
+App::attach(SharedPtr<SigClientInterface> client,
+ SharedPtr<Raul::Deletable> handle)
{
assert( ! _client);
assert( ! _store);
@@ -151,6 +152,7 @@ App::attach(SharedPtr<SigClientInterface> client)
_world->engine->register_client(client.get());
_client = client;
+ _handle = handle;
_store = SharedPtr<ClientStore>(new ClientStore(_world->engine, client));
_loader = SharedPtr<ThreadedLoader>(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<SigClientInterface> client);
+ void attach(SharedPtr<SigClientInterface> client,
+ SharedPtr<Raul::Deletable> handle=SharedPtr<Raul::Deletable>());
+
void detach();
bool gtk_main_iteration();
@@ -106,7 +109,7 @@ public:
Glib::RefPtr<Gdk::Pixbuf> icon_from_path(const string& path, int size);
- const SharedPtr<EngineInterface> engine() const { return _world->engine; }
+ const SharedPtr<EngineInterface>& engine() const { return _world->engine; }
const SharedPtr<SigClientInterface>& client() const { return _client; }
const SharedPtr<ClientStore>& store() const { return _store; }
const SharedPtr<ThreadedLoader>& loader() const { return _loader; }
@@ -143,6 +146,7 @@ protected:
static App* _instance;
SharedPtr<SigClientInterface> _client;
+ SharedPtr<Raul::Deletable> _handle;
SharedPtr<ClientStore> _store;
SharedPtr<Serialiser> _serialiser;
SharedPtr<ThreadedLoader> _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<EngineInterface>(new OSCEngineSender(url));
}
- OSCSigEmitter* ose = new OSCSigEmitter(1024, 16181); // FIXME: args
- SharedPtr<ThreadedSigClientInterface> client(ose);
- App::instance().attach(client);
+ // FIXME: static args
+ SharedPtr<ThreadedSigClientInterface> tsci(new ThreadedSigClientInterface(1024));
+ SharedPtr<OSCClientReceiver> 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<EngineInterface>(
new OSCEngineSender(string("osc.udp://localhost:").append(port_str)));
- OSCSigEmitter* ose = new OSCSigEmitter(1024, 16181); // FIXME: args
- SharedPtr<ThreadedSigClientInterface> client(ose);
- App::instance().attach(client);
+ // FIXME: static args
+ SharedPtr<ThreadedSigClientInterface> tsci(new ThreadedSigClientInterface(1024));
+ SharedPtr<OSCClientReceiver> 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);