diff options
author | David Robillard <d@drobilla.net> | 2008-08-17 01:34:53 +0000 |
---|---|---|
committer | David Robillard <d@drobilla.net> | 2008-08-17 01:34:53 +0000 |
commit | 694b31089c8060fc6b908b146b12c0e340d004c7 (patch) | |
tree | 48b0e0195de5e7b297e65be15eda35639585ef8a /src/libs/client/OSCClientReceiver.cpp | |
parent | 3dc90cc95df35e5c786857336f22856c6373b00f (diff) | |
download | ingen-694b31089c8060fc6b908b146b12c0e340d004c7.tar.gz ingen-694b31089c8060fc6b908b146b12c0e340d004c7.tar.bz2 ingen-694b31089c8060fc6b908b146b12c0e340d004c7.zip |
Cloooser...
Bundling of OSC communication both ways (previous was just engine->client).
Factor out common OSC*Sender functionality (bundling stuff).
Fully type-safe and polyphony-aware port value setting/getting, from RDF through OSC through engine and back again.
git-svn-id: http://svn.drobilla.net/lad/ingen@1409 a436a847-0d15-0410-975c-d299462d15a1
Diffstat (limited to 'src/libs/client/OSCClientReceiver.cpp')
-rw-r--r-- | src/libs/client/OSCClientReceiver.cpp | 23 |
1 files changed, 18 insertions, 5 deletions
diff --git a/src/libs/client/OSCClientReceiver.cpp b/src/libs/client/OSCClientReceiver.cpp index 856e66cc..091b921b 100644 --- a/src/libs/client/OSCClientReceiver.cpp +++ b/src/libs/client/OSCClientReceiver.cpp @@ -31,8 +31,7 @@ namespace Client { OSCClientReceiver::OSCClientReceiver(int listen_port) - : ClientInterface("localhost") - , _listen_port(listen_port) + : _listen_port(listen_port) , _st(NULL) { start(false); // true = dump, false = shutup @@ -159,7 +158,8 @@ OSCClientReceiver::setup_callbacks() lo_server_thread_add_method(_st, "/ingen/polyphonic", "sT", polyphonic_cb, this); lo_server_thread_add_method(_st, "/ingen/polyphonic", "sF", polyphonic_cb, this); lo_server_thread_add_method(_st, "/ingen/set_variable", NULL, set_variable_cb, this); - lo_server_thread_add_method(_st, "/ingen/control_change", "sf", control_change_cb, this); + lo_server_thread_add_method(_st, "/ingen/set_port_value", "sf", set_port_value_cb, this); + lo_server_thread_add_method(_st, "/ingen/set_voice_value", "sif", set_voice_value_cb, this); lo_server_thread_add_method(_st, "/ingen/port_activity", "s", port_activity_cb, this); lo_server_thread_add_method(_st, "/ingen/program_add", "siis", program_add_cb, this); lo_server_thread_add_method(_st, "/ingen/program_remove", "sii", program_remove_cb, this); @@ -321,12 +321,25 @@ OSCClientReceiver::_set_variable_cb(const char* path, const char* types, lo_arg* int -OSCClientReceiver::_control_change_cb(const char* path, const char* types, lo_arg** argv, int argc, lo_message msg) +OSCClientReceiver::_set_port_value_cb(const char* path, const char* types, lo_arg** argv, int argc, lo_message msg) { const char* const port_path = &argv[0]->s; const float value = argv[1]->f; - control_change(port_path, value); + set_port_value(port_path, value); + + return 0; +} + + +int +OSCClientReceiver::_set_voice_value_cb(const char* path, const char* types, lo_arg** argv, int argc, lo_message msg) +{ + const char* const port_path = &argv[0]->s; + const int voice = argv[1]->i; + const float value = argv[2]->f; + + set_voice_value(port_path, voice, value); return 0; } |