add "loop" file name hint for sounds
This commit is contained in:
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@@ -178,6 +178,12 @@ bool RageSound::Load(CString sSoundFilePath, int precache)
|
|||||||
m_sFilePath = sSoundFilePath;
|
m_sFilePath = sSoundFilePath;
|
||||||
position = 0;
|
position = 0;
|
||||||
|
|
||||||
|
|
||||||
|
// Check for "loop" hint
|
||||||
|
if( m_sFilePath.Find("loop") != -1 )
|
||||||
|
SetStopMode( M_LOOP );
|
||||||
|
|
||||||
|
|
||||||
SoundReader_FileReader *NewSample = new RageSoundReader_LowLevel;
|
SoundReader_FileReader *NewSample = new RageSoundReader_LowLevel;
|
||||||
if(!NewSample->Open(sSoundFilePath.c_str()))
|
if(!NewSample->Open(sSoundFilePath.c_str()))
|
||||||
RageException::Throw( "RageSoundManager::RageSoundManager: error opening sound '%s': '%s'",
|
RageException::Throw( "RageSoundManager::RageSoundManager: error opening sound '%s': '%s'",
|
||||||
|
|||||||
@@ -256,7 +256,7 @@ void RageSoundManager::MixAudio(Sint16 *dst, const Sint16 *src, Uint32 len, floa
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void RageSoundManager::PlayMusic(CString file, bool loop, float start_sec, float length_sec, float fade_len)
|
void RageSoundManager::PlayMusic(CString file, bool force_loop, float start_sec, float length_sec, float fade_len)
|
||||||
{
|
{
|
||||||
// LOG->Trace("play '%s' (current '%s')", file.c_str(), music->GetLoadedFilePath().c_str());
|
// LOG->Trace("play '%s' (current '%s')", file.c_str(), music->GetLoadedFilePath().c_str());
|
||||||
if(music->IsPlaying())
|
if(music->IsPlaying())
|
||||||
@@ -272,8 +272,8 @@ void RageSoundManager::PlayMusic(CString file, bool loop, float start_sec, float
|
|||||||
return;
|
return;
|
||||||
|
|
||||||
music->Load( file, false );
|
music->Load( file, false );
|
||||||
|
if( force_loop )
|
||||||
music->SetStopMode(loop? RageSound::M_LOOP:RageSound::M_STOP);
|
music->SetStopMode( RageSound::M_LOOP );
|
||||||
|
|
||||||
if(start_sec == -1)
|
if(start_sec == -1)
|
||||||
music->SetStartSeconds();
|
music->SetStartSeconds();
|
||||||
|
|||||||
@@ -60,7 +60,7 @@ public:
|
|||||||
* itself to this. */
|
* itself to this. */
|
||||||
set<RageSound *> all_sounds;
|
set<RageSound *> all_sounds;
|
||||||
|
|
||||||
void PlayMusic(CString file, bool loop = true, float start_sec = -1, float length_sec = -1, float fade_len = 0);
|
void PlayMusic(CString file, bool force_loop = false, float start_sec = -1, float length_sec = -1, float fade_len = 0);
|
||||||
void StopMusic() { PlayMusic(""); }
|
void StopMusic() { PlayMusic(""); }
|
||||||
static void MixAudio(Sint16 *dst, const Sint16 *src, Uint32 len, float volume);
|
static void MixAudio(Sint16 *dst, const Sint16 *src, Uint32 len, float volume);
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -140,7 +140,7 @@ try_element_again:
|
|||||||
{ "*.ini", NULL },
|
{ "*.ini", NULL },
|
||||||
{ "*.model", "*.sprite", "*.png", "*.jpg", "*.bmp", "*.gif","*.avi", "*.mpg", "*.mpeg", NULL},
|
{ "*.model", "*.sprite", "*.png", "*.jpg", "*.bmp", "*.gif","*.avi", "*.mpg", "*.mpeg", NULL},
|
||||||
{ "*.png", NULL },
|
{ "*.png", NULL },
|
||||||
{ ".set", ".mp3", ".ogg", ".wav", NULL },
|
{ ".set", "*.mp3", "*.ogg", "*.wav", NULL },
|
||||||
};
|
};
|
||||||
const char **asset_masks = masks[category];
|
const char **asset_masks = masks[category];
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user