本文整理汇总了C++中Video::getChannelTitle方法的典型用法代码示例。如果您正苦于以下问题:C++ Video::getChannelTitle方法的具体用法?C++ Video::getChannelTitle怎么用?C++ Video::getChannelTitle使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Video
的用法示例。
在下文中一共展示了Video::getChannelTitle方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: toggleSubscription
void MediaView::toggleSubscription() {
Video *video = playlistModel->activeVideo();
if (!video) return;
QString userId = video->getChannelId();
if (userId.isEmpty()) return;
bool subscribed = YTChannel::isSubscribed(userId);
if (subscribed) {
YTChannel::unsubscribe(userId);
MainWindow::instance()->showMessage(
tr("Unsubscribed from %1").arg(video->getChannelTitle()));
} else {
YTChannel::subscribe(userId);
MainWindow::instance()->showMessage(tr("Subscribed to %1").arg(video->getChannelTitle()));
}
updateSubscriptionAction(video, !subscribed);
}
示例2: gotStreamUrl
void MediaView::gotStreamUrl(const QString &streamUrl, const QString &audioUrl) {
if (stopped) return;
if (streamUrl.isEmpty()) {
qWarning() << "Empty stream url";
skip();
return;
}
Video *video = static_cast<Video *>(sender());
if (!video) {
qDebug() << "Cannot get sender in" << __PRETTY_FUNCTION__;
return;
}
video->disconnect(this);
currentVideoId = video->getId();
if (audioUrl.isEmpty()) {
qDebug() << "Playing" << streamUrl;
media->play(streamUrl);
} else {
qDebug() << "Playing" << streamUrl << audioUrl;
media->playSeparateAudioAndVideo(streamUrl, audioUrl);
}
// ensure we always have videos ahead
playlistModel->searchNeeded();
// ensure active item is visible
int row = playlistModel->activeRow();
if (row != -1) {
QModelIndex index = playlistModel->index(row, 0, QModelIndex());
playlistView->scrollTo(index, QAbstractItemView::EnsureVisible);
}
#ifdef APP_ACTIVATION
if (!Activation::instance().isActivated() && !demoTimer->isActive()) {
int ms = (60000 * 5) + (qrand() % (60000 * 5));
demoTimer->start(ms);
}
#endif
#ifdef APP_EXTRA
Extra::notify(video->getTitle(), video->getChannelTitle(), video->getFormattedDuration());
#endif
ChannelAggregator::instance()->videoWatched(video);
}