当前位置: 首页>>代码示例>>C++>>正文


C++ SoundEntry::getStatus方法代码示例

本文整理汇总了C++中SoundEntry::getStatus方法的典型用法代码示例。如果您正苦于以下问题:C++ SoundEntry::getStatus方法的具体用法?C++ SoundEntry::getStatus怎么用?C++ SoundEntry::getStatus使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在SoundEntry的用法示例。


在下文中一共展示了SoundEntry::getStatus方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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;
}
开发者ID:BenCastricum,项目名称:scummvm,代码行数:33,代码来源:queue.cpp

示例2: 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();
}
开发者ID:singron,项目名称:scummvm,代码行数:49,代码来源:queue.cpp

示例3: 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();
}
开发者ID:BenCastricum,项目名称:scummvm,代码行数:47,代码来源:queue.cpp

示例4: 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;
}
开发者ID:singron,项目名称:scummvm,代码行数:37,代码来源:queue.cpp


注:本文中的SoundEntry::getStatus方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。