diff options
author | David Robillard <d@drobilla.net> | 2018-09-21 00:53:18 +0200 |
---|---|---|
committer | David Robillard <d@drobilla.net> | 2018-09-21 09:30:31 +0200 |
commit | 43ecc5721251c968b1fad47019df20ee4b450533 (patch) | |
tree | 6408be01073df017cd48f0e8d2231fc6150970d2 | |
parent | 518bf9042406940fa8e0eacf327fc1015df55244 (diff) | |
download | jalv-43ecc5721251c968b1fad47019df20ee4b450533.tar.gz jalv-43ecc5721251c968b1fad47019df20ee4b450533.tar.bz2 jalv-43ecc5721251c968b1fad47019df20ee4b450533.zip |
Use jalv_ui_write() universally
-rw-r--r-- | src/jalv.c | 11 | ||||
-rw-r--r-- | src/jalv_gtkmm2.cpp | 4 | ||||
-rw-r--r-- | src/jalv_internal.h | 2 |
3 files changed, 8 insertions, 9 deletions
@@ -515,13 +515,13 @@ jalv_ui_is_resizable(Jalv* jalv) } void -jalv_ui_write(SuilController controller, +jalv_ui_write(void* const jalv_handle, uint32_t port_index, uint32_t buffer_size, uint32_t protocol, const void* buffer) { - Jalv* const jalv = (Jalv*)controller; + Jalv* const jalv = (Jalv*)jalv_handle; if (protocol != 0 && protocol != jalv->urids.atom_eventTransfer) { fprintf(stderr, "UI write with unsupported protocol %d (%s)\n", @@ -722,12 +722,7 @@ jalv_update(Jalv* jalv) free(str); } - if (jalv->ui_instance) { - suil_instance_port_event(jalv->ui_instance, ev.index, - ev.size, ev.protocol, buf); - } else { - jalv_ui_port_event(jalv, ev.index, ev.size, ev.protocol, buf); - } + jalv_ui_port_event(jalv, ev.index, ev.size, ev.protocol, buf); if (ev.protocol == 0 && jalv->opts.print_controls) { print_control_value(jalv, &jalv->ports[ev.index], *(float*)buf); diff --git a/src/jalv_gtkmm2.cpp b/src/jalv_gtkmm2.cpp index 5b1b3c9..811c098 100644 --- a/src/jalv_gtkmm2.cpp +++ b/src/jalv_gtkmm2.cpp @@ -55,6 +55,10 @@ jalv_ui_port_event(Jalv* jalv, uint32_t protocol, const void* buffer) { + if (jalv->ui_instance) { + suil_instance_port_event(jalv->ui_instance, port_index, + buffer_size, protocol, buffer); + } } bool diff --git a/src/jalv_internal.h b/src/jalv_internal.h index 7fa3970..873e16b 100644 --- a/src/jalv_internal.h +++ b/src/jalv_internal.h @@ -384,7 +384,7 @@ bool jalv_ui_is_resizable(Jalv* jalv); void -jalv_ui_write(SuilController controller, +jalv_ui_write(void* const controller, uint32_t port_index, uint32_t buffer_size, uint32_t protocol, |