| 46 | } |
| 47 | |
| 48 | void QTimeIterApp::keyDown( KeyEvent event ) |
| 49 | { |
| 50 | if( event.getChar() == 'f' ) { |
| 51 | setFullScreen( ! isFullScreen() ); |
| 52 | } |
| 53 | else if( event.getChar() == 'o' ) { |
| 54 | fs::path moviePath = getOpenFilePath(); |
| 55 | if( ! moviePath.empty() ) |
| 56 | loadMovieFile( moviePath ); |
| 57 | } |
| 58 | |
| 59 | // these keys only make sense if there is an active movie |
| 60 | if( mMovie ) { |
| 61 | if( event.getCode() == KeyEvent::KEY_LEFT ) { |
| 62 | mMovie->stepBackward(); |
| 63 | } |
| 64 | if( event.getCode() == KeyEvent::KEY_RIGHT ) { |
| 65 | mMovie->stepForward(); |
| 66 | } |
| 67 | else if( event.getChar() == 's' ) { |
| 68 | if( mSurface ) { |
| 69 | fs::path savePath = getSaveFilePath(); |
| 70 | if( ! savePath.empty() ) { |
| 71 | writeImage( savePath, *mSurface ); |
| 72 | } |
| 73 | } |
| 74 | } |
| 75 | else if( event.getChar() == 'm' ) { |
| 76 | // jump to the middle frame |
| 77 | mMovie->seekToTime( mMovie->getDuration() / 2 ); |
| 78 | } |
| 79 | else if( event.getChar() == ' ' ) { |
| 80 | if( mMovie->isPlaying() ) |
| 81 | mMovie->stop(); |
| 82 | else |
| 83 | mMovie->play(); |
| 84 | } |
| 85 | } |
| 86 | } |
| 87 | |
| 88 | void QTimeIterApp::loadMovieFile( const fs::path &moviePath ) |
| 89 | { |
nothing calls this directly
no test coverage detected