Commit e7337704 authored by Andrew Eikum's avatar Andrew Eikum Committed by Alexandre Julliard

xaudio2: Implement GetVoiceDetails for source and submix voices.

parent b77ec00f
......@@ -79,6 +79,7 @@
* Add Flags parameter to IXAudio2SourceVoice::GetState
* Add IXAudio2MasteringVoice::GetChannelMask
* Add DisableLateField member to XAUDIO2FX_REVERB_PARAMETERS
* Add ActiveFlags member to XAUDIO2_VOICE_DETAILS
*
* 2.9
* Change IID_IXAudio2
......@@ -110,10 +111,16 @@ static XA2SourceImpl *impl_from_IXAudio20SourceVoice(IXAudio20SourceVoice *iface
}
static void WINAPI XA20SRC_GetVoiceDetails(IXAudio20SourceVoice *iface,
XAUDIO2_VOICE_DETAILS *pVoiceDetails)
XAUDIO27_VOICE_DETAILS *pVoiceDetails)
{
XA2SourceImpl *This = impl_from_IXAudio20SourceVoice(iface);
return IXAudio2SourceVoice_GetVoiceDetails(&This->IXAudio2SourceVoice_iface, pVoiceDetails);
XAUDIO2_VOICE_DETAILS details;
IXAudio2SourceVoice_GetVoiceDetails(&This->IXAudio2SourceVoice_iface, &details);
pVoiceDetails->CreationFlags = details.CreationFlags;
pVoiceDetails->InputChannels = details.InputChannels;
pVoiceDetails->InputSampleRate = details.InputSampleRate;
}
static HRESULT WINAPI XA20SRC_SetOutputVoices(IXAudio20SourceVoice *iface,
......@@ -362,10 +369,16 @@ static XA2SourceImpl *impl_from_IXAudio23SourceVoice(IXAudio23SourceVoice *iface
}
static void WINAPI XA23SRC_GetVoiceDetails(IXAudio23SourceVoice *iface,
XAUDIO2_VOICE_DETAILS *pVoiceDetails)
XAUDIO27_VOICE_DETAILS *pVoiceDetails)
{
XA2SourceImpl *This = impl_from_IXAudio23SourceVoice(iface);
return IXAudio2SourceVoice_GetVoiceDetails(&This->IXAudio2SourceVoice_iface, pVoiceDetails);
XAUDIO2_VOICE_DETAILS details;
IXAudio2SourceVoice_GetVoiceDetails(&This->IXAudio2SourceVoice_iface, &details);
pVoiceDetails->CreationFlags = details.CreationFlags;
pVoiceDetails->InputChannels = details.InputChannels;
pVoiceDetails->InputSampleRate = details.InputSampleRate;
}
static HRESULT WINAPI XA23SRC_SetOutputVoices(IXAudio23SourceVoice *iface,
......@@ -613,10 +626,16 @@ static XA2SourceImpl *impl_from_IXAudio27SourceVoice(IXAudio27SourceVoice *iface
}
static void WINAPI XA27SRC_GetVoiceDetails(IXAudio27SourceVoice *iface,
XAUDIO2_VOICE_DETAILS *pVoiceDetails)
XAUDIO27_VOICE_DETAILS *pVoiceDetails)
{
XA2SourceImpl *This = impl_from_IXAudio27SourceVoice(iface);
return IXAudio2SourceVoice_GetVoiceDetails(&This->IXAudio2SourceVoice_iface, pVoiceDetails);
XAUDIO2_VOICE_DETAILS details;
IXAudio2SourceVoice_GetVoiceDetails(&This->IXAudio2SourceVoice_iface, &details);
pVoiceDetails->CreationFlags = details.CreationFlags;
pVoiceDetails->InputChannels = details.InputChannels;
pVoiceDetails->InputSampleRate = details.InputSampleRate;
}
static HRESULT WINAPI XA27SRC_SetOutputVoices(IXAudio27SourceVoice *iface,
......@@ -871,10 +890,16 @@ static XA2SubmixImpl *impl_from_IXAudio20SubmixVoice(IXAudio20SubmixVoice *iface
}
static void WINAPI XA20SUB_GetVoiceDetails(IXAudio20SubmixVoice *iface,
XAUDIO2_VOICE_DETAILS *pVoiceDetails)
XAUDIO27_VOICE_DETAILS *pVoiceDetails)
{
XA2SubmixImpl *This = impl_from_IXAudio20SubmixVoice(iface);
return IXAudio2SubmixVoice_GetVoiceDetails(&This->IXAudio2SubmixVoice_iface, pVoiceDetails);
XAUDIO2_VOICE_DETAILS details;
IXAudio2SubmixVoice_GetVoiceDetails(&This->IXAudio2SubmixVoice_iface, &details);
pVoiceDetails->CreationFlags = details.CreationFlags;
pVoiceDetails->InputChannels = details.InputChannels;
pVoiceDetails->InputSampleRate = details.InputSampleRate;
}
static HRESULT WINAPI XA20SUB_SetOutputVoices(IXAudio20SubmixVoice *iface,
......@@ -1051,10 +1076,16 @@ static XA2SubmixImpl *impl_from_IXAudio23SubmixVoice(IXAudio23SubmixVoice *iface
}
static void WINAPI XA23SUB_GetVoiceDetails(IXAudio23SubmixVoice *iface,
XAUDIO2_VOICE_DETAILS *pVoiceDetails)
XAUDIO27_VOICE_DETAILS *pVoiceDetails)
{
XA2SubmixImpl *This = impl_from_IXAudio23SubmixVoice(iface);
return IXAudio2SubmixVoice_GetVoiceDetails(&This->IXAudio2SubmixVoice_iface, pVoiceDetails);
XAUDIO2_VOICE_DETAILS details;
IXAudio2SubmixVoice_GetVoiceDetails(&This->IXAudio2SubmixVoice_iface, &details);
pVoiceDetails->CreationFlags = details.CreationFlags;
pVoiceDetails->InputChannels = details.InputChannels;
pVoiceDetails->InputSampleRate = details.InputSampleRate;
}
static HRESULT WINAPI XA23SUB_SetOutputVoices(IXAudio23SubmixVoice *iface,
......@@ -1221,6 +1252,194 @@ const IXAudio23SubmixVoiceVtbl XAudio23SubmixVoice_Vtbl = {
XA23SUB_GetOutputMatrix,
XA23SUB_DestroyVoice
};
#elif XAUDIO2_VER <= 7
static XA2SubmixImpl *impl_from_IXAudio27SubmixVoice(IXAudio27SubmixVoice *iface)
{
return CONTAINING_RECORD(iface, XA2SubmixImpl, IXAudio27SubmixVoice_iface);
}
static void WINAPI XA27SUB_GetVoiceDetails(IXAudio27SubmixVoice *iface,
XAUDIO27_VOICE_DETAILS *pVoiceDetails)
{
XA2SubmixImpl *This = impl_from_IXAudio27SubmixVoice(iface);
XAUDIO2_VOICE_DETAILS details;
IXAudio2SubmixVoice_GetVoiceDetails(&This->IXAudio2SubmixVoice_iface, &details);
pVoiceDetails->CreationFlags = details.CreationFlags;
pVoiceDetails->InputChannels = details.InputChannels;
pVoiceDetails->InputSampleRate = details.InputSampleRate;
}
static HRESULT WINAPI XA27SUB_SetOutputVoices(IXAudio27SubmixVoice *iface,
const XAUDIO2_VOICE_SENDS *pSendList)
{
XA2SubmixImpl *This = impl_from_IXAudio27SubmixVoice(iface);
return IXAudio2SubmixVoice_SetOutputVoices(&This->IXAudio2SubmixVoice_iface, pSendList);
}
static HRESULT WINAPI XA27SUB_SetEffectChain(IXAudio27SubmixVoice *iface,
const XAUDIO2_EFFECT_CHAIN *pEffectChain)
{
XA2SubmixImpl *This = impl_from_IXAudio27SubmixVoice(iface);
return IXAudio2SubmixVoice_SetEffectChain(&This->IXAudio2SubmixVoice_iface, pEffectChain);
}
static HRESULT WINAPI XA27SUB_EnableEffect(IXAudio27SubmixVoice *iface,
UINT32 EffectIndex, UINT32 OperationSet)
{
XA2SubmixImpl *This = impl_from_IXAudio27SubmixVoice(iface);
return IXAudio2SubmixVoice_EnableEffect(&This->IXAudio2SubmixVoice_iface,
EffectIndex, OperationSet);
}
static HRESULT WINAPI XA27SUB_DisableEffect(IXAudio27SubmixVoice *iface,
UINT32 EffectIndex, UINT32 OperationSet)
{
XA2SubmixImpl *This = impl_from_IXAudio27SubmixVoice(iface);
return IXAudio2SubmixVoice_DisableEffect(&This->IXAudio2SubmixVoice_iface,
EffectIndex, OperationSet);
}
static void WINAPI XA27SUB_GetEffectState(IXAudio27SubmixVoice *iface,
UINT32 EffectIndex, BOOL *pEnabled)
{
XA2SubmixImpl *This = impl_from_IXAudio27SubmixVoice(iface);
return IXAudio2SubmixVoice_GetEffectState(&This->IXAudio2SubmixVoice_iface,
EffectIndex, pEnabled);
}
static HRESULT WINAPI XA27SUB_SetEffectParameters(IXAudio27SubmixVoice *iface,
UINT32 EffectIndex, const void *pParameters, UINT32 ParametersByteSize,
UINT32 OperationSet)
{
XA2SubmixImpl *This = impl_from_IXAudio27SubmixVoice(iface);
return IXAudio2SubmixVoice_SetEffectParameters(&This->IXAudio2SubmixVoice_iface,
EffectIndex, pParameters, ParametersByteSize, OperationSet);
}
static HRESULT WINAPI XA27SUB_GetEffectParameters(IXAudio27SubmixVoice *iface,
UINT32 EffectIndex, void *pParameters, UINT32 ParametersByteSize)
{
XA2SubmixImpl *This = impl_from_IXAudio27SubmixVoice(iface);
return IXAudio2SubmixVoice_GetEffectParameters(&This->IXAudio2SubmixVoice_iface,
EffectIndex, pParameters, ParametersByteSize);
}
static HRESULT WINAPI XA27SUB_SetFilterParameters(IXAudio27SubmixVoice *iface,
const XAUDIO2_FILTER_PARAMETERS *pParameters, UINT32 OperationSet)
{
XA2SubmixImpl *This = impl_from_IXAudio27SubmixVoice(iface);
return IXAudio2SubmixVoice_SetFilterParameters(&This->IXAudio2SubmixVoice_iface,
pParameters, OperationSet);
}
static void WINAPI XA27SUB_GetFilterParameters(IXAudio27SubmixVoice *iface,
XAUDIO2_FILTER_PARAMETERS *pParameters)
{
XA2SubmixImpl *This = impl_from_IXAudio27SubmixVoice(iface);
return IXAudio2SubmixVoice_GetFilterParameters(&This->IXAudio2SubmixVoice_iface, pParameters);
}
static HRESULT WINAPI XA27SUB_SetOutputFilterParameters(IXAudio27SubmixVoice *iface,
IXAudio2Voice *pDestinationVoice,
const XAUDIO2_FILTER_PARAMETERS *pParameters, UINT32 OperationSet)
{
XA2SubmixImpl *This = impl_from_IXAudio27SubmixVoice(iface);
return IXAudio2SubmixVoice_SetOutputFilterParameters(&This->IXAudio2SubmixVoice_iface,
pDestinationVoice, pParameters, OperationSet);
}
static void WINAPI XA27SUB_GetOutputFilterParameters(IXAudio27SubmixVoice *iface,
IXAudio2Voice *pDestinationVoice,
XAUDIO2_FILTER_PARAMETERS *pParameters)
{
XA2SubmixImpl *This = impl_from_IXAudio27SubmixVoice(iface);
IXAudio2SubmixVoice_GetOutputFilterParameters(&This->IXAudio2SubmixVoice_iface,
pDestinationVoice, pParameters);
}
static HRESULT WINAPI XA27SUB_SetVolume(IXAudio27SubmixVoice *iface,
float Volume, UINT32 OperationSet)
{
XA2SubmixImpl *This = impl_from_IXAudio27SubmixVoice(iface);
return IXAudio2SubmixVoice_SetVolume(&This->IXAudio2SubmixVoice_iface,
Volume, OperationSet);
}
static void WINAPI XA27SUB_GetVolume(IXAudio27SubmixVoice *iface,
float *pVolume)
{
XA2SubmixImpl *This = impl_from_IXAudio27SubmixVoice(iface);
return IXAudio2SubmixVoice_GetVolume(&This->IXAudio2SubmixVoice_iface, pVolume);
}
static HRESULT WINAPI XA27SUB_SetChannelVolumes(IXAudio27SubmixVoice *iface,
UINT32 Channels, const float *pVolumes, UINT32 OperationSet)
{
XA2SubmixImpl *This = impl_from_IXAudio27SubmixVoice(iface);
return IXAudio2SubmixVoice_SetChannelVolumes(&This->IXAudio2SubmixVoice_iface,
Channels, pVolumes, OperationSet);
}
static void WINAPI XA27SUB_GetChannelVolumes(IXAudio27SubmixVoice *iface,
UINT32 Channels, float *pVolumes)
{
XA2SubmixImpl *This = impl_from_IXAudio27SubmixVoice(iface);
return IXAudio2SubmixVoice_GetChannelVolumes(&This->IXAudio2SubmixVoice_iface,
Channels, pVolumes);
}
static HRESULT WINAPI XA27SUB_SetOutputMatrix(IXAudio27SubmixVoice *iface,
IXAudio2Voice *pDestinationVoice, UINT32 SubmixChannels,
UINT32 DestinationChannels, const float *pLevelMatrix,
UINT32 OperationSet)
{
XA2SubmixImpl *This = impl_from_IXAudio27SubmixVoice(iface);
return IXAudio2SubmixVoice_SetOutputMatrix(&This->IXAudio2SubmixVoice_iface,
pDestinationVoice, SubmixChannels, DestinationChannels,
pLevelMatrix, OperationSet);
}
static void WINAPI XA27SUB_GetOutputMatrix(IXAudio27SubmixVoice *iface,
IXAudio2Voice *pDestinationVoice, UINT32 SubmixChannels,
UINT32 DestinationChannels, float *pLevelMatrix)
{
XA2SubmixImpl *This = impl_from_IXAudio27SubmixVoice(iface);
return IXAudio2SubmixVoice_GetOutputMatrix(&This->IXAudio2SubmixVoice_iface,
pDestinationVoice, SubmixChannels, DestinationChannels,
pLevelMatrix);
}
static void WINAPI XA27SUB_DestroyVoice(IXAudio27SubmixVoice *iface)
{
XA2SubmixImpl *This = impl_from_IXAudio27SubmixVoice(iface);
return IXAudio2SubmixVoice_DestroyVoice(&This->IXAudio2SubmixVoice_iface);
}
const IXAudio27SubmixVoiceVtbl XAudio27SubmixVoice_Vtbl = {
XA27SUB_GetVoiceDetails,
XA27SUB_SetOutputVoices,
XA27SUB_SetEffectChain,
XA27SUB_EnableEffect,
XA27SUB_DisableEffect,
XA27SUB_GetEffectState,
XA27SUB_SetEffectParameters,
XA27SUB_GetEffectParameters,
XA27SUB_SetFilterParameters,
XA27SUB_GetFilterParameters,
XA27SUB_SetOutputFilterParameters,
XA27SUB_GetOutputFilterParameters,
XA27SUB_SetVolume,
XA27SUB_GetVolume,
XA27SUB_SetChannelVolumes,
XA27SUB_GetChannelVolumes,
XA27SUB_SetOutputMatrix,
XA27SUB_GetOutputMatrix,
XA27SUB_DestroyVoice
};
#endif
/* END IXAudio2SubmixVoice */
......@@ -1233,10 +1452,16 @@ static IXAudio2Impl *impl_from_IXAudio20MasteringVoice(IXAudio20MasteringVoice *
}
static void WINAPI XA20M_GetVoiceDetails(IXAudio20MasteringVoice *iface,
XAUDIO2_VOICE_DETAILS *pVoiceDetails)
XAUDIO27_VOICE_DETAILS *pVoiceDetails)
{
IXAudio2Impl *This = impl_from_IXAudio20MasteringVoice(iface);
return IXAudio2MasteringVoice_GetVoiceDetails(&This->IXAudio2MasteringVoice_iface, pVoiceDetails);
XAUDIO2_VOICE_DETAILS details;
IXAudio2MasteringVoice_GetVoiceDetails(&This->IXAudio2MasteringVoice_iface, &details);
pVoiceDetails->CreationFlags = details.CreationFlags;
pVoiceDetails->InputChannels = details.InputChannels;
pVoiceDetails->InputSampleRate = details.InputSampleRate;
}
static HRESULT WINAPI XA20M_SetOutputVoices(IXAudio20MasteringVoice *iface,
......@@ -1413,10 +1638,16 @@ static IXAudio2Impl *impl_from_IXAudio23MasteringVoice(IXAudio23MasteringVoice *
}
static void WINAPI XA23M_GetVoiceDetails(IXAudio23MasteringVoice *iface,
XAUDIO2_VOICE_DETAILS *pVoiceDetails)
XAUDIO27_VOICE_DETAILS *pVoiceDetails)
{
IXAudio2Impl *This = impl_from_IXAudio23MasteringVoice(iface);
return IXAudio2MasteringVoice_GetVoiceDetails(&This->IXAudio2MasteringVoice_iface, pVoiceDetails);
XAUDIO2_VOICE_DETAILS details;
IXAudio2MasteringVoice_GetVoiceDetails(&This->IXAudio2MasteringVoice_iface, &details);
pVoiceDetails->CreationFlags = details.CreationFlags;
pVoiceDetails->InputChannels = details.InputChannels;
pVoiceDetails->InputSampleRate = details.InputSampleRate;
}
static HRESULT WINAPI XA23M_SetOutputVoices(IXAudio23MasteringVoice *iface,
......@@ -1583,6 +1814,194 @@ const IXAudio23MasteringVoiceVtbl XAudio23MasteringVoice_Vtbl = {
XA23M_GetOutputMatrix,
XA23M_DestroyVoice
};
#elif XAUDIO2_VER <= 7
static IXAudio2Impl *impl_from_IXAudio27MasteringVoice(IXAudio27MasteringVoice *iface)
{
return CONTAINING_RECORD(iface, IXAudio2Impl, IXAudio27MasteringVoice_iface);
}
static void WINAPI XA27M_GetVoiceDetails(IXAudio27MasteringVoice *iface,
XAUDIO27_VOICE_DETAILS *pVoiceDetails)
{
IXAudio2Impl *This = impl_from_IXAudio27MasteringVoice(iface);
XAUDIO2_VOICE_DETAILS details;
IXAudio2MasteringVoice_GetVoiceDetails(&This->IXAudio2MasteringVoice_iface, &details);
pVoiceDetails->CreationFlags = details.CreationFlags;
pVoiceDetails->InputChannels = details.InputChannels;
pVoiceDetails->InputSampleRate = details.InputSampleRate;
}
static HRESULT WINAPI XA27M_SetOutputVoices(IXAudio27MasteringVoice *iface,
const XAUDIO2_VOICE_SENDS *pSendList)
{
IXAudio2Impl *This = impl_from_IXAudio27MasteringVoice(iface);
return IXAudio2MasteringVoice_SetOutputVoices(&This->IXAudio2MasteringVoice_iface, pSendList);
}
static HRESULT WINAPI XA27M_SetEffectChain(IXAudio27MasteringVoice *iface,
const XAUDIO2_EFFECT_CHAIN *pEffectChain)
{
IXAudio2Impl *This = impl_from_IXAudio27MasteringVoice(iface);
return IXAudio2MasteringVoice_SetEffectChain(&This->IXAudio2MasteringVoice_iface, pEffectChain);
}
static HRESULT WINAPI XA27M_EnableEffect(IXAudio27MasteringVoice *iface,
UINT32 EffectIndex, UINT32 OperationSet)
{
IXAudio2Impl *This = impl_from_IXAudio27MasteringVoice(iface);
return IXAudio2MasteringVoice_EnableEffect(&This->IXAudio2MasteringVoice_iface,
EffectIndex, OperationSet);
}
static HRESULT WINAPI XA27M_DisableEffect(IXAudio27MasteringVoice *iface,
UINT32 EffectIndex, UINT32 OperationSet)
{
IXAudio2Impl *This = impl_from_IXAudio27MasteringVoice(iface);
return IXAudio2MasteringVoice_DisableEffect(&This->IXAudio2MasteringVoice_iface,
EffectIndex, OperationSet);
}
static void WINAPI XA27M_GetEffectState(IXAudio27MasteringVoice *iface,
UINT32 EffectIndex, BOOL *pEnabled)
{
IXAudio2Impl *This = impl_from_IXAudio27MasteringVoice(iface);
return IXAudio2MasteringVoice_GetEffectState(&This->IXAudio2MasteringVoice_iface,
EffectIndex, pEnabled);
}
static HRESULT WINAPI XA27M_SetEffectParameters(IXAudio27MasteringVoice *iface,
UINT32 EffectIndex, const void *pParameters, UINT32 ParametersByteSize,
UINT32 OperationSet)
{
IXAudio2Impl *This = impl_from_IXAudio27MasteringVoice(iface);
return IXAudio2MasteringVoice_SetEffectParameters(&This->IXAudio2MasteringVoice_iface,
EffectIndex, pParameters, ParametersByteSize, OperationSet);
}
static HRESULT WINAPI XA27M_GetEffectParameters(IXAudio27MasteringVoice *iface,
UINT32 EffectIndex, void *pParameters, UINT32 ParametersByteSize)
{
IXAudio2Impl *This = impl_from_IXAudio27MasteringVoice(iface);
return IXAudio2MasteringVoice_GetEffectParameters(&This->IXAudio2MasteringVoice_iface,
EffectIndex, pParameters, ParametersByteSize);
}
static HRESULT WINAPI XA27M_SetFilterParameters(IXAudio27MasteringVoice *iface,
const XAUDIO2_FILTER_PARAMETERS *pParameters, UINT32 OperationSet)
{
IXAudio2Impl *This = impl_from_IXAudio27MasteringVoice(iface);
return IXAudio2MasteringVoice_SetFilterParameters(&This->IXAudio2MasteringVoice_iface,
pParameters, OperationSet);
}
static void WINAPI XA27M_GetFilterParameters(IXAudio27MasteringVoice *iface,
XAUDIO2_FILTER_PARAMETERS *pParameters)
{
IXAudio2Impl *This = impl_from_IXAudio27MasteringVoice(iface);
return IXAudio2MasteringVoice_GetFilterParameters(&This->IXAudio2MasteringVoice_iface, pParameters);
}
static HRESULT WINAPI XA27M_SetOutputFilterParameters(IXAudio27MasteringVoice *iface,
IXAudio2Voice *pDestinationVoice,
const XAUDIO2_FILTER_PARAMETERS *pParameters, UINT32 OperationSet)
{
IXAudio2Impl *This = impl_from_IXAudio27MasteringVoice(iface);
return IXAudio2MasteringVoice_SetOutputFilterParameters(&This->IXAudio2MasteringVoice_iface,
pDestinationVoice, pParameters, OperationSet);
}
static void WINAPI XA27M_GetOutputFilterParameters(IXAudio27MasteringVoice *iface,
IXAudio2Voice *pDestinationVoice,
XAUDIO2_FILTER_PARAMETERS *pParameters)
{
IXAudio2Impl *This = impl_from_IXAudio27MasteringVoice(iface);
IXAudio2MasteringVoice_GetOutputFilterParameters(&This->IXAudio2MasteringVoice_iface,
pDestinationVoice, pParameters);
}
static HRESULT WINAPI XA27M_SetVolume(IXAudio27MasteringVoice *iface,
float Volume, UINT32 OperationSet)
{
IXAudio2Impl *This = impl_from_IXAudio27MasteringVoice(iface);
return IXAudio2MasteringVoice_SetVolume(&This->IXAudio2MasteringVoice_iface,
Volume, OperationSet);
}
static void WINAPI XA27M_GetVolume(IXAudio27MasteringVoice *iface,
float *pVolume)
{
IXAudio2Impl *This = impl_from_IXAudio27MasteringVoice(iface);
return IXAudio2MasteringVoice_GetVolume(&This->IXAudio2MasteringVoice_iface, pVolume);
}
static HRESULT WINAPI XA27M_SetChannelVolumes(IXAudio27MasteringVoice *iface,
UINT32 Channels, const float *pVolumes, UINT32 OperationSet)
{
IXAudio2Impl *This = impl_from_IXAudio27MasteringVoice(iface);
return IXAudio2MasteringVoice_SetChannelVolumes(&This->IXAudio2MasteringVoice_iface,
Channels, pVolumes, OperationSet);
}
static void WINAPI XA27M_GetChannelVolumes(IXAudio27MasteringVoice *iface,
UINT32 Channels, float *pVolumes)
{
IXAudio2Impl *This = impl_from_IXAudio27MasteringVoice(iface);
return IXAudio2MasteringVoice_GetChannelVolumes(&This->IXAudio2MasteringVoice_iface,
Channels, pVolumes);
}
static HRESULT WINAPI XA27M_SetOutputMatrix(IXAudio27MasteringVoice *iface,
IXAudio2Voice *pDestinationVoice, UINT32 MasteringChannels,
UINT32 DestinationChannels, const float *pLevelMatrix,
UINT32 OperationSet)
{
IXAudio2Impl *This = impl_from_IXAudio27MasteringVoice(iface);
return IXAudio2MasteringVoice_SetOutputMatrix(&This->IXAudio2MasteringVoice_iface,
pDestinationVoice, MasteringChannels, DestinationChannels,
pLevelMatrix, OperationSet);
}
static void WINAPI XA27M_GetOutputMatrix(IXAudio27MasteringVoice *iface,
IXAudio2Voice *pDestinationVoice, UINT32 MasteringChannels,
UINT32 DestinationChannels, float *pLevelMatrix)
{
IXAudio2Impl *This = impl_from_IXAudio27MasteringVoice(iface);
return IXAudio2MasteringVoice_GetOutputMatrix(&This->IXAudio2MasteringVoice_iface,
pDestinationVoice, MasteringChannels, DestinationChannels,
pLevelMatrix);
}
static void WINAPI XA27M_DestroyVoice(IXAudio27MasteringVoice *iface)
{
IXAudio2Impl *This = impl_from_IXAudio27MasteringVoice(iface);
return IXAudio2MasteringVoice_DestroyVoice(&This->IXAudio2MasteringVoice_iface);
}
const IXAudio27MasteringVoiceVtbl XAudio27MasteringVoice_Vtbl = {
XA27M_GetVoiceDetails,
XA27M_SetOutputVoices,
XA27M_SetEffectChain,
XA27M_EnableEffect,
XA27M_DisableEffect,
XA27M_GetEffectState,
XA27M_SetEffectParameters,
XA27M_GetEffectParameters,
XA27M_SetFilterParameters,
XA27M_GetFilterParameters,
XA27M_SetOutputFilterParameters,
XA27M_GetOutputFilterParameters,
XA27M_SetVolume,
XA27M_GetVolume,
XA27M_SetChannelVolumes,
XA27M_GetChannelVolumes,
XA27M_SetOutputMatrix,
XA27M_GetOutputMatrix,
XA27M_DestroyVoice
};
#endif
/* END IXAudio2MasteringVoice */
......
......@@ -216,6 +216,21 @@ static void test_simple_streaming(IXAudio2 *xa)
XA2CALL(CreateSourceVoice, &src, &fmt, 0, 1.f, &vcb1, NULL, NULL);
ok(hr == S_OK, "CreateSourceVoice failed: %08x\n", hr);
if(xaudio27){
XAUDIO27_VOICE_DETAILS details;
IXAudio27SourceVoice_GetVoiceDetails((IXAudio27SourceVoice*)src, &details);
ok(details.CreationFlags == 0, "Got wrong flags: 0x%x\n", details.CreationFlags);
ok(details.InputChannels == 2, "Got wrong channel count: 0x%x\n", details.InputChannels);
ok(details.InputSampleRate == 44100, "Got wrong sample rate: 0x%x\n", details.InputSampleRate);
}else{
XAUDIO2_VOICE_DETAILS details;
IXAudio2SourceVoice_GetVoiceDetails(src, &details);
ok(details.CreationFlags == 0, "Got wrong creation flags: 0x%x\n", details.CreationFlags);
ok(details.ActiveFlags == 0, "Got wrong active flags: 0x%x\n", details.CreationFlags);
ok(details.InputChannels == 2, "Got wrong channel count: 0x%x\n", details.InputChannels);
ok(details.InputSampleRate == 44100, "Got wrong sample rate: 0x%x\n", details.InputSampleRate);
}
memset(&buf, 0, sizeof(buf));
buf.AudioBytes = 22050 * fmt.nBlockAlign;
buf.pAudioData = HeapAlloc(GetProcessHeap(), 0, buf.AudioBytes);
......@@ -231,6 +246,21 @@ static void test_simple_streaming(IXAudio2 *xa)
XA2CALL(CreateSourceVoice, &src2, &fmt, 0, 1.f, &vcb2, NULL, NULL);
ok(hr == S_OK, "CreateSourceVoice failed: %08x\n", hr);
if(xaudio27){
XAUDIO27_VOICE_DETAILS details;
IXAudio27SourceVoice_GetVoiceDetails((IXAudio27SourceVoice*)src2, &details);
ok(details.CreationFlags == 0, "Got wrong flags: 0x%x\n", details.CreationFlags);
ok(details.InputChannels == 2, "Got wrong channel count: 0x%x\n", details.InputChannels);
ok(details.InputSampleRate == 44100, "Got wrong sample rate: 0x%x\n", details.InputSampleRate);
}else{
XAUDIO2_VOICE_DETAILS details;
IXAudio2SourceVoice_GetVoiceDetails(src2, &details);
ok(details.CreationFlags == 0, "Got wrong creation flags: 0x%x\n", details.CreationFlags);
ok(details.ActiveFlags == 0, "Got wrong active flags: 0x%x\n", details.CreationFlags);
ok(details.InputChannels == 2, "Got wrong channel count: 0x%x\n", details.InputChannels);
ok(details.InputSampleRate == 44100, "Got wrong sample rate: 0x%x\n", details.InputSampleRate);
}
memset(&buf2, 0, sizeof(buf2));
buf2.AudioBytes = 22050 * fmt.nBlockAlign;
buf2.pAudioData = HeapAlloc(GetProcessHeap(), 0, buf2.AudioBytes);
......@@ -775,6 +805,42 @@ static void test_looping(IXAudio2 *xa)
HeapFree(GetProcessHeap(), 0, (void*)buf.pAudioData);
}
static void test_submix(IXAudio2 *xa)
{
HRESULT hr;
IXAudio2MasteringVoice *master;
IXAudio2SubmixVoice *sub;
XA2CALL_0V(StopEngine);
if(xaudio27)
hr = IXAudio27_CreateMasteringVoice((IXAudio27*)xa, &master, 2, 44100, 0, 0, NULL);
else
hr = IXAudio2_CreateMasteringVoice(xa, &master, 2, 44100, 0, NULL, NULL, AudioCategory_GameEffects);
ok(hr == S_OK, "CreateMasteringVoice failed: %08x\n", hr);
XA2CALL(CreateSubmixVoice, &sub, 2, 44100, 0, 0, NULL, NULL);
ok(hr == S_OK, "CreateSubmixVoice failed: %08x\n", hr);
if(xaudio27){
XAUDIO27_VOICE_DETAILS details;
IXAudio27SubmixVoice_GetVoiceDetails((IXAudio27SubmixVoice*)sub, &details);
ok(details.CreationFlags == 0, "Got wrong flags: 0x%x\n", details.CreationFlags);
ok(details.InputChannels == 2, "Got wrong channel count: 0x%x\n", details.InputChannels);
ok(details.InputSampleRate == 44100, "Got wrong sample rate: 0x%x\n", details.InputSampleRate);
}else{
XAUDIO2_VOICE_DETAILS details;
IXAudio2SubmixVoice_GetVoiceDetails(sub, &details);
ok(details.CreationFlags == 0, "Got wrong creation flags: 0x%x\n", details.CreationFlags);
ok(details.ActiveFlags == 0, "Got wrong active flags: 0x%x\n", details.CreationFlags);
ok(details.InputChannels == 2, "Got wrong channel count: 0x%x\n", details.InputChannels);
ok(details.InputSampleRate == 44100, "Got wrong sample rate: 0x%x\n", details.InputSampleRate);
}
IXAudio2SubmixVoice_DestroyVoice(sub);
IXAudio2MasteringVoice_DestroyVoice(master);
}
static UINT32 test_DeviceDetails(IXAudio27 *xa)
{
HRESULT hr;
......@@ -1069,6 +1135,7 @@ START_TEST(xaudio2)
test_simple_streaming((IXAudio2*)xa27);
test_buffer_callbacks((IXAudio2*)xa27);
test_looping((IXAudio2*)xa27);
test_submix((IXAudio2*)xa27);
}else
skip("No audio devices available\n");
......@@ -1091,6 +1158,7 @@ START_TEST(xaudio2)
test_simple_streaming(xa);
test_buffer_callbacks(xa);
test_looping(xa);
test_submix(xa);
}else
skip("No audio devices available\n");
......
......@@ -173,7 +173,13 @@ static void WINAPI XA2SRC_GetVoiceDetails(IXAudio2SourceVoice *iface,
XAUDIO2_VOICE_DETAILS *pVoiceDetails)
{
XA2SourceImpl *This = impl_from_IXAudio2SourceVoice(iface);
TRACE("%p, %p\n", This, pVoiceDetails);
pVoiceDetails->CreationFlags = 0;
pVoiceDetails->ActiveFlags = 0;
pVoiceDetails->InputChannels = This->fmt->nChannels;
pVoiceDetails->InputSampleRate = This->fmt->nSamplesPerSec;
}
static HRESULT WINAPI XA2SRC_SetOutputVoices(IXAudio2SourceVoice *iface,
......@@ -799,6 +805,7 @@ static void WINAPI XA2M_GetVoiceDetails(IXAudio2MasteringVoice *iface,
IXAudio2Impl *This = impl_from_IXAudio2MasteringVoice(iface);
TRACE("%p, %p\n", This, pVoiceDetails);
pVoiceDetails->CreationFlags = 0;
pVoiceDetails->ActiveFlags = 0;
pVoiceDetails->InputChannels = This->fmt.Format.nChannels;
pVoiceDetails->InputSampleRate = This->fmt.Format.nSamplesPerSec;
}
......@@ -1010,7 +1017,10 @@ static void WINAPI XA2SUB_GetVoiceDetails(IXAudio2SubmixVoice *iface,
XAUDIO2_VOICE_DETAILS *pVoiceDetails)
{
XA2SubmixImpl *This = impl_from_IXAudio2SubmixVoice(iface);
TRACE("%p, %p\n", This, pVoiceDetails);
*pVoiceDetails = This->details;
}
static HRESULT WINAPI XA2SUB_SetOutputVoices(IXAudio2SubmixVoice *iface,
......@@ -1499,6 +1509,8 @@ static HRESULT WINAPI IXAudio2Impl_CreateSubmixVoice(IXAudio2 *iface,
sub->IXAudio20SubmixVoice_iface.lpVtbl = &XAudio20SubmixVoice_Vtbl;
#elif XAUDIO2_VER <= 3
sub->IXAudio23SubmixVoice_iface.lpVtbl = &XAudio23SubmixVoice_Vtbl;
#elif XAUDIO2_VER <= 7
sub->IXAudio27SubmixVoice_iface.lpVtbl = &XAudio27SubmixVoice_Vtbl;
#endif
InitializeCriticalSection(&sub->lock);
......@@ -1509,6 +1521,11 @@ static HRESULT WINAPI IXAudio2Impl_CreateSubmixVoice(IXAudio2 *iface,
sub->in_use = TRUE;
sub->details.CreationFlags = flags;
sub->details.ActiveFlags = flags;
sub->details.InputChannels = inputChannels;
sub->details.InputSampleRate = inputSampleRate;
LeaveCriticalSection(&This->lock);
LeaveCriticalSection(&sub->lock);
......@@ -1516,6 +1533,8 @@ static HRESULT WINAPI IXAudio2Impl_CreateSubmixVoice(IXAudio2 *iface,
*ppSubmixVoice = (IXAudio2SubmixVoice*)&sub->IXAudio20SubmixVoice_iface;
#elif XAUDIO2_VER <= 3
*ppSubmixVoice = (IXAudio2SubmixVoice*)&sub->IXAudio23SubmixVoice_iface;
#elif XAUDIO2_VER <= 7
*ppSubmixVoice = (IXAudio2SubmixVoice*)&sub->IXAudio27SubmixVoice_iface;
#else
*ppSubmixVoice = &sub->IXAudio2SubmixVoice_iface;
#endif
......@@ -1751,6 +1770,8 @@ static HRESULT WINAPI IXAudio2Impl_CreateMasteringVoice(IXAudio2 *iface,
*ppMasteringVoice = (IXAudio2MasteringVoice*)&This->IXAudio20MasteringVoice_iface;
#elif XAUDIO2_VER <= 3
*ppMasteringVoice = (IXAudio2MasteringVoice*)&This->IXAudio23MasteringVoice_iface;
#elif XAUDIO2_VER <= 7
*ppMasteringVoice = (IXAudio2MasteringVoice*)&This->IXAudio27MasteringVoice_iface;
#else
*ppMasteringVoice = &This->IXAudio2MasteringVoice_iface;
#endif
......@@ -2001,6 +2022,8 @@ static HRESULT WINAPI XAudio2CF_CreateInstance(IClassFactory *iface, IUnknown *p
object->IXAudio20MasteringVoice_iface.lpVtbl = &XAudio20MasteringVoice_Vtbl;
#elif XAUDIO2_VER <= 3
object->IXAudio23MasteringVoice_iface.lpVtbl = &XAudio23MasteringVoice_Vtbl;
#elif XAUDIO2_VER <= 7
object->IXAudio27MasteringVoice_iface.lpVtbl = &XAudio27MasteringVoice_Vtbl;
#endif
list_init(&object->source_voices);
......
......@@ -93,10 +93,14 @@ typedef struct _XA2SubmixImpl {
IXAudio20SubmixVoice IXAudio20SubmixVoice_iface;
#elif XAUDIO2_VER <= 3
IXAudio23SubmixVoice IXAudio23SubmixVoice_iface;
#elif XAUDIO2_VER <= 7
IXAudio27SubmixVoice IXAudio27SubmixVoice_iface;
#endif
BOOL in_use;
XAUDIO2_VOICE_DETAILS details;
CRITICAL_SECTION lock;
struct list entry;
......@@ -118,6 +122,8 @@ struct _IXAudio2Impl {
IXAudio20MasteringVoice IXAudio20MasteringVoice_iface;
#elif XAUDIO2_VER <= 3
IXAudio23MasteringVoice IXAudio23MasteringVoice_iface;
#elif XAUDIO2_VER <= 7
IXAudio27MasteringVoice IXAudio27MasteringVoice_iface;
#endif
LONG ref;
......@@ -163,6 +169,8 @@ extern const IXAudio23SubmixVoiceVtbl XAudio23SubmixVoice_Vtbl DECLSPEC_HIDDEN;
extern const IXAudio23MasteringVoiceVtbl XAudio23MasteringVoice_Vtbl DECLSPEC_HIDDEN;
#elif XAUDIO2_VER <= 7
extern const IXAudio27SourceVoiceVtbl XAudio27SourceVoice_Vtbl DECLSPEC_HIDDEN;
extern const IXAudio27SubmixVoiceVtbl XAudio27SubmixVoice_Vtbl DECLSPEC_HIDDEN;
extern const IXAudio27MasteringVoiceVtbl XAudio27MasteringVoice_Vtbl DECLSPEC_HIDDEN;
#endif
#if XAUDIO2_VER == 0
......
......@@ -223,9 +223,17 @@ typedef struct XAUDIO2_DEVICE_DETAILS
WAVEFORMATEXTENSIBLE OutputFormat;
} XAUDIO2_DEVICE_DETAILS;
typedef struct XAUDIO27_VOICE_DETAILS
{
UINT32 CreationFlags;
UINT32 InputChannels;
UINT32 InputSampleRate;
} XAUDIO27_VOICE_DETAILS;
typedef struct XAUDIO2_VOICE_DETAILS
{
UINT32 CreationFlags;
UINT32 ActiveFlags;
UINT32 InputChannels;
UINT32 InputSampleRate;
} XAUDIO2_VOICE_DETAILS;
......@@ -323,7 +331,7 @@ typedef struct XAUDIO2_FILTER_PARAMETERS
]
interface IXAudio20Voice
{
void GetVoiceDetails([out] XAUDIO2_VOICE_DETAILS* pVoiceDetails);
void GetVoiceDetails([out] XAUDIO27_VOICE_DETAILS* pVoiceDetails);
HRESULT SetOutputVoices([in] const XAUDIO23_VOICE_SENDS* pSendList);
......@@ -398,7 +406,7 @@ interface IXAudio20Voice
]
interface IXAudio23Voice
{
void GetVoiceDetails([out] XAUDIO2_VOICE_DETAILS* pVoiceDetails);
void GetVoiceDetails([out] XAUDIO27_VOICE_DETAILS* pVoiceDetails);
HRESULT SetOutputVoices([in] const XAUDIO23_VOICE_SENDS* pSendList);
......@@ -464,6 +472,90 @@ interface IXAudio23Voice
void DestroyVoice();
}
/* XAudio 2.7's IXAudio2Voice */
/* XAudio2 2.7's IXAudio2Voice interface. Actually called
* IXAudio2Voice in the Jun 2010 DX SDK */
[
object,
local
]
interface IXAudio27Voice
{
void GetVoiceDetails([out] XAUDIO27_VOICE_DETAILS* pVoiceDetails);
HRESULT SetOutputVoices([in] const XAUDIO2_VOICE_SENDS* pSendList);
HRESULT SetEffectChain([in] const XAUDIO2_EFFECT_CHAIN* pEffectChain);
HRESULT EnableEffect(
[in] UINT32 EffectIndex,
[in, defaultvalue(XAUDIO2_COMMIT_NOW)] UINT32 OperationSet);
HRESULT DisableEffect(
[in] UINT32 EffectIndex,
[in, defaultvalue(XAUDIO2_COMMIT_NOW)] UINT32 OperationSet);
void GetEffectState(
[in] UINT32 EffectIndex,
[out] BOOL* pEnabled);
HRESULT SetEffectParameters(
[in] UINT32 EffectIndex,
[in] const void* pParameters,
[in] UINT32 ParametersByteSize,
[in, defaultvalue(XAUDIO2_COMMIT_NOW)] UINT32 OperationSet);
HRESULT GetEffectParameters(
[in] UINT32 EffectIndex,
[out] void* pParameters,
[in] UINT32 ParametersByteSize);
HRESULT SetFilterParameters(
[in] const XAUDIO2_FILTER_PARAMETERS* pParameters,
[in, defaultvalue(XAUDIO2_COMMIT_NOW)] UINT32 OperationSet);
void GetFilterParameters([out] XAUDIO2_FILTER_PARAMETERS* pParameters);
HRESULT SetOutputFilterParameters(
[in] IXAudio2Voice* pDestinationVoice,
[in] const XAUDIO2_FILTER_PARAMETERS* pParameters,
[in, defaultvalue(XAUDIO2_COMMIT_NOW)] UINT32 OperationSet);
void GetOutputFilterParameters(
[in] IXAudio2Voice* pDestinationVoice,
[out] XAUDIO2_FILTER_PARAMETERS* pParameters);
HRESULT SetVolume(
[in] float Volume,
[in, defaultvalue(XAUDIO2_COMMIT_NOW)] UINT32 OperationSet);
void GetVolume([out] float* pVolume);
HRESULT SetChannelVolumes(
[in] UINT32 Channels,
[in, size_is(Channels)] const float* pVolumes,
[in, defaultvalue(XAUDIO2_COMMIT_NOW)] UINT32 OperationSet);
void GetChannelVolumes(
[in] UINT32 Channels,
[out, size_is(Channels)] float* pVolumes);
HRESULT SetOutputMatrix(
[in] IXAudio2Voice* pDestinationVoice,
[in] UINT32 SourceChannels,
[in] UINT32 DestinationChannels,
[in, size_is(SourceChannels * DestinationChannels)] const float* pLevelMatrix,
[in, defaultvalue(XAUDIO2_COMMIT_NOW)] UINT32 OperationSet);
void GetOutputMatrix(
[in] IXAudio2Voice* pDestinationVoice,
[in] UINT32 SourceChannels,
[in] UINT32 DestinationChannels,
[out, size_is(SourceChannels * DestinationChannels)] float* pLevelMatrix);
void DestroyVoice();
}
[
object,
local
......@@ -644,7 +736,7 @@ interface IXAudio23SourceVoice : IXAudio23Voice
]
/* XAudio2 2.7's IXAudio2SourceVoice interface. Actually called
* IXAudio2SourceVoice in the Jun 2010 DX SDK */
interface IXAudio27SourceVoice : IXAudio2Voice
interface IXAudio27SourceVoice : IXAudio27Voice
{
HRESULT Start(
[in, defaultvalue(0)] UINT32 Flags,
......@@ -731,6 +823,15 @@ interface IXAudio23SubmixVoice : IXAudio23Voice
[
local
]
/* XAudio2 2.7's IXAudio2SubmixVoice interface. Actually called
* IXAudio2SubmixVoice in the Jun 2010 DX SDK */
interface IXAudio27SubmixVoice : IXAudio27Voice
{
}
[
local
]
interface IXAudio2SubmixVoice : IXAudio2Voice
{
}
......@@ -756,6 +857,15 @@ interface IXAudio23MasteringVoice : IXAudio23Voice
[
local
]
/* XAudio2 2.7's IXAudio2MasteringVoice interface. Actually called
* IXAudio2MasteringVoice in the Jun 2010 DX SDK */
interface IXAudio27MasteringVoice : IXAudio27Voice
{
}
[
local
]
interface IXAudio2MasteringVoice : IXAudio2Voice
{
/* not present in XAudio2 2.7 */
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment