OpenTTD Source 20241224-master-gee860a5c8e
xaudio2_s.cpp File Reference

XAudio2 sound driver. More...

#include "../stdafx.h"
#include "../openttd.h"
#include "../driver.h"
#include "../mixer.h"
#include "../debug.h"
#include "../core/alloc_func.hpp"
#include "../core/bitmath_func.hpp"
#include "../core/math_func.hpp"
#include "xaudio2_s.h"
#include <windows.h>
#include <mmsystem.h>
#include <wrl\client.h>
#include <xaudio2.h>
#include "../os/windows/win32.h"
#include "../safeguards.h"

Go to the source code of this file.

Data Structures

class  StreamingVoiceContext
 Implementation of the IXAudio2VoiceCallback interface. More...
 

Macros

#define NTDDI_VERSION   NTDDI_WIN8
 
#define _WIN32_WINNT   _WIN32_WINNT_WIN8
 

Typedefs

typedef HRESULT(__stdcall * API_XAudio2Create) (_Outptr_ IXAudio2 **ppXAudio2, UINT32 Flags, XAUDIO2_PROCESSOR XAudio2Processor)
 

Functions

static HRESULT CreateXAudio (API_XAudio2Create xAudio2Create)
 Create XAudio2 context with SEH exception checking.
 

Variables

static FSoundDriver_XAudio2 iFSoundDriver_XAudio2
 
static HMODULE _xaudio_dll_handle
 
static IXAudio2SourceVoice * _source_voice = nullptr
 
static IXAudio2MasteringVoice * _mastering_voice = nullptr
 
static ComPtr< IXAudio2 > _xaudio2
 
static StreamingVoiceContext_voice_context = nullptr
 

Detailed Description

XAudio2 sound driver.

Definition in file xaudio2_s.cpp.

Macro Definition Documentation

◆ _WIN32_WINNT

#define _WIN32_WINNT   _WIN32_WINNT_WIN8

Definition at line 24 of file xaudio2_s.cpp.

◆ NTDDI_VERSION

#define NTDDI_VERSION   NTDDI_WIN8

Definition at line 23 of file xaudio2_s.cpp.

Typedef Documentation

◆ API_XAudio2Create

typedef HRESULT(__stdcall * API_XAudio2Create) (_Outptr_ IXAudio2 **ppXAudio2, UINT32 Flags, XAUDIO2_PROCESSOR XAudio2Processor)

Definition at line 39 of file xaudio2_s.cpp.

Function Documentation

◆ CreateXAudio()

static HRESULT CreateXAudio ( API_XAudio2Create  xAudio2Create)
static

Create XAudio2 context with SEH exception checking.

Definition at line 121 of file xaudio2_s.cpp.

Referenced by SoundDriver_XAudio2::Start().

Variable Documentation

◆ _mastering_voice

IXAudio2MasteringVoice* _mastering_voice = nullptr
static

Definition at line 116 of file xaudio2_s.cpp.

◆ _source_voice

IXAudio2SourceVoice* _source_voice = nullptr
static

Definition at line 115 of file xaudio2_s.cpp.

◆ _voice_context

StreamingVoiceContext* _voice_context = nullptr
static

Definition at line 118 of file xaudio2_s.cpp.

◆ _xaudio2

ComPtr<IXAudio2> _xaudio2
static

Definition at line 117 of file xaudio2_s.cpp.

◆ _xaudio_dll_handle

HMODULE _xaudio_dll_handle
static

Definition at line 114 of file xaudio2_s.cpp.

◆ iFSoundDriver_XAudio2

FSoundDriver_XAudio2 iFSoundDriver_XAudio2
static

Definition at line 41 of file xaudio2_s.cpp.