/// starts or continue playing, true if successfull
	virtual const bool Play(){
		if(IsPlaying())return true;
		if(IsPaused()){
			// unpause sound
			if(mpChannel){
				result = FMOD_Channel_SetPaused(mpChannel,false);
				ERRCHECK(result);
			}
		} else {
			// start playing
			mpChannel = 0;
			// alloc channel
			if(mpSound && mSoundSystem && mSoundSystem->mpSystem){
				result = FMOD_System_PlaySound(mSoundSystem->mpSystem, FMOD_CHANNEL_FREE, mpSound, true, &mpChannel);
				ERRCHECK(result);
			}
			
			// channel free and working?
			if(mpChannel){
				
				if(mb3D){
					// set 3d position and velocity data
					result = FMOD_Channel_Set3DAttributes(mpChannel, &mlPos, &mlVel);
					ERRCHECK(result);
					// set currently set minmax distances
					SetMinMaxDistance(mfMinDistance,mfMaxDistance);
				} 
				
				result = FMOD_Channel_SetPaused(mpChannel,false);
				ERRCHECK(result);
				
				return true;
			} else return false;
		}
		return false;
	}
Example #2
0
Bool Sound::SetMaxDistance(Float pMaximumDistance)
{
    return SetMinMaxDistance(mMinDistance, pMaximumDistance);
}
Example #3
0
Bool Sound::SetMinDistance(Float pMininumDistance)
{
    return SetMinMaxDistance(pMininumDistance, mMaxDistance);
}