From: <sag...@us...> - 2010-08-09 20:38:44
|
Revision: 682 http://modplug.svn.sourceforge.net/modplug/?rev=682&view=rev Author: saga-games Date: 2010-08-09 20:38:37 +0000 (Mon, 09 Aug 2010) Log Message: ----------- [Imp] Added keyboard shortcut for the panic button. [Ref] Moved panic button code to CModDoc. Modified Paths: -------------- trunk/OpenMPT/mptrack/CommandSet.cpp trunk/OpenMPT/mptrack/CommandSet.h trunk/OpenMPT/mptrack/MainFrm.cpp trunk/OpenMPT/mptrack/Moddoc.cpp trunk/OpenMPT/mptrack/Moddoc.h Modified: trunk/OpenMPT/mptrack/CommandSet.cpp =================================================================== --- trunk/OpenMPT/mptrack/CommandSet.cpp 2010-08-09 14:30:17 UTC (rev 681) +++ trunk/OpenMPT/mptrack/CommandSet.cpp 2010-08-09 20:38:37 UTC (rev 682) @@ -598,6 +598,7 @@ DefineKeyCommand(kcInsNoteMapEditSample, 1849, kcVisible, kcNoDummy, _T("Edit current sample")); DefineKeyCommand(kcInsNoteMapEditSampleMap, 1850, kcVisible, kcNoDummy, _T("Edit sample map")); DefineKeyCommand(kcInstrumentCtrlDuplicate, 1851, kcVisible, kcNoDummy, _T("Duplicate instrument")); + DefineKeyCommand(kcPanic, 1852, kcVisible, kcNoDummy, _T("Panic")); // Add new key commands here. #ifdef _DEBUG Modified: trunk/OpenMPT/mptrack/CommandSet.h =================================================================== --- trunk/OpenMPT/mptrack/CommandSet.h 2010-08-09 14:30:17 UTC (rev 681) +++ trunk/OpenMPT/mptrack/CommandSet.h 2010-08-09 20:38:37 UTC (rev 682) @@ -74,6 +74,7 @@ kcPlaySongFromCursor, kcPlayPatternFromStart, kcPlayPatternFromCursor, + kcPanic, kcEstimateSongLength, kcApproxRealBPM, kcMidiRecord, Modified: trunk/OpenMPT/mptrack/MainFrm.cpp =================================================================== --- trunk/OpenMPT/mptrack/MainFrm.cpp 2010-08-09 14:30:17 UTC (rev 681) +++ trunk/OpenMPT/mptrack/MainFrm.cpp 2010-08-09 20:38:37 UTC (rev 682) @@ -2705,14 +2705,9 @@ void CMainFrame::OnPanic() //------------------------ { - // Panic button. At the moment, it just resets all VSTi and sample notes. - if(m_pModPlaying && m_pModPlaying->GetSoundFile()) - { - BEGIN_CRITICAL(); - m_pModPlaying->GetSoundFile()->ResetChannels(); - m_pModPlaying->GetSoundFile()->StopAllVsti(); - END_CRITICAL(); - } + // "Panic button." At the moment, it just resets all VSTi and sample notes. + if(m_pModPlaying) + m_pModPlaying->OnPanic(); } Modified: trunk/OpenMPT/mptrack/Moddoc.cpp =================================================================== --- trunk/OpenMPT/mptrack/Moddoc.cpp 2010-08-09 14:30:17 UTC (rev 681) +++ trunk/OpenMPT/mptrack/Moddoc.cpp 2010-08-09 20:38:37 UTC (rev 682) @@ -3447,6 +3447,7 @@ case kcPlaySongFromStart: OnPlayerPlayFromStart(); break; case kcPlayPauseSong: OnPlayerPlay(); break; case kcStopSong: OnPlayerStop(); break; + case kcPanic: OnPanic(); break; // case kcPauseSong: OnPlayerPause(); break; @@ -3690,9 +3691,20 @@ } void CModDoc::SafeFileClose() -//-------------------------- +//--------------------------- { // Verify that the main window has the focus. This saves us a lot of trouble because active dialogs normally don't check if their pSndFile pointers are still valid. if(GetActiveWindow() == CMainFrame::GetMainFrame()->m_hWnd) OnFileClose(); +} + + +// "Panic button". At the moment, it just resets all VSTi and sample notes. +void CModDoc::OnPanic() +//--------------------- +{ + BEGIN_CRITICAL(); + m_SndFile.ResetChannels(); + m_SndFile.StopAllVsti(); + END_CRITICAL(); } \ No newline at end of file Modified: trunk/OpenMPT/mptrack/Moddoc.h =================================================================== --- trunk/OpenMPT/mptrack/Moddoc.h 2010-08-09 14:30:17 UTC (rev 681) +++ trunk/OpenMPT/mptrack/Moddoc.h 2010-08-09 20:38:37 UTC (rev 682) @@ -356,6 +356,7 @@ afx_msg void OnPlayerStop(); afx_msg void OnPlayerPause(); afx_msg void OnPlayerPlayFromStart(); + afx_msg void OnPanic(); afx_msg void OnEditGlobals(); afx_msg void OnEditPatterns(); afx_msg void OnEditSamples(); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |