Xonotic QuakeC
The free, fast arena FPS with crisp movement and a wide array of weapons
sound.qh File Reference
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

class  Sound

Macros

#define _sound(e, c, s, v, a)
#define sound(e, c, s, v, a)
#define sound8(e, o, chan, samp, vol, atten, speed, sf)
 because sound7 didn't have origin
#define Sound_fixpath(this)

Functions

string _Sound_fixpath (string base)

Variables

string _Sound_fixpath_cached
entity _Sound_fixpath_this
const float ATTEN_IDLE = 2
const float ATTEN_LARGE = 1
const float ATTEN_LOW = 0.2
const float ATTEN_MAX = 3.984375
const float ATTEN_MIN = 0.015625
const float ATTEN_NONE = 0
const float ATTEN_NORM = 0.5
const float ATTEN_STATIC = 3
const int CH_AMBIENT = -9
const int CH_AMBIENT_SINGLE = 9
const int CH_BGM_SINGLE = 8
const int CH_INFO = 0
const int CH_PAIN = -6
const int CH_PAIN_SINGLE = 6
const int CH_PLAYER = -7
const int CH_PLAYER_SINGLE = 7
const int CH_SHOTS = -4
const int CH_SHOTS_SINGLE = 4
const int CH_TRIGGER = -3
const int CH_TRIGGER_SINGLE = 3
const int CH_TUBA_SINGLE = 5
const int CH_VOICE = -2
const int CH_WEAPON_A = -1
const int CH_WEAPON_B = -1
const int CH_WEAPON_SINGLE = 1
const float VOL_BASE = 0.7
const float VOL_BASEVOICE = 1.0
const float VOL_MUFFLED = 0.35

Macro Definition Documentation

◆ _sound

#define _sound ( e,
c,
s,
v,
a )
Value:
MACRO_BEGIN \
entity __e = e; \
sound7(__e, c, s, v, a, 0, 0); \
#define MACRO_END
Definition macro.qh:7
float MSG_BROADCAST
Definition menudefs.qc:55
bool sound_allowed(int to, entity e)
Definition all.qc:9

Definition at line 43 of file sound.qh.

43 #define _sound(e, c, s, v, a) \
44 MACRO_BEGIN \
45 entity __e = e; \
46 if (sound_allowed(MSG_BROADCAST, __e)) \
47 sound7(__e, c, s, v, a, 0, 0); \
48 MACRO_END

Referenced by basketball_touch(), bot_cmd_sound(), button_fire(), ctf_CheckFlagReturn(), ctf_Handle_Capture(), ctf_Handle_Drop(), ctf_Handle_Pickup(), ctf_Handle_Retrieve(), ctf_Handle_Return(), ctf_Handle_Throw(), dompoint_captured(), door_go_down(), door_go_up(), door_hit_bottom(), door_hit_top(), door_rotating_go_down(), door_rotating_go_up(), door_rotating_hit_bottom(), door_rotating_hit_top(), fd_secret_done(), fd_secret_move1(), fd_secret_move2(), fd_secret_move3(), fd_secret_move4(), fd_secret_move5(), fd_secret_move6(), fd_secret_use(), football_touch(), func_breakable_behave_restore(), func_breakable_destroy(), func_rotating_setactive(), func_vectormamamam_setactive(), GoalTouch(), InitBall(), Item_Touch(), jumppad_push(), Local_Notification_sound(), multi_trigger(), plat_go_down(), plat_go_up(), plat_hit_bottom(), plat_hit_top(), play2all(), sandbox_ObjectFunction_Touch(), target_speaker_use_on(), TeleportPlayer(), train_next(), trigger_gravity_touch(), trigger_heal_touch(), tubasound(), W_Nexball_Touch(), and W_Reload().

◆ sound

