remove GetOffsetFix
This commit is contained in:
@@ -655,7 +655,7 @@ void RageSound::CleanPosMap( deque<pos_map_t> &pos_map )
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Get the position in frames (ignoring GetOffsetFix). */
|
/* Get the position in frames. */
|
||||||
int64_t RageSound::GetPositionSecondsInternal( bool *approximate ) const
|
int64_t RageSound::GetPositionSecondsInternal( bool *approximate ) const
|
||||||
{
|
{
|
||||||
LockMut(SOUNDMAN->lock);
|
LockMut(SOUNDMAN->lock);
|
||||||
@@ -711,8 +711,7 @@ float RageSound::GetPositionSeconds( bool *approximate, RageTimer *Timestamp ) c
|
|||||||
if( Timestamp )
|
if( Timestamp )
|
||||||
HOOKS->ExitTimeCriticalSection();
|
HOOKS->ExitTimeCriticalSection();
|
||||||
|
|
||||||
const float fixed_pos = pos + Sample->GetOffsetFix();
|
return GetPlaybackRate() * pos;
|
||||||
return GetPlaybackRate() * fixed_pos;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -3,15 +3,14 @@
|
|||||||
|
|
||||||
/* A sound reader is a source for a RageSound. It's usually just a convenience
|
/* A sound reader is a source for a RageSound. It's usually just a convenience
|
||||||
* wrapper around SDL_Sound. */
|
* wrapper around SDL_Sound. */
|
||||||
class SoundReader {
|
class SoundReader
|
||||||
|
{
|
||||||
mutable string error;
|
mutable string error;
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
void SetError(string e) const { error = e; }
|
void SetError(string e) const { error = e; }
|
||||||
|
|
||||||
public:
|
public:
|
||||||
virtual float GetOffsetFix() const { return 0; }
|
|
||||||
|
|
||||||
virtual int GetLength() const = 0; /* ms */
|
virtual int GetLength() const = 0; /* ms */
|
||||||
virtual int GetLength_Fast() const { return GetLength(); } /* ms */
|
virtual int GetLength_Fast() const { return GetLength(); } /* ms */
|
||||||
virtual int SetPosition_Accurate(int ms) = 0;
|
virtual int SetPosition_Accurate(int ms) = 0;
|
||||||
|
|||||||
@@ -17,7 +17,6 @@ bool SoundReader_Preload::Open(SoundReader *source)
|
|||||||
{
|
{
|
||||||
ASSERT(source);
|
ASSERT(source);
|
||||||
samplerate = source->GetSampleRate();
|
samplerate = source->GetSampleRate();
|
||||||
OffsetFix = source->GetOffsetFix(); // propagate upwards
|
|
||||||
|
|
||||||
/* Check the length, and see if we think it'll fit in the buffer. */
|
/* Check the length, and see if we think it'll fit in the buffer. */
|
||||||
int len = source->GetLength_Fast();
|
int len = source->GetLength_Fast();
|
||||||
|
|||||||
@@ -42,7 +42,6 @@ public:
|
|||||||
int SetPosition_Fast(int ms);
|
int SetPosition_Fast(int ms);
|
||||||
int Read(char *buf, unsigned len);
|
int Read(char *buf, unsigned len);
|
||||||
int GetSampleRate() const { return samplerate; }
|
int GetSampleRate() const { return samplerate; }
|
||||||
float GetOffsetFix() const { return OffsetFix; }
|
|
||||||
|
|
||||||
SoundReader *Copy() const;
|
SoundReader *Copy() const;
|
||||||
~SoundReader_Preload() { }
|
~SoundReader_Preload() { }
|
||||||
|
|||||||
@@ -27,7 +27,6 @@ public:
|
|||||||
RageSoundReader_Resample_Fast();
|
RageSoundReader_Resample_Fast();
|
||||||
virtual ~RageSoundReader_Resample_Fast();
|
virtual ~RageSoundReader_Resample_Fast();
|
||||||
SoundReader *Copy() const;
|
SoundReader *Copy() const;
|
||||||
float GetOffsetFix() const { return source->GetOffsetFix(); }
|
|
||||||
|
|
||||||
/* Change the actual sample rate of a sound. */
|
/* Change the actual sample rate of a sound. */
|
||||||
void SetSampleRate(int hz);
|
void SetSampleRate(int hz);
|
||||||
|
|||||||
@@ -35,7 +35,6 @@ public:
|
|||||||
RageSoundReader_Resample_Good();
|
RageSoundReader_Resample_Good();
|
||||||
virtual ~RageSoundReader_Resample_Good();
|
virtual ~RageSoundReader_Resample_Good();
|
||||||
SoundReader *Copy() const;
|
SoundReader *Copy() const;
|
||||||
float GetOffsetFix() const { return source->GetOffsetFix(); }
|
|
||||||
|
|
||||||
/* Change the actual sample rate of a sound. */
|
/* Change the actual sample rate of a sound. */
|
||||||
void SetSampleRate( int hz );
|
void SetSampleRate( int hz );
|
||||||
|
|||||||
Reference in New Issue
Block a user