mirror of
https://github.com/cemu-project/Cemu.git
synced 2025-12-12 19:37:01 +00:00
Refactor to use Microsoft::WRL::ComPtr (#1599)
This commit is contained in:
parent
da98aa4176
commit
2f02fda9ea
11 changed files with 56 additions and 119 deletions
|
|
@ -4,6 +4,7 @@
|
|||
#include <mmsystem.h>
|
||||
#include <mmreg.h>
|
||||
#include <dsound.h>
|
||||
#include <wrl/client.h>
|
||||
|
||||
#include "IAudioAPI.h"
|
||||
|
||||
|
|
@ -50,11 +51,6 @@ private:
|
|||
|
||||
static const std::vector<DeviceDescriptionPtr>& RefreshDevices();
|
||||
|
||||
struct XAudioDeleter
|
||||
{
|
||||
void operator()(IXAudio2* ptr) const;
|
||||
};
|
||||
|
||||
struct VoiceDeleter
|
||||
{
|
||||
void operator()(IXAudio2Voice* ptr) const;
|
||||
|
|
@ -63,7 +59,7 @@ private:
|
|||
static HMODULE s_xaudio_dll;
|
||||
static std::vector<DeviceDescriptionPtr> s_devices;
|
||||
|
||||
std::unique_ptr<IXAudio2, XAudioDeleter> m_xaudio;
|
||||
Microsoft::WRL::ComPtr<IXAudio2> m_xaudio;
|
||||
std::wstring m_device_id;
|
||||
std::unique_ptr<IXAudio2MasteringVoice, VoiceDeleter> m_mastering_voice;
|
||||
std::unique_ptr<IXAudio2SourceVoice, VoiceDeleter> m_source_voice;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue