diff options
author | MaZderMind <github@mazdermind.de> | 2015-07-23 09:59:56 +0200 |
---|---|---|
committer | MaZderMind <github@mazdermind.de> | 2015-07-23 09:59:56 +0200 |
commit | 3729af316ea10d17be064e14edf2b4e5f331c167 (patch) | |
tree | ea25251cccce0fe79926ec9f489868f782707ceb /voctogui/lib/ui.py | |
parent | 7186f7b1f57ee9fa1e26d53135b769db20a04295 (diff) |
experiment with cairooverlay
Diffstat (limited to 'voctogui/lib/ui.py')
-rw-r--r-- | voctogui/lib/ui.py | 17 |
1 files changed, 16 insertions, 1 deletions
diff --git a/voctogui/lib/ui.py b/voctogui/lib/ui.py index 628b96c..239913b 100644 --- a/voctogui/lib/ui.py +++ b/voctogui/lib/ui.py @@ -62,7 +62,8 @@ class Ui(UiBuilder): video = self.find_widget_recursive(self.win, 'video_main') audiolevel = self.find_widget_recursive(self.win, 'audiolevel_main') self.video_main_player = VideoDisplay(11000, video, audiolevel, - playaudio=Config.getboolean('mainvideo', 'playaudio')) + playaudio=Config.getboolean('mainvideo', 'playaudio'), + allowoverlay=True) def configure_video_previews(self): self.log.info('Initializing Video Previews') @@ -204,8 +205,22 @@ class Ui(UiBuilder): if btn.get_name() != 'live': self.blink_btn = btn self.blink_btn_state = False + self.streamblank_mode = btn.get_name() + self.video_main_player.set_overlay_callback(self.draw_streamblank_warning) else: self.blink_btn = None + self.video_main_player.set_overlay_callback(None) + + def draw_streamblank_warning(self, cairooverlay, cairo, timestamp, duration): + cairo.set_source_rgba(1.0, 0.0, 0.0, 0.5) + cairo.rectangle(0, 0, 1920, 1080) + cairo.fill() + + cairo.move_to(0, 1080/2) + cairo.set_font_size(100) + cairo.set_source_rgba(1.0, 1.0, 1.0, 1.0) + cairo.show_text("Stream is Blanked: {}".format(self.streamblank_mode)) + def show(self): self.log.info('Running Video-Playback Pipelines') |