audioVolumeAttrib.I

00001 // Filename: audioVolumeAttrib.I
00002 // Created by:  darren (15Dec06)
00003 //
00004 ////////////////////////////////////////////////////////////////////
00005 //
00006 // PANDA 3D SOFTWARE
00007 // Copyright (c) Carnegie Mellon University.  All rights reserved.
00008 //
00009 // All use of this software is subject to the terms of the revised BSD
00010 // license.  You should have received a copy of this license along
00011 // with this source code in a file named "LICENSE."
00012 //
00013 ////////////////////////////////////////////////////////////////////
00014 
00015 
00016 ////////////////////////////////////////////////////////////////////
00017 //     Function: AudioVolumeAttrib::Copy Constructor
00018 //       Access: Protected
00019 //  Description: Use AudioVolumeAttrib::make() to construct a new
00020 //               AudioVolumeAttrib object.
00021 ////////////////////////////////////////////////////////////////////
00022 INLINE AudioVolumeAttrib::
00023 AudioVolumeAttrib(const AudioVolumeAttrib &copy) :
00024   _off(copy._off),
00025   _has_volume(copy._has_volume),
00026   _volume(copy._volume)
00027 {
00028 }
00029 
00030 ////////////////////////////////////////////////////////////////////
00031 //     Function: AudioVolumeAttrib::is_off
00032 //       Access: Published
00033 //  Description: Returns true if the AudioVolumeAttrib will ignore any
00034 //               color scales inherited from above, false otherwise.
00035 //               This is not the same thing as !has_scale(); a
00036 //               AudioVolumeAttrib may have the "off" flag set and also
00037 //               have another scale specified.
00038 ////////////////////////////////////////////////////////////////////
00039 INLINE bool AudioVolumeAttrib::
00040 is_off() const {
00041   return _off;
00042 }
00043 
00044 ////////////////////////////////////////////////////////////////////
00045 //     Function: AudioVolumeAttrib::has_volume
00046 //       Access: Published
00047 //  Description: Returns true if the AudioVolumeAttrib has a
00048 //               non-identity volume, false otherwise (in which case it
00049 //               might be an off attrib or an identity attrib).
00050 ////////////////////////////////////////////////////////////////////
00051 INLINE bool AudioVolumeAttrib::
00052 has_volume() const {
00053   return _has_volume;
00054 }
00055 
00056 ////////////////////////////////////////////////////////////////////
00057 //     Function: AudioVolumeAttrib::get_volume
00058 //       Access: Published
00059 //  Description: Returns the volume to be applied to sounds.
00060 ////////////////////////////////////////////////////////////////////
00061 INLINE PN_stdfloat AudioVolumeAttrib::
00062 get_volume() const {
00063   return _volume;
00064 }