本文整理汇总了C++中Video::getTitle方法的典型用法代码示例。如果您正苦于以下问题:C++ Video::getTitle方法的具体用法?C++ Video::getTitle怎么用?C++ Video::getTitle使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Video
的用法示例。
在下文中一共展示了Video::getTitle方法的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: shareViaEmail
void MediaView::shareViaEmail() {
Video *video = playlistModel->activeVideo();
if (!video) return;
QUrl url("mailto:");
QUrlQuery q;
q.addQueryItem("subject", video->getTitle());
const QString body = video->getTitle() + "\n" + video->getWebpage() + "\n\n" +
tr("Sent from %1").arg(Constants::NAME) + "\n" + Constants::WEBSITE;
q.addQueryItem("body", body);
url.setQuery(q);
QDesktopServices::openUrl(url);
}
示例2: downloadVideo
void MediaView::downloadVideo() {
Video *video = playlistModel->activeVideo();
if (!video) return;
DownloadManager::instance()->addItem(video);
MainWindow::instance()->showActionsInStatusBar({MainWindow::instance()->getAction("downloads")},
true);
QString message = tr("Downloading %1").arg(video->getTitle());
MainWindow::instance()->showMessage(message);
}
示例3: shareViaFacebook
void MediaView::shareViaFacebook() {
Video *video = playlistModel->activeVideo();
if (!video) return;
QUrl url("https://www.facebook.com/sharer.php");
QUrlQuery q;
q.addQueryItem("t", video->getTitle());
q.addQueryItem("u", video->getWebpage());
url.setQuery(q);
QDesktopServices::openUrl(url);
}
示例4: appear
void MediaView::appear() {
MainWindow::instance()->showToolbar();
Video *currentVideo = playlistModel->activeVideo();
if (currentVideo) {
MainWindow::instance()->setWindowTitle(currentVideo->getTitle() + " - " + Constants::NAME);
}
playlistView->setFocus();
}
示例5: findVideoParts
void MediaView::findVideoParts() {
Video *video = playlistModel->activeVideo();
if (!video) return;
QString query = video->getTitle();
const QLatin1String optionalSpace("\\s*");
const QLatin1String staticCounterSeparators("[\\/\\-]");
const QString counterSeparators =
QLatin1String("( of | ") + tr("of", "Used in video parts, as in '2 of 3'") +
QLatin1String(" |") + staticCounterSeparators + QLatin1String(")");
// numbers from 1 to 15
const QLatin1String counterNumber("([1-9]|1[0-5])");
// query.remove(QRegExp(counterSeparators + optionalSpace + counterNumber));
query.remove(QRegExp(counterNumber + optionalSpace + counterSeparators + optionalSpace +
counterNumber));
query.remove(wordRE("pr?t\\.?" + optionalSpace + counterNumber));
query.remove(wordRE("ep\\.?" + optionalSpace + counterNumber));
query.remove(wordRE("part" + optionalSpace + counterNumber));
query.remove(wordRE("episode" + optionalSpace + counterNumber));
query.remove(wordRE(tr("part", "This is for video parts, as in 'Cool video - part 1'") +
optionalSpace + counterNumber));
query.remove(wordRE(tr("episode", "This is for video parts, as in 'Cool series - episode 1'") +
optionalSpace + counterNumber));
query.remove(QRegExp("[\\(\\)\\[\\]]"));
#define NUMBERS "one|two|three|four|five|six|seven|eight|nine|ten"
QRegExp englishNumberRE = QRegExp(QLatin1String(".*(") + NUMBERS + ").*", Qt::CaseInsensitive);
// bool numberAsWords = englishNumberRE.exactMatch(query);
query.remove(englishNumberRE);
QRegExp localizedNumberRE =
QRegExp(QLatin1String(".*(") + tr(NUMBERS) + ").*", Qt::CaseInsensitive);
// if (!numberAsWords) numberAsWords = localizedNumberRE.exactMatch(query);
query.remove(localizedNumberRE);
SearchParams *searchParams = new SearchParams();
searchParams->setTransient(true);
searchParams->setKeywords(query);
searchParams->setChannelId(video->getChannelId());
/*
if (!numberAsWords) {
qDebug() << "We don't have number as words";
// searchParams->setSortBy(SearchParams::SortByNewest);
// TODO searchParams->setReverseOrder(true);
// TODO searchParams->setMax(50);
}
*/
search(searchParams);
}
示例6: shareViaTwitter
void MediaView::shareViaTwitter() {
Video *video = playlistModel->activeVideo();
if (!video) return;
QUrl url("https://twitter.com/intent/tweet");
QUrlQuery q;
q.addQueryItem("via", "minitubeapp");
q.addQueryItem("text", video->getTitle());
q.addQueryItem("url", video->getWebpage());
url.setQuery(q);
QDesktopServices::openUrl(url);
}
示例7: 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);
}
示例8: snapshot
void MediaView::snapshot() {
qint64 currentTime = media->position() / 1000;
QObject *context = new QObject();
connect(media, &Media::snapshotReady, context,
[this, currentTime, context](const QImage &image) {
context->deleteLater();
if (image.isNull()) {
qWarning() << "Null snapshot";
return;
}
QPixmap pixmap = QPixmap::fromImage(image.scaled(
videoWidget->size(), Qt::KeepAspectRatio, Qt::SmoothTransformation));
videoAreaWidget->showSnapshotPreview(pixmap);
Video *video = playlistModel->activeVideo();
if (!video) return;
QString location = SnapshotSettings::getCurrentLocation();
QDir dir(location);
if (!dir.exists()) dir.mkpath(location);
QString basename = video->getTitle();
QString format = video->getDuration() > 3600 ? "h_mm_ss" : "m_ss";
basename += " (" + QTime(0, 0, 0).addSecs(currentTime).toString(format) + ")";
basename = DataUtils::stringToFilename(basename);
QString filename = location + "/" + basename + ".png";
qDebug() << filename;
image.save(filename, "PNG");
if (snapshotSettings) delete snapshotSettings;
snapshotSettings = new SnapshotSettings(videoWidget);
snapshotSettings->setSnapshot(pixmap, filename);
QStatusBar *statusBar = MainWindow::instance()->statusBar();
#ifdef APP_EXTRA
Extra::fadeInWidget(statusBar, statusBar);
#endif
statusBar->insertPermanentWidget(0, snapshotSettings);
snapshotSettings->show();
MainWindow::instance()->setStatusBarVisibility(true);
}
#endif
);
media->snapshot();
}
示例9: checkOut
bool Customer::checkOut(Video video)
{
for(int i = 0; i < 15; i++)
{
if(videosRented[i].getTitle() == video.getTitle())
{
cout << "Customer already has that video." << endl;
return false;
}
}
for(int i = 0; i < 15; i++)
{
if(videosRented[i].getTitle() == "")
{
videosRented[i] = video;
return true;
}
}
cout << "Customer has 15 videos and cannot rent anymore." << endl;
return false;
}