From 04f51cb5bd2195346e4b7258da9fe98f92c347e8 Mon Sep 17 00:00:00 2001 From: Tobias Perschon Date: Fri, 8 Sep 2017 18:15:02 +0200 Subject: [PATCH 1/2] Added countdown time setting --- Adafruit_Video_Looper/video_looper.py | 7 +++++-- video_looper.ini | 3 +++ 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/Adafruit_Video_Looper/video_looper.py b/Adafruit_Video_Looper/video_looper.py index 6a40741..a459121 100644 --- a/Adafruit_Video_Looper/video_looper.py +++ b/Adafruit_Video_Looper/video_looper.py @@ -62,6 +62,9 @@ class VideoLooper(object): self._fgcolor = map(int, self._config.get('video_looper', 'fgcolor') \ .translate(None, ',') \ .split()) + #Get seconds for countdown from config + self._countdown_time = self._config.getint('video_looper', 'countdown_time') + # Load sound volume file name value self._sound_vol_file = self._config.get('omxplayer', 'sound_vol_file'); # default value to 0 millibels (omxplayer) @@ -147,7 +150,7 @@ class VideoLooper(object): font = self._small_font return font.render(message, True, self._fgcolor, self._bgcolor) - def _animate_countdown(self, playlist, seconds=10): + def _animate_countdown(self, playlist): """Print text with the number of loaded movies and a quick countdown message if the on screen display is enabled. """ @@ -163,7 +166,7 @@ class VideoLooper(object): label1 = self._render_text(message + ' Starting playback in:') l1w, l1h = label1.get_size() sw, sh = self._screen.get_size() - for i in range(seconds, 0, -1): + for i in range(self._countdown_time, 0, -1): # Each iteration of the countdown rendering changing text. label2 = self._render_text(str(i), self._big_font) l2w, l2h = label2.get_size() diff --git a/video_looper.ini b/video_looper.ini index 1ce2588..ce9e59b 100644 --- a/video_looper.ini +++ b/video_looper.ini @@ -33,6 +33,9 @@ file_reader = usb_drive osd = true #osd = false +#Below you can set for how many secounds the osd (and countdown) is displayed after files are found +countdown_time = 10 + # To play random playlist. is_random = false From 4f6383d8b7e122b7723e83ac5838a7eb01ef28d5 Mon Sep 17 00:00:00 2001 From: Tobias Perschon Date: Sun, 10 Sep 2017 10:45:09 +0200 Subject: [PATCH 2/2] Fixed indent --- Adafruit_Video_Looper/video_looper.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Adafruit_Video_Looper/video_looper.py b/Adafruit_Video_Looper/video_looper.py index a459121..2ad9ac8 100644 --- a/Adafruit_Video_Looper/video_looper.py +++ b/Adafruit_Video_Looper/video_looper.py @@ -63,7 +63,7 @@ class VideoLooper(object): .translate(None, ',') \ .split()) #Get seconds for countdown from config - self._countdown_time = self._config.getint('video_looper', 'countdown_time') + self._countdown_time = self._config.getint('video_looper', 'countdown_time') # Load sound volume file name value self._sound_vol_file = self._config.get('omxplayer', 'sound_vol_file');