issues addressed

cropped trailing spaces
put TYPE_MAX_ENUM in getDurationAtomic
moved around variables in seekAtomic

--HG--
branch : minor
This commit is contained in:
rcoaxil
2016-10-15 20:04:08 +03:00
parent c5e0846c52
commit 38a6176665
7 changed files with 60 additions and 60 deletions
+1 -1
View File
@@ -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();
} }
+1 -1
View File
@@ -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;
} }
+7 -7
View File
@@ -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)