From: <sag...@us...> - 2010-04-14 21:32:06
|
Revision: 568 http://modplug.svn.sourceforge.net/modplug/?rev=568&view=rev Author: saga-games Date: 2010-04-14 21:31:59 +0000 (Wed, 14 Apr 2010) Log Message: ----------- [Fix] XM compatibility: Volume column doesn't have an effect memory, most effects with param = 0 are useless. Those are ignored in compatibility mode playback and also when exporting the file in compatibility mode. [Fix] When converting PC Notes to MIDI Macros, the instrument index is now also cleaned as well. Noticable for example when pasting PC notes into an IT module. [Fix] Mod Conversion: When converting from MPTM to another format, the first sequence name is removed and the sequence is now sized properly when merging multiple sequences. [Imp] Treeview: Display sequence index next to sequence names. Modified Paths: -------------- trunk/OpenMPT/mptrack/Modedit.cpp trunk/OpenMPT/mptrack/View_tre.cpp trunk/OpenMPT/soundlib/Load_xm.cpp trunk/OpenMPT/soundlib/Snd_fx.cpp trunk/OpenMPT/soundlib/Sndfile.cpp Modified: trunk/OpenMPT/mptrack/Modedit.cpp =================================================================== --- trunk/OpenMPT/mptrack/Modedit.cpp 2010-04-10 22:43:18 UTC (rev 567) +++ trunk/OpenMPT/mptrack/Modedit.cpp 2010-04-14 21:31:59 UTC (rev 568) @@ -392,7 +392,7 @@ ChangeFileExtension(nNewType); // Multisequences not suppported by other formats - if(!(m_SndFile.GetType() == MOD_TYPE_MPT)) MergeSequences(); + if(m_SndFile.GetType() != MOD_TYPE_MPT) MergeSequences(); // Convert sequence with separator patterns into multiple sequences? if(m_SndFile.GetType() == MOD_TYPE_MPT && m_SndFile.Order.GetNumSequences() == 1) { @@ -1097,7 +1097,7 @@ UINT note = m->note; switch(note) { - case 0: p[1] = p[2] = p[3] = '.'; break; + case NOTE_NONE: p[1] = p[2] = p[3] = '.'; break; case NOTE_KEYOFF: p[1] = p[2] = p[3] = '='; break; case NOTE_NOTECUT: p[1] = p[2] = p[3] = '^'; break; case NOTE_FADE: p[1] = p[2] = p[3] = '~'; break; @@ -1754,6 +1754,9 @@ } m_SndFile.Order.RemoveSequence(1); } + // Remove order name + fill up with empty patterns. + m_SndFile.Order.m_sName = ""; + m_SndFile.Order.resize(min(MAX_ORDERS, m_SndFile.GetModSpecifications().ordersMax)); return true; } Modified: trunk/OpenMPT/mptrack/View_tre.cpp =================================================================== --- trunk/OpenMPT/mptrack/View_tre.cpp 2010-04-10 22:43:18 UTC (rev 567) +++ trunk/OpenMPT/mptrack/View_tre.cpp 2010-04-14 21:31:59 UTC (rev 568) @@ -760,7 +760,8 @@ if(pSndFile->Order.GetNumSequences() > 1) { // more than one sequence -> add folder - CString sSeqName = pSndFile->Order.GetSequence(nSeq).m_sName; + CString sSeqName; + sSeqName.Format("%d: %s", nSeq, pSndFile->Order.GetSequence(nSeq).m_sName); if(sSeqName.IsEmpty()) sSeqName.Format("Sequence %d", nSeq); UINT state = (nSeq == pSndFile->Order.GetCurrentSequenceIndex()) ? TVIS_BOLD : 0; Modified: trunk/OpenMPT/soundlib/Load_xm.cpp =================================================================== --- trunk/OpenMPT/soundlib/Load_xm.cpp 2010-04-10 22:43:18 UTC (rev 567) +++ trunk/OpenMPT/soundlib/Load_xm.cpp 2010-04-14 21:31:59 UTC (rev 568) @@ -835,8 +835,7 @@ UINT vol = 0; if (p->volcmd) { - UINT volcmd = p->volcmd; - switch(volcmd) + switch(p->volcmd) { case VOLCMD_VOLUME: vol = 0x10 + p->vol; break; case VOLCMD_VOLSLIDEDOWN: vol = 0x60 + (p->vol & 0x0F); break; @@ -850,6 +849,21 @@ case VOLCMD_PANSLIDERIGHT: vol = 0xE0 + (p->vol & 0x0F); break; case VOLCMD_TONEPORTAMENTO: vol = 0xF0 + (p->vol & 0x0F); break; } + // Those values are ignored in FT2. Don't save them, also to avoid possible problems with other trackers (or MPT itself) + if(bCompatibilityExport && p->vol == 0) + { + switch(p->volcmd) + { + case VOLCMD_VOLUME: + case VOLCMD_PANNING: + case VOLCMD_VIBRATODEPTH: + case VOLCMD_TONEPORTAMENTO: + break; + default: + // no memory here. + vol = 0; + } + } } if ((note) && (p->instr) && (vol > 0x0F) && (command) && (param)) { @@ -946,13 +960,16 @@ UINT sample = pIns->Keyboard[j+12]; // Check to see if sample mapped to this note is already accounted for in this instrument - for (k=0; k<xmih.samples; k++) { - if (smptable[k] == sample) { + for (k=0; k<xmih.samples; k++) + { + if (smptable[k] == sample) + { break; } } - if (k == xmih.samples) { //we got to the end of the loop: sample unnaccounted for. + if (k == xmih.samples) //we got to the end of the loop: sample unnaccounted for. + { smptable[xmih.samples++] = sample; //record in instrument's sample table } Modified: trunk/OpenMPT/soundlib/Snd_fx.cpp =================================================================== --- trunk/OpenMPT/soundlib/Snd_fx.cpp 2010-04-10 22:43:18 UTC (rev 567) +++ trunk/OpenMPT/soundlib/Snd_fx.cpp 2010-04-14 21:31:59 UTC (rev 568) @@ -1486,7 +1486,26 @@ TonePortamento(pChn, vol * 16); } else { - if (vol) pChn->nOldVolParam = vol; else vol = pChn->nOldVolParam; + // XM Compatibility: FT2 ignores some voluem commands with parameter = 0. + if(IsCompatibleMode(TRK_FASTTRACKER2) && vol == 0) + { + switch(volcmd) + { + case VOLCMD_VOLUME: + case VOLCMD_PANNING: + case VOLCMD_VIBRATODEPTH: + case VOLCMD_TONEPORTAMENTO: + break; + default: + // no memory here. + volcmd = VOLCMD_NONE; + } + + } else + { + if(vol) pChn->nOldVolParam = vol; else vol = pChn->nOldVolParam; + } + switch(volcmd) { case VOLCMD_VOLSLIDEUP: Modified: trunk/OpenMPT/soundlib/Sndfile.cpp =================================================================== --- trunk/OpenMPT/soundlib/Sndfile.cpp 2010-04-10 22:43:18 UTC (rev 567) +++ trunk/OpenMPT/soundlib/Sndfile.cpp 2010-04-14 21:31:59 UTC (rev 568) @@ -3332,6 +3332,7 @@ m->command = (m->note == NOTE_PC) ? CMD_MIDI : CMD_SMOOTHMIDI; // might be removed later m->volcmd = VOLCMD_NONE; m->note = NOTE_NONE; + m->instr = 0; } // adjust extended envelope control commands This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |