本文整理汇总了C++中SoundEntry::getTime方法的典型用法代码示例。如果您正苦于以下问题:C++ SoundEntry::getTime方法的具体用法?C++ SoundEntry::getTime怎么用?C++ SoundEntry::getTime使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类SoundEntry
的用法示例。
在下文中一共展示了SoundEntry::getTime方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: updateQueue
void SoundQueue::updateQueue() {
if (getAmbientState() & kAmbientSoundEnabled) {
SoundEntry *entry = getEntry(kSoundTagAmbient);
if (!entry || getFlags()->flag_3 || (entry && entry->getTime() > getSound()->getAmbientSoundDuration())) {
getSound()->playAmbientSound(0x45);
} else {
if (getSound()->needToChangeAmbientVolume()) {
entry->setVolumeSmoothly(getSound()->getChangedAmbientVolume());
getSound()->clearAmbientVolumeChange();
}
}
}
for (Common::List<SoundEntry *>::iterator it = _soundList.begin(); it != _soundList.end(); ++it) {
SoundEntry *entry = *it;
if (entry == NULL)
error("[SoundQueue::updateQueue] Invalid entry found in sound queue");
// Original removes the entry data from the cache and sets the archive as not loaded
// and if the sound data buffer is not full, loads a new entry to be played based on
// its priority and volume
if (!entry->update() && !(entry->getStatus() & kSoundFlagKeepAfterFinish)) {
entry->close();
SAFE_DELETE(entry);
it = _soundList.reverse_erase(it);
}
}
// Original update the current entry, loading another set of samples to be decoded
getFlags()->flag_3 = false;
}
示例2: getEntryTime
uint32 SoundQueue::getEntryTime(EntityIndex index) {
SoundEntry *entry = getEntry(index);
if (entry)
return entry->getTime();
return 0;
}
示例3: getEntryTime
uint32 SoundQueue::getEntryTime(EntityIndex index) {
Common::StackLock locker(_mutex);
SoundEntry *entry = getEntry(index);
if (entry)
return entry->getTime();
return 0;
}
示例4: updateSubtitles
//////////////////////////////////////////////////////////////////////////
// Subtitles
//////////////////////////////////////////////////////////////////////////
void SoundQueue::updateSubtitles() {
Common::StackLock locker(_mutex);
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();
SoundStatus status = (SoundStatus)soundEntry->getStatus().status;
if (!(status & kSoundStatus_40)
|| status & kSoundStatus_180
|| soundEntry->getTime() == 0
|| (status & kSoundStatusFilter) < 6
|| ((getFlags()->nis & 0x8000) && soundEntry->getPriority() < 90)) {
current_index = 0;
} else {
current_index = soundEntry->getPriority() + (status & kSoundStatusFilter);
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: 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();
}
示例6: updateQueue
void SoundQueue::updateQueue() {
Common::StackLock locker(_mutex);
++_flag;
if (getSoundState() & kSoundState1) {
SoundEntry *entry = getEntry(kSoundType1);
if (!entry || getFlags()->flag_3 || (entry && entry->getTime() > getSound()->getLoopingSoundDuration())) {
getSound()->playLoopingSound(0x45);
} else {
if (getSound()->getData1() && getSound()->getData2() >= getSound()->getData1()) {
entry->update(getSound()->getData0());
getSound()->setData1(0);
}
}
}
for (Common::List<SoundEntry *>::iterator it = _soundList.begin(); it != _soundList.end(); ++it) {
SoundEntry *entry = *it;
// Original removes the entry data from the cache and sets the archive as not loaded
// and if the sound data buffer is not full, loads a new entry to be played based on
// its priority and filter id
if (!entry->updateSound() && !(entry->getStatus().status3 & 0x8)) {
entry->close();
SAFE_DELETE(entry);
it = _soundList.reverse_erase(it);
}
}
// Original update the current entry, loading another set of samples to be decoded
getFlags()->flag_3 = false;
--_flag;
}