Changeset 534 for abuse/trunk/src/sdlport
- Timestamp:
- Apr 22, 2011, 7:32:17 PM (12 years ago)
- Location:
- abuse/trunk/src/sdlport
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
abuse/trunk/src/sdlport/sound.cpp
r494 r534 218 218 if( sound_enabled ) 219 219 { 220 longsample_speed;220 int sample_speed; 221 221 222 222 #ifdef USE_SDL_MIXER -
abuse/trunk/src/sdlport/sound.h
r494 r534 9 9 */ 10 10 11 #ifndef __SOUND_H PP_12 #define __SOUND_H PP_11 #ifndef __SOUND_H__ 12 #define __SOUND_H__ 13 13 14 14 #ifdef USE_SDL_MIXER 15 # include <SDL/SDL_mixer.h>15 # include <SDL/SDL_mixer.h> 16 16 #endif 17 17 … … 23 23 int sound_init(int argc, char **argv); 24 24 void sound_uninit(); 25 void print_sound_options(); 25 void print_sound_options(); // print the options avaible for sound 26 26 27 27 class sound_effect 28 28 { 29 long size; 30 void *data; 29 public: 30 sound_effect(char *filename); 31 void play(int volume = 127, int pitch = 128, int panpot = 128); 32 ~sound_effect(); 33 34 private: 35 void *data; 31 36 #ifdef USE_SDL_MIXER 32 Mix_Chunk* chunk;37 Mix_Chunk* chunk; 33 38 #endif 34 public : 35 sound_effect(char *filename); 36 void play(int volume=127, int pitch=128, int panpot=128); 37 ~sound_effect(); 38 } ; 39 39 int size; 40 }; 40 41 41 42 class song 42 43 { 43 char *Name; 44 unsigned char *data; 45 unsigned long song_id; 44 public: 45 char const *name() { return Name; } 46 song(char const *filename); 47 void play(unsigned char volume=127); 48 void stop(long fadeout_time=0); // time in ms 49 int playing(); 50 void set_volume(int volume); 51 ~song(); 52 53 private: 54 char *Name; 55 unsigned char *data; 56 unsigned long song_id; 46 57 #ifdef USE_SDL_MIXER 47 Mix_Music* music;48 SDL_RWops* rw;58 Mix_Music* music; 59 SDL_RWops* rw; 49 60 #endif 50 public : 51 char const *name() { return Name; } 52 song(char const *filename); 53 void play(unsigned char volume=127); 54 void stop(long fadeout_time=0); // time in ms 55 int playing(); 56 void set_volume(int volume); 57 ~song(); 58 } ; 61 }; 62 59 63 #endif 60 64 61 62 63 64 65 66 67 68 69 70
Note: See TracChangeset
for help on using the changeset viewer.