Exemplo n.º 1
0
    def stopAllSounds(self):
        SOUND_DEBUG('Stop all music and sounds')
        for container in self._customEnvs.itervalues():
            for env in container.itervalues():
                env.stop()

        self._customEnvs.clear()
        for fID in self._filters.iterkeys():
            snd_filters.get(fID).stop()

        self._filters.clear()
        if _MC.g_musicController is not None:
            _MC.g_musicController.stop()
        return
Exemplo n.º 2
0
    def stopAllSounds(self):
        SOUND_DEBUG('Stop all music and sounds')
        for container in self._customEnvs.itervalues():
            for env in container.itervalues():
                env.stop()

        self._customEnvs.clear()
        for fID in self._filters.iterkeys():
            snd_filters.get(fID).stop()

        self._filters.clear()
        if _MC.g_musicController is not None:
            _MC.g_musicController.stop()
        return
Exemplo n.º 3
0
    def _clearSoundEnv(self, env):
        env.stop()
        env.onChanged -= self.__onAmbientChanged
        for fID in env.getFilters():
            self._filters[fID] -= 1
            if self._filters[fID] <= 0:
                f = snd_filters.get(fID)
                f.stop()
                SOUND_DEBUG('Filter has been stopped', f)

        return env
Exemplo n.º 4
0
    def _clearSoundEnv(self, env):
        env.stop()
        env.onChanged -= self.__onAmbientChanged
        for fID in env.getFilters():
            self._filters[fID] -= 1
            if self._filters[fID] <= 0:
                f = snd_filters.get(fID)
                f.stop()
                SOUND_DEBUG('Filter has been stopped', f)

        return env
Exemplo n.º 5
0
    def _buildSoundEnv(self, soundEnvClass):
        env = soundEnvClass(self._soundsCtrl)
        env.start()
        env.onChanged += self.__onAmbientChanged
        for fID in env.getFilters():
            self._filters[fID] += 1
            if self._filters[fID] == 1:
                f = snd_filters.get(fID)
                f.start()
                SOUND_DEBUG('Filter has been started', f)

        return env
Exemplo n.º 6
0
    def _buildSoundEnv(self, soundEnvClass):
        env = soundEnvClass(self._soundsCtrl)
        env.start()
        env.onChanged += self.__onAmbientChanged
        for fID in env.getFilters():
            self._filters[fID] += 1
            if self._filters[fID] == 1:
                f = snd_filters.get(fID)
                f.start()
                SOUND_DEBUG('Filter has been started', f)

        return env
Exemplo n.º 7
0
 def __init__(self, soundsCtrl):
     self.filter = weakref.proxy(snd_filters.get(SoundFilters.FORT_FILTER))
     super(FortEnv,
           self).__init__(soundsCtrl,
                          'fort',
                          ambient=SoundEvent(
                              _MC.AMBIENT_EVENT_LOBBY_FORT, {
                                  self.filter.getDefencePeriodField(): 0,
                                  self.filter.getBuildNumberField(): 0,
                                  self.filter.getTransportModeField(): 0
                              }),
                          filters=(SoundFilters.FORT_FILTER,
                                   SoundFilters.FILTERED_HANGAR))
Exemplo n.º 8
0
 def __init__(self, soundsCtrl):
     self.filter = weakref.proxy(snd_filters.get(SoundFilters.FORT_FILTER))
     super(FortEnv, self).__init__(soundsCtrl, 'fort', ambient=SoundEvent(_MC.AMBIENT_EVENT_LOBBY_FORT, {self.filter.getDefencePeriodField(): 0,
      self.filter.getBuildNumberField(): 0,
      self.filter.getTransportModeField(): 0}), filters=(SoundFilters.FORT_FILTER, SoundFilters.FILTERED_HANGAR))