From: <rel...@us...> - 2009-08-18 20:38:58
|
Revision: 332 http://modplug.svn.sourceforge.net/modplug/?rev=332&view=rev Author: relabsoluness Date: 2009-08-18 20:38:41 +0000 (Tue, 18 Aug 2009) Log Message: ----------- [Mod] Default keybindings and tunings are now loaded from resources. [Ref] Some related tweaks and renaming. Modified Paths: -------------- trunk/OpenMPT/mptrack/CommandSet.cpp trunk/OpenMPT/mptrack/CommandSet.h trunk/OpenMPT/mptrack/Ctrl_ins.cpp trunk/OpenMPT/mptrack/InputHandler.cpp trunk/OpenMPT/mptrack/Stdafx.h trunk/OpenMPT/mptrack/misc_util.cpp trunk/OpenMPT/mptrack/misc_util.h trunk/OpenMPT/mptrack/mptrack.rc trunk/OpenMPT/mptrack/mptrack.vcproj trunk/OpenMPT/mptrack/mptrack_08.vcproj trunk/OpenMPT/mptrack/resource.h trunk/OpenMPT/soundlib/Load_it.cpp trunk/OpenMPT/soundlib/Sndfile.cpp trunk/OpenMPT/soundlib/Sndfile.h Added Paths: ----------- trunk/OpenMPT/mptrack/res/built-inTunings.tc trunk/OpenMPT/mptrack/res/defaultKeybindings.mkb Removed Paths: ------------- trunk/OpenMPT/mptrack/bin/tunings/ trunk/OpenMPT/packageTemplate/default.mkb trunk/OpenMPT/packageTemplate/tunings/ Modified: trunk/OpenMPT/mptrack/CommandSet.cpp =================================================================== --- trunk/OpenMPT/mptrack/CommandSet.cpp 2009-08-18 18:41:12 UTC (rev 331) +++ trunk/OpenMPT/mptrack/CommandSet.cpp 2009-08-18 20:38:41 UTC (rev 332) @@ -2,8 +2,10 @@ #include "stdafx.h" #include ".\commandset.h" +#include "resource.h" #include <stdio.h> #include <stdlib.h> +#include <fstream> #define ENABLE_LOGGING 0 @@ -3074,7 +3076,7 @@ if( (outStream = fopen( fileName, "w" )) == NULL ) { - ::MessageBox(NULL, "Can't open file for writing.", "", MB_ICONEXCLAMATION|MB_OK); + AfxMessageBox(IDS_CANT_OPEN_FILE_FOR_WRITING, MB_ICONEXCLAMATION|MB_OK); return false; } fprintf(outStream, "//-------- OpenMPT key binding definition file -------\n"); @@ -3111,10 +3113,9 @@ return true; } -bool CCommandSet::LoadFile(CString fileName) + +bool CCommandSet::LoadFile(std::istream& iStrm, LPCTSTR szFilename) { - - FILE *inStream; KeyCombination kc; CommandID cmd=kcNumCommands; char s[1024]; @@ -3124,17 +3125,8 @@ int l=0; pTempCS = new CCommandSet(); - - - if( (inStream = fopen( fileName, "r" )) == NULL ) - { - ::MessageBox(NULL, "Can't open file keyboard config file " + fileName + " for reading.", "", MB_ICONEXCLAMATION|MB_OK); - delete pTempCS; - return false; - } - int errorCount=0; - while(fgets(s,1024,inStream)) + while(iStrm.getline(s, sizeof(s))) { //::MessageBox(NULL, s, "", MB_ICONEXCLAMATION|MB_OK); curLine = s; @@ -3189,7 +3181,7 @@ errorCount++; CString err; if (errorCount<10) { - err.Format("Line %d in key binding file %s was not understood.", l, fileName); + err.Format("Line %d in key binding file %s was not understood.", l, szFilename); if(s_bShowErrorOnUnknownKeybinding) ::MessageBox(NULL, err, "", MB_ICONEXCLAMATION|MB_OK); Log(err); } else if (errorCount==10) { @@ -3214,6 +3206,19 @@ return true; } +bool CCommandSet::LoadFile(CString fileName) +{ + std::ifstream fin(fileName); + if (fin.fail()) + { + CString strMsg; + AfxFormatString1(strMsg, IDS_CANT_OPEN_KEYBINDING_FILE, fileName); + AfxMessageBox(strMsg, MB_ICONEXCLAMATION|MB_OK); + return false; + } + else + return LoadFile(fin, fileName); +} //Could do better search algo but this is not perf critical. Modified: trunk/OpenMPT/mptrack/CommandSet.h =================================================================== --- trunk/OpenMPT/mptrack/CommandSet.h 2009-08-18 18:41:12 UTC (rev 331) +++ trunk/OpenMPT/mptrack/CommandSet.h 2009-08-18 20:38:41 UTC (rev 332) @@ -1101,6 +1101,7 @@ void GenKeyMap(KeyMap &km); // Generate a keymap from this command set bool SaveFile(CString FileName, bool debug); bool LoadFile(CString FileName); + bool LoadFile(std::istream& iStrm, LPCTSTR szFilename); static DWORD GetKeymapLabel(InputTargetContext ctx, UINT mod, UINT code, KeyEventType ke); Modified: trunk/OpenMPT/mptrack/Ctrl_ins.cpp =================================================================== --- trunk/OpenMPT/mptrack/Ctrl_ins.cpp 2009-08-18 18:41:12 UTC (rev 331) +++ trunk/OpenMPT/mptrack/Ctrl_ins.cpp 2009-08-18 20:38:41 UTC (rev 332) @@ -2553,11 +2553,11 @@ sel -= 1; CTuningCollection* tc = 0; - if(sel < CSoundFile::GetStandardTunings().GetNumTunings()) - tc = &CSoundFile::GetStandardTunings(); + if(sel < CSoundFile::GetBuiltInTunings().GetNumTunings()) + tc = &CSoundFile::GetBuiltInTunings(); else { - sel -= CSoundFile::GetStandardTunings().GetNumTunings(); + sel -= CSoundFile::GetBuiltInTunings().GetNumTunings(); if(sel < CSoundFile::GetLocalTunings().GetNumTunings()) tc = &CSoundFile::GetLocalTunings(); else @@ -2581,7 +2581,7 @@ //Case: Chosen tuning editor to be displayed. //Creating vector for the CTuningDialog. vector<CTuningCollection*> v; - v.push_back(&m_pSndFile->GetStandardTunings()); + v.push_back(&m_pSndFile->GetBuiltInTunings()); v.push_back(&m_pSndFile->GetLocalTunings()); v.push_back(&m_pSndFile->GetTuneSpecificTunings()); CTuningDialog td(this, v, pInstH->pTuning); @@ -2618,9 +2618,9 @@ return; } - for(size_t i = 0; i < CSoundFile::GetStandardTunings().GetNumTunings(); i++) + for(size_t i = 0; i < CSoundFile::GetBuiltInTunings().GetNumTunings(); i++) { - if(pIns->pTuning == &CSoundFile::GetStandardTunings().GetTuning(i)) + if(pIns->pTuning == &CSoundFile::GetBuiltInTunings().GetTuning(i)) { m_ComboTuning.SetCurSel(i+1); return; @@ -2631,7 +2631,7 @@ { if(pIns->pTuning == &CSoundFile::GetLocalTunings().GetTuning(i)) { - m_ComboTuning.SetCurSel(i+CSoundFile::GetStandardTunings().GetNumTunings()+1); + m_ComboTuning.SetCurSel(i+CSoundFile::GetBuiltInTunings().GetNumTunings()+1); return; } } @@ -2640,7 +2640,7 @@ { if(pIns->pTuning == &m_pSndFile->GetTuneSpecificTunings().GetTuning(i)) { - m_ComboTuning.SetCurSel(i+CSoundFile::GetStandardTunings().GetNumTunings() + CSoundFile::GetLocalTunings().GetNumTunings()+1); + m_ComboTuning.SetCurSel(i+CSoundFile::GetBuiltInTunings().GetNumTunings() + CSoundFile::GetLocalTunings().GetNumTunings()+1); return; } } @@ -2792,9 +2792,9 @@ m_ComboTuning.DeleteString(0); m_ComboTuning.AddString("OMPT IT behavior"); //<-> Instrument pTuning pointer == NULL - for(size_t i = 0; i<CSoundFile::GetStandardTunings().GetNumTunings(); i++) + for(size_t i = 0; i<CSoundFile::GetBuiltInTunings().GetNumTunings(); i++) { - m_ComboTuning.AddString(CSoundFile::GetStandardTunings().GetTuning(i).GetName().c_str()); + m_ComboTuning.AddString(CSoundFile::GetBuiltInTunings().GetTuning(i).GetName().c_str()); } for(size_t i = 0; i<CSoundFile::GetLocalTunings().GetNumTunings(); i++) { Modified: trunk/OpenMPT/mptrack/InputHandler.cpp =================================================================== --- trunk/OpenMPT/mptrack/InputHandler.cpp 2009-08-18 18:41:12 UTC (rev 331) +++ trunk/OpenMPT/mptrack/InputHandler.cpp 2009-08-18 20:38:41 UTC (rev 332) @@ -8,6 +8,8 @@ #include "mainfrm.h" #include <direct.h> #include ".\inputhandler.h" +#include <strstream> +#include <Shlwapi.h> #define TRANSITIONBIT 0x8000 #define REPEATBIT 0x4000 @@ -21,17 +23,43 @@ activeCommandSet = new CCommandSet(); CCommandSet::s_bShowErrorOnUnknownKeybinding = (CMainFrame::GetMainFrame()->GetPrivateProfileLong("Misc", "ShowErrorOnUnknownKeybinding", 1, theApp.GetConfigFileName()) != 0); - CString workingDir; - char wd[255]; - _getdcwd(_getdrive(), wd, 255); - workingDir = wd; - if (!CMainFrame::m_szKbdFile[0]) { - strcpy(CMainFrame::m_szKbdFile, workingDir + "\\default.mkb"); - } - if (!(activeCommandSet->LoadFile(CMainFrame::m_szKbdFile))) { - if (!(activeCommandSet->LoadFile(workingDir + "\\default.mkb"))) { - AfxMessageBox("Warning! OpenMPT has not been able to locate a keymap file. Please locate one in the settings.\r\nUntil you do so, the keyboard will not work in OpenMPT."); + CString sDefaultPath = CMainFrame::m_csExecutableDirectoryPath + TEXT("Keybindings.mkb"); + if (sDefaultPath.GetLength() > MAX_PATH - 1) + sDefaultPath = ""; + + const bool bNoExistingKbdFileSetting = (CMainFrame::m_szKbdFile[0] == 0); + + // 1. Try to load keybindings from the path saved in the settings. + // 2. If the setting doesn't exist or the loading fails, try to load from default location. + // 3. If neither one of these worked, load default keybindings from resources. + // 4. If there were no keybinging setting already, create a keybinding file to default location + // and set it's path to settings. + + if (bNoExistingKbdFileSetting || !(activeCommandSet->LoadFile(CMainFrame::m_szKbdFile))) + { + if (bNoExistingKbdFileSetting) + _tcscpy(CMainFrame::m_szKbdFile, sDefaultPath); + bool bSuccess = false; + if (PathFileExists(sDefaultPath) == TRUE) + bSuccess = activeCommandSet->LoadFile(sDefaultPath); + if (bSuccess == false) + { + // Load keybindings from resources. + Log("Loading keybindings from resources\n"); + const char* pData = nullptr; + HGLOBAL hglob = nullptr; + size_t nSize = 0; + if (LoadResource(MAKEINTRESOURCE(IDR_DEFAULT_KEYBINDINGS), TEXT("KEYBINDINGS"), pData, nSize, hglob) != nullptr) + { + std::istrstream iStrm(pData, nSize); + bSuccess = activeCommandSet->LoadFile(iStrm, TEXT("\"executable resource\"")); + FreeResource(hglob); + if (bSuccess && bNoExistingKbdFileSetting) + activeCommandSet->SaveFile(CMainFrame::m_szKbdFile, false); + } } + if (bSuccess == false) + AfxMessageBox(IDS_UNABLE_TO_LOAD_KEYBINDINGS, MB_ICONERROR); } //Get Keymap @@ -148,7 +176,7 @@ inp[0].type = inp[1].type = INPUT_KEYBOARD; inp[0].ki.time = inp[1].ki.time = 0; inp[0].ki.dwExtraInfo = inp[0].ki.dwExtraInfo = 0; - inp[0].ki.wVk = inp[1].ki.wVk = nChar; + inp[0].ki.wVk = inp[1].ki.wVk = static_cast<WORD>(nChar); inp[0].ki.wScan = inp[1].ki.wScan = 0; inp[0].ki.dwFlags = KEYEVENTF_KEYUP; inp[1].ki.dwFlags = 0; @@ -339,12 +367,12 @@ bool CInputHandler::CtrlPressed(void) { - return (modifierMask & HOTKEYF_CONTROL); + return ((modifierMask & HOTKEYF_CONTROL) != 0); } bool CInputHandler::AltPressed(void) { - return (modifierMask & HOTKEYF_ALT); + return ((modifierMask & HOTKEYF_ALT) != 0); } void CInputHandler::Bypass(bool b) Modified: trunk/OpenMPT/mptrack/Stdafx.h =================================================================== --- trunk/OpenMPT/mptrack/Stdafx.h 2009-08-18 18:41:12 UTC (rev 331) +++ trunk/OpenMPT/mptrack/Stdafx.h 2009-08-18 20:38:41 UTC (rev 332) @@ -50,6 +50,10 @@ //#include <afxdhtml.h> #pragma warning(default:4201) +#include <string> +#include <fstream> +#include <strstream> + #ifndef OFN_FORCESHOWHIDDEN #define OFN_FORCESHOWHIDDEN 0x10000000 #endif Modified: trunk/OpenMPT/mptrack/misc_util.cpp =================================================================== --- trunk/OpenMPT/mptrack/misc_util.cpp 2009-08-18 18:41:12 UTC (rev 331) +++ trunk/OpenMPT/mptrack/misc_util.cpp 2009-08-18 20:38:41 UTC (rev 332) @@ -1,3 +1,31 @@ #include "stdafx.h" #include "misc_util.h" +/* + * Loads resource. + * lpName and lpType: parameters passed to FindResource(). + * pData: Pointer to loaded resource data, nullptr if load not successful. + * nSize: Size of the data in bytes, zero if load not succesfull. + * hglob: HGLOBAL returned by LoadResource-function. + * Return: pData. + */ +LPCCH LoadResource(LPCTSTR lpName, LPCTSTR lpType, LPCCH& pData, size_t& nSize, HGLOBAL& hglob) +//--------------------------------------------------------------------------------------------- +{ + pData = nullptr; + nSize = 0; + hglob = nullptr; + HINSTANCE hInstance = AfxGetInstanceHandle(); + HRSRC hrsrc = FindResource(hInstance, lpName, lpType); + if (hrsrc != NULL) + { + hglob = LoadResource(hInstance, hrsrc); + if (hglob != NULL) + { + pData = reinterpret_cast<const char*>(LockResource(hglob)); + nSize = SizeofResource(hInstance, hrsrc); + } + } + return pData; +} + Modified: trunk/OpenMPT/mptrack/misc_util.h =================================================================== --- trunk/OpenMPT/mptrack/misc_util.h 2009-08-18 18:41:12 UTC (rev 331) +++ trunk/OpenMPT/mptrack/misc_util.h 2009-08-18 20:38:41 UTC (rev 332) @@ -78,5 +78,7 @@ #define CLAMP(number, low, high) min(high, max(low, number)) #endif + +LPCCH LoadResource(LPCTSTR lpName, LPCTSTR lpType, LPCCH& pData, size_t& nSize, HGLOBAL& hglob); #endif Modified: trunk/OpenMPT/mptrack/mptrack.rc =================================================================== --- trunk/OpenMPT/mptrack/mptrack.rc 2009-08-18 18:41:12 UTC (rev 331) +++ trunk/OpenMPT/mptrack/mptrack.rc 2009-08-18 20:38:41 UTC (rev 332) @@ -13,7 +13,7 @@ #undef APSTUDIO_READONLY_SYMBOLS ///////////////////////////////////////////////////////////////////////////// -// Deutsch (Deutschland) resources +// German (Germany) resources #if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_DEU) #ifdef _WIN32 @@ -55,12 +55,12 @@ END #endif // APSTUDIO_INVOKED -#endif // Deutsch (Deutschland) resources +#endif // German (Germany) resources ///////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////// -// Englisch (USA) resources +// English (U.S.) resources #if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU) #ifdef _WIN32 @@ -2204,14 +2204,19 @@ IDS_UNSUPPORTED_TUNING_DnD "For the time being Drag and Drop is only supported for tuning instances." IDS_OPERATION_FAIL "Operation failed." + IDS_CANT_OPEN_KEYBINDING_FILE + "Can't open keybindings file %1 for reading. Default keybindings will be used." + IDS_UNABLE_TO_LOAD_KEYBINDINGS + "Loading keybindings failed. The keyboard won't work properly." + IDS_CANT_OPEN_FILE_FOR_WRITING "Can't open file for writing." END -#endif // Englisch (USA) resources +#endif // English (U.S.) resources ///////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////// -// Englisch (GB) resources +// English (U.K.) resources #if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENG) #ifdef _WIN32 @@ -2565,11 +2570,25 @@ // 1 RT_MANIFEST "res\\rt_manif.bin" -#endif // Englisch (GB) resources + ///////////////////////////////////////////////////////////////////////////// +// +// KEYBINDINGS +// +IDR_DEFAULT_KEYBINDINGS KEYBINDINGS "res\\defaultKeybindings.mkb" +///////////////////////////////////////////////////////////////////////////// +// +// TUNING +// +IDR_BUILTIN_TUNINGS TUNING "res\\built-inTunings.tc" +#endif // English (U.K.) resources +///////////////////////////////////////////////////////////////////////////// + + + #ifndef APSTUDIO_INVOKED ///////////////////////////////////////////////////////////////////////////// // Modified: trunk/OpenMPT/mptrack/mptrack.vcproj =================================================================== --- trunk/OpenMPT/mptrack/mptrack.vcproj 2009-08-18 18:41:12 UTC (rev 331) +++ trunk/OpenMPT/mptrack/mptrack.vcproj 2009-08-18 20:38:41 UTC (rev 332) @@ -638,9 +638,15 @@ RelativePath="res\bitmap1.bmp"> </File> <File + RelativePath=".\res\built-inTunings.tc"> + </File> + <File RelativePath=".\res\colors.bmp"> </File> <File + RelativePath=".\res\defaultKeyBindings.mkb"> + </File> + <File RelativePath=".\res\dragging.cur"> </File> <File Modified: trunk/OpenMPT/mptrack/mptrack_08.vcproj =================================================================== --- trunk/OpenMPT/mptrack/mptrack_08.vcproj 2009-08-18 18:41:12 UTC (rev 331) +++ trunk/OpenMPT/mptrack/mptrack_08.vcproj 2009-08-18 20:38:41 UTC (rev 332) @@ -1236,6 +1236,14 @@ </File> </Filter> <File + RelativePath=".\res\built-inTunings.tc" + > + </File> + <File + RelativePath=".\res\defaultKeybindings.mkb" + > + </File> + <File RelativePath=".\mptrack.reg" > </File> Added: trunk/OpenMPT/mptrack/res/built-inTunings.tc =================================================================== (Binary files differ) Property changes on: trunk/OpenMPT/mptrack/res/built-inTunings.tc ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Added: trunk/OpenMPT/mptrack/res/defaultKeybindings.mkb =================================================================== --- trunk/OpenMPT/mptrack/res/defaultKeybindings.mkb (rev 0) +++ trunk/OpenMPT/mptrack/res/defaultKeybindings.mkb 2009-08-18 20:38:41 UTC (rev 332) @@ -0,0 +1,280 @@ +//-------- OpenMPT key binding definition file ------- +//-Format is: - +//- Context:Command ID:Modifiers:Key:KeypressEventType //Comments - +//---------------------------------------------------------------------- + +//----( Global Context (0) )------------ +0:1347:2:78:1 //File/New: Ctrl+N (KeyDown) +0:1346:2:79:1 //File/Open: Ctrl+O (KeyDown) +0:1349:2:83:1 //File/Save: Ctrl+S (KeyDown) +0:1030:0:116:1 //Play song/Pause song: F5 (KeyDown) +0:1031:0:119:1 //Pause song: F8 (KeyDown) +0:1375:0:27:1 //Stop Song: ESC (KeyDown) +0:1029:0:117:1 //Play song from start: F6 (KeyDown) +0:1027:0:118:5 //Play pattern from start: F7 (KeyDown|KeyHold) +0:1026:2:118:5 //Play pattern from cursor: Ctrl+F7 (KeyDown|KeyHold) +0:1376:0:120:1 //Toggle Midi Record: F9 (KeyDown) +0:1359:2:90:1 //Undo: Ctrl+Z (KeyDown) +0:1360:2:88:1 //Cut: Ctrl+X (KeyDown) +0:1361:2:67:1 //Copy: Ctrl+C (KeyDown) +0:1361:2:45:1 //Copy: Ctrl+INSERT (KeyDown) +0:1362:2:86:1 //Paste: Ctrl+V (KeyDown) +0:1362:1:45:1 //Paste: Shift+INSERT (KeyDown) +0:1364:2:53:1 //SelectAll: Ctrl+5 (KeyDown) +0:1365:2:70:1 //Find: Ctrl+F (KeyDown) +0:1366:0:114:1 //Find Next: F3 (KeyDown) +0:1021:4:71:1 //View General: Alt+G (KeyDown) +0:1022:4:80:1 //View Pattern: Alt+P (KeyDown) +0:1023:4:83:1 //View Samples: Alt+S (KeyDown) +0:1024:4:78:1 //View Instruments: Alt+N (KeyDown) +0:1025:1:120:1 //View Comments: Shift+F9 (KeyDown) +0:1368:2:113:1 //Toggle Tree View: Ctrl+F2 (KeyDown) +0:1369:2:112:1 //View Options: Ctrl+F1 (KeyDown) +0:1370:0:112:1 //Help (to do): F1 (KeyDown) +0:1032:2:111:5 //Previous instrument: Ctrl+NUM DIVIDE (KeyDown|KeyHold) +0:1032:2:38:5 //Previous instrument: Ctrl+UP (KeyDown|KeyHold) +0:1033:2:106:5 //Next instrument: Ctrl+NUMMULT (KeyDown|KeyHold) +0:1033:2:40:5 //Next instrument: Ctrl+DOWN (KeyDown|KeyHold) +0:1036:0:111:1 //Previous octave: NUM DIVIDE (KeyDown) +0:1037:0:106:1 //Next octave: NUMMULT (KeyDown) +0:1034:2:37:5 //Previous order: Ctrl+LEFT (KeyDown|KeyHold) +0:1035:2:39:5 //Next order: Ctrl+RIGHT (KeyDown|KeyHold) + +//----( General Context [bottom] (1) )------------ + +//----( Pattern Context [bottom] (2) )------------ +2:1017:0:34:5 //Jump down by measure: PGDOWN (KeyDown|KeyHold) +2:1018:0:33:5 //Jump up by measure: PGUP (KeyDown|KeyHold) +2:1338:4:34:5 //Jump down by beat: Alt+PGDOWN (KeyDown|KeyHold) +2:1339:4:33:5 //Jump up by beat: Alt+PGUP (KeyDown|KeyHold) +2:1340:6:34:5 //Snap down to beat: Ctrl+Alt+PGDOWN (KeyDown|KeyHold) +2:1341:6:33:5 //Snap up to beat: Ctrl+Alt+PGUP (KeyDown|KeyHold) +2:1038:0:40:5 //Navigate down by 1 row: DOWN (KeyDown|KeyHold) +2:1039:0:38:5 //Navigate up by 1 row: UP (KeyDown|KeyHold) +2:1691:4:40:5 //Navigate down by spacing: Alt+DOWN (KeyDown|KeyHold) +2:1692:4:38:5 //Navigate up by spacing: Alt+UP (KeyDown|KeyHold) +2:1040:0:37:5 //Navigate left: LEFT (KeyDown|KeyHold) +2:1041:0:39:5 //Navigate right: RIGHT (KeyDown|KeyHold) +2:1042:0:9:5 //Navigate to next channel: TAB (KeyDown|KeyHold) +2:1043:1:9:5 //Navigate to previous channel: Shift+TAB (KeyDown|KeyHold) +2:1044:0:36:1 //Go to first channel: HOME (KeyDown) +2:1045:2:36:1 //Go to first row: Ctrl+HOME (KeyDown) +2:1046:6:36:1 //Go to first row of first channel: Ctrl+Alt+HOME (KeyDown) +2:1047:0:35:1 //Go to last channel: END (KeyDown) +2:1048:2:35:1 //Go to last row: Ctrl+END (KeyDown) +2:1049:6:35:1 //Go to last row of last channel: Ctrl+Alt+END (KeyDown) +2:1050:1:16:1 //Selection key: Shift (KeyDown) +2:1051:2:17:1 //Copy select key: Ctrl (KeyDown) +2:1011:2:76:1 //Select channel / Select all: Ctrl+L (KeyDown) +2:1663:0:122:1 //Toggle follow song: F11 (KeyDown) +2:1003:0:13:5 //Quick copy: ENTER (KeyDown|KeyHold) +2:1004:0:32:5 //Quick paste: SPACE (KeyDown|KeyHold) +2:1001:2:32:1 //Enable recording: Ctrl+SPACE (KeyDown) +2:1002:2:13:5 //Play row: Ctrl+ENTER (KeyDown|KeyHold) +2:1317:4:18:1 //Set row jump on note entry: Alt (KeyDown) +2:1685:2:9:1 //Switch to order list: Ctrl+TAB (KeyDown) +2:1662:6:80:1 //Toggle channel's plugin editor: Ctrl+Alt+P (KeyDown) +2:1062:0:93:1 //Show note properties: Application (KeyDown) +2:1005:0:121:5 //Mute current channel: F10 (KeyDown|KeyHold) +2:1006:2:121:5 //Solo current channel: Ctrl+F10 (KeyDown|KeyHold) +2:1007:2:81:5 //Transpose +1: Ctrl+Q (KeyDown|KeyHold) +2:1008:2:65:5 //Transpose -1: Ctrl+A (KeyDown|KeyHold) +2:1009:3:81:5 //Transpose +12: Shift+Ctrl+Q (KeyDown|KeyHold) +2:1010:3:65:5 //Transpose -12: Shift+Ctrl+A (KeyDown|KeyHold) +2:1012:2:77:1 //Amplify selection: Ctrl+M (KeyDown) +2:1014:2:74:1 //Interpolate volume: Ctrl+J (KeyDown) +2:1015:2:75:1 //Interpolate effect: Ctrl+K (KeyDown) +2:1016:4:66:1 //Open effect visualizer: Alt+B (KeyDown) +2:1766:2:71:1 //Go to row/channel/...: Ctrl+G (KeyDown) +2:1013:2:73:1 //Apply current instrument: Ctrl+I (KeyDown) +2:1660:4:69:5 //Grow selection: Alt+E (KeyDown|KeyHold) +2:1661:4:68:5 //Shrink selection: Alt+D (KeyDown|KeyHold) +2:1058:0:46:1 //Clear field: DELETE (KeyDown) +2:1664:1:190:1 //Clear field (IT Style): Shift+. (KeyDown) +2:1059:2:46:1 //Clear row and step: Ctrl+DELETE (KeyDown) +2:1665:1:46:5 //Clear field and step (IT Style): Shift+DELETE (KeyDown|KeyHold) +2:1061:0:8:5 //Delete rows: BACKSPACE (KeyDown|KeyHold) +2:1377:2:8:5 //Delete all rows: Ctrl+BACKSPACE (KeyDown|KeyHold) +2:1378:0:45:1 //Insert Row: INSERT (KeyDown) +2:1379:2:45:1 //Insert All Rows: Ctrl+INSERT (KeyDown) +2:1055:0:109:5 //Previous pattern: NUM SUB (KeyDown|KeyHold) +2:1054:0:107:5 //Next pattern: NUM PLUS (KeyDown|KeyHold) + +//----( Pattern Context [bottom] - Note Col (3) )------------ +3:1064:0:81:1 //Base octave C: Q (KeyDown) +3:1065:0:87:1 //Base octave C#: W (KeyDown) +3:1066:0:69:1 //Base octave D: E (KeyDown) +3:1067:0:82:1 //Base octave D#: R (KeyDown) +3:1068:0:84:1 //Base octave E: T (KeyDown) +3:1069:0:89:1 //Base octave F: Y (KeyDown) +3:1070:0:85:1 //Base octave F#: U (KeyDown) +3:1071:0:73:1 //Base octave G: I (KeyDown) +3:1072:0:79:1 //Base octave G#: O (KeyDown) +3:1073:0:80:1 //Base octave +1 A: P (KeyDown) +3:1074:0:219:1 //Base octave +1 A#: [ (KeyDown) +3:1075:0:221:1 //Base octave +1 B: ] (KeyDown) +3:1076:0:65:1 //Base octave +1 C: A (KeyDown) +3:1077:0:83:1 //Base octave +1 C#: S (KeyDown) +3:1078:0:68:1 //Base octave +1 D: D (KeyDown) +3:1079:0:70:1 //Base octave +1 D#: F (KeyDown) +3:1080:0:71:1 //Base octave +1 E: G (KeyDown) +3:1081:0:72:1 //Base octave +1 F: H (KeyDown) +3:1082:0:74:1 //Base octave +1 F#: J (KeyDown) +3:1083:0:75:1 //Base octave +1 G: K (KeyDown) +3:1084:0:76:1 //Base octave +1 G#: L (KeyDown) +3:1085:0:186:1 //Base octave +2 A: ; (KeyDown) +3:1086:0:222:1 //Base octave +2 A#: # (KeyDown) +3:1087:0:220:1 //Base octave +2 B: \ (KeyDown) +3:1088:0:90:1 //Base octave +2 C: Z (KeyDown) +3:1089:0:88:1 //Base octave +2 C#: X (KeyDown) +3:1090:0:67:1 //Base octave +2 D: C (KeyDown) +3:1091:0:86:1 //Base octave +2 D#: V (KeyDown) +3:1092:0:66:1 //Base octave +2 E: B (KeyDown) +3:1093:0:78:1 //Base octave +2 F: N (KeyDown) +3:1094:0:77:1 //Base octave +2 F#: M (KeyDown) +3:1095:0:188:1 //Base octave +2 G: , (KeyDown) +3:1096:0:190:1 //Base octave +2 G#: . (KeyDown) +3:1097:0:191:1 //Base octave +3 A: / (KeyDown) +3:1212:0:48:1 //Set octave 0: 0 (KeyDown) +3:1212:0:96:1 //Set octave 0: NUM 0 (KeyDown) +3:1213:0:49:1 //Set octave 1: 1 (KeyDown) +3:1213:0:97:1 //Set octave 1: NUM 1 (KeyDown) +3:1214:0:50:1 //Set octave 2: 2 (KeyDown) +3:1214:0:98:1 //Set octave 2: NUM 2 (KeyDown) +3:1215:0:51:1 //Set octave 3: 3 (KeyDown) +3:1215:0:99:1 //Set octave 3: NUM 3 (KeyDown) +3:1216:0:52:1 //Set octave 4: 4 (KeyDown) +3:1216:0:100:1 //Set octave 4: NUM 4 (KeyDown) +3:1217:0:53:1 //Set octave 5: 5 (KeyDown) +3:1217:0:101:1 //Set octave 5: NUM 5 (KeyDown) +3:1218:0:54:1 //Set octave 6: 6 (KeyDown) +3:1218:0:102:1 //Set octave 6: NUM 6 (KeyDown) +3:1219:0:55:1 //Set octave 7: 7 (KeyDown) +3:1219:0:103:1 //Set octave 7: NUM 7 (KeyDown) +3:1220:0:56:1 //Set octave 8: 8 (KeyDown) +3:1220:0:104:1 //Set octave 8: NUM 8 (KeyDown) +3:1221:0:57:1 //Set octave 9: 9 (KeyDown) +3:1221:0:105:1 //Set octave 9: NUM 9 (KeyDown) +3:1316:1:16:1 //Chord Modifier: Shift (KeyDown) +3:1200:0:192:1 //Note cut: ' (KeyDown) +3:1201:0:187:1 //Note off: = (KeyDown) + +//----( Pattern Context [bottom] - Ins Col (4) )------------ +4:1202:0:96:1 //Set instrument digit 0: NUM 0 (KeyDown) +4:1202:0:48:1 //Set instrument digit 0: 0 (KeyDown) +4:1203:0:97:1 //Set instrument digit 1: NUM 1 (KeyDown) +4:1203:0:49:1 //Set instrument digit 1: 1 (KeyDown) +4:1204:0:98:1 //Set instrument digit 2: NUM 2 (KeyDown) +4:1204:0:50:1 //Set instrument digit 2: 2 (KeyDown) +4:1205:0:99:1 //Set instrument digit 3: NUM 3 (KeyDown) +4:1205:0:51:1 //Set instrument digit 3: 3 (KeyDown) +4:1206:0:100:1 //Set instrument digit 4: NUM 4 (KeyDown) +4:1206:0:52:1 //Set instrument digit 4: 4 (KeyDown) +4:1207:0:101:1 //Set instrument digit 5: NUM 5 (KeyDown) +4:1207:0:53:1 //Set instrument digit 5: 5 (KeyDown) +4:1208:0:102:1 //Set instrument digit 6: NUM 6 (KeyDown) +4:1208:0:54:1 //Set instrument digit 6: 6 (KeyDown) +4:1209:0:103:1 //Set instrument digit 7: NUM 7 (KeyDown) +4:1209:0:55:1 //Set instrument digit 7: 7 (KeyDown) +4:1210:0:56:1 //Set instrument digit 8: 8 (KeyDown) +4:1211:0:105:1 //Set instrument digit 9: NUM 9 (KeyDown) +4:1211:0:57:1 //Set instrument digit 9: 9 (KeyDown) + +//----( Pattern Context [bottom] - Vol Col (5) )------------ +5:1222:0:48:1 //Set volume digit 0: 0 (KeyDown) +5:1222:0:96:1 //Set volume digit 0: NUM 0 (KeyDown) +5:1223:0:49:1 //Set volume digit 1: 1 (KeyDown) +5:1223:0:97:1 //Set volume digit 1: NUM 1 (KeyDown) +5:1224:0:50:1 //Set volume digit 2: 2 (KeyDown) +5:1224:0:98:1 //Set volume digit 2: NUM 2 (KeyDown) +5:1225:0:51:1 //Set volume digit 3: 3 (KeyDown) +5:1225:0:99:1 //Set volume digit 3: NUM 3 (KeyDown) +5:1226:0:52:1 //Set volume digit 4: 4 (KeyDown) +5:1226:0:100:1 //Set volume digit 4: NUM 4 (KeyDown) +5:1227:0:53:1 //Set volume digit 5: 5 (KeyDown) +5:1227:0:101:1 //Set volume digit 5: NUM 5 (KeyDown) +5:1228:0:54:1 //Set volume digit 6: 6 (KeyDown) +5:1228:0:102:1 //Set volume digit 6: NUM 6 (KeyDown) +5:1229:0:55:1 //Set volume digit 7: 7 (KeyDown) +5:1229:0:103:1 //Set volume digit 7: NUM 7 (KeyDown) +5:1230:0:56:1 //Set volume digit 8: 8 (KeyDown) +5:1231:0:57:1 //Set volume digit 9: 9 (KeyDown) +5:1231:0:105:1 //Set volume digit 9: NUM 9 (KeyDown) +5:1232:0:86:1 //Vol command - volume: V (KeyDown) +5:1233:0:80:1 //Vol command - pan: P (KeyDown) +5:1234:0:67:1 //Vol command - vol slide up: C (KeyDown) +5:1235:0:68:1 //Vol command - vol slide down: D (KeyDown) +5:1236:0:65:1 //Vol command - vol fine slide up: A (KeyDown) +5:1237:0:66:1 //Vol command - vol fine slide down: B (KeyDown) +5:1238:0:85:1 //Vol command - vibrato speed: U (KeyDown) +5:1239:0:72:1 //Vol command - vibrato: H (KeyDown) +5:1240:0:76:1 //Vol command - XM pan left: L (KeyDown) +5:1241:0:82:1 //Vol command - XM pan right: R (KeyDown) +5:1242:0:71:1 //Vol command - Portamento: G (KeyDown) +5:1243:0:70:1 //Vol command - Portamento Up: F (KeyDown) +5:1244:0:69:1 //Vol command - Portamento Down: E (KeyDown) +5:1245:1:186:1 //Vol command - Velocity: Shift+; (KeyDown) +5:1246:0:79:1 //Vol command - Offset: O (KeyDown) + +//----( Pattern Context [bottom] - FX Col (6) )------------ +6:1294:0:220:1 //FX midi macro slide: \ (KeyDown) +6:1295:1:186:1 //FX pseudo-velocity (experimental): Shift+; (KeyDown) + +//----( Pattern Context [bottom] - Param Col (7) )------------ +7:1247:0:48:1 //FX Param digit 0: 0 (KeyDown) +7:1247:0:96:1 //FX Param digit 0: NUM 0 (KeyDown) +7:1248:0:49:1 //FX Param digit 1: 1 (KeyDown) +7:1248:0:97:1 //FX Param digit 1: NUM 1 (KeyDown) +7:1249:0:50:1 //FX Param digit 2: 2 (KeyDown) +7:1249:0:98:1 //FX Param digit 2: NUM 2 (KeyDown) +7:1250:0:51:1 //FX Param digit 3: 3 (KeyDown) +7:1250:0:99:1 //FX Param digit 3: NUM 3 (KeyDown) +7:1251:0:52:1 //FX Param digit 4: 4 (KeyDown) +7:1251:0:100:1 //FX Param digit 4: NUM 4 (KeyDown) +7:1252:0:53:1 //FX Param digit 5: 5 (KeyDown) +7:1252:0:101:1 //FX Param digit 5: NUM 5 (KeyDown) +7:1253:0:54:1 //FX Param digit 6: 6 (KeyDown) +7:1253:0:102:1 //FX Param digit 6: NUM 6 (KeyDown) +7:1254:0:55:1 //FX Param digit 7: 7 (KeyDown) +7:1254:0:103:1 //FX Param digit 7: NUM 7 (KeyDown) +7:1255:0:56:1 //FX Param digit 8: 8 (KeyDown) +7:1255:0:104:1 //FX Param digit 8: NUM 8 (KeyDown) +7:1256:0:57:1 //FX Param digit 9: 9 (KeyDown) +7:1256:0:105:1 //FX Param digit 9: NUM 9 (KeyDown) +7:1257:0:65:1 //FX Param digit A: A (KeyDown) +7:1258:0:66:1 //FX Param digit B: B (KeyDown) +7:1259:0:67:1 //FX Param digit C: C (KeyDown) +7:1260:0:68:1 //FX Param digit D: D (KeyDown) +7:1261:0:69:1 //FX Param digit E: E (KeyDown) +7:1262:0:70:1 //FX Param digit F: F (KeyDown) + +//----( Sample Context [bottom] (8) )------------ +8:1380:2:84:1 //Trim sample around loop points: Ctrl+T (KeyDown) +8:1383:0:8:1 //Silence sample selection: BACKSPACE (KeyDown) +8:1385:3:65:1 //Amplify Sample: Shift+Ctrl+A (KeyDown) +8:1381:3:82:1 //Reverse sample: Shift+Ctrl+R (KeyDown) +8:1382:0:46:1 //Delete sample selection: DELETE (KeyDown) +8:1386:0:107:1 //Zoom Out: NUM PLUS (KeyDown) +8:1387:0:109:1 //Zoom In: NUM SUB (KeyDown) + +//----( Instrument Context [bottom] (9) )------------ + +//----( Comments Context [bottom] (10) )------------ + +//----( Unknown Context (11) )------------ + +//----( Unknown Context (12) )------------ + +//----( Plugin GUI Context (13) )------------ + +//----( General Context [top] (14) )------------ + +//----( Pattern Context [top] (15) )------------ + +//----( Sample Context [top] (16) )------------ + +//----( Instrument Context [top] (17) )------------ + +//----( Comments Context [top] (18) )------------ + +//----( Unknown Context (19) )------------ Modified: trunk/OpenMPT/mptrack/resource.h =================================================================== --- trunk/OpenMPT/mptrack/resource.h 2009-08-18 18:41:12 UTC (rev 331) +++ trunk/OpenMPT/mptrack/resource.h 2009-08-18 20:38:41 UTC (rev 332) @@ -47,6 +47,9 @@ #define IDS_ERR_NO_TUNING_SELECTION 208 #define IDS_UNSUPPORTED_TUNING_DnD 209 #define IDS_OPERATION_FAIL 210 +#define IDS_CANT_OPEN_KEYBINDING_FILE 211 +#define IDS_UNABLE_TO_LOAD_KEYBINDINGS 212 +#define IDS_CANT_OPEN_FILE_FOR_WRITING 213 #define IDB_MAINBAR 300 #define IDB_IMAGELIST 301 #define IDB_PATTERNS 302 @@ -107,6 +110,8 @@ #define IDD_MSGBOX_HIDABLE 516 #define IDD_ADDSILENCE 517 #define IDD_MODLOADING_WARNINGS 518 +#define IDR_DEFAULT_KEYBINDINGS 519 +#define IDR_BUILTIN_TUNINGS 520 #define IDC_BUTTON1 1001 #define IDC_BUTTON2 1002 #define IDC_BUTTON3 1003 @@ -1116,7 +1121,7 @@ #ifdef APSTUDIO_INVOKED #ifndef APSTUDIO_READONLY_SYMBOLS #define _APS_3D_CONTROLS 1 -#define _APS_NEXT_RESOURCE_VALUE 519 +#define _APS_NEXT_RESOURCE_VALUE 521 #define _APS_NEXT_COMMAND_VALUE 59229 #define _APS_NEXT_CONTROL_VALUE 2386 #define _APS_NEXT_SYMED_VALUE 901 Deleted: trunk/OpenMPT/packageTemplate/default.mkb =================================================================== --- trunk/OpenMPT/packageTemplate/default.mkb 2009-08-18 18:41:12 UTC (rev 331) +++ trunk/OpenMPT/packageTemplate/default.mkb 2009-08-18 20:38:41 UTC (rev 332) @@ -1,280 +0,0 @@ -//-------- OpenMPT key binding definition file ------- -//-Format is: - -//- Context:Command ID:Modifiers:Key:KeypressEventType //Comments - -//---------------------------------------------------------------------- - -//----( Global Context (0) )------------ -0:1347:2:78:1 //File/New: Ctrl+N (KeyDown) -0:1346:2:79:1 //File/Open: Ctrl+O (KeyDown) -0:1349:2:83:1 //File/Save: Ctrl+S (KeyDown) -0:1030:0:116:1 //Play song/Pause song: F5 (KeyDown) -0:1031:0:119:1 //Pause song: F8 (KeyDown) -0:1375:0:27:1 //Stop Song: ESC (KeyDown) -0:1029:0:117:1 //Play song from start: F6 (KeyDown) -0:1027:0:118:5 //Play pattern from start: F7 (KeyDown|KeyHold) -0:1026:2:118:5 //Play pattern from cursor: Ctrl+F7 (KeyDown|KeyHold) -0:1376:0:120:1 //Toggle Midi Record: F9 (KeyDown) -0:1359:2:90:1 //Undo: Ctrl+Z (KeyDown) -0:1360:2:88:1 //Cut: Ctrl+X (KeyDown) -0:1361:2:67:1 //Copy: Ctrl+C (KeyDown) -0:1361:2:45:1 //Copy: Ctrl+INSERT (KeyDown) -0:1362:2:86:1 //Paste: Ctrl+V (KeyDown) -0:1362:1:45:1 //Paste: Shift+INSERT (KeyDown) -0:1364:2:53:1 //SelectAll: Ctrl+5 (KeyDown) -0:1365:2:70:1 //Find: Ctrl+F (KeyDown) -0:1366:0:114:1 //Find Next: F3 (KeyDown) -0:1021:4:71:1 //View General: Alt+G (KeyDown) -0:1022:4:80:1 //View Pattern: Alt+P (KeyDown) -0:1023:4:83:1 //View Samples: Alt+S (KeyDown) -0:1024:4:78:1 //View Instruments: Alt+N (KeyDown) -0:1025:1:120:1 //View Comments: Shift+F9 (KeyDown) -0:1368:2:113:1 //Toggle Tree View: Ctrl+F2 (KeyDown) -0:1369:2:112:1 //View Options: Ctrl+F1 (KeyDown) -0:1370:0:112:1 //Help (to do): F1 (KeyDown) -0:1032:2:111:5 //Previous instrument: Ctrl+NUM DIVIDE (KeyDown|KeyHold) -0:1032:2:38:5 //Previous instrument: Ctrl+UP (KeyDown|KeyHold) -0:1033:2:106:5 //Next instrument: Ctrl+NUMMULT (KeyDown|KeyHold) -0:1033:2:40:5 //Next instrument: Ctrl+DOWN (KeyDown|KeyHold) -0:1036:0:111:1 //Previous octave: NUM DIVIDE (KeyDown) -0:1037:0:106:1 //Next octave: NUMMULT (KeyDown) -0:1034:2:37:5 //Previous order: Ctrl+LEFT (KeyDown|KeyHold) -0:1035:2:39:5 //Next order: Ctrl+RIGHT (KeyDown|KeyHold) - -//----( General Context [bottom] (1) )------------ - -//----( Pattern Context [bottom] (2) )------------ -2:1017:0:34:5 //Jump down by measure: PGDOWN (KeyDown|KeyHold) -2:1018:0:33:5 //Jump up by measure: PGUP (KeyDown|KeyHold) -2:1338:4:34:5 //Jump down by beat: Alt+PGDOWN (KeyDown|KeyHold) -2:1339:4:33:5 //Jump up by beat: Alt+PGUP (KeyDown|KeyHold) -2:1340:6:34:5 //Snap down to beat: Ctrl+Alt+PGDOWN (KeyDown|KeyHold) -2:1341:6:33:5 //Snap up to beat: Ctrl+Alt+PGUP (KeyDown|KeyHold) -2:1038:0:40:5 //Navigate down by 1 row: DOWN (KeyDown|KeyHold) -2:1039:0:38:5 //Navigate up by 1 row: UP (KeyDown|KeyHold) -2:1691:4:40:5 //Navigate down by spacing: Alt+DOWN (KeyDown|KeyHold) -2:1692:4:38:5 //Navigate up by spacing: Alt+UP (KeyDown|KeyHold) -2:1040:0:37:5 //Navigate left: LEFT (KeyDown|KeyHold) -2:1041:0:39:5 //Navigate right: RIGHT (KeyDown|KeyHold) -2:1042:0:9:5 //Navigate to next channel: TAB (KeyDown|KeyHold) -2:1043:1:9:5 //Navigate to previous channel: Shift+TAB (KeyDown|KeyHold) -2:1044:0:36:1 //Go to first channel: HOME (KeyDown) -2:1045:2:36:1 //Go to first row: Ctrl+HOME (KeyDown) -2:1046:6:36:1 //Go to first row of first channel: Ctrl+Alt+HOME (KeyDown) -2:1047:0:35:1 //Go to last channel: END (KeyDown) -2:1048:2:35:1 //Go to last row: Ctrl+END (KeyDown) -2:1049:6:35:1 //Go to last row of last channel: Ctrl+Alt+END (KeyDown) -2:1050:1:16:1 //Selection key: Shift (KeyDown) -2:1051:2:17:1 //Copy select key: Ctrl (KeyDown) -2:1011:2:76:1 //Select channel / Select all: Ctrl+L (KeyDown) -2:1663:0:122:1 //Toggle follow song: F11 (KeyDown) -2:1003:0:13:5 //Quick copy: ENTER (KeyDown|KeyHold) -2:1004:0:32:5 //Quick paste: SPACE (KeyDown|KeyHold) -2:1001:2:32:1 //Enable recording: Ctrl+SPACE (KeyDown) -2:1002:2:13:5 //Play row: Ctrl+ENTER (KeyDown|KeyHold) -2:1317:4:18:1 //Set row jump on note entry: Alt (KeyDown) -2:1685:2:9:1 //Switch to order list: Ctrl+TAB (KeyDown) -2:1662:6:80:1 //Toggle channel's plugin editor: Ctrl+Alt+P (KeyDown) -2:1062:0:93:1 //Show note properties: Application (KeyDown) -2:1005:0:121:5 //Mute current channel: F10 (KeyDown|KeyHold) -2:1006:2:121:5 //Solo current channel: Ctrl+F10 (KeyDown|KeyHold) -2:1007:2:81:5 //Transpose +1: Ctrl+Q (KeyDown|KeyHold) -2:1008:2:65:5 //Transpose -1: Ctrl+A (KeyDown|KeyHold) -2:1009:3:81:5 //Transpose +12: Shift+Ctrl+Q (KeyDown|KeyHold) -2:1010:3:65:5 //Transpose -12: Shift+Ctrl+A (KeyDown|KeyHold) -2:1012:2:77:1 //Amplify selection: Ctrl+M (KeyDown) -2:1014:2:74:1 //Interpolate volume: Ctrl+J (KeyDown) -2:1015:2:75:1 //Interpolate effect: Ctrl+K (KeyDown) -2:1016:4:66:1 //Open effect visualizer: Alt+B (KeyDown) -2:1766:2:71:1 //Go to row/channel/...: Ctrl+G (KeyDown) -2:1013:2:73:1 //Apply current instrument: Ctrl+I (KeyDown) -2:1660:4:69:5 //Grow selection: Alt+E (KeyDown|KeyHold) -2:1661:4:68:5 //Shrink selection: Alt+D (KeyDown|KeyHold) -2:1058:0:46:1 //Clear field: DELETE (KeyDown) -2:1664:1:190:1 //Clear field (IT Style): Shift+. (KeyDown) -2:1059:2:46:1 //Clear row and step: Ctrl+DELETE (KeyDown) -2:1665:1:46:5 //Clear field and step (IT Style): Shift+DELETE (KeyDown|KeyHold) -2:1061:0:8:5 //Delete rows: BACKSPACE (KeyDown|KeyHold) -2:1377:2:8:5 //Delete all rows: Ctrl+BACKSPACE (KeyDown|KeyHold) -2:1378:0:45:1 //Insert Row: INSERT (KeyDown) -2:1379:2:45:1 //Insert All Rows: Ctrl+INSERT (KeyDown) -2:1055:0:109:5 //Previous pattern: NUM SUB (KeyDown|KeyHold) -2:1054:0:107:5 //Next pattern: NUM PLUS (KeyDown|KeyHold) - -//----( Pattern Context [bottom] - Note Col (3) )------------ -3:1064:0:81:1 //Base octave C: Q (KeyDown) -3:1065:0:87:1 //Base octave C#: W (KeyDown) -3:1066:0:69:1 //Base octave D: E (KeyDown) -3:1067:0:82:1 //Base octave D#: R (KeyDown) -3:1068:0:84:1 //Base octave E: T (KeyDown) -3:1069:0:89:1 //Base octave F: Y (KeyDown) -3:1070:0:85:1 //Base octave F#: U (KeyDown) -3:1071:0:73:1 //Base octave G: I (KeyDown) -3:1072:0:79:1 //Base octave G#: O (KeyDown) -3:1073:0:80:1 //Base octave +1 A: P (KeyDown) -3:1074:0:219:1 //Base octave +1 A#: [ (KeyDown) -3:1075:0:221:1 //Base octave +1 B: ] (KeyDown) -3:1076:0:65:1 //Base octave +1 C: A (KeyDown) -3:1077:0:83:1 //Base octave +1 C#: S (KeyDown) -3:1078:0:68:1 //Base octave +1 D: D (KeyDown) -3:1079:0:70:1 //Base octave +1 D#: F (KeyDown) -3:1080:0:71:1 //Base octave +1 E: G (KeyDown) -3:1081:0:72:1 //Base octave +1 F: H (KeyDown) -3:1082:0:74:1 //Base octave +1 F#: J (KeyDown) -3:1083:0:75:1 //Base octave +1 G: K (KeyDown) -3:1084:0:76:1 //Base octave +1 G#: L (KeyDown) -3:1085:0:186:1 //Base octave +2 A: ; (KeyDown) -3:1086:0:222:1 //Base octave +2 A#: # (KeyDown) -3:1087:0:220:1 //Base octave +2 B: \ (KeyDown) -3:1088:0:90:1 //Base octave +2 C: Z (KeyDown) -3:1089:0:88:1 //Base octave +2 C#: X (KeyDown) -3:1090:0:67:1 //Base octave +2 D: C (KeyDown) -3:1091:0:86:1 //Base octave +2 D#: V (KeyDown) -3:1092:0:66:1 //Base octave +2 E: B (KeyDown) -3:1093:0:78:1 //Base octave +2 F: N (KeyDown) -3:1094:0:77:1 //Base octave +2 F#: M (KeyDown) -3:1095:0:188:1 //Base octave +2 G: , (KeyDown) -3:1096:0:190:1 //Base octave +2 G#: . (KeyDown) -3:1097:0:191:1 //Base octave +3 A: / (KeyDown) -3:1212:0:48:1 //Set octave 0: 0 (KeyDown) -3:1212:0:96:1 //Set octave 0: NUM 0 (KeyDown) -3:1213:0:49:1 //Set octave 1: 1 (KeyDown) -3:1213:0:97:1 //Set octave 1: NUM 1 (KeyDown) -3:1214:0:50:1 //Set octave 2: 2 (KeyDown) -3:1214:0:98:1 //Set octave 2: NUM 2 (KeyDown) -3:1215:0:51:1 //Set octave 3: 3 (KeyDown) -3:1215:0:99:1 //Set octave 3: NUM 3 (KeyDown) -3:1216:0:52:1 //Set octave 4: 4 (KeyDown) -3:1216:0:100:1 //Set octave 4: NUM 4 (KeyDown) -3:1217:0:53:1 //Set octave 5: 5 (KeyDown) -3:1217:0:101:1 //Set octave 5: NUM 5 (KeyDown) -3:1218:0:54:1 //Set octave 6: 6 (KeyDown) -3:1218:0:102:1 //Set octave 6: NUM 6 (KeyDown) -3:1219:0:55:1 //Set octave 7: 7 (KeyDown) -3:1219:0:103:1 //Set octave 7: NUM 7 (KeyDown) -3:1220:0:56:1 //Set octave 8: 8 (KeyDown) -3:1220:0:104:1 //Set octave 8: NUM 8 (KeyDown) -3:1221:0:57:1 //Set octave 9: 9 (KeyDown) -3:1221:0:105:1 //Set octave 9: NUM 9 (KeyDown) -3:1316:1:16:1 //Chord Modifier: Shift (KeyDown) -3:1200:0:192:1 //Note cut: ' (KeyDown) -3:1201:0:187:1 //Note off: = (KeyDown) - -//----( Pattern Context [bottom] - Ins Col (4) )------------ -4:1202:0:96:1 //Set instrument digit 0: NUM 0 (KeyDown) -4:1202:0:48:1 //Set instrument digit 0: 0 (KeyDown) -4:1203:0:97:1 //Set instrument digit 1: NUM 1 (KeyDown) -4:1203:0:49:1 //Set instrument digit 1: 1 (KeyDown) -4:1204:0:98:1 //Set instrument digit 2: NUM 2 (KeyDown) -4:1204:0:50:1 //Set instrument digit 2: 2 (KeyDown) -4:1205:0:99:1 //Set instrument digit 3: NUM 3 (KeyDown) -4:1205:0:51:1 //Set instrument digit 3: 3 (KeyDown) -4:1206:0:100:1 //Set instrument digit 4: NUM 4 (KeyDown) -4:1206:0:52:1 //Set instrument digit 4: 4 (KeyDown) -4:1207:0:101:1 //Set instrument digit 5: NUM 5 (KeyDown) -4:1207:0:53:1 //Set instrument digit 5: 5 (KeyDown) -4:1208:0:102:1 //Set instrument digit 6: NUM 6 (KeyDown) -4:1208:0:54:1 //Set instrument digit 6: 6 (KeyDown) -4:1209:0:103:1 //Set instrument digit 7: NUM 7 (KeyDown) -4:1209:0:55:1 //Set instrument digit 7: 7 (KeyDown) -4:1210:0:56:1 //Set instrument digit 8: 8 (KeyDown) -4:1211:0:105:1 //Set instrument digit 9: NUM 9 (KeyDown) -4:1211:0:57:1 //Set instrument digit 9: 9 (KeyDown) - -//----( Pattern Context [bottom] - Vol Col (5) )------------ -5:1222:0:48:1 //Set volume digit 0: 0 (KeyDown) -5:1222:0:96:1 //Set volume digit 0: NUM 0 (KeyDown) -5:1223:0:49:1 //Set volume digit 1: 1 (KeyDown) -5:1223:0:97:1 //Set volume digit 1: NUM 1 (KeyDown) -5:1224:0:50:1 //Set volume digit 2: 2 (KeyDown) -5:1224:0:98:1 //Set volume digit 2: NUM 2 (KeyDown) -5:1225:0:51:1 //Set volume digit 3: 3 (KeyDown) -5:1225:0:99:1 //Set volume digit 3: NUM 3 (KeyDown) -5:1226:0:52:1 //Set volume digit 4: 4 (KeyDown) -5:1226:0:100:1 //Set volume digit 4: NUM 4 (KeyDown) -5:1227:0:53:1 //Set volume digit 5: 5 (KeyDown) -5:1227:0:101:1 //Set volume digit 5: NUM 5 (KeyDown) -5:1228:0:54:1 //Set volume digit 6: 6 (KeyDown) -5:1228:0:102:1 //Set volume digit 6: NUM 6 (KeyDown) -5:1229:0:55:1 //Set volume digit 7: 7 (KeyDown) -5:1229:0:103:1 //Set volume digit 7: NUM 7 (KeyDown) -5:1230:0:56:1 //Set volume digit 8: 8 (KeyDown) -5:1231:0:57:1 //Set volume digit 9: 9 (KeyDown) -5:1231:0:105:1 //Set volume digit 9: NUM 9 (KeyDown) -5:1232:0:86:1 //Vol command - volume: V (KeyDown) -5:1233:0:80:1 //Vol command - pan: P (KeyDown) -5:1234:0:67:1 //Vol command - vol slide up: C (KeyDown) -5:1235:0:68:1 //Vol command - vol slide down: D (KeyDown) -5:1236:0:65:1 //Vol command - vol fine slide up: A (KeyDown) -5:1237:0:66:1 //Vol command - vol fine slide down: B (KeyDown) -5:1238:0:85:1 //Vol command - vibrato speed: U (KeyDown) -5:1239:0:72:1 //Vol command - vibrato: H (KeyDown) -5:1240:0:76:1 //Vol command - XM pan left: L (KeyDown) -5:1241:0:82:1 //Vol command - XM pan right: R (KeyDown) -5:1242:0:71:1 //Vol command - Portamento: G (KeyDown) -5:1243:0:70:1 //Vol command - Portamento Up: F (KeyDown) -5:1244:0:69:1 //Vol command - Portamento Down: E (KeyDown) -5:1245:1:186:1 //Vol command - Velocity: Shift+; (KeyDown) -5:1246:0:79:1 //Vol command - Offset: O (KeyDown) - -//----( Pattern Context [bottom] - FX Col (6) )------------ -6:1294:0:220:1 //FX midi macro slide: \ (KeyDown) -6:1295:1:186:1 //FX pseudo-velocity (experimental): Shift+; (KeyDown) - -//----( Pattern Context [bottom] - Param Col (7) )------------ -7:1247:0:48:1 //FX Param digit 0: 0 (KeyDown) -7:1247:0:96:1 //FX Param digit 0: NUM 0 (KeyDown) -7:1248:0:49:1 //FX Param digit 1: 1 (KeyDown) -7:1248:0:97:1 //FX Param digit 1: NUM 1 (KeyDown) -7:1249:0:50:1 //FX Param digit 2: 2 (KeyDown) -7:1249:0:98:1 //FX Param digit 2: NUM 2 (KeyDown) -7:1250:0:51:1 //FX Param digit 3: 3 (KeyDown) -7:1250:0:99:1 //FX Param digit 3: NUM 3 (KeyDown) -7:1251:0:52:1 //FX Param digit 4: 4 (KeyDown) -7:1251:0:100:1 //FX Param digit 4: NUM 4 (KeyDown) -7:1252:0:53:1 //FX Param digit 5: 5 (KeyDown) -7:1252:0:101:1 //FX Param digit 5: NUM 5 (KeyDown) -7:1253:0:54:1 //FX Param digit 6: 6 (KeyDown) -7:1253:0:102:1 //FX Param digit 6: NUM 6 (KeyDown) -7:1254:0:55:1 //FX Param digit 7: 7 (KeyDown) -7:1254:0:103:1 //FX Param digit 7: NUM 7 (KeyDown) -7:1255:0:56:1 //FX Param digit 8: 8 (KeyDown) -7:1255:0:104:1 //FX Param digit 8: NUM 8 (KeyDown) -7:1256:0:57:1 //FX Param digit 9: 9 (KeyDown) -7:1256:0:105:1 //FX Param digit 9: NUM 9 (KeyDown) -7:1257:0:65:1 //FX Param digit A: A (KeyDown) -7:1258:0:66:1 //FX Param digit B: B (KeyDown) -7:1259:0:67:1 //FX Param digit C: C (KeyDown) -7:1260:0:68:1 //FX Param digit D: D (KeyDown) -7:1261:0:69:1 //FX Param digit E: E (KeyDown) -7:1262:0:70:1 //FX Param digit F: F (KeyDown) - -//----( Sample Context [bottom] (8) )------------ -8:1380:2:84:1 //Trim sample around loop points: Ctrl+T (KeyDown) -8:1383:0:8:1 //Silence sample selection: BACKSPACE (KeyDown) -8:1385:3:65:1 //Amplify Sample: Shift+Ctrl+A (KeyDown) -8:1381:3:82:1 //Reverse sample: Shift+Ctrl+R (KeyDown) -8:1382:0:46:1 //Delete sample selection: DELETE (KeyDown) -8:1386:0:107:1 //Zoom Out: NUM PLUS (KeyDown) -8:1387:0:109:1 //Zoom In: NUM SUB (KeyDown) - -//----( Instrument Context [bottom] (9) )------------ - -//----( Comments Context [bottom] (10) )------------ - -//----( Unknown Context (11) )------------ - -//----( Unknown Context (12) )------------ - -//----( Plugin GUI Context (13) )------------ - -//----( General Context [top] (14) )------------ - -//----( Pattern Context [top] (15) )------------ - -//----( Sample Context [top] (16) )------------ - -//----( Instrument Context [top] (17) )------------ - -//----( Comments Context [top] (18) )------------ - -//----( Unknown Context (19) )------------ Modified: trunk/OpenMPT/soundlib/Load_it.cpp =================================================================== --- trunk/OpenMPT/soundlib/Load_it.cpp 2009-08-18 18:41:12 UTC (rev 331) +++ trunk/OpenMPT/soundlib/Load_it.cpp 2009-08-18 20:38:41 UTC (rev 332) @@ -161,12 +161,12 @@ if(csf.Instruments[i]->pTuning) continue; - csf.Instruments[i]->pTuning = csf.GetStandardTunings().GetTuning(str); + csf.Instruments[i]->pTuning = csf.GetBuiltInTunings().GetTuning(str); if(csf.Instruments[i]->pTuning) continue; - if(str == "TET12" && csf.GetStandardTunings().GetNumTunings() > 0) - csf.Instruments[i]->pTuning = &csf.GetStandardTunings().GetTuning(0); + if(str == "TET12" && csf.GetBuiltInTunings().GetNumTunings() > 0) + csf.Instruments[i]->pTuning = &csf.GetBuiltInTunings().GetTuning(0); if(csf.Instruments[i]->pTuning) continue; Modified: trunk/OpenMPT/soundlib/Sndfile.cpp =================================================================== --- trunk/OpenMPT/soundlib/Sndfile.cpp 2009-08-18 18:41:12 UTC (rev 331) +++ trunk/OpenMPT/soundlib/Sndfile.cpp 2009-08-18 20:38:41 UTC (rev 332) @@ -390,7 +390,7 @@ ////////////////////////////////////////////////////////// // CSoundFile -CTuningCollection* CSoundFile::s_pTuningsSharedStandard(0); +CTuningCollection* CSoundFile::s_pTuningsSharedBuiltIn(0); CTuningCollection* CSoundFile::s_pTuningsSharedLocal(0); uint8 CSoundFile::s_DefaultPlugVolumeHandling = PLUGIN_VOLUMEHANDLING_IGNORE; @@ -2839,7 +2839,7 @@ //--------------------------------- { delete s_pTuningsSharedLocal; s_pTuningsSharedLocal = 0; - delete s_pTuningsSharedStandard; s_pTuningsSharedStandard = 0; + delete s_pTuningsSharedBuiltIn; s_pTuningsSharedBuiltIn = 0; } bool CSoundFile::SaveStaticTunings() @@ -2862,42 +2862,45 @@ bool CSoundFile::LoadStaticTunings() //----------------------------------- { - if(s_pTuningsSharedLocal || s_pTuningsSharedStandard) return true; + if(s_pTuningsSharedLocal || s_pTuningsSharedBuiltIn) return true; //For now not allowing to reload tunings(one should be careful when reloading them //since various parts may use addresses of the tuningobjects). CTuning::MessageHandler = &SimpleMessageBox; - - s_pTuningsSharedStandard = new CTuningCollection("Standard tunings"); + + s_pTuningsSharedBuiltIn = new CTuningCollection; s_pTuningsSharedLocal = new CTuningCollection("Local tunings"); - const string exeDir = CMainFrame::m_csExecutableDirectoryPath; - const string baseDirectoryName = exeDir + "tunings\\"; - string filenameBase; - string filename; - - s_pTuningsSharedStandard->SetSavefilePath(baseDirectoryName + string("standard\\std_tunings") + CTuningCollection::s_FileExtension); - s_pTuningsSharedLocal->SetSavefilePath(baseDirectoryName + string("local_tunings") + CTuningCollection::s_FileExtension); - - s_pTuningsSharedStandard->Deserialize(); - s_pTuningsSharedLocal->Deserialize(); - - //This condition should not be true. - if(s_pTuningsSharedStandard->GetNumTunings() == 0) + // Load built-in tunings. + const char* pData = nullptr; + HGLOBAL hglob = nullptr; + size_t nSize = 0; + if (LoadResource(MAKEINTRESOURCE(IDR_BUILTIN_TUNINGS), TEXT("TUNING"), pData, nSize, hglob) != nullptr) { + std::istrstream iStrm(pData, nSize); + s_pTuningsSharedBuiltIn->Deserialize(iStrm); + FreeResource(hglob); + } + if(s_pTuningsSharedBuiltIn->GetNumTunings() == 0) + { + ASSERT(false); CTuningRTI* pT = new CTuningRTI; //Note: Tuning collection class handles deleting. pT->CreateGeometric(1,1); - if(s_pTuningsSharedStandard->AddTuning(pT)) + if(s_pTuningsSharedBuiltIn->AddTuning(pT)) delete pT; } + + // Load local tunings. + s_pTuningsSharedLocal->SetSavefilePath(std::string(CMainFrame::m_csExecutableDirectoryPath + "tunings\\local_tunings" + CTuningCollection::s_FileExtension.c_str())); + s_pTuningsSharedLocal->Deserialize(); - //Enabling adding/removing of tunings for standard collection - //only for debug builds. + // Enabling adding/removing of tunings for standard collection + // only for debug builds. #ifdef DEBUG - s_pTuningsSharedStandard->SetConstStatus(CTuningCollection::EM_ALLOWALL); + s_pTuningsSharedBuiltIn->SetConstStatus(CTuningCollection::EM_ALLOWALL); #else - s_pTuningsSharedStandard->SetConstStatus(CTuningCollection::EM_CONST); + s_pTuningsSharedBuiltIn->SetConstStatus(CTuningCollection::EM_CONST); #endif MODINSTRUMENT::s_DefaultTuning = NULL; Modified: trunk/OpenMPT/soundlib/Sndfile.h =================================================================== --- trunk/OpenMPT/soundlib/Sndfile.h 2009-08-18 18:41:12 UTC (rev 331) +++ trunk/OpenMPT/soundlib/Sndfile.h 2009-08-18 20:38:41 UTC (rev 332) @@ -835,14 +835,14 @@ static bool LoadStaticTunings(); static bool SaveStaticTunings(); static void DeleteStaticdata(); - static CTuningCollection& GetStandardTunings() {return *s_pTuningsSharedStandard;} + static CTuningCollection& GetBuiltInTunings() {return *s_pTuningsSharedBuiltIn;} static CTuningCollection& GetLocalTunings() {return *s_pTuningsSharedLocal;} CTuningCollection& GetTuneSpecificTunings() {return *m_pTuningsTuneSpecific;} std::string GetNoteName(const int16&, const int inst = -1) const; private: CTuningCollection* m_pTuningsTuneSpecific; - static CTuningCollection* s_pTuningsSharedStandard; + static CTuningCollection* s_pTuningsSharedBuiltIn; static CTuningCollection* s_pTuningsSharedLocal; //<--Tuning This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |