Exemplo n.º 1
0
 def musicFadeOut(self):
     if self.__backgroundMode == _VIDEO_BG_MODE:
         WWISE.WW_eventGlobalSync('loginscreen_music_pause')
         self.__backgroundMode = _WALLPAPER_BG_MODE
     else:
         WWISE.WW_eventGlobalSync('loginscreen_ambient_stop')
         self.__backgroundMode = _VIDEO_BG_MODE
     self.__saveLastBackgroundMode()
 def stop(self):
     if self.__event is not None:
         if self.__eventID == MUSIC_EVENT_COMBAT_LOADING:
             WWISE.WW_eventGlobalSync('ue_stop_loadscreen_music')
         elif self.__eventID >= MUSIC_EVENT_COMBAT_VICTORY and self.__eventID <= MUSIC_EVENT_COMBAT_DRAW:
             WWISE.WW_eventGlobalSync('ue_events_hangar_stop_afterBattleMusic')
         else:
             self.__event.stop()
     return
Exemplo n.º 3
0
 def switch(self):
     if self.__bgMode != _BG_MODE_VIDEO:
         self.__bgMode = _BG_MODE_VIDEO
         self.__view.as_showLoginVideoS(_LOGIN_VIDEO_FILE, self.__bufferTime, self.__isSoundMuted)
     else:
         self.__bgMode = _BG_MODE_WALLPAPER
         self.__view.as_showWallpaperS(self.__show, self.__randomImage(), self.__switchButton, self.__isSoundMuted)
     WWISE.WW_eventGlobalSync(('loginscreen_music_resume', 'loginscreen_ambient_start')[self.__bgMode])
     if self.__isSoundMuted:
         WWISE.WW_eventGlobalSync('loginscreen_mute')
Exemplo n.º 4
0
 def setSoundSystem(self, soundSystemID):
     if soundSystemID == _LAPTOP_SOUND_PRESET:
         wwiseEvent = 'ue_set_preset_acoustic_device_laptop'
         soundSystemID = 0
         WWISE.WW_setSoundSystem(soundSystemID)
         WWISE.WW_eventGlobalSync(wwiseEvent)
     else:
         wwiseEvent = 'ue_set_preset_acoustic_device_reset'
         WWISE.WW_eventGlobalSync(wwiseEvent)
         WWISE.WW_setSoundSystem(soundSystemID)
     LOG_DEBUG('WWISE: triggered {0}'.format(wwiseEvent))
     LOG_DEBUG('WWISE: sound system has been applied: %d' % soundSystemID)
Exemplo n.º 5
0
 def onEnvStart(self, environment):
     state = _envStateDefs.get(environment, None)
     if state is not None:
         if self.__states:
             prev = self.__states[-1]
             prevState = _envStateDefs[prev]
             if not prevState[2]:
                 LOG_DEBUG('Set UE state: %s' % prevState[1])
                 WWISE.WW_eventGlobalSync(prevState[1])
         LOG_DEBUG('Set UE state: %s' % state[0])
         WWISE.WW_eventGlobalSync(state[0])
         self.__states.append(environment)
     return
Exemplo n.º 6
0
 def onEnvStop(self, environment):
     for i in xrange(len(self.__states) - 1, -1, -1):
         if environment == self.__states[i]:
             if i == len(self.__states) - 1:
                 prevState = _envStateDefs[environment]
                 LOG_DEBUG('Set UE state: %s' % prevState[1])
                 WWISE.WW_eventGlobalSync(prevState[1])
             del self.__states[i]
             if self.__states:
                 prev = self.__states[-1]
                 prevState = _envStateDefs[prev]
                 if not prevState[2]:
                     LOG_DEBUG('Set UE state: %s' % prevState[0])
                     WWISE.WW_eventGlobalSync(prevState[0])
Exemplo n.º 7
0
 def setBassBoost(self, isEnabled):
     if isEnabled:
         wwiseEvent = 'ue_set_preset_bassboost_on'
     else:
         wwiseEvent = 'ue_set_preset_bassboost_off'
     WWISE.WW_eventGlobalSync(wwiseEvent)
     LOG_DEBUG('WWISE: triggered {0}'.format(wwiseEvent))
