From: <sag...@us...> - 2012-03-12 23:01:19
|
Revision: 1218 http://modplug.svn.sourceforge.net/modplug/?rev=1218&view=rev Author: saga-games Date: 2012-03-12 23:01:12 +0000 (Mon, 12 Mar 2012) Log Message: ----------- [Ref] Changed effect key auto setup to use the effect letters from CModSpecfications. Modified Paths: -------------- trunk/OpenMPT/mptrack/CommandSet.cpp trunk/OpenMPT/mptrack/CommandSet.h trunk/OpenMPT/mptrack/InputHandler.cpp trunk/OpenMPT/mptrack/InputHandler.h trunk/OpenMPT/mptrack/KeyConfigDlg.cpp trunk/OpenMPT/mptrack/MainFrm.cpp trunk/OpenMPT/mptrack/ModConvert.cpp Modified: trunk/OpenMPT/mptrack/CommandSet.cpp =================================================================== --- trunk/OpenMPT/mptrack/CommandSet.cpp 2012-03-12 22:59:25 UTC (rev 1217) +++ trunk/OpenMPT/mptrack/CommandSet.cpp 2012-03-12 23:01:12 UTC (rev 1218) @@ -72,6 +72,7 @@ commands[kc].Message = message; } + //Get command descriptions etc.. loaded up. void CCommandSet::SetupCommands() //------------------------------- @@ -636,17 +637,21 @@ #endif //_DEBUG } -//----------------------------------------- + //------------------------------------------------------- // Command Manipulation //------------------------------------------------------- CString CCommandSet::Add(KeyCombination kc, CommandID cmd, bool overwrite) +//------------------------------------------------------------------------ { return Add(kc, cmd, overwrite, -1); } + + CString CCommandSet::Add(KeyCombination kc, CommandID cmd, bool overwrite, int pos) +//--------------------------------------------------------------------------------- { CString report= ""; @@ -706,14 +711,18 @@ return report; } + bool CCommandSet::IsDummyCommand(CommandID cmd) -{ // e.g. Chord modifier is a dummy command, which serves only to automatically - // generate a set of keycombinations for chords (I'm not proud of this design). +//--------------------------------------------- +{ + // e.g. Chord modifier is a dummy command, which serves only to automatically + // generate a set of keycombinations for chords (I'm not proud of this design). return commands[cmd].isDummy; } CString CCommandSet::Remove(int pos, CommandID cmd) +//------------------------------------------------- { if (pos>=0 && pos<commands[cmd].kcList.GetSize()) { @@ -724,7 +733,9 @@ return ""; } + CString CCommandSet::Remove(KeyCombination kc, CommandID cmd) +//----------------------------------------------------------- { //find kc in commands[cmd].kcList int index=-1; @@ -749,6 +760,7 @@ CString CCommandSet::EnforceAll(KeyCombination inKc, CommandID inCmd, bool adding) +//-------------------------------------------------------------------------------- { //World's biggest, most confusing method. :) //Needs refactoring. Maybe make lots of Rule subclasses, each with their own Enforce() method? @@ -758,7 +770,7 @@ CString report=""; if (enforceRule[krAllowNavigationWithSelection]) - {//------------------------------------------------------------ + { // When we get a new navigation command key, we need to // make sure this navigation will work when any selection key is pressed if (inCmd>=kcStartPatNavigation && inCmd<=kcEndPatNavigation) @@ -805,11 +817,14 @@ // When we get a new selection key, we need to make sure that // all navigation commands will work with this selection key pressed else if (inCmd==kcSelect) - {// check that is is a selection + { + // check that is is a selection for (int curCmd=kcStartPatNavigation; curCmd<=kcEndPatNavigation; curCmd++) - {// for all nav commands + { + // for all nav commands for (int k=0; k<commands[curCmd].kcList.GetSize(); k++) - {// for all keys for this command + { + // for all keys for this command CommandID cmdNavSelection = (CommandID)(kcStartPatNavigationSelect + (curCmd-kcStartPatNavigation)); newKc=commands[curCmd].kcList[k]; // get all properties from the current nav cmd key newKc.mod|=inKc.mod; // and the new selection modifier @@ -848,7 +863,7 @@ } // end krAllowNavigationWithSelection if (enforceRule[krAllowSelectionWithNavigation]) - {//----------------------------------------------------------- + { KeyCombination newKcSel; // When we get a new navigation command key, we need to ensure @@ -926,7 +941,7 @@ } - //if we add a selector or a copy selector, we need it to switch off when we release the key. + // if we add a selector or a copy selector, we need it to switch off when we release the key. if (enforceRule[krAutoSelectOff]) { KeyCombination newKcDeSel; @@ -958,14 +973,14 @@ } - // Allow combinations of copyselect and select if (enforceRule[krAllowSelectCopySelectCombos]) { KeyCombination newKcSel, newKcCopySel; if (inCmd==kcSelect) - { //On getting a new selection key, make this selection key work with all copy selects' modifiers - //On getting a new selection key, make all copyselects work with this key's modifiers + { + // On getting a new selection key, make this selection key work with all copy selects' modifiers + // On getting a new selection key, make all copyselects work with this key's modifiers for (int k=0; k<commands[kcCopySelect].kcList.GetSize(); k++) { newKcSel=inKc; @@ -973,7 +988,7 @@ newKcCopySel=commands[kcCopySelect].kcList[k]; newKcCopySel.mod|=inKc.mod; Log("Enforcing rule krAllowSelectCopySelectCombos\n"); - if (adding) + if (adding) { Add(newKcSel, kcSelectWithCopySelect, false); Add(newKcCopySel, kcCopySelectWithSelect, false); @@ -986,8 +1001,9 @@ } } if (inCmd==kcCopySelect) - { //On getting a new copyselection key, make this copyselection key work with all selects' modifiers - //On getting a new copyselection key, make all selects work with this key's modifiers + { + // On getting a new copyselection key, make this copyselection key work with all selects' modifiers + // On getting a new copyselection key, make all selects work with this key's modifiers for (int k=0; k<commands[kcSelect].kcList.GetSize(); k++) { newKcSel=commands[kcSelect].kcList[k]; @@ -995,7 +1011,7 @@ newKcCopySel=inKc; newKcCopySel.mod|=commands[kcSelect].kcList[k].mod; Log("Enforcing rule krAllowSelectCopySelectCombos\n"); - if (adding) + if (adding) { Add(newKcSel, kcSelectWithCopySelect, false); Add(newKcCopySel, kcCopySelectWithSelect, false); @@ -1297,7 +1313,9 @@ return report; } + UINT CCommandSet::CodeToModifier(UINT code) +//----------------------------------------- { switch(code) { @@ -1310,18 +1328,20 @@ } + //------------------------------------------------------- // Export //------------------------------------------------------- //Generate a keymap from a command set void CCommandSet::GenKeyMap(KeyMap &km) +//------------------------------------- { KeyCombination curKc; CArray<KeyEventType, KeyEventType> eventTypes; CArray<InputTargetContext, InputTargetContext> contexts; //Clear map - memset(km, -1, sizeof(kcNull)*KeyMapSize); + memset(km, -1, sizeof(KeyMap)); //Copy commandlist content into map: for (UINT cmd=0; cmd<kcNumCommands; cmd++) @@ -1372,10 +1392,10 @@ } } -//------------------------------------- DWORD CCommandSet::GetKeymapLabel(InputTargetContext ctx, UINT mod, UINT code, KeyEventType ke) +//--------------------------------------------------------------------------------------------- { //Unused ASSERT((long)ctx<0xFF); ASSERT((long)mod<0xFF); @@ -1392,31 +1412,39 @@ return label; } + void CCommandSet::Copy(CCommandSet *source) +//----------------------------------------- { // copy constructors should take care of complexity (I hope) - for (int cmd=0; cmd<commands.GetSize(); cmd++) + for (int cmd = 0; cmd < commands.GetSize(); cmd++) commands[cmd] = source->commands[cmd]; } + KeyCombination CCommandSet::GetKey(CommandID cmd, UINT key) +//--------------------------------------------------------- { return commands[cmd].kcList[key]; } - int CCommandSet::GetKeyListSize(CommandID cmd) +//-------------------------------------------- { return commands[cmd].kcList.GetSize(); } + CString CCommandSet::GetCommandText(CommandID cmd) +//------------------------------------------------ { return commands[cmd].Message; } + bool CCommandSet::SaveFile(CString fileName) +//------------------------------------------ { //TODO: Make C++ /* Layout: @@ -1473,6 +1501,7 @@ bool CCommandSet::LoadFile(std::istream& iStrm, LPCTSTR szFilename) +//----------------------------------------------------------------- { KeyCombination kc; CommandID cmd=kcNumCommands; @@ -1746,6 +1775,7 @@ //Could do better search algo but this is not perf critical. int CCommandSet::FindCmd(int uid) +//------------------------------- { for (int i=0; i<kcNumCommands; i++) { @@ -1756,7 +1786,9 @@ return -1; } + CString CCommandSet::GetContextText(InputTargetContext ctx) +//--------------------------------------------------------- { switch(ctx) { @@ -1783,7 +1815,10 @@ default: return "Unknown Context"; } }; + + CString CCommandSet::GetKeyEventText(KeyEventType ke) +//--------------------------------------------------- { CString text=""; @@ -1808,7 +1843,9 @@ return text; } + CString CCommandSet::GetModifierText(UINT mod) +//-------------------------------------------- { CString text = ""; if (mod & HOTKEYF_SHIFT) text.Append("Shift+"); @@ -1818,7 +1855,9 @@ return text; } + CString CCommandSet::GetKeyText(UINT mod, UINT code) +//-------------------------------------------------- { CString keyText; keyText=GetModifierText(mod); @@ -1831,7 +1870,9 @@ return keyText; } + CString CCommandSet::GetKeyTextFromCommand(CommandID c, UINT key) +//--------------------------------------------------------------- { if ( static_cast<INT_PTR>(key) < commands[c].kcList.GetSize()) return GetKeyText(commands[c].kcList[0].mod, commands[c].kcList[0].code); @@ -1839,15 +1880,15 @@ return ""; } + bool CCommandSet::isHidden(UINT c) +//-------------------------------- { return commands[c].isHidden; } - - //------------------------------------------------------- // Quick Changes - modify many commands with one call. //------------------------------------------------------- @@ -1871,8 +1912,9 @@ return true; } + bool CCommandSet::QuickChange_NoNotesRepeat() -//----------------------------------------- +//------------------------------------------- { KeyCombination kc; int choices; @@ -1890,36 +1932,38 @@ return true; } -bool CCommandSet::QuickChange_SetEffectsXM() -//----------------------------------------- -{ - return QuickChange_SetEffects("0123456789abcdr?fte???ghk?yxplz"); -} -bool CCommandSet::QuickChange_SetEffectsIT() -//----------------------------------------- +bool CCommandSet::QuickChange_SetEffects(const CModSpecifications &modSpecs) +//-------------------------------------------------------------------------- { - return QuickChange_SetEffects("jfeghlkrxodb?cqati?smnvw?uy?p?z"); - -} - -bool CCommandSet::QuickChange_SetEffects(char comList[kcSetFXEnd-kcSetFXStart]) -//----------------------------------------- -{ int choices=0; KeyCombination kc; kc.ctx = kCtxViewPatternsFX; kc.event = kKeyEventDown; - for (CommandID cmd=kcFixedFXStart; cmd<=kcFixedFXend; cmd=(CommandID)(cmd+1)) + for(CommandID cmd = kcFixedFXStart; cmd <= kcFixedFXend; cmd = static_cast<CommandID>(cmd + 1)) { - choices = GetKeyListSize(cmd); //Remove all old choices - for (int p=choices; p>=0; --p) + //Remove all old choices + choices = GetKeyListSize(cmd); + for(int p = choices; p >= 0; --p) + { Remove(p, cmd); + } - if (comList[cmd-kcSetFXStart] != '?') //? is used an non existant command. + char effect = modSpecs.GetEffectLetter(static_cast<ModCommand::COMMAND>(cmd - kcSetFXStart + 1)); + if(effect >= 'A' && effect <= 'Z') { - SHORT codeNmod = VkKeyScanEx(comList[cmd-kcFixedFXStart], GetKeyboardLayout(0)); + // VkKeyScanEx needs lowercase letters + effect = effect - 'A' + 'a'; + } else if(effect < '0' || effect > '9') + { + // Don't map effects that use "weird" effect letters (such as # or \) + effect = '?'; + } + + if(effect != '?') + { + SHORT codeNmod = VkKeyScanEx(effect, GetKeyboardLayout(0)); kc.code = LOBYTE(codeNmod); kc.mod = HIBYTE(codeNmod) & 0x07; //We're only interest in the bottom 3 bits. Add(kc, cmd, true); Modified: trunk/OpenMPT/mptrack/CommandSet.h =================================================================== --- trunk/OpenMPT/mptrack/CommandSet.h 2012-03-12 22:59:25 UTC (rev 1217) +++ trunk/OpenMPT/mptrack/CommandSet.h 2012-03-12 23:01:12 UTC (rev 1218) @@ -10,6 +10,7 @@ #pragma once #include "afxtempl.h" +#include "../soundlib/mod_specifications.h" #include <string> //#define VK_ALT 0x12 @@ -1077,7 +1078,6 @@ }; #define MAINKEYS 256 -#define KeyMapSize kCtxMaxInputContexts*MaxMod*MAINKEYS*kNumKeyEvents typedef CommandID KeyMap[kCtxMaxInputContexts][MaxMod][MAINKEYS][kNumKeyEvents]; //typedef CMap<long, long, CommandID, CommandID> KeyMap; @@ -1119,8 +1119,7 @@ { UINT ID; CString desc; - bool enforce; - + bool enforce; }; enum RuleID @@ -1190,9 +1189,7 @@ CString Remove(int pos, CommandID cmd); //Tranformation - bool QuickChange_SetEffectsXM(); - bool QuickChange_SetEffectsIT(); - bool QuickChange_SetEffects(char comList[kcSetFXEnd-kcSetFXStart]); + bool QuickChange_SetEffects(const CModSpecifications &modSpecs); bool QuickChange_NotesRepeat(); bool QuickChange_NoNotesRepeat(); Modified: trunk/OpenMPT/mptrack/InputHandler.cpp =================================================================== --- trunk/OpenMPT/mptrack/InputHandler.cpp 2012-03-12 22:59:25 UTC (rev 1217) +++ trunk/OpenMPT/mptrack/InputHandler.cpp 2012-03-12 23:01:12 UTC (rev 1218) @@ -23,8 +23,8 @@ #define TRANSITIONBIT 0x8000 #define REPEATBIT 0x4000 -//-------------------------------------------------------------- CInputHandler::CInputHandler(CWnd *mainframe) +//------------------------------------------- { m_pMainFrm = mainframe; @@ -79,15 +79,17 @@ m_bNoAltMenu = true; } -CInputHandler::~CInputHandler(void) + + +CInputHandler::~CInputHandler() +//----------------------------- { delete activeCommandSet; } - -//-------------------------------------------------------------- CommandID CInputHandler::GeneralKeyEvent(InputTargetContext context, int code, WPARAM wParam , LPARAM lParam) +//----------------------------------------------------------------------------------------------------------- { CommandID executeCommand = kcNull; KeyEventType keyEventType; @@ -126,7 +128,7 @@ CommandID CInputHandler::KeyEvent(InputTargetContext context, UINT &nChar, UINT &/*nRepCnt*/, UINT &/*nFlags*/, KeyEventType keyEventType, CWnd* pSourceWnd) -//------------------------------------------------------------------------------------------------------------------------------------------------- +//---------------------------------------------------------------------------------------------------------------------------------------------------------- { CommandID executeCommand = keyMap[context][modifierMask][nChar][keyEventType]; @@ -144,8 +146,10 @@ return executeCommand; } + // Feature: use Windows keys as modifier keys, intercept special keys -bool CInputHandler::InterceptSpecialKeys( UINT nChar , UINT nFlags ) +bool CInputHandler::InterceptSpecialKeys(UINT nChar, UINT nFlags) +//--------------------------------------------------------------- { KeyEventType keyEventType = GetKeyEventType( HIWORD(nFlags) ); enum { VK_NonExistentKey = VK_F24+1 }; @@ -188,7 +192,9 @@ return false; }; + void CInputHandler::SetupSpecialKeyInterception() +//----------------------------------------------- { m_bInterceptWindowsKeys = m_bInterceptNumLock = m_bInterceptCapsLock = m_bInterceptScrollLock = false; for( int context=0; context < CountOf(keyMap); context++ ) @@ -269,8 +275,10 @@ return false; } + //-------------------------------------------------------------- DWORD CInputHandler::GetKey(CommandID /*c*/) +//------------------------------------------ { return 0;// command[c].kc.code command[c].kc.mod; } @@ -281,6 +289,7 @@ int CInputHandler::SetCommand(InputTargetContext context, CommandID cmd, UINT modifierMask, UINT actionKey, UINT keyEventType) +//---------------------------------------------------------------------------------------------------------------------------- { int deletedCommand = -1; @@ -295,18 +304,23 @@ return deletedCommand; } + KeyCombination CInputHandler::GetKey(CommandID cmd, UINT key) +//----------------------------------------------------------- { return activeCommandSet->GetKey(cmd, key); } int CInputHandler::GetKeyListSize(CommandID cmd) +//---------------------------------------------- { return activeCommandSet->GetKeyListSize(cmd); } + CString CInputHandler::GetCommandText(CommandID cmd) +//-------------------------------------------------- { return activeCommandSet->GetCommandText(cmd); } @@ -326,6 +340,7 @@ */ void CInputHandler::LogModifiers(UINT mask) +//----------------------------------------- { Log("----------------------------------\n"); if (mask & HOTKEYF_CONTROL) Log("Ctrl On"); else Log("Ctrl --"); @@ -334,26 +349,41 @@ if (mask & HOTKEYF_EXT) Log("\tWin On\n"); else Log("\tWin --\n"); // Feature: use Windows keys as modifier keys } + KeyEventType CInputHandler::GetKeyEventType(UINT nFlags) +//------------------------------------------------------ { - if (nFlags & TRANSITIONBIT) //Key released + if (nFlags & TRANSITIONBIT) + { + // Key released return kKeyEventUp; - else - if (nFlags & REPEATBIT) //key repeated + } else + { + if (nFlags & REPEATBIT) + { + // Key repeated return kKeyEventRepeat; - else //new key down - return kKeyEventDown; + } else + { + // New key down + return kKeyEventDown; + } + } } -bool CInputHandler::SelectionPressed(void) + +bool CInputHandler::SelectionPressed() +//------------------------------------ { bool result=false; int nSelectionKeys = activeCommandSet->GetKeyListSize(kcSelect); KeyCombination key; - for (int k=0; k<nSelectionKeys; k++) { + for (int k=0; k<nSelectionKeys; k++) + { key = activeCommandSet->GetKey(kcSelect, k); - if (modifierMask & key.mod) { + if (modifierMask & key.mod) + { result=true; break; } @@ -362,55 +392,74 @@ } -bool CInputHandler::ShiftPressed(void) +bool CInputHandler::ShiftPressed() +//-------------------------------- { return (modifierMask & HOTKEYF_SHIFT); } -bool CInputHandler::CtrlPressed(void) + +bool CInputHandler::CtrlPressed() +//------------------------------- { return ((modifierMask & HOTKEYF_CONTROL) != 0); } -bool CInputHandler::AltPressed(void) + +bool CInputHandler::AltPressed() +//------------------------------ { return ((modifierMask & HOTKEYF_ALT) != 0); } + void CInputHandler::Bypass(bool b) +//-------------------------------- { m_bBypass=b; } + bool CInputHandler::Bypass() +//-------------------------- { return m_bBypass; } + WORD CInputHandler::GetModifierMask() +//----------------------------------- { return (WORD)modifierMask; } + void CInputHandler::SetModifierMask(WORD mask) +//-------------------------------------------- { modifierMask=mask; } + CString CInputHandler::GetCurModifierText() +//----------------------------------------- { return activeCommandSet->GetModifierText(modifierMask); } + CString CInputHandler::GetKeyTextFromCommand(CommandID c) +//------------------------------------------------------- { return activeCommandSet->GetKeyTextFromCommand(c, 0); } + #define FILENEW 1 #define MAINVIEW 59392 CString CInputHandler::GetMenuText(UINT id) +//----------------------------------------- { CString s; CommandID c = kcNull; @@ -488,7 +537,9 @@ return s; } + void CInputHandler::UpdateMainMenu() +//---------------------------------- { CMenu *pMenu = (CMainFrame::GetMainFrame())->GetMenu(); if (!pMenu) return; @@ -553,6 +604,7 @@ void CInputHandler::SetNewCommandSet(CCommandSet *newSet) +//------------------------------------------------------- { activeCommandSet->Copy(newSet); activeCommandSet->GenKeyMap(keyMap); @@ -560,48 +612,35 @@ UpdateMainMenu(); } -bool CInputHandler::noAltMenu() -{ - return m_bNoAltMenu; -} - - -bool CInputHandler::SetITEffects(void) +bool CInputHandler::SetEffectLetters(const CModSpecifications &modSpecs) +//---------------------------------------------------------------------- { - Log("Setting command set to IT.\n"); - bool retval = activeCommandSet->QuickChange_SetEffectsIT(); + Log("Changing command set.\n"); + bool retval = activeCommandSet->QuickChange_SetEffects(modSpecs); activeCommandSet->GenKeyMap(keyMap); return retval; } -bool CInputHandler::SetXMEffects(void) -{ - Log("Setting command set to XM.\n"); - bool retval = activeCommandSet->QuickChange_SetEffectsXM(); - activeCommandSet->GenKeyMap(keyMap); - return retval; -} - - bool CInputHandler::isKeyPressHandledByTextBox(DWORD key) +//------------------------------------------------------- { //Alpha-numerics (only shift or no modifier): - if (!CtrlPressed() && !AltPressed() && - ((key>='A'&&key<='Z') || (key>='0'&&key<='9') || + if(!CtrlPressed() && !AltPressed() + && ((key>='A'&&key<='Z') || (key>='0'&&key<='9') || key==VK_DIVIDE || key==VK_MULTIPLY || key==VK_SPACE || key==VK_RETURN || key==VK_CAPITAL || (key>=VK_OEM_1 && key<=VK_OEM_3) || (key>=VK_OEM_4 && key<=VK_OEM_8))) return true; //navigation (any modifier): - if (key == VK_LEFT || key == VK_RIGHT || key == VK_UP || key == VK_DOWN || + if(key == VK_LEFT || key == VK_RIGHT || key == VK_UP || key == VK_DOWN || key == VK_HOME || key == VK_END || key == VK_DELETE || key == VK_INSERT || key == VK_BACK) return true; //Copy paste etc.. - if (CMainFrame::GetInputHandler()->GetModifierMask()==HOTKEYF_CONTROL && + if(CMainFrame::GetInputHandler()->GetModifierMask()==HOTKEYF_CONTROL && (key == 'Y' || key == 'Z' || key == 'X' || key == 'C' || key == 'V' || key == 'A')) return true; Modified: trunk/OpenMPT/mptrack/InputHandler.h =================================================================== --- trunk/OpenMPT/mptrack/InputHandler.h 2012-03-12 22:59:25 UTC (rev 1217) +++ trunk/OpenMPT/mptrack/InputHandler.h 2012-03-12 23:01:12 UTC (rev 1218) @@ -54,7 +54,7 @@ public: CInputHandler(CWnd *mainframe); - ~CInputHandler(void); + ~CInputHandler(); CommandID GeneralKeyEvent(InputTargetContext context, int code, WPARAM wParam , LPARAM lParam); CommandID KeyEvent(InputTargetContext context, UINT &nChar, UINT &nRepCnt, UINT &nFlags, KeyEventType keyEventType, CWnd* pSourceWnd=NULL); int SetCommand(InputTargetContext context, CommandID command, UINT modifierMask, UINT actionKey, UINT keyEventType); @@ -83,10 +83,10 @@ public: CCommandSet *activeCommandSet; - bool ShiftPressed(void); - bool SelectionPressed(void); - bool CtrlPressed(void); - bool AltPressed(void); + bool ShiftPressed(); + bool SelectionPressed(); + bool CtrlPressed(); + bool AltPressed(); bool Bypass(); void Bypass(bool); WORD GetModifierMask(); @@ -96,7 +96,6 @@ CString GetMenuText(UINT id); void UpdateMainMenu(); void SetNewCommandSet(CCommandSet * newSet); - bool noAltMenu(); - bool SetXMEffects(void); - bool SetITEffects(void); + bool noAltMenu() { return m_bNoAltMenu; }; + bool SetEffectLetters(const CModSpecifications &modSpecs); }; Modified: trunk/OpenMPT/mptrack/KeyConfigDlg.cpp =================================================================== --- trunk/OpenMPT/mptrack/KeyConfigDlg.cpp 2012-03-12 22:59:25 UTC (rev 1217) +++ trunk/OpenMPT/mptrack/KeyConfigDlg.cpp 2012-03-12 23:01:12 UTC (rev 1218) @@ -818,7 +818,7 @@ void COptionsKeyboard::OnSetITEffects() //------------------------------------- { - plocalCmdSet->QuickChange_SetEffectsIT(); + plocalCmdSet->QuickChange_SetEffects(ModSpecs::itEx); ForceUpdateGUI(); } @@ -826,7 +826,7 @@ void COptionsKeyboard::OnSetXMEffects() //------------------------------------- { - plocalCmdSet->QuickChange_SetEffectsXM(); + plocalCmdSet->QuickChange_SetEffects(ModSpecs::xmEx); ForceUpdateGUI(); } Modified: trunk/OpenMPT/mptrack/MainFrm.cpp =================================================================== --- trunk/OpenMPT/mptrack/MainFrm.cpp 2012-03-12 22:59:25 UTC (rev 1217) +++ trunk/OpenMPT/mptrack/MainFrm.cpp 2012-03-12 23:01:12 UTC (rev 1218) @@ -2502,8 +2502,8 @@ //rewbs.customKeys // We have swicthed focus to a new module - might need to update effect keys to reflect module type -bool CMainFrame::UpdateEffectKeys(void) -//------------------------------------- +bool CMainFrame::UpdateEffectKeys() +//--------------------------------- { CModDoc* pModDoc = GetActiveDoc(); if (pModDoc) @@ -2511,10 +2511,7 @@ CSoundFile* pSndFile = pModDoc->GetSoundFile(); if (pSndFile) { - if (pSndFile->m_nType & (MOD_TYPE_MOD|MOD_TYPE_XM)) - return m_InputHandler->SetXMEffects(); - else - return m_InputHandler->SetITEffects(); + return m_InputHandler->SetEffectLetters(pSndFile->GetModSpecifications()); } } Modified: trunk/OpenMPT/mptrack/ModConvert.cpp =================================================================== --- trunk/OpenMPT/mptrack/ModConvert.cpp 2012-03-12 22:59:25 UTC (rev 1217) +++ trunk/OpenMPT/mptrack/ModConvert.cpp 2012-03-12 23:01:12 UTC (rev 1218) @@ -501,10 +501,7 @@ //rewbs.customKeys: update effect key commands CInputHandler *ih = CMainFrame::GetMainFrame()->GetInputHandler(); - if(newTypeIsMOD_XM) - ih->SetXMEffects(); - else - ih->SetITEffects(); + ih->SetEffectLetters(m_SndFile.GetModSpecifications()); //end rewbs.customKeys return true; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |