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


C++ History::channelId方法代码示例

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


在下文中一共展示了History::channelId方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: nextPressed

void PlayerWidget::nextPressed() {
	if (isHidden()) return;

	History *history = _msgmigrated ? _migrated : _history;
	const History::MediaOverview *o = history ? &history->overview[OverviewAudioDocuments] : 0;
	if (audioPlayer() && o && _index >= 0 && _index < o->size() - 1) {
		startPlay(FullMsgId(history->channelId(), o->at(_index + 1)));
	} else if (o && (_index == o->size() - 1) && _msgmigrated && _history->overviewLoaded(OverviewAudioDocuments)) {
		o = &_history->overview[OverviewAudioDocuments];
		if (!o->isEmpty()) {
			startPlay(FullMsgId(_history->channelId(), o->at(0)));
		}
	}
}
开发者ID:MobinRanjbar,项目名称:tdesktop,代码行数:14,代码来源:playerwidget.cpp

示例2: prevPressed

void PlayerWidget::prevPressed() {
	if (isHidden()) return;

	History *history = _msgmigrated ? _migrated : _history;
	const History::MediaOverview *o = history ? &history->overview[OverviewAudioDocuments] : 0;
	if (audioPlayer() && o && _index > 0 && _index <= o->size() && !o->isEmpty()) {
		startPlay(FullMsgId(history->channelId(), o->at(_index - 1)));
	} else if (!_index && _history && _migrated && !_msgmigrated) {
		o = &_migrated->overview[OverviewAudioDocuments];
		if (!o->isEmpty()) {
			startPlay(FullMsgId(_migrated->channelId(), o->at(o->size() - 1)));
		}
	}
}
开发者ID:MobinRanjbar,项目名称:tdesktop,代码行数:14,代码来源:playerwidget.cpp

示例3: mediaOverviewUpdated

void PlayerWidget::mediaOverviewUpdated(PeerData *peer, MediaOverviewType type) {
	if (_history && (_history->peer == peer || (_migrated && _migrated->peer == peer)) && type == OverviewAudioDocuments) {
		_index = -1;
		History *history = _msgmigrated ? _migrated : _history;
		if (history->channelId() == _song.msgId.channel) {
			for (int i = 0, l = history->overview[OverviewAudioDocuments].size(); i < l; ++i) {
				if (history->overview[OverviewAudioDocuments].at(i) == _song.msgId.msg) {
					_index = i;
					preloadNext();
					break;
				}
			}
		}
		updateControls();
	}
}
开发者ID:MobinRanjbar,项目名称:tdesktop,代码行数:16,代码来源:playerwidget.cpp

示例4: preloadNext

void PlayerWidget::preloadNext() {
	if (_index < 0) return;

	History *history = _msgmigrated ? _migrated : _history;
	const History::MediaOverview *o = &history->overview[OverviewAudioDocuments];
	HistoryItem *next = 0;
	if (_index < o->size() - 1) {
		next = App::histItemById(history->channelId(), o->at(_index + 1));
	} else if (_msgmigrated && _index == o->size() - 1 && _history->overviewLoaded(OverviewAudioDocuments) && _history->overviewCount(OverviewAudioDocuments) > 0) {
		next = App::histItemById(_history->channelId(), _history->overview[OverviewAudioDocuments].at(0));
	} else if (_msgmigrated && _index == o->size() - 1 && !_history->overviewCountLoaded(OverviewAudioDocuments)) {
		if (App::main()) App::main()->preloadOverview(_history->peer, OverviewAudioDocuments);
	}
	if (next) {
		if (HistoryDocument *document = static_cast<HistoryDocument*>(next->getMedia())) {
			DocumentData *d = document->getDocument();
			if (!d->loaded(true)) {
				DocumentOpenLink::doOpen(d, ActionOnLoadNone);
			}
		}
	}
}
开发者ID:MobinRanjbar,项目名称:tdesktop,代码行数:22,代码来源:playerwidget.cpp


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