def slide_command(self, *_, **__): if self.gif_player.play_count: return self.gif_player.play(self.images[Slide.get_values()]) #os.popen(self.videos[Slide.get_values()]) self.player.set_media(self.videos[Slide.get_values()]) self.player.play()
def __init__(self, master=None, cnf={}, **kw): # save reference to neuron window self.neuron = kw.pop('neuron') Toplevel.__init__(self, master, cnf, **kw) self.geometry('+{}+{}'.format( self.neuron.DISPLAY_SIZE - self.LEFT_OFFSET, 0)) self.bind('<Destroy>', self.neuron.exit) self.title(self.WINDOW_TITLE) self.reload_button = Button(self, text='Reload', command=self.load_media) self.reload_button.pack(in_=self, fill=BOTH, **self.PADS) self.swap_screen_button = Button(self, text='Swap Screen', command=self.neuron.swap_screen) self.swap_screen_button.pack(in_=self, fill=BOTH, **self.PADS) self.full_screen_button = Button(self, text='Full Screen', command=self.set_full_screen) self.full_screen_button.pack(in_=self, fill=BOTH, **self.PADS) self.controls_frame = LabelFrame(self, text='Controls:') self.controls_frame.pack(**self.PADS) self.slides_frame = Frame(self) self.slides_frame.pack(in_=self.controls_frame, **self.PADS) self.slides = [] for name, size in self.SLIDES: slide = Slide(self, size=size, command=self.slide_command, text=name) slide.pack(in_=self.slides_frame, side=LEFT, fill=Y, **self.PADS) self.slides.append(slide) self.decide_button = Button(self, text='Decide!', command=self.decide_command) self.decide_button.pack(in_=self.controls_frame, fill=BOTH, **self.PADS) self.fullscreen = FALSE self.images = [] self.animations = [] self.vlc_instance = vlc.Instance() self.player = self.vlc_instance.media_player_new() self.videos = [] self.load_media() self.gif_player = GifPlayer(self.neuron) self.decide_command() pygame.init() pygame.joystick.init() self.pygame_mainloop()
def handler(event, context): # clear /tmp folder common.cleanup() log.debug("Received event {}".format(json.dumps(event))) project_id = event["project_id"] s = Slide(event) # try: s.render() if not s.error: # UPDATE COUNTER numSlidesLeft = common.decrementCounter(project_id, 'counter_slides') if numSlidesLeft == 0: triggerTransitions(project_id, context)
def decide_command(self): if self.gif_player.play_count: return self.gif_player.play(self.animations[Slide.get_values()], after_cb=self.slide_command) if self.vlc_is_idle_media: self.vlc_is_idle_media = False if self.slides[0].get_value() - self.slides[1].get_value() >= 2: self.vlc_list_player.play_item_at_index(1) else: self.vlc_list_player.play_item_at_index(2)
def decide_command(self): if self.gif_player.play_count: return self.gif_player.play(self.animations[Slide.get_values()], after_cb=self.slide_command)
def slide_command(self, *_, **__): if self.gif_player.play_count: return self.gif_player.play(self.images[Slide.get_values()])