aboutsummaryrefslogtreecommitdiff
path: root/src-qt5/desktop-utils/lumina-fileinfo/MainUI.cpp
diff options
context:
space:
mode:
authorZackaryWelch <welch.zackary@gmail.com>2017-10-05 17:06:58 -0400
committerZackaryWelch <welch.zackary@gmail.com>2017-10-05 17:06:58 -0400
commit79fbc99707377264761434b44147281457189691 (patch)
treef6e11cbd1f58f1e3f84fc80ddae4782af8b24797 /src-qt5/desktop-utils/lumina-fileinfo/MainUI.cpp
parentMerge branch 'master' of github.com:trueos/lumina (diff)
downloadlumina-79fbc99707377264761434b44147281457189691.tar.gz
lumina-79fbc99707377264761434b44147281457189691.tar.bz2
lumina-79fbc99707377264761434b44147281457189691.zip
Finished video thumnails for lumina-fm and lumina-fileinfo
Diffstat (limited to 'src-qt5/desktop-utils/lumina-fileinfo/MainUI.cpp')
-rw-r--r--src-qt5/desktop-utils/lumina-fileinfo/MainUI.cpp9
1 files changed, 8 insertions, 1 deletions
diff --git a/src-qt5/desktop-utils/lumina-fileinfo/MainUI.cpp b/src-qt5/desktop-utils/lumina-fileinfo/MainUI.cpp
index 40d2d544..0fb736d3 100644
--- a/src-qt5/desktop-utils/lumina-fileinfo/MainUI.cpp
+++ b/src-qt5/desktop-utils/lumina-fileinfo/MainUI.cpp
@@ -25,6 +25,7 @@ MainUI::MainUI() : QDialog(), ui(new Ui::MainUI){
SetupConnections();
player = new QMediaPlayer(this, QMediaPlayer::VideoSurface);
surface = new LVideoSurface(this);
+ qDebug() << surface->surfaceFormat();
player->setVideoOutput(surface);
player->setMuted(true);
connect(player, SIGNAL(mediaStatusChanged(QMediaPlayer::MediaStatus)), this, SLOT(setDuration(QMediaPlayer::MediaStatus)));
@@ -96,7 +97,11 @@ void MainUI::LoadFile(QString path, QString type){
ui->label_file_size->setText( ui->label_file_size->text()+" ("+QString::number(pix.width())+" x "+QString::number(pix.height())+" px)" );
//qDebug() << " - done with image";
}else if(INFO->isVideo()){
- player->setMedia(QUrl("file://"+INFO->absoluteFilePath()));
+ timer.start();
+ QMediaResource video = QMediaResource(QUrl("file://"+INFO->absoluteFilePath()));
+ video.setResolution(64,64);
+ player->setMedia(video);
+ //player->setMedia(QUrl("file://"+INFO->absoluteFilePath()));
player->play();
player->pause();
//Pixmap set when video is loaded in stopVideo
@@ -313,6 +318,8 @@ void MainUI::getXdgCommand(QString prev){
void MainUI::stopVideo(QPixmap img) {
ui->label_file_icon->setPixmap( img.scaledToHeight(64) );
player->pause();
+ qDebug() << timer.elapsed();
+ qDebug() << player->media().canonicalResource().resolution();
}
void MainUI::setDuration(QMediaPlayer::MediaStatus status) {
bgstack15