AUD_NEW("buffer")
memset(m_envelopes->getBuffer(), 0, samplesize);
- m_bAttack = pow(arthreshold, 1.0/(specs.rate * attack));
- m_bRelease = pow(arthreshold, 1.0/(specs.rate * release));
+ m_bAttack = pow(arthreshold, 1.0f/(specs.rate * attack));
+ m_bRelease = pow(arthreshold, 1.0f/(specs.rate * release));
}
AUD_EnvelopeReader::~AUD_EnvelopeReader()
* \param frequency The cutoff frequency.
* \param Q The Q factor.
*/
- AUD_HighpassFactory(AUD_IFactory* factory, float frequency, float Q = 1.0);
+ AUD_HighpassFactory(AUD_IFactory* factory, float frequency, float Q = 1.0f);
/**
* Creates a new highpass factory.
* \param frequency The cutoff frequency.
* \param Q The Q factor.
*/
- AUD_HighpassFactory(float frequency, float Q = 1.0);
+ AUD_HighpassFactory(float frequency, float Q = 1.0f);
virtual AUD_IReader* createReader();
};
m_position = 0;
// calculate coefficients
- float w0 = 2.0 * M_PI * frequency / specs.rate;
+ float w0 = 2 * M_PI * frequency / specs.rate;
float alpha = sin(w0) / (2 * Q);
float norm = 1 + alpha;
m_coeff[0][0] = 0;
* \param frequency The cutoff frequency.
* \param Q The Q factor.
*/
- AUD_LowpassFactory(AUD_IFactory* factory, float frequency, float Q = 1.0);
+ AUD_LowpassFactory(AUD_IFactory* factory, float frequency, float Q = 1.0f);
/**
* Creates a new lowpass factory.
* \param frequency The cutoff frequency.
* \param Q The Q factor.
*/
- AUD_LowpassFactory(float frequency, float Q = 1.0);
+ AUD_LowpassFactory(float frequency, float Q = 1.0f);
virtual AUD_IReader* createReader();
};
m_position = 0;
// calculate coefficients
- float w0 = 2.0 * M_PI * frequency / specs.rate;
+ float w0 = 2 * M_PI * frequency / specs.rate;
float alpha = sin(w0) / (2 * Q);
float norm = 1 + alpha;
m_coeff[0][0] = 0;
* \param factory The input factory.
* \param pitch The desired pitch.
*/
- AUD_PitchFactory(AUD_IFactory* factory = 0, float pitch = 1.0);
+ AUD_PitchFactory(AUD_IFactory* factory = 0, float pitch = 1.0f);
/**
* Creates a new pitch factory.
* \param factory The input factory.
* \param volume The desired volume.
*/
- AUD_VolumeFactory(AUD_IFactory* factory = 0, float volume = 1.0);
+ AUD_VolumeFactory(AUD_IFactory* factory = 0, float volume = 1.0f);
/**
* Creates a new volume factory.
float AUD_OpenALDevice::getPosition(AUD_Handle* handle)
{
- float position = 0.0;
+ float position = 0.0f;
lock();
result = true;
break;
case AUD_3DSS_IS_RELATIVE:
- alSourcei(source, AL_SOURCE_RELATIVE, value > 0.0);
+ alSourcei(source, AL_SOURCE_RELATIVE, value > 0.0f);
result = true;
break;
case AUD_3DSS_MAX_DISTANCE:
{
ALint i;
alGetSourcei(source, AL_SOURCE_RELATIVE, &i);
- result = i ? 1.0 : 0.0;
+ result = i ? 1.0f : 0.0f;
break;
}
case AUD_3DSS_MAX_DISTANCE:
for(int i = 0; i < m_length / 2 + 1; i++)
{
- frequency = i * specs.rate / (m_length / 2.0 + 1.0);
+ frequency = i * specs.rate / (m_length / 2.0f + 1.0f);
if((frequency < m_low) || (frequency > m_high))
complex[i][0] = complex[i][1] = 0.0;
}
{
info.specs.channels = AUD_CHANNELS_INVALID;
info.specs.rate = AUD_RATE_INVALID;
- info.length = 0.0;
+ info.length = 0.0f;
}
return info;
catch(AUD_Exception)
{
}
- return 0.0;
+ return 0.0f;
}
int AUD_update3DSource(AUD_Handle* handle, AUD_3DData* data)
{
}
}
- return 0.0;
+ return 0.0f;
}
int AUD_setSoundVolume(AUD_Handle* handle, float volume)
for(i=0; i < m_rch; i++)
sum += mapping[channels][i];
for(i=0; i < m_rch; i++)
- m_mapping[channels][i] = sum > 0.0 ? mapping[channels][i]/sum : 0.0;
+ m_mapping[channels][i] = sum > 0.0f ?
+ mapping[channels][i]/sum : 0.0f;
}
m_buffer = new AUD_Buffer(); AUD_NEW("buffer")
#define AUD_U8_0 0x80
#define AUD_S16_MAX 0x7FFF
#define AUD_S16_MIN 0x8000
-#define AUD_S16_FLT 32768.0
+#define AUD_S16_FLT 32768.0f
#define AUD_S32_MAX 0x7FFFFFFF
#define AUD_S32_MIN 0x80000000
-#define AUD_S32_FLT 2147483648.0
-#define AUD_FLT_MAX 1.0
-#define AUD_FLT_MIN -1.0
+#define AUD_S32_FLT 2147483648.0f
+#define AUD_FLT_MAX 1.0f
+#define AUD_FLT_MIN -1.0f
void AUD_convert_u8_s16(data_t* target, data_t* source, int length)
{
buffer = m_buffer->getBuffer();
for(int i = 0; i < length; i++)
{
- buffer[i] = sin((m_position + i) * 2.0 * M_PI * m_frequency /
+ buffer[i] = sin((m_position + i) * 2.0f * M_PI * m_frequency /
(float)m_sampleRate);
}
m_playingSounds = new std::list<AUD_SoftwareHandle*>(); AUD_NEW("list")
m_pausedSounds = new std::list<AUD_SoftwareHandle*>(); AUD_NEW("list")
m_playback = false;
- m_volume = 1.0;
+ m_volume = 1.0f;
m_mixer = new AUD_Mixer(); AUD_NEW("mixer")
m_mixer->setSpecs(m_specs);
AUD_SoftwareHandle* sound = new AUD_SoftwareHandle; AUD_NEW("handle")
sound->keep = keep;
sound->reader = reader;
- sound->volume = 1.0;
+ sound->volume = 1.0f;
lock();
m_playingSounds->push_back(sound);
case AUD_CAPS_VOLUME:
lock();
m_volume = *((float*)value);
- if(m_volume > 1.0)
- m_volume = 1.0;
- else if(m_volume < 0.0)
- m_volume = 0.0;
+ if(m_volume > 1.0f)
+ m_volume = 1.0f;
+ else if(m_volume < 0.0f)
+ m_volume = 0.0f;
unlock();
return true;
case AUD_CAPS_SOURCE_VOLUME:
{
AUD_SoftwareHandle* handle = (AUD_SoftwareHandle*)caps->handle;
handle->volume = caps->value;
- if(handle->volume > 1.0)
- handle->volume = 1.0;
- else if(handle->volume < 0.0)
- handle->volume = 0.0;
+ if(handle->volume > 1.0f)
+ handle->volume = 1.0f;
+ else if(handle->volume < 0.0f)
+ handle->volume = 0.0f;
result = true;
}
unlock();