stub music calls until converted
This commit is contained in:
@@ -10,6 +10,8 @@
|
|||||||
#include "RageLog.h"
|
#include "RageLog.h"
|
||||||
#include "RageTimer.h"
|
#include "RageTimer.h"
|
||||||
|
|
||||||
|
#include "RageMusic.h"
|
||||||
|
|
||||||
#include "arch/arch.h"
|
#include "arch/arch.h"
|
||||||
#include "arch/Sound/RageSoundDriver.h"
|
#include "arch/Sound/RageSoundDriver.h"
|
||||||
#include "SDL_audio.h"
|
#include "SDL_audio.h"
|
||||||
@@ -255,46 +257,19 @@ void RageSoundManager::MixAudio(Sint16 *dst, const Sint16 *src, Uint32 len, floa
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
CString RageSoundManager::GetMusicPath() const
|
|
||||||
{
|
|
||||||
return music->GetLoadedFilePath();
|
|
||||||
}
|
|
||||||
|
|
||||||
void RageSoundManager::PlayMusic(CString file, bool force_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());
|
MUSIC->Play(file, force_loop, start_sec, length_sec, fade_len);
|
||||||
if(music->IsPlaying())
|
}
|
||||||
{
|
void RageSoundManager::StopMusic()
|
||||||
if( music->GetLoadedFilePath() == file )
|
{
|
||||||
return; // do nothing
|
MUSIC->Stop();
|
||||||
|
}
|
||||||
|
|
||||||
music->StopPlaying();
|
CString RageSoundManager::GetMusicPath() const
|
||||||
}
|
{
|
||||||
|
return MUSIC->GetPath();
|
||||||
/* If file is blank, just stop. */
|
|
||||||
if(file.empty())
|
|
||||||
{
|
|
||||||
music->Unload();
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
music->Load( file, false );
|
|
||||||
if( force_loop )
|
|
||||||
music->SetStopMode( RageSound::M_LOOP );
|
|
||||||
|
|
||||||
if(start_sec == -1)
|
|
||||||
music->SetStartSeconds();
|
|
||||||
else
|
|
||||||
music->SetStartSeconds(start_sec);
|
|
||||||
|
|
||||||
if(length_sec == -1)
|
|
||||||
music->SetLengthSeconds();
|
|
||||||
else
|
|
||||||
music->SetLengthSeconds(length_sec);
|
|
||||||
|
|
||||||
music->SetFadeLength(fade_len);
|
|
||||||
music->SetPositionSeconds();
|
|
||||||
music->StartPlaying();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void RageSoundManager::SetPrefs(float MixVol)
|
void RageSoundManager::SetPrefs(float MixVol)
|
||||||
|
|||||||
@@ -60,8 +60,9 @@ public:
|
|||||||
* itself to this. */
|
* itself to this. */
|
||||||
set<RageSound *> all_sounds;
|
set<RageSound *> all_sounds;
|
||||||
|
|
||||||
|
/* stubs for music */
|
||||||
void PlayMusic(CString file, bool force_loop = false, 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();
|
||||||
CString GetMusicPath() const;
|
CString GetMusicPath() const;
|
||||||
|
|
||||||
static void MixAudio(Sint16 *dst, const Sint16 *src, Uint32 len, float volume);
|
static void MixAudio(Sint16 *dst, const Sint16 *src, Uint32 len, float volume);
|
||||||
|
|||||||
Reference in New Issue
Block a user