undo regression introduced in d17c21e where any songs without keysounds were clobbered by RageSoundReader_Silence. please test your code before committing it :|
This commit is contained in:
@@ -19,7 +19,6 @@
|
||||
#include "AutoKeysounds.h"
|
||||
#include "GameState.h"
|
||||
#include "Song.h"
|
||||
#include "RageSoundReader.h"
|
||||
#include "RageSoundReader_Chain.h"
|
||||
#include "RageSoundReader_ChannelSplit.h"
|
||||
#include "RageSoundReader_Extend.h"
|
||||
@@ -277,8 +276,6 @@ void AutoKeysounds::FinishLoading()
|
||||
else
|
||||
{
|
||||
delete pChain;
|
||||
RageSoundReader_Silence *pSilence = new RageSoundReader_Silence;
|
||||
m_pSharedSound = pSilence;
|
||||
}
|
||||
}
|
||||
ASSERT_M( m_pSharedSound, ssprintf("No keysounds were loaded for the song %s!", pSong->m_sMainTitle.c_str() ));
|
||||
|
||||
@@ -133,6 +133,21 @@ bool RageSound::IsLoaded() const
|
||||
return m_pSource != NULL;
|
||||
}
|
||||
|
||||
class RageSoundReader_Silence: public RageSoundReader
|
||||
{
|
||||
public:
|
||||
int GetLength() const { return 0; }
|
||||
int GetLength_Fast() const { return 0; }
|
||||
int SetPosition( int iFrame ) { return 1; }
|
||||
int Read( float *pBuf, int iFrames ) { return RageSoundReader::END_OF_FILE; }
|
||||
RageSoundReader *Copy() const { return new RageSoundReader_Silence; }
|
||||
int GetSampleRate() const { return 44100; }
|
||||
unsigned GetNumChannels() const { return 1; }
|
||||
int GetNextSourceFrame() const { return 0; }
|
||||
float GetStreamToSourceRatio() const { return 1.0f; }
|
||||
RString GetError() const { return ""; }
|
||||
};
|
||||
|
||||
|
||||
bool RageSound::Load( RString sSoundFilePath )
|
||||
{
|
||||
|
||||
@@ -43,22 +43,6 @@ public:
|
||||
int RetriedRead( float *pBuffer, int iFrames, int *iSourceFrame = NULL, float *fRate = NULL );
|
||||
};
|
||||
|
||||
|
||||
class RageSoundReader_Silence: public RageSoundReader
|
||||
{
|
||||
public:
|
||||
int GetLength() const { return 0; }
|
||||
int GetLength_Fast() const { return 0; }
|
||||
int SetPosition( int iFrame ) { return 1; }
|
||||
int Read( float *pBuf, int iFrames ) { return RageSoundReader::END_OF_FILE; }
|
||||
RageSoundReader *Copy() const { return new RageSoundReader_Silence; }
|
||||
int GetSampleRate() const { return 44100; }
|
||||
unsigned GetNumChannels() const { return 1; }
|
||||
int GetNextSourceFrame() const { return 0; }
|
||||
float GetStreamToSourceRatio() const { return 1.0f; }
|
||||
RString GetError() const { return ""; }
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
/*
|
||||
|
||||
Reference in New Issue
Block a user