#define sound ( e,
c,
s,
v,
a )
Value:
_sound(e, c, Sound_fixpath(s), v, a)
#define Sound_fixpath(this)
Definition sound.qh:141
#define _sound(e, c, s, v, a)
Definition sound.qh:43

Definition at line 52 of file sound.qh.

Referenced by Arc_Smoke(), beam_think(), buff_Respawn(), buff_Think(), buff_Touch(), bumblebee_blowup(), bumblebee_diethink(), Casing_Touch(), CheatImpulse(), CreatureFrame_hotliquids(), CSQCModel_Effects_Apply(), CSQCModel_Hook_PreDraw(), Draw_GrapplingHook(), Ent_Remove(), Ent_TubaNote_Think(), generator_draw(), Gib_Touch(), GiveSound(), GrapplingHook_Stop(), HitSound(), Item_Respawn(), ka_DropEvent(), ka_RespawnBall(), ka_TouchEvent(), kh_Key_Collect(), kh_Key_DropAll(), kh_Key_DropOne(), kh_Key_Think(), loopsound(), M_Golem_Attack_Lightning_Explode(), M_Golem_Attack_Smash(), M_Mage_Attack_Push(), M_Mage_Attack_Spike_Explode(), StatusEffect::m_remove(), M_Spider_Attack_Web(), MUTATOR_HOOKFUNCTION(), MUTATOR_HOOKFUNCTION(), MUTATOR_HOOKFUNCTION(), MUTATOR_HOOKFUNCTION(), nade_beep(), nade_boom(), nade_damage(), nade_darkness_think(), nade_ice_think(), nade_touch(), NET_HANDLE(), NET_HANDLE(), NET_HANDLE(), NET_HANDLE(), ons_ControlPoint_Icon_BuildThink(), ons_ControlPoint_Icon_Damage(), ons_ControlPoint_Icon_Spawn(), ons_ControlPoint_Icon_Think(), ons_GeneratorDamage(), ons_Teleport(), Onslaught_CheckWinner(), play_countdown(), player_powerups_remove_all(), PlayerCorpseDamage(), PlayerDamage(), PlayerTouchExplode(), Portal_Remove(), racer_exit(), racer_frame(), raptor_diethink(), raptor_frame(), raptor_takeoff(), Remove_ArcBeam(), Remove_GrapplingHook(), spamsound(), spiderbot_blowup(), spiderbot_frame(), spiderbot_headfade(), target_init_use(), target_speaker_use_off(), tka_DropEvent(), tka_RespawnBall(), tka_TouchEvent(), turret_die(), turret_gibboom(), turret_projectile(), vehicle_alarm(), vehicles_exit(), vehicles_gib_explode(), vehicles_projectile(), void(), void(), W_Arc_Beam(), W_Arc_Beam_Think(), W_Devastator_Think(), W_Fireball_Attack1_Frame0(), W_Hagar_Attack2_Load(), W_OverkillNex_Attack(), W_Porto_Touch(), W_SetupShot_Dir_ProjectileSize_Range(), W_Shotgun_Attack2(), W_Shotgun_Attack3_Frame2(), W_Vaporizer_Attack(), W_Vortex_Attack(), W_WeaponFrame(), walker_fire_rocket(), and weapon_prepareattack_checkammo().

◆ sound8

#define sound8 ( e,
o,
chan,
samp,
vol,
atten,
speed,
sf )
Value:
MACRO_BEGIN \
entity __e; \
int __chan = chan; \
string __samp = samp; \
bool auto = false; \
if (__chan > 0) __e = e; \
else \
{ \
auto = true; \
__chan = fabs(__chan); \
entity tmp = __e = new(csqc_autochannel); \
setthink(tmp, SUB_Remove); \
tmp.nextthink = time + soundlength(__samp); \
} \
vector old_origin = __e.origin; \
vector old_mins = __e.mins; \
vector old_maxs = __e.maxs; \
setorigin(__e, o); \
setsize(__e, '0 0 0', '0 0 0'); \
sound7(__e, __chan, __samp, vol, atten, speed, sf); \
if (!auto) \
{ \
setorigin(__e, old_origin); \
setsize(__e, old_mins, old_maxs); \
} \
var entity(vector mins, vector maxs,.entity tofield) findbox_tofield_OrFallback
float time
void SUB_Remove(entity this)
Remove entity.
Definition defer.qh:13
float speed
Definition dynlight.qc:9
float fabs(float f)
vector
Definition self.qh:92
float atten
Definition triggers.qh:47

