AudioCommon: make SoundLoop() non-virtual and private
This commit is contained in:
parent
d14b9a73b2
commit
b6d8c111bc
|
@ -23,12 +23,13 @@ public:
|
|||
~AlsaSound() override;
|
||||
|
||||
bool Init() override;
|
||||
void SoundLoop() override;
|
||||
bool SetRunning(bool running) override;
|
||||
|
||||
static bool isValid() { return true; }
|
||||
|
||||
private:
|
||||
void SoundLoop();
|
||||
|
||||
// maximum number of frames the buffer can hold
|
||||
static constexpr size_t BUFFER_SIZE_MAX = 8192;
|
||||
|
||||
|
|
|
@ -3,10 +3,6 @@
|
|||
|
||||
#include "AudioCommon/NullSoundStream.h"
|
||||
|
||||
void NullSound::SoundLoop()
|
||||
{
|
||||
}
|
||||
|
||||
bool NullSound::Init()
|
||||
{
|
||||
return true;
|
||||
|
|
|
@ -9,7 +9,6 @@ class NullSound final : public SoundStream
|
|||
{
|
||||
public:
|
||||
bool Init() override;
|
||||
void SoundLoop() override;
|
||||
bool SetRunning(bool running) override;
|
||||
void SetVolume(int volume) override;
|
||||
|
||||
|
|
|
@ -56,13 +56,14 @@ public:
|
|||
OpenALStream() : m_source(0) {}
|
||||
~OpenALStream() override;
|
||||
bool Init() override;
|
||||
void SoundLoop() override;
|
||||
void SetVolume(int volume) override;
|
||||
bool SetRunning(bool running) override;
|
||||
|
||||
static bool isValid();
|
||||
|
||||
private:
|
||||
void SoundLoop();
|
||||
|
||||
std::thread m_thread;
|
||||
Common::Flag m_run_thread;
|
||||
|
||||
|
|
|
@ -27,7 +27,7 @@ public:
|
|||
void UnderflowCallback(pa_stream* s);
|
||||
|
||||
private:
|
||||
void SoundLoop() override;
|
||||
void SoundLoop();
|
||||
|
||||
bool PulseInit();
|
||||
void PulseShutdown();
|
||||
|
|
|
@ -20,7 +20,6 @@ public:
|
|||
Mixer* GetMixer() const { return m_mixer.get(); }
|
||||
virtual bool Init() { return false; }
|
||||
virtual void SetVolume(int) {}
|
||||
virtual void SoundLoop() {}
|
||||
// Returns true if successful.
|
||||
virtual bool SetRunning(bool running) { return false; }
|
||||
};
|
||||
|
|
|
@ -35,13 +35,14 @@ public:
|
|||
~WASAPIStream();
|
||||
bool Init() override;
|
||||
bool SetRunning(bool running) override;
|
||||
void SoundLoop() override;
|
||||
|
||||
static bool isValid();
|
||||
static std::vector<std::string> GetAvailableDevices();
|
||||
static Microsoft::WRL::ComPtr<IMMDevice> GetDeviceByName(std::string_view name);
|
||||
|
||||
private:
|
||||
void SoundLoop();
|
||||
|
||||
u32 m_frames_in_buffer = 0;
|
||||
std::atomic<bool> m_running = false;
|
||||
std::thread m_thread;
|
||||
|
|
Loading…
Reference in New Issue