Panda3D
 All Classes Functions Variables Enumerations
audioVolumeAttrib.I
1 // Filename: audioVolumeAttrib.I
2 // Created by: darren (15Dec06)
3 //
4 ////////////////////////////////////////////////////////////////////
5 //
6 // PANDA 3D SOFTWARE
7 // Copyright (c) Carnegie Mellon University. All rights reserved.
8 //
9 // All use of this software is subject to the terms of the revised BSD
10 // license. You should have received a copy of this license along
11 // with this source code in a file named "LICENSE."
12 //
13 ////////////////////////////////////////////////////////////////////
14 
15 
16 ////////////////////////////////////////////////////////////////////
17 // Function: AudioVolumeAttrib::Copy Constructor
18 // Access: Protected
19 // Description: Use AudioVolumeAttrib::make() to construct a new
20 // AudioVolumeAttrib object.
21 ////////////////////////////////////////////////////////////////////
22 INLINE AudioVolumeAttrib::
23 AudioVolumeAttrib(const AudioVolumeAttrib &copy) :
24  _off(copy._off),
25  _has_volume(copy._has_volume),
26  _volume(copy._volume)
27 {
28 }
29 
30 ////////////////////////////////////////////////////////////////////
31 // Function: AudioVolumeAttrib::is_off
32 // Access: Published
33 // Description: Returns true if the AudioVolumeAttrib will ignore any
34 // color scales inherited from above, false otherwise.
35 // This is not the same thing as !has_scale(); a
36 // AudioVolumeAttrib may have the "off" flag set and also
37 // have another scale specified.
38 ////////////////////////////////////////////////////////////////////
39 INLINE bool AudioVolumeAttrib::
40 is_off() const {
41  return _off;
42 }
43 
44 ////////////////////////////////////////////////////////////////////
45 // Function: AudioVolumeAttrib::has_volume
46 // Access: Published
47 // Description: Returns true if the AudioVolumeAttrib has a
48 // non-identity volume, false otherwise (in which case it
49 // might be an off attrib or an identity attrib).
50 ////////////////////////////////////////////////////////////////////
51 INLINE bool AudioVolumeAttrib::
52 has_volume() const {
53  return _has_volume;
54 }
55 
56 ////////////////////////////////////////////////////////////////////
57 // Function: AudioVolumeAttrib::get_volume
58 // Access: Published
59 // Description: Returns the volume to be applied to sounds.
60 ////////////////////////////////////////////////////////////////////
61 INLINE PN_stdfloat AudioVolumeAttrib::
62 get_volume() const {
63  return _volume;
64 }
PN_stdfloat get_volume() const
Returns the volume to be applied to sounds.
bool has_volume() const
Returns true if the AudioVolumeAttrib has a non-identity volume, false otherwise (in which case it mi...
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.