本文整理汇总了C++中SoundChannel::SetVolume方法的典型用法代码示例。如果您正苦于以下问题:C++ SoundChannel::SetVolume方法的具体用法?C++ SoundChannel::SetVolume怎么用?C++ SoundChannel::SetVolume使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类SoundChannel
的用法示例。
在下文中一共展示了SoundChannel::SetVolume方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: SoundInstance
SoundInstance * Sound::Play()
{
if(TYPE_STREAMED == type && soundInstances.size())
{
return soundInstances.front();
}
SoundChannel * ch = SoundSystem::Instance()->FindChannel(priority);
if(!ch)
{
return 0;
}
if(TYPE_STREAMED == type)
{
provider->Init();
provider->Rewind();
PrepareDynamicBuffers();
}
SoundInstance * inst = new SoundInstance();
inst->buddyChannel = ch;
AddSoundInstance(inst);
ch->SetVolume(volume);
ch->Play(this, looping);
return inst;
}
示例2: DVASSERT
SoundInstance * Sound::Play()
{
#ifdef __DAVAENGINE_ANDROID__
SLresult result;
if(TYPE_STATIC == type)
{
result = (*playerBufferQueue)->Clear(playerBufferQueue);
DVASSERT(SL_RESULT_SUCCESS == result);
buffer->FullFill(provider, playerBufferQueue);
}
if(TYPE_STREAMED == type)
{
result = (*playerSeek)->SetPosition(playerSeek, 0, SL_SEEKMODE_FAST);
DVASSERT(SL_RESULT_SUCCESS == result);
}
result = (*playerPlay)->SetPlayState(playerPlay, SL_PLAYSTATE_PLAYING);
DVASSERT(SL_RESULT_SUCCESS == result);
soundInstances.clear();
SoundInstance * inst = new SoundInstance(this);
AddSoundInstance(inst);
return soundInstances.front();
#else
if(TYPE_STREAMED == type && soundInstances.size())
{
return soundInstances.front();
}
SoundChannel * ch = SoundSystem::Instance()->FindChannel(priority);
if(!ch)
{
return 0;
}
if(TYPE_STREAMED == type)
{
PrepareDynamicBuffers();
}
SoundInstance * inst = new SoundInstance();
inst->buddyChannel = ch;
AddSoundInstance(inst);
ch->SetVolume(volume);
ch->Play(this, looping);
return inst;
#endif //#ifdef __DAVAENGINE_ANDROID__
}