Exemplo n.º 8
0
 def _dispose(self):
     if self.__backgroundMode == _VIDEO_BG_MODE:
         WWISE.WW_eventGlobalSync('loginscreen_music_stop_longfade')
     else:
         WWISE.WW_eventGlobalSync('loginscreen_ambient_stop')
     if self.__capsLockCallbackID is not None:
         BigWorld.cancelCallback(self.__capsLockCallbackID)
         self.__capsLockCallbackID = None
     connectionManager.onRejected -= self._onLoginRejected
     connectionManager.onKickWhileLoginReceived -= self._onKickedWhileLogin
     connectionManager.onQueued -= self._onHandleQueue
     self._servers.onServersStatusChanged -= self.__updateServersList
     g_playerEvents.onAccountShowGUI -= self._clearLoginView
     self._serversDP.fini()
     self._serversDP = None
     View._dispose(self)
     return
 def __setEnterState(self):
     if self.__enterState:
         LOG_DEBUG(
             'Set Enter UE sound state "{}" for previous finished environment: "{}"'
             .format(self.__enterState, self.__environment))
         WWISE.WW_eventGlobalSync(self.__enterState)
     self.__cbkID = None
     return
 def __setExitState(self):
     if self.__cbkID is not None:
         BigWorld.cancelCallback(self.__cbkID)
         self.__cbkID = None
         return
     else:
         if self.__exitState:
             LOG_DEBUG('Set Exit UE sound state "{}" for the stopped environment "{}"'.format(self.__exitState, self.__environment))
             WWISE.WW_eventGlobalSync(self.__exitState)
         return
Exemplo n.º 11
0
    def _loadRandomBgImage(self, showSwitchButton=True):
        wallpaperSettings = self.__loadLastBackgroundImage()
        wallpaperFiles = self.__getWallpapersList()
        BG_IMAGES_PATH = '../maps/login/%s.png'
        if wallpaperSettings['show'] and len(wallpaperFiles) > 0:
            if len(wallpaperFiles) == 1:
                newFile = wallpaperFiles[0]
            else:
                newFile = ''
                while True:
                    newFile = random.choice(wallpaperFiles)
                    if newFile != wallpaperSettings['filename']:
                        break

            self.__saveLastBackgroundImage(newFile)
            bgImage = BG_IMAGES_PATH % newFile
        else:
            bgImage = BG_IMAGES_PATH % '__login_bg'
            wallpaperSettings['show'] = False
        WWISE.WW_eventGlobalSync('loginscreen_ambient_start')
        if self.__isSoundMuted:
            WWISE.WW_eventGlobalSync('loginscreen_mute')
        self.as_showWallpaperS(wallpaperSettings['show'], bgImage,
                               showSwitchButton, self.__isSoundMuted)
Exemplo n.º 12
0
 def showWallpaper(self, showSwitchButton):
     self.__view.as_showWallpaperS(self.__show, self.__randomImage(),
                                   showSwitchButton, self.__isSoundMuted)
     WWISE.WW_eventGlobalSync('loginscreen_ambient_start')
     if self.__isSoundMuted:
         WWISE.WW_eventGlobalSync('loginscreen_mute')
Exemplo n.º 13
0
 def startVideoSound(self):
     WWISE.WW_eventGlobalSync('loginscreen_music_start')
     if self.__isSoundMuted:
         WWISE.WW_eventGlobalSync('loginscreen_mute')
Exemplo n.º 14
0
 def fadeSound(self):
     WWISE.WW_eventGlobalSync(('loginscreen_music_pause',
                               'loginscreen_ambient_stop')[self.__bgMode])
Exemplo n.º 15
0
 def toggleMute(self, value):
     self.__isSoundMuted = value
     WWISE.WW_eventGlobalSync(
         ('loginscreen_unmute', 'loginscreen_mute')[self.__isSoundMuted])
Exemplo n.º 16
0
 def hide(self):
     WWISE.WW_eventGlobalSync(('loginscreen_music_stop_longfade',
                               'loginscreen_ambient_stop')[self.__bgMode])
     self.__saveToPrefs()
Exemplo n.º 17
0
 def setMute(self, value):
     self.__isSoundMuted = value
     self.__saveLastMuteState()
     WWISE.WW_eventGlobalSync('loginscreen_mute' if self.
                              __isSoundMuted else 'loginscreen_unmute')
Exemplo n.º 18
0
 def sendGlobalEvent(self, eventName, **params):
     WWISE.WW_eventGlobalSync(eventName)
Exemplo n.º 19
0
 def switchBgMode(self):
     if self.__backgroundMode == _VIDEO_BG_MODE:
         self.as_showLoginVideoS('video/_login.usm', self.__isSoundMuted)
         WWISE.WW_eventGlobalSync('loginscreen_music_resume')
     else:
         self._loadRandomBgImage()