MCPcopy Create free account
hub / github.com/cinder/Cinder / keyDown

Method keyDown

samples/QuickTimeIteration/src/QuickTimeIterationApp.cpp:48–86  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

46}
47
48void 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
88void QTimeIterApp::loadMovieFile( const fs::path &moviePath )
89{

Callers

nothing calls this directly

Calls 13

setFullScreenFunction · 0.85
isFullScreenFunction · 0.85
getOpenFilePathFunction · 0.85
getSaveFilePathFunction · 0.85
writeImageFunction · 0.85
emptyMethod · 0.45
stepBackwardMethod · 0.45
stepForwardMethod · 0.45
seekToTimeMethod · 0.45
getDurationMethod · 0.45
isPlayingMethod · 0.45
stopMethod · 0.45

Tested by

no test coverage detected