summaryrefslogtreecommitdiffstats
path: root/src/gui
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2016-09-18 04:42:31 -0400
committerDavid Robillard <d@drobilla.net>2016-09-18 04:42:31 -0400
commitce6dc3d549bc58515d5d55db1d0a009a92887f3c (patch)
tree2cde2929903e30ec6272a79bd0877dd435aa83c2 /src/gui
parent758543f6dbb56755d3239c0ed68f1083384f0e96 (diff)
downloadingen-ce6dc3d549bc58515d5d55db1d0a009a92887f3c.tar.gz
ingen-ce6dc3d549bc58515d5d55db1d0a009a92887f3c.tar.bz2
ingen-ce6dc3d549bc58515d5d55db1d0a009a92887f3c.zip
Add fancy communication logging
Diffstat (limited to 'src/gui')
-rw-r--r--src/gui/App.cpp24
-rw-r--r--src/gui/App.hpp2
2 files changed, 26 insertions, 0 deletions
diff --git a/src/gui/App.cpp b/src/gui/App.cpp
index fad2f195..c023fe8c 100644
--- a/src/gui/App.cpp
+++ b/src/gui/App.cpp
@@ -27,6 +27,7 @@
#include "ingen/EngineBase.hpp"
#include "ingen/Interface.hpp"
#include "ingen/Log.hpp"
+#include "ingen/StreamWriter.hpp"
#include "ingen/World.hpp"
#include "ingen/client/ClientStore.hpp"
#include "ingen/client/GraphModel.hpp"
@@ -163,6 +164,29 @@ App::attach(SPtr<SigClientInterface> client)
_world->set_store(_store);
}
+ if (_world->conf().option("dump").get<int32_t>()) {
+ _dumper = SPtr<StreamWriter>(new StreamWriter(_world->uri_map(),
+ _world->uris(),
+ Raul::URI("ingen:/client"),
+ stderr,
+ ColorContext::Color::CYAN));
+
+#define DUMP_CONNECT(signal, method) \
+ client->signal_##signal().connect( \
+ sigc::mem_fun(*_dumper.get(), &StreamWriter::method));
+
+ DUMP_CONNECT(object_deleted, del);
+ DUMP_CONNECT(object_moved, move);
+ DUMP_CONNECT(put, put);
+ DUMP_CONNECT(delta, delta);
+ DUMP_CONNECT(connection, connect);
+ DUMP_CONNECT(disconnection, disconnect);
+ DUMP_CONNECT(disconnect_all, disconnect_all);
+ DUMP_CONNECT(property_change, set_property);
+
+#undef DUMP_CONNECT
+ }
+
_graph_tree_window->init(*this, *_store);
_client->signal_response().connect(
diff --git a/src/gui/App.hpp b/src/gui/App.hpp
index c609fa36..6071c750 100644
--- a/src/gui/App.hpp
+++ b/src/gui/App.hpp
@@ -39,6 +39,7 @@ class Interface;
class Log;
class Port;
class Serialiser;
+class StreamWriter;
class World;
namespace Client {
@@ -145,6 +146,7 @@ protected:
SPtr<Client::SigClientInterface> _client;
SPtr<Client::ClientStore> _store;
SPtr<ThreadedLoader> _loader;
+ SPtr<StreamWriter> _dumper;
Style* _style;