add null sound driver

This commit is contained in:
Glenn Maynard
2003-02-12 01:54:01 +00:00
parent 5a27d51068
commit 649f835042
5 changed files with 33 additions and 3 deletions
+4
View File
@@ -621,6 +621,10 @@ SOURCE=.\arch\Sound\RageSoundDriver_DSound_Software.h
# End Source File
# Begin Source File
SOURCE=.\arch\Sound\RageSoundDriver_Null.h
# End Source File
# Begin Source File
SOURCE=.\arch\Sound\RageSoundDriver_WaveOut.cpp
# End Source File
# Begin Source File
+3
View File
@@ -773,6 +773,9 @@ cl /Zl /nologo /c verstub.cpp /Fo$(IntDir)\
<File
RelativePath="arch\Sound\RageSoundDriver_DSound_Software.h">
</File>
<File
RelativePath="arch\Sound\RageSoundDriver_Null.h">
</File>
<File
RelativePath="arch\Sound\RageSoundDriver_WaveOut.cpp">
</File>
@@ -0,0 +1,22 @@
#ifndef RAGE_SOUND_NULL
#define RAGE_SOUND_NULL
#include "RageSound.h"
class RageSound_Null: public RageSoundDriver
{
public:
/* virtuals: */
void StartMixing(RageSound *snd) { }
void StopMixing(RageSound *snd) { }
int GetPosition(const RageSound *snd) const { return 0; }
float GetPlayLatency() const { return 0.0f; } /* silence is fast! */
};
#endif
/*
* Copyright (c) 2003 by the person(s) listed below. All rights reserved.
*
* Glenn Maynard
*/
+3 -1
View File
@@ -41,8 +41,10 @@ RageSoundDriver *MakeRageSoundDriver(CString drivers)
else if(DriversToTry[i] == "DirectSound-sw") ret = new RageSound_DSound_Software;
else if(DriversToTry[i] == "WaveOut") ret = new RageSound_WaveOut;
#else
#error No sound drivers defined!
#warn No sound drivers defined!
if(0) ;
#endif
else if(DriversToTry[i] == "Null") ret = new RageSound_Null;
else
LOG->Warn("Unknown sound driver name: %s", DriversToTry[i].GetString());
}
+1 -2
View File
@@ -8,8 +8,7 @@
#include "LoadingWindow/LoadingWindow_SDL.h"
#include "ErrorDialog/ErrorDialog_stdout.h"
#include "ArchHooks/ArchHooks_none.h"
/* no default sound driver */
#include "Sound/RageSoundDriver_Null.h"
#endif