diff options
author | Arno <arno@disconnect.de> | 2022-04-15 13:29:18 +0200 |
---|---|---|
committer | Arno <arno@disconnect.de> | 2022-04-15 13:29:18 +0200 |
commit | 40f305210fac074196f07620f6f4c67db2ee0667 (patch) | |
tree | a51ae1444596d973d206ae9fd919314652fa5743 | |
parent | 856119c5a43b4781b051b93a0713c152cfd99f85 (diff) | |
download | SheMov-40f305210fac074196f07620f6f4c67db2ee0667.tar.gz SheMov-40f305210fac074196f07620f6f4c67db2ee0667.tar.bz2 SheMov-40f305210fac074196f07620f6f4c67db2ee0667.zip |
Delete videoviewer files
I guess it was bitrotten anyway...
-rw-r--r-- | videoviewer.cpp | 104 | ||||
-rw-r--r-- | videoviewer.h | 35 |
2 files changed, 0 insertions, 139 deletions
diff --git a/videoviewer.cpp b/videoviewer.cpp deleted file mode 100644 index 47646c0..0000000 --- a/videoviewer.cpp +++ /dev/null @@ -1,104 +0,0 @@ -/* - This program is free software; you can redistribute it and/or - modify it under the terms of the GNU General Public License - as published by the Free Software Foundation; either version - 2 of the License, or (at your option) any later version. -*/ - -#include <QMediaPlayer> -//#include <QMediaPlaylist> -#include <QKeyEvent> -#include <QCloseEvent> -#include <QSettings> -#include <QApplication> -//#include <QDesktopWidget> - -#include "videoviewer.h" -#include "smglobals.h" - -VideoViewer::VideoViewer(QWidget *parent) : QVideoWidget(parent) { - resize(1280,1024); - mPlayer = new QMediaPlayer(this); - mPlayer->setVideoOutput(this); - //QMediaPlaylist *playList = new QMediaPlaylist; - //mPlayer->setPlaylist(playList); - readSettings(); -} - -void VideoViewer::readSettings(){ - QSettings s; - QRect winSize = s.value("vw/size").toRect(); - setGeometry(winSize); - bool fullScreen = s.value("vw/fullscreen").toBool(); - setFullScreen(fullScreen); -} - -void VideoViewer::writeSettings(){ - QSettings s; - s.setValue("vw/size", geometry()); - s.setValue("vw/fullscreen", isFullScreen()); -} - -void VideoViewer::keyPressEvent(QKeyEvent *e){ - /*int keyNum = e->key(); - if(keyNum == Qt::Key_Q){ - player()->stop(); - setHidden(true); - }else if(keyNum == Qt::Key_F){ - bool fs = isFullScreen(); - mLastFullScreen = !fs; - setFullScreen(mLastFullScreen); - }else if(keyNum == Qt::Key_Right){ - mPlayer->setPosition(mPlayer->position() + 5000); - }else if(keyNum == Qt::Key_Left){ - qint64 pos = mPlayer->position(); - mPlayer->setPosition(pos - 5000 < 0 ? 0 : pos - 5000); - }else if(keyNum == Qt::Key_Up){ - mPlayer->setPosition(mPlayer->position() + 60000); - }else if(keyNum == Qt::Key_Down){ - qint64 pos = mPlayer->position(); - mPlayer->setPosition(pos - 60000 < 0 ? 0 : pos - 60000); - }else if(keyNum == Qt::Key_N){ - int mediaCount = mPlayer->playlist()->mediaCount(); - int nextIndex = mPlayer->playlist()->currentIndex() + 1; - if(nextIndex >= mediaCount){ - nextIndex = 0; - } - mPlayer->playlist()->setCurrentIndex(nextIndex); - }else if(keyNum == Qt::Key_P){ - int mediaCount = mPlayer->playlist()->mediaCount(); - int prevIndex = mPlayer->playlist()->currentIndex() - 1; - if(prevIndex < 0){ - prevIndex = mediaCount - 1; - } - mPlayer->playlist()->setCurrentIndex(prevIndex); - }else if(keyNum == Qt::Key_M){ - mPlayer->setMuted(mPlayer->isMuted() ? false : true); - }else if(keyNum == Qt::Key_Space){ - QMediaPlayer::State state = mPlayer->state(); - if(state == QMediaPlayer::PausedState){ - mPlayer->play(); - }else if(state == QMediaPlayer::PlayingState){ - mPlayer->pause(); - } - }else if(keyNum == Qt::Key_1){ - int curVol = mPlayer->volume() - 5; - if(curVol < 0){ - curVol = 0; - } - mPlayer->setVolume(curVol); - }else if(keyNum == Qt::Key_2){ - int curVol = mPlayer->volume() + 5; - if(curVol > 100){ - curVol = 100; - } - mPlayer->setVolume(curVol); - }*/ -} - -void VideoViewer::closeEvent(QCloseEvent *e){ - mPlayer->stop(); - writeSettings(); - hide(); - e->ignore(); -} diff --git a/videoviewer.h b/videoviewer.h deleted file mode 100644 index ff5bae6..0000000 --- a/videoviewer.h +++ /dev/null @@ -1,35 +0,0 @@ -/* - This program is free software; you can redistribute it and/or - modify it under the terms of the GNU General Public License - as published by the Free Software Foundation; either version - 2 of the License, or (at your option) any later version. -*/ - -#ifndef VIDEOVIEWER_H -#define VIDEOVIEWER_H - -#include <QVideoWidget> - -class QMediaPlayer; - -class VideoViewer : public QVideoWidget { - public: - VideoViewer(QWidget *parent = nullptr); - QMediaPlayer* player() { return mPlayer; } - bool lastFullScreen() { return mLastFullScreen; } - void setLastFullScreen(bool last) { mLastFullScreen = last; } - - public slots: - void readSettings(); - void writeSettings(); - - protected: - virtual void keyPressEvent(QKeyEvent *e); - virtual void closeEvent(QCloseEvent *e); - - private: - QMediaPlayer *mPlayer; - bool mLastFullScreen; -}; - -#endif // VIDEOVIEWER_H |