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


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

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


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

示例1: 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

示例2: FindVoicePlayingEffect

      //
      // FindVoicePlayingEffect
      //
      // Returns the first voice playing 'e', or NULL
      //
      static Voice * FindVoicePlayingEffect(Effect *e)
      {
        // Ensure index is valid
        if (e->GetVoiceIndex() < totalVoices)
        {
          // Get the voice at this index
          Voice *v = voices[e->GetVoiceIndex()];

          // Still playing and pointing to the given effect
          if ((v->Status() != SMP_DONE) && v->effect.Alive() && (v->effect == e))
          {
            return (v);
          }
        }

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

示例3: RecordInUse

      //
      // RecordInUse
      //
      // TRUE if 'record' is currently being used by a voice
      //
      Bool RecordInUse(Record *record)
      {
        if (Initialized())
        {
          // Try and find a voice that is using the record
          for (U32 i = 0; i < totalVoices; i++)
          {
            // Get the voice at this index
            Voice *voice = voices[i];

            if (voice->Status() != SMP_DONE && voice->record == record)
            {
              return (TRUE);
            }
          }
        }

        return (FALSE);
      }
开发者ID:grasmanek94,项目名称:darkreign2,代码行数:24,代码来源: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::Status方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。