aboutsummaryrefslogtreecommitdiffstats
path: root/alc/backends/wasapi.cpp
diff options
context:
space:
mode:
authorChris Robinson <chris.kcat@gmail.com>2020-12-17 21:07:53 -0800
committerChris Robinson <chris.kcat@gmail.com>2020-12-17 21:07:53 -0800
commit5edd5a11fc16147ee25566db75732533005d1f46 (patch)
tree7f6e89f7c7afcb150a57b40f8aa5c25baf26c43e /alc/backends/wasapi.cpp
parent7d2e21334c5bc6423abed3b450d369829d7c1fde (diff)
Don't use ALC error enums for the backend error code
Diffstat (limited to 'alc/backends/wasapi.cpp')
-rw-r--r--alc/backends/wasapi.cpp18
1 files changed, 11 insertions, 7 deletions
diff --git a/alc/backends/wasapi.cpp b/alc/backends/wasapi.cpp
index 3b732d2c..099a05ec 100644
--- a/alc/backends/wasapi.cpp
+++ b/alc/backends/wasapi.cpp
@@ -844,7 +844,8 @@ void WasapiPlayback::open(const ALCchar *name)
mDevId.clear();
- throw al::backend_exception{ALC_INVALID_VALUE, "Device init failed: 0x%08lx", hr};
+ throw al::backend_exception{al::backend_error::DeviceError, "Device init failed: 0x%08lx",
+ hr};
}
}
@@ -887,7 +888,7 @@ bool WasapiPlayback::reset()
{
HRESULT hr{pushMessage(MsgType::ResetDevice).get()};
if(FAILED(hr))
- throw al::backend_exception{ALC_INVALID_VALUE, "0x%08lx", hr};
+ throw al::backend_exception{al::backend_error::DeviceError, "0x%08lx", hr};
return true;
}
@@ -1151,7 +1152,8 @@ void WasapiPlayback::start()
{
const HRESULT hr{pushMessage(MsgType::StartDevice).get()};
if(FAILED(hr))
- throw al::backend_exception{ALC_INVALID_DEVICE, "Failed to start playback: 0x%lx", hr};
+ throw al::backend_exception{al::backend_error::DeviceError,
+ "Failed to start playback: 0x%lx", hr};
}
HRESULT WasapiPlayback::startProxy()
@@ -1410,15 +1412,16 @@ void WasapiCapture::open(const ALCchar *name)
mDevId.clear();
- throw al::backend_exception{ALC_INVALID_VALUE, "Device init failed: 0x%08lx", hr};
+ throw al::backend_exception{al::backend_error::DeviceError, "Device init failed: 0x%08lx",
+ hr};
}
hr = pushMessage(MsgType::ResetDevice).get();
if(FAILED(hr))
{
if(hr == E_OUTOFMEMORY)
- throw al::backend_exception{ALC_OUT_OF_MEMORY, "Out of memory"};
- throw al::backend_exception{ALC_INVALID_VALUE, "Device reset failed"};
+ throw al::backend_exception{al::backend_error::OutOfMemory, "Out of memory"};
+ throw al::backend_exception{al::backend_error::DeviceError, "Device reset failed"};
}
}
@@ -1714,7 +1717,8 @@ void WasapiCapture::start()
{
const HRESULT hr{pushMessage(MsgType::StartDevice).get()};
if(FAILED(hr))
- throw al::backend_exception{ALC_INVALID_DEVICE, "Failed to start recording: 0x%lx", hr};
+ throw al::backend_exception{al::backend_error::DeviceError,
+ "Failed to start recording: 0x%lx", hr};
}
HRESULT WasapiCapture::startProxy()