aboutsummaryrefslogtreecommitdiffstats
path: root/src/jalv.c
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/jalv.c
parent3a4efdc47d45558aef921eacae25d51f1b399528 (diff)
downloadjalv-3dc259eea6a3bcb46c8547e2dbac5b02b7144f11.tar.gz
jalv-3dc259eea6a3bcb46c8547e2dbac5b02b7144f11.tar.bz2
jalv-3dc259eea6a3bcb46c8547e2dbac5b02b7144f11.zip
Fix incorrect type for sample rate option
Diffstat (limited to 'src/jalv.c')
-rw-r--r--src/jalv.c8
1 files changed, 4 insertions, 4 deletions
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. */