Improve gain/exposure controls
This commit is contained in:
14
src/main.c
14
src/main.c
@@ -157,6 +157,16 @@ update_io_pipeline()
|
||||
static bool
|
||||
update_state(const mp_state_main *new_state)
|
||||
{
|
||||
if (state.exposure.manual != new_state->exposure.manual) {
|
||||
const char *icon_name = new_state->exposure.manual ? "shutter-man-symbolic" : "shutter-auto-symbolic";
|
||||
gtk_button_set_icon_name(GTK_BUTTON(shutter_button), icon_name);
|
||||
}
|
||||
|
||||
if (state.gain.manual != new_state->gain.manual) {
|
||||
const char *icon_name = new_state->gain.manual ? "iso-man-symbolic" : "iso-auto-symbolic";
|
||||
gtk_button_set_icon_name(GTK_BUTTON(iso_button), icon_name);
|
||||
}
|
||||
|
||||
state.gain.control = new_state->gain.control;
|
||||
state.gain.auto_control = new_state->gain.auto_control;
|
||||
state.gain.value = new_state->gain.value;
|
||||
@@ -191,8 +201,6 @@ update_state(const mp_state_main *new_state)
|
||||
gtk_widget_set_visible(iso_button, state.gain.control != 0);
|
||||
gtk_widget_set_visible(shutter_button, state.exposure.control != 0);
|
||||
|
||||
update_io_pipeline();
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -885,7 +893,7 @@ static void
|
||||
open_shutter_controls(GtkWidget *button, gpointer user_data)
|
||||
{
|
||||
float value =
|
||||
((float)state.exposure.value / (float)state.exposure.max) * 360.0f;
|
||||
(float)state.exposure.value * 360.0f / (float)state.camera->current_mode->height;
|
||||
open_controls(button,
|
||||
"Shutter",
|
||||
1.0,
|
||||
|
Reference in New Issue
Block a user