diff options
author | Chris Robinson <[email protected]> | 2020-12-17 21:07:53 -0800 |
---|---|---|
committer | Chris Robinson <[email protected]> | 2020-12-17 21:07:53 -0800 |
commit | 5edd5a11fc16147ee25566db75732533005d1f46 (patch) | |
tree | 7f6e89f7c7afcb150a57b40f8aa5c25baf26c43e /alc/backends/wave.cpp | |
parent | 7d2e21334c5bc6423abed3b450d369829d7c1fde (diff) |
Don't use ALC error enums for the backend error code
Diffstat (limited to 'alc/backends/wave.cpp')
-rw-r--r-- | alc/backends/wave.cpp | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/alc/backends/wave.cpp b/alc/backends/wave.cpp index a9713718..b4e38d02 100644 --- a/alc/backends/wave.cpp +++ b/alc/backends/wave.cpp @@ -205,12 +205,14 @@ int WaveBackend::mixerProc() void WaveBackend::open(const ALCchar *name) { const char *fname{GetConfigValue(nullptr, "wave", "file", "")}; - if(!fname[0]) throw al::backend_exception{ALC_INVALID_VALUE, "No wave output filename"}; + if(!fname[0]) throw al::backend_exception{al::backend_error::NoDevice, + "No wave output filename"}; if(!name) name = waveDevice; else if(strcmp(name, waveDevice) != 0) - throw al::backend_exception{ALC_INVALID_VALUE, "Device name \"%s\" not found", name}; + throw al::backend_exception{al::backend_error::NoDevice, "Device name \"%s\" not found", + name}; #ifdef _WIN32 { @@ -221,8 +223,8 @@ void WaveBackend::open(const ALCchar *name) mFile = fopen(fname, "wb"); #endif if(!mFile) - throw al::backend_exception{ALC_INVALID_VALUE, "Could not open file '%s': %s", fname, - strerror(errno)}; + throw al::backend_exception{al::backend_error::DeviceError, "Could not open file '%s': %s", + fname, strerror(errno)}; mDevice->DeviceName = name; } @@ -339,8 +341,8 @@ void WaveBackend::start() mThread = std::thread{std::mem_fn(&WaveBackend::mixerProc), this}; } catch(std::exception& e) { - throw al::backend_exception{ALC_INVALID_DEVICE, "Failed to start mixing thread: %s", - e.what()}; + throw al::backend_exception{al::backend_error::DeviceError, + "Failed to start mixing thread: %s", e.what()}; } } |