void slitScanApp::testClickedLoadMovie(int x, int y) { x -= FRAME_PADDING*2 + HUD_BUTTON_WIDTH/2; y -= (FRAME_PADDING*2 + SELECTOR_HEIGHT); if(useLiveVideo && x > 0 && x < HUD_BUTTON_WIDTH / 2 && y > 0 && y < HUD_BUTTON_HEIGHT){ initMovie(); } }
void slitScanApp::keyPressed(int key){ //hot keys // b - blending // p or space bar pause // f - fullscreen // m - load movie // l - live video // v - video settings // numbers 1 - 9 select maps if(key == 'b'){ warp.toggleBlending(); } else if(key == 'p' || key == ' '){ isPaused = !isPaused; } else if(key == 'f'){ isFullScreen = !isFullScreen; ofSetFullscreen(isFullScreen); } else if(key == 'm'){ initMovie(); } else if(key == 'l'){ initLiveVideo(); } else if(key == 'v'){ vidGrabber.videoSettings(); } else if(key == '1'){ warp.setDelayMap(*(sampleMaps[currentSampleMapIndex = 0])); } else if(key == '2'){ warp.setDelayMap(*(sampleMaps[currentSampleMapIndex = 1])); } else if(key == '3'){ warp.setDelayMap(*(sampleMaps[currentSampleMapIndex = 2])); } else if(key == '4'){ warp.setDelayMap(*(sampleMaps[currentSampleMapIndex = 3])); } else if(key == '5'){ warp.setDelayMap(*(sampleMaps[currentSampleMapIndex = 4])); } else if(key == '6'){ warp.setDelayMap(*(sampleMaps[currentSampleMapIndex = 5])); } else if(key == '7'){ warp.setDelayMap(*(sampleMaps[currentSampleMapIndex = 6])); } else if(key == '8'){ warp.setDelayMap(*(sampleMaps[currentSampleMapIndex = 7])); } else if(key == '9'){ if(loadCustomMapIndex()){ currentSampleMapIndex = 8; } } }
/** * Asks the user to add a user specified amount of movies and their respective * data. Adds all movies to the specified movieList * @param movieList The list to add movies to */ void getMovieData(MovieNodeType **movieList) { fprintf(outputFile, "* Entering getMovieData *\n"); dumpList(*movieList); /* * Ask the user how many movies they want to input */ int returnVal, numMovies; const int SCANF_UNSUCCESSFUL = 1; do { printf("Enter the number of movies to be entered: "); returnVal = scanf("%d", &numMovies); clearStdin(); } while (returnVal != SCANF_UNSUCCESSFUL || numMovies < 0); /* * Get the user to input the movie data */ int i = 0; for (i = 0; i < numMovies; ++i) { char title[MAX_STR]; int year; GenreType genre; // get movie name printf("Enter the name of movie %d:\n", i + 1); fgets(title, MAX_STR, stdin); title[strlen(title) - 1] = '\0'; // get movie year do { printf("Enter the year of movie %d:\n", i + 1); returnVal = scanf("%d", &year); clearStdin(); } while (returnVal != SCANF_UNSUCCESSFUL || year < 0); // get movie genre char genreInput[MAX_STR]; do { printf( "Enter the genre of movie %d\nAvailable choices are 'comedy', 'drama', 'action', 'horror', 'science-fiction', 'adventure', 'western':\n", i + 1); fgets(genreInput, MAX_STR, stdin); genreInput[strlen(genreInput) - 1] = '\0'; if (strcmp(genreInput, "comedy") == 0) { genre = C_COMEDY; break; } else if (strcmp(genreInput, "drama") == 0) { genre = C_DRAMA; break; } else if (strcmp(genreInput, "action") == 0) { genre = C_ACTION; break; } else if (strcmp(genreInput, "horror") == 0) { genre = C_HORROR; break; } else if (strcmp(genreInput, "science-fiction") == 0) { genre = C_SF; break; } else if (strcmp(genreInput, "adventure") == 0) { genre = C_ADVENTURE; break; } else if (strcmp(genreInput, "western") == 0) { genre = C_WESTERN; break; } else { continue; } } while (1); // add movie to list MovieType *movie; initMovie(&movie, title, year, genre); addToMovieList(movieList, movie); } dumpList(*movieList); fprintf(outputFile, "* Leaving getMovieData *\n"); }
Heart::Heart(){ CloseupModule::init(); video = assets->closeups[1]; initMovie(); }