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


C++ ISound::IsInitialized方法代码示例

本文整理汇总了C++中ISound::IsInitialized方法的典型用法代码示例。如果您正苦于以下问题:C++ ISound::IsInitialized方法的具体用法?C++ ISound::IsInitialized怎么用?C++ ISound::IsInitialized使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在ISound的用法示例。


在下文中一共展示了ISound::IsInitialized方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1:

    ISound* CCE3SoundWrapper::GetPreferredSound()
    {
        // Return last preferred sound if he is still consistent, else search a new one
        ISound* pPreferredSound = NULL;
        ISound* pFallbackSound = NULL; // better then nothing...

        // last preferred source still there?
        if ( gEnv && gEnv->pSoundSystem )
        {
            pPreferredSound = gEnv->pSoundSystem->GetSound( m_nPreferredDataSource );
        }

        // is his playback state still consistent?
        if ( pPreferredSound && pPreferredSound->IsLoaded() && pPreferredSound->IsInitialized() && PLAYSTATE_CONSISTENT( pPreferredSound ) )
        {
            goto success;
        }

        // If not the check the 2d sound
        if ( Is2DSoundActive() && PLAYSTATE_CONSISTENT( m_p2DSound ) )
        {
            m_nPreferredDataSource = m_p2DSound->GetId();
            pPreferredSound = m_p2DSound;
            goto success;
        }

        pFallbackSound = m_p2DSound; // better then nothing...

        // Or one from the proxies
        for ( tEntitySoundProxyMap::iterator iterSound = m_SoundProxies.begin(); iterSound != m_SoundProxies.end(); ++iterSound )
        {
            if ( iterSound->second.IsActive() && PLAYSTATE_CONSISTENT( iterSound->second.GetSound() ) )
            {
                pPreferredSound = iterSound->second.GetSound();
                m_nPreferredDataSource = pPreferredSound->GetId();

                goto success;
            }

            // better then nothing...
            if ( !pFallbackSound && iterSound->second.IsExisting() )
            {
                pFallbackSound = iterSound->second.GetSound();
            }
        }

        // if nothing reliable was found
        m_nPreferredDataSource = INVALID_SOUNDID;

        if ( pFallbackSound )
        {
            return pFallbackSound;
        }

        return NULL;
success:
        // RefreshMaxDuration( pPreferredSound );
        return pPreferredSound;
    }
开发者ID:Aboutdept,项目名称:Plugin_Videoplayer,代码行数:59,代码来源:CCE3SoundWrapper.cpp


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