def create_play_pause_button(self, bb, action): """ Create Play/Pause button :param bb: bounding box :param action: event listener :return: play/pause button """ states = [] pause_state = State() pause_state.name = "pause" pause_state.bounding_box = bb pause_state.bgr = (0, 0, 0) pause_state.keyboard_key = kbd_keys[KEY_PLAY_PAUSE] pause_state.action = action pause_state.img_x = None pause_state.img_y = None pause_state.auto_update = True pause_state.image_align_v = V_ALIGN_CENTER pause_state.show_bgr = True pause_state.show_img = True pause_state.image_size_percent = 0.36 play_state = State() play_state.name = "play" play_state.bounding_box = bb play_state.bgr = (0, 0, 0) play_state.keyboard_key = kbd_keys[KEY_PLAY_PAUSE] play_state.action = action play_state.img_x = None play_state.img_y = None play_state.auto_update = True play_state.image_align_v = V_ALIGN_CENTER play_state.show_bgr = True play_state.show_img = True play_state.image_size_percent = 0.36 if self.config[PLAYER_SETTINGS][PAUSE]: states.append(play_state) states.append(pause_state) else: states.append(pause_state) states.append(play_state) return self.create_multi_state_button(states)
def create_play_pause_button(self, bb, action): """ Create Play/Pause button :param bb: bounding box :param action: event listener :return: play/pause button """ states = [] bgr = self.config[BACKGROUND][MENU_BGR_COLOR] pause_state = State() pause_state.name = "pause" pause_state.bounding_box = bb pause_state.bgr = bgr pause_state.keyboard_key = kbd_keys[KEY_PLAY_PAUSE] pause_state.action = action pause_state.img_x = None pause_state.img_y = None pause_state.auto_update = True pause_state.image_align_v = V_ALIGN_CENTER pause_state.show_bgr = True pause_state.show_img = True pause_state.image_size_percent = 0.36 pause_state.rest_commands = ["playpause"] play_state = State() play_state.name = "play" play_state.bounding_box = bb play_state.bgr = bgr play_state.keyboard_key = kbd_keys[KEY_PLAY_PAUSE] play_state.action = action play_state.img_x = None play_state.img_y = None play_state.auto_update = True play_state.image_align_v = V_ALIGN_CENTER play_state.show_bgr = True play_state.show_img = True play_state.image_size_percent = 0.36 play_state.rest_commands = ["playpause"] states.append(pause_state) states.append(play_state) return self.create_multi_state_button(states)
def create_time_volume_button(self, bb, action): """ Create Time/Volume two states button :param bb: bounding box :param action: event listener :return: Time/Volume button """ states = [] bgr = self.config[BACKGROUND][MENU_BGR_COLOR] volume_state = State() volume_state.name = "speaker" volume_state.bounding_box = bb volume_state.bgr = bgr volume_state.keyboard_key = kbd_keys[KEY_SETUP] volume_state.action = action volume_state.img_x = None volume_state.img_y = None volume_state.auto_update = True volume_state.image_align_v = V_ALIGN_CENTER volume_state.show_bgr = True volume_state.show_img = True volume_state.image_size_percent = 0.36 states.append(volume_state) time_state = State() time_state.name = "time" time_state.bounding_box = bb time_state.bgr = bgr time_state.keyboard_key = kbd_keys[KEY_SETUP] time_state.action = action time_state.img_x = None time_state.img_y = None time_state.auto_update = True time_state.image_align_v = V_ALIGN_CENTER time_state.show_bgr = True time_state.show_img = True time_state.image_size_percent = 0.36 states.append(time_state) return self.create_multi_state_button(states)
def create_play_pause_button(self, bb, action): """ Create Play/Pause button :param bb: bounding box :param action: event listener :return: play/pause button """ states = [] pause_state = State() pause_state.name = "pause" pause_state.bounding_box = bb pause_state.bgr = (0, 0, 0) pause_state.keyboard_key = kbd_keys[KEY_PLAY_PAUSE] pause_state.action = action pause_state.img_x = None pause_state.img_y = None pause_state.auto_update = True pause_state.image_align_v = V_ALIGN_CENTER pause_state.show_bgr = True pause_state.show_img = True states.append(pause_state) play_state = State() play_state.name = "play" play_state.bounding_box = bb play_state.bgr = (0, 0, 0) play_state.keyboard_key = kbd_keys[KEY_PLAY_PAUSE] play_state.action = action play_state.img_x = None play_state.img_y = None play_state.auto_update = True play_state.image_align_v = V_ALIGN_CENTER play_state.show_bgr = True play_state.show_img = True states.append(play_state) return self.create_multi_state_button(states)