comparison sounds.py @ 150:80672955ab70

PARPG now works with, and needs Fife 0.3.3.
author KarstenBock@gmx.net
date Tue, 11 Oct 2011 14:47:37 +0200
parents 7a89ea5404b1
children f131a1b01254
comparison
equal deleted inserted replaced
149:86656563555e 150:80672955ab70
12 12
13 # You should have received a copy of the GNU General Public License 13 # You should have received a copy of the GNU General Public License
14 # along with PARPG. If not, see <http://www.gnu.org/licenses/>. 14 # along with PARPG. If not, see <http://www.gnu.org/licenses/>.
15 15
16 # sounds.py holds the object code to play sounds and sound effects 16 # sounds.py holds the object code to play sounds and sound effects
17 from fife import fife
17 18
18 class SoundEngine: 19 class SoundEngine:
19 def __init__(self, fife_engine): 20 def __init__(self, fife_engine):
20 """Initialise the SoundEngine instance 21 """Initialise the SoundEngine instance
21 @type fife_engine: fine.Engine 22 @type fife_engine: fine.Engine
34 @type sfile: string 35 @type sfile: string
35 @param sfile: Filename to play 36 @param sfile: Filename to play
36 @return: None""" 37 @return: None"""
37 if(sfile is not None): 38 if(sfile is not None):
38 # setup the new sound 39 # setup the new sound
39 sound = self.engine.getSoundClipPool().addResourceFromFile(sfile) 40 sound = self.engine.getSoundClipManager().load(sfile)
40 self.music.setSoundClip(sound) 41 self.music.setSoundClip(sound)
41 self.music.setLooping(True) 42 self.music.setLooping(True)
42 self.music_init = True 43 self.music_init = True
43 self.music.play() 44 self.music.play()
44 self.music_on = True 45 self.music_on = True