Mercurial > touhou
comparison pytouhou/lib/sdl.pyx @ 528:7c3c90468996
Inherit music players from a base class.
author | Emmanuel Gil Peyrot <linkmauve@linkmauve.fr> |
---|---|
date | Wed, 18 Dec 2013 22:36:23 +0100 |
parents | b39ad30c6620 |
children | a7dc55ad9380 |
comparison
equal
deleted
inserted
replaced
527:db28538cd399 | 528:7c3c90468996 |
---|---|
64 mix_open_audio(44100, MIX_DEFAULT_FORMAT, 2, 4096) | 64 mix_open_audio(44100, MIX_DEFAULT_FORMAT, 2, 4096) |
65 except SDLError as error: | 65 except SDLError as error: |
66 logger.error(u'Impossible to set up audio subsystem: %s', error) | 66 logger.error(u'Impossible to set up audio subsystem: %s', error) |
67 self.sound = False | 67 self.sound = False |
68 else: | 68 else: |
69 mix_allocate_channels(MAX_CHANNELS) #TODO: make it dependent on the SFX number. | 69 # TODO: make it dependent on the number of sound files in the |
70 # archives. | |
71 mix_allocate_channels(MAX_SOUNDS) | |
70 | 72 |
71 def __exit__(self, *args): | 73 def __exit__(self, *args): |
72 if self.sound: | 74 if self.sound: |
73 Mix_CloseAudio() | 75 Mix_CloseAudio() |
74 Mix_Quit() | 76 Mix_Quit() |