aboutsummaryrefslogtreecommitdiffstats
path: root/Alc/backends/portaudio.cpp
diff options
context:
space:
mode:
authorChris Robinson <[email protected]>2018-12-26 21:22:17 -0800
committerChris Robinson <[email protected]>2018-12-26 21:22:17 -0800
commit8a0295503db394ea895bfa079d1f3eda0d758e61 (patch)
tree21a1a1e63fe148dc087ad2c35ce94a49418ef900 /Alc/backends/portaudio.cpp
parent4f253a935a14e49a77516a56e0d4c6d6177a56b6 (diff)
Clean up the ring buffer struct and use member functions
Diffstat (limited to 'Alc/backends/portaudio.cpp')
-rw-r--r--Alc/backends/portaudio.cpp11
1 files changed, 7 insertions, 4 deletions
diff --git a/Alc/backends/portaudio.cpp b/Alc/backends/portaudio.cpp
index 59b357b5..f39661a7 100644
--- a/Alc/backends/portaudio.cpp
+++ b/Alc/backends/portaudio.cpp
@@ -365,8 +365,9 @@ int ALCportCapture_ReadCallback(const void *inputBuffer, void *UNUSED(outputBuff
unsigned long framesPerBuffer, const PaStreamCallbackTimeInfo *UNUSED(timeInfo),
const PaStreamCallbackFlags UNUSED(statusFlags), void *userData)
{
- ALCportCapture *self = static_cast<ALCportCapture*>(userData);
- ll_ringbuffer_write(self->Ring.get(), inputBuffer, framesPerBuffer);
+ auto self = static_cast<ALCportCapture*>(userData);
+ RingBuffer *ring{self->Ring.get()};
+ ring->write(inputBuffer, framesPerBuffer);
return 0;
}
@@ -456,12 +457,14 @@ void ALCportCapture_stop(ALCportCapture *self)
ALCuint ALCportCapture_availableSamples(ALCportCapture *self)
{
- return ll_ringbuffer_read_space(self->Ring.get());
+ RingBuffer *ring{self->Ring.get()};
+ return ring->readSpace();
}
ALCenum ALCportCapture_captureSamples(ALCportCapture *self, ALCvoid *buffer, ALCuint samples)
{
- ll_ringbuffer_read(self->Ring.get(), buffer, samples);
+ RingBuffer *ring{self->Ring.get()};
+ ring->read(buffer, samples);
return ALC_NO_ERROR;
}