Run clang-format on a few files

This commit is contained in:
Kristian Vos
2024-08-04 10:40:24 +02:00
committed by Martijn Braam
parent 3280c1d113
commit 64f93cd8f2
3 changed files with 78 additions and 60 deletions

View File

@@ -160,12 +160,15 @@ 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";
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";
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);
}
@@ -201,7 +204,8 @@ update_state(const mp_state_main *new_state)
// Make the right settings available for the camera
gtk_widget_set_visible(iso_button, state.gain.control.id != 0);
gtk_widget_set_visible(shutter_button, state.exposure.control.id != 0);
// Even if there's no flash led/v4l, it'll just default to using the screen as flash, so always enable this button
// Even if there's no flash led/v4l, it'll just default to using the screen
// as flash, so always enable this button
gtk_widget_set_visible(flash_button, true);
return false;
@@ -914,8 +918,8 @@ set_shutter_auto(bool is_auto)
static void
open_shutter_controls(GtkWidget *button, gpointer user_data)
{
float value =
(float)state.exposure.value * 360.0f / (float)state.camera->current_mode->height;
float value = (float)state.exposure.value * 360.0f /
(float)state.camera->current_mode->height;
open_controls(button,
"Shutter",
1.0,
@@ -940,30 +944,33 @@ flash_button_clicked(GtkWidget *button, gpointer user_data)
void
notify_movie_progress(void)
{
if (!movie_start) {
if (!movie_start) {
// Recording started
gtk_button_set_icon_name(GTK_BUTTON(movie), "video-recording-symbolic");
gtk_button_set_icon_name(GTK_BUTTON(movie),
"video-recording-symbolic");
}
}
void
notify_movie_message(gchar *msg)
{
gtk_button_set_label(GTK_BUTTON(movie), msg);
gtk_button_set_label(GTK_BUTTON(movie), msg);
}
void
on_movie_clicked(GtkWidget *widget, gpointer user_data)
{
if (movie_start) {
movie_start = 0;
gtk_button_set_icon_name(GTK_BUTTON(movie), "video-processing-symbolic");
on_movie_stop();
} else {
movie_start = 1;
gtk_button_set_icon_name(GTK_BUTTON(movie), "video-recording-symbolic");
on_movie_start();
}
if (movie_start) {
movie_start = 0;
gtk_button_set_icon_name(GTK_BUTTON(movie),
"video-processing-symbolic");
on_movie_stop();
} else {
movie_start = 1;
gtk_button_set_icon_name(GTK_BUTTON(movie),
"video-recording-symbolic");
on_movie_start();
}
}
static void
@@ -1266,7 +1273,7 @@ activate(GtkApplication *app, gpointer data)
preview_top_box = GTK_WIDGET(gtk_builder_get_object(builder, "top-box"));
preview_bottom_box =
GTK_WIDGET(gtk_builder_get_object(builder, "bottom-box"));
movie = GTK_WIDGET(gtk_builder_get_object(builder, "movie"));
movie = GTK_WIDGET(gtk_builder_get_object(builder, "movie"));
message_box = GTK_WIDGET(gtk_builder_get_object(builder, "message-box"));
message_label = GTK_WIDGET(gtk_builder_get_object(builder, "message-label"));
@@ -1286,10 +1293,9 @@ activate(GtkApplication *app, gpointer data)
g_signal_connect(
flash_button, "clicked", G_CALLBACK(flash_button_clicked), NULL);
g_signal_connect(movie, "clicked",
G_CALLBACK(on_movie_clicked), NULL);
g_signal_connect(movie, "clicked", G_CALLBACK(on_movie_clicked), NULL);
setup_fb_switch(builder);
setup_fb_switch(builder);
// Setup actions
create_simple_action(app, "capture", G_CALLBACK(run_capture_action));