This repository has been archived by the owner on Dec 2, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 225
/
ISACRenderer.h
51 lines (37 loc) · 1.63 KB
/
ISACRenderer.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
//--------------------------------------------------------------------------------------
// ISACRenderer.h
//
// Advanced Technology Group (ATG)
// Copyright (C) Microsoft Corporation. All rights reserved.
//--------------------------------------------------------------------------------------
#include "SpatialAudioClient.h"
#include <mmdeviceapi.h>
#pragma once
// Primary ISAC Renderering Class
class ISACRenderer :
public Microsoft::WRL::RuntimeClass< Microsoft::WRL::RuntimeClassFlags< Microsoft::WRL::ClassicCom >, Microsoft::WRL::FtmBase, IActivateAudioInterfaceCompletionHandler, ISpatialAudioObjectRenderStreamNotify >
{
public:
enum RenderState {
Inactive = 0,
Active,
Resetting
};
ISACRenderer();
HRESULT InitializeAudioDeviceAsync();
bool IsActive() { return m_ISACrenderstate == RenderState::Active; };
bool IsResetting() { return m_ISACrenderstate == RenderState::Resetting; }
void Reset() { m_ISACrenderstate = RenderState::Resetting; }
UINT32 GetMaxDynamicObjects() { return m_MaxDynamicObjects; }
STDMETHOD(ActivateCompleted)(IActivateAudioInterfaceAsyncOperation *operation);
STDMETHOD(OnAvailableDynamicObjectCountChange)(ISpatialAudioObjectRenderStreamBase *sender, LONGLONG hnsComplianceDeadlineTime, UINT32 availableDynamicObjectCountChange);
Microsoft::WRL::ComPtr<ISpatialAudioClient> m_SpatialAudioClient;
Microsoft::WRL::ComPtr<ISpatialAudioObjectRenderStream> m_SpatialAudioStream;
HANDLE m_bufferCompletionEvent;
private:
~ISACRenderer();
private:
Platform::String^ m_DeviceIdString;
RenderState m_ISACrenderstate;
UINT32 m_MaxDynamicObjects;
};