本文整理汇总了C++中Mod::getSound方法的典型用法代码示例。如果您正苦于以下问题:C++ Mod::getSound方法的具体用法?C++ Mod::getSound怎么用?C++ Mod::getSound使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Mod
的用法示例。
在下文中一共展示了Mod::getSound方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: operator
void operator()()
{
while (_flcPlayer->getFrameCount() >= introSoundTrack[trackPosition].frameNumber)
{
int command = introSoundTrack[trackPosition].sound;
if (command & 0x200)
{
#ifndef __NO_MUSIC
switch(command)
{
case 0x200:
Log(LOG_DEBUG) << "Playing gmintro1";
m = mod->getMusic("GMINTRO1");
m->play(1);
break;
case 0x201:
Log(LOG_DEBUG) << "Playing gmintro2";
m = mod->getMusic("GMINTRO2");
m->play(1);
break;
case 0x202:
Log(LOG_DEBUG) << "Playing gmintro3";
m = mod->getMusic("GMINTRO3");
m->play(1);
//Mix_HookMusicFinished(_FlcPlayer::stop);
break;
}
#endif
}
else if (command & 0x400)
{
int newSpeed = (command & 0xff);
_flcPlayer->setHeaderSpeed(newSpeed);
Log(LOG_DEBUG) << "Frame delay now: " << newSpeed;
}
else if (command <= 0x19)
{
for (soundInFile **sounds = introSounds; *sounds; ++sounds) // try hybrid sound set, then intro.cat or sample3.cat alone
{
soundInFile *sf = (*sounds) + command;
int channel = trackPosition % 4; // use at most four channels to play sound effects
double ratio = (double)Options::soundVolume / MIX_MAX_VOLUME;
Log(LOG_DEBUG) << "playing: " << sf->catFile << ":" << sf->sound << " for index " << command;
s = mod->getSound(sf->catFile, sf->sound, false);
if (s)
{
s->play(channel);
Mix_Volume(channel, sf->volume * ratio);
break;
}
else Log(LOG_DEBUG) << "Couldn't play " << sf->catFile << ":" << sf->sound;
}
}
++trackPosition;
}
}