Mercurial > parpg-core
comparison src/parpg/sounds.py @ 182:59c9ce2b8351
PARPG now works with, and needs Fife 0.3.3.
author | KarstenBock@gmx.net |
---|---|
date | Tue, 11 Oct 2011 14:47:37 +0200 |
parents | 1fd2201f5c36 |
children |
comparison
equal
deleted
inserted
replaced
181:54c4277ed905 | 182:59c9ce2b8351 |
---|---|
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 |