From: <sag...@us...> - 2010-01-15 21:16:04
|
Revision: 466 http://modplug.svn.sourceforge.net/modplug/?rev=466&view=rev Author: saga-games Date: 2010-01-15 21:15:34 +0000 (Fri, 15 Jan 2010) Log Message: ----------- [Imp] Treeview: Right-click options for mod items: "View" and "Close" [Imp] Sample editor: When using timestretch, loop points could exceed sample length in some cases. [Mod] Updated keymap NO_mpt_classic_(rakib).mkb Modified Paths: -------------- trunk/OpenMPT/mptrack/Ctrl_smp.cpp trunk/OpenMPT/mptrack/View_tre.cpp trunk/OpenMPT/mptrack/View_tre.h trunk/OpenMPT/mptrack/resource.h trunk/OpenMPT/packageTemplate/extraKeymaps/NO_mpt_classic_(rakib).mkb Modified: trunk/OpenMPT/mptrack/Ctrl_smp.cpp =================================================================== --- trunk/OpenMPT/mptrack/Ctrl_smp.cpp 2010-01-14 20:46:32 UTC (rev 465) +++ trunk/OpenMPT/mptrack/Ctrl_smp.cpp 2010-01-15 21:15:34 UTC (rev 466) @@ -1711,19 +1711,17 @@ // Time stretching if(IsDlgButtonChecked(IDC_CHECK3)){ - //rewbs.timeStretchMods UpdateData(TRUE); //Ensure m_dTimeStretchRatio is up-to-date with textbox content errorcode = TimeStretch(m_dTimeStretchRatio/100.0); //Update loop points only if no error occured. if(errorcode == 0) { - pSmp->nLoopStart *= m_dTimeStretchRatio/100.0; - pSmp->nLoopEnd *= m_dTimeStretchRatio/100.0; - pSmp->nSustainStart *= m_dTimeStretchRatio/100.0; - pSmp->nSustainEnd *= m_dTimeStretchRatio/100.0; + pSmp->nLoopStart = min(pSmp->nLoopStart * (m_dTimeStretchRatio / 100.0), pSmp->nLength); + pSmp->nLoopEnd = min(pSmp->nLoopEnd * (m_dTimeStretchRatio/100.0), pSmp->nLength); + pSmp->nSustainStart = min(pSmp->nSustainStart * (m_dTimeStretchRatio/100.0), pSmp->nLength); + pSmp->nSustainEnd = min(pSmp->nSustainEnd * (m_dTimeStretchRatio/100.0), pSmp->nLength); } - //end rewbs.timeStretchMods } // Pitch shifting Modified: trunk/OpenMPT/mptrack/View_tre.cpp =================================================================== --- trunk/OpenMPT/mptrack/View_tre.cpp 2010-01-14 20:46:32 UTC (rev 465) +++ trunk/OpenMPT/mptrack/View_tre.cpp 2010-01-15 21:15:34 UTC (rev 466) @@ -76,6 +76,7 @@ ON_COMMAND(ID_MODTREE_DUPLICATE, OnDuplicateTreeItem) ON_COMMAND(ID_MODTREE_INSERT, OnInsertTreeItem) ON_COMMAND(ID_MODTREE_SWITCHTO, OnSwitchToTreeItem) + ON_COMMAND(ID_MODTREE_CLOSE, OnCloseItem) // -> CODE#0023 // -> DESC="IT project files (.itp)" @@ -2295,6 +2296,12 @@ SelectItem(hItem); switch(modItemType) { + case MODITEM_HDR_SONG: + nDefault = ID_MODTREE_EXECUTE; + AppendMenu(hMenu, MF_STRING, nDefault, "&View"); + AppendMenu(hMenu, MF_STRING, ID_MODTREE_CLOSE, "&Close"); + break; + case MODITEM_COMMENTS: nDefault = ID_MODTREE_EXECUTE; AppendMenu(hMenu, MF_STRING, nDefault, "&View Comments"); @@ -3205,3 +3212,13 @@ GetItem(&tvi); return (tvi.state & TVIS_EXPANDED) != 0 ? true : false; } + + +void CModTree::OnCloseItem() +//-------------------------- +{ + HTREEITEM hItem = GetSelectedItem(); + CModDoc *pModDoc = GetDocumentFromItem(hItem); + if(pModDoc == nullptr) return; + pModDoc->OnCloseDocument(); +} Modified: trunk/OpenMPT/mptrack/View_tre.h =================================================================== --- trunk/OpenMPT/mptrack/View_tre.h 2010-01-14 20:46:32 UTC (rev 465) +++ trunk/OpenMPT/mptrack/View_tre.h 2010-01-15 21:15:34 UTC (rev 466) @@ -209,6 +209,7 @@ afx_msg void OnDuplicateTreeItem(); afx_msg void OnInsertTreeItem(); afx_msg void OnSwitchToTreeItem(); // hack for sequence items to avoid double-click action + afx_msg void OnCloseItem(); // -> CODE#0023 // -> DESC="IT project files (.itp)" Modified: trunk/OpenMPT/mptrack/resource.h =================================================================== --- trunk/OpenMPT/mptrack/resource.h 2010-01-14 20:46:32 UTC (rev 465) +++ trunk/OpenMPT/mptrack/resource.h 2010-01-15 21:15:34 UTC (rev 466) @@ -1177,15 +1177,17 @@ #define ID_EDIT_PUSHFORWARDPASTE 59239 #define ID_EDIT_SPLITKEYBOARDSETTINGS 59240 #define ID_EDIT_PASTESPECIAL 59241 +#define ID_CHANGE_PCNOTE_PARAM 59242 +#define ID_MODTREE_CLOSE 60243 // Next default values for new objects // #ifdef APSTUDIO_INVOKED #ifndef APSTUDIO_READONLY_SYMBOLS #define _APS_3D_CONTROLS 1 -#define _APS_NEXT_RESOURCE_VALUE 524 -#define _APS_NEXT_COMMAND_VALUE 59242 -#define _APS_NEXT_CONTROL_VALUE 2413 +#define _APS_NEXT_RESOURCE_VALUE 526 +#define _APS_NEXT_COMMAND_VALUE 60244 +#define _APS_NEXT_CONTROL_VALUE 2426 #define _APS_NEXT_SYMED_VALUE 901 #endif #endif Modified: trunk/OpenMPT/packageTemplate/extraKeymaps/NO_mpt_classic_(rakib).mkb =================================================================== --- trunk/OpenMPT/packageTemplate/extraKeymaps/NO_mpt_classic_(rakib).mkb 2010-01-14 20:46:32 UTC (rev 465) +++ trunk/OpenMPT/packageTemplate/extraKeymaps/NO_mpt_classic_(rakib).mkb 2010-01-15 21:15:34 UTC (rev 466) @@ -22,6 +22,7 @@ 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+INS (KeyDown) 0:1362:2:86:1 //Paste: Ctrl+V (KeyDown) 0:1362:1:45:1 //Paste: Shift+INS (KeyDown) 0:1364:2:53:1 //SelectAll: Ctrl+5 (KeyDown) @@ -68,8 +69,7 @@ 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+SKIFT (KeyDown) -2:1051:2:17:1 //Copy select key: Ctrl (KeyDown) -2:1011:2:65:1 //Select channel / Select all: Ctrl+A (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: MELLOMROM (KeyDown|KeyHold) @@ -83,6 +83,7 @@ 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) @@ -114,6 +115,7 @@ 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 A: P (KeyDown) 3:1074:0:221:1 //Base octave A#: \xE5 (KeyDown) 3:1075:0:186:1 //Base octave B: T\xD8DLER (KeyDown) 3:1076:0:65:1 //Base octave +1 C: A (KeyDown) @@ -137,8 +139,8 @@ 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:189:1 //Base octave +2 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) @@ -158,9 +160,9 @@ 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+SKIFT (KeyDown) -3:1667:0:219:1 //Note Cut (don't remember instrument): \ (KeyDown) -3:1668:0:187:1 //Note Off (don't remember instrument): + (KeyDown) -3:1792:0:226:1 //Note Fade (don't remember instrument): < (KeyDown) +3:1200:0:219:1 //Note Cut: \ (KeyDown) +3:1201:0:187:1 //Note Off: + (KeyDown) +3:1791:1:219:1 //Note Fade: Shift+\ (KeyDown) //----( Pattern Context [bottom] - Ins Col (4) )------------ 4:1202:0:96:1 //Set instrument digit 0: NUM 0 (KeyDown) @@ -253,9 +255,9 @@ //----( Sample Context [bottom] (8) )------------ 8:1380:2:84:1 //Trim sample around loop points: Ctrl+T (KeyDown) -8:1384:3:78:1 //Normalise Sample: Shift+Ctrl+N (KeyDown) -8:1385:2:65:1 //Amplify Sample: Ctrl+A (KeyDown) -8:1381:2:82:1 //Reverse sample: Ctrl+R (KeyDown) +8:1383:0:8:1 //Silence sample selection: TILBAKE (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: DEL (KeyDown) 8:1386:0:107:1 //Zoom Out: NUM PLUSS (KeyDown) 8:1387:0:109:1 //Zoom In: NUM MINUS (KeyDown) @@ -264,6 +266,21 @@ 8:1790:2:68:1 //Remove DC Offset: Ctrl+D (KeyDown) //----( Instrument Context [bottom] (9) )------------ +9:1825:1:9:5 //Select previous envelope point: Shift+TAB (KeyDown|KeyHold) +9:1826:0:9:5 //Select next envelope point: TAB (KeyDown|KeyHold) +9:1821:0:37:5 //Move envelope point left: PIL VENSTRE (KeyDown|KeyHold) +9:1822:0:39:5 //Move envelope point right: PIL H\xD8YRE (KeyDown|KeyHold) +9:1823:0:38:5 //Move envelope point up: PIL OPP (KeyDown|KeyHold) +9:1834:0:33:5 //Move envelope point up (big step): PGUP (KeyDown|KeyHold) +9:1824:0:40:5 //Move envelope point down: PIL NED (KeyDown|KeyHold) +9:1835:0:34:5 //Move envelope point down (big step): PGDN (KeyDown|KeyHold) +9:1827:0:45:5 //Insert envelope point: INS (KeyDown|KeyHold) +9:1828:0:46:5 //Remove envelope point: DEL (KeyDown|KeyHold) +9:1829:0:36:1 //Set loop start: HOME (KeyDown) +9:1830:0:35:5 //Set loop end: END (KeyDown|KeyHold) +9:1831:2:36:1 //Set sustain loop start: Ctrl+HOME (KeyDown) +9:1832:2:35:1 //Set sustain loop end: Ctrl+END (KeyDown) +9:1833:2:82:1 //Toggle release node: Ctrl+R (KeyDown) //----( Comments Context [bottom] (10) )------------ This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <rel...@us...> - 2010-01-16 11:44:53
|
Revision: 467 http://modplug.svn.sourceforge.net/modplug/?rev=467&view=rev Author: relabsoluness Date: 2010-01-16 11:44:43 +0000 (Sat, 16 Jan 2010) Log Message: ----------- [Fix] Internal: Tentative fix to compile error in VC08 with SoundTouch resources. [Mod] Key bindings: Change to default key bindings. Modified Paths: -------------- trunk/OpenMPT/mptrack/res/defaultKeybindings.mkb trunk/OpenMPT/soundtouch/soundtouch.vcproj trunk/OpenMPT/soundtouch/soundtouch_08.vcproj Added Paths: ----------- trunk/OpenMPT/soundtouch/resource.h Modified: trunk/OpenMPT/mptrack/res/defaultKeybindings.mkb =================================================================== --- trunk/OpenMPT/mptrack/res/defaultKeybindings.mkb 2010-01-15 21:15:34 UTC (rev 466) +++ trunk/OpenMPT/mptrack/res/defaultKeybindings.mkb 2010-01-16 11:44:43 UTC (rev 467) @@ -168,8 +168,8 @@ 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) -3:1788:1:226:1 //Parameter control(MPTm only): Shift+< (KeyDown) -3:1789:0:226:1 //Parameter control(smooth)(MPTm only): < (KeyDown) +3:1788:1:189:1 //Parameter control(MPTm only): Shift+- (KeyDown) +3:1789:0:189:1 //Parameter control(smooth)(MPTm only): - (KeyDown) //----( Pattern Context [bottom] - Ins Col (4) )------------ 4:1202:0:96:1 //Set instrument digit 0: NUM 0 (KeyDown) Added: trunk/OpenMPT/soundtouch/resource.h =================================================================== --- trunk/OpenMPT/soundtouch/resource.h (rev 0) +++ trunk/OpenMPT/soundtouch/resource.h 2010-01-16 11:44:43 UTC (rev 467) @@ -0,0 +1,15 @@ +//{{NO_DEPENDENCIES}} +// Microsoft Visual C++ generated include file. +// Used by SoundTouchDLL.rc +// + +// Next default values for new objects +// +#ifdef APSTUDIO_INVOKED +#ifndef APSTUDIO_READONLY_SYMBOLS +#define _APS_NEXT_RESOURCE_VALUE 101 +#define _APS_NEXT_COMMAND_VALUE 40001 +#define _APS_NEXT_CONTROL_VALUE 1001 +#define _APS_NEXT_SYMED_VALUE 101 +#endif +#endif Modified: trunk/OpenMPT/soundtouch/soundtouch.vcproj =================================================================== --- trunk/OpenMPT/soundtouch/soundtouch.vcproj 2010-01-15 21:15:34 UTC (rev 466) +++ trunk/OpenMPT/soundtouch/soundtouch.vcproj 2010-01-16 11:44:43 UTC (rev 467) @@ -191,6 +191,9 @@ RelativePath=".\RateTransposer.h"> </File> <File + RelativePath=".\resource.h"> + </File> + <File RelativePath=".\SoundTouch.h"> </File> <File Modified: trunk/OpenMPT/soundtouch/soundtouch_08.vcproj =================================================================== --- trunk/OpenMPT/soundtouch/soundtouch_08.vcproj 2010-01-15 21:15:34 UTC (rev 466) +++ trunk/OpenMPT/soundtouch/soundtouch_08.vcproj 2010-01-16 11:44:43 UTC (rev 467) @@ -277,6 +277,10 @@ > </File> <File + RelativePath=".\resource.h" + > + </File> + <File RelativePath=".\SoundTouch.h" > </File> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <sag...@us...> - 2010-01-16 19:49:00
|
Revision: 469 http://modplug.svn.sourceforge.net/modplug/?rev=469&view=rev Author: saga-games Date: 2010-01-16 19:48:28 +0000 (Sat, 16 Jan 2010) Log Message: ----------- [New] Added InnoSetup script and resources for OpenMPT installer. Added Paths: ----------- trunk/OpenMPT/installer/ trunk/OpenMPT/installer/filetypes.iss trunk/OpenMPT/installer/install-big.bmp trunk/OpenMPT/installer/install-small.bmp trunk/OpenMPT/installer/install.iss trunk/OpenMPT/installer/mpt.ico trunk/OpenMPT/installer/packageTemplate/ trunk/OpenMPT/installer/packageTemplate/readme.txt Added: trunk/OpenMPT/installer/filetypes.iss =================================================================== --- trunk/OpenMPT/installer/filetypes.iss (rev 0) +++ trunk/OpenMPT/installer/filetypes.iss 2010-01-16 19:48:28 UTC (rev 469) @@ -0,0 +1,96 @@ +; OpenMPT Install script - File associations +; Written by Johannes Schultz +; http://sagamusix.de/ +; http://sagagames.de/ + +[Setup] +ChangesAssociations=yes + +[Tasks] +; common file extensions +Name: "associate_common"; Description: "Associate OpenMPT with common module files"; GroupDescription: "File associations:"; +Name: "associate_common\mod"; Description: "ProTracker / Noise Tracker / etc. (MOD)"; +Name: "associate_common\s3m"; Description: "Scream Tracker 3 (S3M)"; +Name: "associate_common\xm"; Description: "Fasttracker 2 (XM)"; +Name: "associate_common\it"; Description: "Impulse Tracker (IT)"; +Name: "associate_common\itp"; Description: "Impulse Tracker Project (ITP)"; +Name: "associate_common\mptm"; Description: "OpenMPT (MPTM)"; +; same, but compressed +Name: "associate_common\compressed"; Description: "Above when compressed (MDR, MDZ, S3Z, XMZ, ITZ, MPTMZ)"; +; less common +Name: "associate_exotic"; Description: "Associate OpenMPT with less common module files"; GroupDescription: "File associations:"; +Name: "associate_exotic\669"; Description: "Composer 669 (669)"; +Name: "associate_exotic\amf"; Description: "ASYLUM Music Format / Advanced Music Format (AMF)"; +Name: "associate_exotic\ams"; Description: "Extreme Tracker (AMS)"; +Name: "associate_exotic\dbm"; Description: "DigiBooster (DBM)"; +Name: "associate_exotic\dmf"; Description: "X-Tracker (DMF)"; +Name: "associate_exotic\dsm"; Description: "DSIK (DSM)"; +Name: "associate_exotic\far"; Description: "Farandole Composer (FAR)"; +Name: "associate_exotic\gdm"; Description: "General Digital Music (GDM)"; +Name: "associate_exotic\imf"; Description: "Imago Orpheus (IMF)"; +Name: "associate_exotic\j2b"; Description: "Jazz Jackrabbit 2 Music (J2B)"; +Name: "associate_exotic\mdl"; Description: "DigiTracker (MDL)"; +Name: "associate_exotic\med"; Description: "OctaMED (MED)"; +Name: "associate_exotic\mo3"; Description: "MO3 compressed modules (MO3)"; +Name: "associate_exotic\mt2"; Description: "MadTracker 2 (MT2)"; +Name: "associate_exotic\mtm"; Description: "MultiTracker Modules (MTM)"; +Name: "associate_exotic\okt"; Description: "Oktalyzer (OKT)"; +Name: "associate_exotic\psm"; Description: "Epic Megagames MASI (PSM)"; +Name: "associate_exotic\ptm"; Description: "PolyTracker (PTM)"; +Name: "associate_exotic\stm"; Description: "Scream Tracker 2 (STM)"; +Name: "associate_exotic\ult"; Description: "UltraTracker (ULT)"; +Name: "associate_exotic\umx"; Description: "Unreal Music (UMX)"; +Name: "associate_exotic\wow"; Description: "Grave Composer (WOW)"; + +[Registry] +; common file extensions +Root: HKCR; Subkey: ".mod"; ValueType: string; ValueName: ""; ValueData: "OpenMPTFile"; Flags: uninsdeletevalue; Tasks: associate_common\mod +Root: HKCR; Subkey: ".s3m"; ValueType: string; ValueName: ""; ValueData: "OpenMPTFile"; Flags: uninsdeletevalue; Tasks: associate_common\s3m +Root: HKCR; Subkey: ".xm"; ValueType: string; ValueName: ""; ValueData: "OpenMPTFile"; Flags: uninsdeletevalue; Tasks: associate_common\xm +Root: HKCR; Subkey: ".it"; ValueType: string; ValueName: ""; ValueData: "OpenMPTFile"; Flags: uninsdeletevalue; Tasks: associate_common\it +Root: HKCR; Subkey: ".itp"; ValueType: string; ValueName: ""; ValueData: "OpenMPTFile"; Flags: uninsdeletevalue; Tasks: associate_common\itp +Root: HKCR; Subkey: ".mptm"; ValueType: string; ValueName: ""; ValueData: "OpenMPTFile"; Flags: uninsdeletevalue; Tasks: associate_common\mptm +; same, but compressed +Root: HKCR; Subkey: ".mdr"; ValueType: string; ValueName: ""; ValueData: "OpenMPTFile"; Flags: uninsdeletevalue; Tasks: associate_common\compressed +Root: HKCR; Subkey: ".mdz"; ValueType: string; ValueName: ""; ValueData: "OpenMPTFile"; Flags: uninsdeletevalue; Tasks: associate_common\compressed +Root: HKCR; Subkey: ".s3z"; ValueType: string; ValueName: ""; ValueData: "OpenMPTFile"; Flags: uninsdeletevalue; Tasks: associate_common\compressed +Root: HKCR; Subkey: ".xmz"; ValueType: string; ValueName: ""; ValueData: "OpenMPTFile"; Flags: uninsdeletevalue; Tasks: associate_common\compressed +Root: HKCR; Subkey: ".itz"; ValueType: string; ValueName: ""; ValueData: "OpenMPTFile"; Flags: uninsdeletevalue; Tasks: associate_common\compressed +Root: HKCR; Subkey: ".mptmz"; ValueType: string; ValueName: ""; ValueData: "OpenMPTFile"; Flags: uninsdeletevalue; Tasks: associate_common\compressed +; less common +Root: HKCR; Subkey: ".669"; ValueType: string; ValueName: ""; ValueData: "OpenMPTFile"; Flags: uninsdeletevalue; Tasks: associate_exotic\669 +Root: HKCR; Subkey: ".amf"; ValueType: string; ValueName: ""; ValueData: "OpenMPTFile"; Flags: uninsdeletevalue; Tasks: associate_exotic\amf +Root: HKCR; Subkey: ".ams"; ValueType: string; ValueName: ""; ValueData: "OpenMPTFile"; Flags: uninsdeletevalue; Tasks: associate_exotic\ams +Root: HKCR; Subkey: ".dbm"; ValueType: string; ValueName: ""; ValueData: "OpenMPTFile"; Flags: uninsdeletevalue; Tasks: associate_exotic\dbm +Root: HKCR; Subkey: ".dmf"; ValueType: string; ValueName: ""; ValueData: "OpenMPTFile"; Flags: uninsdeletevalue; Tasks: associate_exotic\dmf +Root: HKCR; Subkey: ".dsm"; ValueType: string; ValueName: ""; ValueData: "OpenMPTFile"; Flags: uninsdeletevalue; Tasks: associate_exotic\dsm +Root: HKCR; Subkey: ".far"; ValueType: string; ValueName: ""; ValueData: "OpenMPTFile"; Flags: uninsdeletevalue; Tasks: associate_exotic\far +Root: HKCR; Subkey: ".gdm"; ValueType: string; ValueName: ""; ValueData: "OpenMPTFile"; Flags: uninsdeletevalue; Tasks: associate_exotic\gdm +Root: HKCR; Subkey: ".imf"; ValueType: string; ValueName: ""; ValueData: "OpenMPTFile"; Flags: uninsdeletevalue; Tasks: associate_exotic\imf +Root: HKCR; Subkey: ".j2b"; ValueType: string; ValueName: ""; ValueData: "OpenMPTFile"; Flags: uninsdeletevalue; Tasks: associate_exotic\j2b +Root: HKCR; Subkey: ".mdl"; ValueType: string; ValueName: ""; ValueData: "OpenMPTFile"; Flags: uninsdeletevalue; Tasks: associate_exotic\mdl +Root: HKCR; Subkey: ".med"; ValueType: string; ValueName: ""; ValueData: "OpenMPTFile"; Flags: uninsdeletevalue; Tasks: associate_exotic\med +Root: HKCR; Subkey: ".mo3"; ValueType: string; ValueName: ""; ValueData: "OpenMPTFile"; Flags: uninsdeletevalue; Tasks: associate_exotic\mo3 +Root: HKCR; Subkey: ".mt2"; ValueType: string; ValueName: ""; ValueData: "OpenMPTFile"; Flags: uninsdeletevalue; Tasks: associate_exotic\mt2 +Root: HKCR; Subkey: ".mtm"; ValueType: string; ValueName: ""; ValueData: "OpenMPTFile"; Flags: uninsdeletevalue; Tasks: associate_exotic\mtm +Root: HKCR; Subkey: ".okt"; ValueType: string; ValueName: ""; ValueData: "OpenMPTFile"; Flags: uninsdeletevalue; Tasks: associate_exotic\okt +Root: HKCR; Subkey: ".psm"; ValueType: string; ValueName: ""; ValueData: "OpenMPTFile"; Flags: uninsdeletevalue; Tasks: associate_exotic\psm +Root: HKCR; Subkey: ".ptm"; ValueType: string; ValueName: ""; ValueData: "OpenMPTFile"; Flags: uninsdeletevalue; Tasks: associate_exotic\ptm +Root: HKCR; Subkey: ".stm"; ValueType: string; ValueName: ""; ValueData: "OpenMPTFile"; Flags: uninsdeletevalue; Tasks: associate_exotic\stm +Root: HKCR; Subkey: ".ult"; ValueType: string; ValueName: ""; ValueData: "OpenMPTFile"; Flags: uninsdeletevalue; Tasks: associate_exotic\ult +Root: HKCR; Subkey: ".umx"; ValueType: string; ValueName: ""; ValueData: "OpenMPTFile"; Flags: uninsdeletevalue; Tasks: associate_exotic\umx +Root: HKCR; Subkey: ".wow"; ValueType: string; ValueName: ""; ValueData: "OpenMPTFile"; Flags: uninsdeletevalue; Tasks: associate_exotic\wow + +; important (setup) +Root: HKCR; Subkey: "OpenMPTFile"; ValueType: string; ValueName: ""; ValueData: "OpenMPT Module"; Flags: uninsdeletekey; Tasks: associate_common or associate_exotic +Root: HKCR; Subkey: "OpenMPTFile\DefaultIcon"; ValueType: string; ValueName: ""; ValueData: "{app}\mpt.ico,0"; Tasks: associate_common or associate_exotic +Root: HKCR; Subkey: "OpenMPTFile\shell\open\command"; ValueType: string; ValueName: ""; ValueData: """{app}\mptrack.exe"" ""%1"""; Tasks: associate_common or associate_exotic + +[Files] +; icon file (should be moved into EXE) +Source: "mpt.ico"; DestDir: "{app}"; Flags: ignoreversion + + + + + Added: trunk/OpenMPT/installer/install-big.bmp =================================================================== (Binary files differ) Property changes on: trunk/OpenMPT/installer/install-big.bmp ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Added: trunk/OpenMPT/installer/install-small.bmp =================================================================== (Binary files differ) Property changes on: trunk/OpenMPT/installer/install-small.bmp ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Added: trunk/OpenMPT/installer/install.iss =================================================================== --- trunk/OpenMPT/installer/install.iss (rev 0) +++ trunk/OpenMPT/installer/install.iss 2010-01-16 19:48:28 UTC (rev 469) @@ -0,0 +1,105 @@ +; OpenMPT Install script +; Written by Johannes Schultz +; http://sagamusix.de/ +; http://sagagames.de/ + +[Setup] +AppId=OpenMPT +AppVerName=OpenMPT 1.18 +AppVersion=1.18.00.00 +AppName=OpenMPT +AppPublisher=OpenMPT Devs / Olivier Lapicque +AppPublisherURL=http://www.openmpt.com/ +AppSupportURL=http://www.openmpt.com/ +AppUpdatesURL=http://www.openmpt.com/ +DefaultDirName={pf}\OpenMPT +DefaultGroupName=OpenMPT +AllowNoIcons=yes +OutputDir=.\ +OutputBaseFilename=OpenMPT Setup +Compression=lzma +SolidCompression=yes +WizardImageFile=install-big.bmp +WizardSmallImageFile=install-small.bmp +;LicenseFile=license.txt +;CreateUninstallRegKey=no + +[Tasks] +; icons and install mode +Name: "desktopicon"; Description: "{cm:CreateDesktopIcon}"; GroupDescription: "{cm:AdditionalIcons}"; +Name: "quicklaunchicon"; Description: "{cm:CreateQuickLaunchIcon}"; GroupDescription: "{cm:AdditionalIcons}"; Flags: unchecked +Name: "portable"; Description: "Use program directory to store configuration in (portable mode)"; GroupDescription: "Options:"; Flags: unchecked +; file associations - put this below all other [tasks]! +#include "filetypes.iss" + +[Languages] +Name: "en"; MessagesFile: "compiler:Default.isl" + +[Files] +; you may want to change the base paths here + +; preserve file type order for best solid compression results (first binary, then text) +; home folder +Source: "..\mptrack\bin\mptrack.exe"; DestDir: "{app}"; Flags: ignoreversion +Source: "..\mptrack\bin\OpenMPT_SoundTouch_i16.dll"; DestDir: "{app}"; Flags: ignoreversion +Source: "..\mptrack\bin\unmo3.dll"; DestDir: "{app}"; Flags: ignoreversion +Source: "packageTemplate\readme.txt"; DestDir: "{app}"; Flags: ignoreversion +Source: "..\packageTemplate\history.txt"; DestDir: "{app}"; Flags: ignoreversion +; soundtouch license stuff +Source: "..\packageTemplate\SoundTouch\*.*"; DestDir: "{app}\SoundTouch"; Flags: ignoreversion +; keymaps +Source: "..\packageTemplate\extraKeymaps\*.*"; DestDir: "{app}\extraKeymaps"; Flags: ignoreversion + +[Dirs] +; option dirs for non-portable mode +Name: "{userappdata}\OpenMPT"; Tasks: not portable +Name: "{userappdata}\OpenMPT\tunings"; Tasks: not portable +; dirst for portable mode +Name: "{app}\tunings"; Tasks: portable + +[Icons] +; start menu +Name: "{group}\{cm:LaunchProgram,OpenMPT}"; Filename: "{app}\mptrack.exe" +Name: "{group}\{cm:UninstallProgram,OpenMPT}"; Filename: "{uninstallexe}" +Name: "{group}\ModPlug Central"; Filename: "{app}\ModPlug Central.url" +Name: "{group}\Configuration files"; Filename: "{userappdata}\OpenMPT\"; Tasks: not portable + +; app's directory (for ease of use) +Name: "{app}\Configuration files"; Filename: "{userappdata}\OpenMPT\"; Tasks: not portable + +; desktop, quick launch +Name: "{userdesktop}\OpenMPT"; Filename: "{app}\mptrack.exe"; Tasks: desktopicon +Name: "{userappdata}\Microsoft\Internet Explorer\Quick Launch\OpenMPT"; Filename: "{app}\mptrack.exe"; Tasks: quicklaunchicon + +[INI] +; enable portable mode +Filename: "{app}\mptrack.ini"; Section: "Paths"; Key: "UseAppDataDirectory"; String: "0"; Flags: uninsdeleteentry createkeyifdoesntexist; Tasks: portable +; internet shortcut +Filename: "{app}\ModPlug Central.url"; Section: "InternetShortcut"; Key: "URL"; String: "http://www.lpchip.com/modplug/"; Flags: createkeyifdoesntexist; + +[Run] +; duh +Filename: "{app}\mptrack.exe"; Description: "{cm:LaunchProgram,OpenMPT}"; Flags: nowait postinstall skipifsilent + +[UninstallDelete] +; internet shortcut has to be deleted manually +Type: files; Name: "{app}\ModPlug Central.url"; +; normal installation +Type: files; Name: "{userappdata}\OpenMPT\mptrack.ini"; Tasks: not portable +Type: files; Name: "{userappdata}\OpenMPT\plugin.cache"; Tasks: not portable +Type: files; Name: "{userappdata}\OpenMPT\tunings\local_tunings.tc"; Tasks: not portable +Type: dirifempty; Name: "{userappdata}\OpenMPT\tunings"; Tasks: not portable +Type: dirifempty; Name: "{userappdata}\OpenMPT"; Tasks: not portable +; portable installation +Type: files; Name: "{app}\mptrack.ini"; Tasks: portable +Type: files; Name: "{app}\plugin.cache"; Tasks: portable +Type: files; Name: "{app}\tunings\local_tunings.tc"; Tasks: portable +Type: dirifempty; Name: "{app}\tunings"; Tasks: portable + + + + + + + + Added: trunk/OpenMPT/installer/mpt.ico =================================================================== (Binary files differ) Property changes on: trunk/OpenMPT/installer/mpt.ico ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Added: trunk/OpenMPT/installer/packageTemplate/readme.txt =================================================================== --- trunk/OpenMPT/installer/packageTemplate/readme.txt (rev 0) +++ trunk/OpenMPT/installer/packageTemplate/readme.txt 2010-01-16 19:48:28 UTC (rev 469) @@ -0,0 +1,95 @@ +****************** +* OpenMPT 1.18 * +****************** + + +Migrating from OpenMPT 1.17 +--------------------------- + +-If you have an existing installation of OpenMPT 1.17 and wish to + re-use its settings, copy your mptrack.ini and plugin.cache + to the directory into which you installed OpenMPT. + + +Uninstallation +-------------- + +-An uninstaller is provided. It will also uninstall custom settings and tunings, so if you want to keep those, back them up first. Use "open_settings_folder.bat" to find them. + + +Making OpenMPT portable +----------------------- + +By default, OpenMPT stores its settings in %appdata%\OpenMPT. To avoid this, create a file called "mptrack.ini" in the same directory as mptrack.exe (if it does not exist yet) and add the following lines to this file: +[Paths] +UseAppDataDirectory=0 + + +Changes +------- + +See history.txt. + + +Questions, comments, bug reports... +----------------------------------- + +See forums at http://modplug.sourceforge.net/. + + +Release package contents: +------------------------- +extraKeymaps(folder): Additional key bindings for the keyboard manager, available in several flavours (including MPT classic, FastTracker and Impulse Tracker) and country-specific layouts. +soundtouch(folder): SoundTouch readme and copying.txt +history.txt: Version history. +mptrack.exe: Main executable. +open_settings_folder.bat: Opens settings folder. +OpenMPT_SoundTouch_i16.dll: Slightly customized SoundTouch library used in time stretching feature. +readme.txt: +unmo3.dll: Used in MO3-file import. + +Misc: +----- + +OpenMPT is partially under the following license: + +> Copyright (c) 2004-2010, OpenMPT contributors +> Copyright (c) 1997-2003, Olivier Lapicque +> All rights reserved. +> +> Redistribution and use in source and binary forms, with or without +> modification, are permitted provided that the following conditions are met: +> * Redistributions of source code must retain the above copyright +> notice, this list of conditions and the following disclaimer. +> * Redistributions in binary form must reproduce the above copyright +> notice, this list of conditions and the following disclaimer in the +> documentation and/or other materials provided with the distribution. +> * Neither the name of the OpenMPT project nor the +> names of its contributors may be used to endorse or promote products +> derived from this software without specific prior written permission. +> +> THIS SOFTWARE IS PROVIDED BY THE CONTRIBUTORS ``AS IS'' AND ANY +> EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +> WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +> DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY +> DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +> (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +> LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND +> ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +> (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +> SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + + +ASIO is a trademark and software of Steinberg Media Technologies GmbH +VST is a trademark of Steinberg Media Technologies GmbH + +For more information about SoundTouch, see folder SoundTouch. + +unmo3.dll +--------- +Copyright (c) 2001-2009 Ian Luck. All rights reserved + +The MO3 software is free for non-commercial use; if anyone tries to +charge you for it, kick 'em where it hurts! + +TO THE MAXIMUM EXTENT PERMITTED BY APPLICABLE LAW, THIS SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE. THE AUTHORS SHALL NOT BE HELD LIABLE FOR ANY DAMAGE THAT MAY RESULT FROM THE USE OF THIS SOFTWARE. YOU USE THIS SOFTWARE ENTIRELY AT YOUR OWN RISK. This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <sag...@us...> - 2010-01-19 22:57:49
|
Revision: 471 http://modplug.svn.sourceforge.net/modplug/?rev=471&view=rev Author: saga-games Date: 2010-01-19 22:57:23 +0000 (Tue, 19 Jan 2010) Log Message: ----------- [Mod] Updated default keymap with many shortcuts. Thanks, Snu! (this is the same file as US_mpt_classic_(snu).mkb) [Mod] Updated Dvorak keymap [Mod] Updated installer script + readme file. Modified Paths: -------------- trunk/OpenMPT/installer/install.iss trunk/OpenMPT/installer/packageTemplate/readme.txt trunk/OpenMPT/mptrack/res/defaultKeybindings.mkb trunk/OpenMPT/packageTemplate/History.txt trunk/OpenMPT/packageTemplate/extraKeymaps/dvorak_(snu).mkb Added Paths: ----------- trunk/OpenMPT/packageTemplate/extraKeymaps/US_mpt_classic_(snu).mkb Modified: trunk/OpenMPT/installer/install.iss =================================================================== --- trunk/OpenMPT/installer/install.iss 2010-01-16 23:55:23 UTC (rev 470) +++ trunk/OpenMPT/installer/install.iss 2010-01-19 22:57:23 UTC (rev 471) @@ -9,9 +9,9 @@ AppVersion=1.18.00.00 AppName=OpenMPT AppPublisher=OpenMPT Devs / Olivier Lapicque -AppPublisherURL=http://www.openmpt.com/ -AppSupportURL=http://www.openmpt.com/ -AppUpdatesURL=http://www.openmpt.com/ +AppPublisherURL=http://www.modplug.com/ +AppSupportURL=http://www.modplug.com/ +AppUpdatesURL=http://www.modplug.com/ DefaultDirName={pf}\OpenMPT DefaultGroupName=OpenMPT AllowNoIcons=yes @@ -85,15 +85,15 @@ ; internet shortcut has to be deleted manually Type: files; Name: "{app}\ModPlug Central.url"; ; normal installation -Type: files; Name: "{userappdata}\OpenMPT\mptrack.ini"; Tasks: not portable -Type: files; Name: "{userappdata}\OpenMPT\plugin.cache"; Tasks: not portable -Type: files; Name: "{userappdata}\OpenMPT\tunings\local_tunings.tc"; Tasks: not portable +;Type: files; Name: "{userappdata}\OpenMPT\mptrack.ini"; Tasks: not portable +;Type: files; Name: "{userappdata}\OpenMPT\plugin.cache"; Tasks: not portable +;Type: files; Name: "{userappdata}\OpenMPT\tunings\local_tunings.tc"; Tasks: not portable Type: dirifempty; Name: "{userappdata}\OpenMPT\tunings"; Tasks: not portable Type: dirifempty; Name: "{userappdata}\OpenMPT"; Tasks: not portable ; portable installation -Type: files; Name: "{app}\mptrack.ini"; Tasks: portable -Type: files; Name: "{app}\plugin.cache"; Tasks: portable -Type: files; Name: "{app}\tunings\local_tunings.tc"; Tasks: portable +;Type: files; Name: "{app}\mptrack.ini"; Tasks: portable +;Type: files; Name: "{app}\plugin.cache"; Tasks: portable +;Type: files; Name: "{app}\tunings\local_tunings.tc"; Tasks: portable Type: dirifempty; Name: "{app}\tunings"; Tasks: portable @@ -103,3 +103,4 @@ + Modified: trunk/OpenMPT/installer/packageTemplate/readme.txt =================================================================== --- trunk/OpenMPT/installer/packageTemplate/readme.txt 2010-01-16 23:55:23 UTC (rev 470) +++ trunk/OpenMPT/installer/packageTemplate/readme.txt 2010-01-19 22:57:23 UTC (rev 471) @@ -14,17 +14,17 @@ Uninstallation -------------- -An uninstaller is provided. It will also uninstall custom settings and tunings, -so if you want to keep those, back them up first. Use "open_settings_folder.bat" -to find them. +An uninstaller is provided. It won't delete your personal settings, so you have +to delete them yourself, if you don't want to keep them. You can use +"open_settings_folder.bat" to find them (or just go to %appdata%\OpenMPT). Making OpenMPT portable ----------------------- By default, OpenMPT stores its settings in %appdata%\OpenMPT. To avoid this, -create a file called "mptrack.ini" in the same directory as mptrack.exe (if it -does not exist yet) and add the following lines to this file: +create a file called "mptrack.ini" in the same (!) directory as mptrack.exe (if +it does not exist yet) and add the following lines to this file: [Paths] UseAppDataDirectory=0 Modified: trunk/OpenMPT/mptrack/res/defaultKeybindings.mkb =================================================================== --- trunk/OpenMPT/mptrack/res/defaultKeybindings.mkb 2010-01-16 23:55:23 UTC (rev 470) +++ trunk/OpenMPT/mptrack/res/defaultKeybindings.mkb 2010-01-19 22:57:23 UTC (rev 471) @@ -13,18 +13,16 @@ 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:1027:0:118:1 //Play pattern from start: F7 (KeyDown) +0:1026:2:118:1 //Play pattern from cursor: Ctrl+F7 (KeyDown) 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:1363:1:86:1 //Mix Paste: Shift+V (KeyDown) -0:1793:3:86:1 //Paste Flood: Shift+Ctrl+V (KeyDown) -0:1820:6:86:1 //Push Forward Paste: Ctrl+Alt+V (KeyDown) +0:1363:3:86:1 //Mix Paste: Shift+Ctrl+V (KeyDown) +0:1793:1:86:5 //Paste Flood: Shift+V (KeyDown|KeyHold) 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) @@ -33,6 +31,7 @@ 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:1025:4:67:1 //View Comments: Alt+C (KeyDown) 0:1368:2:113:1 //Toggle Tree View: Ctrl+F2 (KeyDown) 0:1369:2:112:1 //View Options: Ctrl+F1 (KeyDown) 0:1781:2:114:1 //View MIDI mapping: Ctrl+F3 (KeyDown) @@ -73,19 +72,21 @@ 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:1003:0:13:1 //Quick copy: ENTER (KeyDown) 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:1806:2:68:1 //Duplicate pattern: Ctrl+D (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:1772:5:80:1 //Show pattern properties window: Shift+Alt+P (KeyDown) 2:1819:2:69:1 //Split Keyboard Settings dialog: Ctrl+E (KeyDown) -2:1776:6:32:1 //Toggle loop pattern: Ctrl+Alt+SPACE (KeyDown) -2:1780:2:84:1 //Show playback time at current row: Ctrl+T (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:1780:2:80:1 //Show playback time at current row: Ctrl+P (KeyDown) +2:1005:0:121:1 //Mute current channel: F10 (KeyDown) +2:1006:2:121:1 //Solo current channel: Ctrl+F10 (KeyDown) +2:1771:6:121:1 //Unmute all channels: Ctrl+Alt+F10 (KeyDown) 2:1786:2:82:1 //Reset channel: Ctrl+R (KeyDown) 2:1007:2:81:5 //Transpose +1: Ctrl+Q (KeyDown|KeyHold) 2:1008:2:65:5 //Transpose -1: Ctrl+A (KeyDown|KeyHold) @@ -101,12 +102,12 @@ 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:1059:2:46:5 //Clear row and step: Ctrl+DELETE (KeyDown|KeyHold) 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:1378:0:45:5 //Insert Row: INSERT (KeyDown|KeyHold) +2:1379:2:45:5 //Insert All Rows: Ctrl+INSERT (KeyDown|KeyHold) 2:1055:0:109:5 //Previous pattern: NUM SUB (KeyDown|KeyHold) 2:1054:0:107:5 //Next pattern: NUM PLUS (KeyDown|KeyHold) @@ -120,9 +121,9 @@ 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:1073:0:80:1 //Base octave A: P (KeyDown) +3:1074:0:219:1 //Base octave A#: [ (KeyDown) +3:1075:0:221:1 //Base octave 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) @@ -132,9 +133,9 @@ 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:1085:0:186:1 //Base octave +1 A: ; (KeyDown) +3:1086:0:222:1 //Base octave +1 A#: ' (KeyDown) +3:1087:0:220:1 //Base octave +1 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) @@ -144,7 +145,7 @@ 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:1097:0:191:1 //Base octave +2 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) @@ -166,10 +167,11 @@ 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) -3:1788:1:189:1 //Parameter control(MPTm only): Shift+- (KeyDown) -3:1789:0:189:1 //Parameter control(smooth)(MPTm only): - (KeyDown) +3:1200:0:192:1 //Note Cut: ` (KeyDown) +3:1201:0:187:1 //Note Off: = (KeyDown) +3:1791:1:187:1 //Note Fade: Shift+= (KeyDown) +3:1788:0:189:1 //Parameter control(MPTm only): - (KeyDown) +3:1789:1:189:1 //Parameter control(smooth)(MPTm only): Shift+- (KeyDown) //----( Pattern Context [bottom] - Ins Col (4) )------------ 4:1202:0:96:1 //Set instrument digit 0: NUM 0 (KeyDown) @@ -188,6 +190,7 @@ 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:104:1 //Set instrument digit 8: NUM 8 (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) @@ -210,6 +213,7 @@ 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:1230:0:104:1 //Set volume digit 8: NUM 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) @@ -225,11 +229,15 @@ 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:0:186:1 //Vol command - Velocity: ; (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) +6:1295:0:186:1 //FX pseudo-velocity (experimental): ; (KeyDown) +6:1666:0:191:1 //FX parameter extension command: / (KeyDown) //----( Pattern Context [bottom] - Param Col (7) )------------ 7:1247:0:48:1 //FX Param digit 0: 0 (KeyDown) @@ -264,6 +272,7 @@ 8:1383:0:8:1 //Silence sample selection: BACKSPACE (KeyDown) 8:1384:1:78:1 //Normalise Sample: Shift+N (KeyDown) 8:1385:3:65:1 //Amplify Sample: Shift+Ctrl+A (KeyDown) +8:1385:2:77:1 //Amplify Sample: Ctrl+M (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) @@ -278,11 +287,12 @@ 9:1821:0:37:5 //Move envelope point left: LEFT (KeyDown|KeyHold) 9:1822:0:39:5 //Move envelope point right: RIGHT (KeyDown|KeyHold) 9:1823:0:38:5 //Move envelope point up: UP (KeyDown|KeyHold) -9:1834:0:33:5 //Move envelope point up (big step): PG UP (KeyDown|KeyHold) +9:1834:0:33:5 //Move envelope point up (big step): PGUP (KeyDown|KeyHold) 9:1824:0:40:5 //Move envelope point down: DOWN (KeyDown|KeyHold) -9:1835:0:34:5 //Move envelope point down (big step): PG DN (KeyDown|KeyHold) -9:1827:0:45:5 //Insert envelope point: INSERT (KeyDown|KeyHold) -9:1828:0:46:5 //Remove envelope point: DELETE (KeyDown|KeyHold) +9:1835:0:34:5 //Move envelope point down (big step): PGDOWN (KeyDown|KeyHold) +9:1827:0:45:1 //Insert envelope point: INSERT (KeyDown) +9:1828:0:46:1 //Remove envelope point: DELETE (KeyDown) +9:1828:0:8:1 //Remove envelope point: BACKSPACE (KeyDown) 9:1829:0:36:1 //Set loop start: HOME (KeyDown) 9:1830:0:35:1 //Set loop end: END (KeyDown) 9:1831:2:36:1 //Set sustain loop start: Ctrl+HOME (KeyDown) @@ -296,11 +306,11 @@ //----( Unknown Context (12) )------------ //----( Plugin GUI Context (13) )------------ -13:1763:2:109:5 //Previous plugin preset: Ctrl+NUM SUB (KeyDown|KeyHold) -13:1764:2:107:5 //Next plugin preset: Ctrl+NUM PLUS (KeyDown|KeyHold) -13:1782:0:109:5 //Plugin preset backward jump: NUM SUB (KeyDown|KeyHold) -13:1783:0:107:5 //Plugin preset forward jump: NUM PLUS (KeyDown|KeyHold) -13:1765:2:82:5 //Randomize plugin parameters: Ctrl+R (KeyDown|KeyHold) +13:1763:0:37:5 //Previous plugin preset: LEFT (KeyDown|KeyHold) +13:1764:0:39:5 //Next plugin preset: RIGHT (KeyDown|KeyHold) +13:1782:0:38:5 //Plugin preset backward jump: UP (KeyDown|KeyHold) +13:1783:0:40:5 //Plugin preset forward jump: DOWN (KeyDown|KeyHold) +13:1765:2:82:1 //Randomize plugin parameters: Ctrl+R (KeyDown) //----( General Context [top] (14) )------------ @@ -344,6 +354,6 @@ 19:1816:0:57:5 //Pattern index digit 9: 9 (KeyDown|KeyHold) 19:1816:0:105:5 //Pattern index digit 9: NUM 9 (KeyDown|KeyHold) 19:1817:0:107:5 //Increase pattern index : NUM PLUS (KeyDown|KeyHold) -19:1817:0:187:5 //Increase pattern index : + (KeyDown|KeyHold) -19:1818:0:109:1 //Decrease pattern index: NUM SUB (KeyDown) -19:1818:0:189:1 //Decrease pattern index: - (KeyDown) +19:1817:0:187:5 //Increase pattern index : = (KeyDown|KeyHold) +19:1818:0:109:5 //Decrease pattern index: NUM SUB (KeyDown|KeyHold) +19:1818:0:189:5 //Decrease pattern index: - (KeyDown|KeyHold) Modified: trunk/OpenMPT/packageTemplate/History.txt =================================================================== --- trunk/OpenMPT/packageTemplate/History.txt 2010-01-16 23:55:23 UTC (rev 470) +++ trunk/OpenMPT/packageTemplate/History.txt 2010-01-19 22:57:23 UTC (rev 471) @@ -9,9 +9,9 @@ ?: other (tx XYZ): thanks to XYZ for telling us about the bug +v1.18 (January 2010, revision 467) +---------------------------------- --------------------- - General tab . <Jojo> Channel name input field was not limited properly. Added: trunk/OpenMPT/packageTemplate/extraKeymaps/US_mpt_classic_(snu).mkb =================================================================== --- trunk/OpenMPT/packageTemplate/extraKeymaps/US_mpt_classic_(snu).mkb (rev 0) +++ trunk/OpenMPT/packageTemplate/extraKeymaps/US_mpt_classic_(snu).mkb 2010-01-19 22:57:23 UTC (rev 471) @@ -0,0 +1,359 @@ +//-------- OpenMPT key binding definition file ------- +//-Format is: - +//- Context:Command ID:Modifiers:Key:KeypressEventType //Comments - +//---------------------------------------------------------------------- +version:1 + +//----( 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:1350:3:83:1 //File/Save As: Shift+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:1 //Play pattern from start: F7 (KeyDown) +0:1026:2:118:1 //Play pattern from cursor: Ctrl+F7 (KeyDown) +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:1362:2:86:1 //Paste: Ctrl+V (KeyDown) +0:1362:1:45:1 //Paste: Shift+INSERT (KeyDown) +0:1363:3:86:1 //Mix Paste: Shift+Ctrl+V (KeyDown) +0:1793:1:86:5 //Paste Flood: Shift+V (KeyDown|KeyHold) +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:1025:4:67:1 //View Comments: Alt+C (KeyDown) +0:1368:2:113:1 //Toggle Tree View: Ctrl+F2 (KeyDown) +0:1369:2:112:1 //View Options: Ctrl+F1 (KeyDown) +0:1781:2:114:1 //View MIDI mapping: Ctrl+F3 (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:1 //Quick copy: ENTER (KeyDown) +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:1806:2:68:1 //Duplicate pattern: Ctrl+D (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:1772:5:80:1 //Show pattern properties window: Shift+Alt+P (KeyDown) +2:1819:2:69:1 //Split Keyboard Settings dialog: Ctrl+E (KeyDown) +2:1780:2:80:1 //Show playback time at current row: Ctrl+P (KeyDown) +2:1005:0:121:1 //Mute current channel: F10 (KeyDown) +2:1006:2:121:1 //Solo current channel: Ctrl+F10 (KeyDown) +2:1771:6:121:1 //Unmute all channels: Ctrl+Alt+F10 (KeyDown) +2:1786:2:82:1 //Reset channel: Ctrl+R (KeyDown) +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:5 //Clear row and step: Ctrl+DELETE (KeyDown|KeyHold) +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:5 //Insert Row: INSERT (KeyDown|KeyHold) +2:1379:2:45:5 //Insert All Rows: Ctrl+INSERT (KeyDown|KeyHold) +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 A: P (KeyDown) +3:1074:0:219:1 //Base octave A#: [ (KeyDown) +3:1075:0:221:1 //Base octave 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 +1 A: ; (KeyDown) +3:1086:0:222:1 //Base octave +1 A#: ' (KeyDown) +3:1087:0:220:1 //Base octave +1 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 +2 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) +3:1791:1:187:1 //Note Fade: Shift+= (KeyDown) +3:1788:0:189:1 //Parameter control(MPTm only): - (KeyDown) +3:1789:1:189:1 //Parameter control(smooth)(MPTm only): Shift+- (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:104:1 //Set instrument digit 8: NUM 8 (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:1230:0:104:1 //Set volume digit 8: NUM 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:0:186:1 //Vol command - Velocity: ; (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) +6:1295:0:186:1 //FX pseudo-velocity (experimental): ; (KeyDown) +6:1666:0:191:1 //FX parameter extension command: / (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:1384:1:78:1 //Normalise Sample: Shift+N (KeyDown) +8:1385:3:65:1 //Amplify Sample: Shift+Ctrl+A (KeyDown) +8:1385:2:77:1 //Amplify Sample: Ctrl+M (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) +8:1784:2:73:1 //Invert sample phase: Ctrl+I (KeyDown) +8:1785:2:85:1 //Signed/Unsigned conversion: Ctrl+U (KeyDown) +8:1790:2:68:1 //Remove DC Offset: Ctrl+D (KeyDown) + +//----( Instrument Context [bottom] (9) )------------ +9:1825:1:9:5 //Select previous envelope point: Shift+TAB (KeyDown|KeyHold) +9:1826:0:9:5 //Select next envelope point: TAB (KeyDown|KeyHold) +9:1821:0:37:5 //Move envelope point left: LEFT (KeyDown|KeyHold) +9:1822:0:39:5 //Move envelope point right: RIGHT (KeyDown|KeyHold) +9:1823:0:38:5 //Move envelope point up: UP (KeyDown|KeyHold) +9:1834:0:33:5 //Move envelope point up (big step): PGUP (KeyDown|KeyHold) +9:1824:0:40:5 //Move envelope point down: DOWN (KeyDown|KeyHold) +9:1835:0:34:5 //Move envelope point down (big step): PGDOWN (KeyDown|KeyHold) +9:1827:0:45:1 //Insert envelope point: INSERT (KeyDown) +9:1828:0:46:1 //Remove envelope point: DELETE (KeyDown) +9:1828:0:8:1 //Remove envelope point: BACKSPACE (KeyDown) +9:1829:0:36:1 //Set loop start: HOME (KeyDown) +9:1830:0:35:1 //Set loop end: END (KeyDown) +9:1831:2:36:1 //Set sustain loop start: Ctrl+HOME (KeyDown) +9:1832:2:35:1 //Set sustain loop end: Ctrl+END (KeyDown) +9:1833:2:82:1 //Toggle release node: Ctrl+R (KeyDown) + +//----( Comments Context [bottom] (10) )------------ + +//----( Unknown Context (11) )------------ + +//----( Unknown Context (12) )------------ + +//----( Plugin GUI Context (13) )------------ +13:1763:0:37:5 //Previous plugin preset: LEFT (KeyDown|KeyHold) +13:1764:0:39:5 //Next plugin preset: RIGHT (KeyDown|KeyHold) +13:1782:0:38:5 //Plugin preset backward jump: UP (KeyDown|KeyHold) +13:1783:0:40:5 //Plugin preset forward jump: DOWN (KeyDown|KeyHold) +13:1765:2:82:1 //Randomize plugin parameters: Ctrl+R (KeyDown) + +//----( General Context [top] (14) )------------ + +//----( Pattern Context [top] (15) )------------ + +//----( Sample Context [top] (16) )------------ + +//----( Instrument Context [top] (17) )------------ + +//----( Comments Context [top] (18) )------------ + +//----( Orderlist (19) )------------ +19:1802:0:46:5 //Delete Order: DELETE (KeyDown|KeyHold) +19:1803:0:45:5 //Insert Order: INSERT (KeyDown|KeyHold) +19:1804:0:13:5 //Edit Pattern: ENTER (KeyDown|KeyHold) +19:1805:0:9:5 //Switch to pattern editor: TAB (KeyDown|KeyHold) +19:1794:0:37:5 //Previous Order: LEFT (KeyDown|KeyHold) +19:1794:0:38:5 //Previous Order: UP (KeyDown|KeyHold) +19:1795:0:39:5 //Next Order: RIGHT (KeyDown|KeyHold) +19:1795:0:40:5 //Next Order: DOWN (KeyDown|KeyHold) +19:1796:0:36:5 //First Order: HOME (KeyDown|KeyHold) +19:1797:0:35:5 //Last Order: END (KeyDown|KeyHold) +19:1807:0:48:5 //Pattern index digit 0: 0 (KeyDown|KeyHold) +19:1807:0:96:5 //Pattern index digit 0: NUM 0 (KeyDown|KeyHold) +19:1808:0:49:5 //Pattern index digit 1: 1 (KeyDown|KeyHold) +19:1808:0:97:5 //Pattern index digit 1: NUM 1 (KeyDown|KeyHold) +19:1809:0:50:5 //Pattern index digit 2: 2 (KeyDown|KeyHold) +19:1809:0:98:5 //Pattern index digit 2: NUM 2 (KeyDown|KeyHold) +19:1810:0:51:5 //Pattern index digit 3: 3 (KeyDown|KeyHold) +19:1810:0:99:5 //Pattern index digit 3: NUM 3 (KeyDown|KeyHold) +19:1811:0:52:5 //Pattern index digit 4: 4 (KeyDown|KeyHold) +19:1811:0:100:5 //Pattern index digit 4: NUM 4 (KeyDown|KeyHold) +19:1812:0:53:5 //Pattern index digit 5: 5 (KeyDown|KeyHold) +19:1812:0:101:5 //Pattern index digit 5: NUM 5 (KeyDown|KeyHold) +19:1813:0:54:5 //Pattern index digit 6: 6 (KeyDown|KeyHold) +19:1813:0:102:5 //Pattern index digit 6: NUM 6 (KeyDown|KeyHold) +19:1814:0:55:5 //Pattern index digit 7: 7 (KeyDown|KeyHold) +19:1814:0:103:5 //Pattern index digit 7: NUM 7 (KeyDown|KeyHold) +19:1815:0:56:5 //Pattern index digit 8: 8 (KeyDown|KeyHold) +19:1815:0:104:5 //Pattern index digit 8: NUM 8 (KeyDown|KeyHold) +19:1816:0:57:5 //Pattern index digit 9: 9 (KeyDown|KeyHold) +19:1816:0:105:5 //Pattern index digit 9: NUM 9 (KeyDown|KeyHold) +19:1817:0:107:5 //Increase pattern index : NUM PLUS (KeyDown|KeyHold) +19:1817:0:187:5 //Increase pattern index : = (KeyDown|KeyHold) +19:1818:0:109:5 //Decrease pattern index: NUM SUB (KeyDown|KeyHold) +19:1818:0:189:5 //Decrease pattern index: - (KeyDown|KeyHold) Modified: trunk/OpenMPT/packageTemplate/extraKeymaps/dvorak_(snu).mkb =================================================================== --- trunk/OpenMPT/packageTemplate/extraKeymaps/dvorak_(snu).mkb 2010-01-16 23:55:23 UTC (rev 470) +++ trunk/OpenMPT/packageTemplate/extraKeymaps/dvorak_(snu).mkb 2010-01-19 22:57:23 UTC (rev 471) @@ -8,51 +8,60 @@ 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:2:119:1 //Play song/Pause song: Ctrl+F8 (KeyDown) +0:1350:6:83:1 //File/Save As: Ctrl+Alt+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:116:5 //Play song from start: F5 (KeyDown|KeyHold) -0:1028:0:118:5 //Play song from cursor: F7 (KeyDown|KeyHold) -0:1027:0:117:5 //Play pattern from start: F6 (KeyDown|KeyHold) -0:1026:2:117:5 //Play pattern from cursor: Ctrl+F6 (KeyDown|KeyHold) -0:1376:2:120:1 //Toggle Midi Record: Ctrl+F9 (KeyDown) +0:1029:0:117:1 //Play song from start: F6 (KeyDown) +0:1027:0:118:1 //Play pattern from start: F7 (KeyDown) +0:1026:2:118:1 //Play pattern from cursor: Ctrl+F7 (KeyDown) +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:1362:2:86:1 //Paste: Ctrl+V (KeyDown) -0:1364:2:65:1 //SelectAll: Ctrl+A (KeyDown) +0:1362:1:45:1 //Paste: Shift+INSERT (KeyDown) +0:1363:6:86:1 //Mix Paste: Ctrl+Alt+V (KeyDown) +0:1793:1:86:5 //Paste Flood: Shift+V (KeyDown|KeyHold) +0:1364:2:53:1 //SelectAll: Ctrl+5 (KeyDown) 0:1365:2:70:1 //Find: Ctrl+F (KeyDown) -0:1366:2:114:1 //Find Next: Ctrl+F3 (KeyDown) -0:1021:0:122:1 //View General: F11 (KeyDown) -0:1022:0:113:1 //View Pattern: F2 (KeyDown) -0:1023:0:114:1 //View Samples: F3 (KeyDown) -0:1024:0:115:1 //View Instruments: F4 (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:1025:4:67:1 //View Comments: Alt+C (KeyDown) 0:1368:2:113:1 //Toggle Tree View: Ctrl+F2 (KeyDown) +0:1369:2:112:1 //View Options: Ctrl+F1 (KeyDown) +0:1781:2:114:1 //View MIDI mapping: Ctrl+F3 (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:5 //Previous octave: NUM DIVIDE (KeyDown|KeyHold) -0:1037:0:106:5 //Next octave: NUMMULT (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:4:34:5 //Jump down by measure: Alt+PGDOWN (KeyDown|KeyHold) -2:1018:4:33:5 //Jump up by measure: Alt+PGUP (KeyDown|KeyHold) -2:1338:0:34:5 //Jump down by beat: PGDOWN (KeyDown|KeyHold) -2:1339:0:33:5 //Jump up by beat: PGUP (KeyDown|KeyHold) -2:1019:2:34:5 //Snap down to measure: Ctrl+PGDOWN (KeyDown|KeyHold) -2:1020:2:33:5 //Snap up to measure: Ctrl+PGUP (KeyDown|KeyHold) +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:2:9:5 //Navigate to previous channel: Ctrl+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) @@ -60,93 +69,109 @@ 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:1011:4:76:1 //Select channel / Select all: Alt+L (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:1 //Quick copy: ENTER (KeyDown) -2:1004:0:32:1 //Quick paste: SPACE (KeyDown) -2:1001:1:120:1 //Enable recording: Shift+F9 (KeyDown) -2:1002:0:104:5 //Play row: NUM 8 (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:1806:2:68:1 //Duplicate pattern: Ctrl+D (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:1063:2:93:1 //Show context (right-click) menu: Ctrl+Application (KeyDown) -2:1005:0:120:1 //Mute current channel: F9 (KeyDown) -2:1006:0:121:1 //Solo current channel: F10 (KeyDown) -2:1007:4:81:5 //Transpose +1: Alt+Q (KeyDown|KeyHold) -2:1008:4:65:5 //Transpose -1: Alt+A (KeyDown|KeyHold) -2:1009:6:81:5 //Transpose +12: Ctrl+Alt+Q (KeyDown|KeyHold) +2:1772:5:80:1 //Show pattern properties window: Shift+Alt+P (KeyDown) +2:1819:2:69:1 //Split Keyboard Settings dialog: Ctrl+E (KeyDown) +2:1780:2:80:1 //Show playback time at current row: Ctrl+P (KeyDown) +2:1005:0:121:1 //Mute current channel: F10 (KeyDown) +2:1006:2:121:1 //Solo current channel: Ctrl+F10 (KeyDown) +2:1771:6:121:1 //Unmute all channels: Ctrl+Alt+F10 (KeyDown) +2:1786:2:82:1 //Reset channel: Ctrl+R (KeyDown) +2:1007:2:222:5 //Transpose +1: Ctrl+' (KeyDown|KeyHold) +2:1008:2:65:5 //Transpose -1: Ctrl+A (KeyDown|KeyHold) +2:1009:6:222:5 //Transpose +12: Ctrl+Alt+' (KeyDown|KeyHold) 2:1010:6:65:5 //Transpose -12: Ctrl+Alt+A (KeyDown|KeyHold) -2:1012:4:74:1 //Amplify selection: Alt+J (KeyDown) -2:1014:4:73:1 //Interpolate volume: Alt+I (KeyDown) -2:1015:4:88:1 //Interpolate effect: Alt+X (KeyDown) +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:1013:4:83:1 //Apply current instrument: Alt+S (KeyDown) -2:1664:0:46:1 //Clear field (IT Style): DELETE (KeyDown) -2:1059:2:46:1 //Clear row and step: Ctrl+DELETE (KeyDown) -2:1060:2:110:1 //Clear field and step: Ctrl+NUM DECIMAL (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:5 //Clear row and step: Ctrl+DELETE (KeyDown|KeyHold) +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:1 //Previous pattern: NUM SUB (KeyDown) -2:1054:0:107:1 //Next pattern: NUM PLUS (KeyDown) +2:1378:0:45:5 //Insert Row: INSERT (KeyDown|KeyHold) +2:1379:2:45:5 //Insert All Rows: Ctrl+INSERT (KeyDown|KeyHold) +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:222:5 //Base octave C: ' (KeyDown|KeyHold) -3:1065:0:188:5 //Base octave C#: , (KeyDown|KeyHold) -3:1066:0:190:5 //Base octave D: . (KeyDown|KeyHold) -3:1067:0:80:5 //Base octave D#: P (KeyDown|KeyHold) -3:1068:0:89:5 //Base octave E: Y (KeyDown|KeyHold) -3:1069:0:70:5 //Base octave F: F (KeyDown|KeyHold) -3:1070:0:71:5 //Base octave F#: G (KeyDown|KeyHold) -3:1071:0:67:5 //Base octave G: C (KeyDown|KeyHold) -3:1072:0:82:5 //Base octave G#: R (KeyDown|KeyHold) -3:1073:0:76:5 //Base octave +1 A: L (KeyDown|KeyHold) -3:1074:0:191:5 //Base octave +1 A#: / (KeyDown|KeyHold) -3:1075:0:187:5 //Base octave +1 B: = (KeyDown|KeyHold) -3:1076:0:65:5 //Base octave +1 C: A (KeyDown|KeyHold) -3:1077:0:79:5 //Base octave +1 C#: O (KeyDown|KeyHold) -3:1078:0:69:5 //Base octave +1 D: E (KeyDown|KeyHold) -3:1079:0:85:5 //Base octave +1 D#: U (KeyDown|KeyHold) -3:1080:0:73:5 //Base octave +1 E: I (KeyDown|KeyHold) -3:1081:0:68:5 //Base octave +1 F: D (KeyDown|KeyHold) -3:1082:0:72:5 //Base octave +1 F#: H (KeyDown|KeyHold) -3:1083:0:84:5 //Base octave +1 G: T (KeyDown|KeyHold) -3:1084:0:78:5 //Base octave +1 G#: N (KeyDown|KeyHold) -3:1085:0:83:5 //Base octave +2 A: S (KeyDown|KeyHold) -3:1086:0:189:5 //Base octave +2 A#: - (KeyDown|KeyHold) -3:1087:0:220:5 //Base octave +2 B: \ (KeyDown|KeyHold) -3:1088:0:186:5 //Base octave +2 C: ; (KeyDown|KeyHold) -3:1089:0:81:5 //Base octave +2 C#: Q (KeyDown|KeyHold) -3:1090:0:74:5 //Base octave +2 D: J (KeyDown|KeyHold) -3:1091:0:75:5 //Base octave +2 D#: K (KeyDown|KeyHold) -3:1092:0:88:5 //Base octave +2 E: X (KeyDown|KeyHold) -3:1093:0:66:5 //Base octave +2 F: B (KeyDown|KeyHold) -3:1094:0:77:5 //Base octave +2 F#: M (KeyDown|KeyHold) -3:1095:0:87:5 //Base octave +2 G: W (KeyDown|KeyHold) -3:1096:0:86:5 //Base octave +2 G#: V (KeyDown|KeyHold) -3:1097:0:90:5 //Base octave +3 A: Z (KeyDown|KeyHold) +3:1064:0:222:1 //Base octave C: ' (KeyDown) +3:1065:0:188:1 //Base octave C#: , (KeyDown) +3:1066:0:190:1 //Base octave D: . (KeyDown) +3:1067:0:80:1 //Base octave D#: P (KeyDown) +3:1068:0:89:1 //Base octave E: Y (KeyDown) +3:1069:0:70:1 //Base octave F: F (KeyDown) +3:1070:0:71:1 //Base octave F#: G (KeyDown) +3:1071:0:67:1 //Base octave G: C (KeyDown) +3:1072:0:82:1 //Base octave G#: R (KeyDown) +3:1073:0:76:1 //Base octave A: L (KeyDown) +3:1074:0:191:1 //Base octave A#: / (KeyDown) +3:1075:0:187:1 //Base octave B: = (KeyDown) +3:1076:0:65:1 //Base octave +1 C: A (KeyDown) +3:1077:0:79:1 //Base octave +1 C#: O (KeyDown) +3:1078:0:69:1 //Base octave +1 D: E (KeyDown) +3:1079:0:85:1 //Base octave +1 D#: U (KeyDown) +3:1080:0:73:1 //Base octave +1 E: I (KeyDown) +3:1081:0:68:1 //Base octave +1 F: D (KeyDown) +3:1082:0:72:1 //Base octave +1 F#: H (KeyDown) +3:1083:0:84:1 //Base octave +1 G: T (KeyDown) +3:1084:0:78:1 //Base octave +1 G#: N (KeyDown) +3:1085:0:83:1 //Base octave +1 A: S (KeyDown) +3:1086:0:189:1 //Base octave +1 A#: - (KeyDown) +3:1087:0:220:1 //Base octave +1 B: \ (KeyDown) +3:1088:0:186:1 //Base octave +2 C: ; (KeyDown) +3:1089:0:81:1 //Base octave +2 C#: Q (KeyDown) +3:1090:0:74:1 //Base octave +2 D: J (KeyDown) +3:1091:0:75:1 //Base octave +2 D#: K (KeyDown) +3:1092:0:88:1 //Base octave +2 E: X (KeyDown) +3:1093:0:66:1 //Base octave +2 F: B (KeyDown) +3:1094:0:77:1 //Base octave +2 F#: M (KeyDown) +3:1095:0:87:1 //Base octave +2 G: W (KeyDown) +3:1096:0:86:1 //Base octave +2 G#: V (KeyDown) +3:1097:0:90:1 //Base octave +2 A: Z (KeyDown) +3:1212:0:48:1 //Set octave 0: 0 (KeyDown) 3:1212:0:96:1 //Set octave 0: NUM 0 (KeyDown) -3:1212:0:48:1 //Set octave 0: 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:1214:0:50:1 //Set octave 2: 2 (KeyDown) +3:1215:0:51:1 //Set octave 3: 3 (KeyDown) 3:1215:0:99:1 //Set octave 3: NUM 3 (KeyDown) -3:1215:0:51:1 //Set octave 3: 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:1217:0:53:1 //Set octave 5: 5 (KeyDown) +3:1218:0:54:1 //Set octave 6: 6 (KeyDown) 3:1218:0:102:1 //Set octave 6: NUM 6 (KeyDown) -3:1218:0:54:1 //Set octave 6: 6 (KeyDown) +3:1219:0:55:1 //Set octave 7: 7 (KeyDown) 3:1219:0:103:1 //Set octave 7: NUM 7 (KeyDown) -3:1219:0:55:1 //Set octave 7: 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:1221:0:57:1 //Set octave 9: 9 (KeyDown) 3:1316:1:16:1 //Chord Modifier: Shift (KeyDown) -3:1667:0:192:1 //Note cut (don't remember instrument): ` (KeyDown) -3:1668:0:221:1 //Note off (don't remember instrument): ] (KeyDown) +3:1200:0:192:1 //Note Cut: ` (KeyDown) +3:1201:0:221:1 //Note Off: ] (KeyDown) +3:1791:1:221:1 //Note Fade: Shift+] (KeyDown) +3:1788:0:219:1 //Parameter control(MPTm only): [ (KeyDown) +3:1789:1:219:1 //Parameter control(smooth)(MPTm only): Shift+[ (KeyDown) //----( Pattern Context [bottom] - Ins Col (4) )------------ 4:1202:0:96:1 //Set instrument digit 0: NUM 0 (KeyDown) @@ -165,6 +190,7 @@ 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:104:1 //Set instrument digit 8: NUM 8 (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) @@ -187,6 +213,7 @@ 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:1230:0:104:1 //Set volume digit 8: NUM 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) @@ -202,25 +229,37 @@ 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:0:186:1 //Vol command - Velocity: ; (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:92:1 //FX midi macro slide: Right Windows (KeyDown) -6:1295:0:58:1 //FX pseudo-velocity (experimental): (KeyDown) -6:1295:1:58:1 //FX pseudo-velocity (experimental): Shift+ (KeyDown) +6:1294:0:220:1 //FX midi macro slide: \ (KeyDown) +6:1295:1:186:1 //FX pseudo-velocity (experimental): Shift+; (KeyDown) +6:1295:0:186:1 //FX pseudo-velocity (experimental): ; (KeyDown) +6:1666:0:191:1 //FX parameter extension command: / (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) @@ -231,14 +270,34 @@ //----( 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:1384:3:78:1 //Normalise Sample: Shift+Ctrl+N (KeyDown) -8:1385:3:65:1 //Amplify Sample: Shift+Ctrl+A (KeyDown) -8:1381:3:82:1 //Reverse sample: Shift+Ctrl+R (KeyDown) +8:1384:1:78:1 //Normalise Sample: Shift+N (KeyDown) +8:1385:6:65:1 //Amplify Sample: Ctrl+Alt+A (KeyDown) +8:1385:2:77:1 //Amplify Sample: Ctrl+M (KeyDown) +8:1381:6:82:1 //Reverse sample: Ctrl+Alt+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) +8:1784:2:73:1 //Invert sample phase: Ctrl+I (KeyDown) +8:1785:2:85:1 //Signed/Unsigned conversion: Ctrl+U (KeyDown) +8:1790:2:68:1 //Remove DC Offset: Ctrl+D (KeyDown) //----( Instrument Context [bottom] (9) )------------ +9:1825:1:9:5 //Select previous envelope point: Shift+TAB (KeyDown|KeyHold) +9:1826:0:9:5 //Select next envelope point: TAB (KeyDown|KeyHold) +9:1821:0:37:5 //Move envelope point left: LEFT (KeyDown|KeyHold) +9:1822:0:39:5 //Move envelope point right: RIGHT (KeyDown|KeyHold) +9:1823:0:38:5 //Move envelope point up: UP (KeyDown|KeyHold) +9:1834:0:33:5 //Move envelope point up (big step): PGUP (KeyDown|KeyHold) +9:1824:0:40:5 //Move envelope point down: DOWN (KeyDown|KeyHold) +9:1835:0:34:5 //Move envelope point down (big step): PGDOWN (KeyDown|KeyHold) +9:1827:0:45:1 //Insert envelope point: INSERT (KeyDown) +9:1828:0:46:1 //Remove envelope point: DELETE (KeyDown) +9:1828:0:8:1 //Remove envelope point: BACKSPACE (KeyDown) +9:1829:0:36:1 //Set loop start: HOME (KeyDown) +9:1830:0:35:1 //Set loop end: END (KeyDown) +9:1831:2:36:1 //Set sustain loop start: Ctrl+HOME (KeyDown) +9:1832:2:35:1 //Set sustain loop end: Ctrl+END (KeyDown) +9:1833:2:82:1 //Toggle release node: Ctrl+R (KeyDown) //----( Comments Context [bottom] (10) )------------ @@ -247,6 +306,11 @@ //----( Unknown Context (12) )------------ //----( Plugin GUI Context (13) )------------ +13:1763:0:37:5 //Previous plugin preset: LEFT (KeyDown|KeyHold) +13:1764:0:39:5 //Next plugin preset: RIGHT (KeyDown|KeyHold) +13:1782:0:38:5 //Plugin preset backward jump: UP (KeyDown|KeyHold) +13:1783:0:40:5 //Plugin preset forward jump: DOWN (KeyDown|KeyHold) +13:1765:2:82:1 //Randomize plugin parameters: Ctrl+R (KeyDown) //----( General Context [top] (14) )------------ @@ -290,6 +354,6 @@ 19:1816:0:57:5 //Pattern index digit 9: 9 (KeyDown|KeyHold) 19:1816:0:105:5 //Pattern index digit 9: NUM 9 (KeyDown|KeyHold) 19:1817:0:107:5 //Increase pattern index : NUM PLUS (KeyDown|KeyHold) -19:1817:0:187:5 //Increase pattern index : + (KeyDown|KeyHold) -19:1818:0:109:1 //Decrease pattern index: NUM SUB (KeyDown) -19:1818:0:189:1 //Decrease pattern index: - (KeyDown) +19:1817:0:187:5 //Increase pattern index : = (KeyDown|KeyHold) +19:1818:0:109:5 //Decrease pattern index: NUM SUB (KeyDown|KeyHold) +19:1818:0:189:5 //Decrease pattern index: - (KeyDown|KeyHold) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <sag...@us...> - 2010-01-20 22:10:16
|
Revision: 472 http://modplug.svn.sourceforge.net/modplug/?rev=472&view=rev Author: saga-games Date: 2010-01-20 22:09:23 +0000 (Wed, 20 Jan 2010) Log Message: ----------- [Mod] Changed a label in the installer [New] MPTM command S7D explicitely enforces pitch envelope, S7E enforces filter envelope. Modified Paths: -------------- trunk/OpenMPT/installer/install.iss trunk/OpenMPT/mptrack/Moddoc.cpp trunk/OpenMPT/soundlib/Snd_defs.h trunk/OpenMPT/soundlib/Snd_fx.cpp trunk/OpenMPT/soundlib/Sndfile.cpp trunk/OpenMPT/soundlib/Sndmix.cpp Modified: trunk/OpenMPT/installer/install.iss =================================================================== --- trunk/OpenMPT/installer/install.iss 2010-01-19 22:57:23 UTC (rev 471) +++ trunk/OpenMPT/installer/install.iss 2010-01-20 22:09:23 UTC (rev 472) @@ -28,7 +28,7 @@ ; icons and install mode Name: "desktopicon"; Description: "{cm:CreateDesktopIcon}"; GroupDescription: "{cm:AdditionalIcons}"; Name: "quicklaunchicon"; Description: "{cm:CreateQuickLaunchIcon}"; GroupDescription: "{cm:AdditionalIcons}"; Flags: unchecked -Name: "portable"; Description: "Use program directory to store configuration in (portable mode)"; GroupDescription: "Options:"; Flags: unchecked +Name: "portable"; Description: "Use program directory to store configuration in"; GroupDescription: "Options:"; Flags: unchecked ; file associations - put this below all other [tasks]! #include "filetypes.iss" @@ -104,3 +104,4 @@ + Modified: trunk/OpenMPT/mptrack/Moddoc.cpp =================================================================== --- trunk/OpenMPT/mptrack/Moddoc.cpp 2010-01-19 22:57:23 UTC (rev 471) +++ trunk/OpenMPT/mptrack/Moddoc.cpp 2010-01-20 22:09:23 UTC (rev 472) @@ -1834,7 +1834,7 @@ //rewbs.graph void CModDoc::OnEditGraph() -//---------------------------- +//------------------------- { if (m_SndFile.m_nType & (MOD_TYPE_XM|MOD_TYPE_IT | MOD_TYPE_MPT)) SendMessageToActiveViews(WM_MOD_ACTIVATEVIEW, IDD_CONTROL_GRAPH); } @@ -2646,6 +2646,9 @@ case 0x0A: strcpy(s, "7A: Pan Env On"); break; case 0x0B: strcpy(s, "7B: Pitch Env Off"); break; case 0x0C: strcpy(s, "7C: Pitch Env On"); break; + // intentional fall-through follows + case 0x0D: if(m_SndFile.GetType() == MOD_TYPE_MPT) { strcpy(s, "7D: Force Pitch Env"); break; } + case 0x0E: if(m_SndFile.GetType() == MOD_TYPE_MPT) { strcpy(s, "7E: Force Filter Env"); break; } default: wsprintf(s, "%02X: undefined", param); break; } } else Modified: trunk/OpenMPT/soundlib/Snd_defs.h =================================================================== --- trunk/OpenMPT/soundlib/Snd_defs.h 2010-01-19 22:57:23 UTC (rev 471) +++ trunk/OpenMPT/soundlib/Snd_defs.h 2010-01-20 22:09:23 UTC (rev 472) @@ -155,7 +155,11 @@ #define CHN_SOLO 0x10000000 // -> CODE#0012 -> DESC="midi keyboard split" -! NEW_FEATURE#0012 #define CHN_NOFX 0x20000000 // -> CODE#0015 -> DESC="channels management dlg" -! NEW_FEATURE#0015 #define CHN_SYNCMUTE 0x40000000 +#define CHN_FILTERENV 0x80000000 +#define CHN_SAMPLEFLAGS (CHN_16BIT|CHN_LOOP|CHN_PINGPONGLOOP|CHN_SUSTAINLOOP|CHN_PINGPONGSUSTAIN|CHN_PANNING|CHN_STEREO|CHN_PINGPONGFLAG) +#define CHN_CHANNELFLAGS (~CHN_SAMPLEFLAGS) + // instrument envelope-specific flags #define ENV_ENABLED 0x01 // env is enabled #define ENV_LOOP 0x02 // env loop Modified: trunk/OpenMPT/soundlib/Snd_fx.cpp =================================================================== --- trunk/OpenMPT/soundlib/Snd_fx.cpp 2010-01-19 22:57:23 UTC (rev 471) +++ trunk/OpenMPT/soundlib/Snd_fx.cpp 2010-01-20 22:09:23 UTC (rev 472) @@ -554,7 +554,7 @@ { if(m_nType & (MOD_TYPE_S3M|MOD_TYPE_IT|MOD_TYPE_MPT)) return; pChn->dwFlags &= ~(CHN_KEYOFF|CHN_NOTEFADE); - pChn->dwFlags = (pChn->dwFlags & (0xFFFFFF00 | CHN_PINGPONGFLAG)) | (pSmp->uFlags & 0xFF); + pChn->dwFlags = (pChn->dwFlags & (CHN_CHANNELFLAGS | CHN_PINGPONGFLAG)) | (pSmp->uFlags & CHN_SAMPLEFLAGS); } else { pChn->dwFlags &= ~(CHN_KEYOFF|CHN_NOTEFADE|CHN_VOLENV|CHN_PANENV|CHN_PITCHENV); @@ -562,9 +562,9 @@ //IT compatibility tentative fix: Don't change bidi loop direction when //no sample nor instrument is changed. if(IsCompatibleMode(TRK_IMPULSETRACKER) && pSmp == pChn->pModSample && !bInstrumentChanged) - pChn->dwFlags = (pChn->dwFlags & (0xFFFFFF00 | CHN_PINGPONGFLAG)) | (pSmp->uFlags & 0xFF); + pChn->dwFlags = (pChn->dwFlags & (CHN_CHANNELFLAGS | CHN_PINGPONGFLAG)) | (pSmp->uFlags & CHN_SAMPLEFLAGS); else - pChn->dwFlags = (pChn->dwFlags & 0xFFFFFF00) | (pSmp->uFlags & 0xFF); + pChn->dwFlags = (pChn->dwFlags & CHN_CHANNELFLAGS) | (pSmp->uFlags & CHN_SAMPLEFLAGS); if (pIns) @@ -574,7 +574,13 @@ if (pIns->PitchEnv.dwFlags & ENV_ENABLED) pChn->dwFlags |= CHN_PITCHENV; if ((pIns->PitchEnv.dwFlags & ENV_ENABLED) && (pIns->PitchEnv.dwFlags & ENV_FILTER)) { + pChn->dwFlags |= CHN_FILTERENV; if (!pChn->nCutOff) pChn->nCutOff = 0x7F; + } else + { + // Special case: Reset filter envelope flag manually (because of S7D/S7E effects). + // This way, the S7x effects can be applied to several notes, as long as they don't come with an instrument number. + pChn->dwFlags &= ~CHN_FILTERENV; } if (pIns->nIFC & 0x80) pChn->nCutOff = pIns->nIFC & 0x7F; if (pIns->nIFR & 0x80) pChn->nResonance = pIns->nIFR & 0x7F; @@ -709,7 +715,7 @@ pChn->nLength = pSmp->nLength; pChn->nLoopEnd = pSmp->nLength; pChn->nLoopStart = 0; - pChn->dwFlags = (pChn->dwFlags & 0xFFFFFF00) | (pSmp->uFlags & 0xFF); + pChn->dwFlags = (pChn->dwFlags & CHN_CHANNELFLAGS) | (pSmp->uFlags & CHN_SAMPLEFLAGS); if (pChn->dwFlags & CHN_SUSTAINLOOP) { pChn->nLoopStart = pSmp->nSustainStart; @@ -2192,6 +2198,7 @@ // Implemented for IMF compatibility, can't actually save this in any formats // sign should be 1 (up) or -1 (down) void CSoundFile::NoteSlide(MODCHANNEL *pChn, UINT param, int sign) +//---------------------------------------------------------------- { BYTE x, y; if (m_dwSongFlags & SONG_FIRSTTICK) { @@ -2593,7 +2600,7 @@ case 0x50: if(((param & 0x0F) < 0x04) || !IsCompatibleMode(TRK_IMPULSETRACKER)) pChn->nPanbrelloType = param & 0x07; break; // S6x: Pattern Delay for x frames case 0x60: m_nFrameDelay = param; break; - // S7x: Envelope Control + // S7x: Envelope Control / Instrument Control case 0x70: if(!(m_dwSongFlags & SONG_FIRSTTICK)) break; switch(param) { @@ -2606,9 +2613,17 @@ { if (bkp->nMasterChn == nChn+1) { - if (param == 1) KeyOff(i); else - if (param == 2) bkp->dwFlags |= CHN_NOTEFADE; else - { bkp->dwFlags |= CHN_NOTEFADE; bkp->nFadeOutVol = 0; } + if (param == 1) + { + KeyOff(i); + } else if (param == 2) + { + bkp->dwFlags |= CHN_NOTEFADE; + } else + { + bkp->dwFlags |= CHN_NOTEFADE; + bkp->nFadeOutVol = 0; + } } } } @@ -2623,6 +2638,20 @@ case 10: pChn->dwFlags |= CHN_PANENV; break; case 11: pChn->dwFlags &= ~CHN_PITCHENV; break; case 12: pChn->dwFlags |= CHN_PITCHENV; break; + case 13: + case 14: + if(GetType() == MOD_TYPE_MPT) + { + pChn->dwFlags |= CHN_PITCHENV; + if(param == 13) // pitch env on, filter env off + { + pChn->dwFlags &= ~CHN_FILTERENV; + } else // filter env on + { + pChn->dwFlags |= CHN_FILTERENV; + } + } + break; } break; // S8x: Set 4-bit Panning Modified: trunk/OpenMPT/soundlib/Sndfile.cpp =================================================================== --- trunk/OpenMPT/soundlib/Sndfile.cpp 2010-01-19 22:57:23 UTC (rev 471) +++ trunk/OpenMPT/soundlib/Sndfile.cpp 2010-01-20 22:09:23 UTC (rev 472) @@ -3227,7 +3227,7 @@ case 0x40: m->param = (m->param & 0x0F) | 0x70; break; case 0x50: case 0x60: - case 0x70: + case 0x70: if(((m->param & 0xF0) == 0x70) && ((m->param & 0x0F) > 0x0A)) { m->command = CMD_NONE; break; } // no pitch env in XM format case 0x90: case 0xA0: m->command = CMD_XFINEPORTAUPDOWN; break; case 0xB0: m->param = (m->param & 0x0F) | 0x60; break; @@ -3275,8 +3275,8 @@ } } // End if(m->command == CMD_PANNING8) - ////////////////////////// - // Convert param control + ///////////////////////////////////////////////////// + // Convert param control, extended envelope control if(oldTypeIsMPT) { if(m->note == NOTE_PC || m->note == NOTE_PCS) @@ -3286,6 +3286,12 @@ m->volcmd = VOLCMD_NONE; m->note = NOTE_NONE; } + + // adjust extended envelope control commands + if((m->command == CMD_S3MCMDEX) && ((m->param & 0xF0) == 0x70) && ((m->param & 0x0F) > 0x0C)) + { + m->param = 0x7C; + } } // End if(oldTypeIsMPT) ///////////////////////////////////////// Modified: trunk/OpenMPT/soundlib/Sndmix.cpp =================================================================== --- trunk/OpenMPT/soundlib/Sndmix.cpp 2010-01-19 22:57:23 UTC (rev 471) +++ trunk/OpenMPT/soundlib/Sndmix.cpp 2010-01-20 22:09:23 UTC (rev 472) @@ -1300,7 +1300,8 @@ } envpitch = CLAMP(envpitch, -256, 256); // Filter Envelope: controls cutoff frequency - if (pIns->PitchEnv.dwFlags & ENV_FILTER) + //if (pIns->PitchEnv.dwFlags & ENV_FILTER) + if (pChn->dwFlags & CHN_FILTERENV) { #ifndef NO_FILTER SetupChannelFilter(pChn, (pChn->dwFlags & CHN_FILTER) ? false : true, envpitch); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <rel...@us...> - 2010-01-21 17:03:48
|
Revision: 473 http://modplug.svn.sourceforge.net/modplug/?rev=473&view=rev Author: relabsoluness Date: 2010-01-21 17:03:40 +0000 (Thu, 21 Jan 2010) Log Message: ----------- [Fix] Internal: Fix to random crashes in VC05/08 debug builds caused by different behaviour of security-enhanced CRT functions compared to the originals. [Imp] PackageTemplate: New files and updates. Modified Paths: -------------- trunk/OpenMPT/installer/packageTemplate/readme.txt trunk/OpenMPT/mptrack/Mptrack.cpp trunk/OpenMPT/packageTemplate/History.txt Added Paths: ----------- trunk/OpenMPT/packageTemplate/open_settings_folder.bat trunk/OpenMPT/packageTemplate/readme.txt Modified: trunk/OpenMPT/installer/packageTemplate/readme.txt =================================================================== --- trunk/OpenMPT/installer/packageTemplate/readme.txt 2010-01-20 22:09:23 UTC (rev 472) +++ trunk/OpenMPT/installer/packageTemplate/readme.txt 2010-01-21 17:03:40 UTC (rev 473) @@ -15,20 +15,10 @@ -------------- An uninstaller is provided. It won't delete your personal settings, so you have -to delete them yourself, if you don't want to keep them. You can use -"open_settings_folder.bat" to find them (or just go to %appdata%\OpenMPT). +to delete them yourself, if you don't want to keep them. There is a shortcut to +settings folder in the installation directory. -Making OpenMPT portable ------------------------ - -By default, OpenMPT stores its settings in %appdata%\OpenMPT. To avoid this, -create a file called "mptrack.ini" in the same (!) directory as mptrack.exe (if -it does not exist yet) and add the following lines to this file: -[Paths] -UseAppDataDirectory=0 - - Changes ------- Modified: trunk/OpenMPT/mptrack/Mptrack.cpp =================================================================== --- trunk/OpenMPT/mptrack/Mptrack.cpp 2010-01-20 22:09:23 UTC (rev 472) +++ trunk/OpenMPT/mptrack/Mptrack.cpp 2010-01-21 17:03:40 UTC (rev 473) @@ -608,6 +608,9 @@ CTrackApp::CTrackApp() //-------------------- { + #if (_MSC_VER >= 1400) + _CrtSetDebugFillThreshold(0); // Disable buffer filling in secure enhanced CRT functions. + #endif m_pModTemplate = NULL; m_pPluginManager = NULL; m_bInitialized = FALSE; Modified: trunk/OpenMPT/packageTemplate/History.txt =================================================================== --- trunk/OpenMPT/packageTemplate/History.txt 2010-01-20 22:09:23 UTC (rev 472) +++ trunk/OpenMPT/packageTemplate/History.txt 2010-01-21 17:03:40 UTC (rev 473) @@ -187,7 +187,7 @@ . <Jojo> When no INI file was present, channel separators were completely black. Keymaps - + <Jojo> Two new keymaps: French Laptop by Paul Legovitch, Norwegian MPT Classic by Rakib. + + <Jojo> Three new keymaps: French Laptop by Paul Legovitch, Norwegian MPT Classic by Rakib, US_mpt_classic_(snu). / <Jojo> Updated DE_jojo.mkb ^ <Jojo> When loading a keymap file and unrecognized lines are found, only one messagebox is shown. / <Jojo> All keymaps have been updated to version 1 and updated to contain the orderlist shortcuts. @@ -342,6 +342,7 @@ + <Jojo> Allow up to 240 envelope points. + <Jojo> IT "Note Fade" command: This existed in IT's player routines already, but there was no way to actually use it in the editor. Triggering an invalid note would cause a note fade, so this is a new note type. + <re> Channel settings(vol&pan) for channels after 64 will now be saved in the file. + + <Jojo> MPTM command S7D explicitely enforces pitch envelope, S7E enforces filter envelope. IT + <Jojo> IT "Note Fade" command: This existed in IT's player routines already, but there was no way to actually use it in the editor. Triggering an invalid note would cause a note fade, so this is a new note type. Added: trunk/OpenMPT/packageTemplate/open_settings_folder.bat =================================================================== --- trunk/OpenMPT/packageTemplate/open_settings_folder.bat (rev 0) +++ trunk/OpenMPT/packageTemplate/open_settings_folder.bat 2010-01-21 17:03:40 UTC (rev 473) @@ -0,0 +1 @@ +explorer %appdata%\OpenMPT \ No newline at end of file Added: trunk/OpenMPT/packageTemplate/readme.txt =================================================================== --- trunk/OpenMPT/packageTemplate/readme.txt (rev 0) +++ trunk/OpenMPT/packageTemplate/readme.txt 2010-01-21 17:03:40 UTC (rev 473) @@ -0,0 +1,106 @@ +****************** +* OpenMPT 1.18 * +****************** + + +Installation +------------ + +-If you have an existing installation of OpenMPT and wish to re-use its + settings, copy your mptrack.ini and plugin.cache to the directory into which + you extract the archive. +-If not, you're done: just extract the archive and launch mptrack.exe. + + +Uninstallation +-------------- + +-Delete the files extracted from the archive and optionally the OpenMPT + setting files, which are by default stored in %appdata%\OpenMPT. + + +Making OpenMPT portable +----------------------- + +By default, OpenMPT stores its settings in %appdata%\OpenMPT. To avoid this, +create a file called "mptrack.ini" in the same directory as mptrack.exe (if +it does not exist yet) and add the following lines to this file: +[Paths] +UseAppDataDirectory=0 + + +Changes +------- + +See history.txt. + + +Questions, comments, bug reports... +----------------------------------- + +See forums at http://modplug.sourceforge.net/. + + +Release package contents: +------------------------- +extraKeymaps(folder): +soundtouch(folder): SoundTouch readme and copying.txt +history.txt: Version history. +mptrack.exe: Main executable. +open_settings_folder.bat: Opens settings folder. +OpenMPT_SoundTouch_i16.dll: Slightly customized SoundTouch library used in time + stretching feature. +readme.txt: +unmo3.dll: Used in MO3-file import. + + +Misc: +----- + +OpenMPT is partially under the following license: + +> Copyright (c) 2004-2010, OpenMPT contributors +> Copyright (c) 1997-2003, Olivier Lapicque +> All rights reserved. +> +> Redistribution and use in source and binary forms, with or without +> modification, are permitted provided that the following conditions are met: +> * Redistributions of source code must retain the above copyright +> notice, this list of conditions and the following disclaimer. +> * Redistributions in binary form must reproduce the above copyright +> notice, this list of conditions and the following disclaimer in the +> documentation and/or other materials provided with the distribution. +> * Neither the name of the OpenMPT project nor the +> names of its contributors may be used to endorse or promote products +> derived from this software without specific prior written permission. +> +> THIS SOFTWARE IS PROVIDED BY THE CONTRIBUTORS ``AS IS'' AND ANY +> EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +> WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +> DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY +> DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +> (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +> LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND +> ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +> (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +> SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + + +ASIO is a trademark and software of Steinberg Media Technologies GmbH +VST is a trademark of Steinberg Media Technologies GmbH + +For more information about SoundTouch, see folder SoundTouch. + +unmo3.dll +--------- +Copyright (c) 2001-2009 Ian Luck. All rights reserved + +The MO3 software is free for non-commercial use; if anyone tries to +charge you for it, kick 'em where it hurts! + +TO THE MAXIMUM EXTENT PERMITTED BY APPLICABLE LAW, THIS SOFTWARE IS PROVIDED "AS +IS", WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT +NOT LIMITED TO THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A +PARTICULAR PURPOSE. THE AUTHORS SHALL NOT BE HELD LIABLE FOR ANY DAMAGE THAT MAY +RESULT FROM THE USE OF THIS SOFTWARE. YOU USE THIS SOFTWARE ENTIRELY AT YOUR OWN +RISK. This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <sag...@us...> - 2010-01-23 16:55:42
|
Revision: 475 http://modplug.svn.sourceforge.net/modplug/?rev=475&view=rev Author: saga-games Date: 2010-01-23 16:55:32 +0000 (Sat, 23 Jan 2010) Log Message: ----------- [Fix] Mod specs: If necessary (S3M), disable restart position edit control on general tab, reset restart position attribute when converting [Ref] Internal: Some variable type refactoring Modified Paths: -------------- trunk/OpenMPT/mptrack/Ctrl_gen.cpp trunk/OpenMPT/mptrack/MainFrm.cpp trunk/OpenMPT/mptrack/Modedit.cpp trunk/OpenMPT/soundlib/Sndfile.cpp trunk/OpenMPT/soundlib/Sndfile.h trunk/OpenMPT/soundlib/mod_specifications.h Modified: trunk/OpenMPT/mptrack/Ctrl_gen.cpp =================================================================== --- trunk/OpenMPT/mptrack/Ctrl_gen.cpp 2010-01-22 23:43:38 UTC (rev 474) +++ trunk/OpenMPT/mptrack/Ctrl_gen.cpp 2010-01-23 16:55:32 UTC (rev 475) @@ -217,6 +217,7 @@ m_SliderVSTiVol.EnableWindow(bIsNotMOD_S3M); m_EditVSTiVol.EnableWindow(bIsNotMOD_S3M); m_SpinVSTiVol.EnableWindow(bIsNotMOD_S3M); + m_EditRestartPos.EnableWindow(specs.hasRestartPos ? TRUE : FALSE); //Note: Global volume slider is not disabled for MOD //on purpose(can be used to control play volume) Modified: trunk/OpenMPT/mptrack/MainFrm.cpp =================================================================== --- trunk/OpenMPT/mptrack/MainFrm.cpp 2010-01-22 23:43:38 UTC (rev 474) +++ trunk/OpenMPT/mptrack/MainFrm.cpp 2010-01-23 16:55:32 UTC (rev 475) @@ -1801,7 +1801,7 @@ //-------------------------------- { m_nPreAmp = n; - if (m_pSndFile) m_pSndFile->SetMasterVolume(m_nPreAmp, TRUE); + if (m_pSndFile) m_pSndFile->SetMasterVolume(m_nPreAmp, true); } @@ -1864,7 +1864,7 @@ pSndFile->SetRepeatCount((gbLoopSong) ? -1 : 0); } } - m_pSndFile->SetMasterVolume(m_nPreAmp, TRUE); + m_pSndFile->SetMasterVolume(m_nPreAmp, true); m_pSndFile->InitPlayer(TRUE); memset(NotifyBuffer, 0, sizeof(NotifyBuffer)); m_dwStatus |= MODSTATUS_PLAYING; @@ -1957,7 +1957,7 @@ return FALSE; } gsdwTotalSamples = 0; - m_pSndFile->SetMasterVolume(m_nPreAmp, TRUE); + m_pSndFile->SetMasterVolume(m_nPreAmp, true); m_pSndFile->InitPlayer(TRUE); m_dwStatus |= MODSTATUS_PLAYING; if (gpSoundDevice) gpSoundDevice->Start(); Modified: trunk/OpenMPT/mptrack/Modedit.cpp =================================================================== --- trunk/OpenMPT/mptrack/Modedit.cpp 2010-01-22 23:43:38 UTC (rev 474) +++ trunk/OpenMPT/mptrack/Modedit.cpp 2010-01-23 16:55:32 UTC (rev 475) @@ -344,6 +344,14 @@ } } + // Is the "restart position" value allowed in this format? + if(CSoundFile::GetModSpecifications(nNewType).hasRestartPos == false) + { + m_SndFile.m_nRestartPos = 0; + AddToLog("WARNING: Restart position is not support by the new format.\n"); + } + + // Fix channel settings (pan/vol) for(CHANNELINDEX nChn = 0; nChn < m_SndFile.m_nChannels; nChn++) { Modified: trunk/OpenMPT/soundlib/Sndfile.cpp =================================================================== --- trunk/OpenMPT/soundlib/Sndfile.cpp 2010-01-22 23:43:38 UTC (rev 474) +++ trunk/OpenMPT/soundlib/Sndfile.cpp 2010-01-23 16:55:32 UTC (rev 475) @@ -1029,18 +1029,17 @@ } -BOOL CSoundFile::SetMasterVolume(UINT nVol, BOOL bAdjustAGC) -//---------------------------------------------------------- +void CSoundFile::SetMasterVolume(UINT nVol, bool adjustAGC) +//--------------------------------------------------------- { if (nVol < 1) nVol = 1; if (nVol > 0x200) nVol = 0x200; // x4 maximum - if ((nVol < m_nMasterVolume) && (nVol) && (gdwSoundSetup & SNDMIX_AGC) && (bAdjustAGC)) + if ((nVol < m_nMasterVolume) && (nVol) && (gdwSoundSetup & SNDMIX_AGC) && (adjustAGC)) { gnAGC = gnAGC * m_nMasterVolume / nVol; if (gnAGC > AGC_UNITY) gnAGC = AGC_UNITY; } m_nMasterVolume = nVol; - return TRUE; } @@ -1058,15 +1057,17 @@ } -/* -UINT CSoundFile::GetNumInstruments() const -//---------------------------------------- +PATTERNINDEX CSoundFile::GetNumPatterns() const +//--------------------------------------------- { - UINT n=0; - for (UINT i=0; i<MAX_INSTRUMENTS; i++) if (Ins[i].pSample) n++; - return n; + PATTERNINDEX max = 0; + for(PATTERNINDEX i = 0; i < Patterns.Size(); i++) + { + if(Patterns.IsValidPat(i)) + max = i; + } + return max; } -*/ UINT CSoundFile::GetMaxPosition() const @@ -2623,8 +2624,8 @@ } -BOOL CSoundFile::SetPatternName(UINT nPat, LPCSTR lpszName) -//--------------------------------------------------------- +BOOL CSoundFile::SetPatternName(PATTERNINDEX nPat, LPCSTR lpszName) +//------------------------------------------------------------------ { CHAR szName[MAX_PATTERNNAME] = ""; if (nPat >= Patterns.Size()) return FALSE; @@ -2652,8 +2653,8 @@ } -BOOL CSoundFile::GetPatternName(UINT nPat, LPSTR lpszName, UINT cbSize) const -//--------------------------------------------------------------------------- +BOOL CSoundFile::GetPatternName(PATTERNINDEX nPat, LPSTR lpszName, UINT cbSize) const +//----------------------------------------------------------------------------------- { if ((!lpszName) || (!cbSize)) return FALSE; lpszName[0] = 0; Modified: trunk/OpenMPT/soundlib/Sndfile.h =================================================================== --- trunk/OpenMPT/soundlib/Sndfile.h 2010-01-22 23:43:38 UTC (rev 474) +++ trunk/OpenMPT/soundlib/Sndfile.h 2010-01-23 16:55:32 UTC (rev 475) @@ -628,10 +628,10 @@ //it returned the number of channels with volume != 0 CHANNELINDEX GetNumChannels() const {return static_cast<CHANNELINDEX>(m_nChannels);} - BOOL SetMasterVolume(UINT vol, BOOL bAdjustAGC=FALSE); + void SetMasterVolume(UINT vol, bool adjustAGC = false); UINT GetMasterVolume() const { return m_nMasterVolume; } ORDERINDEX GetNumPatterns() const; - INSTRUMENTINDEX GetNumInstruments() const {return m_nInstruments;} + INSTRUMENTINDEX GetNumInstruments() const { return m_nInstruments; } SAMPLEINDEX GetNumSamples() const { return m_nSamples; } UINT GetCurrentPos() const; UINT GetCurrentPattern() const { return m_nPattern; } @@ -671,8 +671,8 @@ BOOL IsPaused() const { return (m_dwSongFlags & SONG_PAUSED) ? TRUE : FALSE; } void LoopPattern(PATTERNINDEX nPat, ROWINDEX nRow = 0); void CheckCPUUsage(UINT nCPU); - BOOL SetPatternName(UINT nPat, LPCSTR lpszName); - BOOL GetPatternName(UINT nPat, LPSTR lpszName, UINT cbSize=MAX_PATTERNNAME) const; + BOOL SetPatternName(PATTERNINDEX nPat, LPCSTR lpszName); + BOOL GetPatternName(PATTERNINDEX nPat, LPSTR lpszName, UINT cbSize=MAX_PATTERNNAME) const; CHANNELINDEX ReArrangeChannels(const vector<CHANNELINDEX>& fromToArray); bool MoveChannel(UINT chn_from, UINT chn_to); Modified: trunk/OpenMPT/soundlib/mod_specifications.h =================================================================== --- trunk/OpenMPT/soundlib/mod_specifications.h 2010-01-22 23:43:38 UTC (rev 474) +++ trunk/OpenMPT/soundlib/mod_specifications.h 2010-01-23 16:55:32 UTC (rev 475) @@ -42,6 +42,7 @@ char commands[MAX_EFFECTS + 1]; // An array holding all commands this format supports; commands that are not supported are marked with "?" char volcommands[MAX_VOLCMDS + 1]; // dito, but for volume column bool hasIgnoreIndex; // Does "+++" pattern exist? + bool hasRestartPos; }; @@ -81,6 +82,7 @@ " JFEGHLKRXODB?CQATI?SMNVW?UY?P?Z\\:#", // Supported Effects " vpcdabuhlrgfe:o", // Supported Volume Column commands true, // Has "+++" pattern + true, // Has restart position (order) }; @@ -115,6 +117,7 @@ " 0123456789ABCD?FF?E???????????????", // Supported Effects " ???????????????", // Supported Volume Column commands false, // Doesn't have "+++" pattern + true, // Has restart position (order) }; // MOD with MPT extensions. @@ -147,6 +150,7 @@ " 0123456789ABCD?FF?E???????????????", // Supported Effects " ???????????????", // Supported Volume Column commands true, // Has "+++" pattern + true, // Has restart position (order) }; const CModSpecifications xm = @@ -178,6 +182,7 @@ " 0123456789ABCDRFFTE???GHK?YXPLZ\\:#", // Supported Effects " vpcdabuhlrg????", // Supported Volume Column commands false, // Doesn't have "+++" pattern + true, // Has restart position (order) }; // XM with MPT extensions @@ -210,6 +215,7 @@ " 0123456789ABCDRFFTE???GHK?YXPLZ\\:#", // Supported Effects " vpcdabuhlrgfe:o", // Supported Volume Column commands true, // Has "+++" pattern + true, // Has restart position (order) }; const CModSpecifications s3m = @@ -241,6 +247,7 @@ " JFEGHLKRXODB?CQATI?SMNVW?U????????", // Supported Effects " vp?????????????", // Supported Volume Column commands true, // Has "+++" pattern + false, // Doesn't have restart position (order) }; // S3M with MPT extensions @@ -273,6 +280,7 @@ " JFEGHLKRXODB?CQATI?SMNVW?UY?P?Z\\:#", // Supported Effects " vp?????????????", // Supported Volume Column commands true, // Has "+++" pattern + false, // Doesn't have restart position (order) }; const CModSpecifications it = @@ -304,6 +312,7 @@ " JFEGHLKRXODB?CQATI?SMNVW?UY?P?Z???", // Supported Effects " vpcdab?h??gfe??", // Supported Volume Column commands true, // Has "+++" pattern + false, // Doesn't have restart position (order) }; const CModSpecifications itEx = @@ -335,6 +344,7 @@ " JFEGHLKRXODB?CQATI?SMNVW?UY?P?Z\\:#", // Supported Effects " vpcdab?h??gfe:o", // Supported Volume Column commands true, // Has "+++" pattern + true, // Has restart position (order) }; } //namespace ModSpecs This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <sag...@us...> - 2010-01-25 22:42:29
|
Revision: 479 http://modplug.svn.sourceforge.net/modplug/?rev=479&view=rev Author: saga-games Date: 2010-01-25 22:42:20 +0000 (Mon, 25 Jan 2010) Log Message: ----------- [Imp] Installer: Small improvment to VST scanning (don't write "NumPlugins" key if no plugins have been found). [Mod] Changed history (.txt) Modified Paths: -------------- trunk/OpenMPT/installer/vst_scan.iss trunk/OpenMPT/packageTemplate/History.txt Modified: trunk/OpenMPT/installer/vst_scan.iss =================================================================== --- trunk/OpenMPT/installer/vst_scan.iss 2010-01-25 19:38:07 UTC (rev 478) +++ trunk/OpenMPT/installer/vst_scan.iss 2010-01-25 22:42:20 UTC (rev 479) @@ -13,6 +13,7 @@ bExitSetup: Boolean; INIFile: String; VSTPluginNumber: Integer; + OldVSTPluginNumber: Integer; procedure ProcessDirectory (RootDir: String; Progress: Boolean); var @@ -75,37 +76,41 @@ if ((CurStep = ssInstall) And (IsTaskSelected('vst_scan'))) then begin - // Get the right INI path. - if(IsTaskSelected('portable')) then - begin - INIFile := ExpandConstant('{app}\mptrack.ini'); - end else - begin - INIFile := ExpandConstant('{userappdata}\OpenMPT\mptrack.ini'); + // Get the right INI path. + if(IsTaskSelected('portable')) then + begin + INIFile := ExpandConstant('{app}\mptrack.ini'); + end else + begin + INIFile := ExpandConstant('{userappdata}\OpenMPT\mptrack.ini'); + end; + VSTPluginNumber := GetIniInt('VST Plugins', 'NumPlugins', 0, 0, 0, INIFile); + OldVSTPluginNumber := VSTPluginNumber; + + // The folder to scan. + Dir := ExpandConstant('{pf}\Steinberg\VstPlugins'); + RegQueryStringValue(HKEY_LOCAL_MACHINE, 'Software\VST', 'VSTPluginsPath', Dir); // won't touch Dir if registry path does not exist + // The progress page. + ProgressPage := CreateOutputProgressPage (CustomMessage ('ProgressTitle'), + CustomMessage ('ProgressCaption')); + ProgressPage.SetText (CustomMessage ('ProgressText'), Dir); + ProgressPage.SetProgress(0, 0); + ProgressPage.Show; + // Make the Cancel button visible during the operation. + ;WizardForm.CancelButton.Visible := TRUE; + // Scan the folder. + ProcessDirectory (Dir, TRUE); + // Hide the progress page. + try + finally + ProgressPage.Hide; + end; + + // Update INI key + + if(VSTPluginNumber <> OldVSTPluginNumber) then + begin + SetIniInt('VST Plugins', 'NumPlugins', VSTPluginNumber, INIFile); + end; end; - VSTPluginNumber := GetIniInt('VST Plugins', 'NumPlugins', 0, 0, 0, INIFile); - - // The folder to scan. - Dir := ExpandConstant('{pf}\Steinberg\VstPlugins'); - RegQueryStringValue(HKEY_LOCAL_MACHINE, 'Software\VST', 'VSTPluginsPath', Dir); // won't touch Dir if registry path does not exist - // The progress page. - ProgressPage := CreateOutputProgressPage (CustomMessage ('ProgressTitle'), - CustomMessage ('ProgressCaption')); - ProgressPage.SetText (CustomMessage ('ProgressText'), Dir); - ProgressPage.SetProgress(0, 0); - ProgressPage.Show; - // Make the Cancel button visible during the operation. - ;WizardForm.CancelButton.Visible := TRUE; - // Scan the folder. - ProcessDirectory (Dir, TRUE); - // Hide the progress page. - try - finally - ProgressPage.Hide; - end; - - // Update INI key - SetIniInt('VST Plugins', 'NumPlugins', VSTPluginNumber, INIFile); - end; end; - Modified: trunk/OpenMPT/packageTemplate/History.txt =================================================================== --- trunk/OpenMPT/packageTemplate/History.txt 2010-01-25 19:38:07 UTC (rev 478) +++ trunk/OpenMPT/packageTemplate/History.txt 2010-01-25 22:42:20 UTC (rev 479) @@ -44,7 +44,6 @@ . <Jojo> PC notes are now deleted properly (last column). . <Jojo> Copying only the param column of PC notes overwrote the value column when pasting them. . <Jojo> Entering Note Fade notes didn't work the "old style" way. - . <Jojo> PC note handling was missing in OnClearSelection, so it was possible to delete the effect column only partly. Pattern tab::GUI + <Jojo> Channel rename dialog in channel header context menu. @@ -144,7 +143,7 @@ S3M . <Jojo> ST3 compatibility: Only allow waveforms 0 to 3 for S3x / S4x / S5x. - . <Jojo> The S3M format actually knows muted channels. This was not taking into account before. + . <Jojo> The S3M format actually knows muted channels. This was not taken into account before. XM::Loading ^ <Jojo> Allow to load modules with an empty order list (as they are, in fact, valid XM files). This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <sag...@us...> - 2010-01-27 20:27:49
|
Revision: 481 http://modplug.svn.sourceforge.net/modplug/?rev=481&view=rev Author: saga-games Date: 2010-01-27 20:27:41 +0000 (Wed, 27 Jan 2010) Log Message: ----------- [Imp] Mod Conversion: Don't show warning about restart position if it is actually not set (only applies to S3M format) [Fix] PSM16 Loader: Fix for note cut on tick 0 (warbot tune from Silverball) [Imp] Improved HasNote function in Mod Specs [Fix] Corrected original XM specs. Modified Paths: -------------- trunk/OpenMPT/mptrack/Modedit.cpp trunk/OpenMPT/soundlib/Load_psm.cpp trunk/OpenMPT/soundlib/mod_specifications.cpp trunk/OpenMPT/soundlib/mod_specifications.h Modified: trunk/OpenMPT/mptrack/Modedit.cpp =================================================================== --- trunk/OpenMPT/mptrack/Modedit.cpp 2010-01-26 21:25:38 UTC (rev 480) +++ trunk/OpenMPT/mptrack/Modedit.cpp 2010-01-27 20:27:41 UTC (rev 481) @@ -345,7 +345,7 @@ } // Is the "restart position" value allowed in this format? - if(CSoundFile::GetModSpecifications(nNewType).hasRestartPos == false) + if(m_SndFile.m_nRestartPos > 0 && !CSoundFile::GetModSpecifications(nNewType).hasRestartPos) { m_SndFile.m_nRestartPos = 0; AddToLog("WARNING: Restart position is not support by the new format.\n"); Modified: trunk/OpenMPT/soundlib/Load_psm.cpp =================================================================== --- trunk/OpenMPT/soundlib/Load_psm.cpp 2010-01-26 21:25:38 UTC (rev 480) +++ trunk/OpenMPT/soundlib/Load_psm.cpp 2010-01-27 20:27:41 UTC (rev 481) @@ -360,7 +360,7 @@ default: // How the hell should this happen? I've listened through almost all existing (original) PSM files. :) CString s; - s.Format("Please report to the OpenMPT team: Unknown chunk %d found at position %d (in the OPLH chunk of this PSM file)", lpStream[dwSettingsOffset], dwSettingsOffset); + s.Format("Report to the OpenMPT team: Unknown chunk %d found at position %d (in the OPLH chunk of this PSM file)", lpStream[dwSettingsOffset], dwSettingsOffset); MessageBox(NULL, s, TEXT("OpenMPT PSM import"), MB_ICONERROR); // anyway, in such cases, we have to quit as we don't know how big the chunk really is. return false; @@ -1131,6 +1131,7 @@ break; case 0x2A: // note cut command = CMD_S3MCMDEX; + if(param == 0) param = 1; param |= 0xC0; break; case 0x2B: // note delay Modified: trunk/OpenMPT/soundlib/mod_specifications.cpp =================================================================== --- trunk/OpenMPT/soundlib/mod_specifications.cpp 2010-01-26 21:25:38 UTC (rev 480) +++ trunk/OpenMPT/soundlib/mod_specifications.cpp 2010-01-27 20:27:41 UTC (rev 481) @@ -17,7 +17,8 @@ return hasNoteFade; else return (memcmp(fileExtension, ModSpecs::mptm.fileExtension, 4) == 0); - } + } else if(note == NOTE_NONE) + return true; return false; } Modified: trunk/OpenMPT/soundlib/mod_specifications.h =================================================================== --- trunk/OpenMPT/soundlib/mod_specifications.h 2010-01-26 21:25:38 UTC (rev 480) +++ trunk/OpenMPT/soundlib/mod_specifications.h 2010-01-27 20:27:41 UTC (rev 481) @@ -52,7 +52,7 @@ const CModSpecifications mptm = { /* - TODO: Proper, less arbitrarily chosen, values here. + TODO: Proper, less arbitrarily chosen values here. NOTE: If changing limits, see whether: -savefile format and GUI methods can handle new values(might not be a small task :). */ @@ -78,7 +78,7 @@ 1, //Min Speed 255, //Max Speed true, //Has song comments - 240, //Envelope point count + MAX_ENVPOINTS, //Envelope point count " JFEGHLKRXODB?CQATI?SMNVW?UY?P?Z\\:#", // Supported Effects " vpcdabuhlrgfe:o", // Supported Volume Column commands true, // Has "+++" pattern @@ -171,15 +171,15 @@ 1, //Min pattern rows 256, //Max pattern rows 20, //Max mod name length - 31, //SamplesMax - 200, //instrumentMax + 31, //SamplesMax (actually 16 per instrument) + 128, //instrumentMax mixLevels_original, //defaultMixLevels 0, //Max MIDI mapping directives 1, //Min Speed 31, //Max Speed false, //No song comments 12, //Envelope point count - " 0123456789ABCDRFFTE???GHK?YXPLZ\\:#", // Supported Effects + " 0123456789ABCDRFFTE???GHK??XPL????", // Supported Effects " vpcdabuhlrg????", // Supported Volume Column commands false, // Doesn't have "+++" pattern true, // Has restart position (order) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <sag...@us...> - 2010-02-06 17:44:02
|
Revision: 484 http://modplug.svn.sourceforge.net/modplug/?rev=484&view=rev Author: saga-games Date: 2010-02-06 17:43:04 +0000 (Sat, 06 Feb 2010) Log Message: ----------- [Fix] Mod Saving: If a mod had loop points set, but loop disabled, they were still saved in the .MOD file, resulting in the loop being enabled automatically. [Fix] Pattern Editor: Instead of turning "Follow Song" off, the Find/Replace dialog toggled it. Modified Paths: -------------- trunk/OpenMPT/mptrack/Ctrl_pat.cpp trunk/OpenMPT/mptrack/Ctrl_seq.cpp trunk/OpenMPT/mptrack/View_pat.cpp trunk/OpenMPT/soundlib/Load_mod.cpp Modified: trunk/OpenMPT/mptrack/Ctrl_pat.cpp =================================================================== --- trunk/OpenMPT/mptrack/Ctrl_pat.cpp 2010-02-05 20:39:08 UTC (rev 483) +++ trunk/OpenMPT/mptrack/Ctrl_pat.cpp 2010-02-06 17:43:04 UTC (rev 484) @@ -451,8 +451,16 @@ //rewbs.customKeys case CTRLMSG_PAT_FOLLOWSONG: - CheckDlgButton(IDC_PATTERN_FOLLOWSONG, !IsDlgButtonChecked(IDC_PATTERN_FOLLOWSONG)); - OnFollowSong(); + // parameters: 0 = turn off, 1 = toggle + { + UINT state = FALSE; + if(lParam == 1) // toggle + { + state = !IsDlgButtonChecked(IDC_PATTERN_FOLLOWSONG); + } + CheckDlgButton(IDC_PATTERN_FOLLOWSONG, state); + OnFollowSong(); + } break; case CTRLMSG_PAT_LOOP: Modified: trunk/OpenMPT/mptrack/Ctrl_seq.cpp =================================================================== --- trunk/OpenMPT/mptrack/Ctrl_seq.cpp 2010-02-05 20:39:08 UTC (rev 483) +++ trunk/OpenMPT/mptrack/Ctrl_seq.cpp 2010-02-06 17:43:04 UTC (rev 484) @@ -446,7 +446,7 @@ case kcChangeLoopStatus: m_pParent->OnModCtrlMsg(CTRLMSG_PAT_LOOP, -1); return wParam; case kcToggleFollowSong: - m_pParent->OnModCtrlMsg(CTRLMSG_PAT_FOLLOWSONG, 0); return wParam; + m_pParent->OnModCtrlMsg(CTRLMSG_PAT_FOLLOWSONG, 1); return wParam; case kcChannelUnmuteAll: case kcUnmuteAllChnOnPatTransition: Modified: trunk/OpenMPT/mptrack/View_pat.cpp =================================================================== --- trunk/OpenMPT/mptrack/View_pat.cpp 2010-02-05 20:39:08 UTC (rev 483) +++ trunk/OpenMPT/mptrack/View_pat.cpp 2010-02-06 17:43:04 UTC (rev 484) @@ -3614,7 +3614,7 @@ case kcEditPushForwardPaste: OnEditPushForwardPaste(); return wParam; case kcEditSelectAll: OnEditSelectAll(); return wParam; case kcTogglePluginEditor: TogglePluginEditor((m_dwCursor & 0xFFFF) >> 3); return wParam; - case kcToggleFollowSong: SendCtrlMessage(CTRLMSG_PAT_FOLLOWSONG); return wParam; + case kcToggleFollowSong: SendCtrlMessage(CTRLMSG_PAT_FOLLOWSONG, 1); return wParam; case kcChangeLoopStatus: SendCtrlMessage(CTRLMSG_PAT_LOOP, -1); return wParam; case kcNewPattern: SendCtrlMessage(CTRLMSG_PAT_NEWPATTERN); return wParam; case kcDuplicatePattern: SendCtrlMessage(CTRLMSG_PAT_DUPPATTERN); return wParam; @@ -4106,7 +4106,7 @@ void CViewPattern::TempEnterNote(int note, bool oldStyle, int vol) -//-------------------------------------------------------------------------------- +//---------------------------------------------------------------- { CMainFrame *pMainFrm = CMainFrame::GetMainFrame(); CModDoc *pModDoc = GetDocument(); Modified: trunk/OpenMPT/soundlib/Load_mod.cpp =================================================================== --- trunk/OpenMPT/soundlib/Load_mod.cpp 2010-02-05 20:39:08 UTC (rev 483) +++ trunk/OpenMPT/soundlib/Load_mod.cpp 2010-02-06 17:43:04 UTC (rev 484) @@ -494,9 +494,14 @@ if (pSmp->RelativeTone > 0) bTab[24] = 0x07; else bTab[24] = (BYTE)XM2MODFineTune(pSmp->nFineTune); bTab[25] = pSmp->nVolume >> 2; - bTab[26] = pSmp->nLoopStart >> 9; - bTab[27] = pSmp->nLoopStart >> 1; - UINT replen = pSmp->nLoopEnd - pSmp->nLoopStart; + UINT repstart = 0, replen = 2; + if(pSmp->uFlags & CHN_LOOP) + { + repstart = pSmp->nLoopStart; + replen = pSmp->nLoopEnd - pSmp->nLoopStart; + } + bTab[26] = repstart >> 9; + bTab[27] = repstart >> 1; if(replen < 2) // ensure PT will load it properly replen = 2; bTab[28] = replen >> 9; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <sag...@us...> - 2010-02-07 13:23:41
|
Revision: 485 http://modplug.svn.sourceforge.net/modplug/?rev=485&view=rev Author: saga-games Date: 2010-02-07 13:23:29 +0000 (Sun, 07 Feb 2010) Log Message: ----------- [Fix] Pattern Editor: The status bar ("Position x of y") only the showed order length for the first subtune if subtunes were separated by an "---" order item. [Fix] Instrument IO: Flags from old ITI/XI files should also be loaded correctly now. Modified Paths: -------------- trunk/OpenMPT/mptrack/Ctrl_seq.cpp trunk/OpenMPT/soundlib/Load_it.cpp trunk/OpenMPT/soundlib/Sampleio.cpp trunk/OpenMPT/soundlib/Sndfile.h Modified: trunk/OpenMPT/mptrack/Ctrl_seq.cpp =================================================================== --- trunk/OpenMPT/mptrack/Ctrl_seq.cpp 2010-02-06 17:43:04 UTC (rev 484) +++ trunk/OpenMPT/mptrack/Ctrl_seq.cpp 2010-02-07 13:23:29 UTC (rev 485) @@ -702,7 +702,7 @@ } else { - const ORDERINDEX nLength = pSndFile->Order.GetLengthFirstEmpty(); + const ORDERINDEX nLength = pSndFile->Order.GetLengthTailTrimmed(); wsprintf(s, "Position %d of %d (%02Xh of %02Xh)", m_nScrollPos, nLength, m_nScrollPos, nLength); } Modified: trunk/OpenMPT/soundlib/Load_it.cpp =================================================================== --- trunk/OpenMPT/soundlib/Load_it.cpp 2010-02-06 17:43:04 UTC (rev 484) +++ trunk/OpenMPT/soundlib/Load_it.cpp 2010-02-07 13:23:29 UTC (rev 485) @@ -846,24 +846,7 @@ // fix old instrument flags which got broken in OpenMPT 1.17.03.03 due to refactoring (rev 415). if(version == 0x00000101 && fcode == 'dF..') { - DWORD dwFlags = Instruments[i]->dwFlags; // more convenient - DWORD dwNewFlags = 0; - if(dwFlags & 0x0001) Instruments[i]->VolEnv.dwFlags |= ENV_ENABLED; - if(dwFlags & 0x0002) Instruments[i]->VolEnv.dwFlags |= ENV_SUSTAIN; - if(dwFlags & 0x0004) Instruments[i]->VolEnv.dwFlags |= ENV_LOOP; - if(dwFlags & 0x0008) Instruments[i]->PanEnv.dwFlags |= ENV_ENABLED; - if(dwFlags & 0x0010) Instruments[i]->PanEnv.dwFlags |= ENV_SUSTAIN; - if(dwFlags & 0x0020) Instruments[i]->PanEnv.dwFlags |= ENV_LOOP; - if(dwFlags & 0x0040) Instruments[i]->PitchEnv.dwFlags |= ENV_ENABLED; - if(dwFlags & 0x0080) Instruments[i]->PitchEnv.dwFlags |= ENV_SUSTAIN; - if(dwFlags & 0x0100) Instruments[i]->VolEnv.dwFlags |= ENV_LOOP; - if(dwFlags & 0x0200) dwNewFlags |= INS_SETPANNING; - if(dwFlags & 0x0400) Instruments[i]->PitchEnv.dwFlags |= ENV_FILTER; - if(dwFlags & 0x0800) Instruments[i]->VolEnv.dwFlags |= ENV_CARRY; - if(dwFlags & 0x1000) Instruments[i]->PanEnv.dwFlags |= ENV_CARRY; - if(dwFlags & 0x2000) Instruments[i]->PitchEnv.dwFlags |= ENV_CARRY; - if(dwFlags & 0x4000) dwNewFlags |= INS_MUTE; - Instruments[i]->dwFlags = dwNewFlags; + ConvertOldExtendedFlagFormat(Instruments[i]); } break; } Modified: trunk/OpenMPT/soundlib/Sampleio.cpp =================================================================== --- trunk/OpenMPT/soundlib/Sampleio.cpp 2010-02-06 17:43:04 UTC (rev 484) +++ trunk/OpenMPT/soundlib/Sampleio.cpp 2010-02-07 13:23:29 UTC (rev 485) @@ -2056,6 +2056,8 @@ // Seek for supported extended settings header if( code == 'MPTX' ) { + bool newFormat = false; // new flag format (separate flags for envelopes) + bool hasFlags = false; // do we really need to convert the flags? pData += sizeof(code); // jump extension header code while( (uintptr_t)(pData - pDataStart) <= nMemLength - 4) @@ -2063,11 +2065,42 @@ memcpy(&code, pData, sizeof(code)); // read field code pData += sizeof(code); // jump field code ReadExtendedInstrumentProperty(pIns, code, pData, pEnd); + if(code == 'VFLG') + newFormat = true; + if(code == 'dF..') + hasFlags = true; } + if(!newFormat && hasFlags) + { + ConvertOldExtendedFlagFormat(pIns); + } } } +void ConvertOldExtendedFlagFormat(MODINSTRUMENT *pIns) +//---------------------------------------------------- +{ + DWORD dwOldFlags = pIns->dwFlags; + pIns->dwFlags = pIns->VolEnv.dwFlags = pIns->PanEnv.dwFlags = pIns->PitchEnv.dwFlags = 0; + if(dwOldFlags & 0x0001) pIns->VolEnv.dwFlags |= ENV_ENABLED; + if(dwOldFlags & 0x0002) pIns->VolEnv.dwFlags |= ENV_SUSTAIN; + if(dwOldFlags & 0x0004) pIns->VolEnv.dwFlags |= ENV_LOOP; + if(dwOldFlags & 0x0008) pIns->PanEnv.dwFlags |= ENV_ENABLED; + if(dwOldFlags & 0x0010) pIns->PanEnv.dwFlags |= ENV_SUSTAIN; + if(dwOldFlags & 0x0020) pIns->PanEnv.dwFlags |= ENV_LOOP; + if(dwOldFlags & 0x0040) pIns->PitchEnv.dwFlags |= ENV_ENABLED; + if(dwOldFlags & 0x0080) pIns->PitchEnv.dwFlags |= ENV_SUSTAIN; + if(dwOldFlags & 0x0100) pIns->VolEnv.dwFlags |= ENV_LOOP; + if(dwOldFlags & 0x0200) pIns->dwFlags |= INS_SETPANNING; + if(dwOldFlags & 0x0400) pIns->PitchEnv.dwFlags |= ENV_FILTER; + if(dwOldFlags & 0x0800) pIns->VolEnv.dwFlags |= ENV_CARRY; + if(dwOldFlags & 0x1000) pIns->PanEnv.dwFlags |= ENV_CARRY; + if(dwOldFlags & 0x2000) pIns->PitchEnv.dwFlags |= ENV_CARRY; + if(dwOldFlags & 0x4000) pIns->dwFlags |= INS_MUTE; +} + + /////////////////////////////////////////////////////////////////////////////////////////////////// // 8SVX Samples Modified: trunk/OpenMPT/soundlib/Sndfile.h =================================================================== --- trunk/OpenMPT/soundlib/Sndfile.h 2010-02-06 17:43:04 UTC (rev 484) +++ trunk/OpenMPT/soundlib/Sndfile.h 2010-02-07 13:23:29 UTC (rev 485) @@ -1193,5 +1193,8 @@ // Read extended instrument properties from 'pDataStart' to instrument 'pIns'. void ReadExtendedInstrumentProperties(MODINSTRUMENT* pIns, const LPCBYTE pDataStart, const size_t nMemLength); +// Convert old instrument flag format, where all flags used to be stored in one single flag. Now, some flags are stored in envelope-specific flag fields. +void ConvertOldExtendedFlagFormat(MODINSTRUMENT* pIns); + #endif This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <sag...@us...> - 2010-02-07 15:33:51
|
Revision: 486 http://modplug.svn.sourceforge.net/modplug/?rev=486&view=rev Author: saga-games Date: 2010-02-07 15:33:33 +0000 (Sun, 07 Feb 2010) Log Message: ----------- Modified Paths: -------------- trunk/OpenMPT/mptrack/Ctrl_ins.cpp trunk/OpenMPT/mptrack/Ctrl_smp.cpp trunk/OpenMPT/soundlib/mod_specifications.h Modified: trunk/OpenMPT/mptrack/Ctrl_ins.cpp =================================================================== --- trunk/OpenMPT/mptrack/Ctrl_ins.cpp 2010-02-07 13:23:29 UTC (rev 485) +++ trunk/OpenMPT/mptrack/Ctrl_ins.cpp 2010-02-07 15:33:33 UTC (rev 486) @@ -775,6 +775,7 @@ CModControlDlg::OnInitDialog(); m_bInitialized = FALSE; if ((!m_pModDoc) || (!m_pSndFile)) return TRUE; + m_NoteMap.Init(this); m_ToolBar.Init(); m_ToolBar.AddButton(IDC_INSTRUMENT_NEW, TIMAGE_INSTR_NEW); @@ -783,8 +784,6 @@ m_ToolBar.AddButton(IDC_INSTRUMENT_PLAY, TIMAGE_PREVIEW); m_SpinInstrument.SetRange(0, 0); m_SpinInstrument.EnableWindow(FALSE); - m_EditName.SetLimitText(32); - m_EditFileName.SetLimitText(20); // NNA m_ComboNNA.AddString("Note Cut"); m_ComboNNA.AddString("Continue"); @@ -1030,6 +1029,12 @@ if (!m_bInitialized) dwHintMask |= HINT_MODTYPE; if (dwHintMask & HINT_MODTYPE) { + const CModSpecifications *specs = &m_pSndFile->GetModSpecifications(); + + // Limit text fields + m_EditName.SetLimitText(specs->instrNameLengthMax); + m_EditFileName.SetLimitText(specs->instrFilenameLengthMax); + BOOL bITandMPT = ((m_pSndFile->m_nType & (MOD_TYPE_IT | MOD_TYPE_MPT)) && (m_pSndFile->m_nInstruments)) ? TRUE : FALSE; //rewbs.instroVSTi BOOL bITandXM = (((m_pSndFile->m_nType & (MOD_TYPE_IT | MOD_TYPE_MPT)) || (m_pSndFile->m_nType == MOD_TYPE_XM)) && (m_pSndFile->m_nInstruments)) ? TRUE : FALSE; Modified: trunk/OpenMPT/mptrack/Ctrl_smp.cpp =================================================================== --- trunk/OpenMPT/mptrack/Ctrl_smp.cpp 2010-02-07 13:23:29 UTC (rev 485) +++ trunk/OpenMPT/mptrack/Ctrl_smp.cpp 2010-02-07 15:33:33 UTC (rev 486) @@ -183,6 +183,7 @@ CModControlDlg::OnInitDialog(); if (!m_pSndFile) return TRUE; m_bInitialized = FALSE; + // Zoom Selection m_ComboZoom.AddString("Auto"); m_ComboZoom.AddString("1:1"); @@ -212,8 +213,6 @@ m_ToolBar2.AddButton(IDC_SAMPLE_INVERT, TIMAGE_SAMPLE_INVERT); m_ToolBar2.AddButton(IDC_SAMPLE_SIGN_UNSIGN, TIMAGE_SAMPLE_UNSIGN); // Setup Controls - m_EditName.SetLimitText(32); - m_EditFileName.SetLimitText(22); m_SpinVolume.SetRange(0, 64); m_SpinGlobalVol.SetRange(0, 64); //rewbs.fix36944 @@ -241,7 +240,7 @@ m_SpinVibRate.SetRange(0, 64); } - for (UINT i=BASENOTE_MIN; i<BASENOTE_MAX; i++) + for (UINT i = BASENOTE_MIN; i < BASENOTE_MAX; i++) { CHAR s[32]; wsprintf(s, "%s%d", szNoteNames[i%12], i/12); @@ -543,6 +542,12 @@ // Updating Ranges if (dwHintMask & HINT_MODTYPE) { + const CModSpecifications *specs = &m_pSndFile->GetModSpecifications(); + + // Limit text fields + m_EditName.SetLimitText(specs->sampleNameLengthMax); + m_EditFileName.SetLimitText(specs->sampleFilenameLengthMax); + BOOL b; // Loop Type m_ComboLoopType.ResetContent(); Modified: trunk/OpenMPT/soundlib/mod_specifications.h =================================================================== --- trunk/OpenMPT/soundlib/mod_specifications.h 2010-02-07 13:23:29 UTC (rev 485) +++ trunk/OpenMPT/soundlib/mod_specifications.h 2010-02-07 15:33:33 UTC (rev 486) @@ -30,7 +30,11 @@ TEMPO tempoMax; ROWINDEX patternRowsMin; ROWINDEX patternRowsMax; - uint16 modNameLengthMax; //Meaning 'usable letters', possible null character is not included. + uint16 modNameLengthMax; //Meaning 'usable letters', possible null character is not included. + uint16 sampleNameLengthMax; //Dito + uint16 sampleFilenameLengthMax; //Dito + uint16 instrNameLengthMax; //Dito + uint16 instrFilenameLengthMax; //Dito SAMPLEINDEX samplesMax; INSTRUMENTINDEX instrumentsMax; BYTE defaultMixLevels; @@ -71,6 +75,10 @@ 1, //Min pattern rows 1024, //Max pattern rows 25, //Max mod name length + 26, //Max sample name length + 12, //Max sample filename length + 26, //Max instrument name length + 12, //Max instrument filename length 4000, //SamplesMax 256, //instrumentMax mixLevels_117RC3, //defaultMixLevels @@ -100,12 +108,16 @@ 64, //Pattern max. 128, //Order max. 4, //Channel min - 4, //Channel max + 32, //Channel max 32, //Min tempo 255, //Max tempo 64, //Min pattern rows 64, //Max pattern rows 20, //Max mod name length + 22, //Max sample name length + 0, //Max sample filename length + 0, //Max instrument name length + 0, //Max instrument filename length 31, //SamplesMax 0, //instrumentMax mixLevels_original, //defaultMixLevels @@ -139,6 +151,10 @@ 64, //Min pattern rows 64, //Max pattern rows 20, //Max mod name length + 22, //Max sample name length + 0, //Max sample filename length + 0, //Max instrument name length + 0, //Max instrument filename length 31, //SamplesMax 0, //instrumentMax mixLevels_original, //defaultMixLevels @@ -171,6 +187,10 @@ 1, //Min pattern rows 256, //Max pattern rows 20, //Max mod name length + 22, //Max sample name length + 0, //Max sample filename length + 22, //Max instrument name length + 0, //Max instrument filename length 31, //SamplesMax (actually 16 per instrument) 128, //instrumentMax mixLevels_original, //defaultMixLevels @@ -204,6 +224,10 @@ 1, //Min pattern rows 1024, //Max pattern rows 20, //Max mod name length + 22, //Max sample name length + 0, //Max sample filename length + 22, //Max instrument name length + 0, //Max instrument filename length 4000, //SamplesMax 256, //instrumentMax mixLevels_117RC3, //defaultMixLevels @@ -236,6 +260,10 @@ 64, //Min pattern rows 64, //Max pattern rows 27, //Max mod name length + 27, //Max sample name length + 12, //Max sample filename length + 0, //Max instrument name length + 0, //Max instrument filename length 99, //SamplesMax 0, //instrumentMax mixLevels_original, //defaultMixLevels @@ -269,6 +297,10 @@ 64, //Min pattern rows 64, //Max pattern rows 27, //Max mod name length + 27, //Max sample name length + 12, //Max sample filename length + 0, //Max instrument name length + 0, //Max instrument filename length 99, //SamplesMax 0, //instrumentMax mixLevels_original, //defaultMixLevels @@ -301,6 +333,10 @@ 1, //Min pattern rows 256, //Max pattern rows 25, //Max mod name length + 25, //Max sample name length + 12, //Max sample filename length + 25, //Max instrument name length + 12, //Max instrument filename length 99, //SamplesMax 99, //instrumentMax mixLevels_original, //defaultMixLevels @@ -333,6 +369,10 @@ 1, //Min pattern rows 1024, //Max pattern rows 25, //Max mod name length + 25, //Max sample name length + 12, //Max sample filename length + 25, //Max instrument name length + 12, //Max instrument filename length 4000, //SamplesMax 256, //instrumentMax mixLevels_117RC3, //defaultMixLevels This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <sag...@us...> - 2010-02-13 13:15:27
|
Revision: 491 http://modplug.svn.sourceforge.net/modplug/?rev=491&view=rev Author: saga-games Date: 2010-02-13 13:15:18 +0000 (Sat, 13 Feb 2010) Log Message: ----------- [Fix] Pattern Editor: Don't enable or disable "follow song" checkbox to its default setting all the time when updating other parts of the dialog [Fix] Mod Specs: Updated maximum IT pattern length (unhacked specs) [New] Added Sample Generator sourcecode. It's not finished yet so it's not included in the project. Modified Paths: -------------- trunk/OpenMPT/mptrack/Ctrl_pat.cpp trunk/OpenMPT/soundlib/mod_specifications.h Added Paths: ----------- trunk/OpenMPT/mptrack/SampleGenerator.cpp trunk/OpenMPT/mptrack/SampleGenerator.h Modified: trunk/OpenMPT/mptrack/Ctrl_pat.cpp =================================================================== --- trunk/OpenMPT/mptrack/Ctrl_pat.cpp 2010-02-10 18:21:42 UTC (rev 490) +++ trunk/OpenMPT/mptrack/Ctrl_pat.cpp 2010-02-13 13:15:18 UTC (rev 491) @@ -264,7 +264,7 @@ m_ToolBar.UpdateStyle(); // -> CODE#0007 // -> DESC="uncheck follow song checkbox by default" - CheckDlgButton(IDC_PATTERN_FOLLOWSONG, (CMainFrame::m_dwPatternSetup & PATTERN_FOLLOWSONGOFF) ? MF_UNCHECKED : MF_CHECKED); + //CheckDlgButton(IDC_PATTERN_FOLLOWSONG, (CMainFrame::m_dwPatternSetup & PATTERN_FOLLOWSONGOFF) ? MF_UNCHECKED : MF_CHECKED); m_ToolBar.SetState(ID_OVERFLOWPASTE, ((CMainFrame::m_dwPatternSetup & PATTERN_OVERFLOWPASTE) ? TBSTATE_CHECKED : 0) | TBSTATE_ENABLED); // -! BEHAVIOUR_CHANGE#0007 } Added: trunk/OpenMPT/mptrack/SampleGenerator.cpp =================================================================== --- trunk/OpenMPT/mptrack/SampleGenerator.cpp (rev 0) +++ trunk/OpenMPT/mptrack/SampleGenerator.cpp 2010-02-13 13:15:18 UTC (rev 491) @@ -0,0 +1,761 @@ +/* + * SampleGenerator.cpp + * ------------------- + * Purpose: Generate samples from math formulas using muParser + * Notes : (currently none) + * Authors: OpenMPT Devs + */ + + +#include "stdafx.h" +#include "SampleGenerator.h" +#include "modsmp_ctrl.h" + +int CSampleGenerator::sample_frequency = 44100; +int CSampleGenerator::sample_length = CSampleGenerator::sample_frequency; +mu::string_type CSampleGenerator::expression = _T("sin(xp * _pi)"); +smpgen_clip_methods CSampleGenerator::sample_clipping = smpgen_normalize; + +mu::value_type *CSampleGenerator::sample_buffer = nullptr; +size_t CSampleGenerator::samples_written = 0; + + +CSampleGenerator::CSampleGenerator() +//---------------------------------- +{ + + // Setup function callbacks + muParser.DefineFun(_T("clip"), &ClipCallback, false); + muParser.DefineFun(_T("pwm"), &PWMCallback, false); + muParser.DefineFun(_T("rnd"), &RndCallback, false); + muParser.DefineFun(_T("smp"), &SampleDataCallback, false); + muParser.DefineFun(_T("tri"), &TriangleCallback, false); + + // Setup binary operator callbacks + muParser.DefineOprt(_T("mod"), &ModuloCallback, 0); + + //muParser.DefineConst("pi", (mu::value_type)PARSER_CONST_PI); + +} + + +// Open the smpgen dialog +bool CSampleGenerator::ShowDialog() +//--------------------------------- +{ + bool isDone = false, result = false; + while(!isDone) + { + CSmpGenDialog dlg(sample_frequency, sample_length, sample_clipping, expression); + dlg.DoModal(); + + // pressed "OK" button? + if(dlg.CanApply()) + { + sample_frequency = dlg.GetFrequency(); + sample_length = dlg.GetLength(); + sample_clipping = dlg.GetClipping(); + expression = dlg.GetExpression(); + isDone = CanRenderSample(); + if(isDone) isDone = TestExpression(); // show dialog again if the formular can't be parsed. + result = true; + } else + { + isDone = true; // just quit. + result = false; + } + } + return result; +} + + +// Check if the currently select expression can be parsed by muParser. +bool CSampleGenerator::TestExpression() +//------------------------------------- +{ + // reset helper variables + samples_written = 0; + sample_buffer = nullptr; + + muParser.SetExpr(expression); + mu::value_type x = 0; + muParser.DefineVar(_T("x"), &x); + muParser.DefineVar(_T("xp"), &x); + muParser.DefineVar(_T("len"), &x); + muParser.DefineVar(_T("lens"), &x); + muParser.DefineVar(_T("freq"), &x); + + try + { + muParser.Eval(); + } + catch (mu::Parser::exception_type &e) + { + ShowError(&e); + return false; + } + return true; +} + + +// Check if sample parameters are valid. +bool CSampleGenerator::CanRenderSample() +//-------------------------------------- +{ + if(sample_frequency < SMPGEN_MINFREQ || sample_frequency > SMPGEN_MAXFREQ || sample_length < SMPGEN_MINLENGTH || sample_length > SMPGEN_MAXLENGTH) return false; + return true; +} + + +// Actual render loop. +bool CSampleGenerator::RenderSample(CSoundFile *pSndFile, SAMPLEINDEX nSample) +//---------------------------------------------------------------------------- +{ + if(!CanRenderSample() || !TestExpression() || (pSndFile == nullptr) || (nSample < 1) || (nSample > pSndFile->m_nSamples)) return false; + + // allocate a new buffer + sample_buffer = (mu::value_type *)malloc(sample_length * sizeof(mu::value_type)); + if(sample_buffer == nullptr) return false; + memset(sample_buffer, 0, sample_length * sizeof(mu::value_type)); + + mu::value_type x = 0, xp = 0; + mu::value_type v_len = sample_length, v_freq = sample_frequency, v_lens = v_len / v_freq; + muParser.DefineVar(_T("x"), &x); + muParser.DefineVar(_T("xp"), &xp); + muParser.DefineVar(_T("len"), &v_len); + muParser.DefineVar(_T("lens"), &v_lens); + muParser.DefineVar(_T("freq"), &v_freq); + + bool success = true; + mu::value_type minmax = 0; + + for(size_t i = 0; i < (size_t)sample_length; i++) + { + samples_written = i; + x = (mu::value_type)i; + xp = x * 100 / sample_length; + + try + { + sample_buffer[i] = muParser.Eval(); + } + catch (mu::Parser::exception_type &e) + { + // let's just ignore div by zero errors (note: this error code is currently unused (muParser 1.30)) + if(e.GetCode() != mu::ecDIV_BY_ZERO) + { + ShowError(&e); + success = false; + break; + } + sample_buffer[i] = 0; + } + // new maximum value? + if(abs(sample_buffer[i]) > minmax) minmax = abs(sample_buffer[i]); + + } + + if(success) + { + MODSAMPLE *pModSample = &pSndFile->Samples[nSample]; + + BEGIN_CRITICAL(); + + // first, save some memory... (leads to crashes) + //CSoundFile::FreeSample(pModSample->pSample); + //pModSample->pSample = nullptr; + + if(minmax == 0) minmax = 1; // avoid division by 0 + + // convert sample to 16-bit (or whateve rhas been specified) + int16 *pSample = (sampling_type *)CSoundFile::AllocateSample((sample_length + 4) * SMPGEN_MIXBYTES); + for(size_t i = 0; i < (size_t)sample_length; i++) + { + switch(sample_clipping) + { + case smpgen_clip: sample_buffer[i] = CLAMP(sample_buffer[i], -1, 1); break; // option 1: clip + case smpgen_normalize: sample_buffer[i] /= minmax; break; // option 3: normalize + } + + pSample[i] = (sampling_type)(sample_buffer[i] * sample_maxvalue); + } + + // set new sample proprerties + pModSample->nC5Speed = sample_frequency; + CSoundFile::FrequencyToTranspose(pModSample); + pModSample->uFlags |= CHN_16BIT; // has to be adjusted if SMPGEN_MIXBYTES changes! + pModSample->uFlags &= ~(CHN_STEREO|CHN_SUSTAINLOOP|CHN_PINGPONGSUSTAIN); + pModSample->nLoopStart = 0; + pModSample->nLoopEnd = sample_length; + pModSample->nSustainStart = pModSample->nSustainEnd = 0; + if(sample_length / sample_frequency < 5) // arbitrary limit for automatic sample loop (5 seconds) + pModSample->uFlags |= CHN_LOOP; + else + pModSample->uFlags &= ~(CHN_LOOP|CHN_PINGPONGLOOP); + + ctrlSmp::ReplaceSample(*pModSample, (LPSTR)pSample, sample_length, pSndFile); + + END_CRITICAL(); + } + + free(sample_buffer); + sample_buffer = nullptr; + + return success; +} + + +// Callback function to access sample data +mu::value_type CSampleGenerator::SampleDataCallback(mu::value_type v) +//------------------------------------------------------------------- +{ + if(sample_buffer == nullptr) return 0; + v = CLAMP(v, 0, samples_written); + size_t pos = static_cast<size_t>(v); + return sample_buffer[pos]; +} + + +void CSampleGenerator::ShowError(mu::Parser::exception_type *e) +//------------------------------------------------------------- +{ + std::string errmsg; + errmsg = "The expression\n " + e->GetExpr() + "\ncontains an error "; + if(!e->GetToken().empty()) + errmsg += "in the token\n " + e->GetToken() + "\n"; + errmsg += "at position " + Stringify(e->GetPos()) + ".\nThe error message was: " + e->GetMsg(); + ::MessageBox(0, errmsg.c_str(), _T("muParser Sample Generator"), 0); +} + + +////////////////////////////////////////////////////////////////////////// +// Sample Generator Dialog implementation + +#define MAX_SAMPLEGEN_EXPRESSIONS 61 + +BEGIN_MESSAGE_MAP(CSmpGenDialog, CDialog) + ON_EN_CHANGE(IDC_EDIT_SAMPLE_LENGTH, OnSampleLengthChanged) + ON_EN_CHANGE(IDC_EDIT_SAMPLE_LENGTH_SEC, OnSampleSecondsChanged) + ON_EN_CHANGE(IDC_EDIT_SAMPLE_FREQ, OnSampleFreqChanged) + ON_EN_CHANGE(IDC_EDIT_FORMULA, OnExpressionChanged) + ON_COMMAND(IDC_BUTTON_SHOW_EXPRESSIONS, OnShowExpressions) + ON_COMMAND(IDC_BUTTON_SAMPLEGEN_PRESETS, OnShowPresets) + ON_COMMAND_RANGE(ID_SAMPLE_GENERATOR_MENU, ID_SAMPLE_GENERATOR_MENU + MAX_SAMPLEGEN_EXPRESSIONS - 1, OnInsertExpression) + ON_COMMAND_RANGE(ID_SAMPLE_GENERATOR_PRESET_MENU, ID_SAMPLE_GENERATOR_PRESET_MENU + MAX_SAMPLEGEN_PRESETS + 1, OnSelectPreset) +END_MESSAGE_MAP() + + +// List of all possible expression for expression menu +const samplegen_expression menu_descriptions[MAX_SAMPLEGEN_EXPRESSIONS] = +{ + //------------------------------------- + {"Variables", ""}, + //------------------------------------- + {"Current position (sampling point)", "x"}, + {"Current position (percentage)", "xp"}, + {"Sample length", "len"}, + {"Sample length (seconds)", "lens"}, + {"Sampling frequency", "freq"}, + //------------------------------------- + {"Constants", ""}, + //------------------------------------- + {"Pi", "_pi"}, + {"e", "_e"}, + //------------------------------------- + {"Trigonometric functions", ""}, + //------------------------------------- + {"Sine", "sin(x)"}, + {"Cosine", "cos(x)"}, + {"Tangens", "tan(x)"}, + {"Arcus Sine", "asin(x)"}, + {"Arcus Cosine", "acos(x)"}, + {"Arcus Tangens", "atan(x)"}, + {"Hyperbolic Sine", "sinh(x)"}, + {"Hyperbolic Cosine", "cosh(x)"}, + {"Hyperbolic Tangens", "tanh(x)"}, + {"Hyperbolic Arcus Sine", "asinh(x)"}, + {"Hyperbolic Arcus Cosine", "acosh(x)"}, + {"Hyperbolic Arcus Tangens", "atanh(x)"}, + //------------------------------------- + {"Log, Exp, Root", ""}, + //------------------------------------- + {"Logarithm (base 2)", "log2(x)"}, + {"Logarithm (base 10)", "log(x)"}, + {"Natural Logarithm (base e)", "ln(x)"}, + {"e^x", "exp(x)"}, + {"Square Root", "sqrt(x)"}, + //------------------------------------- + {"Sign and rounding", ""}, + //------------------------------------- + {"Sign", "sign(x)"}, + {"Absolute value", "abs(x)"}, + {"Round to nearest integer", "rint(x)"}, + //------------------------------------- + {"Sets", ""}, + //------------------------------------- + {"Minimum", "min(x, y, ...)"}, + {"Maximum", "max(x, y, ...)"}, + {"Sum", "sum(x, y, ...)"}, + {"Mean value", "avg(x, y, ...)"}, + //------------------------------------- + {"Misc functions", ""}, + //------------------------------------- + {"Pulse generator", "pwm(position, duty%, width)"}, + {"Triangle", "tri(position, width)"}, + {"Random value between 0 and x", "rnd(x)"}, + {"Access previous sampling point", "smp(position)"}, + {"Clip between values", "clip(value, minclip, maxclip)"}, + {"If...Then...Else", "if(condition, statement1, statement2)"}, + //------------------------------------- + {"Operators", ""}, + //------------------------------------- + {"Assignment", "x = y"}, + {"Logical And", "x abd y"}, + {"Logical Or", "x or y"}, + {"Logical Xor", "x xor y"}, + {"Less or equal", "x <= y"}, + {"Greater or equal", "x >= y"}, + {"Not equal", "x != y"}, + {"Equal", "x == y"}, + {"Greater than", "x > y"}, + {"Less than", "x < y"}, + {"Addition", "x + y"}, + {"Subtraction", "x - y"}, + {"Multiplication", "x * y"}, + {"Division", "x / y"}, + {"x^y", "x ^ y"}, + {"Modulo", "x mod y"}, +}; + + +BOOL CSmpGenDialog::OnInitDialog() +//-------------------------------- +{ + CDialog::OnInitDialog(); + RecalcParameters(false, true); + SetDlgItemText(IDC_EDIT_FORMULA, expression.c_str()); + + int check = IDC_RADIO_SMPCLIP1; + switch(sample_clipping) + { + case smpgen_clip: check = IDC_RADIO_SMPCLIP1; break; + case smpgen_overflow: check = IDC_RADIO_SMPCLIP2; break; + case smpgen_normalize: check = IDC_RADIO_SMPCLIP3; break; + } + CheckRadioButton(IDC_RADIO_SMPCLIP1, IDC_RADIO_SMPCLIP3, check); + + if(presets.GetNumPresets() == 0) + { + CreateDefaultPresets(); + } + + // Create font for "dropdown" button (Marlett system font) + hButtonFont = CreateFont(14, 0, 0, 0, FW_DONTCARE, FALSE, FALSE, FALSE, DEFAULT_CHARSET, OUT_DEFAULT_PRECIS, CLIP_DEFAULT_PRECIS, DEFAULT_QUALITY, FF_DONTCARE, TEXT("Marlett")); + ::SendMessage(GetDlgItem(IDC_BUTTON_SHOW_EXPRESSIONS)->m_hWnd, WM_SETFONT, (WPARAM)hButtonFont, MAKELPARAM(TRUE, 0)); + + return TRUE; +} + + +void CSmpGenDialog::OnOK() +//------------------------ +{ + CDialog::OnOK(); + apply = true; + + int check = GetCheckedRadioButton(IDC_RADIO_SMPCLIP1, IDC_RADIO_SMPCLIP3); + switch(check) + { + case IDC_RADIO_SMPCLIP1: sample_clipping = smpgen_clip; break; + case IDC_RADIO_SMPCLIP2: sample_clipping = smpgen_overflow; break; + case IDC_RADIO_SMPCLIP3: sample_clipping = smpgen_normalize; break; + } + + DeleteObject(hButtonFont); +} + + +void CSmpGenDialog::OnCancel() +//---------------------------- +{ + CDialog::OnCancel(); + apply = false; +} + + +// User changed formula +void CSmpGenDialog::OnExpressionChanged() +//--------------------------------------- +{ + CString result; + GetDlgItemText(IDC_EDIT_FORMULA, result); + expression = result; +} + + +// User changed sample length field +void CSmpGenDialog::OnSampleLengthChanged() +//----------------------------------------- +{ + int temp_length = GetDlgItemInt(IDC_EDIT_SAMPLE_LENGTH); + if(temp_length >= SMPGEN_MINLENGTH && temp_length <= SMPGEN_MAXLENGTH) + { + sample_length = temp_length; + RecalcParameters(false); + } +} + + +// User changed sample length (seconds) field +void CSmpGenDialog::OnSampleSecondsChanged() +//------------------------------------------ +{ + CString str; + GetDlgItemText(IDC_EDIT_SAMPLE_LENGTH_SEC, str); + double temp_seconds = atof(str); + if(temp_seconds > 0) + { + sample_seconds = temp_seconds; + RecalcParameters(true); + } +} + + +// User changed sample frequency field +void CSmpGenDialog::OnSampleFreqChanged() +//--------------------------------------- +{ + int temp_freq = GetDlgItemInt(IDC_EDIT_SAMPLE_FREQ); + if(temp_freq >= SMPGEN_MINFREQ && temp_freq <= SMPGEN_MAXFREQ) + { + sample_frequency = temp_freq; + RecalcParameters(false); + } +} + + +// Show all expressions that can be input +void CSmpGenDialog::OnShowExpressions() +//------------------------------------- +{ + HMENU hMenu = ::CreatePopupMenu(), hSubMenu = NULL; + if(!hMenu) return; + + for(int i = 0; i < MAX_SAMPLEGEN_EXPRESSIONS; i++) + { + if(menu_descriptions[i].expression == "") + { + // add sub menu + if(hSubMenu != NULL) ::DestroyMenu(hSubMenu); + hSubMenu = ::CreatePopupMenu(); + + AppendMenu(hMenu, MF_POPUP, (UINT_PTR)hSubMenu, menu_descriptions[i].description.c_str()); + } else + { + // add sub menu entry (formula) + AppendMenu(hSubMenu, MF_STRING, ID_SAMPLE_GENERATOR_MENU + i, menu_descriptions[i].description.c_str()); + } + } + + // place popup menu below button + RECT button; + GetDlgItem(IDC_BUTTON_SHOW_EXPRESSIONS)->GetWindowRect(&button); + ::TrackPopupMenu(hMenu, TPM_LEFTALIGN | TPM_RIGHTBUTTON, button.left, button.bottom, 0, m_hWnd, NULL); + ::DestroyMenu(hMenu); + ::DestroyMenu(hSubMenu); +} + + +// Show all expression presets +void CSmpGenDialog::OnShowPresets() +//--------------------------------- +{ + HMENU hMenu = ::CreatePopupMenu(); + if(!hMenu) return; + + bool prestsExist = false; + for(size_t i = 0; i < presets.GetNumPresets(); i++) + { + if(presets.GetPreset(i)->expression != "") + { + AppendMenu(hMenu, MF_STRING, ID_SAMPLE_GENERATOR_PRESET_MENU + i, presets.GetPreset(i)->description.c_str()); + prestsExist = true; + } + } + + if(prestsExist) AppendMenu(hMenu, MF_SEPARATOR, 0, NULL); + + AppendMenu(hMenu, MF_STRING, ID_SAMPLE_GENERATOR_PRESET_MENU + MAX_SAMPLEGEN_PRESETS, _TEXT("Manage...")); + + CString result; + GetDlgItemText(IDC_EDIT_FORMULA, result); + if((!result.IsEmpty()) && (presets.GetNumPresets() < MAX_SAMPLEGEN_PRESETS)) + { + AppendMenu(hMenu, MF_STRING, ID_SAMPLE_GENERATOR_PRESET_MENU + MAX_SAMPLEGEN_PRESETS + 1, _TEXT("Add current...")); + } + + // place popup menu below button + RECT button; + GetDlgItem(IDC_BUTTON_SAMPLEGEN_PRESETS)->GetWindowRect(&button); + ::TrackPopupMenu(hMenu, TPM_LEFTALIGN | TPM_RIGHTBUTTON, button.left, button.bottom, 0, m_hWnd, NULL); + ::DestroyMenu(hMenu); +} + + + +// Insert expression from context menu +void CSmpGenDialog::OnInsertExpression(UINT nId) +//---------------------------------------------- +{ + if((nId < ID_SAMPLE_GENERATOR_MENU) || (nId >= ID_SAMPLE_GENERATOR_MENU + MAX_SAMPLEGEN_EXPRESSIONS)) return; + + expression += " " + menu_descriptions[nId - ID_SAMPLE_GENERATOR_MENU].expression; + + SetDlgItemText(IDC_EDIT_FORMULA, expression.c_str()); +} + + +// Select a preset (or manage them, or add one) +void CSmpGenDialog::OnSelectPreset(UINT nId) +//------------------------------------------ +{ + if((nId < ID_SAMPLE_GENERATOR_PRESET_MENU) || (nId >= ID_SAMPLE_GENERATOR_PRESET_MENU + MAX_SAMPLEGEN_PRESETS + 2)) return; + + if(nId - ID_SAMPLE_GENERATOR_PRESET_MENU >= MAX_SAMPLEGEN_PRESETS) + { + // add... + if((nId - ID_SAMPLE_GENERATOR_PRESET_MENU == MAX_SAMPLEGEN_PRESETS + 1)) + { + samplegen_expression newPreset; + newPreset.description = newPreset.expression = expression; + presets.AddPreset(newPreset); + // call preset manager now. + } + + // manage... + CSmpGenPresetDlg dlg(&presets); + dlg.DoModal(); + } else + { + expression = presets.GetPreset(nId - ID_SAMPLE_GENERATOR_PRESET_MENU)->expression; + SetDlgItemText(IDC_EDIT_FORMULA, expression.c_str()); + } + +} + + +// Update input fields, depending on what has been chagned +void CSmpGenDialog::RecalcParameters(bool secondsChanged, bool forceRefresh) +//-------------------------------------------------------------------------- +{ + static bool isLocked = false; + if(isLocked) return; + isLocked = true; // avoid deadlock + + if(secondsChanged) + { + // seconds changed => recalc length + sample_length = (int)(sample_seconds * sample_frequency); + if(sample_length < SMPGEN_MINLENGTH || sample_length > SMPGEN_MAXLENGTH) sample_length = SMPGEN_MAXLENGTH; + } else + { + // length/freq changed => recalc seconds + sample_seconds = ((double)sample_length) / ((double)sample_frequency); + } + + if(secondsChanged || forceRefresh) SetDlgItemInt(IDC_EDIT_SAMPLE_LENGTH, sample_length); + if(secondsChanged || forceRefresh) SetDlgItemInt(IDC_EDIT_SAMPLE_FREQ, sample_frequency); + CString str; + str.Format("%.4f", sample_seconds); + if(!secondsChanged || forceRefresh) SetDlgItemText(IDC_EDIT_SAMPLE_LENGTH_SEC, str); + + int smpsize = sample_length * SMPGEN_MIXBYTES; + if(smpsize < 1024) + { + str.Format("Sample Size: %d Bytes", smpsize); + } else if((smpsize >> 10) < 1024) + { + str.Format("Sample Size: %d KB", smpsize >> 10); + } else + { + str.Format("Sample Size: %d MB", smpsize >> 20); + } + SetDlgItemText(IDC_STATIC_SMPSIZE_KB, str); + + isLocked = false; +} + + +// Create a set of default formla presets +void CSmpGenDialog::CreateDefaultPresets() +//---------------------------------------- +{ + samplegen_expression preset; + + preset.description = "A440"; + preset.expression = "sin(xp * _pi / 50 * 440 * len / freq)"; + presets.AddPreset(preset); + + preset.description = "Noisy Saw"; + preset.expression = "(x mod 800) / 800 - 0.5 + rnd (0.1)"; + presets.AddPreset(preset); + + preset.description = "PWM Filter"; + preset.expression = "pwm(x, 50 + sin(xp * _pi / 100) * 40, 100) + tri(x, 50)"; + presets.AddPreset(preset); + + preset.description = "Fat PWM Pad"; + preset.expression = "pwm(x, xp, 500) + pwm(x, abs(50 - xp), 1000)"; + presets.AddPreset(preset); + + preset.description = "Dual Square"; + preset.expression = "if((x mod 100) < 50, (x mod 200), -x mod 200)"; + presets.AddPreset(preset); + + preset.description = "Noise Hit"; + preset.expression = "exp(-xp) * (rnd(x) - x / 2)"; + presets.AddPreset(preset); + + preset.description = "Laser"; + preset.expression = "sin(xp * _pi * 100 /(xp ^ 2)) * 100 / sqrt(xp)"; + + presets.AddPreset(preset); + preset.description = "Twinkle, Twinkle..."; + preset.expression = "sin(xp * _pi * 100 / xp) * 100 / sqrt(xp)"; + + preset.description = "FM Tom"; + preset.expression = "sin(xp * _pi * 2 + (xp / 5 - 50) ^ 2) * exp(-xp / 10)"; + presets.AddPreset(preset); + + preset.description = "FM Warp"; + preset.expression = "sin(_pi * xp / 2 * (1 + (1 + sin(_pi * xp / 4 * 50)) / 4)) * exp(-(xp / 8) * .6)"; + presets.AddPreset(preset); +} + + + +////////////////////////////////////////////////////////////////////////// +// Sample Generator Preset Dialog implementation + + +BEGIN_MESSAGE_MAP(CSmpGenPresetDlg, CDialog) + ON_COMMAND(IDC_BUTTON_ADD, OnAddPreset) + ON_COMMAND(IDC_BUTTON_REMOVE, OnRemovePreset) + ON_EN_CHANGE(IDC_EDIT_PRESET_NAME, OnTextChanged) + ON_EN_CHANGE(IDC_EDIT_PRESET_EXPR, OnExpressionChanged) + ON_LBN_SELCHANGE(IDC_LIST_SAMPLEGEN_PRESETS, OnListSelChange) +END_MESSAGE_MAP() + + +BOOL CSmpGenPresetDlg::OnInitDialog() +//----------------------------------- +{ + CDialog::OnInitDialog(); + + RefreshList(); + + return TRUE; +} + + +void CSmpGenPresetDlg::OnOK() +//--------------------------- +{ + // remove empty presets + for(size_t i = 0; i < presets->GetNumPresets(); i++) + { + if(presets->GetPreset(i)->expression.empty()) + { + presets->RemovePreset(i); + } + } + CDialog::OnOK(); +} + + +void CSmpGenPresetDlg::OnListSelChange() +//-------------------------------------- +{ + currentItem = ((CListBox *)GetDlgItem(IDC_LIST_SAMPLEGEN_PRESETS))->GetCurSel() + 1; + if(currentItem == 0 || currentItem > presets->GetNumPresets()) return; + samplegen_expression *preset = presets->GetPreset(currentItem - 1); + if(preset == nullptr) return; + SetDlgItemText(IDC_EDIT_PRESET_NAME, preset->description.c_str()); + SetDlgItemText(IDC_EDIT_PRESET_EXPR, preset->expression.c_str()); +} + + +void CSmpGenPresetDlg::OnTextChanged() +//------------------------------------ +{ + if(currentItem == 0 || currentItem > presets->GetNumPresets()) return; + CString result; + GetDlgItemText(IDC_EDIT_PRESET_NAME, result); + + samplegen_expression *preset = presets->GetPreset(currentItem - 1); + if(preset == nullptr) return; + preset->description = result; + + CListBox *clist = (CListBox *)GetDlgItem(IDC_LIST_SAMPLEGEN_PRESETS); + clist->DeleteString(currentItem - 1); + clist->InsertString(currentItem - 1, (preset->description).c_str()); + clist->SetCurSel(currentItem - 1); +} + + +void CSmpGenPresetDlg::OnExpressionChanged() +//------------------------------------------ +{ + if(currentItem == 0 || currentItem > presets->GetNumPresets()) return; + CString result; + GetDlgItemText(IDC_EDIT_PRESET_EXPR, result); + + samplegen_expression *preset = presets->GetPreset(currentItem - 1); + if(preset != nullptr) preset->expression = result; + +} + + +void CSmpGenPresetDlg::OnAddPreset() +//---------------------------------- +{ + samplegen_expression newPreset; + newPreset.description = "New Preset"; + newPreset.expression = ""; + if(presets->AddPreset(newPreset)) + { + currentItem = presets->GetNumPresets(); + RefreshList(); + } +} + + +void CSmpGenPresetDlg::OnRemovePreset() +//------------------------------------- +{ + if(currentItem == 0 || currentItem > presets->GetNumPresets()) return; + if(presets->RemovePreset(currentItem - 1)) + RefreshList(); +} + + +void CSmpGenPresetDlg::RefreshList() +//---------------------------------- +{ + CListBox *clist = (CListBox *)GetDlgItem(IDC_LIST_SAMPLEGEN_PRESETS); + clist->SetRedraw(FALSE); //disable lisbox refreshes during fill to avoid flicker + clist->ResetContent(); + for(size_t i = 0; i < presets->GetNumPresets(); i++) + { + samplegen_expression *preset = presets->GetPreset(i); + if(preset != nullptr) + clist->AddString((preset->description).c_str()); + } + clist->SetRedraw(TRUE); //re-enable lisbox refreshes + if(currentItem == 0 || currentItem > presets->GetNumPresets()) + { + currentItem = presets->GetNumPresets(); + } + if(currentItem != 0) clist->SetCurSel(currentItem - 1); + OnListSelChange(); +} Added: trunk/OpenMPT/mptrack/SampleGenerator.h =================================================================== --- trunk/OpenMPT/mptrack/SampleGenerator.h (rev 0) +++ trunk/OpenMPT/mptrack/SampleGenerator.h 2010-02-13 13:15:18 UTC (rev 491) @@ -0,0 +1,207 @@ +/* + * SampleGenerator.h + * ----------------- + * Purpose: Header file for sample generator + * Notes : (currently none) + * Authors: OpenMPT Devs + */ + +#pragma once +#include "mptrack.h" +#include "Mainfrm.h" +#include "Sndfile.h" +#include "../muParser/include/muParser.h" + +// sample length +#define SMPGEN_MINLENGTH 1 +#define SMPGEN_MAXLENGTH MAX_SAMPLE_LENGTH +// sample frequency +#define SMPGEN_MINFREQ 1 +#define SMPGEN_MAXFREQ 96000 +// 16-bit sample quality - when changing this, also change CSampleGenerator::sampling_type and 16-bit flags in SampleGenerator.cpp! +#define SMPGEN_MIXBYTES 2 + +enum smpgen_clip_methods +{ + smpgen_clip, + smpgen_overflow, + smpgen_normalize, +}; + +//==================== +class CSampleGenerator +//==================== +{ +protected: + + // sample parameters + static int sample_frequency; + static int sample_length; + static mu::string_type expression; + static smpgen_clip_methods sample_clipping; + + // rendering helper variables (they're here for the callback functions) + static mu::value_type *sample_buffer; + static size_t samples_written; + + typedef int16 sampling_type; // has to match SMPGEN_MIXBYTES! + static const sampling_type sample_maxvalue = (1 << ((SMPGEN_MIXBYTES << 3) - 1)) - 1; + + // muParser object for parsing the expression + mu::Parser muParser; + + // Rendering callback functions + // functions + static mu::value_type ClipCallback(mu::value_type val, mu::value_type min, mu::value_type max) { return CLAMP(val, min, max); }; + static mu::value_type PWMCallback(mu::value_type pos, mu::value_type duty, mu::value_type width) { if((int)width == 0) return 0; else return (((int)pos % (int)width) < ((duty / 100) * width)) ? 1 : -1; }; + static mu::value_type RndCallback(mu::value_type v) { return v*std::rand()/(mu::value_type)(RAND_MAX+1.0); } + static mu::value_type SampleDataCallback(mu::value_type v); + static mu::value_type TriangleCallback(mu::value_type pos, mu::value_type width) { if((int)width == 0) return 0; else return abs(((int)pos % (int)(width)) - width / 2) / (width / 4) - 1; }; + + // binary operators + static mu::value_type ModuloCallback(mu::value_type x, mu::value_type y) { if((int)y == 0) return 0; else return ((int)x) % ((int)y); }; + + void ShowError(mu::Parser::exception_type *e); + +public: + + bool ShowDialog(); + bool TestExpression(); + bool CanRenderSample(); + bool RenderSample(CSoundFile *pSndFile, SAMPLEINDEX nSample); + + CSampleGenerator(); + +}; + + +////////////////////////////////////////////////////////////////////////// +// Sample Generator Formula Preset implementation + + +struct samplegen_expression +{ + std::string description; // e.g. "Pulse" + mu::string_type expression; // e.g. "pwm(x,y,z)" - empty if this is a sub menu +}; +#define MAX_SAMPLEGEN_PRESETS 100 + + +//================== +class CSmpGenPresets +//================== +{ +protected: + vector<samplegen_expression> presets; + +public: + bool AddPreset(samplegen_expression new_preset) { if(GetNumPresets() >= MAX_SAMPLEGEN_PRESETS) return false; presets.push_back(new_preset); return true;}; + bool RemovePreset(size_t which) { if(which < GetNumPresets()) { presets.erase(presets.begin() + which); return true; } else return false; }; + samplegen_expression *GetPreset(size_t which) { if(which < GetNumPresets()) return &presets[which]; else return nullptr; }; + size_t GetNumPresets() { return presets.size(); }; + void Clear() { presets.clear(); }; + + CSmpGenPresets() { Clear(); } + ~CSmpGenPresets() { Clear(); } +}; + + +////////////////////////////////////////////////////////////////////////// +// Sample Generator Dialog implementation + + +//================================= +class CSmpGenDialog: public CDialog +//================================= +{ +protected: + + // sample parameters + int sample_frequency; + int sample_length; + double sample_seconds; + mu::string_type expression; + smpgen_clip_methods sample_clipping; + // pressed "OK"? + bool apply; + // preset slots + CSmpGenPresets presets; + + HFONT hButtonFont; // "Marlett" font for "dropdown" button + + void RecalcParameters(bool secondsChanged, bool forceRefresh = false); + + // function presets + void CreateDefaultPresets(); + +public: + + int GetFrequency() { return sample_frequency; }; + int GetLength() { return sample_length; }; + smpgen_clip_methods GetClipping() { return sample_clipping; } + mu::string_type GetExpression() { return expression; }; + bool CanApply() { return apply; }; + + CSmpGenDialog(int freq, int len, smpgen_clip_methods clipping, mu::string_type expr):CDialog(IDD_SAMPLE_GENERATOR, CMainFrame::GetMainFrame()) + { + sample_frequency = freq; + sample_length = len; + sample_clipping = clipping; + expression = expr; + apply = false; + } + +protected: + virtual BOOL OnInitDialog(); + virtual void OnOK(); + virtual void OnCancel(); + + afx_msg void OnSampleLengthChanged(); + afx_msg void OnSampleSecondsChanged(); + afx_msg void OnSampleFreqChanged(); + afx_msg void OnExpressionChanged(); + afx_msg void OnShowExpressions(); + afx_msg void OnShowPresets(); + afx_msg void OnInsertExpression(UINT nId); + afx_msg void OnSelectPreset(UINT nId); + + //}}AFX_MSG + DECLARE_MESSAGE_MAP() +}; + + +////////////////////////////////////////////////////////////////////////// +// Sample Generator Preset Dialog implementation + + +//==================================== +class CSmpGenPresetDlg: public CDialog +//==================================== +{ +protected: + CSmpGenPresets *presets; + size_t currentItem; // first item is actually 1! + + void RefreshList(); + +public: + CSmpGenPresetDlg(CSmpGenPresets *pPresets):CDialog(IDD_SAMPLE_GENERATOR_PRESETS, CMainFrame::GetMainFrame()) + { + presets = pPresets; + currentItem = 0; + } + +protected: + virtual BOOL OnInitDialog(); + virtual void OnOK(); + + afx_msg void OnListSelChange(); + + afx_msg void OnTextChanged(); + afx_msg void OnExpressionChanged(); + + afx_msg void OnAddPreset(); + afx_msg void OnRemovePreset(); + + DECLARE_MESSAGE_MAP() +}; Modified: trunk/OpenMPT/soundlib/mod_specifications.h =================================================================== --- trunk/OpenMPT/soundlib/mod_specifications.h 2010-02-10 18:21:42 UTC (rev 490) +++ trunk/OpenMPT/soundlib/mod_specifications.h 2010-02-13 13:15:18 UTC (rev 491) @@ -331,7 +331,7 @@ 32, //Min tempo 255, //Max tempo 1, //Min pattern rows - 256, //Max pattern rows + 200, //Max pattern rows 25, //Max mod name length 25, //Max sample name length 12, //Max sample filename length This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <sag...@us...> - 2010-02-13 19:58:12
|
Revision: 492 http://modplug.svn.sourceforge.net/modplug/?rev=492&view=rev Author: saga-games Date: 2010-02-13 19:58:05 +0000 (Sat, 13 Feb 2010) Log Message: ----------- (fix from SchismTracker) [Fix] IT Loader: Ignore stereo sample flag when loading old IT files (older than IT 2.14) since IT id not reset this flag when importing stereo samples back then. [New] Code for detecting MPT hacks in files (is not complete yet) Modified Paths: -------------- trunk/OpenMPT/soundlib/Load_it.cpp Added Paths: ----------- trunk/OpenMPT/mptrack/MPTHacks.cpp Added: trunk/OpenMPT/mptrack/MPTHacks.cpp =================================================================== --- trunk/OpenMPT/mptrack/MPTHacks.cpp (rev 0) +++ trunk/OpenMPT/mptrack/MPTHacks.cpp 2010-02-13 19:58:05 UTC (rev 492) @@ -0,0 +1,340 @@ +/* + * MPTHacks.cpp + * ------------ + * Purpose: Find out if MOD/XM/S3M/IT modules have MPT-specific hacks and fix them. + * Notes : This is not finished yet. + * Authors: OpenMPT Devs + */ + +#include "stdafx.h" +#include "Moddoc.h" + +/* TODO: +stereo/16bit samples (only XM? maybe S3M? many new IT trackers support stereo samples) +out-of range sample pre-amp +song flags and properties (just look at the song properties window) ++++/--- orders in XM/MOD sequence +comments in XM files +AUTOFIX actions! + +maybe two options in program: convert to mptm / remove hacks from file! +*/ + +// Functor for fixing hacked patterns +struct FixHackedPatterns +//====================== +{ + FixHackedPatterns(const CModSpecifications *originalSpecs, MODTYPE type, bool autofix, bool *foundHacks) + { + this->originalSpecs = originalSpecs; + this->type = type; + this->autofix = autofix; + this->foundHacks = foundHacks; + *foundHacks = false; + } + + void operator()(MODCOMMAND& m) + { + // definitely not perfect yet. :) + // Probably missing: Some extended effect parameters + if(!originalSpecs->HasNote(m.note)) + { + *foundHacks = true; + if(autofix) + m.note = NOTE_NONE; + } + + if(!originalSpecs->HasCommand(m.command)) + { + *foundHacks = true; + if(autofix) + m.command = CMD_NONE; + } + + if(!originalSpecs->HasVolCommand(m.volcmd)) + { + *foundHacks = true; + if(autofix) + m.volcmd = VOLCMD_NONE; + } + + if(type == MOD_TYPE_XM) // modplug XM extensions + { + if(m.command == CMD_XFINEPORTAUPDOWN && m.param >= 0x30) + { + *foundHacks = true; + if(autofix) + m.command = CMD_NONE; + } + } else if(type == MOD_TYPE_IT) // modplug IT extensions + { + if(m.command == CMD_S3MCMDEX && (m.param & 0x90) != 0 && m.param != 0x91) + { + *foundHacks = true; + if(autofix) + m.command = CMD_NONE; + } + + } + } + + const CModSpecifications *originalSpecs; + MODTYPE type; + bool autofix; + bool *foundHacks; +}; + +// Go through the module to find out if it contains any hacks introduced by (Open)MPT +bool CModDoc::HasMPTHacks(bool autofix) +//------------------------------------- +{ + const CModSpecifications *originalSpecs = &m_SndFile.GetModSpecifications(); + // retrieve original (not hacked) specs. + switch(m_SndFile.GetType()) + { + case MOD_TYPE_MOD: + originalSpecs = &ModSpecs::mod; + break; + case MOD_TYPE_XM: + originalSpecs = &ModSpecs::xm; + break; + case MOD_TYPE_S3M: + originalSpecs = &ModSpecs::s3m; + break; + case MOD_TYPE_IT: + originalSpecs = &ModSpecs::it; + break; + } + + bool foundHacks = false, foundHere = false; + ClearLog(); + + // Check for plugins + foundHere = false; + for(PLUGINDEX i = 0; i < MAX_MIXPLUGINS; i++) + { + if(m_SndFile.m_MixPlugins[i].pMixPlugin != nullptr || m_SndFile.m_MixPlugins[i].Info.dwPluginId1 || m_SndFile.m_MixPlugins[i].Info.dwPluginId2) + { + foundHere = foundHacks = true; + break; + } + // REQUIRES AUTOFIX + } + if(foundHere) + AddToLog("Found VST plugins\n"); + + // Pattern count + if(m_SndFile.GetNumPatterns() > originalSpecs->patternsMax) + { + AddToLog("Found too many patterns\n"); + foundHacks = true; + // REQUIRES AUTOFIX + } + + // Check for too big/small patterns + foundHere = false; + for(PATTERNINDEX i = 0; i < m_SndFile.Patterns.Size(); i++) + { + if(m_SndFile.Patterns.IsValidPat(i)) + { + if(m_SndFile.Patterns[i].GetNumRows() > originalSpecs->patternRowsMax || m_SndFile.Patterns[i].GetNumRows() < originalSpecs->patternRowsMin) + { + foundHacks = foundHere = true; + break; + } + // REQUIRES AUTOFIX + } + } + if(foundHere) + AddToLog("Found incompatible pattern lengths\n"); + + // Check for invalid pattern commands + foundHere = false; + m_SndFile.Patterns.ForEachModCommand(FixHackedPatterns(originalSpecs, m_SndFile.GetType(), autofix, &foundHere)); + if(foundHere) + AddToLog("Found invalid pattern commands\n"); + + // Check for pattern names + foundHere = false; + for(PATTERNINDEX i = 0; i < m_SndFile.Patterns.Size(); i++) + { + if(m_SndFile.Patterns.IsValidPat(i)) + { + TCHAR tempname[MAX_PATTERNNAME]; + MemsetZero(tempname); + m_SndFile.GetPatternName(i, tempname, sizeof(tempname)); + if(strcmp(tempname, "") != 0) + { + foundHere = foundHacks = true; + if(autofix) + m_SndFile.SetPatternName(i, ""); + else + break; + } + } + } + if(foundHere) + AddToLog("Found pattern names\n"); + + // Check for too many channels + if(m_SndFile.GetNumChannels() > originalSpecs->channelsMax || m_SndFile.GetNumChannels() < originalSpecs->channelsMin) + { + AddToLog("Found incompatible channel count\n"); + foundHacks = true; + // REQUIRES AUTOFIX + } + + // Check for channel names + foundHere = false; + for(CHANNELINDEX i = 0; i < m_SndFile.GetNumChannels(); i++) + { + if(strcmp(m_SndFile.ChnSettings[i].szName, "") != 0) + { + foundHere = foundHacks = true; + if(autofix) + MemsetZero(m_SndFile.ChnSettings[i].szName); + else + break; + } + } + if(foundHere) + AddToLog("Found channel names\n"); + + // Check for too many samples + if(m_SndFile.GetNumSamples() > originalSpecs->samplesMax) + { + AddToLog("Found too many samples\n"); + foundHacks = true; + // REQUIRES AUTOFIX + } + + // Check for too many instruments + if(m_SndFile.GetNumInstruments() > originalSpecs->instrumentsMax) + { + AddToLog("Found too many instruments\n"); + foundHacks = true; + // REQUIRES AUTOFIX + } + + // Check for instrument extensions + foundHere = false; + for(INSTRUMENTINDEX i = 1; i <= m_SndFile.GetNumInstruments(); i++) + { + MODINSTRUMENT *instr = m_SndFile.Instruments[i]; + if(instr == nullptr) continue; + + if(instr->nFilterMode != FLTMODE_UNCHANGED || instr->nVolRamp != 0 || instr->nResampling != SRCMODE_DEFAULT || + instr->nCutSwing != 0 || instr->nResSwing != 0 || instr->nMixPlug != 0 || instr->wPitchToTempoLock != 0 || + instr->nDCT == DCT_PLUGIN || + instr->VolEnv.nReleaseNode != ENV_RELEASE_NODE_UNSET || + instr->PanEnv.nReleaseNode != ENV_RELEASE_NODE_UNSET || + instr->PitchEnv.nReleaseNode != ENV_RELEASE_NODE_UNSET + ) + { + foundHere = foundHacks = true; + if(autofix) + { + instr->nFilterMode = FLTMODE_UNCHANGED; + instr->nVolRamp = 0; + instr->nResampling = SRCMODE_DEFAULT; + instr->nCutSwing = 0; + instr->nResSwing = 0; + instr->nMixPlug = 0; + instr->wPitchToTempoLock = 0; + if(instr->nDCT == DCT_PLUGIN) instr->nDCT = DCT_NONE; + instr->VolEnv.nReleaseNode = instr->PanEnv.nReleaseNode = instr->PitchEnv.nReleaseNode = ENV_RELEASE_NODE_UNSET; + } + } + + } + if(foundHere) + AddToLog("Found MPT instrument extensions\n"); + + // Check for too many orders + if(m_SndFile.Order.GetLengthTailTrimmed() > originalSpecs->ordersMax) + { + AddToLog("Found too many orders\n"); + foundHacks = true; + // REQUIRES AUTOFIX + } + + // Check for invalid default tempo + if(m_SndFile.m_nDefaultTempo > originalSpecs->tempoMax || m_SndFile.m_nDefaultTempo < originalSpecs->tempoMin) + { + AddToLog("Found incompatible default tempo\n"); + foundHacks = true; + if(autofix) + m_SndFile.m_nDefaultTempo = CLAMP(m_SndFile.m_nDefaultTempo, originalSpecs->tempoMin, originalSpecs->tempoMax); + } + + // Check for invalid default speed + if(m_SndFile.m_nDefaultSpeed > originalSpecs->speedMax || m_SndFile.m_nDefaultSpeed < originalSpecs->speedMin) + { + AddToLog("Found incompatible default speed\n"); + foundHacks = true; + if(autofix) + m_SndFile.m_nDefaultSpeed = CLAMP(m_SndFile.m_nDefaultSpeed, originalSpecs->speedMin, originalSpecs->speedMax); + } + + // Check for invalid rows per beat / measure values + if(m_SndFile.m_nRowsPerBeat >= originalSpecs->patternRowsMax || m_SndFile.m_nRowsPerMeasure >= originalSpecs->patternRowsMax) + { + AddToLog("Found incompatible rows per beat / measure\n"); + foundHacks = true; + if(autofix) + { + m_SndFile.m_nRowsPerBeat = CLAMP(m_SndFile.m_nRowsPerBeat, 1, (originalSpecs->patternRowsMax - 1)); + m_SndFile.m_nRowsPerMeasure = CLAMP(m_SndFile.m_nRowsPerMeasure, m_SndFile.m_nRowsPerBeat, (originalSpecs->patternRowsMax - 1)); + } + } + + // Check for new tempo modes + if(m_SndFile.m_nTempoMode != tempo_mode_classic) + { + AddToLog("Found incompatible tempo mode\n"); + foundHacks = true; + if(autofix) + m_SndFile.m_nTempoMode = tempo_mode_classic; + } + + // Check for extended filter range flag + if(m_SndFile.m_dwSongFlags & SONG_EXFILTERRANGE) + { + AddToLog("Found extended filter range\n"); + foundHacks = true; + if(autofix) + m_SndFile.m_dwSongFlags &= ~SONG_EXFILTERRANGE; + } + + // Embedded MIDI configuration in XM files + if((m_SndFile.m_dwSongFlags & SONG_EMBEDMIDICFG) != 0 && m_SndFile.GetType() == MOD_TYPE_XM) + { + AddToLog("Found embedded MIDI macros\n"); + foundHacks = true; + if(autofix) + m_SndFile.m_dwSongFlags &= ~SONG_EMBEDMIDICFG; + } + + // Player flags + if(!m_SndFile.GetModFlag(MSF_COMPATIBLE_PLAY)) + { + AddToLog("Compatible play is deactivated\n"); + foundHacks = true; + if(autofix) + m_SndFile.SetModFlag(MSF_COMPATIBLE_PLAY, true); + } + + // Check for restart position where it should not be + if(m_SndFile.m_nRestartPos > 0 && !originalSpecs->hasRestartPos) + { + AddToLog("Found restart position\n"); + foundHacks = true; + if(autofix) + m_SndFile.m_nRestartPos = 0; + } + + if(autofix && foundHacks) + SetModified(); + + return foundHacks; +} Modified: trunk/OpenMPT/soundlib/Load_it.cpp =================================================================== --- trunk/OpenMPT/soundlib/Load_it.cpp 2010-02-13 13:15:18 UTC (rev 491) +++ trunk/OpenMPT/soundlib/Load_it.cpp 2010-02-13 19:58:05 UTC (rev 492) @@ -1261,18 +1261,18 @@ pSmp->nLength = pis->length; if (pSmp->nLength > MAX_SAMPLE_LENGTH) pSmp->nLength = MAX_SAMPLE_LENGTH; UINT flags = (pis->cvt & 1) ? RS_PCM8S : RS_PCM8U; - if (pis->flags & 2) + if (pis->flags & 2) // 16-bit { flags += 5; - if (pis->flags & 4) flags |= RSF_STEREO; + if (pis->flags & 4 && pifh->cwtv >= 0x214) flags |= RSF_STEREO; // some old version of IT didn't clear the stereo flag when importing samples. Luckily, all other trackers are identifying as IT 2.14+, so let's check for old IT versions. pSmp->uFlags |= CHN_16BIT; - // IT 2.14 16-bit packed sample ? + // IT 2.14 16-bit packed sample? if (pis->flags & 8) flags = ((pifh->cmwt >= 0x215) && (pis->cvt & 4)) ? RS_IT21516 : RS_IT21416; - } else + } else // 8-bit { - if (pis->flags & 4) flags |= RSF_STEREO; + if (pis->flags & 4 && pifh->cwtv >= 0x214) flags |= RSF_STEREO; // some old version of IT didn't clear the stereo flag when importing samples. Luckily, all other trackers are identifying as IT 2.14+, so let's check for old IT versions. if (pis->cvt == 0xFF) flags = RS_ADPCM4; else - // IT 2.14 8-bit packed sample ? + // IT 2.14 8-bit packed sample? if (pis->flags & 8) flags = ((pifh->cmwt >= 0x215) && (pis->cvt & 4)) ? RS_IT2158 : RS_IT2148; } // -> CODE#0027 This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <sag...@us...> - 2010-02-14 01:10:46
|
Revision: 493 http://modplug.svn.sourceforge.net/modplug/?rev=493&view=rev Author: saga-games Date: 2010-02-14 00:22:40 +0000 (Sun, 14 Feb 2010) Log Message: ----------- [Mod] Added dialog resources for Sample Generator [Ref] Mostly cosmetic changes to ITP and GDM loader as well as tagging code Modified Paths: -------------- trunk/OpenMPT/mptrack/mptrack.rc trunk/OpenMPT/mptrack/resource.h trunk/OpenMPT/mptrack/tagging.cpp trunk/OpenMPT/mptrack/tagging.h trunk/OpenMPT/soundlib/IT_DEFS.H trunk/OpenMPT/soundlib/Load_gdm.cpp trunk/OpenMPT/soundlib/Load_it.cpp Modified: trunk/OpenMPT/mptrack/mptrack.rc =================================================================== --- trunk/OpenMPT/mptrack/mptrack.rc 2010-02-13 19:58:05 UTC (rev 492) +++ trunk/OpenMPT/mptrack/mptrack.rc 2010-02-14 00:22:40 UTC (rev 493) @@ -13,7 +13,7 @@ #undef APSTUDIO_READONLY_SYMBOLS ///////////////////////////////////////////////////////////////////////////// -// German (Germany) resources +// Deutsch (Deutschland) resources #if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_DEU) #ifdef _WIN32 @@ -99,7 +99,50 @@ LTEXT "Enabling instrument, volume or octave change will enable the keyboard split feature. These options are applied to the lower section of the keyboard.",IDC_STATIC,6,78,174,24 END +IDD_SAMPLE_GENERATOR DIALOGEX 0, 0, 304, 191 +STYLE DS_SETFONT | DS_MODALFRAME | DS_FIXEDSYS | WS_POPUP | WS_CAPTION | WS_SYSMENU +CAPTION "Sample Generator" +FONT 8, "MS Shell Dlg", 400, 0, 0x1 +BEGIN + GROUPBOX "Mathematical Formula",IDC_STATIC,6,6,294,30 + EDITTEXT IDC_EDIT_FORMULA,12,18,270,12,ES_AUTOHSCROLL + PUSHBUTTON "6",IDC_BUTTON_SHOW_EXPRESSIONS,282,18,12,12 + GROUPBOX "Sample Parameters",IDC_STATIC,6,42,294,48 + LTEXT "Sample Length:",IDC_STATIC,12,56,60,8 + EDITTEXT IDC_EDIT_SAMPLE_LENGTH,108,54,42,12,ES_AUTOHSCROLL | ES_NUMBER + LTEXT "Sample Frequency:",IDC_STATIC,12,74,66,8 + EDITTEXT IDC_EDIT_SAMPLE_FREQ,108,72,42,12,ES_AUTOHSCROLL | ES_NUMBER + LTEXT "Sample Length in Seconds:",IDC_STATIC,156,56,90,8 + EDITTEXT IDC_EDIT_SAMPLE_LENGTH_SEC,252,54,42,12,ES_AUTOHSCROLL + LTEXT "Size: 9999 KB",IDC_STATIC_SMPSIZE_KB,156,72,138,12 + GROUPBOX "Clipping Options",IDC_STATIC,6,96,294,66 + CONTROL "Normalize - All values are accepted and normalized.",IDC_RADIO_SMPCLIP3, + "Button",BS_AUTORADIOBUTTON,12,114,270,12 + CONTROL "Clip - Values in [-1,1] are accepted, other values are clipped.",IDC_RADIO_SMPCLIP1, + "Button",BS_AUTORADIOBUTTON,12,126,270,12 + CONTROL "Overflow - Values in [-1,1] are accepted, other values are wrapped around.",IDC_RADIO_SMPCLIP2, + "Button",BS_AUTORADIOBUTTON,12,138,270,12 + DEFPUSHBUTTON "OK",IDOK,192,168,50,14 + PUSHBUTTON "Cancel",IDCANCEL,246,168,50,14 + PUSHBUTTON "Presets...",IDC_BUTTON_SAMPLEGEN_PRESETS,6,168,50,14 +END +IDD_SAMPLE_GENERATOR_PRESETS DIALOGEX 0, 0, 316, 101 +STYLE DS_SETFONT | DS_MODALFRAME | DS_FIXEDSYS | WS_POPUP | WS_CAPTION | WS_SYSMENU +CAPTION "Sample Generator Presets" +FONT 8, "MS Shell Dlg", 400, 0, 0x1 +BEGIN + DEFPUSHBUTTON "OK",IDOK,258,78,50,14 + LISTBOX IDC_LIST_SAMPLEGEN_PRESETS,6,6,108,90,LBS_NOINTEGRALHEIGHT | WS_VSCROLL | WS_TABSTOP + EDITTEXT IDC_EDIT_PRESET_NAME,120,18,186,12,ES_AUTOHSCROLL + LTEXT "Name:",IDC_STATIC,120,6,186,8 + EDITTEXT IDC_EDIT_PRESET_EXPR,120,54,186,12,ES_AUTOHSCROLL + LTEXT "Expression:",IDC_STATIC,120,42,186,8 + PUSHBUTTON "Remove",IDC_BUTTON_REMOVE,120,78,50,14 + PUSHBUTTON "Add",IDC_BUTTON_ADD,174,78,50,14 +END + + ///////////////////////////////////////////////////////////////////////////// // // DESIGNINFO @@ -139,15 +182,31 @@ TOPMARGIN, 7 BOTTOMMARGIN, 130 END + + IDD_SAMPLE_GENERATOR, DIALOG + BEGIN + LEFTMARGIN, 7 + RIGHTMARGIN, 297 + TOPMARGIN, 7 + BOTTOMMARGIN, 184 + END + + IDD_SAMPLE_GENERATOR_PRESETS, DIALOG + BEGIN + LEFTMARGIN, 7 + RIGHTMARGIN, 309 + TOPMARGIN, 7 + BOTTOMMARGIN, 94 + END END #endif // APSTUDIO_INVOKED -#endif // German (Germany) resources +#endif // Deutsch (Deutschland) resources ///////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////// -// English (U.S.) resources +// Englisch (USA) resources #if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU) #ifdef _WIN32 @@ -467,7 +526,7 @@ END IDD_CONTROL_SAMPLES DIALOGEX 0, 0, 544, 106 -STYLE DS_SETFONT | WS_CHILD +STYLE DS_SETFONT | DS_FIXEDSYS | WS_CHILD FONT 8, "MS Shell Dlg", 0, 0, 0x1 BEGIN CONTROL "Toolbar1",IDC_TOOLBAR1,"ToolbarWindow32",WS_GROUP | 0x4d,4,4,55,17 @@ -2311,12 +2370,12 @@ IDS_SOUNDTOUCH_LOADFAILURE "Unable to load OpenMPT_soundtouch_i16.dll." END -#endif // English (U.S.) resources +#endif // Englisch (USA) resources ///////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////// -// English (U.K.) resources +// Englisch (GB) resources #if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENG) #ifdef _WIN32 @@ -2685,7 +2744,7 @@ // IDR_BUILTIN_TUNINGS TUNING "res\\built-inTunings.tc" -#endif // English (U.K.) resources +#endif // Englisch (GB) resources ///////////////////////////////////////////////////////////////////////////// Modified: trunk/OpenMPT/mptrack/resource.h =================================================================== --- trunk/OpenMPT/mptrack/resource.h 2010-02-13 19:58:05 UTC (rev 492) +++ trunk/OpenMPT/mptrack/resource.h 2010-02-14 00:22:40 UTC (rev 493) @@ -132,6 +132,8 @@ #define IDD_CLEANUP_SONG 521 #define IDD_CHANNEL_NAME 522 #define IDD_KEYBOARD_SPLIT 523 +#define IDD_SAMPLE_GENERATOR 524 +#define IDD_SAMPLE_GENERATOR_PRESETS 525 #define IDC_BUTTON1 1001 #define IDC_BUTTON2 1002 #define IDC_BUTTON3 1003 @@ -930,6 +932,22 @@ #define IDC_STATIC_CHANNEL_NAME 2410 #define IDC_EDIT_CHANNEL_NAME 2411 #define IDC_STATIC_PATTERNNAME 2412 +#define IDC_EDIT_SAMPLE_LENGTH 2413 +#define IDC_EDIT_SAMPLE_FREQ 2414 +#define IDC_EDIT_FORMULA 2415 +#define IDC_EDIT_SAMPLE_LENGTH2 2416 +#define IDC_EDIT_SAMPLE_LENGTH_SEC 2416 +#define IDC_RADIO_SMPCLIP1 2417 +#define IDC_RADIO_SMPCLIP2 2418 +#define IDC_RADIO_SMPCLIP3 2419 +#define IDC_STATIC_SMPSIZE_KB 2420 +#define IDC_BUTTON_SHOW_EXPRESSIONS 2421 +#define IDC_SAMPLEGEN_PRESETS 2422 +#define IDC_BUTTON_SAMPLEGEN_PRESETS 2422 +#define IDC_EDIT_PRESET_NAME 2423 +#define IDC_EDIT_PRESET_EXPR 2424 +#define IDC_LIST_SAMPLEGEN_PRESETS 2425 +#define IDC_CHECK_UNDO 2426 #define ID_FILE_NEWMOD 32771 #define ID_FILE_NEWXM 32772 #define ID_FILE_NEWS3M 32773 @@ -1178,7 +1196,10 @@ #define ID_EDIT_SPLITKEYBOARDSETTINGS 59240 #define ID_EDIT_PASTESPECIAL 59241 #define ID_CHANGE_PCNOTE_PARAM 59242 -#define ID_MODTREE_CLOSE 60243 +#define ID_MODTREE_CLOSE 60243 +#define ID_SAMPLE_GENERATOR_MENU 60244 +#define ID_SAMPLE_GENERATOR_PRESET_MENU 60344 +#define ID_SAMPLE_GENERATE 60445 // Next default values for new objects // @@ -1186,8 +1207,8 @@ #ifndef APSTUDIO_READONLY_SYMBOLS #define _APS_3D_CONTROLS 1 #define _APS_NEXT_RESOURCE_VALUE 526 -#define _APS_NEXT_COMMAND_VALUE 60244 -#define _APS_NEXT_CONTROL_VALUE 2426 +#define _APS_NEXT_COMMAND_VALUE 60446 +#define _APS_NEXT_CONTROL_VALUE 2427 #define _APS_NEXT_SYMED_VALUE 901 #endif #endif Modified: trunk/OpenMPT/mptrack/tagging.cpp =================================================================== --- trunk/OpenMPT/mptrack/tagging.cpp 2010-02-13 19:58:05 UTC (rev 492) +++ trunk/OpenMPT/mptrack/tagging.cpp 2010-02-14 00:22:40 UTC (rev 493) @@ -13,6 +13,7 @@ // CFileTagging - helper class for writing tags CFileTagging::CFileTagging() +//-------------------------- { encoder = "OpenMPT " MPT_VERSION_STR; } @@ -23,10 +24,11 @@ // Convert Integer to Synchsafe Integer (see ID3v2.4 specs) // Basically, it's a BigEndian integer, but the MSB of all bytes is 0. // Thus, a 32-bit integer turns into a 28-bit integer. -UINT32 CFileTagging::intToSynchsafe(UINT32 iIn) +uint32 CFileTagging::intToSynchsafe(uint32 iIn) +//--------------------------------------------- { iIn = LittleEndian(iIn); - UINT32 iOut = 0, iSteps = 0; + uint32 iOut = 0, iSteps = 0; do { iOut |= (iIn & 0x7F) << iSteps; iSteps += 8; @@ -36,6 +38,7 @@ // Write Tags void CFileTagging::WriteID3v2Tags(FILE *f) +//---------------------------------------- { if(!f) return; @@ -81,6 +84,7 @@ // Write a ID3v2 frame void CFileTagging::WriteID3v2Frame(char cFrameID[4], string sFramecontent, FILE *f) +//--------------------------------------------------------------------------------- { if(!strcmp(cFrameID, "") || sFramecontent.empty() || !f) return; @@ -108,6 +112,7 @@ // Write RIFF tags void CFileTagging::WriteWaveTags(WAVEDATAHEADER *wdh, WAVEFILEHEADER *wfh, FILE *f) +//--------------------------------------------------------------------------------- { if(!f || !wdh || !wfh) return; Modified: trunk/OpenMPT/mptrack/tagging.h =================================================================== --- trunk/OpenMPT/mptrack/tagging.h 2010-02-13 19:58:05 UTC (rev 492) +++ trunk/OpenMPT/mptrack/tagging.h 2010-02-14 00:22:40 UTC (rev 493) @@ -58,18 +58,18 @@ typedef struct _TAGID3v2HEADER { - BYTE signature[3]; - BYTE version[2]; - BYTE flags; - UINT32 size; + uint8 signature[3]; + uint8 version[2]; + uint8 flags; + uint32 size; // Total: 10 bytes } TAGID3v2HEADER; typedef struct _TAGID3v2FRAME { - UINT32 frameid; - UINT32 size; - UINT16 flags; + uint32 frameid; + uint32 size; + uint16 flags; // Total: 10 bytes } TAGID3v2FRAME; @@ -106,11 +106,11 @@ private: // Convert Integer to Synchsafe Integer (see ID3v2.4 specs) - UINT32 intToSynchsafe(UINT32 in); + uint32 intToSynchsafe(UINT32 in); // Write a frame void WriteID3v2Frame(char cFrameID[4], string sFramecontent, FILE *f); // Size of our tag - UINT32 totalID3v2Size; + uint32 totalID3v2Size; }; #pragma pack() Modified: trunk/OpenMPT/soundlib/IT_DEFS.H =================================================================== --- trunk/OpenMPT/soundlib/IT_DEFS.H 2010-02-13 19:58:05 UTC (rev 492) +++ trunk/OpenMPT/soundlib/IT_DEFS.H 2010-02-14 00:22:40 UTC (rev 493) @@ -140,19 +140,19 @@ extern BYTE autovibit2xm[8]; extern BYTE autovibxm2it[8]; -#endif +#define ITP_VERSION 0x00000102 // v1.02 -//plastiq.manyChannels enum IT_ReaderBitMasks { - // pattern row parsing, the channel data is read to obtain - // number of channels active in the pattern. These bit masks are - // to blank out sections of the byte of data being read. + // pattern row parsing, the channel data is read to obtain + // number of channels active in the pattern. These bit masks are + // to blank out sections of the byte of data being read. - IT_bitmask_patternChanField_c = 0x7f, - IT_bitmask_patternChanMask_c = 0x3f, - IT_bitmask_patternChanEnabled_c = 0x80, - IT_bitmask_patternChanUsed_c = 0x0f + IT_bitmask_patternChanField_c = 0x7f, + IT_bitmask_patternChanMask_c = 0x3f, + IT_bitmask_patternChanEnabled_c = 0x80, + IT_bitmask_patternChanUsed_c = 0x0f }; -//end plastiq.manyChannels \ No newline at end of file + +#endif \ No newline at end of file Modified: trunk/OpenMPT/soundlib/Load_gdm.cpp =================================================================== --- trunk/OpenMPT/soundlib/Load_gdm.cpp 2010-02-13 19:58:05 UTC (rev 492) +++ trunk/OpenMPT/soundlib/Load_gdm.cpp 2010-02-14 00:22:40 UTC (rev 493) @@ -19,57 +19,63 @@ typedef struct _GDMHEADER { - DWORD ID; // ID: 'GDM\xFE' - CHAR SongTitle[32]; // Music's title - CHAR SongMusician[32]; // Name of music's composer - CHAR DOSEOF[3]; // 13, 10, 26 - DWORD ID2; // ID: 'GMFS' - BYTE FormMajorVer; // Format major version - BYTE FormMinorVer; // Format minor version - UINT16 TrackID; // Composing Tracker ID code (00 = 2GDM) - BYTE TrackMajorVer; // Tracker's major version - BYTE TrackMinorVer; // Tracker's minor version - BYTE PanMap[32]; // 0-Left to 15-Right, 255-N/U - BYTE MastVol; // Range: 0...64 - BYTE Tempo; // Initial music tempo (6) - BYTE BPM; // Initial music BPM (125) - UINT16 FormOrigin; // Original format ID: + uint32 ID; // ID: 'GDM\xFE' + char SongTitle[32]; // Music's title + char SongMusician[32]; // Name of music's composer + char DOSEOF[3]; // 13, 10, 26 + uint32 ID2; // ID: 'GMFS' + uint8 FormMajorVer; // Format major version + uint8 FormMinorVer; // Format minor version + uint16 TrackID; // Composing Tracker ID code (00 = 2GDM) + uint8 TrackMajorVer; // Tracker's major version + uint8 TrackMinorVer; // Tracker's minor version + uint8 PanMap[32]; // 0-Left to 15-Right, 255-N/U + uint8 MastVol; // Range: 0...64 + uint8 Tempo; // Initial music tempo (6) + uint8 BPM; // Initial music BPM (125) + uint16 FormOrigin; // Original format ID: // 1-MOD, 2-MTM, 3-S3M, 4-669, 5-FAR, 6-ULT, 7-STM, 8-MED // (versions of 2GDM prior to v1.15 won't set this correctly) - UINT32 OrdOffset; - BYTE NOO; // Number of orders in module - 1 - UINT32 PatOffset; - BYTE NOP; // Number of patterns in module - 1 - UINT32 SamHeadOffset; - UINT32 SamOffset; - BYTE NOS; // Number of samples in module - 1 - UINT32 MTOffset; // Offset of song message - UINT32 MTLength; - UINT32 SSOffset; // Offset of scrolly script (huh?) - UINT16 SSLength; - UINT32 TGOffset; // Offset of text graphic (huh?) - UINT16 TGLength; + uint32 OrdOffset; + uint8 NOO; // Number of orders in module - 1 + uint32 PatOffset; + uint8 NOP; // Number of patterns in module - 1 + uint32 SamHeadOffset; + uint32 SamOffset; + uint8 NOS; // Number of samples in module - 1 + uint32 MTOffset; // Offset of song message + uint32 MTLength; + uint32 SSOffset; // Offset of scrolly script (huh?) + uint16 SSLength; + uint32 TGOffset; // Offset of text graphic (huh?) + uint16 TGLength; } GDMHEADER, *PGDMHEADER; typedef struct _GDMSAMPLEHEADER { - CHAR SamName[32]; // sample's name - CHAR FileName[12]; // sample's filename - BYTE EmsHandle; // useless - UINT32 Length; // length in bytes - UINT32 LoopBegin; // loop start in samples - UINT32 LoopEnd; // loop end in samples - BYTE Flags; // misc. flags - UINT16 C4Hertz; // frequency - BYTE Volume; // default volume - BYTE Pan; // default pan + char SamName[32]; // sample's name + char FileName[12]; // sample's filename + uint8 EmsHandle; // useless + uint32 Length; // length in bytes + uint32 LoopBegin; // loop start in samples + uint32 LoopEnd; // loop end in samples + uint8 Flags; // misc. flags + uint16 C4Hertz; // frequency + uint8 Volume; // default volume + uint8 Pan; // default pan } GDMSAMPLEHEADER, *PGDMSAMPLEHEADER; #pragma pack() +#define GDMHeader_Origin_Count 8 +static MODTYPE GDMHeader_Origin[GDMHeader_Origin_Count] = +{ + MOD_TYPE_NONE, MOD_TYPE_MOD, MOD_TYPE_S3M, MOD_TYPE_669, MOD_TYPE_FAR, MOD_TYPE_ULT, MOD_TYPE_STM, MOD_TYPE_MED +}; + bool CSoundFile::ReadGDM(const LPCBYTE lpStream, const DWORD dwMemLength) -//----------------------------------------------------------- +//----------------------------------------------------------------------- { if ((!lpStream) || (dwMemLength < sizeof(GDMHEADER))) return false; @@ -82,11 +88,13 @@ // there are no other format versions... if(pHeader->FormMajorVer != 1 || pHeader->FormMinorVer != 0) - { - ::MessageBox(0, TEXT("GDM file seems to be valid, but this format version is currently not supported."), TEXT("OpenMPT GDM import"), MB_ICONERROR); return false; - } + // 1-MOD, 2-MTM, 3-S3M, 4-669, 5-FAR, 6-ULT, 7-STM, 8-MED + m_nType = GDMHeader_Origin[pHeader->FormOrigin % GDMHeader_Origin_Count]; + if(m_nType == MOD_TYPE_NONE) + return false; + // interesting question: Is TrackID, TrackMajorVer, TrackMinorVer relevant? The only TrackID should be 0 - 2GDM.exe, so the answer would be no. // song name @@ -121,43 +129,10 @@ m_nSamplePreAmp = 48; // dito m_nVSTiVolume = 48; // dito - // 1-MOD, 2-MTM, 3-S3M, 4-669, 5-FAR, 6-ULT, 7-STM, 8-MED - - switch(LittleEndianW(pHeader->FormOrigin)) - { - case 1: - m_nType = MOD_TYPE_MOD; - break; - case 2: - m_nType = MOD_TYPE_MTM; - break; - case 3: - m_nType = MOD_TYPE_S3M; - break; - case 4: - m_nType = MOD_TYPE_669; - break; - case 5: - m_nType = MOD_TYPE_FAR; - break; - case 6: - m_nType = MOD_TYPE_ULT; - break; - case 7: - m_nType = MOD_TYPE_STM; - break; - case 8: - m_nType = MOD_TYPE_MED; - break; - default: - ::MessageBox(0, TEXT("GDM file seems to be valid, but the original format is currently not supported.\nThis should not happen."), TEXT("OpenMPT GDM import"), MB_ICONERROR); - return false; - break; - } - UINT32 iSampleOffset = LittleEndian(pHeader->SamOffset), + uint32 iSampleOffset = LittleEndian(pHeader->SamOffset), iPatternsOffset = LittleEndian(pHeader->PatOffset); - const UINT32 iOrdOffset = LittleEndian(pHeader->OrdOffset), iSamHeadOffset = LittleEndian(pHeader->SamHeadOffset), + const uint32 iOrdOffset = LittleEndian(pHeader->OrdOffset), iSamHeadOffset = LittleEndian(pHeader->SamHeadOffset), iMTOffset = LittleEndian(pHeader->MTOffset), iMTLength = LittleEndian(pHeader->MTLength), iSSOffset = LittleEndian(pHeader->SSOffset), iSSLength = LittleEndianW(pHeader->SSLength), iTGOffset = LittleEndian(pHeader->TGOffset), iTGLength = LittleEndianW(pHeader->TGLength); @@ -243,24 +218,16 @@ if(pSample->Flags & 0x02) // 16 bit { if(pSample->Flags & 0x20) // stereo - { iSampleFormat = RS_PCM16U; // should be RS_STPCM16U but that breaks the sample reader - } else - { iSampleFormat = RS_PCM16U; - } } else // 8 bit { if(pSample->Flags & 0x20) // stereo - { iSampleFormat = RS_PCM8U; // should be RS_STPCM8U - dito - } else - { iSampleFormat = RS_PCM8U; - } } // according to zilym, LZW support has never been finished, so this is also practically useless. Just ignore the flag. @@ -283,7 +250,7 @@ { if(iPatternsOffset + 2 > dwMemLength) break; - UINT16 iPatternLength = LittleEndianW(*(UINT16 *)(lpStream + iPatternsOffset)); // pattern length including the two "length" bytes + uint16 iPatternLength = LittleEndianW(*(uint16 *)(lpStream + iPatternsOffset)); // pattern length including the two "length" bytes if(iPatternLength > dwMemLength || iPatternsOffset > dwMemLength - iPatternLength) break; if(Patterns.Insert(iPat, 64)) Modified: trunk/OpenMPT/soundlib/Load_it.cpp =================================================================== --- trunk/OpenMPT/soundlib/Load_it.cpp 2010-02-13 19:58:05 UTC (rev 492) +++ trunk/OpenMPT/soundlib/Load_it.cpp 2010-02-14 00:22:40 UTC (rev 493) @@ -458,6 +458,9 @@ version = id; streamPos += sizeof(DWORD); + if(version > ITP_VERSION) + return false; + // Song name // name string length @@ -1554,7 +1557,7 @@ DWORD id = 0x2e697470; // .itp ASCII fwrite(&id, 1, sizeof(id), f); - id = 0x00000102; // v1.02 + id = ITP_VERSION; fwrite(&id, 1, sizeof(id), f); // Song name This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <rel...@us...> - 2010-02-15 21:05:10
|
Revision: 495 http://modplug.svn.sourceforge.net/modplug/?rev=495&view=rev Author: relabsoluness Date: 2010-02-15 21:05:01 +0000 (Mon, 15 Feb 2010) Log Message: ----------- [Fix] Pattern Editor: status bar change done in r485 is now applied also when using hex-display. [Fix] VST: Returned host CanDo-values were wrong (since pre RC1 era). [Mod] ITP: Removed 'terminate loading on newer version'-functionality introduced in r493. [Mod] Version: Changed version to 1.18.00.01 [Mod] Misc: Some minor changes. [Svn] TortoiseSVN setting logminsize is now defined to prevent commits with empty log message. Instrument extension handling: [Mod] 'dF..' extension uses the old(pre 1.18.00.00) format again. [Mod] Limit envpoints to 32 on saving if possible. [Fix] Loading PFLG, AFLG and VFLG entries was broken (since they were introduced?). [Fix] 'dF..' conversion was faulty (introduced in r483). Modified Paths: -------------- trunk/OpenMPT/mptrack/Ctrl_seq.cpp trunk/OpenMPT/mptrack/Vstplug.cpp trunk/OpenMPT/mptrack/version.h trunk/OpenMPT/soundlib/Load_it.cpp trunk/OpenMPT/soundlib/Sampleio.cpp trunk/OpenMPT/soundlib/Snd_defs.h trunk/OpenMPT/soundlib/Sndfile.cpp trunk/OpenMPT/soundlib/Sndfile.h Property Changed: ---------------- trunk/OpenMPT/ Property changes on: trunk/OpenMPT ___________________________________________________________________ Added: tsvn:logminsize + 10 Modified: trunk/OpenMPT/mptrack/Ctrl_seq.cpp =================================================================== --- trunk/OpenMPT/mptrack/Ctrl_seq.cpp 2010-02-14 15:02:53 UTC (rev 494) +++ trunk/OpenMPT/mptrack/Ctrl_seq.cpp 2010-02-15 21:05:01 UTC (rev 495) @@ -698,7 +698,7 @@ s[0] = 0; if(CMainFrame::m_dwPatternSetup & PATTERN_HEXDISPLAY) { - wsprintf(s, "Position %02Xh of %02Xh", m_nScrollPos, pSndFile->Order.GetLengthFirstEmpty()); + wsprintf(s, "Position %02Xh of %02Xh", m_nScrollPos, pSndFile->Order.GetLengthTailTrimmed()); } else { @@ -709,7 +709,7 @@ if (m_nScrollPos < pSndFile->Order.GetLength()) { - UINT nPat = pSndFile->Order[m_nScrollPos]; + PATTERNINDEX nPat = pSndFile->Order[m_nScrollPos]; if ((nPat < pSndFile->Patterns.Size()) && (nPat < pSndFile->m_nPatternNames)) { CHAR szpat[40] = ""; Modified: trunk/OpenMPT/mptrack/Vstplug.cpp =================================================================== --- trunk/OpenMPT/mptrack/Vstplug.cpp 2010-02-14 15:02:53 UTC (rev 494) +++ trunk/OpenMPT/mptrack/Vstplug.cpp 2010-02-15 21:05:01 UTC (rev 495) @@ -645,6 +645,13 @@ Log("VST plugin to host: Eff: 0x%.8X, Opcode = %d, Index = %d, Value = %d, PTR = %.8X, OPT = %.3f\n",(int)effect, opcode,index,value,(int)ptr,opt); #endif + enum HostCanDo + { + HostDoNotKnow = 0, + HostCanDo = 1, + HostCanNotDo = -1 + }; + switch(opcode) { // Called when plugin param is changed via gui @@ -929,14 +936,14 @@ //"asyncProcessing", //"offline", //"supportShell" - if (!(strcmp((char*)ptr,"sendVstEvents")==0 || + if ((strcmp((char*)ptr,"sendVstEvents")==0 || strcmp((char*)ptr,"sendVstMidiEvent")==0 || strcmp((char*)ptr,"sendVstTimeInfo")==0 || strcmp((char*)ptr,"supplyIdle")==0 || strcmp((char*)ptr,"sizeWindow")==0)) - return 1; + return HostCanDo; else - return -1; + return HostCanNotDo; // case audioMasterGetLanguage: return kVstLangEnglish; Modified: trunk/OpenMPT/mptrack/version.h =================================================================== --- trunk/OpenMPT/mptrack/version.h 2010-02-14 15:02:53 UTC (rev 494) +++ trunk/OpenMPT/mptrack/version.h 2010-02-15 21:05:01 UTC (rev 495) @@ -15,7 +15,7 @@ #define VER_MAJORMAJOR 1 #define VER_MAJOR 18 #define VER_MINOR 00 -#define VER_MINORMINOR 00 +#define VER_MINORMINOR 01 //Creates version number from version parts that appears in version string. //For example MAKE_VERSION_NUMERIC(1,17,02,28) gives version number of Modified: trunk/OpenMPT/soundlib/Load_it.cpp =================================================================== --- trunk/OpenMPT/soundlib/Load_it.cpp 2010-02-14 15:02:53 UTC (rev 494) +++ trunk/OpenMPT/soundlib/Load_it.cpp 2010-02-15 21:05:01 UTC (rev 495) @@ -457,9 +457,6 @@ version = id; streamPos += sizeof(DWORD); - if(version > ITP_VERSION) - return false; - m_nType = MOD_TYPE_IT; // Song name @@ -850,11 +847,6 @@ default: ptr += sizeof(__int32); // jump field code ReadExtendedInstrumentProperty(Instruments[i], fcode, ptr, lpStream + dwMemLength); - // fix old instrument flags which got broken in OpenMPT 1.17.03.03 due to refactoring (rev 415). - if(version == 0x00000101 && fcode == 'dF..') - { - ConvertOldExtendedFlagFormat(Instruments[i]); - } break; } } @@ -3526,7 +3518,7 @@ fwrite(&size, 1, sizeof(__int16), f); fwrite(&m_dwCreatedWithVersion, 1, size, f); - code = 'LSWV'; //write m_dwCreatedWithVersion + code = 'LSWV'; //write m_dwLastSavedWithVersion fwrite(&code, 1, sizeof(__int32), f); size = sizeof(m_dwLastSavedWithVersion); fwrite(&size, 1, sizeof(__int16), f); Modified: trunk/OpenMPT/soundlib/Sampleio.cpp =================================================================== --- trunk/OpenMPT/soundlib/Sampleio.cpp 2010-02-14 15:02:53 UTC (rev 494) +++ trunk/OpenMPT/soundlib/Sampleio.cpp 2010-02-15 21:05:01 UTC (rev 495) @@ -2021,6 +2021,9 @@ if(fadr && code != 'K[..') // copy field data in instrument's header memcpy(fadr,ptr,size); // (except for keyboard mapping) ptr += size; // jump field + + if (code == 'dF..' && fadr != nullptr) // 'dF..' field requires additional processing. + ConvertReadExtendedFlags(pIns); } @@ -2056,8 +2059,6 @@ // Seek for supported extended settings header if( code == 'MPTX' ) { - bool newFormat = false; // new flag format (separate flags for envelopes) - bool hasFlags = false; // do we really need to convert the flags? pData += sizeof(code); // jump extension header code while( (uintptr_t)(pData - pDataStart) <= nMemLength - 4) @@ -2065,39 +2066,31 @@ memcpy(&code, pData, sizeof(code)); // read field code pData += sizeof(code); // jump field code ReadExtendedInstrumentProperty(pIns, code, pData, pEnd); - if(code == 'VFLG') - newFormat = true; - if(code == 'dF..') - hasFlags = true; } - if(!newFormat && hasFlags) - { - ConvertOldExtendedFlagFormat(pIns); - } } } -void ConvertOldExtendedFlagFormat(MODINSTRUMENT *pIns) -//---------------------------------------------------- +void ConvertReadExtendedFlags(MODINSTRUMENT *pIns) +//------------------------------------------------ { - DWORD dwOldFlags = pIns->dwFlags; + const DWORD dwOldFlags = pIns->dwFlags; pIns->dwFlags = pIns->VolEnv.dwFlags = pIns->PanEnv.dwFlags = pIns->PitchEnv.dwFlags = 0; - if(dwOldFlags & 0x0001) pIns->VolEnv.dwFlags |= ENV_ENABLED; - if(dwOldFlags & 0x0002) pIns->VolEnv.dwFlags |= ENV_SUSTAIN; - if(dwOldFlags & 0x0004) pIns->VolEnv.dwFlags |= ENV_LOOP; - if(dwOldFlags & 0x0008) pIns->PanEnv.dwFlags |= ENV_ENABLED; - if(dwOldFlags & 0x0010) pIns->PanEnv.dwFlags |= ENV_SUSTAIN; - if(dwOldFlags & 0x0020) pIns->PanEnv.dwFlags |= ENV_LOOP; - if(dwOldFlags & 0x0040) pIns->PitchEnv.dwFlags |= ENV_ENABLED; - if(dwOldFlags & 0x0080) pIns->PitchEnv.dwFlags |= ENV_SUSTAIN; - if(dwOldFlags & 0x0100) pIns->VolEnv.dwFlags |= ENV_LOOP; - if(dwOldFlags & 0x0200) pIns->dwFlags |= INS_SETPANNING; - if(dwOldFlags & 0x0400) pIns->PitchEnv.dwFlags |= ENV_FILTER; - if(dwOldFlags & 0x0800) pIns->VolEnv.dwFlags |= ENV_CARRY; - if(dwOldFlags & 0x1000) pIns->PanEnv.dwFlags |= ENV_CARRY; - if(dwOldFlags & 0x2000) pIns->PitchEnv.dwFlags |= ENV_CARRY; - if(dwOldFlags & 0x4000) pIns->dwFlags |= INS_MUTE; + if(dwOldFlags & dFdd_VOLUME) pIns->VolEnv.dwFlags |= ENV_ENABLED; + if(dwOldFlags & dFdd_VOLSUSTAIN) pIns->VolEnv.dwFlags |= ENV_SUSTAIN; + if(dwOldFlags & dFdd_VOLLOOP) pIns->VolEnv.dwFlags |= ENV_LOOP; + if(dwOldFlags & dFdd_PANNING) pIns->PanEnv.dwFlags |= ENV_ENABLED; + if(dwOldFlags & dFdd_PANSUSTAIN) pIns->PanEnv.dwFlags |= ENV_SUSTAIN; + if(dwOldFlags & dFdd_PANLOOP) pIns->PanEnv.dwFlags |= ENV_LOOP; + if(dwOldFlags & dFdd_PITCH) pIns->PitchEnv.dwFlags |= ENV_ENABLED; + if(dwOldFlags & dFdd_PITCHSUSTAIN) pIns->PitchEnv.dwFlags |= ENV_SUSTAIN; + if(dwOldFlags & dFdd_PITCHLOOP) pIns->PitchEnv.dwFlags |= ENV_LOOP; + if(dwOldFlags & dFdd_SETPANNING) pIns->dwFlags |= INS_SETPANNING; + if(dwOldFlags & dFdd_FILTER) pIns->PitchEnv.dwFlags |= ENV_FILTER; + if(dwOldFlags & dFdd_VOLCARRY) pIns->VolEnv.dwFlags |= ENV_CARRY; + if(dwOldFlags & dFdd_PANCARRY) pIns->PanEnv.dwFlags |= ENV_CARRY; + if(dwOldFlags & dFdd_PITCHCARRY) pIns->PitchEnv.dwFlags |= ENV_CARRY; + if(dwOldFlags & dFdd_MUTE) pIns->dwFlags |= INS_MUTE; } Modified: trunk/OpenMPT/soundlib/Snd_defs.h =================================================================== --- trunk/OpenMPT/soundlib/Snd_defs.h 2010-02-14 15:02:53 UTC (rev 494) +++ trunk/OpenMPT/soundlib/Snd_defs.h 2010-02-15 21:05:01 UTC (rev 495) @@ -167,10 +167,30 @@ #define ENV_CARRY 0x08 // env carry #define ENV_FILTER 0x10 // filter env enabled (this has to be combined with ENV_ENABLED in the pitch envelope's flags) + +// Flags of 'dF..' datafield in extended instrument properties. +#define dFdd_VOLUME 0x0001 +#define dFdd_VOLSUSTAIN 0x0002 +#define dFdd_VOLLOOP 0x0004 +#define dFdd_PANNING 0x0008 +#define dFdd_PANSUSTAIN 0x0010 +#define dFdd_PANLOOP 0x0020 +#define dFdd_PITCH 0x0040 +#define dFdd_PITCHSUSTAIN 0x0080 +#define dFdd_PITCHLOOP 0x0100 +#define dFdd_SETPANNING 0x0200 +#define dFdd_FILTER 0x0400 +#define dFdd_VOLCARRY 0x0800 +#define dFdd_PANCARRY 0x1000 +#define dFdd_PITCHCARRY 0x2000 +#define dFdd_MUTE 0x4000 + + // instrument-specific flags #define INS_SETPANNING 0x01 // panning enabled -#define INS_MUTE 0x02 // instrumentd is muted +#define INS_MUTE 0x02 // instrument is muted + // envelope types in instrument editor enum enmEnvelopeTypes { Modified: trunk/OpenMPT/soundlib/Sndfile.cpp =================================================================== --- trunk/OpenMPT/soundlib/Sndfile.cpp 2010-02-14 15:02:53 UTC (rev 494) +++ trunk/OpenMPT/soundlib/Sndfile.cpp 2010-02-15 21:05:01 UTC (rev 495) @@ -153,7 +153,7 @@ IFC. nIFC; IFR. nIFR; K[. Keyboard[128]; -LSWV [EXT] nPlugMixMode +LSWV [EXT] Last Saved With Version MB.. wMidiBank; MC.. nMidiChannel; MDK. nMidiDrumKey; @@ -219,6 +219,7 @@ // Convenient macro to help WRITE_HEADER declaration for single type members ONLY (non-array) // -------------------------------------------------------------------------------------------- #define WRITE_MPTHEADER_sized_member(name,type,code) \ +static_assert(sizeof(input->name) >= sizeof(type), "");\ fcode = #@code;\ fwrite(& fcode , 1 , sizeof( __int32 ) , file);\ fsize = sizeof( type );\ @@ -229,19 +230,55 @@ // Convenient macro to help WRITE_HEADER declaration for array members ONLY // -------------------------------------------------------------------------------------------- #define WRITE_MPTHEADER_array_member(name,type,code,arraysize) \ +ASSERT(sizeof(input->name) >= sizeof(type) * arraysize);\ fcode = #@code;\ fwrite(& fcode , 1 , sizeof( __int32 ) , file);\ fsize = sizeof( type ) * arraysize;\ fwrite(& fsize , 1 , sizeof( __int16 ) , file);\ fwrite(&input-> name , 1 , fsize , file); +namespace { +// Create 'dF..' entry. +DWORD CreateExtensionFlags(const MODINSTRUMENT& ins) +//-------------------------------------------------- +{ + DWORD dwFlags = 0; + if (ins.VolEnv.dwFlags & ENV_ENABLED) dwFlags |= dFdd_VOLUME; + if (ins.VolEnv.dwFlags & ENV_SUSTAIN) dwFlags |= dFdd_VOLSUSTAIN; + if (ins.VolEnv.dwFlags & ENV_LOOP) dwFlags |= dFdd_VOLLOOP; + if (ins.PanEnv.dwFlags & ENV_ENABLED) dwFlags |= dFdd_PANNING; + if (ins.PanEnv.dwFlags & ENV_SUSTAIN) dwFlags |= dFdd_PANSUSTAIN; + if (ins.PanEnv.dwFlags & ENV_LOOP) dwFlags |= dFdd_PANLOOP; + if (ins.PitchEnv.dwFlags & ENV_ENABLED) dwFlags |= dFdd_PITCH; + if (ins.PitchEnv.dwFlags & ENV_SUSTAIN) dwFlags |= dFdd_PITCHSUSTAIN; + if (ins.PitchEnv.dwFlags & ENV_LOOP) dwFlags |= dFdd_PITCHLOOP; + if (ins.dwFlags & INS_SETPANNING) dwFlags |= dFdd_SETPANNING; + if (ins.PitchEnv.dwFlags & ENV_FILTER) dwFlags |= dFdd_FILTER; + if (ins.VolEnv.dwFlags & ENV_CARRY) dwFlags |= dFdd_VOLCARRY; + if (ins.PanEnv.dwFlags & ENV_CARRY) dwFlags |= dFdd_PANCARRY; + if (ins.PitchEnv.dwFlags & ENV_CARRY) dwFlags |= dFdd_PITCHCARRY; + if (ins.dwFlags & INS_MUTE) dwFlags |= dFdd_MUTE; + return dwFlags; +} +} // unnamed namespace. + // Write (in 'file') 'input' MODINSTRUMENT with 'code' & 'size' extra field infos for each member void WriteInstrumentHeaderStruct(MODINSTRUMENT * input, FILE * file) { __int32 fcode; __int16 fsize; WRITE_MPTHEADER_sized_member( nFadeOut , UINT , FO.. ) -WRITE_MPTHEADER_sized_member( dwFlags , DWORD , dF.. ) + +{ // dwFlags needs to be constructed so write it manually. + //WRITE_MPTHEADER_sized_member( dwFlags , DWORD , dF.. ) + const DWORD dwFlags = CreateExtensionFlags(*input); + fcode = 'dF..'; + fwrite(&fcode, 1, sizeof(int32), file); + fsize = sizeof(dwFlags); + fwrite(&fsize, 1, sizeof(int16), file); + fwrite(&dwFlags, 1, fsize, file); +} + WRITE_MPTHEADER_sized_member( nGlobalVol , UINT , GV.. ) WRITE_MPTHEADER_sized_member( nPan , UINT , P... ) WRITE_MPTHEADER_sized_member( VolEnv.nNodes , UINT , VE.. ) @@ -272,12 +309,12 @@ WRITE_MPTHEADER_sized_member( nMidiDrumKey , BYTE , MDK. ) WRITE_MPTHEADER_sized_member( nPPS , signed char , PPS. ) WRITE_MPTHEADER_sized_member( nPPC , unsigned char , PPC. ) -WRITE_MPTHEADER_array_member( VolEnv.Ticks , WORD , VP[. , MAX_ENVPOINTS ) -WRITE_MPTHEADER_array_member( PanEnv.Ticks , WORD , PP[. , MAX_ENVPOINTS ) -WRITE_MPTHEADER_array_member( PitchEnv.Ticks , WORD , PiP[ , MAX_ENVPOINTS ) -WRITE_MPTHEADER_array_member( VolEnv.Values , BYTE , VE[. , MAX_ENVPOINTS ) -WRITE_MPTHEADER_array_member( PanEnv.Values , BYTE , PE[. , MAX_ENVPOINTS ) -WRITE_MPTHEADER_array_member( PitchEnv.Values , BYTE , PiE[ , MAX_ENVPOINTS ) +WRITE_MPTHEADER_array_member( VolEnv.Ticks , WORD , VP[. , ((input->VolEnv.nNodes > 32) ? MAX_ENVPOINTS : 32)) +WRITE_MPTHEADER_array_member( PanEnv.Ticks , WORD , PP[. , ((input->PanEnv.nNodes > 32) ? MAX_ENVPOINTS : 32)) +WRITE_MPTHEADER_array_member( PitchEnv.Ticks , WORD , PiP[ , ((input->PitchEnv.nNodes > 32) ? MAX_ENVPOINTS : 32)) +WRITE_MPTHEADER_array_member( VolEnv.Values , BYTE , VE[. , ((input->VolEnv.nNodes > 32) ? MAX_ENVPOINTS : 32)) +WRITE_MPTHEADER_array_member( PanEnv.Values , BYTE , PE[. , ((input->PanEnv.nNodes > 32) ? MAX_ENVPOINTS : 32)) +WRITE_MPTHEADER_array_member( PitchEnv.Values , BYTE , PiE[ , ((input->PitchEnv.nNodes > 32) ? MAX_ENVPOINTS : 32)) WRITE_MPTHEADER_array_member( NoteMap , BYTE , NM[. , 128 ) WRITE_MPTHEADER_array_member( Keyboard , WORD , K[.. , 128 ) WRITE_MPTHEADER_array_member( name , CHAR , n[.. , 32 ) @@ -376,9 +413,9 @@ GET_MPTHEADER_sized_member( PitchEnv.nReleaseNode , BYTE , PERN ) GET_MPTHEADER_sized_member( PanEnv.nReleaseNode , BYTE , AERN ) GET_MPTHEADER_sized_member( VolEnv.nReleaseNode , BYTE , VERN ) -GET_MPTHEADER_sized_member( PitchEnv.dwFlags , BYTE , PFLG ) -GET_MPTHEADER_sized_member( PanEnv.dwFlags , BYTE , AFLG ) -GET_MPTHEADER_sized_member( VolEnv.dwFlags , BYTE , VFLG ) +GET_MPTHEADER_sized_member( PitchEnv.dwFlags , DWORD , PFLG ) +GET_MPTHEADER_sized_member( PanEnv.dwFlags , DWORD , AFLG ) +GET_MPTHEADER_sized_member( VolEnv.dwFlags , DWORD , VFLG ) } return pointer; Modified: trunk/OpenMPT/soundlib/Sndfile.h =================================================================== --- trunk/OpenMPT/soundlib/Sndfile.h 2010-02-14 15:02:53 UTC (rev 494) +++ trunk/OpenMPT/soundlib/Sndfile.h 2010-02-15 21:05:01 UTC (rev 495) @@ -1193,8 +1193,8 @@ // Read extended instrument properties from 'pDataStart' to instrument 'pIns'. void ReadExtendedInstrumentProperties(MODINSTRUMENT* pIns, const LPCBYTE pDataStart, const size_t nMemLength); -// Convert old instrument flag format, where all flags used to be stored in one single flag. Now, some flags are stored in envelope-specific flag fields. -void ConvertOldExtendedFlagFormat(MODINSTRUMENT* pIns); +// Convert instrument flags which were read from 'dF..' extension to proper internal representation. +void ConvertReadExtendedFlags(MODINSTRUMENT* pIns); #endif This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <sag...@us...> - 2010-02-17 14:49:57
|
Revision: 498 http://modplug.svn.sourceforge.net/modplug/?rev=498&view=rev Author: saga-games Date: 2010-02-17 14:49:47 +0000 (Wed, 17 Feb 2010) Log Message: ----------- [Imp] Sample Editor: When enabling (sustain) loop and no loop points are set yet, automatically set loop to full sample length. [Ref] Added some useful stuff from SchismTracker to the code that will be necessary for further backports. Modified Paths: -------------- trunk/OpenMPT/mptrack/Ctrl_smp.cpp trunk/OpenMPT/soundlib/Sndfile.cpp trunk/OpenMPT/soundlib/Sndfile.h trunk/OpenMPT/soundlib/modcommand.h Modified: trunk/OpenMPT/mptrack/Ctrl_smp.cpp =================================================================== --- trunk/OpenMPT/mptrack/Ctrl_smp.cpp 2010-02-17 09:10:14 UTC (rev 497) +++ trunk/OpenMPT/mptrack/Ctrl_smp.cpp 2010-02-17 14:49:47 UTC (rev 498) @@ -2540,6 +2540,7 @@ if ((IsLocked()) || (!m_pSndFile)) return; int n = m_ComboLoopType.GetCurSel(); MODSAMPLE *pSmp = &m_pSndFile->Samples[m_nSample]; + bool wasDisabled = (pSmp->uFlags & CHN_LOOP) == 0; switch(n) { case 0: // Off @@ -2553,6 +2554,12 @@ pSmp->uFlags |= CHN_LOOP|CHN_PINGPONGLOOP; break; } + // set loop points if theren't any + if(wasDisabled && ((pSmp->uFlags & CHN_LOOP) != 0) && (pSmp->nLoopStart == pSmp->nLoopEnd) && (pSmp->nLoopStart == 0)) + { + pSmp->nLoopEnd = pSmp->nLength; + m_pModDoc->UpdateAllViews(NULL, (m_nSample << HINT_SHIFT_SMP) | HINT_SAMPLEDATA | HINT_SAMPLEINFO, NULL); + } m_pModDoc->AdjustEndOfSample(m_nSample); m_pModDoc->SetModified(); } @@ -2608,6 +2615,7 @@ if ((IsLocked()) || (!m_pSndFile)) return; int n = m_ComboSustainType.GetCurSel(); MODSAMPLE *pSmp = &m_pSndFile->Samples[m_nSample]; + bool wasDisabled = (pSmp->uFlags & CHN_SUSTAINLOOP) == 0; switch(n) { case 0: // Off @@ -2621,6 +2629,12 @@ pSmp->uFlags |= CHN_SUSTAINLOOP|CHN_PINGPONGSUSTAIN; break; } + // set sustain loop points if theren't any + if(wasDisabled && ((pSmp->uFlags & CHN_SUSTAINLOOP) != 0) && (pSmp->nSustainStart == pSmp->nSustainEnd) && (pSmp->nSustainStart == 0)) + { + pSmp->nSustainEnd = pSmp->nLength; + m_pModDoc->UpdateAllViews(NULL, (m_nSample << HINT_SHIFT_SMP) | HINT_SAMPLEDATA | HINT_SAMPLEINFO, NULL); + } m_pModDoc->SetModified(); } Modified: trunk/OpenMPT/soundlib/Sndfile.cpp =================================================================== --- trunk/OpenMPT/soundlib/Sndfile.cpp 2010-02-17 09:10:14 UTC (rev 497) +++ trunk/OpenMPT/soundlib/Sndfile.cpp 2010-02-17 14:49:47 UTC (rev 498) @@ -3776,4 +3776,53 @@ if(CSoundFile::GetModSpecifications(nNewType).HasVolCommand(m->volcmd) == false) m->volcmd = CMD_NONE; +} + + +// "importance" of every FX command. Table is used for importing from formats with multiple effect colums +// and is approximately the same as in SchismTracker. +uint16 CSoundFile::GetEffectWeight(MODCOMMAND::COMMAND cmd) +//--------------------------------------------------------- +{ + switch(cmd) + { + case CMD_PATTERNBREAK: return 288; + case CMD_POSITIONJUMP: return 280; + case CMD_SPEED: return 272; + case CMD_TEMPO: return 264; + case CMD_GLOBALVOLUME: return 256; + case CMD_GLOBALVOLSLIDE: return 248; + case CMD_CHANNELVOLUME: return 240; + case CMD_CHANNELVOLSLIDE: return 232; + case CMD_TONEPORTAVOL: return 224; + case CMD_TONEPORTAMENTO: return 216; + case CMD_ARPEGGIO: return 208; + case CMD_RETRIG: return 200; + case CMD_TREMOR: return 192; + case CMD_OFFSET: return 184; + case CMD_VOLUME: return 176; + case CMD_VIBRATOVOL: return 168; + case CMD_VOLUMESLIDE: return 160; + case CMD_PORTAMENTODOWN: return 152; + case CMD_PORTAMENTOUP: return 133; + case CMD_NOTESLIDEDOWN: return 136; + case CMD_NOTESLIDEUP: return 128; + case CMD_PANNING8: return 120; + case CMD_PANNINGSLIDE: return 112; + case CMD_SMOOTHMIDI: return 104; + case CMD_MIDI: return 96; + case CMD_MODCMDEX: return 88; + case CMD_S3MCMDEX: return 80; + case CMD_PANBRELLO: return 72; + case CMD_XFINEPORTAUPDOWN: return 64; + case CMD_VIBRATO: return 56; + case CMD_FINEVIBRATO: return 48; + case CMD_TREMOLO: return 40; + case CMD_KEYOFF: return 32; + case CMD_SETENVPOSITION: return 24; + case CMD_VELOCITY: return 16; + case CMD_XPARAM: return 8; + case CMD_NONE: + default: return 0; + } } \ No newline at end of file Modified: trunk/OpenMPT/soundlib/Sndfile.h =================================================================== --- trunk/OpenMPT/soundlib/Sndfile.h 2010-02-17 09:10:14 UTC (rev 497) +++ trunk/OpenMPT/soundlib/Sndfile.h 2010-02-17 14:49:47 UTC (rev 498) @@ -964,6 +964,11 @@ void HandlePatternTransitionEvents(); void BuildDefaultInstrument(); long GetSampleOffset(); + +public: + // "importance" of every FX command. Table is used for importing from formats with multiple effect colums + // and is approximately the same as in SchismTracker. + static uint16 CSoundFile::GetEffectWeight(MODCOMMAND::COMMAND cmd); }; #pragma warning(default : 4324) //structure was padded due to __declspec(align()) Modified: trunk/OpenMPT/soundlib/modcommand.h =================================================================== --- trunk/OpenMPT/soundlib/modcommand.h 2010-02-17 09:10:14 UTC (rev 497) +++ trunk/OpenMPT/soundlib/modcommand.h 2010-02-17 14:49:47 UTC (rev 498) @@ -59,6 +59,17 @@ // Returns true if and only if note is NOTE_PC or NOTE_PCS. bool IsPcNote() const {return note == NOTE_PC || note == NOTE_PCS;} + // Swap volume and effect column (doesn't do any conversion as it's mainly for importing formats with multiple effect columns, so beware!) + void SwapEffects() + { + VOLCMD vcold = volcmd; + VOL vold = vol; + volcmd = command; + vol = param; + command = vcold; + param = vold; + } + public: BYTE note; BYTE instr; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <sag...@us...> - 2010-02-20 16:32:19
|
Revision: 500 http://modplug.svn.sourceforge.net/modplug/?rev=500&view=rev Author: saga-games Date: 2010-02-20 16:32:10 +0000 (Sat, 20 Feb 2010) Log Message: ----------- [Fix] Comments Tab: When editing sample / instrument names, they are limited properly now. [Fix] Orderlist Editor: Fixed possible logical error when moving orders (don't think that anything happened due to the && vs. ||, though) [Imp] Playback: When PT1x flag is activated, Amiga note range limits are automatically taken into account. Modified Paths: -------------- trunk/OpenMPT/mptrack/Ctrl_seq.cpp trunk/OpenMPT/mptrack/view_com.cpp trunk/OpenMPT/soundlib/Sndmix.cpp Modified: trunk/OpenMPT/mptrack/Ctrl_seq.cpp =================================================================== --- trunk/OpenMPT/mptrack/Ctrl_seq.cpp 2010-02-17 20:38:04 UTC (rev 499) +++ trunk/OpenMPT/mptrack/Ctrl_seq.cpp 2010-02-20 16:32:10 UTC (rev 500) @@ -897,7 +897,7 @@ // drop before or after the selection bool bMoveBack = !(m_nDragOrder < (UINT)m_nDropPos); // don't do anything if drop position is inside the selection - if(m_nDropPos >= selection.nOrdLo && m_nDropPos <= selection.nOrdHi || m_nDragOrder == m_nDropPos) return; + if((m_nDropPos >= selection.nOrdLo && m_nDropPos <= selection.nOrdHi) || m_nDragOrder == m_nDropPos) return; // drag one order or multiple orders? bool bMultiSelection = (selection.nOrdLo != selection.nOrdHi); @@ -922,7 +922,7 @@ SetCurSel((bMoveBack && (!bSelection)) ? m_nDropPos - 1 : m_nDropPos); } else { - SetCurSel(((m_nDragOrder < (UINT)m_nDropPos) && (!bSelection)) ? m_nDropPos - 1 : m_nDropPos); + SetCurSel(((m_nDragOrder < m_nDropPos) && (!bSelection)) ? m_nDropPos - 1 : m_nDropPos); } m_pModDoc->SetModified(); } Modified: trunk/OpenMPT/mptrack/view_com.cpp =================================================================== --- trunk/OpenMPT/mptrack/view_com.cpp 2010-02-17 20:38:04 UTC (rev 499) +++ trunk/OpenMPT/mptrack/view_com.cpp 2010-02-20 16:32:10 UTC (rev 500) @@ -486,25 +486,30 @@ UINT iItem = plvItem->iItem; CSoundFile *pSndFile = pModDoc->GetSoundFile(); lstrcpyn(s, plvItem->pszText, sizeof(s)); - for (UINT i=strlen(s); i<sizeof(s); i++) s[i] = 0; + + size_t maxStrLen = (m_nListId == IDC_LIST_SAMPLES) ? pSndFile->GetModSpecifications().sampleNameLengthMax : pSndFile->GetModSpecifications().instrNameLengthMax; + + for (size_t i = min(maxStrLen, strlen(s)); i < sizeof(s); i++) + s[i] = 0; + if (m_nListId == IDC_LIST_SAMPLES) { if (iItem < pSndFile->m_nSamples) { - s[31] = 0; - memcpy(pSndFile->m_szNames[iItem+1], s, 32); + memcpy(pSndFile->m_szNames[iItem + 1], s, sizeof(pSndFile->m_szNames[iItem + 1])); + SetNullTerminator(pSndFile->m_szNames[iItem + 1]); // 05/01/05 : ericus replaced "<< 24" by "<< 20" : 4000 samples -> 12bits [see Moddoc.h] - pModDoc->UpdateAllViews(this, ((iItem+1) << HINT_SHIFT_SMP) | (HINT_SMPNAMES|HINT_SAMPLEINFO), this); + pModDoc->UpdateAllViews(this, ((iItem + 1) << HINT_SHIFT_SMP) | (HINT_SMPNAMES|HINT_SAMPLEINFO), this); } } else if (m_nListId == IDC_LIST_INSTRUMENTS) { - if ((iItem < pSndFile->m_nInstruments) && (pSndFile->Instruments[iItem+1])) + if ((iItem < pSndFile->m_nInstruments) && (pSndFile->Instruments[iItem + 1])) { MODINSTRUMENT *pIns = pSndFile->Instruments[iItem+1]; - s[31] = 0; - memcpy(pIns->name, s, 32); - pModDoc->UpdateAllViews(this, ((iItem+1) << HINT_SHIFT_INS) | (HINT_INSNAMES|HINT_INSTRUMENT), this); + memcpy(pIns->name, s, sizeof(pIns->name)); + SetNullTerminator(pIns->name); + pModDoc->UpdateAllViews(this, ((iItem + 1) << HINT_SHIFT_INS) | (HINT_INSNAMES|HINT_INSTRUMENT), this); } } else { Modified: trunk/OpenMPT/soundlib/Sndmix.cpp =================================================================== --- trunk/OpenMPT/soundlib/Sndmix.cpp 2010-02-17 20:38:04 UTC (rev 499) +++ trunk/OpenMPT/soundlib/Sndmix.cpp 2010-02-20 16:32:10 UTC (rev 500) @@ -1259,7 +1259,7 @@ } // Preserve Amiga freq limits - if (m_dwSongFlags & SONG_AMIGALIMITS) + if (m_dwSongFlags & (SONG_AMIGALIMITS|SONG_PT1XMODE)) period = CLAMP(period, 113 * 4, 856 * 4); // Pitch/Filter Envelope This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <sag...@us...> - 2010-02-20 21:02:11
|
Revision: 503 http://modplug.svn.sourceforge.net/modplug/?rev=503&view=rev Author: saga-games Date: 2010-02-20 21:02:02 +0000 (Sat, 20 Feb 2010) Log Message: ----------- [New] Instrument Editor: Transpose Up/Down for sample map. Modified Paths: -------------- trunk/OpenMPT/mptrack/Ctrl_ins.cpp trunk/OpenMPT/mptrack/Ctrl_ins.h trunk/OpenMPT/mptrack/resource.h trunk/OpenMPT/soundlib/modcommand.h Modified: trunk/OpenMPT/mptrack/Ctrl_ins.cpp =================================================================== --- trunk/OpenMPT/mptrack/Ctrl_ins.cpp 2010-02-20 20:34:40 UTC (rev 502) +++ trunk/OpenMPT/mptrack/Ctrl_ins.cpp 2010-02-20 21:02:02 UTC (rev 503) @@ -25,6 +25,8 @@ ON_WM_LBUTTONDOWN() ON_WM_RBUTTONDOWN() ON_WM_LBUTTONDBLCLK() + ON_COMMAND(ID_NOTEMAP_TRANS_UP, OnMapTransposeUp) + ON_COMMAND(ID_NOTEMAP_TRANS_DOWN, OnMapTransposeDown) ON_COMMAND(ID_NOTEMAP_COPY_NOTE, OnMapCopyNote) ON_COMMAND(ID_NOTEMAP_COPY_SMP, OnMapCopySample) ON_COMMAND(ID_NOTEMAP_RESET, OnMapReset) @@ -288,7 +290,7 @@ if (hMenu) { - AppendMenu(hMenu, MF_STRING, ID_INSTRUMENT_SAMPLEMAP, "Edit Sample Map"); + AppendMenu(hMenu, MF_STRING, ID_INSTRUMENT_SAMPLEMAP, "Edit Sample &Map"); if (hSubMenu) { BYTE smpused[(MAX_SAMPLES+7)/8]; @@ -309,18 +311,24 @@ AppendMenu(hSubMenu, MF_STRING, ID_NOTEMAP_EDITSAMPLE+j, s); } } - AppendMenu(hMenu, MF_POPUP, (UINT)hSubMenu, "Edit Sample"); + AppendMenu(hMenu, MF_POPUP, (UINT)hSubMenu, "&Edit Sample"); AppendMenu(hMenu, MF_SEPARATOR, 0, NULL); } - wsprintf(s, "Map all notes to sample %d", pIns->Keyboard[m_nNote]); + wsprintf(s, "Map all notes to &sample %d", pIns->Keyboard[m_nNote]); AppendMenu(hMenu, MF_STRING, ID_NOTEMAP_COPY_SMP, s); - if(pIns->NoteMap[m_nNote] < NOTE_MIN_SPECIAL) - wsprintf(s, "Map all notes to %s", pSndFile->GetNoteName(pIns->NoteMap[m_nNote], m_nInstrument).c_str()); - else - wsprintf(s, "Map all notes to %s", szSpecialNoteNames[pIns->NoteMap[m_nNote] - NOTE_MIN_SPECIAL]); - AppendMenu(hMenu, MF_STRING, ID_NOTEMAP_COPY_NOTE, s); - AppendMenu(hMenu, MF_STRING, ID_NOTEMAP_RESET, "Reset note mapping"); - AppendMenu(hMenu, MF_STRING, ID_INSTRUMENT_DUPLICATE, "Duplicate Instrument\tShift+New"); + + if(pSndFile->GetType() != MOD_TYPE_XM) + { + if(pIns->NoteMap[m_nNote] < NOTE_MIN_SPECIAL) + wsprintf(s, "Map all ¬es to %s", pSndFile->GetNoteName(pIns->NoteMap[m_nNote], m_nInstrument).c_str()); + else + wsprintf(s, "Map all ¬es to %s", szSpecialNoteNames[pIns->NoteMap[m_nNote] - NOTE_MIN_SPECIAL]); + AppendMenu(hMenu, MF_STRING, ID_NOTEMAP_COPY_NOTE, s); + AppendMenu(hMenu, MF_STRING, ID_NOTEMAP_TRANS_UP, "Transpose map &up"); + AppendMenu(hMenu, MF_STRING, ID_NOTEMAP_TRANS_DOWN, "Transpose map &down"); + } + AppendMenu(hMenu, MF_STRING, ID_NOTEMAP_RESET, "&Reset note mapping"); + AppendMenu(hMenu, MF_STRING, ID_INSTRUMENT_DUPLICATE, "Duplicate &Instrument\tShift+New"); SetMenuDefaultItem(hMenu, ID_INSTRUMENT_SAMPLEMAP, FALSE); ClientToScreen(&pt); ::TrackPopupMenu(hMenu, TPM_LEFTALIGN|TPM_RIGHTBUTTON, pt.x, pt.y, 0, m_hWnd, NULL); @@ -335,56 +343,52 @@ void CNoteMapWnd::OnMapCopyNote() //------------------------------- { - if (m_pModDoc) + if(m_pModDoc == nullptr) return; + CSoundFile *pSndFile; + MODINSTRUMENT *pIns; + + pSndFile = m_pModDoc->GetSoundFile(); + pIns = pSndFile->Instruments[m_nInstrument]; + if (pIns) { - CSoundFile *pSndFile; - MODINSTRUMENT *pIns; - - pSndFile = m_pModDoc->GetSoundFile(); - pIns = pSndFile->Instruments[m_nInstrument]; - if (pIns) + bool bModified = false; + UINT n = pIns->NoteMap[m_nNote]; + for (NOTEINDEXTYPE i = 0; i < NOTE_MAX; i++) if (pIns->NoteMap[i] != n) { - BOOL bModified = FALSE; - UINT n = pIns->NoteMap[m_nNote]; - for (UINT i=0; i<NOTE_MAX; i++) if (pIns->NoteMap[i] != n) - { - pIns->NoteMap[i] = n; - bModified = TRUE; - } - if (bModified) - { - m_pModDoc->SetModified(); - InvalidateRect(NULL, FALSE); - } + pIns->NoteMap[i] = n; + bModified = true; } + if (bModified) + { + m_pModDoc->SetModified(); + InvalidateRect(NULL, FALSE); + } } } void CNoteMapWnd::OnMapCopySample() -//------------------------------------- +//--------------------------------- { - if (m_pModDoc) + if(m_pModDoc == nullptr) return; + CSoundFile *pSndFile; + MODINSTRUMENT *pIns; + + pSndFile = m_pModDoc->GetSoundFile(); + pIns = pSndFile->Instruments[m_nInstrument]; + if (pIns) { - CSoundFile *pSndFile; - MODINSTRUMENT *pIns; - - pSndFile = m_pModDoc->GetSoundFile(); - pIns = pSndFile->Instruments[m_nInstrument]; - if (pIns) + bool bModified = false; + UINT n = pIns->Keyboard[m_nNote]; + for (NOTEINDEXTYPE i = 0; i < NOTE_MAX; i++) if (pIns->Keyboard[i] != n) { - BOOL bModified = FALSE; - UINT n = pIns->Keyboard[m_nNote]; - for (UINT i=0; i<NOTE_MAX; i++) if (pIns->Keyboard[i] != n) - { - pIns->Keyboard[i] = n; - bModified = TRUE; - } - if (bModified) - { - m_pModDoc->SetModified(); - InvalidateRect(NULL, FALSE); - } + pIns->Keyboard[i] = n; + bModified = true; } + if (bModified) + { + m_pModDoc->SetModified(); + InvalidateRect(NULL, FALSE); + } } } @@ -392,27 +396,70 @@ void CNoteMapWnd::OnMapReset() //---------------------------- { - if (m_pModDoc) + if(m_pModDoc == nullptr) return; + CSoundFile *pSndFile; + MODINSTRUMENT *pIns; + + pSndFile = m_pModDoc->GetSoundFile(); + pIns = pSndFile->Instruments[m_nInstrument]; + if (pIns) { - CSoundFile *pSndFile; - MODINSTRUMENT *pIns; - - pSndFile = m_pModDoc->GetSoundFile(); - pIns = pSndFile->Instruments[m_nInstrument]; - if (pIns) + bool bModified = false; + for (NOTEINDEXTYPE i = 0; i < NOTE_MAX; i++) if (pIns->NoteMap[i] != i + 1) { - BOOL bModified = FALSE; - for (UINT i=0; i<NOTE_MAX; i++) if (pIns->NoteMap[i] != i+1) + pIns->NoteMap[i] = i + 1; + bModified = true; + } + if (bModified) + { + m_pModDoc->SetModified(); + InvalidateRect(NULL, FALSE); + } + } +} + + +void CNoteMapWnd::OnMapTransposeUp() +//---------------------------------- +{ + MapTranspose(1); +} + + +void CNoteMapWnd::OnMapTransposeDown() +//------------------------------------ +{ + MapTranspose(-1); +} + + +void CNoteMapWnd::MapTranspose(int nAmount) +//----------------------------------------- +{ + if(m_pModDoc == nullptr || nAmount == 0) return; + CSoundFile *pSndFile; + MODINSTRUMENT *pIns; + + pSndFile = m_pModDoc->GetSoundFile(); + pIns = pSndFile->Instruments[m_nInstrument]; + if (pIns) + { + bool bModified = false; + for(NOTEINDEXTYPE i = 0; i < NOTE_MAX; i++) + { + int n = pIns->NoteMap[i]; + if ((n > NOTE_MIN && nAmount < 0) || (n < NOTE_MAX && nAmount > 0)) { - pIns->NoteMap[i] = i+1; - bModified = TRUE; + n = CLAMP(n + nAmount, NOTE_MIN, NOTE_MAX); + pIns->NoteMap[i] = (BYTE)n; + bModified = true; } - if (bModified) - { - m_pModDoc->SetModified(); - InvalidateRect(NULL, FALSE); - } } + if (bModified) + { + m_pModDoc->SetModified(); + InvalidateRect(NULL, FALSE); + } } } Modified: trunk/OpenMPT/mptrack/Ctrl_ins.h =================================================================== --- trunk/OpenMPT/mptrack/Ctrl_ins.h 2010-02-20 20:34:40 UTC (rev 502) +++ trunk/OpenMPT/mptrack/Ctrl_ins.h 2010-02-20 21:02:02 UTC (rev 503) @@ -19,6 +19,9 @@ int m_cxFont, m_cyFont; COLORREF colorText, colorTextSel; +private: + void MapTranspose(int nAmount); + public: CNoteMapWnd() { m_nPlayingNote=-1; m_nNote = 5*12; m_pModDoc = NULL; m_nInstrument = 0; m_bIns = FALSE; m_cxFont = m_cyFont = 0; m_hFont = NULL; m_nOldNote = m_nOldIns = 0; m_pParent = NULL; } BOOL SetCurrentInstrument(CModDoc *pModDoc, UINT nIns); @@ -47,6 +50,8 @@ afx_msg void OnPaint(); afx_msg void OnMapCopySample(); afx_msg void OnMapCopyNote(); + afx_msg void OnMapTransposeUp(); + afx_msg void OnMapTransposeDown(); afx_msg void OnMapReset(); afx_msg void OnEditSample(UINT nID); afx_msg void OnEditSampleMap(); Modified: trunk/OpenMPT/mptrack/resource.h =================================================================== --- trunk/OpenMPT/mptrack/resource.h 2010-02-20 20:34:40 UTC (rev 502) +++ trunk/OpenMPT/mptrack/resource.h 2010-02-20 21:02:02 UTC (rev 503) @@ -1200,6 +1200,8 @@ #define ID_SAMPLE_GENERATOR_MENU 60244 #define ID_SAMPLE_GENERATOR_PRESET_MENU 60344 #define ID_SAMPLE_GENERATE 60445 +#define ID_NOTEMAP_TRANS_UP 60446 +#define ID_NOTEMAP_TRANS_DOWN 60447 // Next default values for new objects // @@ -1207,7 +1209,7 @@ #ifndef APSTUDIO_READONLY_SYMBOLS #define _APS_3D_CONTROLS 1 #define _APS_NEXT_RESOURCE_VALUE 526 -#define _APS_NEXT_COMMAND_VALUE 60446 +#define _APS_NEXT_COMMAND_VALUE 60448 #define _APS_NEXT_CONTROL_VALUE 2427 #define _APS_NEXT_SYMED_VALUE 901 #endif Modified: trunk/OpenMPT/soundlib/modcommand.h =================================================================== --- trunk/OpenMPT/soundlib/modcommand.h 2010-02-20 20:34:40 UTC (rev 502) +++ trunk/OpenMPT/soundlib/modcommand.h 2010-02-20 21:02:02 UTC (rev 503) @@ -10,6 +10,7 @@ #define NOTE_FADE 0xFD //253, IT's action for illegal notes - DO NOT SAVE AS 253 as this is IT's internal representation of "no note"! #define NOTE_PC 0xFC //252, Param Control 'note'. Changes param value on first tick. #define NOTE_PCS 0xFB //251, Param Control(Smooth) 'note'. Changes param value during the whole row. +#define NOTE_MIN 1 #define NOTE_MAX 120 //Defines maximum notevalue(with index starting from 1) as well as maximum number of notes. #define NOTE_MAX_SPECIAL NOTE_KEYOFF #define NOTE_MIN_SPECIAL NOTE_PCS This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <sag...@us...> - 2010-02-21 12:35:42
|
Revision: 505 http://modplug.svn.sourceforge.net/modplug/?rev=505&view=rev Author: saga-games Date: 2010-02-21 12:35:33 +0000 (Sun, 21 Feb 2010) Log Message: ----------- [Fix] Treeview: Right-Click on module -> Close didn't ask for confirmation when the document was modified. [Ref] XM Loader: Rewrote some lines of the instrument loader so they wouldn't confuse the "MPT hack detector". Modified Paths: -------------- trunk/OpenMPT/mptrack/View_tre.cpp trunk/OpenMPT/soundlib/Load_xm.cpp Modified: trunk/OpenMPT/mptrack/View_tre.cpp =================================================================== --- trunk/OpenMPT/mptrack/View_tre.cpp 2010-02-20 23:13:54 UTC (rev 504) +++ trunk/OpenMPT/mptrack/View_tre.cpp 2010-02-21 12:35:33 UTC (rev 505) @@ -845,14 +845,14 @@ // Add Patterns if ((pInfo->hPatterns) && (hintFlagPart != HINT_INSNAMES) && (hintFlagPart != HINT_SMPNAMES)) { - const DWORD nPat = (lHint >> HINT_SHIFT_PAT); + const PATTERNINDEX nPat = (PATTERNINDEX)(lHint >> HINT_SHIFT_PAT); pInfo->tiPatterns.resize(pSndFile->Patterns.Size(), NULL); - UINT imin = 0, imax = pSndFile->Patterns.Size()-1; + PATTERNINDEX imin = 0, imax = pSndFile->Patterns.Size()-1; if ((hintFlagPart == HINT_PATNAMES) && (nPat < pSndFile->Patterns.Size())) imin = imax = nPat; BOOL bDelPat = FALSE; ASSERT(pInfo->tiPatterns.size() == pSndFile->Patterns.Size()); - for (UINT iPat=imin; iPat <= imax; iPat++) + for(PATTERNINDEX iPat = imin; iPat <= imax; iPat++) { if ((bDelPat) && (pInfo->tiPatterns[iPat])) { @@ -3222,5 +3222,9 @@ HTREEITEM hItem = GetSelectedItem(); CModDoc *pModDoc = GetDocumentFromItem(hItem); if(pModDoc == nullptr) return; - pModDoc->OnCloseDocument(); + // Spam our message to the first available view + POSITION pos = pModDoc->GetFirstViewPosition(); + if(pos == NULL) return; + CView* pView = pModDoc->GetNextView(pos); + if (pView) pView->PostMessage(WM_COMMAND, ID_FILE_CLOSE); } Modified: trunk/OpenMPT/soundlib/Load_xm.cpp =================================================================== --- trunk/OpenMPT/soundlib/Load_xm.cpp 2010-02-20 23:13:54 UTC (rev 504) +++ trunk/OpenMPT/soundlib/Load_xm.cpp 2010-02-21 12:35:33 UTC (rev 505) @@ -317,11 +317,8 @@ pih = (XMINSTRUMENTHEADER *)(lpStream + dwMemPos); if (dwMemPos + LittleEndian(pih->size) > dwMemLength) return true; - if ((Instruments[iIns] = new MODINSTRUMENT) == NULL) continue; - memset(Instruments[iIns], 0, sizeof(MODINSTRUMENT)); - Instruments[iIns]->pTuning = m_defaultInstrument.pTuning; - Instruments[iIns]->nPluginVelocityHandling = PLUGIN_VELOCITYHANDLING_CHANNEL; - Instruments[iIns]->nPluginVolumeHandling = PLUGIN_VOLUMEHANDLING_IGNORE; + if ((Instruments[iIns] = new MODINSTRUMENT) == nullptr) continue; + memcpy(Instruments[iIns], &m_defaultInstrument, sizeof(MODINSTRUMENT)); memcpy(Instruments[iIns]->name, pih->name, 22); SpaceToNullStringFixed(Instruments[iIns]->name, 22); @@ -392,7 +389,7 @@ n--; } #ifndef FASTSOUNDLIB - // Damn! more than 200 samples: look for duplicates + // Damn! Too many samples: look for duplicates if (!n) { if (!unused_samples) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <sag...@us...> - 2010-02-24 23:10:37
|
Revision: 511 http://modplug.svn.sourceforge.net/modplug/?rev=511&view=rev Author: saga-games Date: 2010-02-24 22:23:05 +0000 (Wed, 24 Feb 2010) Log Message: ----------- [Fix] Song Length Detection: *Much* more accurate song length detection! The new algorithm is explained in the code. Got rid of those evil GOTOs, wohoo! [Fix] MPTHacks.cpp: Some IT Sxx effects (f.e. SBx) were erroneously recognized as MPT hacks. [Fix] Mod Specs: Fixed the XM specs a bit so that they don't interfere with MPTHacks.cpp Modified Paths: -------------- trunk/OpenMPT/mptrack/MPTHacks.cpp trunk/OpenMPT/soundlib/Snd_fx.cpp trunk/OpenMPT/soundlib/mod_specifications.h Modified: trunk/OpenMPT/mptrack/MPTHacks.cpp =================================================================== --- trunk/OpenMPT/mptrack/MPTHacks.cpp 2010-02-24 17:05:58 UTC (rev 510) +++ trunk/OpenMPT/mptrack/MPTHacks.cpp 2010-02-24 22:23:05 UTC (rev 511) @@ -68,7 +68,7 @@ } } else if(type == MOD_TYPE_IT) // modplug IT extensions { - if(m.command == CMD_S3MCMDEX && (m.param & 0x90) != 0 && m.param != 0x91) + if((m.command == CMD_S3MCMDEX) && ((m.param >> 4) == 0x09) && (m.param != 0x91)) { *foundHacks = true; if(autofix) Modified: trunk/OpenMPT/soundlib/Snd_fx.cpp =================================================================== --- trunk/OpenMPT/soundlib/Snd_fx.cpp 2010-02-24 17:05:58 UTC (rev 510) +++ trunk/OpenMPT/soundlib/Snd_fx.cpp 2010-02-24 22:23:05 UTC (rev 511) @@ -114,6 +114,32 @@ nPattern = Order[0]; nRow = nNextRow = 0; + /* Now, some fun code begins: This will determine if a specific row in a pattern (orderlist item) + has been visited before. This way, we can tell when the module starts to loop, i.e. when we have determined + the song length (or found out that a given point of the module cannot be reached). + The concept is actually very simple: Store a boolean value for every row for every possible orderlist item. + To save some memory, I have decided to actually store 8 row flags in one uint8 item, to save some + space. + As the modplug engine already deals with pattern loops sufficiently, there's no problem with (infinite) loops + in this code. However, if you're going to use this idea somewhere else, bare in mind that rows inside pattern loops + should only be evaluated once, or else the algorithm will cancel! + */ + vector<vector<uint8> > visited_rows; + visited_rows.resize(Order.GetLengthTailTrimmed()); + for(ORDERINDEX nOrd = 0; nOrd < Order.GetLengthTailTrimmed(); nOrd++) + { + PATTERNINDEX nPat = Order[nOrd]; + ROWINDEX nSize = 0; + if(Patterns.IsValidPat(nPat)) + nSize = Patterns[nPat].GetNumRows(); + // as we need one vector unit per 8 rows, we will probably have to add some non-existing rows + // (f.e. if a pattern has 7 rows, we actually need another row so it's 8 rows = 1 byte - got it? ;) + if(nSize & 7) + nSize += 8; + nSize >>= 3; + visited_rows[nOrd].resize(nSize, 0); + } + for (;;) { UINT nSpeedCount = 0; @@ -121,7 +147,7 @@ nCurrentPattern = nNextPattern; if(nCurrentPattern >= Order.size()) - goto EndMod; + break; // Check if pattern is valid nPattern = Order[nCurrentPattern]; @@ -133,26 +159,42 @@ // End of song ? if ((nPattern == Order.GetInvalidPatIndex()) || (nCurrentPattern >= Order.size())) { - goto EndMod; + nCurrentPattern = m_nRestartPos; } else { nCurrentPattern++; - nPattern = (nCurrentPattern < Order.size()) ? Order[nCurrentPattern] : Order.GetInvalidPatIndex(); } + nPattern = (nCurrentPattern < Order.size()) ? Order[nCurrentPattern] : Order.GetInvalidPatIndex(); nNextPattern = nCurrentPattern; } - // Weird stuff? - if ((nPattern >= Patterns.Size()) || (!Patterns[nPattern])) break; + // Skip non-existing patterns + if ((nPattern >= Patterns.Size()) || (!Patterns[nPattern])) + { + nNextPattern = nCurrentPattern + 1; + continue; + } // Should never happen - if (nRow >= PatternSize[nPattern]) nRow = 0; + if (nRow >= PatternSize[nPattern]) + nRow = 0; //Check whether target reached. if(nCurrentPattern == endOrder && nRow == endRow) { targetReached = true; - goto EndMod; + break; } + // Detect backward loop (or more general: if this row has been visited before) + size_t row_slot = nRow >> 3; + uint8 row_value = 1 << (nRow & 7); + // This should always be true - but who knows what different parts of the program could modify the patterns and orders while this test is running? + if(nCurrentPattern < visited_rows.size() && row_slot < visited_rows[nCurrentPattern].size()) + { + if((visited_rows[nCurrentPattern][row_slot] & row_value) != 0) + break; // we visited this row already + visited_rows[nCurrentPattern][row_slot] |= row_value; + } + // Update next position nNextRow = nRow + 1; @@ -163,7 +205,8 @@ } if (!nRow) { - for (UINT ipck=0; ipck<m_nChannels; ipck++) patloop[ipck] = dwElapsedTime; + for(UINT ipck = 0; ipck < m_nChannels; ipck++) + patloop[ipck] = dwElapsedTime; } if (!bTotal) { @@ -177,6 +220,7 @@ break; } } + MODCHANNEL *pChn = Chn; MODCOMMAND *p = Patterns[nPattern] + nRow * m_nChannels; MODCOMMAND *nextRow = NULL; @@ -208,7 +252,7 @@ case CMD_PATTERNBREAK: patternBreakOnThisRow=true; //Try to check next row for XPARAM - nextRow = NULL; + nextRow = nullptr; if (nRow < PatternSize[nPattern]-1) { nextRow = Patterns[nPattern] + (nRow+1) * m_nChannels + nChn; } @@ -388,13 +432,8 @@ case tempo_mode_classic: default: dwElapsedTime += (2500.0 * (double)nSpeedCount) / (double)nMusicTempo; } - //Detect backwards loop - if (nNextPattern<nCurrentPattern - || (nNextPattern==nCurrentPattern && nNextRow<=nRow)) { - goto EndMod; - } } -EndMod: + if ((bAdjust) && (!bTotal)) { m_nGlobalVolume = nGlbVol; @@ -2597,7 +2636,7 @@ case 0x10: pChn->dwFlags &= ~CHN_GLISSANDO; if (param) pChn->dwFlags |= CHN_GLISSANDO; break; // S2x: Set FineTune case 0x20: if(!(m_dwSongFlags & SONG_FIRSTTICK)) break; - pChn->nC5Speed = S3MFineTuneTable[param & 0x0F]; + pChn->nC5Speed = S3MFineTuneTable[param]; pChn->nFineTune = MOD2XMFineTune(param); if (pChn->nPeriod) pChn->nPeriod = GetPeriodFromNote(pChn->nNote, pChn->nFineTune, pChn->nC5Speed); break; @@ -2702,7 +2741,7 @@ } break; // S9x: Sound Control - case 0x90: ExtendedChannelEffect(pChn, param & 0x0F); break; + case 0x90: ExtendedChannelEffect(pChn, param); break; // SAx: Set 64k Offset case 0xA0: if(m_dwSongFlags & SONG_FIRSTTICK) { Modified: trunk/OpenMPT/soundlib/mod_specifications.h =================================================================== --- trunk/OpenMPT/soundlib/mod_specifications.h 2010-02-24 17:05:58 UTC (rev 510) +++ trunk/OpenMPT/soundlib/mod_specifications.h 2010-02-24 22:23:05 UTC (rev 511) @@ -191,7 +191,7 @@ 0, //Max sample filename length 22, //Max instrument name length 0, //Max instrument filename length - 31, //SamplesMax (actually 16 per instrument) + 128 * 16, //SamplesMax (actually 16 per instrument) 128, //instrumentMax mixLevels_original, //defaultMixLevels 0, //Max MIDI mapping directives @@ -228,7 +228,7 @@ 0, //Max sample filename length 22, //Max instrument name length 0, //Max instrument filename length - 4000, //SamplesMax + 256 * 16, //SamplesMax (actually 16 per instrument) 256, //instrumentMax mixLevels_117RC3, //defaultMixLevels 200, //Max MIDI mapping directives This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <sag...@us...> - 2010-02-25 08:09:12
|
Revision: 512 http://modplug.svn.sourceforge.net/modplug/?rev=512&view=rev Author: saga-games Date: 2010-02-25 08:09:05 +0000 (Thu, 25 Feb 2010) Log Message: ----------- [Imp] Installer: With the new version of InnoSetup, a "real" portable setup can now finally be created. [Ref] More verbose description of the new song length detection code Modified Paths: -------------- trunk/OpenMPT/installer/install.iss trunk/OpenMPT/soundlib/Snd_fx.cpp Modified: trunk/OpenMPT/installer/install.iss =================================================================== --- trunk/OpenMPT/installer/install.iss 2010-02-24 22:23:05 UTC (rev 511) +++ trunk/OpenMPT/installer/install.iss 2010-02-25 08:09:05 UTC (rev 512) @@ -21,14 +21,14 @@ SolidCompression=yes WizardImageFile=install-big.bmp WizardSmallImageFile=install-small.bmp +CreateUninstallRegKey=not IsTaskSelected('portable') ;LicenseFile=license.txt -;CreateUninstallRegKey=no [Tasks] ; icons and install mode Name: "desktopicon"; Description: "{cm:CreateDesktopIcon}"; GroupDescription: "{cm:AdditionalIcons}"; Name: "quicklaunchicon"; Description: "{cm:CreateQuickLaunchIcon}"; GroupDescription: "{cm:AdditionalIcons}"; Flags: unchecked -Name: "portable"; Description: "Use program directory to store configuration in"; GroupDescription: "Options:"; Flags: unchecked +Name: "portable"; Description: "Portable mode (use program folder for storing settings, no registry changes)"; GroupDescription: "Options:"; Flags: unchecked Name: "vst_scan"; Description: "Scan for previously installed VST plugins"; GroupDescription: "Options:"; Flags: unchecked ; file associations - put this below all other [tasks]! #include "filetypes.iss" @@ -141,3 +141,4 @@ end; #include "vst_scan.iss" + Modified: trunk/OpenMPT/soundlib/Snd_fx.cpp =================================================================== --- trunk/OpenMPT/soundlib/Snd_fx.cpp 2010-02-24 22:23:05 UTC (rev 511) +++ trunk/OpenMPT/soundlib/Snd_fx.cpp 2010-02-25 08:09:05 UTC (rev 512) @@ -119,10 +119,10 @@ the song length (or found out that a given point of the module cannot be reached). The concept is actually very simple: Store a boolean value for every row for every possible orderlist item. To save some memory, I have decided to actually store 8 row flags in one uint8 item, to save some - space. - As the modplug engine already deals with pattern loops sufficiently, there's no problem with (infinite) loops + space. Hence, there's some funky bit-shifting here and there. + As the modplug engine already deals with pattern loops sufficiently, there's no problem with (infinite) pattern loops in this code. However, if you're going to use this idea somewhere else, bare in mind that rows inside pattern loops - should only be evaluated once, or else the algorithm will cancel! + should only be evaluated once, or else the algorithm will cancel too early! */ vector<vector<uint8> > visited_rows; visited_rows.resize(Order.GetLengthTailTrimmed()); @@ -136,7 +136,7 @@ // (f.e. if a pattern has 7 rows, we actually need another row so it's 8 rows = 1 byte - got it? ;) if(nSize & 7) nSize += 8; - nSize >>= 3; + nSize >>= 3; // 2^3 elements per vector unit! visited_rows[nOrd].resize(nSize, 0); } @@ -186,13 +186,13 @@ // Detect backward loop (or more general: if this row has been visited before) size_t row_slot = nRow >> 3; - uint8 row_value = 1 << (nRow & 7); + uint8 row_mask = 1 << (nRow & 7); // This should always be true - but who knows what different parts of the program could modify the patterns and orders while this test is running? if(nCurrentPattern < visited_rows.size() && row_slot < visited_rows[nCurrentPattern].size()) { - if((visited_rows[nCurrentPattern][row_slot] & row_value) != 0) - break; // we visited this row already - visited_rows[nCurrentPattern][row_slot] |= row_value; + if((visited_rows[nCurrentPattern][row_slot] & row_mask) != 0) + break; // we visited this row already - this module must be looping. + visited_rows[nCurrentPattern][row_slot] |= row_mask; } // Update next position This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <sag...@us...> - 2010-02-28 18:23:31
|
Revision: 513 http://modplug.svn.sourceforge.net/modplug/?rev=513&view=rev Author: saga-games Date: 2010-02-28 18:23:21 +0000 (Sun, 28 Feb 2010) Log Message: ----------- [New] VST/Instrument handling: The IT instrument note mapping is now also applied to VST instruments (before, it was just available for samples). This way, VST instruments can be transposed easily. [Ref] Small portions of refactoring. Modified Paths: -------------- trunk/OpenMPT/mptrack/Moddoc.cpp trunk/OpenMPT/soundlib/Snd_fx.cpp trunk/OpenMPT/soundlib/Sndmix.cpp Modified: trunk/OpenMPT/mptrack/Moddoc.cpp =================================================================== --- trunk/OpenMPT/mptrack/Moddoc.cpp 2010-02-25 08:09:05 UTC (rev 512) +++ trunk/OpenMPT/mptrack/Moddoc.cpp 2010-02-28 18:23:21 UTC (rev 513) @@ -355,6 +355,7 @@ m_SndFile.ChangeModTypeTo(MOD_TYPE_S3M); break; case MOD_TYPE_PSM: + case MOD_TYPE_ULT: default: m_SndFile.ChangeModTypeTo(MOD_TYPE_IT); } @@ -793,7 +794,7 @@ if ((!pMainFrm) || (!note)) return FALSE; if (nVol > 256) nVol = 256; - if (note < 128) + if (note <= NOTE_MAX) { BEGIN_CRITICAL(); @@ -923,7 +924,7 @@ if ((nPlugin) && (nPlugin <= MAX_MIXPLUGINS)) { IMixPlugin *pPlugin = m_SndFile.m_MixPlugins[nPlugin-1].pMixPlugin; - if (pPlugin) pPlugin->MidiCommand(pIns->nMidiChannel, pIns->nMidiProgram, pIns->wMidiBank, note, pChn->nVolume, MAX_BASECHANNELS); + if (pPlugin) pPlugin->MidiCommand(pIns->nMidiChannel, pIns->nMidiProgram, pIns->wMidiBank, pIns->NoteMap[note - 1], pChn->nVolume, MAX_BASECHANNELS); //if (pPlugin) pPlugin->MidiCommand(pIns->nMidiChannel, pIns->nMidiProgram, pIns->wMidiBank, note, pChn->GetVSTVolume(), MAX_BASECHANNELS); } } @@ -950,13 +951,13 @@ BOOL CModDoc::NoteOff(UINT note, BOOL bFade, UINT nins, UINT nCurrentChn) //rewbs.vstiLive: added chan and nins -//-------------------------------------------------------------------------- +//----------------------------------------------------------------------- { BEGIN_CRITICAL(); - //rewbs.vstiLive - if (nins>0 && nins<=m_SndFile.m_nInstruments) { + if((nins > 0) && (nins <= m_SndFile.m_nInstruments) && (note >= NOTE_MIN) && (note <= NOTE_MAX)) + { MODINSTRUMENT *pIns = m_SndFile.Instruments[nins]; if (pIns && pIns->nMidiChannel > 0 && pIns->nMidiChannel < 17) // instro sends to a midi chan @@ -970,7 +971,7 @@ if ((nPlugin) && (nPlugin <= MAX_MIXPLUGINS)) { IMixPlugin *pPlugin = m_SndFile.m_MixPlugins[nPlugin-1].pMixPlugin; - if (pPlugin) pPlugin->MidiCommand(pIns->nMidiChannel, pIns->nMidiProgram, pIns->wMidiBank, note+NOTE_KEYOFF, 0, MAX_BASECHANNELS); + if (pPlugin) pPlugin->MidiCommand(pIns->nMidiChannel, pIns->nMidiProgram, pIns->wMidiBank, pIns->NoteMap[note - 1] + NOTE_KEYOFF, 0, MAX_BASECHANNELS); } } @@ -1942,19 +1943,7 @@ m_SndFile.m_nMusicTempo, m_SndFile.m_nMusicSpeed, m_SndFile.m_nRowsPerBeat, bpm); break; } -/* - if (CMainFrame::m_dwPatternSetup & PATTERN_MODERNSPEED) { - Message.Format("Using modern speed interpretation.\n\nAssuming:\n. %d ticks per second\n. %d ticks per row\n. %d rows per beat\nthe tempo is approximately: %.20g BPM", - m_SndFile.m_nMusicTempo, m_SndFile.m_nMusicSpeed, CMainFrame::m_nRowSpacing2, bpm); - } - else if (CMainFrame::m_dwPatternSetup & PATTERN_ALTERNTIVEBPMSPEED) { - Message.Format("Using alternative tempo interpretation.\n\nAssuming:\n. %d ticks per second\n. %d ticks per row\n. %d rows per beat\nthe tempo is approximately: %.20g BPM", - m_SndFile.m_nMusicTempo, m_SndFile.m_nMusicSpeed, CMainFrame::m_nRowSpacing2, bpm); - } else { - Message.Format("Using standard tempo interpretation.\n\nAssuming:\n. A mod tempo (tick duration factor) of %d\n. %d ticks per row\n. %d rows per beat\nthe tempo is approximately: %.20g BPM", - m_SndFile.m_nMusicTempo, m_SndFile.m_nMusicSpeed, CMainFrame::m_nRowSpacing2, bpm); - } - */ + CMainFrame::GetMainFrame()->MessageBox(Message, NULL, MB_OK|MB_ICONINFORMATION); } @@ -2667,7 +2656,7 @@ case 0x30: // vibrato waveform case 0x40: // tremolo waveform case 0x50: // panbrello waveform - if(((param & 0x0F) > 0x03) && m_SndFile.IsCompatibleMode(TRK_IMPULSETRACKER | TRK_SCREAMTRACKER)) + if(((param & 0x0F) > 0x03) && m_SndFile.IsCompatibleMode(TRK_IMPULSETRACKER)) { strcpy(s, "ignore"); break; Modified: trunk/OpenMPT/soundlib/Snd_fx.cpp =================================================================== --- trunk/OpenMPT/soundlib/Snd_fx.cpp 2010-02-25 08:09:05 UTC (rev 512) +++ trunk/OpenMPT/soundlib/Snd_fx.cpp 2010-02-28 18:23:21 UTC (rev 513) @@ -453,18 +453,6 @@ return dwElapsedTime / 1000.0; - /* -// -> CODE#0022 -// -> DESC="alternative BPM/Speed interpretation method" -// return (UINT)((dwElapsedTime+500.0) / 1000.0); -// if(CMainFrame::m_dwPatternSetup & PATTERN_ALTERNTIVEBPMSPEED) { - if (m_nTempoMode == tempo_mode_alternative) { - return (UINT)((dwElapsedTime + 1000.0) / 1000.0); - } else { - return (UINT)((dwElapsedTime + 500.0) / 1000.0); - } -// -! NEW_FEATURE#0022 - */ } @@ -485,7 +473,7 @@ if ((pIns) && (note) && (note <= 128)) { - if (pIns->NoteMap[note-1] >= 0xFE) return; + if (pIns->NoteMap[note-1] >= NOTE_MIN_SPECIAL) return; UINT n = pIns->Keyboard[note-1]; pSmp = ((n) && (n < MAX_SAMPLES)) ? &Samples[n] : NULL; } else @@ -1050,7 +1038,7 @@ //switch off duplicated note played on this plugin IMixPlugin *pPlugin = m_MixPlugins[pHeader->nMixPlug-1].pMixPlugin; if (pPlugin && p->nNote) - pPlugin->MidiCommand(p->pModInstrument->nMidiChannel, p->pModInstrument->nMidiProgram, p->pModInstrument->wMidiBank, p->nNote+NOTE_KEYOFF, 0, i); + pPlugin->MidiCommand(p->pModInstrument->nMidiChannel, p->pModInstrument->nMidiProgram, p->pModInstrument->wMidiBank, p->nNote + NOTE_KEYOFF, 0, i); break; } } @@ -1264,7 +1252,7 @@ if(IsCompatibleMode(TRK_IMPULSETRACKER)) nStartTick = 1; //ST3 ignores notes with SD0 completely - else if(GetType() & MOD_TYPE_S3M) + else if(GetType() == MOD_TYPE_S3M) nStartTick = m_nMusicSpeed; } @@ -2249,7 +2237,8 @@ //---------------------------------------------------------------- { BYTE x, y; - if (m_dwSongFlags & SONG_FIRSTTICK) { + if (m_dwSongFlags & SONG_FIRSTTICK) + { x = param & 0xf0; if (x) pChn->nNoteSlideSpeed = (x >> 4); @@ -2257,13 +2246,15 @@ if (y) pChn->nNoteSlideStep = y; pChn->nNoteSlideCounter = pChn->nNoteSlideSpeed; - } else { - if (--pChn->nNoteSlideCounter == 0) { - pChn->nNoteSlideCounter = pChn->nNoteSlideSpeed; - // update it - pChn->nPeriod = GetPeriodFromNote - (sign * pChn->nNoteSlideStep + GetNoteFromPeriod(pChn->nPeriod), 8363, 0); - } + } else + { + if (--pChn->nNoteSlideCounter == 0) + { + pChn->nNoteSlideCounter = pChn->nNoteSlideSpeed; + // update it + pChn->nPeriod = GetPeriodFromNote + (sign * pChn->nNoteSlideStep + GetNoteFromPeriod(pChn->nPeriod), 8363, 0); + } } } @@ -2289,7 +2280,7 @@ if(param) pChn->nPortamentoSlide = param; else - if(pChn->nPortamentoSlide == NULL) + if(pChn->nPortamentoSlide == 0) return; @@ -3422,7 +3413,7 @@ if(IsCompatibleMode(TRK_IMPULSETRACKER)) nTick = 1; // ST3 doesn't cut notes with SC0 - else if(m_nType & MOD_TYPE_S3M) + else if(m_nType == MOD_TYPE_S3M) return; } @@ -3961,7 +3952,7 @@ void CSoundFile::PortamentoMPT(MODCHANNEL* pChn, int param) -//---------------------------------------------------------------- +//--------------------------------------------------------- { //Behavior: Modifies portamento by param-steps on every tick. //Note that step meaning depends on tuning. @@ -3972,7 +3963,7 @@ void CSoundFile::PortamentoFineMPT(MODCHANNEL* pChn, int param) -//------------------------------------------------------------------- +//------------------------------------------------------------- { //Behavior: Divides portamento change between ticks/row. For example //if Ticks/row == 6, and param == +-6, portamento goes up/down by one tuning-dependent Modified: trunk/OpenMPT/soundlib/Sndmix.cpp =================================================================== --- trunk/OpenMPT/soundlib/Sndmix.cpp 2010-02-25 08:09:05 UTC (rev 512) +++ trunk/OpenMPT/soundlib/Sndmix.cpp 2010-02-28 18:23:21 UTC (rev 513) @@ -665,12 +665,14 @@ } } +#ifdef MODPLUG_TRACKER if(CMainFrame::GetMainFrame()) { - // If channel resetting is disabled, we will emulate a pattern break + // If channel resetting is disabled in MPT, we will emulate a pattern break if(!(CMainFrame::GetMainFrame()->m_dwPatternSetup & PATTERN_RESETCHANNELS)) m_dwSongFlags |= SONG_BREAKTOROW; } +#endif if (!nRestartPosOverride && !(m_dwSongFlags & SONG_BREAKTOROW)) { @@ -1983,9 +1985,11 @@ if(GetModFlag(MSF_MIDICC_BUGEMULATION)) { - if (note) { - pPlugin->MidiCommand(pIns->nMidiChannel, pIns->nMidiProgram, pIns->wMidiBank, note, pChn->nVolume, nChn); - } else if (volcmd == VOLCMD_VOLUME) { + if((note >= NOTE_MIN) && (note <= NOTE_MAX)) + { + pPlugin->MidiCommand(pIns->nMidiChannel, pIns->nMidiProgram, pIns->wMidiBank, pIns->NoteMap[note - 1], pChn->nVolume, nChn); + } else if (volcmd == VOLCMD_VOLUME) + { pPlugin->MidiCC(pIns->nMidiChannel, MIDICC_Volume_Fine, vol, nChn); } return; @@ -2007,7 +2011,10 @@ break; } - pPlugin->MidiCommand(pIns->nMidiChannel, pIns->nMidiProgram, pIns->wMidiBank, note, velocity, nChn); + MODCOMMAND::NOTE realNote = note; + if((note >= NOTE_MIN) && (note <= NOTE_MAX)) + realNote = pIns->NoteMap[note - 1]; + pPlugin->MidiCommand(pIns->nMidiChannel, pIns->nMidiProgram, pIns->wMidiBank, realNote, velocity, nChn); } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <sag...@us...> - 2010-03-05 19:41:27
|
Revision: 514 http://modplug.svn.sourceforge.net/modplug/?rev=514&view=rev Author: saga-games Date: 2010-03-05 19:41:15 +0000 (Fri, 05 Mar 2010) Log Message: ----------- [New] Pattern Editor: Extended context menu for PC Notes [Ref] Refactored code to use IsPCNote() where possible. Modified Paths: -------------- trunk/OpenMPT/mptrack/Draw_pat.cpp trunk/OpenMPT/mptrack/Modedit.cpp trunk/OpenMPT/mptrack/PSRatioCalc.cpp trunk/OpenMPT/mptrack/View_pat.cpp trunk/OpenMPT/mptrack/View_pat.h trunk/OpenMPT/mptrack/dlg_misc.h trunk/OpenMPT/soundlib/Load_it.cpp trunk/OpenMPT/soundlib/Sndfile.cpp trunk/OpenMPT/soundlib/pattern.cpp Modified: trunk/OpenMPT/mptrack/Draw_pat.cpp =================================================================== --- trunk/OpenMPT/mptrack/Draw_pat.cpp 2010-02-28 18:23:21 UTC (rev 513) +++ trunk/OpenMPT/mptrack/Draw_pat.cpp 2010-03-05 19:41:15 UTC (rev 514) @@ -401,7 +401,7 @@ { PCPATTERNFONT pfnt = GetCurrentPatternFont(); - if(mc.note == NOTE_PCS || mc.note == NOTE_PC) + if(mc.IsPcNote()) { //If note is parameter control note, drawing volume command differently. const int val = min(MODCOMMAND::maxColumnValue, mc.GetValueVolCol()); @@ -805,7 +805,7 @@ MODCOMMAND *mold = m - ncols; if (m->note == mold->note) dwSpeedUpMask |= 0x01; if ((m->instr == mold->instr) || (m_nDetailLevel < 1)) dwSpeedUpMask |= 0x02; - if ( m->note == NOTE_PCS || m->note == NOTE_PC || mold->note == NOTE_PCS || mold->note == NOTE_PC ) + if ( m->IsPcNote() || mold->IsPcNote() ) { // Handle speedup mask for PC notes. if(m->note == mold->note) { @@ -893,7 +893,7 @@ tx_col = MODCOLOR_TEXTSELECTED; bk_col = MODCOLOR_BACKSELECTED; } else - if (m->note != NOTE_PCS && m->note != NOTE_PC && (m->volcmd) && (CMainFrame::m_dwPatternSetup & PATTERN_EFFECTHILIGHT)) + if ((!m->IsPcNote()) && (m->volcmd) && (CMainFrame::m_dwPatternSetup & PATTERN_EFFECTHILIGHT)) { switch(m->volcmd) { @@ -931,7 +931,7 @@ // Command & param if (m_nDetailLevel > 2) { - const bool isPCnote = (m->note == NOTE_PC || m->note == NOTE_PCS); + const bool isPCnote = m->IsPcNote(); uint16 val = m->GetValueEffectCol(); if(val > MODCOMMAND::maxColumnValue) val = MODCOMMAND::maxColumnValue; fx_col = row_col; @@ -1475,7 +1475,7 @@ if (m->instr) { CHAR sztmp[128] = ""; - if(m->note == NOTE_PC || m->note == NOTE_PCS) + if(m->IsPcNote()) { // display plugin name. if(m->instr <= MAX_MIXPLUGINS) @@ -1523,7 +1523,7 @@ break; case 2: // display volume command - if(m->note == NOTE_PC || m->note == NOTE_PCS) + if(m->IsPcNote()) { // display plugin param name. if(m->instr > 0 && m->instr <= MAX_MIXPLUGINS) @@ -1542,7 +1542,7 @@ case 3: case 4: // display effect command - if(m->note != NOTE_PC && m->note != NOTE_PCS) + if(!m->IsPcNote()) { if (!pModDoc->GetEffectName(s, m->command, m->param, false, nChn)) s[0] = 0; } Modified: trunk/OpenMPT/mptrack/Modedit.cpp =================================================================== --- trunk/OpenMPT/mptrack/Modedit.cpp 2010-02-28 18:23:21 UTC (rev 513) +++ trunk/OpenMPT/mptrack/Modedit.cpp 2010-03-05 19:41:15 UTC (rev 514) @@ -1118,7 +1118,7 @@ ncursor++; if ((ncursor >= colmin) && (ncursor <= colmax)) { - if(m->note == NOTE_PC || m->note == NOTE_PCS) + if(m->IsPcNote()) { const uint16 val = m->GetValueVolCol(); p[6] = GetDigit<2>(val); @@ -1143,7 +1143,7 @@ if (((ncursor >= colmin) && (ncursor <= colmax)) || ((ncursor+1 >= colmin) && (ncursor+1 <= colmax))) { - if(m->note == NOTE_PC || m->note == NOTE_PCS) + if(m->IsPcNote()) { const uint16 val = m->GetValueEffectCol(); p[9] = GetDigit<2>(val); Modified: trunk/OpenMPT/mptrack/PSRatioCalc.cpp =================================================================== --- trunk/OpenMPT/mptrack/PSRatioCalc.cpp 2010-02-28 18:23:21 UTC (rev 513) +++ trunk/OpenMPT/mptrack/PSRatioCalc.cpp 2010-03-05 19:41:15 UTC (rev 514) @@ -151,17 +151,7 @@ rowTime = 2500.0 * (double)m_nSpeed/(double)m_nTempo; break; } -/* - if (CMainFrame::m_dwPatternSetup & PATTERN_MODERNSPEED) { - rowTime = 60000.0/(double)m_nTempo / (double)m_nRowsPerBeat; - } - else if (CMainFrame::m_dwPatternSetup & PATTERN_ALTERNTIVEBPMSPEED) { - rowTime = 60000.0 / (1.65625 * (double)(m_nSpeed * m_nTempo)); - } - else { - rowTime = 2500.0 * (double)m_nSpeed/(double)m_nTempo; - } -*/ + m_dRowsOrig = (double)m_lMsOrig/rowTime; m_dRowsNew = m_dRowsOrig*(m_dRatio/100); Modified: trunk/OpenMPT/mptrack/View_pat.cpp =================================================================== --- trunk/OpenMPT/mptrack/View_pat.cpp 2010-02-28 18:23:21 UTC (rev 513) +++ trunk/OpenMPT/mptrack/View_pat.cpp 2010-03-05 19:41:15 UTC (rev 514) @@ -116,6 +116,7 @@ ON_COMMAND(ID_CHANNEL_RENAME, OnRenameChannel) ON_COMMAND(ID_PATTERN_EDIT_PCNOTE_PLUGIN, OnTogglePCNotePluginEditor) ON_COMMAND_RANGE(ID_CHANGE_INSTRUMENT, ID_CHANGE_INSTRUMENT+MAX_INSTRUMENTS, OnSelectInstrument) + ON_COMMAND_RANGE(ID_CHANGE_PCNOTE_PARAM, ID_CHANGE_PCNOTE_PARAM + MODCOMMAND::maxColumnValue, OnSelectPCNoteParam) ON_UPDATE_COMMAND_UI(ID_EDIT_UNDO, OnUpdateUndo) ON_COMMAND_RANGE(ID_PLUGSELECT, ID_PLUGSELECT+MAX_MIXPLUGINS, OnSelectPlugin) //rewbs.patPlugName @@ -892,7 +893,7 @@ switch(i & 7) { case 0: // Clear note if (rm.note) { - if(m->note == NOTE_PCS || m->note == NOTE_PC) + if(m->IsPcNote()) { // Clear whole row if clearing PC note m->Clear(); invalidateAllCols = true; @@ -918,7 +919,7 @@ case 3: // Clear Command if (rm.command) { m->command = 0; - if(m->note == NOTE_PC || m->note == NOTE_PCS) m->SetValueEffectCol(0); + if(m->IsPcNote()) m->SetValueEffectCol(0); } break; case 4: // Clear Command Param @@ -1226,9 +1227,10 @@ AppendMenu(hMenu, MF_SEPARATOR, 0, ""); if (BuildVisFXCtxMenu(hMenu, ih) | //Use bitwise ORs to avoid shortcuts BuildAmplifyCtxMenu(hMenu, ih) | - BuildSetInstCtxMenu(hMenu, ih, pSndFile) | - BuildPCNoteCtxMenu(hMenu, ih, pSndFile) ) + BuildSetInstCtxMenu(hMenu, ih, pSndFile) ) AppendMenu(hMenu, MF_SEPARATOR, 0, ""); + if (BuildPCNoteCtxMenu(hMenu, ih, pSndFile)) + AppendMenu(hMenu, MF_SEPARATOR, 0, ""); if (BuildGrowShrinkCtxMenu(hMenu, ih)) AppendMenu(hMenu, MF_SEPARATOR, 0, ""); if(BuildMiscCtxMenu(hMenu, ih)) @@ -1804,7 +1806,7 @@ } // Ignore modcommands with PC/PCS notes when searching from volume or effect column. - if( (m->note == NOTE_PC || m->note == NOTE_PCS) + if( (m->IsPcNote()) && m_dwFindFlags & (PATSEARCH_VOLCMD|PATSEARCH_VOLUME|PATSEARCH_COMMAND|PATSEARCH_PARAM)) { @@ -2153,8 +2155,8 @@ //static void CArrayUtils<UINT>::Merge(CArray<UINT,UINT>& Dest, CArray<UINT,UINT>& Src); -void CViewPattern::Interpolate(UINT type) -//--------------------------------------- +void CViewPattern::Interpolate(PatternColumns type) +//------------------------------------------------- { CModDoc *pModDoc = GetDocument(); if (!pModDoc) @@ -2451,6 +2453,7 @@ if (!nIns) return; if ((pModDoc = GetDocument()) == NULL) return; pSndFile = pModDoc->GetSoundFile(); + if(!pSndFile) return; p = pSndFile->Patterns[m_nPattern]; if (!p) return; BeginWaitCursor(); @@ -2984,7 +2987,7 @@ // MPTM: Use PC Notes // only overwrite existing PC Notes - if(pRow->IsEmpty() || pRow->note == NOTE_PC || pRow->note == NOTE_PCS) + if(pRow->IsEmpty() || pRow->IsPcNote()) { pRow->Set(NOTE_PCS, plugSlot + 1, paramIndex, static_cast<uint16>(pPlug->GetParameter(paramIndex) * MODCOMMAND::maxColumnValue)); InvalidateRow(); @@ -3719,7 +3722,7 @@ MODCOMMAND* p = pSndFile->Patterns[m_nPattern].GetpModCommand(m_nRow, GetChanFromCursor(m_dwCursor)); MODCOMMAND oldcmd = *p; // This is the command we are about to overwrite - if(p->note == NOTE_PC || p->note == NOTE_PCS) + if(p->IsPcNote()) { ENTER_PCNOTE_VALUE(v, ValueVolCol); } @@ -3812,7 +3815,7 @@ PrepareUndo(m_dwBeginSel, m_dwEndSel); - if(p->note == NOTE_PC || p->note == NOTE_PCS) + if(p->IsPcNote()) { ENTER_PCNOTE_VALUE(c, ValueEffectCol); } @@ -3864,7 +3867,7 @@ PrepareUndo(m_dwBeginSel, m_dwEndSel); - if(p->note == NOTE_PC || p->note == NOTE_PCS) + if(p->IsPcNote()) { ENTER_PCNOTE_VALUE(v, ValueEffectCol); } @@ -4504,14 +4507,14 @@ switch(field) { - case 0: if(p->note == NOTE_PC || p->note == NOTE_PCS) p->Clear(); else {p->note = NOTE_NONE; if (ITStyle) p->instr = 0;} break; //Note + case 0: if(p->IsPcNote()) p->Clear(); else {p->note = NOTE_NONE; if (ITStyle) p->instr = 0;} break; //Note case 1: p->instr = 0; break; //instr case 2: p->vol = 0; p->volcmd = 0; break; //Vol case 3: p->command = 0; break; //Effect case 4: p->param = 0; break; //Param default: p->Clear(); //If not specified, delete them all! :) } - if((field == 3 || field == 4) && (p->note == NOTE_PC || p->note == NOTE_PCS)) + if((field == 3 || field == 4) && (p->IsPcNote())) p->SetValueEffectCol(0); if(IsEditingEnabled_bmsg()) @@ -4575,17 +4578,47 @@ UINT o_inst = GetCurrentInstrument(); UINT n_inst = nID-ID_CHANGE_INSTRUMENT; - if (n_inst == 0) { + if (n_inst == 0) + { RowMask sp = {0,1,0,0,0}; // Setup mask to only clear instrument data in OnClearSelection OnClearSelection(false, sp); // Clears instrument selection from pattern - } else { + } else + { SendCtrlMessage(CTRLMSG_SETCURRENTINSTRUMENT, n_inst); OnSetSelInstrument(); SendCtrlMessage(CTRLMSG_SETCURRENTINSTRUMENT, o_inst); //Restoring old instrument. } } +void CViewPattern::OnSelectPCNoteParam(UINT nID) +//---------------------------------------------- +{ + CModDoc *pModDoc = GetDocument(); if (!pModDoc) return; + CSoundFile *pSndFile = pModDoc->GetSoundFile(); if (!pSndFile) return; + UINT paramNdx = nID - ID_CHANGE_PCNOTE_PARAM; + bool bModified = false; + MODCOMMAND *p; + for(ROWINDEX nRow = GetSelectionStartRow(); nRow <= GetSelectionEndRow(); nRow++) + { + for(CHANNELINDEX nChn = GetSelectionStartChan(); nChn <= GetSelectionEndChan(); nChn++) + { + p = pSndFile->Patterns[m_nPattern] + nRow * pSndFile->GetNumChannels() + nChn; + if(p && p->IsPcNote() && (p->GetValueVolCol() != paramNdx)) + { + bModified = true; + p->SetValueVolCol(paramNdx); + } + } + } + if (bModified) + { + pModDoc->SetModified(); + pModDoc->UpdateAllViews(NULL, HINT_PATTERNDATA | (m_nPattern << HINT_SHIFT_PAT), NULL); + } +} + + void CViewPattern::OnSelectPlugin(UINT nID) //----------------------------------------- { @@ -4944,8 +4977,21 @@ CArray<UINT, UINT> validChans; DWORD greyed = (ListChansWhereColSelected(INST_COLUMN, validChans)>0)?FALSE:MF_GRAYED; - if (!greyed || !(CMainFrame::m_dwPatternSetup&PATTERN_OLDCTXMENUSTYLE)) + if (!greyed || !(CMainFrame::m_dwPatternSetup & PATTERN_OLDCTXMENUSTYLE)) { + bool isPcNote = false; + MODCOMMAND *mSelStart = nullptr; + if((pSndFile != nullptr) && (pSndFile->Patterns.IsValidPat(m_nPattern))) + { + mSelStart = pSndFile->Patterns[m_nPattern].GetpModCommand(GetSelectionStartRow(), GetSelectionStartChan()); + if(mSelStart != nullptr && mSelStart->IsPcNote()) + { + isPcNote = true; + } + } + if(isPcNote) + return false; + // Create the new menu and add it to the existing menu. HMENU instrumentChangeMenu = ::CreatePopupMenu(); AppendMenu(hMenu, MF_POPUP|greyed, (UINT)instrumentChangeMenu, "Change Instrument\t" + ih->GetKeyTextFromCommand(kcPatternSetInstrument)); @@ -5004,6 +5050,7 @@ } +// Context menu for Param Control notes bool CViewPattern::BuildPCNoteCtxMenu(HMENU hMenu, CInputHandler* ih, CSoundFile* pSndFile) //----------------------------------------------------------------------------------------- { @@ -5013,10 +5060,46 @@ mSelStart = pSndFile->Patterns[m_nPattern].GetpModCommand(GetSelectionStartRow(), GetSelectionStartChan()); if((mSelStart == nullptr) || (!mSelStart->IsPcNote())) return false; - if(mSelStart->instr < 1 || mSelStart->instr > MAX_MIXPLUGINS) - return false; - AppendMenu(hMenu, MF_STRING, ID_PATTERN_EDIT_PCNOTE_PLUGIN, "Toggle plugin editor\t" + ih->GetKeyTextFromCommand(kcPatternEditPCNotePlugin)); + char s[72]; + + // Create sub menu for "change plugin" + HMENU pluginChangeMenu = ::CreatePopupMenu(); + AppendMenu(hMenu, MF_POPUP, (UINT)pluginChangeMenu, "Change Plugin\t" + ih->GetKeyTextFromCommand(kcPatternSetInstrument)); + for(PLUGINDEX nPlg = 0; nPlg < MAX_MIXPLUGINS; nPlg++) + { + if(pSndFile->m_MixPlugins[nPlg].pMixPlugin != nullptr) + { + wsprintf(s, "%02d: %s", nPlg + 1, pSndFile->m_MixPlugins[nPlg].GetName()); + AppendMenu(pluginChangeMenu, MF_STRING | ((nPlg + 1) == mSelStart->instr) ? MF_CHECKED : 0, ID_CHANGE_INSTRUMENT + nPlg + 1, s); + } + } + + if(mSelStart->instr >= 1 && mSelStart->instr <= MAX_MIXPLUGINS) + { + CVstPlugin *plug = (CVstPlugin *)(pSndFile->m_MixPlugins[mSelStart->instr - 1].pMixPlugin); + + if(plug != nullptr) + { + + // Create sub menu for "change plugin param" + HMENU paramChangeMenu = ::CreatePopupMenu(); + AppendMenu(hMenu, MF_POPUP, (UINT)paramChangeMenu, "Change Plugin Parameter\t"); + + char sname[64]; + uint16 nThisParam = mSelStart->GetValueVolCol(); + UINT nParams = plug->GetNumParameters(); + for (UINT i = 0; i < nParams; i++) + { + plug->GetParamName(i, sname, sizeof(sname)); + wsprintf(s, "%02d: %s", i, sname); + AppendMenu(paramChangeMenu, MF_STRING | (i == nThisParam) ? MF_CHECKED : 0, ID_CHANGE_PCNOTE_PARAM + i, s); + } + } + + AppendMenu(hMenu, MF_STRING, ID_PATTERN_EDIT_PCNOTE_PLUGIN, "Toggle plugin editor\t" + ih->GetKeyTextFromCommand(kcPatternEditPCNotePlugin)); + } + return true; } @@ -5041,7 +5124,7 @@ return max(GetChanFromCursor(m_dwBeginSel), GetChanFromCursor(m_dwEndSel)); } -UINT CViewPattern::ListChansWhereColSelected(UINT colType, CArray<UINT,UINT> &chans) { +UINT CViewPattern::ListChansWhereColSelected(PatternColumns colType, CArray<UINT,UINT> &chans) { //---------------------------------------------------------------------------------- chans.RemoveAll(); UINT startChan = GetSelectionStartChan(); @@ -5071,7 +5154,7 @@ bool CViewPattern::IsInterpolationPossible(UINT startRow, UINT endRow, - UINT chan, UINT colType, CSoundFile* pSndFile) { + UINT chan, PatternColumns colType, CSoundFile* pSndFile) { //--------------------------------------------------------------------------------------- if (startRow == endRow) { return false; @@ -5082,7 +5165,7 @@ const MODCOMMAND endRowMC = *pSndFile->Patterns[m_nPattern].GetpModCommand(endRow, chan); UINT startRowCmd, endRowCmd; - if(colType == EFFECT_COLUMN && (startRowMC.note == NOTE_PC || startRowMC.note == NOTE_PCS || endRowMC.note == NOTE_PC || endRowMC.note == NOTE_PCS)) + if(colType == EFFECT_COLUMN && (startRowMC.IsPcNote() || endRowMC.IsPcNote())) return true; switch (colType) { Modified: trunk/OpenMPT/mptrack/View_pat.h =================================================================== --- trunk/OpenMPT/mptrack/View_pat.h 2010-02-28 18:23:21 UTC (rev 513) +++ trunk/OpenMPT/mptrack/View_pat.h 2010-03-05 19:41:15 UTC (rev 514) @@ -33,7 +33,8 @@ // Row Spacing #define MAX_SPACING 64 -enum { +enum PatternColumns +{ NOTE_COLUMN=0, INST_COLUMN, VOL_COLUMN, @@ -300,6 +301,7 @@ afx_msg LRESULT OnCustomKeyMsg(WPARAM, LPARAM); //rewbs.customKeys afx_msg void OnClearSelectionFromMenu(); afx_msg void OnSelectInstrument(UINT nid); + afx_msg void OnSelectPCNoteParam(UINT nid); afx_msg void OnRunScript(); afx_msg void OnShowTimeAtRow(); afx_msg void OnRenameChannel(); @@ -338,14 +340,14 @@ UINT GetSelectionEndRow(); UINT GetSelectionStartChan(); UINT GetSelectionEndChan(); - UINT ListChansWhereColSelected(UINT colType, CArray<UINT,UINT> &chans); + UINT ListChansWhereColSelected(PatternColumns colType, CArray<UINT,UINT> &chans); static ROWINDEX GetRowFromCursor(DWORD cursor); static CHANNELINDEX GetChanFromCursor(DWORD cursor); static UINT GetColTypeFromCursor(DWORD cursor); - bool IsInterpolationPossible(UINT startRow, UINT endRow, UINT chan, UINT colType, CSoundFile* pSndFile); - void Interpolate(UINT type); + bool IsInterpolationPossible(UINT startRow, UINT endRow, UINT chan, PatternColumns colType, CSoundFile* pSndFile); + void Interpolate(PatternColumns type); // Return true if recording live (i.e. editing while following playback). // rSndFile must be the CSoundFile object of given rModDoc. Modified: trunk/OpenMPT/mptrack/dlg_misc.h =================================================================== --- trunk/OpenMPT/mptrack/dlg_misc.h 2010-02-28 18:23:21 UTC (rev 513) +++ trunk/OpenMPT/mptrack/dlg_misc.h 2010-03-05 19:41:15 UTC (rev 514) @@ -271,7 +271,7 @@ public: CPageEditVolume(CModDoc *pModDoc, CEditCommand *parent):CPageEditCommand(pModDoc, parent, IDD_PAGEEDITVOLUME) {} - void Init(MODCOMMAND &m) { m_nVolCmd = m.volcmd; m_nVolume = m.vol; m_bIsParamControl = (m.note == NOTE_PC || m.note == NOTE_PCS) ? true : false;} + void Init(MODCOMMAND &m) { m_nVolCmd = m.volcmd; m_nVolume = m.vol; m_bIsParamControl = (m.IsPcNote()) ? true : false;} void UpdateDialog(); void UpdateRanges(); @@ -303,7 +303,7 @@ CPageEditEffect(CModDoc *pModDoc, CEditCommand *parent):CPageEditCommand(pModDoc, parent, IDD_PAGEEDITEFFECT) {} // -> CODE#0010 // -> DESC="add extended parameter mechanism to pattern effects" - void Init(MODCOMMAND &m) { m_nCommand = m.command; m_nParam = m.param; m_pModcommand = &m; m_bIsParamControl = (m.note == NOTE_PC || m.note == NOTE_PCS) ? true : false; m_nPlugin = m.instr; m_nPluginParam = MODCOMMAND::GetValueVolCol(m.volcmd, m.vol);} + void Init(MODCOMMAND &m) { m_nCommand = m.command; m_nParam = m.param; m_pModcommand = &m; m_bIsParamControl = (m.IsPcNote()) ? true : false; m_nPlugin = m.instr; m_nPluginParam = MODCOMMAND::GetValueVolCol(m.volcmd, m.vol);} void XInit(UINT xparam = 0, UINT multiplier = 1) { m_nXParam = xparam; m_nMultiplier = multiplier; } // -! NEW_FEATURE#0010 void UpdateDialog(); Modified: trunk/OpenMPT/soundlib/Load_it.cpp =================================================================== --- trunk/OpenMPT/soundlib/Load_it.cpp 2010-02-28 18:23:21 UTC (rev 513) +++ trunk/OpenMPT/soundlib/Load_it.cpp 2010-03-05 19:41:15 UTC (rev 514) @@ -2144,7 +2144,7 @@ for (UINT ch=0; ch<m_nChannels; ch++, m++) { // Skip mptm-specific notes. - if(GetType() == MOD_TYPE_MPT && (m->note == NOTE_PC || m->note == NOTE_PCS)) + if(GetType() == MOD_TYPE_MPT && (m->IsPcNote())) {bNeedsMptPatSave = true; continue;} BYTE b = 0; Modified: trunk/OpenMPT/soundlib/Sndfile.cpp =================================================================== --- trunk/OpenMPT/soundlib/Sndfile.cpp 2010-02-28 18:23:21 UTC (rev 513) +++ trunk/OpenMPT/soundlib/Sndfile.cpp 2010-03-05 19:41:15 UTC (rev 514) @@ -3317,7 +3317,7 @@ // Convert param control, extended envelope control if(oldTypeIsMPT) { - if(m->note == NOTE_PC || m->note == NOTE_PCS) + if(m->IsPcNote()) { m->param = (BYTE)(min(MODCOMMAND::maxColumnValue, m->GetValueEffectCol()) * 0x7F / MODCOMMAND::maxColumnValue); m->command = (m->note == NOTE_PC) ? CMD_MIDI : CMD_SMOOTHMIDI; // might be removed later Modified: trunk/OpenMPT/soundlib/pattern.cpp =================================================================== --- trunk/OpenMPT/soundlib/pattern.cpp 2010-02-28 18:23:21 UTC (rev 513) +++ trunk/OpenMPT/soundlib/pattern.cpp 2010-03-05 19:41:15 UTC (rev 514) @@ -328,7 +328,7 @@ const MODCOMMAND m = *pat.GetpModCommand(r, c); // Writing only commands not writting in IT-pattern writing: // For now this means only NOTE_PC and NOTE_PCS. - if(m.note != NOTE_PCS && m.note != NOTE_PC) + if(!m.IsPcNote()) continue; uint8 diffmask = CreateDiffMask(lastChnMC[c], m); uint8 chval = static_cast<uint8>(c+1); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <sag...@us...> - 2010-03-07 13:37:23
|
Revision: 516 http://modplug.svn.sourceforge.net/modplug/?rev=516&view=rev Author: saga-games Date: 2010-03-07 13:37:12 +0000 (Sun, 07 Mar 2010) Log Message: ----------- [New] Orderlist: "Select All" shortcut also works here now. [Fix] PTM Loader: Fixed an unhandled null pointer exception that occured when loading some unsupported RAR files. [Fix] All loaders: Added another security check to the CSoundFile::Create method because of aforementioned problem. [Fix] Treeview: "Bypass" action for VSTs didn't set the document as modified. Modified Paths: -------------- trunk/OpenMPT/mptrack/Ctrl_seq.cpp trunk/OpenMPT/mptrack/View_tre.cpp trunk/OpenMPT/soundlib/Load_ptm.cpp trunk/OpenMPT/soundlib/Sndfile.cpp Modified: trunk/OpenMPT/mptrack/Ctrl_seq.cpp =================================================================== --- trunk/OpenMPT/mptrack/Ctrl_seq.cpp 2010-03-06 12:41:43 UTC (rev 515) +++ trunk/OpenMPT/mptrack/Ctrl_seq.cpp 2010-03-07 13:37:12 UTC (rev 516) @@ -401,11 +401,14 @@ case kcOrderlistNavigateFirstSelect: case kcOrderlistNavigateFirst: SetCurSelTo2ndSel(wParam == kcOrderlistNavigateFirstSelect); SetCurSel(0); return wParam; + case kcEditSelectAll: + SetCurSel(0); + // fallthroughs intended. case kcOrderlistNavigateLastSelect: case kcOrderlistNavigateLast: if((m_pModDoc != nullptr) && (m_pModDoc->GetSoundFile() != nullptr)) { - SetCurSelTo2ndSel(wParam == kcOrderlistNavigateLastSelect); + SetCurSelTo2ndSel(wParam == kcOrderlistNavigateLastSelect || wParam == kcEditSelectAll); ORDERINDEX nLast = m_pModDoc->GetSoundFile()->Order.GetLengthTailTrimmed(); if(nLast > 0) nLast--; SetCurSel(nLast); Modified: trunk/OpenMPT/mptrack/View_tre.cpp =================================================================== --- trunk/OpenMPT/mptrack/View_tre.cpp 2010-03-06 12:41:43 UTC (rev 515) +++ trunk/OpenMPT/mptrack/View_tre.cpp 2010-03-07 13:37:12 UTC (rev 516) @@ -2768,20 +2768,22 @@ { pModDoc->MuteInstrument((INSTRUMENTINDEX)modItemID, (pModDoc->IsInstrumentMuted((INSTRUMENTINDEX)modItemID)) ? false : true); UpdateView(GetDocumentIDFromModDoc(pModDoc), HINT_INSNAMES | HINT_INSTRUMENT); - } - + } else if ((modItemType == MODITEM_EFFECT)) { - CSoundFile *pSndFile = pModDoc ? pModDoc->GetSoundFile() : NULL; - if (pSndFile) { - PSNDMIXPLUGIN pPlugin = &pSndFile->m_MixPlugins[modItemID]; - if (pPlugin) { - CVstPlugin *pVstPlugin = (CVstPlugin *)pPlugin->pMixPlugin; - if (pVstPlugin) pVstPlugin->Bypass(); - } - } + CSoundFile *pSndFile = pModDoc ? pModDoc->GetSoundFile() : nullptr; + if (pSndFile == nullptr) + return; + PSNDMIXPLUGIN pPlugin = &pSndFile->m_MixPlugins[modItemID]; + if(pPlugin == nullptr) + return; + CVstPlugin *pVstPlugin = (CVstPlugin *)pPlugin->pMixPlugin; + if(pVstPlugin == nullptr) + return; + pVstPlugin->Bypass(); + pModDoc->SetModified(); + //UpdateView(GetDocumentIDFromModDoc(pModDoc), HINT_MIXPLUGINS); } - } } Modified: trunk/OpenMPT/soundlib/Load_ptm.cpp =================================================================== --- trunk/OpenMPT/soundlib/Load_ptm.cpp 2010-03-06 12:41:43 UTC (rev 515) +++ trunk/OpenMPT/soundlib/Load_ptm.cpp 2010-03-07 13:37:12 UTC (rev 516) @@ -65,6 +65,9 @@ bool CSoundFile::ReadPTM(const BYTE *lpStream, DWORD dwMemLength) //--------------------------------------------------------------- { + if(lpStream == nullptr || dwMemLength < sizeof(PTMFILEHEADER)) + return false; + PTMFILEHEADER pfh = *(LPPTMFILEHEADER)lpStream; DWORD dwMemPos; UINT nOrders; @@ -76,12 +79,11 @@ pfh.fileflags = LittleEndianW(pfh.fileflags); pfh.reserved2 = LittleEndianW(pfh.reserved2); pfh.ptmf_id = LittleEndian(pfh.ptmf_id); - for (UINT j=0; j<128; j++) - { - pfh.patseg[j] = LittleEndianW(pfh.patseg[j]); + for (UINT j = 0; j < 128; j++) + { + pfh.patseg[j] = LittleEndianW(pfh.patseg[j]); } - if ((!lpStream) || (dwMemLength < 1024)) return false; if ((pfh.ptmf_id != 0x464d5450) || (!pfh.nchannels) || (pfh.nchannels > 32) || (pfh.norders > 256) || (!pfh.norders) @@ -98,12 +100,12 @@ nOrders = (pfh.norders < MAX_ORDERS) ? pfh.norders : MAX_ORDERS-1; Order.ReadAsByte(pfh.orders, nOrders, nOrders); - for (UINT ipan=0; ipan<m_nChannels; ipan++) + for (CHANNELINDEX ipan = 0; ipan < m_nChannels; ipan++) { ChnSettings[ipan].nVolume = 64; ChnSettings[ipan].nPan = ((pfh.chnpan[ipan] & 0x0F) << 4) + 4; } - for (UINT ismp=0; ismp<m_nSamples; ismp++, dwMemPos += SIZEOF_PTMSAMPLE) + for (SAMPLEINDEX ismp = 0; ismp < m_nSamples; ismp++, dwMemPos += SIZEOF_PTMSAMPLE) { MODSAMPLE *pSmp = &Samples[ismp+1]; PTMSAMPLE *psmp = (PTMSAMPLE *)(lpStream+dwMemPos); Modified: trunk/OpenMPT/soundlib/Sndfile.cpp =================================================================== --- trunk/OpenMPT/soundlib/Sndfile.cpp 2010-03-06 12:41:43 UTC (rev 515) +++ trunk/OpenMPT/soundlib/Sndfile.cpp 2010-03-07 13:37:12 UTC (rev 516) @@ -572,7 +572,7 @@ CZipArchive archive(glpszModExtensions); if (CZipArchive::IsArchive((LPBYTE)lpStream, dwMemLength)) { - if (archive.UnzipArchive((LPBYTE)lpStream, dwMemLength)) + if (archive.UnzipArchive((LPBYTE)lpStream, dwMemLength) && archive.GetOutputFile()) { lpStream = archive.GetOutputFile(); dwMemLength = archive.GetOutputFileLength(); @@ -583,7 +583,7 @@ CRarArchive unrar((LPBYTE)lpStream, dwMemLength, glpszModExtensions); if (unrar.IsArchive()) { - if (unrar.ExtrFile()) + if (unrar.ExtrFile() && unrar.GetOutputFile()) { lpStream = unrar.GetOutputFile(); dwMemLength = unrar.GetOutputFileLength(); @@ -594,7 +594,7 @@ CLhaArchive unlha((LPBYTE)lpStream, dwMemLength, glpszModExtensions); if (unlha.IsArchive()) { - if (unlha.ExtractFile()) + if (unlha.ExtractFile() && unlha.GetOutputFile()) { lpStream = unlha.GetOutputFile(); dwMemLength = unlha.GetOutputFileLength(); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |