diff options
author | David Robillard <d@drobilla.net> | 2018-09-22 22:55:06 +0200 |
---|---|---|
committer | David Robillard <d@drobilla.net> | 2018-09-22 22:55:48 +0200 |
commit | d976b0df20c02d1a95dca1184132b77e25cc2d8c (patch) | |
tree | b3e2ccceb83bc30e31b61573e4c232450e8c72c7 | |
parent | b49b6f8c22d6c66e630fbbc5bde4838df5f6af41 (diff) | |
download | jalv-d976b0df20c02d1a95dca1184132b77e25cc2d8c.tar.gz jalv-d976b0df20c02d1a95dca1184132b77e25cc2d8c.tar.bz2 jalv-d976b0df20c02d1a95dca1184132b77e25cc2d8c.zip |
Move control printing function to shared internal header
-rw-r--r-- | src/jalv.c | 11 | ||||
-rw-r--r-- | src/jalv_console.c | 2 | ||||
-rw-r--r-- | src/jalv_internal.h | 7 |
3 files changed, 10 insertions, 10 deletions
@@ -345,13 +345,6 @@ jalv_control_by_symbol(Jalv* jalv, const char* sym) return NULL; } -static void -print_control_value(Jalv* jalv, const struct Port* port, float value) -{ - const LilvNode* sym = lilv_port_get_symbol(jalv->plugin, port->lilv_port); - printf("%s = %f\n", lilv_node_as_string(sym), value); -} - void jalv_create_controls(Jalv* jalv, bool writable) { @@ -726,7 +719,7 @@ jalv_update(Jalv* jalv) 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); + jalv_print_control(jalv, &jalv->ports[ev.index], *(float*)buf); } } @@ -1151,7 +1144,7 @@ main(int argc, char** argv) ControlID* control = jalv.controls.controls[i]; if (control->type == PORT && control->is_writable) { struct Port* port = &jalv.ports[control->index]; - print_control_value(&jalv, port, port->control); + jalv_print_control(&jalv, port, port->control); } } diff --git a/src/jalv_console.c b/src/jalv_console.c index 91e9f62..7bf69a2 100644 --- a/src/jalv_console.c +++ b/src/jalv_console.c @@ -160,7 +160,7 @@ jalv_process_command(Jalv* jalv, const char* cmd) } if (port) { port->control = value; - printf("%s = %f\n", sym, value); + jalv_print_control(jalv, port, value); } else { fprintf(stderr, "error: no control named `%s'\n", sym); } diff --git a/src/jalv_internal.h b/src/jalv_internal.h index c8b45ab..b193c22 100644 --- a/src/jalv_internal.h +++ b/src/jalv_internal.h @@ -465,6 +465,13 @@ atom_to_turtle(LV2_URID_Unmap* unmap, const SerdNode* predicate, const LV2_Atom* atom); +static inline void +jalv_print_control(Jalv* jalv, const struct Port* port, float value) +{ + const LilvNode* sym = lilv_port_get_symbol(jalv->plugin, port->lilv_port); + printf("%s = %f\n", lilv_node_as_string(sym), value); +} + static inline char* jalv_strdup(const char* str) { |