CommonLibSSE (Parapets fork)
IXAudio2.h
Go to the documentation of this file.
1 #pragma once
2 
3 #include "RE/I/IUnknown.h"
4 #include "RE/X/XAudio2.h"
5 
6 namespace RE
7 {
8  struct IXAudio2EngineCallback;
9  struct IXAudio2MasteringVoice;
10  struct IXAudio2SourceVoice;
11  struct IXAudio2SubmixVoice;
12  struct IXAudio2VoiceCallback;
13  using WAVEFORMATEX = struct tWAVEFORMATEX;
14 
15  struct __declspec(novtable) IXAudio2 : public IUnknown
16  {
17  public:
18  virtual std::int32_t GetDeviceCount(std::uint32_t* a_count) = 0; // 03
19 
20  virtual std::int32_t GetDeviceDetails(std::uint32_t a_index, XAUDIO2_DEVICE_DETAILS* a_details) = 0; // 04
21 
22  virtual std::int32_t Initialize(
23  std::uint32_t a_flags,
24  XAUDIO2_PROCESSOR a_XAudio2Processor = XAUDIO2_DEFAULT_PROCESSOR) = 0; // 05
25 
26  virtual std::int32_t RegisterForCallbacks(IXAudio2EngineCallback* a_callback) = 0; // 06
27 
28  virtual void UnregisterForCallbacks(IXAudio2EngineCallback* a_callback) = 0; // 07
29 
30  virtual std::int32_t CreateSourceVoice(
31  IXAudio2SourceVoice** a_sourceVoice,
32  const WAVEFORMATEX* a_sourceFormat,
33  std::uint32_t a_flags = 0,
34  float a_maxFrequencyRatio = XAUDIO2_DEFAULT_FREQ_RATIO,
35  IXAudio2VoiceCallback* a_callback = nullptr,
36  const XAUDIO2_VOICE_SENDS* a_sendList = nullptr,
37  const XAUDIO2_EFFECT_CHAIN* a_effectChain = nullptr) = 0; // 08
38 
39  virtual std::int32_t CreateSubmixVoice(
40  IXAudio2SubmixVoice** a_submixVoice,
41  std::uint32_t a_inputChannels,
42  std::uint32_t a_inputSampleRate,
43  std::uint32_t a_flags = 0,
44  std::uint32_t a_processingStage = 0,
45  const XAUDIO2_VOICE_SENDS* a_sendList = nullptr,
46  const XAUDIO2_EFFECT_CHAIN* a_effectChain = nullptr) = 0; // 09
47 
48  virtual std::int32_t CreateMasteringVoice(
49  IXAudio2MasteringVoice** a_masteringVoice,
50  std::uint32_t a_inputChannels = XAUDIO2_DEFAULT_CHANNELS,
51  std::uint32_t a_inputSampleRate = XAUDIO2_DEFAULT_SAMPLERATE,
52  std::uint32_t a_flags = 0,
53  std::uint32_t a_deviceIndex = 0,
54  const XAUDIO2_EFFECT_CHAIN* a_effectChain = nullptr) = 0; // 0A
55 
56  virtual std::int32_t StartEngine() = 0; // 0B
57 
58  virtual void StopEngine() = 0; // 0C
59 
60  virtual std::int32_t CommitChanges(std::uint32_t a_operationSet) = 0; // 0D
61 
62  virtual void GetPerformanceData(XAUDIO2_PERFORMANCE_DATA* a_perfData) = 0; // 0E
63 
64  virtual void SetDebugConfiguration(
65  const XAUDIO2_DEBUG_CONFIGURATION* a_debugConfiguration,
66  void* a_reserved = nullptr) = 0; // 0F
67  };
68 }
Definition: AbsorbEffect.h:6
constexpr auto XAUDIO2_DEFAULT_FREQ_RATIO
Definition: XAudio2.h:21
constexpr auto XAUDIO2_DEFAULT_PROCESSOR
Definition: XAudio2.h:92
constexpr auto XAUDIO2_DEFAULT_CHANNELS
Definition: XAudio2.h:33
XAUDIO2_PROCESSORS::XAUDIO2_WINDOWS_PROCESSOR_SPECIFIER XAUDIO2_PROCESSOR
Definition: XAudio2.h:90
tWAVEFORMATEX WAVEFORMATEX
Definition: AudioDefs.h:18
constexpr auto XAUDIO2_DEFAULT_SAMPLERATE
Definition: XAudio2.h:34