Nuclide
Software Development Kit for id Technology
NSSound.h
1/*
2 * Copyright (c) 2024 Vera Visions LLC.
3 *
4 * Permission to use, copy, modify, and distribute this software for any
5 * purpose with or without fee is hereby granted, provided that the above
6 * copyright notice and this permission notice appear in all copies.
7 *
8 * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
9 * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
10 * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
11 * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
12 * WHATSOEVER RESULTING FROM LOSS OF MIND, USE, DATA OR PROFITS, WHETHER
13 * IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING
14 * OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
15*/
16
18{
19 SOUND_SAMPLE,
20 SOUND_VOLUME,
21 SOUND_RADIUS,
22 SOUND_PITCH,
23 SOUND_ORIGIN,
24 SOUND_ENABLED
25};
26
27class
29{
30public:
31 void NSSound( void );
32
33 nonvirtual void SetSample( string );
34 nonvirtual void SetVolume( float );
35 nonvirtual void SetRadius( float );
36 nonvirtual void SetPitch( float );
37 nonvirtual void SetSoundOffset( float );
38 nonvirtual void MakeOmniDirectional( void );
39 nonvirtual void MakeDirectional( void );
40 nonvirtual void EnableReverb( void );
41 nonvirtual void DisableReverb( void );
42 nonvirtual void ForceLoop( bool );
43 nonvirtual void Play( void );
44
45 virtual void Spawned(void);
46 virtual void OnRemoveEntity(void);
47
48#ifdef SERVER
49 virtual void Respawn(void);
50 virtual void EvaluateEntity(void);
51 virtual float SendEntity(entity, float);
52#endif
53
54#ifdef CLIENT
55 virtual void ReceiveEntity(float,float);
56#endif
57
58private:
59 NETWORKED_FLOAT(m_radius)
60 NETWORKED_FLOAT(m_volume)
61 NETWORKED_FLOAT(m_soundIndex)
62 NETWORKED_FLOAT(m_pitch)
63 NETWORKED_BOOL(m_isLooping)
64 string m_sample;
65 bool m_omniDirectional;
66 float m_offset;
67 bool m_ignoreReverb;
68 bool m_forceLoop;
69};
This entity class represents point-entity triggers.
Definition: NSPointTrigger.h:26
Definition: NSSound.h:29
typedef enumflags
Defines the valid alignment flags for text fields.
Definition: font.h:37