Browse Source

name change for AudioManagers

Dave Schuyler 24 years ago
parent
commit
46b3078d1b
2 changed files with 7 additions and 10 deletions
  1. 1 1
      direct/src/showbase/Loader.py
  2. 6 9
      direct/src/showbase/ShowBase.py

+ 1 - 1
direct/src/showbase/Loader.py

@@ -145,7 +145,7 @@ class Loader:
         Loader.notify.debug("Loading sound: %s" % (soundPath) )
         Loader.notify.debug("Loading sound: %s" % (soundPath) )
         if phaseChecker:
         if phaseChecker:
             phaseChecker(soundPath)
             phaseChecker(soundPath)
-        sound = base.effectsAudioManager.getSound(soundPath)
+        sound = base.sfxManager.getSound(soundPath)
         return sound
         return sound
 
 
     def unloadSound(self, sound):
     def unloadSound(self, sound):

+ 6 - 9
direct/src/showbase/ShowBase.py

@@ -36,9 +36,6 @@ class ShowBase:
         # Store dconfig variables
         # Store dconfig variables
         self.wantTk = self.config.GetBool('want-tk', 0)
         self.wantTk = self.config.GetBool('want-tk', 0)
         self.wantAnySound = self.config.GetBool('want-sound', 1)
         self.wantAnySound = self.config.GetBool('want-sound', 1)
-        if not self.wantAnySound:
-            self.effectsAudioManager.setActive(0)
-            self.musicAudioManager.setActive(0)
         self.wantSfx = self.config.GetBool('audio-sfx-active', 1)
         self.wantSfx = self.config.GetBool('audio-sfx-active', 1)
         self.wantMusic = self.config.GetBool('audio-music-active', 1)
         self.wantMusic = self.config.GetBool('audio-music-active', 1)
         if not (self.wantSfx or self.wantMusic):
         if not (self.wantSfx or self.wantMusic):
@@ -276,17 +273,17 @@ class ShowBase:
 
 
     def createAudioManager(self):
     def createAudioManager(self):
         if self.wantAnySound:
         if self.wantAnySound:
-            self.effectsAudioManager = AudioManager.createAudioManager()
-            self.musicAudioManager = AudioManager.createAudioManager()
+            self.sfxManager = AudioManager.createAudioManager()
+            self.musicManager = AudioManager.createAudioManager()
 
 
     def loadSfx(self, name):
     def loadSfx(self, name):
         if (name and base.wantSfx):
         if (name and base.wantSfx):
-            sound=self.effectsAudioManager.getSound(name)
+            sound=self.sfxManager.getSound(name)
             return sound
             return sound
 
 
     def loadMusic(self, name):
     def loadMusic(self, name):
         if (name and base.wantMusic):
         if (name and base.wantMusic):
-            sound=self.musicAudioManager.getSound(name)
+            sound=self.musicManager.getSound(name)
             return sound
             return sound
 
 
     def unloadSfx(self, sfx):
     def unloadSfx(self, sfx):
@@ -310,12 +307,12 @@ class ShowBase:
     def playMusic(self, music, looping = 0, interupt = 1, volume = None,
     def playMusic(self, music, looping = 0, interupt = 1, volume = None,
                   restart = None, time = 0.):
                   restart = None, time = 0.):
         if (music and base.wantMusic):
         if (music and base.wantMusic):
+            if volume != None:
+                music.setVolume(volume)
             if interupt or (music.status() != AudioSound.PLAYING):
             if interupt or (music.status() != AudioSound.PLAYING):
                 music.setTime(time)
                 music.setTime(time)
                 music.setLoop(looping)
                 music.setLoop(looping)
                 music.play()
                 music.play()
-            if volume != None:
-                music.setVolume(volume)
             if restart:
             if restart:
                 restart[0].accept("restart-music", restart[1])
                 restart[0].accept("restart-music", restart[1])