本文整理汇总了C++中SoundEntry类的典型用法代码示例。如果您正苦于以下问题:C++ SoundEntry类的具体用法?C++ SoundEntry怎么用?C++ SoundEntry使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了SoundEntry类的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: getEntry
void SoundQueue::fade(EntityIndex entity) {
SoundEntry *entry = getEntry(entity);
if (entry) {
entry->fade();
entry->setEntity(kEntityPlayer);
}
}
示例2: locker
void SoundQueue::removeFromQueue(EntityIndex entity) {
Common::StackLock locker(_mutex);
SoundEntry *entry = getEntry(entity);
if (entry)
entry->reset();
}
示例3: destroyAllSound
void SoundQueue::destroyAllSound() {
_flag |= 8;
for (Common::List<SoundEntry *>::iterator i = _soundList.begin(); i != _soundList.end(); ++i) {
SoundEntry *entry = (*i);
if (entry == NULL)
error("[SoundQueue::destroyAllSound] Invalid entry found in sound queue");
// Delete entry
entry->kill();
SAFE_DELETE(entry);
i = _soundList.reverse_erase(i);
}
updateSubtitles();
}
示例4: updateSubtitles
//////////////////////////////////////////////////////////////////////////
// Subtitles
//////////////////////////////////////////////////////////////////////////
void SoundQueue::updateSubtitles() {
uint32 index = 0;
SubtitleEntry *subtitle = NULL;
for (Common::List<SubtitleEntry *>::iterator i = _subtitles.begin(); i != _subtitles.end(); ++i) {
uint32 current_index = 0;
SoundEntry *soundEntry = (*i)->getSoundEntry();
SoundFlag status = (SoundFlag)soundEntry->getStatus();
if (!(status & kSoundFlagPlaying)
|| status & kSoundFlagMute
|| soundEntry->getTime() == 0
|| (status & kSoundVolumeMask) < kVolume6
|| ((getFlags()->nis & 0x8000) && soundEntry->getPriority() < 90)) {
current_index = 0;
} else {
current_index = soundEntry->getPriority() + (status & kSoundVolumeMask);
if (_currentSubtitle == (*i))
current_index += 4;
}
if (index < current_index) {
index = current_index;
subtitle = (*i);
}
}
if (_currentSubtitle == subtitle) {
if (subtitle)
subtitle->setupAndDraw();
return;
}
if (!subtitle)
return;
if (_subtitlesFlag & 1)
subtitle->drawOnScreen();
subtitle->loadData();
subtitle->setupAndDraw();
}
示例5: count
//////////////////////////////////////////////////////////////////////////
// Savegame
//////////////////////////////////////////////////////////////////////////
void SoundQueue::saveLoadWithSerializer(Common::Serializer &s) {
s.syncAsUint32LE(_ambientState);
s.syncAsUint32LE(_currentTag);
// Save or load each entry data
if (s.isSaving()) {
// Compute the number of entries to save
uint32 numEntries = count();
s.syncAsUint32LE(numEntries);
for (Common::List<SoundEntry *>::iterator i = _soundList.begin(); i != _soundList.end(); ++i)
if ((*i)->needSaving())
(*i)->saveLoadWithSerializer(s);
} else {
uint32 numEntries;
s.syncAsUint32LE(numEntries);
for (uint32 i = 0; i < numEntries; i++) {
SoundEntry* entry = new SoundEntry(_engine);
entry->saveLoadWithSerializer(s);
addToQueue(entry);
}
}
}