|
|
|
@ -712,86 +712,6 @@ open_shutter_controls(GtkWidget *button, gpointer user_data)
|
|
|
|
|
open_controls(button, "Shutter", 1.0, 360.0, exposure, !exposure_is_manual, set_shutter, set_shutter_auto); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
/*
|
|
|
|
|
static void |
|
|
|
|
on_control_auto_toggled(GtkToggleButton *widget, gpointer user_data) |
|
|
|
|
{ |
|
|
|
|
bool is_manual = gtk_toggle_button_get_active(widget) ? false : true; |
|
|
|
|
bool has_changed; |
|
|
|
|
|
|
|
|
|
switch (current_control) { |
|
|
|
|
case USER_CONTROL_ISO: |
|
|
|
|
if (gain_is_manual != is_manual) { |
|
|
|
|
gain_is_manual = is_manual; |
|
|
|
|
has_changed = true; |
|
|
|
|
} |
|
|
|
|
break; |
|
|
|
|
case USER_CONTROL_SHUTTER: |
|
|
|
|
if (exposure_is_manual != is_manual) { |
|
|
|
|
exposure_is_manual = is_manual; |
|
|
|
|
has_changed = true; |
|
|
|
|
} |
|
|
|
|
break; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
if (has_changed) { |
|
|
|
|
// The slider might have been moved while Auto mode is active. When entering
|
|
|
|
|
// Manual mode, first read the slider value to sync with those changes.
|
|
|
|
|
double value = gtk_adjustment_get_value(control_slider); |
|
|
|
|
switch (current_control) { |
|
|
|
|
case USER_CONTROL_ISO: |
|
|
|
|
if (value != gain) { |
|
|
|
|
gain = (int)value; |
|
|
|
|
} |
|
|
|
|
break; |
|
|
|
|
case USER_CONTROL_SHUTTER: { |
|
|
|
|
// So far all sensors use exposure time in number of sensor rows
|
|
|
|
|
int new_exposure = |
|
|
|
|
(int)(value / 360.0 * camera->capture_mode.height); |
|
|
|
|
if (new_exposure != exposure) { |
|
|
|
|
exposure = new_exposure; |
|
|
|
|
} |
|
|
|
|
break; |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
update_io_pipeline(); |
|
|
|
|
draw_controls(); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
static void |
|
|
|
|
on_control_slider_changed(GtkAdjustment *widget, gpointer user_data) |
|
|
|
|
{ |
|
|
|
|
double value = gtk_adjustment_get_value(widget); |
|
|
|
|
|
|
|
|
|
bool has_changed = false; |
|
|
|
|
switch (current_control) { |
|
|
|
|
case USER_CONTROL_ISO: |
|
|
|
|
if (value != gain) { |
|
|
|
|
gain = (int)value; |
|
|
|
|
has_changed = true; |
|
|
|
|
} |
|
|
|
|
break; |
|
|
|
|
case USER_CONTROL_SHUTTER: { |
|
|
|
|
// So far all sensors use exposure time in number of sensor rows
|
|
|
|
|
int new_exposure = |
|
|
|
|
(int)(value / 360.0 * camera->capture_mode.height); |
|
|
|
|
if (new_exposure != exposure) { |
|
|
|
|
exposure = new_exposure; |
|
|
|
|
has_changed = true; |
|
|
|
|
} |
|
|
|
|
break; |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
if (has_changed) { |
|
|
|
|
update_io_pipeline(); |
|
|
|
|
draw_controls(); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
*/ |
|
|
|
|
|
|
|
|
|
static void |
|
|
|
|
on_realize(GtkWidget *window, gpointer *data) |
|
|
|
|
{ |
|
|
|
|