本文整理汇总了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();
}
}
}
}
示例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);
}
示例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);
}
示例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);
}