From d9f59e45f6b0f9fd660dbb191b4b000c59900f45 Mon Sep 17 00:00:00 2001 From: adelikat Date: Tue, 2 Mar 2010 03:34:15 +0000 Subject: [PATCH] Win32 - a Disable Movie Messages during AVI menu item. --- changelog.txt | 3 ++- src/driver.h | 2 ++ src/drivers/win/aviout.cpp | 17 +++++++++++++++++ src/drivers/win/config.cpp | 2 ++ src/drivers/win/res.rc | 15 +++++++-------- src/drivers/win/resource.h | 5 ++++- src/drivers/win/window.cpp | 6 ++++++ src/video.cpp | 3 +++ 8 files changed, 43 insertions(+), 10 deletions(-) diff --git a/changelog.txt b/changelog.txt index b36f59d0..dd8973d3 100644 --- a/changelog.txt +++ b/changelog.txt @@ -1,4 +1,5 @@ -255555-feb-2010 - prockguy - unix netplay is now functional; gtk network gui created +01-march-2010 - adelikat - win32 - a disable movie messages menu item +25-feb-2010 - prockguy - unix netplay is now functional; gtk network gui created 24-feb-2010 - prockguy - GTK - added basic movie controls 24-feb-2010 - prockguy - GTK - added file filters; added Load FDS function 24-feb-2010 - prockguy - GTK - added palette config dialog diff --git a/src/driver.h b/src/driver.h index 65655605..70e853a0 100644 --- a/src/driver.h +++ b/src/driver.h @@ -271,6 +271,8 @@ void FCEUI_AviEnd(void); void FCEUI_AviVideoUpdate(const unsigned char* buffer); void FCEUI_AviSoundUpdate(void* soundData, int soundLen); bool FCEUI_AviIsRecording(); +bool FCEUI_AviDisableMovieMessages(); +void FCEUI_SetAviDisableMovieMessages(bool disable); void FCEUD_AviRecordTo(void); void FCEUD_AviStop(void); diff --git a/src/drivers/win/aviout.cpp b/src/drivers/win/aviout.cpp index 4bccf2e9..83ddab25 100644 --- a/src/drivers/win/aviout.cpp +++ b/src/drivers/win/aviout.cpp @@ -14,6 +14,9 @@ extern PALETTEENTRY *color_palette; #define VIDEO_WIDTH 256 +//adelikat: TODO - perhaps put this in AVIFile +bool disableMovieMessages = false; + static struct AVIFile { int valid; @@ -432,3 +435,17 @@ bool FCEUI_AviIsRecording() return false; } + +bool FCEUI_AviDisableMovieMessages() +{ + if (disableMovieMessages) + return true; + + return false; +} + +void FCEUI_SetAviDisableMovieMessages(bool disable) +{ + disableMovieMessages = disable; +} + diff --git a/src/drivers/win/config.cpp b/src/drivers/win/config.cpp index 213078ca..f93cbcb7 100644 --- a/src/drivers/win/config.cpp +++ b/src/drivers/win/config.cpp @@ -61,6 +61,7 @@ extern uint8 gNoBGFillColor; extern bool rightClickEnabled; extern int CurrentState; extern bool pauseWhileActive; //adelikat: Cheats dialog +extern bool AVIdisableMovieMessages; //window positions and sizes: extern int ChtPosX,ChtPosY; @@ -304,6 +305,7 @@ static CFGSTRUCT fceuconfig[] = { AC(backupSavestates), AC(compressSavestates), AC(pauseWhileActive), + AC(AVIdisableMovieMessages), ENDCFGSTRUCT }; diff --git a/src/drivers/win/res.rc b/src/drivers/win/res.rc index 62d26926..fb504a20 100644 --- a/src/drivers/win/res.rc +++ b/src/drivers/win/res.rc @@ -7,8 +7,7 @@ // // Generated from the TEXTINCLUDE 2 resource. // -#include "afxres.h" - +#include "afxres.h" ///////////////////////////////////////////////////////////////////////////// #undef APSTUDIO_READONLY_SYMBOLS @@ -71,6 +70,7 @@ BEGIN MENUITEM "&Stop AVI", MENU_STOP_AVI MENUITEM "&Record WAV...", MENU_RECORD_WAV MENUITEM "&Stop WAV", MENU_STOP_WAV + MENUITEM "Disable Movie Messages", ID_AVI_DISMOVIEMESSAGE END POPUP "&Lua" BEGIN @@ -1471,10 +1471,10 @@ BEGIN EDITTEXT IDC_EDIT_LUAPATH,7,16,256,14,ES_AUTOHSCROLL EDITTEXT IDC_EDIT_LUAARGS,47,50,216,14,ES_AUTOHSCROLL EDITTEXT IDC_LUACONSOLE,7,80,256,60,ES_MULTILINE | ES_AUTOVSCROLL | ES_READONLY | WS_VSCROLL - LTEXT "Output Console:",IDC_STATIC,7,70,56,8 - LTEXT "Script File:",IDC_STATIC,7,7,36,8 - LTEXT "Arugments:",IDC_STATIC,7,52,40,8 -PUSHBUTTON "Edit",IDC_BUTTON_LUAEDIT,58,31,46,16 + LTEXT "Output Console:",IDC_STATIC,7,70,56,8 + LTEXT "Script File:",IDC_STATIC,7,7,36,8 + LTEXT "Arugments:",IDC_STATIC,7,52,40,8 + PUSHBUTTON "Edit",IDC_BUTTON_LUAEDIT,58,31,46,16 END VIDEOCONFIG DIALOGEX 65520, 76, 384, 296 @@ -1938,8 +1938,7 @@ IDB_TE_ARROW BITMAP "res/te_arrow.bmp" // // Generated from the TEXTINCLUDE 3 resource. // - - + ///////////////////////////////////////////////////////////////////////////// #endif // not APSTUDIO_INVOKED diff --git a/src/drivers/win/resource.h b/src/drivers/win/resource.h index a2ba3ae1..416e7650 100644 --- a/src/drivers/win/resource.h +++ b/src/drivers/win/resource.h @@ -770,6 +770,9 @@ #define RW_MENU_LAST_RECENT_FILE 40400 #define ID_ENABLE_BACKUPSAVESTATES 40401 #define ID_ENABLE_COMPRESSSAVESTATES 40402 +#define ID_AVI_DISABLEMOV 40403 +#define ID_AVI_DISMOVIEMESS 40404 +#define ID_AVI_DISMOVIEMESSAGE 40405 #define IDC_DEBUGGER_ICONTRAY 55535 #define MW_ValueLabel2 65423 #define MW_ValueLabel1 65426 @@ -779,7 +782,7 @@ #ifdef APSTUDIO_INVOKED #ifndef APSTUDIO_READONLY_SYMBOLS #define _APS_NEXT_RESOURCE_VALUE 160 -#define _APS_NEXT_COMMAND_VALUE 40403 +#define _APS_NEXT_COMMAND_VALUE 40406 #define _APS_NEXT_CONTROL_VALUE 1257 #define _APS_NEXT_SYMED_VALUE 101 #endif diff --git a/src/drivers/win/window.cpp b/src/drivers/win/window.cpp index 7c845b2e..6e43990e 100644 --- a/src/drivers/win/window.cpp +++ b/src/drivers/win/window.cpp @@ -116,6 +116,7 @@ int GetCheckedAutoFirePattern(); int GetCheckedAutoFireOffset(); //Internal variables------------------------------------- +bool AVIdisableMovieMessages = false; char *md5_asciistr(uint8 digest[16]); static int winwidth, winheight; static volatile int nofocus = 0; @@ -375,6 +376,7 @@ void UpdateCheckedMenuItems() //File Maneu CheckMenuItem(fceumenu, ID_FILE_MOVIE_TOGGLEREAD, movie_readonly ? MF_CHECKED : MF_UNCHECKED); CheckMenuItem(fceumenu, ID_FILE_OPENLUAWINDOW, LuaConsoleHWnd ? MF_CHECKED : MF_UNCHECKED); + CheckMenuItem(fceumenu, ID_AVI_DISMOVIEMESSAGE, AVIdisableMovieMessages ? MF_CHECKED : MF_UNCHECKED); //NES Menu CheckMenuItem(fceumenu, ID_NES_PAUSE, EmulationPaused ? MF_CHECKED : MF_UNCHECKED); @@ -1521,6 +1523,10 @@ LRESULT FAR PASCAL AppWndProc(HWND hWnd,UINT msg,WPARAM wParam,LPARAM lParam) CloseWave(); loggingSound = false; break; + case ID_AVI_DISMOVIEMESSAGE: + AVIdisableMovieMessages ^= 1; + FCEUI_SetAviDisableMovieMessages(AVIdisableMovieMessages); + break; case FCEUX_CONTEXT_SCREENSHOT: case ID_FILE_SCREENSHOT: diff --git a/src/video.cpp b/src/video.cpp index 386044d9..f731ad55 100644 --- a/src/video.cpp +++ b/src/video.cpp @@ -345,6 +345,8 @@ void FCEU_DispMessageOnMovie(char *format, ...) guiMessage.howlong = 180; guiMessage.isMovieMessage = true; + if (FCEUI_AviIsRecording() && FCEUI_AviDisableMovieMessages()) + guiMessage.howlong = 0; } void FCEU_DispMessage(char *format, ...) @@ -358,6 +360,7 @@ void FCEU_DispMessage(char *format, ...) guiMessage.howlong = 180; guiMessage.isMovieMessage = false; + //adelikat: Pretty sure this code fails, Movie playback stopped is done with FCEU_DispMessageOnMovie() #ifdef CREATE_AVI if(LoggingEnabled == 2) {