diff options
author | David Robillard <d@drobilla.net> | 2007-09-22 23:51:00 +0000 |
---|---|---|
committer | David Robillard <d@drobilla.net> | 2007-09-22 23:51:00 +0000 |
commit | c1160ffc8a5dfb38891b0faa6373c9eecdd8e4c9 (patch) | |
tree | 1baf40b7a90bc96c4b0832103ff0cdabdf1ed1a6 /src/libs/client | |
parent | 4bd53e016b8bb912e48d77e756720516d876d5c2 (diff) | |
download | ingen-c1160ffc8a5dfb38891b0faa6373c9eecdd8e4c9.tar.gz ingen-c1160ffc8a5dfb38891b0faa6373c9eecdd8e4c9.tar.bz2 ingen-c1160ffc8a5dfb38891b0faa6373c9eecdd8e4c9.zip |
Type oblivious set_port_value interface.
git-svn-id: http://svn.drobilla.net/lad/ingen@765 a436a847-0d15-0410-975c-d299462d15a1
Diffstat (limited to 'src/libs/client')
-rw-r--r-- | src/libs/client/DeprecatedLoader.cpp | 3 | ||||
-rw-r--r-- | src/libs/client/OSCClientReceiver.cpp | 2 | ||||
-rw-r--r-- | src/libs/client/OSCEngineSender.cpp | 43 | ||||
-rw-r--r-- | src/libs/client/OSCEngineSender.hpp | 18 | ||||
-rw-r--r-- | src/libs/client/PluginModel.cpp | 13 |
5 files changed, 58 insertions, 21 deletions
diff --git a/src/libs/client/DeprecatedLoader.cpp b/src/libs/client/DeprecatedLoader.cpp index f6c07ecd..9cff9422 100644 --- a/src/libs/client/DeprecatedLoader.cpp +++ b/src/libs/client/DeprecatedLoader.cpp @@ -258,7 +258,8 @@ DeprecatedLoader::load_patch(const Glib::ustring& filename, if (pm->name() == "default") { list<ControlModel>::const_iterator i = pm->controls().begin(); for ( ; i != pm->controls().end(); ++i) { - _engine->set_port_value(i->port_path(), i->value()); + const float value = i->value(); + _engine->set_port_value(i->port_path(), sizeof(float), &value); } } else { cerr << "WARNING: Unknown preset: \"" << pm->name() << endl; diff --git a/src/libs/client/OSCClientReceiver.cpp b/src/libs/client/OSCClientReceiver.cpp index 63bf5b69..d6ce3f81 100644 --- a/src/libs/client/OSCClientReceiver.cpp +++ b/src/libs/client/OSCClientReceiver.cpp @@ -39,7 +39,7 @@ OSCClientReceiver::OSCClientReceiver(int listen_port) // _receiving_node_num_ports(0), // _num_received_ports(0) { - start(false); + start(true); } diff --git a/src/libs/client/OSCEngineSender.cpp b/src/libs/client/OSCEngineSender.cpp index 46181195..90f27676 100644 --- a/src/libs/client/OSCEngineSender.cpp +++ b/src/libs/client/OSCEngineSender.cpp @@ -16,9 +16,10 @@ */ #include <iostream> -#include "OSCEngineSender.hpp" #include <raul/AtomLiblo.hpp> -using std::cout; using std::cerr; using std::endl; +#include "OSCEngineSender.hpp" + +using namespace std; namespace Ingen { namespace Client { @@ -350,39 +351,61 @@ OSCEngineSender::disconnect_all(const string& node_path) void OSCEngineSender::set_port_value(const string& port_path, - float val) + uint32_t data_size, + const void* data) { assert(_engine_addr); + assert(data_size == 4); lo_send(_engine_addr, "/ingen/set_port_value", "isf", next_id(), port_path.c_str(), - val); + *(float*)data); } void OSCEngineSender::set_port_value(const string& port_path, uint32_t voice, - float val) + uint32_t data_size, + const void* data) { assert(_engine_addr); + assert(data_size == 4); lo_send(_engine_addr, "/ingen/set_port_value", "isif", next_id(), port_path.c_str(), voice, - val); + *(float*)data); +} + + +void +OSCEngineSender::set_port_value_immediate(const string& port_path, + uint32_t data_size, + const void* data) +{ + assert(_engine_addr); + assert(data_size == 4); + lo_send(_engine_addr, "/ingen/set_port_value_immediate", "isf", + next_id(), + port_path.c_str(), + *(float*)data); } void -OSCEngineSender::set_port_value_queued(const string& port_path, - float val) +OSCEngineSender::set_port_value_immediate(const string& port_path, + uint32_t voice, + uint32_t data_size, + const void* data) { assert(_engine_addr); - lo_send(_engine_addr, "/ingen/set_port_value_queued", "isf", + assert(data_size == 4); + lo_send(_engine_addr, "/ingen/set_port_value_immediate", "isif", next_id(), port_path.c_str(), - val); + voice, + *(float*)data); } diff --git a/src/libs/client/OSCEngineSender.hpp b/src/libs/client/OSCEngineSender.hpp index c3a9b46a..bdaf8337 100644 --- a/src/libs/client/OSCEngineSender.hpp +++ b/src/libs/client/OSCEngineSender.hpp @@ -112,14 +112,22 @@ public: void disconnect_all(const string& node_path); void set_port_value(const string& port_path, - float val); + uint32_t data_size, + const void* data); void set_port_value(const string& port_path, uint32_t voice, - float val); - - void set_port_value_queued(const string& port_path, - float val); + uint32_t data_size, + const void* data); + + void set_port_value_immediate(const string& port_path, + uint32_t data_size, + const void* data); + + void set_port_value_immediate(const string& port_path, + uint32_t voice, + uint32_t data_size, + const void* data); void set_program(const string& node_path, uint32_t bank, diff --git a/src/libs/client/PluginModel.cpp b/src/libs/client/PluginModel.cpp index 442cbb43..6fb7e95a 100644 --- a/src/libs/client/PluginModel.cpp +++ b/src/libs/client/PluginModel.cpp @@ -55,11 +55,16 @@ PluginModel::default_node_name(SharedPtr<PatchModel> parent) void lv2_ui_write(LV2UI_Controller controller, - uint32_t port, - uint32_t buffer_size, - const void* buffer) + uint32_t port, + uint32_t buffer_size, + const void* buffer) { - cerr << "********* LV2 UI WRITE" << endl; + cerr << "********* LV2 UI WRITE port " << port << ", size " + << buffer_size << endl; + for (uint32_t i=0; i < buffer_size; ++i) { + fprintf(stderr, "( %X )", *((uint8_t*)buffer + i)); + } + fprintf(stderr, "\n"); } |