Correct const use.

This commit is contained in:
Raynaldo Rivera 2009-08-26 03:06:36 +00:00
parent 93e36c4a03
commit 198124c988
3 changed files with 31 additions and 24 deletions

View File

@ -40,21 +40,21 @@ namespace cAudio
void setDopplerVelocity(const cVector3 dvelocity);
//!Returns the audio objects position
cVector3 getPosition();
const cVector3& getPosition()const;
//!Returns the audio objects velocity
cVector3 getVelocity();
const cVector3& getVelocity()const;
//!Returns the audio objects direction
cVector3 getDirection();
const cVector3& getDirection()const;
//!Returns the audio objects doppler strength
float getDopplerStrength();
const float& getDopplerStrength()const;
//!Returns the audio objects strength
float getStrength();
const float& getStrength()const;
//!Returns the volume of the sound object
float getVolume();
const float& getVolume()const;
//!Returns the pitch volume
float getPitch();
const float& getPitch()const;
//!Returns if the sound object is looping
bool isLooping();
const bool& isLooping()const;

View File

@ -246,36 +246,43 @@ namespace cAudio
alSource3f(source, AL_DOPPLER_VELOCITY, dvelocity.x, dvelocity.y, dvelocity.z);
}
cVector3 cAudio::getPosition()
const cVector3& cAudio::getPosition()const
{
return this->position;
}
cVector3 cAudio::getVelocity(){
const cVector3& cAudio::getVelocity()const
{
return this->velocity;
}
cVector3 cAudio::getDirection(){
const cVector3& cAudio::getDirection()const
{
return this->direction;
}
float cAudio::getDopplerStrength(){
const float& cAudio::getDopplerStrength()const
{
return this->dstrength;
}
float cAudio::getStrength(){
const float& cAudio::getStrength()const
{
return this->strength;
}
float cAudio::getVolume(){
const float& cAudio::getVolume()const
{
return this->volume;
}
float cAudio::getPitch(){
const float& cAudio::getPitch()const
{
return this->pitch;
}
bool cAudio::isLooping(){
const bool& cAudio::isLooping()const
{
return this->toloop;
}

View File

@ -38,21 +38,21 @@ namespace cAudio
virtual void seek(float secs) = 0;
//!Returns the audio objects position
virtual cVector3 getPosition() = 0;
virtual const cVector3& getPosition()const = 0;
//!Returns the audio objects velocity
virtual cVector3 getVelocity() = 0;
virtual const cVector3& getVelocity()const = 0;
//!Returns the audio objects direction
virtual cVector3 getDirection() = 0;
virtual const cVector3& getDirection()const = 0;
//!Returns the audio objects doppler strength
virtual float getDopplerStrength() = 0;
virtual const float& getDopplerStrength()const = 0;
//!Returns the audio objects strength
virtual float getStrength() = 0;
virtual const float& getStrength()const = 0;
//!Returns the volume of the sound object
virtual float getVolume() = 0;
virtual const float& getVolume()const = 0;
//!Returns the pitch volume
virtual float getPitch() = 0;
virtual const float& getPitch()const = 0;
//!Returns if the sound object is looping
virtual bool isLooping() = 0;
virtual const bool& isLooping()const = 0;
//!release the file handle
virtual void release() = 0;