From f9eba59332ee7e45ffbfebcd0ce79e8e0cfd9ec4 Mon Sep 17 00:00:00 2001 From: David Robillard Date: Mon, 19 May 2008 21:36:34 +0000 Subject: More (but not yet completely) type safe value_changed notification. git-svn-id: http://svn.drobilla.net/lad/ingen@1216 a436a847-0d15-0410-975c-d299462d15a1 --- src/libs/client/OSCClientReceiver.cpp | 2 +- src/libs/client/PluginModel.cpp | 2 ++ src/libs/client/PluginUI.cpp | 16 +++++++--------- src/libs/client/PortModel.hpp | 8 +++----- 4 files changed, 13 insertions(+), 15 deletions(-) (limited to 'src/libs/client') diff --git a/src/libs/client/OSCClientReceiver.cpp b/src/libs/client/OSCClientReceiver.cpp index 6002ca59..04b83d61 100644 --- a/src/libs/client/OSCClientReceiver.cpp +++ b/src/libs/client/OSCClientReceiver.cpp @@ -35,7 +35,7 @@ OSCClientReceiver::OSCClientReceiver(int listen_port) _listen_port(listen_port), _st(NULL) { - start(false); // true = dump, false = shutup + start(true); // true = dump, false = shutup } diff --git a/src/libs/client/PluginModel.cpp b/src/libs/client/PluginModel.cpp index df8d4bf7..1f11cc21 100644 --- a/src/libs/client/PluginModel.cpp +++ b/src/libs/client/PluginModel.cpp @@ -57,6 +57,7 @@ PluginModel::default_node_name(SharedPtr parent) } +#if 0 struct NodeController { EngineInterface* engine; NodeModel* node; @@ -91,6 +92,7 @@ lv2_ui_write(LV2UI_Controller controller, nc->engine->set_port_value_immediate(port->path(), port->type().uri(), buffer_size, buffer); } +#endif #ifdef HAVE_SLV2 diff --git a/src/libs/client/PluginUI.cpp b/src/libs/client/PluginUI.cpp index b9ef9050..54ee0009 100644 --- a/src/libs/client/PluginUI.cpp +++ b/src/libs/client/PluginUI.cpp @@ -30,11 +30,11 @@ static void lv2_ui_write(LV2UI_Controller controller, uint32_t port_index, uint32_t buffer_size, - uint32_t format, + uint32_t format, const void* buffer) { - /*cerr << "********* LV2 UI WRITE:" << endl; - lv2_osc_message_print((const LV2Message*)buffer); + cerr << "********* LV2 UI WRITE (FORMAT " << format << ":" << endl; + /*lv2_osc_message_print((const LV2Message*)buffer);*/ fprintf(stderr, "RAW:\n"); for (uint32_t i=0; i < buffer_size; ++i) { @@ -44,18 +44,16 @@ lv2_ui_write(LV2UI_Controller controller, else fprintf(stderr, "%2X ", ((unsigned char*)buffer)[i]); } - fprintf(stderr, "\n"); - */ PluginUI* ui = (PluginUI*)controller; SharedPtr port = ui->node()->ports()[port_index]; if (format == 0) { - ui->engine()->set_port_value_immediate(port->path(), - port->type().uri(), - buffer_size, buffer); + ui->engine()->set_port_value_immediate(port->path(), + port->type().uri(), + buffer_size, buffer); } } @@ -73,7 +71,7 @@ PluginUI::~PluginUI() { slv2_ui_instance_free(_instance); } - + SharedPtr PluginUI::create(SharedPtr engine, diff --git a/src/libs/client/PortModel.hpp b/src/libs/client/PortModel.hpp index 940b967e..759b8c1e 100644 --- a/src/libs/client/PortModel.hpp +++ b/src/libs/client/PortModel.hpp @@ -56,18 +56,16 @@ public: inline bool operator==(const PortModel& pm) const { return (_path == pm._path); } - inline void value(float val) + inline void value(const Atom& val) { if (val != _current_val) { _current_val = val; - signal_control.emit(val); + signal_value_changed.emit(val); } } - inline float value() { return _current_val; } - // Signals - sigc::signal signal_control; ///< Control ports + sigc::signal signal_value_changed; ///< Value ports sigc::signal signal_activity; ///< Message ports sigc::signal > signal_connection; sigc::signal > signal_disconnection; -- cgit v1.2.1