Permalink
Browse files

Merge pull request #10225 from LunaMoo/AVdumpHotkey

Add hotkey to toggle audio and video dumping together in sync.
  • Loading branch information...
hrydgard committed Dec 2, 2017
2 parents b2bb1b6 + 95a14ca commit 0389647013b56873a5304ff0bbf7323868c35eb5
Showing with 24 additions and 0 deletions.
  1. +1 −0 Common/KeyMap.cpp
  2. +1 −0 Common/KeyMap.h
  3. +22 −0 UI/EmuScreen.cpp
@@ -649,6 +649,7 @@ const KeyMap_IntStrPair psp_button_names[] = {
#ifndef MOBILE_DEVICE
{VIRTKEY_FRAME_ADVANCE, "Frame Advance"},
{VIRTKEY_REWIND, "Rewind"},
{VIRTKEY_RECORD, "Audio/Video Recording" },
#endif
{VIRTKEY_SAVE_STATE, "Save State"},
{VIRTKEY_LOAD_STATE, "Load State"},
@@ -51,6 +51,7 @@ enum {
VIRTKEY_AXIS_SWAP = 0x40000013,
VIRTKEY_DEVMENU = 0x40000014,
VIRTKEY_FRAME_ADVANCE = 0x40000015,
VIRTKEY_RECORD = 0x40000016,
VIRTKEY_LAST,
VIRTKEY_COUNT = VIRTKEY_LAST - VIRTKEY_FIRST
};
@@ -454,6 +454,28 @@ void EmuScreen::onVKeyDown(int virtualKeyCode) {
break;
}
#ifndef MOBILE_DEVICE
case VIRTKEY_RECORD:
{
if (g_Config.bDumpFrames == g_Config.bDumpAudio) {
g_Config.bDumpFrames = !g_Config.bDumpFrames;
g_Config.bDumpAudio = !g_Config.bDumpAudio;
} else {
// This hotkey should always toggle both audio and video together.
// So let's make sure that's the only outcome even if video OR audio was already being dumped.
if (g_Config.bDumpFrames) {
AVIDump::Stop();
AVIDump::Start(PSP_CoreParameter().renderWidth, PSP_CoreParameter().renderHeight);
g_Config.bDumpAudio = true;
} else {
WAVDump::Reset();
g_Config.bDumpFrames = true;
}
}
break;
}
#endif
case VIRTKEY_AXIS_X_MIN:
case VIRTKEY_AXIS_X_MAX:
setVKeyAnalogX(CTRL_STICK_LEFT, VIRTKEY_AXIS_X_MIN, VIRTKEY_AXIS_X_MAX);

0 comments on commit 0389647

Please sign in to comment.