当前位置: 首页>>代码示例>>C++>>正文


C++ IDirectSoundBuffer8::GetObjectInPath方法代码示例

本文整理汇总了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 );
    }
}
开发者ID:gene9,项目名称:Darwinia-and-Multiwinia-Source-Code,代码行数:65,代码来源:sound_library_3d_dsound.cpp


注:本文中的IDirectSoundBuffer8::GetObjectInPath方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。