diff options
author | David Robillard <d@drobilla.net> | 2013-05-09 18:36:38 +0000 |
---|---|---|
committer | David Robillard <d@drobilla.net> | 2013-05-09 18:36:38 +0000 |
commit | abb8cfaf30475f25659d89605cb24fb0d5aee68d (patch) | |
tree | 1bed11201e42b5ce4d5a1ecd533641b529fd6607 /src/jalv.c | |
parent | 93c86e7b19dd804d508ccdd0deaa7a2d76917a6b (diff) | |
download | jalv-abb8cfaf30475f25659d89605cb24fb0d5aee68d.tar.gz jalv-abb8cfaf30475f25659d89605cb24fb0d5aee68d.tar.bz2 jalv-abb8cfaf30475f25659d89605cb24fb0d5aee68d.zip |
Add command-line option to control UI update frequency.
git-svn-id: http://svn.drobilla.net/lad/trunk/jalv@5106 a436a847-0d15-0410-975c-d299462d15a1
Diffstat (limited to 'src/jalv.c')
-rw-r--r-- | src/jalv.c | 10 |
1 files changed, 8 insertions, 2 deletions
@@ -1041,8 +1041,14 @@ main(int argc, char** argv) options_feature.data = &options; - /* Calculate theoretical UI update frequency. */ - jalv.ui_update_hz = (double)jalv.sample_rate / jalv.midi_buf_size * 2.0; + if (!jalv.opts.update_rate) { + /* Calculate theoretical UI update frequency. */ + jalv.ui_update_hz = (double)jalv.sample_rate / jalv.midi_buf_size * 2.0; + jalv.ui_update_hz = MAX(25, jalv.ui_update_hz); + } else { + jalv.ui_update_hz = jalv.opts.update_rate; + jalv.ui_update_hz = MAX(1, jalv.ui_update_hz); + } /* The UI can only go so fast, clamp to reasonable limits */ jalv.ui_update_hz = MIN(60, jalv.ui_update_hz); |