because sound7 didn't have origin

Parameters
esound owner
osound origin
chansound channel
sampsound filename
volsound volume
attensound attenuation
speed
sf

Definition at line 66 of file sound.qh.

66#define sound8(e, o, chan, samp, vol, atten, speed, sf) \
67 MACRO_BEGIN \
68 entity __e; \
69 int __chan = chan; \
70 string __samp = samp; \
71 bool auto = false; \
72 if (__chan > 0) __e = e; \
73 else \
74 { \
75 auto = true; \
76 __chan = fabs(__chan); \
77 entity tmp = __e = new(csqc_autochannel); \
78 setthink(tmp, SUB_Remove); \
79 tmp.nextthink = time + soundlength(__samp); \
80 } \
81 vector old_origin = __e.origin; \
82 vector old_mins = __e.mins; \
83 vector old_maxs = __e.maxs; \
84 setorigin(__e, o); \
85 setsize(__e, '0 0 0', '0 0 0'); \
86 sound7(__e, __chan, __samp, vol, atten, speed, sf); \
87 if (!auto) \
88 { \
89 setorigin(__e, old_origin); \
90 setsize(__e, old_mins, old_maxs); \
91 } \
92 MACRO_END

Referenced by NET_HANDLE(), and NET_HANDLE().

◆ Sound_fixpath

#define Sound_fixpath ( this)
Value:
( \
_Sound_fixpath_this = (this), \
)
entity _Sound_fixpath_this
Definition sound.qh:139
string _Sound_fixpath(string base)
Definition sound.qh:94
string _Sound_fixpath_cached
Definition sound.qh:140

Definition at line 141 of file sound.qh.

141#define Sound_fixpath(this) ( \
142 _Sound_fixpath_this = (this), \
143 _Sound_fixpath_cached = _Sound_fixpath_this.sound_str_, \
144 _Sound_fixpath_cached ? _Sound_fixpath_cached : _Sound_fixpath(_Sound_fixpath_this.sound_str()) \
145)

Referenced by dom_spawnteam(), StartItem(), and W_Reload().

Function Documentation

◆ _Sound_fixpath()

string _Sound_fixpath ( string base)

Definition at line 94 of file sound.qh.

95{
96 if (base == "") return string_null;
97#ifdef SVQC
98 return strcat(base, ".wav"); // let the client engine decide
99#else
100#define extensions(x) \
101 x(wav) \
102 x(ogg) \
103 x(flac) \
104 /**/
105#define tryext(ext) { \
106 string s = strcat(base, "." #ext); \
107 if (fexists(strcat("sound/", s))) { \
108 return s; \
109 } \
110 }
112 LOG_WARNF("Missing sound: \"%s\"", strcat("sound/", base));
113#undef tryext
114#undef extensions
115 return string_null;
116#endif
117}
#define tryext(ext)
#define extensions(x)
#define LOG_WARNF(...)
Definition log.qh:62
string string_null
Definition nil.qh:9
strcat(_("^F4Countdown stopped!"), "\n^BG", _("Teams are too unbalanced."))

References extensions, LOG_WARNF, strcat(), string_null, and tryext.

Referenced by Sound::sound_precache(), and StrafeHUD_UpdateSonarSound().

Variable Documentation

◆ _Sound_fixpath_cached

string _Sound_fixpath_cached

Definition at line 140 of file sound.qh.

