output/wasapi: rename OpenDevice() to ChooseDevice()
OpenDevice was a confusing name because it does not actually open a device.
This commit is contained in:
@@ -253,7 +253,7 @@ public:
|
|||||||
com_worker = std::make_shared<COMWorker>();
|
com_worker = std::make_shared<COMWorker>();
|
||||||
|
|
||||||
try {
|
try {
|
||||||
com_worker->Async([&]() { OpenDevice(); }).get();
|
com_worker->Async([&]() { ChooseDevice(); }).get();
|
||||||
} catch (...) {
|
} catch (...) {
|
||||||
com_worker.reset();
|
com_worker.reset();
|
||||||
throw;
|
throw;
|
||||||
@@ -288,7 +288,7 @@ private:
|
|||||||
void DoDisable() noexcept;
|
void DoDisable() noexcept;
|
||||||
void DoOpen(AudioFormat &audio_format);
|
void DoOpen(AudioFormat &audio_format);
|
||||||
|
|
||||||
void OpenDevice();
|
void ChooseDevice();
|
||||||
bool TryFormatExclusive(const AudioFormat &audio_format);
|
bool TryFormatExclusive(const AudioFormat &audio_format);
|
||||||
void FindExclusiveFormatSupported(AudioFormat &audio_format);
|
void FindExclusiveFormatSupported(AudioFormat &audio_format);
|
||||||
void FindSharedFormatSupported(AudioFormat &audio_format);
|
void FindSharedFormatSupported(AudioFormat &audio_format);
|
||||||
@@ -445,7 +445,7 @@ WasapiOutput::DoOpen(AudioFormat &audio_format)
|
|||||||
|
|
||||||
if (GetState(*device) != DEVICE_STATE_ACTIVE) {
|
if (GetState(*device) != DEVICE_STATE_ACTIVE) {
|
||||||
device.reset();
|
device.reset();
|
||||||
OpenDevice();
|
ChooseDevice();
|
||||||
}
|
}
|
||||||
|
|
||||||
client = Activate<IAudioClient>(*device);
|
client = Activate<IAudioClient>(*device);
|
||||||
@@ -693,7 +693,7 @@ WasapiOutput::Cancel() noexcept
|
|||||||
|
|
||||||
/// run inside COMWorkerThread
|
/// run inside COMWorkerThread
|
||||||
void
|
void
|
||||||
WasapiOutput::OpenDevice()
|
WasapiOutput::ChooseDevice()
|
||||||
{
|
{
|
||||||
ComPtr<IMMDeviceEnumerator> enumerator;
|
ComPtr<IMMDeviceEnumerator> enumerator;
|
||||||
enumerator.CoCreateInstance(__uuidof(MMDeviceEnumerator), nullptr,
|
enumerator.CoCreateInstance(__uuidof(MMDeviceEnumerator), nullptr,
|
||||||
|
Reference in New Issue
Block a user