From 701e8c9ab78f0d71e6ed63db8539ae61cf36e088 Mon Sep 17 00:00:00 2001 From: Andreas Frisch Date: Tue, 10 May 2016 19:01:32 +0200 Subject: [PATCH] cooldown break before ready to take more photos, fix countdown shadow in css --- default.ini | 8 +++++--- photobooth.c | 23 +++++++++++++++++++---- photobooth.css | 6 +++--- photobooth.h | 1 + 4 files changed, 28 insertions(+), 10 deletions(-) diff --git a/default.ini b/default.ini index 3af50c6..d6771e9 100644 --- a/default.ini +++ b/default.ini @@ -22,12 +22,14 @@ cam_reeinit_after_snapshot = 1 [strings] No camera connected! = Keine Kamera verbunden! -Taking photo... = fotografiere... Touch screen to take a photo! = Bildschirm berühren zum Fotografieren! -Processing photo... = verarbeite Foto... -Print Photo? Touch background to cancel! = Foto Drucken? Zum Abbrechen Hintergrund berühren Taking photo in %d seconds... = Aufnahme in %d Sekunden... SAY CHEESE! = BITTE LÄCHELN :) +Focussing... = stelle scharf... +Taking photo... = fotografiere... +Processing photo... = verarbeite Foto... +Print Photo? Touch background to cancel! = Foto Drucken? Zum Abbrechen Hintergrund berühren +Please wait... = Bitte warten... Printer %s online. %i prints (%s) remaining = Drucker %s bereit. %i Abzüge (%s) übrig Can't parse printer backend output = Fehler beim Verarbeiten der Ausgabe vom Drucker-Backend Printer %s off-line = Drucker %s ist nicht verfügbar diff --git a/photobooth.c b/photobooth.c index 99bcb15..7ebfc39 100644 --- a/photobooth.c +++ b/photobooth.c @@ -100,6 +100,7 @@ static void photo_booth_window_destroyed_signal (PhotoBoothWindow *win, PhotoBoo static void photo_booth_setup_window (PhotoBooth *pb); static void photo_booth_video_widget_ready (PhotoBooth *pb); static gboolean photo_booth_preview (PhotoBooth *pb); +static gboolean photo_booth_preview_ready (PhotoBooth *pb); static void photo_booth_snapshot_start (PhotoBooth *pb); static gboolean photo_booth_snapshot_prepare (PhotoBooth *pb); static gboolean photo_booth_snapshot_trigger (PhotoBooth *pb); @@ -886,13 +887,25 @@ static gboolean photo_booth_preview (PhotoBooth *pb) } int ret = gst_element_link (pb->video_bin, pb->output_bin); gst_element_set_state (pb->video_bin, GST_STATE_PLAYING); - photo_booth_change_state (pb, PB_STATE_PREVIEW); + int cooldown_delay = 2000; + if (priv->state == PB_STATE_NONE) + cooldown_delay = 10; + photo_booth_change_state (pb, PB_STATE_PREVIEW_COOLDOWN); + gtk_label_set_text (priv->win->status, _("Please wait...")); + g_timeout_add (cooldown_delay, (GSourceFunc) photo_booth_preview_ready, pb); GST_DEBUG_BIN_TO_DOT_FILE (GST_BIN (pb->pipeline), GST_DEBUG_GRAPH_SHOW_ALL, "photo_booth_preview.dot"); - gtk_label_set_text (priv->win->status, _("Touch screen to take a photo!")); SEND_COMMAND (pb, CONTROL_VIDEO); return FALSE; } +static gboolean photo_booth_preview_ready (PhotoBooth *pb) +{ + PhotoBoothPrivate *priv = photo_booth_get_instance_private (pb); + photo_booth_change_state (pb, PB_STATE_PREVIEW); + gtk_label_set_text (priv->win->status, _("Touch screen to take a photo!")); + return FALSE; +} + void photo_booth_background_clicked (GtkWidget *widget, GdkEventButton *event, PhotoBoothWindow *win) { PhotoBooth *pb = PHOTO_BOOTH_FROM_WINDOW (win); @@ -909,6 +922,7 @@ void photo_booth_background_clicked (GtkWidget *widget, GdkEventButton *event, P case PB_STATE_TAKING_PHOTO: case PB_STATE_PROCESS_PHOTO: case PB_STATE_PRINTING: + case PB_STATE_PREVIEW_COOLDOWN: GST_DEBUG_OBJECT (pb, "BUSY... ignore event!"); break; case PB_STATE_WAITING_FOR_ANSWER: @@ -920,8 +934,8 @@ void photo_booth_background_clicked (GtkWidget *widget, GdkEventButton *event, P default: break; } - if (priv->prints_remaining < 1) - photo_booth_get_printer_status (pb); +// if (priv->prints_remaining < 1) +// photo_booth_get_printer_status (pb); } static gboolean photo_booth_get_printer_status (PhotoBooth *pb) @@ -1536,6 +1550,7 @@ const gchar* photo_booth_state_get_name (PhotoboothState state) switch (state) { case PB_STATE_NONE: return "PB_STATE_NONE";break; case PB_STATE_PREVIEW: return "PB_STATE_PREVIEW";break; + case PB_STATE_PREVIEW_COOLDOWN: return "PB_STATE_PREVIEW_COOLDOWN";break; case PB_STATE_COUNTDOWN: return "PB_STATE_COUNTDOWN";break; case PB_STATE_TAKING_PHOTO: return "PB_STATE_TAKING_PHOTO";break; case PB_STATE_PROCESS_PHOTO: return "PB_STATE_PROCESS_PHOTO";break; diff --git a/photobooth.css b/photobooth.css index b76d74f..385dc3b 100644 --- a/photobooth.css +++ b/photobooth.css @@ -3,8 +3,8 @@ } .countdown_label { - color: rgba (150, 200, 200, 1); - text-shadow: 10px 10px #000000 + color: rgba (85, 255, 255, 1); + text-shadow: 8px 8px 3px #0c0d24; font-weight: bold; font-size: 80px; padding: 0 0 0 0; @@ -14,7 +14,7 @@ color: rgba (0, 0, 110, 1); background: rgba (168, 233, 255, 0.9); font-weight: bold; - font-size: 80px; + font-size: 60px; padding: 20px 20px 20px 20px; } diff --git a/photobooth.h b/photobooth.h index 12ef176..1664603 100644 --- a/photobooth.h +++ b/photobooth.h @@ -75,6 +75,7 @@ typedef enum { PB_STATE_NONE = 0, PB_STATE_PREVIEW, + PB_STATE_PREVIEW_COOLDOWN, PB_STATE_COUNTDOWN, PB_STATE_TAKING_PHOTO, PB_STATE_PROCESS_PHOTO,