AudioCommon: rename isValid() to IsValid()

This commit is contained in:
Tillmann Karras 2021-08-08 00:23:58 +01:00
parent b6d8c111bc
commit eda2035874
10 changed files with 20 additions and 20 deletions

View File

@ -25,7 +25,7 @@ public:
bool Init() override;
bool SetRunning(bool running) override;
static bool isValid() { return true; }
static bool IsValid() { return true; }
private:
void SoundLoop();

View File

@ -30,17 +30,17 @@ static std::unique_ptr<SoundStream> CreateSoundStreamForBackend(std::string_view
{
if (backend == BACKEND_CUBEB)
return std::make_unique<CubebStream>();
else if (backend == BACKEND_OPENAL && OpenALStream::isValid())
else if (backend == BACKEND_OPENAL && OpenALStream::IsValid())
return std::make_unique<OpenALStream>();
else if (backend == BACKEND_NULLSOUND)
return std::make_unique<NullSound>();
else if (backend == BACKEND_ALSA && AlsaSound::isValid())
else if (backend == BACKEND_ALSA && AlsaSound::IsValid())
return std::make_unique<AlsaSound>();
else if (backend == BACKEND_PULSEAUDIO && PulseAudio::isValid())
else if (backend == BACKEND_PULSEAUDIO && PulseAudio::IsValid())
return std::make_unique<PulseAudio>();
else if (backend == BACKEND_OPENSLES && OpenSLESStream::isValid())
else if (backend == BACKEND_OPENSLES && OpenSLESStream::IsValid())
return std::make_unique<OpenSLESStream>();
else if (backend == BACKEND_WASAPI && WASAPIStream::isValid())
else if (backend == BACKEND_WASAPI && WASAPIStream::IsValid())
return std::make_unique<WASAPIStream>();
return {};
}
@ -96,7 +96,7 @@ std::string GetDefaultSoundBackend()
#if defined ANDROID
backend = BACKEND_OPENSLES;
#elif defined __linux__
if (AlsaSound::isValid())
if (AlsaSound::IsValid())
backend = BACKEND_ALSA;
#elif defined(__APPLE__) || defined(_WIN32)
backend = BACKEND_CUBEB;
@ -115,15 +115,15 @@ std::vector<std::string> GetSoundBackends()
backends.emplace_back(BACKEND_NULLSOUND);
backends.emplace_back(BACKEND_CUBEB);
if (AlsaSound::isValid())
if (AlsaSound::IsValid())
backends.emplace_back(BACKEND_ALSA);
if (PulseAudio::isValid())
if (PulseAudio::IsValid())
backends.emplace_back(BACKEND_PULSEAUDIO);
if (OpenALStream::isValid())
if (OpenALStream::IsValid())
backends.emplace_back(BACKEND_OPENAL);
if (OpenSLESStream::isValid())
if (OpenSLESStream::IsValid())
backends.emplace_back(BACKEND_OPENSLES);
if (WASAPIStream::isValid())
if (WASAPIStream::IsValid())
backends.emplace_back(BACKEND_WASAPI);
return backends;

View File

@ -12,5 +12,5 @@ public:
bool SetRunning(bool running) override;
void SetVolume(int volume) override;
static bool isValid() { return true; }
static bool IsValid() { return true; }
};

View File

@ -83,7 +83,7 @@ static bool InitLibrary()
return true;
}
bool OpenALStream::isValid()
bool OpenALStream::IsValid()
{
return InitLibrary();
}

View File

@ -59,7 +59,7 @@ public:
void SetVolume(int volume) override;
bool SetRunning(bool running) override;
static bool isValid();
static bool IsValid();
private:
void SoundLoop();

View File

@ -16,7 +16,7 @@ public:
bool Init() override;
bool SetRunning(bool running) override { return true; }
void SetVolume(int volume) override;
static bool isValid() { return true; }
static bool IsValid() { return true; }
private:
std::thread thread;

View File

@ -21,7 +21,7 @@ public:
bool Init() override;
bool SetRunning(bool running) override { return true; }
static bool isValid() { return true; }
static bool IsValid() { return true; }
void StateCallback(pa_context* c);
void WriteCallback(pa_stream* s, size_t length);
void UnderflowCallback(pa_stream* s);

View File

@ -16,7 +16,7 @@ protected:
public:
SoundStream() : m_mixer(new Mixer(48000)) {}
virtual ~SoundStream() {}
static bool isValid() { return false; }
static bool IsValid() { return false; }
Mixer* GetMixer() const { return m_mixer.get(); }
virtual bool Init() { return false; }
virtual void SetVolume(int) {}

View File

@ -49,7 +49,7 @@ WASAPIStream::~WASAPIStream()
m_thread.join();
}
bool WASAPIStream::isValid()
bool WASAPIStream::IsValid()
{
return true;
}

View File

@ -36,7 +36,7 @@ public:
bool Init() override;
bool SetRunning(bool running) override;
static bool isValid();
static bool IsValid();
static std::vector<std::string> GetAvailableDevices();
static Microsoft::WRL::ComPtr<IMMDevice> GetDeviceByName(std::string_view name);