本文整理汇总了C++中IDirectSoundBuffer8::GetObjectInPath方法的典型用法代码示例。如果您正苦于以下问题:C++ IDirectSoundBuffer8::GetObjectInPath方法的具体用法?C++ IDirectSoundBuffer8::GetObjectInPath怎么用?C++ IDirectSoundBuffer8::GetObjectInPath使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类IDirectSoundBuffer8
的用法示例。
在下文中一共展示了IDirectSoundBuffer8::GetObjectInPath方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1:
void SoundLibrary3dDirectSound::UpdateDspFX( int _channel, int _filterType, int _numParams, float const *_params )
{
AppDebugAssert(_channel >= 0 && _channel < m_numChannels);
AppDebugAssert(GetNumFilters(_channel) > 0);
DirectSoundChannel *channel;
if (_channel == m_musicChannelId) channel = m_musicChannel;
else channel = &m_channels[_channel];
if (_filterType <= DSP_DSOUND_WAVESREVERB)
{
int errCode;
IDirectSoundBuffer8 *buffer = (IDirectSoundBuffer8 *) channel->m_bufferInterface;
IUnknown *effect;
GUID sfxClass = *s_dxDescriptors[_filterType].m_sfxClass;
GUID interfaceClass = *s_dxDescriptors[_filterType].m_interfaceClass;
errCode = buffer->GetObjectInPath(sfxClass,
0,
interfaceClass,
(void **) &effect );
SOUNDASSERT( errCode, "Failed to get hold of DirectFX filter" );
switch( _filterType )
{
case DSP_DSOUND_CHORUS:
errCode = ((IDirectSoundFXChorus8 *)effect)->SetAllParameters( (DSFXChorus *)_params );
break;
case DSP_DSOUND_COMPRESSOR:
errCode = ((IDirectSoundFXCompressor8 *)effect)->SetAllParameters( (DSFXCompressor *)_params );
break;
case DSP_DSOUND_DISTORTION:
errCode = ((IDirectSoundFXDistortion8 *)effect)->SetAllParameters( (DSFXDistortion *)_params );
break;
case DSP_DSOUND_ECHO:
errCode = ((IDirectSoundFXEcho8 *)effect)->SetAllParameters( (DSFXEcho *)_params );
break;
case DSP_DSOUND_FLANGER:
errCode = ((IDirectSoundFXFlanger8 *)effect)->SetAllParameters( (DSFXFlanger *)_params );
break;
case DSP_DSOUND_GARGLE:
errCode = ((IDirectSoundFXGargle8 *)effect)->SetAllParameters( (DSFXGargle *)_params );
break;
case DSP_DSOUND_PARAMEQ:
errCode = ((IDirectSoundFXParamEq8 *)effect)->SetAllParameters( (DSFXParamEq *)_params );
break;
case DSP_DSOUND_WAVESREVERB:
errCode = ((IDirectSoundFXWavesReverb8 *)effect)->SetAllParameters( (DSFXWavesReverb *)_params );
break;
case DSP_DSOUND_I3DL2REVERB:
errCode = ((IDirectSoundFXI3DL2Reverb8 *)effect)->SetAllParameters( (DSFXI3DL2Reverb *)_params );
errCode = ((IDirectSoundFXI3DL2Reverb8 *)effect)->SetQuality( _params[12] );
break;
default:
AppReleaseAssert( false, "Unknown filter type" );
}
SOUNDASSERT( errCode, "Failed to set filter parameters" );
}
else
{
AppDebugAssert(channel->m_dspFX[_filterType].m_userFilter);
channel->m_dspFX[_filterType].m_userFilter->SetParameters( _params );
}
}