Inexor
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Classes | Functions | Variables
inexor::sound Namespace Reference

Classes

struct  soundsample
 
struct  soundslot
 
struct  soundconfig
 
struct  soundchannel
 
struct  soundtype
 

Functions

 VARFP (mumble, 0, 0, 1,{if(mumble) initmumble();else closemumble();})
 
void initmumble ()
 
void closemumble ()
 
static vec mumblevec (const vec &v, bool pos=false)
 
void updatemumble ()
 
soundchannelnewchannel (int n, soundslot *slot, const vec *loc=nullptr, extentity *ent=nullptr, int flags=0, int radius=0)
 
void freechannel (int n)
 
void syncchannel (soundchannel &chan)
 
void stopchannels ()
 
 VARFP (soundvol, 0, 255, 255, if(!soundvol){stopchannels();})
 
 VARF (soundchans, 1, 32, 128, initwarning("sound configuration", INIT_RESET, CHANGE_SOUND))
 
 VARF (soundfreq, 0, 44100, 44100, initwarning("sound configuration", INIT_RESET, CHANGE_SOUND))
 
 VARF (soundbufferlen, 128, 1024, 4096, initwarning("sound configuration", INIT_RESET, CHANGE_SOUND))
 
void initsound ()
 
static void cleanupsamples ()
 
void registersound (char *name, int *vol)
 
 COMMAND (registersound,"si")
 
void mapsound (char *name, int *vol, int *maxuses)
 
 COMMAND (mapsound,"sii")
 
void altsound (char *name, int *vol)
 
 COMMAND (altsound,"si")
 
void altmapsound (char *name, int *vol)
 
 COMMAND (altmapsound,"si")
 
void soundreset ()
 
 COMMAND (soundreset,"")
 
void mapsoundreset ()
 
 COMMAND (mapsoundreset,"")
 
void resetchannels ()
 
void clear_sound ()
 
void stopmapsounds ()
 
void clearmapsounds ()
 
void stopmapsound (extentity *e)
 
void checkmapsounds ()
 
 VAR (stereo, 0, 1, 1)
 
 VARP (maxsoundradius, 0, 340, 10000)
 
bool updatechannel (soundchannel &chan)
 
void reclaimchannels ()
 
void syncchannels ()
 
void updatesounds ()
 
 VARP (maxsoundsatonce, 0, 7, 100)
 
 VAR (dbgsound, 0, 0, 1)
 
void preloadsound (int n)
 
void preloadmapsound (int n)
 
void preloadmapsounds ()
 
int playsound (int n, const vec *loc, extentity *ent, int flags, int loops, int fade, int chanid, int radius, int expire)
 
void stopsounds ()
 
bool stopsound (int n, int chanid, int fade)
 
int playsoundname (const char *s, const vec *loc, int vol, int flags, int loops, int fade, int chanid, int radius, int expire)
 
void sound (int *n)
 
 COMMAND (sound,"i")
 
void resetsound ()
 
 COMMAND (resetsound,"")
 

Variables

bool nosound = true
 
vector< soundchannelchannels
 
int maxchannels = 0
 
static hashnameset< soundsamplesamples
 
static struct
inexor::sound::soundtype 
gamesounds
 
static struct
inexor::sound::soundtype 
mapsounds
 
SharedVar< int > soundchans
 
SharedVar< int > soundfreq
 
SharedVar< int > soundbufferlen
 

Class Documentation

struct inexor::sound::soundslot
Class Members
soundsample * sample
int volume

Function Documentation

void inexor::sound::altmapsound ( char *  name,
int *  vol 
)
void inexor::sound::altsound ( char *  name,
int *  vol 
)
void inexor::sound::checkmapsounds ( )
static void inexor::sound::cleanupsamples ( )
static
void inexor::sound::clear_sound ( )
void inexor::sound::clearmapsounds ( )
void inexor::sound::closemumble ( )

References NULL.

Referenced by clear_sound(), and initmumble().

inexor::sound::COMMAND ( registersound  ,
"si"   
)
inexor::sound::COMMAND ( mapsound  ,
"sii"   
)
inexor::sound::COMMAND ( altsound  ,
"si"   
)
inexor::sound::COMMAND ( altmapsound  ,
"si"   
)
inexor::sound::COMMAND ( soundreset  ,
""   
)
inexor::sound::COMMAND ( mapsoundreset  ,
""   
)
inexor::sound::COMMAND ( sound  ,
"i"   
)
inexor::sound::COMMAND ( resetsound  ,
""   
)
void inexor::sound::freechannel ( int  n)
void inexor::sound::initmumble ( )
void inexor::sound::initsound ( )

References maxchannels, nosound, and soundchans.

Referenced by main(), and resetsound().

void inexor::sound::mapsound ( char *  name,
int *  vol,
int *  maxuses 
)
void inexor::sound::mapsoundreset ( )
static vec inexor::sound::mumblevec ( const vec v,
bool  pos = false 
)
inlinestatic

References vec::div().

Referenced by updatemumble().

soundchannel& inexor::sound::newchannel ( int  n,
soundslot *  slot,
const vec loc = nullptr,
extentity ent = nullptr,
int  flags = 0,
int  radius = 0 
)
int inexor::sound::playsound ( int  n,
const vec loc,
extentity ent,
int  flags,
int  loops,
int  fade,
int  chanid,
int  radius,
int  expire 
)

References camera1, channels, inexor::sound::soundconfig::chooseslot(), inexor::sound::soundchannel::clearloc(), inexor::sound::soundtype::configs, vec::dist(), freechannel(), gamesounds, inexor::sound::soundchannel::hasloc(), inexor::sound::soundchannel::loc, Log, loopv, mapsounds, maxchannels, inexor::sound::soundconfig::maxuses, inexor::rpc::min(), inexor::rendering::screen::ScreenManager::minimized, inexor::sound::soundsample::name, newchannel(), nosound, physent::o, inexor::sound::soundtype::playing(), inexor::sound::soundslot::sample, inexor::rendering::screen::screen_manager, inexor::sound::soundtype::slots, SND_MAP, inexor::util::log_manager::std, syncchannel(), totalmillis, and updatechannel().

Referenced by game::checkattacksound(), game::checkidlesound(), checkmapsounds(), entities::checkquad(), entities::checktriggers(), game::cycleweapon(), game::damaged(), game::deathstate(), game::collectclientmode::deposittokens(), game::ctfclientmode::dropflag(), game::collectclientmode::droptoken(), game::collectclientmode::expiretoken(), game::explode(), game::gunselect(), game::hit(), entities::jumppadeffects(), game::msgsound(), game::nextweapon(), game::parsemessages(), game::physicstrigger(), entities::pickupeffects(), playsoundname(), game::projsplash(), game::ctfclientmode::resetflag(), game::ctfclientmode::returnflag(), game::ctfclientmode::scoreflag(), game::setweapon(), game::shoteffects(), sound(), game::collectclientmode::stealtoken(), game::ctfclientmode::takeflag(), game::collectclientmode::taketoken(), entities::teleporteffects(), entities::trypickup(), entities::unlocktriggers(), and game::captureclientmode::updatebase().

int inexor::sound::playsoundname ( const char *  s,
const vec loc,
int  vol,
int  flags,
int  loops,
int  fade,
int  chanid,
int  radius,
int  expire 
)
void inexor::sound::preloadmapsound ( int  n)
void inexor::sound::preloadmapsounds ( )
void inexor::sound::preloadsound ( int  n)
void inexor::sound::reclaimchannels ( )

References channels, and loopv.

Referenced by updatesounds().

void inexor::sound::registersound ( char *  name,
int *  vol 
)
void inexor::sound::resetchannels ( )

References channels, freechannel(), and loopv.

Referenced by clear_sound(), and resetsound().

void inexor::sound::resetsound ( )
void inexor::sound::sound ( int *  n)
void inexor::sound::soundreset ( )
void inexor::sound::stopchannels ( )
void inexor::sound::stopmapsound ( extentity e)
void inexor::sound::stopmapsounds ( )

References channels, freechannel(), and loopv.

Referenced by clearmapsounds(), and updatesounds().

bool inexor::sound::stopsound ( int  n,
int  chanid,
int  fade 
)
void inexor::sound::stopsounds ( )

References channels, freechannel(), and loopv.

Referenced by renderbackground(), and updatesounds().

void inexor::sound::syncchannel ( soundchannel &  chan)
void inexor::sound::syncchannels ( )
bool inexor::sound::updatechannel ( soundchannel &  chan)
void inexor::sound::updatemumble ( )
void inexor::sound::updatesounds ( )
inexor::sound::VAR ( stereo  ,
,
,
 
)
inexor::sound::VAR ( dbgsound  ,
,
,
 
)
inexor::sound::VARF ( soundchans  ,
,
32  ,
128  ,
initwarning("sound configuration", INIT_RESET, CHANGE_SOUND  
)
inexor::sound::VARF ( soundfreq  ,
,
44100  ,
44100  ,
initwarning("sound configuration", INIT_RESET, CHANGE_SOUND  
)
inexor::sound::VARF ( soundbufferlen  ,
128  ,
1024  ,
4096  ,
initwarning("sound configuration", INIT_RESET, CHANGE_SOUND  
)
inexor::sound::VARFP ( mumble  ,
,
,
,
{if(mumble) initmumble();else closemumble();}   
)
inexor::sound::VARFP ( soundvol  ,
,
255  ,
255  ,
if(!soundvol){stopchannels();}   
)
inexor::sound::VARP ( maxsoundradius  ,
,
340  ,
10000   
)
inexor::sound::VARP ( maxsoundsatonce  ,
,
,
100   
)

Variable Documentation

vector<soundchannel> inexor::sound::channels
struct inexor::sound::soundtype inexor::sound::gamesounds
static
struct inexor::sound::soundtype inexor::sound::mapsounds
static
int inexor::sound::maxchannels = 0

Referenced by initsound(), and playsound().

bool inexor::sound::nosound = true
hashnameset<soundsample> inexor::sound::samples
static
SharedVar<int> inexor::sound::soundbufferlen

Referenced by writeinitcfg().

SharedVar<int> inexor::sound::soundchans

Referenced by initsound(), and writeinitcfg().

SharedVar<int> inexor::sound::soundfreq

Referenced by writeinitcfg().