Added Source:getChannels. Positional/directional audio only works with 1-channel (mono) sources.

This commit is contained in:
Alex Szpakowski
2013-10-15 23:09:35 -04:00
parent f846ed60b2
commit cf6acfa258
7 changed files with 26 additions and 0 deletions
+7
View File
@@ -50,6 +50,7 @@ Source::Source(Pool *pool, love::sound::SoundData *soundData)
, cone()
, offsetSamples(0)
, offsetSeconds(0)
, channels(soundData->getChannels())
, decoder(0)
, toLoop(0)
{
@@ -81,6 +82,7 @@ Source::Source(Pool *pool, love::sound::Decoder *decoder)
, cone()
, offsetSamples(0)
, offsetSeconds(0)
, channels(decoder->getChannels())
, decoder(decoder)
, toLoop(0)
{
@@ -754,6 +756,11 @@ float Source::getMaxDistance() const
return this->maxDistance;
}
int Source::getChannels() const
{
return channels;
}
} // openal
} // audio
} // love
+3
View File
@@ -95,6 +95,7 @@ public:
virtual float getRolloffFactor() const;
virtual void setMaxDistance(float distance);
virtual float getMaxDistance() const;
virtual int getChannels() const;
void playAtomic();
void stopAtomic();
@@ -155,6 +156,8 @@ private:
float offsetSamples;
float offsetSeconds;
int channels;
love::sound::Decoder *decoder;
unsigned int toLoop;