From ce6dc3d549bc58515d5d55db1d0a009a92887f3c Mon Sep 17 00:00:00 2001 From: David Robillard Date: Sun, 18 Sep 2016 04:42:31 -0400 Subject: Add fancy communication logging --- src/gui/App.cpp | 24 ++++++++++++++++++++++++ src/gui/App.hpp | 2 ++ 2 files changed, 26 insertions(+) (limited to 'src/gui') 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 client) _world->set_store(_store); } + if (_world->conf().option("dump").get()) { + _dumper = SPtr(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; SPtr _store; SPtr _loader; + SPtr _dumper; Style* _style; -- cgit v1.2.1