Rename Source/SoundData/Decoder:getChannels to getChannelCount (resolves issue #1307). Deprecate the old methods rather than completely removing them.

--HG--
branch : minor
This commit is contained in:
Alex Szpakowski
2017-08-27 14:40:46 -03:00
parent 0325663283
commit bf6983beac
32 changed files with 87 additions and 56 deletions
+1 -1
View File
@@ -132,7 +132,7 @@ int RecordingDevice::getBitDepth() const
return bitDepth;
}
int RecordingDevice::getChannels() const
int RecordingDevice::getChannelCount() const
{
return channels;
}
+1 -1
View File
@@ -60,7 +60,7 @@ public:
virtual int getMaxSamples() const;
virtual int getSampleRate() const;
virtual int getBitDepth() const;
virtual int getChannels() const;
virtual int getChannelCount() const;
virtual bool isRecording() const;
private:
+8 -8
View File
@@ -122,12 +122,12 @@ Source::Source(Pool *pool, love::sound::SoundData *soundData)
: love::audio::Source(Source::TYPE_STATIC)
, pool(pool)
, sampleRate(soundData->getSampleRate())
, channels(soundData->getChannels())
, channels(soundData->getChannelCount())
, bitDepth(soundData->getBitDepth())
{
ALenum fmt = Audio::getFormat(soundData->getBitDepth(), soundData->getChannels());
ALenum fmt = Audio::getFormat(soundData->getBitDepth(), soundData->getChannelCount());
if (fmt == AL_NONE)
throw InvalidFormatException(soundData->getChannels(), soundData->getBitDepth());
throw InvalidFormatException(soundData->getChannelCount(), soundData->getBitDepth());
staticBuffer.set(new StaticDataBuffer(fmt, soundData->getData(), (ALsizei) soundData->getSize(), sampleRate), Acquire::NORETAIN);
@@ -145,13 +145,13 @@ Source::Source(Pool *pool, love::sound::Decoder *decoder)
: love::audio::Source(Source::TYPE_STREAM)
, pool(pool)
, sampleRate(decoder->getSampleRate())
, channels(decoder->getChannels())
, channels(decoder->getChannelCount())
, bitDepth(decoder->getBitDepth())
, decoder(decoder)
, buffers(DEFAULT_BUFFERS)
{
if (Audio::getFormat(decoder->getBitDepth(), decoder->getChannels()) == AL_NONE)
throw InvalidFormatException(decoder->getChannels(), decoder->getBitDepth());
if (Audio::getFormat(decoder->getBitDepth(), decoder->getChannelCount()) == AL_NONE)
throw InvalidFormatException(decoder->getChannelCount(), decoder->getBitDepth());
for (int i = 0; i < buffers; i++)
{
@@ -1138,7 +1138,7 @@ int Source::streamAtomic(ALuint buffer, love::sound::Decoder *d)
// OpenAL implementations are allowed to ignore 0-size alBufferData calls.
if (decoded > 0)
{
int fmt = Audio::getFormat(d->getBitDepth(), d->getChannels());
int fmt = Audio::getFormat(d->getBitDepth(), d->getChannelCount());
if (fmt != AL_NONE)
alBufferData(buffer, fmt, d->getBuffer(), decoded, d->getSampleRate());
@@ -1318,7 +1318,7 @@ float Source::getAirAbsorptionFactor() const
return absorptionFactor;
}
int Source::getChannels() const
int Source::getChannelCount() const
{
return channels;
}
+1 -1
View File
@@ -142,7 +142,7 @@ public:
virtual float getMaxDistance() const;
virtual void setAirAbsorptionFactor(float factor);
virtual float getAirAbsorptionFactor() const;
virtual int getChannels() const;
virtual int getChannelCount() const;
virtual bool setFilter(const std::map<Filter::Parameter, float> &params);
virtual bool setFilter();