本文整理汇总了C++中CAudio::Available方法的典型用法代码示例。如果您正苦于以下问题:C++ CAudio::Available方法的具体用法?C++ CAudio::Available怎么用?C++ CAudio::Available使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CAudio
的用法示例。
在下文中一共展示了CAudio::Available方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: Stop
void CAudioChannel::Stop (void)
{
m_info.bPlaying = 0;
m_info.nSoundObj = -1;
m_info.bPersistent = 0;
#if USE_OPENAL
if (gameOpts->sound.bUseOpenAL) {
if (m_info.source != 0xFFFFFFFF)
alSourceStop (m_info.source);
}
#endif
#if USE_SDL_MIXER
if (audio.Available () && gameOpts->sound.bUseSDLMixer) {
if (m_info.mixChunkP) {
Mix_HaltChannel (m_info.nChannel);
if (m_info.bBuiltIn)
m_info.bBuiltIn = 0;
else
Mix_FreeChunk (m_info.mixChunkP);
m_info.mixChunkP = NULL;
}
//Mix_FadeOutChannel (nChannel, 500);
}
#endif
if (m_info.bResampled) {
m_info.sample.Destroy ();
m_info.bResampled = 0;
}
}
示例2: MixCallback
//changed on 980905 by adb to cleanup, add nPan support and optimize mixer
void _CDECL_ CAudio::MixCallback (void* userdata, Uint8* stream, int len)
{
if (!audio.Available ())
return;
memset (stream, 0x80, len); // fix "static" sound bug on Mac OS X
CAudioChannel* channelP = audio.m_channels.Buffer ();
for (int i = audio.MaxChannels (); i; i--, channelP++)
channelP->Mix (reinterpret_cast<ubyte*> (stream), len);
}
示例3: Mix_VolPan
void Mix_VolPan (int nChannel, int nVolume, int nPan)
{
#if USE_SDL_MIXER
if (!audio.Available ())
return;
if (gameOpts->sound.bUseSDLMixer && (nChannel >= 0)) {
if (nVolume) {
nVolume = (FixMul (nVolume, audio.Volume ()) + (SOUND_MAX_VOLUME / MIX_MAX_VOLUME) / 2) / (SOUND_MAX_VOLUME / MIX_MAX_VOLUME);
if (!nVolume)
nVolume = 1;
Mix_Volume (nChannel, nVolume);
if (nPan >= 0) {
nPan /= (32767 / 127);
Mix_SetPanning (nChannel, (ubyte) nPan, (ubyte) (254 - nPan));
}
}
}
#endif
}