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