|
@@ -68,9 +68,10 @@ GtkWidget *preview_bottom_box;
|
|
GtkWidget *message_box;
|
|
GtkWidget *message_box;
|
|
GtkWidget *message_label;
|
|
GtkWidget *message_label;
|
|
|
|
|
|
-GtkWidget *flash_button;
|
|
|
|
GtkWidget *iso_button;
|
|
GtkWidget *iso_button;
|
|
GtkWidget *shutter_button;
|
|
GtkWidget *shutter_button;
|
|
|
|
+GtkWidget *focus_button;
|
|
|
|
+GtkWidget *flash_button;
|
|
|
|
|
|
LfbEvent *capture_event;
|
|
LfbEvent *capture_event;
|
|
static GtkWidget *movie;
|
|
static GtkWidget *movie;
|
|
@@ -172,6 +173,13 @@ update_state(const mp_state_main *new_state)
|
|
gtk_button_set_icon_name(GTK_BUTTON(iso_button), icon_name);
|
|
gtk_button_set_icon_name(GTK_BUTTON(iso_button), icon_name);
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+ if (state.focus.manual != new_state->focus.manual) {
|
|
|
|
+ const char *icon_name = new_state->focus.manual ?
|
|
|
|
+ "focus-man-symbolic" :
|
|
|
|
+ "focus-auto-symbolic";
|
|
|
|
+ gtk_button_set_icon_name(GTK_BUTTON(focus_button), icon_name);
|
|
|
|
+ }
|
|
|
|
+
|
|
state.gain.control = new_state->gain.control;
|
|
state.gain.control = new_state->gain.control;
|
|
state.gain.auto_control = new_state->gain.auto_control;
|
|
state.gain.auto_control = new_state->gain.auto_control;
|
|
state.gain.value = new_state->gain.value;
|
|
state.gain.value = new_state->gain.value;
|
|
@@ -204,6 +212,7 @@ update_state(const mp_state_main *new_state)
|
|
// Make the right settings available for the camera
|
|
// Make the right settings available for the camera
|
|
gtk_widget_set_visible(iso_button, state.gain.control.id != 0);
|
|
gtk_widget_set_visible(iso_button, state.gain.control.id != 0);
|
|
gtk_widget_set_visible(shutter_button, state.exposure.control.id != 0);
|
|
gtk_widget_set_visible(shutter_button, state.exposure.control.id != 0);
|
|
|
|
+ gtk_widget_set_visible(focus_button, state.focus.control.id != 0);
|
|
// Even if there's no flash led/v4l, it'll just default to using the screen
|
|
// Even if there's no flash led/v4l, it'll just default to using the screen
|
|
// as flash, so always enable this button
|
|
// as flash, so always enable this button
|
|
gtk_widget_set_visible(flash_button, true);
|
|
gtk_widget_set_visible(flash_button, true);
|
|
@@ -915,6 +924,24 @@ set_shutter_auto(bool is_auto)
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+static void
|
|
|
|
+set_focus(double value)
|
|
|
|
+{
|
|
|
|
+ if (state.focus.value != (int)value) {
|
|
|
|
+ state.focus.value_req = (int)value;
|
|
|
|
+ update_io_pipeline();
|
|
|
|
+ }
|
|
|
|
+}
|
|
|
|
+
|
|
|
|
+static void
|
|
|
|
+set_focus_auto(bool is_auto)
|
|
|
|
+{
|
|
|
|
+ if (state.focus.manual != !is_auto) {
|
|
|
|
+ state.focus.manual_req = !is_auto;
|
|
|
|
+ update_io_pipeline();
|
|
|
|
+ }
|
|
|
|
+}
|
|
|
|
+
|
|
static void
|
|
static void
|
|
open_shutter_controls(GtkWidget *button, gpointer user_data)
|
|
open_shutter_controls(GtkWidget *button, gpointer user_data)
|
|
{
|
|
{
|
|
@@ -930,6 +957,19 @@ open_shutter_controls(GtkWidget *button, gpointer user_data)
|
|
set_shutter_auto);
|
|
set_shutter_auto);
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+static void
|
|
|
|
+open_focus_controls(GtkWidget *button, gpointer user_data)
|
|
|
|
+{
|
|
|
|
+ open_controls(button,
|
|
|
|
+ "Focus",
|
|
|
|
+ 0,
|
|
|
|
+ state.focus.max,
|
|
|
|
+ state.focus.value,
|
|
|
|
+ !state.focus.manual,
|
|
|
|
+ set_focus,
|
|
|
|
+ set_focus_auto);
|
|
|
|
+}
|
|
|
|
+
|
|
static void
|
|
static void
|
|
flash_button_clicked(GtkWidget *button, gpointer user_data)
|
|
flash_button_clicked(GtkWidget *button, gpointer user_data)
|
|
{
|
|
{
|
|
@@ -1254,6 +1294,8 @@ activate(GtkApplication *app, gpointer data)
|
|
GTK_WIDGET(gtk_builder_get_object(builder, "iso-controls-button"));
|
|
GTK_WIDGET(gtk_builder_get_object(builder, "iso-controls-button"));
|
|
shutter_button = GTK_WIDGET(
|
|
shutter_button = GTK_WIDGET(
|
|
gtk_builder_get_object(builder, "shutter-controls-button"));
|
|
gtk_builder_get_object(builder, "shutter-controls-button"));
|
|
|
|
+ focus_button =
|
|
|
|
+ GTK_WIDGET(gtk_builder_get_object(builder, "focus-controls-button"));
|
|
flash_button =
|
|
flash_button =
|
|
GTK_WIDGET(gtk_builder_get_object(builder, "flash-controls-button"));
|
|
GTK_WIDGET(gtk_builder_get_object(builder, "flash-controls-button"));
|
|
GtkWidget *setting_dng_button =
|
|
GtkWidget *setting_dng_button =
|
|
@@ -1290,6 +1332,8 @@ activate(GtkApplication *app, gpointer data)
|
|
g_signal_connect(iso_button, "clicked", G_CALLBACK(open_iso_controls), NULL);
|
|
g_signal_connect(iso_button, "clicked", G_CALLBACK(open_iso_controls), NULL);
|
|
g_signal_connect(
|
|
g_signal_connect(
|
|
shutter_button, "clicked", G_CALLBACK(open_shutter_controls), NULL);
|
|
shutter_button, "clicked", G_CALLBACK(open_shutter_controls), NULL);
|
|
|
|
+ g_signal_connect(
|
|
|
|
+ focus_button, "clicked", G_CALLBACK(open_focus_controls), NULL);
|
|
g_signal_connect(
|
|
g_signal_connect(
|
|
flash_button, "clicked", G_CALLBACK(flash_button_clicked), NULL);
|
|
flash_button, "clicked", G_CALLBACK(flash_button_clicked), NULL);
|
|
|
|
|