Fix a few minor compiler warnings.

Make WAV play methods not pure virtual, so we can change them without affecting libretro.
This commit is contained in:
Stephen Anthony 2022-09-03 14:51:20 -02:30
parent dfccad83cf
commit 1c38d3e57a
3 changed files with 6 additions and 9 deletions

View File

@ -72,7 +72,7 @@ SoundSDL2::~SoundSDL2()
{
ASSERT_MAIN_THREAD;
stopWav();
stopWav(); // NOLINT
if(myWavDevice)
SDL_CloseAudioDevice(myWavDevice);
@ -409,7 +409,7 @@ bool SoundSDL2::playWav(const char* fileName, uInt32 position, uInt32 length)
// - volume (requires callback using SDL_MixAudio)
// - (un)mute
SDL_AudioSpec wavSpec;
uInt32 wavLength;
uInt32 wavLength{0};
// Stop any playing WAVs
stopWav();

View File

@ -114,19 +114,20 @@ class Sound
@return True, if the WAV file can be played
*/
virtual bool playWav(const char* fileName, uInt32 position = 0, uInt32 length = 0) = 0;
virtual bool playWav(const char* fileName, uInt32 position = 0,
uInt32 length = 0) { return false; }
/**
Stop any currently playing WAV file.
*/
virtual void stopWav() = 0;
virtual void stopWav() { }
/**
Get the size of the WAV file which remains to be played.
@return The remaining number of bytes
*/
virtual uInt32 wavSize() const = 0;
virtual uInt32 wavSize() const { return 0; }
protected:
/**

View File

@ -151,10 +151,6 @@ class SoundLIBRETRO : public Sound
bool toggleMute() override { return !myIsInitializedFlag; }
string about() const override { return ""; }
bool playWav(const char*, uInt32, uInt32) override { return false; }
void stopWav() override { }
uInt32 wavSize() const override { return 0; }
private:
// Indicates if the sound device was successfully initialized
bool myIsInitializedFlag{false};