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/opensl.cpp | |
parent | 7d2e21334c5bc6423abed3b450d369829d7c1fde (diff) |
Don't use ALC error enums for the backend error code
Diffstat (limited to 'alc/backends/opensl.cpp')
-rw-r--r-- | alc/backends/opensl.cpp | 21 |
1 files changed, 12 insertions, 9 deletions
diff --git a/alc/backends/opensl.cpp b/alc/backends/opensl.cpp index 11a6a9eb..dccc7410 100644 --- a/alc/backends/opensl.cpp +++ b/alc/backends/opensl.cpp @@ -306,7 +306,8 @@ void OpenSLPlayback::open(const ALCchar *name) if(!name) name = opensl_device; else if(strcmp(name, opensl_device) != 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}; // create engine SLresult result{slCreateEngine(&mEngineObj, 0, nullptr, 0, nullptr, nullptr)}; @@ -343,7 +344,7 @@ void OpenSLPlayback::open(const ALCchar *name) mEngineObj = nullptr; mEngine = nullptr; - throw al::backend_exception{ALC_INVALID_VALUE, + throw al::backend_exception{al::backend_error::DeviceError, "Failed to initialize OpenSL device: 0x%08x", result}; } @@ -554,16 +555,16 @@ void OpenSLPlayback::start() PRINTERR(result, "bufferQueue->RegisterCallback"); } if(SL_RESULT_SUCCESS != result) - throw al::backend_exception{ALC_INVALID_DEVICE, "Failed to register callback: 0x%08x", - result}; + throw al::backend_exception{al::backend_error::DeviceError, + "Failed to register callback: 0x%08x", result}; try { mKillNow.store(false, std::memory_order_release); mThread = std::thread(std::mem_fn(&OpenSLPlayback::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()}; } } @@ -675,7 +676,8 @@ void OpenSLCapture::open(const ALCchar* name) if(!name) name = opensl_device; else if(strcmp(name, opensl_device) != 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}; SLresult result{slCreateEngine(&mEngineObj, 0, nullptr, 0, nullptr, nullptr)}; PRINTERR(result, "slCreateEngine"); @@ -829,7 +831,7 @@ void OpenSLCapture::open(const ALCchar* name) mEngineObj = nullptr; mEngine = nullptr; - throw al::backend_exception{ALC_INVALID_VALUE, + throw al::backend_exception{al::backend_error::DeviceError, "Failed to initialize OpenSL device: 0x%08x", result}; } @@ -848,7 +850,8 @@ void OpenSLCapture::start() PRINTERR(result, "record->SetRecordState"); } if(SL_RESULT_SUCCESS != result) - throw al::backend_exception{ALC_INVALID_DEVICE, "Failed to start capture: 0x%08x", result}; + throw al::backend_exception{al::backend_error::DeviceError, + "Failed to start capture: 0x%08x", result}; } void OpenSLCapture::stop() |