Commit 974523ea authored by ale's avatar ale

Reduce range of humanizer params + minor UI changes

Add a frame around the control groups.
parent 9965f3bd
......@@ -89,7 +89,7 @@
lv2:name "Humanizer Latency Max" ;
lv2:default 0.0 ;
lv2:minimum 0.0 ;
lv2:maximum 400.0 ;
lv2:maximum 100.0 ;
units:unit units:ms ;
] , [
a lv2:InputPort ,
......@@ -99,7 +99,7 @@
lv2:name "Humanizer Latency StdDev" ;
lv2:default 0.0 ;
lv2:minimum 0.0 ;
lv2:maximum 100.0 ;
lv2:maximum 20.0 ;
units:unit units:ms ;
] , [
a lv2:InputPort ,
......@@ -128,7 +128,7 @@
lv2:name "Humanizer Velocity StdDev" ;
lv2:default 0.0 ;
lv2:minimum 0.0 ;
lv2:maximum 1.0 ;
lv2:maximum 0.3 ;
] , [
a lv2:InputPort ,
lv2:ControlPort ;
......
......@@ -46,6 +46,8 @@ struct plugin_ui {
GtkWidget *load_dialog;
GtkWidget *button_box;
GtkWidget *box;
GtkWidget *frame;
GtkWidget *humanize_frame;
GtkWidget *humanize_box;
GtkWidget *humanize_button;
GtkWidget *humanize_latency_max_knob;
......@@ -117,11 +119,12 @@ static void on_load_dialog_response(GtkDialog *widget, gint response, void *hand
}
static void write_control_values(struct plugin_ui *ui) {
WRITECONTROLVALUE(ui->humanize_latency_max_value * 400.0, PORT_HUMANIZE_LATENCY_MAX);
WRITECONTROLVALUE(ui->humanize_latency_stddev_value * 100.0, PORT_HUMANIZE_LATENCY_STDDEV);
WRITECONTROLVALUE(ui->humanize_latency_laid_back_value* 100.0, PORT_HUMANIZE_LATENCY_LAID_BACK);
// Values here should match the ranges specified in hydrumkit.ttl.
WRITECONTROLVALUE(ui->humanize_latency_max_value * 100.0, PORT_HUMANIZE_LATENCY_MAX);
WRITECONTROLVALUE(ui->humanize_latency_stddev_value * 20.0, PORT_HUMANIZE_LATENCY_STDDEV);
WRITECONTROLVALUE(ui->humanize_latency_laid_back_value * 100.0, PORT_HUMANIZE_LATENCY_LAID_BACK);
WRITECONTROLVALUE(ui->humanize_latency_regain_value, PORT_HUMANIZE_LATENCY_REGAIN);
WRITECONTROLVALUE(ui->humanize_velocity_stddev_value, PORT_HUMANIZE_VELOCITY_STDDEV);
WRITECONTROLVALUE(ui->humanize_velocity_stddev_value * 0.3, PORT_HUMANIZE_VELOCITY_STDDEV);
}
static void on_humanize_button_click(GtkButton *widget, void *handle) {
......@@ -180,8 +183,10 @@ static LV2UI_Handle instantiate(const LV2UI_Descriptor *descriptor,
// Construct Gtk UI
ui->box = gtk_grid_new();
gtk_orientable_set_orientation(GTK_ORIENTABLE(ui->box), GTK_ORIENTATION_VERTICAL);
ui->frame = gtk_frame_new("Drumkit");
ui->label = gtk_label_new("No drumkit loaded.");
ui->button_box = gtk_grid_new();
ui->humanize_frame = gtk_frame_new("Humanizer");
ui->humanize_box = gtk_grid_new();
// Create the file chooser (we use a custom GtkButton instead of the
......@@ -218,7 +223,7 @@ static LV2UI_Handle instantiate(const LV2UI_Descriptor *descriptor,
}
// Create the humanizer controls.
ui->humanize_button = gtk_check_button_new_with_label("Humanize");
ui->humanize_button = gtk_check_button_new_with_label("Enable");
ui->humanize_latency_max_knob = knob_widget_new(&ui->humanize_latency_max_value, KNOB_SIZE, 0);
ui->humanize_latency_stddev_knob = knob_widget_new(&ui->humanize_latency_stddev_value, KNOB_SIZE, 0);
ui->humanize_latency_laid_back_knob = knob_widget_new(&ui->humanize_latency_laid_back_value, KNOB_SIZE, 0);
......@@ -238,14 +243,16 @@ static LV2UI_Handle instantiate(const LV2UI_Descriptor *descriptor,
gtk_widget_set_halign(ui->label, GTK_ALIGN_CENTER);
gtk_container_add(GTK_CONTAINER(ui->button_box), ui->load_button);
gtk_widget_set_hexpand(ui->load_button, FALSE);
gtk_container_add(GTK_CONTAINER(ui->box), ui->button_box);
gtk_container_add(GTK_CONTAINER(ui->frame), ui->button_box);
gtk_container_add(GTK_CONTAINER(ui->box), ui->frame);
gtk_container_add(GTK_CONTAINER(ui->humanize_box), ui->humanize_button);
gtk_container_add(GTK_CONTAINER(ui->humanize_box), ui->humanize_latency_max_knob);
gtk_container_add(GTK_CONTAINER(ui->humanize_box), ui->humanize_latency_stddev_knob);
gtk_container_add(GTK_CONTAINER(ui->humanize_box), ui->humanize_latency_laid_back_knob);
gtk_container_add(GTK_CONTAINER(ui->humanize_box), ui->humanize_latency_regain_knob);
gtk_container_add(GTK_CONTAINER(ui->humanize_box), ui->humanize_velocity_stddev_knob);
gtk_container_add(GTK_CONTAINER(ui->box), ui->humanize_box);
gtk_container_add(GTK_CONTAINER(ui->humanize_frame), ui->humanize_box);
gtk_container_add(GTK_CONTAINER(ui->box), ui->humanize_frame);
g_signal_connect(ui->load_dialog, "response", G_CALLBACK(on_load_dialog_response), ui);
......@@ -270,6 +277,7 @@ static void cleanup(LV2UI_Handle handle) {
gtk_widget_destroy(ui->load_dialog);
gtk_widget_destroy(ui->load_button);
gtk_widget_destroy(ui->button_box);
gtk_widget_destroy(ui->frame);
gtk_widget_destroy(ui->humanize_button);
gtk_widget_destroy(ui->humanize_latency_max_knob);
gtk_widget_destroy(ui->humanize_latency_stddev_knob);
......@@ -277,6 +285,7 @@ static void cleanup(LV2UI_Handle handle) {
gtk_widget_destroy(ui->humanize_latency_regain_knob);
gtk_widget_destroy(ui->humanize_velocity_stddev_knob);
gtk_widget_destroy(ui->humanize_box);
gtk_widget_destroy(ui->humanize_frame);
gtk_widget_destroy(ui->box);
free(ui);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment