X-Git-Url: https://git.artsoft.org/?a=blobdiff_plain;ds=sidebyside;f=src%2Flibgame%2Fsound.h;h=ec5a2a8b8c2a0a13d7382cb4a7e5a6dd73dfe72f;hb=1e4d3fd0343fa76d5d1e2803b33bb6faa97403d4;hp=5d27f20a9f6f6547cedf369903cb8b921941689c;hpb=2f1f47c267eb7b16d95eb25cfb53eb5effedea9a;p=rocksndiamonds.git diff --git a/src/libgame/sound.h b/src/libgame/sound.h index 5d27f20a..ec5a2a8b 100644 --- a/src/libgame/sound.h +++ b/src/libgame/sound.h @@ -1,7 +1,7 @@ /*********************************************************** * Artsoft Retro-Game Library * *----------------------------------------------------------* -* (c) 1994-2001 Artsoft Entertainment * +* (c) 1994-2002 Artsoft Entertainment * * Holger Schemel * * Detmolder Strasse 189 * * 33604 Bielefeld * @@ -70,69 +70,58 @@ /* values for PlaySound(), StopSound() and friends */ -#define SND_CTRL_NONE (0) -#define SND_CTRL_MUSIC (1 << 0) -#define SND_CTRL_LOOP (1 << 1) -#define SND_CTRL_FADE (1 << 2) -#define SND_CTRL_STOP (1 << 3) -#define SND_CTRL_ALL_SOUNDS (1 << 4) -#define SND_CTRL_RELOAD_SOUNDS (1 << 5) -#define SND_CTRL_RELOAD_MUSIC (1 << 6) - -#define SND_CTRL_PLAY_SOUND (SND_CTRL_NONE) -#define SND_CTRL_PLAY_LOOP (SND_CTRL_LOOP) -#define SND_CTRL_PLAY_MUSIC (SND_CTRL_LOOP | SND_CTRL_MUSIC) - -#define SND_CTRL_FADE_SOUND (SND_CTRL_FADE) -#define SND_CTRL_FADE_MUSIC (SND_CTRL_FADE | SND_CTRL_MUSIC) -#define SND_CTRL_FADE_ALL (SND_CTRL_FADE | SND_CTRL_ALL_SOUNDS) - -#define SND_CTRL_STOP_SOUND (SND_CTRL_STOP) -#define SND_CTRL_STOP_MUSIC (SND_CTRL_STOP | SND_CTRL_MUSIC) -#define SND_CTRL_STOP_ALL (SND_CTRL_STOP | SND_CTRL_ALL_SOUNDS) - -#define IS_MUSIC(x) ((x).state & SND_CTRL_MUSIC) -#define IS_LOOP(x) ((x).state & SND_CTRL_LOOP) -#define IS_FADING(x) ((x).state & SND_CTRL_FADE) -#define IS_STOPPING(x) ((x).state & SND_CTRL_STOP) -#define IS_RELOADING(x) ((x).state & (SND_CTRL_RELOAD_SOUNDS | \ - SND_CTRL_RELOAD_MUSIC)) -#define ALL_SOUNDS(x) ((x).state & SND_CTRL_ALL_SOUNDS) - - -#if !defined(TARGET_ALLEGRO) - -#define PSND_SILENCE 0 -#define PSND_MAX_VOLUME_BITS 15 -#define PSND_MIN_VOLUME 0 -#define PSND_MAX_VOLUME (1 << PSND_MAX_VOLUME_BITS) -#define PSND_MIDDLE 0 -#define PSND_MAX_STEREO_BITS 7 -#define PSND_MAX_STEREO (1 << PSND_MAX_STEREO_BITS) -#define PSND_MAX_LEFT (-PSND_MAX_STEREO) -#define PSND_MAX_RIGHT (+PSND_MAX_STEREO) -#define PSND_MAX_LEFT2RIGHT_BITS (PSND_MAX_STEREO_BITS+1) -#define PSND_MAX_LEFT2RIGHT (1 << PSND_MAX_LEFT2RIGHT_BITS) - -#else /* TARGET_ALLEGRO */ - -#define PSND_SILENCE 0 -#define PSND_MIN_VOLUME 0 -#define PSND_MAX_VOLUME 255 -#define PSND_MAX_LEFT 0 -#define PSND_MAX_RIGHT 255 -#define PSND_MIDDLE 128 - +#define SND_CTRL_NONE (0) +#define SND_CTRL_MUSIC (1 << 0) +#define SND_CTRL_LOOP (1 << 1) +#define SND_CTRL_FADE (1 << 2) +#define SND_CTRL_STOP (1 << 3) +#define SND_CTRL_ALL_SOUNDS (1 << 4) +#define SND_CTRL_RELOAD_SOUNDS (1 << 5) +#define SND_CTRL_RELOAD_MUSIC (1 << 6) + +#define SND_CTRL_PLAY_SOUND (SND_CTRL_NONE) +#define SND_CTRL_PLAY_LOOP (SND_CTRL_LOOP) +#define SND_CTRL_PLAY_MUSIC (SND_CTRL_LOOP | SND_CTRL_MUSIC) + +#define SND_CTRL_FADE_SOUND (SND_CTRL_FADE) +#define SND_CTRL_FADE_MUSIC (SND_CTRL_FADE | SND_CTRL_MUSIC) +#define SND_CTRL_FADE_ALL (SND_CTRL_FADE | SND_CTRL_ALL_SOUNDS) + +#define SND_CTRL_STOP_SOUND (SND_CTRL_STOP) +#define SND_CTRL_STOP_MUSIC (SND_CTRL_STOP | SND_CTRL_MUSIC) +#define SND_CTRL_STOP_ALL (SND_CTRL_STOP | SND_CTRL_ALL_SOUNDS) + +#define IS_MUSIC(x) ((x).state & SND_CTRL_MUSIC) +#define IS_LOOP(x) ((x).state & SND_CTRL_LOOP) +#define IS_FADING(x) ((x).state & SND_CTRL_FADE) +#define IS_STOPPING(x) ((x).state & SND_CTRL_STOP) +#define IS_RELOADING(x) ((x).state & (SND_CTRL_RELOAD_SOUNDS |\ + SND_CTRL_RELOAD_MUSIC)) +#define ALL_SOUNDS(x) ((x).state & SND_CTRL_ALL_SOUNDS) + +#define SOUND_MIN_VOLUME 0 +#if defined(TARGET_SDL) +#define SOUND_MAX_VOLUME SDL_MIX_MAXVOLUME +#elif defined(TARGET_ALLEGRO) +#define SOUND_MAX_VOLUME 255 +#else +#define SOUND_MAX_VOLUME 128 #endif +#define SOUND_MAX_LEFT 0 +#define SOUND_MAX_RIGHT 255 +#define SOUND_MAX_LEFT2RIGHT 255 +#define SOUND_MIDDLE (SOUND_MAX_LEFT2RIGHT / 2) + /* value for undefined sound effect filename */ -#define SND_FILE_UNDEFINED "NONE" +#define SND_FILE_UNDEFINED "NONE" struct SoundEffectInfo { char *text; char *default_filename; + char *filename; };