From: <sag...@us...> - 2013-04-14 00:32:54
|
Revision: 1873 http://sourceforge.net/p/modplug/code/1873 Author: saga-games Date: 2013-04-14 00:32:41 +0000 (Sun, 14 Apr 2013) Log Message: ----------- [Ref] Mostly small changes, partly to get rid of compiler warnings. Modified Paths: -------------- trunk/OpenMPT/common/StringFixer.h trunk/OpenMPT/mptrack/Autotune.cpp trunk/OpenMPT/mptrack/CommandSet.cpp trunk/OpenMPT/mptrack/CommandSet.h trunk/OpenMPT/mptrack/Ctrl_com.cpp trunk/OpenMPT/mptrack/Ctrl_gen.cpp trunk/OpenMPT/mptrack/Ctrl_pat.cpp trunk/OpenMPT/mptrack/Ctrl_pat.h trunk/OpenMPT/mptrack/Ctrl_seq.cpp trunk/OpenMPT/mptrack/InputHandler.cpp trunk/OpenMPT/mptrack/Moptions.cpp trunk/OpenMPT/mptrack/Mpdlgs.cpp trunk/OpenMPT/mptrack/PatternEditorDialogs.cpp trunk/OpenMPT/mptrack/PatternGotoDialog.cpp trunk/OpenMPT/mptrack/PatternGotoDialog.h trunk/OpenMPT/mptrack/View_pat.cpp trunk/OpenMPT/mptrack/test/test.cpp trunk/OpenMPT/sounddev/SoundDevice.cpp trunk/OpenMPT/soundlib/ITCompression.cpp trunk/OpenMPT/soundlib/Message.cpp trunk/OpenMPT/soundlib/Message.h trunk/OpenMPT/soundlib/ModSequence.cpp trunk/OpenMPT/soundlib/Sndfile.h trunk/OpenMPT/soundlib/plugins/PluginEventQueue.h Modified: trunk/OpenMPT/common/StringFixer.h =================================================================== --- trunk/OpenMPT/common/StringFixer.h 2013-04-13 16:38:15 UTC (rev 1872) +++ trunk/OpenMPT/common/StringFixer.h 2013-04-14 00:32:41 UTC (rev 1873) @@ -226,8 +226,8 @@ // Copy from a char array to a fixed size char array. template <size_t destSize> - void CopyN(char (&destBuffer)[destSize], const char *srcBuffer, const size_t srcSize = SIZE_T_MAX) - //------------------------------------------------------------------------------------------------ + void CopyN(char (&destBuffer)[destSize], const char *srcBuffer, const size_t srcSize = SIZE_MAX) + //---------------------------------------------------------------------------------------------- { const size_t copySize = MIN(destSize - 1, srcSize); strncpy(destBuffer, srcBuffer, copySize); Modified: trunk/OpenMPT/mptrack/Autotune.cpp =================================================================== --- trunk/OpenMPT/mptrack/Autotune.cpp 2013-04-13 16:38:15 UTC (rev 1872) +++ trunk/OpenMPT/mptrack/Autotune.cpp 2013-04-14 00:32:41 UTC (rev 1873) @@ -39,7 +39,7 @@ //--------------------------------------------------------------------------------------- { const double fundamentalFrequency = NoteToFrequency((double)note / BINS_PER_NOTE, pitchReference); - return (SmpLength)MAX(Util::Round((double)sampleFreq / fundamentalFrequency), 1); + return std::max(Util::Round<SmpLength>((double)sampleFreq / fundamentalFrequency), SmpLength(1)); } Modified: trunk/OpenMPT/mptrack/CommandSet.cpp =================================================================== --- trunk/OpenMPT/mptrack/CommandSet.cpp 2013-04-13 16:38:15 UTC (rev 1872) +++ trunk/OpenMPT/mptrack/CommandSet.cpp 2013-04-14 00:32:41 UTC (rev 1873) @@ -44,7 +44,7 @@ enforceRule[krCheckModifiers] = true; enforceRule[krPropagateSampleManipulation] = true; // enforceRule[krCheckContextHierarchy] = true; - + commands.SetSize(kcNumCommands); SetupCommands(); SetupContextHierarchy(); @@ -690,16 +690,16 @@ //--------------------------------------------------------------------------------- { CString report= ""; - + KeyCombination curKc; //Avoid duplicate - for (int k=0; k<commands[cmd].kcList.GetSize(); k++) + for (int k=0; k<commands[cmd].kcList.GetSize(); k++) { curKc=commands[cmd].kcList[k]; if (curKc==kc) { //cm'ed out for perf - //Log("Not adding key:%d; ctx:%d; mod:%d event %d - Duplicate!\n", kc.code, kc.ctx, kc.mod, kc.event); + //Log("Not adding key:%d; ctx:%d; mod:%d event %d - Duplicate!\n", kc.code, kc.ctx, kc.mod, kc.event); return ""; } } @@ -725,7 +725,7 @@ else { if (crossContext) - { + { report += "Warning! the following commands may conflict:\r\n >" + GetCommandText((CommandID)curCmd) + " in " + GetContextText(curKc.ctx) + "\r\n >" + GetCommandText((CommandID)cmd) + " in " + GetContextText(kc.ctx) + "\r\n\r\n"; Log("%s", report); } else @@ -738,7 +738,7 @@ } } } - + if (pos>=0) commands[cmd].kcList.InsertAt(pos, kc); else @@ -753,7 +753,7 @@ bool CCommandSet::IsDummyCommand(CommandID cmd) //--------------------------------------------- { - // e.g. Chord modifier is a dummy command, which serves only to automatically + // e.g. Chord modifier is a dummy command, which serves only to automatically // generate a set of keycombinations for chords (I'm not proud of this design). return commands[cmd].isDummy; } @@ -767,7 +767,7 @@ return Remove(commands[cmd].kcList[pos], cmd); } - Log("Failed to remove a key: keychoice out of range.\n"); + Log("Failed to remove a key: keychoice out of range.\n"); return ""; } @@ -790,7 +790,7 @@ } else { - Log("Failed to remove a key as it was not found\n"); + Log("Failed to remove a key as it was not found\n"); return ""; } @@ -808,7 +808,7 @@ if(enforceRule[krAllowNavigationWithSelection]) { - // When we get a new navigation command key, we need to + // When we get a new navigation command key, we need to // make sure this navigation will work when any selection key is pressed if(inCmd >= kcStartPatNavigation && inCmd <= kcEndPatNavigation) {//Check that it is a nav cmd @@ -824,7 +824,7 @@ Add(newKc, cmdNavSelection, false); } else { - Log("Enforcing rule krAllowNavigationWithSelection - removing key:%d with modifier:%d to command: %d\n", kSel, newKc.mod, cmdNavSelection); + Log("Enforcing rule krAllowNavigationWithSelection - removing key:%d with modifier:%d to command: %d\n", kSel, newKc.mod, cmdNavSelection); Remove(newKc, cmdNavSelection); } } @@ -844,12 +844,12 @@ Add(newKc, cmdNavSelection, false); } else { - Log("Enforcing rule krAllowNavigationWithSelection - removing key:%d with modifier:%d to command: %d\n", kSel, newKc.mod, cmdNavSelection); + Log("Enforcing rule krAllowNavigationWithSelection - removing key:%d with modifier:%d to command: %d\n", kSel, newKc.mod, cmdNavSelection); Remove(newKc, cmdNavSelection); } } } - // When we get a new selection key, we need to make sure that + // When we get a new selection key, we need to make sure that // all navigation commands will work with this selection key pressed else if(inCmd == kcSelect) { @@ -869,7 +869,7 @@ Add(newKc, cmdNavSelection, false); } else { - Log("Enforcing rule krAllowNavigationWithSelection - removing key:%d with modifier:%d to command: %d\n", curCmd, inKc.mod, cmdNavSelection); + Log("Enforcing rule krAllowNavigationWithSelection - removing key:%d with modifier:%d to command: %d\n", curCmd, inKc.mod, cmdNavSelection); Remove(newKc, cmdNavSelection); } } @@ -887,7 +887,7 @@ Add(newKc, cmdNavSelection, false); } else { - Log("Enforcing rule krAllowNavigationWithSelection - removing key:%d with modifier:%d to command: %d\n", curCmd, inKc.mod, cmdNavSelection); + Log("Enforcing rule krAllowNavigationWithSelection - removing key:%d with modifier:%d to command: %d\n", curCmd, inKc.mod, cmdNavSelection); Remove(newKc, cmdNavSelection); } } @@ -898,7 +898,7 @@ if(enforceRule[krAllowSelectionWithNavigation]) { KeyCombination newKcSel; - + // When we get a new navigation command key, we need to ensure // all selection keys will work even when this new selection key is pressed if(inCmd >= kcStartPatNavigation && inCmd <= kcEndPatNavigation) @@ -909,11 +909,11 @@ newKcSel.mod |= inKc.mod; // add modifiers from the new nav command if(adding) { - Log("Enforcing rule krAllowSelectionWithNavigation: adding removing kcSelectWithNav and kcSelectOffWithNav\n"); + Log("Enforcing rule krAllowSelectionWithNavigation: adding removing kcSelectWithNav and kcSelectOffWithNav\n"); Add(newKcSel, kcSelectWithNav, false); } else { - Log("Enforcing rule krAllowSelectionWithNavigation: removing kcSelectWithNav and kcSelectOffWithNav\n"); + Log("Enforcing rule krAllowSelectionWithNavigation: removing kcSelectWithNav and kcSelectOffWithNav\n"); Remove(newKcSel, kcSelectWithNav); } } @@ -927,11 +927,11 @@ newKcSel.mod|=inKc.mod; // add modifiers from the new nav command if(adding) { - Log("Enforcing rule krAllowSelectionWithNavigation: adding removing kcSelectWithNav and kcSelectOffWithNav\n"); + Log("Enforcing rule krAllowSelectionWithNavigation: adding removing kcSelectWithNav and kcSelectOffWithNav\n"); Add(newKcSel, kcSelectWithNav, false); } else { - Log("Enforcing rule krAllowSelectionWithNavigation: removing kcSelectWithNav and kcSelectOffWithNav\n"); + Log("Enforcing rule krAllowSelectionWithNavigation: removing kcSelectWithNav and kcSelectOffWithNav\n"); Remove(newKcSel, kcSelectWithNav); } } @@ -952,7 +952,7 @@ Add(newKcSel, kcSelectWithNav, false); } else { - Log("Enforcing rule krAllowSelectionWithNavigation - removing key:%d with modifier:%d to command: %d\n", curCmd, inKc.mod, kcSelectWithNav); + Log("Enforcing rule krAllowSelectionWithNavigation - removing key:%d with modifier:%d to command: %d\n", curCmd, inKc.mod, kcSelectWithNav); Remove(newKcSel, kcSelectWithNav); } } @@ -970,15 +970,15 @@ Add(newKcSel, kcSelectWithNav, false); } else { - Log("Enforcing rule krAllowSelectionWithNavigation - removing key:%d with modifier:%d to command: %d\n", curCmd, inKc.mod, kcSelectWithNav); + Log("Enforcing rule krAllowSelectionWithNavigation - removing key:%d with modifier:%d to command: %d\n", curCmd, inKc.mod, kcSelectWithNav); Remove(newKcSel, kcSelectWithNav); } } } // end all nav commands - } + } } - + // if we add a selector or a copy selector, we need it to switch off when we release the key. if (enforceRule[krAutoSelectOff]) { @@ -997,7 +997,7 @@ default: ruleApplies = false; } - + if(ruleApplies) { newKcDeSel = inKc; @@ -1016,7 +1016,7 @@ Remove(newKcDeSel, cmdOff); } } - + } // Allow combinations of copyselect and select if(enforceRule[krAllowSelectCopySelectCombos]) @@ -1032,7 +1032,7 @@ newKcSel.mod|=commands[kcCopySelect].kcList[k].mod; newKcCopySel=commands[kcCopySelect].kcList[k]; newKcCopySel.mod|=inKc.mod; - Log("Enforcing rule krAllowSelectCopySelectCombos\n"); + Log("Enforcing rule krAllowSelectCopySelectCombos\n"); if(adding) { Add(newKcSel, kcSelectWithCopySelect, false); @@ -1045,7 +1045,7 @@ } } if(inCmd == kcCopySelect) - { + { // On getting a new copyselection key, make this copyselection key work with all selects' modifiers // On getting a new copyselection key, make all selects work with this key's modifiers for(int k = 0; k < commands[kcSelect].kcList.GetSize(); k++) @@ -1054,7 +1054,7 @@ newKcSel.mod |= inKc.mod; newKcCopySel=inKc; newKcCopySel.mod|=commands[kcSelect].kcList[k].mod; - Log("Enforcing rule krAllowSelectCopySelectCombos\n"); + Log("Enforcing rule krAllowSelectCopySelectCombos\n"); if(adding) { Add(newKcSel, kcSelectWithCopySelect, false); @@ -1068,10 +1068,10 @@ } } - + //# Lock Notes to Chords if (enforceRule[krLockNotesToChords]) - { + { if (inCmd>=kcVPStartNotes && inCmd<=kcVPEndNotes) { int noteOffset = inCmd - kcVPStartNotes; @@ -1081,12 +1081,12 @@ newKc.mod|=commands[kcChordModifier].kcList[k].mod; if (adding) { - Log("Enforcing rule krLockNotesToChords: auto adding in a chord command\n"); + Log("Enforcing rule krLockNotesToChords: auto adding in a chord command\n"); Add(newKc, (CommandID)(kcVPStartChords+noteOffset), false); } else { - Log("Enforcing rule krLockNotesToChords: auto removing a chord command\n"); + Log("Enforcing rule krLockNotesToChords: auto removing a chord command\n"); Remove(newKc, (CommandID)(kcVPStartChords+noteOffset)); } } @@ -1103,12 +1103,12 @@ newKc.mod|=inKc.mod; if (adding) { - Log("Enforcing rule krLockNotesToChords: auto adding in a chord command\n"); + Log("Enforcing rule krLockNotesToChords: auto adding in a chord command\n"); Add(newKc, (CommandID)(kcVPStartChords+noteOffset), false); } else { - Log("Enforcing rule krLockNotesToChords: auto removing a chord command\n"); + Log("Enforcing rule krLockNotesToChords: auto removing a chord command\n"); Remove(newKc, (CommandID)(kcVPStartChords+noteOffset)); } } @@ -1116,7 +1116,7 @@ } } - + //# Auto set note off on release if (enforceRule[krNoteOffOnKeyRelease]) { @@ -1127,12 +1127,12 @@ newKc.event=kKeyEventUp; if (adding) { - Log("Enforcing rule krNoteOffOnKeyRelease: adding note off command\n"); + Log("Enforcing rule krNoteOffOnKeyRelease: adding note off command\n"); Add(newKc, (CommandID)(kcVPStartNoteStops+noteOffset), false); } else { - Log("Enforcing rule krNoteOffOnKeyRelease: removing note off command\n"); + Log("Enforcing rule krNoteOffOnKeyRelease: removing note off command\n"); Remove(newKc, (CommandID)(kcVPStartNoteStops+noteOffset)); } } @@ -1143,12 +1143,12 @@ newKc.event=kKeyEventUp; if (adding) { - Log("Enforcing rule krNoteOffOnKeyRelease: adding Chord off command\n"); + Log("Enforcing rule krNoteOffOnKeyRelease: adding Chord off command\n"); Add(newKc, (CommandID)(kcVPStartChordStops+noteOffset), false); } else { - Log("Enforcing rule krNoteOffOnKeyRelease: removing Chord off command\n"); + Log("Enforcing rule krNoteOffOnKeyRelease: removing Chord off command\n"); Remove(newKc, (CommandID)(kcVPStartChordStops+noteOffset)); } } @@ -1159,23 +1159,23 @@ newKc.event=kKeyEventUp; if (adding) { - Log("Enforcing rule krNoteOffOnKeyRelease: adding Chord off command\n"); + Log("Enforcing rule krNoteOffOnKeyRelease: adding Chord off command\n"); Add(newKc, (CommandID)(kcSetOctaveStop0+noteOffset), false); } else { - Log("Enforcing rule krNoteOffOnKeyRelease: removing Chord off command\n"); + Log("Enforcing rule krNoteOffOnKeyRelease: removing Chord off command\n"); Remove(newKc, (CommandID)(kcSetOctaveStop0+noteOffset)); } } } - + //# Reassign freed number keys to octaves if (enforceRule[krReassignDigitsToOctaves] && !adding) - { + { if ( (inKc.mod == 0) && //no modifier ( (inKc.ctx == kCtxViewPatternsNote) || (inKc.ctx == kCtxViewPatterns) ) && //note scope or pattern scope - ( ('0'<=inKc.code && inKc.code<='9') || (VK_NUMPAD0<=inKc.code && inKc.code<=VK_NUMPAD9) ) ) { //is number key + ( ('0'<=inKc.code && inKc.code<='9') || (VK_NUMPAD0<=inKc.code && inKc.code<=VK_NUMPAD9) ) ) { //is number key newKc.ctx=kCtxViewPatternsNote; newKc.mod=0; newKc.event= kKeyEventDown; @@ -1219,7 +1219,7 @@ Add(newKc, (CommandID)(kcSetSpacing0 + inKc.code - VK_NUMPAD0), false); } } - + } } if (enforceRule[krPropagateNotes]) @@ -1244,7 +1244,7 @@ noteOffset = inCmd - kcVPStartNotes; if (adding) { - Log("Enforcing rule krPropagateNotesToSampAndIns: adding Note on in samp ctx\n"); + Log("Enforcing rule krPropagateNotesToSampAndIns: adding Note on in samp ctx\n"); Add(newKcSamp, (CommandID)(kcSampStartNotes+noteOffset), false); Add(newKcIns, (CommandID)(kcInstrumentStartNotes+noteOffset), false); Add(newKcTree, (CommandID)(kcTreeViewStartNotes+noteOffset), false); @@ -1253,7 +1253,7 @@ } else { - Log("Enforcing rule krPropagateNotesToSampAndIns: removing Note on in samp ctx\n"); + Log("Enforcing rule krPropagateNotesToSampAndIns: removing Note on in samp ctx\n"); Remove(newKcSamp, (CommandID)(kcSampStartNotes+noteOffset)); Remove(newKcIns, (CommandID)(kcInstrumentStartNotes+noteOffset)); Remove(newKcTree, (CommandID)(kcTreeViewStartNotes+noteOffset)); @@ -1278,7 +1278,7 @@ noteOffset = inCmd - kcVPStartNoteStops; if (adding) { - Log("Enforcing rule krPropagateNotesToSampAndIns: adding Note stop on in samp ctx\n"); + Log("Enforcing rule krPropagateNotesToSampAndIns: adding Note stop on in samp ctx\n"); Add(newKcSamp, (CommandID)(kcSampStartNoteStops+noteOffset), false); Add(newKcIns, (CommandID)(kcInstrumentStartNoteStops+noteOffset), false); Add(newKcTree, (CommandID)(kcTreeViewStartNoteStops+noteOffset), false); @@ -1287,7 +1287,7 @@ } else { - Log("Enforcing rule krPropagateNotesToSampAndIns: removing Note stop on in samp ctx\n"); + Log("Enforcing rule krPropagateNotesToSampAndIns: removing Note stop on in samp ctx\n"); Remove(newKcSamp, (CommandID)(kcSampStartNoteStops+noteOffset)); Remove(newKcIns, (CommandID)(kcInstrumentStartNoteStops+noteOffset)); Remove(newKcTree, (CommandID)(kcTreeViewStartNoteStops+noteOffset)); @@ -1305,7 +1305,7 @@ for (int i = 0; i < CountOf(forcedModifiers); i++) { CommandID curCmd = forcedModifiers[i]; - + //for all of this command's key combinations for (int k=0; k<commands[curCmd].kcList.GetSize(); k++) { @@ -1321,7 +1321,7 @@ //commands[curCmd].kcList[k].ctx; } } - + } } if (enforceRule[krPropagateSampleManipulation]) @@ -1350,7 +1350,7 @@ if (inKc.ctx == kCtxViewPatternsFX) { KeyCombination newKc = inKc; newKc.ctx = kCtxViewPatternsFXparam; - if (adding) { + if (adding) { Add(newKc, inCmd, false); } else { Remove(newKc, inCmd); @@ -1359,12 +1359,12 @@ if (inKc.ctx == kCtxViewPatternsFXparam) { KeyCombination newKc = inKc; newKc.ctx = kCtxViewPatternsFX; - if (adding) { + if (adding) { Add(newKc, inCmd, false); } else { Remove(newKc, inCmd); } - } + } } */ return report; @@ -1382,7 +1382,7 @@ case VK_LWIN: case VK_RWIN: return HOTKEYF_EXT; // Feature: use Windows keys as modifier keys default: /*DEBUG: ASSERT(false);*/ return 0; //can only get modifier for modifier key } - + } @@ -1396,13 +1396,13 @@ KeyCombination curKc; CArray<KeyEventType, KeyEventType> eventTypes; CArray<InputTargetContext, InputTargetContext> contexts; - + //Clear map memset(km, kcNull, sizeof(KeyMap)); //Copy commandlist content into map: for(UINT cmd=0; cmd<kcNumCommands; cmd++) - { + { if(IsDummyCommand((CommandID)cmd)) continue; @@ -1411,7 +1411,7 @@ contexts.RemoveAll(); eventTypes.RemoveAll(); curKc = commands[cmd].kcList[k]; - + //Handle keyEventType mask. if (curKc.event & kKeyEventDown) eventTypes.Add(kKeyEventDown); @@ -1504,7 +1504,7 @@ ErrorBox(IDS_CANT_OPEN_FILE_FOR_WRITING); return false; } - fprintf(outStream, "//-------- OpenMPT key binding definition file -------\n"); + fprintf(outStream, "//-------- OpenMPT key binding definition file -------\n"); fprintf(outStream, "//-Format is: -\n"); fprintf(outStream, "//- Context:Command ID:Modifiers:Key:KeypressEventType //Comments -\n"); fprintf(outStream, "//----------------------------------------------------------------------\n"); @@ -1512,22 +1512,22 @@ for (int ctx=0; ctx<kCtxMaxInputContexts; ctx++) { - fprintf(outStream, "\n//----( %s (%d) )------------\n", GetContextText((InputTargetContext)ctx), ctx); + fprintf(outStream, "\n//----( %s (%d) )------------\n", GetContextText((InputTargetContext)ctx), ctx); for (int cmd=0; cmd<kcNumCommands; cmd++) { for (int k=0; k<GetKeyListSize((CommandID)cmd); k++) { kc = GetKey((CommandID)cmd, k); - + if (kc.ctx != ctx) continue; //sort by context - + if (!commands[cmd].isHidden) { - fprintf(outStream, "%d:%d:%d:%d:%d\t\t//%s: %s (%s)\n", - ctx, commands[cmd].UID, kc.mod, kc.code, kc.event, - GetCommandText((CommandID)cmd), GetKeyText(kc.mod,kc.code), GetKeyEventText(kc.event)); + fprintf(outStream, "%d:%d:%d:%d:%d\t\t//%s: %s (%s)\n", + ctx, commands[cmd].UID, kc.mod, kc.code, kc.event, + GetCommandText((CommandID)cmd), GetKeyText(kc.mod,kc.code), GetKeyEventText(kc.event)); } } @@ -1560,18 +1560,18 @@ while(iStrm.getline(s, sizeof(s))) { curLine = s; - - + + //Cut everything after a // commentStart = curLine.Find("//"); if (commentStart>=0) curLine = curLine.Left(commentStart); curLine.Trim(); //remove whitespace - + if (!curLine.IsEmpty() && curLine.Compare("\n") !=0) { bool ignoreLine = false; - + //ctx:UID:Description:Modifier:Key:EventMask int spos = 0; @@ -1803,7 +1803,7 @@ { switch(ctx) { - + case kCtxAllContexts: return "Global Context"; case kCtxViewGeneral: return "General Context [bottom]"; case kCtxViewPatterns: return "Pattern Context [bottom]"; @@ -1892,7 +1892,7 @@ { if ( static_cast<INT_PTR>(key) < commands[c].kcList.GetSize()) return GetKeyText(commands[c].kcList[0].mod, commands[c].kcList[0].code); - else + else return ""; } @@ -1908,7 +1908,7 @@ //------------------------------------------------------- // Quick Changes - modify many commands with one call. //------------------------------------------------------- - + bool CCommandSet::QuickChange_NotesRepeat() //----------------------------------------- { @@ -1965,7 +1965,7 @@ { Remove(p, cmd); } - + char effect = modSpecs.GetEffectLetter(static_cast<ModCommand::COMMAND>(cmd - kcSetFXStart + 1)); if(effect >= 'A' && effect <= 'Z') { @@ -1980,10 +1980,10 @@ if(effect != '?') { SHORT codeNmod = VkKeyScanEx(effect, GetKeyboardLayout(0)); - kc.code = LOBYTE(codeNmod); + kc.code = LOBYTE(codeNmod); kc.mod = HIBYTE(codeNmod) & 0x07; //We're only interest in the bottom 3 bits. Add(kc, cmd, true); - + if (kc.code >= '0' && kc.code <= '9') //for numbers, ensure numpad works too { kc.code = VK_NUMPAD0 + (kc.code-'0'); @@ -1991,11 +1991,12 @@ } } } + return true; } // Stupid MFC crap: for some reason VK code isn't enough to get correct string with GetKeyName. -// We also need to figure out the correct "extended" bit. +// We also need to figure out the correct "extended" bit. bool CCommandSet::IsExtended(UINT code) { if (code==VK_SNAPSHOT) //print screen @@ -2003,7 +2004,7 @@ if (code>=VK_PRIOR && code<=VK_DOWN) //pgup, pg down, home, end, cursor keys, return true; if (code>=VK_INSERT && code<=VK_DELETE) // ins, del - return true; + return true; if (code>=VK_LWIN && code<=VK_APPS) //winkeys & application key return true; if (code==VK_DIVIDE) //Numpad '/' @@ -2017,42 +2018,17 @@ } -void CCommandSet::GetParentContexts(InputTargetContext child, CArray<InputTargetContext, InputTargetContext> parentList) +void CCommandSet::SetupContextHierarchy() { - UNREFERENCED_PARAMETER(child); - //parentList.RemoveAll(); +// m_isParentContext.SetSize(kCtxMaxInputContexts); - //for (InputTargetContext parent; parent<kCtxMaxInputContexts; parent++) { - // if (m_isParentContext[child][parent]) { - // parentList.Add(parent); - // } - //} -} - -void CCommandSet::GetChildContexts(InputTargetContext parent, CArray<InputTargetContext, InputTargetContext> childList) -{ - UNREFERENCED_PARAMETER(parent); - //childList.RemoveAll(); - - //for (InputTargetContext child; child<kCtxMaxInputContexts; child++) { - // if (m_isParentContext[child][parent]) { - // childList.Add(child); - // } - //} -} - - -void CCommandSet::SetupContextHierarchy() -{ -// m_isParentContext.SetSize(kCtxMaxInputContexts); - for (UINT nCtx=0; nCtx<kCtxMaxInputContexts; nCtx++) { // m_isParentContext[nCtx].SetSize(kCtxMaxInputContexts); for (UINT nCtx2=0; nCtx2<kCtxMaxInputContexts; nCtx2++) { m_isParentContext[nCtx][nCtx2] = false; }//InputTargetContext } - + //For now much be fully expanded (i.e. don't rely on grandparent relationships). m_isParentContext[kCtxViewGeneral][kCtxAllContexts] = true; m_isParentContext[kCtxViewPatterns][kCtxAllContexts] = true; @@ -2085,19 +2061,19 @@ } -bool CCommandSet::KeyCombinationConflict(KeyCombination kc1, KeyCombination kc2, bool &crossCxtConflict) +bool CCommandSet::KeyCombinationConflict(KeyCombination kc1, KeyCombination kc2, bool &crossCxtConflict) { bool modConflict = (kc1.mod==kc2.mod); bool codeConflict = (kc1.code==kc2.code); bool eventConflict = ((kc1.event&kc2.event)!=0); bool ctxConflict = (kc1.ctx == kc2.ctx); crossCxtConflict = m_isParentContext[kc1.ctx][kc2.ctx] || m_isParentContext[kc2.ctx][kc1.ctx]; - - bool conflict = modConflict && codeConflict && eventConflict && + + bool conflict = modConflict && codeConflict && eventConflict && (ctxConflict || crossCxtConflict); return conflict; } -//end rewbs.customKeys +//end rewbs.customKeys \ No newline at end of file Modified: trunk/OpenMPT/mptrack/CommandSet.h =================================================================== --- trunk/OpenMPT/mptrack/CommandSet.h 2013-04-13 16:38:15 UTC (rev 1872) +++ trunk/OpenMPT/mptrack/CommandSet.h 2013-04-14 00:32:41 UTC (rev 1873) @@ -1223,8 +1223,6 @@ bool IsDummyCommand(CommandID cmd); UINT CodeToModifier(UINT code); CString EnforceAll(KeyCombination kc, CommandID cmd, bool adding); - void GetParentContexts(InputTargetContext child, CArray<InputTargetContext, InputTargetContext> ctxList); - void GetChildContexts(InputTargetContext child, CArray<InputTargetContext, InputTargetContext> ctxList); bool IsExtended(UINT code); int FindCmd(int uid); Modified: trunk/OpenMPT/mptrack/Ctrl_com.cpp =================================================================== --- trunk/OpenMPT/mptrack/Ctrl_com.cpp 2013-04-13 16:38:15 UTC (rev 1872) +++ trunk/OpenMPT/mptrack/Ctrl_com.cpp 2013-04-14 00:32:41 UTC (rev 1873) @@ -137,9 +137,9 @@ if ((ln >= LINE_LENGTH-1) || (!*p)) { if (((BYTE)c) > ' ') s[ln++] = c; - c = INTERNAL_LINEENDING; + c = SongMessage::InternalLineEnding; } - if (c == INTERNAL_LINEENDING) + if (c == SongMessage::InternalLineEnding) { s[ln] = 0x0D; s[ln+1] = 0x0A; @@ -173,7 +173,6 @@ if ((!m_bInitialized) || (!m_EditComments.m_hWnd) || (!m_EditComments.GetModify())) return; CHAR s[LINE_LENGTH + 2]; - const char *oldMsg = m_pSndFile->songMessage.c_str(); // Updating comments { @@ -195,13 +194,13 @@ if (i+1 < n) { size_t l = strlen(s); - s[l++] = INTERNAL_LINEENDING; + s[l++] = SongMessage::InternalLineEnding; s[l] = '\0'; } strcat(p, s); } UINT len = strlen(p); - while ((len > 0) && ((p[len-1] == ' ') || (p[len-1] == INTERNAL_LINEENDING))) + while ((len > 0) && ((p[len-1] == ' ') || (p[len-1] == SongMessage::InternalLineEnding))) { len--; p[len] = 0; Modified: trunk/OpenMPT/mptrack/Ctrl_gen.cpp =================================================================== --- trunk/OpenMPT/mptrack/Ctrl_gen.cpp 2013-04-13 16:38:15 UTC (rev 1872) +++ trunk/OpenMPT/mptrack/Ctrl_gen.cpp 2013-04-14 00:32:41 UTC (rev 1873) @@ -144,7 +144,6 @@ void CCtrlGeneral::OnActivatePage(LPARAM) //--------------------------------------- { - CMainFrame *pMainFrm = CMainFrame::GetMainFrame(); if (m_pModDoc) m_pModDoc->SetNotifications(Notification::Default); if (m_pModDoc) m_pModDoc->SetFollowWnd(m_hWnd); PostViewMessage(VIEWMSG_SETACTIVE, NULL); @@ -629,8 +628,8 @@ } -VOID CVuMeter::DrawVuMeter(CDC &dc, bool redraw) -//---------------------------------------------- +VOID CVuMeter::DrawVuMeter(CDC &dc, bool /*redraw*/) +//-------------------------------------------------- { LONG vu; LONG lastvu; Modified: trunk/OpenMPT/mptrack/Ctrl_pat.cpp =================================================================== --- trunk/OpenMPT/mptrack/Ctrl_pat.cpp 2013-04-13 16:38:15 UTC (rev 1872) +++ trunk/OpenMPT/mptrack/Ctrl_pat.cpp 2013-04-14 00:32:41 UTC (rev 1873) @@ -838,15 +838,15 @@ CSoundFile *pSndFile = m_pModDoc->GetSoundFile(); OrdSelection selection = m_OrderList.GetCurSel(false); - ORDERINDEX nInsertCount = selection.lastOrd - selection.firstOrd; - ORDERINDEX nInsertWhere = selection.firstOrd + nInsertCount + 1; - if (nInsertWhere >= pSndFile->GetModSpecifications().ordersMax) + const ORDERINDEX insertCount = selection.lastOrd - selection.firstOrd; + const ORDERINDEX insertWhere = selection.firstOrd + insertCount + 1; + if (insertWhere >= pSndFile->GetModSpecifications().ordersMax) return; bool success = false; // Has this pattern been duplicated already? (for multiselect) vector<PATTERNINDEX> patReplaceIndex(pSndFile->Patterns.Size(), PATTERNINDEX_INVALID); - for(ORDERINDEX i = 0; i <= nInsertCount; i++) + for(ORDERINDEX i = 0; i <= insertCount; i++) { PATTERNINDEX nCurPat = pSndFile->Order[selection.firstOrd + i]; if (pSndFile->Patterns.IsValidIndex(nCurPat) && patReplaceIndex[nCurPat] == PATTERNINDEX_INVALID) @@ -854,7 +854,7 @@ ROWINDEX rows = pSndFile->Patterns[nCurPat].GetNumRows(); Limit(rows, pSndFile->GetModSpecifications().patternRowsMin, pSndFile->GetModSpecifications().patternRowsMax); - PATTERNINDEX nNewPat = m_pModDoc->InsertPattern(nInsertWhere + i, rows); + PATTERNINDEX nNewPat = m_pModDoc->InsertPattern(insertWhere + i, rows); if ((nNewPat != PATTERNINDEX_INVALID) && (nNewPat < pSndFile->Patterns.Size()) && (pSndFile->Patterns[nCurPat] != nullptr)) { // Update time signature and pattern name @@ -882,7 +882,7 @@ } else { // Invalid pattern, or it has been duplicated before (multiselect) - for (int j = pSndFile->Order.size() - 1; j > selection.firstOrd + i + nInsertCount + 1; j--) pSndFile->Order[j] = pSndFile->Order[j - 1]; + for (int j = pSndFile->Order.size() - 1; j > selection.firstOrd + i + insertCount + 1; j--) pSndFile->Order[j] = pSndFile->Order[j - 1]; PATTERNINDEX nNewPat; if(nCurPat < pSndFile->Patterns.Size() && patReplaceIndex[nCurPat] != PATTERNINDEX_INVALID) @@ -894,9 +894,9 @@ nNewPat = pSndFile->Order[selection.firstOrd + i]; } - if (selection.firstOrd + i + nInsertCount + 1 < pSndFile->Order.GetLength()) + if (selection.firstOrd + i + insertCount + 1 < pSndFile->Order.GetLength()) { - pSndFile->Order[selection.firstOrd + i + nInsertCount + 1] = nNewPat; + pSndFile->Order[selection.firstOrd + i + insertCount + 1] = nNewPat; } success = true; @@ -906,10 +906,10 @@ if(success) { m_OrderList.InvalidateRect(NULL, FALSE); - m_OrderList.SetCurSel(nInsertWhere); + m_OrderList.SetCurSel(insertWhere); // If the first duplicated order is e.g. a +++ item, we need to move the pattern display on or else we'll still edit the previously shown pattern. - ORDERINDEX showPattern = MIN(nInsertWhere, pSndFile->Order.GetLastIndex()); + ORDERINDEX showPattern = std::min(insertWhere, pSndFile->Order.GetLastIndex()); while(!pSndFile->Patterns.IsValidPat(pSndFile->Order[showPattern]) && showPattern < pSndFile->Order.GetLastIndex()) { showPattern++; @@ -918,7 +918,7 @@ m_pModDoc->SetModified(); m_pModDoc->UpdateAllViews(NULL, HINT_MODSEQUENCE | HINT_PATNAMES, this); - if(selection.lastOrd != selection.firstOrd) m_OrderList.m_nScrollPos2nd = nInsertWhere + nInsertCount; + if(selection.lastOrd != selection.firstOrd) m_OrderList.m_nScrollPos2nd = insertWhere + insertCount; } } SwitchToView(); @@ -1244,35 +1244,17 @@ void CCtrlPatterns::TogglePluginEditor() //-------------------------------------- { - if(m_nInstrument && m_pModDoc && m_pSndFile && m_pSndFile->Instruments[m_nInstrument] != nullptr) + if(m_pModDoc && m_pSndFile && m_pSndFile->GetInstrumentPlugin(m_nInstrument) != nullptr) { - PLUGINDEX nPlug = m_pSndFile->Instruments[m_nInstrument]->nMixPlug; - if(nPlug) - { - // Has a plugin assigned - if(m_pSndFile->m_MixPlugins[nPlug - 1].pMixPlugin != nullptr) - { - // Has a valid plugin assigned - m_pModDoc->TogglePluginEditor(nPlug - 1); - } - } + m_pModDoc->TogglePluginEditor(m_pSndFile->Instruments[m_nInstrument]->nMixPlug - 1); } } -bool CCtrlPatterns::HasValidPlug(UINT instr) -//------------------------------------------ +bool CCtrlPatterns::HasValidPlug(INSTRUMENTINDEX instr) +//----------------------------------------------------- { - if ((instr) && (instr < MAX_INSTRUMENTS) && (m_pSndFile) && m_pSndFile->Instruments[instr] != nullptr) - { - PLUGINDEX nPlug = m_pSndFile->Instruments[instr]->nMixPlug; - if(nPlug) - { - // Has a plugin assigned - return (m_pSndFile->m_MixPlugins[nPlug - 1].pMixPlugin != nullptr); - } - } - return false; + return m_pSndFile != nullptr && m_pSndFile->GetInstrumentPlugin(instr) != nullptr; } Modified: trunk/OpenMPT/mptrack/Ctrl_pat.h =================================================================== --- trunk/OpenMPT/mptrack/Ctrl_pat.h 2013-04-13 16:38:15 UTC (rev 1872) +++ trunk/OpenMPT/mptrack/Ctrl_pat.h 2013-04-14 00:32:41 UTC (rev 1873) @@ -262,7 +262,7 @@ //}}AFX_MSG DECLARE_MESSAGE_MAP() private: - bool HasValidPlug(UINT instr); + bool HasValidPlug(INSTRUMENTINDEX instr); public: afx_msg BOOL OnMouseWheel(UINT nFlags, short zDelta, CPoint pt); afx_msg BOOL OnToolTip(UINT id, NMHDR *pTTTStruct, LRESULT *pResult); Modified: trunk/OpenMPT/mptrack/Ctrl_seq.cpp =================================================================== --- trunk/OpenMPT/mptrack/Ctrl_seq.cpp 2013-04-13 16:38:15 UTC (rev 1872) +++ trunk/OpenMPT/mptrack/Ctrl_seq.cpp 2013-04-14 00:32:41 UTC (rev 1873) @@ -1121,9 +1121,9 @@ CSoundFile &sndFile = m_pModDoc->GetrSoundFile(); const OrdSelection selection = GetCurSel(false); - const ORDERINDEX nInsertCount = selection.lastOrd - selection.firstOrd, nInsertEnd = selection.lastOrd; + const ORDERINDEX insertCount = selection.lastOrd - selection.firstOrd, insertEnd = selection.lastOrd; - for(ORDERINDEX i = 0; i <= nInsertCount; i++) + for(ORDERINDEX i = 0; i <= insertCount; i++) { // Checking whether there is some pattern at the end of orderlist. if (sndFile.Order.GetLength() < 1 || sndFile.Order.Last() < sndFile.Patterns.Size()) @@ -1131,20 +1131,21 @@ if(sndFile.Order.GetLength() < sndFile.GetModSpecifications().ordersMax) sndFile.Order.Append(); } - for(int j = sndFile.Order.GetLastIndex(); j > nInsertEnd; j--) + for(int j = sndFile.Order.GetLastIndex(); j > insertEnd; j--) sndFile.Order[j] = sndFile.Order[j - 1]; } // now that there is enough space in the order list, overwrite the orders - for(ORDERINDEX i = 0; i <= nInsertCount; i++) + for(ORDERINDEX i = 0; i <= insertCount; i++) { - if(nInsertEnd + i + 1 < sndFile.GetModSpecifications().ordersMax - && - nInsertEnd + i + 1 < sndFile.Order.GetLength()) - sndFile.Order[nInsertEnd + i + 1] = sndFile.Order[nInsertEnd - nInsertCount + i]; + if(insertEnd + i + 1 < sndFile.GetModSpecifications().ordersMax + && insertEnd + i + 1 < sndFile.Order.GetLength()) + { + sndFile.Order[insertEnd + i + 1] = sndFile.Order[insertEnd - insertCount + i]; + } } - m_nScrollPos = MIN(nInsertEnd + 1, sndFile.Order.GetLastIndex()); - if(nInsertCount > 0) - m_nScrollPos2nd = MIN(m_nScrollPos + nInsertCount, sndFile.Order.GetLastIndex()); + m_nScrollPos = std::min(ORDERINDEX(insertEnd + 1), sndFile.Order.GetLastIndex()); + if(insertCount > 0) + m_nScrollPos2nd = std::min(ORDERINDEX(m_nScrollPos + insertCount), sndFile.Order.GetLastIndex()); else m_nScrollPos2nd = ORDERINDEX_INVALID; Modified: trunk/OpenMPT/mptrack/InputHandler.cpp =================================================================== --- trunk/OpenMPT/mptrack/InputHandler.cpp 2013-04-13 16:38:15 UTC (rev 1872) +++ trunk/OpenMPT/mptrack/InputHandler.cpp 2013-04-14 00:32:41 UTC (rev 1873) @@ -147,9 +147,6 @@ { CommandID executeCommand = keyMap[context][modifierMask][nChar][keyEventType]; -/* if (keyEventType == kKeyEventUp) - keyEventType=kKeyEventUp; -*/ if(pSourceWnd == nullptr) pSourceWnd = m_pMainFrm; //by default, send command message to main frame. Modified: trunk/OpenMPT/mptrack/Moptions.cpp =================================================================== --- trunk/OpenMPT/mptrack/Moptions.cpp 2013-04-13 16:38:15 UTC (rev 1872) +++ trunk/OpenMPT/mptrack/Moptions.cpp 2013-04-14 00:32:41 UTC (rev 1873) @@ -108,7 +108,7 @@ } -BOOL COptionsColors::OnKillActive() +BOOL COptionsColors::OnKillActive() //--------------------------------- { int temp_nRowSpacing = GetDlgItemInt(IDC_PRIMARYHILITE); @@ -260,8 +260,8 @@ PREVIEWBMP_HEIGHT, m_pPreviewDib->lpDibBits, (LPBITMAPINFO)m_pPreviewDib, - DIB_RGB_COLORS, - SRCCOPY); + DIB_RGB_COLORS, + SRCCOPY); } } @@ -332,7 +332,7 @@ void COptionsColors::OnSettingsChanged() //-------------------------------------- { - SetModified(TRUE); + SetModified(TRUE); } void COptionsColors::OnUpdateDialog() Modified: trunk/OpenMPT/mptrack/Mpdlgs.cpp =================================================================== --- trunk/OpenMPT/mptrack/Mpdlgs.cpp 2013-04-13 16:38:15 UTC (rev 1872) +++ trunk/OpenMPT/mptrack/Mpdlgs.cpp 2013-04-14 00:32:41 UTC (rev 1873) @@ -354,7 +354,7 @@ vector<bool> supportedRates; vector<UINT> samplerates; - for(size_t i = 0; i < NUMMIXRATE; i++) + for(size_t i = 0; i < CountOf(nMixingRates); i++) { samplerates.push_back(nMixingRates[i]); } @@ -392,7 +392,7 @@ supportedRates.assign(samplerates.size(), true); } int n = 1; - for(size_t i = 0; i < NUMMIXRATE; i++) + for(size_t i = 0; i < CountOf(nMixingRates); i++) { if(supportedRates[i]) { @@ -504,6 +504,7 @@ } } + ////////////////////////////////////////////////////////// // COptionsPlayer @@ -806,8 +807,6 @@ CMainFrame::GetMainFrame()->SetupPlayer(); } #endif - // Notify CMainFrame - CMainFrame *pParent = CMainFrame::GetMainFrame(); //rewbs.resamplerConf CString s; m_CEditWFIRCutoff.GetWindowText(s); Modified: trunk/OpenMPT/mptrack/PatternEditorDialogs.cpp =================================================================== --- trunk/OpenMPT/mptrack/PatternEditorDialogs.cpp 2013-04-13 16:38:15 UTC (rev 1872) +++ trunk/OpenMPT/mptrack/PatternEditorDialogs.cpp 2013-04-14 00:32:41 UTC (rev 1873) @@ -185,7 +185,7 @@ combo->SetItemData(combo->AddString("ins -1"), replaceInstrumentMinusOne); combo->SetItemData(combo->AddString("ins +1"), replaceInstrumentPlusOne); } - for (UINT n=1; n<MAX_INSTRUMENTS; n++) + for(INSTRUMENTINDEX n = 1; n < MAX_INSTRUMENTS; n++) { if(sndFile.GetNumInstruments()) { Modified: trunk/OpenMPT/mptrack/PatternGotoDialog.cpp =================================================================== --- trunk/OpenMPT/mptrack/PatternGotoDialog.cpp 2013-04-13 16:38:15 UTC (rev 1872) +++ trunk/OpenMPT/mptrack/PatternGotoDialog.cpp 2013-04-14 00:32:41 UTC (rev 1873) @@ -51,50 +51,44 @@ // CPatternGotoDialog message handlers -void CPatternGotoDialog::UpdatePos(UINT row, UINT chan, UINT pat, UINT ord, CSoundFile* pSndFile) +void CPatternGotoDialog::UpdatePos(ROWINDEX row, CHANNELINDEX chan, PATTERNINDEX pat, ORDERINDEX ord, CSoundFile &sndFile) { m_nRow = row; m_nChannel = chan; - m_nPattern = static_cast<PATTERNINDEX>(pat); + m_nPattern = pat; m_nActiveOrder = ord; m_nOrder = ord; - m_pSndFile = pSndFile; + m_pSndFile = &sndFile; } void CPatternGotoDialog::OnOK() { UpdateData(); - bool validated=true; + bool validated = true; - //is pattern number sensible? - if(m_nPattern>=m_pSndFile->Patterns.Size()) + // Does pattern exist? + if(validated && !m_pSndFile->Patterns.IsValidPat(m_nPattern)) { - validated=false; + validated = false; } - - //Does pattern exist? - if(validated && !(m_pSndFile->Patterns[m_nPattern])) - { - validated=false; - } - //Does order match pattern? + // Does order match pattern? if(validated && m_pSndFile->Order[m_nOrder] != m_nPattern) { - validated=false; + validated = false; } - //Does pattern have enough rows? + // Does pattern have enough rows? if(validated && m_pSndFile->Patterns[m_nPattern].GetNumRows() <= m_nRow) { - validated=false; + validated = false; } - //Does track have enough channels? + // Does track have enough channels? if(validated && m_pSndFile->m_nChannels < m_nChannel) { - validated=false; + validated = false; } @@ -122,7 +116,7 @@ if(m_nOrder == ORDERINDEX_INVALID) { - m_nOrder=0; + m_nOrder = 0; } LockControls(); @@ -141,8 +135,8 @@ if(m_nOrder<m_pSndFile->Order.size()) { - UINT candidatePattern = m_pSndFile->Order[m_nOrder]; - if(candidatePattern<m_pSndFile->Patterns.Size() && m_pSndFile->Patterns[candidatePattern]) + PATTERNINDEX candidatePattern = m_pSndFile->Order[m_nOrder]; + if(candidatePattern < m_pSndFile->Patterns.Size() && m_pSndFile->Patterns[candidatePattern]) { m_nPattern = candidatePattern; } Modified: trunk/OpenMPT/mptrack/PatternGotoDialog.h =================================================================== --- trunk/OpenMPT/mptrack/PatternGotoDialog.h 2013-04-13 16:38:15 UTC (rev 1872) +++ trunk/OpenMPT/mptrack/PatternGotoDialog.h 2013-04-14 00:32:41 UTC (rev 1873) @@ -27,7 +27,7 @@ public: UINT m_nRow, m_nChannel, m_nPattern, m_nOrder, m_nActiveOrder; - void UpdatePos(UINT row, UINT chan, UINT pat, UINT ord, CSoundFile* pSndFile); + void UpdatePos(ROWINDEX row, CHANNELINDEX chan, PATTERNINDEX pat, ORDERINDEX ord, CSoundFile &sndFile); protected: bool m_bControlLock; Modified: trunk/OpenMPT/mptrack/View_pat.cpp =================================================================== --- trunk/OpenMPT/mptrack/View_pat.cpp 2013-04-13 16:38:15 UTC (rev 1872) +++ trunk/OpenMPT/mptrack/View_pat.cpp 2013-04-14 00:32:41 UTC (rev 1873) @@ -1975,11 +1975,11 @@ } if (m_pGotoWnd) { - CSoundFile *pSndFile = pModDoc->GetSoundFile(); + CSoundFile &sndFile = pModDoc->GetrSoundFile(); ORDERINDEX curOrder = GetCurrentOrder(); CHANNELINDEX curChannel = GetCurrentChannel() + 1; - m_pGotoWnd->UpdatePos(GetCurrentRow(), curChannel, m_nPattern, curOrder, pSndFile); + m_pGotoWnd->UpdatePos(GetCurrentRow(), curChannel, m_nPattern, curOrder, sndFile); if (m_pGotoWnd->DoModal() == IDOK) { Modified: trunk/OpenMPT/mptrack/test/test.cpp =================================================================== --- trunk/OpenMPT/mptrack/test/test.cpp 2013-04-13 16:38:15 UTC (rev 1872) +++ trunk/OpenMPT/mptrack/test/test.cpp 2013-04-14 00:32:41 UTC (rev 1873) @@ -3,8 +3,7 @@ * -------- * Purpose: Unit tests for OpenMPT. * Notes : We need FAAAAAAAR more unit tests! - * Authors: Olivier Lapicque - * OpenMPT Devs + * Authors: OpenMPT Devs * The OpenMPT source code is released under the BSD license. Read LICENSE for more details. */ @@ -324,50 +323,50 @@ void TestLoadXMFile(const CModDoc *pModDoc) //----------------------------------------- { - const CSoundFile *pSndFile = pModDoc->GetSoundFile(); + const CSoundFile &sndFile = pModDoc->GetrSoundFile(); // Global Variables - VERIFY_EQUAL_NONCONT(strcmp(pSndFile->m_szNames[0], "Test Module"), 0); - VERIFY_EQUAL_NONCONT(pSndFile->songMessage.at(0), 'O'); - VERIFY_EQUAL_NONCONT(pSndFile->m_nDefaultTempo, 139); - VERIFY_EQUAL_NONCONT(pSndFile->m_nDefaultSpeed, 5); - VERIFY_EQUAL_NONCONT(pSndFile->m_nGlobalVolume, 128); - VERIFY_EQUAL_NONCONT(pSndFile->m_nVSTiVolume, 42); - VERIFY_EQUAL_NONCONT(pSndFile->m_nSamplePreAmp, 23); - VERIFY_EQUAL_NONCONT((pSndFile->m_SongFlags & SONG_FILE_FLAGS), SONG_EMBEDMIDICFG | SONG_LINEARSLIDES | SONG_EXFILTERRANGE); - VERIFY_EQUAL_NONCONT(pSndFile->GetModFlag(MSF_COMPATIBLE_PLAY), true); - VERIFY_EQUAL_NONCONT(pSndFile->GetModFlag(MSF_MIDICC_BUGEMULATION), false); - VERIFY_EQUAL_NONCONT(pSndFile->GetModFlag(MSF_OLDVOLSWING), false); - VERIFY_EQUAL_NONCONT(pSndFile->GetModFlag(MSF_OLD_MIDI_PITCHBENDS), false); - VERIFY_EQUAL_NONCONT(pSndFile->m_nMixLevels, mixLevels_compatible); - VERIFY_EQUAL_NONCONT(pSndFile->m_nTempoMode, tempo_mode_modern); - VERIFY_EQUAL_NONCONT(pSndFile->m_nDefaultRowsPerBeat, 6); - VERIFY_EQUAL_NONCONT(pSndFile->m_nDefaultRowsPerMeasure, 12); - VERIFY_EQUAL_NONCONT(pSndFile->m_dwCreatedWithVersion, MAKE_VERSION_NUMERIC(1, 19, 02, 05)); - VERIFY_EQUAL_NONCONT(pSndFile->m_nRestartPos, 1); + VERIFY_EQUAL_NONCONT(strcmp(sndFile.m_szNames[0], "Test Module"), 0); + VERIFY_EQUAL_NONCONT(sndFile.songMessage.at(0), 'O'); + VERIFY_EQUAL_NONCONT(sndFile.m_nDefaultTempo, 139); + VERIFY_EQUAL_NONCONT(sndFile.m_nDefaultSpeed, 5); + VERIFY_EQUAL_NONCONT(sndFile.m_nGlobalVolume, 128); + VERIFY_EQUAL_NONCONT(sndFile.m_nVSTiVolume, 42); + VERIFY_EQUAL_NONCONT(sndFile.m_nSamplePreAmp, 23); + VERIFY_EQUAL_NONCONT((sndFile.m_SongFlags & SONG_FILE_FLAGS), SONG_EMBEDMIDICFG | SONG_LINEARSLIDES | SONG_EXFILTERRANGE); + VERIFY_EQUAL_NONCONT(sndFile.GetModFlag(MSF_COMPATIBLE_PLAY), true); + VERIFY_EQUAL_NONCONT(sndFile.GetModFlag(MSF_MIDICC_BUGEMULATION), false); + VERIFY_EQUAL_NONCONT(sndFile.GetModFlag(MSF_OLDVOLSWING), false); + VERIFY_EQUAL_NONCONT(sndFile.GetModFlag(MSF_OLD_MIDI_PITCHBENDS), false); + VERIFY_EQUAL_NONCONT(sndFile.m_nMixLevels, mixLevels_compatible); + VERIFY_EQUAL_NONCONT(sndFile.m_nTempoMode, tempo_mode_modern); + VERIFY_EQUAL_NONCONT(sndFile.m_nDefaultRowsPerBeat, 6); + VERIFY_EQUAL_NONCONT(sndFile.m_nDefaultRowsPerMeasure, 12); + VERIFY_EQUAL_NONCONT(sndFile.m_dwCreatedWithVersion, MAKE_VERSION_NUMERIC(1, 19, 02, 05)); + VERIFY_EQUAL_NONCONT(sndFile.m_nRestartPos, 1); // Macros - VERIFY_EQUAL_NONCONT(pSndFile->m_MidiCfg.GetParameteredMacroType(0), sfx_reso); - VERIFY_EQUAL_NONCONT(pSndFile->m_MidiCfg.GetParameteredMacroType(1), sfx_drywet); - VERIFY_EQUAL_NONCONT(pSndFile->m_MidiCfg.GetFixedMacroType(), zxx_resomode); + VERIFY_EQUAL_NONCONT(sndFile.m_MidiCfg.GetParameteredMacroType(0), sfx_reso); + VERIFY_EQUAL_NONCONT(sndFile.m_MidiCfg.GetParameteredMacroType(1), sfx_drywet); + VERIFY_EQUAL_NONCONT(sndFile.m_MidiCfg.GetFixedMacroType(), zxx_resomode); // Channels - VERIFY_EQUAL_NONCONT(pSndFile->GetNumChannels(), 2); - VERIFY_EQUAL_NONCONT(strcmp(pSndFile->ChnSettings[0].szName, "First Channel"), 0); - VERIFY_EQUAL_NONCONT(pSndFile->ChnSettings[0].nMixPlugin, 0); + VERIFY_EQUAL_NONCONT(sndFile.GetNumChannels(), 2); + VERIFY_EQUAL_NONCONT(strcmp(sndFile.ChnSettings[0].szName, "First Channel"), 0); + VERIFY_EQUAL_NONCONT(sndFile.ChnSettings[0].nMixPlugin, 0); - VERIFY_EQUAL_NONCONT(strcmp(pSndFile->ChnSettings[1].szName, "Second Channel"), 0); - VERIFY_EQUAL_NONCONT(pSndFile->ChnSettings[1].nMixPlugin, 1); + VERIFY_EQUAL_NONCONT(strcmp(sndFile.ChnSettings[1].szName, "Second Channel"), 0); + VERIFY_EQUAL_NONCONT(sndFile.ChnSettings[1].nMixPlugin, 1); // Samples - VERIFY_EQUAL_NONCONT(pSndFile->GetNumSamples(), 3); - VERIFY_EQUAL_NONCONT(strcmp(pSndFile->m_szNames[1], "Pulse Sample"), 0); - VERIFY_EQUAL_NONCONT(strcmp(pSndFile->m_szNames[2], "Empty Sample"), 0); - VERIFY_EQUAL_NONCONT(strcmp(pSndFile->m_szNames[3], "Unassigned Sample"), 0); + VERIFY_EQUAL_NONCONT(sndFile.GetNumSamples(), 3); + VERIFY_EQUAL_NONCONT(strcmp(sndFile.m_szNames[1], "Pulse Sample"), 0); + VERIFY_EQUAL_NONCONT(strcmp(sndFile.m_szNames[2], "Empty Sample"), 0); + VERIFY_EQUAL_NONCONT(strcmp(sndFile.m_szNames[3], "Unassigned Sample"), 0); VERIFY_EQUAL_NONCONT(pModDoc->FindSampleParent(1), 1); VERIFY_EQUAL_NONCONT(pModDoc->FindSampleParent(2), 1); VERIFY_EQUAL_NONCONT(pModDoc->FindSampleParent(3), INSTRUMENTINDEX_INVALID); - const ModSample &sample = pSndFile->GetSample(1); + const ModSample &sample = sndFile.GetSample(1); VERIFY_EQUAL_NONCONT(sample.GetBytesPerSample(), 1); VERIFY_EQUAL_NONCONT(sample.GetNumChannels(), 1); VERIFY_EQUAL_NONCONT(sample.GetElementarySampleSize(), 1); @@ -388,18 +387,19 @@ VERIFY_EQUAL_NONCONT(sample.nVibDepth, 5); // Sample Data + const int8 *p8 = static_cast<const int8 *>(sample.pSample); for(size_t i = 0; i < 6; i++) { - VERIFY_EQUAL_NONCONT(static_cast<int8*>(sample.pSample)[i], 18); + VERIFY_EQUAL_NONCONT(p8[i], 18); } for(size_t i = 6; i < 16; i++) { - VERIFY_EQUAL_NONCONT(static_cast<int8*>(sample.pSample)[i], 0); + VERIFY_EQUAL_NONCONT(p8[i], 0); } // Instruments - VERIFY_EQUAL_NONCONT(pSndFile->GetNumInstruments(), 1); - const ModInstrument *pIns = pSndFile->Instruments[1]; + VERIFY_EQUAL_NONCONT(sndFile.GetNumInstruments(), 1); + const ModInstrument *pIns = sndFile.Instruments[1]; VERIFY_EQUAL_NONCONT(pIns->nFadeOut, 1024); VERIFY_EQUAL_NONCONT(pIns->nPan, 128); VERIFY_EQUAL_NONCONT(pIns->dwFlags, InstrumentFlags(0)); @@ -430,14 +430,14 @@ VERIFY_EQUAL_NONCONT(pIns->wMidiBank, 2); VERIFY_EQUAL_NONCONT(pIns->midiPWD, 8); - VERIFY_EQUAL_NONCONT(pIns->pTuning, pSndFile->GetDefaultTuning()); + VERIFY_EQUAL_NONCONT(pIns->pTuning, sndFile.GetDefaultTuning()); VERIFY_EQUAL_NONCONT(pIns->wPitchToTempoLock, 0); VERIFY_EQUAL_NONCONT(pIns->nPluginVelocityHandling, PLUGIN_VELOCITYHANDLING_VOLUME); VERIFY_EQUAL_NONCONT(pIns->nPluginVolumeHandling, PLUGIN_VOLUMEHANDLING_MIDI); - for(size_t i = pSndFile->GetModSpecifications().noteMin; i < pSndFile->GetModSpecifications().noteMax; i++) + for(size_t i = sndFile.GetModSpecifications().noteMin; i < sndFile.GetModSpecifications().noteMax; i++) { VERIFY_EQUAL_NONCONT(pIns->Keyboard[i], (i == NOTE_MIDDLEC - 1) ? 2 : 1); } @@ -462,51 +462,51 @@ VERIFY_EQUAL_NONCONT(pIns->PitchEnv.nNodes, 0); // Sequences - VERIFY_EQUAL_NONCONT(pSndFile->Order.GetNumSequences(), 1); - VERIFY_EQUAL_NONCONT(pSndFile->Order[0], 0); - VERIFY_EQUAL_NONCONT(pSndFile->Order[1], 1); + VERIFY_EQUAL_NONCONT(sndFile.Order.GetNumSequences(), 1); + VERIFY_EQUAL_NONCONT(sndFile.Order[0], 0); + VERIFY_EQUAL_NONCONT(sndFile.Order[1], 1); // Patterns - VERIFY_EQUAL_NONCONT(pSndFile->Patterns.GetNumPatterns(), 2); + VERIFY_EQUAL_NONCONT(sndFile.Patterns.GetNumPatterns(), 2); - VERIFY_EQUAL_NONCONT(pSndFile->Patterns[0].GetName(), "First Pattern"); - VERIFY_EQUAL_NONCONT(pSndFile->Patterns[0].GetNumRows(), 64); - VERIFY_EQUAL_NONCONT(pSndFile->Patterns[0].GetNumChannels(), 2); - VERIFY_EQUAL_NONCONT(pSndFile->Patterns[0].GetOverrideSignature(), false); - VERIFY_EQUAL_NONCONT(pSndFile->Patterns[0].GetRowsPerBeat(), 0); - VERIFY_EQUAL_NONCONT(pSndFile->Patterns[0].GetRowsPerMeasure(), 0); - VERIFY_EQUAL_NONCONT(pSndFile->Patterns.IsPatternEmpty(0), true); + VERIFY_EQUAL_NONCONT(sndFile.Patterns[0].GetName(), "First Pattern"); + VERIFY_EQUAL_NONCONT(sndFile.Patterns[0].GetNumRows(), 64); + VERIFY_EQUAL_NONCONT(sndFile.Patterns[0].GetNumChannels(), 2); + VERIFY_EQUAL_NONCONT(sndFile.Patterns[0].GetOverrideSignature(), false); + VERIFY_EQUAL_NONCONT(sndFile.Patterns[0].GetRowsPerBeat(), 0); + VERIFY_EQUAL_NONCONT(sndFile.Patterns[0].GetRowsPerMeasure(), 0); + VERIFY_EQUAL_NONCONT(sndFile.Patterns.IsPatternEmpty(0), true); - VERIFY_EQUAL_NONCONT(pSndFile->Patterns[1].GetName(), "Second Pattern"); - VERIFY_EQUAL_NONCONT(pSndFile->Patterns[1].GetNumRows(), 32); - VERIFY_EQUAL_NONCONT(pSndFile->Patterns[1].GetNumChannels(), 2); - VERIFY_EQUAL_NONCONT(pSndFile->Patterns[1].GetOverrideSignature(), false); - VERIFY_EQUAL_NONCONT(pSndFile->Patterns[1].GetRowsPerBeat(), 0); - VERIFY_EQUAL_NONCONT(pSndFile->Patterns[1].GetRowsPerMeasure(), 0); - VERIFY_EQUAL_NONCONT(pSndFile->Patterns.IsPatternEmpty(1), false); - VERIFY_EQUAL_NONCONT(pSndFile->Patterns[1].GetpModCommand(0, 0)->IsPcNote(), false); - VERIFY_EQUAL_NONCONT(pSndFile->Patterns[1].GetpModCommand(0, 0)->note, NOTE_NONE); - VERIFY_EQUAL_NONCONT(pSndFile->Patterns[1].GetpModCommand(0, 0)->instr, 0); - VERIFY_EQUAL_NONCONT(pSndFile->Patterns[1].GetpModCommand(0, 0)->volcmd, VOLCMD_VIBRATOSPEED); - VERIFY_EQUAL_NONCONT(pSndFile->Patterns[1].GetpModCommand(0, 0)->vol, 15); - VERIFY_EQUAL_NONCONT(pSndFile->Patterns[1].GetpModCommand(31, 0)->IsEmpty(), true); - VERIFY_EQUAL_NONCONT(pSndFile->Patterns[1].GetpModCommand(31, 1)->IsEmpty(), false); - VERIFY_EQUAL_NONCONT(pSndFile->Patterns[1].GetpModCommand(31, 1)->IsPcNote(), false); - VERIFY_EQUAL_NONCONT(pSndFile->Patterns[1].GetpModCommand(31, 1)->note, NOTE_MIDDLEC + 12); - VERIFY_EQUAL_NONCONT(pSndFile->Patterns[1].GetpModCommand(31, 1)->instr, 45); - VERIFY_EQUAL_NONCONT(pSndFile->Patterns[1].GetpModCommand(31, 1)->volcmd, VOLCMD_VOLSLIDEDOWN); - VERIFY_EQUAL_NONCONT(pSndFile->Patterns[1].GetpModCommand(31, 1)->vol, 5); - VERIFY_EQUAL_NONCONT(pSndFile->Patterns[1].GetpModCommand(31, 1)->command, CMD_PANNING8); - VERIFY_EQUAL_NONCONT(pSndFile->Patterns[1].GetpModCommand(31, 1)->param, 0xFF); + VERIFY_EQUAL_NONCONT(sndFile.Patterns[1].GetName(), "Second Pattern"); + VERIFY_EQUAL_NONCONT(sndFile.Patterns[1].GetNumRows(), 32); + VERIFY_EQUAL_NONCONT(sndFile.Patterns[1].GetNumChannels(), 2); + VERIFY_EQUAL_NONCONT(sndFile.Patterns[1].GetOverrideSignature(), false); + VERIFY_EQUAL_NONCONT(sndFile.Patterns[1].GetRowsPerBeat(), 0); + VERIFY_EQUAL_NONCONT(sndFile.Patterns[1].GetRowsPerMeasure(), 0); + VERIFY_EQUAL_NONCONT(sndFile.Patterns.IsPatternEmpty(1), false); + VERIFY_EQUAL_NONCONT(sndFile.Patterns[1].GetpModCommand(0, 0)->IsPcNote(), false); + VERIFY_EQUAL_NONCONT(sndFile.Patterns[1].GetpModCommand(0, 0)->note, NOTE_NONE); + VERIFY_EQUAL_NONCONT(sndFile.Patterns[1].GetpModCommand(0, 0)->instr, 0); + VERIFY_EQUAL_NONCONT(sndFile.Patterns[1].GetpModCommand(0, 0)->volcmd, VOLCMD_VIBRATOSPEED); + VERIFY_EQUAL_NONCONT(sndFile.Patterns[1].GetpModCommand(0, 0)->vol, 15); + VERIFY_EQUAL_NONCONT(sndFile.Patterns[1].GetpModCommand(31, 0)->IsEmpty(), true); + VERIFY_EQUAL_NONCONT(sndFile.Patterns[1].GetpModCommand(31, 1)->IsEmpty(), false); + VERIFY_EQUAL_NONCONT(sndFile.Patterns[1].GetpModCommand(31, 1)->IsPcNote(), false); + VERIFY_EQUAL_NONCONT(sndFile.Patterns[1].GetpModCommand(31, 1)->note, NOTE_MIDDLEC + 12); + VERIFY_EQUAL_NONCONT(sndFile.Patterns[1].GetpModCommand(31, 1)->instr, 45); + VERIFY_EQUAL_NONCONT(sndFile.Patterns[1].GetpModCommand(31, 1)->volcmd, VOLCMD_VOLSLIDEDOWN); + VERIFY_EQUAL_NONCONT(sndFile.Patterns[1].GetpModCommand(31, 1)->vol, 5); + VERIFY_EQUAL_NONCONT(sndFile.Patterns[1].GetpModCommand(31, 1)->command, CMD_PANNING8); + VERIFY_EQUAL_NONCONT(sndFile.Patterns[1].GetpModCommand(31, 1)->param, 0xFF); // Test 4-Bit Panning conversion for(int i = 0; i < 16; i++) { - VERIFY_EQUAL_NONCONT(pSndFile->Patterns[1].GetpModCommand(10 + i, 0)->vol, ((i * 64 + 8) / 15)); + VERIFY_EQUAL_NONCONT(sndFile.Patterns[1].GetpModCommand(10 + i, 0)->vol, ((i * 64 + 8) / 15)); } // Plugins - const SNDMIXPLUGIN &plug = pSndFile->m_MixPlugins[0]; + const SNDMIXPLUGIN &plug = sndFile.m_MixPlugins[0]; VERIFY_EQUAL_NONCONT(strcmp(plug.GetName(), "First Plugin"), 0); VERIFY_EQUAL_NONCONT(plug.fDryRatio, 0.26f); VERIFY_EQUAL_NONCONT(plug.IsMasterEffect(), true); @@ -518,27 +518,27 @@ void TestLoadMPTMFile(const CModDoc *pModDoc) //------------------------------------------- { - const CSoundFile *pSndFile = pModDoc->GetSoundFile(); + const CSoundFile &sndFile = pModDoc->GetrSoundFile(); // Global Variables - VERIFY_EQUAL_NONCONT(strcmp(pSndFile->m_szNames[0], "Test Module_____________X"), 0); - VERIFY_EQUAL_NONCONT(pSndFile->songMessage.at(0), 'O'); - VERIFY_EQUAL_NONCONT(pSndFile->m_nDefaultTempo, 139); - VERIFY_EQUAL_NONCONT(pSndFile->m_nDefaultSpeed, 5); - VERIFY_EQUAL_NONCONT(pSndFile->m_nGlobalVolume, 128); - VERIFY_EQUAL_NONCONT(pSndFile->m_nVSTiVolume, 42); - VERIFY_EQUAL_NONCONT(pSndFile->m_nSamplePreAmp, 23); - VERIFY_EQUAL_NONCONT((pSndFile->m_SongFlags & SONG_FILE_FLAGS), SONG_EMBEDMIDICFG | SONG_LINEARSLIDES | SONG_EXFILTERRANGE | SONG_ITCOMPATGXX | SONG_ITOLDEFFECTS); - VERIFY_EQUAL_NONCONT(pSndFile->GetModFlag(MSF_COMPATIBLE_PLAY), true); - VERIFY_EQUAL_NONCONT(pSndFile->GetModFlag(MSF_MIDICC_BUGEMULATION), false); - VERIFY_EQUAL_NONCONT(pSndFile->GetModFlag(MSF_OLDVOLSWING), false); - VERIFY_EQUAL_NONCONT(pSndFile->GetModFlag(MSF_OLD_MIDI_PITCHBENDS), false); - VERIFY_EQUAL_NONCONT(pSndFile->m_nMixLevels, mixLevels_compatible); - VERIFY_EQUAL_NONCONT(pSndFile->m_nTempoMode, tempo_mode_modern); - VERIFY_EQUAL_NONCONT(pSndFile->m_nDefaultRowsPerBeat, 6); - VERIFY_EQUAL_NONCONT(pSndFile->m_nDefaultRowsPerMeasure, 12); - VERIFY_EQUAL_NONCONT(pSndFile->m_dwCreatedWithVersion, MAKE_VERSION_NUMERIC(1, 19, 02, 05)); - VERIFY_EQUAL_NONCONT(pSndFile->m_nRestartPos, 1); + VERIFY_EQUAL_NONCONT(strcmp(sndFile.m_szNames[0], "Test Module_____________X"), 0); + VERIFY_EQUAL_NONCONT(sndFile.songMessage.at(0), 'O'); + VERIFY_EQUAL_NONCONT(sndFile.m_nDefaultTempo, 139); + VERIFY_EQUAL_NONCONT(sndFile.m_nDefaultSpeed, 5); + VERIFY_EQUAL_NONCONT(sndFile.m_nGlobalVolume, 128); + VERIFY_EQUAL_NONCONT(sndFile.m_nVSTiVolume, 42); + VERIFY_EQUAL_NONCONT(sndFile.m_nSamplePreAmp, 23); + VERIFY_EQUAL_NONCONT((sndFile.m_SongFlags & SONG_FILE_FLAGS), SONG_EMBEDMIDICFG | SONG_LINEARSLIDES | SONG_EXFILTERRANGE | SONG_ITCOMPATGXX | SONG_ITOLDEFFECTS); + VERIFY_EQUAL_NONCONT(sndFile.GetModFlag(MSF_COMPATIBLE_PLAY), true); + VERIFY_EQUAL_NONCONT(sndFile.GetModFlag(MSF_MIDICC_BUGEMULATION), false); + VERIFY_EQUAL_NONCONT(sndFile.GetModFlag(MSF_OLDVOLSWING), false); + VERIFY_EQUAL_NONCONT(sndFile.GetModFlag(MSF_OLD_MIDI_PITCHBENDS), false); + VERIFY_EQUAL_NONCONT(sndFile.m_nMixLevels, mixLevels_compatible); + VERIFY_EQUAL_NONCONT(sndFile.m_nTempoMode, tempo_mode_modern); + VERIFY_EQUAL_NONCONT(sndFile.m_nDefaultRowsPerBeat, 6); + VERIFY_EQUAL_NONCONT(sndFile.m_nDefaultRowsPerMeasure, 12); + VERIFY_EQUAL_NONCONT(sndFile.m_dwCreatedWithVersion, MAKE_VERSION_NUMERIC(1, 19, 02, 05)); + VERIFY_EQUAL_NONCONT(sndFile.m_nRestartPos, 1); // Edit history VERIFY_EQUAL_NONCONT(pModDoc->GetFileHistory().size() > 0, true); @@ -552,34 +552,34 @@ VERIFY_EQUAL_NONCONT((uint32)((double)fh.openTime / HISTORY_TIMER_PRECISION), 31); // Macros - VERIFY_EQUAL_NONCONT(pSndFile->m_MidiCfg.GetParameteredMacroType(0), sfx_reso); - VERIFY_EQUAL_NONCONT(pSndFile->m_MidiCfg.GetParameteredMacroType(1), sfx_drywet); - VERIFY_EQUAL_NONCONT(pSndFile->m_MidiCfg.GetParameteredMacroType(2), sfx_polyAT); - VERIFY_EQUAL_NONCONT(pSndFile->m_MidiCfg.GetFixedMacroType(), zxx_resomode); + VERIFY_EQUAL_NONCONT(sndFile.m_MidiCfg.GetParameteredMacroType(0), sfx_reso); + VERIFY_EQUAL_NONCONT(sndFile.m_MidiCfg.GetParameteredMacroType(1), sfx_drywet); + VERIFY_EQUAL_NONCONT(sndFile.m_MidiCfg.GetParameteredMacroType(2), sfx_polyAT); + VERIFY_EQUAL_NONCONT(sndFile.m_MidiCfg.GetFixedMacroType(), zxx_resomode); // Channels - VERIFY_EQUAL_NONCONT(pSndFile->GetNumChannels(), 70); - VERIFY_EQUAL_NONCONT(strcmp(pSndFile->ChnSettings[0].szName, "First Channel"), 0); - VERIFY_EQUAL_NONCONT(pSndFile->ChnSettings[0].nPan, 32); - VERIFY_EQUAL_NONCONT(pSndFile->ChnSettings[0].nVolume, 32); - VERIFY_EQUAL_NONCONT(pSndFile->ChnSettings[0].dwFlags, CHN_MUTE); - VERIFY_EQUAL_NONCONT(pSndFile->ChnSettings[0].nMixPlugin, 0); + VERIFY_EQUAL_NONCONT(sndFile.GetNumChannels(), 70); + VERIFY_EQUAL_NONCONT(strcmp(sndFile.ChnSettings[0].szName, "First Channel"), 0); + VERIFY_EQUAL_NONCONT(sndFile.ChnSettings[0].nPan, 32); + VERIFY_EQUAL_NONCONT(sndFile.ChnSettings[0].nVolume, 32); + VERIFY_EQUAL_NONCONT(sndFile.ChnSettings[0].dwFlags, CHN_MUTE); + VERIFY_EQUAL_NONCONT(sndFile.ChnSettings[0].nMixPlugin, 0); - VERIFY_EQUAL_NONCONT(strcmp(pSndFile->ChnSettings[1].szName, "Second Channel"), 0); - VERIFY_EQUAL_NONCONT(pSndFile->ChnSettings[1].nPan, 128); - VERIFY_EQUAL_NONCONT(pSndFile->ChnSettings[1].nVolume, 16); - VERIFY_EQUAL_NONCONT(pSndFile->ChnSettings[1].dwFlags, CHN_SURROUND); - VERIFY_EQUAL_NONCONT(pSndFile->ChnSettings[1].nMixPlugin, 1); + VERIFY_EQUAL_NONCONT(strcmp(sndFile.ChnSettings[1].szName, "Second Channel"), 0); + VERIFY_EQUAL_NONCONT(sndFile.ChnSettings[1].nPan, 128); + VERIFY_EQUAL_NONCONT(sndFile.ChnSettings[1].nVolume, 16); + VERIFY_EQUAL_NONCONT(sndFile.ChnSettings[1].dwFlags, CHN_SURROUND); + VERIFY_EQUAL_NONCONT(sndFile.ChnSettings[1].nMixPlugin, 1); - VERIFY_EQUAL_NONCONT(strcmp(pSndFile->ChnSettings[69].szName, "Last Channel______X"), 0); - VERIFY_EQUAL_NONCONT(pSndFile->ChnSettings[69].nPan, 256); - VERIFY_EQUAL_NO... [truncated message content] |