aboutsummaryrefslogtreecommitdiffstats
path: root/src/jack.c
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2024-11-21 14:08:02 -0500
committerDavid Robillard <d@drobilla.net>2024-11-24 19:11:44 -0500
commit2a5bc1ca7aee36cd763ac10c894b84eef347fe25 (patch)
treeb145b86c8f98fb6d7adab34f69c1bcb0114e34fa /src/jack.c
parent724aab7a868ed0200afbeecf056e53b5ea16b23d (diff)
downloadjalv-2a5bc1ca7aee36cd763ac10c894b84eef347fe25.tar.gz
jalv-2a5bc1ca7aee36cd763ac10c894b84eef347fe25.tar.bz2
jalv-2a5bc1ca7aee36cd763ac10c894b84eef347fe25.zip
Factor out "settings" that affect the execution process
Diffstat (limited to 'src/jack.c')
-rw-r--r--src/jack.c20
1 files changed, 12 insertions, 8 deletions
diff --git a/src/jack.c b/src/jack.c
index a5f26c6..f848476 100644
--- a/src/jack.c
+++ b/src/jack.c
@@ -12,6 +12,7 @@
#include "lv2_evbuf.h"
#include "port.h"
#include "process.h"
+#include "settings.h"
#include "string_utils.h"
#include "types.h"
#include "urids.h"
@@ -50,11 +51,13 @@ static const float max_latency = 16777216.0f;
static int
jack_buffer_size_cb(jack_nframes_t nframes, void* data)
{
- Jalv* const jalv = (Jalv*)data;
- jalv->block_length = nframes;
+ Jalv* const jalv = (Jalv*)data;
+ JalvSettings* const settings = &jalv->settings;
+
+ settings->block_length = nframes;
#if USE_JACK_PORT_TYPE_GET_BUFFER_SIZE
- jalv->midi_buf_size = jack_port_type_get_buffer_size(jalv->backend->client,
- JACK_DEFAULT_MIDI_TYPE);
+ settings->midi_buf_size = jack_port_type_get_buffer_size(
+ jalv->backend->client, JACK_DEFAULT_MIDI_TYPE);
#endif
if (jalv->run_state == JALV_RUNNING) {
jalv_allocate_port_buffers(jalv);
@@ -355,11 +358,12 @@ jalv_backend_open(Jalv* jalv)
jalv_log(JALV_LOG_INFO, "JACK name: %s\n", jack_get_client_name(client));
// Set audio engine properties
- jalv->sample_rate = (float)jack_get_sample_rate(client);
- jalv->block_length = jack_get_buffer_size(client);
- jalv->midi_buf_size = 4096;
+ JalvSettings* const settings = &jalv->settings;
+ settings->sample_rate = (float)jack_get_sample_rate(client);
+ settings->block_length = jack_get_buffer_size(client);
+ settings->midi_buf_size = 4096;
#if USE_JACK_PORT_TYPE_GET_BUFFER_SIZE
- jalv->midi_buf_size =
+ settings->midi_buf_size =
jack_port_type_get_buffer_size(client, JACK_DEFAULT_MIDI_TYPE);
#endif