From e5019d818f7f189d177ddf43cc7021ca2c05a611 Mon Sep 17 00:00:00 2001 From: adelikat Date: Mon, 22 Dec 2008 23:33:52 +0000 Subject: [PATCH] apparently these don't get added by default --- src/drivers/win/movieoptions.cpp | 111 +++++++++++++++++++++++++++++++ src/drivers/win/movieoptions.h | 5 ++ 2 files changed, 116 insertions(+) create mode 100644 src/drivers/win/movieoptions.cpp create mode 100644 src/drivers/win/movieoptions.h diff --git a/src/drivers/win/movieoptions.cpp b/src/drivers/win/movieoptions.cpp new file mode 100644 index 00000000..50db9366 --- /dev/null +++ b/src/drivers/win/movieoptions.cpp @@ -0,0 +1,111 @@ +/* FCE Ultra - NES/Famicom Emulator +* +* Copyright notice for this file: +* Copyright (C) 2002 Xodnizel +* +* 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. +* +* This program is distributed in the hope that it will be useful, +* but WITHOUT ANY WARRANTY; without even the implied warranty of +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +* GNU General Public License for more details. +* +* You should have received a copy of the GNU General Public License +* along with this program; if not, write to the Free Software +* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +*/ + +#include "resource.h" +#include "window.h" + +//internal variables +int pauseAfterPlayback = 0; //Flag for pausing emulator when movie is finished +bool bindSavestate = true; //Toggle that determines if a savestate filename will include the movie filename +bool autoMovieBackup = false; //Toggle that determines if movies should be backed up automatically before altering them + +//external +extern int status_icon; //In main.cpp - For displaying movie status icons (play,record,pause) +extern bool movieSubtitles; //In fceu.cpp - Toggle for displaying movie subtitles +extern bool subtitlesOnAVI; //In movie.cpp - Toggle for putting movie subtitles in an AVI + +void UpdateCheckBoxes(HWND hwndDlg) +{ + CheckDlgButton(hwndDlg, IDC_MOVIE_PAUSEAFTERPLAYBACK, pauseAfterPlayback ? BST_CHECKED : BST_UNCHECKED); + CheckDlgButton(hwndDlg, IDC_MOVIE_BINDSAVESTATES, bindSavestate ? BST_CHECKED : BST_UNCHECKED); + CheckDlgButton(hwndDlg, IDC_MOVIE_DISPLAYSTATUSICON, status_icon ? BST_CHECKED : BST_UNCHECKED); + CheckDlgButton(hwndDlg, IDC_MOVIE_DISPLAYSUBTITLES, movieSubtitles ? BST_CHECKED : BST_UNCHECKED); + CheckDlgButton(hwndDlg, IDC_MOVIE_DISPLAYSUBTITLES, subtitlesOnAVI ? BST_CHECKED : BST_UNCHECKED); + CheckDlgButton(hwndDlg, IDC_MOVIE_AUTOBACKUP, autoMovieBackup ? BST_CHECKED : BST_UNCHECKED); +} + +void CloseMovieOptionsDialog(HWND hwndDlg) +{ + EndDialog(hwndDlg, 0); +} + +/** +* Callback function of the Timing configuration dialog. +**/ +BOOL CALLBACK MovieOptionsCallB(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam) +{ + switch(uMsg) + { + case WM_INITDIALOG: + + UpdateCheckBoxes(hwndDlg); + break; + + case WM_CLOSE: + case WM_QUIT: + CloseMovieOptionsDialog(hwndDlg); + break; + + case WM_COMMAND: + + if(!(wParam >> 16)) + { + switch(wParam & 0xFFFF) + { + case IDC_MOVIE_PAUSEAFTERPLAYBACK: + pauseAfterPlayback = pauseAfterPlayback?0:1; + break; + + case IDC_MOVIE_BINDSAVESTATES: + bindSavestate ^= 1; + break; + + case IDC_MOVIE_DISPLAYSTATUSICON: + status_icon = pauseAfterPlayback?0:1; + break; + + case IDC_MOVIE_DISPLAYSUBTITLES: + movieSubtitles ^= 1; + if (movieSubtitles) FCEU_DispMessage("Movie subtitles on"); + else FCEU_DispMessage("Movie subtitles off"); + break; + + case IDC_MOVIE_SUBTITLESINAVI: + subtitlesOnAVI ^= 1; + break; + + case IDC_MOVIE_AUTOBACKUP: + autoMovieBackup ^= 1; + break; + + case IDC_MOVIE_CLOSE: + CloseMovieOptionsDialog(hwndDlg); + break; + } + } + } + + return 0; +} + +void OpenMovieOptions() +{ + DialogBox(fceu_hInstance, "MOVIEOPTIONS", hAppWnd, MovieOptionsCallB); +} diff --git a/src/drivers/win/movieoptions.h b/src/drivers/win/movieoptions.h new file mode 100644 index 00000000..05a6ac11 --- /dev/null +++ b/src/drivers/win/movieoptions.h @@ -0,0 +1,5 @@ +void OpenMovieOptions(); + +extern int pauseAfterPlayback; +extern bool bindSavestate; +extern bool autoMovieBackup; \ No newline at end of file