aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2019-05-04 12:32:45 +0200
committerDavid Robillard <d@drobilla.net>2019-05-04 12:32:45 +0200
commit3dc259eea6a3bcb46c8547e2dbac5b02b7144f11 (patch)
treed877b5a001409cfd5174769dbff3861430547700 /src
parent3a4efdc47d45558aef921eacae25d51f1b399528 (diff)
downloadjalv-3dc259eea6a3bcb46c8547e2dbac5b02b7144f11.tar.gz
jalv-3dc259eea6a3bcb46c8547e2dbac5b02b7144f11.tar.bz2
jalv-3dc259eea6a3bcb46c8547e2dbac5b02b7144f11.zip
Fix incorrect type for sample rate option
Diffstat (limited to 'src')
-rw-r--r--src/jack.c2
-rw-r--r--src/jalv.c8
-rw-r--r--src/jalv_internal.h2
3 files changed, 6 insertions, 6 deletions
diff --git a/src/jack.c b/src/jack.c
index a98963a..11edc31 100644
--- a/src/jack.c
+++ b/src/jack.c
@@ -381,7 +381,7 @@ jalv_backend_init(Jalv* jalv)
printf("JACK Name: %s\n", jack_get_client_name(client));
/* Set audio engine properties */
- jalv->sample_rate = jack_get_sample_rate(client);
+ jalv->sample_rate = (float)jack_get_sample_rate(client);
jalv->block_length = jack_get_buffer_size(client);
jalv->midi_buf_size = 4096;
#ifdef HAVE_JACK_PORT_TYPE_GET_BUFFER_SIZE
diff --git a/src/jalv.c b/src/jalv.c
index 562e23a..46aaa3d 100644
--- a/src/jalv.c
+++ b/src/jalv.c
@@ -625,8 +625,8 @@ jalv_run(Jalv* jalv, uint32_t nframes)
/* Check if it's time to send updates to the UI */
jalv->event_delta_t += nframes;
- bool send_ui_updates = false;
- uint32_t update_frames = jalv->sample_rate / jalv->ui_update_hz;
+ bool send_ui_updates = false;
+ float update_frames = jalv->sample_rate / jalv->ui_update_hz;
if (jalv->has_ui && (jalv->event_delta_t > update_frames)) {
send_ui_updates = true;
jalv->event_delta_t = 0;
@@ -1008,7 +1008,7 @@ jalv_open(Jalv* const jalv, int argc, char** argv)
return -6;
}
- printf("Sample rate: %u Hz\n", jalv->sample_rate);
+ printf("Sample rate: %u Hz\n", (uint32_t)jalv->sample_rate);
printf("Block length: %u frames\n", jalv->block_length);
printf("MIDI buffers: %zu bytes\n", jalv->midi_buf_size);
@@ -1024,7 +1024,7 @@ jalv_open(Jalv* const jalv, int argc, char** argv)
if (jalv->opts.update_rate == 0.0) {
/* Calculate a reasonable UI update frequency. */
- jalv->ui_update_hz = (float)jalv->sample_rate / jalv->midi_buf_size * 2.0f;
+ jalv->ui_update_hz = jalv->sample_rate / jalv->midi_buf_size * 2.0f;
jalv->ui_update_hz = MAX(25.0f, jalv->ui_update_hz);
} else {
/* Use user-specified UI update rate. */
diff --git a/src/jalv_internal.h b/src/jalv_internal.h
index fb387d2..b159ebd 100644
--- a/src/jalv_internal.h
+++ b/src/jalv_internal.h
@@ -327,7 +327,7 @@ struct Jalv {
uint32_t num_ports; ///< Size of the two following arrays:
uint32_t plugin_latency; ///< Latency reported by plugin (if any)
float ui_update_hz; ///< Frequency of UI updates
- uint32_t sample_rate; ///< Sample rate
+ float sample_rate; ///< Sample rate
uint32_t event_delta_t; ///< Frames since last update sent to UI
uint32_t position; ///< Transport position in frames
float bpm; ///< Transport tempo in beats per minute