diff options
author | Chris Robinson <[email protected]> | 2018-12-27 20:24:35 -0800 |
---|---|---|
committer | Chris Robinson <[email protected]> | 2018-12-27 20:24:35 -0800 |
commit | 885f68268feb21c7c7fbb6f01c7bd899b9846bfe (patch) | |
tree | 1cf27f10b1c082026fe4ef2be12a6c8d1b27c342 /Alc/backends/coreaudio.cpp | |
parent | 015a4b060b2f0461f412e519c2a219ed1e7465c2 (diff) |
Turn more methods into member functions
Diffstat (limited to 'Alc/backends/coreaudio.cpp')
-rw-r--r-- | Alc/backends/coreaudio.cpp | 22 |
1 files changed, 13 insertions, 9 deletions
diff --git a/Alc/backends/coreaudio.cpp b/Alc/backends/coreaudio.cpp index 9af370ca..82312d67 100644 --- a/Alc/backends/coreaudio.cpp +++ b/Alc/backends/coreaudio.cpp @@ -43,6 +43,7 @@ static const ALCchar ca_device[] = "CoreAudio Default"; struct ALCcoreAudioPlayback final : public ALCbackend { ALCcoreAudioPlayback(ALCdevice *device) noexcept : ALCbackend{device} { } + ~ALCcoreAudioPlayback() override; static OSStatus MixerProcC(void *inRefCon, AudioUnitRenderActionFlags *ioActionFlags, const AudioTimeStamp *inTimeStamp, UInt32 inBusNumber, UInt32 inNumberFrames, @@ -80,11 +81,12 @@ static void ALCcoreAudioPlayback_Construct(ALCcoreAudioPlayback *self, ALCdevice } static void ALCcoreAudioPlayback_Destruct(ALCcoreAudioPlayback *self) -{ - AudioUnitUninitialize(self->mAudioUnit); - AudioComponentInstanceDispose(self->mAudioUnit); +{ self->~ALCcoreAudioPlayback(); } - self->~ALCcoreAudioPlayback(); +ALCcoreAudioPlayback::~ALCcoreAudioPlayback() +{ + AudioUnitUninitialize(mAudioUnit); + AudioComponentInstanceDispose(mAudioUnit); } @@ -322,6 +324,7 @@ static void ALCcoreAudioPlayback_stop(ALCcoreAudioPlayback *self) struct ALCcoreAudioCapture final : public ALCbackend { ALCcoreAudioCapture(ALCdevice *device) noexcept : ALCbackend{device} { } + ~ALCcoreAudioCapture() override; static OSStatus RecordProcC(void *inRefCon, AudioUnitRenderActionFlags *ioActionFlags, const AudioTimeStamp *inTimeStamp, UInt32 inBusNumber, UInt32 inNumberFrames, @@ -363,12 +366,13 @@ static void ALCcoreAudioCapture_Construct(ALCcoreAudioCapture *self, ALCdevice * } static void ALCcoreAudioCapture_Destruct(ALCcoreAudioCapture *self) -{ - if(self->mAudioUnit) - AudioComponentInstanceDispose(self->mAudioUnit); - self->mAudioUnit = 0; +{ self->~ALCcoreAudioCapture(); } - self->~ALCcoreAudioCapture(); +ALCcoreAudioCapture::~ALCcoreAudioCapture() +{ + if(mAudioUnit) + AudioComponentInstanceDispose(mAudioUnit); + mAudioUnit = 0; } |