diff --git a/README.md b/README.md index 5aa2ba47..bdcba4bd 100644 --- a/README.md +++ b/README.md @@ -104,6 +104,8 @@ optional arguments: saved to the logfile (default: INFO) -S, --subtitles Display SRT subtitles -t, --timecode Display video timecode + -p, --splash Displays splash.bmp upon boot for 3 seconds + -C, --clear Clear display on exit Args that start with '--' (eg. -f) can also be set in a config file (slowmovie.conf). Config file syntax allows: key=value, flag=true, diff --git a/slowmovie.py b/slowmovie.py index c15adf96..23f29b31 100755 --- a/slowmovie.py +++ b/slowmovie.py @@ -237,6 +237,7 @@ def error(self, message): parser.add_argument("-l", "--loop", action="store_true", help="loop a single video; otherwise play through the files in the videos directory") parser.add_argument("-e", "--epd", help="the name of the display device driver to use") parser.add_argument("-o", "--loglevel", default="INFO", type=str.upper, choices=["DEBUG", "INFO", "WARNING", "ERROR", "CRITICAL"], help="minimum importance-level of messages displayed and saved to the logfile (default: %(default)s)") +parser.add_argument("-p", "--splash", action="store_true", help="displays splash.bmp upon boot for 3 seconds") parser.add_argument("-C", "--clear", action="store_true", help="clear display on exit") textOverlayGroup = parser.add_mutually_exclusive_group() textOverlayGroup.add_argument("-S", "--subtitles", action="store_true", help="display SRT subtitles") @@ -361,6 +362,15 @@ def error(self, message): # Initialize lastVideo so that first time through the loop, we'll print "Playing x" lastVideo = None +# Display splash.bmp for 3 seconds after boot +if args.splash: + epd.prepare() + generate_frame("splash.bmp", "/dev/shm/frame.bmp", 0) + pil_im = Image.open("/dev/shm/frame.bmp") + epd.display(pil_im) + epd.sleep() + time.sleep(3) + while True: if lastVideo != currentVideo: # Print a message when starting a new video diff --git a/splash.bmp b/splash.bmp new file mode 100644 index 00000000..bbe44109 Binary files /dev/null and b/splash.bmp differ