Bläddra i källkod

ui: display exposure/gain settings

Pavel Machek 2 månader sedan
förälder
incheckning
13264d6b1c
3 ändrade filer med 17 tillägg och 7 borttagningar
  1. 6 1
      src/main.c
  2. 1 0
      src/main.h
  3. 10 6
      src/process_pipeline.c

+ 6 - 1
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;
 }

+ 1 - 0
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);

+ 10 - 6
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