コード例 #1
0
ファイル: sound_file.py プロジェクト: bcorfman/pug
 def play(self, event):
     from pygame import mixer
     if not mixer.get_init():
         mixer.init()
     if mixer.get_busy() and self.sound:
         self.sound.stop()
         return
     volume_attr = self.aguidata.get('volume')
     if volume_attr:
         volume = getattr(self.window.object, volume_attr)
     else:
         volume = 1
     try:
         sound = get_sound(self.get_control_value(), volume=volume)
         sound.play()
         self.sound = sound
     except:
         self.sound = None
     self.play_button_down = True
     self.looping = False
     wx.CallLater(0.1, self.test_button)
     event.Skip()
コード例 #2
0
ファイル: sound_file.py プロジェクト: bcorfman/pug
    def play(self, event):
        from pygame import mixer

        if not mixer.get_init():
            mixer.init()
        if mixer.get_busy() and self.sound:
            self.sound.stop()
            return
        volume_attr = self.aguidata.get("volume")
        if volume_attr:
            volume = getattr(self.window.object, volume_attr)
        else:
            volume = 1
        try:
            sound = get_sound(self.get_control_value(), volume=volume)
            sound.play()
            self.sound = sound
        except:
            self.sound = None
        self.play_button_down = True
        self.looping = False
        wx.CallLater(0.1, self.test_button)
        event.Skip()
コード例 #3
0
 def on_first_display(self, register_type="single"):
     "Set up sounds and register for mouse events"
     self.hover_sound_object = get_sound(self.hover_sound)
     self.click_sound_object = get_sound(self.click_sound)
     self.base_look = self.owner.tint
     self.owner.mouse_register(register_type)
コード例 #4
0
ファイル: On_Create_Sound.py プロジェクト: bcorfman/pug
 def setup(self):
     "setup(): Set up the sound. This is for ease of derivation."
     scene = PigDirector.scene #@UndefinedVariable
     self.sound_object = get_sound( self.sound, volume=self.volume)                
コード例 #5
0
 def setup(self):
     "setup(): Set up the sound. This is for ease of derivation."
     scene = PigDirector.scene  #@UndefinedVariable
     self.sound_object = get_sound(self.sound, volume=self.volume)
コード例 #6
0
ファイル: Spawner.py プロジェクト: bcorfman/pug
 def setup_spawner(self):
     "Setup for the spawner. Subclasses should call this."
     if self.sound:
         self.sound_object = get_sound( self.sound, volume=self.volume)
     if self.spawned_objects is None:
         self.spawned_objects = weakref.WeakValueDictionary()
コード例 #7
0
ファイル: Scene_Button.py プロジェクト: bcorfman/pug
 def on_first_display(self, register_type="single"):
     "Set up sounds and register for mouse events"
     self.hover_sound_object = get_sound(self.hover_sound)
     self.click_sound_object = get_sound(self.click_sound)
     self.base_look = self.owner.tint
     self.owner.mouse_register(register_type)
コード例 #8
0
ファイル: Spawner.py プロジェクト: bcorfman/pug
 def setup_spawner(self):
     "Setup for the spawner. Subclasses should call this."
     if self.sound:
         self.sound_object = get_sound(self.sound, volume=self.volume)
     if self.spawned_objects is None:
         self.spawned_objects = weakref.WeakValueDictionary()