summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorArno <arno@disconnect.de>2018-08-26 22:29:40 +0200
committerArno <arno@disconnect.de>2018-08-26 22:29:40 +0200
commit2e211cc21ba495d2523f7b8f8f3d171721e28a58 (patch)
treeb14aca94ca16da744f9c1cdd8cf229b74e44fcdf
parent70327f1bacc973c13d9b37b34d560b27bdd27b59 (diff)
downloadSheMov-2e211cc21ba495d2523f7b8f8f3d171721e28a58.tar.gz
SheMov-2e211cc21ba495d2523f7b8f8f3d171721e28a58.tar.bz2
SheMov-2e211cc21ba495d2523f7b8f8f3d171721e28a58.zip
Add some more keyboard action to VideoViewer
* Ĺšpace for play/pause * 1 for lowering volume * 2 for raising volume
-rw-r--r--videoviewer.cpp19
1 files changed, 19 insertions, 0 deletions
diff --git a/videoviewer.cpp b/videoviewer.cpp
index b94790a..5617641 100644
--- a/videoviewer.cpp
+++ b/videoviewer.cpp
@@ -69,6 +69,25 @@ void VideoViewer::keyPressEvent(QKeyEvent *e){
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);
}
}