Don't ignore port_events for gain/pan if I haven't shown the ui yet, just remember them.

This commit is contained in:
Nick Lanham 2012-02-23 12:52:53 +01:00
parent 9e0de55c5c
commit fedf1a87a6

View File

@ -391,34 +391,28 @@ port_event(LV2UI_Handle handle,
} }
else if (index >= DRMR_GAIN_ONE && else if (index >= DRMR_GAIN_ONE &&
index <= DRMR_GAIN_THIRTYTWO) { index <= DRMR_GAIN_THIRTYTWO) {
if (ui->gain_sliders) { float gain = *(float*)buffer;
float gain = *(float*)buffer; int idx = index-DRMR_GAIN_ONE;
int idx = index-DRMR_GAIN_ONE; ui->gain_vals[idx] = gain;
ui->gain_vals[idx] = gain; if (idx < ui->samples && ui->gain_sliders) {
if (idx < ui->samples) { struct slider_callback_data* data = malloc(sizeof(struct slider_callback_data));
struct slider_callback_data* data = malloc(sizeof(struct slider_callback_data)); data->range = GTK_RANGE(ui->gain_sliders[idx]);
data->range = GTK_RANGE(ui->gain_sliders[idx]); data->val = gain;
data->val = gain; g_idle_add(slider_callback,data);
g_idle_add(slider_callback,data); //GtkRange* range = GTK_RANGE(ui->gain_sliders[idx]);
//GtkRange* range = GTK_RANGE(ui->gain_sliders[idx]); //gtk_range_set_value(range,gain);
//gtk_range_set_value(range,gain);
}
} }
} }
else if (index >= DRMR_PAN_ONE && else if (index >= DRMR_PAN_ONE &&
index <= DRMR_PAN_THIRTYTWO) { index <= DRMR_PAN_THIRTYTWO) {
if (ui->pan_sliders) { float pan = *(float*)buffer;
float pan = *(float*)buffer; int idx = index-DRMR_PAN_ONE;
int idx = index-DRMR_PAN_ONE; ui->pan_vals[idx] = pan;
ui->pan_vals[idx] = pan; if (idx < ui->samples && ui->pan_sliders) {
if (idx < ui->samples) { struct slider_callback_data* data = malloc(sizeof(struct slider_callback_data));
struct slider_callback_data* data = malloc(sizeof(struct slider_callback_data)); data->range = GTK_RANGE(ui->pan_sliders[idx]);
data->range = GTK_RANGE(ui->pan_sliders[idx]); data->val = pan;
data->val = pan; g_idle_add(slider_callback,data);
g_idle_add(slider_callback,data);
//GtkRange* range = GTK_RANGE(ui->pan_sliders[idx]);
//gtk_range_set_value(range,pan);
}
} }
} }
} }