Panda3D
audioVolumeAttrib.I
Go to the documentation of this file.
1 /**
2  * PANDA 3D SOFTWARE
3  * Copyright (c) Carnegie Mellon University. All rights reserved.
4  *
5  * All use of this software is subject to the terms of the revised BSD
6  * license. You should have received a copy of this license along
7  * with this source code in a file named "LICENSE."
8  *
9  * @file audioVolumeAttrib.I
10  * @author darren
11  * @date 2006-12-15
12  */
13 
14 /**
15  * Use AudioVolumeAttrib::make() to construct a new AudioVolumeAttrib object.
16  */
17 INLINE AudioVolumeAttrib::
18 AudioVolumeAttrib(const AudioVolumeAttrib &copy) :
19  _off(copy._off),
20  _has_volume(copy._has_volume),
21  _volume(copy._volume)
22 {
23 }
24 
25 /**
26  * Returns true if the AudioVolumeAttrib will ignore any color scales
27  * inherited from above, false otherwise. This is not the same thing as
28  * !has_scale(); a AudioVolumeAttrib may have the "off" flag set and also have
29  * another scale specified.
30  */
31 INLINE bool AudioVolumeAttrib::
32 is_off() const {
33  return _off;
34 }
35 
36 /**
37  * Returns true if the AudioVolumeAttrib has a non-identity volume, false
38  * otherwise (in which case it might be an off attrib or an identity attrib).
39  */
40 INLINE bool AudioVolumeAttrib::
41 has_volume() const {
42  return _has_volume;
43 }
44 
45 /**
46  * Returns the volume to be applied to sounds.
47  */
48 INLINE PN_stdfloat AudioVolumeAttrib::
49 get_volume() const {
50  return _volume;
51 }
bool is_off() const
Returns true if the AudioVolumeAttrib will ignore any color scales inherited from above,...
Applies a scale to audio volume for positional sounds in the scene graph.