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