mirror of
https://github.com/love2d/love.git
synced 2026-08-18 11:44:15 +02:00
Added Source:getChannels. Positional/directional audio only works with 1-channel (mono) sources.
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user