X-Git-Url: http://git.xonotic.org/?a=blobdiff_plain;f=sound.h;h=4da72a1ef0219eb57e926c796447473dbcebf2bd;hb=refs%2Fheads%2Fterencehill%2Fbuiltin_fixes;hp=86839d17aba80a6c93e8a90d5c50043ee56de9a7;hpb=ff0e0fd9ea6ce001e9c2c6f9e18ecda6aef15d10;p=xonotic%2Fdarkplaces.git diff --git a/sound.h b/sound.h index 86839d17..4da72a1e 100644 --- a/sound.h +++ b/sound.h @@ -32,12 +32,13 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. #define DEFAULT_SOUND_PACKET_ATTENUATION 1.0 // Channel flags -#define CHANNELFLAG_NONE 0 -#define CHANNELFLAG_FORCELOOP (1 << 0) // force looping even if the sound is not looped -#define CHANNELFLAG_LOCALSOUND (1 << 1) // INTERNAL USE. Not settable by S_SetChannelFlag -#define CHANNELFLAG_PAUSED (1 << 2) -#define CHANNELFLAG_FULLVOLUME (1 << 3) // isn't affected by the general volume - +// These channel flags can be used for sound() builtins, with SOUNDFLAG_* names +#define CHANNELFLAG_NONE 0 +#define CHANNELFLAG_RELIABLE (1 << 0) // send as reliable message (only used on server) +#define CHANNELFLAG_FORCELOOP (1 << 1) // force looping even if the sound is not looped +#define CHANNELFLAG_LOCALSOUND (1 << 2) // INTERNAL USE. Not settable by S_SetChannelFlag +#define CHANNELFLAG_PAUSED (1 << 3) // pause status +#define CHANNELFLAG_FULLVOLUME (1 << 4) // isn't affected by the general volume // ==================================================================== // Types and variables @@ -62,7 +63,7 @@ void S_Terminate (void); void S_Startup (void); void S_Shutdown (void); -void S_UnloadAllSounds_f (void); +void S_UnloadAllSounds_f(cmd_state_t *cmd); void S_Update(const matrix4x4_t *listenermatrix); void S_ExtraUpdate (void); @@ -72,9 +73,7 @@ float S_SoundLength(const char *name); void S_ClearUsed (void); void S_PurgeUnused (void); qboolean S_IsSoundPrecached (const sfx_t *sfx); - -// for sound() builtins -#define CHANFLAG_RELIABLE 1 +sfx_t *S_FindName(const char *name); // these define the "engine" channel namespace #define CHAN_MIN_AUTO -128 @@ -97,13 +96,13 @@ qboolean S_IsSoundPrecached (const sfx_t *sfx); // S_StartSound returns the channel index, or -1 if an error occurred int S_StartSound (int entnum, int entchannel, sfx_t *sfx, vec3_t origin, float fvol, float attenuation); -int S_StartSound_StartPosition (int entnum, int entchannel, sfx_t *sfx, vec3_t origin, float fvol, float attenuation, float startposition); int S_StartSound_StartPosition_Flags (int entnum, int entchannel, sfx_t *sfx, vec3_t origin, float fvol, float attenuation, float startposition, int flags, float fspeed); qboolean S_LocalSound (const char *s); void S_StaticSound (sfx_t *sfx, vec3_t origin, float fvol, float attenuation); void S_StopSound (int entnum, int entchannel); void S_StopAllSounds (void); +void S_StopAllSounds_f(cmd_state_t *cmd); void S_PauseGameSounds (qboolean toggle); void S_StopChannel (unsigned int channel_ind, qboolean lockmutex, qboolean freesfx);