diff options
author | Chris Robinson <[email protected]> | 2018-12-28 14:06:15 -0800 |
---|---|---|
committer | Chris Robinson <[email protected]> | 2018-12-28 14:06:15 -0800 |
commit | b7f5166d59bc3782cc804eb2019f028fd6cdd4e7 (patch) | |
tree | 0a52a61e57bf05bdd74ffd61cf8f67097665661d /Alc/backends/qsa.cpp | |
parent | 200e267b8113a00485bbb216acb7fa6e65332d1f (diff) |
Turn even more methods into member functions
Diffstat (limited to 'Alc/backends/qsa.cpp')
-rw-r--r-- | Alc/backends/qsa.cpp | 30 |
1 files changed, 17 insertions, 13 deletions
diff --git a/Alc/backends/qsa.cpp b/Alc/backends/qsa.cpp index 6ceaf0a6..c7c8e90b 100644 --- a/Alc/backends/qsa.cpp +++ b/Alc/backends/qsa.cpp @@ -171,9 +171,10 @@ void deviceList(int type, al::vector<DevMap> *devmap) /* Wrappers to use an old-style backend with the new interface. */ struct PlaybackWrapper final : public ALCbackend { - std::unique_ptr<qsa_data> mExtraData; - PlaybackWrapper(ALCdevice *device) noexcept : ALCbackend{device} { } + ~PlaybackWrapper() override; + + std::unique_ptr<qsa_data> mExtraData; }; static void PlaybackWrapper_Construct(PlaybackWrapper *self, ALCdevice *device); @@ -620,11 +621,12 @@ static void PlaybackWrapper_Construct(PlaybackWrapper *self, ALCdevice *device) } static void PlaybackWrapper_Destruct(PlaybackWrapper *self) -{ - if(self->mExtraData) - qsa_close_playback(self); +{ self->~PlaybackWrapper(); } - self->~PlaybackWrapper(); +PlaybackWrapper::~PlaybackWrapper() +{ + if(mExtraData) + qsa_close_playback(this); } static ALCenum PlaybackWrapper_open(PlaybackWrapper *self, const ALCchar *name) @@ -654,9 +656,10 @@ static void PlaybackWrapper_stop(PlaybackWrapper *self) /***********/ struct CaptureWrapper final : public ALCbackend { - std::unique_ptr<qsa_data> mExtraData; - CaptureWrapper(ALCdevice *device) noexcept : ALCbackend{device} { } + ~CaptureWrapper() override; + + std::unique_ptr<qsa_data> mExtraData; }; static void CaptureWrapper_Construct(CaptureWrapper *self, ALCdevice *device); @@ -778,7 +781,7 @@ static void qsa_close_capture(CaptureWrapper *self) if (data->pcmHandle!=nullptr) snd_pcm_close(data->pcmHandle); - data->pcmHandle = nullptr + data->pcmHandle = nullptr; self->mExtraData = nullptr; } @@ -921,11 +924,12 @@ static void CaptureWrapper_Construct(CaptureWrapper *self, ALCdevice *device) } static void CaptureWrapper_Destruct(CaptureWrapper *self) -{ - if(self->mExtraData) - qsa_close_capture(self); +{ self->~CaptureWrapper(); } - self->~CaptureWrapper(); +CaptureWrapper::~CaptureWrapper() +{ + if(mExtraData) + qsa_close_capture(this); } static ALCenum CaptureWrapper_open(CaptureWrapper *self, const ALCchar *name) |