◆ _Sound_fixpath_this

entity _Sound_fixpath_this

Definition at line 139 of file sound.qh.

◆ ATTEN_IDLE

◆ ATTEN_LARGE

const float ATTEN_LARGE = 1

Definition at line 31 of file sound.qh.

Referenced by Casing_Touch(), nade_beep(), nade_damage(), and nade_touch().

◆ ATTEN_LOW

const float ATTEN_LOW = 0.2

Definition at line 29 of file sound.qh.

Referenced by NET_HANDLE().

◆ ATTEN_MAX

const float ATTEN_MAX = 3.984375

Definition at line 34 of file sound.qh.

Referenced by nade_beep(), nade_damage(), and nade_touch().

◆ ATTEN_MIN

const float ATTEN_MIN = 0.015625

Definition at line 28 of file sound.qh.

Referenced by _GlobalSound(), and bot_cmd_sound().

◆ ATTEN_NONE

◆ ATTEN_NORM

const float ATTEN_NORM = 0.5

Definition at line 30 of file sound.qh.

Referenced by _GlobalSound(), Arc_Smoke(), basketball_touch(), beam_think(), bumblebee_blowup(), bumblebee_diethink(), button_fire(), CheatImpulse(), CreatureFrame_hotliquids(), ctf_Handle_Retrieve(), ctf_Handle_Throw(), dompoint_captured(), door_go_down(), door_go_up(), door_hit_bottom(), door_hit_top(), door_rotating_go_down(), door_rotating_go_up(), door_rotating_hit_bottom(), door_rotating_hit_top(), Draw_GrapplingHook(), fd_secret_done(), fd_secret_move1(), fd_secret_move2(), fd_secret_move3(), fd_secret_move4(), fd_secret_move5(), fd_secret_move6(), fd_secret_use(), football_touch(), func_breakable_behave_restore(), func_breakable_destroy(), func_breakable_init_for_player(), generator_draw(), Gib_Touch(), GiveSound(), GrapplingHook_Stop(), InitBall(), Item_Respawn(), Item_RespawnCountdown(), Item_Touch(), jumppad_push(), ka_TouchEvent(), kh_Key_Collect(), kh_Key_DropAll(), kh_Key_DropOne(), kh_Key_Think(), M_Golem_Attack_Lightning_Explode(), M_Golem_Attack_Smash(), M_Mage_Attack_Push(), M_Mage_Attack_Spike_Explode(), StatusEffect::m_remove(), M_Spider_Attack_Web(), Monster_Damage(), Monster_Sound(), multi_trigger(), MUTATOR_HOOKFUNCTION(), MUTATOR_HOOKFUNCTION(), MUTATOR_HOOKFUNCTION(), MUTATOR_HOOKFUNCTION(), nade_boom(), nade_darkness_think(), nade_ice_think(), nade_napalm_ball(), nade_touch(), NET_HANDLE(), NET_HANDLE(), NET_HANDLE(), NET_HANDLE(), NET_HANDLE(), ons_ControlPoint_Icon_BuildThink(), ons_ControlPoint_Icon_Damage(), ons_ControlPoint_Icon_Spawn(), ons_ControlPoint_Icon_Think(), ons_GeneratorDamage(), ons_Teleport(), plat_go_down(), plat_go_up(), plat_hit_bottom(), plat_hit_top(), play_countdown(), player_powerups_remove_all(), PlayerCorpseDamage(), PlayerDamage(), PlayerTouchExplode(), Portal_Remove(), racer_exit(), racer_frame(), raptor_diethink(), raptor_frame(), raptor_takeoff(), Remove_ArcBeam(), Remove_GrapplingHook(), sandbox_ObjectFunction_Touch(), spawnfunc(), spawnfunc(), spiderbot_blowup(), spiderbot_frame(), spiderbot_headfade(), TeleportPlayer(), tka_TouchEvent(), trigger_gravity_touch(), trigger_heal_touch(), turret_die(), turret_gibboom(), turret_projectile(), vehicles_damage(), vehicles_exit(), vehicles_gib_explode(), vehicles_projectile(), W_Electro_Orb_Touch(), W_Fireball_Attack1_Frame0(), W_Nexball_Touch(), W_Porto_Touch(), W_Reload(), W_Shotgun_Attack2(), W_Vaporizer_Attack(), walker_fire_rocket(), and weapon_prepareattack_checkammo().

