change the behavior of menu item "Emulation > Pause" to call TogglePause() rather than Pause(); add Increase/Decrease Volume hotkey.

This commit is contained in:
gocha 2009-11-04 08:41:43 +00:00
parent 961264bd1b
commit b117ca793d
3 changed files with 30 additions and 3 deletions

View File

@ -222,6 +222,19 @@ void HK_LCDsSwap(int)
LCDsSwap(-1); LCDsSwap(-1);
} }
extern int sndvolume;
void HK_IncreaseVolume(int, bool justPressed)
{
sndvolume = std::min(100, sndvolume + 5);
SPU_SetVolume(sndvolume);
}
void HK_DecreaseVolume(int, bool justPressed)
{
sndvolume = std::max(0, sndvolume - 5);
SPU_SetVolume(sndvolume);
}
void HK_Reset(int, bool justPressed) {ResetGame();} void HK_Reset(int, bool justPressed) {ResetGame();}
void HK_RecordAVI(int, bool justPressed) { if (AVI_IsRecording()) AviEnd(); else AviRecordTo(); } void HK_RecordAVI(int, bool justPressed) { if (AVI_IsRecording()) AviEnd(); else AviRecordTo(); }
@ -675,6 +688,18 @@ void InitCustomKeys (SCustomKeys *keys)
keys->LCDsSwap.page = HOTKEY_PAGE_MOVIE; keys->LCDsSwap.page = HOTKEY_PAGE_MOVIE;
keys->LCDsSwap.key = VK_NEXT; keys->LCDsSwap.key = VK_NEXT;
keys->IncreaseVolume.handleKeyDown = HK_IncreaseVolume;
keys->IncreaseVolume.code = "IncreaseVolume";
keys->IncreaseVolume.name = L"Increase Volume";
keys->IncreaseVolume.page = HOTKEY_PAGE_MOVIE;
keys->IncreaseVolume.key = NULL;
keys->DecreaseVolume.handleKeyDown = HK_DecreaseVolume;
keys->DecreaseVolume.code = "DecreaseVolume";
keys->DecreaseVolume.name = L"Decrease Volume";
keys->DecreaseVolume.page = HOTKEY_PAGE_MOVIE;
keys->DecreaseVolume.key = NULL;
//StateSlots Page -------------------------------------------------- //StateSlots Page --------------------------------------------------
keys->NextSaveSlot.handleKeyDown = HK_NextSaveSlot; keys->NextSaveSlot.handleKeyDown = HK_NextSaveSlot;
keys->NextSaveSlot.code = "NextSaveSlot"; keys->NextSaveSlot.code = "NextSaveSlot";

View File

@ -93,6 +93,8 @@ struct SCustomKeys
SCustomKey StylusAutoHold; SCustomKey StylusAutoHold;
SCustomKey LCDsMode; SCustomKey LCDsMode;
SCustomKey LCDsSwap; SCustomKey LCDsSwap;
SCustomKey IncreaseVolume;
SCustomKey DecreaseVolume;
SCustomKey LastItem; // dummy, must be last SCustomKey LastItem; // dummy, must be last
//--methods-- //--methods--

View File

@ -270,9 +270,9 @@ extern bool userTouchesScreen;
static int sndcoretype=SNDCORE_DIRECTX; static int sndcoretype=SNDCORE_DIRECTX;
static int sndbuffersize=735*4; static int sndbuffersize=735*4;
static int sndvolume=100;
static int snd_synchmode=0; static int snd_synchmode=0;
static int snd_synchmethod=0; static int snd_synchmethod=0;
int sndvolume=100;
SoundInterface_struct *SNDCoreList[] = { SoundInterface_struct *SNDCoreList[] = {
&SNDDummy, &SNDDummy,
@ -3596,7 +3596,6 @@ LRESULT CALLBACK WindowProcedure (HWND hwnd, UINT message, WPARAM wParam, LPARAM
WritePrivateProfileString("Watches", str, &rw_recent_files[i][0], IniName); WritePrivateProfileString("Watches", str, &rw_recent_files[i][0], IniName);
} }
for(int i = 0; i < MAX_RECENT_SCRIPTS; i++) for(int i = 0; i < MAX_RECENT_SCRIPTS; i++)
{ {
char str[256]; char str[256];
@ -3604,6 +3603,7 @@ LRESULT CALLBACK WindowProcedure (HWND hwnd, UINT message, WPARAM wParam, LPARAM
WritePrivateProfileString("Scripting", str, &Recent_Scripts[i][0], IniName); WritePrivateProfileString("Scripting", str, &Recent_Scripts[i][0], IniName);
} }
WritePrivateProfileInt("Sound", "Volume", sndvolume, IniName);
ExitRunLoop(); ExitRunLoop();
} }
@ -4498,7 +4498,7 @@ LRESULT CALLBACK WindowProcedure (HWND hwnd, UINT message, WPARAM wParam, LPARAM
return 0; return 0;
case IDM_PAUSE: case IDM_PAUSE:
Pause(); TogglePause();
return 0; return 0;
case IDM_GBASLOT: case IDM_GBASLOT: