Remove extra whitespace

--HG--
branch : minor
This commit is contained in:
Bart van Strien
2017-02-11 20:12:44 +01:00
parent cbaf9e047b
commit 42b8249b60
10 changed files with 96 additions and 96 deletions
+25 -25
View File
@@ -77,7 +77,7 @@ ALenum Audio::getFormat(int bitDepth, int channels)
return bitDepth == 8 ? AL_FORMAT_MONO8 : AL_FORMAT_MONO16;
else if (channels == 2)
return bitDepth == 8 ? AL_FORMAT_STEREO8 : AL_FORMAT_STEREO16;
#ifdef AL_EXT_MCFORMATS
#ifdef AL_EXT_MCFORMATS
else if (alIsExtensionPresent("AL_EXT_MCFORMATS"))
{
if (channels == 6)
@@ -85,7 +85,7 @@ ALenum Audio::getFormat(int bitDepth, int channels)
else if (channels == 8)
return bitDepth == 8 ? AL_FORMAT_71CHN8 : AL_FORMAT_71CHN16;
}
#endif
#endif
return AL_NONE;
}
@@ -102,11 +102,11 @@ Audio::Audio()
if (device == nullptr)
throw love::Exception("Could not open device.");
#ifdef ALC_EXT_EFX
ALint attribs[4] = { ALC_MAX_AUXILIARY_SENDS, MAX_SOURCE_EFFECTS, 0, 0 };
#else
#ifdef ALC_EXT_EFX
ALint attribs[4] = { ALC_MAX_AUXILIARY_SENDS, MAX_SOURCE_EFFECTS, 0, 0 };
#else
ALint *attribs = nullptr;
#endif
#endif
context = alcCreateContext(device, attribs);
@@ -116,12 +116,12 @@ Audio::Audio()
if (!alcMakeContextCurrent(context) || alcGetError(device) != ALC_NO_ERROR)
throw love::Exception("Could not make context current.");
#ifdef ALC_EXT_EFX
#ifdef ALC_EXT_EFX
initializeEFX();
alcGetIntegerv(device, ALC_MAX_AUXILIARY_SENDS, 1, &MAX_SOURCE_EFFECTS);
alGetError();
alGetError();
if (alGenAuxiliaryEffectSlots)
{
for (int i = 0; i < MAX_SCENE_EFFECTS; i++)
@@ -143,9 +143,9 @@ Audio::Audio()
}
else
MAX_SCENE_EFFECTS = MAX_SOURCE_EFFECTS = 0;
#else
#else
MAX_SCENE_EFFECTS = MAX_SOURCE_EFFECTS = 0;
#endif
#endif
try
{
@@ -155,11 +155,11 @@ Audio::Audio()
{
for (auto c : capture)
delete c;
#ifdef ALC_EXT_EFX
#ifdef ALC_EXT_EFX
if (alDeleteAuxiliaryEffectSlots)
for (auto slot : effectSlots)
alDeleteAuxiliaryEffectSlots(1, &slot);
#endif
#endif
alcMakeContextCurrent(nullptr);
alcDestroyContext(context);
alcCloseDevice(device);
@@ -179,14 +179,14 @@ Audio::~Audio()
delete pool;
for (auto c : capture)
delete c;
#ifdef ALC_EXT_EFX
#ifdef ALC_EXT_EFX
for (auto e : effects)
if (e != nullptr)
delete e;
if (alDeleteAuxiliaryEffectSlots)
for (auto slot : effectSlots)
alDeleteAuxiliaryEffectSlots(1, &slot);
#endif
#endif
alcMakeContextCurrent(nullptr);
alcDestroyContext(context);
alcCloseDevice(device);
@@ -320,9 +320,9 @@ void Audio::setMeter(float scale)
if (scale >= 0.0f)
{
metersPerUnit = scale;
#ifdef ALC_EXT_EFX
#ifdef ALC_EXT_EFX
alListenerf(AL_METERS_PER_UNIT, scale);
#endif
#endif
}
}
@@ -455,7 +455,7 @@ bool Audio::setSceneEffect(int slot, std::map<Effect::Parameter, float> &params)
bool result = effects[slot]->setParams(params);
#ifdef ALC_EXT_EFX
#ifdef ALC_EXT_EFX
if (alAuxiliaryEffectSloti)
{
if (result == true)
@@ -468,7 +468,7 @@ bool Audio::setSceneEffect(int slot, std::map<Effect::Parameter, float> &params)
alAuxiliaryEffectSloti(effectSlots[slot], AL_EFFECTSLOT_EFFECT, AL_EFFECT_NULL);
alGetError();
}
#endif
#endif
return result;
}
@@ -483,10 +483,10 @@ bool Audio::setSceneEffect(int slot)
effects[slot] = nullptr;
#ifdef ALC_EXT_EFX
#ifdef ALC_EXT_EFX
if (alAuxiliaryEffectSloti)
alAuxiliaryEffectSloti(effectSlots[slot], AL_EFFECTSLOT_EFFECT, AL_EFFECT_NULL);
#endif
#endif
return true;
}
@@ -516,11 +516,11 @@ int Audio::getMaxSourceEffects() const
bool Audio::isEFXsupported() const
{
#ifdef ALC_EXT_EFX
#ifdef ALC_EXT_EFX
return (alGenEffects != nullptr);
#else
#else
return false;
#endif
#endif
}
ALuint Audio::getSceneEffectID(int slot)
@@ -574,7 +574,7 @@ LPALGETAUXILIARYEFFECTSLOTFV alGetAuxiliaryEffectSlotfv = nullptr;
void Audio::initializeEFX()
{
#ifdef ALC_EXT_EFX
#ifdef ALC_EXT_EFX
if (alcIsExtensionPresent(device, "ALC_EXT_EFX") == AL_FALSE)
return;
@@ -636,7 +636,7 @@ void Audio::initializeEFX()
alGetAuxiliaryEffectSlotf = nullptr; alGetAuxiliaryEffectSlotfv = nullptr;
}
#endif
#endif
}
} // openal
+16 -16
View File
@@ -55,7 +55,7 @@ Effect *Effect::clone()
bool Effect::generateEffect()
{
#ifdef ALC_EXT_EFX
#ifdef ALC_EXT_EFX
if (!alGenEffects)
return false;
@@ -67,17 +67,17 @@ bool Effect::generateEffect()
throw love::Exception("Failed to create sound Effect.");
return true;
#else
#else
return false;
#endif
#endif
}
void Effect::deleteEffect()
{
#ifdef ALC_EXT_EFX
#ifdef ALC_EXT_EFX
if (effect != AL_EFFECT_NULL)
alDeleteEffects(1, &effect);
#endif
#endif
effect = AL_EFFECT_NULL;
}
@@ -94,7 +94,7 @@ bool Effect::setParams(const std::map<Parameter, float> &params)
if (!generateEffect())
return false;
#ifdef ALC_EXT_EFX
#ifdef ALC_EXT_EFX
//parameter table without EFFECT_TYPE entry is illegal
switch (type)
{
@@ -150,8 +150,8 @@ bool Effect::setParams(const std::map<Parameter, float> &params)
return false;
}
#define clampf(v,l,h) fmax(fmin((v),(h)),(l))
#define PARAMSTR(i,e,v) effect,AL_##e##_##v,clampf(getValue(i,AL_##e##_DEFAULT_##v),AL_##e##_MIN_##v,AL_##e##_MAX_##v)
#define clampf(v,l,h) fmax(fmin((v),(h)),(l))
#define PARAMSTR(i,e,v) effect,AL_##e##_##v,clampf(getValue(i,AL_##e##_DEFAULT_##v),AL_##e##_MIN_##v,AL_##e##_MAX_##v)
switch (type)
{
case TYPE_REVERB:
@@ -224,7 +224,7 @@ bool Effect::setParams(const std::map<Parameter, float> &params)
/*
case TYPE_FREQSHIFTER:
{
alEffectf(PARAMSTR(FREQSHIFTER_FREQ,FREQUENCY_SHIFTER,FREQUENCY));
alEffectf(PARAMSTR(FREQSHIFTER_FREQ,FREQUENCY_SHIFTER,FREQUENCY));
Direction dir = static_cast<Direction>(getValue(FREQSHIFTER_LEFTDIR, static_cast<int>(DIR_MAX_ENUM)));
if (dir == DIR_NONE)
@@ -233,7 +233,7 @@ bool Effect::setParams(const std::map<Parameter, float> &params)
alEffecti(effect, AL_FREQUENCY_SHIFTER_LEFT_DIRECTION, AL_FREQUENCY_SHIFTER_DIRECTION_UP);
else if(dir == DIR_DOWN)
alEffecti(effect, AL_FREQUENCY_SHIFTER_LEFT_DIRECTION, AL_FREQUENCY_SHIFTER_DIRECTION_DOWN);
else
else
alEffecti(effect, AL_FREQUENCY_SHIFTER_LEFT_DIRECTION, AL_FREQUENCY_SHIFTER_DEFAULT_LEFT_DIRECTION);
dir = static_cast<Direction>(getValue(FREQSHIFTER_RIGHTDIR, static_cast<int>(DIR_MAX_ENUM)));
@@ -243,7 +243,7 @@ bool Effect::setParams(const std::map<Parameter, float> &params)
alEffecti(effect, AL_FREQUENCY_SHIFTER_RIGHT_DIRECTION, AL_FREQUENCY_SHIFTER_DIRECTION_UP);
else if(dir == DIR_DOWN)
alEffecti(effect, AL_FREQUENCY_SHIFTER_RIGHT_DIRECTION, AL_FREQUENCY_SHIFTER_DIRECTION_DOWN);
else
else
alEffecti(effect, AL_FREQUENCY_SHIFTER_RIGHT_DIRECTION, AL_FREQUENCY_SHIFTER_DEFAULT_RIGHT_DIRECTION);
break;
}
@@ -351,14 +351,14 @@ bool Effect::setParams(const std::map<Parameter, float> &params)
case TYPE_MAX_ENUM:
break;
}
#undef PARAMSTR
#undef clampf
#undef PARAMSTR
#undef clampf
//alGetError();
return true;
#else
#else
return false;
#endif //ALC_EXT_EFX
#endif //ALC_EXT_EFX
}
const std::map<Effect::Parameter, float> &Effect::getParams() const
@@ -377,7 +377,7 @@ int Effect::getValue(Parameter in, int def) const
}
/*
std::map<Effect::Phoneme, ALint> Effect::phonemeMap =
std::map<Effect::Phoneme, ALint> Effect::phonemeMap =
{
{Effect::PHONEME_A, AL_VOCAL_MORPHER_PHONEME_A},
{Effect::PHONEME_E, AL_VOCAL_MORPHER_PHONEME_E},
+12 -12
View File
@@ -54,7 +54,7 @@ Filter *Filter::clone()
bool Filter::generateFilter()
{
#ifdef ALC_EXT_EFX
#ifdef ALC_EXT_EFX
if (!alGenFilters)
return false;
@@ -66,17 +66,17 @@ bool Filter::generateFilter()
throw love::Exception("Failed to create sound Filter.");
return true;
#else
#else
return false;
#endif
#endif
}
void Filter::deleteFilter()
{
#ifdef ALC_EXT_EFX
#ifdef ALC_EXT_EFX
if (filter != AL_FILTER_NULL)
alDeleteFilters(1, &filter);
#endif
#endif
filter = AL_FILTER_NULL;
}
@@ -93,7 +93,7 @@ bool Filter::setParams(const std::map<Parameter, float> &params)
if (!generateFilter())
return false;
#ifdef ALC_EXT_EFX
#ifdef ALC_EXT_EFX
switch (type)
{
case TYPE_LOWPASS:
@@ -117,8 +117,8 @@ bool Filter::setParams(const std::map<Parameter, float> &params)
return false;
}
#define clampf(v,l,h) fmax(fmin((v),(h)),(l))
#define PARAMSTR(i,e,v) filter,AL_##e##_##v,clampf(getValue(i,AL_##e##_DEFAULT_##v),AL_##e##_MIN_##v,AL_##e##_MAX_##v)
#define clampf(v,l,h) fmax(fmin((v),(h)),(l))
#define PARAMSTR(i,e,v) filter,AL_##e##_##v,clampf(getValue(i,AL_##e##_DEFAULT_##v),AL_##e##_MIN_##v,AL_##e##_MAX_##v)
switch (type)
{
case TYPE_LOWPASS:
@@ -138,14 +138,14 @@ bool Filter::setParams(const std::map<Parameter, float> &params)
case TYPE_MAX_ENUM:
break;
}
#undef clampf
#undef PARAMSTR
#undef clampf
#undef PARAMSTR
//alGetError();
return true;
#else
#else
return false;
#endif
#endif
}
const std::map<Filter::Parameter, float> &Filter::getParams() const
+20 -20
View File
@@ -341,7 +341,7 @@ bool Source::update()
return true;
}
return false;
case TYPE_QUEUE:
case TYPE_QUEUE:
{
ALint processed;
ALuint buffers[MAX_BUFFERS];
@@ -648,9 +648,9 @@ void Source::setCone(float innerAngle, float outerAngle, float outerVolume, floa
alSourcei(source, AL_CONE_INNER_ANGLE, cone.innerAngle);
alSourcei(source, AL_CONE_OUTER_ANGLE, cone.outerAngle);
alSourcef(source, AL_CONE_OUTER_GAIN, cone.outerVolume);
#ifdef ALC_EXT_EFX
#ifdef ALC_EXT_EFX
alSourcef(source, AL_CONE_OUTER_GAINHF, cone.outerHighGain);
#endif
#endif
}
}
@@ -748,14 +748,14 @@ int Source::getFreeBufferCount() const
{
switch (sourceType) //why not :^)
{
case TYPE_STATIC:
case TYPE_STATIC:
return 0;
case TYPE_STREAM:
return unusedBufferTop + 1;
case TYPE_QUEUE:
return valid ? unusedBufferTop + 1 : (int)MAX_BUFFERS - unusedBufferTop - 1;
case TYPE_MAX_ENUM:
return 0;
return 0;
}
return 0;
}
@@ -887,7 +887,7 @@ bool Source::playAtomic(ALuint source)
//this is set to success state afterwards anyway, but setting it here
//to true preemptively avoids race condition with update bug
valid = true;
valid = true;
return success;
}
@@ -1014,7 +1014,7 @@ void Source::reset()
alSourcei(source, AL_CONE_INNER_ANGLE, cone.innerAngle);
alSourcei(source, AL_CONE_OUTER_ANGLE, cone.outerAngle);
alSourcef(source, AL_CONE_OUTER_GAIN, cone.outerVolume);
#ifdef ALC_EXT_EFX
#ifdef ALC_EXT_EFX
alSourcef(source, AL_AIR_ABSORPTION_FACTOR, absorptionFactor);
alSourcef(source, AL_CONE_OUTER_GAINHF, cone.outerHighGain);
alSourcef(source, AL_ROOM_ROLLOFF_FACTOR, rolloffFactor); //reverb-specific rolloff
@@ -1022,7 +1022,7 @@ void Source::reset()
for (unsigned int i = 0; i < sendtargets.size(); i++)
alSource3i(source, AL_AUXILIARY_SEND_FILTER, sendtargets[i], i, sendfilters[i] ? sendfilters[i]->getFilter() : AL_FILTER_NULL);
//alGetError();
#endif
#endif
}
void Source::setFloatv(float *dst, const float *src) const
@@ -1230,13 +1230,13 @@ void Source::setAirAbsorptionFactor(float factor)
throw SpatialSupportException();
absorptionFactor = factor;
#ifdef ALC_EXT_EFX
#ifdef ALC_EXT_EFX
if (valid)
{
alSourcef(source, AL_AIR_ABSORPTION_FACTOR, absorptionFactor);
//alGetError();
}
#endif
#endif
}
float Source::getAirAbsorptionFactor() const
@@ -1259,14 +1259,14 @@ bool Source::setFilter(std::map<Filter::Parameter, float> &params)
bool result = directfilter->setParams(params);
#ifdef ALC_EXT_EFX
#ifdef ALC_EXT_EFX
if (valid)
{
//in case of failure contains AL_FILTER_NULL, a valid non-filter
alSourcei(source, AL_DIRECT_FILTER, directfilter->getFilter());
//alGetError();
}
#endif
#endif
return result;
}
@@ -1278,13 +1278,13 @@ bool Source::setFilter()
directfilter = nullptr;
#ifdef ALC_EXT_EFX
#ifdef ALC_EXT_EFX
if (valid)
{
alSourcei(source, AL_DIRECT_FILTER, AL_FILTER_NULL);
//alGetError();
}
#endif
#endif
return true;
}
@@ -1311,13 +1311,13 @@ bool Source::setSceneEffect(int slot, int effect)
sendfilters[slot] = nullptr;
#ifdef ALC_EXT_EFX
#ifdef ALC_EXT_EFX
if (valid)
{
alSource3i(source, AL_AUXILIARY_SEND_FILTER, sendtargets[slot], slot, AL_FILTER_NULL);
//alGetError();
}
#endif
#endif
return true;
}
@@ -1334,14 +1334,14 @@ bool Source::setSceneEffect(int slot, int effect, std::map<Filter::Parameter, fl
sendfilters[slot]->setParams(params);
#ifdef ALC_EXT_EFX
#ifdef ALC_EXT_EFX
if (valid)
{
//in case of failure contains AL_FILTER_NULL, a valid non-filter
alSource3i(source, AL_AUXILIARY_SEND_FILTER, sendtargets[slot], slot, sendfilters[slot]->getFilter());
//alGetError();
}
#endif
#endif
return true;
}
@@ -1356,13 +1356,13 @@ bool Source::setSceneEffect(int slot)
delete sendfilters[slot];
sendfilters[slot] = nullptr;
#ifdef ALC_EXT_EFX
#ifdef ALC_EXT_EFX
if (valid)
{
alSource3i(source, AL_AUXILIARY_SEND_FILTER, AL_EFFECTSLOT_NULL, slot, AL_FILTER_NULL);
//alGetError();
}
#endif
#endif
return true;
}