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


C++ Voice::Stop方法代码示例

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


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

示例1: StopByOwner

      //
      // StopByOwner
      //
      // Stop all voices with the given owner id
      //
      void StopByOwner(U32 id)
      {
        if (Initialized())
        {
          for (U32 i = 0; i < totalVoices; i++)
          {
            // Get the voice at this index
            Voice *voice = voices[i];

            if (voice->owner == id)
            {
              voice->Stop();
            }
          }
        }
      }
开发者ID:grasmanek94,项目名称:darkreign2,代码行数:21,代码来源:sound_digital_output.cpp

示例2: StopByRecord

      //
      // StopByRecord
      //
      // Stop all voices playing the given record
      //
      void StopByRecord(Record *r)
      {
        if (Initialized())
        {
          for (U32 i = 0; i < totalVoices; i++)
          {
            // Get the voice at this index
            Voice *voice = voices[i];

            if ((voice->Status() != SMP_DONE) && (voice->record == r))
            {
              voice->Stop();
            }
          }
        }
      }
开发者ID:grasmanek94,项目名称:darkreign2,代码行数:21,代码来源:sound_digital_output.cpp

示例3: StopByEffect

      //
      // StopByEffect
      //
      // Stop all voices played using the given effect
      //
      void StopByEffect(Effect *e)
      {
        if (Initialized())
        {
          for (U32 i = 0; i < totalVoices; i++)
          {
            // Get the voice at this index
            Voice *voice = voices[i];

            // Effect is still alive and matches the one supplied
            if (voice->effect.Alive() && voice->effect == e)
            {
              voice->Stop();
            }
          }        
        }
      }
开发者ID:grasmanek94,项目名称:darkreign2,代码行数:22,代码来源:sound_digital_output.cpp

示例4: Request

      //
      // Request
      //
      // Request the use of a voice
      //
      static Voice * Request(F32 priority, Bool flag3D, U8 &index)
      {
        ASSERT(Initialized());

        // Try and find a voice that is currently free
		U32 i = 0;
        for (; i < totalVoices; i++)
        {
          // Get the voice at this index
          Voice *voice = voices[i];

          // Correct type and available for use
          if ((voice->flag3D == flag3D) && (voice->Status() == SMP_DONE))
          {
            index = (U8)i;
            return (voice);
          }
        }
 
        // Try and free a voice using the priority system
        for (i = 0; i < totalVoices; i++)
        {
          // Get the voice at this index
          Voice *voice = voices[i];

          // Correct type and lower priority
          if ((voice->flag3D == flag3D) && (voice->priority < priority))
          {
            index = (U8)i;
            voice->Stop();
            return (voice);
          }
        }

        return (NULL);     
      }
开发者ID:grasmanek94,项目名称:darkreign2,代码行数:41,代码来源:sound_digital_output.cpp


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