mirror of
https://github.com/love2d/love.git
synced 2026-08-21 05:00:08 +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();
|
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();
|
return new Source();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -222,7 +222,7 @@ int Source::getFreeBufferCount() const
|
|||||||
return 0;
|
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;
|
return false;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -463,7 +463,7 @@ void Source::seekAtomic(float offset, void *unit)
|
|||||||
{
|
{
|
||||||
case TYPE_STATIC:
|
case TYPE_STATIC:
|
||||||
alSourcef(source, AL_SAMPLE_OFFSET, offsetSamples);
|
alSourcef(source, AL_SAMPLE_OFFSET, offsetSamples);
|
||||||
this->offsetSamples = this->offsetSeconds = 0;
|
offsetSamples = offsetSeconds = 0;
|
||||||
break;
|
break;
|
||||||
case TYPE_STREAM:
|
case TYPE_STREAM:
|
||||||
{
|
{
|
||||||
@@ -473,8 +473,6 @@ void Source::seekAtomic(float offset, void *unit)
|
|||||||
if (valid)
|
if (valid)
|
||||||
stopAtomic();
|
stopAtomic();
|
||||||
|
|
||||||
this->offsetSamples = offsetSamples;
|
|
||||||
this->offsetSeconds = offsetSeconds;
|
|
||||||
decoder->seek(offsetSeconds);
|
decoder->seek(offsetSeconds);
|
||||||
|
|
||||||
if (wasPlaying)
|
if (wasPlaying)
|
||||||
@@ -486,7 +484,7 @@ void Source::seekAtomic(float offset, void *unit)
|
|||||||
if (valid)
|
if (valid)
|
||||||
{
|
{
|
||||||
alSourcef(source, AL_SAMPLE_OFFSET, offsetSamples);
|
alSourcef(source, AL_SAMPLE_OFFSET, offsetSamples);
|
||||||
this->offsetSamples = this->offsetSeconds = 0;
|
offsetSamples = offsetSeconds = 0;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@@ -509,13 +507,13 @@ void Source::seekAtomic(float offset, void *unit)
|
|||||||
if (buffer == AL_NONE)
|
if (buffer == AL_NONE)
|
||||||
offsetSamples = 0;
|
offsetSamples = 0;
|
||||||
offsetSeconds = offsetSamples / sampleRate;
|
offsetSeconds = offsetSamples / sampleRate;
|
||||||
this->offsetSamples = offsetSamples;
|
|
||||||
this->offsetSeconds = offsetSeconds;
|
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case TYPE_MAX_ENUM:
|
case TYPE_MAX_ENUM:
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
this->offsetSamples = offsetSamples;
|
||||||
|
this->offsetSeconds = offsetSeconds;
|
||||||
}
|
}
|
||||||
|
|
||||||
void Source::seek(float offset, Source::Unit unit)
|
void Source::seek(float offset, Source::Unit unit)
|
||||||
@@ -584,8 +582,10 @@ double Source::getDurationAtomic(void *vunit)
|
|||||||
else
|
else
|
||||||
return (double)samples / (double)sampleRate;
|
return (double)samples / (double)sampleRate;
|
||||||
}
|
}
|
||||||
default: return 0.0;
|
case TYPE_MAX_ENUM:
|
||||||
|
return 0.0;
|
||||||
}
|
}
|
||||||
|
return 0.0;
|
||||||
}
|
}
|
||||||
|
|
||||||
double Source::getDuration(Unit unit)
|
double Source::getDuration(Unit unit)
|
||||||
|
|||||||
Reference in New Issue
Block a user