diff options
author | Chris Robinson <[email protected]> | 2019-09-15 09:50:28 -0700 |
---|---|---|
committer | Chris Robinson <[email protected]> | 2019-09-15 09:50:28 -0700 |
commit | c5a3c52822d0ab8e36c2d3d31936eae1da64049f (patch) | |
tree | 0608df414c53e281459c29de73a6ca272f9fc33a /alc/backends/portaudio.cpp | |
parent | e4cc77ea237c8a2ca67cb0a1cb28e6d652746590 (diff) |
Return and pass more appropriate types for backends
Diffstat (limited to 'alc/backends/portaudio.cpp')
-rw-r--r-- | alc/backends/portaudio.cpp | 30 |
1 files changed, 15 insertions, 15 deletions
diff --git a/alc/backends/portaudio.cpp b/alc/backends/portaudio.cpp index 4704a806..0b77f622 100644 --- a/alc/backends/portaudio.cpp +++ b/alc/backends/portaudio.cpp @@ -81,8 +81,8 @@ struct PortPlayback final : public BackendBase { const PaStreamCallbackTimeInfo *timeInfo, const PaStreamCallbackFlags statusFlags); ALCenum open(const ALCchar *name) override; - ALCboolean reset() override; - ALCboolean start() override; + bool reset() override; + bool start() override; void stop() override; PaStream *mStream{nullptr}; @@ -179,7 +179,7 @@ retry_open: } -ALCboolean PortPlayback::reset() +bool PortPlayback::reset() { const PaStreamInfo *streamInfo{Pa_GetStreamInfo(mStream)}; mDevice->Frequency = static_cast<ALuint>(streamInfo->sampleRate); @@ -198,7 +198,7 @@ ALCboolean PortPlayback::reset() else { ERR("Unexpected sample format: 0x%lx\n", mParams.sampleFormat); - return ALC_FALSE; + return false; } if(mParams.channelCount == 2) @@ -208,22 +208,22 @@ ALCboolean PortPlayback::reset() else { ERR("Unexpected channel count: %u\n", mParams.channelCount); - return ALC_FALSE; + return false; } SetDefaultChannelOrder(mDevice); - return ALC_TRUE; + return true; } -ALCboolean PortPlayback::start() +bool PortPlayback::start() { PaError err{Pa_StartStream(mStream)}; if(err != paNoError) { ERR("Pa_StartStream() returned an error: %s\n", Pa_GetErrorText(err)); - return ALC_FALSE; + return false; } - return ALC_TRUE; + return true; } void PortPlayback::stop() @@ -245,9 +245,9 @@ struct PortCapture final : public BackendBase { const PaStreamCallbackTimeInfo *timeInfo, const PaStreamCallbackFlags statusFlags); ALCenum open(const ALCchar *name) override; - ALCboolean start() override; + bool start() override; void stop() override; - ALCenum captureSamples(ALCvoid *buffer, ALCuint samples) override; + ALCenum captureSamples(al::byte *buffer, ALCuint samples) override; ALCuint availableSamples() override; PaStream *mStream{nullptr}; @@ -341,15 +341,15 @@ ALCenum PortCapture::open(const ALCchar *name) } -ALCboolean PortCapture::start() +bool PortCapture::start() { PaError err{Pa_StartStream(mStream)}; if(err != paNoError) { ERR("Error starting stream: %s\n", Pa_GetErrorText(err)); - return ALC_FALSE; + return false; } - return ALC_TRUE; + return true; } void PortCapture::stop() @@ -363,7 +363,7 @@ void PortCapture::stop() ALCuint PortCapture::availableSamples() { return static_cast<ALCuint>(mRing->readSpace()); } -ALCenum PortCapture::captureSamples(ALCvoid *buffer, ALCuint samples) +ALCenum PortCapture::captureSamples(al::byte *buffer, ALCuint samples) { mRing->read(buffer, samples); return ALC_NO_ERROR; |