Rename RageMusic to RageSounds.

This commit is contained in:
Glenn Maynard
2003-07-26 22:47:55 +00:00
parent a5e1f86efd
commit 99e28a3875
8 changed files with 66 additions and 41 deletions
+1 -1
View File
@@ -55,7 +55,7 @@ RageTexture.cpp RageTexture.h RageTextureManager.cpp RageTextureManager.h RageTh
RageTimer.cpp RageTimer.h RageTypes.h RageUtil_FileDB.cpp RageUtil_FileDB.h RageUtil.cpp RageUtil.h \
RageUtil_CharConversions.cpp RageUtil_CharConversions.h RageSoundReader_Preload.cpp RageSoundReader_Preload.h \
RageSoundResampler.cpp RageSoundResampler.h RageSoundReader_Resample.cpp RageSoundReader_Resample.h RageSoundReader_FileReader.h \
RageMusic.cpp RageMusic.h
RageSounds.cpp RageSounds.h
DataStructures = \
CodeDetector.cpp CodeDetector.h Course.cpp Course.h Font.cpp Font.h FontCharAliases.cpp FontCharAliases.h \
-18
View File
@@ -1,18 +0,0 @@
#ifndef RAGE_MUSIC_H
class RageSound;
class RageMusic
{
RageSound *music;
public:
RageMusic();
~RageMusic();
void Play(CString file, bool force_loop = false, float start_sec = -1, float length_sec = -1, float fade_len = 0);
void Stop() { Play(""); }
CString GetPath() const;
};
extern RageMusic *MUSIC;
#endif
+4 -4
View File
@@ -10,7 +10,7 @@
#include "RageLog.h"
#include "RageTimer.h"
#include "RageMusic.h"
#include "RageSounds.h"
#include "arch/arch.h"
#include "arch/Sound/RageSoundDriver.h"
@@ -260,16 +260,16 @@ void RageSoundManager::MixAudio(Sint16 *dst, const Sint16 *src, Uint32 len, floa
void RageSoundManager::PlayMusic(CString file, bool force_loop, float start_sec, float length_sec, float fade_len)
{
MUSIC->Play(file, force_loop, start_sec, length_sec, fade_len);
SOUND->PlayMusic(file, force_loop, start_sec, length_sec, fade_len);
}
void RageSoundManager::StopMusic()
{
MUSIC->Stop();
SOUND->StopMusic();
}
CString RageSoundManager::GetMusicPath() const
{
return MUSIC->GetPath();
return SOUND->GetMusicPath();
}
void RageSoundManager::SetPrefs(float MixVol)
@@ -1,27 +1,29 @@
/* This is just a simple wrapper to handle a single music track conveniently. */
#include "global.h"
#include "RageMusic.h"
#include "RageSoundManager.h"
#include "RageSounds.h"
#include "RageSound.h"
RageMusic *MUSIC = NULL;
RageSounds *SOUND = NULL;
RageMusic::RageMusic()
RageSounds::RageSounds()
{
/* Init RageSoundMan first: */
ASSERT( SOUNDMAN );
music = new RageSound;
}
RageMusic::~RageMusic()
RageSounds::~RageSounds()
{
delete music;
}
CString RageMusic::GetPath() const
CString RageSounds::GetMusicPath() const
{
return music->GetLoadedFilePath();
}
void RageMusic::Play(CString file, bool force_loop, float start_sec, float length_sec, float fade_len)
void RageSounds::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());
if(music->IsPlaying())
@@ -58,6 +60,16 @@ void RageMusic::Play(CString file, bool force_loop, float start_sec, float lengt
music->StartPlaying();
}
void RageSounds::PlayOnce( CString sPath )
{
SOUNDMAN->PlayOnce( sPath );
}
void RageSounds::PlayOnceFromDir( CString PlayOnceFromDir )
{
SOUNDMAN->PlayOnceFromDir( PlayOnceFromDir );
}
/*
-----------------------------------------------------------------------------
Copyright (c) 2002-2003 by the person(s) listed below. All rights reserved.
+31
View File
@@ -0,0 +1,31 @@
#ifndef RAGE_MUSIC_H
/* This contains all of the generally useful user-level SOUNDMAN calls, as well
* as some other simple helper stuff. Don't include RageSoundManager for normal
* use; it's only for drivers and sound code. This file should be very lightweight. */
*/
class RageSound;
class RageSounds
{
RageSound *music;
public:
RageSounds();
~RageSounds();
void PlayMusic(CString file, bool force_loop = false, float start_sec = -1, float length_sec = -1, float fade_len = 0);
void StopMusic() { PlayMusic(""); }
CString GetMusicPath() const;
void PlayOnce( CString sPath );
void PlayOnceFromDir( CString sDir );
};
extern RageSounds *SOUND;
#endif
/*
-----------------------------------------------------------------------------
Copyright (c) 2002-2003 by the person(s) listed below. All rights reserved.
Glenn Maynard
-----------------------------------------------------------------------------
*/
+3 -3
View File
@@ -18,7 +18,7 @@
#include "RageLog.h"
#include "RageTextureManager.h"
#include "RageSoundManager.h"
#include "RageMusic.h"
#include "RageSounds.h"
#include "RageInput.h"
#include "RageTimer.h"
#include "RageException.h"
@@ -486,7 +486,7 @@ int main(int argc, char* argv[])
NOTESKIN = new NoteSkinManager;
SOUNDMAN = new RageSoundManager(PREFSMAN->m_sSoundDrivers);
SOUNDMAN->SetPrefs(PREFSMAN->m_fSoundVolume);
MUSIC = new RageMusic;
SOUND = new RageSounds;
ANNOUNCER = new AnnouncerManager;
INPUTFILTER = new InputFilter;
INPUTMAPPER = new InputMapper;
@@ -572,7 +572,7 @@ int main(int argc, char* argv[])
SAFE_DELETE( NOTESKIN );
SAFE_DELETE( THEME );
SAFE_DELETE( ANNOUNCER );
SAFE_DELETE( MUSIC );
SAFE_DELETE( SOUND );
SAFE_DELETE( SOUNDMAN );
SAFE_DELETE( FONT );
SAFE_DELETE( TEXTUREMAN );
+2 -2
View File
@@ -543,7 +543,7 @@ SOURCE=.\RageMath.h
# End Source File
# Begin Source File
SOURCE=.\RageMusic.cpp
SOURCE=.\RageSounds.cpp
!IF "$(CFG)" == "StepMania - Win32 Debug"
@@ -558,7 +558,7 @@ SOURCE=.\RageMusic.cpp
# End Source File
# Begin Source File
SOURCE=.\RageMusic.h
SOURCE=.\RageSounds.h
# End Source File
# Begin Source File
+6 -6
View File
@@ -1527,12 +1527,6 @@ cl /Zl /nologo /c verstub.cpp /Fo"$(IntDir)"\
<File
RelativePath="RageMath.h">
</File>
<File
RelativePath="RageMusic.cpp">
</File>
<File
RelativePath="RageMusic.h">
</File>
<File
RelativePath="RageSound.cpp">
</File>
@@ -1575,6 +1569,12 @@ cl /Zl /nologo /c verstub.cpp /Fo&quot;$(IntDir)&quot;\
<File
RelativePath="RageSoundResampler.h">
</File>
<File
RelativePath="RageSounds.cpp">
</File>
<File
RelativePath="RageSounds.h">
</File>
<File
RelativePath=".\RageTexture.cpp">
</File>