aboutsummaryrefslogtreecommitdiffstats
path: root/src/jalv.c
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2024-11-19 14:47:15 -0500
committerDavid Robillard <d@drobilla.net>2024-11-24 19:11:16 -0500
commit3a01868bc21ee5b3fd0bb29e4bbd0a015692c374 (patch)
tree6e67307b2cac9aa52d53127a55a2d323b9cc2f48 /src/jalv.c
parentc725fa6fced438fe450df60fd74f050cc3d29ba7 (diff)
downloadjalv-3a01868bc21ee5b3fd0bb29e4bbd0a015692c374.tar.gz
jalv-3a01868bc21ee5b3fd0bb29e4bbd0a015692c374.tar.bz2
jalv-3a01868bc21ee5b3fd0bb29e4bbd0a015692c374.zip
Move ring size calculation into a function with other similar ones
Diffstat (limited to 'src/jalv.c')
-rw-r--r--src/jalv.c18
1 files changed, 9 insertions, 9 deletions
diff --git a/src/jalv.c b/src/jalv.c
index 24b41ab..734172b 100644
--- a/src/jalv.c
+++ b/src/jalv.c
@@ -740,8 +740,15 @@ jalv_init_options(Jalv* const jalv)
}
static void
-jalv_init_display(Jalv* const jalv)
+jalv_init_ui_settings(Jalv* const jalv)
{
+ if (!jalv->opts.ring_size) {
+ /* The UI ring is fed by plugin output ports (usually one), and the UI
+ updates roughly once per cycle. The ring size is a few times the size
+ of the MIDI output to give the UI a chance to keep up. */
+ jalv->opts.ring_size = jalv->midi_buf_size * N_BUFFER_CYCLES;
+ }
+
if (!jalv->opts.update_rate) {
// Calculate a reasonable UI update frequency
jalv->ui_update_hz = jalv_frontend_refresh_rate(jalv);
@@ -947,14 +954,7 @@ jalv_open(Jalv* const jalv, int* argc, char*** argv)
jalv_log(JALV_LOG_INFO, "Block length: %u frames\n", jalv->block_length);
jalv_log(JALV_LOG_INFO, "MIDI buffers: %zu bytes\n", jalv->midi_buf_size);
- if (!jalv->opts.ring_size) {
- /* The UI ring is fed by plugin output ports (usually one), and the UI
- updates roughly once per cycle. The ring size is a few times the size
- of the MIDI output to give the UI a chance to keep up. */
- jalv->opts.ring_size = jalv->midi_buf_size * N_BUFFER_CYCLES;
- }
-
- jalv_init_display(jalv);
+ jalv_init_ui_settings(jalv);
jalv_init_options(jalv);
// Create Plugin <=> UI communication buffers