diff options
Diffstat (limited to 'src/gui')
-rw-r--r-- | src/gui/App.cpp | 24 | ||||
-rw-r--r-- | src/gui/App.hpp | 2 |
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; |