From: <sag...@us...> - 2010-04-20 20:26:58
|
Revision: 574 http://modplug.svn.sourceforge.net/modplug/?rev=574&view=rev Author: saga-games Date: 2010-04-20 20:26:52 +0000 (Tue, 20 Apr 2010) Log Message: ----------- [Fix] Instrument Editor: The panning spin button ranged from 0 to 256, however when saving to .IT, 256 was wrapping over to 0. Panning is now limited from 0 to 255. [Fix] Treeview: If a sequence had no name, its name was not formatted properly. [Imp] Note Properties: Show a nice description for the new :xy effect. [Imp] Mod Conversion: Convert the :xy effect to a simple note delay effect when converting to anything that's not MPTM. [Mod] Updated release notes document. Note: Does not include the new :xy effect yet. [Ref] Using (u)int8/16 types instead of "char" and "short" in the sample saving code now, to prevent possible sign errors with other compilers than MSVC. Modified Paths: -------------- trunk/OpenMPT/mptrack/Ctrl_ins.cpp trunk/OpenMPT/mptrack/Moddoc.cpp trunk/OpenMPT/mptrack/View_tre.cpp trunk/OpenMPT/packageTemplate/OMPT_1.18_ReleaseNotes.html trunk/OpenMPT/soundlib/Load_it.cpp trunk/OpenMPT/soundlib/Load_s3m.cpp trunk/OpenMPT/soundlib/Sndfile.cpp trunk/OpenMPT/soundlib/Sndfile.h Modified: trunk/OpenMPT/mptrack/Ctrl_ins.cpp =================================================================== --- trunk/OpenMPT/mptrack/Ctrl_ins.cpp 2010-04-20 19:38:59 UTC (rev 573) +++ trunk/OpenMPT/mptrack/Ctrl_ins.cpp 2010-04-20 20:26:52 UTC (rev 574) @@ -856,7 +856,7 @@ // Global Volume m_SpinGlobalVol.SetRange(0, 64); // Panning - m_SpinPanning.SetRange(0, 256); + m_SpinPanning.SetRange(0, 255); // Midi Program m_SpinMidiPR.SetRange(0, 128); // rewbs.MidiBank Modified: trunk/OpenMPT/mptrack/Moddoc.cpp =================================================================== --- trunk/OpenMPT/mptrack/Moddoc.cpp 2010-04-20 19:38:59 UTC (rev 573) +++ trunk/OpenMPT/mptrack/Moddoc.cpp 2010-04-20 20:26:52 UTC (rev 574) @@ -2618,7 +2618,7 @@ if(ontime == 0) ontime = 1; if(offtime == 0) offtime = 1; } - wsprintf(pszName, "ontime %d, offtime %d", ontime, offtime); + wsprintf(s, "ontime %d, offtime %d", ontime, offtime); } else { @@ -2648,6 +2648,10 @@ break; //end rewbs.smoothVST + case CMD_DELAYCUT: + wsprintf(pszName, "Note delay: %d, cut after %d ticks", (param >> 4), (param & 0x0F)); + break; + default: if (gFXInfo[ndx].dwParamMask == 0xF0) { Modified: trunk/OpenMPT/mptrack/View_tre.cpp =================================================================== --- trunk/OpenMPT/mptrack/View_tre.cpp 2010-04-20 19:38:59 UTC (rev 573) +++ trunk/OpenMPT/mptrack/View_tre.cpp 2010-04-20 20:26:52 UTC (rev 574) @@ -761,8 +761,11 @@ { // more than one sequence -> add folder CString sSeqName; - sSeqName.Format("%d: %s", nSeq, (LPCTSTR)pSndFile->Order.GetSequence(nSeq).m_sName); - if(sSeqName.IsEmpty()) sSeqName.Format("Sequence %d", nSeq); + if(pSndFile->Order.GetSequence(nSeq).m_sName.IsEmpty()) + sSeqName.Format("Sequence %d", nSeq); + else + sSeqName.Format("%d: %s", nSeq, (LPCTSTR)pSndFile->Order.GetSequence(nSeq).m_sName); + UINT state = (nSeq == pSndFile->Order.GetCurrentSequenceIndex()) ? TVIS_BOLD : 0; if(pInfo->tiSequences[nSeq] == NULL) Modified: trunk/OpenMPT/packageTemplate/OMPT_1.18_ReleaseNotes.html =================================================================== --- trunk/OpenMPT/packageTemplate/OMPT_1.18_ReleaseNotes.html 2010-04-20 19:38:59 UTC (rev 573) +++ trunk/OpenMPT/packageTemplate/OMPT_1.18_ReleaseNotes.html 2010-04-20 20:26:52 UTC (rev 574) @@ -90,6 +90,9 @@ <li>More <strong>customisable colours</strong>. Now, you can export your favourite colour scheme to a file and share it with your friends!</li> <li>Some <strong>new options</strong>, including the ability not to reset the channels when the module is looping and sample playback indicators in the treeview.</li> <li><strong>Program settings</strong> are now stored in the Application Data folder by default.</li> + <li>More <strong>intelligtent autosave</strong> behaviour, which does not autosave anymore if nothing has changed since the last autosave. + A friendly reminder: The autosave and backup options should always be enabled; You will be very glad about them once OpenMPT <i>really</i> crashes + or you accidentally overwrite a file.</strong> <li>New and <strong>updated keymaps</strong> with many new shortcuts!</li> <li><strong>Redesigned</strong> several dialogs.</li> </ul> @@ -109,6 +112,9 @@ The instrument column (XX) contains the VST number (can be obtained from the VST list or through the context menu). The volume column (YYY) stores the parameter that is going to be automatic, ranging from 0 to 999 (decimal). The effect column (ZZZ) stores the parameter value, also ranging from 0 to 999 (decimal).</li> + <li><strong>Note Fade</strong> is a new note type in IT / MPTM modules, based on an unfinished feature in Impulse Tracker. + As the name suggests, this note fades out the instrument depending on its fadeout value (without releasing any envelopes). + Therefore, it will not work in sample mode.</li> <li>In the <strong>orderlist</strong>, multiple orders can now be selected at once (default multiselect shortcut: Shift). Order selections can be quickly rendered to a wave file using the context menu.</li> <li>New <strong>paste modes</strong>: Overflow paste (which continues the paste in the next pattern if it reaches the bottom of the current pattern), @@ -143,8 +149,9 @@ <li>Enhanced <strong>VST compatibility</strong>.</li> </ul> + <h3>There's more...</h3> <p> - For a detailed description of what has changed, check <a href="history.txt">history.txt</a>. + For a detailed description of what has changed, check <a href="history.txt">history.txt</a>. </p> <h2>Known Issues</h2> @@ -164,8 +171,8 @@ <h2>Contact</h2> <p> - Helpful bug reports, new ideas and brave volunteers to test early development builds or contribute to the code are more than welcome! - You can meet us at the ModPlug Central forums: <a href="http://openmpt.com/forum/">http://openmpt.com/forum/</a>. + Helpful bug reports, new ideas and brave volunteers to test early development builds or contribute to the code are more than welcome! + You can meet us at the ModPlug Central forums: <a href="http://openmpt.com/forum/">http://openmpt.com/forum/</a>. </p> </body> Modified: trunk/OpenMPT/soundlib/Load_it.cpp =================================================================== --- trunk/OpenMPT/soundlib/Load_it.cpp 2010-04-20 19:38:59 UTC (rev 573) +++ trunk/OpenMPT/soundlib/Load_it.cpp 2010-04-20 20:26:52 UTC (rev 574) @@ -1494,7 +1494,7 @@ { m[ch].command = cmd; m[ch].param = param; - S3MConvert(&m[ch], TRUE); + S3MConvert(&m[ch], true); lastvalue[ch].command = m[ch].command; lastvalue[ch].param = m[ch].param; } @@ -2211,7 +2211,7 @@ if (vol != 0xFF) b |= 4; if (command) { - S3MSaveConvert(&command, ¶m, TRUE); + S3MSaveConvert(&command, ¶m, true); if (command) b |= 8; } // Packing information Modified: trunk/OpenMPT/soundlib/Load_s3m.cpp =================================================================== --- trunk/OpenMPT/soundlib/Load_s3m.cpp 2010-04-20 19:38:59 UTC (rev 573) +++ trunk/OpenMPT/soundlib/Load_s3m.cpp 2010-04-20 20:26:52 UTC (rev 574) @@ -75,7 +75,7 @@ S3I_TYPE_ADMEL = 2, }; -void CSoundFile::S3MConvert(MODCOMMAND *m, BOOL bIT) const +void CSoundFile::S3MConvert(MODCOMMAND *m, bool bIT) const //-------------------------------------------------------- { UINT command = m->command; @@ -119,8 +119,8 @@ } -void CSoundFile::S3MSaveConvert(UINT *pcmd, UINT *pprm, BOOL bIT, BOOL bCompatibilityExport) const -//--------------------------------------------------------------------------------------- +void CSoundFile::S3MSaveConvert(UINT *pcmd, UINT *pprm, bool bIT, bool bCompatibilityExport) const +//------------------------------------------------------------------------------------------------ { UINT command = *pcmd; UINT param = *pprm; @@ -198,13 +198,13 @@ break; // Chars under 0x40 don't save properly, so map : to ] and # to [. case CMD_DELAYCUT: - if(bCompatibilityExport) + if(bCompatibilityExport || !bIT) command = param = 0; else command = ']'; break; case CMD_XPARAM: - if(bCompatibilityExport) + if(bCompatibilityExport || !bIT) command = param = 0; else command = '['; @@ -457,7 +457,7 @@ if(j + nInd + 2 >= dwMemLength) break; m->command = src[j++]; m->param = src[j++]; - if (m->command) S3MConvert(m, FALSE); + if (m->command) S3MConvert(m, false); if(m->command == CMD_MIDI) { if(m->param > 0x0F) Modified: trunk/OpenMPT/soundlib/Sndfile.cpp =================================================================== --- trunk/OpenMPT/soundlib/Sndfile.cpp 2010-04-20 19:38:59 UTC (rev 573) +++ trunk/OpenMPT/soundlib/Sndfile.cpp 2010-04-20 20:26:52 UTC (rev 574) @@ -1829,7 +1829,7 @@ case RS_PCM16D: case RS_PCM16S: { - short int *p = (short int *)pSample; + uint16 *p = (uint16 *)pSample; int s_old = 0, s_ofs; len = nLen * 2; bufcount = 0; @@ -1845,11 +1845,11 @@ } if (nFlags == RS_PCM16D) { - *((short *)(&buffer[bufcount])) = (short)(s_new - s_old); + *((uint16 *)(&buffer[bufcount])) = (uint16)(s_new - s_old); s_old = s_new; } else { - *((short *)(&buffer[bufcount])) = (short)(s_new + s_ofs); + *((uint16 *)(&buffer[bufcount])) = (uint16)(s_new + s_ofs); } bufcount += 2; if (bufcount >= sizeof(buffer) - 1) @@ -1870,7 +1870,7 @@ int s_ofs = (nFlags == RS_STPCM8U) ? 0x80 : 0; for (UINT iCh=0; iCh<2; iCh++) { - signed char *p = pSample + iCh; + int8 *p = ((int8 *)pSample) + iCh; int s_old = 0; bufcount = 0; @@ -1880,11 +1880,11 @@ p += 2; if (nFlags == RS_STPCM8D) { - buffer[bufcount++] = (char)(s_new - s_old); + buffer[bufcount++] = (uint8)(s_new - s_old); s_old = s_new; } else { - buffer[bufcount++] = (char)(s_new + s_ofs); + buffer[bufcount++] = (uint8)(s_new + s_ofs); } if (bufcount >= sizeof(buffer)) { @@ -1906,7 +1906,7 @@ int s_ofs = (nFlags == RS_STPCM16U) ? 0x8000 : 0; for (UINT iCh=0; iCh<2; iCh++) { - signed short *p = ((signed short *)pSample) + iCh; + int16 *p = ((int16 *)pSample) + iCh; int s_old = 0; bufcount = 0; @@ -1916,11 +1916,11 @@ p += 2; if (nFlags == RS_STPCM16D) { - *((short *)(&buffer[bufcount])) = (short)(s_new - s_old); + *((uint16 *)(&buffer[bufcount])) = (uint16)(s_new - s_old); s_old = s_new; } else { - *((short *)(&buffer[bufcount])) = (short)(s_new + s_ofs); + *((uint16 *)(&buffer[bufcount])) = (uint16)(s_new + s_ofs); } bufcount += 2; if (bufcount >= sizeof(buffer)) @@ -1948,13 +1948,13 @@ len = nLen; bufcount = 0; { - signed char *p = pSample; + int8 *p = (int8 *)pSample; int sinc = (pSmp->uFlags & CHN_16BIT) ? 2 : 1; int s_old = 0, s_ofs = (nFlags == RS_PCM8U) ? 0x80 : 0; if (pSmp->uFlags & CHN_16BIT) p++; for (UINT j=0; j<len; j++) { - int s_new = (signed char)(*p); + int s_new = (int8)(*p); p += sinc; if (pSmp->uFlags & CHN_STEREO) { @@ -1963,11 +1963,11 @@ } if (nFlags == RS_PCM8D) { - buffer[bufcount++] = (char)(s_new - s_old); + buffer[bufcount++] = (uint8)(s_new - s_old); s_old = s_new; } else { - buffer[bufcount++] = (char)(s_new + s_ofs); + buffer[bufcount++] = (uint8)(s_new + s_ofs); } if (bufcount >= sizeof(buffer)) { @@ -3324,8 +3324,8 @@ } } // End if(m->command == CMD_PANNING8) - ///////////////////////////////////////////////////// - // Convert param control, extended envelope control + /////////////////////////////////////////////////////////////////////////////////////// + // MPTM to anything: Convert param control, extended envelope control, note delay+cut if(oldTypeIsMPT) { if(m->IsPcNote()) @@ -3342,6 +3342,12 @@ { m->param = 0x7C; } + + if(m->command == CMD_DELAYCUT) + { + m->command = CMD_S3MCMDEX; // when converting to MOD/XM, this will be converted to CMD_MODCMDEX later + m->param = 0xD0 | (m->param >> 4); // preserve delay nibble. + } } // End if(oldTypeIsMPT) ///////////////////////////////////////// @@ -3810,16 +3816,16 @@ 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_DELAYCUT: return 16; + case CMD_DELAYCUT: return 88; + case CMD_MODCMDEX: return 80; + case CMD_S3MCMDEX: return 72; + case CMD_PANBRELLO: return 64; + case CMD_XFINEPORTAUPDOWN: return 56; + case CMD_VIBRATO: return 48; + case CMD_FINEVIBRATO: return 40; + case CMD_TREMOLO: return 32; + case CMD_KEYOFF: return 24; + case CMD_SETENVPOSITION: return 16; case CMD_XPARAM: return 8; case CMD_NONE: default: return 0; Modified: trunk/OpenMPT/soundlib/Sndfile.h =================================================================== --- trunk/OpenMPT/soundlib/Sndfile.h 2010-04-20 19:38:59 UTC (rev 573) +++ trunk/OpenMPT/soundlib/Sndfile.h 2010-04-20 20:26:52 UTC (rev 574) @@ -746,8 +746,8 @@ MODTYPE GetBestSaveFormat() const; MODTYPE GetSaveFormats() const; void ConvertModCommand(MODCOMMAND *) const; - void S3MConvert(MODCOMMAND *m, BOOL bIT) const; - void S3MSaveConvert(UINT *pcmd, UINT *pprm, BOOL bIT, BOOL bCompatibilityExport = false) const; + void S3MConvert(MODCOMMAND *m, bool bIT) const; + void S3MSaveConvert(UINT *pcmd, UINT *pprm, bool bIT, bool bCompatibilityExport = false) const; WORD ModSaveCommand(const MODCOMMAND *m, const bool bXM, const bool bCompatibilityExport = false) const; static void ConvertCommand(MODCOMMAND *m, MODTYPE nOldType, MODTYPE nNewType); // Convert a complete MODCOMMAND item from one format to another This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <sag...@us...> - 2010-04-20 20:36:02
|
Revision: 575 http://modplug.svn.sourceforge.net/modplug/?rev=575&view=rev Author: saga-games Date: 2010-04-20 20:35:55 +0000 (Tue, 20 Apr 2010) Log Message: ----------- [Fix] Note Properties: It was still possible to input the "unused" volume effect (previously velocity) using this dialog. [Mod] Updated DE_jojo.mkb Modified Paths: -------------- trunk/OpenMPT/mptrack/Moddoc.cpp trunk/OpenMPT/packageTemplate/extraKeymaps/DE_jojo.mkb Modified: trunk/OpenMPT/mptrack/Moddoc.cpp =================================================================== --- trunk/OpenMPT/mptrack/Moddoc.cpp 2010-04-20 20:26:52 UTC (rev 574) +++ trunk/OpenMPT/mptrack/Moddoc.cpp 2010-04-20 20:35:55 UTC (rev 575) @@ -2863,7 +2863,7 @@ {VOLCMD_TONEPORTAMENTO, MOD_TYPE_XMITMPT, "g: Tone portamento"}, {VOLCMD_PORTAUP, MOD_TYPE_ITMPT, "f: Portamento up"}, {VOLCMD_PORTADOWN, MOD_TYPE_ITMPT, "e: Portamento down"}, - {VOLCMD_DELAYCUT, MOD_TYPE_ITMPT, ":: (currently unused)"}, + {VOLCMD_DELAYCUT, MOD_TYPE_NONE, ":: (currently unused)"}, {VOLCMD_OFFSET, MOD_TYPE_ITMPT, "o: Offset"}, //rewbs.volOff }; Modified: trunk/OpenMPT/packageTemplate/extraKeymaps/DE_jojo.mkb =================================================================== --- trunk/OpenMPT/packageTemplate/extraKeymaps/DE_jojo.mkb 2010-04-20 20:26:52 UTC (rev 574) +++ trunk/OpenMPT/packageTemplate/extraKeymaps/DE_jojo.mkb 2010-04-20 20:35:55 UTC (rev 575) @@ -226,12 +226,11 @@ 5:1242:0:71:1 //Vol command - Portamento: G (KeyDown) 5:1243:0:70:1 //Vol command - Portamento Up: F (KeyDown) 5:1244:0:69:1 //Vol command - Portamento Down: E (KeyDown) -5:1245:1:190: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: ZIRKUMFLEX (KeyDown) -6:1295:1:190:1 //FX pseudo-velocity (experimental): Shift+. (KeyDown) +6:1295:0:190:1 //FX combined note delay and note cut: . (KeyDown) 6:1666:0:191:1 //FX parameter extension command: # (KeyDown) //----( Pattern Context [bottom] - Param Col (7) )------------ This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <sag...@us...> - 2010-04-20 21:57:45
|
Revision: 576 http://modplug.svn.sourceforge.net/modplug/?rev=576&view=rev Author: saga-games Date: 2010-04-20 21:57:38 +0000 (Tue, 20 Apr 2010) Log Message: ----------- [Fix] Cleanup: Because of an error in GetNumPatterns(), the last pattern was checked when looking for unused samples which sometimes resulted in deleted samples (although they were actually used). [Fix] Mod Conversion: When converting from MOD to S3M or IT, the Invert Loop effect was not removed. [Mod] Release notes: Typo [Ref] Rewrote some array-based code with vectors. [Ref] Moved IsInstrumentUsed() / IsSampleUsed() to Sndfile.cpp instead of sampleio.cpp, as that appears more logical to me. Modified Paths: -------------- trunk/OpenMPT/mptrack/CleanupSong.cpp trunk/OpenMPT/mptrack/Moddoc.cpp trunk/OpenMPT/mptrack/Mptrack.h trunk/OpenMPT/packageTemplate/OMPT_1.18_ReleaseNotes.html trunk/OpenMPT/soundlib/Sampleio.cpp trunk/OpenMPT/soundlib/Sndfile.cpp Modified: trunk/OpenMPT/mptrack/CleanupSong.cpp =================================================================== --- trunk/OpenMPT/mptrack/CleanupSong.cpp 2010-04-20 20:35:55 UTC (rev 575) +++ trunk/OpenMPT/mptrack/CleanupSong.cpp 2010-04-20 21:57:38 UTC (rev 576) @@ -574,7 +574,7 @@ } } EndWaitCursor(); - if (nExt && !((pSndFile->m_nType & MOD_TYPE_IT) && (pSndFile->m_dwSongFlags & SONG_ITPROJECT))) + if (nExt && !((pSndFile->GetType() == MOD_TYPE_IT) && (pSndFile->m_dwSongFlags & SONG_ITPROJECT))) { //We don't remove an instrument's unused samples in an ITP. wsprintf(s, "OpenMPT detected %d sample%s referenced by an instrument,\n" "but not used in the song. Do you want to remove them?", nExt, (nExt == 1) ? "" : "s"); @@ -730,7 +730,7 @@ CSoundFile *pSndFile = m_pModDoc->GetSoundFile(); if(pSndFile == nullptr) return false; - INSTRUMENTINDEX usedmap[MAX_INSTRUMENTS]; + vector<bool> usedmap; INSTRUMENTINDEX swapmap[MAX_INSTRUMENTS]; INSTRUMENTINDEX swapdest[MAX_INSTRUMENTS]; CHAR s[512]; @@ -741,18 +741,21 @@ if (!pSndFile->m_nInstruments) return false; char removeSamples = -1; - if ( !((pSndFile->m_nType & MOD_TYPE_IT) && (pSndFile->m_dwSongFlags&SONG_ITPROJECT))) { //never remove an instrument's samples in ITP. - if(::MessageBox(NULL, "Remove samples associated with an instrument if they are unused?", "Removing unused instruments", MB_YESNO | MB_ICONQUESTION) == IDYES) { + if ( !((pSndFile->GetType() == MOD_TYPE_IT) && (pSndFile->m_dwSongFlags & SONG_ITPROJECT))) //never remove an instrument's samples in ITP. + { + if(::MessageBox(NULL, "Remove samples associated with an instrument if they are unused?", "Removing unused instruments", MB_YESNO | MB_ICONQUESTION) == IDYES) + { removeSamples = 1; } - } else { + } else + { ::MessageBox(NULL, "This is an IT project file, so no samples associated with a used instrument will be removed.", "Removing unused instruments", MB_OK | MB_ICONINFORMATION); } BeginWaitCursor(); - memset(usedmap, 0, sizeof(usedmap)); + usedmap.resize(pSndFile->GetNumInstruments() + 1, false); - for(INSTRUMENTINDEX i = pSndFile->m_nInstruments; i >= 1; i--) + for(INSTRUMENTINDEX i = pSndFile->GetNumInstruments(); i >= 1; i--) { if (!pSndFile->IsInstrumentUsed(i)) { @@ -762,12 +765,15 @@ // pSndFile->DestroyInstrument(i); pSndFile->DestroyInstrument(i, removeSamples); // -! BEHAVIOUR_CHANGE#0003 - if ((i == pSndFile->m_nInstruments) && (i>1)) pSndFile->m_nInstruments--; else bReorg = true; + if ((i == pSndFile->GetNumInstruments()) && (i>1)) + pSndFile->m_nInstruments--; + else + bReorg = true; END_CRITICAL(); nRemoved++; } else { - usedmap[i] = 1; + usedmap[i] = true; } } EndWaitCursor(); @@ -790,8 +796,8 @@ swapdest[nSwap] = nIndex; pSndFile->Instruments[nIndex] = pSndFile->Instruments[nIns]; pSndFile->Instruments[nIns] = nullptr; - usedmap[nIndex] = 1; - usedmap[nIns] = 0; + usedmap[nIndex] = true; + usedmap[nIns] = false; nSwap++; nIndex++; break; @@ -814,7 +820,7 @@ { for (UINT k=0; k<nSwap; k++) { - if (p->instr == swapmap[k]) p->instr = (BYTE)swapdest[k]; + if (p->instr == swapmap[k]) p->instr = (MODCOMMAND::INSTR)swapdest[k]; } } p++; Modified: trunk/OpenMPT/mptrack/Moddoc.cpp =================================================================== --- trunk/OpenMPT/mptrack/Moddoc.cpp 2010-04-20 20:35:55 UTC (rev 575) +++ trunk/OpenMPT/mptrack/Moddoc.cpp 2010-04-20 21:57:38 UTC (rev 576) @@ -1985,28 +1985,29 @@ #define MOD_TYPE_XMIT (MOD_TYPE_XM|MOD_TYPE_IT) #define MOD_TYPE_XMITMPT (MOD_TYPE_XM|MOD_TYPE_IT|MOD_TYPE_MPT) #define MOD_TYPE_ITMPT (MOD_TYPE_IT|MOD_TYPE_MPT) +#define MOD_TYPE_ALL 0xFFFFFFFF #define MAX_FXINFO 70 const MPTEFFECTINFO gFXInfo[MAX_FXINFO] = { - {CMD_ARPEGGIO, 0,0, 0, 0xFFFFFFFF, "Arpeggio"}, - {CMD_PORTAMENTOUP, 0,0, 0, 0xFFFFFFFF, "Portamento Up"}, - {CMD_PORTAMENTODOWN,0,0, 0, 0xFFFFFFFF, "Portamento Down"}, - {CMD_TONEPORTAMENTO,0,0, 0, 0xFFFFFFFF, "Tone portamento"}, - {CMD_VIBRATO, 0,0, 0, 0xFFFFFFFF, "Vibrato"}, - {CMD_TONEPORTAVOL, 0,0, 0, 0xFFFFFFFF, "Volslide+Toneporta"}, - {CMD_VIBRATOVOL, 0,0, 0, 0xFFFFFFFF, "VolSlide+Vibrato"}, - {CMD_TREMOLO, 0,0, 0, 0xFFFFFFFF, "Tremolo"}, - {CMD_PANNING8, 0,0, 0, 0xFFFFFFFF, "Set Panning"}, - {CMD_OFFSET, 0,0, 0, 0xFFFFFFFF, "Set Offset"}, - {CMD_VOLUMESLIDE, 0,0, 0, 0xFFFFFFFF, "Volume Slide"}, - {CMD_POSITIONJUMP, 0,0, 0, 0xFFFFFFFF, "Position Jump"}, + {CMD_ARPEGGIO, 0,0, 0, MOD_TYPE_ALL, "Arpeggio"}, + {CMD_PORTAMENTOUP, 0,0, 0, MOD_TYPE_ALL, "Portamento Up"}, + {CMD_PORTAMENTODOWN,0,0, 0, MOD_TYPE_ALL, "Portamento Down"}, + {CMD_TONEPORTAMENTO,0,0, 0, MOD_TYPE_ALL, "Tone portamento"}, + {CMD_VIBRATO, 0,0, 0, MOD_TYPE_ALL, "Vibrato"}, + {CMD_TONEPORTAVOL, 0,0, 0, MOD_TYPE_ALL, "Volslide+Toneporta"}, + {CMD_VIBRATOVOL, 0,0, 0, MOD_TYPE_ALL, "VolSlide+Vibrato"}, + {CMD_TREMOLO, 0,0, 0, MOD_TYPE_ALL, "Tremolo"}, + {CMD_PANNING8, 0,0, 0, MOD_TYPE_ALL, "Set Panning"}, + {CMD_OFFSET, 0,0, 0, MOD_TYPE_ALL, "Set Offset"}, + {CMD_VOLUMESLIDE, 0,0, 0, MOD_TYPE_ALL, "Volume Slide"}, + {CMD_POSITIONJUMP, 0,0, 0, MOD_TYPE_ALL, "Position Jump"}, {CMD_VOLUME, 0,0, 0, MOD_TYPE_MODXM, "Set Volume"}, - {CMD_PATTERNBREAK, 0,0, 0, 0xFFFFFFFF, "Pattern Break"}, + {CMD_PATTERNBREAK, 0,0, 0, MOD_TYPE_ALL, "Pattern Break"}, {CMD_RETRIG, 0,0, 0, MOD_TYPE_NOMOD, "Retrigger Note"}, - {CMD_SPEED, 0,0, 0, 0xFFFFFFFF, "Set Speed"}, - {CMD_TEMPO, 0,0, 0, 0xFFFFFFFF, "Set Tempo"}, + {CMD_SPEED, 0,0, 0, MOD_TYPE_ALL, "Set Speed"}, + {CMD_TEMPO, 0,0, 0, MOD_TYPE_ALL, "Set Tempo"}, {CMD_TREMOR, 0,0, 0, MOD_TYPE_NOMOD, "Tremor"}, {CMD_CHANNELVOLUME, 0,0, 0, MOD_TYPE_S3MITMPT, "Set channel volume"}, {CMD_CHANNELVOLSLIDE,0,0, 0, MOD_TYPE_S3MITMPT, "Channel volslide"}, @@ -2065,8 +2066,8 @@ // -> DESC="add extended parameter mechanism to pattern effects" {CMD_XPARAM, 0x00,0x00, 0, MOD_TYPE_XMITMPT, "X param"}, // -! NEW_FEATURE#0010 - {CMD_NOTESLIDEUP, 0x00,0x00, 0, 0, "Note Slide Up"}, // .IMF effect - {CMD_NOTESLIDEDOWN, 0x00,0x00, 0, 0, "Note Slide Down"}, // .IMF effect + {CMD_NOTESLIDEUP, 0x00,0x00, 0, MOD_TYPE_NONE, "Note Slide Up"}, // .IMF effect + {CMD_NOTESLIDEDOWN, 0x00,0x00, 0, MOD_TYPE_NONE, "Note Slide Down"}, // .IMF effect }; Modified: trunk/OpenMPT/mptrack/Mptrack.h =================================================================== --- trunk/OpenMPT/mptrack/Mptrack.h 2010-04-20 20:35:55 UTC (rev 575) +++ trunk/OpenMPT/mptrack/Mptrack.h 2010-04-20 21:57:38 UTC (rev 576) @@ -439,7 +439,7 @@ STATIC_ASSERT(ARRAYELEMCOUNT(szSpecialNoteShortDesc) == ARRAYELEMCOUNT(szSpecialNoteNames)); const LPCSTR szHexChar = "0123456789ABCDEF"; -const LPCSTR gszModCommands = " 0123456789ABCDRFFTE???GHK?YXPLZ\\:#??"; //rewbs.smoothVST: added last \ (written as \\); +const LPCSTR gszModCommands = " 0123456789ABCDRFFTE???GHK?YXPLZ\\?#??"; //rewbs.smoothVST: added last \ (written as \\); const LPCSTR gszS3mCommands = " JFEGHLKRXODB?CQATI?SMNVW?UY?P?Z\\:#??"; //rewbs.smoothVST: added last \ (written as \\); const LPCSTR gszVolCommands = " vpcdabuhlrgfe:o"; const TCHAR gszEmpty[] = TEXT(""); Modified: trunk/OpenMPT/packageTemplate/OMPT_1.18_ReleaseNotes.html =================================================================== --- trunk/OpenMPT/packageTemplate/OMPT_1.18_ReleaseNotes.html 2010-04-20 20:35:55 UTC (rev 575) +++ trunk/OpenMPT/packageTemplate/OMPT_1.18_ReleaseNotes.html 2010-04-20 21:57:38 UTC (rev 576) @@ -110,7 +110,7 @@ The pattern event stores all necessary information and can thus be moved around easily in the pattern. The format for those events is: PC(s) XX YYY ZZZ. A PC "note" equals a Zxx effect, a PCs "note" behaves like \xx. The instrument column (XX) contains the VST number (can be obtained from the VST list or through the context menu). - The volume column (YYY) stores the parameter that is going to be automatic, ranging from 0 to 999 (decimal). + The volume column (YYY) stores the parameter that is going to be automated, ranging from 0 to 999 (decimal). The effect column (ZZZ) stores the parameter value, also ranging from 0 to 999 (decimal).</li> <li><strong>Note Fade</strong> is a new note type in IT / MPTM modules, based on an unfinished feature in Impulse Tracker. As the name suggests, this note fades out the instrument depending on its fadeout value (without releasing any envelopes). Modified: trunk/OpenMPT/soundlib/Sampleio.cpp =================================================================== --- trunk/OpenMPT/soundlib/Sampleio.cpp 2010-04-20 20:35:55 UTC (rev 575) +++ trunk/OpenMPT/soundlib/Sampleio.cpp 2010-04-20 21:57:38 UTC (rev 576) @@ -133,79 +133,34 @@ } -bool CSoundFile::IsSampleUsed(SAMPLEINDEX nSample) -//------------------------------------------------ -{ - if ((!nSample) || (nSample > m_nSamples)) return false; - if (m_nInstruments) - { - for (UINT i=1; i<=m_nInstruments; i++) if (Instruments[i]) - { - MODINSTRUMENT *pIns = Instruments[i]; - for (UINT j=0; j<128; j++) - { - if (pIns->Keyboard[j] == nSample) return true; - } - } - } else - { - for (UINT i=0; i<Patterns.Size(); i++) if (Patterns[i]) - { - MODCOMMAND *m = Patterns[i]; - for (UINT j=m_nChannels*PatternSize[i]; j; m++, j--) - { - if (m->instr == nSample) return true; - } - } - } - return false; -} - - -bool CSoundFile::IsInstrumentUsed(INSTRUMENTINDEX nInstr) -//------------------------------------------------------- -{ - if ((!nInstr) || (nInstr > m_nInstruments) || (!Instruments[nInstr])) return false; - for (UINT i=0; i<Patterns.Size(); i++) if (Patterns[i]) - { - MODCOMMAND *m = Patterns[i]; - for (UINT j=m_nChannels*PatternSize[i]; j; m++, j--) - { - if (m->instr == nInstr) return true; - } - } - return false; -} - - // Removing all unused samples bool CSoundFile::RemoveInstrumentSamples(INSTRUMENTINDEX nInstr) //-------------------------------------------------------------- { - BYTE sampleused[MAX_SAMPLES/8]; - - memset(sampleused, 0, sizeof(sampleused)); + vector<bool> sampleused; + sampleused.resize(GetNumSamples() + 1, false); + if (Instruments[nInstr]) { MODINSTRUMENT *p = Instruments[nInstr]; for (UINT r=0; r<128; r++) { UINT n = p->Keyboard[r]; - if (n < MAX_SAMPLES) sampleused[n>>3] |= (1<<(n&7)); + if (n <= GetNumSamples()) sampleused[n] = true; } - for (SAMPLEINDEX nSmp=1; nSmp<MAX_INSTRUMENTS; nSmp++) if ((Instruments[nSmp]) && (nSmp != nInstr)) + for (INSTRUMENTINDEX nIns = 1; nIns < MAX_INSTRUMENTS; nIns++) if ((Instruments[nIns]) && (nIns != nInstr)) { - p = Instruments[nSmp]; + p = Instruments[nIns]; for (UINT r=0; r<128; r++) { UINT n = p->Keyboard[r]; - if (n < MAX_SAMPLES) sampleused[n>>3] &= ~(1<<(n&7)); + if (n <= GetNumSamples()) sampleused[n] = false; } } - for (SAMPLEINDEX d = 1; d <= m_nSamples; d++) if (sampleused[d>>3] & (1<<(d&7))) + for (SAMPLEINDEX nSmp = 1; nSmp <= GetNumSamples(); nSmp++) if (sampleused[nSmp]) { - DestroySample(d); - m_szNames[d][0] = 0; + DestroySample(nSmp); + m_szNames[nSmp][0] = 0; } return true; } @@ -226,7 +181,7 @@ // -> CODE#0003 // -> DESC="remove instrument's samples" // RemoveInstrumentSamples(nInstr); - DestroyInstrument(nInstr,1); + DestroyInstrument(nInstr, 1); // -! BEHAVIOUR_CHANGE#0003 if (!Instruments[nInstr]) Instruments[nInstr] = new MODINSTRUMENT; MODINSTRUMENT *pIns = Instruments[nInstr]; Modified: trunk/OpenMPT/soundlib/Sndfile.cpp =================================================================== --- trunk/OpenMPT/soundlib/Sndfile.cpp 2010-04-20 20:35:55 UTC (rev 575) +++ trunk/OpenMPT/soundlib/Sndfile.cpp 2010-04-20 21:57:38 UTC (rev 576) @@ -1102,7 +1102,7 @@ for(PATTERNINDEX i = 0; i < Patterns.Size(); i++) { if(Patterns.IsValidPat(i)) - max = i; + max = i + 1; } return max; } @@ -2717,6 +2717,51 @@ #ifndef FASTSOUNDLIB +bool CSoundFile::IsSampleUsed(SAMPLEINDEX nSample) +//------------------------------------------------ +{ + if ((!nSample) || (nSample > m_nSamples)) return false; + if (m_nInstruments) + { + for (UINT i=1; i<=m_nInstruments; i++) if (Instruments[i]) + { + MODINSTRUMENT *pIns = Instruments[i]; + for (UINT j=0; j<128; j++) + { + if (pIns->Keyboard[j] == nSample) return true; + } + } + } else + { + for (UINT i=0; i<Patterns.Size(); i++) if (Patterns[i]) + { + MODCOMMAND *m = Patterns[i]; + for (UINT j=m_nChannels*PatternSize[i]; j; m++, j--) + { + if (m->instr == nSample && !m->IsPcNote()) return true; + } + } + } + return false; +} + + +bool CSoundFile::IsInstrumentUsed(INSTRUMENTINDEX nInstr) +//------------------------------------------------------- +{ + if ((!nInstr) || (nInstr > m_nInstruments) || (!Instruments[nInstr])) return false; + for (UINT i=0; i<Patterns.Size(); i++) if (Patterns[i]) + { + MODCOMMAND *m = Patterns[i]; + for (UINT j=m_nChannels*PatternSize[i]; j; m++, j--) + { + if (m->instr == nInstr && !m->IsPcNote()) return true; + } + } + return false; +} + + UINT CSoundFile::DetectUnusedSamples(BYTE *pbIns) //----------------------------------------------- { @@ -3542,6 +3587,7 @@ break; case CMD_MODCMDEX: // This would turn into "Set Active Macro", so let's better remove it + case CMD_S3MCMDEX: if((m->param & 0xF0) == 0xF0) m->command = CMD_NONE; break; } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <sag...@us...> - 2010-04-25 20:42:43
|
Revision: 577 http://modplug.svn.sourceforge.net/modplug/?rev=577&view=rev Author: saga-games Date: 2010-04-25 20:42:36 +0000 (Sun, 25 Apr 2010) Log Message: ----------- [Fix] DBM Loader: Various fixes to increase import precision and an endianness fix [Fix] Further fixes to the song length detection code [Fix] VST Editor: Preset names starting with ' ' >= char > 'A' were cropped (i.e. "123ABC" was displayed as "ABC") [Fix] Mod Conversion: When converting to MOD/S3M, the extended filter range flag was not deactivated. Modified Paths: -------------- trunk/OpenMPT/mptrack/AbstractVstEditor.cpp trunk/OpenMPT/mptrack/Modedit.cpp trunk/OpenMPT/soundlib/LOAD_DBM.CPP trunk/OpenMPT/soundlib/Snd_fx.cpp Modified: trunk/OpenMPT/mptrack/AbstractVstEditor.cpp =================================================================== --- trunk/OpenMPT/mptrack/AbstractVstEditor.cpp 2010-04-20 21:57:38 UTC (rev 576) +++ trunk/OpenMPT/mptrack/AbstractVstEditor.cpp 2010-04-25 20:42:36 UTC (rev 577) @@ -24,7 +24,7 @@ else { size_t k=0; - while(k < rnSize-1 && rawname[k] != 0 && rawname[k] < 'A' && k<255) k++; + while(k < rnSize-1 && rawname[k] != 0 && rawname[k] <= ' ' && k<255) k++; wsprintf(name, "%02d - %s", p, &rawname[k]); } name[nSize-1] = 0; Modified: trunk/OpenMPT/mptrack/Modedit.cpp =================================================================== --- trunk/OpenMPT/mptrack/Modedit.cpp 2010-04-20 21:57:38 UTC (rev 576) +++ trunk/OpenMPT/mptrack/Modedit.cpp 2010-04-25 20:42:36 UTC (rev 577) @@ -356,6 +356,7 @@ if (!newTypeIsIT_MPT) m_SndFile.m_dwSongFlags &= ~(SONG_ITOLDEFFECTS|SONG_ITCOMPATMODE); if (!newTypeIsS3M) m_SndFile.m_dwSongFlags &= ~SONG_FASTVOLSLIDES; if (!newTypeIsMOD) m_SndFile.m_dwSongFlags &= ~SONG_PT1XMODE; + if (newTypeIsS3M || newTypeIsMOD) m_SndFile.m_dwSongFlags &= ~SONG_EXFILTERRANGE; END_CRITICAL(); ChangeFileExtension(nNewType); Modified: trunk/OpenMPT/soundlib/LOAD_DBM.CPP =================================================================== --- trunk/OpenMPT/soundlib/LOAD_DBM.CPP 2010-04-20 21:57:38 UTC (rev 576) +++ trunk/OpenMPT/soundlib/LOAD_DBM.CPP 2010-04-25 20:42:36 UTC (rev 577) @@ -19,8 +19,6 @@ #include "stdafx.h" #include "sndfile.h" -#pragma warning(disable:4244) //"conversion from 'type1' to 'type2', possible loss of data" - #define DBM_FILE_MAGIC 0x304d4244 #define DBM_ID_NAME 0x454d414e #define DBM_NAMELEN 0x2c000000 @@ -97,12 +95,93 @@ #pragma pack() +static MODCOMMAND::COMMAND dbm_efftrans[23] = +{ + CMD_ARPEGGIO, CMD_PORTAMENTOUP, CMD_PORTAMENTODOWN, CMD_TONEPORTAMENTO, + CMD_VIBRATO, CMD_TONEPORTAVOL, CMD_VIBRATOVOL, CMD_TREMOLO, + CMD_PANNING8, CMD_OFFSET, CMD_VOLUMESLIDE, CMD_POSITIONJUMP, + CMD_VOLUME, CMD_PATTERNBREAK, CMD_MODCMDEX, CMD_TEMPO, + CMD_GLOBALVOLUME, CMD_GLOBALVOLSLIDE, CMD_KEYOFF, CMD_SETENVPOSITION, + CMD_CHANNELVOLUME, CMD_CHANNELVOLSLIDE, CMD_PANNINGSLIDE, +}; + + +void ConvertDBMEffect(uint8 *command, uint8 *param) +//---------------------------------- +{ + if(*command < ARRAYELEMCOUNT(dbm_efftrans)) + *command = dbm_efftrans[*command]; + else + *command = CMD_NONE; + + switch (*command) + { + case CMD_ARPEGGIO: + if(*param == 0) + *command = CMD_NONE; + break; + case CMD_VOLUMESLIDE: + if(*param & 0xF0) + *param &= 0xF0; + break; + case CMD_MODCMDEX: + switch(*param & 0xF0) + { + case 0x00: // set filter + *command = CMD_NONE; + break; + case 0x30: // play backwards + *command = CMD_S3MCMDEX; + *param = 0x9F; + break; + case 0x40: // turn off sound in channel + // TODO + break; + case 0x50: // turn on/off channel + // TODO is this correct? + if((*param & 0x0F) <= 0x01) + { + *command = CMD_CHANNELVOLUME; + *param = (*param == 0x50) ? 0x00 : 0x40; + } + break; + case 0x60: // set loop begin / loop + // TODO + break; + case 0x70: // set offset + // TODO + break; + case 0xF0: // turn on/off channel + // TODO + break; + default: + // Rest will be converted later from CMD_MODCMDEX to CMD_S3MCMDEX. + break; + } + break; + case CMD_TEMPO: + if(*param <= 0x1F) *command = CMD_SPEED; + break; + case CMD_KEYOFF: + if (*param == 0) + { + // TODO key of at tick 0 + } + break; + case CMD_OFFSET: + // TODO Sample offset slide + *command = CMD_NONE; + break; + } +} + + bool CSoundFile::ReadDBM(const BYTE *lpStream, DWORD dwMemLength) //--------------------------------------------------------------- { const DBMFILEHEADER *pfh = (DBMFILEHEADER *)lpStream; DWORD dwMemPos; - UINT nOrders, nSamples, nInstruments, nPatterns; + uint16 nOrders, nSamples, nInstruments, nPatterns; if ((!lpStream) || (dwMemLength <= sizeof(DBMFILEHEADER)) || (!pfh->channels) || (pfh->dbm_id != DBM_FILE_MAGIC) || (!pfh->songs) || (pfh->song_id != DBM_ID_SONG) @@ -115,9 +194,7 @@ nSamples = BigEndianW(pfh->samples); nPatterns = BigEndianW(pfh->patterns); m_nType = MOD_TYPE_DBM; - m_nChannels = BigEndianW(pfh->channels); - if (m_nChannels < 1) m_nChannels = 1; - if (m_nChannels > 64) m_nChannels = 64; + m_nChannels = CLAMP(BigEndianW(pfh->channels), 1, MAX_BASECHANNELS); // note: MAX_BASECHANNELS is currently 127, but DBM supports up to 128 channels. memcpy(m_szNames[0], (pfh->songname[0]) ? pfh->songname : pfh->songname2, 32); SpaceToNullStringFixed(m_szNames[0], 31); Order.resize(nOrders, Order.GetInvalidPatIndex()); @@ -129,7 +206,7 @@ dwMemPos += 2*nOrders; while (dwMemPos + 10 < dwMemLength) { - DWORD chunk_id = ((LPDWORD)(lpStream+dwMemPos))[0]; + DWORD chunk_id = LittleEndian(((LPDWORD)(lpStream+dwMemPos))[0]); DWORD chunk_size = BigEndian(((LPDWORD)(lpStream+dwMemPos))[1]); DWORD chunk_pos; @@ -141,19 +218,22 @@ if (chunk_id == DBM_ID_INST) { if (nInstruments >= MAX_INSTRUMENTS) nInstruments = MAX_INSTRUMENTS-1; - for (UINT iIns=0; iIns<nInstruments; iIns++) + for(INSTRUMENTINDEX iIns = 0; iIns < nInstruments; iIns++) { MODSAMPLE *psmp; MODINSTRUMENT *pIns; DBMINSTRUMENT *pih; - UINT nsmp; + WORD nsmp; if (chunk_pos + sizeof(DBMINSTRUMENT) > dwMemPos) break; - if ((pIns = new MODINSTRUMENT) == NULL) break; - pih = (DBMINSTRUMENT *)(lpStream+chunk_pos); + if ((pIns = new MODINSTRUMENT) == nullptr) break; + memset(pIns, 0, sizeof(MODINSTRUMENT)); + SetDefaultInstrumentValues(pIns); + Instruments[iIns + 1] = pIns; + + pih = (DBMINSTRUMENT *)(lpStream + chunk_pos); nsmp = BigEndianW(pih->sampleno); - psmp = ((nsmp) && (nsmp < MAX_SAMPLES)) ? &Samples[nsmp] : NULL; - memset(pIns, 0, sizeof(MODINSTRUMENT)); + psmp = ((nsmp) && (nsmp < MAX_SAMPLES)) ? &Samples[nsmp] : nullptr; memcpy(pIns->name, pih->name, 30); SpaceToNullStringFixed(pIns->name, 30); if (psmp) @@ -161,7 +241,7 @@ memcpy(m_szNames[nsmp], pih->name, 30); SpaceToNullStringFixed(m_szNames[nsmp], 30); } - Instruments[iIns+1] = pIns; + pIns->nFadeOut = 1024; // ??? pIns->nGlobalVol = 64; pIns->nPan = BigEndianW(pih->panning); @@ -169,12 +249,12 @@ pIns->dwFlags = INS_SETPANNING; else pIns->nPan = 128; - pIns->nPPC = 5*12; - SetDefaultInstrumentValues(pIns); - for (UINT i=0; i<NOTE_MAX; i++) + pIns->nPPC = 5 * 12; + + for (BYTE i = 0; i < NOTE_MAX; i++) { pIns->Keyboard[i] = nsmp; - pIns->NoteMap[i] = i+1; + pIns->NoteMap[i] = i + 1; } // Sample Info if (psmp) @@ -185,7 +265,7 @@ psmp->nGlobalVol = 64; psmp->nC5Speed = BigEndian(pih->finetune); int f2t = FrequencyToTranspose(psmp->nC5Speed); - psmp->RelativeTone = f2t >> 7; + psmp->RelativeTone = (signed char)(f2t >> 7); psmp->nFineTune = f2t & 0x7F; if ((pih->looplen) && (sflags & 3)) { @@ -197,7 +277,7 @@ } } chunk_pos += sizeof(DBMINSTRUMENT); - m_nInstruments = iIns+1; + m_nInstruments = iIns + 1; } } else // Volume Envelopes @@ -239,7 +319,7 @@ if (chunk_id == DBM_ID_PATT) { if (nPatterns > MAX_PATTERNS) nPatterns = MAX_PATTERNS; - for (UINT iPat=0; iPat<nPatterns; iPat++) + for(PATTERNINDEX iPat = 0; iPat < nPatterns; iPat++) { DBMPATTERN *pph; DWORD pksize; @@ -272,47 +352,64 @@ { if (b & 0x01) { - UINT note = pkdata[i++]; + uint8 note = pkdata[i++]; - if (note == 0x1F) note = 0xFF; else + if (note == 0x1F) note = NOTE_KEYOFF; else if ((note) && (note < 0xFE)) { - note = ((note >> 4)*12) + (note & 0x0F) + 13; + note = ((note >> 4) * 12) + (note & 0x0F) + 13; } m[ch].note = note; } if (b & 0x02) m[ch].instr = pkdata[i++]; if (b & 0x3C) { - UINT cmd1 = 0xFF, param1 = 0, cmd2 = 0xFF, param2 = 0; - if (b & 0x04) cmd1 = (UINT)pkdata[i++]; - if (b & 0x08) param1 = pkdata[i++]; - if (b & 0x10) cmd2 = (UINT)pkdata[i++]; - if (b & 0x20) param2 = pkdata[i++]; - if (cmd1 == 0x0C) + uint8 cmd1 = CMD_NONE, cmd2 = CMD_NONE; + uint8 param1 = 0, param2 = 0; + if (b & 0x04) cmd2 = pkdata[i++]; + if (b & 0x08) param2 = pkdata[i++]; + if (b & 0x10) cmd1 = pkdata[i++]; + if (b & 0x20) param1 = pkdata[i++]; + ConvertDBMEffect(&cmd1, ¶m1); + ConvertDBMEffect(&cmd2, ¶m2); + + // this is the same conversion algorithm as in the ULT loader. maybe this should be merged at some point... + if (cmd2 == CMD_VOLUME || (cmd2 == CMD_NONE && cmd1 != CMD_VOLUME)) { - m[ch].volcmd = VOLCMD_VOLUME; - m[ch].vol = param1; - cmd1 = 0xFF; - } else - if (cmd2 == 0x0C) - { - m[ch].volcmd = VOLCMD_VOLUME; - m[ch].vol = param2; - cmd2 = 0xFF; + std::swap(cmd1, cmd2); + std::swap(param1, param2); } - if ((cmd1 > 0x13) || ((cmd1 >= 0x10) && (cmd2 < 0x10))) + + int n; + for (n = 0; n < 4; n++) { - cmd1 = cmd2; - param1 = param2; - cmd2 = 0xFF; + if(CSoundFile::ConvertVolEffect(&cmd1, ¶m1, (n >> 1) ? true : false)) + { + n = 5; + break; + } + std::swap(cmd1, cmd2); + std::swap(param1, param2); } - if (cmd1 <= 0x13) + if (n < 5) { - m[ch].command = cmd1; - m[ch].param = param1; - ConvertModCommand(&m[ch]); + if (CSoundFile::GetEffectWeight((MODCOMMAND::COMMAND)cmd1) > CSoundFile::GetEffectWeight((MODCOMMAND::COMMAND)cmd2)) + { + std::swap(cmd1, cmd2); + std::swap(param1, param2); + } + cmd1 = CMD_NONE; } + if (!cmd1) + param1 = 0; + if (!cmd2) + param2 = 0; + + m[ch].volcmd = cmd1; + m[ch].vol = param1; + m[ch].command = cmd2; + m[ch].param = param2; + MODExx2S3MSxx(&m[ch]); } } else { Modified: trunk/OpenMPT/soundlib/Snd_fx.cpp =================================================================== --- trunk/OpenMPT/soundlib/Snd_fx.cpp 2010-04-20 21:57:38 UTC (rev 576) +++ trunk/OpenMPT/soundlib/Snd_fx.cpp 2010-04-25 20:42:36 UTC (rev 577) @@ -150,7 +150,7 @@ } nPattern = (nCurrentPattern < Order.size()) ? Order[nCurrentPattern] : Order.GetInvalidPatIndex(); nNextPattern = nCurrentPattern; - if(IsRowVisited(nCurrentPattern, 0, true)) + if((!Patterns.IsValidPat(nPattern)) && IsRowVisited(nCurrentPattern, 0, true)) break; } // Skip non-existing patterns @@ -2877,7 +2877,7 @@ { // EFx implementation for MOD files (PT 1.1A and up: Invert Loop) // This effect trashes samples. Thanks to 8bitbubsy for making this work. :) - if((m_nType & MOD_TYPE_MOD) == 0 || pChn->nEFxSpeed == 0) return; + if((GetType() == MOD_TYPE_MOD) == 0 || pChn->nEFxSpeed == 0) return; // we obviously also need a sample for this MODSAMPLE *pModSample = pChn->pModSample; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <sag...@us...> - 2010-04-27 21:15:06
|
Revision: 578 http://modplug.svn.sourceforge.net/modplug/?rev=578&view=rev Author: saga-games Date: 2010-04-27 21:14:59 +0000 (Tue, 27 Apr 2010) Log Message: ----------- [Fix] Mod Conversion: S00 (IT/S3M) does not equal E00 (MOD/XM), as Exx doesn't have effect memory. Trying to convert S00 to the last used value now. [Ref] That one comparison that was changed in Snd_fx.cpp in the last revision might have worked, but it's looking slightly wrong... Modified Paths: -------------- trunk/OpenMPT/mptrack/Modedit.cpp trunk/OpenMPT/soundlib/Snd_fx.cpp Modified: trunk/OpenMPT/mptrack/Modedit.cpp =================================================================== --- trunk/OpenMPT/mptrack/Modedit.cpp 2010-04-25 20:42:36 UTC (rev 577) +++ trunk/OpenMPT/mptrack/Modedit.cpp 2010-04-27 21:14:59 UTC (rev 578) @@ -171,8 +171,13 @@ MODCOMMAND *m = m_SndFile.Patterns[nPat]; // This is used for -> MOD/XM conversion - BYTE cEffectMemory[MAX_BASECHANNELS][MAX_EFFECTS]; - memset(&cEffectMemory, 0, sizeof(BYTE) * MAX_BASECHANNELS * MAX_EFFECTS); + vector<vector<MODCOMMAND::PARAM> > cEffectMemory; + cEffectMemory.resize(m_SndFile.GetNumChannels()); + for(size_t i = 0; i < m_SndFile.GetNumChannels(); i++) + { + cEffectMemory[i].resize(MAX_EFFECTS, 0); + } + UINT nChannel = m_SndFile.m_nChannels - 1; for (UINT len = m_SndFile.PatternSize[nPat] * m_SndFile.m_nChannels; len; m++, len--) @@ -187,11 +192,13 @@ switch(m->command) { case CMD_ARPEGGIO: + case CMD_S3MCMDEX: + case CMD_MODCMDEX: // No effect memory in XM / MOD if(m->param == 0) - m->param = cEffectMemory[nChannel][CMD_ARPEGGIO]; + m->param = cEffectMemory[nChannel][m->command]; else - cEffectMemory[nChannel][CMD_ARPEGGIO] = m->param; + cEffectMemory[nChannel][m->command] = m->param; break; } } Modified: trunk/OpenMPT/soundlib/Snd_fx.cpp =================================================================== --- trunk/OpenMPT/soundlib/Snd_fx.cpp 2010-04-25 20:42:36 UTC (rev 577) +++ trunk/OpenMPT/soundlib/Snd_fx.cpp 2010-04-27 21:14:59 UTC (rev 578) @@ -2877,7 +2877,7 @@ { // EFx implementation for MOD files (PT 1.1A and up: Invert Loop) // This effect trashes samples. Thanks to 8bitbubsy for making this work. :) - if((GetType() == MOD_TYPE_MOD) == 0 || pChn->nEFxSpeed == 0) return; + if(GetType() != MOD_TYPE_MOD || pChn->nEFxSpeed == 0) return; // we obviously also need a sample for this MODSAMPLE *pModSample = pChn->pModSample; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <sag...@us...> - 2010-04-28 20:52:52
|
Revision: 579 http://modplug.svn.sourceforge.net/modplug/?rev=579&view=rev Author: saga-games Date: 2010-04-28 20:52:46 +0000 (Wed, 28 Apr 2010) Log Message: ----------- [Reg] Pattern Editor: Creating a selection using the Shift key + Mouse click now only works if there was previously no selection made; This seems reasonable as the old shift-behaviour seems to be widely used. [Mod] Updated release notes. Modified Paths: -------------- trunk/OpenMPT/mptrack/View_pat.cpp trunk/OpenMPT/packageTemplate/OMPT_1.18_ReleaseNotes.html Modified: trunk/OpenMPT/mptrack/View_pat.cpp =================================================================== --- trunk/OpenMPT/mptrack/View_pat.cpp 2010-04-27 21:14:59 UTC (rev 578) +++ trunk/OpenMPT/mptrack/View_pat.cpp 2010-04-28 20:52:46 UTC (rev 579) @@ -998,7 +998,7 @@ DragToSel(m_dwEndSel, TRUE); } else */ { - if(CMainFrame::GetInputHandler()->ShiftPressed()) + if(CMainFrame::GetInputHandler()->ShiftPressed() && m_dwStartSel == m_dwEndSel) { // Shift pressed -> set 2nd selection point DragToSel(GetPositionFromPoint(point), TRUE); @@ -4241,7 +4241,7 @@ // -- write sdx if playing live if (usePlaybackPosition && nTick) // avoid SD0 which will be mis-interpreted { - if (p->command == 0) //make sure we don't overwrite any existing commands. + if (p->command == CMD_NONE) //make sure we don't overwrite any existing commands. { p->command = (pSndFile->TypeIsS3M_IT_MPT()) ? CMD_S3MCMDEX : CMD_MODCMDEX; UINT maxSpeed = 0x0F; @@ -4251,9 +4251,8 @@ } // -- old style note cut/off: erase instrument number - if (oldStyle && ((p->note == NOTE_NOTECUT) || (p->note == NOTE_KEYOFF) || (p->note == NOTE_FADE))) { + if (oldStyle && ((p->note == NOTE_NOTECUT) || (p->note == NOTE_KEYOFF) || (p->note == NOTE_FADE))) p->instr=0; - } // -- if recording, handle post note entry behaviour (move cursor etc..) if(bRecordEnabled) Modified: trunk/OpenMPT/packageTemplate/OMPT_1.18_ReleaseNotes.html =================================================================== --- trunk/OpenMPT/packageTemplate/OMPT_1.18_ReleaseNotes.html 2010-04-27 21:14:59 UTC (rev 578) +++ trunk/OpenMPT/packageTemplate/OMPT_1.18_ReleaseNotes.html 2010-04-28 20:52:46 UTC (rev 579) @@ -48,8 +48,18 @@ h3 { border-left-width: 2em; } h4 { border-left-width: 1em; } - li {list-style-type: none; padding:0 0 1em 0; } + li {list-style-type: none; padding: 0 0 1em 0; } li:before { content: "» "; } + + li li { padding: 0; } + + /* use this for pattern data */ + pre + { + font-family: monospace; + display: inline; + color: #006; + } </style> </head> @@ -92,7 +102,7 @@ <li><strong>Program settings</strong> are now stored in the Application Data folder by default.</li> <li>More <strong>intelligtent autosave</strong> behaviour, which does not autosave anymore if nothing has changed since the last autosave. A friendly reminder: The autosave and backup options should always be enabled; You will be very glad about them once OpenMPT <i>really</i> crashes - or you accidentally overwrite a file.</strong> + or you accidentally overwrite a file.</li> <li>New and <strong>updated keymaps</strong> with many new shortcuts!</li> <li><strong>Redesigned</strong> several dialogs.</li> </ul> @@ -105,22 +115,29 @@ <li>The upper panel is a lot more <strong>compact</strong> now; The split keyboard settings have been moved to a separate dialog which can be called with a keyboard shortcut or through the main menu.</li> - <li><strong>Parameter Control Notes</strong>: These new pattern events almost completely replace Zxx and \xx commands + <li><strong>Parameter Control Notes</strong>: These new pattern events almost completely replace <pre>Zxx</pre> and <pre>\xx</pre> commands for VST parameter automation in the MPTM format. They are not bound to a specific channel or macro anymore; The pattern event stores all necessary information and can thus be moved around easily in the pattern. - The format for those events is: PC(s) XX YYY ZZZ. A PC "note" equals a Zxx effect, a PCs "note" behaves like \xx. - The instrument column (XX) contains the VST number (can be obtained from the VST list or through the context menu). - The volume column (YYY) stores the parameter that is going to be automated, ranging from 0 to 999 (decimal). - The effect column (ZZZ) stores the parameter value, also ranging from 0 to 999 (decimal).</li> - <li><strong>Note Fade</strong> is a new note type in IT / MPTM modules, based on an unfinished feature in Impulse Tracker. + The format for those events is <pre>PC(s) XX YYY ZZZ</pre>, the parameters work as follows: + <ul> + <li>A <pre>PC</pre> "note" entry equals a <pre>Zxx</pre> effect, a <pre>PCs</pre> "note" behaves like <pre>\xx</pre>.</li> + <li>The instrument column (<pre>XX</pre>) contains the VST number (can be obtained from the VST list or through the context menu).</li> + <li>The volume column (<pre>YYY</pre>) stores the parameter that is going to be automated, ranging from <pre>000</pre> to <pre>999</pre> (decimal).</li> + <li>The effect column (<pre>ZZZ</pre>) stores the parameter value, also ranging from <pre>000</pre> to <pre>999</pre> (decimal).</li> + </ul> + </li> + <li><strong>Note Fade</strong> is a new note type in IT / MPTM modules, based on an unfinished feature in Impulse Tracker, displayed as <pre>~~</pre>. As the name suggests, this note fades out the instrument depending on its fadeout value (without releasing any envelopes). - Therefore, it will not work in sample mode.</li> + Therefore, it will not work in sample mode. Various players and trackers support this command already.</li> + <li>New combined effect in the MPTM format: <strong>Note Delay + Cut</strong>. Format is <pre>:xy</pre>, whereas <pre>x</pre> is the delay in + ticks and <pre>y</pre> the amount of ticks after which the instrument will be cut off again (or more precise: the instrument will be cut off at tick <pre>x</pre> + <pre>y</pre>).</li> <li>In the <strong>orderlist</strong>, multiple orders can now be selected at once (default multiselect shortcut: Shift). Order selections can be quickly rendered to a wave file using the context menu.</li> <li>New <strong>paste modes</strong>: Overflow paste (which continues the paste in the next pattern if it reaches the bottom of the current pattern), paste flood (which keeps pasting the data again and again, until it reaches the bottom of the pattern) and push-forward paste (which pushes the already existing pattern data downwards, like in Impulse Tracker).</li> <li>Improved MOD editing - now it should be almost impossible to write commands in the patterns that don't belong into MOD files. :-)</li> + <li>If no selection has been made, Shift-Clicking a point now draws a <strong>selection</strong>, starting from the previously highlighted pattern command;</li> </ul> <h3>Sample Editor</h3> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <sag...@us...> - 2010-05-01 11:51:02
|
Revision: 582 http://modplug.svn.sourceforge.net/modplug/?rev=582&view=rev Author: saga-games Date: 2010-05-01 11:50:56 +0000 (Sat, 01 May 2010) Log Message: ----------- [Mod] VST Editor: Changed number of patches per sub menu from 100 to 128. Now, one sub menu equals ones MIDI bank (more logical) [Mod] Updated release notes Modified Paths: -------------- trunk/OpenMPT/mptrack/AbstractVstEditor.cpp trunk/OpenMPT/packageTemplate/OMPT_1.18_ReleaseNotes.html Modified: trunk/OpenMPT/mptrack/AbstractVstEditor.cpp =================================================================== --- trunk/OpenMPT/mptrack/AbstractVstEditor.cpp 2010-04-30 21:45:37 UTC (rev 581) +++ trunk/OpenMPT/mptrack/AbstractVstEditor.cpp 2010-05-01 11:50:56 UTC (rev 582) @@ -353,8 +353,8 @@ return NULL; } -#define PRESETS_PER_COLUMN 25 -#define PRESETS_PER_GROUP 100 +#define PRESETS_PER_COLUMN 32 +#define PRESETS_PER_GROUP 128 void CAbstractVstEditor::UpdatePresetMenu() { Modified: trunk/OpenMPT/packageTemplate/OMPT_1.18_ReleaseNotes.html =================================================================== --- trunk/OpenMPT/packageTemplate/OMPT_1.18_ReleaseNotes.html 2010-04-30 21:45:37 UTC (rev 581) +++ trunk/OpenMPT/packageTemplate/OMPT_1.18_ReleaseNotes.html 2010-05-01 11:50:56 UTC (rev 582) @@ -138,6 +138,7 @@ push-forward paste (which pushes the already existing pattern data downwards, like in Impulse Tracker).</li> <li>Improved MOD editing - now it should be almost impossible to write commands in the patterns that don't belong into MOD files. :-)</li> <li>If no selection has been made, Shift-Clicking a point now draws a <strong>selection</strong>, starting from the previously highlighted pattern command;</li> + <li>The volume column effect <pre>:</pre> (fake velocity) has been removed.</li> </ul> <h3>Sample Editor</h3> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <sag...@us...> - 2010-05-04 13:12:09
|
Revision: 584 http://modplug.svn.sourceforge.net/modplug/?rev=584&view=rev Author: saga-games Date: 2010-05-04 13:11:59 +0000 (Tue, 04 May 2010) Log Message: ----------- [Fix] MOD Loader: Very short loops (4-8 bytes long) are not ignored anymore. This fixes "Crew Generation" by Necros. [Ref] Some code cleanup Modified Paths: -------------- trunk/OpenMPT/mptrack/Moddoc.cpp trunk/OpenMPT/mptrack/Moddoc.h trunk/OpenMPT/mptrack/Mpdlgs.cpp trunk/OpenMPT/soundlib/LOAD_AMF.CPP trunk/OpenMPT/soundlib/Load_mod.cpp trunk/OpenMPT/soundlib/Load_ptm.cpp trunk/OpenMPT/soundlib/Load_s3m.cpp trunk/OpenMPT/soundlib/Sndfile.h Modified: trunk/OpenMPT/mptrack/Moddoc.cpp =================================================================== --- trunk/OpenMPT/mptrack/Moddoc.cpp 2010-05-01 22:35:46 UTC (rev 583) +++ trunk/OpenMPT/mptrack/Moddoc.cpp 2010-05-04 13:11:59 UTC (rev 584) @@ -3343,6 +3343,7 @@ //end rewbs.customKeys void CModDoc::TogglePluginEditor(UINT m_nCurrentPlugin) +//----------------------------------------------------- { PSNDMIXPLUGIN pPlugin; @@ -3356,8 +3357,8 @@ return; } -void CModDoc::ChangeFileExtension(UINT nNewType) -//---------------------------------------------- +void CModDoc::ChangeFileExtension(MODTYPE nNewType) +//------------------------------------------------- { //Not making path if path is empty(case only(?) for new file) if(GetPathName().GetLength() > 0) @@ -3409,22 +3410,22 @@ UINT CModDoc::FindAvailableChannel() -//------------------------------------------- +//---------------------------------- { // Search for available channel - for (UINT j=m_SndFile.m_nChannels; j<MAX_CHANNELS; j++) { + for (CHANNELINDEX j = m_SndFile.m_nChannels; j < MAX_CHANNELS; j++) + { MODCHANNEL *p = &m_SndFile.Chn[j]; - if (!p->nLength) { + if (!p->nLength) return j; - } } // Not found: look for one that's stopped - for (UINT j=m_SndFile.m_nChannels; j<MAX_CHANNELS; j++) { + for (CHANNELINDEX j = m_SndFile.m_nChannels; j < MAX_CHANNELS; j++) + { MODCHANNEL *p = &m_SndFile.Chn[j]; - if (p->dwFlags & CHN_NOTEFADE) { + if (p->dwFlags & CHN_NOTEFADE) return j; - } } //Last resort: go for first virutal channel. @@ -3440,7 +3441,8 @@ void CModDoc::LearnMacro(int macroToSet, long paramToUse) //------------------------------------------------------- { - if (macroToSet<0 || macroToSet>NMACROS) { + if (macroToSet<0 || macroToSet>NMACROS) + { return; } Modified: trunk/OpenMPT/mptrack/Moddoc.h =================================================================== --- trunk/OpenMPT/mptrack/Moddoc.h 2010-05-01 22:35:46 UTC (rev 583) +++ trunk/OpenMPT/mptrack/Moddoc.h 2010-05-04 13:11:59 UTC (rev 584) @@ -378,7 +378,7 @@ DECLARE_MESSAGE_MAP() private: - void ChangeFileExtension(UINT nNewType); + void ChangeFileExtension(MODTYPE nNewType); UINT FindAvailableChannel(); }; Modified: trunk/OpenMPT/mptrack/Mpdlgs.cpp =================================================================== --- trunk/OpenMPT/mptrack/Mpdlgs.cpp 2010-05-01 22:35:46 UTC (rev 583) +++ trunk/OpenMPT/mptrack/Mpdlgs.cpp 2010-05-04 13:11:59 UTC (rev 584) @@ -444,7 +444,6 @@ if (CSoundFile::GetSysInfo() & SYSMIX_SLOWCPU) ::EnableWindow(::GetDlgItem(m_hWnd, IDC_CHECK3), FALSE); else if (dwQuality & QUALITY_EQ) CheckDlgButton(IDC_CHECK3, MF_CHECKED); - if (CSoundFile::gdwSoundSetup & SNDMIX_EMULATE_MIX_BUGS) CheckDlgButton(IDC_CHECK7, MF_CHECKED); //rewbs.emulateMixBugs // Bass Expansion m_SbXBassDepth.SetRange(0,4); @@ -595,14 +594,6 @@ if (IsDlgButtonChecked(IDC_CHECK6)) dwQuality |= QUALITY_REVERB; dwSrcMode = m_CbnResampling.GetCurSel(); - //rewbs.emulateMixBugs - if (IsDlgButtonChecked(IDC_CHECK7)) { - CSoundFile::gdwSoundSetup |= SNDMIX_EMULATE_MIX_BUGS; - } else { - CSoundFile::gdwSoundSetup &= ~SNDMIX_EMULATE_MIX_BUGS; - } - //end rewbs.emulateMixBugs - // Bass Expansion { UINT nXBassDepth = 8-m_SbXBassDepth.GetPos(); Modified: trunk/OpenMPT/soundlib/LOAD_AMF.CPP =================================================================== --- trunk/OpenMPT/soundlib/LOAD_AMF.CPP 2010-05-01 22:35:46 UTC (rev 583) +++ trunk/OpenMPT/soundlib/LOAD_AMF.CPP 2010-05-04 13:11:59 UTC (rev 584) @@ -54,7 +54,7 @@ extern void Log(LPCSTR, ...); #endif -VOID AMF_Unpack(MODCOMMAND *pPat, const BYTE *pTrack, UINT nRows, UINT nChannels) +void AMF_Unpack(MODCOMMAND *pPat, const BYTE *pTrack, UINT nRows, UINT nChannels) //------------------------------------------------------------------------------- { UINT lastinstr = 0; Modified: trunk/OpenMPT/soundlib/Load_mod.cpp =================================================================== --- trunk/OpenMPT/soundlib/Load_mod.cpp 2010-05-01 22:35:46 UTC (rev 583) +++ trunk/OpenMPT/soundlib/Load_mod.cpp 2010-05-04 13:11:59 UTC (rev 584) @@ -280,8 +280,8 @@ if (psmp->nLoopStart >= psmp->nLength) { psmp->nLoopStart = psmp->nLength-1; derr|=1; } if (psmp->nLoopEnd > psmp->nLength) { psmp->nLoopEnd = psmp->nLength; derr |= 1; } if (psmp->nLoopStart > psmp->nLoopEnd) derr |= 1; - if ((psmp->nLoopStart > psmp->nLoopEnd) || (psmp->nLoopEnd <= 8) - || (psmp->nLoopEnd - psmp->nLoopStart <= 4)) + if ((psmp->nLoopStart > psmp->nLoopEnd) || (psmp->nLoopEnd < 4) + || (psmp->nLoopEnd - psmp->nLoopStart < 4)) { psmp->nLoopStart = 0; psmp->nLoopEnd = 0; Modified: trunk/OpenMPT/soundlib/Load_ptm.cpp =================================================================== --- trunk/OpenMPT/soundlib/Load_ptm.cpp 2010-05-01 22:35:46 UTC (rev 583) +++ trunk/OpenMPT/soundlib/Load_ptm.cpp 2010-05-04 13:11:59 UTC (rev 584) @@ -173,13 +173,10 @@ if (dwMemPos + 2 > dwMemLength) break; m[nChn].command = lpStream[dwMemPos++]; m[nChn].param = lpStream[dwMemPos++]; - if ((m[nChn].command == 0x0E) && ((m[nChn].param & 0xF0) == 0x80)) - { - m[nChn].command = CMD_S3MCMDEX; - } else if (m[nChn].command < 0x10) { ConvertModCommand(&m[nChn]); + MODExx2S3MSxx(&m[nChn]); } else { switch(m[nChn].command) Modified: trunk/OpenMPT/soundlib/Load_s3m.cpp =================================================================== --- trunk/OpenMPT/soundlib/Load_s3m.cpp 2010-05-01 22:35:46 UTC (rev 583) +++ trunk/OpenMPT/soundlib/Load_s3m.cpp 2010-05-04 13:11:59 UTC (rev 584) @@ -16,8 +16,6 @@ #pragma warning(disable:4244) //"conversion from 'type1' to 'type2', possible loss of data" -extern WORD S3MFineTuneTable[16]; - ////////////////////////////////////////////////////// // ScreamTracker S3M file support Modified: trunk/OpenMPT/soundlib/Sndfile.h =================================================================== --- trunk/OpenMPT/soundlib/Sndfile.h 2010-05-01 22:35:46 UTC (rev 583) +++ trunk/OpenMPT/soundlib/Sndfile.h 2010-05-04 13:11:59 UTC (rev 584) @@ -635,7 +635,7 @@ void SetMasterVolume(UINT vol, bool adjustAGC = false); UINT GetMasterVolume() const { return m_nMasterVolume; } - ORDERINDEX GetNumPatterns() const; + PATTERNINDEX GetNumPatterns() const; INSTRUMENTINDEX GetNumInstruments() const { return m_nInstruments; } SAMPLEINDEX GetNumSamples() const { return m_nSamples; } UINT GetCurrentPos() const; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <sag...@us...> - 2010-05-09 22:04:40
|
Revision: 591 http://modplug.svn.sourceforge.net/modplug/?rev=591&view=rev Author: saga-games Date: 2010-05-09 22:04:33 +0000 (Sun, 09 May 2010) Log Message: ----------- [Imp] Instrument Editor: "Scale envelope points" is now always available for scaling the values of the points (y axis). [Ref] Related code changes. Modified Paths: -------------- trunk/OpenMPT/mptrack/ScaleEnvPointsDlg.cpp trunk/OpenMPT/mptrack/ScaleEnvPointsDlg.h trunk/OpenMPT/mptrack/View_ins.cpp trunk/OpenMPT/mptrack/mptrack.rc trunk/OpenMPT/mptrack/resource.h trunk/OpenMPT/soundlib/Dlsbank.cpp trunk/OpenMPT/soundlib/Load_imf.cpp trunk/OpenMPT/soundlib/Load_mid.cpp trunk/OpenMPT/soundlib/Snd_defs.h trunk/OpenMPT/soundlib/Sndfile.h trunk/OpenMPT/soundlib/Sndmix.cpp Modified: trunk/OpenMPT/mptrack/ScaleEnvPointsDlg.cpp =================================================================== --- trunk/OpenMPT/mptrack/ScaleEnvPointsDlg.cpp 2010-05-08 22:11:33 UTC (rev 590) +++ trunk/OpenMPT/mptrack/ScaleEnvPointsDlg.cpp 2010-05-09 22:04:33 UTC (rev 591) @@ -1,78 +1,64 @@ -// ScaleEnvPointsDlg.cpp : implementation file -// +/* + * ScaleEnvPointsDlg.cpp + * --------------------- + * Purpose: Scale instrument envelope points on x and y axis. + * Notes : (currently none) + * Authors: OpenMPT Devs + */ #include "stdafx.h" #include "mptrack.h" #include "ScaleEnvPointsDlg.h" +float CScaleEnvPointsDlg::m_fFactorX = 1; +float CScaleEnvPointsDlg::m_fFactorY = 1; -// CScaleEnvPointsDlg dialog -IMPLEMENT_DYNAMIC(CScaleEnvPointsDlg, CDialog) -CScaleEnvPointsDlg::CScaleEnvPointsDlg(CWnd* pParent, MODINSTRUMENT* pInst, UINT env) - : CDialog(CScaleEnvPointsDlg::IDD, pParent), - m_pInstrument(pInst), - m_Env(env) -//---------------------------------------------------------------------- +BOOL CScaleEnvPointsDlg::OnInitDialog() +//------------------------------------- { -} + CDialog::OnInitDialog(); -CScaleEnvPointsDlg::~CScaleEnvPointsDlg() -//--------------------------------------- -{ -} + char buffer[10]; + _snprintf(buffer, 9, "%g", m_fFactorX); + SetDlgItemText(IDC_EDIT_FACTORX, buffer); + _snprintf(buffer, 9, "%g", m_fFactorY); + SetDlgItemText(IDC_EDIT_FACTORY, buffer); + GetDlgItem(IDC_EDIT_FACTORX)->SetFocus(); -void CScaleEnvPointsDlg::DoDataExchange(CDataExchange* pDX) -//-------------------------------------------------------- -{ - CDialog::DoDataExchange(pDX); - DDX_Control(pDX, IDC_EDIT_FACTOR, m_EditFactor); + return FALSE; // return TRUE unless you set the focus to a control } -BEGIN_MESSAGE_MAP(CScaleEnvPointsDlg, CDialog) - -END_MESSAGE_MAP() - - -// CScaleEnvPointsDlg message handlers - void CScaleEnvPointsDlg::OnOK() -//------------------------------ +//----------------------------- { char buffer[10]; - GetDlgItemText(IDC_EDIT_FACTOR, buffer, 9); - float factor = ConvertStrTo<float>(buffer); - if(factor > 0) + GetDlgItemText(IDC_EDIT_FACTORX, buffer, 9); + m_fFactorX = ConvertStrTo<float>(buffer); + + GetDlgItemText(IDC_EDIT_FACTORY, buffer, 9); + m_fFactorY = ConvertStrTo<float>(buffer); + + if(m_fFactorX > 0 && m_fFactorX != 1) { - INSTRUMENTENVELOPE *pEnv = nullptr; - switch(m_Env) + for(UINT i = 0; i < m_pEnv->nNodes; i++) { - case ENV_PANNING: pEnv = &m_pInstrument->PanEnv; break; - case ENV_PITCH: pEnv = &m_pInstrument->PitchEnv; break; - default: pEnv = &m_pInstrument->VolEnv; break; + m_pEnv->Ticks[i] = static_cast<WORD>(m_fFactorX * m_pEnv->Ticks[i]); + + // Checking that the order of points is preserved. + if(i > 0 && m_pEnv->Ticks[i] <= m_pEnv->Ticks[i - 1]) + m_pEnv->Ticks[i] = m_pEnv->Ticks[i - 1] + 1; } - for(UINT i = 0; i< pEnv->nNodes; i++) - { - pEnv->Ticks[i] = static_cast<WORD>(factor * pEnv->Ticks[i]); + } - //Checking that the order of points is preserved. - if(i > 0 && pEnv->Ticks[i] <= pEnv->Ticks[i - 1]) - pEnv->Ticks[i] = pEnv->Ticks[i - 1] + 1; + if(m_fFactorY != 1) + { + for(UINT i = 0; i < m_pEnv->nNodes; i++) + { + m_pEnv->Values[i] = CLAMP(static_cast<BYTE>((m_fFactorY * ((int)m_pEnv->Values[i] - m_nCenter)) + m_nCenter), ENVELOPE_MIN, ENVELOPE_MAX); } } CDialog::OnOK(); } - -BOOL CScaleEnvPointsDlg::OnInitDialog() -//------------------------------------- -{ - CDialog::OnInitDialog(); - - SetDlgItemText(IDC_EDIT_FACTOR, ""); - m_EditFactor.SetFocus(); - - - return FALSE; // return TRUE unless you set the focus to a control -} Modified: trunk/OpenMPT/mptrack/ScaleEnvPointsDlg.h =================================================================== --- trunk/OpenMPT/mptrack/ScaleEnvPointsDlg.h 2010-05-08 22:11:33 UTC (rev 590) +++ trunk/OpenMPT/mptrack/ScaleEnvPointsDlg.h 2010-05-09 22:04:33 UTC (rev 591) @@ -1,33 +1,31 @@ +/* + * ScaleEnvPointsDlg.h + * ------------------- + * Purpose: Header file for envelope scaling dialog. + * Notes : (currently none) + * Authors: OpenMPT Devs + */ + #pragma once -#include "sndfile.h" -#include "afxwin.h" -// CScaleEnvPointsDlg dialog - //======================================= class CScaleEnvPointsDlg : public CDialog //======================================= { - DECLARE_DYNAMIC(CScaleEnvPointsDlg) - public: - CScaleEnvPointsDlg(CWnd* pParent, MODINSTRUMENT* pInst, UINT env); // standard constructor - virtual ~CScaleEnvPointsDlg(); -// Dialog Data - enum { IDD = IDD_SCALE_ENV_POINTS }; + CScaleEnvPointsDlg(CWnd* pParent, INSTRUMENTENVELOPE *pEnv, int nCenter) : CDialog(IDD_SCALE_ENV_POINTS, pParent) + { + m_pEnv = pEnv; + m_nCenter = nCenter; + } -protected: - virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support - - DECLARE_MESSAGE_MAP() - private: - MODINSTRUMENT* m_pInstrument; - UINT m_Env; //To tell which envelope to process. - CEdit m_EditFactor; + INSTRUMENTENVELOPE *m_pEnv; //To tell which envelope to process. + static float m_fFactorX, m_fFactorY; + int m_nCenter; + protected: virtual void OnOK(); -public: virtual BOOL OnInitDialog(); }; Modified: trunk/OpenMPT/mptrack/View_ins.cpp =================================================================== --- trunk/OpenMPT/mptrack/View_ins.cpp 2010-05-08 22:11:33 UTC (rev 590) +++ trunk/OpenMPT/mptrack/View_ins.cpp 2010-05-09 22:04:33 UTC (rev 591) @@ -2189,15 +2189,18 @@ { CModDoc *pModDoc = GetDocument(); CSoundFile *pSndFile = (pModDoc) ? pModDoc->GetSoundFile() : NULL; - if(pSndFile == NULL) + if(pSndFile == nullptr) return; if(m_nInstrument >= 1 && m_nInstrument <= pSndFile->GetNumInstruments() && pSndFile->Instruments[m_nInstrument]) { - CScaleEnvPointsDlg dialog(this, pSndFile->Instruments[m_nInstrument], m_nEnv); - if (dialog.DoModal() == IDOK) + // "Center" y value of the envelope. For panning and pitch, this is 32, for volume and filter it is 0 (minimum). + int nOffset = ((m_nEnv != ENV_VOLUME) && ((GetEnvelopePtr()->dwFlags & ENV_FILTER) == 0)) ? 32 : 0; + + CScaleEnvPointsDlg dlg(this, GetEnvelopePtr(), nOffset); + if(dlg.DoModal()) { pModDoc->SetModified(); pModDoc->UpdateAllViews(NULL, (m_nInstrument << HINT_SHIFT_INS) | HINT_ENVELOPE, NULL); @@ -2281,10 +2284,10 @@ { INSTRUMENTENVELOPE *pEnv = GetEnvelopePtr(); if(pEnv == nullptr || !IsDragItemEnvPoint()) return; - if(pEnv->Values[m_nDragItem - 1] <= 64 - stepsize) + if(pEnv->Values[m_nDragItem - 1] <= ENVELOPE_MAX - stepsize) pEnv->Values[m_nDragItem - 1] += stepsize; else - pEnv->Values[m_nDragItem - 1] = 64; + pEnv->Values[m_nDragItem - 1] = ENVELOPE_MAX; GetDocument()->SetModified(); // sanity checks are done in GetEnvelopePtr() already InvalidateRect(NULL, FALSE); @@ -2296,10 +2299,10 @@ { INSTRUMENTENVELOPE *pEnv = GetEnvelopePtr(); if(pEnv == nullptr || !IsDragItemEnvPoint()) return; - if(pEnv->Values[m_nDragItem - 1] >= stepsize) + if(pEnv->Values[m_nDragItem - 1] >= ENVELOPE_MIN + stepsize) pEnv->Values[m_nDragItem - 1] -= stepsize; else - pEnv->Values[m_nDragItem - 1] = 0; + pEnv->Values[m_nDragItem - 1] = ENVELOPE_MIN; GetDocument()->SetModified(); // sanity checks are done in GetEnvelopePtr() already InvalidateRect(NULL, FALSE); Modified: trunk/OpenMPT/mptrack/mptrack.rc =================================================================== --- trunk/OpenMPT/mptrack/mptrack.rc 2010-05-08 22:11:33 UTC (rev 590) +++ trunk/OpenMPT/mptrack/mptrack.rc 2010-05-09 22:04:33 UTC (rev 591) @@ -2547,15 +2547,18 @@ LISTBOX IDC_LIST6,312,62,86,68,LBS_SORT | LBS_NOINTEGRALHEIGHT | WS_VSCROLL | WS_TABSTOP END -IDD_SCALE_ENV_POINTS DIALOGEX 0, 0, 172, 47 +IDD_SCALE_ENV_POINTS DIALOGEX 0, 0, 172, 77 STYLE DS_SETFONT | DS_MODALFRAME | DS_FIXEDSYS | WS_POPUP | WS_CAPTION | WS_SYSMENU CAPTION "Scale Envelope Points" FONT 8, "MS Shell Dlg", 400, 0, 0x1 BEGIN - LTEXT "Scale envelope points by:",IDC_STATIC_SCALE_ENV,6,6,90,8 - EDITTEXT IDC_EDIT_FACTOR,6,18,90,13,ES_AUTOHSCROLL - DEFPUSHBUTTON "OK",IDOK,114,6,50,14 - PUSHBUTTON "Cancel",IDCANCEL,114,24,50,14 + EDITTEXT IDC_EDIT_FACTORX,126,6,36,13,ES_AUTOHSCROLL + EDITTEXT IDC_EDIT_FACTORY,126,24,36,13,ES_AUTOHSCROLL + DEFPUSHBUTTON "OK",IDOK,60,54,50,14 + PUSHBUTTON "Cancel",IDCANCEL,114,54,50,14 + LTEXT "Scale envelope points (x axis) by:",IDC_STATIC,6,8,120,8 + LTEXT "Scale envelope values (y axis) by:",IDC_STATIC,6,26,120,8 + CONTROL "",IDC_STATIC,"Static",SS_ETCHEDFRAME,6,45,156,1 END @@ -2629,7 +2632,7 @@ LEFTMARGIN, 2 RIGHTMARGIN, 165 TOPMARGIN, 6 - BOTTOMMARGIN, 43 + BOTTOMMARGIN, 73 END END #endif // APSTUDIO_INVOKED Modified: trunk/OpenMPT/mptrack/resource.h =================================================================== --- trunk/OpenMPT/mptrack/resource.h 2010-05-08 22:11:33 UTC (rev 590) +++ trunk/OpenMPT/mptrack/resource.h 2010-05-09 22:04:33 UTC (rev 591) @@ -783,7 +783,8 @@ #define IDC_GENMACROLABEL 2253 #define IDC_RENDERZONE 2254 #define IDC_PATTERN_LOOP 2255 -#define IDC_EDIT_FACTOR 2256 +#define IDC_EDIT_FACTORX 2256 +#define IDC_EDIT_FACTORY 2257 #define IDC_EDIT_ORDERLIST_MARGINS 2258 #define IDC_STATICRATIOMAP 2259 #define IDC_SPIN_ORDERLIST_MARGINS 2260 Modified: trunk/OpenMPT/soundlib/Dlsbank.cpp =================================================================== --- trunk/OpenMPT/soundlib/Dlsbank.cpp 2010-05-08 22:11:33 UTC (rev 590) +++ trunk/OpenMPT/soundlib/Dlsbank.cpp 2010-05-09 22:04:33 UTC (rev 591) @@ -1779,14 +1779,14 @@ pIns->VolEnv.Ticks[nPoint] = 0; if (part->wVolAttack) { - pIns->VolEnv.Values[nPoint] = (BYTE)(64/(part->wVolAttack/2+2)+8);// /----- - pIns->VolEnv.Ticks[nPoint+1] = part->wVolAttack; // | + pIns->VolEnv.Values[nPoint] = (BYTE)(ENVELOPE_MAX / (part->wVolAttack / 2 + 2) + 8); // /----- + pIns->VolEnv.Ticks[nPoint+1] = part->wVolAttack; // | } else { - pIns->VolEnv.Values[nPoint] = 64; // |----- - pIns->VolEnv.Ticks[nPoint+1] = 1; // | + pIns->VolEnv.Values[nPoint] = ENVELOPE_MAX; // |----- + pIns->VolEnv.Ticks[nPoint + 1] = 1; // | } - pIns->VolEnv.Values[nPoint+1] = 64; + pIns->VolEnv.Values[nPoint + 1] = ENVELOPE_MAX; nPoint += 2; // Hold section // -> DLS Level 2 @@ -1870,12 +1870,12 @@ } if (lReleaseTime < 1) lReleaseTime = 1; pIns->VolEnv.Ticks[nPoint] = (WORD)(lStartTime + lReleaseTime); - pIns->VolEnv.Values[nPoint] = 0; + pIns->VolEnv.Values[nPoint] = ENVELOPE_MIN; nPoint++; } else { pIns->VolEnv.Ticks[nPoint] = (BYTE)(pIns->VolEnv.Ticks[nPoint-1] + 1); - pIns->VolEnv.Values[nPoint] = 0; + pIns->VolEnv.Values[nPoint] = ENVELOPE_MIN; nPoint++; } pIns->VolEnv.nNodes = (BYTE)nPoint; @@ -1889,13 +1889,13 @@ { pIns->VolEnv.dwFlags |= ENV_ENABLED; pIns->VolEnv.Ticks[0] = 0; - pIns->VolEnv.Values[0] = 64; + pIns->VolEnv.Values[0] = ENVELOPE_MAX; pIns->VolEnv.Ticks[1] = 5; - pIns->VolEnv.Values[1] = 64; + pIns->VolEnv.Values[1] = ENVELOPE_MAX; pIns->VolEnv.Ticks[2] = 10; - pIns->VolEnv.Values[2] = 32; + pIns->VolEnv.Values[2] = ENVELOPE_MID; pIns->VolEnv.Ticks[3] = 20; // 1 second max. for drums - pIns->VolEnv.Values[3] = 0; + pIns->VolEnv.Values[3] = ENVELOPE_MIN; pIns->VolEnv.nNodes = 4; } } Modified: trunk/OpenMPT/soundlib/Load_imf.cpp =================================================================== --- trunk/OpenMPT/soundlib/Load_imf.cpp 2010-05-08 22:11:33 UTC (rev 590) +++ trunk/OpenMPT/soundlib/Load_imf.cpp 2010-05-09 22:04:33 UTC (rev 591) @@ -255,7 +255,7 @@ nTick = LittleEndianW(imfins->nodes[e][n].tick); nValue = LittleEndianW(imfins->nodes[e][n].value) >> shift; env->Ticks[n] = (WORD)max(min, nTick); - env->Values[n] = (BYTE)min(nValue, 64); + env->Values[n] = (BYTE)min(nValue, ENVELOPE_MAX); min = nTick + 1; } } Modified: trunk/OpenMPT/soundlib/Load_mid.cpp =================================================================== --- trunk/OpenMPT/soundlib/Load_mid.cpp 2010-05-08 22:11:33 UTC (rev 590) +++ trunk/OpenMPT/soundlib/Load_mid.cpp 2010-05-09 22:04:33 UTC (rev 591) @@ -443,13 +443,13 @@ if (nChannel != MIDI_DRUMCHANNEL) pIns->VolEnv.dwFlags |= ENV_SUSTAIN; pIns->VolEnv.nNodes = 4; pIns->VolEnv.Ticks[0] = 0; - pIns->VolEnv.Values[0] = 64; + pIns->VolEnv.Values[0] = ENVELOPE_MAX; pIns->VolEnv.Ticks[1] = 10; - pIns->VolEnv.Values[1] = 64; + pIns->VolEnv.Values[1] = ENVELOPE_MAX; pIns->VolEnv.Ticks[2] = 15; - pIns->VolEnv.Values[2] = 48; + pIns->VolEnv.Values[2] = (ENVELOPE_MAX + ENVELOPE_MID) / 2; pIns->VolEnv.Ticks[3] = 20; - pIns->VolEnv.Values[3] = 0; + pIns->VolEnv.Values[3] = ENVELOPE_MIN; pIns->VolEnv.nSustainStart = pIns->VolEnv.nSustainEnd = 1; // Sample Samples[m_nSamples].nPan = 128; Modified: trunk/OpenMPT/soundlib/Snd_defs.h =================================================================== --- trunk/OpenMPT/soundlib/Snd_defs.h 2010-05-08 22:11:33 UTC (rev 590) +++ trunk/OpenMPT/soundlib/Snd_defs.h 2010-05-09 22:04:33 UTC (rev 591) @@ -170,7 +170,12 @@ #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) +// Envelope value boundaries +#define ENVELOPE_MIN 0 +#define ENVELOPE_MID 32 +#define ENVELOPE_MAX 64 + // Flags of 'dF..' datafield in extended instrument properties. #define dFdd_VOLUME 0x0001 #define dFdd_VOLSUSTAIN 0x0002 @@ -338,8 +343,8 @@ #define SNDMIX_NOBACKWARDJUMPS 0x40000 #define SNDMIX_MAXDEFAULTPAN 0x80000 // Used by the MOD loader (currently unused) #define SNDMIX_MUTECHNMODE 0x100000 // Notes are not played on muted channels -#define SNDMIX_EMULATE_MIX_BUGS 0x200000 // rewbs.emulateMixBugs + #define MAX_GLOBAL_VOLUME 256 // Resampling modes Modified: trunk/OpenMPT/soundlib/Sndfile.h =================================================================== --- trunk/OpenMPT/soundlib/Sndfile.h 2010-05-08 22:11:33 UTC (rev 590) +++ trunk/OpenMPT/soundlib/Sndfile.h 2010-05-09 22:04:33 UTC (rev 591) @@ -119,7 +119,7 @@ CHAR name[32]; // Note: not guaranteed to be null-terminated. CHAR filename[32]; - BYTE nMixPlug; //rewbs.instroVSTi + PLUGINDEX nMixPlug; //rewbs.instroVSTi // -> CODE#0027 // -> DESC="per-instrument volume ramping setup (refered as attack)" USHORT nVolRamp; Modified: trunk/OpenMPT/soundlib/Sndmix.cpp =================================================================== --- trunk/OpenMPT/soundlib/Sndmix.cpp 2010-05-08 22:11:33 UTC (rev 590) +++ trunk/OpenMPT/soundlib/Sndmix.cpp 2010-05-09 22:04:33 UTC (rev 591) @@ -1298,12 +1298,12 @@ int x1, envpitch; if (envpos >= x2) { - envpitch = (((int)pIns->PitchEnv.Values[pt]) - 32) * 8; + envpitch = (((int)pIns->PitchEnv.Values[pt]) - ENVELOPE_MID) * 8; x1 = x2; } else if (pt) { - envpitch = (((int)pIns->PitchEnv.Values[pt-1]) - 32) * 8; + envpitch = (((int)pIns->PitchEnv.Values[pt-1]) - ENVELOPE_MID) * 8; x1 = pIns->PitchEnv.Ticks[pt-1]; } else { This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <sag...@us...> - 2010-05-13 19:57:12
|
Revision: 593 http://modplug.svn.sourceforge.net/modplug/?rev=593&view=rev Author: saga-games Date: 2010-05-13 19:57:06 +0000 (Thu, 13 May 2010) Log Message: ----------- [New] Modules in gzip archives (single-file .gz archives) can now be imported, just to satisfy my laziness when downloading gzipped modules from Amiga Music Preservation. :-P [Ref] Moved functions related to endianness conversion to a separate file. [Mod] Updated release notes. NOTE: The old mptrack.sln has not been updated yet; references to the ungzip project are missing. Modified Paths: -------------- trunk/OpenMPT/mptrack/MPTRACK_08.sln trunk/OpenMPT/mptrack/mptrack.vcproj trunk/OpenMPT/mptrack/mptrack_08.vcproj trunk/OpenMPT/packageTemplate/OMPT_1.18_ReleaseNotes.html trunk/OpenMPT/soundlib/Sndfile.cpp trunk/OpenMPT/soundlib/Sndfile.h Added Paths: ----------- trunk/OpenMPT/soundlib/Endianness.h trunk/OpenMPT/ungzip/ trunk/OpenMPT/ungzip/ungzip.h trunk/OpenMPT/ungzip/ungzip_08.vcproj Modified: trunk/OpenMPT/mptrack/MPTRACK_08.sln =================================================================== --- trunk/OpenMPT/mptrack/MPTRACK_08.sln 2010-05-13 19:12:29 UTC (rev 592) +++ trunk/OpenMPT/mptrack/MPTRACK_08.sln 2010-05-13 19:57:06 UTC (rev 593) @@ -2,6 +2,7 @@ # Visual Studio 2008 Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "mptrack", "mptrack_08.vcproj", "{21D95071-FB97-4E69-B3B1-050D0D4A5021}" ProjectSection(ProjectDependencies) = postProject + {94CD7910-649A-4075-9F33-7EBEE614FD45} = {94CD7910-649A-4075-9F33-7EBEE614FD45} {44316F22-904E-48AA-B841-5A3A6AC77319} = {44316F22-904E-48AA-B841-5A3A6AC77319} {FAE39936-1DC7-40BB-AD3F-3B5B9E9AB0E8} = {FAE39936-1DC7-40BB-AD3F-3B5B9E9AB0E8} {745DEC58-EBB3-47A9-A9B8-4C6627C01BF8} = {745DEC58-EBB3-47A9-A9B8-4C6627C01BF8} @@ -21,6 +22,11 @@ EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "zlibstat", "..\zlib\contrib\vstudio\vc9\zlibstat.vcproj", "{745DEC58-EBB3-47A9-A9B8-4C6627C01BF8}" EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "ungzip", "..\ungzip\ungzip_08.vcproj", "{94CD7910-649A-4075-9F33-7EBEE614FD45}" + ProjectSection(ProjectDependencies) = postProject + {745DEC58-EBB3-47A9-A9B8-4C6627C01BF8} = {745DEC58-EBB3-47A9-A9B8-4C6627C01BF8} + EndProjectSection +EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Win32 = Debug|Win32 @@ -70,6 +76,12 @@ {745DEC58-EBB3-47A9-A9B8-4C6627C01BF8}.Release|Win32.Build.0 = Release|Win32 {745DEC58-EBB3-47A9-A9B8-4C6627C01BF8}.ReleaseWithoutAsm|Win32.ActiveCfg = ReleaseWithoutAsm|Win32 {745DEC58-EBB3-47A9-A9B8-4C6627C01BF8}.ReleaseWithoutAsm|Win32.Build.0 = ReleaseWithoutAsm|Win32 + {94CD7910-649A-4075-9F33-7EBEE614FD45}.Debug|Win32.ActiveCfg = Debug|Win32 + {94CD7910-649A-4075-9F33-7EBEE614FD45}.Debug|Win32.Build.0 = Debug|Win32 + {94CD7910-649A-4075-9F33-7EBEE614FD45}.Release|Win32.ActiveCfg = Release|Win32 + {94CD7910-649A-4075-9F33-7EBEE614FD45}.Release|Win32.Build.0 = Release|Win32 + {94CD7910-649A-4075-9F33-7EBEE614FD45}.ReleaseWithoutAsm|Win32.ActiveCfg = Release|Win32 + {94CD7910-649A-4075-9F33-7EBEE614FD45}.ReleaseWithoutAsm|Win32.Build.0 = Release|Win32 EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE Modified: trunk/OpenMPT/mptrack/mptrack.vcproj =================================================================== --- trunk/OpenMPT/mptrack/mptrack.vcproj 2010-05-13 19:12:29 UTC (rev 592) +++ trunk/OpenMPT/mptrack/mptrack.vcproj 2010-05-13 19:57:06 UTC (rev 593) @@ -759,6 +759,9 @@ RelativePath=".\EffectVis.h"> </File> <File + RelativePath="..\soundlib\Endianness.h"> + </File> + <File RelativePath=".\fxp.h"> </File> <File Modified: trunk/OpenMPT/mptrack/mptrack_08.vcproj =================================================================== --- trunk/OpenMPT/mptrack/mptrack_08.vcproj 2010-05-13 19:12:29 UTC (rev 592) +++ trunk/OpenMPT/mptrack/mptrack_08.vcproj 2010-05-13 19:57:06 UTC (rev 593) @@ -1,7 +1,7 @@ <?xml version="1.0" encoding="Windows-1252"?> <VisualStudioProject ProjectType="Visual C++" - Version="9.00" + Version="9,00" Name="mptrack" ProjectGUID="{21D95071-FB97-4E69-B3B1-050D0D4A5021}" RootNamespace="mptrack" @@ -1011,6 +1011,10 @@ > </File> <File + RelativePath="..\soundlib\Endianness.h" + > + </File> + <File RelativePath=".\fxp.h" > </File> Modified: trunk/OpenMPT/packageTemplate/OMPT_1.18_ReleaseNotes.html =================================================================== --- trunk/OpenMPT/packageTemplate/OMPT_1.18_ReleaseNotes.html 2010-05-13 19:12:29 UTC (rev 592) +++ trunk/OpenMPT/packageTemplate/OMPT_1.18_ReleaseNotes.html 2010-05-13 19:57:06 UTC (rev 593) @@ -88,7 +88,7 @@ to the other formats - The sequences are merged into one orderlist then. Sequences can be managed comfortably from the treeview.</li> <li>Support for <strong>new file formats</strong>: GDM (General Digital Music), IMF (Imago Orpheus), - J2B (Jazz Jackrabbit 2 music) and 8 channel Startrekker modules can now be imported. Scala tuning files can be used with OpenMPT's tuning editor now. + J2B (Jazz Jackrabbit 2 music) and 8 channel Startrekker modules can now be imported. Modules compressed with gzip can be loaded. Scala tuning files can be used with OpenMPT's tuning editor now. Support for other file formats was also notably improved: All PSM files (old and new Epic Megagames MASI) load correctly now, ULT (Ultratracker) import is more accurate, XM files compressed with BoobieSequeezer or made with early versions of Skale Tracker load correctly, etc...</li> <li>A countless number of <strong>playback behaviour fixes</strong> to maximise compatibility with ProTracker, Added: trunk/OpenMPT/soundlib/Endianness.h =================================================================== --- trunk/OpenMPT/soundlib/Endianness.h (rev 0) +++ trunk/OpenMPT/soundlib/Endianness.h 2010-05-13 19:57:06 UTC (rev 593) @@ -0,0 +1,27 @@ +#ifndef ENDIANNESS_H +#define ENDIANNESS_H + +// Ending swaps: +// BigEndian(x) may be used either to: +// -Convert DWORD x, which is in big endian format(for example read from file), +// to endian format of current architecture. +// -Convert value x from endian format of current architecture to big endian format. +// Similarly LittleEndian(x) converts known little endian format to format of current +// endian architecture or value x in format of current architecture to little endian +// format. +#ifdef PLATFORM_BIG_ENDIAN +// PPC +inline DWORD LittleEndian(DWORD x) { return ((x & 0xFF) << 24) | ((x & 0xFF00) << 8) | ((x & 0xFF0000) >> 8) | ((x & 0xFF000000) >> 24); } +inline WORD LittleEndianW(WORD x) { return (WORD)(((x >> 8) & 0xFF) | ((x << 8) & 0xFF00)); } +#define BigEndian(x) (x) +#define BigEndianW(x) (x) +#else +// x86 +inline DWORD BigEndian(DWORD x) { return ((x & 0xFF) << 24) | ((x & 0xFF00) << 8) | ((x & 0xFF0000) >> 8) | ((x & 0xFF000000) >> 24); } +inline WORD BigEndianW(WORD x) { return (WORD)(((x >> 8) & 0xFF) | ((x << 8) & 0xFF00)); } +#define LittleEndian(x) (x) +#define LittleEndianW(x) (x) +#endif + +#endif // ENDIANNESS_H + Modified: trunk/OpenMPT/soundlib/Sndfile.cpp =================================================================== --- trunk/OpenMPT/soundlib/Sndfile.cpp 2010-05-13 19:12:29 UTC (rev 592) +++ trunk/OpenMPT/soundlib/Sndfile.cpp 2010-05-13 19:57:06 UTC (rev 593) @@ -29,6 +29,7 @@ #ifndef NO_ARCHIVE_SUPPORT #define UNRAR_SUPPORT #define UNLHA_SUPPORT +#define UNGZIP_SUPPORT #define ZIPPED_MOD_SUPPORT LPCSTR glpszModExtensions = "mod|s3m|xm|it|stm|nst|ult|669|wow|mtm|med|far|mdl|ams|dsm|amf|okt|dmf|ptm|psm|mt2|umx|gdm|imf|j2b" #ifndef NO_UNMO3_SUPPORT @@ -53,6 +54,10 @@ #include "../unlha/unlha32.h" #endif +#ifdef UNGZIP_SUPPORT +#include "../ungzip/ungzip.h" +#endif + #ifdef MMCMP_SUPPORT extern BOOL MMCMP_Unpack(LPCBYTE *ppMemFile, LPDWORD pdwMemLength); #endif @@ -602,6 +607,17 @@ } } #endif +#ifdef UNGZIP_SUPPORT + CGzipArchive ungzip((LPBYTE)lpStream, dwMemLength); + if (ungzip.IsArchive()) + { + if (ungzip.ExtractFile() && ungzip.GetOutputFile()) + { + lpStream = ungzip.GetOutputFile(); + dwMemLength = ungzip.GetOutputFileLength(); + } + } +#endif #ifdef MMCMP_SUPPORT BOOL bMMCmp = MMCMP_Unpack(&lpStream, &dwMemLength); #endif Modified: trunk/OpenMPT/soundlib/Sndfile.h =================================================================== --- trunk/OpenMPT/soundlib/Sndfile.h 2010-05-13 19:12:29 UTC (rev 592) +++ trunk/OpenMPT/soundlib/Sndfile.h 2010-05-13 19:57:06 UTC (rev 593) @@ -17,6 +17,7 @@ #include <bitset> #include "midi.h" #include "Snd_defs.h" +#include "Endianness.h" class CTuningBase; typedef CTuningBase CTuning; @@ -1010,30 +1011,7 @@ return NULL; } -// Ending swaps: -// BigEndian(x) may be used either to: -// -Convert DWORD x, which is in big endian format(for example read from file), -// to endian format of current architecture. -// -Convert value x from endian format of current architecture to big endian format. -// Similarly LittleEndian(x) converts known little endian format to format of current -// endian architecture or value x in format of current architecture to little endian -// format. -#ifdef PLATFORM_BIG_ENDIAN -// PPC -inline DWORD LittleEndian(DWORD x) { return ((x & 0xFF) << 24) | ((x & 0xFF00) << 8) | ((x & 0xFF0000) >> 8) | ((x & 0xFF000000) >> 24); } -inline WORD LittleEndianW(WORD x) { return (WORD)(((x >> 8) & 0xFF) | ((x << 8) & 0xFF00)); } -#define BigEndian(x) (x) -#define BigEndianW(x) (x) -#else -// x86 -inline DWORD BigEndian(DWORD x) { return ((x & 0xFF) << 24) | ((x & 0xFF00) << 8) | ((x & 0xFF0000) >> 8) | ((x & 0xFF000000) >> 24); } -inline WORD BigEndianW(WORD x) { return (WORD)(((x >> 8) & 0xFF) | ((x << 8) & 0xFF00)); } -#define LittleEndian(x) (x) -#define LittleEndianW(x) (x) -#endif - - ////////////////////////////////////////////////////////// // WAVE format information Added: trunk/OpenMPT/ungzip/ungzip.h =================================================================== --- trunk/OpenMPT/ungzip/ungzip.h (rev 0) +++ trunk/OpenMPT/ungzip/ungzip.h 2010-05-13 19:57:06 UTC (rev 593) @@ -0,0 +1,72 @@ +/* + * ungzip.h + * -------- + * Purpose: Header file for .gz loader + * Notes : (currently none) + * Authors: OpenMPT Devs + */ + +#pragma once + +#ifndef ZLIB_WINAPI +#define ZLIB_WINAPI +#endif // ZLIB_WINAPI +#include "../zlib/zlib.h" +#include "../mptrack/typedefs.h" + +#pragma pack(1) + +struct GZheader +{ + uint8 magic1; // 0x1F + uint8 magic2; // 0x8B + uint8 method; // 0-7 = reserved, 8 = deflate + uint8 flags; // See GZ_F* constants + uint32 mtime; // UNIX time + uint8 xflags; // Available for use by specific compression methods. We ignore this. + uint8 os; // Which OS was used to compress the file? We also ignore this. +}; + +struct GZtrailer +{ + uint32 crc32; // CRC32 of decompressed data + uint32 isize; // Size of decompressed data +}; + +#pragma pack() + +// magic bytes +#define GZ_HMAGIC1 0x1F +#define GZ_HMAGIC2 0x8B +#define GZ_HMDEFLATE 0x08 +// header flags +#define GZ_FTEXT 0x01 // File is probably ASCII text (who cares) +#define GZ_FHCRC 0x02 // CRC16 present +#define GZ_FEXTRA 0x04 // Extra fields present +#define GZ_FNAME 0x08 // Original filename present +#define GZ_FCOMMENT 0x10 // Comment is present +#define GZ_FRESERVED (~(GZ_FTEXT | GZ_FHCRC | GZ_FEXTRA | GZ_FNAME | GZ_FCOMMENT)) + + +//================ +class CGzipArchive +//================ +{ +public: + + LPBYTE GetOutputFile() const { return m_pOutputFile; } + DWORD GetOutputFileLength() const { return m_dwOutputLen; } + bool IsArchive(); + bool ExtractFile(); + + CGzipArchive(LPBYTE lpStream, DWORD dwMemLength); + ~CGzipArchive(); + +protected: + // in + LPBYTE m_lpStream; + DWORD m_dwStreamLen; + // out + Bytef *m_pOutputFile; + DWORD m_dwOutputLen; +}; Added: trunk/OpenMPT/ungzip/ungzip_08.vcproj =================================================================== --- trunk/OpenMPT/ungzip/ungzip_08.vcproj (rev 0) +++ trunk/OpenMPT/ungzip/ungzip_08.vcproj 2010-05-13 19:57:06 UTC (rev 593) @@ -0,0 +1,169 @@ +<?xml version="1.0" encoding="Windows-1252"?> +<VisualStudioProject + ProjectType="Visual C++" + Version="9,00" + Name="ungzip" + ProjectGUID="{94CD7910-649A-4075-9F33-7EBEE614FD45}" + RootNamespace="ungzip" + TargetFrameworkVersion="196613" + > + <Platforms> + <Platform + Name="Win32" + /> + </Platforms> + <ToolFiles> + </ToolFiles> + <Configurations> + <Configuration + Name="Debug|Win32" + OutputDirectory="$(SolutionDir)$(ConfigurationName)" + IntermediateDirectory="$(ConfigurationName)" + ConfigurationType="4" + CharacterSet="2" + > + <Tool + Name="VCPreBuildEventTool" + /> + <Tool + Name="VCCustomBuildTool" + /> + <Tool + Name="VCXMLDataGeneratorTool" + /> + <Tool + Name="VCWebServiceProxyGeneratorTool" + /> + <Tool + Name="VCMIDLTool" + /> + <Tool + Name="VCCLCompilerTool" + Optimization="0" + PreprocessorDefinitions="WIN32;ZLIB_WINAPI" + MinimalRebuild="true" + BasicRuntimeChecks="3" + RuntimeLibrary="3" + WarningLevel="3" + DebugInformationFormat="3" + OmitDefaultLibName="true" + /> + <Tool + Name="VCManagedResourceCompilerTool" + /> + <Tool + Name="VCResourceCompilerTool" + /> + <Tool + Name="VCPreLinkEventTool" + /> + <Tool + Name="VCLibrarianTool" + /> + <Tool + Name="VCALinkTool" + /> + <Tool + Name="VCXDCMakeTool" + /> + <Tool + Name="VCBscMakeTool" + /> + <Tool + Name="VCFxCopTool" + /> + <Tool + Name="VCPostBuildEventTool" + /> + </Configuration> + <Configuration + Name="Release|Win32" + OutputDirectory="$(SolutionDir)$(ConfigurationName)" + IntermediateDirectory="$(ConfigurationName)" + ConfigurationType="4" + CharacterSet="2" + WholeProgramOptimization="1" + > + <Tool + Name="VCPreBuildEventTool" + /> + <Tool + Name="VCCustomBuildTool" + /> + <Tool + Name="VCXMLDataGeneratorTool" + /> + <Tool + Name="VCWebServiceProxyGeneratorTool" + /> + <Tool + Name="VCMIDLTool" + /> + <Tool + Name="VCCLCompilerTool" + Optimization="2" + EnableIntrinsicFunctions="true" + PreprocessorDefinitions="WIN32;ZLIB_WINAPI" + RuntimeLibrary="2" + EnableFunctionLevelLinking="true" + WarningLevel="3" + SuppressStartupBanner="false" + DebugInformationFormat="0" + OmitDefaultLibName="true" + /> + <Tool + Name="VCManagedResourceCompilerTool" + /> + <Tool + Name="VCResourceCompilerTool" + /> + <Tool + Name="VCPreLinkEventTool" + /> + <Tool + Name="VCLibrarianTool" + /> + <Tool + Name="VCALinkTool" + /> + <Tool + Name="VCXDCMakeTool" + /> + <Tool + Name="VCBscMakeTool" + /> + <Tool + Name="VCFxCopTool" + /> + <Tool + Name="VCPostBuildEventTool" + /> + </Configuration> + </Configurations> + <References> + </References> + <Files> + <Filter + Name="Source Files" + Filter="cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx" + UniqueIdentifier="{4FC737F1-C7A5-4376-A066-2A32D752A2FF}" + > + <File + RelativePath=".\ungzip.cpp" + > + </File> + </Filter> + <Filter + Name="Header Files" + Filter="h;hpp;hxx;hm;inl;inc;xsd" + UniqueIdentifier="{93995380-89BD-4b04-88EB-625FBE52EBFB}" + > + <File + RelativePath=".\ungzip.h" + > + </File> + </Filter> + </Files> + <Globals> + </Globals> +</VisualStudioProject> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <sag...@us...> - 2010-05-13 21:06:55
|
Revision: 594 http://modplug.svn.sourceforge.net/modplug/?rev=594&view=rev Author: saga-games Date: 2010-05-13 21:06:48 +0000 (Thu, 13 May 2010) Log Message: ----------- ungzip.cpp was lost in the last commit, dunno how that could happen! [Mod] Updated file selection filter to display .gz files. Modified Paths: -------------- trunk/OpenMPT/mptrack/Mptrack.cpp Added Paths: ----------- trunk/OpenMPT/ungzip/ungzip.cpp Modified: trunk/OpenMPT/mptrack/Mptrack.cpp =================================================================== --- trunk/OpenMPT/mptrack/Mptrack.cpp 2010-05-13 19:57:06 UTC (rev 593) +++ trunk/OpenMPT/mptrack/Mptrack.cpp 2010-05-13 21:06:48 UTC (rev 594) @@ -1457,12 +1457,11 @@ #ifndef NO_MO3_SUPPORT ";*.mo3" #endif - ")|*.mdz;*.s3z;*.xmz;*.itz;*.mdr;*.zip;*.rar;*.lha" + ")|*.mdz;*.s3z;*.xmz;*.itz;*.mdr;*.zip;*.rar;*.lha;*.gz" #ifndef NO_MO3_SUPPORT ";*.mo3" #endif "|" - // -! NEW_FEATURE#0023 "ProTracker Modules (*.mod,*.nst)|*.mod;mod.*;*.mdz;*.nst;*.m15|" "ScreamTracker Modules (*.s3m,*.stm)|*.s3m;*.stm;*.s3z|" "FastTracker Modules (*.xm)|*.xm;*.xmz|" Added: trunk/OpenMPT/ungzip/ungzip.cpp =================================================================== --- trunk/OpenMPT/ungzip/ungzip.cpp (rev 0) +++ trunk/OpenMPT/ungzip/ungzip.cpp 2010-05-13 21:06:48 UTC (rev 594) @@ -0,0 +1,157 @@ +/* + * ungzip.cpp + * ---------- + * Purpose: Implementation file for extracting modules from .gz archives + * Notes : (currently none) + * Authors: OpenMPT Devs + */ + +#include "ungzip.h" +#include "../soundlib/Endianness.h" + + +CGzipArchive::CGzipArchive(LPBYTE lpStream, DWORD dwMemLength) +//------------------------------------------------------------ +{ + m_lpStream = lpStream; + m_dwStreamLen = dwMemLength; + m_pOutputFile = nullptr; + m_dwOutputLen = 0; +} + + +CGzipArchive::~CGzipArchive() +//--------------------------- +{ + if(m_pOutputFile != nullptr) + { + delete[] m_pOutputFile; + } +} + + +bool CGzipArchive::IsArchive() +//---------------------------- +{ + if(m_lpStream == nullptr || m_dwStreamLen <= (sizeof(GZheader) + sizeof(GZtrailer))) + return false; + + // Check header data + GZheader *pHeader = (GZheader *)m_lpStream; + if(pHeader->magic1 != GZ_HMAGIC1 || pHeader->magic2 != GZ_HMAGIC2 || pHeader->method != GZ_HMDEFLATE || (pHeader->flags & GZ_FRESERVED) != 0) + return false; + + // Seems to be OK... + return true; +} + + +bool CGzipArchive::ExtractFile() +//------------------------------ +{ + #define ASSERT_CAN_READ(x) \ + if( dwMemPos > m_dwStreamLen || x > m_dwStreamLen - dwMemPos ) return false; + + if(!IsArchive()) + return false; + + DWORD dwMemPos = 0; + GZheader *pHeader = (GZheader *)m_lpStream; + GZtrailer *pTrailer = (GZtrailer *)(m_lpStream + m_dwStreamLen - sizeof(GZtrailer)); + + dwMemPos += sizeof(GZheader); + + // Extra block present? (ignore) + if(pHeader->flags & GZ_FEXTRA) + { + ASSERT_CAN_READ(sizeof(uint16)); + uint16 xlen = LittleEndianW(*((uint16 *)m_lpStream + dwMemPos)); + dwMemPos += sizeof(uint16); + // We skip this. + ASSERT_CAN_READ(xlen); + dwMemPos += xlen; + } + + // Filename present? (ignore) + if(pHeader->flags & GZ_FNAME) + { + do + { + ASSERT_CAN_READ(1); + } while (m_lpStream[dwMemPos++] != 0); + } + + // Comment present? (ignore) + if(pHeader->flags & GZ_FCOMMENT) + { + do + { + ASSERT_CAN_READ(1); + } while (m_lpStream[dwMemPos++] != 0); + } + + // CRC16 present? + if(pHeader->flags & GZ_FHCRC) + { + ASSERT_CAN_READ(sizeof(uint16)); + uint16 crc16_h = LittleEndianW(*((uint16 *)m_lpStream + dwMemPos)); + uint16 crc16_f = (uint16)(crc32(0, m_lpStream, dwMemPos) & 0xFFFF); + dwMemPos += sizeof(uint16); + if(crc16_h != crc16_f) + return false; + } + + // Well, this is a bit small when inflated. + if(pTrailer->isize == 0) + return false; + + // Check if the deflated data is a bit small as well. + ASSERT_CAN_READ(sizeof(GZtrailer) + 1); + + // Clear the output buffer, if necessary. + if(m_pOutputFile != nullptr) + { + delete[] m_pOutputFile; + } + + DWORD destSize = LittleEndian(pTrailer->isize); + + m_pOutputFile = new Bytef[destSize]; + if(m_pOutputFile == nullptr) + return false; + + // Inflate! + z_stream strm; + strm.zalloc = Z_NULL; + strm.zfree = Z_NULL; + strm.opaque = Z_NULL; + strm.avail_in = m_dwStreamLen - (dwMemPos + sizeof(GZtrailer)); + strm.next_in = &m_lpStream[dwMemPos]; + if(inflateInit2(&strm, -15) != Z_OK) + return false; + strm.avail_out = destSize; + strm.next_out = m_pOutputFile; + + int nRetVal = inflate(&strm, Z_NO_FLUSH); + inflateEnd(&strm); + + // Everything went OK? Check return code, number of written bytes and CRC32. + if(nRetVal == Z_STREAM_END && destSize == strm.total_out && LittleEndian(pTrailer->crc32) == crc32(0, m_pOutputFile, destSize)) + { + // Success! :) + m_dwOutputLen = destSize; + return true; + } else + { + // Fail :( + if(m_pOutputFile != nullptr) + { + delete[] m_pOutputFile; + } + m_pOutputFile = nullptr; + m_lpStream = nullptr; + return false; + } + + #undef ASSERT_CAN_READ +} This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <sag...@us...> - 2010-05-14 15:27:29
|
Revision: 595 http://modplug.svn.sourceforge.net/modplug/?rev=595&view=rev Author: saga-games Date: 2010-05-14 15:27:19 +0000 (Fri, 14 May 2010) Log Message: ----------- [Reg] Removed AutodetectITplaystyle option, since the tracker detection works reliably enough now. Tracker detection can not be ignored anymore now. [Mod] Changes some error messages to be more verbose. [Mod] More error messages are now added to the log instead of showing messageboxes. [Mod] Updated internet links (ModPlug Central Forums link is now a permalink) [Ref] Removed unfinished, possibly confusing code from CMainFrame. Modified Paths: -------------- trunk/OpenMPT/mptrack/MainFrm.cpp trunk/OpenMPT/mptrack/Mainfrm.h trunk/OpenMPT/soundlib/IT_DEFS.H trunk/OpenMPT/soundlib/Load_it.cpp Modified: trunk/OpenMPT/mptrack/MainFrm.cpp =================================================================== --- trunk/OpenMPT/mptrack/MainFrm.cpp 2010-05-13 21:06:48 UTC (rev 594) +++ trunk/OpenMPT/mptrack/MainFrm.cpp 2010-05-14 15:27:19 UTC (rev 595) @@ -1825,13 +1825,6 @@ } -UINT CMainFrame::GetCurrentInstrument() -//------------------------------------- -{ - return 0; -} - - void CMainFrame::SetPreAmp(UINT n) //-------------------------------- { @@ -2245,7 +2238,7 @@ BOOL CMainFrame::SetupDirectories(LPCTSTR szModDir, LPCTSTR szSampleDir, LPCTSTR szInstrDir, LPCTSTR szVstDir, LPCTSTR szPresetDir) -//--------------------------------------------------------------------------- +//--------------------------------------------------------------------------------------------------------------------------------- { // will also set working directory SetDefaultDirectory(szModDir, DIR_MODS); @@ -2760,8 +2753,8 @@ // case ID_NETLINK_OSMUSIC: pszURL = "http://www.osmusic.net/"; break; // case ID_NETLINK_HANDBOOK: pszURL = "http://www.modplug.com/mods/handbook/handbook.htm"; break; case ID_NETLINK_MPTFR: pszURL = "http://mpt.new.fr/"; break; - case ID_NETLINK_FORUMS: pszURL = "http://www.lpchip.com/modplug"; break; - case ID_NETLINK_PLUGINS: pszURL = "http://www.kvraudio.com"; break; + case ID_NETLINK_FORUMS: pszURL = "http://openmpt.com/forum/"; break; + case ID_NETLINK_PLUGINS: pszURL = "http://www.kvraudio.com/"; break; case ID_NETLINK_MODARCHIVE: pszURL = "http://modarchive.org/"; break; case ID_NETLINK_OPENMPTWIKI_GERMAN: pszURL = "http://sagamusix.de/openmpt/Hauptseite"; break; } Modified: trunk/OpenMPT/mptrack/Mainfrm.h =================================================================== --- trunk/OpenMPT/mptrack/Mainfrm.h 2010-05-13 21:06:48 UTC (rev 594) +++ trunk/OpenMPT/mptrack/Mainfrm.h 2010-05-14 15:27:19 UTC (rev 595) @@ -562,7 +562,6 @@ VOID SetXInfoText(LPCSTR lpszText); //rewbs.xinfo VOID SetHelpText(LPCSTR lpszText); UINT GetBaseOctave(); - UINT GetCurrentInstrument(); CModDoc *GetActiveDoc(); CView *GetActiveView(); //rewbs.customKeys CImageList *GetImageList() { return &m_ImageList; } Modified: trunk/OpenMPT/soundlib/IT_DEFS.H =================================================================== --- trunk/OpenMPT/soundlib/IT_DEFS.H 2010-05-13 21:06:48 UTC (rev 594) +++ trunk/OpenMPT/soundlib/IT_DEFS.H 2010-05-14 15:27:19 UTC (rev 595) @@ -143,8 +143,10 @@ #define ITP_VERSION 0x00000102 // v1.02 #define ITP_FILE_ID 0x2e697470 // .itp ASCII -enum IT_ReaderBitMasks { +#define IT_CHBI 0x49424843 // "CHBI" magic bytes in the IT header to identify ChibiTracker +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. Modified: trunk/OpenMPT/soundlib/Load_it.cpp =================================================================== --- trunk/OpenMPT/soundlib/Load_it.cpp 2010-05-13 21:06:48 UTC (rev 594) +++ trunk/OpenMPT/soundlib/Load_it.cpp 2010-05-14 15:27:19 UTC (rev 595) @@ -196,10 +196,14 @@ if(iter == notFoundTunings.end()) { notFoundTunings.push_back(str); - string erm = string("Tuning ") + str + string(" used by the module was not found."); - MessageBox(0, erm.c_str(), 0, MB_ICONINFORMATION); - if(csf.GetpModDoc()) //The tuning is changed so the modified flag is set. - csf.GetpModDoc()->SetModified(); +#ifdef MODPLUG_TRACKER + if(csf.GetpModDoc() != nullptr) + { + string erm = string("Tuning ") + str + string(" used by the module was not found."); + csf.GetpModDoc()->AddToLog(erm.c_str()); + csf.GetpModDoc()->SetModified(); //The tuning is changed so the modified flag is set. + } +#endif // MODPLUG_TRACKER } csf.Instruments[i]->pTuning = csf.Instruments[i]->s_DefaultTuning; @@ -767,7 +771,8 @@ if(streamPos >= dwMemLength || len > dwMemLength - streamPos) return false; // Copy sample struct data - if(pis.id == 0x53504D49){ + if(pis.id == 0x53504D49) + { MODSAMPLE *pSmp = &Samples[nsmp]; memcpy(pSmp->filename, pis.filename, 12); pSmp->uFlags = 0; @@ -873,7 +878,8 @@ //HACK: if we fail on i <= m_nInstruments above, arrive here without having set fcode as appropriate, // hence the code duplication. - if ( (uintptr_t)(ptr - lpStream) <= dwMemLength - 4 ) { + if ( (uintptr_t)(ptr - lpStream) <= dwMemLength - 4 ) + { fcode = (*((__int32 *)ptr)); } @@ -1031,7 +1037,7 @@ memcpy(m_lpszSongComments, lpStream+pifh->msgoffset, pifh->msglength); m_lpszSongComments[pifh->msglength] = 0; // ChibiTracker uses \n instead of \r. - if(pifh->cwtv == 0x0214 && pifh->cmwt == 0x0214 && LittleEndian(pifh->reserved) == 0x49424843) + if(pifh->cwtv == 0x0214 && pifh->cmwt == 0x0214 && LittleEndian(pifh->reserved) == IT_CHBI) { for(size_t i = 0; i < pifh->msglength; i++) { @@ -1053,9 +1059,11 @@ { if(nordsize > GetModSpecifications().ordersMax) { +#ifdef MODPLUG_TRACKER CString str; str.Format(str_SequenceTruncationNote, nordsize, GetModSpecifications().ordersMax); - CMainFrame::GetMainFrame()->MessageBox(str, 0, MB_ICONWARNING); + if(GetpModDoc() != nullptr) GetpModDoc()->AddToLog(str); +#endif // MODPLUG_TRACKER nordsize = GetModSpecifications().ordersMax; } @@ -1090,9 +1098,14 @@ if(patpossize > GetModSpecifications().patternsMax) { // Hack: Note user here if file contains more patterns than what can be read. - CString str; - str.Format(str_PatternSetTruncationNote, patpossize, GetModSpecifications().patternsMax); - CMainFrame::GetMainFrame()->MessageBox(str, 0, MB_ICONWARNING); +#ifdef MODPLUG_TRACKER + if(GetpModDoc() != nullptr) + { + CString str; + str.Format(str_PatternSetTruncationNote, patpossize, GetModSpecifications().patternsMax); + GetpModDoc()->AddToLog(str); + } +#endif // MODPLUG_TRACKER patpossize = GetModSpecifications().patternsMax; } @@ -1357,8 +1370,8 @@ #ifdef MODPLUG_TRACKER CString s; s.Format(TEXT("Allocating patterns failed starting from pattern %u"), npat); - if(m_pModDoc != nullptr) m_pModDoc->AddToLog(s); -#endif + if(GetpModDoc() != nullptr) GetpModDoc()->AddToLog(s); +#endif // MODPLUG_TRACKER break; } continue; @@ -1473,7 +1486,7 @@ // 203-212: Vibrato depth if ((vol >= 203) && (vol <= 212)) { m[ch].volcmd = VOLCMD_VIBRATODEPTH; m[ch].vol = vol - 203; - // Old versions of ModPlug seemed to save this as vibrato speed instead so let's fix that + // Old versions of ModPlug saved this as vibrato speed instead, so let's fix that if(m_dwLastSavedWithVersion <= MAKE_VERSION_NUMERIC(1, 17, 02, 54) && interpretModplugmade) m[ch].volcmd = VOLCMD_VIBRATOSPEED; } else @@ -1511,24 +1524,15 @@ SetModFlag(MSF_OLDVOLSWING, true); } - static char autodetectITplaymode = -1; if(GetType() == MOD_TYPE_IT) { -#ifdef MODPLUG_TRACKER - if(autodetectITplaymode == -1) - autodetectITplaymode = CMainFrame::GetPrivateProfileLong("Misc", "AutodetectITplaystyle", 1, theApp.GetConfigFileName()); -#endif - - if(autodetectITplaymode) + // Set appropriate mod flags if the file was not made with MPT. + if(!interpretModplugmade) { - if(!interpretModplugmade) - { - SetModFlag(MSF_MIDICC_BUGEMULATION, false); - SetModFlag(MSF_OLDVOLSWING, false); - SetModFlag(MSF_COMPATIBLE_PLAY, true); - } + SetModFlag(MSF_MIDICC_BUGEMULATION, false); + SetModFlag(MSF_OLDVOLSWING, false); + SetModFlag(MSF_COMPATIBLE_PLAY, true); } - return true; } else { @@ -1551,14 +1555,24 @@ ssb.ReadItem(Order, FileIdSequences, strlen(FileIdSequences), &ReadModSequences); if (ssb.m_Status & srlztn::SNT_FAILURE) - AfxMessageBox("Unknown error occured.", MB_ICONERROR); + { +#ifdef MODPLUG_TRACKER + if(GetpModDoc() != nullptr) GetpModDoc()->AddToLog(_T("Unknown error occured while deserializing file.")); +#endif // MODPLUG_TRACKER + } } else //Loading for older files. { if(GetTuneSpecificTunings().Deserialize(iStrm)) - MessageBox(0, "Error occured - loading failed while trying to load tune specific tunings.", "", MB_ICONERROR); + { +#ifdef MODPLUG_TRACKER + if(GetpModDoc() != nullptr) GetpModDoc()->AddToLog(_T("Error occured - loading failed while trying to load tune specific tunings.")); +#endif // MODPLUG_TRACKER + } else + { ReadTuningMap(iStrm, *this); + } } } //version condition(MPT) } @@ -2422,7 +2436,7 @@ ssb.FinishWrite(); if (ssb.m_Status & srlztn::SNT_FAILURE) - AfxMessageBox("Error occured in writing.", MB_ICONERROR); + AfxMessageBox("Error occured in writing MPTM extensions.", MB_ICONERROR); //Last 4 bytes should tell where the hack mpt things begin. if(!fout.good()) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <sag...@us...> - 2010-05-14 16:37:22
|
Revision: 596 http://modplug.svn.sourceforge.net/modplug/?rev=596&view=rev Author: saga-games Date: 2010-05-14 16:37:15 +0000 (Fri, 14 May 2010) Log Message: ----------- [Mod] Updated installer / readme URLs and instructions. Modified Paths: -------------- trunk/OpenMPT/installer/install.iss trunk/OpenMPT/installer/packageTemplate/readme.txt trunk/OpenMPT/packageTemplate/readme.txt Modified: trunk/OpenMPT/installer/install.iss =================================================================== --- trunk/OpenMPT/installer/install.iss 2010-05-14 15:27:19 UTC (rev 595) +++ trunk/OpenMPT/installer/install.iss 2010-05-14 16:37:15 UTC (rev 596) @@ -6,12 +6,12 @@ [Setup] AppId={{67903736-E9BB-4664-B148-F62BCAB4FA42} AppVerName=OpenMPT 1.18 -AppVersion=1.18.00.00 +AppVersion=1.18.01.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://openmpt.com/ +AppSupportURL=http://openmpt.com/forum/ +AppUpdatesURL=http://openmpt.com/ DefaultDirName={pf}\OpenMPT DefaultGroupName=OpenMPT AllowNoIcons=yes @@ -240,5 +240,3 @@ end; end; - - Modified: trunk/OpenMPT/installer/packageTemplate/readme.txt =================================================================== --- trunk/OpenMPT/installer/packageTemplate/readme.txt 2010-05-14 15:27:19 UTC (rev 595) +++ trunk/OpenMPT/installer/packageTemplate/readme.txt 2010-05-14 16:37:15 UTC (rev 596) @@ -6,16 +6,16 @@ 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 %appdata%\OpenMPT (or the -directory into which you installed OpenMPT if you used portable mode). +Unless you install OpenMPT in portable mode, all settings are now stored in +%appdata%\OpenMPT. The installer will automatically try to move all settings +to the new folder - Migration is done automatically. Uninstallation -------------- An uninstaller is provided. Don't worry, it will ask you if you want to keep -your personal settings, nothing will automatically be deleted. +your personal settings, none of these will be deleted automatically. Changes @@ -27,7 +27,7 @@ Questions, comments, bug reports... ----------------------------------- -See forums at http://modplug.sourceforge.net/. +See forums at http://openmpt.com/forum/. Release package contents: @@ -36,13 +36,14 @@ available in several flavours (including MPT classic, FastTracker and Impulse Tracker) and country-specific layouts. soundtouch(folder): SoundTouch readme and copying.txt +ReleaseNotesImages(folder): Images using in the release notes document. 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: +readme.txt: this document unmo3.dll: Used in MO3-file import. +OMPT_1.18_ReleaseNotes.html: Release notes for this version. Misc: ----- Modified: trunk/OpenMPT/packageTemplate/readme.txt =================================================================== --- trunk/OpenMPT/packageTemplate/readme.txt 2010-05-14 15:27:19 UTC (rev 595) +++ trunk/OpenMPT/packageTemplate/readme.txt 2010-05-14 16:37:15 UTC (rev 596) @@ -38,20 +38,22 @@ Questions, comments, bug reports... ----------------------------------- -See forums at http://modplug.sourceforge.net/. +See forums at http://openmpt.com/forum/. Release package contents: ------------------------- extraKeymaps(folder): soundtouch(folder): SoundTouch readme and copying.txt +ReleaseNotesImages(folder): Images using in the release notes document. 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: +readme.txt: this document unmo3.dll: Used in MO3-file import. +OMPT_1.18_ReleaseNotes.html: Release notes for this version. Misc: This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <sag...@us...> - 2010-05-20 21:41:42
|
Revision: 598 http://modplug.svn.sourceforge.net/modplug/?rev=598&view=rev Author: saga-games Date: 2010-05-20 21:41:36 +0000 (Thu, 20 May 2010) Log Message: ----------- [Fix] Sample Editor: When loading an extremely short raw file (f.e. 1 byte) twice, it crashed OpenMPT. [Imp] XM Loader: Improved detection of an old version of MPT. [Ref] Some rewriting of the CRawSampleDlg code. Modified Paths: -------------- trunk/OpenMPT/mptrack/Ctrl_smp.cpp trunk/OpenMPT/mptrack/Mpdlgs.cpp trunk/OpenMPT/mptrack/Mpdlgs.h trunk/OpenMPT/soundlib/Load_mod.cpp trunk/OpenMPT/soundlib/Load_xm.cpp Modified: trunk/OpenMPT/mptrack/Ctrl_smp.cpp =================================================================== --- trunk/OpenMPT/mptrack/Ctrl_smp.cpp 2010-05-15 20:26:56 UTC (rev 597) +++ trunk/OpenMPT/mptrack/Ctrl_smp.cpp 2010-05-20 21:41:36 UTC (rev 598) @@ -716,14 +716,14 @@ CRawSampleDlg dlg(this); if(m_nPreviousRawFormat != 0) { - dlg.m_nFormat = m_nPreviousRawFormat; - dlg.m_bRememberFormat = true; + dlg.SetSampleFormat(m_nPreviousRawFormat); + dlg.SetRememberFormat(true); } EndWaitCursor(); if ((m_nPreviousRawFormat != 0) || (dlg.DoModal() == IDOK)) { - m_nPreviousRawFormat = ((dlg.m_bRememberFormat)) ? dlg.m_nFormat : 0; + m_nPreviousRawFormat = ((dlg.GetRemeberFormat())) ? dlg.GetSampleFormat() : 0; BeginWaitCursor(); UINT flags = 0; @@ -732,25 +732,19 @@ m_pSndFile->DestroySample(m_nSample); pSmp->nLength = len; pSmp->uFlags = RS_PCM8S; - pSmp->nGlobalVol = 64; - pSmp->nVolume = 256; - pSmp->nPan = 128; - pSmp->filename[0] = 0; - if (!pSmp->nC5Speed) pSmp->nC5Speed = 22050; - if (dlg.m_nFormat & 1) + + if (dlg.GetSampleFormat() & ER_16BIT) { pSmp->nLength >>= 1; - pSmp->uFlags |= CHN_16BIT; flags = RS_PCM16S; } - if (!(dlg.m_nFormat & 2)) + if (dlg.GetSampleFormat() & ER_UNSIGNED) { flags++; } // Interleaved Stereo Sample - if (dlg.m_nFormat & 4) + if (dlg.GetSampleFormat() & ER_STEREO) { - pSmp->uFlags |= CHN_STEREO; pSmp->nLength >>= 1; flags |= 0x40|RSF_STEREO; } @@ -764,6 +758,15 @@ if (m_pSndFile->ReadSample(pSmp, flags, p16, l16)) { bOk = true; + + pSmp->nGlobalVol = 64; + pSmp->nVolume = 256; + pSmp->nPan = 128; + pSmp->filename[0] = 0; + if (!pSmp->nC5Speed) pSmp->nC5Speed = 22050; + } else + { + m_pModDoc->GetSampleUndo()->Undo(m_nSample); } END_CRITICAL(); } else Modified: trunk/OpenMPT/mptrack/Mpdlgs.cpp =================================================================== --- trunk/OpenMPT/mptrack/Mpdlgs.cpp 2010-05-15 20:26:56 UTC (rev 597) +++ trunk/OpenMPT/mptrack/Mpdlgs.cpp 2010-05-20 21:41:36 UTC (rev 598) @@ -1056,10 +1056,8 @@ ////////////////////////////////////////////////////////////// // CRawSampleDlg +UINT CRawSampleDlg::m_nFormat = ER_8BIT | ER_UNSIGNED | ER_MONO; -UINT CRawSampleDlg::m_nFormat = 0; - - BOOL CRawSampleDlg::OnInitDialog() //-------------------------------- { @@ -1073,9 +1071,12 @@ //------------------------ { m_nFormat = 0; - if (IsDlgButtonChecked(IDC_RADIO2)) m_nFormat |= 1; - if (IsDlgButtonChecked(IDC_RADIO4)) m_nFormat |= 2; - if (IsDlgButtonChecked(IDC_RADIO6)) m_nFormat |= 4; + if(IsDlgButtonChecked(IDC_RADIO1)) m_nFormat |= ER_8BIT; + if(IsDlgButtonChecked(IDC_RADIO2)) m_nFormat |= ER_16BIT; + if(IsDlgButtonChecked(IDC_RADIO3)) m_nFormat |= ER_UNSIGNED; + if(IsDlgButtonChecked(IDC_RADIO4)) m_nFormat |= ER_SIGNED; + if(IsDlgButtonChecked(IDC_RADIO5)) m_nFormat |= ER_MONO; + if(IsDlgButtonChecked(IDC_RADIO6)) m_nFormat |= ER_STEREO; m_bRememberFormat = IsDlgButtonChecked(IDC_CHK_REMEMBERSETTINGS) ? true : false; CDialog::OnOK(); } @@ -1084,9 +1085,9 @@ void CRawSampleDlg::UpdateDialog() //-------------------------------- { - CheckRadioButton(IDC_RADIO1, IDC_RADIO2, (m_nFormat & 1) ? IDC_RADIO2 : IDC_RADIO1); - CheckRadioButton(IDC_RADIO3, IDC_RADIO4, (m_nFormat & 2) ? IDC_RADIO4 : IDC_RADIO3); - CheckRadioButton(IDC_RADIO5, IDC_RADIO6, (m_nFormat & 4) ? IDC_RADIO6 : IDC_RADIO5); + CheckRadioButton(IDC_RADIO1, IDC_RADIO2, (m_nFormat & ER_8BIT) ? IDC_RADIO1 : IDC_RADIO2 ); + CheckRadioButton(IDC_RADIO3, IDC_RADIO4, (m_nFormat & ER_UNSIGNED) ? IDC_RADIO3 : IDC_RADIO4); + CheckRadioButton(IDC_RADIO5, IDC_RADIO6, (m_nFormat & ER_MONO) ? IDC_RADIO5 : IDC_RADIO6); CheckDlgButton(IDC_CHK_REMEMBERSETTINGS, (m_bRememberFormat) ? MF_CHECKED : MF_UNCHECKED); } Modified: trunk/OpenMPT/mptrack/Mpdlgs.h =================================================================== --- trunk/OpenMPT/mptrack/Mpdlgs.h 2010-05-15 20:26:56 UTC (rev 597) +++ trunk/OpenMPT/mptrack/Mpdlgs.h 2010-05-20 21:41:36 UTC (rev 598) @@ -129,18 +129,32 @@ }; +#define ER_8BIT 0x01 +#define ER_16BIT 0x02 + +#define ER_SIGNED 0x10 +#define ER_UNSIGNED 0x20 + +#define ER_MONO 0x0100 +#define ER_STEREO 0x0200 + //================================= class CRawSampleDlg: public CDialog //================================= { -public: +protected: static UINT m_nFormat; bool m_bRememberFormat; public: + static const UINT GetSampleFormat() { return m_nFormat; } + static void SetSampleFormat(UINT nFormat) { m_nFormat = nFormat; } + const bool GetRemeberFormat() { return m_bRememberFormat; }; + void SetRememberFormat(bool bRemember) { m_bRememberFormat = bRemember; }; + +public: CRawSampleDlg(CWnd *parent = NULL):CDialog(IDD_LOADRAWSAMPLE, parent) { - //m_nFormat = 0; m_bRememberFormat = false; } Modified: trunk/OpenMPT/soundlib/Load_mod.cpp =================================================================== --- trunk/OpenMPT/soundlib/Load_mod.cpp 2010-05-15 20:26:56 UTC (rev 597) +++ trunk/OpenMPT/soundlib/Load_mod.cpp 2010-05-20 21:41:36 UTC (rev 598) @@ -55,7 +55,7 @@ case 'X' - 55: command = CMD_XFINEPORTAUPDOWN; break; case 'Y' - 55: command = CMD_PANBRELLO; break; //34 case 'Z' - 55: command = CMD_MIDI; break; //35 - case '\\' - 56: command = CMD_SMOOTHMIDI; break; //rewbs.smoothVST: 36 + case '\\' - 56: command = CMD_SMOOTHMIDI; break; //rewbs.smoothVST: 36 - note: this is actually displayed as "-" in FT2, but seems to be doing nothing. //case ':' - 21: command = CMD_DELAYCUT; break; //37 case '#' + 3: command = CMD_XPARAM; break; //rewbs.XMfixes - XParam is 38 default: command = 0; Modified: trunk/OpenMPT/soundlib/Load_xm.cpp =================================================================== --- trunk/OpenMPT/soundlib/Load_xm.cpp 2010-05-15 20:26:56 UTC (rev 597) +++ trunk/OpenMPT/soundlib/Load_xm.cpp 2010-05-20 21:41:36 UTC (rev 598) @@ -245,7 +245,7 @@ BYTE samples_used[(MAX_SAMPLES + 7) / 8]; // for removing unused samples UINT unused_samples; // dito - bool bMadeWithModPlug = false, bProbablyMadeWithModPlug = false, bIsFT2 = false; + bool bMadeWithModPlug = false, bProbablyMadeWithModPlug = false, bProbablyMPT109 = false, bIsFT2 = false; // set this here already because XMs compressed with BoobieSqueezer will exit the function early SetModFlag(MSF_COMPATIBLE_PLAY, true); @@ -561,6 +561,9 @@ pSmp->nVibRate = xmsh.vibrate; memcpy(pSmp->filename, xmss.name, 22); SpaceToNullStringFixed(pSmp->filename, 21); + + if ((xmss.type & 3) == 3) // MPT 1.09 and maybe newer / older versions set both flags for bidi loops + bProbablyMPT109 = true; } #if 0 if ((xmsh.reserved2 > nsamples) && (xmsh.reserved2 <= 16)) @@ -683,7 +686,6 @@ if (!memcmp((LPCSTR)lpStream + 0x26, "OpenMPT ", 8)) { - //bMadeWithModPlug = true; // Don't set it - it's also used by compatibility export CHAR sVersion[13]; memcpy(sVersion, lpStream + 0x26 + 8, 12); sVersion[12] = 0; @@ -693,7 +695,13 @@ if(bMadeWithModPlug) { SetModFlag(MSF_COMPATIBLE_PLAY, false); - if(!m_dwLastSavedWithVersion) m_dwLastSavedWithVersion = MAKE_VERSION_NUMERIC(1, 16, 00, 00); + if(!m_dwLastSavedWithVersion) + { + if(bProbablyMPT109) + m_dwLastSavedWithVersion = MAKE_VERSION_NUMERIC(1, 09, 00, 00); + else + m_dwLastSavedWithVersion = MAKE_VERSION_NUMERIC(1, 16, 00, 00); + } } // -> CODE#0027 @@ -712,6 +720,9 @@ if(bInterpretOpenMPTMade && m_dwLastSavedWithVersion < MAKE_VERSION_NUMERIC(1, 17, 2, 50)) SetModFlag(MSF_MIDICC_BUGEMULATION, true); + if(bInterpretOpenMPTMade && m_dwLastSavedWithVersion == 0) + m_dwLastSavedWithVersion = MAKE_VERSION_NUMERIC(1, 17, 01, 00); // early versions of OpenMPT had no version indication. + return true; } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <rel...@us...> - 2010-05-21 16:37:44
|
Revision: 599 http://modplug.svn.sourceforge.net/modplug/?rev=599&view=rev Author: relabsoluness Date: 2010-05-21 16:37:38 +0000 (Fri, 21 May 2010) Log Message: ----------- [Mod] Keybindings: Updated and slightly modified default keybindings. [Fix] General: Fix to possible path handling related crash (occurred at least in VC03 build at startup). [Fix] Internal: VC03 build fixes(e.g. added ungzip-project, updated zlib-project). Modified Paths: -------------- trunk/OpenMPT/mptrack/MPTRACK.sln trunk/OpenMPT/mptrack/MainFrm.cpp trunk/OpenMPT/mptrack/View_gen.cpp trunk/OpenMPT/mptrack/mptrack.vcproj trunk/OpenMPT/mptrack/res/defaultKeybindings.mkb trunk/OpenMPT/zlib/contrib/vstudio/vc7/zlibstat.vcproj Added Paths: ----------- trunk/OpenMPT/ungzip/ungzip.vcproj Modified: trunk/OpenMPT/mptrack/MPTRACK.sln =================================================================== --- trunk/OpenMPT/mptrack/MPTRACK.sln 2010-05-20 21:41:36 UTC (rev 598) +++ trunk/OpenMPT/mptrack/MPTRACK.sln 2010-05-21 16:37:38 UTC (rev 599) @@ -6,6 +6,7 @@ {71531076-78C7-488D-8FD6-9D841F20AADE} = {71531076-78C7-488D-8FD6-9D841F20AADE} {CF3C2CA5-5D45-4635-BBA4-C1F435E10896} = {CF3C2CA5-5D45-4635-BBA4-C1F435E10896} {3C7281B0-D0E2-48ED-AE4D-A181FC77D8F7} = {3C7281B0-D0E2-48ED-AE4D-A181FC77D8F7} + {20BF96C8-0202-4251-80C9-6C62BE845DAE} = {20BF96C8-0202-4251-80C9-6C62BE845DAE} EndProjectSection EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "unlha", "..\unlha\unlha.vcproj", "{71531076-78C7-488D-8FD6-9D841F20AADE}" @@ -32,6 +33,11 @@ ProjectSection(ProjectDependencies) = postProject EndProjectSection EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "ungzip", "..\ungzip\ungzip.vcproj", "{20BF96C8-0202-4251-80C9-6C62BE845DAE}" + ProjectSection(ProjectDependencies) = postProject + {3F7D3110-B3DD-4DE1-B608-C3F491009625} = {3F7D3110-B3DD-4DE1-B608-C3F491009625} + EndProjectSection +EndProject Global GlobalSection(SolutionConfiguration) = preSolution Debug = Debug @@ -92,12 +98,20 @@ {CF3C2CA5-5D45-4635-BBA4-C1F435E10896}.ReleaseWithoutAsm.Build.0 = Release|Win32 {3F7D3110-B3DD-4DE1-B608-C3F491009625}.Debug.ActiveCfg = Debug|Win32 {3F7D3110-B3DD-4DE1-B608-C3F491009625}.Debug.Build.0 = Debug|Win32 - {3F7D3110-B3DD-4DE1-B608-C3F491009625}.Release.ActiveCfg = Release|Win32 - {3F7D3110-B3DD-4DE1-B608-C3F491009625}.Release.Build.0 = Release|Win32 + {3F7D3110-B3DD-4DE1-B608-C3F491009625}.Release.ActiveCfg = ReleaseWithoutAsm|Win32 + {3F7D3110-B3DD-4DE1-B608-C3F491009625}.Release.Build.0 = ReleaseWithoutAsm|Win32 {3F7D3110-B3DD-4DE1-B608-C3F491009625}.ReleaseAxp.ActiveCfg = ReleaseAxp|Win32 {3F7D3110-B3DD-4DE1-B608-C3F491009625}.ReleaseAxp.Build.0 = ReleaseAxp|Win32 {3F7D3110-B3DD-4DE1-B608-C3F491009625}.ReleaseWithoutAsm.ActiveCfg = ReleaseWithoutAsm|Win32 {3F7D3110-B3DD-4DE1-B608-C3F491009625}.ReleaseWithoutAsm.Build.0 = ReleaseWithoutAsm|Win32 + {20BF96C8-0202-4251-80C9-6C62BE845DAE}.Debug.ActiveCfg = Debug|Win32 + {20BF96C8-0202-4251-80C9-6C62BE845DAE}.Debug.Build.0 = Debug|Win32 + {20BF96C8-0202-4251-80C9-6C62BE845DAE}.Release.ActiveCfg = Release|Win32 + {20BF96C8-0202-4251-80C9-6C62BE845DAE}.Release.Build.0 = Release|Win32 + {20BF96C8-0202-4251-80C9-6C62BE845DAE}.ReleaseAxp.ActiveCfg = Release|Win32 + {20BF96C8-0202-4251-80C9-6C62BE845DAE}.ReleaseAxp.Build.0 = Release|Win32 + {20BF96C8-0202-4251-80C9-6C62BE845DAE}.ReleaseWithoutAsm.ActiveCfg = Release|Win32 + {20BF96C8-0202-4251-80C9-6C62BE845DAE}.ReleaseWithoutAsm.Build.0 = Release|Win32 EndGlobalSection GlobalSection(ExtensibilityGlobals) = postSolution EndGlobalSection Modified: trunk/OpenMPT/mptrack/MainFrm.cpp =================================================================== --- trunk/OpenMPT/mptrack/MainFrm.cpp 2010-05-20 21:41:36 UTC (rev 598) +++ trunk/OpenMPT/mptrack/MainFrm.cpp 2010-05-21 16:37:38 UTC (rev 599) @@ -3176,14 +3176,14 @@ return; const size_t nStrLength = nLength - 1; // "usable" length, i.e. not including the null char. - TCHAR szExePath[nLength], szTempPath[nLength]; + TCHAR szExePath[nLength], szTempPath[nLength] = _T(""); _tcsncpy(szExePath, theApp.GetAppDirPath(), nStrLength); SetNullTerminator(szExePath); // Path is on the same drive as OpenMPT ("\Somepath\" => "C:\Somepath\") if(!_tcsncicmp(szPath, _T("\\"), 1)) { - _tcsncpy(szTempPath, szExePath, 2); // "C:" + _tcsncat(szTempPath, szExePath, 2); // "C:" _tcsncat(szTempPath, szPath, nStrLength - 2); // "\Somepath\" _tcscpy(szPath, szTempPath); } else Modified: trunk/OpenMPT/mptrack/View_gen.cpp =================================================================== --- trunk/OpenMPT/mptrack/View_gen.cpp 2010-05-20 21:41:36 UTC (rev 598) +++ trunk/OpenMPT/mptrack/View_gen.cpp 2010-05-21 16:37:38 UTC (rev 599) @@ -1488,6 +1488,7 @@ // This is used for retrieving the correct background colour for the // frames on the general tab when using WinXP Luna or Vista/Win7 Aero. typedef HRESULT (__stdcall * ETDT)(HWND, DWORD); +#include <uxtheme.h> HBRUSH CViewGlobals::OnCtlColor(CDC *pDC, CWnd* pWnd, UINT nCtlColor) //------------------------------------------------------------------- @@ -1497,7 +1498,7 @@ if(!bUxInited) { - HMODULE uxlib = LoadLibrary("uxtheme.dll"); + HMODULE uxlib = LoadLibrary(_T("uxtheme.dll")); if(uxlib) hETDT = (ETDT)GetProcAddress(uxlib, "EnableThemeDialogTexture"); bUxInited = true; Modified: trunk/OpenMPT/mptrack/mptrack.vcproj =================================================================== --- trunk/OpenMPT/mptrack/mptrack.vcproj 2010-05-20 21:41:36 UTC (rev 598) +++ trunk/OpenMPT/mptrack/mptrack.vcproj 2010-05-21 16:37:38 UTC (rev 599) @@ -698,6 +698,9 @@ RelativePath=".\res\view_pat.bmp"> </File> <File + RelativePath=".\res\vispcnode.bmp"> + </File> + <File RelativePath=".\res\vumeters.bmp"> </File> </Filter> Modified: trunk/OpenMPT/mptrack/res/defaultKeybindings.mkb =================================================================== --- trunk/OpenMPT/mptrack/res/defaultKeybindings.mkb 2010-05-20 21:41:36 UTC (rev 598) +++ trunk/OpenMPT/mptrack/res/defaultKeybindings.mkb 2010-05-21 16:37:38 UTC (rev 599) @@ -23,6 +23,7 @@ 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:1820:6:86:1 //Push Forward Paste: Ctrl+Alt+V (KeyDown) 0:1364:2:53:1 //SelectAll: Ctrl+5 (KeyDown) 0:1365:2:70:1 //Find: Ctrl+F (KeyDown) 0:1366:0:114:1 //Find Next: F3 (KeyDown) @@ -79,11 +80,13 @@ 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:1836:2:191:1 //Edit plugin assigned to PC note: Ctrl+/ (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:1776:1:122:1 //Toggle loop pattern: Shift+F11 (KeyDown) +2:1780:2:84:1 //Show playback time at current row: Ctrl+T (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) @@ -134,7 +137,7 @@ 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: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) @@ -167,11 +170,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: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) +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) @@ -229,14 +232,12 @@ 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 - (unused): ; (KeyDown) -5:1245:1:186:1 //Vol command - (unused): 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 combined note cute and note delay: Shift+; (KeyDown) -6:1295:0:186:1 //FX combined note cute and note delay: ; (KeyDown) +6:1295:1:186:1 //FX combined note delay and note cut: Shift+; (KeyDown) +6:1295:0:186:1 //FX combined note delay and note cut: ; (KeyDown) 6:1666:0:191:1 //FX parameter extension command: / (KeyDown) //----( Pattern Context [bottom] - Param Col (7) )------------ @@ -282,6 +283,8 @@ 8:1790:2:68:1 //Remove DC Offset: Ctrl+D (KeyDown) //----( Instrument Context [bottom] (9) )------------ +9:1837:0:107:5 //Zoom In: NUM PLUS (KeyDown|KeyHold) +9:1838:0:109:5 //Zoom Out: NUM SUB (KeyDown|KeyHold) 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) @@ -306,11 +309,14 @@ //----( 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) +13:1763:0:109:5 //Previous plugin preset: NUM SUB (KeyDown|KeyHold) +13:1764:0:107:5 //Next plugin preset: NUM PLUS (KeyDown|KeyHold) +13:1782:2:109:5 //Plugin preset backward jump: Ctrl+NUM SUB (KeyDown|KeyHold) +13:1783:2:107:5 //Plugin preset forward jump: Ctrl+NUM PLUS (KeyDown|KeyHold) +13:1765:3:68:1 //Randomize plugin parameters: Shift+Ctrl+D (KeyDown) +13:1839:2:82:1 //Toggle parameter recording: Ctrl+R (KeyDown) +13:1840:2:75:1 //Pass key presses to plugin: Ctrl+K (KeyDown) +13:1841:2:66:1 //Bypass plugin: Ctrl+B (KeyDown) //----( General Context [top] (14) )------------ Added: trunk/OpenMPT/ungzip/ungzip.vcproj =================================================================== --- trunk/OpenMPT/ungzip/ungzip.vcproj (rev 0) +++ trunk/OpenMPT/ungzip/ungzip.vcproj 2010-05-21 16:37:38 UTC (rev 599) @@ -0,0 +1,124 @@ +<?xml version="1.0" encoding="Windows-1252"?> +<VisualStudioProject + ProjectType="Visual C++" + Version="7.10" + Name="ungzip" + ProjectGUID="{20BF96C8-0202-4251-80C9-6C62BE845DAE}" + Keyword="Win32Proj"> + <Platforms> + <Platform + Name="Win32"/> + </Platforms> + <Configurations> + <Configuration + Name="Debug|Win32" + OutputDirectory="Debug" + IntermediateDirectory="Debug" + ConfigurationType="4" + CharacterSet="0"> + <Tool + Name="VCCLCompilerTool" + Optimization="0" + PreprocessorDefinitions="WIN32;_DEBUG;_LIB;ZLIB_WINAPI" + MinimalRebuild="TRUE" + BasicRuntimeChecks="3" + RuntimeLibrary="1" + BufferSecurityCheck="TRUE" + ForceConformanceInForLoopScope="TRUE" + UsePrecompiledHeader="0" + WarningLevel="4" + Detect64BitPortabilityProblems="TRUE" + DebugInformationFormat="4"/> + <Tool + Name="VCCustomBuildTool"/> + <Tool + Name="VCLibrarianTool" + OutputFile="$(OutDir)/ungzip.lib"/> + <Tool + Name="VCMIDLTool"/> + <Tool + Name="VCPostBuildEventTool"/> + <Tool + Name="VCPreBuildEventTool"/> + <Tool + Name="VCPreLinkEventTool"/> + <Tool + Name="VCResourceCompilerTool"/> + <Tool + Name="VCWebServiceProxyGeneratorTool"/> + <Tool + Name="VCXMLDataGeneratorTool"/> + <Tool + Name="VCManagedWrapperGeneratorTool"/> + <Tool + Name="VCAuxiliaryManagedWrapperGeneratorTool"/> + </Configuration> + <Configuration + Name="Release|Win32" + OutputDirectory="Release" + IntermediateDirectory="Release" + ConfigurationType="4" + CharacterSet="0"> + <Tool + Name="VCCLCompilerTool" + AdditionalOptions="/O2" + PreprocessorDefinitions="WIN32;NDEBUG;_LIB;ZLIB_WINAPI" + RuntimeLibrary="0" + ForceConformanceInForLoopScope="TRUE" + UsePrecompiledHeader="0" + WarningLevel="3" + Detect64BitPortabilityProblems="TRUE" + DebugInformationFormat="3"/> + <Tool + Name="VCCustomBuildTool"/> + <Tool + Name="VCLibrarianTool" + OutputFile="$(OutDir)/ungzip.lib"/> + <Tool + Name="VCMIDLTool"/> + <Tool + Name="VCPostBuildEventTool"/> + <Tool + Name="VCPreBuildEventTool"/> + <Tool + Name="VCPreLinkEventTool"/> + <Tool + Name="VCResourceCompilerTool"/> + <Tool + Name="VCWebServiceProxyGeneratorTool"/> + <Tool + Name="VCXMLDataGeneratorTool"/> + <Tool + Name="VCManagedWrapperGeneratorTool"/> + <Tool + Name="VCAuxiliaryManagedWrapperGeneratorTool"/> + </Configuration> + </Configurations> + <References> + </References> + <Files> + <Filter + Name="Source Files" + Filter="cpp;c;cxx;def;odl;idl;hpj;bat;asm;asmx" + UniqueIdentifier="{4FC737F1-C7A5-4376-A066-2A32D752A2FF}"> + <File + RelativePath=".\ungzip.cpp"> + </File> + </Filter> + <Filter + Name="Header Files" + Filter="h;hpp;hxx;hm;inl;inc;xsd" + UniqueIdentifier="{93995380-89BD-4b04-88EB-625FBE52EBFB}"> + <File + RelativePath=".\ungzip.h"> + </File> + </Filter> + <Filter + Name="Resource Files" + Filter="rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx" + UniqueIdentifier="{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}"> + </Filter> + </Files> + <Globals> + </Globals> +</VisualStudioProject> Modified: trunk/OpenMPT/zlib/contrib/vstudio/vc7/zlibstat.vcproj =================================================================== --- trunk/OpenMPT/zlib/contrib/vstudio/vc7/zlibstat.vcproj 2010-05-20 21:41:36 UTC (rev 598) +++ trunk/OpenMPT/zlib/contrib/vstudio/vc7/zlibstat.vcproj 2010-05-21 16:37:38 UTC (rev 599) @@ -135,7 +135,7 @@ Name="VCCustomBuildTool"/> <Tool Name="VCLibrarianTool" - AdditionalOptions="..\..\masmx86\gvmat32.obj ..\..\masmx86\inffas32.obj /NODEFAULTLIB " + AdditionalOptions="/NODEFAULTLIB " OutputFile=".\zlibstat\zlibstat.lib" SuppressStartupBanner="TRUE"/> <Tool @@ -173,7 +173,7 @@ PreprocessorDefinitions="WIN32;ZLIB_WINAPI" StringPooling="TRUE" ExceptionHandling="FALSE" - RuntimeLibrary="4" + RuntimeLibrary="0" EnableFunctionLevelLinking="TRUE" PrecompiledHeaderFile=".\zlibstat/zlibstat.pch" AssemblerListingLocation=".\zlibstatWithoutAsm/" @@ -228,9 +228,6 @@ RelativePath="..\..\..\deflate.c"> </File> <File - RelativePath="..\..\masmx86\gvmat32c.c"> - </File> - <File RelativePath="..\..\..\infback.c"> </File> <File This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <sag...@us...> - 2010-05-22 13:36:22
|
Revision: 602 http://modplug.svn.sourceforge.net/modplug/?rev=602&view=rev Author: saga-games Date: 2010-05-22 13:36:09 +0000 (Sat, 22 May 2010) Log Message: ----------- [New] Wave export can now also render by instrument (i.e. one wave file per instrument). [Imp] General tab: The "output to" dropdown list also shows the actual plugin name (instead of just the library name) now. [Mod] Updated release notes [Mod] Some datatype changes in r574 were wrong in theory (but did not change anything because of the way C++ work), but I reverted them anyway. [Ref] Some more refactoring Modified Paths: -------------- trunk/OpenMPT/mptrack/Mod2wave.cpp trunk/OpenMPT/mptrack/Moddoc.cpp trunk/OpenMPT/mptrack/View_gen.cpp trunk/OpenMPT/mptrack/View_pat.cpp trunk/OpenMPT/mptrack/misc_util.h trunk/OpenMPT/mptrack/mod2wave.h trunk/OpenMPT/mptrack/mptrack.rc trunk/OpenMPT/packageTemplate/History.txt trunk/OpenMPT/packageTemplate/OMPT_1.18_ReleaseNotes.html trunk/OpenMPT/soundlib/Sndfile.cpp Added Paths: ----------- trunk/OpenMPT/packageTemplate/ReleaseNotesImages/1.18/cleanup.png Modified: trunk/OpenMPT/mptrack/Mod2wave.cpp =================================================================== --- trunk/OpenMPT/mptrack/Mod2wave.cpp 2010-05-21 21:01:28 UTC (rev 601) +++ trunk/OpenMPT/mptrack/Mod2wave.cpp 2010-05-22 13:36:09 UTC (rev 602) @@ -10,6 +10,7 @@ extern UINT nMixingRates[NUMMIXRATE]; extern LPCSTR gszChnCfgNames[3]; +// this converts a buffer of 32-bit integer sample data to 32 bit floating point static void __cdecl M2W_32ToFloat(void *pBuffer, long nCount) { // const float _ki2f = 1.0f / (FLOAT)(ULONG)(0x80000000); //olivier @@ -50,6 +51,8 @@ BEGIN_MESSAGE_MAP(CWaveConvert, CDialog) ON_COMMAND(IDC_CHECK1, OnCheck1) ON_COMMAND(IDC_CHECK2, OnCheck2) + ON_COMMAND(IDC_CHECK4, OnCheckChannelMode) + ON_COMMAND(IDC_CHECK6, OnCheckInstrMode) ON_COMMAND(IDC_RADIO1, UpdateDialog) ON_COMMAND(IDC_RADIO2, UpdateDialog) ON_COMMAND(IDC_PLAYEROPTIONS, OnPlayerOptions) //rewbs.resamplerConf @@ -104,11 +107,7 @@ CHAR s[128]; CDialog::OnInitDialog(); - if (m_bSelectPlay) { - CheckDlgButton(IDC_RADIO2, MF_CHECKED); - } else { - CheckDlgButton(IDC_RADIO1, MF_CHECKED); - } + CheckRadioButton(IDC_RADIO1, IDC_RADIO2, m_bSelectPlay ? IDC_RADIO2 : IDC_RADIO1); CheckDlgButton(IDC_CHECK3, MF_CHECKED); // HQ resampling CheckDlgButton(IDC_CHECK5, MF_UNCHECKED); // rewbs.NoNormalize @@ -116,6 +115,7 @@ // -> CODE#0024 // -> DESC="wav export update" CheckDlgButton(IDC_CHECK4, MF_UNCHECKED); + CheckDlgButton(IDC_CHECK6, MF_UNCHECKED); // -! NEW_FEATURE#0024 SetDlgItemInt(IDC_EDIT3, m_nMinOrder); @@ -230,6 +230,22 @@ } +// Channel render is mutually exclusive with instrument render +void CWaveConvert::OnCheckChannelMode() +//------------------------------------- +{ + CheckDlgButton(IDC_CHECK6, MF_UNCHECKED); +} + + +// Channel render is mutually exclusive with instrument render +void CWaveConvert::OnCheckInstrMode() +//----------------------------------- +{ + CheckDlgButton(IDC_CHECK4, MF_UNCHECKED); +} + + void CWaveConvert::OnOK() //----------------------- { @@ -242,9 +258,11 @@ //m_bHighQuality = IsDlgButtonChecked(IDC_CHECK3) ? true : false; //rewbs.resamplerConf - we don't want this anymore. m_bNormalize = IsDlgButtonChecked(IDC_CHECK5) ? true : false; m_bGivePlugsIdleTime = IsDlgButtonChecked(IDC_GIVEPLUGSIDLETIME) ? true : false; - if (m_bGivePlugsIdleTime) { + if (m_bGivePlugsIdleTime) + { if (MessageBox("You only need slow render if you are experiencing dropped notes with a Kontakt based sampler with Direct-From-Disk enabled.\nIt will make rendering *very* slow.\n\nAre you sure you want to enable slow render?", - "Really enable slow render?", MB_YESNO) == IDNO ) { + "Really enable slow render?", MB_YESNO) == IDNO ) + { CheckDlgButton(IDC_GIVEPLUGSIDLETIME, BST_UNCHECKED); return; } @@ -252,8 +270,9 @@ // -> CODE#0024 // -> DESC="wav export update" - m_bChannelMode = IsDlgButtonChecked(IDC_CHECK4) ? TRUE : FALSE; + m_bChannelMode = IsDlgButtonChecked(IDC_CHECK4) ? true : false; // -! NEW_FEATURE#0024 + m_bInstrumentMode= IsDlgButtonChecked(IDC_CHECK6) ? true : false; // WaveFormatEx DWORD dwFormat = m_CbnSampleFormat.GetItemData(m_CbnSampleFormat.GetCurSel()); @@ -542,7 +561,7 @@ { m_FileTags.comments = m_pSndFile->m_lpszSongComments; // convert \r to \n, remove bad characters - for(UINT i = 0; i < m_FileTags.comments.length(); i++) + for(size_t i = 0; i < m_FileTags.comments.length(); i++) { if(m_FileTags.comments.substr(i, 1) == "\r") m_FileTags.comments.replace(i, 1, "\n"); @@ -550,7 +569,7 @@ m_FileTags.comments.replace(i, 1, " "); } - /*UINT spos; + /*size_t spos; while((spos = m_FileTags.comments.find("\r")) != string::npos) { m_FileTags.comments.replace(spos, 1, "\n"); @@ -700,7 +719,8 @@ } }*/ - if (m_bGivePlugsIdleTime) { + if (m_bGivePlugsIdleTime) + { Sleep(20); } @@ -992,6 +1012,7 @@ pos = 0; pcmBufSize = WAVECONVERTBUFSIZE; bFinished = FALSE; + // Writing File CMainFrame::GetMainFrame()->InitRenderer(m_pSndFile); //rewbs.VSTTimeInfo for (n=0; ; n++) Modified: trunk/OpenMPT/mptrack/Moddoc.cpp =================================================================== --- trunk/OpenMPT/mptrack/Moddoc.cpp 2010-05-21 21:01:28 UTC (rev 601) +++ trunk/OpenMPT/mptrack/Moddoc.cpp 2010-05-22 13:36:09 UTC (rev 602) @@ -1424,7 +1424,7 @@ void CModDoc::OnFileWaveConvert(ORDERINDEX nMinOrder, ORDERINDEX nMaxOrder) //------------------------------------------------------------------------- { - TCHAR fname[_MAX_FNAME]=""; + TCHAR fname[_MAX_FNAME] = _T(""); CMainFrame *pMainFrm = CMainFrame::GetMainFrame(); if ((!pMainFrm) || (!m_SndFile.GetType())) return; @@ -1441,60 +1441,128 @@ // will set default dir here because there's no setup option for export dir yet (feel free to add one...) CMainFrame::SetDefaultDirectory(files.workingDirectory.c_str(), DIR_EXPORT, true); - TCHAR s[_MAX_PATH]; - strcpy(s, files.first_file.c_str()); + TCHAR sFilename[_MAX_PATH]; + strcpy(sFilename, files.first_file.c_str()); // Saving as wave file - UINT p = 0, n = 1; + + // Keep position of the caracter just before ".wav" in path string + size_t p = strlen(sFilename) - 4; + TCHAR sFilenameAdd[_MAX_PATH] = _T(""); + + int nRenderPasses = 1; DWORD flags[MAX_BASECHANNELS]; - CHAR channel[MAX_CHANNELNAME+10]; + vector<bool> instrMuteState; // Channel mode : save song in multiple wav files (one for each enabled channels) - if(wsdlg.m_bChannelMode){ - n = m_SndFile.m_nChannels; - for(UINT i = 0 ; i < n ; i++){ + if(wsdlg.m_bChannelMode) + { + nRenderPasses = m_SndFile.m_nChannels; + for(int i = 0; i < nRenderPasses ; i++) + { // Save channels' flags flags[i] = m_SndFile.ChnSettings[i].dwFlags; // Mute each channel m_SndFile.ChnSettings[i].dwFlags |= CHN_MUTE; } - // Keep position of the caracter just before ".wav" in path string - p = strlen(s) - 4; } + // Instrument mode: Same as channel mode, but renders per instrument (or sample) + if(wsdlg.m_bInstrumentMode) + { + // render by instrument (or sample) + if(m_SndFile.GetNumInstruments() == 0) + { + nRenderPasses = m_SndFile.GetNumSamples(); + instrMuteState.resize(nRenderPasses); + for(SAMPLEINDEX i = 0; i < m_SndFile.GetNumSamples(); i++) + { + instrMuteState[i] = IsSampleMuted(i + 1); + MuteSample(i + 1, true); + } + } else + { + nRenderPasses = m_SndFile.GetNumInstruments(); + instrMuteState.resize(nRenderPasses); + for(INSTRUMENTINDEX i = 0; i < m_SndFile.GetNumInstruments(); i++) + { + instrMuteState[i] = IsInstrumentMuted(i + 1); + MuteInstrument(i + 1, true); + } + } + } - CDoWaveConvert dwcdlg(&m_SndFile, s, &wsdlg.WaveFormat.Format, wsdlg.m_bNormalize, pMainFrm); + CDoWaveConvert dwcdlg(&m_SndFile, sFilename, &wsdlg.WaveFormat.Format, wsdlg.m_bNormalize, pMainFrm); dwcdlg.m_dwFileLimit = static_cast<DWORD>(wsdlg.m_dwFileLimit); dwcdlg.m_bGivePlugsIdleTime = wsdlg.m_bGivePlugsIdleTime; dwcdlg.m_dwSongLimit = wsdlg.m_dwSongLimit; dwcdlg.m_nMaxPatterns = (wsdlg.m_bSelectPlay) ? wsdlg.m_nMaxOrder - wsdlg.m_nMinOrder + 1 : 0; //if(wsdlg.m_bHighQuality) CSoundFile::SetResamplingMode(SRCMODE_POLYPHASE); - BOOL bplaying = FALSE; UINT pos = m_SndFile.GetCurrentPos(); - bplaying = TRUE; pMainFrm->PauseMod(); - for(UINT i = 0 ; i < n ; i++){ + for(int i = 0 ; i < nRenderPasses ; i++) + { // Channel mode - if(wsdlg.m_bChannelMode){ + if(wsdlg.m_bChannelMode) + { // Add channel number & name (if available) to path string - if(m_SndFile.ChnSettings[i].szName[0] >= 0x20) - wsprintf(channel, "-%03d_%s.wav", i+1,m_SndFile.ChnSettings[i].szName); + if(strlen(m_SndFile.ChnSettings[i].szName) > 0) + wsprintf(sFilenameAdd, "-%03d_%s.wav", i + 1, m_SndFile.ChnSettings[i].szName); else - wsprintf(channel, "-%03d.wav", i+1); - s[p] = '\0'; - strcat(s,channel); + wsprintf(sFilenameAdd, "-%03d.wav", i + 1); + // Re-mute previously processed channel + if(i > 0) m_SndFile.ChnSettings[i - 1].dwFlags |= CHN_MUTE; // Unmute channel to process m_SndFile.ChnSettings[i].dwFlags &= ~CHN_MUTE; } + // Instrument mode + if(wsdlg.m_bInstrumentMode) + { + if(m_SndFile.GetNumInstruments() == 0) + { + if(m_SndFile.Samples[i + 1].pSample == nullptr || !m_SndFile.IsSampleUsed((SAMPLEINDEX)(i + 1))) + continue; + // Add sample number & name (if available) to path string + if(strlen(m_SndFile.m_szNames[i + 1]) > 0) + wsprintf(sFilenameAdd, "-%03d_%s.wav", i + 1, m_SndFile.m_szNames[i + 1]); + else + wsprintf(sFilenameAdd, "-%03d.wav", i + 1); + // Re-mute previously processed sample + if(i > 0) MuteSample((SAMPLEINDEX)i, true); + // Unmute sample to process + MuteSample((SAMPLEINDEX)(i + 1), false); + } else + { + if(m_SndFile.Instruments[i + 1] == nullptr || !m_SndFile.IsInstrumentUsed((INSTRUMENTINDEX)(i + 1))) + continue; + if(strlen(m_SndFile.Instruments[i + 1]->name) > 0) + wsprintf(sFilenameAdd, "-%03d_%s.wav", i + 1, m_SndFile.Instruments[i + 1]->name); + else + wsprintf(sFilenameAdd, "-%03d.wav", i + 1); + // Re-mute previously processed instrument + if(i > 0) MuteInstrument((INSTRUMENTINDEX)i, true); + // Unmute instrument to process + MuteInstrument((INSTRUMENTINDEX)(i + 1), false); + } + } + if(_tcslen(sFilenameAdd) > 0) + { + SanitizeFilename(sFilenameAdd); + sFilename[p] = 0; + _tcscat(sFilename, sFilenameAdd); + _tcscpy(sFilenameAdd, _T("")); + } // Render song (or current channel if channel mode and channel not initially disabled) - if(!wsdlg.m_bChannelMode || !(flags[i] & CHN_MUTE)){ + if(!(wsdlg.m_bChannelMode || wsdlg.m_bInstrumentMode) || !(flags[i] & CHN_MUTE)) + { // rewbs.fix3239 m_SndFile.SetCurrentPos(0); m_SndFile.m_dwSongFlags &= ~SONG_PATTERNLOOP; - if (wsdlg.m_bSelectPlay) { + if (wsdlg.m_bSelectPlay) + { m_SndFile.SetCurrentOrder(wsdlg.m_nMinOrder); m_SndFile.m_nCurrentPattern = wsdlg.m_nMinOrder; m_SndFile.GetLength(TRUE, FALSE); @@ -1503,15 +1571,31 @@ //end rewbs.fix3239 if( dwcdlg.DoModal() != IDOK ) break; // UPDATE#03 } - - // Re-mute processed channel - if(wsdlg.m_bChannelMode) m_SndFile.ChnSettings[i].dwFlags |= CHN_MUTE; } // Restore channels' flags - if(wsdlg.m_bChannelMode){ - for(UINT i = 0 ; i < n ; i++) m_SndFile.ChnSettings[i].dwFlags = flags[i]; + if(wsdlg.m_bChannelMode) + { + for(int i = 0 ; i < nRenderPasses ; i++) + m_SndFile.ChnSettings[i].dwFlags = flags[i]; } + // Restore instruments' / samples' flags + if(wsdlg.m_bInstrumentMode) + { + if(m_SndFile.GetNumInstruments() == 0) + { + for(SAMPLEINDEX i = 0; i < m_SndFile.GetNumSamples(); i++) + { + MuteSample(i + 1, instrMuteState[i]); + } + } else + { + for(INSTRUMENTINDEX i = 0; i < m_SndFile.GetNumInstruments(); i++) + { + MuteInstrument(i + 1, instrMuteState[i]); + } + } + } m_SndFile.SetCurrentPos(pos); m_SndFile.GetLength(TRUE); @@ -1626,11 +1710,10 @@ ext = ModSpecs::mod.fileExtension; pattern = FileFilterMOD; if( AfxMessageBox(GetStrI18N(TEXT( - "Compared to regular MOD save, compatibility export makes " - "small adjustments to the save file in order to make the file compatible with " - "ProTracker and other Amiga-based trackers. Note that this feature is not complete and the " - "file is not guaranteed to be free of MPT-specific features.\n\n " - "Important: beginning of some samples may be adjusted in the process. Proceed?")), MB_ICONINFORMATION|MB_YESNO) != IDYES + "Compared to regular MOD save, compatibility export adjust the beginning of oneshot samples " + "in order to make the file compatible with ProTracker and other Amiga-based trackers. " + "Note that this feature does not remove effects \"invented\" by other PC-based trackers (f.e. panning commands)." + "\n\n Proceed?")), MB_ICONINFORMATION|MB_YESNO) != IDYES ) return; break; Modified: trunk/OpenMPT/mptrack/View_gen.cpp =================================================================== --- trunk/OpenMPT/mptrack/View_gen.cpp 2010-05-21 21:01:28 UTC (rev 601) +++ trunk/OpenMPT/mptrack/View_gen.cpp 2010-05-22 13:36:09 UTC (rev 602) @@ -538,12 +538,19 @@ m_CbnOutput.SetRedraw(FALSE); m_CbnOutput.ResetContent(); m_CbnOutput.SetItemData(m_CbnOutput.AddString("Default"), 0); - for (UINT iOut=m_nCurrentPlugin+1; iOut<MAX_MIXPLUGINS; iOut++) + for (PLUGINDEX iOut = m_nCurrentPlugin + 1; iOut < MAX_MIXPLUGINS; iOut++) { PSNDMIXPLUGIN p = &pSndFile->m_MixPlugins[iOut]; - if (p->Info.szLibraryName[0]) + if (p->Info.dwPluginId1) { - wsprintf(s, "FX%d: %s", iOut+1, p->Info.szLibraryName); + if(!strcmp(p->Info.szLibraryName, p->Info.szName) || strlen(p->Info.szName) == 0) + { + wsprintf(s, "FX%d: %s", iOut + 1, p->Info.szLibraryName); + } else + { + wsprintf(s, "FX%d: %s (%s)", iOut + 1, p->Info.szLibraryName, p->Info.szName); + } + int n = m_CbnOutput.AddString(s); m_CbnOutput.SetItemData(n, 0x80|iOut); if ((pSndFile->m_MixPlugins[m_nCurrentPlugin].Info.dwOutputRouting & 0x80) Modified: trunk/OpenMPT/mptrack/View_pat.cpp =================================================================== --- trunk/OpenMPT/mptrack/View_pat.cpp 2010-05-21 21:01:28 UTC (rev 601) +++ trunk/OpenMPT/mptrack/View_pat.cpp 2010-05-22 13:36:09 UTC (rev 602) @@ -1404,14 +1404,16 @@ if (pModDoc) { UINT nChn = current ? (m_dwCursor&0xFFFF)>>3 : (m_nMenuParam&0xFFFF)>>3; - pModDoc->SoloChannel(nChn, FALSE); //rewbs.merge: recover old solo/mute behaviour + pModDoc->SoloChannel(nChn, false); //rewbs.merge: recover old solo/mute behaviour pModDoc->MuteChannel(nChn, !pModDoc->IsChannelMuted(nChn)); //If we just unmuted a channel, make sure none are still considered "solo". - if (!pModDoc->IsChannelMuted(nChn)) { - UINT nNumChn = pModDoc->GetNumChannels(); - for (UINT i=0; i<nNumChn; i++){ - pModDoc->SoloChannel(i, FALSE); + if(!pModDoc->IsChannelMuted(nChn)) + { + const CHANNELINDEX nNumChn = pModDoc->GetNumChannels(); + for(CHANNELINDEX i = 0; i < nNumChn; i++) + { + pModDoc->SoloChannel(i, false); } } @@ -1436,7 +1438,7 @@ return; } - UINT nNumChn = pModDoc->GetNumChannels(); + const CHANNELINDEX nNumChn = pModDoc->GetNumChannels(); UINT nChn = current ? (m_dwCursor&0xFFFF)>>3 : (m_nMenuParam&0xFFFF)>>3; if (nChn >= nNumChn) { return; @@ -1455,7 +1457,8 @@ return; } } - for (UINT i=0; i<nNumChn; i++) { + for(CHANNELINDEX i = 0; i < nNumChn; i++) + { pModDoc->MuteChannel(i, !(i == nChn)); //mute all chans except nChn, unmute nChn pModDoc->SoloChannel(i, (i == nChn)); //unsolo all chans except nChn, solo nChn } @@ -1506,11 +1509,11 @@ CModDoc *pModDoc = GetDocument(); if (pModDoc) { - UINT nChns = pModDoc->GetNumChannels(); - for (UINT i=0; i<nChns; i++) + const CHANNELINDEX nChns = pModDoc->GetNumChannels(); + for(CHANNELINDEX i = 0; i < nChns; i++) { - pModDoc->MuteChannel(i, FALSE); - pModDoc->SoloChannel(i, FALSE); //rewbs.merge: binary solo/mute behaviour + pModDoc->MuteChannel(i, false); + pModDoc->SoloChannel(i, false); //rewbs.merge: binary solo/mute behaviour } InvalidateChannelsHeaders(); } Modified: trunk/OpenMPT/mptrack/misc_util.h =================================================================== --- trunk/OpenMPT/mptrack/misc_util.h 2010-05-21 21:01:28 UTC (rev 601) +++ trunk/OpenMPT/mptrack/misc_util.h 2010-05-22 13:36:09 UTC (rev 602) @@ -112,7 +112,7 @@ inline void SanitizeFilename(char (&buffer)[size]) { STATIC_ASSERT(size > 0); - for(int i = 0; i < size; i++) + for(size_t i = 0; i < size; i++) { if( buffer[i] == '\\' || buffer[i] == '\"' || @@ -123,7 +123,7 @@ buffer[i] == '>' || buffer[i] == '*') { - for(int j = i + 1; j < size; j++) + for(size_t j = i + 1; j < size; j++) { buffer[j - 1] = buffer[j]; } Modified: trunk/OpenMPT/mptrack/mod2wave.h =================================================================== --- trunk/OpenMPT/mptrack/mod2wave.h 2010-05-21 21:01:28 UTC (rev 601) +++ trunk/OpenMPT/mptrack/mod2wave.h 2010-05-22 13:36:09 UTC (rev 602) @@ -20,8 +20,9 @@ // -> CODE#0024 // -> DESC="wav export update" - BOOL m_bChannelMode; + bool m_bChannelMode; // Render by channel // -! NEW_FEATURE#0024 + bool m_bInstrumentMode; // Render by instrument public: CWaveConvert(CWnd *parent, ORDERINDEX nMinOrder = ORDERINDEX_INVALID, ORDERINDEX nMaxOrder = ORDERINDEX_INVALID); @@ -33,6 +34,8 @@ virtual void OnOK(); afx_msg void OnCheck1(); afx_msg void OnCheck2(); + afx_msg void OnCheckChannelMode(); + afx_msg void OnCheckInstrMode(); afx_msg void OnFormatChanged(); afx_msg void OnPlayerOptions(); //rewbs.resamplerConf DECLARE_MESSAGE_MAP() Modified: trunk/OpenMPT/mptrack/mptrack.rc =================================================================== --- trunk/OpenMPT/mptrack/mptrack.rc 2010-05-21 21:01:28 UTC (rev 601) +++ trunk/OpenMPT/mptrack/mptrack.rc 2010-05-22 13:36:09 UTC (rev 602) @@ -284,33 +284,35 @@ PUSHBUTTON "Default Settings",IDC_BUTTON_DEFAULT_RESAMPLING,186,180,66,12 END -IDD_WAVECONVERT DIALOGEX 0, 0, 262, 197 +IDD_WAVECONVERT DIALOGEX 0, 0, 262, 221 STYLE DS_SETFONT | DS_MODALFRAME | DS_FIXEDSYS | DS_CENTER | WS_POPUP | WS_VISIBLE | WS_CAPTION | WS_SYSMENU CAPTION "Wave Convert" FONT 8, "MS Shell Dlg", 0, 0, 0x0 BEGIN DEFPUSHBUTTON "OK",IDOK,204,12,50,14 PUSHBUTTON "Cancel",IDCANCEL,204,30,50,14 - GROUPBOX "Render",IDC_STATIC,6,6,192,90 + GROUPBOX "Render",IDC_STATIC,6,6,192,114 COMBOBOX IDC_COMBO1,18,18,54,82,CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP COMBOBOX IDC_COMBO2,78,18,73,75,CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP PUSHBUTTON "Change Player Options",IDC_PLAYEROPTIONS,18,36,81,14,BS_CENTER - CONTROL "Channel mode (one file per channel)",IDC_CHECK4,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,18,54,168,8 - CONTROL "Normalize Output (experimental)",IDC_CHECK5,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,18,66,119,10 + CONTROL "Normalize Output (experimental)",IDC_CHECK5,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,18,84,168,12 CONTROL "High quality resampling",IDC_CHECK3,"Button",BS_AUTOCHECKBOX | NOT WS_VISIBLE | WS_TABSTOP,112,36,84,10 CONTROL "Slow render (for Kontakt+DFD)",IDC_GIVEPLUGSIDLETIME, - "Button",BS_AUTOCHECKBOX | BS_LEFT | BS_MULTILINE | WS_TABSTOP,18,78,133,8 - GROUPBOX "Limit",IDC_STATIC,6,102,192,90 - CONTROL "Limit file size to: (KBytes)",IDC_CHECK1,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,18,114,111,11 - EDITTEXT IDC_EDIT1,138,114,50,12,ES_AUTOHSCROLL - CONTROL "Limit song length to: (seconds)",IDC_CHECK2,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,18,134,111,10 - EDITTEXT IDC_EDIT2,138,133,50,12,ES_AUTOHSCROLL - LTEXT "Play:",IDC_STATIC,18,150,37,8 - CONTROL "Entire song",IDC_RADIO1,"Button",BS_AUTORADIOBUTTON,18,162,104,10 - CONTROL "From position",IDC_RADIO2,"Button",BS_AUTORADIOBUTTON,18,175,58,10 - EDITTEXT IDC_EDIT3,78,174,19,12,ES_AUTOHSCROLL | ES_NUMBER - CTEXT "to",IDC_STATIC,102,176,8,8 - EDITTEXT IDC_EDIT4,114,174,19,12,ES_AUTOHSCROLL | ES_NUMBER + "Button",BS_AUTOCHECKBOX | BS_LEFT | BS_MULTILINE | WS_TABSTOP,18,97,168,12 + GROUPBOX "Limit",IDC_STATIC,6,126,192,90 + CONTROL "Limit file size to: (KBytes)",IDC_CHECK1,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,18,138,111,11 + EDITTEXT IDC_EDIT1,138,138,50,12,ES_AUTOHSCROLL + CONTROL "Limit song length to: (seconds)",IDC_CHECK2,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,18,158,111,10 + EDITTEXT IDC_EDIT2,138,157,50,12,ES_AUTOHSCROLL + LTEXT "Play:",IDC_STATIC,18,174,37,8 + CONTROL "Entire song",IDC_RADIO1,"Button",BS_AUTORADIOBUTTON,18,186,104,10 + CONTROL "From position",IDC_RADIO2,"Button",BS_AUTORADIOBUTTON,18,199,58,10 + EDITTEXT IDC_EDIT3,78,198,24,12,ES_AUTOHSCROLL | ES_NUMBER + CTEXT "to",IDC_STATIC,105,200,8,8 + EDITTEXT IDC_EDIT4,117,198,24,12,ES_AUTOHSCROLL | ES_NUMBER + CONTROL "Channel mode (one file per channel)",IDC_CHECK4,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,18,54,168,12 + CONTROL "Instrument mode (one file per instrument)",IDC_CHECK6, + "Button",BS_AUTOCHECKBOX | WS_TABSTOP,18,66,168,12 END IDD_PROGRESS DIALOG 0, 0, 186, 55 @@ -1532,7 +1534,7 @@ IDD_WAVECONVERT, DIALOG BEGIN RIGHTMARGIN, 211 - BOTTOMMARGIN, 194 + BOTTOMMARGIN, 218 END IDD_OPTIONS_KEYBOARD, DIALOG Modified: trunk/OpenMPT/packageTemplate/History.txt =================================================================== --- trunk/OpenMPT/packageTemplate/History.txt 2010-05-21 21:01:28 UTC (rev 601) +++ trunk/OpenMPT/packageTemplate/History.txt 2010-05-22 13:36:09 UTC (rev 602) @@ -9,12 +9,13 @@ [Var]: other (tx XYZ): thanks to XYZ for telling us about the bug -Changes from revisions [476, 599] +Changes from revisions [476, 602] --------------------------------- General tab [Imp] <Jojo> Disabled tempo slider for MOD files (it was just confusing) [Imp] <Jojo> Disabled global volume slider for MOD files, instead enabled the sample pre-amp slider (so it is also possible to make output louder) + [Imp] <Jojo> The "output to" dropdown list also shows the actual plugin name (instead of just the library name) now. [Fix] <Jojo> Moving a plugin in MOD/S3M files doesn't mark them as modified anymore. The channel fx dropdown lists are now also disabled for those module types. [Fix] <Jojo> The restart position edit control is disabled for S3M files. [Fix] <coda> The background colour of the tabs in the channel configuration is now also correct when using WinXP Luna or Vista/Win7 Aero. @@ -174,6 +175,7 @@ Misc [New] <Jojo> INI Settings: When portable mode is enabled, the most common paths in mptrack.ini are now translated to relative paths (if possible). Plugin paths are not translated to relative paths (yet). [New] <Jojo> Modules in gzip archives (single-file .gz archives) can now be imported, just to satisfy my laziness when downloading gzipped modules from Amiga Music Preservation. :-P + [New] <Jojo> Wave export can now also render by instrument (i.e. one wave file per instrument). [Imp] <Jojo> Mod Loaders: Instead of creating messageboxes in various places, errors are now written to the log and one messagebox is shown for each file. [Imp] <Jojo> Binary files are now less often falsely recognized as early MOD files (15 samples without header): If the orderlist contains orderlist items > 128, loading is cancelled. [Imp] <Jojo> Song Properties: Tooltips are shown for various controls. @@ -187,6 +189,7 @@ [Fix] <Jojo> Song Length Detection: *Much* more accurate song length detection! [Fix] <Jojo/re> Instrument IO: Flags from old ITI/XI files should also be loaded correctly now (broken in 1.18.00.00) [Fix] <Jojo> Plugin Editor: Changing a plugin parameter in MOD/S3M files doesn't mark them as modified anymore. + [Fix] <Jojo> When using the "close file" shortcut several times in a row so that multiple messageboxes popped up, it was possible to crash OpenMPT. [Reg] <Jojo> Removed AutodetectITplaystyle option, since the tracker detection works reliably enough now. Tracker detection can not be ignored anymore now. Installer/release package Modified: trunk/OpenMPT/packageTemplate/OMPT_1.18_ReleaseNotes.html =================================================================== --- trunk/OpenMPT/packageTemplate/OMPT_1.18_ReleaseNotes.html 2010-05-21 21:01:28 UTC (rev 601) +++ trunk/OpenMPT/packageTemplate/OMPT_1.18_ReleaseNotes.html 2010-05-22 13:36:09 UTC (rev 602) @@ -19,8 +19,14 @@ a:visited { color: #909; text-decoration: none; } a:hover { text-decoration: underline; } - div img, h1 + .screenshots { + float:right; + text-align:right; + } + + .screenshots img, h1 + { border: 1px solid #ccc; padding: 3px; background: #eee; @@ -78,7 +84,8 @@ <h2>What's new?</h2> <h3>General</h3> - <div style="float:right;"> + <div class="screenshots"> + <a href="ReleaseNotesImages/1.18/cleanup.png"><img src="ReleaseNotesImages/1.18/cleanup.png" width="183" height="84" alt="Cleanup dialog" title="Cleanup dialog (click to view big screenshot)" /></a><br /> <img src="ReleaseNotesImages/1.18/treeview.png" width="183" height="338" alt="Improved treeview" title="Improved treeview" /> </div> <ul> @@ -104,11 +111,21 @@ A friendly reminder: The autosave and backup options should always be enabled; You will be very glad about them once OpenMPT <i>really</i> crashes or you accidentally overwrite a file.</li> <li>New and <strong>updated keymaps</strong> with many new shortcuts!</li> + <li>The new <strong>cleanup dialog</strong> replaces the cleanup menu and offers more options. For example, the <strong>rearrange samples</strong> function is available again.</li> <li><strong>Redesigned</strong> several dialogs.</li> </ul> + + <h3>Treeview</h3> + <ul> + <li>It is very simple to <strong>switch to another module</strong> now: Simply click the module name!</li> + <li><strong>Closing a module</strong> is almost as simple: Right-click the module name and select the appropriate context menu entry.</li> + <li>Sample and instrument <strong>playback indicators</strong>.</li> + <li><strong>Improved icons</strong>: Mute status is now displayed.</li> + <li><strong>Sequence control</strong> including copying a sequence to another module.</li> + </ul> <h3>Pattern Editor</h3> - <div style="float:right;"> + <div class="screenshots"> <img src="ReleaseNotesImages/1.18/orderlist.png" width="348" height="167" alt="New orderlist" title="New orderlist" /> </div> <ul> Added: trunk/OpenMPT/packageTemplate/ReleaseNotesImages/1.18/cleanup.png =================================================================== (Binary files differ) Property changes on: trunk/OpenMPT/packageTemplate/ReleaseNotesImages/1.18/cleanup.png ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Modified: trunk/OpenMPT/soundlib/Sndfile.cpp =================================================================== --- trunk/OpenMPT/soundlib/Sndfile.cpp 2010-05-21 21:01:28 UTC (rev 601) +++ trunk/OpenMPT/soundlib/Sndfile.cpp 2010-05-22 13:36:09 UTC (rev 602) @@ -1845,7 +1845,7 @@ case RS_PCM16D: case RS_PCM16S: { - uint16 *p = (uint16 *)pSample; + int16 *p = (int16 *)pSample; int s_old = 0, s_ofs; len = nLen * 2; bufcount = 0; @@ -1861,11 +1861,11 @@ } if (nFlags == RS_PCM16D) { - *((uint16 *)(&buffer[bufcount])) = (uint16)(s_new - s_old); + *((int16 *)(&buffer[bufcount])) = (int16)(s_new - s_old); s_old = s_new; } else { - *((uint16 *)(&buffer[bufcount])) = (uint16)(s_new + s_ofs); + *((int16 *)(&buffer[bufcount])) = (int16)(s_new + s_ofs); } bufcount += 2; if (bufcount >= sizeof(buffer) - 1) @@ -1896,11 +1896,11 @@ p += 2; if (nFlags == RS_STPCM8D) { - buffer[bufcount++] = (uint8)(s_new - s_old); + buffer[bufcount++] = (int8)(s_new - s_old); s_old = s_new; } else { - buffer[bufcount++] = (uint8)(s_new + s_ofs); + buffer[bufcount++] = (int8)(s_new + s_ofs); } if (bufcount >= sizeof(buffer)) { @@ -1932,11 +1932,11 @@ p += 2; if (nFlags == RS_STPCM16D) { - *((uint16 *)(&buffer[bufcount])) = (uint16)(s_new - s_old); + *((int16 *)(&buffer[bufcount])) = (int16)(s_new - s_old); s_old = s_new; } else { - *((uint16 *)(&buffer[bufcount])) = (uint16)(s_new + s_ofs); + *((int16 *)(&buffer[bufcount])) = (int16)(s_new + s_ofs); } bufcount += 2; if (bufcount >= sizeof(buffer)) @@ -1979,11 +1979,11 @@ } if (nFlags == RS_PCM8D) { - buffer[bufcount++] = (uint8)(s_new - s_old); + buffer[bufcount++] = (int8)(s_new - s_old); s_old = s_new; } else { - buffer[bufcount++] = (uint8)(s_new + s_ofs); + buffer[bufcount++] = (int8)(s_new + s_ofs); } if (bufcount >= sizeof(buffer)) { This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <sag...@us...> - 2010-05-22 15:27:42
|
Revision: 604 http://modplug.svn.sourceforge.net/modplug/?rev=604&view=rev Author: saga-games Date: 2010-05-22 15:27:35 +0000 (Sat, 22 May 2010) Log Message: ----------- [Fix] Autosaver: Added a CSoundFile verification, so that it would not complain that autosaving failed in *extremely* rare situations (for example when trying to load a non-existing file. A "file not found" messagebox would be shown and the autosaver could kick in while this box is still shown. Yep, very rare, but I actually managed to trigger this. [Imp] Wave Export: In channel mode, unused channels are not exported anymore. [Fix] Wave Export: Small fixes with related refactoring. Modified Paths: -------------- trunk/OpenMPT/mptrack/AutoSaver.cpp trunk/OpenMPT/mptrack/Moddoc.cpp trunk/OpenMPT/mptrack/Moddoc.h trunk/OpenMPT/mptrack/Modedit.cpp trunk/OpenMPT/mptrack/View_pat.cpp trunk/OpenMPT/mptrack/dlg_misc.cpp trunk/OpenMPT/mptrack/dlg_misc.h trunk/OpenMPT/packageTemplate/History.txt Modified: trunk/OpenMPT/mptrack/AutoSaver.cpp =================================================================== --- trunk/OpenMPT/mptrack/AutoSaver.cpp 2010-05-22 13:45:17 UTC (rev 603) +++ trunk/OpenMPT/mptrack/AutoSaver.cpp 2010-05-22 15:27:35 UTC (rev 604) @@ -72,11 +72,14 @@ while (posDocument) { //for all open documents pModDoc = (CModDoc*)(pDocTemplate->GetNextDoc(posDocument)); - if (pModDoc && pModDoc->ModifiedSinceLastAutosave()) { - if (SaveSingleFile(pModDoc)) { + if (pModDoc && pModDoc->ModifiedSinceLastAutosave() && pModDoc->GetSoundFile()) + { + if (SaveSingleFile(pModDoc)) + { CleanUpBackups(pModDoc); - } else { - m_bEnabled=false; + } else + { + m_bEnabled = false; AfxMessageBox("Warning: Autosave failed and has been disabled. Please:\n- Review your autosave paths\n- Check available diskspace & filesystem access rights\n- If you are using the ITP format, ensure all instruments exist as independant .iti files"); success = false; } Modified: trunk/OpenMPT/mptrack/Moddoc.cpp =================================================================== --- trunk/OpenMPT/mptrack/Moddoc.cpp 2010-05-22 13:45:17 UTC (rev 603) +++ trunk/OpenMPT/mptrack/Moddoc.cpp 2010-05-22 15:27:35 UTC (rev 604) @@ -1451,17 +1451,27 @@ TCHAR sFilenameAdd[_MAX_PATH] = _T(""); int nRenderPasses = 1; - DWORD flags[MAX_BASECHANNELS]; + // Channel mode + bool unusedChannels[MAX_BASECHANNELS]; + vector<DWORD> channelFlags; + // Instrument mode vector<bool> instrMuteState; - // Channel mode : save song in multiple wav files (one for each enabled channels) + // Channel mode: save song in multiple wav files (one for each enabled channels) if(wsdlg.m_bChannelMode) { - nRenderPasses = m_SndFile.m_nChannels; - for(int i = 0; i < nRenderPasses ; i++) + // Don't save empty channels + memset(unusedChannels, false, sizeof(unusedChannels)); + CheckUnusedChannels(unusedChannels); + + nRenderPasses = m_SndFile.GetNumChannels(); + channelFlags.resize(nRenderPasses, 0); + for(CHANNELINDEX i = 0; i < m_SndFile.GetNumChannels(); i++) { // Save channels' flags - flags[i] = m_SndFile.ChnSettings[i].dwFlags; + channelFlags[i] = m_SndFile.ChnSettings[i].dwFlags; + // Ignore muted channels + if(channelFlags[i] & CHN_MUTE) unusedChannels[i] = true; // Mute each channel m_SndFile.ChnSettings[i].dwFlags |= CHN_MUTE; } @@ -1472,7 +1482,7 @@ if(m_SndFile.GetNumInstruments() == 0) { nRenderPasses = m_SndFile.GetNumSamples(); - instrMuteState.resize(nRenderPasses); + instrMuteState.resize(nRenderPasses, false); for(SAMPLEINDEX i = 0; i < m_SndFile.GetNumSamples(); i++) { instrMuteState[i] = IsSampleMuted(i + 1); @@ -1481,7 +1491,7 @@ } else { nRenderPasses = m_SndFile.GetNumInstruments(); - instrMuteState.resize(nRenderPasses); + instrMuteState.resize(nRenderPasses, false); for(INSTRUMENTINDEX i = 0; i < m_SndFile.GetNumInstruments(); i++) { instrMuteState[i] = IsInstrumentMuted(i + 1); @@ -1509,6 +1519,9 @@ // Re-mute previously processed channel if(i > 0) m_SndFile.ChnSettings[i - 1].dwFlags |= CHN_MUTE; + // Was this channel actually muted? Don't process it then. + if(unusedChannels[i] == true) + continue; // Add channel number & name (if available) to path string if(strlen(m_SndFile.ChnSettings[i].szName) > 0) wsprintf(sFilenameAdd, "-%03d_%s.wav", i + 1, m_SndFile.ChnSettings[i].szName); @@ -1557,29 +1570,24 @@ _tcscpy(sFilenameAdd, _T("")); } - // Render song (or current channel if channel mode and channel not initially disabled) - if(!(wsdlg.m_bChannelMode || wsdlg.m_bInstrumentMode) || !(flags[i] & CHN_MUTE)) + // Render song (or current channel, or current sample/instrument) + m_SndFile.SetCurrentPos(0); + m_SndFile.m_dwSongFlags &= ~SONG_PATTERNLOOP; + if (wsdlg.m_bSelectPlay) { - // rewbs.fix3239 - m_SndFile.SetCurrentPos(0); - m_SndFile.m_dwSongFlags &= ~SONG_PATTERNLOOP; - if (wsdlg.m_bSelectPlay) - { - m_SndFile.SetCurrentOrder(wsdlg.m_nMinOrder); - m_SndFile.m_nCurrentPattern = wsdlg.m_nMinOrder; - m_SndFile.GetLength(TRUE, FALSE); - m_SndFile.m_nMaxOrderPosition = wsdlg.m_nMaxOrder + 1; - } - //end rewbs.fix3239 - if( dwcdlg.DoModal() != IDOK ) break; // UPDATE#03 + m_SndFile.SetCurrentOrder(wsdlg.m_nMinOrder); + m_SndFile.m_nCurrentPattern = wsdlg.m_nMinOrder; + m_SndFile.GetLength(TRUE, FALSE); + m_SndFile.m_nMaxOrderPosition = wsdlg.m_nMaxOrder + 1; } + if(dwcdlg.DoModal() != IDOK) break; } // Restore channels' flags if(wsdlg.m_bChannelMode) { for(int i = 0 ; i < nRenderPasses ; i++) - m_SndFile.ChnSettings[i].dwFlags = flags[i]; + m_SndFile.ChnSettings[i].dwFlags = channelFlags[i]; } // Restore instruments' / samples' flags if(wsdlg.m_bInstrumentMode) Modified: trunk/OpenMPT/mptrack/Moddoc.h =================================================================== --- trunk/OpenMPT/mptrack/Moddoc.h 2010-05-22 13:45:17 UTC (rev 603) +++ trunk/OpenMPT/mptrack/Moddoc.h 2010-05-22 15:27:35 UTC (rev 604) @@ -287,7 +287,7 @@ void LearnMacro(int macro, long param); void SetElapsedTime(ORDERINDEX nOrd, ROWINDEX nRow, bool bReset = false); - BOOL RemoveChannels(BOOL bChnMask[MAX_CHANNELS]); + bool RemoveChannels(bool bChnMask[MAX_BASECHANNELS]); bool HasMPTHacks(bool autofix = false); @@ -311,7 +311,7 @@ BOOL InitializeMod(); void* GetChildFrame(); //rewbs.customKeys - void CheckUnusedChannels(BOOL mask[MAX_CHANNELS], CHANNELINDEX maxRemoveCount); + void CheckUnusedChannels(bool mask[MAX_BASECHANNELS], CHANNELINDEX maxRemoveCount = MAX_BASECHANNELS); // Overrides // ClassWizard generated virtual function overrides Modified: trunk/OpenMPT/mptrack/Modedit.cpp =================================================================== --- trunk/OpenMPT/mptrack/Modedit.cpp 2010-05-22 13:45:17 UTC (rev 603) +++ trunk/OpenMPT/mptrack/Modedit.cpp 2010-05-22 15:27:35 UTC (rev 604) @@ -499,7 +499,7 @@ } -BOOL CModDoc::RemoveChannels(BOOL m_bChnMask[MAX_CHANNELS]) +bool CModDoc::RemoveChannels(bool m_bChnMask[MAX_BASECHANNELS]) //--------------------------------------------------------- //To remove all channels whose index corresponds to true value at m_bChnMask[] array. Code is almost non-modified copy of //the code which was in CModDoc::ChangeNumChannels(UINT nNewChannels) - the only differences are the lines before @@ -518,7 +518,7 @@ if(nRemainingChannels == m_SndFile.m_nChannels) str.Format("No channels chosen to be removed."); else str.Format("No removal done - channel number is already at minimum."); CMainFrame::GetMainFrame()->MessageBox(str , "Remove channel", MB_OK | MB_ICONINFORMATION); - return FALSE; + return false; } BeginWaitCursor(); @@ -531,7 +531,7 @@ { END_CRITICAL(); AddToLog("ERROR: Not enough memory to resize patterns!\nPattern Data is corrupted!"); - return TRUE; + return true; } MODCOMMAND *tmpsrc = p, *tmpdest = newp; for (UINT j=0; j<m_SndFile.PatternSize[i]; j++) @@ -568,7 +568,7 @@ SetModified(); GetPatternUndo()->ClearUndo(); UpdateAllViews(NULL, HINT_MODTYPE); - return FALSE; + return false; } @@ -1607,22 +1607,23 @@ } -void CModDoc::CheckUnusedChannels(BOOL mask[MAX_CHANNELS], CHANNELINDEX maxRemoveCount) +void CModDoc::CheckUnusedChannels(bool mask[MAX_BASECHANNELS], CHANNELINDEX maxRemoveCount) //------------------------------------------------------------------------------------- { // Checking for unused channels - for (int iRst=m_SndFile.m_nChannels-1; iRst>=0; iRst--) //rewbs.removeChanWindowCleanup + const int nChannels = m_SndFile.GetNumChannels(); + for(int iRst = nChannels - 1; iRst >= 0; iRst--) { - mask[iRst] = TRUE; - for (UINT ipat=0; ipat<m_SndFile.Patterns.Size(); ipat++) if (m_SndFile.Patterns[ipat]) + mask[iRst] = true; + for (PATTERNINDEX ipat = 0; ipat < m_SndFile.Patterns.Size(); ipat++) if (m_SndFile.Patterns.IsValidPat(ipat)) { MODCOMMAND *p = m_SndFile.Patterns[ipat] + iRst; UINT len = m_SndFile.PatternSize[ipat]; - for (UINT idata=0; idata<len; idata++, p+=m_SndFile.m_nChannels) + for (UINT idata = 0; idata < len; idata++, p += m_SndFile.m_nChannels) { - if (*((LPDWORD)p)) + if (!p->IsEmpty()) { - mask[iRst] = FALSE; + mask[iRst] = false; break; } } Modified: trunk/OpenMPT/mptrack/View_pat.cpp =================================================================== --- trunk/OpenMPT/mptrack/View_pat.cpp 2010-05-22 13:45:17 UTC (rev 603) +++ trunk/OpenMPT/mptrack/View_pat.cpp 2010-05-22 15:27:35 UTC (rev 604) @@ -2529,8 +2529,8 @@ str.Format("Remove channel %d?\nNote: Affects all patterns and no undo", nChn+1); if(CMainFrame::GetMainFrame()->MessageBox(str , "Remove channel", MB_YESNO | MB_ICONQUESTION) == IDYES) { - BOOL chnMask[MAX_CHANNELS]; - for(CHANNELINDEX i = 0; i < MAX_CHANNELS; chnMask[i] = FALSE, i++) {} + bool chnMask[MAX_BASECHANNELS]; + for(CHANNELINDEX i = 0; i < MAX_BASECHANNELS; i++) {chnMask[i] = false;} chnMask[nChn] = TRUE; pModDoc->RemoveChannels(chnMask); SetCurrentPattern(m_nPattern); //Updating the screen. Modified: trunk/OpenMPT/mptrack/dlg_misc.cpp =================================================================== --- trunk/OpenMPT/mptrack/dlg_misc.cpp 2010-05-22 13:45:17 UTC (rev 603) +++ trunk/OpenMPT/mptrack/dlg_misc.cpp 2010-05-22 15:27:35 UTC (rev 604) @@ -674,7 +674,7 @@ void CRemoveChannelsDlg::OnOK() //----------------------------- { - memset(m_bChnMask, 0, sizeof(m_bChnMask)); + memset(m_bChnMask, false, sizeof(m_bChnMask)); int nCount = m_RemChansList.GetSelCount(); CArray<int,int> aryListBoxSel; aryListBoxSel.SetSize(nCount); @@ -682,7 +682,7 @@ for (int n=0; n<nCount; n++) { - m_bChnMask[aryListBoxSel[n]]++; + m_bChnMask[aryListBoxSel[n]] = true; } if ((static_cast<UINT>(nCount) == m_nRemove && nCount > 0) || (m_nRemove == 0 && (m_pSndFile->GetNumChannels() >= nCount + m_pSndFile->GetModSpecifications().channelsMin))) CDialog::OnOK(); Modified: trunk/OpenMPT/mptrack/dlg_misc.h =================================================================== --- trunk/OpenMPT/mptrack/dlg_misc.h 2010-05-22 13:45:17 UTC (rev 603) +++ trunk/OpenMPT/mptrack/dlg_misc.h 2010-05-22 15:27:35 UTC (rev 604) @@ -87,7 +87,7 @@ { public: CSoundFile *m_pSndFile; - BOOL m_bChnMask[MAX_CHANNELS]; + bool m_bChnMask[MAX_BASECHANNELS]; UINT m_nChannels, m_nRemove; CListBox m_RemChansList; //rewbs.removeChansDlgCleanup bool m_ShowCancel; @@ -97,7 +97,7 @@ { m_pSndFile = pSndFile; m_nChannels = m_pSndFile->m_nChannels; m_nRemove = nChns; - memset(m_bChnMask, 0, sizeof(m_bChnMask)); + memset(m_bChnMask, false, sizeof(m_bChnMask)); m_ShowCancel = showCancel; } Modified: trunk/OpenMPT/packageTemplate/History.txt =================================================================== --- trunk/OpenMPT/packageTemplate/History.txt 2010-05-22 13:45:17 UTC (rev 603) +++ trunk/OpenMPT/packageTemplate/History.txt 2010-05-22 15:27:35 UTC (rev 604) @@ -9,7 +9,7 @@ [Var]: other (tx XYZ): thanks to XYZ for telling us about the bug -Changes from revisions [476, 602] +Changes from revisions [476, 604] --------------------------------- General tab @@ -176,6 +176,7 @@ [New] <Jojo> INI Settings: When portable mode is enabled, the most common paths in mptrack.ini are now translated to relative paths (if possible). Plugin paths are not translated to relative paths (yet). [New] <Jojo> Modules in gzip archives (single-file .gz archives) can now be imported, just to satisfy my laziness when downloading gzipped modules from Amiga Music Preservation. :-P [New] <Jojo> Wave export can now also render by instrument (i.e. one wave file per instrument). + [Imp] <Jojo> The wave export "render by channel" mode ignores empty channels now. [Imp] <Jojo> Mod Loaders: Instead of creating messageboxes in various places, errors are now written to the log and one messagebox is shown for each file. [Imp] <Jojo> Binary files are now less often falsely recognized as early MOD files (15 samples without header): If the orderlist contains orderlist items > 128, loading is cancelled. [Imp] <Jojo> Song Properties: Tooltips are shown for various controls. This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <sag...@us...> - 2010-05-22 15:56:56
|
Revision: 605 http://modplug.svn.sourceforge.net/modplug/?rev=605&view=rev Author: saga-games Date: 2010-05-22 15:56:50 +0000 (Sat, 22 May 2010) Log Message: ----------- [Fix] Even if an instrument was muted, a VSTi assigned to this instrument was still playing in the pattern. This also fixes a problem with wave export + instrument mode. Modified Paths: -------------- trunk/OpenMPT/packageTemplate/History.txt trunk/OpenMPT/soundlib/Sndmix.cpp Modified: trunk/OpenMPT/packageTemplate/History.txt =================================================================== --- trunk/OpenMPT/packageTemplate/History.txt 2010-05-22 15:27:35 UTC (rev 604) +++ trunk/OpenMPT/packageTemplate/History.txt 2010-05-22 15:56:50 UTC (rev 605) @@ -9,7 +9,7 @@ [Var]: other (tx XYZ): thanks to XYZ for telling us about the bug -Changes from revisions [476, 604] +Changes from revisions [476, 605] --------------------------------- General tab @@ -100,6 +100,7 @@ [Imp] <Jojo> VST Editor: Added shortcuts for "toggle bypass", "pass keys to plug" and "record params to pattern" [Mod] <Jojo> VST Editor: Changed number of patches per sub menu from 100 to 128. Now, one sub menu equals ones MIDI bank (more logical) [Fix] <Jojo> VST Editor: Preset names starting with ' ' >= char > 'A' were cropped (i.e. "123ABC" was displayed as "ABC") + [Fix] <Jojo> Even if an instrument was muted, a VSTi assigned to this instrument was still playing in the pattern. [Fix] <re> Some VSTs that previously wouldn't load might now load fine. [Fix] <re> Returned host CanDo-values were wrong (since pre RC1 era). Modified: trunk/OpenMPT/soundlib/Sndmix.cpp =================================================================== --- trunk/OpenMPT/soundlib/Sndmix.cpp 2010-05-22 15:27:35 UTC (rev 604) +++ trunk/OpenMPT/soundlib/Sndmix.cpp 2010-05-22 15:56:50 UTC (rev 605) @@ -2000,15 +2000,24 @@ if ((instr) && (instr < MAX_INSTRUMENTS)) pIns = Instruments[instr]; - if ((pIns) && (pIns->nMidiChannel >= 1) && (pIns->nMidiChannel <= 16)) { - UINT nPlugin = GetBestPlugin(nChn, PRIORITISE_INSTRUMENT, RESPECT_MUTES); - if ((nPlugin) && (nPlugin <= MAX_MIXPLUGINS)) { - pPlugin = m_MixPlugins[nPlugin-1].pMixPlugin; + if (pIns) + { + // Check instrument plugins + if ((pIns->nMidiChannel >= 1) && (pIns->nMidiChannel <= 16)) + { + UINT nPlugin = GetBestPlugin(nChn, PRIORITISE_INSTRUMENT, RESPECT_MUTES); + if ((nPlugin) && (nPlugin <= MAX_MIXPLUGINS)) + { + pPlugin = m_MixPlugins[nPlugin-1].pMixPlugin; + } } + + // Muted instrument? + if (pIns && (pIns->dwFlags & INS_MUTE)) return; } - //Do couldn't find a valid plugin - if (pPlugin == NULL) return; + // Do couldn't find a valid plugin + if (pPlugin == nullptr) return; if(GetModFlag(MSF_MIDICC_BUGEMULATION)) { This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <sag...@us...> - 2010-05-23 15:33:05
|
Revision: 606 http://modplug.svn.sourceforge.net/modplug/?rev=606&view=rev Author: saga-games Date: 2010-05-23 15:32:59 +0000 (Sun, 23 May 2010) Log Message: ----------- [Fix] Pattern editor: Jumping between patterns also stops VSTi notes now. [Fix] Pattern editor: When deleting all patterns via the treeview and then switching to the pattern editor, pattern 0 is not created automatically anymore, to avoid confusion. [Imp] Wave Convert: When switching to another task and switching back to OpenMPT, it is now less likely that the infamous "OpenMPT does not respond" dialog from Windows occours. [Mod] Added some unfinished code for the VST file selection command. As it's unfinished, it's commented out of course. [Ref] A bit more refactoring Modified Paths: -------------- trunk/OpenMPT/mptrack/Mod2wave.cpp trunk/OpenMPT/mptrack/View_pat.cpp trunk/OpenMPT/mptrack/View_pat.h trunk/OpenMPT/mptrack/Vstplug.cpp trunk/OpenMPT/packageTemplate/History.txt trunk/OpenMPT/soundlib/Fastmix.cpp trunk/OpenMPT/soundlib/Sndfile.cpp trunk/OpenMPT/soundlib/Sndfile.h Modified: trunk/OpenMPT/mptrack/Mod2wave.cpp =================================================================== --- trunk/OpenMPT/mptrack/Mod2wave.cpp 2010-05-22 15:56:50 UTC (rev 605) +++ trunk/OpenMPT/mptrack/Mod2wave.cpp 2010-05-23 15:32:59 UTC (rev 606) @@ -700,6 +700,8 @@ UINT nBytesPerSample = (CSoundFile::gnBitsPerSample * CSoundFile::gnChannels) / 8; // For calculating the remaining time DWORD dwStartTime = timeGetTime(); + // For giving away some processing time every now and then + DWORD dwSleepTime = dwStartTime; CMainFrame::GetMainFrame()->InitRenderer(m_pSndFile); //rewbs.VSTTimeInfo for (UINT n=0; ; n++) @@ -763,14 +765,22 @@ { DWORD l = (DWORD)(ullSamples / CSoundFile::gdwMixingFreq); + const DWORD dwCurrentTime = timeGetTime(); DWORD timeRemaining = 0; // estimated remainig time if((ullSamples > 0) && (ullSamples < max)) { - timeRemaining = static_cast<DWORD>(((timeGetTime() - dwStartTime) * (max - ullSamples) / ullSamples) / 1000); + timeRemaining = static_cast<DWORD>(((dwCurrentTime - dwStartTime) * (max - ullSamples) / ullSamples) / 1000); } wsprintf(s, "Writing file... (%uKB, %umn%02us, %umn%02us remaining)", datahdr.length >> 10, l / 60, l % 60, timeRemaining / 60, timeRemaining % 60); SetDlgItemText(IDC_TEXT1, s); + + // Give windows some time to redraw the window, if necessary (else, the infamous "OpenMPT does not respond" will pop up) + if ((!m_bGivePlugsIdleTime) && (dwCurrentTime > dwSleepTime + 1000)) + { + Sleep(1); + dwSleepTime = dwCurrentTime; + } } if ((progress != NULL) && ((DWORD)(ullSamples >> 14) != pos)) { @@ -782,6 +792,7 @@ ::TranslateMessage(&msg); ::DispatchMessage(&msg); } + if (m_bAbort) { ok = IDCANCEL; @@ -977,6 +988,7 @@ } static DWORD oldsndcfg = CSoundFile::gdwSoundSetup; oldrepeat = m_pSndFile->GetRepeatCount(); + const DWORD dwSongTime = m_pSndFile->GetSongTime(); CSoundFile::gdwMixingFreq = wfxSrc.nSamplesPerSec; CSoundFile::gnBitsPerSample = 16; // CSoundFile::SetResamplingMode(SRCMODE_POLYPHASE); //rewbs.resamplerConf - we don't want this anymore. @@ -998,7 +1010,7 @@ // calculate maximum samples uint64 max = ullMaxSamples; - uint64 l = m_pSndFile->GetSongTime() * wfxSrc.nSamplesPerSec; + uint64 l = dwSongTime * wfxSrc.nSamplesPerSec; if (l < max) max = l; if (progress != NULL) { Modified: trunk/OpenMPT/mptrack/View_pat.cpp =================================================================== --- trunk/OpenMPT/mptrack/View_pat.cpp 2010-05-22 15:56:50 UTC (rev 605) +++ trunk/OpenMPT/mptrack/View_pat.cpp 2010-05-23 15:32:59 UTC (rev 606) @@ -163,10 +163,9 @@ m_nPlayRow = 0; m_nMidRow = 0; m_nDragItem = 0; - m_bDragging = FALSE; - m_bInItemRect = FALSE; - m_bRecord = TRUE; - m_bContinueSearch = FALSE; + m_bDragging = false; + m_bInItemRect = false; + m_bContinueSearch = false; m_dwBeginSel = m_dwEndSel = m_dwCursor = m_dwStartSel = m_dwDragPos = 0; //m_dwStatus = 0; m_dwStatus = PATSTATUS_PLUGNAMESINHEADERS; @@ -193,7 +192,7 @@ { CSoundFile *pSndFile; CModDoc *pModDoc = GetDocument(); - BOOL bUpdateScroll; + bool bUpdateScroll = false; pSndFile = pModDoc ? pModDoc->GetSoundFile() : NULL; if ( (!pModDoc) || (!pSndFile) || (npat >= pSndFile->Patterns.Size()) ) return FALSE; @@ -203,18 +202,18 @@ while ((npat > 0) && (!pSndFile->Patterns[npat])) npat--; if (!pSndFile->Patterns[npat]) { - pSndFile->Patterns.Insert(npat, 64); + // Changed behaviour here. Previously, an empty pattern was inserted and the user most likely didn't notice that. Now, we just return an error. + //pSndFile->Patterns.Insert(npat, 64); + return FALSE; } - - bUpdateScroll = FALSE; m_nPattern = npat; - if ((nrow >= 0) && (nrow != (int)m_nRow) && (nrow < (int)pSndFile->PatternSize[m_nPattern])) + if ((nrow >= 0) && (nrow != (int)m_nRow) && (nrow < (int)pSndFile->Patterns[m_nPattern].GetNumRows())) { m_nRow = nrow; - bUpdateScroll = TRUE; + bUpdateScroll = true; } - if (m_nRow >= pSndFile->PatternSize[m_nPattern]) m_nRow = 0; + if (m_nRow >= pSndFile->Patterns[m_nPattern].GetNumRows()) m_nRow = 0; int sel = m_dwCursor | (m_nRow << 16); SetCurSel(sel, sel); UpdateSizes(); @@ -363,7 +362,7 @@ { ncol += (((ncol & 0x07) - m_nDetailLevel) << 3) - (m_nDetailLevel+1); } - if ((ncol >> 3) >= pSndFile->m_nChannels) return FALSE; + if ((ncol >> 3) >= pSndFile->GetNumChannels()) return FALSE; m_dwCursor = ncol; int sel = m_dwCursor | (m_nRow << 16); int sel0 = sel; @@ -461,7 +460,7 @@ CModDoc *pModDoc = GetDocument(); CSoundFile *pSndFile; CRect rcClient, rect, plugRect; //rewbs.patPlugNames - UINT n, nmax; + UINT n; int xofs, yofs; if (!pModDoc) return 0; @@ -471,7 +470,7 @@ rect.SetRect(m_szHeader.cx, 0, m_szHeader.cx + GetColumnWidth() - 2, m_szHeader.cy); plugRect.SetRect(m_szHeader.cx, m_szHeader.cy-PLUGNAME_HEIGHT, m_szHeader.cx + GetColumnWidth() - 2, m_szHeader.cy); //rewbs.patPlugNames pSndFile = pModDoc->GetSoundFile(); - nmax = pSndFile->m_nChannels; + const UINT nmax = pSndFile->GetNumChannels(); // Checking channel headers //rewbs.patPlugNames if (m_dwStatus & PATSTATUS_PLUGNAMESINHEADERS) @@ -980,11 +979,13 @@ if (/*(m_bDragging) ||*/ (!pModDoc)) return; SetFocus(); m_nDragItem = GetDragItem(point, &m_rcDragItem); - m_bDragging = TRUE; - m_bInItemRect = TRUE; + m_bDragging = true; + m_bInItemRect = true; SetCapture(); - if ((point.x >= m_szHeader.cx) && (point.y <= m_szHeader.cy)) { - if (nFlags & MK_CONTROL) { + if ((point.x >= m_szHeader.cx) && (point.y <= m_szHeader.cy)) + { + if (nFlags & MK_CONTROL) + { TogglePendingMute((GetPositionFromPoint(point)&0xFFFF)>>3); } } @@ -1059,10 +1060,10 @@ //------------------------------------------------------- { CModDoc *pModDoc = GetDocument(); - BOOL bItemSelected = m_bInItemRect; + const bool bItemSelected = m_bInItemRect; if (/*(!m_bDragging) ||*/ (!pModDoc)) return; - m_bDragging = FALSE; - m_bInItemRect = FALSE; + m_bDragging = false; + m_bInItemRect = false; ReleaseCapture(); m_dwStatus &= ~PATSTATUS_MOUSEDRAGSEL; // Drag & Drop Editing @@ -1109,7 +1110,7 @@ } else if (!(nFlags&MK_CONTROL)) { - pModDoc->MuteChannel(nItemNo, (pSndFile->ChnSettings[nItemNo].dwFlags & CHN_MUTE) ? false : true); + pModDoc->MuteChannel(nItemNo, !pModDoc->IsChannelMuted(nItemNo)); pModDoc->UpdateAllViews(this, HINT_MODCHANNELS | ((nItemNo / CHANNELS_IN_TAB) << HINT_SHIFT_CHNTAB)); } break; @@ -1163,15 +1164,16 @@ m_dwStatus &= ~(PATSTATUS_DRAGNDROPEDIT|PATSTATUS_MOUSEDRAGSEL); if (m_bDragging) { - m_bDragging = FALSE; - m_bInItemRect = FALSE; + m_bDragging = false; + m_bInItemRect = false; ReleaseCapture(); } SetCursor(CMainFrame::curArrow); return; } - if ((hMenu = ::CreatePopupMenu()) == NULL) { + if ((hMenu = ::CreatePopupMenu()) == NULL) + { return; } @@ -1398,7 +1400,7 @@ } void CViewPattern::OnMuteChannel(BOOL current) -//-------------------------------- +//-------------------------------------------- { CModDoc *pModDoc = GetDocument(); if (pModDoc) @@ -1693,7 +1695,7 @@ m_cmdReplace.param = pageReplace.m_nParam; m_dwReplaceFlags = pageReplace.m_dwFlags; m_cInstrRelChange = pageReplace.cInstrRelChange; - m_bContinueSearch = FALSE; + m_bContinueSearch = false; OnEditFindNext(); } } @@ -1932,7 +1934,7 @@ } EndSearch: if (m_dwReplaceFlags & PATSEARCH_REPLACEALL) InvalidatePattern(); - m_bContinueSearch = TRUE; + m_bContinueSearch = true; EndWaitCursor(); // Display search results //m_dwReplaceFlags &= ~PATSEARCH_REPLACEALL; Modified: trunk/OpenMPT/mptrack/View_pat.h =================================================================== --- trunk/OpenMPT/mptrack/View_pat.h 2010-05-22 15:56:50 UTC (rev 605) +++ trunk/OpenMPT/mptrack/View_pat.h 2010-05-23 15:32:59 UTC (rev 606) @@ -88,7 +88,7 @@ int m_nXScroll, m_nYScroll; DWORD m_nDragItem, m_nMenuParam, m_nDetailLevel; - BOOL m_bDragging, m_bInItemRect, m_bRecord, m_bContinueSearch, m_bWholePatternFitsOnScreen; + bool m_bDragging, m_bInItemRect, m_bContinueSearch, m_bWholePatternFitsOnScreen; RECT m_rcDragItem; DWORD m_dwStatus, m_dwCursor; DWORD m_dwBeginSel, m_dwEndSel, m_dwStartSel, m_dwDragPos; Modified: trunk/OpenMPT/mptrack/Vstplug.cpp =================================================================== --- trunk/OpenMPT/mptrack/Vstplug.cpp 2010-05-22 15:56:50 UTC (rev 605) +++ trunk/OpenMPT/mptrack/Vstplug.cpp 2010-05-23 15:32:59 UTC (rev 606) @@ -185,7 +185,7 @@ PVSTPLUGINLIB CVstPluginManager::AddPlugin(LPCSTR pszDllPath, BOOL bCache, const bool checkFileExistence, CString* const errStr) -//----------------------------------------------------------------------------------------------------------- +//------------------------------------------------------------------------------------------------------------------------------ { if(checkFileExistence && (PathFileExists(pszDllPath) == FALSE)) { @@ -444,7 +444,7 @@ BOOL CVstPluginManager::CreateMixPlugin(PSNDMIXPLUGIN pMixPlugin, CSoundFile* pSndFile) -//--------------------------------------------------------------------------------- +//------------------------------------------------------------------------------------- { UINT nMatch=0; PVSTPLUGINLIB pFound = NULL; @@ -457,15 +457,15 @@ { if (pMixPlugin) { - BOOL b1=FALSE, b2=FALSE; + bool b1 = false, b2 = false; if ((p->dwPluginId1 == pMixPlugin->Info.dwPluginId1) && (p->dwPluginId2 == pMixPlugin->Info.dwPluginId2)) { - b1 = TRUE; + b1 = true; } if (!_strnicmp(p->szLibraryName, pMixPlugin->Info.szLibraryName, 64)) { - b2 = TRUE; + b2 = true; } if ((b1) && (b2)) { @@ -645,7 +645,7 @@ 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 + enum enmHostCanDo { HostDoNotKnow = 0, HostCanDo = 1, @@ -991,7 +991,51 @@ break; // open a fileselector window with VstFileSelect* in <ptr> case audioMasterOpenFileSelector: - Log("VST plugin to host: Get Directory\n"); + { + /* + VstFileSelect *pFileSel = (VstFileSelect *)ptr; + ASSERT(false); + + if(pFileSel->command != kVstDirectorySelect) + { + std::string extensions; + for(size_t i = 0; i < pFileSel->nbFileTypes; i++) + { + VstFileType *pType = &(pFileSel->fileTypes[i]); + extensions += pType->name; + extensions += "|"; +#if (defined(WIN32) || defined(WINDOWS)) + extensions += "*."; + extensions += pType->dosType; +#elif defined(MAC) + extensions += "*"; + extensions += pType->macType; +#elif defined(UNIX) + extensions += "*."; + extensions += pType->unixType; +#else + #error Platform-specific code missing +#endif + extensions += "|"; + } + + FileDlgResult files = CTrackApp::ShowOpenSaveFileDialog( + pFileSel->command == kVstFileSave ? false : true, + "", "", extensions, pFileSel->initialPath, + pFileSel->command == kVstMultipleFilesLoad + ); + if(files.abort) + return 0; + // todo: retrieve filenames etc. + //strcpy(pFileSel->returnPath, files.first_file.c_str()); + //pFileSel->sizeReturnPath = files.first_file.length(); + return 1; + + } else */ + { + Log("VST plugin to host: Get Directory\n"); + } + } break; //---from here VST 2.2 extension opcodes------------------------------------------------------ @@ -1130,6 +1174,7 @@ }; bool CSelectPluginDlg::VerifyPlug(PVSTPLUGINLIB plug) +//--------------------------------------------------- { CString s; for (int p=0; p<NUM_PROBLEMPLUGS; p++) @@ -1837,7 +1882,7 @@ } bool CVstPlugin::SaveProgram(CString fileName) -//------------------------------------ +//-------------------------------------------- { if (!(m_pEffect)) return false; Modified: trunk/OpenMPT/packageTemplate/History.txt =================================================================== --- trunk/OpenMPT/packageTemplate/History.txt 2010-05-22 15:56:50 UTC (rev 605) +++ trunk/OpenMPT/packageTemplate/History.txt 2010-05-23 15:32:59 UTC (rev 606) @@ -9,7 +9,7 @@ [Var]: other (tx XYZ): thanks to XYZ for telling us about the bug -Changes from revisions [476, 605] +Changes from revisions [476, 606] --------------------------------- General tab @@ -23,6 +23,7 @@ Sequence editor [New] <Jojo> "Select All" shortcut also works here now. [Imp] <Jojo> Sequence menu also allows to insert empty sequences now. + [Fix] <Jojo> Jumping between patterns also stops VSTi notes now. Pattern tab::pattern editing [New] <Jojo> Extended context menu for PC Notes @@ -36,6 +37,7 @@ [Fix] <Jojo> When pasting pattern data that exactly reached the pattern end with overflow paste enabled, a redundant undo point was created. [Fix] <Jojo> Entered (volume) effects are now properly validated (makes a difference f.e. in MOD format where it was previously possible to enter effects like Hxx) [Fix] <Jojo> Mix Paste: When in MPT behaviour mode, empty FX commands were not overwritten properly when there previously was an effect in that field but only the effect number (and not the param value) was reset. + [Fix] <Jojo> When deleting all patterns via the treeview and then switching to the pattern editor, pattern 0 is not created automatically anymore, to avoid confusion. [Reg] <Jojo> Creating a selection using the Shift key + Mouse click now only works if there was previously no selection made; This seems reasonable as the old shift-behaviour seems to be widely used. Pattern tab::GUI @@ -173,10 +175,13 @@ [Fix] <Jojo> Because of an error in pattern count retrival, the last pattern was not checked when looking for unused samples which sometimes resulted in deleted samples (although they were actually used). [Fix] <re> Fixed a memory leak in pattern name handling. +Wave Export + [New] <Jojo> It is now also possible to render by instrument (i.e. one wave file per instrument). + [Imp] <Jojo> When switching to another task and switching back to OpenMPT, it is now less likely that the infamous "OpenMPT does not respond" dialog from Windows occours. + Misc [New] <Jojo> INI Settings: When portable mode is enabled, the most common paths in mptrack.ini are now translated to relative paths (if possible). Plugin paths are not translated to relative paths (yet). [New] <Jojo> Modules in gzip archives (single-file .gz archives) can now be imported, just to satisfy my laziness when downloading gzipped modules from Amiga Music Preservation. :-P - [New] <Jojo> Wave export can now also render by instrument (i.e. one wave file per instrument). [Imp] <Jojo> The wave export "render by channel" mode ignores empty channels now. [Imp] <Jojo> Mod Loaders: Instead of creating messageboxes in various places, errors are now written to the log and one messagebox is shown for each file. [Imp] <Jojo> Binary files are now less often falsely recognized as early MOD files (15 samples without header): If the orderlist contains orderlist items > 128, loading is cancelled. Modified: trunk/OpenMPT/soundlib/Fastmix.cpp =================================================================== --- trunk/OpenMPT/soundlib/Fastmix.cpp 2010-05-22 15:56:50 UTC (rev 605) +++ trunk/OpenMPT/soundlib/Fastmix.cpp 2010-05-23 15:32:59 UTC (rev 606) @@ -1748,7 +1748,8 @@ } //didn't manage to get flag from instrument header, use channel flags. - if (pChannel->dwFlags & CHN_HQSRC) { + if (pChannel->dwFlags & CHN_HQSRC) + { if (gdwSoundSetup & SNDMIX_SPLINESRCMODE) return MIXNDX_HQSRC; if (gdwSoundSetup & SNDMIX_POLYPHASESRCMODE) return MIXNDX_KAISERSRC; if (gdwSoundSetup & SNDMIX_FIRFILTERSRCMODE) return MIXNDX_FIRFILTERSRC; @@ -1762,7 +1763,7 @@ extern int gbInitPlugins; -VOID CSoundFile::ProcessPlugins(UINT nCount) +void CSoundFile::ProcessPlugins(UINT nCount) //------------------------------------------ { // Setup float inputs @@ -1782,7 +1783,8 @@ }*/ //We should only ever reach this point if the song is playing. - if (!pPlugin->pMixPlugin->IsSongPlaying()) { + if (!pPlugin->pMixPlugin->IsSongPlaying()) + { //Plugin doesn't know it is in a song that is playing; //we must have added it during playback. Initialise it! pPlugin->pMixPlugin->NotifySongPlaying(true); Modified: trunk/OpenMPT/soundlib/Sndfile.cpp =================================================================== --- trunk/OpenMPT/soundlib/Sndfile.cpp 2010-05-22 15:56:50 UTC (rev 605) +++ trunk/OpenMPT/soundlib/Sndfile.cpp 2010-05-23 15:32:59 UTC (rev 606) @@ -768,13 +768,14 @@ } if ((m_nRestartPos >= Order.size()) || (Order[m_nRestartPos] >= Patterns.Size())) m_nRestartPos = 0; - // Load plugins only when m_pModDoc != 0. (can be == 0 for example when examining module samples in treeview. + // plugin loader string sNotFound; bool bSearchIDs[MAX_MIXPLUGINS]; memset(bSearchIDs, false, MAX_MIXPLUGINS * sizeof(bool)); UINT iShowNotFound = 0; + // Load plugins only when m_pModDoc != 0. (can be == 0 for example when examining module samples in treeview. if (gpMixPluginCreateProc && GetpModDoc()) { for (PLUGINDEX iPlug = 0; iPlug < MAX_MIXPLUGINS; iPlug++) @@ -1237,9 +1238,8 @@ void CSoundFile::SetCurrentOrder(ORDERINDEX nOrder) -//----------------------------------------------- +//------------------------------------------------- { - //while ((nPos < Order.size()) && (Order[nPos] == 0xFE)) nPos++; while ((nOrder < Order.size()) && (Order[nOrder] == Order.GetIgnoreIndex())) nOrder++; if ((nOrder >= Order.size()) || (Order[nOrder] >= Patterns.Size())) return; for (CHANNELINDEX j = 0; j < MAX_CHANNELS; j++) @@ -1259,6 +1259,12 @@ } Chn[j].nTremorCount = 0; } + +#ifndef NO_VST + // Stop hanging notes from VST instruments as well + StopAllVsti(); +#endif // NO_VST + if (!nOrder) { SetCurrentPos(0); @@ -1320,28 +1326,32 @@ void CSoundFile::StopAllVsti() //---------------------------- { - for (UINT iPlug=0; iPlug<MAX_MIXPLUGINS; iPlug++) { + for (UINT iPlug=0; iPlug<MAX_MIXPLUGINS; iPlug++) + { if (!m_MixPlugins[iPlug].pMixPlugin) continue; //most common branch IMixPlugin *pPlugin = m_MixPlugins[iPlug].pMixPlugin; - if (m_MixPlugins[iPlug].pMixState) { + if (m_MixPlugins[iPlug].pMixState) + { pPlugin->HardAllNotesOff(); } } - m_lTotalSampleCount=GetSampleOffset(); + m_lTotalSampleCount = GetSampleOffset(); } void CSoundFile::RecalculateGainForAllPlugs() //------------------------------------------ { - for (UINT iPlug=0; iPlug<MAX_MIXPLUGINS; iPlug++) { + for (UINT iPlug=0; iPlug<MAX_MIXPLUGINS; iPlug++) + { if (!m_MixPlugins[iPlug].pMixPlugin) continue; //most common branch IMixPlugin *pPlugin = m_MixPlugins[iPlug].pMixPlugin; - if (m_MixPlugins[iPlug].pMixState) { + if (m_MixPlugins[iPlug].pMixState) + { pPlugin->RecalculateGain(); } } Modified: trunk/OpenMPT/soundlib/Sndfile.h =================================================================== --- trunk/OpenMPT/soundlib/Sndfile.h 2010-05-22 15:56:50 UTC (rev 605) +++ trunk/OpenMPT/soundlib/Sndfile.h 2010-05-23 15:32:59 UTC (rev 606) @@ -755,11 +755,11 @@ public: // Real-time sound functions - VOID SuspendPlugins(); //rewbs.VSTCompliance - VOID ResumePlugins(); //rewbs.VSTCompliance - VOID StopAllVsti(); //rewbs.VSTCompliance - VOID RecalculateGainForAllPlugs(); - VOID ResetChannels(); + void SuspendPlugins(); //rewbs.VSTCompliance + void ResumePlugins(); //rewbs.VSTCompliance + void StopAllVsti(); //rewbs.VSTCompliance + void RecalculateGainForAllPlugs(); + void ResetChannels(); UINT Read(LPVOID lpBuffer, UINT cbBuffer); UINT ReadMix(LPVOID lpBuffer, UINT cbBuffer, CSoundFile *, DWORD *, LPBYTE ps=NULL); UINT CreateStereoMix(int count); @@ -767,8 +767,8 @@ BOOL FadeSong(UINT msec); BOOL GlobalFadeSong(UINT msec); UINT GetTotalTickCount() const { return m_nTotalCount; } - VOID ResetTotalTickCount() { m_nTotalCount = 0;} - VOID ProcessPlugins(UINT nCount); + void ResetTotalTickCount() { m_nTotalCount = 0;} + void ProcessPlugins(UINT nCount); public: // Mixer Config This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <rel...@us...> - 2010-05-23 21:49:10
|
Revision: 607 http://modplug.svn.sourceforge.net/modplug/?rev=607&view=rev Author: relabsoluness Date: 2010-05-23 21:49:03 +0000 (Sun, 23 May 2010) Log Message: ----------- [Mod] Version: Changed to 1.18.02.00, increased mptm file version. [Mod] General: Removed changes-dialog since there are separate release notes. Modified Paths: -------------- trunk/OpenMPT/mptrack/Mptrack.cpp trunk/OpenMPT/mptrack/version.h trunk/OpenMPT/packageTemplate/History.txt trunk/OpenMPT/soundlib/Load_it.cpp Modified: trunk/OpenMPT/mptrack/Mptrack.cpp =================================================================== --- trunk/OpenMPT/mptrack/Mptrack.cpp 2010-05-23 15:32:59 UTC (rev 606) +++ trunk/OpenMPT/mptrack/Mptrack.cpp 2010-05-23 21:49:03 UTC (rev 607) @@ -236,28 +236,6 @@ static void ShowChangesDialog() //----------------------------- { - const char* const firstOpenMessage = "OpenMPT build " MPT_VERSION_STR ".\n\n" - "Some changes since version 1.17.02.54:\n\n" - "[New] Pattern tab: New paste modes: overflow, push forward and flood.\n" - "[Mod] Pattern tab: Keyboard split is now accessible from key shortcut or menu.\n" - "[Imp] Pattern tab: Numerous improvements including better effect descriptions in note properties.\n" - "[New] Sequence editor: Can now handle order selections including delete/copy/cut/paste functionality.\n" - "[New] Sequence editor: Can render selected patterns to wave directly from orderlist.\n" - "[New] Envelope editor: Numerous improvements including ability to insert and remove points easily and editing envelopes with the keyboard.\n" - "[New] Sample tab: sample undo, sample draw, resize sample, DC offset removal, batch export, better loop point handling when deleting selections. Play sample from given position with Ctrl + left mouse button.\n" - "[New] MPTM: New parameter controls for controlling plug params from pattern.\n" - "[New] MPTM: Can have envelope points up to 240 and multiple sequences.\n" - "[New] MIDI mapping: Editing a plug param in its editor while holding shift key will now open MIDI mapping dialog.\n" - "[New] MIDI mapping: Can now record MIDI mapping changes to pattern.\n" - "[Imp] MOD/S3M/XM/IT: Numerous improvements to load, save and playback compatibility.\n" - "[New] Input: Can import J2B (RIFF AM / RIFF AMFF), PSM16, IMF, GDM and SCL files. Improved PSM and ULT import.\n" - "[New] Setup: New default directories: plugins and plugin presets, sharable colour schemes\n" - "[New] Cleanup: New option compo cleanup, rearrange samples is back, can merge sequences.\n" - "[Mod] Misc: Program settings are now by default stored in %APPDATA%\\OpenMPT\n" - "\n" - "and many more. See history.txt for more details."; - - CMainFrame::GetMainFrame()->MessageBox(firstOpenMessage, "OpenMPT " MPT_VERSION_STR, MB_ICONINFORMATION); } Modified: trunk/OpenMPT/mptrack/version.h =================================================================== --- trunk/OpenMPT/mptrack/version.h 2010-05-23 15:32:59 UTC (rev 606) +++ trunk/OpenMPT/mptrack/version.h 2010-05-23 21:49:03 UTC (rev 607) @@ -14,7 +14,7 @@ //Version definitions. The only thing that needs to be changed when changing version number. #define VER_MAJORMAJOR 1 #define VER_MAJOR 18 -#define VER_MINOR 01 +#define VER_MINOR 02 #define VER_MINORMINOR 00 //Creates version number from version parts that appears in version string. Modified: trunk/OpenMPT/packageTemplate/History.txt =================================================================== --- trunk/OpenMPT/packageTemplate/History.txt 2010-05-23 15:32:59 UTC (rev 606) +++ trunk/OpenMPT/packageTemplate/History.txt 2010-05-23 21:49:03 UTC (rev 607) @@ -9,9 +9,10 @@ [Var]: other (tx XYZ): thanks to XYZ for telling us about the bug -Changes from revisions [476, 606] ---------------------------------- +v1.18.02.00 (May 2010) +---------------------- + General tab [Imp] <Jojo> Disabled tempo slider for MOD files (it was just confusing) [Imp] <Jojo> Disabled global volume slider for MOD files, instead enabled the sample pre-amp slider (so it is also possible to make output louder) Modified: trunk/OpenMPT/soundlib/Load_it.cpp =================================================================== --- trunk/OpenMPT/soundlib/Load_it.cpp 2010-05-23 15:32:59 UTC (rev 606) +++ trunk/OpenMPT/soundlib/Load_it.cpp 2010-05-23 21:49:03 UTC (rev 607) @@ -31,13 +31,14 @@ #define str_LoadingIncompatibleVersion TEXT("The file informed that it is incompatible with this version of OpenMPT. Loading was terminated.") #define str_LoadingMoreRecentVersion TEXT("The loaded file was made with a more recent OpenMPT version and this version may not be able to load all the features or play the file correctly.") -const uint16 verMptFileVer = 0x88F; +const uint16 verMptFileVer = 0x890; const uint16 verMptFileVerLoadLimit = 0x1000; // If cwtv-field is greater or equal to this value, // the MPTM file will not be loaded. /* MPTM version history for cwtv-field in IT header: -0x88E(1.17.02.50) -> 0x88F(1.18.01.00): +0x88F(1.18.01.00) -> 0x890(1.18.02.00): Removed volume command velocity :xy, added delay-cut command :xy. +0x88E(1.17.02.50) -> 0x88F(1.18.01.00): Numerous changes 0x88D(1.17.02.49) -> 0x88E(1.17.02.50): Changed ID to that of IT and undone the orderlist change done in 0x88A->0x88B. Now extended orderlist is saved as extension. 0x88C(1.17.02.48) -> 0x88D(1.17.02.49): Some tuning related changes - that part fails to read on older versions. This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <sag...@us...> - 2010-05-23 23:58:30
|
Revision: 608 http://modplug.svn.sourceforge.net/modplug/?rev=608&view=rev Author: saga-games Date: 2010-05-23 23:58:24 +0000 (Sun, 23 May 2010) Log Message: ----------- [Mod] Updated installer script. Hint: Needs the latest version of InnoSetup to compile. [Mod] The old mpt classic keymap by diamond is now maintained by nobuyuki. Some keys have been updated or moved. Modified Paths: -------------- trunk/OpenMPT/installer/install.iss Added Paths: ----------- trunk/OpenMPT/packageTemplate/extraKeymaps/US_mpt_classic_(nobuyuki).mkb Removed Paths: ------------- trunk/OpenMPT/packageTemplate/extraKeymaps/US_mpt_classic_(diamond).mkb Modified: trunk/OpenMPT/installer/install.iss =================================================================== --- trunk/OpenMPT/installer/install.iss 2010-05-23 21:49:03 UTC (rev 607) +++ trunk/OpenMPT/installer/install.iss 2010-05-23 23:58:24 UTC (rev 608) @@ -17,11 +17,12 @@ AllowNoIcons=yes OutputDir=.\ OutputBaseFilename=OpenMPT Setup -Compression=lzma +Compression=lzma2 SolidCompression=yes WizardImageFile=install-big.bmp WizardSmallImageFile=install-small.bmp CreateUninstallRegKey=not IsTaskSelected('portable') +DisableWelcomePage=yes ;LicenseFile=license.txt [Tasks] @@ -39,6 +40,9 @@ [Files] ; you may want to change the base paths here +; note: packageTemplate\ contains files specific for the "install package". +; for files that are common with the "zip package", use ..\packageTemplate\ + ; preserve file type order for best solid compression results (first binary, then text) ; home folder Source: "..\mptrack\bin\mptrack.exe"; DestDir: "{app}"; Flags: ignoreversion @@ -86,7 +90,7 @@ ; enable portable mode Filename: "{app}\mptrack.ini"; Section: "Paths"; Key: "UseAppDataDirectory"; String: "0"; Flags: createkeyifdoesntexist; Tasks: portable ; internet shortcut -Filename: "{app}\ModPlug Central.url"; Section: "InternetShortcut"; Key: "URL"; String: "http://www.lpchip.com/modplug/"; Flags: createkeyifdoesntexist; +Filename: "{app}\ModPlug Central.url"; Section: "InternetShortcut"; Key: "URL"; String: "http://openmpt.com/forum/"; Flags: createkeyifdoesntexist; [Run] ; duh @@ -240,3 +244,5 @@ end; end; + + Deleted: trunk/OpenMPT/packageTemplate/extraKeymaps/US_mpt_classic_(diamond).mkb =================================================================== --- trunk/OpenMPT/packageTemplate/extraKeymaps/US_mpt_classic_(diamond).mkb 2010-05-23 21:49:03 UTC (rev 607) +++ trunk/OpenMPT/packageTemplate/extraKeymaps/US_mpt_classic_(diamond).mkb 2010-05-23 23:58:24 UTC (rev 608) @@ -1,307 +0,0 @@ -//-------- Modplug Tracker 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:1030:0:116:1 //Play song/Pause song: F5 (KeyDown) -0:1031:0:119:1 //Pause song: F8 (KeyDown) -0:1375:0:27:1 //Stop Song: Esc (KeyDown) -0:1029:0:117:1 //Play song from start: F6 (KeyDown) -0:1027:0:118:5 //Play pattern from start: F7 (KeyDown|KeyHold) -0:1026:2:118:5 //Play pattern from cursor: Ctrl+F7 (KeyDown|KeyHold) -0:1376:0:120:1 //Toggle Midi Record: F9 (KeyDown) -0:1359:2:90:1 //Undo: Ctrl+Z (KeyDown) -0:1360:2:88:1 //Cut: Ctrl+X (KeyDown) -0:1361:2:67:1 //Copy: Ctrl+C (KeyDown) -0:1361:2:45:1 //Copy: Ctrl+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) -0:1365:2:70:1 //Find: Ctrl+F (KeyDown) -0:1366:0:114:1 //Find Next: F3 (KeyDown) -0:1021:4:71:1 //View General: Alt+G (KeyDown) -0:1022:4:80:1 //View Pattern: Alt+P (KeyDown) -0:1023:4:83:1 //View Samples: Alt+S (KeyDown) -0:1024:4:78:1 //View Instruments: Alt+N (KeyDown) -0:1025:1:120:1 //View Comments: Shift+F9 (KeyDown) -0:1368:2:113:1 //Toggle Tree View: Ctrl+F2 (KeyDown) -0:1369:2:112:1 //View Options: Ctrl+F1 (KeyDown) -0:1370:0:112:1 //Help (to do): F1 (KeyDown) -0:1032:2:111:5 //Previous instrument: Ctrl+ (KeyDown|KeyHold) -0:1032:2:38:5 //Previous instrument: Ctrl+Up (KeyDown|KeyHold) -0:1033:2:106:5 //Next instrument: Ctrl+Num * (KeyDown|KeyHold) -0:1033:2:40:5 //Next instrument: Ctrl+Down (KeyDown|KeyHold) -0:1036:0:111:1 //Previous octave: (KeyDown) -0:1037:0:106:1 //Next octave: Num * (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:1 //Jump down by highlight1: Page Down (KeyDown) -2:1018:0:33:1 //Jump up by highlight1: Page Up (KeyDown) -2:1338:4:34:1 //Jump down by highlight2: Alt+Page Down (KeyDown) -2:1339:4:33:1 //Jump up by highlight2: Alt+Page Up (KeyDown) -2:1340:6:34:5 //Snap down to highlight2: Ctrl+Alt+Page Down (KeyDown|KeyHold) -2:1341:6:33:5 //Snap up to highlight2: Ctrl+Alt+Page Up (KeyDown|KeyHold) -2:1038:0:40:5 //Navigate down: Down (KeyDown|KeyHold) -2:1039:0:38:1 //Navigate up: Up (KeyDown) -2:1040:0:37:5 //Navigate left: Left (KeyDown|KeyHold) -2:1041:0:39:5 //Navigate right: Right (KeyDown|KeyHold) -2:1042:0:9:1 //Navigate to next channel: Tab (KeyDown) -2:1043:1:9:1 //Navigate to previous channel: Shift+Tab (KeyDown) -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:1011:2:76:1 //Select channel / Select all: Ctrl+L (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+Alt (KeyDown) -2:1685:2:9:1 //Switch to order list: Ctrl+Tab (KeyDown) -2:1662:6:80:1 //Toggle channel's plugin editor: Ctrl+Alt+P (KeyDown) -2:1062:0:93:1 //Show note properties: Application (KeyDown) -2: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: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: Del (KeyDown) -2:1664:1:190:1 //Clear field (IT Style): Shift+. (KeyDown) -2:1059:2:46:1 //Clear row and step: Ctrl+Del (KeyDown) -2:1665:1:46:5 //Clear field and step (IT Style): Shift+Del (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: Ins (KeyDown) -2:1379:2:45:1 //Insert All Rows: Ctrl+Ins (KeyDown) -2:1055:0:109:5 //Previous pattern: Num - (KeyDown|KeyHold) -2:1054:0:107:5 //Next pattern: Num + (KeyDown|KeyHold) - -//----( Pattern Context [bottom] - Note Col (3) )------------ -3:1064:0:81:1 //Base octave C: Q (KeyDown) -3:1065:0:87:1 //Base octave C#: W (KeyDown) -3:1066:0:69:1 //Base octave D: E (KeyDown) -3:1067:0:82:1 //Base octave D#: R (KeyDown) -3:1068:0:84:1 //Base octave E: T (KeyDown) -3:1069:0:89:1 //Base octave F: Y (KeyDown) -3:1070:0:85:1 //Base octave F#: U (KeyDown) -3:1071:0:73:1 //Base octave G: I (KeyDown) -3:1072:0:79:1 //Base octave G#: O (KeyDown) -3:1073:0:80:1 //Base octave +1 A: P (KeyDown) -3:1074:0:219:1 //Base octave +1 A#: [ (KeyDown) -3:1075:0:221:1 //Base octave +1 B: ] (KeyDown) -3:1076:0:65:1 //Base octave +1 C: A (KeyDown) -3:1077:0:83:1 //Base octave +1 C#: S (KeyDown) -3:1078:0:68:1 //Base octave +1 D: D (KeyDown) -3:1079:0:70:1 //Base octave +1 D#: F (KeyDown) -3:1080:0:71:1 //Base octave +1 E: G (KeyDown) -3:1081:0:72:1 //Base octave +1 F: H (KeyDown) -3:1082:0:74:1 //Base octave +1 F#: J (KeyDown) -3:1083:0:75:1 //Base octave +1 G: K (KeyDown) -3:1084:0:76:1 //Base octave +1 G#: L (KeyDown) -3:1085:0:186:1 //Base octave +2 A: ; (KeyDown) -3:1086:0:222:1 //Base octave +2 A#: ' (KeyDown) -3:1087:0:220:1 //Base octave +2 B: \ (KeyDown) -3:1088:0:90:1 //Base octave +2 C: Z (KeyDown) -3:1089:0:88:1 //Base octave +2 C#: X (KeyDown) -3:1090:0:67:1 //Base octave +2 D: C (KeyDown) -3:1091:0:86:1 //Base octave +2 D#: V (KeyDown) -3:1092:0:66:1 //Base octave +2 E: B (KeyDown) -3:1093:0:78:1 //Base octave +2 F: N (KeyDown) -3:1094:0:77:1 //Base octave +2 F#: M (KeyDown) -3:1095:0:188:1 //Base octave +2 G: , (KeyDown) -3:1096:0:190:1 //Base octave +2 G#: . (KeyDown) -3:1097:0:191:1 //Base octave +3 A: / (KeyDown) -3:1212:0:48:1 //Set octave 0: 0 (KeyDown) -3:1212:0:96:1 //Set octave 0: Num 0 (KeyDown) -3:1213:0:49:1 //Set octave 1: 1 (KeyDown) -3:1213:0:97:1 //Set octave 1: Num 1 (KeyDown) -3:1214:0:50:1 //Set octave 2: 2 (KeyDown) -3:1214:0:98:1 //Set octave 2: Num 2 (KeyDown) -3:1215:0:51:1 //Set octave 3: 3 (KeyDown) -3:1215:0:99:1 //Set octave 3: Num 3 (KeyDown) -3:1216:0:52:1 //Set octave 4: 4 (KeyDown) -3:1216:0:100:1 //Set octave 4: Num 4 (KeyDown) -3:1217:0:53:1 //Set octave 5: 5 (KeyDown) -3:1217:0:101:1 //Set octave 5: Num 5 (KeyDown) -3:1218:0:54:1 //Set octave 6: 6 (KeyDown) -3:1218:0:102:1 //Set octave 6: Num 6 (KeyDown) -3:1219:0:55:1 //Set octave 7: 7 (KeyDown) -3:1219:0:103:1 //Set octave 7: Num 7 (KeyDown) -3:1220:0:56:1 //Set octave 8: 8 (KeyDown) -3:1220:0:104:1 //Set octave 8: Num 8 (KeyDown) -3:1221:0:57:1 //Set octave 9: 9 (KeyDown) -3:1221:0:105:1 //Set octave 9: Num 9 (KeyDown) -3:1316:1:16:1 //Chord Modifier: Shift+Shift (KeyDown) -3:1200:0:192:1 //Note cut: ` (KeyDown) -3:1201:0:187:1 //Note off: = (KeyDown) - -//----( Pattern Context [bottom] - Ins Col (4) )------------ -4:1202:0:96:1 //Set instrument digit 0: Num 0 (KeyDown) -4:1202:0:48:1 //Set instrument digit 0: 0 (KeyDown) -4:1203:0:97:1 //Set instrument digit 1: Num 1 (KeyDown) -4:1203:0:49:1 //Set instrument digit 1: 1 (KeyDown) -4:1204:0:98:1 //Set instrument digit 2: Num 2 (KeyDown) -4:1204:0:50:1 //Set instrument digit 2: 2 (KeyDown) -4:1205:0:99:1 //Set instrument digit 3: Num 3 (KeyDown) -4:1205:0:51:1 //Set instrument digit 3: 3 (KeyDown) -4:1206:0:100:1 //Set instrument digit 4: Num 4 (KeyDown) -4:1206:0:52:1 //Set instrument digit 4: 4 (KeyDown) -4:1207:0:101:1 //Set instrument digit 5: Num 5 (KeyDown) -4:1207:0:53:1 //Set instrument digit 5: 5 (KeyDown) -4:1208:0:102:1 //Set instrument digit 6: Num 6 (KeyDown) -4:1208:0:54:1 //Set instrument digit 6: 6 (KeyDown) -4:1209:0:103:1 //Set instrument digit 7: Num 7 (KeyDown) -4:1209:0:55:1 //Set instrument digit 7: 7 (KeyDown) -4:1210:0:56:1 //Set instrument digit 8: 8 (KeyDown) -4:1211:0:105:1 //Set instrument digit 9: Num 9 (KeyDown) -4:1211:0:57:1 //Set instrument digit 9: 9 (KeyDown) - -//----( Pattern Context [bottom] - Vol Col (5) )------------ -5:1222:0:48:1 //Set volume digit 0: 0 (KeyDown) -5:1222:0:96:1 //Set volume digit 0: Num 0 (KeyDown) -5:1223:0:49:1 //Set volume digit 1: 1 (KeyDown) -5:1223:0:97:1 //Set volume digit 1: Num 1 (KeyDown) -5:1224:0:50:1 //Set volume digit 2: 2 (KeyDown) -5:1224:0:98:1 //Set volume digit 2: Num 2 (KeyDown) -5:1225:0:51:1 //Set volume digit 3: 3 (KeyDown) -5:1225:0:99:1 //Set volume digit 3: Num 3 (KeyDown) -5:1226:0:52:1 //Set volume digit 4: 4 (KeyDown) -5:1226:0:100:1 //Set volume digit 4: Num 4 (KeyDown) -5:1227:0:53:1 //Set volume digit 5: 5 (KeyDown) -5:1227:0:101:1 //Set volume digit 5: Num 5 (KeyDown) -5:1228:0:54:1 //Set volume digit 6: 6 (KeyDown) -5:1228:0:102:1 //Set volume digit 6: Num 6 (KeyDown) -5:1229:0:55:1 //Set volume digit 7: 7 (KeyDown) -5:1229:0:103:1 //Set volume digit 7: Num 7 (KeyDown) -5:1230:0:56:1 //Set volume digit 8: 8 (KeyDown) -5:1231:0:57:1 //Set volume digit 9: 9 (KeyDown) -5:1231:0:105:1 //Set volume digit 9: Num 9 (KeyDown) -5:1232:0:86:1 //Vol command - volume: V (KeyDown) -5:1233:0:80:1 //Vol command - pan: P (KeyDown) -5:1234:0:67:1 //Vol command - vol slide up: C (KeyDown) -5:1235:0:68:1 //Vol command - vol slide down: D (KeyDown) -5:1236:0:65:1 //Vol command - vol fine slide up: A (KeyDown) -5:1237:0:66:1 //Vol command - vol fine slide down: B (KeyDown) -5:1238:0:85:1 //Vol command - vibrato speed: U (KeyDown) -5:1239:0:72:1 //Vol command - vibrato: H (KeyDown) -5:1240:0:76:1 //Vol command - XM pan left: L (KeyDown) -5:1241:0:82:1 //Vol command - XM pan right: R (KeyDown) -5:1242:0:71:1 //Vol command - Portamento: G (KeyDown) -5:1243:0:70:1 //Vol command - Portamento Up: F (KeyDown) -5:1244:0:69:1 //Vol command - Portamento Down: E (KeyDown) -5:1245:1:186:1 //Vol command - Velocity: Shift+; (KeyDown) -5:1246:0:79:1 //Vol command - Offset: O (KeyDown) - -//----( Pattern Context [bottom] - FX Col (6) )------------ -6:1294:0:220:1 //FX midi macro slide: \ (KeyDown) -6:1295:1:186:1 //FX pseudo-velocity (experimental): Shift+; (KeyDown) - -//----( Pattern Context [bottom] - Param Col (7) )------------ -7:1247:0:48:1 //FX Param digit 0: 0 (KeyDown) -7:1247:0:96:1 //FX Param digit 0: Num 0 (KeyDown) -7:1248:0:49:1 //FX Param digit 1: 1 (KeyDown) -7:1248:0:97:1 //FX Param digit 1: Num 1 (KeyDown) -7:1249:0:50:1 //FX Param digit 2: 2 (KeyDown) -7:1249:0:98:1 //FX Param digit 2: Num 2 (KeyDown) -7:1250:0:51:1 //FX Param digit 3: 3 (KeyDown) -7:1250:0:99:1 //FX Param digit 3: Num 3 (KeyDown) -7:1251:0:52:1 //FX Param digit 4: 4 (KeyDown) -7:1251:0:100:1 //FX Param digit 4: Num 4 (KeyDown) -7:1252:0:53:1 //FX Param digit 5: 5 (KeyDown) -7:1252:0:101:1 //FX Param digit 5: Num 5 (KeyDown) -7:1253:0:54:1 //FX Param digit 6: 6 (KeyDown) -7:1253:0:102:1 //FX Param digit 6: Num 6 (KeyDown) -7:1254:0:55:1 //FX Param digit 7: 7 (KeyDown) -7:1254:0:103:1 //FX Param digit 7: Num 7 (KeyDown) -7:1255:0:56:1 //FX Param digit 8: 8 (KeyDown) -7:1255:0:104:1 //FX Param digit 8: Num 8 (KeyDown) -7:1256:0:57:1 //FX Param digit 9: 9 (KeyDown) -7:1256:0:105:1 //FX Param digit 9: Num 9 (KeyDown) -7:1257:0:65:1 //FX Param digit A: A (KeyDown) -7:1258:0:66:1 //FX Param digit B: B (KeyDown) -7:1259:0:67:1 //FX Param digit C: C (KeyDown) -7:1260:0:68:1 //FX Param digit D: D (KeyDown) -7:1261:0:69:1 //FX Param digit E: E (KeyDown) -7:1262:0:70:1 //FX Param digit F: F (KeyDown) - -//----( Sample Context [bottom] (8) )------------ -8:1380:2:84:1 //Trim sample around loop points: Ctrl+T (KeyDown) -8:1383:0:8:1 //Silence sample selection: Backspace (KeyDown) -8:1385:3:65:1 //Amplify Sample: Shift+Ctrl+A (KeyDown) -8:1381:3:82:1 //Reverse sample: Shift+Ctrl+R (KeyDown) -8:1382:0:46:1 //Delete sample selection: Del (KeyDown) -8:1386:0:107:1 //Zoom Out: Num + (KeyDown) -8:1387:0:109:1 //Zoom In: Num - (KeyDown) - -//----( Instrument Context [bottom] (9) )------------ - -//----( Comments Context [bottom] (10) )------------ - -//----( Unknown Context (11) )------------ - -//----( Unknown Context (12) )------------ - -//----( Plugin GUI Context (13) )------------ - -//----( General Context [top] (14) )------------ - -//----( Pattern Context [top] (15) )------------ - -//----( Sample Context [top] (16) )------------ - -//----( Instrument Context [top] (17) )------------ - -//----( Comments Context [top] (18) )------------ - -//----( 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:1 //Decrease pattern index: NUM SUB (KeyDown) -19:1818:0:189:1 //Decrease pattern index: - (KeyDown) Added: trunk/OpenMPT/packageTemplate/extraKeymaps/US_mpt_classic_(nobuyuki).mkb =================================================================== --- trunk/OpenMPT/packageTemplate/extraKeymaps/US_mpt_classic_(nobuyuki).mkb (rev 0) +++ trunk/OpenMPT/packageTemplate/extraKeymaps/US_mpt_classic_(nobuyuki).mkb 2010-05-23 23:58:24 UTC (rev 608) @@ -0,0 +1,305 @@ +//-------- 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:1030:0:116:1 //Play song/Pause song: F5 (KeyDown) +0:1031:0:119:1 //Pause song: F8 (KeyDown) +0:1375:0:27:1 //Stop Song: Esc (KeyDown) +0:1029:0:117:1 //Play song from start: F6 (KeyDown) +0:1027:0:118:5 //Play pattern from start: F7 (KeyDown|KeyHold) +0:1026:2:118:5 //Play pattern from cursor: Ctrl+F7 (KeyDown|KeyHold) +0:1376:0:120:1 //Toggle Midi Record: F9 (KeyDown) +0:1359:2:90:1 //Undo: Ctrl+Z (KeyDown) +0:1360:2:88:1 //Cut: Ctrl+X (KeyDown) +0:1361:2:67:1 //Copy: Ctrl+C (KeyDown) +0:1361:2:45:1 //Copy: Ctrl+Insert (KeyDown) +0:1362:2:86:1 //Paste: Ctrl+V (KeyDown) +0:1362:1:45:1 //Paste: Shift+Insert (KeyDown) +0:1364:2:53:1 //SelectAll: Ctrl+5 (KeyDown) +0:1365:2:70:1 //Find: Ctrl+F (KeyDown) +0:1366:0:114:1 //Find Next: F3 (KeyDown) +0:1021:4:71:1 //View General: Alt+G (KeyDown) +0:1022:4:80:1 //View Pattern: Alt+P (KeyDown) +0:1023:4:83:1 //View Samples: Alt+S (KeyDown) +0:1024:4:78:1 //View Instruments: Alt+N (KeyDown) +0:1025:1:120:1 //View Comments: Shift+F9 (KeyDown) +0:1368:2:113:1 //Toggle Tree View: Ctrl+F2 (KeyDown) +0:1369:2:112:1 //View Options: Ctrl+F1 (KeyDown) +0:1370:0:112:1 //Help (to do): F1 (KeyDown) +0:1032:2:111:5 //Previous instrument: Ctrl+Num / (KeyDown|KeyHold) +0:1032:2:38:5 //Previous instrument: Ctrl+Up (KeyDown|KeyHold) +0:1033:2:106:5 //Next instrument: Ctrl+Num * (KeyDown|KeyHold) +0:1033:2:40:5 //Next instrument: Ctrl+Down (KeyDown|KeyHold) +0:1036:0:111:1 //Previous octave: Num / (KeyDown) +0:1037:0:106:1 //Next octave: Num * (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:1 //Jump down by measure: Alt+Page Down (KeyDown) +2:1018:4:33:1 //Jump up by measure: Alt+Page Up (KeyDown) +2:1338:0:34:5 //Jump down by beat: Page Down (KeyDown|KeyHold) +2:1339:0:33:5 //Jump up by beat: Page Up (KeyDown|KeyHold) +2:1340:6:34:5 //Snap down to beat: Ctrl+Alt+Page Down (KeyDown|KeyHold) +2:1341:6:33:5 //Snap up to beat: Ctrl+Alt+Page Up (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:1040:0:37:5 //Navigate left: Left (KeyDown|KeyHold) +2:1041:0:39:5 //Navigate right: Right (KeyDown|KeyHold) +2:1042:0:9:1 //Navigate to next channel: Tab (KeyDown) +2:1043:1:9:1 //Navigate to previous channel: Shift+Tab (KeyDown) +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+Shift (KeyDown) +2:1011:2:76:1 //Select channel / Select all: Ctrl+L (KeyDown) +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+Alt (KeyDown) +2:1685:2:9:1 //Switch to order list: Ctrl+Tab (KeyDown) +2:1662:6:80:1 //Toggle channel's plugin editor: Ctrl+Alt+P (KeyDown) +2:1062:0:93:1 //Show note properties: Application (KeyDown) +2: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: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:1:190:1 //Clear field: Shift+. (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: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:220:1 //Insert All Rows: Ctrl+\ (KeyDown) +2:1055:0:109:5 //Previous pattern: Num - (KeyDown|KeyHold) +2:1054:0:107:5 //Next pattern: Num + (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+Shift (KeyDown) +3:1667:0:192:1 //Note Cut (don't remember instrument): ` (KeyDown) +3:1668:0:187:1 //Note Off (don't remember instrument): = (KeyDown) + +//----( Pattern Context [bottom] - Ins Col (4) )------------ +4:1202:0:96:1 //Set instrument digit 0: Num 0 (KeyDown) +4:1202:0:48:1 //Set instrument digit 0: 0 (KeyDown) +4:1203:0:97:1 //Set instrument digit 1: Num 1 (KeyDown) +4:1203:0:49:1 //Set instrument digit 1: 1 (KeyDown) +4:1204:0:98:1 //Set instrument digit 2: Num 2 (KeyDown) +4:1204:0:50:1 //Set instrument digit 2: 2 (KeyDown) +4:1205:0:99:1 //Set instrument digit 3: Num 3 (KeyDown) +4:1205:0:51:1 //Set instrument digit 3: 3 (KeyDown) +4:1206:0:100:1 //Set instrument digit 4: Num 4 (KeyDown) +4:1206:0:52:1 //Set instrument digit 4: 4 (KeyDown) +4:1207:0:101:1 //Set instrument digit 5: Num 5 (KeyDown) +4:1207:0:53:1 //Set instrument digit 5: 5 (KeyDown) +4:1208:0:102:1 //Set instrument digit 6: Num 6 (KeyDown) +4:1208:0:54:1 //Set instrument digit 6: 6 (KeyDown) +4:1209:0:103:1 //Set instrument digit 7: Num 7 (KeyDown) +4:1209:0:55:1 //Set instrument digit 7: 7 (KeyDown) +4:1210:0:56:1 //Set instrument digit 8: 8 (KeyDown) +4:1211:0:105:1 //Set instrument digit 9: Num 9 (KeyDown) +4:1211:0:57:1 //Set instrument digit 9: 9 (KeyDown) + +//----( Pattern Context [bottom] - Vol Col (5) )------------ +5:1222:0:48:1 //Set volume digit 0: 0 (KeyDown) +5:1222:0:96:1 //Set volume digit 0: Num 0 (KeyDown) +5:1223:0:49:1 //Set volume digit 1: 1 (KeyDown) +5:1223:0:97:1 //Set volume digit 1: Num 1 (KeyDown) +5:1224:0:50:1 //Set volume digit 2: 2 (KeyDown) +5:1224:0:98:1 //Set volume digit 2: Num 2 (KeyDown) +5:1225:0:51:1 //Set volume digit 3: 3 (KeyDown) +5:1225:0:99:1 //Set volume digit 3: Num 3 (KeyDown) +5:1226:0:52:1 //Set volume digit 4: 4 (KeyDown) +5:1226:0:100:1 //Set volume digit 4: Num 4 (KeyDown) +5:1227:0:53:1 //Set volume digit 5: 5 (KeyDown) +5:1227:0:101:1 //Set volume digit 5: Num 5 (KeyDown) +5:1228:0:54:1 //Set volume digit 6: 6 (KeyDown) +5:1228:0:102:1 //Set volume digit 6: Num 6 (KeyDown) +5:1229:0:55:1 //Set volume digit 7: 7 (KeyDown) +5:1229:0:103:1 //Set volume digit 7: Num 7 (KeyDown) +5:1230:0:56:1 //Set volume digit 8: 8 (KeyDown) +5:1231:0:57:1 //Set volume digit 9: 9 (KeyDown) +5:1231:0:105:1 //Set volume digit 9: Num 9 (KeyDown) +5:1232:0:86:1 //Vol command - volume: V (KeyDown) +5:1233:0:80:1 //Vol command - pan: P (KeyDown) +5:1234:0:67:1 //Vol command - vol slide up: C (KeyDown) +5:1235:0:68:1 //Vol command - vol slide down: D (KeyDown) +5:1236:0:65:1 //Vol command - vol fine slide up: A (KeyDown) +5:1237:0:66:1 //Vol command - vol fine slide down: B (KeyDown) +5:1238:0:85:1 //Vol command - vibrato speed: U (KeyDown) +5:1239:0:72:1 //Vol command - vibrato: H (KeyDown) +5:1240:0:76:1 //Vol command - XM pan left: L (KeyDown) +5:1241:0:82:1 //Vol command - XM pan right: R (KeyDown) +5:1242:0:71:1 //Vol command - Portamento: G (KeyDown) +5:1243:0:70:1 //Vol command - Portamento Up: F (KeyDown) +5:1244:0:69:1 //Vol command - Portamento Down: E (KeyDown) +5: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 combined note delay and note cut: Shift+; (KeyDown) + +//----( Pattern Context [bottom] - Param Col (7) )------------ +7:1247:0:48:1 //FX Param digit 0: 0 (KeyDown) +7:1247:0:96:1 //FX Param digit 0: Num 0 (KeyDown) +7:1248:0:49:1 //FX Param digit 1: 1 (KeyDown) +7:1248:0:97:1 //FX Param digit 1: Num 1 (KeyDown) +7:1249:0:50:1 //FX Param digit 2: 2 (KeyDown) +7:1249:0:98:1 //FX Param digit 2: Num 2 (KeyDown) +7:1250:0:51:1 //FX Param digit 3: 3 (KeyDown) +7:1250:0:99:1 //FX Param digit 3: Num 3 (KeyDown) +7:1251:0:52:1 //FX Param digit 4: 4 (KeyDown) +7:1251:0:100:1 //FX Param digit 4: Num 4 (KeyDown) +7:1252:0:53:1 //FX Param digit 5: 5 (KeyDown) +7:1252:0:101:1 //FX Param digit 5: Num 5 (KeyDown) +7:1253:0:54:1 //FX Param digit 6: 6 (KeyDown) +7:1253:0:102:1 //FX Param digit 6: Num 6 (KeyDown) +7:1254:0:55:1 //FX Param digit 7: 7 (KeyDown) +7:1254:0:103:1 //FX Param digit 7: Num 7 (KeyDown) +7:1255:0:56:1 //FX Param digit 8: 8 (KeyDown) +7:1255:0:104:1 //FX Param digit 8: Num 8 (KeyDown) +7:1256:0:57:1 //FX Param digit 9: 9 (KeyDown) +7:1256:0:105:1 //FX Param digit 9: Num 9 (KeyDown) +7:1257:0:65:1 //FX Param digit A: A (KeyDown) +7:1258:0:66:1 //FX Param digit B: B (KeyDown) +7:1259:0:67:1 //FX Param digit C: C (KeyDown) +7:1260:0:68:1 //FX Param digit D: D (KeyDown) +7:1261:0:69:1 //FX Param digit E: E (KeyDown) +7:1262:0:70:1 //FX Param digit F: F (KeyDown) + +//----( Sample Context [bottom] (8) )------------ +8:1380:2:84:1 //Trim sample around loop points: Ctrl+T (KeyDown) +8:1383:0:8:1 //Silence sample selection: Backspace (KeyDown) +8:1385:3:65:1 //Amplify Sample: Shift+Ctrl+A (KeyDown) +8:1381:3:82:1 //Reverse sample: Shift+Ctrl+R (KeyDown) +8:1382:0:46:1 //Delete sample selection: Delete (KeyDown) +8:1386:0:107:1 //Zoom Out: Num + (KeyDown) +8:1387:0:109:1 //Zoom In: Num - (KeyDown) + +//----( Instrument Context [bottom] (9) )------------ + +//----( Comments Context [bottom] (10) )------------ + +//----( Unknown Context (11) )------------ + +//----( Unknown Context (12) )------------ + +//----( Plugin GUI Context (13) )------------ + +//----( General Context [top] (14) )------------ + +//----( Pattern Context [top] (15) )------------ + +//----( Sample Context [top] (16) )------------ + +//----( Instrument Context [top] (17) )------------ + +//----( Comments Context [top] (18) )------------ + +//----( 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 + (KeyDown|KeyHold) +19:1817:0:187:5 //Increase pattern index : = (KeyDown|KeyHold) +19:1818:0:109:5 //Decrease pattern index: Num - (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-05-29 12:29:50
|
Revision: 610 http://modplug.svn.sourceforge.net/modplug/?rev=610&view=rev Author: saga-games Date: 2010-05-29 12:29:26 +0000 (Sat, 29 May 2010) Log Message: ----------- [Mod] Updated installer script. [Mod] Added example songs to package template. Modified Paths: -------------- trunk/OpenMPT/installer/install.iss trunk/OpenMPT/installer/packageTemplate/readme.txt trunk/OpenMPT/packageTemplate/readme.txt Added Paths: ----------- trunk/OpenMPT/packageTemplate/ExampleSongs/ trunk/OpenMPT/packageTemplate/ExampleSongs/coda - control.it trunk/OpenMPT/packageTemplate/ExampleSongs/coda - doilies.it trunk/OpenMPT/packageTemplate/ExampleSongs/coda - silver gardener.it trunk/OpenMPT/packageTemplate/ExampleSongs/lsnk - meander.it trunk/OpenMPT/packageTemplate/ExampleSongs/nobuyuki - enlilsong1.it trunk/OpenMPT/packageTemplate/ExampleSongs/smh - on the moon.it trunk/OpenMPT/packageTemplate/ExampleSongs/xaimus - digital sentience.it trunk/OpenMPT/packageTemplate/ExampleSongs/xaimus - drunk in toronto.it Modified: trunk/OpenMPT/installer/install.iss =================================================================== --- trunk/OpenMPT/installer/install.iss 2010-05-24 17:07:27 UTC (rev 609) +++ trunk/OpenMPT/installer/install.iss 2010-05-29 12:29:26 UTC (rev 610) @@ -6,7 +6,7 @@ [Setup] AppId={{67903736-E9BB-4664-B148-F62BCAB4FA42} AppVerName=OpenMPT 1.18 -AppVersion=1.18.01.00 +AppVersion=1.18.02.00 AppName=OpenMPT AppPublisher=OpenMPT Devs / Olivier Lapicque AppPublisherURL=http://openmpt.com/ @@ -22,8 +22,9 @@ WizardImageFile=install-big.bmp WizardSmallImageFile=install-small.bmp CreateUninstallRegKey=not IsTaskSelected('portable') +;LicenseFile=license.txt +;The following setting is recommended by the Aero wizard guidelines. DisableWelcomePage=yes -;LicenseFile=license.txt [Tasks] ; icons and install mode @@ -38,8 +39,6 @@ Name: "english"; MessagesFile: "compiler:Default.isl" [Files] -; you may want to change the base paths here - ; note: packageTemplate\ contains files specific for the "install package". ; for files that are common with the "zip package", use ..\packageTemplate\ @@ -48,6 +47,9 @@ 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\ExampleSongs\*.*"; DestDir: "{app}\ExampleSongs\"; Flags: ignoreversion + Source: "packageTemplate\readme.txt"; DestDir: "{app}"; Flags: ignoreversion Source: "..\packageTemplate\history.txt"; DestDir: "{app}"; Flags: ignoreversion @@ -94,7 +96,7 @@ [Run] ; duh -Filename: "{app}\mptrack.exe"; Description: "{cm:LaunchProgram,OpenMPT}"; Flags: nowait postinstall skipifsilent +Filename: "{app}\mptrack.exe"; Parameters: """{app}\ExampleSongs\xaimus - digital sentience.it"""; Description: "{cm:LaunchProgram,OpenMPT}"; Flags: nowait postinstall skipifsilent [UninstallDelete] ; internet shortcut has to be deleted manually @@ -246,3 +248,7 @@ + + + + Modified: trunk/OpenMPT/installer/packageTemplate/readme.txt =================================================================== --- trunk/OpenMPT/installer/packageTemplate/readme.txt 2010-05-24 17:07:27 UTC (rev 609) +++ trunk/OpenMPT/installer/packageTemplate/readme.txt 2010-05-29 12:29:26 UTC (rev 610) @@ -37,6 +37,8 @@ Impulse Tracker) and country-specific layouts. soundtouch(folder): SoundTouch readme and copying.txt ReleaseNotesImages(folder): Images using in the release notes document. +ExampleSongs(folder): A set of module files which should give an impression of + what can be done in OpenMPT with only a few kilobytes. history.txt: Version history. mptrack.exe: Main executable. OpenMPT_SoundTouch_i16.dll: Slightly customized SoundTouch library used in time Property changes on: trunk/OpenMPT/packageTemplate/ExampleSongs ___________________________________________________________________ Added: tsvn:logminsize + 10 Added: trunk/OpenMPT/packageTemplate/ExampleSongs/coda - control.it =================================================================== (Binary files differ) Property changes on: trunk/OpenMPT/packageTemplate/ExampleSongs/coda - control.it ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Added: trunk/OpenMPT/packageTemplate/ExampleSongs/coda - doilies.it =================================================================== (Binary files differ) Property changes on: trunk/OpenMPT/packageTemplate/ExampleSongs/coda - doilies.it ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Added: trunk/OpenMPT/packageTemplate/ExampleSongs/coda - silver gardener.it =================================================================== (Binary files differ) Property changes on: trunk/OpenMPT/packageTemplate/ExampleSongs/coda - silver gardener.it ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Added: trunk/OpenMPT/packageTemplate/ExampleSongs/lsnk - meander.it =================================================================== (Binary files differ) Property changes on: trunk/OpenMPT/packageTemplate/ExampleSongs/lsnk - meander.it ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Added: trunk/OpenMPT/packageTemplate/ExampleSongs/nobuyuki - enlilsong1.it =================================================================== (Binary files differ) Property changes on: trunk/OpenMPT/packageTemplate/ExampleSongs/nobuyuki - enlilsong1.it ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Added: trunk/OpenMPT/packageTemplate/ExampleSongs/smh - on the moon.it =================================================================== (Binary files differ) Property changes on: trunk/OpenMPT/packageTemplate/ExampleSongs/smh - on the moon.it ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Added: trunk/OpenMPT/packageTemplate/ExampleSongs/xaimus - digital sentience.it =================================================================== (Binary files differ) Property changes on: trunk/OpenMPT/packageTemplate/ExampleSongs/xaimus - digital sentience.it ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Added: trunk/OpenMPT/packageTemplate/ExampleSongs/xaimus - drunk in toronto.it =================================================================== (Binary files differ) Property changes on: trunk/OpenMPT/packageTemplate/ExampleSongs/xaimus - drunk in toronto.it ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Modified: trunk/OpenMPT/packageTemplate/readme.txt =================================================================== --- trunk/OpenMPT/packageTemplate/readme.txt 2010-05-24 17:07:27 UTC (rev 609) +++ trunk/OpenMPT/packageTemplate/readme.txt 2010-05-29 12:29:26 UTC (rev 610) @@ -46,6 +46,8 @@ extraKeymaps(folder): soundtouch(folder): SoundTouch readme and copying.txt ReleaseNotesImages(folder): Images using in the release notes document. +ExampleSongs(folder): A set of module files which should give an impression of + what can be done in OpenMPT with only a few kilobytes. history.txt: Version history. mptrack.exe: Main executable. open_settings_folder.bat: Opens settings folder. This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <sag...@us...> - 2010-05-30 20:47:07
|
Revision: 612 http://modplug.svn.sourceforge.net/modplug/?rev=612&view=rev Author: saga-games Date: 2010-05-30 20:46:59 +0000 (Sun, 30 May 2010) Log Message: ----------- [Ref] Getting rid of the deprecated PatternSize[] array. Modified Paths: -------------- trunk/OpenMPT/mptrack/CleanupSong.cpp trunk/OpenMPT/mptrack/Ctrl_pat.cpp trunk/OpenMPT/mptrack/Draw_pat.cpp trunk/OpenMPT/mptrack/EffectVis.cpp trunk/OpenMPT/mptrack/Moddoc.cpp trunk/OpenMPT/mptrack/Modedit.cpp trunk/OpenMPT/mptrack/PatternGotoDialog.cpp trunk/OpenMPT/mptrack/Undo.cpp trunk/OpenMPT/mptrack/View_pat.cpp trunk/OpenMPT/mptrack/dlg_misc.cpp trunk/OpenMPT/mptrack/mod2midi.cpp trunk/OpenMPT/soundlib/LOAD_AMF.CPP trunk/OpenMPT/soundlib/Load_ams.cpp trunk/OpenMPT/soundlib/Load_it.cpp trunk/OpenMPT/soundlib/Load_mdl.cpp trunk/OpenMPT/soundlib/Load_mid.cpp trunk/OpenMPT/soundlib/Load_mod.cpp trunk/OpenMPT/soundlib/Load_s3m.cpp trunk/OpenMPT/soundlib/Load_xm.cpp trunk/OpenMPT/soundlib/ModSequence.cpp trunk/OpenMPT/soundlib/Snd_fx.cpp trunk/OpenMPT/soundlib/Sndfile.cpp trunk/OpenMPT/soundlib/Sndfile.h trunk/OpenMPT/soundlib/Sndmix.cpp Modified: trunk/OpenMPT/mptrack/CleanupSong.cpp =================================================================== --- trunk/OpenMPT/mptrack/CleanupSong.cpp 2010-05-30 20:42:33 UTC (rev 611) +++ trunk/OpenMPT/mptrack/CleanupSong.cpp 2010-05-30 20:46:59 UTC (rev 612) @@ -389,7 +389,7 @@ for (PATTERNINDEX nPat = maxpat; nPat < maxPatIndex; nPat++) if ((pSndFile->Patterns[nPat]) && (nPat >= nMinToRemove)) { MODCOMMAND *m = pSndFile->Patterns[nPat]; - UINT ncmd = pSndFile->m_nChannels * pSndFile->PatternSize[nPat]; + UINT ncmd = pSndFile->m_nChannels * pSndFile->Patterns[nPat].GetNumRows(); for (UINT i=0; i<ncmd; i++) { if ((m[i].note) || (m[i].instr) || (m[i].volcmd) || (m[i].command)) goto NotEmpty; @@ -474,7 +474,7 @@ pSndFile->m_lpszPatternNames = lpszoldpatnames; if (s[0]) pSndFile->SetPatternName(k, s); } - nPatRows[k] = pSndFile->PatternSize[i]; + nPatRows[k] = pSndFile->Patterns[i].GetNumRows(); pPatterns[k] = pSndFile->Patterns[i]; } else if (pSndFile->Patterns[i]) @@ -539,7 +539,7 @@ MODCOMMAND *p = pSndFile->Patterns[nPat]; if (p) { - UINT jmax = pSndFile->PatternSize[nPat] * pSndFile->m_nChannels; + UINT jmax = pSndFile->Patterns[nPat].GetNumRows() * pSndFile->m_nChannels; for (UINT j=0; j<jmax; j++, p++) { if ((p->note) && (p->note <= NOTE_MAX)) @@ -706,7 +706,7 @@ for (PATTERNINDEX nPat = 0; nPat < pSndFile->Patterns.Size(); nPat++) if (pSndFile->Patterns[nPat]) { MODCOMMAND *m = pSndFile->Patterns[nPat]; - for(UINT len = pSndFile->PatternSize[nPat] * pSndFile->m_nChannels; len; m++, len--) + for(UINT len = pSndFile->Patterns[nPat].GetNumRows() * pSndFile->m_nChannels; len; m++, len--) { if(m->instr <= pSndFile->m_nSamples) m->instr = (BYTE)nSampleMap[m->instr]; } @@ -813,7 +813,7 @@ for (PATTERNINDEX iPat = 0; iPat < pSndFile->Patterns.Size(); iPat++) if (pSndFile->Patterns[iPat]) { MODCOMMAND *p = pSndFile->Patterns[iPat]; - UINT nLen = pSndFile->m_nChannels * pSndFile->PatternSize[iPat]; + UINT nLen = pSndFile->m_nChannels * pSndFile->Patterns[iPat].GetNumRows(); while (nLen--) { if (p->instr) Modified: trunk/OpenMPT/mptrack/Ctrl_pat.cpp =================================================================== --- trunk/OpenMPT/mptrack/Ctrl_pat.cpp 2010-05-30 20:42:33 UTC (rev 611) +++ trunk/OpenMPT/mptrack/Ctrl_pat.cpp 2010-05-30 20:46:59 UTC (rev 612) @@ -783,7 +783,7 @@ ROWINDEX rows = 64; if ((pat < pSndFile->Patterns.Size()) && (pSndFile->Patterns[pat]) && (pSndFile->m_nType & (MOD_TYPE_XM|MOD_TYPE_IT|MOD_TYPE_MPT))) { - rows = pSndFile->PatternSize[pat]; + rows = pSndFile->Patterns[pat].GetNumRows(); rows = CLAMP(rows, pSndFile->GetModSpecifications().patternRowsMin, pSndFile->GetModSpecifications().patternRowsMax); } PATTERNINDEX nNewPat = m_pModDoc->InsertPattern(nCurOrd + 1, rows); @@ -824,7 +824,7 @@ ROWINDEX rows = 64; if (nCurPat < pSndFile->Patterns.Size() && pReplaceIndex[nCurPat] == PATTERNINDEX_INVALID) { - rows = pSndFile->PatternSize[nCurPat]; + rows = pSndFile->Patterns[nCurPat].GetNumRows(); rows = CLAMP(rows, pSndFile->GetModSpecifications().patternRowsMin, pSndFile->GetModSpecifications().patternRowsMax); PATTERNINDEX nNewPat = m_pModDoc->InsertPattern(nInsertWhere + i, rows); @@ -832,8 +832,8 @@ { MODCOMMAND *pSrc = pSndFile->Patterns[nCurPat]; MODCOMMAND *pDest = pSndFile->Patterns[nNewPat]; - UINT n = pSndFile->PatternSize[nCurPat]; - if (pSndFile->PatternSize[nNewPat] < n) n = pSndFile->PatternSize[nNewPat]; + UINT n = pSndFile->Patterns[nCurPat].GetNumRows(); + if (pSndFile->Patterns[nNewPat].GetNumRows() < n) n = pSndFile->Patterns[nNewPat].GetNumRows(); n *= pSndFile->m_nChannels; if (n) memcpy(pDest, pSrc, n * sizeof(MODCOMMAND)); bSuccess = true; Modified: trunk/OpenMPT/mptrack/Draw_pat.cpp =================================================================== --- trunk/OpenMPT/mptrack/Draw_pat.cpp 2010-05-30 20:42:33 UTC (rev 611) +++ trunk/OpenMPT/mptrack/Draw_pat.cpp 2010-05-30 20:46:59 UTC (rev 612) @@ -460,7 +460,7 @@ yofs = GetYScrollPos(); pSndFile = pModDoc->GetSoundFile(); nColumnWidth = m_szCell.cx; - nrows = (pSndFile->Patterns[m_nPattern]) ? pSndFile->PatternSize[m_nPattern] : 0; + nrows = (pSndFile->Patterns[m_nPattern]) ? pSndFile->Patterns[m_nPattern].GetNumRows() : 0; ncols = pSndFile->GetNumChannels(); xpaint = m_szHeader.cx; ypaint = rcClient.top; @@ -582,7 +582,7 @@ } if ((bPrevPatFound) && (nPrevPat < pSndFile->Patterns.Size()) && (pSndFile->Patterns[nPrevPat])) { - UINT nPrevRows = pSndFile->PatternSize[nPrevPat]; + UINT nPrevRows = pSndFile->Patterns[nPrevPat].GetNumRows(); UINT n = (nSkip < nPrevRows) ? nSkip : nPrevRows; ypaint += (nSkip-n)*m_szCell.cy; @@ -630,7 +630,7 @@ } if ((bNextPatFound) && (nNextPat < pSndFile->Patterns.Size()) && (pSndFile->Patterns[nNextPat])) { - UINT nNextRows = pSndFile->PatternSize[nNextPat]; + UINT nNextRows = pSndFile->Patterns[nNextPat].GetNumRows(); UINT n = ((UINT)nVisRows < nNextRows) ? nVisRows : nNextRows; m_Dib.SetBlendMode(0x80); @@ -1068,7 +1068,7 @@ y1 += dy; y2 += dy; nChannels = pSndFile->m_nChannels; - nRows = pSndFile->PatternSize[m_nPattern]; + nRows = pSndFile->Patterns[m_nPattern].GetNumRows(); if (x1 < GetXScrollPos()) bLeft = false; if (x1 >= nChannels) x1 = nChannels - 1; if (x1 < 0) { x1 = 0; c1 = 0; bLeft = false; } @@ -1149,7 +1149,7 @@ CSoundFile *pSndFile = pModDoc->GetSoundFile(); SIZE sizeTotal, sizePage, sizeLine; sizeTotal.cx = m_szHeader.cx + pSndFile->m_nChannels * m_szCell.cx; - sizeTotal.cy = m_szHeader.cy + pSndFile->PatternSize[m_nPattern] * m_szCell.cy; + sizeTotal.cy = m_szHeader.cy + pSndFile->Patterns[m_nPattern].GetNumRows() * m_szCell.cy; sizeLine.cx = m_szCell.cx; sizeLine.cy = m_szCell.cy; sizePage.cx = sizeLine.cx * 2; @@ -1375,7 +1375,7 @@ CSoundFile *pSndFile = pModDoc->GetSoundFile(); int yofs = GetYScrollPos() - m_nMidRow; if (n == -1) n = m_nRow; - if ((n < yofs) || (n >= (int)pSndFile->PatternSize[m_nPattern])) return; + if ((n < yofs) || (n >= (int)pSndFile->Patterns[m_nPattern].GetNumRows())) return; CRect rect; GetClientRect(&rect); rect.left = m_szHeader.cx; @@ -1431,7 +1431,7 @@ s[0] = 0; if ((!(m_dwStatus & (PATSTATUS_KEYDRAGSEL/*|PATSTATUS_MOUSEDRAGSEL*/))) //rewbs.xinfo: update indicator even when dragging && (m_dwBeginSel == m_dwEndSel) && (pSndFile->Patterns[m_nPattern]) - && (m_nRow < pSndFile->PatternSize[m_nPattern]) && (nChn < pSndFile->m_nChannels)) + && (m_nRow < pSndFile->Patterns[m_nPattern].GetNumRows()) && (nChn < pSndFile->m_nChannels)) { MODCOMMAND *m = &pSndFile->Patterns[m_nPattern][m_nRow*pSndFile->m_nChannels+nChn]; Modified: trunk/OpenMPT/mptrack/EffectVis.cpp =================================================================== --- trunk/OpenMPT/mptrack/EffectVis.cpp 2010-05-30 20:42:33 UTC (rev 611) +++ trunk/OpenMPT/mptrack/EffectVis.cpp 2010-05-30 20:46:59 UTC (rev 612) @@ -599,16 +599,16 @@ //Check pattern, start row and channel exist MODCOMMAND *pcmd = m_pSndFile->Patterns[m_nPattern]; - if (!pcmd || (m_startRow >= m_pSndFile->PatternSize[m_nPattern]) || (m_nChan >= m_pSndFile->m_nChannels)) + if (!pcmd || (m_startRow >= m_pSndFile->Patterns[m_nPattern].GetNumRows()) || (m_nChan >= m_pSndFile->m_nChannels)) { DoClose(); return; } //Check end exists - if ( (m_endRow >= m_pSndFile->PatternSize[m_nPattern]) ) + if ( (m_endRow >= m_pSndFile->Patterns[m_nPattern].GetNumRows()) ) { - m_endRow = m_pSndFile->PatternSize[m_nPattern]-1; + m_endRow = m_pSndFile->Patterns[m_nPattern].GetNumRows()-1; //ensure we still have some rows to process if (m_endRow <= m_startRow) { Modified: trunk/OpenMPT/mptrack/Moddoc.cpp =================================================================== --- trunk/OpenMPT/mptrack/Moddoc.cpp 2010-05-30 20:42:33 UTC (rev 611) +++ trunk/OpenMPT/mptrack/Moddoc.cpp 2010-05-30 20:46:59 UTC (rev 612) @@ -352,7 +352,7 @@ { m_SndFile.m_nType = MOD_TYPE_MOD; for (UINT i=0; i<m_SndFile.Patterns.Size(); i++) - if ((m_SndFile.Patterns[i]) && (m_SndFile.PatternSize[i] != 64)) + if ((m_SndFile.Patterns[i]) && (m_SndFile.Patterns[i].GetNumRows() != 64)) m_SndFile.m_nType = MOD_TYPE_XM; } break; @@ -1295,7 +1295,7 @@ UINT CModDoc::GetPatternSize(PATTERNINDEX nPat) const //--------------------------------------------------- { - if ((nPat < m_SndFile.Patterns.Size()) && (m_SndFile.Patterns[nPat])) return m_SndFile.PatternSize[nPat]; + if ((nPat < m_SndFile.Patterns.Size()) && (m_SndFile.Patterns[nPat])) return m_SndFile.Patterns[nPat].GetNumRows(); return 0; } @@ -3079,7 +3079,7 @@ if (pat >= m_SndFile.Patterns.Size()) { pat=0; } - if (row >= pSndFile->PatternSize[pat]) { + if (row >= pSndFile->Patterns[pat].GetNumRows()) { row=0; } //end rewbs.fix3185 Modified: trunk/OpenMPT/mptrack/Modedit.cpp =================================================================== --- trunk/OpenMPT/mptrack/Modedit.cpp 2010-05-30 20:42:33 UTC (rev 611) +++ trunk/OpenMPT/mptrack/Modedit.cpp 2010-05-30 20:46:59 UTC (rev 612) @@ -107,7 +107,7 @@ // Check if conversion to 64 rows is necessary for (UINT ipat=0; ipat<m_SndFile.Patterns.Size(); ipat++) { - if ((m_SndFile.Patterns[ipat]) && (m_SndFile.PatternSize[ipat] != 64)) b64++; + if ((m_SndFile.Patterns[ipat]) && (m_SndFile.Patterns[ipat].GetNumRows() != 64)) b64++; } if (((m_SndFile.m_nInstruments) || (b64)) && (nNewType & (MOD_TYPE_MOD|MOD_TYPE_S3M))) { @@ -126,12 +126,12 @@ // Resizing all patterns to 64 rows UINT nPatCvt = 0; UINT i = 0; - for (i=0; i<m_SndFile.Patterns.Size(); i++) if ((m_SndFile.Patterns[i]) && (m_SndFile.PatternSize[i] != 64)) + for (i=0; i<m_SndFile.Patterns.Size(); i++) if ((m_SndFile.Patterns[i]) && (m_SndFile.Patterns[i].GetNumRows() != 64)) { - if(m_SndFile.PatternSize[i] < 64) + if(m_SndFile.Patterns[i].GetNumRows() < 64) { // try to save short patterns by inserting a pattern break. - m_SndFile.TryWriteEffect(i, m_SndFile.PatternSize[i] - 1, CMD_PATTERNBREAK, 0, false, CHANNELINDEX_INVALID, false, true); + m_SndFile.TryWriteEffect(i, m_SndFile.Patterns[i].GetNumRows() - 1, CMD_PATTERNBREAK, 0, false, CHANNELINDEX_INVALID, false, true); } m_SndFile.Patterns[i].Resize(64, false); if (b64 < 5) @@ -180,7 +180,7 @@ UINT nChannel = m_SndFile.m_nChannels - 1; - for (UINT len = m_SndFile.PatternSize[nPat] * m_SndFile.m_nChannels; len; m++, len--) + for (UINT len = m_SndFile.Patterns[nPat].GetNumRows() * m_SndFile.m_nChannels; len; m++, len--) { nChannel = (nChannel + 1) % m_SndFile.m_nChannels; // 0...Channels - 1 @@ -466,14 +466,14 @@ for (UINT i=0; i<m_SndFile.Patterns.Size(); i++) if (m_SndFile.Patterns[i]) { MODCOMMAND *p = m_SndFile.Patterns[i]; - MODCOMMAND *newp = CSoundFile::AllocatePattern(m_SndFile.PatternSize[i], nNewChannels); + MODCOMMAND *newp = CSoundFile::AllocatePattern(m_SndFile.Patterns[i].GetNumRows(), nNewChannels); if (!newp) { END_CRITICAL(); AddToLog("ERROR: Not enough memory to create new channels!\nPattern Data is corrupted!\n"); return FALSE; } - for (UINT j=0; j<m_SndFile.PatternSize[i]; j++) + for (UINT j=0; j<m_SndFile.Patterns[i].GetNumRows(); j++) { memcpy(&newp[j*nNewChannels], &p[j*m_SndFile.m_nChannels], m_SndFile.m_nChannels*sizeof(MODCOMMAND)); } @@ -526,7 +526,7 @@ for (i=0; i<m_SndFile.Patterns.Size(); i++) if (m_SndFile.Patterns[i]) { MODCOMMAND *p = m_SndFile.Patterns[i]; - MODCOMMAND *newp = CSoundFile::AllocatePattern(m_SndFile.PatternSize[i], nRemainingChannels); + MODCOMMAND *newp = CSoundFile::AllocatePattern(m_SndFile.Patterns[i].GetNumRows(), nRemainingChannels); if (!newp) { END_CRITICAL(); @@ -534,7 +534,7 @@ return true; } MODCOMMAND *tmpsrc = p, *tmpdest = newp; - for (UINT j=0; j<m_SndFile.PatternSize[i]; j++) + for (UINT j=0; j<m_SndFile.Patterns[i].GetNumRows(); j++) { for (UINT k=0; k<m_SndFile.m_nChannels; k++, tmpsrc++) { @@ -579,7 +579,7 @@ for (UINT i=0; i<m_SndFile.Patterns.Size(); i++) if (m_SndFile.Patterns[i]) { MODCOMMAND *p = m_SndFile.Patterns[i]; - for (UINT j=m_SndFile.m_nChannels*m_SndFile.PatternSize[i]; j; j--, p++) if (p->instr) + for (UINT j=m_SndFile.m_nChannels*m_SndFile.Patterns[i].GetNumRows(); j; j--, p++) if (p->instr) { UINT instr = p->instr; UINT note = p->note; @@ -1039,7 +1039,7 @@ for (UINT row=0; row<nrows; row++) { MODCOMMAND *m = m_SndFile.Patterns[nPattern]; - if ((row + (dwBeginSel >> 16)) >= m_SndFile.PatternSize[nPattern]) break; + if ((row + (dwBeginSel >> 16)) >= m_SndFile.Patterns[nPattern].GetNumRows()) break; m += (row+(dwBeginSel >> 16))*m_SndFile.m_nChannels; m += (colmin >> 3); for (UINT col=0; col<ncols; col++, m++, p+=12) @@ -1184,7 +1184,7 @@ PATTERNINDEX pTemp; GetEditPosition(rTemp, pTemp, oCurrentOrder); - if ((nrow >= m_SndFile.PatternSize[nPattern]) || (ncol >= m_SndFile.m_nChannels)) goto PasteDone; + if ((nrow >= m_SndFile.Patterns[nPattern].GetNumRows()) || (ncol >= m_SndFile.m_nChannels)) goto PasteDone; m += nrow * m_SndFile.m_nChannels; // Search for signature @@ -1209,7 +1209,7 @@ startLen = len; startRow = nrow; - while ((nrow < m_SndFile.PatternSize[nPattern])) + while ((nrow < m_SndFile.Patterns[nPattern].GetNumRows())) { // Search for column separator or end of paste data while ((len + 11 >= dwMemSize) || p[len] != '|') @@ -1245,7 +1245,7 @@ // Before changing anything in this pattern, we have to create an undo point. if(bPrepareUndo) { - GetPatternUndo()->PrepareUndo(nPattern, 0, 0, m_SndFile.m_nChannels, m_SndFile.PatternSize[nPattern], !bFirstUndo); + GetPatternUndo()->PrepareUndo(nPattern, 0, 0, m_SndFile.m_nChannels, m_SndFile.Patterns[nPattern].GetNumRows(), !bFirstUndo); bPrepareUndo = false; bFirstUndo = false; } @@ -1257,7 +1257,7 @@ // push channel data below paste point first. if(pasteMode == pm_pushforwardpaste) { - for(ROWINDEX nPushRow = m_SndFile.PatternSize[nPattern] - 1 - nrow; nPushRow > 0; nPushRow--) + for(ROWINDEX nPushRow = m_SndFile.Patterns[nPattern].GetNumRows() - 1 - nrow; nPushRow > 0; nPushRow--) { m[col + nPushRow * m_SndFile.m_nChannels] = m[col + (nPushRow - 1) * m_SndFile.m_nChannels]; } @@ -1414,7 +1414,7 @@ // If Paste Flood is enabled, this won't be called due to obvious reasons. if(doOverflowPaste) { - while(nrow >= m_SndFile.PatternSize[nPattern]) + while(nrow >= m_SndFile.Patterns[nPattern].GetNumRows()) { nrow = 0; ORDERINDEX oNextOrder = m_SndFile.Order.GetNextOrderIgnoringSkips(oCurrentOrder); @@ -1618,7 +1618,7 @@ for (PATTERNINDEX ipat = 0; ipat < m_SndFile.Patterns.Size(); ipat++) if (m_SndFile.Patterns.IsValidPat(ipat)) { MODCOMMAND *p = m_SndFile.Patterns[ipat] + iRst; - UINT len = m_SndFile.PatternSize[ipat]; + UINT len = m_SndFile.Patterns[ipat].GetNumRows(); for (UINT idata = 0; idata < len; idata++, p += m_SndFile.m_nChannels) { if (!p->IsEmpty()) Modified: trunk/OpenMPT/mptrack/PatternGotoDialog.cpp =================================================================== --- trunk/OpenMPT/mptrack/PatternGotoDialog.cpp 2010-05-30 20:42:33 UTC (rev 611) +++ trunk/OpenMPT/mptrack/PatternGotoDialog.cpp 2010-05-30 20:46:59 UTC (rev 612) @@ -76,7 +76,7 @@ } //Does pattern have enough rows? - if (validated && m_pSndFile->PatternSize[m_nPattern] <= m_nRow) { + if (validated && m_pSndFile->Patterns[m_nPattern].GetNumRows() <= m_nRow) { validated=false; } Modified: trunk/OpenMPT/mptrack/Undo.cpp =================================================================== --- trunk/OpenMPT/mptrack/Undo.cpp 2010-05-30 20:42:33 UTC (rev 611) +++ trunk/OpenMPT/mptrack/Undo.cpp 2010-05-30 20:46:59 UTC (rev 612) @@ -50,7 +50,7 @@ UINT nRows; if (!pSndFile->Patterns.IsValidPat(pattern)) return false; - nRows = pSndFile->PatternSize[pattern]; + nRows = pSndFile->Patterns[pattern].GetNumRows(); pPattern = pSndFile->Patterns[pattern]; if ((y >= nRows) || (cx < 1) || (cy < 1) || (x >= pSndFile->m_nChannels)) return false; if (y + cy >= nRows) cy = nRows - y; @@ -68,7 +68,7 @@ } sUndo.pattern = pattern; - sUndo.patternsize = pSndFile->PatternSize[pattern]; + sUndo.patternsize = pSndFile->Patterns[pattern].GetNumRows(); sUndo.column = x; sUndo.row = y; sUndo.cx = cx; @@ -130,7 +130,7 @@ nRows = pUndo->patternsize; if(pUndo->column + pUndo->cx <= pSndFile->m_nChannels) { - if((!pSndFile->Patterns[nPattern]) || (pSndFile->PatternSize[nPattern] < nRows)) + if((!pSndFile->Patterns[nPattern]) || (pSndFile->Patterns[nPattern].GetNumRows() < nRows)) { MODCOMMAND *newPattern = CSoundFile::AllocatePattern(nRows, pSndFile->m_nChannels); MODCOMMAND *oldPattern = pSndFile->Patterns[nPattern]; Modified: trunk/OpenMPT/mptrack/View_pat.cpp =================================================================== --- trunk/OpenMPT/mptrack/View_pat.cpp 2010-05-30 20:42:33 UTC (rev 611) +++ trunk/OpenMPT/mptrack/View_pat.cpp 2010-05-30 20:46:59 UTC (rev 612) @@ -254,7 +254,7 @@ if (!pModDoc) return FALSE; pSndFile = pModDoc->GetSoundFile(); - if ((bWrap) && (pSndFile->PatternSize[m_nPattern])) + if ((bWrap) && (pSndFile->Patterns[m_nPattern].GetNumRows())) { if ((int)row < (int)0) { @@ -269,26 +269,26 @@ { const ORDERINDEX prevOrd = pSndFile->Order.GetPreviousOrderIgnoringSkips(nCurOrder); const PATTERNINDEX nPrevPat = pSndFile->Order[prevOrd]; - if ((nPrevPat < pSndFile->Patterns.Size()) && (pSndFile->PatternSize[nPrevPat])) + if ((nPrevPat < pSndFile->Patterns.Size()) && (pSndFile->Patterns[nPrevPat].GetNumRows())) { SendCtrlMessage(CTRLMSG_SETCURRENTORDER, prevOrd); if (SetCurrentPattern(nPrevPat)) - return SetCurrentRow(pSndFile->PatternSize[nPrevPat] + (int)row); + return SetCurrentRow(pSndFile->Patterns[nPrevPat].GetNumRows() + (int)row); } } row = 0; } else if (CMainFrame::m_dwPatternSetup & PATTERN_WRAP) { - if ((int)row < (int)0) row += pSndFile->PatternSize[m_nPattern]; - row %= pSndFile->PatternSize[m_nPattern]; + if ((int)row < (int)0) row += pSndFile->Patterns[m_nPattern].GetNumRows(); + row %= pSndFile->Patterns[m_nPattern].GetNumRows(); } } else //row >= 0 - if (row >= pSndFile->PatternSize[m_nPattern]) + if (row >= pSndFile->Patterns[m_nPattern].GetNumRows()) { if (m_dwStatus & (PATSTATUS_KEYDRAGSEL|PATSTATUS_MOUSEDRAGSEL)) { - row = pSndFile->PatternSize[m_nPattern]-1; + row = pSndFile->Patterns[m_nPattern].GetNumRows()-1; } else if (CMainFrame::m_dwPatternSetup & PATTERN_CONTSCROLL) { @@ -297,19 +297,19 @@ { const ORDERINDEX nextOrder = pSndFile->Order.GetNextOrderIgnoringSkips(nCurOrder); const PATTERNINDEX nextPat = pSndFile->Order[nextOrder]; - if ((nextPat < pSndFile->Patterns.Size()) && (pSndFile->PatternSize[nextPat])) + if ((nextPat < pSndFile->Patterns.Size()) && (pSndFile->Patterns[nextPat].GetNumRows())) { - const ROWINDEX newRow = row - pSndFile->PatternSize[m_nPattern]; + const ROWINDEX newRow = row - pSndFile->Patterns[m_nPattern].GetNumRows(); SendCtrlMessage(CTRLMSG_SETCURRENTORDER, nextOrder); if (SetCurrentPattern(nextPat)) return SetCurrentRow(newRow); } } - row = pSndFile->PatternSize[m_nPattern]-1; + row = pSndFile->Patterns[m_nPattern].GetNumRows()-1; } else if (CMainFrame::m_dwPatternSetup & PATTERN_WRAP) { - row %= pSndFile->PatternSize[m_nPattern]; + row %= pSndFile->Patterns[m_nPattern].GetNumRows(); } } } @@ -317,11 +317,11 @@ //rewbs.fix3168 if ( (static_cast<int>(row)<0) && !(CMainFrame::m_dwPatternSetup & PATTERN_CONTSCROLL)) row = 0; - if (row >= pSndFile->PatternSize[m_nPattern] && !(CMainFrame::m_dwPatternSetup & PATTERN_CONTSCROLL)) - row = pSndFile->PatternSize[m_nPattern]-1; + if (row >= pSndFile->Patterns[m_nPattern].GetNumRows() && !(CMainFrame::m_dwPatternSetup & PATTERN_CONTSCROLL)) + row = pSndFile->Patterns[m_nPattern].GetNumRows()-1; //end rewbs.fix3168 - if ((row >= pSndFile->PatternSize[m_nPattern]) || (!m_szCell.cy)) return FALSE; + if ((row >= pSndFile->Patterns[m_nPattern].GetNumRows()) || (!m_szCell.cy)) return FALSE; // Fix: If cursor isn't on screen move both scrollbars to make it visible InvalidateRow(); m_nRow = row; @@ -526,7 +526,7 @@ if (!bScroll) return TRUE; // Scroll to row row = dwPos >> 16; - if (row < (int)pSndFile->PatternSize[m_nPattern]) + if (row < (int)pSndFile->Patterns[m_nPattern].GetNumRows()) { row += m_nMidRow; rect.top += m_szHeader.cy; @@ -760,7 +760,7 @@ DWORD startSel = ((m_dwBeginSel>>16)<(m_dwEndSel>>16)) ? m_dwBeginSel : m_dwEndSel; DWORD endSel = ((m_dwBeginSel>>16)<(m_dwEndSel>>16)) ? m_dwEndSel : m_dwBeginSel; - pModDoc->GetPatternUndo()->PrepareUndo(m_nPattern, 0, 0, pSndFile->m_nChannels, pSndFile->PatternSize[m_nPattern]); + pModDoc->GetPatternUndo()->PrepareUndo(m_nPattern, 0, 0, pSndFile->m_nChannels, pSndFile->Patterns[m_nPattern].GetNumRows()); int finalDest = (startSel>>16)+((endSel>>16)-(startSel>>16))*2; for (int row=finalDest; row>(int)(startSel >> 16); row-=2) @@ -769,7 +769,7 @@ for (UINT i=(startSel & 0xFFFF); i<=(endSel & 0xFFFF); i++) if ((i & 7) < 5) { UINT chn = i >> 3; - if ((chn >= pSndFile->m_nChannels) || (row >= pSndFile->PatternSize[m_nPattern])) continue; + if ((chn >= pSndFile->m_nChannels) || (row >= pSndFile->Patterns[m_nPattern].GetNumRows())) continue; MODCOMMAND *dest = &p[row * pSndFile->m_nChannels + chn]; MODCOMMAND *src = &p[(row-offset/2) * pSndFile->m_nChannels + chn]; MODCOMMAND *blank= &p[(row-1) * pSndFile->m_nChannels + chn]; @@ -788,7 +788,7 @@ } m_dwBeginSel = startSel; - m_dwEndSel = (min(finalDest,pSndFile->PatternSize[m_nPattern]-1)<<16) | (endSel&0xFFFF); + m_dwEndSel = (min(finalDest,pSndFile->Patterns[m_nPattern].GetNumRows()-1)<<16) | (endSel&0xFFFF); InvalidatePattern(FALSE); pModDoc->SetModified(); @@ -810,7 +810,7 @@ DWORD startSel = ((m_dwBeginSel>>16)<(m_dwEndSel>>16))?m_dwBeginSel:m_dwEndSel; DWORD endSel = ((m_dwBeginSel>>16)<(m_dwEndSel>>16))?m_dwEndSel:m_dwBeginSel; - pModDoc->GetPatternUndo()->PrepareUndo(m_nPattern, 0, 0, pSndFile->m_nChannels, pSndFile->PatternSize[m_nPattern]); + pModDoc->GetPatternUndo()->PrepareUndo(m_nPattern, 0, 0, pSndFile->m_nChannels, pSndFile->Patterns[m_nPattern].GetNumRows()); int finalDest = (startSel>>16)+((endSel>>16)-(startSel>>16))/2; @@ -822,8 +822,8 @@ for (UINT i=(startSel & 0xFFFF); i<=(endSel & 0xFFFF); i++) if ((i & 7) < 5) { UINT chn = i >> 3; - if ((chn >= pSndFile->m_nChannels) || (srcRow >= pSndFile->PatternSize[m_nPattern]) - || (row >= pSndFile->PatternSize[m_nPattern])) continue; + if ((chn >= pSndFile->m_nChannels) || (srcRow >= pSndFile->Patterns[m_nPattern].GetNumRows()) + || (row >= pSndFile->Patterns[m_nPattern].GetNumRows())) continue; MODCOMMAND *dest = &p[row * pSndFile->m_nChannels + chn]; MODCOMMAND *src = &p[srcRow * pSndFile->m_nChannels + chn]; //memcpy(dest/*+(i%5)*/, src/*+(i%5)*/, /*sizeof(MODCOMMAND) - (i-chn)*/ sizeof(BYTE)); @@ -849,7 +849,7 @@ } } m_dwBeginSel = startSel; - m_dwEndSel = (min(finalDest,pSndFile->PatternSize[m_nPattern]-1)<<16) | (endSel& 0xFFFF); + m_dwEndSel = (min(finalDest,pSndFile->Patterns[m_nPattern].GetNumRows()-1)<<16) | (endSel& 0xFFFF); InvalidatePattern(FALSE); pModDoc->SetModified(); @@ -888,7 +888,7 @@ for (UINT i=(m_dwBeginSel & 0xFFFF); i<=(m_dwEndSel & 0xFFFF); i++) if ((i & 7) < 5) { // for all selected cols UINT chn = i >> 3; - if ((chn >= pSndFile->m_nChannels) || (row >= pSndFile->PatternSize[m_nPattern])) continue; + if ((chn >= pSndFile->m_nChannels) || (row >= pSndFile->Patterns[m_nPattern].GetNumRows())) continue; MODCOMMAND *m = &p[row * pSndFile->m_nChannels + chn]; switch(i & 7) { case 0: // Clear note @@ -1297,7 +1297,7 @@ if ((pModDoc) && (m_nPattern < pModDoc->GetSoundFile()->Patterns.Size())) { UINT row = dwPos >> 16; - UINT max = pModDoc->GetSoundFile()->PatternSize[m_nPattern]; + UINT max = pModDoc->GetSoundFile()->Patterns[m_nPattern].GetNumRows(); if ((row) && (row >= max)) row = max-1; dwPos &= 0xFFFF; dwPos |= (row << 16); @@ -1337,7 +1337,7 @@ if (pModDoc) { CSoundFile *pSndFile = pModDoc->GetSoundFile(); - SetCurSel(0, ((pSndFile->PatternSize[m_nPattern]-1) << 16) + SetCurSel(0, ((pSndFile->Patterns[m_nPattern].GetNumRows()-1) << 16) | ((pSndFile->m_nChannels - 1) << 3) | (4)); } @@ -1352,7 +1352,7 @@ { CSoundFile *pSndFile = pModDoc->GetSoundFile(); SetCurSel(m_nMenuParam & 0xFFF8, - ((pSndFile->PatternSize[m_nPattern]-1) << 16) + ((pSndFile->Patterns[m_nPattern].GetNumRows()-1) << 16) | ((m_nMenuParam & 0xFFF8)+4)); } } @@ -1366,7 +1366,7 @@ { CSoundFile *pSndFile = pModDoc->GetSoundFile(); DWORD dwBeginSel = m_dwCursor & 0xFFF8; - DWORD dwEndSel = ((pSndFile->PatternSize[m_nPattern]-1) << 16) | ((m_dwCursor & 0xFFF8)+4); + DWORD dwEndSel = ((pSndFile->Patterns[m_nPattern].GetNumRows()-1) << 16) | ((m_dwCursor & 0xFFF8)+4); // If column is already selected, select the current pattern if ((dwBeginSel == m_dwBeginSel) && (dwEndSel == m_dwEndSel)) { @@ -1533,7 +1533,7 @@ pSndFile = pModDoc->GetSoundFile(); if (!pSndFile->Patterns[m_nPattern]) return; row = m_dwBeginSel >> 16; - maxrow = pSndFile->PatternSize[m_nPattern]; + maxrow = pSndFile->Patterns[m_nPattern].GetNumRows(); if (colmax >= pSndFile->m_nChannels) colmax = pSndFile->m_nChannels-1; if (colmin > colmax) return; pModDoc->GetPatternUndo()->PrepareUndo(m_nPattern, 0,0, pSndFile->m_nChannels, maxrow); @@ -1599,7 +1599,7 @@ pSndFile = pModDoc->GetSoundFile(); if (!pSndFile->Patterns[m_nPattern]) return; row = m_dwBeginSel >> 16; - maxrow = pSndFile->PatternSize[m_nPattern]; + maxrow = pSndFile->Patterns[m_nPattern].GetNumRows(); if (colmax >= pSndFile->m_nChannels) colmax = pSndFile->m_nChannels-1; if (colmin > colmax) return; pModDoc->GetPatternUndo()->PrepareUndo(m_nPattern, 0,0, pSndFile->m_nChannels, maxrow); @@ -1639,7 +1639,7 @@ pSndFile = pModDoc->GetSoundFile(); if (!pSndFile->Patterns[m_nPattern]) return; row = m_nRow; - maxrow = pSndFile->PatternSize[m_nPattern]; + maxrow = pSndFile->Patterns[m_nPattern].GetNumRows(); colmin = (m_dwBeginSel & 0xFFFF) >> 3; colmax = (m_dwEndSel & 0xFFFF) >> 3; @@ -1780,7 +1780,7 @@ for (UINT nPat=nPatStart; nPat<nPatEnd; nPat++) { LPMODCOMMAND m = pSndFile->Patterns[nPat]; - DWORD len = pSndFile->m_nChannels * pSndFile->PatternSize[nPat]; + DWORD len = pSndFile->m_nChannels * pSndFile->Patterns[nPat].GetNumRows(); if ((!m) || (!len)) continue; UINT n = 0; if ((m_bContinueSearch) && (nPat == nPatStart) && (nPat == m_nPattern)) @@ -1995,7 +1995,7 @@ if ((pMainFrm) && (pModDoc)) { CSoundFile *pSndFile = pModDoc->GetSoundFile(); - if ((!pSndFile->PatternSize[m_nPattern]) || (!pSndFile->Patterns[m_nPattern])) return; + if ((!pSndFile->Patterns[m_nPattern].GetNumRows()) || (!pSndFile->Patterns[m_nPattern])) return; // Cut instrument/sample BEGIN_CRITICAL(); for (UINT i=pSndFile->m_nChannels; i<MAX_CHANNELS; i++) @@ -2015,7 +2015,7 @@ if (CMainFrame::m_dwPatternSetup & PATTERN_CONTSCROLL) SetCurrentRow(GetCurrentRow()+1, TRUE); else - SetCurrentRow((GetCurrentRow()+1) % pSndFile->PatternSize[m_nPattern], FALSE); + SetCurrentRow((GetCurrentRow()+1) % pSndFile->Patterns[m_nPattern].GetNumRows(), FALSE); SetFocus(); } } @@ -2029,7 +2029,7 @@ if (pModDoc) { CSoundFile *pSndFile = pModDoc->GetSoundFile(); - if ((!pSndFile->PatternSize[m_nPattern]) || (!pSndFile->Patterns[m_nPattern])) return; + if ((!pSndFile->Patterns[m_nPattern].GetNumRows()) || (!pSndFile->Patterns[m_nPattern])) return; MODCOMMAND *m = pSndFile->Patterns[m_nPattern] + m_nRow * pSndFile->m_nChannels + ((m_dwCursor & 0xFFFF) >> 3); switch(m_dwCursor & 7) { @@ -2332,7 +2332,7 @@ MODCOMMAND *pcmd = pSndFile->Patterns[m_nPattern]; if ((!pcmd) || (col0 > col1) || (col1 >= pSndFile->m_nChannels) - || (row0 > row1) || (row1 >= pSndFile->PatternSize[m_nPattern])) return FALSE; + || (row0 > row1) || (row1 >= pSndFile->Patterns[m_nPattern].GetNumRows())) return FALSE; PrepareUndo(m_dwBeginSel, m_dwEndSel); for (UINT row=row0; row <= row1; row++) { @@ -2369,7 +2369,7 @@ if ((pModDoc = GetDocument()) == NULL || !(IsEditingEnabled_bmsg())) return; pSndFile = pModDoc->GetSoundFile(); nChannels = pSndFile->m_nChannels; - nRows = pSndFile->PatternSize[m_nPattern]; + nRows = pSndFile->Patterns[m_nPattern].GetNumRows(); pOldPattern = pSndFile->Patterns[m_nPattern]; if ((nChannels < 1) || (nRows < 1) || (!pOldPattern)) return; dx = (int)((m_dwDragPos & 0xFFF8) >> 3) - (int)((m_dwStartSel & 0xFFF8) >> 3); @@ -2736,8 +2736,8 @@ ROWINDEX firstRow = (m_dwBeginSel >> 16), lastRow = (m_dwEndSel >> 16); firstChannel = CLAMP(firstChannel, 0, pSndFile->m_nChannels - 1); lastChannel = CLAMP(lastChannel, 0, pSndFile->m_nChannels - 1); - firstRow = CLAMP(firstRow, 0, pSndFile->PatternSize[m_nPattern] - 1); - lastRow = CLAMP(lastRow, 0, pSndFile->PatternSize[m_nPattern] - 1); + firstRow = CLAMP(firstRow, 0, pSndFile->Patterns[m_nPattern].GetNumRows() - 1); + lastRow = CLAMP(lastRow, 0, pSndFile->Patterns[m_nPattern].GetNumRows() - 1); for (CHANNELINDEX nChn = firstChannel; nChn <= lastChannel; nChn++) { @@ -2939,7 +2939,7 @@ if (nOrd < pSndFile->Order.size()) SendCtrlMessage(CTRLMSG_SETCURRENTORDER, nOrd); updateOrderList = false; } - if (nRow != m_nRow) SetCurrentRow((nRow < pSndFile->PatternSize[nPat]) ? nRow : 0, FALSE, FALSE); + if (nRow != m_nRow) SetCurrentRow((nRow < pSndFile->Patterns[nPat].GetNumRows()) ? nRow : 0, FALSE, FALSE); } SetPlayCursor(0xFFFF, 0); } else @@ -3385,7 +3385,7 @@ if (pModDoc) { CSoundFile *pSndFile = pModDoc->GetSoundFile(); - pModDoc->CopyPattern(m_nPattern, 0, ((pSndFile->PatternSize[m_nPattern]-1)<<16)|(pSndFile->m_nChannels<<3)); + pModDoc->CopyPattern(m_nPattern, 0, ((pSndFile->Patterns[m_nPattern].GetNumRows()-1)<<16)|(pSndFile->m_nChannels<<3)); } } break; @@ -4285,7 +4285,7 @@ if((m_nSpacing > 0) && (m_nSpacing <= MAX_SPACING)) { - if(nRow + m_nSpacing < pSndFile->PatternSize[nPat] || (CMainFrame::m_dwPatternSetup & PATTERN_CONTSCROLL)) + if(nRow + m_nSpacing < pSndFile->Patterns[nPat].GetNumRows() || (CMainFrame::m_dwPatternSetup & PATTERN_CONTSCROLL)) { SetCurrentRow(nRow + m_nSpacing, (CMainFrame::m_dwPatternSetup & PATTERN_CONTSCROLL) ? true: false); m_bLastNoteEntryBlocked=false; Modified: trunk/OpenMPT/mptrack/dlg_misc.cpp =================================================================== --- trunk/OpenMPT/mptrack/dlg_misc.cpp 2010-05-30 20:42:33 UTC (rev 611) +++ trunk/OpenMPT/mptrack/dlg_misc.cpp 2010-05-30 20:46:59 UTC (rev 612) @@ -53,7 +53,7 @@ // Find extension resolution (8 to 24 bits) UINT n = 1; - while(n < 4 && nCmdRow+n < pSndFile->PatternSize[nPat]){ + while(n < 4 && nCmdRow+n < pSndFile->Patterns[nPat].GetNumRows()){ i = (nCmdRow+n) * pSndFile->m_nChannels + nChannel; if(pSndFile->Patterns[nPat][i].command != CMD_XPARAM) break; n++; @@ -1032,7 +1032,7 @@ if ((pSndFile) && (m_nPattern < pSndFile->Patterns.Size()) && (combo)) { CHAR s[256]; - UINT nrows = pSndFile->PatternSize[m_nPattern]; + UINT nrows = pSndFile->Patterns[m_nPattern].GetNumRows(); // -> CODE#0008 // -> DESC="#define to set pattern size" @@ -1048,9 +1048,9 @@ combo->SetCurSel(nrows - specs.patternRowsMin); wsprintf(s, "Pattern #%d:\x0d\x0a %d row%s (%dK)", m_nPattern, - pSndFile->PatternSize[m_nPattern], - (pSndFile->PatternSize[m_nPattern] == 1) ? "" : "s", - (pSndFile->PatternSize[m_nPattern] * pSndFile->m_nChannels * sizeof(MODCOMMAND))/1024); + pSndFile->Patterns[m_nPattern].GetNumRows(), + (pSndFile->Patterns[m_nPattern].GetNumRows() == 1) ? "" : "s", + (pSndFile->Patterns[m_nPattern].GetNumRows() * pSndFile->m_nChannels * sizeof(MODCOMMAND))/1024); SetDlgItemText(IDC_TEXT1, s); } return TRUE; @@ -1193,7 +1193,7 @@ UINT nChannel = (dwCursor & 0xFFFF) >> 3; if ((nPat >= pSndFile->Patterns.Size()) || (!m_pModDoc) - || (nRow >= pSndFile->PatternSize[nPat]) || (nChannel >= pSndFile->m_nChannels) + || (nRow >= pSndFile->Patterns[nPat].GetNumRows()) || (nChannel >= pSndFile->m_nChannels) || (!pSndFile->Patterns[nPat])) return FALSE; m_Command = pSndFile->Patterns[nPat][nRow * pSndFile->m_nChannels + nChannel]; m_nRow = nRow; @@ -1237,7 +1237,7 @@ { CSoundFile *pSndFile = m_pModDoc->GetSoundFile(); if ((m_nPattern >= pSndFile->Patterns.Size()) || (!m_pModDoc) - || (m_nRow >= pSndFile->PatternSize[m_nPattern]) + || (m_nRow >= pSndFile->Patterns[m_nPattern].GetNumRows()) || (m_nChannel >= pSndFile->m_nChannels) || (!pSndFile->Patterns[m_nPattern])) return; MODCOMMAND *m = pSndFile->Patterns[m_nPattern]+m_nRow*pSndFile->m_nChannels+m_nChannel; @@ -1261,7 +1261,7 @@ { CSoundFile *pSndFile = m_pModDoc->GetSoundFile(); if ((m_nPattern >= pSndFile->Patterns.Size()) || (!m_pModDoc) - || (m_nRow >= pSndFile->PatternSize[m_nPattern]) + || (m_nRow >= pSndFile->Patterns[m_nPattern].GetNumRows()) || (m_nChannel >= pSndFile->m_nChannels) || (!pSndFile->Patterns[m_nPattern])) return; MODCOMMAND *m = pSndFile->Patterns[m_nPattern]+m_nRow*pSndFile->m_nChannels+m_nChannel; @@ -1284,7 +1284,7 @@ { CSoundFile *pSndFile = m_pModDoc->GetSoundFile(); if ((m_nPattern >= pSndFile->Patterns.Size()) || (!m_pModDoc) - || (m_nRow >= pSndFile->PatternSize[m_nPattern]) + || (m_nRow >= pSndFile->Patterns[m_nPattern].GetNumRows()) || (m_nChannel >= pSndFile->m_nChannels) || (!pSndFile->Patterns[m_nPattern])) return; MODCOMMAND *m = pSndFile->Patterns[m_nPattern]+m_nRow*pSndFile->m_nChannels+m_nChannel; Modified: trunk/OpenMPT/mptrack/mod2midi.cpp =================================================================== --- trunk/OpenMPT/mptrack/mod2midi.cpp 2010-05-30 20:42:33 UTC (rev 611) +++ trunk/OpenMPT/mptrack/mod2midi.cpp 2010-05-30 20:46:59 UTC (rev 612) @@ -424,7 +424,7 @@ { int pattern_break = -1; UINT nPat = m_pSndFile->Order[nOrder]; - if ((nPat >= m_pSndFile->Patterns.Size()) || (nPat == m_pSndFile->Order.GetIgnoreIndex()) || (!m_pSndFile->Patterns[nPat]) || (nRow >= m_pSndFile->PatternSize[nPat])) + if ((nPat >= m_pSndFile->Patterns.Size()) || (nPat == m_pSndFile->Order.GetIgnoreIndex()) || (!m_pSndFile->Patterns[nPat]) || (nRow >= m_pSndFile->Patterns[nPat].GetNumRows())) { nOrder++; nRow = 0; @@ -527,7 +527,7 @@ } else { nRow++; - if (nRow >= m_pSndFile->PatternSize[nPat]) + if (nRow >= m_pSndFile->Patterns[nPat].GetNumRows()) { nRow = 0; nOrder++; Modified: trunk/OpenMPT/soundlib/LOAD_AMF.CPP =================================================================== --- trunk/OpenMPT/soundlib/LOAD_AMF.CPP 2010-05-30 20:42:33 UTC (rev 611) +++ trunk/OpenMPT/soundlib/LOAD_AMF.CPP 2010-05-30 20:46:59 UTC (rev 612) @@ -385,7 +385,7 @@ // Create the patterns from the list of tracks for (UINT iPat=0; iPat<pfh->numorders; iPat++) { - MODCOMMAND *p = AllocatePattern(PatternSize[iPat], m_nChannels); + MODCOMMAND *p = AllocatePattern(Patterns[iPat].GetNumRows(), m_nChannels); if (!p) break; Patterns[iPat] = p; for (UINT iChn=0; iChn<m_nChannels; iChn++) @@ -399,7 +399,7 @@ realtrk--; if ((realtrk < realtrackcnt) && (pTrackData[realtrk])) { - AMF_Unpack(p+iChn, pTrackData[realtrk], PatternSize[iPat], m_nChannels); + AMF_Unpack(p+iChn, pTrackData[realtrk], Patterns[iPat].GetNumRows(), m_nChannels); } } } Modified: trunk/OpenMPT/soundlib/Load_ams.cpp =================================================================== --- trunk/OpenMPT/soundlib/Load_ams.cpp 2010-05-30 20:42:33 UTC (rev 611) +++ trunk/OpenMPT/soundlib/Load_ams.cpp 2010-05-30 20:46:59 UTC (rev 612) @@ -156,7 +156,7 @@ if (!m) return true; const BYTE *p = lpStream + dwMemPos; UINT row = 0, i = 0; - while ((row < PatternSize[iPat]) && (i+2 < len)) + while ((row < Patterns[iPat].GetNumRows()) && (i+2 < len)) { BYTE b0 = p[i++]; BYTE b1 = p[i++]; Modified: trunk/OpenMPT/soundlib/Load_it.cpp =================================================================== --- trunk/OpenMPT/soundlib/Load_it.cpp 2010-05-30 20:42:33 UTC (rev 611) +++ trunk/OpenMPT/soundlib/Load_it.cpp 2010-05-30 20:46:59 UTC (rev 612) @@ -700,7 +700,7 @@ // Free pattern if not empty if(Patterns[npat]) { FreePattern(Patterns[npat]); Patterns[npat] = NULL; } - // PatternSize[npat] + // Patterns[npat].GetNumRows() ASSERT_CAN_READ(4); memcpy(&id,lpStream+streamPos,sizeof(DWORD)); if(id > MAX_PATTERN_ROWS) return false; @@ -708,16 +708,16 @@ streamPos += sizeof(DWORD); // Try to allocate & read only sized patterns - if(PatternSize[npat]){ + if(Patterns[npat].GetNumRows()){ // Allocate pattern - if(Patterns.Insert(npat, PatternSize[npat])){ - streamPos += m_nChannels * PatternSize[npat] * n; + if(Patterns.Insert(npat, Patterns[npat].GetNumRows())){ + streamPos += m_nChannels * Patterns[npat].GetNumRows() * n; continue; } // Pattern data - long datasize = m_nChannels * PatternSize[npat] * n; + long datasize = m_nChannels * Patterns[npat].GetNumRows() * n; //if (streamPos+datasize<=dwMemLength) { if(Patterns[npat].ReadITPdata(lpStream, streamPos, datasize, dwMemLength)) { @@ -1728,11 +1728,11 @@ // patterns data content for(UINT npat=0; npat<MAX_PATTERNS; npat++){ // pattern size (number of rows) - id = Patterns[npat] ? PatternSize[npat] : 0; + id = Patterns[npat] ? Patterns[npat].GetNumRows() : 0; fwrite(&id, 1, sizeof(id), f); // pattern data - if(Patterns[npat] && PatternSize[npat]) Patterns[npat].WriteITPdata(f); - //fwrite(Patterns[npat], 1, m_nChannels * PatternSize[npat] * sizeof(MODCOMMAND_ORIGINAL), f); + if(Patterns[npat] && Patterns[npat].GetNumRows()) Patterns[npat].WriteITPdata(f); + //fwrite(Patterns[npat], 1, m_nChannels * Patterns[npat].GetNumRows() * sizeof(MODCOMMAND_ORIGINAL), f); } // Song lonely (instrument-less) samples @@ -2161,15 +2161,15 @@ if (!Patterns[npat]) continue; patpos[npat] = dwPos; patinfo[0] = 0; - patinfo[1] = PatternSize[npat]; + patinfo[1] = Patterns[npat].GetNumRows(); patinfo[2] = 0; patinfo[3] = 0; // Check for empty pattern - if (PatternSize[npat] == 64) + if (Patterns[npat].GetNumRows() == 64) { MODCOMMAND *pzc = Patterns[npat]; - UINT nz = PatternSize[npat] * m_nChannels; + UINT nz = Patterns[npat].GetNumRows() * m_nChannels; UINT iz = 0; for (iz=0; iz<nz; iz++) { @@ -2187,7 +2187,7 @@ memset(chnmask, 0xFF, sizeof(chnmask)); memset(lastvalue, 0, sizeof(lastvalue)); MODCOMMAND *m = Patterns[npat]; - for (UINT row=0; row<PatternSize[npat]; row++) + for (UINT row=0; row<Patterns[npat].GetNumRows(); row++) { UINT len = 0; for (UINT ch=0; ch<m_nChannels; ch++, m++) @@ -2760,14 +2760,14 @@ if (!Patterns[npat]) continue; patpos[npat] = dwPos; patinfo[0] = 0; - patinfo[1] = PatternSize[npat]; + patinfo[1] = Patterns[npat].GetNumRows(); patinfo[2] = 0; patinfo[3] = 0; // Check for empty pattern - if (PatternSize[npat] == 64) + if (Patterns[npat].GetNumRows() == 64) { MODCOMMAND *pzc = Patterns[npat]; - UINT nz = PatternSize[npat] * nChannels; + UINT nz = Patterns[npat].GetNumRows() * nChannels; UINT iz = 0; for (iz=0; iz<nz; iz++) { @@ -2785,7 +2785,7 @@ memset(chnmask, 0xFF, sizeof(chnmask)); memset(lastvalue, 0, sizeof(lastvalue)); MODCOMMAND *m = Patterns[npat]; - for (UINT row=0; row<PatternSize[npat]; row++) + for (UINT row=0; row<Patterns[npat].GetNumRows(); row++) { len = 0; for (UINT ch = 0; ch < m_nChannels; ch++, m++) Modified: trunk/OpenMPT/soundlib/Load_mdl.cpp =================================================================== --- trunk/OpenMPT/soundlib/Load_mdl.cpp 2010-05-30 20:42:33 UTC (rev 611) +++ trunk/OpenMPT/soundlib/Load_mdl.cpp 2010-05-30 20:46:59 UTC (rev 612) @@ -533,11 +533,11 @@ { for (UINT ipat=0; ipat<npatterns; ipat++) { - if ((Patterns[ipat] = AllocatePattern(PatternSize[ipat], m_nChannels)) == NULL) break; + if ((Patterns[ipat] = AllocatePattern(Patterns[ipat].GetNumRows(), m_nChannels)) == NULL) break; for (UINT chn=0; chn<m_nChannels; chn++) if ((patterntracks[ipat*32+chn]) && (patterntracks[ipat*32+chn] <= ntracks)) { MODCOMMAND *m = Patterns[ipat] + chn; - UnpackMDLTrack(m, m_nChannels, PatternSize[ipat], patterntracks[ipat*32+chn], lpStream+dwTrackPos); + UnpackMDLTrack(m, m_nChannels, Patterns[ipat].GetNumRows(), patterntracks[ipat*32+chn], lpStream+dwTrackPos); } } } Modified: trunk/OpenMPT/soundlib/Load_mid.cpp =================================================================== --- trunk/OpenMPT/soundlib/Load_mid.cpp 2010-05-30 20:42:33 UTC (rev 611) +++ trunk/OpenMPT/soundlib/Load_mid.cpp 2010-05-30 20:46:59 UTC (rev 612) @@ -628,7 +628,7 @@ // Allocate current pattern if not allocated yet if (!Patterns[pat]) { - Patterns[pat] = AllocatePattern(PatternSize[pat], m_nChannels); + Patterns[pat] = AllocatePattern(Patterns[pat].GetNumRows(), m_nChannels); if (!Patterns[pat]) break; } dwGlobalFlags |= MIDIGLOBAL_SONGENDED; @@ -1199,7 +1199,7 @@ } } - if ((++row) >= PatternSize[pat]) + if ((++row) >= Patterns[pat].GetNumRows()) { pat++; if (pat >= MAX_PATTERNS-1) break; Modified: trunk/OpenMPT/soundlib/Load_mod.cpp =================================================================== --- trunk/OpenMPT/soundlib/Load_mod.cpp 2010-05-30 20:42:33 UTC (rev 611) +++ trunk/OpenMPT/soundlib/Load_mod.cpp 2010-05-30 20:46:59 UTC (rev 612) @@ -542,7 +542,7 @@ { MODCOMMAND *m = Patterns[ipat]; for (UINT i=0; i<64; i++) { //for all rows - if (i < PatternSize[ipat]) { //if row exists + if (i < Patterns[ipat].GetNumRows()) { //if row exists LPBYTE p=s; for (UINT c=0; c<m_nChannels; c++,p+=4,m++) { Modified: trunk/OpenMPT/soundlib/Load_s3m.cpp =================================================================== --- trunk/OpenMPT/soundlib/Load_s3m.cpp 2010-05-30 20:42:33 UTC (rev 611) +++ trunk/OpenMPT/soundlib/Load_s3m.cpp 2010-05-30 20:46:59 UTC (rev 612) @@ -488,7 +488,7 @@ for(PATTERNINDEX nPat = 0; nPat < Patterns.Size(); nPat++) if(Patterns[nPat]) { MODCOMMAND *m = Patterns[nPat]; - for(UINT len = PatternSize[nPat] * m_nChannels; len; m++, len--) + for(UINT len = Patterns[nPat].GetNumRows() * m_nChannels; len; m++, len--) { if(m->command == CMD_MIDI) { @@ -642,7 +642,7 @@ { len = 2; MODCOMMAND *p = Patterns[i]; - for (UINT row=0; row<64; row++) if (row < PatternSize[i]) + for (UINT row=0; row<64; row++) if (row < Patterns[i].GetNumRows()) { for (UINT j=0; j<m_nChannels; j++) { Modified: trunk/OpenMPT/soundlib/Load_xm.cpp =================================================================== --- trunk/OpenMPT/soundlib/Load_xm.cpp 2010-05-30 20:42:33 UTC (rev 611) +++ trunk/OpenMPT/soundlib/Load_xm.cpp 2010-05-30 20:46:59 UTC (rev 612) @@ -829,9 +829,9 @@ memset(&xmph, 0, sizeof(xmph)); xmph[0] = 9; - xmph[5] = (BYTE)(PatternSize[i] & 0xFF); - xmph[6] = (BYTE)(PatternSize[i] >> 8); - for (UINT j = m_nChannels * PatternSize[i]; j > 0; j--, p++) + xmph[5] = (BYTE)(Patterns[i].GetNumRows() & 0xFF); + xmph[6] = (BYTE)(Patterns[i].GetNumRows() >> 8); + for (UINT j = m_nChannels * Patterns[i].GetNumRows(); j > 0; j--, p++) { // Don't write more than 32 channels if(bCompatibilityExport && m_nChannels - ((j - 1) % m_nChannels) > 32) continue; @@ -916,8 +916,8 @@ { memset(&xmph, 0, sizeof(xmph)); xmph[0] = 9; - xmph[5] = (BYTE)(PatternSize[i] & 0xFF); - xmph[6] = (BYTE)(PatternSize[i] >> 8); + xmph[5] = (BYTE)(Patterns[i].GetNumRows() & 0xFF); + xmph[6] = (BYTE)(Patterns[i].GetNumRows() >> 8); fwrite(xmph, 1, 9, f); } // Writing instruments Modified: trunk/OpenMPT/soundlib/ModSequence.cpp =================================================================== --- trunk/OpenMPT/soundlib/ModSequence.cpp 2010-05-30 20:42:33 UTC (rev 611) +++ trunk/OpenMPT/soundlib/ModSequence.cpp 2010-05-30 20:46:59 UTC (rev 612) @@ -448,7 +448,7 @@ if(m_pSndFile->Patterns.IsValidPat(copyPat)) { MODCOMMAND *m = m_pSndFile->Patterns[copyPat]; - for (UINT len = m_pSndFile->PatternSize[copyPat] * m_pSndFile->m_nChannels; len; m++, len--) + for (UINT len = m_pSndFile->Patterns[copyPat].GetNumRows() * m_pSndFile->m_nChannels; len; m++, len--) { if(m->command == CMD_POSITIONJUMP && m->param >= startOrd) { @@ -512,21 +512,21 @@ if(!m_pSndFile->Patterns.IsValidPat(nPat)) continue; MODCOMMAND *m = m_pSndFile->Patterns[nPat]; - for (UINT len = 0; len < m_pSndFile->PatternSize[nPat] * m_pSndFile->m_nChannels; m++, len++) + for (UINT len = 0; len < m_pSndFile->Patterns[nPat].GetNumRows() * m_pSndFile->m_nChannels; m++, len++) { if(m->command == CMD_POSITIONJUMP) { if(patternsFixed[nPat] != SEQUENCEINDEX_INVALID && patternsFixed[nPat] != removedSequences) { // Oops, some other sequence uses this pattern already. - const PATTERNINDEX nNewPat = m_pSndFile->Patterns.Insert(m_pSndFile->PatternSize[nPat]); + const PATTERNINDEX nNewPat = m_pSndFile->Patterns.Insert(m_pSndFile->Patterns[nPat].GetNumRows()); if(nNewPat != SEQUENCEINDEX_INVALID) { // could create new pattern - copy data over and continue from here. At(nFirstOrder + nOrd) = nNewPat; MODCOMMAND *pSrc = m_pSndFile->Patterns[nPat]; MODCOMMAND *pDest = m_pSndFile->Patterns[nNewPat]; - memcpy(pDest, pSrc, m_pSndFile->PatternSize[nPat] * m_pSndFile->m_nChannels * sizeof(MODCOMMAND)); + memcpy(pDest, pSrc, m_pSndFile->Patterns[nPat].GetNumRows() * m_pSndFile->m_nChannels * sizeof(MODCOMMAND)); m = pDest + len; patternsFixed.resize(max(nNewPat + 1, (PATTERNINDEX)patternsFixed.size()), SEQUENCEINDEX_INVALID); nPat = nNewPat; Modified: trunk/OpenMPT/soundlib/Snd_fx.cpp =================================================================== --- trunk/OpenMPT/soundlib/Snd_fx.cpp 2010-05-30 20:42:33 UTC (rev 611) +++ trunk/OpenMPT/soundlib/Snd_fx.cpp 2010-05-30 20:46:59 UTC (rev 612) @@ -163,7 +163,7 @@ continue; } // Should never happen - if (nRow >= PatternSize[nPattern]) + if (nRow >= Patterns[nPattern].GetNumRows()) nRow = 0; //Check whether target reached. @@ -179,7 +179,7 @@ // Update next position nNextRow = nRow + 1; - if (nNextRow >= PatternSize[nPattern]) + if (nNextRow >= Patterns[nPattern].GetNumRows()) { nNextPattern = nCurrentPattern + 1; nNextRow = 0; @@ -236,7 +236,7 @@ patternBreakOnThisRow=true; //Try to check next row for XPARAM nextRow = nullptr; - if (nRow < PatternSize[nPattern]-1) { + if (nRow < Patterns[nPattern].GetNumRows()-1) { nextRow = Patterns[nPattern] + (nRow+1) * m_nChannels + nChn; } if (nextRow && nextRow->command == CMD_XPARAM) { @@ -1652,7 +1652,7 @@ // -> CODE#0010 // -> DESC="add extended parameter mechanism to pattern effects" m = NULL; - if (m_nRow < PatternSize[m_nPattern]-1) { + if (m_nRow < Patterns[m_nPattern].GetNumRows()-1) { m = Patterns[m_nPattern] + (m_nRow+1) * m_nChannels + nChn; } if (m && m->command == CMD_XPARAM) { @@ -1927,7 +1927,7 @@ // Pattern Break case CMD_PATTERNBREAK: m = NULL; - if (m_nRow < PatternSize[m_nPattern]-1) { + if (m_nRow < Patterns[m_nPattern].GetNumRows()-1) { m = Patterns[m_nPattern] + (m_nRow+1) * m_nChannels + nChn; } if (m && m->command == CMD_XPARAM) { @@ -3239,12 +3239,12 @@ MODCOMMAND *m; m = NULL; - if(m_nRow < PatternSize[m_nPattern]-1) m = Patterns[m_nPattern] + (m_nRow+1) * m_nChannels + nChn; + if(m_nRow < Patterns[m_nPattern].GetNumRows()-1) m = Patterns[m_nPattern] + (m_nRow+1) * m_nChannels + nChn; if(m && m->command == CMD_XPARAM){ UINT tmp = m->param; m = NULL; - if(m_nRow < PatternSize[m_nPattern]-2) m = Patterns[m_nPattern] + (m_nRow+2) * m_nChannels + nChn; + if(m_nRow < Patterns[m_nPattern].GetNumRows()-2) m = Patterns[m_nPattern] + (m_nRow+2) * m_nChannels + nChn; if(m && m->command == CMD_XPARAM) param = (param<<16) + (tmp<<8) + m->param; else param = (param<<8) + tmp; @@ -3711,7 +3711,7 @@ const MODPATTERN& p = Patterns[nPat]; if (p) { - UINT len = PatternSize[nPat] * m_nChannels; + UINT len = Patterns[nPat].GetNumRows() * m_nChannels; UINT pos = (nOrd == nStartOrder) ? nStartRow : 0; pos *= m_nChannels; while (pos < len) @@ -3742,14 +3742,14 @@ // Treat only case with jumps in the same pattern if (nJumpOrder > nStartOrder) return TRUE; - if ((nJumpOrder < nStartOrder) || (nJumpRow >= PatternSize[nStartOrder]) + if ((nJumpOrder < nStartOrder) || (nJumpRow >= Patterns[nStartOrder].GetNumRows()) || (!(Patterns[nStartOrder])) || (nStartRow >= MAX_PATTERN_ROWS) || (nJumpRow >= MAX_PATTERN_ROWS)) return FALSE; // See if the pattern is being played backward BYTE row_hist[MAX_PATTERN_ROWS]; memset(row_hist, 0, sizeof(row_hist)); - UINT nRows = PatternSize[nStartOrder], row = nJumpRow; + UINT nRows = Patterns[nStartOrder].GetNumRows(), row = nJumpRow; if (nRows > MAX_PATTERN_ROWS) nRows = MAX_PATTERN_ROWS; row_hist[nStartRow] = TRUE; Modified: trunk/OpenMPT/soundlib/Sndfile.cpp =================================================================== --- trunk/OpenMPT/soundlib/Sndfile.cpp 2010-05-30 20:42:33 UTC (rev 611) +++ trunk/OpenMPT/soundlib/Sndfile.cpp 2010-05-30 20:46:59 UTC (rev 612) @@ -432,13 +432,7 @@ CTuning* MODINSTRUMENT::s_DefaultTuning = 0; -const ROWINDEX CPatternSizesMimic::operator [](const int i) const -//----------------------------------------------------------- -{ - return m_rSndFile.Patterns[i].GetNumRows(); -} - ////////////////////////////////////////////////////////// // CSoundFile @@ -448,7 +442,7 @@ CSoundFile::CSoundFile() : - PatternSize(*this), Patterns(*this), + Patterns(*this), Order(*this), m_PlaybackEventer(*this), m_pModSpecs(&ModSpecs::itEx), @@ -567,7 +561,7 @@ memset(m_MixPlugins, 0, sizeof(m_MixPlugins)); memset(&m_SongEQ, 0, sizeof(m_SongEQ)); ResetMidiCfg(); - //for (UINT npt=0; npt<Patterns.Size(); npt++) PatternSize[npt] = 64; + //for (UINT npt=0; npt<Patterns.Size(); npt++) Patterns[npt].GetNumRows() = 64; for (CHANNELINDEX nChn = 0; nChn < MAX_BASECHANNELS; nChn++) { InitChannel(nChn); @@ -1133,7 +1127,7 @@ while ((i < Order.size()) && (Order[i] != Order.GetInvalidPatIndex())) { - if (Order[i] < Patterns.Size()) max += PatternSize[Order[i]]; + if (Order[i] < Patterns.Size()) max += Patterns[Order[i]].GetNumRows(); i++; } return max; @@ -1146,7 +1140,7 @@ UINT pos = 0; for (UINT i=0; i<m_nCurrentPattern; i++) if (Order[i] < Patterns.Size()) - pos += PatternSize[Order[i]]; + pos += Patterns[Order[i]].GetNumRows(); return pos + m_nRow; } @@ -1192,14 +1186,14 @@ if (ord == Order.GetInvalidPatIndex()) break; if (ord < Patterns.Size()) { - if (nPos < (UINT)PatternSize[ord]) break; - nPos -= PatternSize[ord]; + if (nPos < (UINT)Patterns[ord].GetNumRows()) break; + nPos -= Patterns[ord].GetNumRows(); } } // Buggy position ? if ((nPattern >= Order.size()) || (Order[nPattern] >= Patterns.Size()) - || (nPos >= PatternSize[Order[nPattern]])) + || (nPos >= Patterns[Order[nPattern]].GetNumRows())) { nPos = 0; nPattern = 0; @@ -1208,7 +1202,7 @@ if ((nRow) && (Order[nPattern] < Patterns.Size())) { MODCOMMAND *p = Patterns[Order[nPattern]]; - if ((p) && (nRow < PatternSize[Order[nPattern]])) + if ((p) && (nRow < Patterns[Order[nPattern]].GetNumRows())) { BOOL bOk = FALSE; while ((!bOk) && (nRow > 0)) @@ -1380,7 +1374,7 @@ m_dwSongFlags &= ~SONG_PATTERNLOOP; } else { - if ((nRow < 0) || (nRow >= (int)PatternSize[nPat])) nRow = 0; + if ((nRow < 0) || (nRow >= (int)Patterns[nPat].GetNumRows())) nRow = 0; m_nPattern = nPat; m_nRow = m_nNextRow = nRow; m_nTickCount = m_nMusicSpeed; @@ -1396,7 +1390,7 @@ //---------------------------------------------------------------- { if ((nPat < 0) || (nPat >= Patterns.Size()) || (!Patterns[nPat])) nPat = 0; - if ((nRow < 0) || (nRow >= (int)PatternSize[nPat])) nRow = 0; + if ((nRow < 0) || (nRow >= (int)Patterns[nPat].GetNumRows())) nRow = 0; m_nPattern = nPat; m_nRow = m_nNextRow = nRow; m_nTickCount = m_nMusicSpeed; @@ -1620,7 +1614,7 @@ if (Patterns[nPat]) { MODCOMMAND *p = Patterns[nPat]; - MODCOMMAND *newp = CSoundFile::AllocatePattern(PatternSize[nPat], nRemainingChannels); + MODCOMMAND *newp = CSoundFile::AllocatePattern(Patterns[nPat].GetNumRows(), nRemainingChannels); if (!newp) { END_CRITICAL(); @@ -1628,7 +1622,7 @@ return 0; } MODCOMMAND *tmpsrc = p, *tmpdest = newp; - for (ROWINDEX nRow = 0; nRow<PatternSize[nPat]; nRow++) //Scrolling rows + for (ROWINDEX nRow = 0; nRow<Patterns[nPat].GetNumRows(); nRow++) //Scrolling rows { for (CHANNELINDEX nChn = 0; nChn < nRemainingChannels; nChn++, tmpdest++) //Scrolling channels. { @@ -2762,7 +2756,7 @@ for (UINT i=0; i<Patterns.Size(); i++) if (Patterns[i]) { MODCOMMAND *m = Patterns[i]; - for (UINT j=m_nChannels*PatternSize[i]; j; m++, j--) + for (UINT j=m_nChannels*Patterns[i].GetNumRows(); j; m++, j--) { if (m->instr == nSample && !m->IsPcNote()) return true; } @@ -2779,7 +2773,7 @@ for (UINT i=0; i<Patterns.Size(); i++) if (Patterns[i]) { MODCOMMAND *m = Patterns[i]; - for (UINT j=m_nChannels*PatternSize[i]; j; m++, j--) + for (UINT j=m_nChannels*Patterns[i].GetNumRows(); j; m++, j--) { if (m->instr == nInstr && !m->IsPcNote()) return true; } @@ -2802,7 +2796,7 @@ MODCOMMAND *p = Patterns[ipat]; if (p) { - UINT jmax = PatternSize[ipat] * m_nChannels; + UINT jmax = Patterns[ipat].GetNumRows() * m_nChannels; for (UINT j=0; j<jmax; j++, p++) { if ((p->note) && (p->note <= NOTE_MAX)) Modified: trunk/OpenMPT/soundlib/Sndfile.h =================================================================== --- trunk/OpenMPT/soundlib/Sndfile.h 2010-05-30 20:42:33 UTC (rev 611) +++ trunk/OpenMPT/soundlib/Sndfile.h 2010-05-30 20:46:59 UTC (rev 612) @@ -446,16 +446,6 @@ class CSoundFile; -//====================== -class CPatternSizesMimic -//====================== -{ -public: - const ROWINDEX operator[](const int i) const; - CPatternSizesMimic(const CSoundFile& csf) : m_rSndFile(csf) {} -private: - const CSoundFile& m_rSndFile; -}; //Note: These are bit indeces. MSF <-> Mod(Specific)Flag. //If changing these, ChangeModTypeTo() might need modification. @@ -592,7 +582,6 @@ MODCHANNEL Chn[MAX_CHANNELS]; // Channels MODCHANNELSETTINGS ChnSettings[MAX_BASECHANNELS]; // Channels settings CPatternContainer Patterns; // Patterns - CPatternSizesMimic PatternSize; // Mimics old PatternsSize-array(is read-only). ModSequenceSet Order; // Modsequences. Order[x] returns an index of a pattern located at order x. MODSAMPLE Samples[MAX_SAMPLES]; // Sample Headers MODINSTRUMENT *Instruments[MAX_INSTRUMENTS]; // Instrument Headers Modified: trunk/OpenMPT/soundlib/Sndmix.cpp =================================================================== --- trunk/OpenMPT/soundlib/Sndmix.cpp 2010-05-30 20:42:33 UTC (rev 611) +++ trunk/OpenMPT/soundlib/Sndmix.cpp 2010-05-30 20:46:59 UTC (rev 612) @@ -750,9 +750,9 @@ // Weird stuff? if ((m_nPattern >= Patterns.Size()) || (!Patterns[m_nPattern])) return FALSE; // Should never happen - if (m_nRow >= PatternSize[m_nPattern]) m_nRow = 0; + if (m_nRow >= Patterns[m_nPattern].GetNumRows()) m_nRow = 0; m_nNextRow = m_nRow + 1; - if (m_nNextRow >= PatternSize[m_nPattern]) + if (m_nNextRow >= Patterns[m_nPattern].GetNumRows()) { if (!(m_dwSongFlags & SONG_PATTERNLOOP)) m_nNextPattern = m_nCurrentPattern + 1; m_nNextRow = 0; @@ -1978,7 +1978,7 @@ // For now there is no difference between mute and sync mute with VSTis. if (pChn->dwFlags & (CHN_MUTE|CHN_SYNCMUTE)) return; if ((!m_nInstruments) || (m_nPattern >= Patterns.Size()) - || (m_nRow >= PatternSize[m_nPattern]) || (!Patterns[m_nPattern])) return; + || (m_nRow >= Patterns[m_nPattern].GetNumRows()) || (!Patterns[m_nPattern])) return; const MODCOMMAND::NOTE note = pChn->nRowNote; const MODCOMMAND::INSTR instr = pChn->nRowInstr; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <sag...@us...> - 2010-06-03 20:39:34
|
Revision: 614 http://modplug.svn.sourceforge.net/modplug/?rev=614&view=rev Author: saga-games Date: 2010-06-03 20:39:27 +0000 (Thu, 03 Jun 2010) Log Message: ----------- [Mod] Removed outdated mptrack.exe from repository. [Mod] Minor changes to install script. [Mod] Shuffled some lines in History.txt Modified Paths: -------------- trunk/OpenMPT/installer/install.iss trunk/OpenMPT/packageTemplate/History.txt Removed Paths: ------------- trunk/OpenMPT/mptrack/bin/mptrack.exe Modified: trunk/OpenMPT/installer/install.iss =================================================================== --- trunk/OpenMPT/installer/install.iss 2010-06-02 21:42:47 UTC (rev 613) +++ trunk/OpenMPT/installer/install.iss 2010-06-03 20:39:27 UTC (rev 614) @@ -5,7 +5,6 @@ ; ISPP is needed for automated version retrieval. ; To download and install ISPP, get the Inno Setup QuickStart Pack from http://www.jrsoftware.org/isdl.php#qsp -#include "Builtins.iss" #define GetAppVersion StringChange(GetFileProductVersion("..\mptrack\bin\mptrack.exe"), ",", ".") #define GetAppVersionShort Copy(GetAppVersion, 1, 4) @@ -251,15 +250,3 @@ end; end; end; - - - - - - - - - - - - Deleted: trunk/OpenMPT/mptrack/bin/mptrack.exe =================================================================== (Binary files differ) Modified: trunk/OpenMPT/packageTemplate/History.txt =================================================================== --- trunk/OpenMPT/packageTemplate/History.txt 2010-06-02 21:42:47 UTC (rev 613) +++ trunk/OpenMPT/packageTemplate/History.txt 2010-06-03 20:39:27 UTC (rev 614) @@ -130,11 +130,10 @@ [Fix] <Jojo> IT Compatibility: Default Vibrato/Tremolo/Panbrello waveform values to sine waveform if out of range (e.g. S35) IT/MPTM/ITP, Instrument extension handling: - [Fix] <Jojo> ITP Loader: Instruments flags in ITP files with embedded instrument headers were loaded wrong since revision 415. [Fix] <re> Fixes to instrument envelope flag handling (broken in 1.18.00.00). XM - [Imp] <Jojo> XM Loader: Improved detection of an old version of MPT. + [Imp] <Jojo> XM Loader: Improved detection of an old version of MPT (1.09?). [Fix] <Jojo> XM Loader: Some XMs not made with ModPlug were recognized as files made with MPT. [Fix] <Jojo> XM Loader: The last XM instrument was not always loaded. [Fix] <Jojo> XM Loader: Early versions of Skale Tracker (R.I.P.) apparently did stupid things to XM instrument headers, so mpt failed to load such modules. Tested the fix with a few hundred XMs and apparently only one XM (IFULOVE.XM) that I have has a header size that is different from the struct size - and that's the one that caused problems. @@ -169,6 +168,7 @@ MPTM [New] <rewbs> Added combined note delay & note cut command for MPTM only (":xy" means delay until tick x and play for y ticks). [New] <Jojo> MPTM command S7D explicitely enforces pitch envelope, S7E enforces filter envelope. + [Fix] <Jojo> MPTM Saving: A missing null pointer check crashed OpenMPT when trying to access a deleted instrument slot. Module cleanup [Imp] <Jojo> In the cleanup dialog, mutually exclusive items are now automatically unchecked, to avoid confusion. @@ -178,12 +178,12 @@ Wave Export [New] <Jojo> It is now also possible to render by instrument (i.e. one wave file per instrument). + [Imp] <Jojo> The "render by channel" mode ignores empty channels now. [Imp] <Jojo> When switching to another task and switching back to OpenMPT, it is now less likely that the infamous "OpenMPT does not respond" dialog from Windows occours. Misc [New] <Jojo> INI Settings: When portable mode is enabled, the most common paths in mptrack.ini are now translated to relative paths (if possible). Plugin paths are not translated to relative paths (yet). [New] <Jojo> Modules in gzip archives (single-file .gz archives) can now be imported, just to satisfy my laziness when downloading gzipped modules from Amiga Music Preservation. :-P - [Imp] <Jojo> The wave export "render by channel" mode ignores empty channels now. [Imp] <Jojo> Mod Loaders: Instead of creating messageboxes in various places, errors are now written to the log and one messagebox is shown for each file. [Imp] <Jojo> Binary files are now less often falsely recognized as early MOD files (15 samples without header): If the orderlist contains orderlist items > 128, loading is cancelled. [Imp] <Jojo> Song Properties: Tooltips are shown for various controls. @@ -191,7 +191,6 @@ [Reg] <rewbs> Removed old "velocity" volume command, which was experimental and unused. [Mod] <Jojo> Replaced default VU-meter colours for the MPT scheme by more pleasant colours that were already used for the other themes. [Mod] <Jojo> Updated internet links (ModPlug Central Forums link is now a permalink) - [Fix] <Jojo> MPTM Saving: A missing null pointer check crashed OpenMPT when trying to access a deleted instrument slot. [Fix] <Jojo> Multi window edit: When (un)muting a channel from the general tab in window 1, it was instantly shown in the pattern editor of window 2, but not vice versa. [Fix] <Jojo> Channel Manager: When removing channels using the channel manager, their names were not cleared properly. [Fix] <Jojo> Song Length Detection: *Much* more accurate song length detection! This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <sag...@us...> - 2010-06-05 12:45:34
|
Revision: 615 http://modplug.svn.sourceforge.net/modplug/?rev=615&view=rev Author: saga-games Date: 2010-06-05 12:45:27 +0000 (Sat, 05 Jun 2010) Log Message: ----------- [Ref] Quite a bit of refactoring... [Imp] To make the menus a bit more consistent, WAV and MP3 menu points are now also called "Export as" instead of "Save as". [Mod] Updated muParser vc2008 project file Modified Paths: -------------- trunk/OpenMPT/mptrack/CleanupSong.cpp trunk/OpenMPT/mptrack/CommandSet.cpp trunk/OpenMPT/mptrack/InputHandler.cpp trunk/OpenMPT/mptrack/Undo.cpp trunk/OpenMPT/mptrack/Undo.h trunk/OpenMPT/mptrack/Vstplug.cpp trunk/OpenMPT/muParser/build/msvc2008/muparser_muParser.vcproj trunk/OpenMPT/soundlib/Load_mo3.cpp trunk/OpenMPT/soundlib/Snd_fx.cpp trunk/OpenMPT/soundlib/Sndfile.cpp trunk/OpenMPT/soundlib/Sndfile.h trunk/OpenMPT/soundlib/Sndmix.cpp trunk/OpenMPT/soundlib/modcommand.h trunk/OpenMPT/soundlib/pattern.cpp Modified: trunk/OpenMPT/mptrack/CleanupSong.cpp =================================================================== --- trunk/OpenMPT/mptrack/CleanupSong.cpp 2010-06-03 20:39:27 UTC (rev 614) +++ trunk/OpenMPT/mptrack/CleanupSong.cpp 2010-06-05 12:45:27 UTC (rev 615) @@ -388,26 +388,32 @@ } for (PATTERNINDEX nPat = maxpat; nPat < maxPatIndex; nPat++) if ((pSndFile->Patterns[nPat]) && (nPat >= nMinToRemove)) { - MODCOMMAND *m = pSndFile->Patterns[nPat]; - UINT ncmd = pSndFile->m_nChannels * pSndFile->Patterns[nPat].GetNumRows(); - for (UINT i=0; i<ncmd; i++) + const MODCOMMAND *m = pSndFile->Patterns[nPat]; + bool bEmptyPat = true; + size_t ncmd = pSndFile->m_nChannels * pSndFile->Patterns[nPat].GetNumRows(); + for (size_t i = 0; i < ncmd; i++) { - if ((m[i].note) || (m[i].instr) || (m[i].volcmd) || (m[i].command)) goto NotEmpty; + if(m[i].IsEmpty()) + { + bEmptyPat = false; + break; + } } - pSndFile->Patterns.Remove(nPat); - nPatRemoved++; -NotEmpty: - ; + if(bEmptyPat) + { + pSndFile->Patterns.Remove(nPat); + nPatRemoved++; + } } - UINT bWaste = 0; + UINT nWaste = 0; for (UINT ichk=0; ichk < maxPatIndex; ichk++) { - if ((pSndFile->Patterns[ichk]) && (!bPatUsed[ichk])) bWaste++; + if ((pSndFile->Patterns[ichk]) && (!bPatUsed[ichk])) nWaste++; } - if ((bRemove) && (bWaste)) + if ((bRemove) && (nWaste)) { EndWaitCursor(); - wsprintf(s, "%d pattern%s present in file, but not used in the song\nDo you want to reorder the sequence list and remove these patterns?", bWaste, (bWaste == 1) ? "" : "s"); + wsprintf(s, "%d pattern%s present in file, but not used in the song\nDo you want to reorder the sequence list and remove these patterns?", nWaste, (nWaste == 1) ? "" : "s"); if (m_wParent->MessageBox(s, "Pattern Cleanup", MB_YESNO) != IDYES) return false; BeginWaitCursor(); } @@ -431,7 +437,7 @@ } } // Add unused patterns at the end - if ((!bRemove) || (!bWaste)) + if ((!bRemove) || (!nWaste)) { for(PATTERNINDEX iadd = 0; iadd < maxPatIndex; iadd++) { @@ -539,7 +545,7 @@ MODCOMMAND *p = pSndFile->Patterns[nPat]; if (p) { - UINT jmax = pSndFile->Patterns[nPat].GetNumRows() * pSndFile->m_nChannels; + UINT jmax = pSndFile->Patterns[nPat].GetNumRows() * pSndFile->GetNumChannels(); for (UINT j=0; j<jmax; j++, p++) { if ((p->note) && (p->note <= NOTE_MAX)) @@ -706,7 +712,7 @@ for (PATTERNINDEX nPat = 0; nPat < pSndFile->Patterns.Size(); nPat++) if (pSndFile->Patterns[nPat]) { MODCOMMAND *m = pSndFile->Patterns[nPat]; - for(UINT len = pSndFile->Patterns[nPat].GetNumRows() * pSndFile->m_nChannels; len; m++, len--) + for(UINT len = pSndFile->Patterns[nPat].GetNumRows() * pSndFile->GetNumChannels(); len; m++, len--) { if(m->instr <= pSndFile->m_nSamples) m->instr = (BYTE)nSampleMap[m->instr]; } Modified: trunk/OpenMPT/mptrack/CommandSet.cpp =================================================================== --- trunk/OpenMPT/mptrack/CommandSet.cpp 2010-06-03 20:39:27 UTC (rev 614) +++ trunk/OpenMPT/mptrack/CommandSet.cpp 2010-06-05 12:45:27 UTC (rev 615) @@ -1812,12 +1812,12 @@ commands[kcFileSaveAs].isDummy = false; commands[kcFileSaveAsWave].UID = 1351; - commands[kcFileSaveAsWave].Message = "File/Save as Wave"; + commands[kcFileSaveAsWave].Message = "File/Export as Wave"; commands[kcFileSaveAsWave].isHidden = false; commands[kcFileSaveAsWave].isDummy = false; commands[kcFileSaveAsMP3].UID = 1352; - commands[kcFileSaveAsMP3].Message = "File/Save as MP3"; + commands[kcFileSaveAsMP3].Message = "File/Export as MP3"; commands[kcFileSaveAsMP3].isHidden = false; commands[kcFileSaveAsMP3].isDummy = false; Modified: trunk/OpenMPT/mptrack/InputHandler.cpp =================================================================== --- trunk/OpenMPT/mptrack/InputHandler.cpp 2010-06-03 20:39:27 UTC (rev 614) +++ trunk/OpenMPT/mptrack/InputHandler.cpp 2010-06-05 12:45:27 UTC (rev 615) @@ -420,8 +420,8 @@ case ID_FILE_CLOSE: s="&Close\t"; c=kcFileClose; break; case ID_FILE_SAVE: s="&Save\t"; c=kcFileSave; break; case ID_FILE_SAVE_AS: s="Save &As...\t"; c=kcFileSaveAs; break; - case ID_FILE_SAVEASWAVE: s="Save as &Wave...\t"; c=kcFileSaveAsWave; break; - case ID_FILE_SAVEASMP3: s="Save as M&P3...\t"; c=kcFileSaveAsMP3; break; + case ID_FILE_SAVEASWAVE: s="Export as &Wave...\t"; c=kcFileSaveAsWave; break; + case ID_FILE_SAVEASMP3: s="Export as M&P3...\t"; c=kcFileSaveAsMP3; break; case ID_FILE_SAVEMIDI: s="Export as M&IDI...\t"; c=kcFileSaveMidi; break; case ID_FILE_SAVECOMPAT: s="Compatibility &Export...\t"; c=kcFileExportCompat; break; case ID_IMPORT_MIDILIB: s="Import &MIDI Library...\t"; c=kcFileImportMidiLib; break; Modified: trunk/OpenMPT/mptrack/Undo.cpp =================================================================== --- trunk/OpenMPT/mptrack/Undo.cpp 2010-06-03 20:39:27 UTC (rev 614) +++ trunk/OpenMPT/mptrack/Undo.cpp 2010-06-05 12:45:27 UTC (rev 615) @@ -33,13 +33,13 @@ // Create undo point. // Parameter list: // - pattern: Pattern of which an undo step should be created from. -// - x: first channel -// - y: first row -// - cx: width -// - cy: height -// - linkToPrevious: Don't create a separate undo step, but link this to the previous undo event. -bool CPatternUndo::PrepareUndo(PATTERNINDEX pattern, UINT x, UINT y, UINT cx, UINT cy, bool linkToPrevious) -//--------------------------------------------------------------------------------------------------------- +// - firstChn: first channel, 0-based. +// - firstRow: first row, 0-based. +// - numChns: width +// - numRows: height +// - linkToPrevious: Don't create a separate undo step, but link this to the previous undo event. Useful for commands that modify several patterns at once. +bool CPatternUndo::PrepareUndo(PATTERNINDEX pattern, CHANNELINDEX firstChn, ROWINDEX firstRow, CHANNELINDEX numChns, ROWINDEX numRows, bool linkToPrevious) +//--------------------------------------------------------------------------------------------------------------------------------------------------------- { if(m_pModDoc == nullptr) return false; CSoundFile *pSndFile = m_pModDoc->GetSoundFile(); @@ -47,16 +47,16 @@ PATTERNUNDOBUFFER sUndo; MODCOMMAND *pUndoData, *pPattern; - UINT nRows; + ROWINDEX nRows; if (!pSndFile->Patterns.IsValidPat(pattern)) return false; nRows = pSndFile->Patterns[pattern].GetNumRows(); pPattern = pSndFile->Patterns[pattern]; - if ((y >= nRows) || (cx < 1) || (cy < 1) || (x >= pSndFile->m_nChannels)) return false; - if (y + cy >= nRows) cy = nRows - y; - if (x + cx >= pSndFile->m_nChannels) cx = pSndFile->m_nChannels - x; + if ((firstRow >= nRows) || (numChns < 1) || (numRows < 1) || (firstChn >= pSndFile->m_nChannels)) return false; + if (firstRow + numRows >= nRows) numRows = nRows - firstRow; + if (firstChn + numChns >= pSndFile->m_nChannels) numChns = pSndFile->m_nChannels - firstChn; - pUndoData = new MODCOMMAND[cx * cy]; + pUndoData = new MODCOMMAND[numChns * numRows]; if (!pUndoData) return false; const bool bUpdate = !CanUndo(); // update undo status? @@ -69,17 +69,17 @@ sUndo.pattern = pattern; sUndo.patternsize = pSndFile->Patterns[pattern].GetNumRows(); - sUndo.column = x; - sUndo.row = y; - sUndo.cx = cx; - sUndo.cy = cy; + sUndo.firstChannel = firstChn; + sUndo.firstRow = firstRow; + sUndo.numChannels = numChns; + sUndo.numRows = numRows; sUndo.pbuffer = pUndoData; sUndo.linkToPrevious = linkToPrevious; - pPattern += x + y * pSndFile->m_nChannels; - for (UINT iy = 0; iy < cy; iy++) + pPattern += firstChn + firstRow * pSndFile->m_nChannels; + for(ROWINDEX iy = 0; iy < numRows; iy++) { - memcpy(pUndoData, pPattern, cx * sizeof(MODCOMMAND)); - pUndoData += cx; + memcpy(pUndoData, pPattern, numChns * sizeof(MODCOMMAND)); + pUndoData += numChns; pPattern += pSndFile->m_nChannels; } @@ -99,7 +99,7 @@ // Restore an undo point. Returns which pattern has been modified. -// linkedFromPrevious is true if a connected undo even is going to be deleted. +// linkedFromPrevious is true if a connected undo event is going to be deleted (can only be called internally). PATTERNINDEX CPatternUndo::Undo(bool linkedFromPrevious) //------------------------------------------------------ { @@ -128,7 +128,7 @@ nPattern = pUndo->pattern; nRows = pUndo->patternsize; - if(pUndo->column + pUndo->cx <= pSndFile->m_nChannels) + if(pUndo->firstChannel + pUndo->numChannels <= pSndFile->m_nChannels) { if((!pSndFile->Patterns[nPattern]) || (pSndFile->Patterns[nPattern].GetNumRows() < nRows)) { @@ -147,12 +147,12 @@ pUndoData = pUndo->pbuffer; pPattern = pSndFile->Patterns[nPattern]; if (!pSndFile->Patterns[nPattern]) return PATTERNINDEX_INVALID; - pPattern += pUndo->column + (pUndo->row * pSndFile->m_nChannels); - for(UINT iy = 0; iy < pUndo->cy; iy++) + pPattern += pUndo->firstChannel + (pUndo->firstRow * pSndFile->m_nChannels); + for(ROWINDEX iy = 0; iy < pUndo->numRows; iy++) { - memcpy(pPattern, pUndoData, pUndo->cx * sizeof(MODCOMMAND)); + memcpy(pPattern, pUndoData, pUndo->numChannels * sizeof(MODCOMMAND)); pPattern += pSndFile->m_nChannels; - pUndoData += pUndo->cx; + pUndoData += pUndo->numChannels; } } Modified: trunk/OpenMPT/mptrack/Undo.h =================================================================== --- trunk/OpenMPT/mptrack/Undo.h 2010-06-03 20:39:27 UTC (rev 614) +++ trunk/OpenMPT/mptrack/Undo.h 2010-06-05 12:45:27 UTC (rev 615) @@ -18,8 +18,8 @@ { PATTERNINDEX pattern; ROWINDEX patternsize; - UINT column, row; - UINT cx, cy; + CHANNELINDEX firstChannel, numChannels; + ROWINDEX firstRow, numRows; MODCOMMAND *pbuffer; bool linkToPrevious; }; @@ -42,7 +42,7 @@ // Pattern undo functions void ClearUndo(); - bool PrepareUndo(PATTERNINDEX pattern, UINT x, UINT y, UINT cx, UINT cy, bool linkToPrevious = false); + bool PrepareUndo(PATTERNINDEX pattern, CHANNELINDEX firstChn, ROWINDEX firstRow, CHANNELINDEX numChns, ROWINDEX numRows, bool linkToPrevious = false); PATTERNINDEX Undo(); bool CanUndo(); void RemoveLastUndoStep(); @@ -69,7 +69,7 @@ // We will differentiate between different types of undo actions so that we don't have to copy the whole sample everytime. enum sampleUndoTypes { - sundo_none = 0, // no changes to sample itself, e.g. loop point update + sundo_none, // no changes to sample itself, e.g. loop point update sundo_update, // silence, amplify, normalize, dc offset - update complete sample section sundo_delete, // delete part of the sample sundo_invert, // invert sample phase, apply again to undo Modified: trunk/OpenMPT/mptrack/Vstplug.cpp =================================================================== --- trunk/OpenMPT/mptrack/Vstplug.cpp 2010-06-03 20:39:27 UTC (rev 614) +++ trunk/OpenMPT/mptrack/Vstplug.cpp 2010-06-05 12:45:27 UTC (rev 615) @@ -2828,73 +2828,13 @@ //rewbs.smoothVST UINT CVstPlugin::GetZxxParameter(UINT nParam) -//-------------------------------------------------------- +//------------------------------------------- { return (UINT) (GetParameter(nParam) * 127.0f+0.5f); } //end rewbs.smoothVST -//rewbs.VSTCompliance: not keeping Eric's preset load/save -// code as he is not using the standard fxp format. -/* -// -> CODE#0002 -// -> DESC="VST plugins presets" -BOOL CVstPlugin::SavePreset(LPCSTR lpszFileName) -{ - FILE *f; - UINT nParams = (m_pEffect->numParams > 0) ? m_pEffect->numParams : 0; - - if((!lpszFileName) || (!nParams) || ((f = fopen(lpszFileName, "wb")) == NULL)) return FALSE; - - CHAR name[256]; - if(!GetDefaultEffectName(&name[0])) wsprintf(&name[0],"unknown"); - - DWORD nLen = strlen(name) + 1; - fwrite(&nLen, 1, sizeof(DWORD), f); // name string length - fwrite(&name[0], 1, nLen, f); // name string - nLen = nParams; - fwrite(&nLen, 1, sizeof(DWORD), f); // number of params - - for(UINT i=0; i<nParams; i++){ - FLOAT p = GetParameter(i); - fwrite(&p, 1, sizeof(FLOAT), f); // i'th param - } - - fclose(f); - return TRUE; -} - -BOOL CVstPlugin::LoadPreset(LPCSTR lpszFileName) -{ - FILE *f; - UINT nParams = (m_pEffect->numParams > 0) ? m_pEffect->numParams : 0; - - if((!lpszFileName) || ((f = fopen(lpszFileName, "r")) == NULL)) return FALSE; - - FLOAT p; - DWORD nLen; - CHAR name[256]; - CHAR ename[256]; - - fread(&nLen, 1, sizeof(DWORD), f); // name string length - fread(&name[0], 1, nLen, f); // name string - fread(&nLen, 1, sizeof(DWORD), f); // number of params - - if(!GetDefaultEffectName(&ename[0])) wsprintf(&ename[0],"unknown"); - if(strcmp(name,ename) != 0 || nLen != nParams) { fclose(f); return FALSE; } - - for(UINT i=0; i<nParams; i++){ - fread(&p, 1, sizeof(FLOAT), f); // i'th param - SetParameter(i, p); - } - - fclose(f); - return TRUE; -} -// -! NEW_FEATURE#0002 -*/ - void CVstPlugin::SaveAllParameters() //---------------------------------- { @@ -3097,15 +3037,13 @@ bool CVstPlugin::Bypass(bool bypass) //----------------------------------- { - if (bypass) { + if (bypass) m_pMixStruct->Info.dwInputRouting |= MIXPLUG_INPUTF_BYPASS; - } else { - m_pMixStruct->Info.dwInputRouting &=~ MIXPLUG_INPUTF_BYPASS; - } + else + m_pMixStruct->Info.dwInputRouting &= ~MIXPLUG_INPUTF_BYPASS; - if (m_pModDoc) { + if (m_pModDoc) m_pModDoc->UpdateAllViews(NULL, HINT_MIXPLUGINS, NULL); - } return bypass; } Modified: trunk/OpenMPT/muParser/build/msvc2008/muparser_muParser.vcproj =================================================================== --- trunk/OpenMPT/muParser/build/msvc2008/muparser_muParser.vcproj 2010-06-03 20:39:27 UTC (rev 614) +++ trunk/OpenMPT/muParser/build/msvc2008/muparser_muParser.vcproj 2010-06-05 12:45:27 UTC (rev 615) @@ -216,7 +216,7 @@ BufferSecurityCheck="true" RuntimeTypeInfo="true" ObjectFile="obj\vc_static_dbg\muParser\" - ProgramDataBaseFileName="..\..\lib\muparserd.pdb" + ProgramDataBaseFileName="..\..\lib\muparser.pdb" WarningLevel="4" SuppressStartupBanner="true" DebugInformationFormat="3" @@ -235,7 +235,7 @@ /> <Tool Name="VCLibrarianTool" - OutputFile="..\..\lib\muparserd.lib" + OutputFile="..\..\lib\muparser.lib" SuppressStartupBanner="true" /> <Tool Modified: trunk/OpenMPT/soundlib/Load_mo3.cpp =================================================================== --- trunk/OpenMPT/soundlib/Load_mo3.cpp 2010-06-03 20:39:27 UTC (rev 614) +++ trunk/OpenMPT/soundlib/Load_mo3.cpp 2010-06-05 12:45:27 UTC (rev 615) @@ -34,15 +34,15 @@ if(lpStream[3] > 31) return false; #ifdef MODPLUG_TRACKER - if(m_pModDoc != nullptr) m_pModDoc->AddToLog(GetStrI18N(__TEXT("The file appears to be a MO3 file, but this OpenMPT build does not support loading MO3 files."))); + if(m_pModDoc != nullptr) m_pModDoc->AddToLog(GetStrI18N(_TEXT("The file appears to be a MO3 file, but this OpenMPT build does not support loading MO3 files."))); #endif // MODPLUG_TRACKER return false; #else - bool b_result = false; // result of trying to load the module, false == fail. + bool bResult = false; // result of trying to load the module, false == fail. int iLen = static_cast<int>(dwMemLength); - void ** mo3Stream = (void **)&lpStream; + void **mo3Stream = (void **)&lpStream; // try to load unmo3.dll dynamically. HMODULE unmo3 = LoadLibrary(_TEXT("unmo3.dll")); @@ -54,24 +54,26 @@ } else //case: dll loaded succesfully. { - UNMO3_DECODE UNMO3_Decode = (UNMO3_DECODE)GetProcAddress(unmo3, "UNMO3_Decode"); - UNMO3_FREE UNMO3_Free = (UNMO3_FREE)GetProcAddress(unmo3, "UNMO3_Free"); + UNMO3_DECODE UNMO3_Decode = (UNMO3_DECODE)GetProcAddress(unmo3, _TEXT("UNMO3_Decode")); + UNMO3_FREE UNMO3_Free = (UNMO3_FREE)GetProcAddress(unmo3, _TEXT("UNMO3_Free")); - if(UNMO3_Decode != NULL && UNMO3_Free != NULL) { - if(UNMO3_Decode(mo3Stream, &iLen) == 0) { + if(UNMO3_Decode != NULL && UNMO3_Free != NULL) + { + if(UNMO3_Decode(mo3Stream, &iLen) == 0) + { /* if decoding was successful, mo3Stream and iLen will keep the new pointers now. */ if(iLen > 0) { - b_result = true; + bResult = true; if ((!ReadXM((const BYTE *)*mo3Stream, (DWORD)iLen)) && (!ReadIT((const BYTE *)*mo3Stream, (DWORD)iLen)) && (!ReadS3M((const BYTE *)*mo3Stream, (DWORD)iLen)) #ifndef FASTSOUNDLIB && (!ReadMTM((const BYTE *)*mo3Stream, (DWORD)iLen)) - #endif - && (!ReadMod((const BYTE *)*mo3Stream, (DWORD)iLen))) b_result = false; + #endif // FASTSOUNDLIB + && (!ReadMod((const BYTE *)*mo3Stream, (DWORD)iLen))) bResult = false; } UNMO3_Free(*mo3Stream); @@ -79,8 +81,6 @@ } FreeLibrary(unmo3); } - return b_result; + return bResult; #endif // NO_MO3_SUPPORT } - - Modified: trunk/OpenMPT/soundlib/Snd_fx.cpp =================================================================== --- trunk/OpenMPT/soundlib/Snd_fx.cpp 2010-06-03 20:39:27 UTC (rev 614) +++ trunk/OpenMPT/soundlib/Snd_fx.cpp 2010-06-05 12:45:27 UTC (rev 615) @@ -1868,7 +1868,7 @@ // Set Channel Global Volume case CMD_CHANNELVOLUME: - if (m_nTickCount) break; + if ((m_dwSongFlags & SONG_FIRSTTICK) == 0) break; if (param <= 64) { pChn->nGlobalVol = param; @@ -1913,7 +1913,8 @@ // Position Jump case CMD_POSITIONJUMP: nPosJump = param; - if((m_dwSongFlags & SONG_PATTERNLOOP && m_nSeqOverride == 0)) { + if((m_dwSongFlags & SONG_PATTERNLOOP && m_nSeqOverride == 0)) + { m_nSeqOverride = param + 1; //Releasing pattern loop after position jump could cause //instant jumps - modifying behavior so that now position jumps @@ -1927,16 +1928,20 @@ // Pattern Break case CMD_PATTERNBREAK: m = NULL; - if (m_nRow < Patterns[m_nPattern].GetNumRows()-1) { + if (m_nRow < Patterns[m_nPattern].GetNumRows()-1) + { m = Patterns[m_nPattern] + (m_nRow+1) * m_nChannels + nChn; } - if (m && m->command == CMD_XPARAM) { + if (m && m->command == CMD_XPARAM) + { nBreakRow = (param<<8) + m->param; - } else { + } else + { nBreakRow = param; } - if((m_dwSongFlags & SONG_PATTERNLOOP)) { + if((m_dwSongFlags & SONG_PATTERNLOOP)) + { //If song is set to loop and a pattern break occurs we should stay on the same pattern. //Use nPosJump to force playback to "jump to this pattern" rather than move to next, as by default. //rewbs.to @@ -1944,25 +1949,22 @@ } break; - // Midi Controller + // Midi Controller (on first tick only) case CMD_MIDI: if(!(m_dwSongFlags & SONG_FIRSTTICK)) break; - if (param < 0x80){ + if (param < 0x80) ProcessMidiMacro(nChn, &m_MidiCfg.szMidiSFXExt[pChn->nActiveMacro << 5], param); - } else { + else ProcessMidiMacro(nChn, &m_MidiCfg.szMidiZXXExt[(param & 0x7F) << 5], 0); - } break; - //rewbs.smoothVST: Smooth Macro slide + // Midi Controller (smooth, i.e. on every tick) case CMD_SMOOTHMIDI: - if (param < 0x80) { + if (param < 0x80) ProcessSmoothMidiMacro(nChn, &m_MidiCfg.szMidiSFXExt[pChn->nActiveMacro << 5], param); - } else { + else ProcessSmoothMidiMacro(nChn, &m_MidiCfg.szMidiZXXExt[(param & 0x7F) << 5], 0); - } break; - //rewbs.smoothVST end // IMF Commands case CMD_NOTESLIDEUP: @@ -2040,7 +2042,8 @@ void CSoundFile::resetEnvelopes(MODCHANNEL* pChn, int envToReset) //--------------------------------------------------------------- { - switch (envToReset) { + switch (envToReset) + { case ENV_RESET_ALL: pChn->nVolEnvPosition = 0; pChn->nPanEnvPosition = 0; Modified: trunk/OpenMPT/soundlib/Sndfile.cpp =================================================================== --- trunk/OpenMPT/soundlib/Sndfile.cpp 2010-06-03 20:39:27 UTC (rev 614) +++ trunk/OpenMPT/soundlib/Sndfile.cpp 2010-06-05 12:45:27 UTC (rev 615) @@ -1149,11 +1149,11 @@ { double bpm; - if (m_nTempoMode == tempo_mode_modern) { // With modern mode, we trust that true bpm - bpm = static_cast<double>(m_nMusicTempo); // is be close enough to what user chose. - } // This avoids oscillation due to tick-to-tick corrections. - - else { //with other modes, we calculate it: + if (m_nTempoMode == tempo_mode_modern) // With modern mode, we trust that true bpm + { // is close enough to what user chose. + bpm = static_cast<double>(m_nMusicTempo); // This avoids oscillation due to tick-to-tick corrections. + } else + { //with other modes, we calculate it: double ticksPerBeat = m_nMusicSpeed*m_nRowsPerBeat; //ticks/beat = ticks/row * rows/beat double samplesPerBeat = m_nSamplesPerTick*ticksPerBeat; //samps/beat = samps/tick * ticks/beat bpm = gdwMixingFreq/samplesPerBeat*60; //beats/sec = samps/sec / samps/beat @@ -1204,7 +1204,7 @@ MODCOMMAND *p = Patterns[Order[nPattern]]; if ((p) && (nRow < Patterns[Order[nPattern]].GetNumRows())) { - BOOL bOk = FALSE; + bool bOk = false; while ((!bOk) && (nRow > 0)) { UINT n = nRow * m_nChannels; @@ -1212,7 +1212,7 @@ { if (p[n].note) { - bOk = TRUE; + bOk = true; break; } } @@ -1360,7 +1360,7 @@ m_nBufferCount = 0; for (UINT i=0; i<MAX_CHANNELS; i++) { - Chn[i].nROfs = Chn[i].nLOfs = 0; + Chn[i].nROfs = Chn[i].nLOfs = Chn[i].nLength = 0; } } Modified: trunk/OpenMPT/soundlib/Sndfile.h =================================================================== --- trunk/OpenMPT/soundlib/Sndfile.h 2010-06-03 20:39:27 UTC (rev 614) +++ trunk/OpenMPT/soundlib/Sndfile.h 2010-06-05 12:45:27 UTC (rev 615) @@ -478,7 +478,7 @@ // Is compatible mode for a specific tracker turned on? // Hint 1: No need to poll for MOD_TYPE_MPT, as it will automatically be linked with MOD_TYPE_IT when using TRK_IMPULSETRACKER // Hint 2: Always returns true for MOD / S3M format (if that is the format of the current file) - bool IsCompatibleMode(MODTYPE type) + bool IsCompatibleMode(MODTYPE type) const { if(GetType() & type & (MOD_TYPE_MOD | MOD_TYPE_S3M)) return true; // S3M and MOD format don't have compatibility flags, so we will always return true @@ -1154,10 +1154,10 @@ typedef struct MODFORMATINFO { - DWORD dwFormatId; // MOD_TYPE_XXXX - LPCSTR lpszFormatName; // "ProTracker" - LPCSTR lpszExtension; // ".xxx" - DWORD dwPadding; + MODTYPE mtFormatId; // MOD_TYPE_XXXX + LPCSTR lpszFormatName; // "ProTracker" + LPCSTR lpszExtension; // ".xxx" + DWORD dwPadding; } MODFORMATINFO; extern MODFORMATINFO gModFormatInfo[MAX_MODTYPE]; Modified: trunk/OpenMPT/soundlib/Sndmix.cpp =================================================================== --- trunk/OpenMPT/soundlib/Sndmix.cpp 2010-06-03 20:39:27 UTC (rev 614) +++ trunk/OpenMPT/soundlib/Sndmix.cpp 2010-06-05 12:45:27 UTC (rev 615) @@ -49,7 +49,7 @@ LONG gnDryROfsVol = 0; LONG gnDryLOfsVol = 0; int gbInitPlugins = 0; -int gbInitTables = 0; +bool gbInitTables = 0; typedef DWORD (MPPASMCALL * LPCONVERTPROC)(LPVOID, int *, DWORD); @@ -218,7 +218,7 @@ if (!gbInitTables) { SndMixInitializeTables(); - gbInitTables = 1; + gbInitTables = true; } #endif if (m_nMaxMixChannels > MAX_CHANNELS) m_nMaxMixChannels = MAX_CHANNELS; @@ -681,11 +681,13 @@ m_nMusicSpeed = m_nDefaultSpeed; m_nMusicTempo = m_nDefaultTempo; m_nGlobalVolume = m_nDefaultGlobalVolume; - for (UINT i=0; i<MAX_CHANNELS; i++) { + for (UINT i=0; i<MAX_CHANNELS; i++) + { Chn[i].dwFlags |= CHN_NOTEFADE | CHN_KEYOFF; Chn[i].nFadeOutVol = 0; - if (i < m_nChannels) { + if (i < m_nChannels) + { Chn[i].nGlobalVol = ChnSettings[i].nVolume; Chn[i].nVolume = ChnSettings[i].nVolume; Chn[i].nPan = ChnSettings[i].nPan; @@ -696,7 +698,8 @@ Chn[i].nOldHiOffset = 0; Chn[i].nPortamentoDest = 0; - if (!Chn[i].nLength) { + if (!Chn[i].nLength) + { Chn[i].dwFlags = ChnSettings[i].dwFlags; Chn[i].nLoopStart = 0; Chn[i].nLoopEnd = 0; @@ -715,7 +718,8 @@ m_nCurrentPattern = nRestartPosOverride; m_dwSongFlags &= ~SONG_BREAKTOROW; //If restart pos points to +++, move along - while (Order[m_nCurrentPattern] == Order.GetIgnoreIndex()) { + while (Order[m_nCurrentPattern] == Order.GetIgnoreIndex()) + { m_nCurrentPattern++; } //Check for end of song or bad pattern @@ -726,19 +730,18 @@ return FALSE; } - } else { + } else + { m_nCurrentPattern++; } - if (m_nCurrentPattern < Order.size()) { + if (m_nCurrentPattern < Order.size()) m_nPattern = Order[m_nCurrentPattern]; - } else { + else m_nPattern = Order.GetInvalidPatIndex(); - } - if ((m_nPattern < Patterns.Size()) && (!Patterns[m_nPattern])) { + if ((m_nPattern < Patterns.Size()) && (!Patterns[m_nPattern])) m_nPattern = Order.GetIgnoreIndex(); - } } m_nNextPattern = m_nCurrentPattern; @@ -1184,7 +1187,8 @@ } } // vol is 14-bits - if (vol) { + if (vol) + { // IMPORTANT: pChn->nRealVolume is 14 bits !!! // -> _muldiv( 14+8, 6+6, 18); => RealVolume: 14-bit result (22+12-20) @@ -1192,11 +1196,14 @@ //Don't let global volume affect level of sample if //global volume is going to be applied to master output anyway. - if (pChn->dwFlags&CHN_SYNCMUTE) { + if (pChn->dwFlags & CHN_SYNCMUTE) + { pChn->nRealVolume = 0; - } else if (m_pConfig->getGlobalVolumeAppliesToMaster()) { + } else if (m_pConfig->getGlobalVolumeAppliesToMaster()) + { pChn->nRealVolume = _muldiv(vol*MAX_GLOBAL_VOLUME, pChn->nGlobalVol * pChn->nInsVol, 1 << 20); - } else { + } else + { pChn->nRealVolume = _muldiv(vol * m_nGlobalVolume, pChn->nGlobalVol * pChn->nInsVol, 1 << 20); } } @@ -1901,7 +1908,7 @@ if (nRampLength < (LONG)gnVolumeRampSamples) nRampLength = gnVolumeRampSamples; } } -#endif +#endif // FASTSOUNDLIB pChn->nRightRamp = nRightDelta / nRampLength; pChn->nLeftRamp = nLeftDelta / nRampLength; pChn->nRightVol = pChn->nNewRightVol - ((pChn->nRightRamp * nRampLength) >> VOLUMERAMPPRECISION); @@ -1931,7 +1938,7 @@ // Note change but no sample if (pChn->nLeftVU > 128) pChn->nLeftVU = 0; if (pChn->nRightVU > 128) pChn->nRightVU = 0; -#endif +#endif // ENABLE_STEREOVU if (pChn->nVUMeter > 0xFF) pChn->nVUMeter = 0; pChn->nLeftVol = pChn->nRightVol = 0; pChn->nLength = 0; Modified: trunk/OpenMPT/soundlib/modcommand.h =================================================================== --- trunk/OpenMPT/soundlib/modcommand.h 2010-06-03 20:39:27 UTC (rev 614) +++ trunk/OpenMPT/soundlib/modcommand.h 2010-06-05 12:45:27 UTC (rev 615) @@ -52,15 +52,21 @@ void Clear() {memset(this, 0, sizeof(MODCOMMAND));} // Returns true if modcommand is empty, false otherwise. - bool IsEmpty() const {return (this->note == 0 && this->instr == 0 && this->volcmd == 0 && this->command == 0);} - //bool IsEmpty() const {return (*this == Empty());} + // If ignoreEffectValues is true (default), effect values are ignored are ignored if there is no effect command present. + bool IsEmpty(bool ignoreEffectValues = true) const + { + if(ignoreEffectValues) + return (this->note == 0 && this->instr == 0 && this->volcmd == 0 && this->command == 0); + else + return (*this == Empty()); + } // Returns true if instrument column represents plugin index. bool IsInstrPlug() const {return IsPcNote();} // Returns true if and only if note is NOTE_PC or NOTE_PCS. - bool IsPcNote() const {return note == NOTE_PC || note == NOTE_PCS;} - static bool IsPcNote(NOTE note_id) {return note_id == NOTE_PC || note_id == NOTE_PCS;} + bool IsPcNote() const { return note == NOTE_PC || note == NOTE_PCS; } + static bool IsPcNote(NOTE note_id) { return note_id == NOTE_PC || note_id == 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() Modified: trunk/OpenMPT/soundlib/pattern.cpp =================================================================== --- trunk/OpenMPT/soundlib/pattern.cpp 2010-06-03 20:39:27 UTC (rev 614) +++ trunk/OpenMPT/soundlib/pattern.cpp 2010-06-05 12:45:27 UTC (rev 615) @@ -116,7 +116,6 @@ //--------------------- { MODCOMMAND *newPattern, *oldPattern; - UINT nRows, nChns; CSoundFile& sndFile = m_rPatternContainer.GetSoundFile(); if(sndFile.m_pModDoc == NULL) return true; @@ -126,21 +125,21 @@ if ((!m_ModCommands) || (m_Rows > sndFile.GetModSpecifications().patternRowsMax / 2)) return true; rModDoc.BeginWaitCursor(); - nRows = m_Rows; - nChns = sndFile.m_nChannels; - newPattern = CSoundFile::AllocatePattern(nRows*2, nChns); + const ROWINDEX nRows = m_Rows; + const CHANNELINDEX nChns = sndFile.m_nChannels; + newPattern = CSoundFile::AllocatePattern(nRows * 2, nChns); if (!newPattern) return true; - const UINT nPattern = m_rPatternContainer.GetIndex(this); - rModDoc.GetPatternUndo()->PrepareUndo(nPattern, 0,0, nChns, nRows); + const PATTERNINDEX nPattern = m_rPatternContainer.GetIndex(this); + rModDoc.GetPatternUndo()->PrepareUndo(nPattern, 0, 0, nChns, nRows); oldPattern = m_ModCommands; - for (UINT y=0; y<nRows; y++) + for (ROWINDEX y = 0; y < nRows; y++) { - memcpy(newPattern+y*2*nChns, oldPattern+y*nChns, nChns*sizeof(MODCOMMAND)); + memcpy(newPattern + y * 2 * nChns, oldPattern + y * nChns, nChns * sizeof(MODCOMMAND)); } m_ModCommands = newPattern; m_Rows = nRows * 2; - CSoundFile::FreePattern(oldPattern); oldPattern= NULL; + CSoundFile::FreePattern(oldPattern); oldPattern = nullptr; rModDoc.SetModified(); rModDoc.UpdateAllViews(NULL, HINT_PATTERNDATA | (nPattern << HINT_SHIFT_PAT), NULL); rModDoc.EndWaitCursor(); @@ -150,8 +149,6 @@ bool CPattern::Shrink() //--------------------- { - UINT nRows, nChns; - CSoundFile& sndFile = m_rPatternContainer.GetSoundFile(); if(sndFile.m_pModDoc == NULL) return true; @@ -160,16 +157,16 @@ if (!m_ModCommands || m_Rows < sndFile.GetModSpecifications().patternRowsMin * 2) return true; rModDoc.BeginWaitCursor(); - nRows = m_Rows; - nChns = sndFile.m_nChannels; - const UINT nPattern = m_rPatternContainer.GetIndex(this); - rModDoc.GetPatternUndo()->PrepareUndo(nPattern, 0,0, nChns, nRows); + ROWINDEX nRows = m_Rows; + const CHANNELINDEX nChns = sndFile.m_nChannels; + const PATTERNINDEX nPattern = m_rPatternContainer.GetIndex(this); + rModDoc.GetPatternUndo()->PrepareUndo(nPattern, 0, 0, nChns, nRows); nRows /= 2; - for (UINT y=0; y<nRows; y++) + for (ROWINDEX y = 0; y < nRows; y++) { MODCOMMAND *psrc = sndFile.Patterns[nPattern] + (y * 2 * nChns); MODCOMMAND *pdest = sndFile.Patterns[nPattern] + (y * nChns); - for (UINT x=0; x<nChns; x++) + for (CHANNELINDEX x = 0; x < nChns; x++) { pdest[x] = psrc[x]; if ((!pdest[x].note) && (!pdest[x].instr)) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |