def play(event, init, play_press, ready): if (event.type == pygame.MOUSEBUTTONDOWN and event.button == 1 and play_press.collidepoint(event.pos) and init): init = False ready = True play_sound(swooshing) return init, ready
def show(self, button_label, info, title=None, timeout=UNSET_TIMEOUT, sound=False): self.check_destroy() # Data self.time = time.time() self.information = info self.title = self.default_title if title is None else title self.button.set_tooltip_text(lang.button_open if info is not None else lang.button_remove) # Timer self.check_timer() if timeout != UNSET_TIMEOUT: self.timer = gobject.timeout_add(timeout, self.hide) # Show self.box.show() self.is_visible = True self.label.set_markup(button_label) # Play sound if self.gui.main.settings.is_true("infosound", True) and ((info is None and not self.passive) or sound): play_sound(self.gui.main, "theme:dialog-%s" % self.dtype) # Show GUI if not shown so the user does notices the message if not self.gui.is_shown: gobject.idle_add(self.gui.show_gui)
def callBack(channel): print channel if channel == 17: sd.play_sound(0) if channel == 18: sd.play_sound(1) if channel == 27: sd.play_sound(2) if channel == 22: sd.play_sound(3) if channel == 23: sd.play_sound(4)
def show(self, item_id, *args): if (item_id == -1 or item_id == self.last_id) and len(self.items) > 0: item = self.items.pop(0) try: self.last_id = self.send(item) # In very strange cases the dbus might go aways while we're running # so lets try to grab it again except dbus.exceptions.DBusException: log_error('DBUS error') self.init_dbus() self.last_id = self.send(item) # Play the sound play_sound(self.main, item[3])
def play_break_sound(self, player=None, position=None): if self.break_sound is not None: sounds.play_sound(self.break_sound, player=player, position=position)
def bird_player(event, game, flapped): if (game and event.type == pygame.KEYDOWN and event.key == pygame.K_SPACE): flapped = True play_sound(wing) return flapped
def play_break_sound(self, player: custom_types.Player, position=None): if self.break_sound is not None: sounds.play_sound(self.break_sound, player=player, position=position)
def set_mode(new_mode, silent=False): global mode mode = new_mode if not silent: if new_mode == IMMEDIATE_MODE: play_sound("mode imm") elif new_mode == COMMAND_MODE: play_sound("mode cmd")