◆ ATTEN_STATIC

const float ATTEN_STATIC = 3

Definition at line 33 of file sound.qh.

Referenced by spawnfunc().

◆ CH_AMBIENT

const int CH_AMBIENT = -9

Definition at line 24 of file sound.qh.

◆ CH_AMBIENT_SINGLE

const int CH_AMBIENT_SINGLE = 9

Definition at line 25 of file sound.qh.

Referenced by func_rotating_init_for_player(), and func_rotating_setactive().

◆ CH_BGM_SINGLE

const int CH_BGM_SINGLE = 8

Definition at line 23 of file sound.qh.

◆ CH_INFO

const int CH_INFO = 0

◆ CH_PAIN

◆ CH_PAIN_SINGLE

const int CH_PAIN_SINGLE = 6

Definition at line 19 of file sound.qh.

Referenced by NET_HANDLE(), raptor_frame(), and Vehicles_drawHUD().

◆ CH_PLAYER

const int CH_PLAYER = -7

◆ CH_PLAYER_SINGLE

const int CH_PLAYER_SINGLE = 7

Definition at line 21 of file sound.qh.

Referenced by CreatureFrame_hotliquids(), and PutPlayerInServer().

◆ CH_SHOTS

◆ CH_SHOTS_SINGLE

◆ CH_TRIGGER

◆ CH_TRIGGER_SINGLE

◆ CH_TUBA_SINGLE

const int CH_TUBA_SINGLE = 5

Definition at line 17 of file sound.qh.

Referenced by Ent_TubaNote_Think(), and tubasound().

◆ CH_VOICE

const int CH_VOICE = -2

◆ CH_WEAPON_A

◆ CH_WEAPON_B

◆ CH_WEAPON_SINGLE

const int CH_WEAPON_SINGLE = 1

◆ VOL_BASE

const float VOL_BASE = 0.7

Definition at line 36 of file sound.qh.

Referenced by _GlobalSound(), Arc_Smoke(), basketball_touch(), beam_think(), bot_cmd_sound(), buff_Respawn(), buff_Think(), buff_Touch(), bumblebee_blowup(), bumblebee_diethink(), button_fire(), Casing_Touch(), CheatImpulse(), CreatureFrame_hotliquids(), CSQCModel_Effects_Apply(), CSQCModel_Hook_PreDraw(), ctf_CheckFlagReturn(), ctf_Handle_Capture(), ctf_Handle_Drop(), ctf_Handle_Pickup(), ctf_Handle_Retrieve(), ctf_Handle_Return(), ctf_Handle_Throw(), dompoint_captured(), door_go_down(), door_go_up(), door_hit_bottom(), door_hit_top(), door_rotating_go_down(), door_rotating_go_up(), door_rotating_hit_bottom(), door_rotating_hit_top(), Draw_GrapplingHook(), DrownPlayer(), Ent_Remove(), Ent_TubaNote_UpdateSound(), fd_secret_done(), fd_secret_move1(), fd_secret_move2(), fd_secret_move3(), fd_secret_move4(), fd_secret_move5(), fd_secret_move6(), fd_secret_use(), football_touch(), func_breakable_behave_restore(), func_breakable_destroy(), func_breakable_init_for_player(), func_rotating_init_for_player(), func_rotating_setactive(), func_vectormamamam_init_for_player(), func_vectormamamam_setactive(), generator_draw(), Gib_Touch(), GiveSound(), GoalTouch(), GrapplingHook_Stop(), HitSound(), InitBall(), Item_Respawn(), Item_RespawnCountdown(), Item_Touch(), jumppad_push(), ka_DropEvent(), ka_RespawnBall(), ka_TouchEvent(), kh_Key_Collect(), kh_Key_DropAll(), kh_Key_DropOne(), kh_Key_Think(), M_Golem_Attack_Lightning_Explode(), M_Golem_Attack_Smash(), M_Mage_Attack_Spike_Explode(), StatusEffect::m_remove(), M_Spider_Attack_Web(), Monster_Damage(), Monster_Sound(), multi_trigger(), MUTATOR_HOOKFUNCTION(), MUTATOR_HOOKFUNCTION(), MUTATOR_HOOKFUNCTION(), MUTATOR_HOOKFUNCTION(), MUTATOR_HOOKFUNCTION(), MUTATOR_HOOKFUNCTION(), nade_beep(), nade_boom(), nade_damage(), nade_darkness_think(), nade_ice_think(), nade_napalm_ball(), nade_touch(), NET_HANDLE(), NET_HANDLE(), NET_HANDLE(), NET_HANDLE(), NET_HANDLE(), ons_ControlPoint_Icon_BuildThink(), ons_ControlPoint_Icon_Damage(), ons_ControlPoint_Icon_Spawn(), ons_ControlPoint_Icon_Think(), ons_GeneratorDamage(), ons_GeneratorThink(), ons_Teleport(), Onslaught_CheckWinner(), plat_go_down(), plat_go_up(), plat_hit_bottom(), plat_hit_top(), play2(), play2all(), play_countdown(), player_powerups_remove_all(), PlayerCorpseDamage(), PlayerDamage(), PlayerJump(), PlayerTouchExplode(), PM_check_hitground(), PM_dodging(), PM_Footsteps(), Portal_Remove(), raptor_diethink(), raptor_frame(), Remove_ArcBeam(), Remove_GrapplingHook(), sandbox_ObjectFunction_Touch(), spawnfunc(), spawnfunc(), spawnfunc(), spawnfunc(), spiderbot_blowup(), spiderbot_frame(), spiderbot_headfade(), StrafeHUD_Sonar(), target_init_use(), target_speaker_use_activator(), target_speaker_use_off(), target_speaker_use_on(), TeleportPlayer(), tka_DropEvent(), tka_RespawnBall(), tka_TouchEvent(), train_next(), trigger_gravity_touch(), trigger_heal_touch(), turret_die(), turret_gibboom(), turret_projectile(), vehicles_damage(), vehicles_gib_explode(), vehicles_projectile(), W_Arc_Beam(), W_Arc_Beam_Think(), W_Devastator_Think(), W_Electro_Orb_Touch(), W_Fireball_Attack1_Frame0(), W_Hagar_Attack2_Load(), W_MineLayer_Stick(), W_MineLayer_Think(), W_Mortar_Grenade_Touch1(), W_Mortar_Grenade_Touch2(), W_Nexball_Touch(), W_OverkillNex_Attack(), W_Porto_Touch(), W_Reload(), W_SetupShot_Dir_ProjectileSize_Range(), W_Shotgun_Attack2(), W_Shotgun_Attack3_Frame2(), W_Vaporizer_Attack(), W_Vortex_Attack(), W_WeaponFrame(), walker_fire_rocket(), and weapon_prepareattack_checkammo().

◆ VOL_BASEVOICE

const float VOL_BASEVOICE = 1.0

Definition at line 37 of file sound.qh.

Referenced by FireRailgunBullet(), NET_HANDLE(), PlayerPreThink(), and vehicle_alarm().

◆ VOL_MUFFLED

const float VOL_MUFFLED = 0.35

Definition at line 38 of file sound.qh.

Referenced by PM_check_hitground().