diff options
author | Chris Robinson <[email protected]> | 2019-10-08 05:44:38 -0700 |
---|---|---|
committer | Chris Robinson <[email protected]> | 2019-10-08 05:44:38 -0700 |
commit | 7726a06d26e59dc6a8e109af2e268de878c4f606 (patch) | |
tree | 3fdea7f120e21def8e52b89d335f63aa38372497 /alc/backends/winmm.cpp | |
parent | 360330b2add6cf10776c38aaa186b0892b54e300 (diff) |
Clean up some exception messages and avoid duplicate log messages
Diffstat (limited to 'alc/backends/winmm.cpp')
-rw-r--r-- | alc/backends/winmm.cpp | 17 |
1 files changed, 4 insertions, 13 deletions
diff --git a/alc/backends/winmm.cpp b/alc/backends/winmm.cpp index 8f85f351..dde74304 100644 --- a/alc/backends/winmm.cpp +++ b/alc/backends/winmm.cpp @@ -127,8 +127,9 @@ struct WinMMPlayback final : public BackendBase { WinMMPlayback(ALCdevice *device) noexcept : BackendBase{device} { } ~WinMMPlayback() override; - static void CALLBACK waveOutProcC(HWAVEOUT device, UINT msg, DWORD_PTR instance, DWORD_PTR param1, DWORD_PTR param2); void CALLBACK waveOutProc(HWAVEOUT device, UINT msg, DWORD_PTR param1, DWORD_PTR param2); + static void CALLBACK waveOutProcC(HWAVEOUT device, UINT msg, DWORD_PTR instance, DWORD_PTR param1, DWORD_PTR param2) + { reinterpret_cast<WinMMPlayback*>(instance)->waveOutProc(device, msg, param1, param2); } int mixerProc(); @@ -162,10 +163,6 @@ WinMMPlayback::~WinMMPlayback() std::fill(mWaveBuffer.begin(), mWaveBuffer.end(), WAVEHDR{}); } - -void CALLBACK WinMMPlayback::waveOutProcC(HWAVEOUT device, UINT msg, DWORD_PTR instance, DWORD_PTR param1, DWORD_PTR param2) -{ reinterpret_cast<WinMMPlayback*>(instance)->waveOutProc(device, msg, param1, param2); } - /* WinMMPlayback::waveOutProc * * Posts a message to 'WinMMPlayback::mixerProc' everytime a WaveOut Buffer is @@ -256,7 +253,6 @@ retry_open: mDevice->FmtType = DevFmtShort; goto retry_open; } - ERR("waveOutOpen failed: %u\n", res); throw al::backend_exception{ALC_INVALID_VALUE, "waveOutOpen failed: %u", res}; } @@ -368,8 +364,9 @@ struct WinMMCapture final : public BackendBase { WinMMCapture(ALCdevice *device) noexcept : BackendBase{device} { } ~WinMMCapture() override; - static void CALLBACK waveInProcC(HWAVEIN device, UINT msg, DWORD_PTR instance, DWORD_PTR param1, DWORD_PTR param2); void CALLBACK waveInProc(HWAVEIN device, UINT msg, DWORD_PTR param1, DWORD_PTR param2); + static void CALLBACK waveInProcC(HWAVEIN device, UINT msg, DWORD_PTR instance, DWORD_PTR param1, DWORD_PTR param2) + { reinterpret_cast<WinMMCapture*>(instance)->waveInProc(device, msg, param1, param2); } int captureProc(); @@ -407,9 +404,6 @@ WinMMCapture::~WinMMCapture() std::fill(mWaveBuffer.begin(), mWaveBuffer.end(), WAVEHDR{}); } -void CALLBACK WinMMCapture::waveInProcC(HWAVEIN device, UINT msg, DWORD_PTR instance, DWORD_PTR param1, DWORD_PTR param2) -{ reinterpret_cast<WinMMCapture*>(instance)->waveInProc(device, msg, param1, param2); } - /* WinMMCapture::waveInProc * * Posts a message to 'WinMMCapture::captureProc' everytime a WaveIn Buffer is @@ -513,10 +507,7 @@ void WinMMCapture::open(const ALCchar *name) reinterpret_cast<DWORD_PTR>(&WinMMCapture::waveInProcC), reinterpret_cast<DWORD_PTR>(this), CALLBACK_FUNCTION)}; if(res != MMSYSERR_NOERROR) - { - ERR("waveInOpen failed: %u\n", res); throw al::backend_exception{ALC_INVALID_VALUE, "waveInOpen failed: %u", res}; - } // Ensure each buffer is 50ms each DWORD BufferSize{mFormat.nAvgBytesPerSec / 20u}; |