diff --git a/src/main.c b/src/main.c index d9a1e86..3b54f32 100644 --- a/src/main.c +++ b/src/main.c @@ -165,6 +165,12 @@ update_io_pipeline() mp_io_pipeline_update_state(&new_state); } +void +notify_auto_status(gchar *msg) +{ + gtk_button_set_label(GTK_BUTTON(status_button), msg); +} + /* * State transfer from Process -> Main */ @@ -236,7 +242,6 @@ update_state(const mp_state_main *new_state) // as flash, so always enable this button gtk_widget_set_visible(flash_button, true); gtk_widget_set_visible(status_button, true); - gtk_button_set_label(GTK_BUTTON(status_button), "(st)"); return false; } diff --git a/src/main.h b/src/main.h index 9b35502..df6ef82 100644 --- a/src/main.h +++ b/src/main.h @@ -41,3 +41,4 @@ bool check_window_active(); void notify_movie_progress(void); void notify_movie_message(gchar *msg); +void notify_auto_status(gchar *msg); diff --git a/src/process_pipeline.c b/src/process_pipeline.c index 7b096e8..6da9d62 100644 --- a/src/process_pipeline.c +++ b/src/process_pipeline.c @@ -496,25 +496,29 @@ static void summarize() { double time, gain; + bool portrait = (state_proc.device_rotation == 0 || state_proc.device_rotation == 180); + char *sep = portrait ? " " : "\n"; + char buf[2048]; /* FIXME: may be approximate -- width/height should include blank areas */ double PCK = state_proc.mode->width * state_proc.mode->height * 30; double per_line = state_proc.mode->width / PCK; time = state_proc.exposure.value * per_line; - //Then the exposure time = (exposure line) * (time per line ). - - /* Frame time in seconds */ - //time = state_proc.exposure.value * state_proc.mode->height; - /* */ - gain = state_proc.gain.value / ((float) state_proc.gain.min); /* FIXME: .min */ + gain = state_proc.gain.value / ((float) state_proc.gain.min); if (0) /* dgain */ gain *= state_proc.dgain.value / ((float) state_proc.dgain.min); printf("1/%.0f sec, ISO %.0f, t=%f, g=%f %d %d\n", (float) (1.0/time), (float) (gain*100), (float) time, (float) gain, state_proc.gain.value, state_proc.dgain.value); + + sprintf(buf, "1/%s%.0f%sISO%s%.0f", + sep, (float) (1.0/time), sep, + sep, (float) (gain*100)); + + notify_auto_status(buf); } static void