aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--NEWS1
-rw-r--r--src/jalv.c10
-rw-r--r--src/jalv_gtk.c2
-rw-r--r--src/jalv_internal.h1
4 files changed, 12 insertions, 2 deletions
diff --git a/NEWS b/NEWS
index ebd0359..a58deb3 100644
--- a/NEWS
+++ b/NEWS
@@ -1,6 +1,7 @@
jalv (1.4.1) unstable;
* Fix crash when running "jalv" with bad command line arguments
+ * Add command-line option to control UI update frequency
-- David Robillard <d@drobilla.net> Sun, 24 Mar 2013 18:18:08 -0400
diff --git a/src/jalv.c b/src/jalv.c
index 25676c2..0e77239 100644
--- a/src/jalv.c
+++ b/src/jalv.c
@@ -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);
diff --git a/src/jalv_gtk.c b/src/jalv_gtk.c
index b1c069a..e371a6c 100644
--- a/src/jalv_gtk.c
+++ b/src/jalv_gtk.c
@@ -91,6 +91,8 @@ jalv_init(int* argc, char*** argv, JalvOptions* opts)
"Use Jalv generic UI and not the plugin UI", NULL},
{ "buffer-size", 'b', 0, G_OPTION_ARG_INT, &opts->buffer_size,
"Buffer size for plugin <=> UI communication", "SIZE"},
+ { "update-frequency", 'r', 0, G_OPTION_ARG_INT, &opts->update_rate,
+ "UI update frequency", NULL},
{ 0, 0, 0, 0, 0, 0, 0 } };
GError* error = NULL;
const int err = gtk_init_with_args(
diff --git a/src/jalv_internal.h b/src/jalv_internal.h
index 9800924..2fccbc5 100644
--- a/src/jalv_internal.h
+++ b/src/jalv_internal.h
@@ -86,6 +86,7 @@ typedef struct {
char* uuid;
char* load;
uint32_t buffer_size;
+ uint32_t update_rate;
bool dump;
bool generic_ui;
} JalvOptions;