mirror of
https://github.com/love2d/love.git
synced 2026-08-21 21:15:09 +02:00
issues addressed
cropped trailing spaces put TYPE_MAX_ENUM in getDurationAtomic moved around variables in seekAtomic --HG-- branch : minor
This commit is contained in:
@@ -51,7 +51,7 @@ love::audio::Source *Audio::newSource(love::sound::SoundData *)
|
||||
return new Source();
|
||||
}
|
||||
|
||||
love::audio::Source *Audio::newSource(int sampleRate, int bitDepth, int channels)
|
||||
love::audio::Source *Audio::newSource(int, int, int)
|
||||
{
|
||||
return new Source();
|
||||
}
|
||||
|
||||
@@ -222,7 +222,7 @@ int Source::getFreeBufferCount() const
|
||||
return 0;
|
||||
}
|
||||
|
||||
bool Source::queue(void *data, int length, int dataSampleRate, int dataBitDepth, int dataChannels)
|
||||
bool Source::queue(void *, int, int, int, int)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -463,7 +463,7 @@ void Source::seekAtomic(float offset, void *unit)
|
||||
{
|
||||
case TYPE_STATIC:
|
||||
alSourcef(source, AL_SAMPLE_OFFSET, offsetSamples);
|
||||
this->offsetSamples = this->offsetSeconds = 0;
|
||||
offsetSamples = offsetSeconds = 0;
|
||||
break;
|
||||
case TYPE_STREAM:
|
||||
{
|
||||
@@ -473,8 +473,6 @@ void Source::seekAtomic(float offset, void *unit)
|
||||
if (valid)
|
||||
stopAtomic();
|
||||
|
||||
this->offsetSamples = offsetSamples;
|
||||
this->offsetSeconds = offsetSeconds;
|
||||
decoder->seek(offsetSeconds);
|
||||
|
||||
if (wasPlaying)
|
||||
@@ -486,7 +484,7 @@ void Source::seekAtomic(float offset, void *unit)
|
||||
if (valid)
|
||||
{
|
||||
alSourcef(source, AL_SAMPLE_OFFSET, offsetSamples);
|
||||
this->offsetSamples = this->offsetSeconds = 0;
|
||||
offsetSamples = offsetSeconds = 0;
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -509,13 +507,13 @@ void Source::seekAtomic(float offset, void *unit)
|
||||
if (buffer == AL_NONE)
|
||||
offsetSamples = 0;
|
||||
offsetSeconds = offsetSamples / sampleRate;
|
||||
this->offsetSamples = offsetSamples;
|
||||
this->offsetSeconds = offsetSeconds;
|
||||
}
|
||||
break;
|
||||
case TYPE_MAX_ENUM:
|
||||
break;
|
||||
}
|
||||
this->offsetSamples = offsetSamples;
|
||||
this->offsetSeconds = offsetSeconds;
|
||||
}
|
||||
|
||||
void Source::seek(float offset, Source::Unit unit)
|
||||
@@ -584,8 +582,10 @@ double Source::getDurationAtomic(void *vunit)
|
||||
else
|
||||
return (double)samples / (double)sampleRate;
|
||||
}
|
||||
default: return 0.0;
|
||||
case TYPE_MAX_ENUM:
|
||||
return 0.0;
|
||||
}
|
||||
return 0.0;
|
||||
}
|
||||
|
||||
double Source::getDuration(Unit unit)
|
||||
|
||||
Reference in New Issue
Block a user