diff options
author | ZackaryWelch <welch.zackary@gmail.com> | 2017-10-11 20:51:56 -0400 |
---|---|---|
committer | ZackaryWelch <welch.zackary@gmail.com> | 2017-10-11 20:51:56 -0400 |
commit | f649d4976e64cfdf9b32022d55bfd08f39d00a8f (patch) | |
tree | 0678b4028230aaab341ad9d1cf6976b89931cffb /src-qt5/desktop-utils | |
parent | Update lumina-checkpass with 2 additional options: (diff) | |
download | lumina-f649d4976e64cfdf9b32022d55bfd08f39d00a8f.tar.gz lumina-f649d4976e64cfdf9b32022d55bfd08f39d00a8f.tar.bz2 lumina-f649d4976e64cfdf9b32022d55bfd08f39d00a8f.zip |
Added framework to play video when the mouse is put over them. Breaks
picture and video preview for lumina-fileinfo currently
Diffstat (limited to 'src-qt5/desktop-utils')
-rw-r--r-- | src-qt5/desktop-utils/lumina-fileinfo/MainUI.cpp | 39 | ||||
-rw-r--r-- | src-qt5/desktop-utils/lumina-fileinfo/MainUI.h | 3 | ||||
-rw-r--r-- | src-qt5/desktop-utils/lumina-fileinfo/lumina-fileinfo.pro | 2 |
3 files changed, 5 insertions, 39 deletions
diff --git a/src-qt5/desktop-utils/lumina-fileinfo/MainUI.cpp b/src-qt5/desktop-utils/lumina-fileinfo/MainUI.cpp index 0fb736d3..4ec8fae7 100644 --- a/src-qt5/desktop-utils/lumina-fileinfo/MainUI.cpp +++ b/src-qt5/desktop-utils/lumina-fileinfo/MainUI.cpp @@ -23,20 +23,11 @@ MainUI::MainUI() : QDialog(), ui(new Ui::MainUI){ terminate_thread = false; UpdateIcons(); //Set all the icons in the dialog 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))); - connect(surface, SIGNAL(frameReceived(QPixmap)), this, SLOT(stopVideo(QPixmap))); INFO = 0; } MainUI::~MainUI(){ terminate_thread = true; - surface->deleteLater(); - player->deleteLater(); this->close(); } @@ -91,20 +82,10 @@ void MainUI::LoadFile(QString path, QString type){ ui->label_file_type->setText(ftype); //Now load the icon for the file if(INFO->isImage()){ - //qDebug() << "Set Image:"; - QPixmap pix(INFO->absoluteFilePath()); - ui->label_file_icon->setPixmap( pix.scaledToHeight(64) ); - ui->label_file_size->setText( ui->label_file_size->text()+" ("+QString::number(pix.width())+" x "+QString::number(pix.height())+" px)" ); - //qDebug() << " - done with image"; + ui->label_file_icon = new LVideoLabel(INFO->absoluteFilePath(), false); + //ui->label_file_size->setText( ui->label_file_size->text()+" ("+QString::number(pix.width())+" x "+QString::number(pix.height())+" px)" ); }else if(INFO->isVideo()){ - 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 + ui->label_file_icon = new LVideoLabel(INFO->absoluteFilePath(), true); }else{ ui->label_file_icon->setPixmap( LXDG::findIcon( INFO->iconfile(), "unknown").pixmap(QSize(64,64)) ); } @@ -315,20 +296,6 @@ void MainUI::getXdgCommand(QString prev){ xdgvaluechanged(); } -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) { - if(status == QMediaPlayer::BufferedMedia) { - player->setPosition(player->duration() / 2); - player->play(); - } -} - void MainUI::on_tool_xdg_getDir_clicked(){ //Find a directory QString dir = ui->line_xdg_wdir->text(); diff --git a/src-qt5/desktop-utils/lumina-fileinfo/MainUI.h b/src-qt5/desktop-utils/lumina-fileinfo/MainUI.h index 3bc85aae..8cac813c 100644 --- a/src-qt5/desktop-utils/lumina-fileinfo/MainUI.h +++ b/src-qt5/desktop-utils/lumina-fileinfo/MainUI.h @@ -17,6 +17,7 @@ #include <QMediaPlayer> #include <LuminaXDG.h> #include <LVideoSurface.h> +#include <LVideoLabel.h> #include <QElapsedTimer> namespace Ui{ class MainUI; @@ -56,8 +57,6 @@ private slots: //UI Buttons void on_push_close_clicked(); void on_push_save_clicked(); - void stopVideo(QPixmap); - void setDuration(QMediaPlayer::MediaStatus); void getXdgCommand(QString prev = ""); //void on_tool_xdg_getCommand_clicked(QString prev = ""); void on_tool_xdg_getDir_clicked(); diff --git a/src-qt5/desktop-utils/lumina-fileinfo/lumina-fileinfo.pro b/src-qt5/desktop-utils/lumina-fileinfo/lumina-fileinfo.pro index b53d8cba..14345f50 100644 --- a/src-qt5/desktop-utils/lumina-fileinfo/lumina-fileinfo.pro +++ b/src-qt5/desktop-utils/lumina-fileinfo/lumina-fileinfo.pro @@ -13,7 +13,7 @@ target.path = $${L_BINDIR} include(../../core/libLumina/LUtils.pri) #includes LUtils include(../../core/libLumina/LuminaXDG.pri) #include(../../core/libLumina/LuminaSingleApplication.pri) -include(../../core/libLumina/LVideoSurface.pri) +include(../../core/libLumina/LVideoLabel.pri) include(../../core/libLumina/LuminaThemes.pri) SOURCES += main.cpp\ |