You can subscribe to this list here.
| 2006 |
Jan
|
Feb
|
Mar
(1) |
Apr
(1) |
May
|
Jun
(1) |
Jul
|
Aug
(10) |
Sep
|
Oct
|
Nov
|
Dec
(3) |
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 2007 |
Jan
(1) |
Feb
(2) |
Mar
(3) |
Apr
(2) |
May
(10) |
Jun
(2) |
Jul
(1) |
Aug
|
Sep
|
Oct
|
Nov
(3) |
Dec
|
| 2008 |
Jan
(6) |
Feb
(4) |
Mar
(5) |
Apr
(2) |
May
(1) |
Jun
(1) |
Jul
(4) |
Aug
(6) |
Sep
(2) |
Oct
(9) |
Nov
(1) |
Dec
(4) |
| 2009 |
Jan
(9) |
Feb
(2) |
Mar
(2) |
Apr
(2) |
May
(6) |
Jun
(18) |
Jul
(33) |
Aug
(39) |
Sep
(33) |
Oct
(24) |
Nov
(23) |
Dec
(22) |
| 2010 |
Jan
(29) |
Feb
(32) |
Mar
(51) |
Apr
(17) |
May
(31) |
Jun
(21) |
Jul
(32) |
Aug
(28) |
Sep
(35) |
Oct
(27) |
Nov
(11) |
Dec
(13) |
| 2011 |
Jan
(14) |
Feb
(13) |
Mar
(27) |
Apr
(27) |
May
(28) |
Jun
(20) |
Jul
(43) |
Aug
(52) |
Sep
(66) |
Oct
(61) |
Nov
(11) |
Dec
(8) |
| 2012 |
Jan
(20) |
Feb
(30) |
Mar
(38) |
Apr
(21) |
May
(33) |
Jun
(21) |
Jul
(25) |
Aug
(9) |
Sep
(24) |
Oct
(42) |
Nov
(27) |
Dec
(41) |
| 2013 |
Jan
(20) |
Feb
(35) |
Mar
(156) |
Apr
(298) |
May
(258) |
Jun
(201) |
Jul
(105) |
Aug
(60) |
Sep
(193) |
Oct
(245) |
Nov
(280) |
Dec
(194) |
| 2014 |
Jan
(63) |
Feb
(202) |
Mar
(200) |
Apr
(23) |
May
(53) |
Jun
(105) |
Jul
(18) |
Aug
(26) |
Sep
(110) |
Oct
(187) |
Nov
(97) |
Dec
(74) |
| 2015 |
Jan
(45) |
Feb
(55) |
Mar
(116) |
Apr
(116) |
May
(193) |
Jun
(164) |
Jul
(50) |
Aug
(111) |
Sep
(98) |
Oct
(71) |
Nov
(103) |
Dec
(63) |
| 2016 |
Jan
(33) |
Feb
(101) |
Mar
(182) |
Apr
(139) |
May
(140) |
Jun
(103) |
Jul
(165) |
Aug
(286) |
Sep
(208) |
Oct
(127) |
Nov
(97) |
Dec
(54) |
| 2017 |
Jan
(64) |
Feb
(335) |
Mar
(202) |
Apr
(212) |
May
(139) |
Jun
(127) |
Jul
(294) |
Aug
(154) |
Sep
(170) |
Oct
(152) |
Nov
(156) |
Dec
(62) |
| 2018 |
Jan
(168) |
Feb
(237) |
Mar
(196) |
Apr
(174) |
May
(174) |
Jun
(161) |
Jul
(127) |
Aug
(88) |
Sep
(149) |
Oct
(66) |
Nov
(52) |
Dec
(135) |
| 2019 |
Jan
(146) |
Feb
(126) |
Mar
(104) |
Apr
(58) |
May
(60) |
Jun
(28) |
Jul
(197) |
Aug
(129) |
Sep
(141) |
Oct
(148) |
Nov
(63) |
Dec
(100) |
| 2020 |
Jan
(74) |
Feb
(37) |
Mar
(59) |
Apr
(154) |
May
(194) |
Jun
(133) |
Jul
(313) |
Aug
(197) |
Sep
(49) |
Oct
(162) |
Nov
(143) |
Dec
(57) |
| 2021 |
Jan
(120) |
Feb
(107) |
Mar
(314) |
Apr
(157) |
May
(524) |
Jun
(169) |
Jul
(72) |
Aug
(133) |
Sep
(135) |
Oct
(146) |
Nov
(198) |
Dec
(325) |
| 2022 |
Jan
(409) |
Feb
(249) |
Mar
(138) |
Apr
(95) |
May
(102) |
Jun
(221) |
Jul
(66) |
Aug
(120) |
Sep
(192) |
Oct
(131) |
Nov
(53) |
Dec
(171) |
| 2023 |
Jan
(357) |
Feb
(82) |
Mar
(168) |
Apr
(218) |
May
(196) |
Jun
(86) |
Jul
(115) |
Aug
(49) |
Sep
(190) |
Oct
(102) |
Nov
(45) |
Dec
(76) |
| 2024 |
Jan
(86) |
Feb
(50) |
Mar
(324) |
Apr
(209) |
May
(197) |
Jun
(232) |
Jul
(194) |
Aug
(247) |
Sep
(219) |
Oct
(266) |
Nov
(328) |
Dec
(304) |
| 2025 |
Jan
(191) |
Feb
(115) |
Mar
(137) |
Apr
(32) |
May
(126) |
Jun
(403) |
Jul
(213) |
Aug
(203) |
Sep
(148) |
Oct
(109) |
Nov
(191) |
Dec
(209) |
| 2026 |
Jan
(127) |
Feb
(123) |
Mar
(160) |
Apr
(141) |
May
(45) |
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
|
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-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 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: <re...@us...> - 2010-04-20 19:39:09
|
Revision: 573
http://modplug.svn.sourceforge.net/modplug/?rev=573&view=rev
Author: rewbs
Date: 2010-04-20 19:38:59 +0000 (Tue, 20 Apr 2010)
Log Message:
-----------
[New] Added combined note delay & note cut command for .mptm only (":xy" means delay until tick x and play for y ticks).
[Mod] Removed old "velocity" volume command, which was experimental and unused.
Modified Paths:
--------------
trunk/OpenMPT/mptrack/CommandSet.cpp
trunk/OpenMPT/mptrack/CommandSet.h
trunk/OpenMPT/mptrack/Draw_pat.cpp
trunk/OpenMPT/mptrack/Moddoc.cpp
trunk/OpenMPT/mptrack/Mptrack.h
trunk/OpenMPT/mptrack/View_pat.cpp
trunk/OpenMPT/mptrack/res/defaultKeybindings.mkb
trunk/OpenMPT/soundlib/Load_it.cpp
trunk/OpenMPT/soundlib/Load_mod.cpp
trunk/OpenMPT/soundlib/Load_s3m.cpp
trunk/OpenMPT/soundlib/Snd_fx.cpp
trunk/OpenMPT/soundlib/Sndfile.cpp
trunk/OpenMPT/soundlib/mod_specifications.h
trunk/OpenMPT/soundlib/modcommand.h
Modified: trunk/OpenMPT/mptrack/CommandSet.cpp
===================================================================
--- trunk/OpenMPT/mptrack/CommandSet.cpp 2010-04-19 19:20:17 UTC (rev 572)
+++ trunk/OpenMPT/mptrack/CommandSet.cpp 2010-04-20 19:38:59 UTC (rev 573)
@@ -1279,10 +1279,10 @@
commands[kcSetVolumeITPortaDown].isDummy = false;
commands[kcSetVolumeITPortaDown].Message = "Vol command - Portamento Down";
- commands[kcSetVolumeITVelocity].UID = 1245;
- commands[kcSetVolumeITVelocity].isHidden = false;
- commands[kcSetVolumeITVelocity].isDummy = false;
- commands[kcSetVolumeITVelocity].Message = "Vol command - Velocity";
+ commands[kcSetVolumeITUnused].UID = 1245;
+ commands[kcSetVolumeITUnused].isHidden = true;
+ commands[kcSetVolumeITUnused].isDummy = false;
+ commands[kcSetVolumeITUnused].Message = "Vol command - Unused";
commands[kcSetVolumeITOffset].UID = 1246;
commands[kcSetVolumeITOffset].isHidden = false;
@@ -1529,10 +1529,10 @@
commands[kcSetFXmacroSlide].isDummy = false;
commands[kcSetFXmacroSlide].Message = "FX midi macro slide";
- commands[kcSetFXvelocity].UID = 1295;
- commands[kcSetFXvelocity].isHidden = false;
- commands[kcSetFXvelocity].isDummy = false;
- commands[kcSetFXvelocity].Message = "FX pseudo-velocity (experimental)";
+ commands[kcSetFXdelaycut].UID = 1295;
+ commands[kcSetFXdelaycut].isHidden = false;
+ commands[kcSetFXdelaycut].isDummy = false;
+ commands[kcSetFXdelaycut].Message = "FX combined note delay and note cut";
commands[kcPatternJumpDownh1Select].UID = 1296;
commands[kcPatternJumpDownh1Select].isHidden = true;
Modified: trunk/OpenMPT/mptrack/CommandSet.h
===================================================================
--- trunk/OpenMPT/mptrack/CommandSet.h 2010-04-19 19:20:17 UTC (rev 572)
+++ trunk/OpenMPT/mptrack/CommandSet.h 2010-04-20 19:38:59 UTC (rev 573)
@@ -484,7 +484,7 @@
kcSetVolumePortamento, //g
kcSetVolumeITPortaUp, //f
kcSetVolumeITPortaDown, //e
- kcSetVolumeITVelocity, //:
+ kcSetVolumeITUnused, //:
kcSetVolumeITOffset, //o
kcSetVolumeEnd=kcSetVolumeITOffset,
@@ -542,7 +542,7 @@
kcSetFXmacro, //z,z
kcFixedFXend=kcSetFXmacro,
kcSetFXmacroSlide, //?,\
- kcSetFXvelocity, //?,:
+ kcSetFXdelaycut, //?,:
kcSetFXextension, //?,#
kcSetFXEnd=kcSetFXextension,
Modified: trunk/OpenMPT/mptrack/Draw_pat.cpp
===================================================================
--- trunk/OpenMPT/mptrack/Draw_pat.cpp 2010-04-19 19:20:17 UTC (rev 572)
+++ trunk/OpenMPT/mptrack/Draw_pat.cpp 2010-04-20 19:38:59 UTC (rev 573)
@@ -289,12 +289,10 @@
srcy = pfnt->nAlphaNZ_Y + 14 * COLUMN_HEIGHT;
break;
//end rewbs.smoothVST
- //rewbs.velocity
case ':':
srcx = pfnt->nAlphaNZ_X;
srcy = pfnt->nAlphaNZ_Y + 15 * COLUMN_HEIGHT;
break;
- //end rewbs.velocity
case ' ':
srcx = pfnt->nSpaceX;
srcy = pfnt->nSpaceY;
Modified: trunk/OpenMPT/mptrack/Moddoc.cpp
===================================================================
--- trunk/OpenMPT/mptrack/Moddoc.cpp 2010-04-19 19:20:17 UTC (rev 572)
+++ trunk/OpenMPT/mptrack/Moddoc.cpp 2010-04-20 19:38:59 UTC (rev 573)
@@ -1985,7 +1985,7 @@
#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 MAX_FXINFO 69
+#define MAX_FXINFO 70
const MPTEFFECTINFO gFXInfo[MAX_FXINFO] =
@@ -2060,6 +2060,7 @@
// MPT IT extensions and special effects
{CMD_S3MCMDEX, 0xF0,0x90, 0, MOD_TYPE_S3MITMPT, "Sound control"},
{CMD_S3MCMDEX, 0xF0,0x70, 0, MOD_TYPE_ITMPT, "Instr. control"},
+ {CMD_DELAYCUT, 0x00,0x00, 0, MOD_TYPE_MPT, "Note delay and cut"},
// -> CODE#0010
// -> DESC="add extended parameter mechanism to pattern effects"
{CMD_XPARAM, 0x00,0x00, 0, MOD_TYPE_XMITMPT, "X param"},
@@ -2840,7 +2841,7 @@
LPCSTR pszName; // ie "Set Volume"
} MPTVOLCMDINFO;
-#define MAX_VOLINFO 15 //rewbs.volOff & rewbs.velocity: increased from 13
+#define MAX_VOLINFO 15
const MPTVOLCMDINFO gVolCmdInfo[MAX_VOLINFO] =
@@ -2858,8 +2859,8 @@
{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_VELOCITY, MOD_TYPE_ITMPT, ":: velocity"}, //rewbs.velocity
- {VOLCMD_OFFSET, MOD_TYPE_ITMPT, "o: offset"}, //rewbs.volOff
+ {VOLCMD_DELAYCUT, MOD_TYPE_ITMPT, ":: (currently unused)"},
+ {VOLCMD_OFFSET, MOD_TYPE_ITMPT, "o: Offset"}, //rewbs.volOff
};
Modified: trunk/OpenMPT/mptrack/Mptrack.h
===================================================================
--- trunk/OpenMPT/mptrack/Mptrack.h 2010-04-19 19:20:17 UTC (rev 572)
+++ trunk/OpenMPT/mptrack/Mptrack.h 2010-04-20 19:38:59 UTC (rev 573)
@@ -439,9 +439,9 @@
STATIC_ASSERT(ARRAYELEMCOUNT(szSpecialNoteShortDesc) == ARRAYELEMCOUNT(szSpecialNoteNames));
const LPCSTR szHexChar = "0123456789ABCDEF";
-const LPCSTR gszModCommands = " 0123456789ABCDRFFTE???GHK?YXPLZ\\:#??"; //rewbs.smoothVST: added last \ (written as \\); rewbs.velocity: added last :
-const LPCSTR gszS3mCommands = " JFEGHLKRXODB?CQATI?SMNVW?UY?P?Z\\:#??"; //rewbs.smoothVST: added last \ (written as \\); rewbs.velocity: added last :
-const LPCSTR gszVolCommands = " vpcdabuhlrgfe:o"; //rewbs.velocity: added last : ; rewbs.volOff added last o
+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("");
// Defined in load_mid.cpp
Modified: trunk/OpenMPT/mptrack/View_pat.cpp
===================================================================
--- trunk/OpenMPT/mptrack/View_pat.cpp 2010-04-19 19:20:17 UTC (rev 572)
+++ trunk/OpenMPT/mptrack/View_pat.cpp 2010-04-20 19:38:59 UTC (rev 573)
@@ -3763,7 +3763,6 @@
case kcSetVolumePortamento: volcmd = VOLCMD_TONEPORTAMENTO; break;
case kcSetVolumeITPortaUp: if (pSndFile->m_nType & (MOD_TYPE_IT | MOD_TYPE_MPT)) volcmd = VOLCMD_PORTAUP; break;
case kcSetVolumeITPortaDown: if (pSndFile->m_nType & (MOD_TYPE_IT | MOD_TYPE_MPT)) volcmd = VOLCMD_PORTADOWN; break;
- case kcSetVolumeITVelocity: if (pSndFile->m_nType & (MOD_TYPE_IT | MOD_TYPE_MPT)) volcmd = VOLCMD_VELOCITY; break; //rewbs.velocity
case kcSetVolumeITOffset: if (pSndFile->m_nType & (MOD_TYPE_IT | MOD_TYPE_MPT)) volcmd = VOLCMD_OFFSET; break; //rewbs.volOff
}
//if ((pSndFile->m_nType & MOD_TYPE_MOD) && (volcmd > VOLCMD_PANNING)) volcmd = vol = 0;
@@ -3892,18 +3891,6 @@
p->param = (p->param << 4) | v;
if (p->command == m_cmdOld.command) m_cmdOld.param = p->param;
- /*
- if (v >= 0 && v <= 9)
- {
- p->param = (p->param << 4) | v;
- if (p->command == m_cmdOld.command) m_cmdOld.param = p->param;
- }
- else if (v >= 10 && v <= 15)
- {
- p->param = (p->param << 4) | (v + 0x0A);
- if (p->command == m_cmdOld.command) m_cmdOld.param = p->param;
- }
- */
// Check for MOD/XM Speed/Tempo command
if ((pSndFile->m_nType & (MOD_TYPE_MOD|MOD_TYPE_XM))
&& ((p->command == CMD_SPEED) || (p->command == CMD_TEMPO)))
@@ -3912,15 +3899,15 @@
}
}
- DWORD sel = (m_nRow << 16) | m_dwCursor;
- SetCurSel(sel, sel);
- sel &= ~7;
- if(*p != oldcmd)
- {
- pModDoc->SetModified();
- InvalidateArea(sel, sel+5);
- UpdateIndicator();
- }
+ DWORD sel = (m_nRow << 16) | m_dwCursor;
+ SetCurSel(sel, sel);
+ sel &= ~7;
+ if(*p != oldcmd)
+ {
+ pModDoc->SetModified();
+ InvalidateArea(sel, sel+5);
+ UpdateIndicator();
+ }
}
}
Modified: trunk/OpenMPT/mptrack/res/defaultKeybindings.mkb
===================================================================
--- trunk/OpenMPT/mptrack/res/defaultKeybindings.mkb 2010-04-19 19:20:17 UTC (rev 572)
+++ trunk/OpenMPT/mptrack/res/defaultKeybindings.mkb 2010-04-20 19:38:59 UTC (rev 573)
@@ -229,14 +229,14 @@
5:1242:0:71:1 //Vol command - Portamento: G (KeyDown)
5:1243:0:70:1 //Vol command - Portamento Up: F (KeyDown)
5:1244:0:69:1 //Vol command - Portamento Down: E (KeyDown)
-5:1245:0:186:1 //Vol command - Velocity: ; (KeyDown)
-5:1245:1:186:1 //Vol command - Velocity: Shift+; (KeyDown)
+5: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 pseudo-velocity (experimental): Shift+; (KeyDown)
-6:1295:0:186:1 //FX pseudo-velocity (experimental): ; (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:1666:0:191:1 //FX parameter extension command: / (KeyDown)
//----( Pattern Context [bottom] - Param Col (7) )------------
Modified: trunk/OpenMPT/soundlib/Load_it.cpp
===================================================================
--- trunk/OpenMPT/soundlib/Load_it.cpp 2010-04-19 19:20:17 UTC (rev 572)
+++ trunk/OpenMPT/soundlib/Load_it.cpp 2010-04-20 19:38:59 UTC (rev 573)
@@ -1475,9 +1475,8 @@
if(m_dwLastSavedWithVersion <= MAKE_VERSION_NUMERIC(1, 17, 02, 54) && interpretModplugmade)
m[ch].volcmd = VOLCMD_VIBRATOSPEED;
} else
- // 213-222: Velocity //rewbs.velocity
- if ((vol >= 213) && (vol <= 222)) { m[ch].volcmd = VOLCMD_VELOCITY; m[ch].vol = vol - 213; } else //rewbs.velocity
- // 223-232: Offset //rewbs.VolOffset
+ // 213-222: Unused (was velocity)
+ // 223-232: Offset
if ((vol >= 223) && (vol <= 232)) { m[ch].volcmd = VOLCMD_OFFSET; m[ch].vol = vol - 223; } //rewbs.volOff
lastvalue[ch].volcmd = m[ch].volcmd;
lastvalue[ch].vol = m[ch].vol;
@@ -2205,7 +2204,6 @@
case VOLCMD_TONEPORTAMENTO: vol = 193 + ConvertVolParam(m->vol); break;
case VOLCMD_PORTADOWN: vol = 105 + ConvertVolParam(m->vol); break;
case VOLCMD_PORTAUP: vol = 115 + ConvertVolParam(m->vol); break;
- case VOLCMD_VELOCITY: vol = 213 + ConvertVolParam(m->vol); break; //rewbs.velocity
case VOLCMD_OFFSET: vol = 223 + ConvertVolParam(m->vol); break; //rewbs.volOff
default: vol = 0xFF;
}
Modified: trunk/OpenMPT/soundlib/Load_mod.cpp
===================================================================
--- trunk/OpenMPT/soundlib/Load_mod.cpp 2010-04-19 19:20:17 UTC (rev 572)
+++ trunk/OpenMPT/soundlib/Load_mod.cpp 2010-04-20 19:38:59 UTC (rev 573)
@@ -56,7 +56,7 @@
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 ':' - 21: command = CMD_VELOCITY; break; //rewbs.velocity: 37
+ case ':' - 21: command = CMD_DELAYCUT; break; //37
case '#' + 3: command = CMD_XPARAM; break; //rewbs.XMfixes - XParam is 38
default: command = 0;
}
@@ -153,11 +153,8 @@
else
command = '\\' - 56;
break;
- case CMD_VELOCITY: //rewbs.velocity: 37
- if(bCompatibilityExport)
+ case CMD_DELAYCUT:
command = param = 0;
- else
- command = ':' - 21;
break;
case CMD_XPARAM: //rewbs.XMfixes - XParam is 38
if(bCompatibilityExport)
Modified: trunk/OpenMPT/soundlib/Load_s3m.cpp
===================================================================
--- trunk/OpenMPT/soundlib/Load_s3m.cpp 2010-04-19 19:20:17 UTC (rev 572)
+++ trunk/OpenMPT/soundlib/Load_s3m.cpp 2010-04-20 19:38:59 UTC (rev 573)
@@ -80,7 +80,7 @@
{
UINT command = m->command;
UINT param = m->param;
- switch (command + 0x40)
+ switch (command | 0x40)
{
case 'A': command = CMD_SPEED; break;
case 'B': command = CMD_POSITIONJUMP; break;
@@ -109,11 +109,9 @@
case 'Y': command = CMD_PANBRELLO; break;
case 'Z': command = CMD_MIDI; break;
case '\\': command = CMD_SMOOTHMIDI; break; //rewbs.smoothVST
- case ':': command = CMD_VELOCITY; break; //rewbs.velocity
-// -> CODE#0010
-// -> DESC="add extended parameter mechanism to pattern effects"
+ // Chars under 0x40 don't save properly, so map : to ] and # to [.
+ case ']': command = CMD_DELAYCUT; break;
case '[': command = CMD_XPARAM; break;
-// -! NEW_FEATURE#0010
default: command = 0;
}
m->command = command;
@@ -172,12 +170,6 @@
else
command = '\\';
break;
- case CMD_VELOCITY: //rewbs.velocity
- if(bCompatibilityExport)
- command = param = 0;
- else
- command = ':';
- break;
case CMD_XFINEPORTAUPDOWN:
if (param & 0x0F) switch(param & 0xF0)
{
@@ -204,15 +196,19 @@
case 0xB0: if (param & 0x0F) { command = 'D'; param |= 0xF0; } else command=param=0; break;
}
break;
-// -> CODE#0010
-// -> DESC="add extended parameter mechanism to pattern effects"
+ // Chars under 0x40 don't save properly, so map : to ] and # to [.
+ case CMD_DELAYCUT:
+ if(bCompatibilityExport)
+ command = param = 0;
+ else
+ command = ']';
+ break;
case CMD_XPARAM:
if(bCompatibilityExport)
command = param = 0;
else
command = '[';
break;
-// -! NEW_FEATURE#0010
default: command = param = 0;
}
command &= ~0x40;
Modified: trunk/OpenMPT/soundlib/Snd_fx.cpp
===================================================================
--- trunk/OpenMPT/soundlib/Snd_fx.cpp 2010-04-19 19:20:17 UTC (rev 572)
+++ trunk/OpenMPT/soundlib/Snd_fx.cpp 2010-04-20 19:38:59 UTC (rev 573)
@@ -1256,6 +1256,13 @@
if((m_dwSongFlags & SONG_FIRSTTICK) == 0) InvertLoop(&Chn[nChn]);
// Process special effects (note delay, pattern delay, pattern loop)
+ if (cmd == CMD_DELAYCUT)
+ {
+ //:xy --> note delay until tick x, note cut at tick x+y
+ nStartTick = (param & 0xF0) >> 4;
+ int cutAtTick = nStartTick + (param & 0x0F);
+ NoteCut(nChn, cutAtTick);
+ } else
if ((cmd == CMD_MODCMDEX) || (cmd == CMD_S3MCMDEX))
{
if ((!param) && (m_nType & (MOD_TYPE_S3M|MOD_TYPE_IT|MOD_TYPE_MPT))) param = pChn->nOldCmdEx; else pChn->nOldCmdEx = param;
@@ -1569,12 +1576,6 @@
else
PortamentoDown(pChn, vol << 2, false);
break;
-
- case VOLCMD_VELOCITY: //rewbs.velocity TEMP algorithm (crappy :)
- pChn->nVolume = vol * 28; //Max nVolume is 255; max vol is 9; 255/9=28
- pChn->dwFlags |= CHN_FASTVOLRAMP;
- if (m_nTickCount == nStartTick) SampleOffset(nChn, 48-(vol << 3), bPorta); //Max vol is 9; 9 << 3 = 48
- break;
case VOLCMD_OFFSET: //rewbs.volOff
if (m_nTickCount == nStartTick)
@@ -1701,8 +1702,6 @@
if (volcmd == VOLCMD_OFFSET)
RetrigNote(nChn, pChn->nRetrigParam, vol << 3);
- else if (volcmd == VOLCMD_VELOCITY)
- RetrigNote(nChn, pChn->nRetrigParam, 48 - (vol << 3));
else
RetrigNote(nChn, pChn->nRetrigParam);
}
@@ -1710,15 +1709,11 @@
{
// XM Retrig
if (param) pChn->nRetrigParam = (BYTE)(param & 0xFF); else param = pChn->nRetrigParam;
- //rewbs.volOffset
//RetrigNote(nChn, param);
if (volcmd == VOLCMD_OFFSET)
RetrigNote(nChn, param, vol << 3);
- else if (volcmd == VOLCMD_VELOCITY)
- RetrigNote(nChn, param, 48 - (vol << 3));
else
RetrigNote(nChn, param);
- //end rewbs.volOffset:
}
break;
@@ -1968,11 +1963,6 @@
}
break;
//rewbs.smoothVST end
-
- //rewbs.velocity
- case CMD_VELOCITY:
- break;
- //end rewbs.velocity
// IMF Commands
case CMD_NOTESLIDEUP:
Modified: trunk/OpenMPT/soundlib/Sndfile.cpp
===================================================================
--- trunk/OpenMPT/soundlib/Sndfile.cpp 2010-04-19 19:20:17 UTC (rev 572)
+++ trunk/OpenMPT/soundlib/Sndfile.cpp 2010-04-20 19:38:59 UTC (rev 573)
@@ -3623,10 +3623,6 @@
m->command = CMD_OFFSET;
m->param = m->vol << 3;
break;
- case VOLCMD_VELOCITY:
- m->command = CMD_VOLUME;
- m->param = m->vol * 7;
- break;
default:
break;
}
@@ -3700,10 +3696,6 @@
m->param = m->vol << 3;
m->volcmd = CMD_NONE;
break;
- case VOLCMD_VELOCITY:
- m->volcmd = CMD_VOLUME;
- m->vol *= 7;
- break;
default:
break;
}
@@ -3731,10 +3723,6 @@
m->param = m->vol << 3;
m->volcmd = CMD_NONE;
break;
- case VOLCMD_VELOCITY:
- m->volcmd = CMD_VOLUME;
- m->vol *= 7;
- break;
default:
break;
}
@@ -3756,7 +3744,6 @@
case VOLCMD_VIBRATODEPTH:
// OpenMPT-specific commands
case VOLCMD_OFFSET:
- case VOLCMD_VELOCITY:
m->vol = min(m->vol, 9);
break;
case VOLCMD_PANSLIDELEFT:
@@ -3832,7 +3819,7 @@
case CMD_TREMOLO: return 40;
case CMD_KEYOFF: return 32;
case CMD_SETENVPOSITION: return 24;
- case CMD_VELOCITY: return 16;
+ case CMD_DELAYCUT: return 16;
case CMD_XPARAM: return 8;
case CMD_NONE:
default: return 0;
Modified: trunk/OpenMPT/soundlib/mod_specifications.h
===================================================================
--- trunk/OpenMPT/soundlib/mod_specifications.h 2010-04-19 19:20:17 UTC (rev 572)
+++ trunk/OpenMPT/soundlib/mod_specifications.h 2010-04-20 19:38:59 UTC (rev 573)
@@ -89,7 +89,7 @@
true, //Has song comments
MAX_ENVPOINTS, //Envelope point count
" JFEGHLKRXODB?CQATI?SMNVW?UY?P?Z\\:#", // Supported Effects
- " vpcdabuhlrgfe:o", // Supported Volume Column commands
+ " vpcdabuhlrgfe?o", // Supported Volume Column commands
true, // Has "+++" pattern
true, // Has restart position (order)
true, // Supports plugins
@@ -241,8 +241,8 @@
31, //Max Speed
true, //Has song comments
12, //Envelope point count
- " 0123456789ABCDRFFTE???GHK?YXPLZ\\:#", // Supported Effects
- " vpcdabuhlrgfe:o", // Supported Volume Column commands
+ " 0123456789ABCDRFFTE???GHK?YXPLZ\\?#", // Supported Effects
+ " vpcdabuhlrgfe?o", // Supported Volume Column commands
true, // Has "+++" pattern
true, // Has restart position (order)
true, // Supports plugins
@@ -316,7 +316,7 @@
255, //Max Speed
false, //No song comments
0, //No instrument envelopes
- " JFEGHLKRXODB?CQATI?SMNVW?UY?P?Z\\:#", // Supported Effects
+ " JFEGHLKRXODB?CQATI?SMNVW?UY?P?Z\\?#", // Supported Effects
" vp?????????????", // Supported Volume Column commands
true, // Has "+++" pattern
false, // Doesn't have restart position (order)
@@ -390,8 +390,8 @@
255, //Max Speed
true, //Has song comments
25, //Envelope point count
- " JFEGHLKRXODB?CQATI?SMNVW?UY?P?Z\\:#", // Supported Effects
- " vpcdab?h??gfe:o", // Supported Volume Column commands
+ " JFEGHLKRXODB?CQATI?SMNVW?UY?P?Z\\?#", // Supported Effects
+ " vpcdab?h??gfe?o", // Supported Volume Column commands
true, // Has "+++" pattern
true, // Has restart position (order)
true, // Supports plugins
Modified: trunk/OpenMPT/soundlib/modcommand.h
===================================================================
--- trunk/OpenMPT/soundlib/modcommand.h 2010-04-19 19:20:17 UTC (rev 572)
+++ trunk/OpenMPT/soundlib/modcommand.h 2010-04-20 19:38:59 UTC (rev 573)
@@ -96,7 +96,7 @@
#define VOLCMD_TONEPORTAMENTO 11
#define VOLCMD_PORTAUP 12
#define VOLCMD_PORTADOWN 13
-#define VOLCMD_VELOCITY 14 //rewbs.velocity
+#define VOLCMD_DELAYCUT 14 //currently unused
#define VOLCMD_OFFSET 15 //rewbs.volOff
#define MAX_VOLCMDS 16
@@ -135,7 +135,7 @@
#define CMD_SETENVPOSITION 30
#define CMD_MIDI 31
#define CMD_SMOOTHMIDI 32 //rewbs.smoothVST
-#define CMD_VELOCITY 33 //rewbs.velocity
+#define CMD_DELAYCUT 33
#define CMD_XPARAM 34 // -> CODE#0010 -> DESC="add extended parameter mechanism to pattern effects" -! NEW_FEATURE#0010
#define CMD_NOTESLIDEUP 35 // IMF Gxy
#define CMD_NOTESLIDEDOWN 36 // IMF Hxy
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <sag...@us...> - 2010-04-19 19:20:24
|
Revision: 572
http://modplug.svn.sourceforge.net/modplug/?rev=572&view=rev
Author: saga-games
Date: 2010-04-19 19:20:17 +0000 (Mon, 19 Apr 2010)
Log Message:
-----------
[Mod] Added OpenMPT 1.18 release notes document for package template
Modified Paths:
--------------
trunk/OpenMPT/installer/install.iss
Added Paths:
-----------
trunk/OpenMPT/packageTemplate/OMPT_1.18_ReleaseNotes.html
trunk/OpenMPT/packageTemplate/ReleaseNotesImages/1.18/
trunk/OpenMPT/packageTemplate/ReleaseNotesImages/1.18/orderlist.png
trunk/OpenMPT/packageTemplate/ReleaseNotesImages/1.18/treeview.png
trunk/OpenMPT/packageTemplate/ReleaseNotesImages/general/
trunk/OpenMPT/packageTemplate/ReleaseNotesImages/general/modplug.png
Modified: trunk/OpenMPT/installer/install.iss
===================================================================
--- trunk/OpenMPT/installer/install.iss 2010-04-18 20:21:47 UTC (rev 571)
+++ trunk/OpenMPT/installer/install.iss 2010-04-19 19:20:17 UTC (rev 572)
@@ -46,6 +46,12 @@
Source: "..\mptrack\bin\unmo3.dll"; DestDir: "{app}"; Flags: ignoreversion
Source: "packageTemplate\readme.txt"; DestDir: "{app}"; Flags: ignoreversion
Source: "..\packageTemplate\history.txt"; DestDir: "{app}"; Flags: ignoreversion
+
+; release notes
+Source: "..\packageTemplate\ReleaseNotesImages\general\*.*"; DestDir: "{app}\ReleaseNotesImages\general\"; Flags: ignoreversion
+Source: "..\packageTemplate\ReleaseNotesImages\1.18\*.*"; DestDir: "{app}\ReleaseNotesImages\1.18\"; Flags: ignoreversion
+Source: "..\packageTemplate\OMPT_1.18_ReleaseNotes.html"; DestDir: "{app}"; Flags: ignoreversion
+
; soundtouch license stuff
Source: "..\packageTemplate\SoundTouch\*.*"; DestDir: "{app}\SoundTouch"; Flags: ignoreversion
; keymaps
@@ -235,3 +241,4 @@
end;
+
Added: trunk/OpenMPT/packageTemplate/OMPT_1.18_ReleaseNotes.html
===================================================================
--- trunk/OpenMPT/packageTemplate/OMPT_1.18_ReleaseNotes.html (rev 0)
+++ trunk/OpenMPT/packageTemplate/OMPT_1.18_ReleaseNotes.html 2010-04-19 19:20:17 UTC (rev 572)
@@ -0,0 +1,172 @@
+<?xml version="1.0" ?>
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
+ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
+ <head>
+ <title>OpenMPT 1.18 Release Notes</title>
+ <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
+ <meta name="language" content="en" />
+ <style type="text/css">
+ * { font-family: sans-serif; }
+ body
+ {
+ color: #000;
+ background: #fff;
+ font-size:12pt;
+ }
+
+ a { color: #00c; text-decoration: none; }
+ a:visited { color: #909; text-decoration: none; }
+ a:hover { text-decoration: underline; }
+
+ div img, h1
+ {
+ border: 1px solid #ccc;
+ padding: 3px;
+ background: #eee;
+ margin: 0 0 3px 3px;
+ }
+
+ p { padding: 5px; }
+
+ h1
+ {
+ margin: 0;
+ font-size:24pt;
+ }
+ h1 img { vertical-align: middle; }
+
+ h2, h3, h4
+ {
+ border: 1px solid #ddd;
+ border-width: 0 0 0 3em;
+ margin: 15px 5px;
+ padding: 0px 5px;
+ font-size: 18pt;
+ }
+
+ h3 { border-left-width: 2em; }
+ h4 { border-left-width: 1em; }
+
+ li {list-style-type: none; padding:0 0 1em 0; }
+ li:before { content: "» "; }
+
+ </style>
+ </head>
+ <body>
+
+ <h1>
+ <img src="ReleaseNotesImages/general/modplug.png" width="114" height="110" alt="OpenMPT Logo" />
+ OpenMPT 1.18 - Release Notes
+ </h1>
+
+ <p>
+ OpenMPT has changed a lot since the last official release (version 1.17.02.54).
+ This document should give a rough overview about the greatest changes in OpenMPT 1.18.
+ </p>
+
+ <h2>What's new?</h2>
+
+ <h3>General</h3>
+ <div style="float:right;">
+ <img src="ReleaseNotesImages/1.18/treeview.png" width="183" height="338" alt="Improved treeview" title="Improved treeview" />
+ </div>
+ <ul>
+ <li><strong>Sequences</strong>: It is possible to have more than just one orderlist in the MPTM format now.
+ This way, you can work on several tracks or subtunes at once using the same set of instruments.
+ This is for example useful when working on game music. You can also convert your work back
+ 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.
+ 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,
+ Scream Tracker 3, Fasttracker 2 and Impulse Tracker, including a special
+ "ProTracker 1.x" playback mode. Compatibility export features have been enhanced.</li>
+ <li>Support for <strong>ultra-low latency</strong> in ASIO mode, down to 1ms.</li>
+ <li><strong>Time estimation</strong> in the WAV and MP3 export dialogs; improved MP3 export (including ID3 v2.4 Tags).</li>
+ <li><strong>Default directories</strong> for VST plugins and presets.</li>
+ <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>New and <strong>updated keymaps</strong> with many new shortcuts!</li>
+ <li><strong>Redesigned</strong> several dialogs.</li>
+ </ul>
+
+ <h3>Pattern Editor</h3>
+ <div style="float:right;">
+ <img src="ReleaseNotesImages/1.18/orderlist.png" width="348" height="167" alt="New orderlist" title="New orderlist" />
+ </div>
+ <ul>
+ <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
+ 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 automatic, ranging from 0 to 999 (decimal).
+ The effect column (ZZZ) stores the parameter value, also ranging from 0 to 999 (decimal).</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>
+ </ul>
+
+ <h3>Sample Editor</h3>
+ <ul>
+ <li><strong>Sample drawing</strong>! Create new empty samples and doodle around in the sample editor to create cool chip samples,
+ or fix small mistakes (f.e. peaks) in already existing samples.</li>
+ <li><strong>Undo</strong>: Finally, you can now also undo sample modifications; there are up to 100 undo steps for each individual sample.</li>
+ <li><strong>Mass export</strong>: Shift-Click the "Save" button to export all samples at once.</li>
+ <li><strong>Duplicate sample</strong>: Shift-Click the "New" button to clone all settings and the sample itself into a new sample slot.</li>
+ <li><strong>DC Offset Removal</strong>: Samples can now be aligned perfectly to the zero line, to allow maximum amplification.</li>
+ </ul>
+
+ <h3>Instrument Editor</h3>
+ <ul>
+ <li>The envelopes can now be edited using the <strong>keyboard</strong>; some of the default keymaps already have the necessary shortcuts assigned
+ - if you are using a custom keymap, you might want to add those shortcuts to it using the keyboard setup.</li>
+ <li>The <strong>sample map</strong> (IT / MPTM format) is now also applied to VST instruments. This way, you can easily transpose a VST instrument up or down.
+ Some entries have been added to the sample map's context menu, to simplify this.</li>
+ <li>A basic <strong>envelope zoom</strong> feature; Might still look a bit weird at extreme zoom. :-)</li>
+ </ul>
+
+ <h3>VST Plugins</h3>
+ <ul>
+ <li>Pressing <strong>Shift</strong> while changing a plugin parameter in the plugin's GUI will open the
+ MIDI Mapping dialog. Does not work with all plugins.</li>
+ <li>Enhanced <strong>VST compatibility</strong>.</li>
+ </ul>
+
+ <p>
+ For a detailed description of what has changed, check <a href="history.txt">history.txt</a>.
+ </p>
+
+ <h2>Known Issues</h2>
+ <p>
+ <i>This list has mostly been copied over from the old 1.17RC2 release notes, so this not very comprehensive... :-)</i>
+ </p>
+ <ul>
+ <li>Lacking support for VST 2.4+</li>
+ <li>Some controls are vanishing randomly all the time, most notably under Windows Vista and Windows 7.</li>
+ <li>Previewing samples from the treeview's file browser stops the playing module.</li>
+ <li>Cannot preview instruments directly from the MIDI library in the treeview.</li>
+ <li>Excessive performance drop when dragging over the graphical parameter editor during playback.</li>
+ <li>The Right Alt (or Alt Gr) key is not handled well by the keyboard configuration.</li>
+ <li>In Windows 98, the graphical parameter editor and instrument envelope editor grid display are messed up.</li>
+ <li>There is no real way to find out what features of the tracker are supported by the original trackers (Impulse Tracker, Fasttracker 2, etc...) when working with those file formats...</li>
+ </ul>
+
+ <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>.
+ </p>
+
+ </body>
+</html>
\ No newline at end of file
Property changes on: trunk/OpenMPT/packageTemplate/ReleaseNotesImages/1.18
___________________________________________________________________
Added: tsvn:logminsize
+ 10
Added: trunk/OpenMPT/packageTemplate/ReleaseNotesImages/1.18/orderlist.png
===================================================================
(Binary files differ)
Property changes on: trunk/OpenMPT/packageTemplate/ReleaseNotesImages/1.18/orderlist.png
___________________________________________________________________
Added: svn:mime-type
+ application/octet-stream
Added: trunk/OpenMPT/packageTemplate/ReleaseNotesImages/1.18/treeview.png
===================================================================
(Binary files differ)
Property changes on: trunk/OpenMPT/packageTemplate/ReleaseNotesImages/1.18/treeview.png
___________________________________________________________________
Added: svn:mime-type
+ application/octet-stream
Property changes on: trunk/OpenMPT/packageTemplate/ReleaseNotesImages/general
___________________________________________________________________
Added: tsvn:logminsize
+ 10
Added: trunk/OpenMPT/packageTemplate/ReleaseNotesImages/general/modplug.png
===================================================================
(Binary files differ)
Property changes on: trunk/OpenMPT/packageTemplate/ReleaseNotesImages/general/modplug.png
___________________________________________________________________
Added: svn:mime-type
+ application/octet-stream
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <sag...@us...> - 2010-04-18 20:21:54
|
Revision: 571
http://modplug.svn.sourceforge.net/modplug/?rev=571&view=rev
Author: saga-games
Date: 2010-04-18 20:21:47 +0000 (Sun, 18 Apr 2010)
Log Message:
-----------
[Fix] Song Length Estimation: In some special cases (f.e. the order +++, ---, 0), the length estimation was running into an infinite loop.
Modified Paths:
--------------
trunk/OpenMPT/soundlib/Snd_fx.cpp
Modified: trunk/OpenMPT/soundlib/Snd_fx.cpp
===================================================================
--- trunk/OpenMPT/soundlib/Snd_fx.cpp 2010-04-18 14:46:44 UTC (rev 570)
+++ trunk/OpenMPT/soundlib/Snd_fx.cpp 2010-04-18 20:21:47 UTC (rev 571)
@@ -132,13 +132,13 @@
// Check if pattern is valid
nPattern = Order[nCurrentPattern];
- bool positionJumpOnThisRow=false;
- bool patternBreakOnThisRow=false;
+ bool positionJumpOnThisRow = false;
+ bool patternBreakOnThisRow = false;
- while (nPattern >= Patterns.Size())
+ while(nPattern >= Patterns.Size())
{
- // End of song ?
- if ((nPattern == Order.GetInvalidPatIndex()) || (nCurrentPattern >= Order.size()))
+ // End of song?
+ if((nPattern == Order.GetInvalidPatIndex()) || (nCurrentPattern >= Order.size()))
{
if(nCurrentPattern == m_nRestartPos)
break;
@@ -150,6 +150,8 @@
}
nPattern = (nCurrentPattern < Order.size()) ? Order[nCurrentPattern] : Order.GetInvalidPatIndex();
nNextPattern = nCurrentPattern;
+ if(IsRowVisited(nCurrentPattern, 0, true))
+ break;
}
// Skip non-existing patterns
if ((nPattern >= Patterns.Size()) || (!Patterns[nPattern]))
@@ -220,9 +222,9 @@
positionJumpOnThisRow=true;
nNextPattern = (ORDERINDEX)param;
// see http://lpchip.com/modplug/viewtopic.php?t=2769 - FastTracker resets Dxx if Bxx is called _after_ Dxx
- if (!patternBreakOnThisRow || (GetType() == MOD_TYPE_XM)) {
+ if(!patternBreakOnThisRow || (GetType() == MOD_TYPE_XM))
nNextRow = 0;
- }
+
if (bAdjust)
{
pChn->nPatternLoopCount = 0;
@@ -1923,7 +1925,8 @@
//occurs also when pattern loop is enabled.
}
// see http://lpchip.com/modplug/viewtopic.php?t=2769 - FastTracker resets Dxx if Bxx is called _after_ Dxx
- if(GetType() == MOD_TYPE_XM) nBreakRow = 0;
+ if(GetType() == MOD_TYPE_XM)
+ nBreakRow = 0;
break;
// Pattern Break
@@ -4156,5 +4159,5 @@
if(Patterns.IsValidPat(nPat))
return (size_t)(Patterns[nPat].GetNumRows());
else
- return 0;
+ return 1; // invalid patterns consist of a "fake" row.
}
\ No newline at end of file
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <rel...@us...> - 2010-04-18 14:46:51
|
Revision: 570
http://modplug.svn.sourceforge.net/modplug/?rev=570&view=rev
Author: relabsoluness
Date: 2010-04-18 14:46:44 +0000 (Sun, 18 Apr 2010)
Log Message:
-----------
[Fix] Mod conversion: Merging multiple sequences didn't properly convert '---'/'+++' orders.
[Fix] Mod cleanup: Merging sequences could truncate the result sequence to length 256 even for MPTM files (bug introduced in r568).
[Ref] Some refactoring and minor fixing(e.g. moved some mod conversion code that modifies sequences to ModSequence classes).
Modified Paths:
--------------
trunk/OpenMPT/mptrack/CleanupSong.cpp
trunk/OpenMPT/mptrack/Ctrl_seq.cpp
trunk/OpenMPT/mptrack/Moddoc.h
trunk/OpenMPT/mptrack/Modedit.cpp
trunk/OpenMPT/mptrack/View_tre.cpp
trunk/OpenMPT/soundlib/ModSequence.cpp
trunk/OpenMPT/soundlib/ModSequence.h
trunk/OpenMPT/soundlib/Sndfile.cpp
Modified: trunk/OpenMPT/mptrack/CleanupSong.cpp
===================================================================
--- trunk/OpenMPT/mptrack/CleanupSong.cpp 2010-04-17 13:14:48 UTC (rev 569)
+++ trunk/OpenMPT/mptrack/CleanupSong.cpp 2010-04-18 14:46:44 UTC (rev 570)
@@ -1044,9 +1044,9 @@
return true;
}
-// Remove all plugins
+
bool CModCleanupDlg::MergeSequences()
//-----------------------------------
{
- return m_pModDoc->MergeSequences();
+ return m_pModDoc->GetSoundFile()->Order.MergeSequences();
}
Modified: trunk/OpenMPT/mptrack/Ctrl_seq.cpp
===================================================================
--- trunk/OpenMPT/mptrack/Ctrl_seq.cpp 2010-04-17 13:14:48 UTC (rev 569)
+++ trunk/OpenMPT/mptrack/Ctrl_seq.cpp 2010-04-18 14:46:44 UTC (rev 570)
@@ -1374,7 +1374,7 @@
CSoundFile& rSf = *m_pModDoc->GetSoundFile();
if (nSeq == MAX_SEQUENCES + 2)
{
- CString strParam; strParam.Format(TEXT("%u: %s"), rSf.Order.GetCurrentSequenceIndex(), rSf.Order.m_sName);
+ CString strParam; strParam.Format(TEXT("%u: %s"), rSf.Order.GetCurrentSequenceIndex(), (LPCTSTR)rSf.Order.m_sName);
CString str;
AfxFormatString1(str, IDS_CONFIRM_SEQUENCE_DELETE, strParam);
if (AfxMessageBox(str, MB_YESNO | MB_ICONQUESTION) == IDYES)
Modified: trunk/OpenMPT/mptrack/Moddoc.h
===================================================================
--- trunk/OpenMPT/mptrack/Moddoc.h 2010-04-17 13:14:48 UTC (rev 569)
+++ trunk/OpenMPT/mptrack/Moddoc.h 2010-04-18 14:46:44 UTC (rev 570)
@@ -289,9 +289,6 @@
BOOL RemoveChannels(BOOL bChnMask[MAX_CHANNELS]);
- bool MergeSequences();
- bool ConvertSubsongsToMultipleSequences();
-
bool HasMPTHacks(bool autofix = false);
bool m_bHasValidPath; //becomes true if document is loaded or saved.
Modified: trunk/OpenMPT/mptrack/Modedit.cpp
===================================================================
--- trunk/OpenMPT/mptrack/Modedit.cpp 2010-04-17 13:14:48 UTC (rev 569)
+++ trunk/OpenMPT/mptrack/Modedit.cpp 2010-04-18 14:46:44 UTC (rev 570)
@@ -324,38 +324,6 @@
}
}
- // Order list too long? -> remove unnecessary order items first.
- if(m_SndFile.Order.GetLengthTailTrimmed() > specs.ordersMax)
- {
- for(ORDERINDEX nOrd = m_SndFile.Order.GetLengthTailTrimmed() - 1; nOrd > 0; nOrd--)
- {
- if(m_SndFile.Patterns.IsValidPat(m_SndFile.Order[nOrd]) == false)
- {
- for(ORDERINDEX nMoveOrd = nOrd; nMoveOrd < m_SndFile.Order.GetLengthTailTrimmed() - 1; nMoveOrd++)
- {
- m_SndFile.Order[nMoveOrd] = m_SndFile.Order[nMoveOrd + 1];
- }
- m_SndFile.Order[m_SndFile.Order.GetLengthTailTrimmed() - 1] = m_SndFile.Order.GetInvalidPatIndex();
- }
- }
- if(m_SndFile.Order.GetLengthTailTrimmed() > specs.ordersMax)
- {
- AddToLog("WARNING: Order list has been trimmed!\n");
- }
- }
-
- // If not supported, remove "+++" separator order items.
- if(CSoundFile::GetModSpecifications(nNewType).hasIgnoreIndex == false)
- {
- for(ORDERINDEX nOrd = m_SndFile.Order.GetLengthTailTrimmed() - 1; nOrd > 0; nOrd--)
- {
- if(m_SndFile.Order[nOrd] == m_SndFile.Order.GetIgnoreIndex())
- {
- m_SndFile.Order.Remove(nOrd, nOrd);
- }
- }
- }
-
// Is the "restart position" value allowed in this format?
if(m_SndFile.m_nRestartPos > 0 && !CSoundFile::GetModSpecifications(nNewType).hasRestartPos)
{
@@ -391,29 +359,6 @@
END_CRITICAL();
ChangeFileExtension(nNewType);
- // Multisequences not suppported by other formats
- 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)
- {
- bool hasSepPatterns = false;
- for(ORDERINDEX nOrd = 0; nOrd < m_SndFile.Order.GetLengthTailTrimmed(); nOrd++)
- {
- if(!m_SndFile.Patterns.IsValidIndex(m_SndFile.Order[nOrd]))
- {
- hasSepPatterns = true;
- break;
- }
- }
- if(hasSepPatterns &&
- ::MessageBox(NULL,
- "The order list contains separator items.\nThe new format supports multiple sequences, do you want to convert those separate tracks into multiple song sequences?",
- "Order list conversion", MB_YESNO | MB_ICONQUESTION) == IDYES)
- {
- ConvertSubsongsToMultipleSequences();
- }
- }
-
//rewbs.cutomKeys: update effect key commands
CInputHandler *ih = CMainFrame::GetMainFrame()->GetInputHandler();
if (newTypeIsMOD_XM) {
@@ -1680,149 +1625,4 @@
}
}
-// Merge multiple sequences into one sequence
-bool CModDoc::MergeSequences()
-//----------------------------
-{
- if(m_SndFile.Order.GetNumSequences() <= 1) return false;
- CHAR s[256];
- m_SndFile.Order.SetSequence(0);
- m_SndFile.Order.resize(m_SndFile.Order.GetLengthTailTrimmed());
- SEQUENCEINDEX removedSequences = 0; // sequence count
- vector <SEQUENCEINDEX> patternsFixed; // pattern fixed by other sequence already?
- patternsFixed.resize(m_SndFile.Patterns.Size(), SEQUENCEINDEX_INVALID);
- // Set up vector
- for(ORDERINDEX nOrd = 0; nOrd < m_SndFile.Order.GetLengthTailTrimmed(); nOrd++)
- {
- PATTERNINDEX nPat = m_SndFile.Order[nOrd];
- if(!m_SndFile.Patterns.IsValidPat(nPat)) continue;
- patternsFixed[nPat] = 0;
- }
-
- while(m_SndFile.Order.GetNumSequences() > 1)
- {
- removedSequences++;
- const ORDERINDEX nFirstOrder = m_SndFile.Order.GetLengthTailTrimmed() + 1; // +1 for separator item
- if(nFirstOrder + m_SndFile.Order.GetSequence(1).GetLengthTailTrimmed() > m_SndFile.GetModSpecifications().ordersMax)
- {
- wsprintf(s, "WARNING: Cannot merge Sequence %d (too long!)\n", removedSequences);
- AddToLog(s);
- m_SndFile.Order.RemoveSequence(1);
- continue;
- }
- m_SndFile.Order.Append(m_SndFile.Order.GetInvalidPatIndex()); // Separator item
- for(ORDERINDEX nOrd = 0; nOrd < m_SndFile.Order.GetSequence(1).GetLengthTailTrimmed(); nOrd++)
- {
- PATTERNINDEX nPat = m_SndFile.Order.GetSequence(1)[nOrd];
- m_SndFile.Order.Append(nPat);
-
- // Try to fix patterns (Bxx commands)
- if(!m_SndFile.Patterns.IsValidPat(nPat)) continue;
-
- MODCOMMAND *m = m_SndFile.Patterns[nPat];
- for (UINT len = 0; len < m_SndFile.PatternSize[nPat] * m_SndFile.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_SndFile.Patterns.Insert(m_SndFile.PatternSize[nPat]);
- if(nNewPat != SEQUENCEINDEX_INVALID)
- {
- // could create new pattern - copy data over and continue from here.
- m_SndFile.Order[nFirstOrder + nOrd] = nNewPat;
- MODCOMMAND *pSrc = m_SndFile.Patterns[nPat];
- MODCOMMAND *pDest = m_SndFile.Patterns[nNewPat];
- memcpy(pDest, pSrc, m_SndFile.PatternSize[nPat] * m_SndFile.m_nChannels * sizeof(MODCOMMAND));
- m = pDest + len;
- patternsFixed.resize(max(nNewPat + 1, (PATTERNINDEX)patternsFixed.size()), SEQUENCEINDEX_INVALID);
- nPat = nNewPat;
- } else
- {
- // cannot create new pattern: notify the user
- wsprintf(s, "CONFLICT: Pattern break commands in Pattern %d might be broken since it has been used in several sequences!", nPat);
- AddToLog(s);
- }
- }
- m->param += nFirstOrder;
- patternsFixed[nPat] = removedSequences;
- }
- }
-
- }
- 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;
-}
-
-
-// Split subsongs (separated by "---" or "+++" patterns) into sequences
-bool CModDoc::ConvertSubsongsToMultipleSequences()
-//------------------------------------------------
-{
- if(m_SndFile.GetType() != MOD_TYPE_MPT || m_SndFile.Order.GetNumSequences() != 1) return false;
- bool modified = false;
-
- m_SndFile.Order.SetSequence(0);
- for(ORDERINDEX nOrd = 0; nOrd < m_SndFile.Order.GetLengthTailTrimmed(); nOrd++)
- {
- // end of subsong?
- if(!m_SndFile.Patterns.IsValidIndex(m_SndFile.Order[nOrd]))
- {
- ORDERINDEX oldLength = m_SndFile.Order.GetLengthTailTrimmed();
- // remove all separator patterns between current and next subsong first
- while(nOrd < oldLength && (!m_SndFile.Patterns.IsValidIndex(m_SndFile.Order[nOrd])))
- {
- m_SndFile.Order[nOrd] = m_SndFile.Order.GetInvalidPatIndex();
- nOrd++;
- modified = true;
- }
- if(nOrd >= oldLength) break;
- ORDERINDEX startOrd = nOrd;
- modified = true;
-
- SEQUENCEINDEX newSeq = m_SndFile.Order.AddSequence(false);
- m_SndFile.Order.SetSequence(newSeq);
-
- // resize new seqeuence if necessary
- if(m_SndFile.Order.GetLength() < oldLength - startOrd)
- {
- m_SndFile.Order.resize(oldLength - startOrd);
- }
-
- // now, move all following orders to the new sequence
- while(nOrd < oldLength)
- {
- PATTERNINDEX copyPat = m_SndFile.Order.GetSequence(newSeq - 1)[nOrd];
- m_SndFile.Order[nOrd - startOrd] = copyPat;
- nOrd++;
-
- // is this a valid pattern? adjust pattern jump commands, if necessary.
- if(m_SndFile.Patterns.IsValidPat(copyPat))
- {
- MODCOMMAND *m = m_SndFile.Patterns[copyPat];
- for (UINT len = m_SndFile.PatternSize[copyPat] * m_SndFile.m_nChannels; len; m++, len--)
- {
- if(m->command == CMD_POSITIONJUMP && m->param >= startOrd)
- {
- m->param -= startOrd;
- }
- }
- }
- }
- m_SndFile.Order.SetSequence(newSeq - 1);
- m_SndFile.Order.Remove(startOrd, oldLength - 1);
- m_SndFile.Order.SetSequence(newSeq);
- // start from beginning...
- nOrd = 0;
- if(m_SndFile.Order.GetLengthTailTrimmed() == 0 || !m_SndFile.Patterns.IsValidIndex(m_SndFile.Order[nOrd])) break;
- }
- }
- m_SndFile.Order.SetSequence(0);
- return modified;
-}
Modified: trunk/OpenMPT/mptrack/View_tre.cpp
===================================================================
--- trunk/OpenMPT/mptrack/View_tre.cpp 2010-04-17 13:14:48 UTC (rev 569)
+++ trunk/OpenMPT/mptrack/View_tre.cpp 2010-04-18 14:46:44 UTC (rev 570)
@@ -761,7 +761,7 @@
{
// more than one sequence -> add folder
CString sSeqName;
- sSeqName.Format("%d: %s", nSeq, pSndFile->Order.GetSequence(nSeq).m_sName);
+ sSeqName.Format("%d: %s", nSeq, (LPCTSTR)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/ModSequence.cpp
===================================================================
--- trunk/OpenMPT/soundlib/ModSequence.cpp 2010-04-17 13:14:48 UTC (rev 569)
+++ trunk/OpenMPT/soundlib/ModSequence.cpp 2010-04-18 14:46:44 UTC (rev 570)
@@ -1,15 +1,17 @@
#include "stdafx.h"
#include "sndfile.h"
#include "ModSequence.h"
+#include "../mptrack/moddoc.h"
#include "../mptrack/version.h"
#include "../mptrack/serialization_utils.h"
+#include <functional>
#define str_SequenceTruncationNote (GetStrI18N((_TEXT("Module has sequence of length %u; it will be truncated to maximum supported length, %u."))))
#define new DEBUG_NEW
-ModSequence::ModSequence(const CSoundFile& rSf,
+ModSequence::ModSequence(CSoundFile& rSf,
PATTERNINDEX* pArray,
ORDERINDEX nSize,
ORDERINDEX nCapacity,
@@ -25,7 +27,7 @@
{}
-ModSequence::ModSequence(const CSoundFile& rSf, ORDERINDEX nSize) :
+ModSequence::ModSequence(CSoundFile& rSf, ORDERINDEX nSize) :
m_pSndFile(&rSf),
m_bDeletableArray(true),
m_nInvalidIndex(GetInvalidPatIndex(MOD_TYPE_MPT)),
@@ -62,26 +64,58 @@
return false;
}
+namespace
+{
+ // Functor for detecting non-valid patterns from sequence.
+ struct IsNotValidPat
+ {
+ IsNotValidPat(CSoundFile& sndFile) : rSndFile(sndFile) {}
+ bool operator()(PATTERNINDEX i) {return !rSndFile.Patterns.IsValidPat(i);}
+ CSoundFile& rSndFile;
+ };
+}
-void ModSequence::OnModTypeChanged(const MODTYPE oldtype)
-//-------------------------------------------------------
+
+void ModSequence::AdjustToNewModType(const MODTYPE oldtype)
+//---------------------------------------------------------
{
const CModSpecifications specs = m_pSndFile->GetModSpecifications();
+ const MODTYPE newtype = m_pSndFile->GetType();
- m_nInvalidIndex = GetInvalidPatIndex(m_pSndFile->GetType());
- m_nIgnoreIndex = GetIgnoreIndex(m_pSndFile->GetType());
+ m_nInvalidIndex = GetInvalidPatIndex(newtype);
+ m_nIgnoreIndex = GetIgnoreIndex(newtype);
+ // If not supported, remove "+++" separator order items.
+ if (specs.hasIgnoreIndex == false)
+ {
+ if (oldtype != MOD_TYPE_NONE)
+ {
+ iterator i = std::remove_if(begin(), end(), std::bind2nd(std::equal_to<PATTERNINDEX>(), GetIgnoreIndex(oldtype)));
+ std::fill(i, end(), GetInvalidPatIndex());
+ }
+ }
+ else
+ Replace(GetIgnoreIndex(oldtype), GetIgnoreIndex());
+
//Resize orderlist if needed.
- if (specs.ordersMax < GetLength())
+ if (specs.ordersMax < GetLength())
{
+ // Order list too long? -> remove unnecessary order items first.
+ if (oldtype != MOD_TYPE_NONE && specs.ordersMax < GetLengthTailTrimmed())
+ {
+ iterator iter = std::remove_if(begin(), end(), IsNotValidPat(*m_pSndFile));
+ std::fill(iter, end(), GetInvalidPatIndex());
+ if(GetLengthTailTrimmed() > specs.ordersMax)
+ {
+ if (m_pSndFile->GetpModDoc())
+ m_pSndFile->GetpModDoc()->AddToLog("WARNING: Order list has been trimmed!\n");
+ }
+ }
resize(specs.ordersMax);
- /*resize(max(MAX_ORDERS, specs.ordersMax));
- std::fill(begin() + specs.ordersMax, end(), GetInvalidPatIndex());*/
}
-
- //Replace items used to denote end of song/skip order.
- Replace(GetInvalidPatIndex(oldtype), GetInvalidPatIndex());
- Replace(GetIgnoreIndex(oldtype), GetIgnoreIndex());
+
+ // Replace items used to denote end of song order.
+ Replace(GetInvalidPatIndex(oldtype), GetInvalidPatIndex());
}
@@ -235,7 +269,7 @@
/////////////////////////////////////
-ModSequenceSet::ModSequenceSet(const CSoundFile& sndFile)
+ModSequenceSet::ModSequenceSet(CSoundFile& sndFile)
: ModSequence(sndFile, m_Cache, s_nCacheSize, s_nCacheSize, NoArrayDelete),
m_nCurrentSeq(0)
//-------------------------------------------------------------------
@@ -244,8 +278,8 @@
}
-const ModSequence& ModSequenceSet::GetSequence(SEQUENCEINDEX nSeq)
-//----------------------------------------------------------------
+const ModSequence& ModSequenceSet::GetSequence(SEQUENCEINDEX nSeq) const
+//----------------------------------------------------------------------
{
if (nSeq == GetCurrentSequenceIndex())
return *this;
@@ -254,6 +288,16 @@
}
+ModSequence& ModSequenceSet::GetSequence(SEQUENCEINDEX nSeq)
+//----------------------------------------------------------
+{
+ if (nSeq == GetCurrentSequenceIndex())
+ return *this;
+ else
+ return m_Sequences[nSeq];
+}
+
+
void ModSequenceSet::CopyCacheToStorage()
//---------------------------------------
{
@@ -322,6 +366,195 @@
}
+void ModSequenceSet::OnModTypeChanged(const MODTYPE oldtype)
+//----------------------------------------------------------
+{
+ const MODTYPE newtype = m_pSndFile->GetType();
+ const SEQUENCEINDEX nSeqs = GetNumSequences();
+ for(SEQUENCEINDEX n = 0; n < nSeqs; n++)
+ {
+ GetSequence(n).AdjustToNewModType(oldtype);
+ }
+ // Multisequences not suppported by other formats
+ if (oldtype != MOD_TYPE_NONE && newtype != MOD_TYPE_MPT)
+ MergeSequences();
+
+ // Convert sequence with separator patterns into multiple sequences?
+ if (oldtype != MOD_TYPE_NONE && newtype == MOD_TYPE_MPT && GetNumSequences() == 1)
+ ConvertSubsongsToMultipleSequences();
+}
+
+
+bool ModSequenceSet::ConvertSubsongsToMultipleSequences()
+//-------------------------------------------------------
+{
+ // Allow conversion only if there's only one sequence.
+ if (GetNumSequences() != 1 || m_pSndFile->GetType() != MOD_TYPE_MPT)
+ return false;
+
+ bool hasSepPatterns = false;
+ const ORDERINDEX nLengthTt = GetLengthTailTrimmed();
+ for(ORDERINDEX nOrd = 0; nOrd < nLengthTt; nOrd++)
+ {
+ if(!m_pSndFile->Patterns.IsValidIndex(At(nOrd)))
+ {
+ hasSepPatterns = true;
+ break;
+ }
+ }
+ bool modified = false;
+
+ if(hasSepPatterns &&
+ ::MessageBox(NULL,
+ "The order list contains separator items.\nThe new format supports multiple sequences, do you want to convert those separate tracks into multiple song sequences?",
+ "Order list conversion", MB_YESNO | MB_ICONQUESTION) == IDYES)
+ {
+
+ SetSequence(0);
+ for(ORDERINDEX nOrd = 0; nOrd < GetLengthTailTrimmed(); nOrd++)
+ {
+ // end of subsong?
+ if(!m_pSndFile->Patterns.IsValidIndex(At(nOrd)))
+ {
+ ORDERINDEX oldLength = GetLengthTailTrimmed();
+ // remove all separator patterns between current and next subsong first
+ while(nOrd < oldLength && (!m_pSndFile->Patterns.IsValidIndex(At(nOrd))))
+ {
+ At(nOrd) = GetInvalidPatIndex();
+ nOrd++;
+ modified = true;
+ }
+ if(nOrd >= oldLength) break;
+ ORDERINDEX startOrd = nOrd;
+ modified = true;
+
+ SEQUENCEINDEX newSeq = AddSequence(false);
+ SetSequence(newSeq);
+
+ // resize new seqeuence if necessary
+ if(GetLength() < oldLength - startOrd)
+ {
+ resize(oldLength - startOrd);
+ }
+
+ // now, move all following orders to the new sequence
+ while(nOrd < oldLength)
+ {
+ PATTERNINDEX copyPat = GetSequence(newSeq - 1)[nOrd];
+ At(nOrd - startOrd) = copyPat;
+ nOrd++;
+
+ // is this a valid pattern? adjust pattern jump commands, if necessary.
+ 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--)
+ {
+ if(m->command == CMD_POSITIONJUMP && m->param >= startOrd)
+ {
+ m->param = static_cast<BYTE>(m->param - startOrd);
+ }
+ }
+ }
+ }
+ SetSequence(newSeq - 1);
+ Remove(startOrd, oldLength - 1);
+ SetSequence(newSeq);
+ // start from beginning...
+ nOrd = 0;
+ if(GetLengthTailTrimmed() == 0 || !m_pSndFile->Patterns.IsValidIndex(At(nOrd))) break;
+ }
+ }
+ SetSequence(0);
+ }
+ return modified;
+}
+
+bool ModSequenceSet::MergeSequences()
+//-----------------------------------
+{
+ if(GetNumSequences() <= 1)
+ return false;
+
+ CHAR s[256];
+ SetSequence(0);
+ resize(GetLengthTailTrimmed());
+ SEQUENCEINDEX removedSequences = 0; // sequence count
+ vector <SEQUENCEINDEX> patternsFixed; // pattern fixed by other sequence already?
+ patternsFixed.resize(m_pSndFile->Patterns.Size(), SEQUENCEINDEX_INVALID);
+ // Set up vector
+ for(ORDERINDEX nOrd = 0; nOrd < GetLengthTailTrimmed(); nOrd++)
+ {
+ PATTERNINDEX nPat = At(nOrd);
+ if(!m_pSndFile->Patterns.IsValidPat(nPat)) continue;
+ patternsFixed[nPat] = 0;
+ }
+
+ while(GetNumSequences() > 1)
+ {
+ removedSequences++;
+ const ORDERINDEX nFirstOrder = GetLengthTailTrimmed() + 1; // +1 for separator item
+ if(nFirstOrder + GetSequence(1).GetLengthTailTrimmed() > m_pSndFile->GetModSpecifications().ordersMax)
+ {
+ wsprintf(s, "WARNING: Cannot merge Sequence %d (too long!)\n", removedSequences);
+ if (m_pSndFile->GetpModDoc())
+ m_pSndFile->GetpModDoc()->AddToLog(s);
+ RemoveSequence(1);
+ continue;
+ }
+ Append(GetInvalidPatIndex()); // Separator item
+ for(ORDERINDEX nOrd = 0; nOrd < GetSequence(1).GetLengthTailTrimmed(); nOrd++)
+ {
+ PATTERNINDEX nPat = GetSequence(1)[nOrd];
+ Append(nPat);
+
+ // Try to fix patterns (Bxx commands)
+ 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++)
+ {
+ 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]);
+ 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));
+ m = pDest + len;
+ patternsFixed.resize(max(nNewPat + 1, (PATTERNINDEX)patternsFixed.size()), SEQUENCEINDEX_INVALID);
+ nPat = nNewPat;
+ } else
+ {
+ // cannot create new pattern: notify the user
+ wsprintf(s, "CONFLICT: Pattern break commands in Pattern %d might be broken since it has been used in several sequences!", nPat);
+ if (m_pSndFile->GetpModDoc())
+ m_pSndFile->GetpModDoc()->AddToLog(s);
+ }
+ }
+ m->param = static_cast<BYTE>(m->param + nFirstOrder);
+ patternsFixed[nPat] = removedSequences;
+ }
+ }
+
+ }
+ RemoveSequence(1);
+ }
+ // Remove order name + fill up with empty patterns.
+ m_sName = "";
+ const ORDERINDEX nMinLength = (std::min)(ModSequenceSet::s_nCacheSize, m_pSndFile->GetModSpecifications().ordersMax);
+ if (GetLength() < nMinLength)
+ resize(nMinLength);
+ return true;
+}
+
+
/////////////////////////////////////
// Read/Write
/////////////////////////////////////
Modified: trunk/OpenMPT/soundlib/ModSequence.h
===================================================================
--- trunk/OpenMPT/soundlib/ModSequence.h 2010-04-17 13:14:48 UTC (rev 569)
+++ trunk/OpenMPT/soundlib/ModSequence.h 2010-04-18 14:46:44 UTC (rev 570)
@@ -19,14 +19,16 @@
virtual ~ModSequence() {if (m_bDeletableArray) delete[] m_pArray;}
ModSequence(const ModSequence&);
- ModSequence(const CSoundFile& rSf, ORDERINDEX nSize);
- ModSequence(const CSoundFile& rSf, PATTERNINDEX* pArray, ORDERINDEX nSize, ORDERINDEX nCapacity, bool bDeletableArray);
+ ModSequence(CSoundFile& rSf, ORDERINDEX nSize);
+ ModSequence(CSoundFile& rSf, PATTERNINDEX* pArray, ORDERINDEX nSize, ORDERINDEX nCapacity, bool bDeletableArray);
// Initialize default sized sequence.
void Init();
PATTERNINDEX& operator[](const size_t i) {ASSERT(i < m_nSize); return m_pArray[i];}
const PATTERNINDEX& operator[](const size_t i) const {ASSERT(i < m_nSize); return m_pArray[i];}
+ PATTERNINDEX& At(const size_t i) {return (*this)[i];}
+ const PATTERNINDEX& At(const size_t i) const {return (*this)[i];}
PATTERNINDEX& Last() {ASSERT(m_nSize > 0); return m_pArray[m_nSize-1];}
const PATTERNINDEX& Last() const {ASSERT(m_nSize > 0); return m_pArray[m_nSize-1];}
@@ -52,9 +54,9 @@
void resize(ORDERINDEX nNewSize, PATTERNINDEX nFill);
// Replaces all occurences of nOld with nNew.
- void Replace(PATTERNINDEX nOld, PATTERNINDEX nNew) {std::replace(begin(), end(), nOld, nNew);}
+ void Replace(PATTERNINDEX nOld, PATTERNINDEX nNew) {if (nOld != nNew) std::replace(begin(), end(), nOld, nNew);}
- void OnModTypeChanged(const MODTYPE oldtype);
+ void AdjustToNewModType(const MODTYPE oldtype);
ORDERINDEX size() const {return GetLength();}
ORDERINDEX GetLength() const {return m_nSize;}
@@ -106,7 +108,7 @@
PATTERNINDEX m_nInvalidIndex; // Invalid pat index.
PATTERNINDEX m_nIgnoreIndex; // Ignore pat index.
bool m_bDeletableArray; // True if m_pArray points the deletable(with delete[]) array.
- const CSoundFile* m_pSndFile; // Pointer to associated CSoundFile.
+ CSoundFile* m_pSndFile; // Pointer to associated CSoundFile.
static const bool NoArrayDelete = false;
};
@@ -127,10 +129,11 @@
friend void ReadModSequence(std::istream& iStrm, ModSequence& seq, const size_t);
public:
- ModSequenceSet(const CSoundFile& sndFile);
+ ModSequenceSet(CSoundFile& sndFile);
const ModSequence& GetSequence() {return GetSequence(GetCurrentSequenceIndex());}
- const ModSequence& GetSequence(SEQUENCEINDEX nSeq);
+ const ModSequence& GetSequence(SEQUENCEINDEX nSeq) const;
+ ModSequence& GetSequence(SEQUENCEINDEX nSeq);
SEQUENCEINDEX GetNumSequences() const {return static_cast<SEQUENCEINDEX>(m_Sequences.size());}
void SetSequence(SEQUENCEINDEX); // Sets working sequence.
SEQUENCEINDEX AddSequence(bool bDuplicate = true); // Adds new sequence. If bDuplicate is true, new sequence is a duplicate of the old one. Returns the ID of the new sequence.
@@ -138,8 +141,20 @@
void RemoveSequence(SEQUENCEINDEX); // Removes given sequence
SEQUENCEINDEX GetCurrentSequenceIndex() const {return m_nCurrentSeq;}
+ void OnModTypeChanged(const MODTYPE oldtype);
+
ModSequenceSet& operator=(const ModSequence& seq) {ModSequence::operator=(seq); return *this;}
+ // Merges multiple sequences into one and destroys all other sequences.
+ // Returns false if there were no sequences to merge, true otherwise.
+ bool MergeSequences();
+
+ // If there are subsongs (separated by "---" or "+++" patterns) in the module,
+ // asks user whether to convert these into multiple sequences (given that the
+ // modformat supports multiple sequences).
+ // Returns true if sequences were modified, false otherwise.
+ bool ConvertSubsongsToMultipleSequences();
+
static const ORDERINDEX s_nCacheSize = MAX_ORDERS;
private:
Modified: trunk/OpenMPT/soundlib/Sndfile.cpp
===================================================================
--- trunk/OpenMPT/soundlib/Sndfile.cpp 2010-04-17 13:14:48 UTC (rev 569)
+++ trunk/OpenMPT/soundlib/Sndfile.cpp 2010-04-18 14:46:44 UTC (rev 570)
@@ -3027,9 +3027,11 @@
}
void CSoundFile::ChangeModTypeTo(const MODTYPE& newType)
-//---------------------------------------------------
+//------------------------------------------------------
{
const MODTYPE oldtype = m_nType;
+ if (oldtype == newType)
+ return;
m_nType = newType;
SetModSpecsPointer(m_pModSpecs, m_nType);
SetupMODPanning(); // Setup LRRL panning scheme if needed
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <sag...@us...> - 2010-04-17 13:14:57
|
Revision: 569
http://modplug.svn.sourceforge.net/modplug/?rev=569&view=rev
Author: saga-games
Date: 2010-04-17 13:14:48 +0000 (Sat, 17 Apr 2010)
Log Message:
-----------
[Fix] IT Loader: ChibiTracker uses \n instead of \r in the IT comment text, which was not handled properly.
[Fix] S3M Loader: Slightly improved the AdLib instrument detection.
[Ref] Using #defined constants for sample (file)name length now.
[Ref] Some more refactoring, especially in the j2b loader.
Modified Paths:
--------------
trunk/OpenMPT/mptrack/Ctrl_ins.cpp
trunk/OpenMPT/mptrack/Ctrl_smp.cpp
trunk/OpenMPT/mptrack/Draw_pat.cpp
trunk/OpenMPT/mptrack/View_smp.cpp
trunk/OpenMPT/mptrack/dlg_misc.cpp
trunk/OpenMPT/mptrack/view_com.cpp
trunk/OpenMPT/soundlib/Dlsbank.cpp
trunk/OpenMPT/soundlib/IT_DEFS.H
trunk/OpenMPT/soundlib/Load_it.cpp
trunk/OpenMPT/soundlib/Load_s3m.cpp
trunk/OpenMPT/soundlib/Sampleio.cpp
trunk/OpenMPT/soundlib/Snd_defs.h
trunk/OpenMPT/soundlib/Sndfile.h
trunk/OpenMPT/soundlib/Sndmix.cpp
trunk/OpenMPT/soundlib/load_j2b.cpp
trunk/OpenMPT/soundlib/modcommand.h
Modified: trunk/OpenMPT/mptrack/Ctrl_ins.cpp
===================================================================
--- trunk/OpenMPT/mptrack/Ctrl_ins.cpp 2010-04-14 21:31:59 UTC (rev 568)
+++ trunk/OpenMPT/mptrack/Ctrl_ins.cpp 2010-04-17 13:14:48 UTC (rev 569)
@@ -306,7 +306,7 @@
{
wsprintf(s, "%d: ", j);
UINT l = strlen(s);
- memcpy(s+l, pSndFile->m_szNames[j], 32);
+ memcpy(s+l, pSndFile->m_szNames[j], MAX_SAMPLENAME);
s[l+32] = 0;
AppendMenu(hSubMenu, MF_STRING, ID_NOTEMAP_EDITSAMPLE+j, s);
}
Modified: trunk/OpenMPT/mptrack/Ctrl_smp.cpp
===================================================================
--- trunk/OpenMPT/mptrack/Ctrl_smp.cpp 2010-04-14 21:31:59 UTC (rev 568)
+++ trunk/OpenMPT/mptrack/Ctrl_smp.cpp 2010-04-17 13:14:48 UTC (rev 569)
@@ -615,11 +615,11 @@
wsprintf(s, "%d-bit %s, len: %d", pSmp->GetElementarySampleSize() * 8, (pSmp->uFlags & CHN_STEREO) ? "stereo" : "mono", pSmp->nLength);
SetDlgItemText(IDC_TEXT5, s);
// Name
- memcpy(s, m_pSndFile->m_szNames[m_nSample], 32);
+ memcpy(s, m_pSndFile->m_szNames[m_nSample], MAX_SAMPLENAME);
s[31] = 0;
SetDlgItemText(IDC_SAMPLE_NAME, s);
// File Name
- memcpy(s, pSmp->filename, 22);
+ memcpy(s, pSmp->filename, MAX_SAMPLEFILENAME);
s[21] = 0;
if (m_pSndFile->m_nType & (MOD_TYPE_MOD|MOD_TYPE_XM)) s[0] = 0;
SetDlgItemText(IDC_SAMPLE_FILENAME, s);
@@ -791,16 +791,16 @@
// MOD/XM
strcat(szFullFilename, szExt);
szFullFilename[31] = 0;
- memcpy(m_pSndFile->m_szNames[m_nSample], szFullFilename, 32);
+ memcpy(m_pSndFile->m_szNames[m_nSample], szFullFilename, MAX_SAMPLENAME);
} else
{
// S3M/IT
szFullFilename[31] = 0;
- if (!m_pSndFile->m_szNames[m_nSample][0]) memcpy(m_pSndFile->m_szNames[m_nSample], szFullFilename, 32);
+ if (!m_pSndFile->m_szNames[m_nSample][0]) memcpy(m_pSndFile->m_szNames[m_nSample], szFullFilename, MAX_SAMPLENAME);
if (strlen(szFullFilename) < 9) strcat(szFullFilename, szExt);
}
szFullFilename[21] = 0;
- memcpy(pSmp->filename, szFullFilename, 22);
+ memcpy(pSmp->filename, szFullFilename, MAX_SAMPLEFILENAME);
}
if ((m_pSndFile->m_nType & MOD_TYPE_XM) && (!(pSmp->uFlags & CHN_PANNING)))
{
@@ -980,11 +980,11 @@
}
if (m_pSndFile->m_nType & (MOD_TYPE_S3M|MOD_TYPE_IT|MOD_TYPE_MPT))
{
- memcpy(szFileName, m_pSndFile->Samples[m_nSample].filename, 22);
+ memcpy(szFileName, m_pSndFile->Samples[m_nSample].filename, MAX_SAMPLEFILENAME);
szFileName[22] = 0;
} else
{
- memcpy(szFileName, m_pSndFile->m_szNames[m_nSample], 32);
+ memcpy(szFileName, m_pSndFile->m_szNames[m_nSample], MAX_SAMPLENAME);
szFileName[32] = 0; }
if (!szFileName[0]) strcpy(szFileName, "untitled");
}
@@ -2313,9 +2313,9 @@
m_EditName.GetWindowText(s, sizeof(s));
for (UINT i=strlen(s); i<32; i++) s[i] = 0;
s[31] = 0;
- if (strncmp(s, m_pSndFile->m_szNames[m_nSample], 32))
+ if (strncmp(s, m_pSndFile->m_szNames[m_nSample], MAX_SAMPLENAME))
{
- memcpy(m_pSndFile->m_szNames[m_nSample], s, 32);
+ memcpy(m_pSndFile->m_szNames[m_nSample], s, MAX_SAMPLENAME);
m_pModDoc->UpdateAllViews(NULL, (m_nSample << HINT_SHIFT_SMP) | (HINT_SMPNAMES|HINT_SAMPLEINFO), this);
m_pModDoc->UpdateAllViews(NULL, HINT_INSNAMES, this);
m_pModDoc->SetModified();
@@ -2333,9 +2333,9 @@
m_EditFileName.GetWindowText(s, sizeof(s));
s[21] = 0;
for (UINT i=strlen(s); i<22; i++) s[i] = 0;
- if (strncmp(s, m_pSndFile->Samples[m_nSample].filename, 22))
+ if (strncmp(s, m_pSndFile->Samples[m_nSample].filename, MAX_SAMPLEFILENAME))
{
- memcpy(m_pSndFile->Samples[m_nSample].filename, s, 22);
+ memcpy(m_pSndFile->Samples[m_nSample].filename, s, MAX_SAMPLEFILENAME);
m_pModDoc->UpdateAllViews(NULL, (m_nSample << HINT_SHIFT_SMP) | HINT_SAMPLEINFO, this);
if (m_pSndFile->m_nType & (MOD_TYPE_S3M|MOD_TYPE_IT|MOD_TYPE_MPT)) m_pModDoc->SetModified();
}
Modified: trunk/OpenMPT/mptrack/Draw_pat.cpp
===================================================================
--- trunk/OpenMPT/mptrack/Draw_pat.cpp 2010-04-14 21:31:59 UTC (rev 568)
+++ trunk/OpenMPT/mptrack/Draw_pat.cpp 2010-04-17 13:14:48 UTC (rev 569)
@@ -947,7 +947,8 @@
{
UINT command = m->command & 0x3F;
int n = (pSndFile->m_nType & (MOD_TYPE_MOD|MOD_TYPE_XM)) ? gszModCommands[command] : gszS3mCommands[command];
- if (n <= ' ') n = '?';
+ ASSERT(n > ' ');
+ //if (n <= ' ') n = '?';
DrawLetter(xbmp+x, 0, (char)n, pfnt->nEltWidths[3], pfnt->nCmdOfs);
} else
{
@@ -1472,7 +1473,7 @@
if ((nsmp) && (nsmp <= pSndFile->m_nSamples))
{
CHAR sztmp2[64] = "";
- memcpy(sztmp2, pSndFile->m_szNames[nsmp], 32);
+ memcpy(sztmp2, pSndFile->m_szNames[nsmp], MAX_SAMPLENAME);
sztmp2[32] = 0;
if (sztmp2[0])
{
@@ -1485,7 +1486,7 @@
{
if (m->instr <= pSndFile->m_nSamples)
{
- memcpy(sztmp, pSndFile->m_szNames[m->instr], 32);
+ memcpy(sztmp, pSndFile->m_szNames[m->instr], MAX_SAMPLENAME);
sztmp[32] = 0;
}
}
Modified: trunk/OpenMPT/mptrack/View_smp.cpp
===================================================================
--- trunk/OpenMPT/mptrack/View_smp.cpp 2010-04-14 21:31:59 UTC (rev 568)
+++ trunk/OpenMPT/mptrack/View_smp.cpp 2010-04-17 13:14:48 UTC (rev 569)
@@ -1421,7 +1421,8 @@
{
CHAR s[256];
DWORD dwPos = ScreenToSample(pt.x);
- if (dwPos <= pSmp->nLength) {
+ if (dwPos <= pSmp->nLength)
+ {
//Set loop points
wsprintf(s, "Set Loop Start to:\t%d", dwPos);
::AppendMenu(hMenu, MF_STRING|((dwPos+4<=pSmp->nLoopEnd)?0:MF_GRAYED),
@@ -1475,7 +1476,7 @@
// if there's no selection, but loop points
//::AppendMenu(hMenu, MF_STRING|(m_dwEndSel>m_dwBeginSel)?0:MF_GRAYED,
// ID_SAMPLE_TRIM, "Trim\t" + ih->GetKeyTextFromCommand(kcSampleTrim));
- ::AppendMenu(hMenu, MF_STRING|(bIsGrayed)?MF_GRAYED:0, ID_SAMPLE_TRIM, sTrimMenuText.c_str());
+ ::AppendMenu(hMenu, MF_STRING|(bIsGrayed) ? MF_GRAYED : 0, ID_SAMPLE_TRIM, sTrimMenuText.c_str());
::AppendMenu(hMenu, MF_STRING, ID_EDIT_CUT, "Cut\t" + ih->GetKeyTextFromCommand(kcEditCut));
::AppendMenu(hMenu, MF_STRING, ID_EDIT_COPY, "Copy\t" + ih->GetKeyTextFromCommand(kcEditCopy));
}
@@ -1857,8 +1858,8 @@
pxh->xtra_len += 32;
if (pSmp->filename[0])
{
- memcpy(pszText+32, pSmp->filename, 22);
- pxh->xtra_len += 22;
+ memcpy(pszText + 32, pSmp->filename, MAX_SAMPLEFILENAME);
+ pxh->xtra_len += MAX_SAMPLEFILENAME;
}
}
phdr->filesize += sizeof(WAVESMPLHEADER) + pxh->xtra_len + 8;
Modified: trunk/OpenMPT/mptrack/dlg_misc.cpp
===================================================================
--- trunk/OpenMPT/mptrack/dlg_misc.cpp 2010-04-14 21:31:59 UTC (rev 568)
+++ trunk/OpenMPT/mptrack/dlg_misc.cpp 2010-04-17 13:14:48 UTC (rev 569)
@@ -1337,7 +1337,7 @@
if (pSndFile->Instruments[i])
memcpy(s+k, pSndFile->Instruments[i]->name, 32);
} else
- memcpy(s+k, pSndFile->m_szNames[i], 32);
+ memcpy(s+k, pSndFile->m_szNames[i], MAX_SAMPLENAME);
s[k+32] = 0;
combo->SetItemData(combo->AddString(s), i);
}
Modified: trunk/OpenMPT/mptrack/view_com.cpp
===================================================================
--- trunk/OpenMPT/mptrack/view_com.cpp 2010-04-14 21:31:59 UTC (rev 568)
+++ trunk/OpenMPT/mptrack/view_com.cpp 2010-04-17 13:14:48 UTC (rev 569)
@@ -247,7 +247,7 @@
switch(iCol)
{
case SMPLIST_SAMPLENAME:
- lstrcpyn(s, pSndFile->m_szNames[iSmp+1], 32);
+ lstrcpyn(s, pSndFile->m_szNames[iSmp+1], MAX_SAMPLENAME);
break;
case SMPLIST_SAMPLENO:
wsprintf(s, "%02d", iSmp+1);
Modified: trunk/OpenMPT/soundlib/Dlsbank.cpp
===================================================================
--- trunk/OpenMPT/soundlib/Dlsbank.cpp 2010-04-14 21:31:59 UTC (rev 568)
+++ trunk/OpenMPT/soundlib/Dlsbank.cpp 2010-04-17 13:14:48 UTC (rev 569)
@@ -1592,7 +1592,7 @@
if (pSndFile->m_nType & MOD_TYPE_XM) psmp->uFlags |= CHN_PANNING;
}
}
- if (pDlsIns->szName[0]) memcpy(pSndFile->m_szNames[nSample], pDlsIns->szName, 31);
+ if (pDlsIns->szName[0]) memcpy(pSndFile->m_szNames[nSample], pDlsIns->szName, MAX_SAMPLENAME - 1);
bOk = TRUE;
}
FreeWaveForm(pWaveForm);
Modified: trunk/OpenMPT/soundlib/IT_DEFS.H
===================================================================
--- trunk/OpenMPT/soundlib/IT_DEFS.H 2010-04-14 21:31:59 UTC (rev 568)
+++ trunk/OpenMPT/soundlib/IT_DEFS.H 2010-04-17 13:14:48 UTC (rev 569)
@@ -25,7 +25,7 @@
BYTE pwd; // pitch wheel depth
WORD msglength;
DWORD msgoffset;
- DWORD reserved;
+ DWORD reserved; // ChibiTracker writes "CHBI" here.
BYTE chnpan[64];
BYTE chnvol[64];
} ITFILEHEADER;
Modified: trunk/OpenMPT/soundlib/Load_it.cpp
===================================================================
--- trunk/OpenMPT/soundlib/Load_it.cpp 2010-04-14 21:31:59 UTC (rev 568)
+++ trunk/OpenMPT/soundlib/Load_it.cpp 2010-04-17 13:14:48 UTC (rev 569)
@@ -1030,6 +1030,15 @@
{
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)
+ {
+ for(size_t i = 0; i < pifh->msglength; i++)
+ {
+ if(m_lpszSongComments[i] == '\n')
+ m_lpszSongComments[i] = '\r';
+ }
+ }
}
}
// Reading orders
Modified: trunk/OpenMPT/soundlib/Load_s3m.cpp
===================================================================
--- trunk/OpenMPT/soundlib/Load_s3m.cpp 2010-04-14 21:31:59 UTC (rev 568)
+++ trunk/OpenMPT/soundlib/Load_s3m.cpp 2010-04-17 13:14:48 UTC (rev 569)
@@ -393,7 +393,7 @@
Samples[iSmp].nLoopStart = Samples[iSmp].nLoopEnd = 0;
Samples[iSmp].nPan = 0x80;
//ASSERT(iLooplength == 0 || iLooplength > 4);
- } else if(s[0] == S3I_TYPE_ADMEL)
+ } else if(s[0] >= S3I_TYPE_ADMEL)
{
bHasAdlibPatches = true;
}
Modified: trunk/OpenMPT/soundlib/Sampleio.cpp
===================================================================
--- trunk/OpenMPT/soundlib/Sampleio.cpp 2010-04-14 21:31:59 UTC (rev 568)
+++ trunk/OpenMPT/soundlib/Sampleio.cpp 2010-04-17 13:14:48 UTC (rev 569)
@@ -557,15 +557,15 @@
// Name present (clipboard only)
UINT xtrabytes = pxh->xtra_len + 8 - sizeof(WAVEEXTRAHEADER);
LPSTR pszTextEx = (LPSTR)(pxh+1);
- if (xtrabytes >= 32)
+ if (xtrabytes >= MAX_SAMPLENAME)
{
- memcpy(m_szNames[nSample], pszTextEx, 31);
- pszTextEx += 32;
- xtrabytes -= 32;
- if (xtrabytes >= 22)
+ memcpy(m_szNames[nSample], pszTextEx, MAX_SAMPLENAME - 1);
+ pszTextEx += MAX_SAMPLENAME;
+ xtrabytes -= MAX_SAMPLENAME;
+ if (xtrabytes >= MAX_SAMPLEFILENAME)
{
- memcpy(pSmp->filename, pszTextEx, 22);
- xtrabytes -= 22;
+ memcpy(pSmp->filename, pszTextEx, MAX_SAMPLEFILENAME);
+ xtrabytes -= MAX_SAMPLEFILENAME;
}
}
}
Modified: trunk/OpenMPT/soundlib/Snd_defs.h
===================================================================
--- trunk/OpenMPT/soundlib/Snd_defs.h 2010-04-14 21:31:59 UTC (rev 568)
+++ trunk/OpenMPT/soundlib/Snd_defs.h 2010-04-17 13:14:48 UTC (rev 569)
@@ -75,6 +75,9 @@
#define MAX_ENVPOINTS 240
#define MIN_PERIOD 0x0020
#define MAX_PERIOD 0xFFFF
+// String lengths
+#define MAX_SAMPLENAME 32 // also affects module name!
+#define MAX_SAMPLEFILENAME 22
#define MAX_PATTERNNAME 32
#define MAX_CHANNELNAME 20
#define MAX_INFONAME 80
@@ -136,7 +139,7 @@
#define CHN_KEYOFF 0x200 // exit sustain
#define CHN_NOTEFADE 0x400 // fade note (instrument mode)
#define CHN_SURROUND 0x800 // use surround channel
-#define CHN_NOIDO 0x1000 // ???
+#define CHN_NOIDO 0x1000 // Indicates if the channel is near enough to an exact multiple of the base frequency that any interpolation won't be noticeable - or if interpolation was switched off completely. --Storlek
#define CHN_HQSRC 0x2000 // ???
#define CHN_FILTER 0x4000 // filtered output
#define CHN_VOLUMERAMP 0x8000 // ramp volume
@@ -391,4 +394,11 @@
INST_NUMFILTERMODES
};*/
+// Vibrato Types
+#define VIB_SINE 0
+#define VIB_SQUARE 1
+#define VIB_RAMP_UP 2
+#define VIB_RAMP_DOWN 3
+#define VIB_RANDOM 4
+
#endif
Modified: trunk/OpenMPT/soundlib/Sndfile.h
===================================================================
--- trunk/OpenMPT/soundlib/Sndfile.h 2010-04-14 21:31:59 UTC (rev 568)
+++ trunk/OpenMPT/soundlib/Sndfile.h 2010-04-17 13:14:48 UTC (rev 569)
@@ -41,7 +41,7 @@
BYTE nVibDepth;
BYTE nVibRate;
CHAR name[32];
- CHAR filename[22];
+ CHAR filename[MAX_SAMPLEFILENAME];
// Return the size of one (elementary) sample in bytes.
uint8 GetElementarySampleSize() const {return (uFlags & CHN_16BIT) ? 2 : 1;}
@@ -596,7 +596,7 @@
MODSAMPLE Samples[MAX_SAMPLES]; // Sample Headers
MODINSTRUMENT *Instruments[MAX_INSTRUMENTS]; // Instrument Headers
MODINSTRUMENT m_defaultInstrument; // Currently only used to get default values for extented properties.
- CHAR m_szNames[MAX_SAMPLES][32]; // Song and sample names
+ CHAR m_szNames[MAX_SAMPLES][MAX_SAMPLENAME]; // Song and sample names
MODMIDICFG m_MidiCfg; // Midi macro config table
SNDMIXPLUGIN m_MixPlugins[MAX_MIXPLUGINS]; // Mix plugins
SNDMIXSONGEQ m_SongEQ; // Default song EQ preset
Modified: trunk/OpenMPT/soundlib/Sndmix.cpp
===================================================================
--- trunk/OpenMPT/soundlib/Sndmix.cpp 2010-04-14 21:31:59 UTC (rev 568)
+++ trunk/OpenMPT/soundlib/Sndmix.cpp 2010-04-17 13:14:48 UTC (rev 569)
@@ -872,7 +872,8 @@
{
int nchn32 = 0;
MODCHANNEL *pChn = Chn;
- for (UINT nChn=0; nChn<m_nChannels; nChn++,pChn++) {
+ for (UINT nChn=0; nChn<m_nChannels; nChn++,pChn++)
+ {
//if(!(pChn->dwFlags & CHN_MUTE)) //removed by rewbs: fix http://www.modplug.com/forum/viewtopic.php?t=3358
nchn32++;
}
@@ -880,7 +881,8 @@
DWORD mastervol;
- if (m_pConfig->getUseGlobalPreAmp()) {
+ if (m_pConfig->getUseGlobalPreAmp())
+ {
int realmastervol = m_nMasterVolume;
if (realmastervol > 0x80) {
//Attenuate global pre-amp depending on num channels
@@ -909,7 +911,7 @@
// Update channels data
m_nMixChannels = 0;
MODCHANNEL *pChn = Chn;
- for (UINT nChn=0; nChn<MAX_CHANNELS; nChn++,pChn++)
+ for (UINT nChn = 0; nChn < MAX_CHANNELS; nChn++, pChn++)
{
skipchn:
@@ -937,8 +939,9 @@
pChn++;
}
}
- if (nChn < MAX_CHANNELS) goto skipchn;
- goto done;
+ if (nChn < MAX_CHANNELS)
+ goto skipchn; // >:(
+ break;
}
// Reset channel data
pChn->nInc = 0;
@@ -973,13 +976,12 @@
{
if(!(GetType() & (MOD_TYPE_IT | MOD_TYPE_MPT)) || GetModFlag(MSF_OLDVOLSWING))
{
- vol = pChn->nVolume + pChn->nVolSwing;
+ vol += pChn->nVolSwing;
}
else
{
pChn->nVolume += pChn->nVolSwing;
- if(pChn->nVolume > 256) pChn->nVolume = 256;
- if(pChn->nVolume < 0) pChn->nVolume = 0;
+ pChn->nVolume = CLAMP(pChn->nVolume, 0, 256);
vol = pChn->nVolume;
pChn->nVolSwing = 0;
}
@@ -1034,7 +1036,8 @@
// IT compatibility 12. / 13.: Tremor
if(IsCompatibleMode(TRK_IMPULSETRACKER))
{
- if ((pChn->nTremorCount & 128) && pChn->nLength) {
+ if ((pChn->nTremorCount & 128) && pChn->nLength)
+ {
if (pChn->nTremorCount == 128)
pChn->nTremorCount = (pChn->nTremorParam >> 4) | 192;
else if (pChn->nTremorCount == 192)
@@ -1934,7 +1937,7 @@
pChn->nLength = 0;
}
}
-done:
+
// Checking Max Mix Channels reached: ordering by volume
if ((m_nMixChannels >= m_nMaxMixChannels) && (!(gdwSoundSetup & SNDMIX_DIRECTTODISK)))
{
Modified: trunk/OpenMPT/soundlib/load_j2b.cpp
===================================================================
--- trunk/OpenMPT/soundlib/load_j2b.cpp 2010-04-14 21:31:59 UTC (rev 568)
+++ trunk/OpenMPT/soundlib/load_j2b.cpp 2010-04-17 13:14:48 UTC (rev 569)
@@ -17,84 +17,84 @@
// header for compressed j2b files
struct J2BHEADER
{
- DWORD signature; // MUSE
- DWORD deadbeaf; // 0xDEADBEAF (AM) or 0xDEADBABE (AMFF)
- DWORD j2blength; // complete filesize
- DWORD crc32; // checksum of the compressed data block
- DWORD packed_length; // length of the compressed data block
- DWORD unpacked_length; // length of the decompressed module
+ uint32 signature; // MUSE
+ uint32 deadbeaf; // 0xDEADBEAF (AM) or 0xDEADBABE (AMFF)
+ uint32 j2blength; // complete filesize
+ uint32 crc32; // checksum of the compressed data block
+ uint32 packed_length; // length of the compressed data block
+ uint32 unpacked_length; // length of the decompressed module
};
// am(ff) stuff
-struct RIFFCHUNK
+struct AMFF_RIFFCHUNK
{
- DWORD signature; // "RIFF"
- DWORD chunksize; // chunk size without header
+ uint32 signature; // "RIFF"
+ uint32 chunksize; // chunk size without header
};
// this header is used for both AM's "INIT" as well as AMFF's "MAIN" chunk
struct AMFFCHUNK_MAIN
{
- char songname[64];
- BYTE flags;
- BYTE channels;
- BYTE speed;
- BYTE tempo;
- DWORD unknown;
- BYTE globalvolume;
+ char songname[64];
+ uint8 flags;
+ uint8 channels;
+ uint8 speed;
+ uint8 tempo;
+ uint32 unknown;
+ uint8 globalvolume;
};
struct AMFFCHUNK_INSTRUMENT
{
- BYTE unknown; // 0x00
- BYTE sample; // sample number
+ uint8 unknown; // 0x00
+ uint8 sample; // sample number
char name[28];
char stuff[195]; // lots of NULs?
};
struct AMFFCHUNK_SAMPLE
{
- DWORD signature; // "SAMP"
- DWORD chunksize; // header + sample size
- char name[28];
- BYTE pan;
- BYTE volume;
- WORD flags;
- DWORD length;
- DWORD loopstart;
- DWORD loopend;
- DWORD samplerate;
- DWORD reserved1;
- DWORD reserved2;
+ uint32 signature; // "SAMP"
+ uint32 chunksize; // header + sample size
+ char name[28];
+ uint8 pan;
+ uint8 volume;
+ uint16 flags;
+ uint32 length;
+ uint32 loopstart;
+ uint32 loopend;
+ uint32 samplerate;
+ uint32 reserved1;
+ uint32 reserved2;
};
struct AMCHUNK_INSTRUMENT
{
- BYTE unknown; // 0x00
- BYTE sample; // sample number
+ uint8 unknown; // 0x00
+ uint8 sample; // sample number
char name[32];
};
struct AMCHUNK_SAMPLE
{
- DWORD signature; // "SAMP"
- DWORD chunksize; // header + sample size
- DWORD headsize; // header size
- char name[32];
- WORD pan;
- WORD volume;
- WORD flags;
- WORD unkown;
- DWORD length;
- DWORD loopstart;
- DWORD loopend;
- DWORD samplerate;
+ uint32 signature; // "SAMP"
+ uint32 chunksize; // header + sample size
+ uint32 headsize; // header size
+ char name[32];
+ uint16 pan;
+ uint16 volume;
+ uint16 flags;
+ uint16 unkown;
+ uint32 length;
+ uint32 loopstart;
+ uint32 loopend;
+ uint32 samplerate;
};
#pragma pack()
-static BYTE riffam_efftrans[26] =
+static uint8 riffam_efftrans[26] =
{
CMD_ARPEGGIO, CMD_PORTAMENTOUP, CMD_PORTAMENTODOWN, CMD_TONEPORTAMENTO,
CMD_VIBRATO, CMD_TONEPORTAVOL, CMD_VIBRATOVOL, CMD_TREMOLO,
@@ -126,7 +126,7 @@
MODCOMMAND *mrow = Patterns[nPat];
MODCOMMAND *m = mrow;
ROWINDEX nRow = 0;
- BYTE flags;
+ uint8 flags;
while((nRow < nRows) && (dwMemPos < dwMemLength))
{
@@ -245,29 +245,29 @@
DWORD dwMemPos = 0;
- ASSERT_CAN_READ(sizeof(RIFFCHUNK));
- RIFFCHUNK *chunkheader = (RIFFCHUNK *)lpStream;
+ ASSERT_CAN_READ(sizeof(AMFF_RIFFCHUNK));
+ AMFF_RIFFCHUNK *chunkheader = (AMFF_RIFFCHUNK *)lpStream;
if(LittleEndian(chunkheader->signature) != 0x46464952 // "RIFF"
- || LittleEndian(chunkheader->chunksize) != dwMemLength - sizeof(RIFFCHUNK)
+ || LittleEndian(chunkheader->chunksize) != dwMemLength - sizeof(AMFF_RIFFCHUNK)
) return false;
- dwMemPos += sizeof(RIFFCHUNK);
+ dwMemPos += sizeof(AMFF_RIFFCHUNK);
bool bIsAM; // false: AMFF, true: AM
ASSERT_CAN_READ(4);
- if(LittleEndian(*(DWORD *)(lpStream + dwMemPos)) == 0x46464D41) bIsAM = false; // "AMFF"
- else if(LittleEndian(*(DWORD *)(lpStream + dwMemPos)) == 0x20204D41) bIsAM = true; // "AM "
+ if(LittleEndian(*(uint32 *)(lpStream + dwMemPos)) == 0x46464D41) bIsAM = false; // "AMFF"
+ else if(LittleEndian(*(uint32 *)(lpStream + dwMemPos)) == 0x20204D41) bIsAM = true; // "AM "
else return false;
dwMemPos += 4;
// go through all chunks now
while(dwMemPos < dwMemLength)
{
- ASSERT_CAN_READ(sizeof(RIFFCHUNK));
- chunkheader = (RIFFCHUNK *)(lpStream + dwMemPos);
- dwMemPos += sizeof(RIFFCHUNK);
+ ASSERT_CAN_READ(sizeof(AMFF_RIFFCHUNK));
+ chunkheader = (AMFF_RIFFCHUNK *)(lpStream + dwMemPos);
+ dwMemPos += sizeof(AMFF_RIFFCHUNK);
ASSERT_CAN_READ(LittleEndian(chunkheader->chunksize));
DWORD dwChunkEnd = dwMemPos + LittleEndian(chunkheader->chunksize);
@@ -380,17 +380,17 @@
if(bIsAM)
{
ASSERT_CAN_READ_CHUNK(4);
- if(LittleEndian(*(DWORD *)(lpStream + dwMemPos)) != 0x20204941) break; // "AI "
+ if(LittleEndian(*(uint32 *)(lpStream + dwMemPos)) != 0x20204941) break; // "AI "
dwMemPos += 4;
- ASSERT_CAN_READ_CHUNK(sizeof(RIFFCHUNK));
- RIFFCHUNK *instchunk = (RIFFCHUNK *)(lpStream + dwMemPos);
- dwMemPos += sizeof(RIFFCHUNK);
+ ASSERT_CAN_READ_CHUNK(sizeof(AMFF_RIFFCHUNK));
+ AMFF_RIFFCHUNK *instchunk = (AMFF_RIFFCHUNK *)(lpStream + dwMemPos);
+ dwMemPos += sizeof(AMFF_RIFFCHUNK);
ASSERT_CAN_READ_CHUNK(LittleEndian(instchunk->chunksize));
if(LittleEndian(instchunk->signature) != 0x54534E49) break; // "INST"
ASSERT_CAN_READ_CHUNK(4);
- DWORD dwHeadlen = LittleEndian(*(DWORD *)(lpStream + dwMemPos));
+ DWORD dwHeadlen = LittleEndian(*(uint32 *)(lpStream + dwMemPos));
dwMemPos +=4 ;
ASSERT_CAN_READ_CHUNK(sizeof(AMCHUNK_INSTRUMENT));
@@ -405,14 +405,14 @@
memcpy(m_szNames[nSmp], instheadchunk->name, 32);
SpaceToNullStringFixed(m_szNames[nSmp], 31);
- ASSERT_CAN_READ_CHUNK(sizeof(RIFFCHUNK));
- instchunk = (RIFFCHUNK *)(lpStream + dwMemPos);
- dwMemPos += sizeof(RIFFCHUNK);
+ ASSERT_CAN_READ_CHUNK(sizeof(AMFF_RIFFCHUNK));
+ instchunk = (AMFF_RIFFCHUNK *)(lpStream + dwMemPos);
+ dwMemPos += sizeof(AMFF_RIFFCHUNK);
ASSERT_CAN_READ_CHUNK(LittleEndian(instchunk->chunksize));
if(LittleEndian(instchunk->signature) != 0x46464952) break; // yet another "RIFF"...
ASSERT_CAN_READ_CHUNK(4);
- if(LittleEndian(*(DWORD *)(lpStream + dwMemPos)) != 0x20205341) break; // "AS " (ain't this boring?)
+ if(LittleEndian(*(uint32 *)(lpStream + dwMemPos)) != 0x20205341) break; // "AS " (ain't this boring?)
dwMemPos += 4;
ASSERT_CAN_READ_CHUNK(sizeof(AMCHUNK_SAMPLE));
Modified: trunk/OpenMPT/soundlib/modcommand.h
===================================================================
--- trunk/OpenMPT/soundlib/modcommand.h 2010-04-14 21:31:59 UTC (rev 568)
+++ trunk/OpenMPT/soundlib/modcommand.h 2010-04-17 13:14:48 UTC (rev 569)
@@ -59,17 +59,13 @@
// 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(MODCOMMAND::NOTE note_id) {return note_id == NOTE_PC || note_id == 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()
{
- VOLCMD vcold = volcmd;
- VOL vold = vol;
- volcmd = command;
- vol = param;
- command = vcold;
- param = vold;
+ std::swap(volcmd, command);
+ std::swap(vol, param);
}
public:
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
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.
|
|
From: <sag...@us...> - 2010-04-10 22:44:04
|
Revision: 567
http://modplug.svn.sourceforge.net/modplug/?rev=567&view=rev
Author: saga-games
Date: 2010-04-10 22:43:18 +0000 (Sat, 10 Apr 2010)
Log Message:
-----------
[Mod] Updated Paul Legovitch's keymap (now also suitable for desktop keyboards); use this as the default "french" keymap in the installer.
[Mod] Options: Removed the "space bar repeats previous action" option, as it did not work anymore since the new keyhandler is used; in fact, this option can be achieved instead by using the "on key hold" for the "quick paste" key shortcut.
[Imp] Note Properties: Don't allow values > 63 for "break to row" commands in MOD/S3M.
[Fix] ITI/ITS Loader: Sample flags were not reset when a sample slot was overwritten when loading ITI or ITS files. That way, it was possible that f.e. the bidi loop flag was not disabled when loading a new sample that had a normal loop.
[Fix] Mod Conversion: When converting between XM and IT, the sample autovibrato "sweep" factor is now fixed a bit.
[Mod] Removed the RegisterExtensions() call on startup (useless).
Modified Paths:
--------------
trunk/OpenMPT/installer/install.iss
trunk/OpenMPT/mptrack/MainFrm.cpp
trunk/OpenMPT/mptrack/Mainfrm.h
trunk/OpenMPT/mptrack/Moddoc.cpp
trunk/OpenMPT/mptrack/Modedit.cpp
trunk/OpenMPT/mptrack/Moptions.cpp
trunk/OpenMPT/mptrack/Mptrack.cpp
trunk/OpenMPT/soundlib/Sampleio.cpp
Added Paths:
-----------
trunk/OpenMPT/packageTemplate/extraKeymaps/FR_mpt_(legovitch).mkb
Removed Paths:
-------------
trunk/OpenMPT/packageTemplate/extraKeymaps/FR_mpt_laptop_(legovitch).mkb
Modified: trunk/OpenMPT/installer/install.iss
===================================================================
--- trunk/OpenMPT/installer/install.iss 2010-04-07 17:23:25 UTC (rev 566)
+++ trunk/OpenMPT/installer/install.iss 2010-04-10 22:43:18 UTC (rev 567)
@@ -167,7 +167,7 @@
end;
$0c: // French
begin
- keyboardFilepath := 'FR_mpt_classic_(vanisherIII)';
+ keyboardFilepath := 'FR_mpt_(legovitch)';
end;
$14: // Norwegian
begin
@@ -234,3 +234,4 @@
end;
end;
+
Modified: trunk/OpenMPT/mptrack/MainFrm.cpp
===================================================================
--- trunk/OpenMPT/mptrack/MainFrm.cpp 2010-04-07 17:23:25 UTC (rev 566)
+++ trunk/OpenMPT/mptrack/MainFrm.cpp 2010-04-10 22:43:18 UTC (rev 567)
@@ -197,7 +197,7 @@
DWORD CMainFrame::m_dwMidiSetup = MIDISETUP_RECORDVELOCITY|MIDISETUP_RECORDNOTEOFF;
// Pattern Setup
DWORD CMainFrame::m_dwPatternSetup = PATTERN_PLAYNEWNOTE | PATTERN_EFFECTHILIGHT
- | PATTERN_SMALLFONT | PATTERN_CENTERROW | PATTERN_AUTOSPACEBAR
+ | PATTERN_SMALLFONT | PATTERN_CENTERROW
| PATTERN_DRAGNDROPEDIT | PATTERN_FLATBUTTONS
| PATTERN_2NDHIGHLIGHT | PATTERN_STDHIGHLIGHT | PATTERN_HILITETIMESIGS
| PATTERN_SHOWPREVIOUS | PATTERN_CONTSCROLL | PATTERN_SYNCMUTE | PATTERN_AUTODELAY | PATTERN_NOTEFADE;
@@ -437,6 +437,8 @@
m_dwPatternSetup |= PATTERN_NOTEFADE;
if(vIniVersion < MAKE_VERSION_NUMERIC(1,17,03,01))
m_dwPatternSetup |= PATTERN_RESETCHANNELS;
+ if(vIniVersion < MAKE_VERSION_NUMERIC(1,18,01,00))
+ m_dwPatternSetup &= ~0x800; // quick paste autorepeat is now a keymap option
m_nRowSpacing = GetPrivateProfileDWord("Pattern Editor", "RowSpacing", 16, iniFile);
m_nRowSpacing2 = GetPrivateProfileDWord("Pattern Editor", "RowSpacing2", 4, iniFile);
@@ -576,6 +578,7 @@
RegQueryValueEx(key, "PatternSetup", NULL, &dwREG_DWORD, (LPBYTE)&m_dwPatternSetup, &dwDWORDSize);
m_dwPatternSetup |= PATTERN_NOTEFADE; // Set flag to maintain old behaviour(was changed in 1.17.02.50).
m_dwPatternSetup |= PATTERN_RESETCHANNELS; // Set flag to reset channels on loop was changed in 1.17.03.01).
+ m_dwPatternSetup &= ~0x800; // quick paste autorepeat is now a keymap option
RegQueryValueEx(key, "RowSpacing", NULL, &dwREG_DWORD, (LPBYTE)&m_nRowSpacing, &dwDWORDSize);
RegQueryValueEx(key, "RowSpacing2", NULL, &dwREG_DWORD, (LPBYTE)&m_nRowSpacing2, &dwDWORDSize);
RegQueryValueEx(key, "LoopSong", NULL, &dwREG_DWORD, (LPBYTE)&gbLoopSong, &dwDWORDSize);
Modified: trunk/OpenMPT/mptrack/Mainfrm.h
===================================================================
--- trunk/OpenMPT/mptrack/Mainfrm.h 2010-04-07 17:23:25 UTC (rev 566)
+++ trunk/OpenMPT/mptrack/Mainfrm.h 2010-04-10 22:43:18 UTC (rev 567)
@@ -174,7 +174,7 @@
#define PATTERN_FLATBUTTONS 0x100 // flat toolbar buttons
#define PATTERN_CREATEBACKUP 0x200 // create .bak files when saving
#define PATTERN_SINGLEEXPAND 0x400 // single click to expand tree
-#define PATTERN_AUTOSPACEBAR 0x800 // space bar repeats previous action
+//#define PATTERN_AUTOSPACEBAR 0x800 // space bar repeats previous action - DOES NOT EXIST ANYMORE, use "on key hold" instead
#define PATTERN_NOEXTRALOUD 0x1000 // no loud samples in sample editor
#define PATTERN_DRAGNDROPEDIT 0x2000 // enable drag and drop editing
#define PATTERN_2NDHIGHLIGHT 0x4000 // activate secondary highlight
Modified: trunk/OpenMPT/mptrack/Moddoc.cpp
===================================================================
--- trunk/OpenMPT/mptrack/Moddoc.cpp 2010-04-07 17:23:25 UTC (rev 566)
+++ trunk/OpenMPT/mptrack/Moddoc.cpp 2010-04-10 22:43:18 UTC (rev 567)
@@ -2325,6 +2325,11 @@
// adjust waveform types for IT/S3M
if(gFXInfo[ndx].dwParamValue >= 0x30 && gFXInfo[ndx].dwParamValue <= 0x50) nmax = gFXInfo[ndx].dwParamValue | (m_SndFile.IsCompatibleMode(TRK_IMPULSETRACKER | TRK_SCREAMTRACKER) ? 0x03 : 0x07);
break;
+ case CMD_PATTERNBREAK:
+ // no big patterns in MOD/S3M files
+ if(nType & (MOD_TYPE_MOD|MOD_TYPE_S3M))
+ nmax = 63;
+ break;
}
*prangeMin = nmin;
*prangeMax = nmax;
@@ -2503,7 +2508,7 @@
case CMD_PANNING8:
wsprintf(s, "%d", param);
- if(m_SndFile.m_nType & MOD_TYPE_S3M)
+ if(m_SndFile.GetType() == MOD_TYPE_S3M)
{
if(param == 0xA4)
strcpy(s, "Surround");
Modified: trunk/OpenMPT/mptrack/Modedit.cpp
===================================================================
--- trunk/OpenMPT/mptrack/Modedit.cpp 2010-04-07 17:23:25 UTC (rev 566)
+++ trunk/OpenMPT/mptrack/Modedit.cpp 2010-04-10 22:43:18 UTC (rev 567)
@@ -232,7 +232,7 @@
}
// Transpose to Frequency (MOD/XM to S3M/IT/MPT)
- if (oldTypeIsMOD_XM && newTypeIsS3M_IT_MPT)
+ if(oldTypeIsMOD_XM && newTypeIsS3M_IT_MPT)
{
m_SndFile.Samples[nSmp].nC5Speed = CSoundFile::TransposeToFrequency(m_SndFile.Samples[nSmp].RelativeTone, m_SndFile.Samples[nSmp].nFineTune);
m_SndFile.Samples[nSmp].RelativeTone = 0;
@@ -240,14 +240,26 @@
}
// Frequency to Transpose (S3M/IT/MPT to MOD/XM)
- if (oldTypeIsS3M_IT_MPT && newTypeIsXM)
+ if(oldTypeIsS3M_IT_MPT && newTypeIsXM)
{
CSoundFile::FrequencyToTranspose(&m_SndFile.Samples[nSmp]);
if (!(m_SndFile.Samples[nSmp].uFlags & CHN_PANNING)) m_SndFile.Samples[nSmp].nPan = 128;
}
+
+ if(oldTypeIsXM && newTypeIsIT_MPT)
+ {
+ // Autovibrato settings (XM to IT, where sweep 0 means "no vibrato")
+ if(m_SndFile.Samples[nSmp].nVibSweep == 0 && m_SndFile.Samples[nSmp].nVibRate != 0 && m_SndFile.Samples[nSmp].nVibDepth != 0)
+ m_SndFile.Samples[nSmp].nVibSweep = 255;
+ } else if(oldTypeIsIT_MPT && newTypeIsXM)
+ {
+ // Autovibrato settings (IT to XM, where sweep 0 means "no sweep")
+ if(m_SndFile.Samples[nSmp].nVibSweep == 0)
+ m_SndFile.Samples[nSmp].nVibRate = m_SndFile.Samples[nSmp].nVibDepth = 0;
+ }
}
- // No Vibrato for MOD/S3M
+ // No Autovibrato for MOD/S3M
if(newTypeIsMOD || newTypeIsS3M)
{
ctrlSmp::ResetSamples(m_SndFile, ctrlSmp::SmpResetVibrato);
@@ -1197,8 +1209,8 @@
if ((hCpy) && ((p = (LPSTR)GlobalLock(hCpy)) != NULL))
{
- TEMPO spdmax = m_SndFile.GetModSpecifications().speedMax;
- DWORD dwMemSize = GlobalSize(hCpy);
+ const TEMPO spdmax = m_SndFile.GetModSpecifications().speedMax;
+ const DWORD dwMemSize = GlobalSize(hCpy);
MODCOMMAND *m = m_SndFile.Patterns[nPattern];
UINT nrow = dwBeginSel >> 16;
UINT ncol = (dwBeginSel & 0xFFFF) >> 3;
Modified: trunk/OpenMPT/mptrack/Moptions.cpp
===================================================================
--- trunk/OpenMPT/mptrack/Moptions.cpp 2010-04-07 17:23:25 UTC (rev 566)
+++ trunk/OpenMPT/mptrack/Moptions.cpp 2010-04-10 22:43:18 UTC (rev 567)
@@ -613,7 +613,6 @@
{PATTERN_FLATBUTTONS, "Flat Buttons", "Use flat buttons in toolbars"},
{PATTERN_SINGLEEXPAND, "Single click to expand tree", "Single-clicking in the left tree view will expand a branch"},
{PATTERN_MUTECHNMODE, "Ignored muted channels", "Notes will not be played on muted channels (unmuting will only start on a new note)."},
- {PATTERN_AUTOSPACEBAR, "Quick cursor paste Auto-Repeat", "Leaving the space bar pressed will auto-repeat the action"},
{PATTERN_NOEXTRALOUD, "No loud samples", "Disable loud playback of samples in the sample/instrument editor. Sample volume depends on the sample volume slider on the general tab when activated."},
{PATTERN_SHOWPREVIOUS, "Show Prev/Next patterns", "Displays grayed-out version of the previous/next patterns in the pattern editor. Does not work if \"always center active row\" is disabled."},
{PATTERN_CONTSCROLL, "Continuous scroll", "Jumps to the next pattern when moving past the end of a pattern"},
Modified: trunk/OpenMPT/mptrack/Mptrack.cpp
===================================================================
--- trunk/OpenMPT/mptrack/Mptrack.cpp 2010-04-07 17:23:25 UTC (rev 566)
+++ trunk/OpenMPT/mptrack/Mptrack.cpp 2010-04-10 22:43:18 UTC (rev 567)
@@ -973,7 +973,7 @@
EnableShellOpen();
// Register MOD extensions
- RegisterExtensions();
+ //RegisterExtensions();
// Load DirectSound (if available)
m_bExWaveSupport = cmdInfo.m_bWavEx;
Added: trunk/OpenMPT/packageTemplate/extraKeymaps/FR_mpt_(legovitch).mkb
===================================================================
--- trunk/OpenMPT/packageTemplate/extraKeymaps/FR_mpt_(legovitch).mkb (rev 0)
+++ trunk/OpenMPT/packageTemplate/extraKeymaps/FR_mpt_(legovitch).mkb 2010-04-10 22:43:18 UTC (rev 567)
@@ -0,0 +1,356 @@
+//-------- 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:1348:2:87:1 //File/Close: Ctrl+W (KeyDown)
+0:1349:2:83:1 //File/Save: Ctrl+S (KeyDown)
+0:1350:3:83:1 //File/Save As: Shift+Ctrl+S (KeyDown)
+0:1693:6:37:1 //Previous Document: Ctrl+Alt+GAUCHE (KeyDown)
+0:1694:6:39:1 //Next Document: Ctrl+Alt+DROITE (KeyDown)
+0:1030:0:114:1 //Play song/Pause song: F3 (KeyDown)
+0:1375:0:27:1 //Stop Song: ECHAP (KeyDown)
+0:1026:0:115:1 //Play pattern from cursor: F4 (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:1363:6:86:1 //Mix Paste: Ctrl+Alt+V (KeyDown)
+0:1793:7:86:1 //Paste Flood: Shift+Ctrl+Alt+V (KeyDown)
+0:1364:2:53:1 //SelectAll: Ctrl+( (KeyDown)
+0:1365:2:70:1 //Find: Ctrl+F (KeyDown)
+0:1366:6:70:1 //Find Next: Ctrl+Alt+F (KeyDown)
+0:1021:0:116:1 //View General: F5 (KeyDown)
+0:1022:0:117:1 //View Pattern: F6 (KeyDown)
+0:1023:0:118:1 //View Samples: F7 (KeyDown)
+0:1024:0:119:1 //View Instruments: F8 (KeyDown)
+0:1025:0:120:1 //View Comments: F9 (KeyDown)
+0:1367:6:87:1 //Toggle Main View: Ctrl+Alt+W (KeyDown)
+0:1368:0:112:1 //Toggle Tree View: F1 (KeyDown)
+0:1369:2:112:1 //View Options: Ctrl+F1 (KeyDown)
+0:1670:2:116:1 //View Channel Manager: Ctrl+F5 (KeyDown)
+0:1669:2:117:1 //View Plugin Manager: Ctrl+F6 (KeyDown)
+0:1775:6:112:1 //Show song properties window: Ctrl+Alt+F1 (KeyDown)
+0:1032:2:38:1 //Previous instrument: Ctrl+HAUT (KeyDown)
+0:1033:2:40:1 //Next instrument: Ctrl+BAS (KeyDown)
+0:1036:0:122:1 //Previous octave: F11 (KeyDown)
+0:1037:0:123:1 //Next octave: F12 (KeyDown)
+0:1034:2:37:5 //Previous order: Ctrl+GAUCHE (KeyDown|KeyHold)
+0:1035:2:39:5 //Next order: Ctrl+DROITE (KeyDown|KeyHold)
+
+//----( General Context [bottom] (1) )------------
+
+//----( Pattern Context [bottom] (2) )------------
+2:1017:0:34:1 //Jump down by measure: PG.SUIV (KeyDown)
+2:1018:0:33:1 //Jump up by measure: PG.PREC (KeyDown)
+2:1338:4:34:1 //Jump down by beat: Alt+PG.SUIV (KeyDown)
+2:1339:4:33:1 //Jump up by beat: Alt+PG.PREC (KeyDown)
+2:1340:6:34:5 //Snap down to beat: Ctrl+Alt+PG.SUIV (KeyDown|KeyHold)
+2:1341:6:33:5 //Snap up to beat: Ctrl+Alt+PG.PREC (KeyDown|KeyHold)
+2:1038:0:40:5 //Navigate down by 1 row: BAS (KeyDown|KeyHold)
+2:1039:0:38:5 //Navigate up by 1 row: HAUT (KeyDown|KeyHold)
+2:1691:4:40:5 //Navigate down by spacing: Alt+BAS (KeyDown|KeyHold)
+2:1692:4:38:5 //Navigate up by spacing: Alt+HAUT (KeyDown|KeyHold)
+2:1040:0:37:5 //Navigate left: GAUCHE (KeyDown|KeyHold)
+2:1041:0:39:5 //Navigate right: DROITE (KeyDown|KeyHold)
+2:1042:0:9:1 //Navigate to next channel: TAB (KeyDown)
+2:1042:4:39:1 //Navigate to next channel: Alt+DROITE (KeyDown)
+2:1043:1:9:1 //Navigate to previous channel: Shift+TAB (KeyDown)
+2:1043:4:37:1 //Navigate to previous channel: Alt+GAUCHE (KeyDown)
+2:1044:2:36:1 //Go to first channel: Ctrl+ORIGINE (KeyDown)
+2:1045:0:36:1 //Go to first row: ORIGINE (KeyDown)
+2:1046:6:36:1 //Go to first row of first channel: Ctrl+Alt+ORIGINE (KeyDown)
+2:1047:2:35:1 //Go to last channel: Ctrl+FIN (KeyDown)
+2:1048:0:35:1 //Go to last row: FIN (KeyDown)
+2:1049:6:35:1 //Go to last row of last channel: Ctrl+Alt+FIN (KeyDown)
+2:1050:1:16:1 //Selection key: Shift+MAJ (KeyDown)
+2:1011:2:76:1 //Select channel / Select all: Ctrl+L (KeyDown)
+2:1663:0:32:1 //Toggle follow song: ESPACE (KeyDown)
+2:1003:0:13:1 //Quick copy: ENTREE (KeyDown)
+2:1004:1:13:1 //Quick paste: Shift+ENTREE (KeyDown)
+2:1001:2:32:1 //Enable recording: Ctrl+ESPACE (KeyDown)
+2:1002:2:13:5 //Play row: Ctrl+ENTREE (KeyDown|KeyHold)
+2:1317:4:18:1 //Set row jump on note entry: Alt (KeyDown)
+2:1685:2:9:1 //Switch to order list: Ctrl+TAB (KeyDown)
+2:1806:2:68:1 //Duplicate pattern: Ctrl+D (KeyDown)
+2:1836:2:222:1 //Edit plugin assigned to PC note: Ctrl+\xB2 (KeyDown)
+2:1662:6:80:1 //Toggle channel's plugin editor: Ctrl+Alt+P (KeyDown)
+2:1062:0:110:1 //Show note properties: . (PAVE NUM.) (KeyDown)
+2:1776:4:32:1 //Toggle loop pattern: Alt+ESPACE (KeyDown)
+2:1006:0:113:1 //Solo current channel: F2 (KeyDown)
+2:1778:2:113:1 //Unmute all channels on pattern transition: Ctrl+F2 (KeyDown)
+2:1779:1:113:1 //Solo channel on pattern transition: Shift+F2 (KeyDown)
+2:1007:2:65:1 //Transpose +1: Ctrl+A (KeyDown)
+2:1008:2:81:1 //Transpose -1: Ctrl+Q (KeyDown)
+2:1009:6:65:5 //Transpose +12: Ctrl+Alt+A (KeyDown|KeyHold)
+2:1010:6:81:5 //Transpose -12: Ctrl+Alt+Q (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:1057:2:46:1 //Clear row: Ctrl+SUPPR (KeyDown)
+2:1058:1:46:1 //Clear field: Shift+SUPPR (KeyDown)
+2:1664:0:46:1 //Clear field (IT Style): SUPPR (KeyDown)
+2:1059:3:46:1 //Clear row and step: Shift+Ctrl+SUPPR (KeyDown)
+2:1061:0:8:1 //Delete rows: RET.ARR (KeyDown)
+2:1377:4:8:5 //Delete all rows: Alt+RET.ARR (KeyDown|KeyHold)
+2:1378:0:45:1 //Insert Row: INS (KeyDown)
+2:1379:4:45:1 //Insert All Rows: Alt+INS (KeyDown)
+2:1055:2:109:5 //Previous pattern: Ctrl+- (PAVE NUM.) (KeyDown|KeyHold)
+2:1054:2:107:5 //Next pattern: Ctrl++ (PAVE NUM.) (KeyDown|KeyHold)
+
+//----( Pattern Context [bottom] - Note Col (3) )------------
+3:1064:0:65:1 //Base octave C: A (KeyDown)
+3:1065:0:90:1 //Base octave C#: Z (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:221:1 //Base octave A#: ACCENT CIRCONFLEXE (KeyDown)
+3:1075:0:186:1 //Base octave B: $ (KeyDown)
+3:1076:0:81:1 //Base octave +1 C: Q (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:77:1 //Base octave +1 A: M (KeyDown)
+3:1086:0:192:1 //Base octave +1 A#: \xF9 (KeyDown)
+3:1087:0:220:1 //Base octave +1 B: * (KeyDown)
+3:1088:0:87:1 //Base octave +2 C: W (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:188:1 //Base octave +2 F#: , (KeyDown)
+3:1095:0:190:1 //Base octave +2 G: ; (KeyDown)
+3:1096:0:191:1 //Base octave +2 G#: : (KeyDown)
+3:1097:0:223:1 //Base octave +2 A: ! (KeyDown)
+3:1212:0:48:1 //Set octave 0: \xE0 (KeyDown)
+3:1212:0:96:1 //Set octave 0: 0 (PAVE NUM.) (KeyDown)
+3:1213:0:49:1 //Set octave 1: & (KeyDown)
+3:1213:0:97:1 //Set octave 1: 1 (PAVE NUM.) (KeyDown)
+3:1214:0:50:1 //Set octave 2: \xE9 (KeyDown)
+3:1214:0:98:1 //Set octave 2: 2 (PAVE NUM.) (KeyDown)
+3:1215:0:51:1 //Set octave 3: " (KeyDown)
+3:1215:0:99:1 //Set octave 3: 3 (PAVE NUM.) (KeyDown)
+3:1216:0:52:1 //Set octave 4: ' (KeyDown)
+3:1216:0:100:1 //Set octave 4: 4 (PAVE NUM.) (KeyDown)
+3:1217:0:53:1 //Set octave 5: ( (KeyDown)
+3:1217:0:101:1 //Set octave 5: 5 (PAVE NUM.) (KeyDown)
+3:1218:0:54:1 //Set octave 6: - (KeyDown)
+3:1218:0:102:1 //Set octave 6: 6 (PAVE NUM.) (KeyDown)
+3:1219:0:55:1 //Set octave 7: \xE8 (KeyDown)
+3:1219:0:103:1 //Set octave 7: 7 (PAVE NUM.) (KeyDown)
+3:1220:0:56:1 //Set octave 8: _ (KeyDown)
+3:1220:0:104:1 //Set octave 8: 8 (PAVE NUM.) (KeyDown)
+3:1221:0:57:1 //Set octave 9: \xE7 (KeyDown)
+3:1221:0:105:1 //Set octave 9: 9 (PAVE NUM.) (KeyDown)
+3:1316:1:16:1 //Chord Modifier: Shift+MAJ (KeyDown)
+3:1200:1:219:1 //Note Cut: Shift+) (KeyDown)
+3:1201:1:187:1 //Note Off: Shift+= (KeyDown)
+3:1791:3:219:1 //Note Fade: Shift+Ctrl+) (KeyDown)
+3:1667:0:219:1 //Note Cut (don't remember instrument): ) (KeyDown)
+3:1668:0:187:1 //Note Off (don't remember instrument): = (KeyDown)
+3:1792:2:219:1 //Note Fade (don't remember instrument): Ctrl+) (KeyDown)
+3:1788:0:222:1 //Parameter control(MPTm only): \xB2 (KeyDown)
+3:1789:1:222:1 //Parameter control(smooth)(MPTm only): Shift+\xB2 (KeyDown)
+
+//----( Pattern Context [bottom] - Ins Col (4) )------------
+4:1202:0:96:1 //Set instrument digit 0: 0 (PAVE NUM.) (KeyDown)
+4:1202:0:48:1 //Set instrument digit 0: \xE0 (KeyDown)
+4:1203:0:97:1 //Set instrument digit 1: 1 (PAVE NUM.) (KeyDown)
+4:1203:0:49:1 //Set instrument digit 1: & (KeyDown)
+4:1204:0:98:1 //Set instrument digit 2: 2 (PAVE NUM.) (KeyDown)
+4:1204:0:50:1 //Set instrument digit 2: \xE9 (KeyDown)
+4:1205:0:99:1 //Set instrument digit 3: 3 (PAVE NUM.) (KeyDown)
+4:1205:0:51:1 //Set instrument digit 3: " (KeyDown)
+4:1206:0:100:1 //Set instrument digit 4: 4 (PAVE NUM.) (KeyDown)
+4:1206:0:52:1 //Set instrument digit 4: ' (KeyDown)
+4:1207:0:101:1 //Set instrument digit 5: 5 (PAVE NUM.) (KeyDown)
+4:1207:0:53:1 //Set instrument digit 5: ( (KeyDown)
+4:1208:0:102:1 //Set instrument digit 6: 6 (PAVE NUM.) (KeyDown)
+4:1208:0:54:1 //Set instrument digit 6: - (KeyDown)
+4:1209:0:103:1 //Set instrument digit 7: 7 (PAVE NUM.) (KeyDown)
+4:1209:0:55:1 //Set instrument digit 7: \xE8 (KeyDown)
+4:1210:0:104:1 //Set instrument digit 8: 8 (PAVE NUM.) (KeyDown)
+4:1211:0:105:1 //Set instrument digit 9: 9 (PAVE NUM.) (KeyDown)
+4:1211:0:57:1 //Set instrument digit 9: \xE7 (KeyDown)
+
+//----( Pattern Context [bottom] - Vol Col (5) )------------
+5:1222:0:48:1 //Set volume digit 0: \xE0 (KeyDown)
+5:1222:0:96:1 //Set volume digit 0: 0 (PAVE NUM.) (KeyDown)
+5:1223:0:49:1 //Set volume digit 1: & (KeyDown)
+5:1223:0:97:1 //Set volume digit 1: 1 (PAVE NUM.) (KeyDown)
+5:1224:0:50:1 //Set volume digit 2: \xE9 (KeyDown)
+5:1224:0:98:1 //Set volume digit 2: 2 (PAVE NUM.) (KeyDown)
+5:1225:0:51:1 //Set volume digit 3: " (KeyDown)
+5:1225:0:99:1 //Set volume digit 3: 3 (PAVE NUM.) (KeyDown)
+5:1226:0:52:1 //Set volume digit 4: ' (KeyDown)
+5:1226:0:100:1 //Set volume digit 4: 4 (PAVE NUM.) (KeyDown)
+5:1227:0:53:1 //Set volume digit 5: ( (KeyDown)
+5:1227:0:101:1 //Set volume digit 5: 5 (PAVE NUM.) (KeyDown)
+5:1228:0:54:1 //Set volume digit 6: - (KeyDown)
+5:1228:0:102:1 //Set volume digit 6: 6 (PAVE NUM.) (KeyDown)
+5:1229:0:55:1 //Set volume digit 7: \xE8 (KeyDown)
+5:1229:0:103:1 //Set volume digit 7: 7 (PAVE NUM.) (KeyDown)
+5:1230:0:56:1 //Set volume digit 8: _ (KeyDown)
+5:1231:0:57:1 //Set volume digit 9: \xE7 (KeyDown)
+5:1231:0:105:1 //Set volume digit 9: 9 (PAVE NUM.) (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)
+6:1666:6:51:1 //FX parameter extension command: Ctrl+Alt+" (KeyDown)
+
+//----( Pattern Context [bottom] - Param Col (7) )------------
+7:1247:0:48:1 //FX Param digit 0: \xE0 (KeyDown)
+7:1247:0:96:1 //FX Param digit 0: 0 (PAVE NUM.) (KeyDown)
+7:1248:0:49:1 //FX Param digit 1: & (KeyDown)
+7:1248:0:97:1 //FX Param digit 1: 1 (PAVE NUM.) (KeyDown)
+7:1249:0:50:1 //FX Param digit 2: \xE9 (KeyDown)
+7:1249:0:98:1 //FX Param digit 2: 2 (PAVE NUM.) (KeyDown)
+7:1250:0:51:1 //FX Param digit 3: " (KeyDown)
+7:1250:0:99:1 //FX Param digit 3: 3 (PAVE NUM.) (KeyDown)
+7:1251:0:52:1 //FX Param digit 4: ' (KeyDown)
+7:1251:0:100:1 //FX Param digit 4: 4 (PAVE NUM.) (KeyDown)
+7:1252:0:53:1 //FX Param digit 5: ( (KeyDown)
+7:1252:0:101:1 //FX Param digit 5: 5 (PAVE NUM.) (KeyDown)
+7:1253:0:54:1 //FX Param digit 6: - (KeyDown)
+7:1253:0:102:1 //FX Param digit 6: 6 (PAVE NUM.) (KeyDown)
+7:1254:0:55:1 //FX Param digit 7: \xE8 (KeyDown)
+7:1254:0:103:1 //FX Param digit 7: 7 (PAVE NUM.) (KeyDown)
+7:1255:0:56:1 //FX Param digit 8: _ (KeyDown)
+7:1255:0:104:1 //FX Param digit 8: 8 (PAVE NUM.) (KeyDown)
+7:1256:0:57:1 //FX Param digit 9: \xE7 (KeyDown)
+7:1256:0:105:1 //FX Param digit 9: 9 (PAVE NUM.) (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:1673:4:79:1 //Load a Sample: Alt+O (KeyDown)
+8:1674:4:83:1 //Save Sample: Alt+S (KeyDown)
+8:1675:4:78:1 //New Sample: Alt+N (KeyDown)
+8:1380:2:84:1 //Trim sample around loop points: Ctrl+T (KeyDown)
+8:1383:0:8:1 //Silence sample selection: RET.ARR (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: SUPPR (KeyDown)
+8:1386:0:33:1 //Zoom Out: PG.PREC (KeyDown)
+8:1387:0:34:1 //Zoom In: PG.SUIV (KeyDown)
+8:1790:6:68:1 //Remove DC Offset: Ctrl+Alt+D (KeyDown)
+
+//----( Instrument Context [bottom] (9) )------------
+9:1837:2:107:5 //Zoom In: Ctrl++ (PAVE NUM.) (KeyDown|KeyHold)
+9:1838:2:109:5 //Zoom Out: Ctrl+- (PAVE NUM.) (KeyDown|KeyHold)
+9:1825:1:9:5 //Select previous envelope point: Shift+TAB (KeyDown|KeyHold)
+9:1825:4:37:5 //Select previous envelope point: Alt+GAUCHE (KeyDown|KeyHold)
+9:1826:0:9:5 //Select next envelope point: TAB (KeyDown|KeyHold)
+9:1826:4:39:5 //Select next envelope point: Alt+DROITE (KeyDown|KeyHold)
+9:1821:0:37:5 //Move envelope point left: GAUCHE (KeyDown|KeyHold)
+9:1822:0:39:5 //Move envelope point right: DROITE (KeyDown|KeyHold)
+9:1823:0:38:5 //Move envelope point up: HAUT (KeyDown|KeyHold)
+9:1834:0:33:5 //Move envelope point up (big step): PG.PREC (KeyDown|KeyHold)
+9:1824:0:40:5 //Move envelope point down: BAS (KeyDown|KeyHold)
+9:1835:0:34:5 //Move envelope point down (big step): PG.SUIV (KeyDown|KeyHold)
+9:1827:0:45:5 //Insert envelope point: INS (KeyDown|KeyHold)
+9:1828:0:46:5 //Remove envelope point: SUPPR (KeyDown|KeyHold)
+9:1829:0:36:1 //Set loop start: ORIGINE (KeyDown)
+9:1830:0:35:1 //Set loop end: FIN (KeyDown)
+9:1831:2:36:1 //Set sustain loop start: Ctrl+ORIGINE (KeyDown)
+9:1832:2:35:1 //Set sustain loop end: Ctrl+FIN (KeyDown)
+9:1833:2:82:1 //Toggle release node: Ctrl+R (KeyDown)
+
+//----( Comments Context [bottom] (10) )------------
+
+//----( Unknown Context (11) )------------
+
+//----( Unknown Context (12) )------------
+
+//----( Plugin GUI Context (13) )------------
+13:1763:2:109:1 //Previous plugin preset: Ctrl+- (PAVE NUM.) (KeyDown)
+13:1764:2:107:1 //Next plugin preset: Ctrl++ (PAVE NUM.) (KeyDown)
+13:1782:2:33:1 //Plugin preset backward jump: Ctrl+PG.PREC (KeyDown)
+13:1783:2:34:1 //Plugin preset forward jump: Ctrl+PG.SUIV (KeyDown)
+13:1765:6:82:1 //Randomize plugin parameters: Ctrl+Alt+R (KeyDown)
+13:1839:6:80:1 //Toggle parameter recording: Ctrl+Alt+P (KeyDown)
+
+//----( General Context [top] (14) )------------
+
+//----( Pattern Context [top] (15) )------------
+
+//----( Sample Context [top] (16) )------------
+
+//----( Instrument Context [top] (17) )------------
+
+//----( Comments Context [top] (18) )------------
+
+//----( Orderlist (19) )------------
+19:1802:0:46:5 //Delete Order: SUPPR (KeyDown|KeyHold)
+19:1803:0:45:5 //Insert Order: INS (KeyDown|KeyHold)
+19:1804:0:13:5 //Edit Pattern: ENTREE (KeyDown|KeyHold)
+19:1805:0:9:5 //Switch to pattern editor: TAB (KeyDown|KeyHold)
+19:1794:0:37:5 //Previous Order: GAUCHE (KeyDown|KeyHold)
+19:1795:0:39:5 //Next Order: DROITE (KeyDown|KeyHold)
+19:1796:0:36:5 //First Order: ORIGINE (KeyDown|KeyHold)
+19:1797:0:35:5 //Last Order: FIN (KeyDown|KeyHold)
+19:1807:0:48:5 //Pattern index digit 0: \xE0 (KeyDown|KeyHold)
+19:1807:0:96:5 //Pattern index digit 0: 0 (PAVE NUM.) (KeyDown|KeyHold)
+19:1808:0:49:5 //Pattern index digit 1: & (KeyDown|KeyHold)
+19:1808:0:97:5 //Pattern index digit 1: 1 (PAVE NUM.) (KeyDown|KeyHold)
+19:1809:0:50:5 //Pattern index digit 2: \xE9 (KeyDown|KeyHold)
+19:1809:0:98:5 //Pattern index digit 2: 2 (PAVE NUM.) (KeyDown|KeyHold)
+19:1810:0:51:5 //Pattern index digit 3: " (KeyDown|KeyHold)
+19:1810:0:99:5 //Pattern index digit 3: 3 (PAVE NUM.) (KeyDown|KeyHold)
+19:1811:0:52:5 //Pattern index digit 4: ' (KeyDown|KeyHold)
+19:1811:0:100:5 //Pattern index digit 4: 4 (PAVE NUM.) (KeyDown|KeyHold)
+19:1812:0:53:5 //Pattern index digit 5: ( (KeyDown|KeyHold)
+19:1812:0:101:5 //Pattern index digit 5: 5 (PAVE NUM.) (KeyDown|KeyHold)
+19:1813:0:54:5 //Pattern index digit 6: - (KeyDown|KeyHold)
+19:1813:0:102:5 //Pattern index digit 6: 6 (PAVE NUM.) (KeyDown|KeyHold)
+19:1814:0:55:5 //Pattern index digit 7: \xE8 (KeyDown|KeyHold)
+19:1814:0:103:5 //Pattern index digit 7: 7 (PAVE NUM.) (KeyDown|KeyHold)
+19:1815:0:56:5 //Pattern index digit 8: _ (KeyDown|KeyHold)
+19:1815:0:104:5 //Pattern index digit 8: 8 (PAVE NUM.) (KeyDown|KeyHold)
+19:1816:0:57:5 //Pattern index digit 9: \xE7 (KeyDown|KeyHold)
+19:1816:0:105:5 //Pattern index digit 9: 9 (PAVE NUM.) (KeyDown|KeyHold)
+19:1817:0:38:5 //Increase pattern index : HAUT (KeyDown|KeyHold)
+19:1817:0:187:5 //Increase pattern index : = (KeyDown|KeyHold)
+19:1818:0:40:5 //Decrease pattern index: BAS (KeyDown|KeyHold)
+19:1818:0:189:5 //Decrease pattern index: (KeyDown|KeyHold)
Deleted: trunk/OpenMPT/packageTemplate/extraKeymaps/FR_mpt_laptop_(legovitch).mkb
===================================================================
--- trunk/OpenMPT/packageTemplate/extraKeymaps/FR_mpt_laptop_(legovitch).mkb 2010-04-07 17:23:25 UTC (rev 566)
+++ trunk/OpenMPT/packageTemplate/extraKeymaps/FR_mpt_laptop_(legovitch).mkb 2010-04-10 22:43:18 UTC (rev 567)
@@ -1,343 +0,0 @@
-//-------- 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:1348:2:87:1 //File/Close: Ctrl+W (KeyDown)
-0:1349:2:83:1 //File/Save: Ctrl+S (KeyDown)
-0:1350:3:83:1 //File/Save As: Shift+Ctrl+S (KeyDown)
-0:1693:6:37:1 //Previous Document: Ctrl+Alt+GAUCHE (KeyDown)
-0:1694:6:39:1 //Next Document: Ctrl+Alt+DROITE (KeyDown)
-0:1030:0:114:1 //Play song/Pause song: F3 (KeyDown)
-0:1375:0:27:1 //Stop Song: ECHAP (KeyDown)
-0:1026:0:115:1 //Play pattern from cursor: F4 (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:1363:6:86:1 //Mix Paste: Ctrl+Alt+V (KeyDown)
-0:1793:7:86:1 //Paste Flood: Shift+Ctrl+Alt+V (KeyDown)
-0:1364:2:53:1 //SelectAll: Ctrl+( (KeyDown)
-0:1365:2:70:1 //Find: Ctrl+F (KeyDown)
-0:1366:6:70:1 //Find Next: Ctrl+Alt+F (KeyDown)
-0:1021:0:116:1 //View General: F5 (KeyDown)
-0:1022:0:117:1 //View Pattern: F6 (KeyDown)
-0:1023:0:118:1 //View Samples: F7 (KeyDown)
-0:1024:0:119:1 //View Instruments: F8 (KeyDown)
-0:1025:0:120:1 //View Comments: F9 (KeyDown)
-0:1367:6:87:1 //Toggle Main View: Ctrl+Alt+W (KeyDown)
-0:1368:0:112:1 //Toggle Tree View: F1 (KeyDown)
-0:1369:2:112:1 //View Options: Ctrl+F1 (KeyDown)
-0:1670:2:116:1 //View Channel Manager: Ctrl+F5 (KeyDown)
-0:1669:2:117:1 //View Plugin Manager: Ctrl+F6 (KeyDown)
-0:1775:6:112:1 //Show song properties window: Ctrl+Alt+F1 (KeyDown)
-0:1032:2:38:1 //Previous instrument: Ctrl+HAUT (KeyDown)
-0:1033:2:40:1 //Next instrument: Ctrl+BAS (KeyDown)
-0:1036:0:122:1 //Previous octave: F11 (KeyDown)
-0:1037:0:123:1 //Next octave: F12 (KeyDown)
-0:1034:2:37:5 //Previous order: Ctrl+GAUCHE (KeyDown|KeyHold)
-0:1035:2:39:5 //Next order: Ctrl+DROITE (KeyDown|KeyHold)
-
-//----( General Context [bottom] (1) )------------
-
-//----( Pattern Context [bottom] (2) )------------
-2:1017:0:34:1 //Jump down by measure: PG.SUIV (KeyDown)
-2:1018:0:33:1 //Jump up by measure: PG.PREC (KeyDown)
-2:1338:4:34:1 //Jump down by beat: Alt+PG.SUIV (KeyDown)
-2:1339:4:33:1 //Jump up by beat: Alt+PG.PREC (KeyDown)
-2:1340:6:34:5 //Snap down to beat: Ctrl+Alt+PG.SUIV (KeyDown|KeyHold)
-2:1341:6:33:5 //Snap up to beat: Ctrl+Alt+PG.PREC (KeyDown|KeyHold)
-2:1038:0:40:5 //Navigate down by 1 row: BAS (KeyDown|KeyHold)
-2:1039:0:38:5 //Navigate up by 1 row: HAUT (KeyDown|KeyHold)
-2:1691:4:167:5 //Navigate down by spacing: Alt+ (KeyDown|KeyHold)
-2:1692:4:166:5 //Navigate up by spacing: Alt+ (KeyDown|KeyHold)
-2:1040:0:37:5 //Navigate left: GAUCHE (KeyDown|KeyHold)
-2:1041:0:39:5 //Navigate right: DROITE (KeyDown|KeyHold)
-2:1042:0:9:1 //Navigate to next channel: TAB (KeyDown)
-2:1042:0:167:1 //Navigate to next channel: (KeyDown)
-2:1043:1:9:1 //Navigate to previous channel: Shift+TAB (KeyDown)
-2:1043:0:166:1 //Navigate to previous channel: (KeyDown)
-2:1044:2:36:1 //Go to first channel: Ctrl+ORIGINE (KeyDown)
-2:1045:0:36:1 //Go to first row: ORIGINE (KeyDown)
-2:1046:6:36:1 //Go to first row of first channel: Ctrl+Alt+ORIGINE (KeyDown)
-2:1047:2:35:1 //Go to last channel: Ctrl+FIN (KeyDown)
-2:1048:0:35:1 //Go to last row: FIN (KeyDown)
-2:1049:6:35:1 //Go to last row of last channel: Ctrl+Alt+FIN (KeyDown)
-2:1050:1:16:1 //Selection key: Shift+MAJ (KeyDown)
-2:1011:2:76:1 //Select channel / Select all: Ctrl+L (KeyDown)
-2:1663:0:32:1 //Toggle follow song: ESPACE (KeyDown)
-2:1003:0:13:1 //Quick copy: ENTREE (KeyDown)
-2:1004:1:13:1 //Quick paste: Shift+ENTREE (KeyDown)
-2:1001:2:32:1 //Enable recording: Ctrl+ESPACE (KeyDown)
-2:1002:2:13:5 //Play row: Ctrl+ENTREE (KeyDown|KeyHold)
-2:1317:4:18:1 //Set row jump on note entry: Alt (KeyDown)
-2:1685:2:9:1 //Switch to order list: Ctrl+TAB (KeyDown)
-2:1806:2:68:1 //Duplicate pattern: Ctrl+D (KeyDown)
-2:1662:6:80:1 //Toggle channel's plugin editor: Ctrl+Alt+P (KeyDown)
-2:1062:0:255:1 //Show note properties: (KeyDown)
-2:1776:4:32:1 //Toggle loop pattern: Alt+ESPACE (KeyDown)
-2:1006:0:113:1 //Solo current channel: F2 (KeyDown)
-2:1778:2:113:1 //Unmute all channels on pattern transition: Ctrl+F2 (KeyDown)
-2:1779:1:113:1 //Solo channel on pattern transition: Shift+F2 (KeyDown)
-2:1007:2:65:5 //Transpose +1: Ctrl+A (KeyDown|KeyHold)
-2:1008:2:81:1 //Transpose -1: Ctrl+Q (KeyDown)
-2:1009:6:65:5 //Transpose +12: Ctrl+Alt+A (KeyDown|KeyHold)
-2:1010:6:81:5 //Transpose -12: Ctrl+Alt+Q (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:1057:2:46:1 //Clear row: Ctrl+SUPPR (KeyDown)
-2:1058:1:46:1 //Clear field: Shift+SUPPR (KeyDown)
-2:1664:0:46:1 //Clear field (IT Style): SUPPR (KeyDown)
-2:1059:3:46:1 //Clear row and step: Shift+Ctrl+SUPPR (KeyDown)
-2:1061:0:8:1 //Delete rows: RET.ARR (KeyDown)
-2:1377:4:8:5 //Delete all rows: Alt+RET.ARR (KeyDown|KeyHold)
-2:1378:0:45:1 //Insert Row: INS (KeyDown)
-2:1379:4:45:1 //Insert All Rows: Alt+INS (KeyDown)
-2:1055:2:166:5 //Previous pattern: Ctrl+ (KeyDown|KeyHold)
-2:1054:2:167:5 //Next pattern: Ctrl+ (KeyDown|KeyHold)
-
-//----( Pattern Context [bottom] - Note Col (3) )------------
-3:1064:0:65:1 //Base octave C: A (KeyDown)
-3:1065:0:90:1 //Base octave C#: Z (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:221:1 //Base octave A#: ACCENT CIRCONFLEXE (KeyDown)
-3:1075:0:186:1 //Base octave B: $ (KeyDown)
-3:1076:0:81:1 //Base octave +1 C: Q (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:77:1 //Base octave +1 A: M (KeyDown)
-3:1086:0:192:1 //Base octave +1 A#: \xF9 (KeyDown)
-3:1087:0:220:1 //Base octave +1 B: * (KeyDown)
-3:1088:0:87:1 //Base octave +2 C: W (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:188:1 //Base octave +2 F#: , (KeyDown)
-3:1095:0:190:1 //Base octave +2 G: ; (KeyDown)
-3:1096:0:191:1 //Base octave +2 G#: : (KeyDown)
-3:1097:0:223:1 //Base octave +2 A: ! (KeyDown)
-3:1212:0:48:1 //Set octave 0: \xE0 (KeyDown)
-3:1212:0:96:1 //Set octave 0: 0 (PAVE NUM.) (KeyDown)
-3:1213:0:49:1 //Set octave 1: & (KeyDown)
-3:1214:0:50:1 //Set octave 2: \xE9 (KeyDown)
-3:1215:0:51:1 //Set octave 3: " (KeyDown)
-3:1216:0:52:1 //Set octave 4: ' (KeyDown)
-3:1217:0:53:1 //Set octave 5: ( (KeyDown)
-3:1218:0:54:1 //Set octave 6: - (KeyDown)
-3:1219:0:55:1 //Set octave 7: \xE8 (KeyDown)
-3:1220:0:56:1 //Set octave 8: _ (KeyDown)
-3:1221:0:57:1 //Set octave 9: \xE7 (KeyDown)
-3:1316:1:16:1 //Chord Modifier: Shift+MAJ (KeyDown)
-3:1200:1:219:1 //Note Cut: Shift+) (KeyDown)
-3:1201:1:187:1 //Note Off: Shift+= (KeyDown)
-3:1791:3:219:1 //Note Fade: Shift+Ctrl+) (KeyDown)
-3:1667:0:219:1 //Note Cut (don't remember instrument): ) (KeyDown)
-3:1668:0:187:1 //Note Off (don't remember instrument): = (KeyDown)
-3:1792:2:219:1 //Note Fade (don't remember instrument): Ctrl+) (KeyDown)
-3:1788:0:222:1 //Parameter control(MPTm only): \xB2 (KeyDown)
-3:1789:1:222:1 //Parameter control(smooth)(MPTm only): Shift+\xB2 (KeyDown)
-
-//----( Pattern Context [bottom] - Ins Col (4) )------------
-4:1202:0:96:1 //Set instrument digit 0: 0 (PAVE NUM.) (KeyDown)
-4:1202:0:48:1 //Set instrument digit 0: \xE0 (KeyDown)
-4:1203:0:97:1 //Set instrument digit 1: 1 (PAVE NUM.) (KeyDown)
-4:1203:0:49:1 //Set instrument digit 1: & (KeyDown)
-4:1204:0:98:1 //Set instrument digit 2: 2 (PAVE NUM.) (KeyDown)
-4:1204:0:50:1 //Set instrument digit 2: \xE9 (KeyDown)
-4:1205:0:99:1 //Set instrument digit 3: 3 (PAVE NUM.) (KeyDown)
-4:1205:0:51:1 //Set instrument digit 3: " (KeyDown)
-4:1206:0:100:1 //Set instrument digit 4: 4 (PAVE NUM.) (KeyDown)
-4:1206:0:52:1 //Set instrument digit 4: ' (KeyDown)
-4:1207:0:101:1 //Set instrument digit 5: 5 (PAVE NUM.) (KeyDown)
-4:1207:0:53:1 //Set instrument digit 5: ( (KeyDown)
-4:1208:0:102:1 //Set instrument digit 6: 6 (PAVE NUM.) (KeyDown)
-4:1208:0:54:1 //Set instrument digit 6: - (KeyDown)
-4:1209:0:103:1 //Set instrument digit 7: 7 (PAVE NUM.) (KeyDown)
-4:1209:0:55:1 //Set instrument digit 7: \xE8 (KeyDown)
-4:1210:0:104:1 //Set instrument digit 8: 8 (PAVE NUM.) (KeyDown)
-4:1211:0:105:1 //Set instrument digit 9: 9 (PAVE NUM.) (KeyDown)
-4:1211:0:57:1 //Set instrument digit 9: \xE7 (KeyDown)
-
-//----( Pattern Context [bottom] - Vol Col (5) )------------
-5:1222:0:48:1 //Set volume digit 0: \xE0 (KeyDown)
-5:1222:0:96:1 //Set volume digit 0: 0 (PAVE NUM.) (KeyDown)
-5:1223:0:49:1 //Set volume digit 1: & (KeyDown)
-5:1223:0:97:1 //Set volume digit 1: 1 (PAVE NUM.) (KeyDown)
-5:1224:0:50:1 //Set volume digit 2: \xE9 (KeyDown)
-5:1224:0:98:1 //Set volume digit 2: 2 (PAVE NUM.) (KeyDown)
-5:1225:0:51:1 //Set volume digit 3: " (KeyDown)
-5:1225:0:99:1 //Set volume digit 3: 3 (PAVE NUM.) (KeyDown)
-5:1226:0:52:1 //Set volume digit 4: ' (KeyDown)
-5:1226:0:100:1 //Set volume digit 4: 4 (PAVE NUM.) (KeyDown)
-5:1227:0:53:1 //Set volume digit 5: ( (KeyDown)
-5:1227:0:101:1 //Set volume digit 5: 5 (PAVE NUM.) (KeyDown)
-5:1228:0:54:1 //Set volume digit 6: - (KeyDown)
-5:1228:0:102:1 //Set volume digit 6: 6 (PAVE NUM.) (KeyDown)
-5:1229:0:55:1 //Set volume digit 7: \xE8 (KeyDown)
-5:1229:0:103:1 //Set volume digit 7: 7 (PAVE NUM.) (KeyDown)
-5:1230:0:56:1 //Set volume digit 8: _ (KeyDown)
-5:1231:0:57:1 //Set volume digit 9: \xE7 (KeyDown)
-5:1231:0:105:1 //Set volume digit 9: 9 (PAVE NUM.) (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)
-6:1666:6:51:1 //FX parameter extension command: Ctrl+Alt+" (KeyDown)
-
-//----( Pattern Context [bottom] - Param Col (7) )------------
-7:1247:0:48:1 //FX Param digit 0: \xE0 (KeyDown)
-7:1247:0:96:1 //FX Param digit 0: 0 (PAVE NUM.) (KeyDown)
-7:1248:0:49:1 //FX Param digit 1: & (KeyDown)
-7:1248:0:97:1 //FX Param digit 1: 1 (PAVE NUM.) (KeyDown)
-7:1249:0:50:1 //FX Param digit 2: \xE9 (KeyDown)
-7:1249:0:98:1 //FX Param digit 2: 2 (PAVE NUM.) (KeyDown)
-7:1250:0:51:1 //FX Param digit 3: " (KeyDown)
-7:1250:0:99:1 //FX Param digit 3: 3 (PAVE NUM.) (KeyDown)
-7:1251:0:52:1 //FX Param digit 4: ' (KeyDown)
-7:1251:0:100:1 //FX Param digit 4: 4 (PAVE NUM.) (KeyDown)
-7:1252:0:53:1 //FX Param digit 5: ( (KeyDown)
-7:1252:0:101:1 //FX Param digit 5: 5 (PAVE NUM.) (KeyDown)
-7:1253:0:54:1 //FX Param digit 6: - (KeyDown)
-7:1253:0:102:1 //FX Param digit 6: 6 (PAVE NUM.) (KeyDown)
-7:1254:0:55:1 //FX Param digit 7: \xE8 (KeyDown)
-7:1254:0:103:1 //FX Param digit 7: 7 (PAVE NUM.) (KeyDown)
-7:1255:0:56:1 //FX Param digit 8: _ (KeyDown)
-7:1255:0:104:1 //FX Param digit 8: 8 (PAVE NUM.) (KeyDown)
-7:1256:0:57:1 //FX Param digit 9: \xE7 (KeyDown)
-7:1256:0:105:1 //FX Param digit 9: 9 (PAVE NUM.) (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:1673:4:79:1 //Load a Sample: Alt+O (KeyDown)
-8:1674:4:83:1 //Save Sample: Alt+S (KeyDown)
-8:1675:4:78:1 //New Sample: Alt+N (KeyDown)
-8:1380:2:84:1 //Trim sample around loop points: Ctrl+T (KeyDown)
-8:1383:0:8:1 //Silence sample selection: RET.ARR (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: SUPPR (KeyDown)
-8:1386:0:33:1 //Zoom Out: PG.PREC (KeyDown)
-8:1387:0:34:1 //Zoom In: PG.SUIV (KeyDown)
-8:1790:6:68:1 //Remove DC Offset: Ctrl+Alt+D (KeyDown)
-
-//----( Instrument Context [bottom] (9) )------------
-9:1825:1:9:5 //Select previous envelope point: Shift+TAB (KeyDown|KeyHold)
-9:1825:0:166:5 //Select previous envelope point: (KeyDown|KeyHold)
-9:1826:0:9:5 //Select next envelope point: TAB (KeyDown|KeyHold)
-9:1826:0:167:5 //Select next envelope point: (KeyDown|KeyHold)
-9:1821:0:37:5 //Move envelope point left: GAUCHE (KeyDown|KeyHold)
-9:1822:0:39:5 //Move envelope point right: DROITE (KeyDown|KeyHold)
-9:1823:0:38:5 //Move envelope point up: HAUT (KeyDown|KeyHold)
-9:1834:0:33:5 //Move envelope point up (big step): PG.PREC (KeyDown|KeyHold)
-9:1824:0:40:5 //Move envelope point down: BAS (KeyDown|KeyHold)
-9:1835:0:34:5 //Move envelope point down (big step): PG.SUIV (KeyDown|KeyHold)
-9:1827:0:45:5 //Insert envelope point: INS (KeyDown|KeyHold)
-9:1828:0:46:5 //Remove envelope point: SUPPR (KeyDown|KeyHold)
-9:1829:0:36:1 //Set loop start: ORIGINE (KeyDown)
-9:1830:0:35:1 //Set loop end: FIN (KeyDown)
-9:1831:2:36:1 //Set sustain loop start: Ctrl+ORIGINE (KeyDown)
-9:1832:2:35:1 //Set sustain loop end: Ctrl+FIN (KeyDown)
-9:1833:2:82:1 //Toggle release node: Ctrl+R (KeyDown)
-
-//----( Comments Context [bottom] (10) )------------
-
-//----( Unknown Context (11) )------------
-
-//----( Unknown Context (12) )------------
-
-//----( Plugin GUI Context (13) )------------
-13:1763:0:166:1 //Previous plugin preset: (KeyDown)
-13:1764:0:167:1 //Next plugin preset: (KeyDown)
-13:1782:2:166:1 //Plugin preset backward jump: Ctrl+ (KeyDown)
-13:1783:2:167:1 //Plugin preset forward jump: Ctrl+ (KeyDown)
-13:1765:6:82:1 //Randomize plugin parameters: Ctrl+Alt+R (KeyDown)
-
-//----( General Context [top] (14) )------------
-
-//----( Pattern Context [top] (15) )------------
-
-//----( Sample Context [top] (16) )------------
-
-//----( Instrument Context [top] (17) )------------
-
-//----( Comments Context [top] (18) )------------
-
-//----( Orderlist (19) )------------
-19:1802:0:46:5 //Delete Order: SUPPR (KeyDown|KeyHold)
-19:1803:0:45:5 //Insert Order: INS (KeyDown|KeyHold)
-19:1804:0:13:5 //Edit Pattern: ENTREE (KeyDown|KeyHold)
-19:1805:0:9:5 //Switch to pattern editor: TAB (KeyDown|KeyHold)
-19:1794:0:37:5 //Previous Order: GAUCHE (KeyDown|KeyHold)
-19:1795:0:39:5 //Next Order: DROITE (KeyDown|KeyHold)
-19:1796:0:36:5 //First Order: ORIGINE (KeyDown|KeyHold)
-19:1797:0:35:5 //Last Order: FIN (KeyDown|KeyHold)
-19:1807:0:48:5 //Pattern index digit 0: \xE0 (KeyDown|KeyHold)
-19:1807:0:96:5 //Pattern index digit 0: 0 (PAVE NUM.) (KeyDown|KeyHold)
-19:1808:0:49:5 //Pattern index digit 1: & (KeyDown|KeyHold)
-19:1808:0:97:5 //Pattern index digit 1: 1 (PAVE NUM.) (KeyDown|KeyHold)
-19:1809:0:50:5 //Pattern index digit 2: \xE9 (KeyDown|KeyHold)
-19:1809:0:98:5 //Pattern index digit 2: 2 (PAVE NUM.) (KeyDown|KeyHold)
-19:1810:0:51:5 //Pattern index digit 3: " (KeyDown|KeyHold)
-19:1810:0:99:5 //Pattern index digit 3: 3 (PAVE NUM.) (KeyDown|KeyHold)
-19:1811:0:52:5 //Pattern index digit 4: ' (KeyDown|KeyHold)
-19:1811:0:100:5 //Pattern index digit 4: 4 (PAVE NUM.) (KeyDown|KeyHold)
-19:1812:0:53:5 //Pattern index digit 5: ( (KeyDown|KeyHold)
-19:1812:0:101:5 //Pattern index digit 5: 5 (PAVE NUM.) (KeyDown|KeyHold)
-19:1813:0:54:5 //Pattern index digit 6: - (KeyDown|KeyHold)
-19:1813:0:102:5 //Pattern index digit 6: 6 (PAVE NUM.) (KeyDown|KeyHold)
-19:1814:0:55:5 //Pattern index digit 7: \xE8 (KeyDown|KeyHold)
-19:1814:0:103:5 //Pattern index digit 7: 7 (PAVE NUM.) (KeyDown|KeyHold)
-19:1815:0:56:5 //Pattern index digit 8: _ (KeyDown|KeyHold)
-19:1815:0:104:5 //Pattern index digit 8: 8 (PAVE NUM.) (KeyDown|KeyHold)
-19:1816:0:57:5 //Pattern index digit 9: \xE7 (KeyDown|KeyHold)
-19:1816:0:105:5 //Pattern index digit 9: 9 (PAVE NUM.) (KeyDown|KeyHold)
-19:1817:0:38:5 //Increase pattern index : HAUT (KeyDown|KeyHold)
-19:1817:0:187:5 //Increase pattern index : = (KeyDown|KeyHold)
-19:1818:0:40:5 //Decrease pattern index: BAS (KeyDown|KeyHold)
-19:1818:0:189:5 //Decrease pattern index: (KeyDown|KeyHold)
Modified: trunk/OpenMPT/soundlib/Sampleio.cpp
===================================================================
--- trunk/OpenMPT/soundlib/Sampleio.cpp 2010-04-07 17:23:25 UTC (rev 566)
+++ trunk/OpenMPT/soundlib/Sampleio.cpp 2010-04-10 22:43:18 UTC (rev 567)
@@ -1680,11 +1680,12 @@
if (pis->C5Speed < 256) pSmp->nC5Speed = 256;
pSmp->RelativeTone = 0;
pSmp->nFineTune = 0;
- if (m_nType & MOD_TYPE_XM) FrequencyToTranspose(pSmp);
+ if (GetType() == MOD_TYPE_XM) FrequencyToTranspose(pSmp);
pSmp->nVolume = pis->vol << 2;
if (pSmp->nVolume > 256) pSmp->nVolume = 256;
pSmp->nGlobalVol = pis->gvl;
if (pSmp->nGlobalVol > 64) pSmp->nGlobalVol = 64;
+ pSmp->uFlags = 0;
if (pis->flags & 0x10) pSmp->uFlags |= CHN_LOOP;
if (pis->flags & 0x20) pSmp->uFlags |= CHN_SUSTAINLOOP;
if (pis->flags & 0x40) pSmp->uFlags |= CHN_PINGPONGLOOP;
@@ -1700,7 +1701,8 @@
if (pis->flags & 2)
{
flags += 5;
- if (pis->flags & 4) {
+ if (pis->flags & 4)
+ {
flags |= RSF_STEREO;
// -> CODE#0001
// -> DESC="enable saving stereo ITI"
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <sag...@us...> - 2010-04-07 17:23:38
|
Revision: 566
http://modplug.svn.sourceforge.net/modplug/?rev=566&view=rev
Author: saga-games
Date: 2010-04-07 17:23:25 +0000 (Wed, 07 Apr 2010)
Log Message:
-----------
[Reg] Cannot create S3M files with more than 100 patterns anymore, because...
[Fix] ... it was possible to create S3M files where the 256 parapointers were not enough. It was possible to crash MPT with 669 files with SCRM at position 0x2C because MPT would allow more than 256 parapointer table entries, although it only reserved 256*2 bytes for it.
Modified Paths:
--------------
trunk/OpenMPT/soundlib/Load_s3m.cpp
trunk/OpenMPT/soundlib/mod_specifications.h
Modified: trunk/OpenMPT/soundlib/Load_s3m.cpp
===================================================================
--- trunk/OpenMPT/soundlib/Load_s3m.cpp 2010-04-07 15:19:36 UTC (rev 565)
+++ trunk/OpenMPT/soundlib/Load_s3m.cpp 2010-04-07 17:23:25 UTC (rev 566)
@@ -270,7 +270,7 @@
dwMemPos = 0x60;
m_nType = MOD_TYPE_S3M;
- memset(m_szNames,0,sizeof(m_szNames));
+ memset(m_szNames, 0, sizeof(m_szNames));
memcpy(m_szNames[0], psfh.name, 28);
SpaceToNullStringFixed(m_szNames[0], 28);
// Speed
@@ -326,12 +326,18 @@
patnum = npat = psfh.patnum;
if (patnum > MAX_PATTERNS) patnum = MAX_PATTERNS;
memset(ptr, 0, sizeof(ptr));
- if (nins+npat)
+
+ // this seems to be corrupted, the table can't really hold that many values.
+ if(nins + npat > 256)
+ return false;
+
+ if (nins + npat)
{
- memcpy(ptr, lpStream+dwMemPos, 2*(nins+npat));
- dwMemPos += 2*(nins+npat);
- const UINT nLoopEnd = min(256, nins+npat);
- for (UINT j = 0; j < nLoopEnd; ++j) {
+ memcpy(ptr, lpStream + dwMemPos, 2 * (nins + npat));
+ dwMemPos += 2 * (nins + npat);
+ const UINT nLoopEnd = min(256, nins + npat);
+ for(UINT j = 0; j < nLoopEnd; ++j)
+ {
ptr[j] = LittleEndianW(ptr[j]);
}
if (psfh.panning_present == 252)
Modified: trunk/OpenMPT/soundlib/mod_specifications.h
===================================================================
--- trunk/OpenMPT/soundlib/mod_specifications.h 2010-04-07 15:19:36 UTC (rev 565)
+++ trunk/OpenMPT/soundlib/mod_specifications.h 2010-04-07 17:23:25 UTC (rev 566)
@@ -295,7 +295,7 @@
true, //Has notecut.
false, //No noteoff.
false, //No notefade.
- 240, //Pattern max.
+ 99, //Pattern max.
255, //Order max.
1, //Channel min
32, //Channel max
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <sag...@us...> - 2010-04-07 15:19:42
|
Revision: 565
http://modplug.svn.sourceforge.net/modplug/?rev=565&view=rev
Author: saga-games
Date: 2010-04-07 15:19:36 +0000 (Wed, 07 Apr 2010)
Log Message:
-----------
[Fix] MOD Saving: Samples were shifted badly if the sample size was odd. (wow, this is an OLD bug!)
[Fix] Sample Editor: It was not possible to create the last sample slot (i.e. pressing "new sample" with a MOD file that had 30 samples would result in an error, although MOD supports 31 samples).
Modified Paths:
--------------
trunk/OpenMPT/mptrack/Modedit.cpp
trunk/OpenMPT/soundlib/Load_mod.cpp
Modified: trunk/OpenMPT/mptrack/Modedit.cpp
===================================================================
--- trunk/OpenMPT/mptrack/Modedit.cpp 2010-03-30 19:13:11 UTC (rev 564)
+++ trunk/OpenMPT/mptrack/Modedit.cpp 2010-04-07 15:19:36 UTC (rev 565)
@@ -742,7 +742,7 @@
}
}
if (((bLimit) && (i >= 200) && (!m_SndFile.m_nInstruments))
- || (i >= m_SndFile.GetModSpecifications().samplesMax))
+ || (i > m_SndFile.GetModSpecifications().samplesMax))
{
ErrorBox(IDS_ERR_TOOMANYSMP, CMainFrame::GetMainFrame());
return SAMPLEINDEX_INVALID;
Modified: trunk/OpenMPT/soundlib/Load_mod.cpp
===================================================================
--- trunk/OpenMPT/soundlib/Load_mod.cpp 2010-03-30 19:13:11 UTC (rev 564)
+++ trunk/OpenMPT/soundlib/Load_mod.cpp 2010-04-07 15:19:36 UTC (rev 565)
@@ -487,6 +487,9 @@
MODSAMPLE *pSmp = &Samples[insmap[iins]];
memcpy(bTab, m_szNames[iins],22);
inslen[iins] = pSmp->nLength;
+ // if the sample size is odd, we have to add a padding byte, as all sample sizes in MODs are even.
+ if(inslen[iins] & 1)
+ inslen[iins]++;
if (inslen[iins] > 0x1fff0) inslen[iins] = 0x1fff0;
bTab[22] = inslen[iins] >> 9;
bTab[23] = inslen[iins] >> 1;
@@ -509,7 +512,7 @@
fwrite(bTab, 30, 1, f);
}
// Writing number of patterns
- UINT nbp=0, norders=128;
+ UINT nbp = 0, norders = 128;
for (UINT iord=0; iord<128; iord++)
{
if (Order[iord] == Order.GetInvalidPatIndex())
@@ -535,7 +538,8 @@
// Writing patterns
for (UINT ipat=0; ipat<nbp; ipat++) { //for all patterns
BYTE s[64*4];
- if (Patterns[ipat]) { //if pattern exists
+ if (Patterns[ipat]) //if pattern exists
+ {
MODCOMMAND *m = Patterns[ipat];
for (UINT i=0; i<64; i++) { //for all rows
if (i < PatternSize[ipat]) { //if row exists
@@ -584,7 +588,7 @@
}
// Writing instruments
- for (UINT ismpd=1; ismpd<=31; ismpd++) if (inslen[ismpd])
+ for (UINT ismpd = 1; ismpd <= 31; ismpd++) if (inslen[ismpd])
{
MODSAMPLE *pSmp = &Samples[insmap[ismpd]];
if(bCompatibilityExport == true) // first two bytes have to be 0 due to PT's one-shot loop ("no loop")
@@ -604,6 +608,12 @@
}
#endif
WriteSample(f, pSmp, flags, inslen[ismpd]);
+ // write padding byte if the sample size is odd.
+ if((pSmp->nLength & 1) && !nPacking)
+ {
+ int8 padding = 0;
+ fwrite(&padding, 1, 1, f);
+ }
}
fclose(f);
return true;
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <sag...@us...> - 2010-03-30 19:13:18
|
Revision: 564
http://modplug.svn.sourceforge.net/modplug/?rev=564&view=rev
Author: saga-games
Date: 2010-03-30 19:13:11 +0000 (Tue, 30 Mar 2010)
Log Message:
-----------
[Fix] Pattern Editor: When using MIDI record or split keyboard settings, volume data was writting into the volume column in MOD format.
[Ref] Improved TCHAR handling of the previous patch (does not really matter at the moment, but let's better fix this right now)
Modified Paths:
--------------
trunk/OpenMPT/mptrack/Mptrack.cpp
trunk/OpenMPT/mptrack/View_pat.cpp
Modified: trunk/OpenMPT/mptrack/Mptrack.cpp
===================================================================
--- trunk/OpenMPT/mptrack/Mptrack.cpp 2010-03-29 20:00:06 UTC (rev 563)
+++ trunk/OpenMPT/mptrack/Mptrack.cpp 2010-03-30 19:13:11 UTC (rev 564)
@@ -135,7 +135,7 @@
CHAR s[_MAX_PATH], *pszCmd, *pszData;
int len;
- lstrcpyn(s, lpszCommand, sizeof(s));
+ lstrcpyn(s, lpszCommand, CountOf(s));
len = strlen(s) - 1;
while ((len > 0) && (strchr("(){}[]\'\" ", s[len]))) s[len--] = 0;
pszCmd = s;
@@ -356,24 +356,24 @@
}
return TRUE;
}
- GetPrivateProfileString(_T("Ultrasound"), _T("PatchDir"), _T(""), szUltraSndPath, sizeof(szUltraSndPath), lpszConfigFile);
+ GetPrivateProfileString(_T("Ultrasound"), _T("PatchDir"), _T(""), szUltraSndPath, CountOf(szUltraSndPath), lpszConfigFile);
if (!strcmp(szUltraSndPath, _T(".\\"))) szUltraSndPath[0] = 0;
- if (!szUltraSndPath[0]) GetCurrentDirectory(sizeof(szUltraSndPath), szUltraSndPath);
+ if (!szUltraSndPath[0]) GetCurrentDirectory(CountOf(szUltraSndPath), szUltraSndPath);
for (UINT iMidi=0; iMidi<256; iMidi++)
{
szFileName[0] = 0;
wsprintf(s, (iMidi < 128) ? _T("Midi%d") : _T("Perc%d"), iMidi & 0x7f);
- GetPrivateProfileString(_T("Midi Library"), s, _T(""), szFileName, sizeof(szFileName), lpszConfigFile);
+ GetPrivateProfileString(_T("Midi Library"), s, _T(""), szFileName, CountOf(szFileName), lpszConfigFile);
// Check for ULTRASND.INI
if (!szFileName[0])
{
LPCSTR pszSection = (iMidi < 128) ? _T("Melodic Patches") : _T("Drum Patches");
wsprintf(s, _T("%d"), iMidi & 0x7f);
- GetPrivateProfileString(pszSection, s, _T(""), szFileName, sizeof(szFileName), lpszConfigFile);
+ GetPrivateProfileString(pszSection, s, _T(""), szFileName, CountOf(szFileName), lpszConfigFile);
if (!szFileName[0])
{
pszSection = (iMidi < 128) ? _T("Melodic Bank 0") : _T("Drum Bank 0");
- GetPrivateProfileString(pszSection, s, "", szFileName, sizeof(szFileName), lpszConfigFile);
+ GetPrivateProfileString(pszSection, s, "", szFileName, CountOf(szFileName), lpszConfigFile);
}
if (szFileName[0])
{
@@ -384,9 +384,9 @@
int len = strlen(s)-1;
if ((len) && (s[len-1] != '\\')) strcat(s, _T("\\"));
}
- strncat(s, szFileName, sizeof(s));
- strncat(s, ".pat", sizeof(s));
- strcpy(szFileName, s);
+ _tcsncat(s, szFileName, CountOf(s));
+ _tcsncat(s, ".pat", CountOf(s));
+ _tcscpy(szFileName, s);
}
}
if (szFileName[0])
@@ -396,7 +396,7 @@
if ((glpMidiLibrary->MidiMap[iMidi] = new TCHAR[_MAX_PATH]) == nullptr) return FALSE;
}
CMainFrame::RelativePathToAbsolute(szFileName);
- strcpy(glpMidiLibrary->MidiMap[iMidi], szFileName);
+ _tcscpy(glpMidiLibrary->MidiMap[iMidi], szFileName);
}
}
return FALSE;
@@ -409,7 +409,7 @@
TCHAR szFileName[_MAX_PATH], s[128];
if ((!glpMidiLibrary) || (!lpszConfigFile) || (!lpszConfigFile[0])) return FALSE;
- for (UINT iMidi=0; iMidi<256; iMidi++) if (glpMidiLibrary->MidiMap[iMidi])
+ for(size_t iMidi = 0; iMidi < 256; iMidi++) if (glpMidiLibrary->MidiMap[iMidi])
{
if (iMidi < 128)
wsprintf(s, _T("Midi%d"), iMidi);
@@ -418,7 +418,7 @@
strcpy(szFileName, glpMidiLibrary->MidiMap[iMidi]);
- if (szFileName[0])
+ if(szFileName[0])
{
if(IsPortableMode())
CMainFrame::AbsolutePathToRelative(szFileName);
@@ -449,8 +449,9 @@
{
CHAR s[MAX_PATH];
UINT numBanks = CMainFrame::GetPrivateProfileLong("DLS Banks", "NumBanks", 0, theApp.GetConfigFileName());
- for (UINT i=0; i<numBanks; i++) {
- wsprintf(s, _T("Bank%d"), i+1);
+ for(size_t i = 0; i < numBanks; i++)
+ {
+ wsprintf(s, _T("Bank%d"), i + 1);
TCHAR szPath[_MAX_PATH];
GetPrivateProfileString("DLS Banks", s, "", szPath, INIBUFFERSIZE, theApp.GetConfigFileName());
CMainFrame::RelativePathToAbsolute(szPath);
Modified: trunk/OpenMPT/mptrack/View_pat.cpp
===================================================================
--- trunk/OpenMPT/mptrack/View_pat.cpp 2010-03-29 20:00:06 UTC (rev 563)
+++ trunk/OpenMPT/mptrack/View_pat.cpp 2010-03-30 19:13:11 UTC (rev 564)
@@ -4226,22 +4226,36 @@
}*/
// -- write vol data
+ int volWrite = -1;
if (vol >= 0 && vol <= 64 && !(isSplit && pModDoc->GetSplitKeyboardSettings()->splitVolume)) //write valid volume, as long as there's no split volume override.
{
- p->volcmd=VOLCMD_VOLUME;
- p->vol = vol;
+ volWrite = vol;
} else if (isSplit && pModDoc->GetSplitKeyboardSettings()->splitVolume) //cater for split volume override.
{
if (pModDoc->GetSplitKeyboardSettings()->splitVolume > 0 && pModDoc->GetSplitKeyboardSettings()->splitVolume <= 64)
{
- p->volcmd=VOLCMD_VOLUME;
- p->vol = pModDoc->GetSplitKeyboardSettings()->splitVolume;
+ volWrite = pModDoc->GetSplitKeyboardSettings()->splitVolume;
}
}
+ if(volWrite != -1)
+ {
+ if(pSndFile->GetType() == MOD_TYPE_MOD)
+ {
+ p->command = CMD_VOLUME;
+ p->param = (MODCOMMAND::PARAM)volWrite;
+ } else
+ {
+ p->volcmd = VOLCMD_VOLUME;
+ p->vol = (MODCOMMAND::VOL)volWrite;
+ }
+ }
+
// -- 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 (usePlaybackPosition && nTick) // avoid SD0 which will be mis-interpreted
+ {
+ if (p->command == 0) //make sure we don't overwrite any existing commands.
+ {
p->command = (pSndFile->TypeIsS3M_IT_MPT()) ? CMD_S3MCMDEX : CMD_MODCMDEX;
UINT maxSpeed = 0x0F;
if(pSndFile->m_nMusicSpeed > 0) maxSpeed = min(0x0F, pSndFile->m_nMusicSpeed - 1);
@@ -4275,14 +4289,17 @@
}
//Move cursor down only if not recording live.
- if ( bIsLiveRecord == false )
+ if(bIsLiveRecord == false)
{
- if ((m_nSpacing > 0) && (m_nSpacing <= MAX_SPACING)) {
+ 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->PatternSize[nPat] || (CMainFrame::m_dwPatternSetup & PATTERN_CONTSCROLL))
+ {
SetCurrentRow(nRow + m_nSpacing, (CMainFrame::m_dwPatternSetup & PATTERN_CONTSCROLL) ? true: false);
m_bLastNoteEntryBlocked=false;
- } else {
+ } else
+ {
m_bLastNoteEntryBlocked=true; // if the cursor is block by the end of the pattern here,
} // we must remember to not step back should the next note form a chord.
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <sag...@us...> - 2010-03-29 20:00:13
|
Revision: 563
http://modplug.svn.sourceforge.net/modplug/?rev=563&view=rev
Author: saga-games
Date: 2010-03-29 20:00:06 +0000 (Mon, 29 Mar 2010)
Log Message:
-----------
[Fix] IT Compatibility: Always reset autovibrato settings when there's an instrument number (fix from SchismTracker)
[Imp] Instrument Editor: When pasting an envelope, it's now also automatically enabled.
[Ref] Simplified the IsCompatibleMode macro. This was unnecessarily confusing.
Modified Paths:
--------------
trunk/OpenMPT/mptrack/Modedit.cpp
trunk/OpenMPT/soundlib/Snd_fx.cpp
trunk/OpenMPT/soundlib/Sndfile.h
Modified: trunk/OpenMPT/mptrack/Modedit.cpp
===================================================================
--- trunk/OpenMPT/mptrack/Modedit.cpp 2010-03-29 14:19:36 UTC (rev 562)
+++ trunk/OpenMPT/mptrack/Modedit.cpp 2010-03-29 20:00:06 UTC (rev 563)
@@ -1602,7 +1602,7 @@
pEnv->nLoopStart = loopBegin;
pEnv->nLoopEnd = loopEnd;
pEnv->nReleaseNode = releaseNode;
- pEnv->dwFlags = (pEnv->dwFlags & ~(ENV_LOOP|ENV_SUSTAIN|ENV_CARRY)) | (bLoop ? ENV_LOOP : 0) | (bSus ? ENV_SUSTAIN : 0) | (bCarry ? ENV_CARRY: 0);
+ pEnv->dwFlags = (pEnv->dwFlags & ~(ENV_LOOP|ENV_SUSTAIN|ENV_CARRY)) | (bLoop ? ENV_LOOP : 0) | (bSus ? ENV_SUSTAIN : 0) | (bCarry ? ENV_CARRY: 0) | ENV_ENABLED;
int oldn = 0;
for (UINT i=0; i<nPoints; i++)
Modified: trunk/OpenMPT/soundlib/Snd_fx.cpp
===================================================================
--- trunk/OpenMPT/soundlib/Snd_fx.cpp 2010-03-29 14:19:36 UTC (rev 562)
+++ trunk/OpenMPT/soundlib/Snd_fx.cpp 2010-03-29 20:00:06 UTC (rev 563)
@@ -553,8 +553,12 @@
} else {
resetEnvelopes(pChn);
}
- pChn->nAutoVibDepth = 0;
- pChn->nAutoVibPos = 0;
+ // IT Compatibility: Always reset autovibrato settings when there's an instrument number
+ if(!IsCompatibleMode(TRK_IMPULSETRACKER))
+ {
+ pChn->nAutoVibDepth = 0;
+ pChn->nAutoVibPos = 0;
+ }
} else if ((pIns) && (!(pIns->VolEnv.dwFlags & ENV_ENABLED)))
{
resetEnvelopes(pChn);
@@ -568,6 +572,13 @@
return;
}
+ // IT Compatibility: Always reset autovibrato settings when there's an instrument number
+ if(IsCompatibleMode(TRK_IMPULSETRACKER))
+ {
+ pChn->nAutoVibDepth = 0;
+ pChn->nAutoVibPos = 0;
+ }
+
// Tone-Portamento doesn't reset the pingpong direction flag
if ((bPorta) && (pSmp == pChn->pModSample))
{
Modified: trunk/OpenMPT/soundlib/Sndfile.h
===================================================================
--- trunk/OpenMPT/soundlib/Sndfile.h 2010-03-29 14:19:36 UTC (rev 562)
+++ trunk/OpenMPT/soundlib/Sndfile.h 2010-03-29 20:00:06 UTC (rev 563)
@@ -485,12 +485,13 @@
void SetModFlag(BYTE i, bool val) {if(i < 8*sizeof(m_ModFlags)) {m_ModFlags = (val) ? m_ModFlags |= (1 << i) : m_ModFlags &= ~(1 << i);}}
// 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
- // Hint 2: Always returns true for MOD / S3M format (if that is the format of the current file)
- bool IsCompatibleMode(MODTYPE type) {
+ // 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)
+ {
if(GetType() & type & (MOD_TYPE_MOD | MOD_TYPE_S3M))
- return true; // those formats don't have flags so we will always return true
- return ((GetType() & ((type & MOD_TYPE_IT) ? type | MOD_TYPE_MPT : type)) && GetModFlag(MSF_COMPATIBLE_PLAY)) ? true : false;
+ return true; // S3M and MOD format don't have compatibility flags, so we will always return true
+ return ((GetType() & type) && GetModFlag(MSF_COMPATIBLE_PLAY)) ? true : false;
}
//Tuning-->
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <sag...@us...> - 2010-03-29 14:19:42
|
Revision: 562
http://modplug.svn.sourceforge.net/modplug/?rev=562&view=rev
Author: saga-games
Date: 2010-03-29 14:19:36 +0000 (Mon, 29 Mar 2010)
Log Message:
-----------
[Imp] Midi Library also makes use of relative paths now.
Modified Paths:
--------------
trunk/OpenMPT/mptrack/Mptrack.cpp
trunk/OpenMPT/mptrack/Mptrack.h
trunk/OpenMPT/mptrack/View_tre.cpp
trunk/OpenMPT/mptrack/View_tre.h
Modified: trunk/OpenMPT/mptrack/Mptrack.cpp
===================================================================
--- trunk/OpenMPT/mptrack/Mptrack.cpp 2010-03-28 22:53:43 UTC (rev 561)
+++ trunk/OpenMPT/mptrack/Mptrack.cpp 2010-03-29 14:19:36 UTC (rev 562)
@@ -250,7 +250,7 @@
"[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 import.\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"
@@ -272,7 +272,7 @@
//================================================
{
public:
- BOOL m_bNoAcm, m_bNoDls, m_bNoMp3, m_bSafeMode, m_bWavEx, m_bNoPlugins, m_bDebug,
+ bool m_bNoAcm, m_bNoDls, m_bNoMp3, m_bSafeMode, m_bWavEx, m_bNoPlugins, m_bDebug,
m_bNoSettingsOnNewVersion;
CString m_csExtension;
@@ -280,7 +280,7 @@
public:
CMPTCommandLineInfo() {
m_bNoAcm = m_bNoDls = m_bNoMp3 = m_bSafeMode = m_bWavEx =
- m_bNoPlugins = m_bDebug = m_bNoSettingsOnNewVersion = FALSE;
+ m_bNoPlugins = m_bDebug = m_bNoSettingsOnNewVersion = false;
m_csExtension = "";
}
virtual void ParseParam(LPCTSTR lpszParam, BOOL bFlag, BOOL bLast);
@@ -293,13 +293,13 @@
if ((lpszParam) && (bFlag))
{
if (!lstrcmpi(lpszParam, "nologo")) { m_bShowSplash = FALSE; return; } else
- if (!lstrcmpi(lpszParam, "nodls")) { m_bNoDls = TRUE; return; } else
- if (!lstrcmpi(lpszParam, "noacm")) { m_bNoAcm = TRUE; return; } else
- if (!lstrcmpi(lpszParam, "nomp3")) { m_bNoMp3 = TRUE; return; } else
- if (!lstrcmpi(lpszParam, "wavex")) { m_bWavEx = TRUE; } else
- if (!lstrcmpi(lpszParam, "noplugs")) { m_bNoPlugins = TRUE; } else
- if (!lstrcmpi(lpszParam, "debug")) { m_bDebug = TRUE; } else
- if (!lstrcmpi(lpszParam, "noSettingsOnNewVersion")) { m_bNoSettingsOnNewVersion = TRUE; }
+ if (!lstrcmpi(lpszParam, "nodls")) { m_bNoDls = true; return; } else
+ if (!lstrcmpi(lpszParam, "noacm")) { m_bNoAcm = true; return; } else
+ if (!lstrcmpi(lpszParam, "nomp3")) { m_bNoMp3 = true; return; } else
+ if (!lstrcmpi(lpszParam, "wavex")) { m_bWavEx = true; } else
+ if (!lstrcmpi(lpszParam, "noplugs")) { m_bNoPlugins = true; } else
+ if (!lstrcmpi(lpszParam, "debug")) { m_bDebug = true; } else
+ if (!lstrcmpi(lpszParam, "noSettingsOnNewVersion")) { m_bNoSettingsOnNewVersion = true; }
}
CCommandLineInfo::ParseParam(lpszParam, bFlag, bLast);
}
@@ -313,7 +313,7 @@
BOOL CTrackApp::ImportMidiConfig(LPCSTR lpszConfigFile, BOOL bNoWarn)
//-------------------------------------------------------------------
{
- CHAR szFileName[_MAX_PATH], s[_MAX_PATH], szUltraSndPath[_MAX_PATH];
+ TCHAR szFileName[_MAX_PATH], s[_MAX_PATH], szUltraSndPath[_MAX_PATH];
if ((!lpszConfigFile) || (!lpszConfigFile[0])) return FALSE;
if (!glpMidiLibrary)
@@ -356,23 +356,23 @@
}
return TRUE;
}
- GetPrivateProfileString("Ultrasound", "PatchDir", "", szUltraSndPath, sizeof(szUltraSndPath), lpszConfigFile);
- if (!strcmp(szUltraSndPath, ".\\")) szUltraSndPath[0] = 0;
+ GetPrivateProfileString(_T("Ultrasound"), _T("PatchDir"), _T(""), szUltraSndPath, sizeof(szUltraSndPath), lpszConfigFile);
+ if (!strcmp(szUltraSndPath, _T(".\\"))) szUltraSndPath[0] = 0;
if (!szUltraSndPath[0]) GetCurrentDirectory(sizeof(szUltraSndPath), szUltraSndPath);
for (UINT iMidi=0; iMidi<256; iMidi++)
{
szFileName[0] = 0;
- wsprintf(s, (iMidi < 128) ? "Midi%d" : "Perc%d", iMidi & 0x7f);
- GetPrivateProfileString("Midi Library", s, "", szFileName, sizeof(szFileName), lpszConfigFile);
+ wsprintf(s, (iMidi < 128) ? _T("Midi%d") : _T("Perc%d"), iMidi & 0x7f);
+ GetPrivateProfileString(_T("Midi Library"), s, _T(""), szFileName, sizeof(szFileName), lpszConfigFile);
// Check for ULTRASND.INI
if (!szFileName[0])
{
- LPCSTR pszSection = (iMidi < 128) ? "Melodic Patches" : "Drum Patches";
- wsprintf(s, "%d", iMidi & 0x7f);
- GetPrivateProfileString(pszSection, s, "", szFileName, sizeof(szFileName), lpszConfigFile);
+ LPCSTR pszSection = (iMidi < 128) ? _T("Melodic Patches") : _T("Drum Patches");
+ wsprintf(s, _T("%d"), iMidi & 0x7f);
+ GetPrivateProfileString(pszSection, s, _T(""), szFileName, sizeof(szFileName), lpszConfigFile);
if (!szFileName[0])
{
- pszSection = (iMidi < 128) ? "Melodic Bank 0" : "Drum Bank 0";
+ pszSection = (iMidi < 128) ? _T("Melodic Bank 0") : _T("Drum Bank 0");
GetPrivateProfileString(pszSection, s, "", szFileName, sizeof(szFileName), lpszConfigFile);
}
if (szFileName[0])
@@ -382,7 +382,7 @@
{
strcpy(s, szUltraSndPath);
int len = strlen(s)-1;
- if ((len) && (s[len-1] != '\\')) strcat(s, "\\");
+ if ((len) && (s[len-1] != '\\')) strcat(s, _T("\\"));
}
strncat(s, szFileName, sizeof(s));
strncat(s, ".pat", sizeof(s));
@@ -393,17 +393,9 @@
{
if (!glpMidiLibrary->MidiMap[iMidi])
{
- if ((glpMidiLibrary->MidiMap[iMidi] = new CHAR[_MAX_PATH]) == NULL) return FALSE;
+ if ((glpMidiLibrary->MidiMap[iMidi] = new TCHAR[_MAX_PATH]) == nullptr) return FALSE;
}
- if ((lpszConfigFile[1] == ':') && (szFileName[1] != ':'))
- {
- s[0] = lpszConfigFile[0];
- s[1] = lpszConfigFile[1];
- s[2] = 0;
- strncat(s, szFileName, sizeof(s));
- s[sizeof(s)-1] = 0;
- strcpy(szFileName, s);
- }
+ CMainFrame::RelativePathToAbsolute(szFileName);
strcpy(glpMidiLibrary->MidiMap[iMidi], szFileName);
}
}
@@ -414,25 +406,22 @@
BOOL CTrackApp::ExportMidiConfig(LPCSTR lpszConfigFile)
//-----------------------------------------------------
{
- CHAR szFileName[_MAX_PATH], s[128];
+ TCHAR szFileName[_MAX_PATH], s[128];
if ((!glpMidiLibrary) || (!lpszConfigFile) || (!lpszConfigFile[0])) return FALSE;
for (UINT iMidi=0; iMidi<256; iMidi++) if (glpMidiLibrary->MidiMap[iMidi])
{
if (iMidi < 128)
- wsprintf(s, "Midi%d", iMidi);
+ wsprintf(s, _T("Midi%d"), iMidi);
else
- wsprintf(s, "Perc%d", iMidi & 0x7F);
- /*if ((glpMidiLibrary->MidiMap[iMidi][1] == ':') && (lpszConfigFile[1] == ':')
- && ((glpMidiLibrary->MidiMap[iMidi][0]|0x20) == (lpszConfigFile[0]|0x20)))
- {
- strcpy(szFileName, glpMidiLibrary->MidiMap[iMidi]+2);
- } else*/
- {
- strcpy(szFileName, glpMidiLibrary->MidiMap[iMidi]);
- }
+ wsprintf(s, _T("Perc%d"), iMidi & 0x7F);
+
+ strcpy(szFileName, glpMidiLibrary->MidiMap[iMidi]);
+
if (szFileName[0])
{
+ if(IsPortableMode())
+ CMainFrame::AbsolutePathToRelative(szFileName);
if (!WritePrivateProfileString("Midi Library", s, szFileName, lpszConfigFile)) break;
}
}
@@ -962,7 +951,7 @@
// Parse command line for standard shell commands, DDE, file open
CMPTCommandLineInfo cmdInfo;
- if (GetDSoundVersion() >= 0x0700) cmdInfo.m_bWavEx = TRUE;
+ if (GetDSoundVersion() >= 0x0700) cmdInfo.m_bWavEx = true;
ParseCommandLine(cmdInfo);
// create main MDI Frame window
@@ -993,7 +982,7 @@
if (!cmdInfo.m_bNoDls) LoadDefaultDLSBanks();
// Initialize ACM Support
- if (GetProfileInt("Settings", "DisableACM", 0)) cmdInfo.m_bNoAcm = TRUE;
+ if (GetProfileInt("Settings", "DisableACM", 0)) cmdInfo.m_bNoAcm = true;
if (!cmdInfo.m_bNoMp3) InitializeACM(cmdInfo.m_bNoAcm);
// Initialize DXPlugins
Modified: trunk/OpenMPT/mptrack/Mptrack.h
===================================================================
--- trunk/OpenMPT/mptrack/Mptrack.h 2010-03-28 22:53:43 UTC (rev 561)
+++ trunk/OpenMPT/mptrack/Mptrack.h 2010-03-29 14:19:36 UTC (rev 562)
@@ -53,7 +53,7 @@
typedef struct MIDILIBSTRUCT
{
- LPSTR MidiMap[128*2]; // 128 instruments + 128 percussions
+ LPTSTR MidiMap[128*2]; // 128 instruments + 128 percussions
} MIDILIBSTRUCT, *LPMIDILIBSTRUCT;
Modified: trunk/OpenMPT/mptrack/View_tre.cpp
===================================================================
--- trunk/OpenMPT/mptrack/View_tre.cpp 2010-03-28 22:53:43 UTC (rev 561)
+++ trunk/OpenMPT/mptrack/View_tre.cpp 2010-03-29 14:19:36 UTC (rev 562)
@@ -1346,7 +1346,7 @@
}
-BOOL CModTree::SetMidiInstrument(UINT nIns, LPCSTR lpszFileName)
+BOOL CModTree::SetMidiInstrument(UINT nIns, LPCTSTR lpszFileName)
//--------------------------------------------------------------
{
LPMIDILIBSTRUCT lpMidiLib = CTrackApp::GetMidiLibrary();
@@ -1354,7 +1354,7 @@
{
if (!lpMidiLib->MidiMap[nIns])
{
- if ((lpMidiLib->MidiMap[nIns] = new CHAR[_MAX_PATH]) == NULL) return FALSE;
+ if ((lpMidiLib->MidiMap[nIns] = new TCHAR[_MAX_PATH]) == NULL) return FALSE;
}
strcpy(lpMidiLib->MidiMap[nIns], lpszFileName);
RefreshMidiLibrary();
@@ -1364,7 +1364,7 @@
}
-BOOL CModTree::SetMidiPercussion(UINT nPerc, LPCSTR lpszFileName)
+BOOL CModTree::SetMidiPercussion(UINT nPerc, LPCTSTR lpszFileName)
//---------------------------------------------------------------
{
LPMIDILIBSTRUCT lpMidiLib = CTrackApp::GetMidiLibrary();
@@ -1373,7 +1373,7 @@
UINT nIns = nPerc | 0x80;
if (!lpMidiLib->MidiMap[nIns])
{
- if ((lpMidiLib->MidiMap[nIns] = new CHAR[_MAX_PATH]) == NULL) return FALSE;
+ if ((lpMidiLib->MidiMap[nIns] = new TCHAR[_MAX_PATH]) == NULL) return FALSE;
}
strcpy(lpMidiLib->MidiMap[nIns], lpszFileName);
RefreshMidiLibrary();
Modified: trunk/OpenMPT/mptrack/View_tre.h
===================================================================
--- trunk/OpenMPT/mptrack/View_tre.h 2010-03-28 22:53:43 UTC (rev 561)
+++ trunk/OpenMPT/mptrack/View_tre.h 2010-03-29 14:19:36 UTC (rev 562)
@@ -144,8 +144,8 @@
uint64 GetModItem(HTREEITEM hItem);
inline uint32 GetModItemType(const uint64 modItem) {return static_cast<uint32>(modItem & 0xFFFF);}; // return "item type" part of mod item variable ( & 0xFFFF )
inline uint32 GetModItemID(const uint64 modItem) {return static_cast<uint32>(modItem >> 16);}; // return "item ID" part of mod item variable ( >> 16 )
- BOOL SetMidiInstrument(UINT nIns, LPCSTR lpszFileName);
- BOOL SetMidiPercussion(UINT nPerc, LPCSTR lpszFileName);
+ BOOL SetMidiInstrument(UINT nIns, LPCTSTR lpszFileName);
+ BOOL SetMidiPercussion(UINT nPerc, LPCTSTR lpszFileName);
BOOL ExecuteItem(HTREEITEM hItem);
BOOL DeleteTreeItem(HTREEITEM hItem);
BOOL PlayItem(HTREEITEM hItem, UINT nParam=0);
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <sag...@us...> - 2010-03-28 22:53:49
|
Revision: 561
http://modplug.svn.sourceforge.net/modplug/?rev=561&view=rev
Author: saga-games
Date: 2010-03-28 22:53:43 +0000 (Sun, 28 Mar 2010)
Log Message:
-----------
[Fix] IT Compatibility: S77 / S79/ S7B are supposed to pause the envelope, not disable it.
[Ref] Added some comments to the CHN_* flags and in the pattern drawing code, minor refactoring there as well.
Modified Paths:
--------------
trunk/OpenMPT/mptrack/Draw_pat.cpp
trunk/OpenMPT/soundlib/Snd_defs.h
trunk/OpenMPT/soundlib/Sndmix.cpp
Modified: trunk/OpenMPT/mptrack/Draw_pat.cpp
===================================================================
--- trunk/OpenMPT/mptrack/Draw_pat.cpp 2010-03-28 19:31:53 UTC (rev 560)
+++ trunk/OpenMPT/mptrack/Draw_pat.cpp 2010-03-28 22:53:43 UTC (rev 561)
@@ -93,8 +93,12 @@
-3, 1, 9, // InstrOfs + nInstrHiWidth
};
+// NOTE: See also CViewPattern::DrawNote() when changing stuff here
+// or adding new fonts - The custom tuning note names might require
+// some additions there.
+
/////////////////////////////////////////////////////////////////////////////
// CViewPattern Drawing Implementation
@@ -667,7 +671,7 @@
// -> CODE#0015
// -> DESC="channels management dlg"
- BOOL activeDoc = pMainFrm ? pMainFrm->GetActiveDoc() == GetDocument() : FALSE;
+ bool activeDoc = pMainFrm ? (pMainFrm->GetActiveDoc() == GetDocument()) : false;
if(activeDoc && CChannelManagerDlg::sharedInstance(FALSE) && CChannelManagerDlg::sharedInstance()->IsDisplayed())
CChannelManagerDlg::sharedInstance()->SetDocument((void*)this);
@@ -1045,13 +1049,13 @@
CRect rect;
POINT ptTopLeft, ptBottomRight;
DWORD dwTopLeft, dwBottomRight;
- BOOL bLeft, bTop, bRight, bBottom;
+ bool bLeft, bTop, bRight, bBottom;
int x1, y1, x2, y2, dx, dy, c1, c2;
int nChannels, nRows;
- if ((pModDoc = GetDocument()) == NULL) return;
+ if ((pModDoc = GetDocument()) == nullptr) return;
pSndFile = pModDoc->GetSoundFile();
- bLeft = bTop = bRight = bBottom = TRUE;
+ bLeft = bTop = bRight = bBottom = true;
x1 = (m_dwBeginSel & 0xFFF8) >> 3;
y1 = (m_dwBeginSel) >> 16;
x2 = (m_dwEndSel & 0xFFF8) >> 3;
@@ -1066,15 +1070,15 @@
y2 += dy;
nChannels = pSndFile->m_nChannels;
nRows = pSndFile->PatternSize[m_nPattern];
- if (x1 < GetXScrollPos()) bLeft = FALSE;
- if (x1 >= nChannels) x1 = nChannels-1;
- if (x1 < 0) { x1 = 0; c1 = 0; bLeft = FALSE; }
- if (x2 >= nChannels) { x2 = nChannels-1; c2 = 4; bRight = FALSE; }
+ if (x1 < GetXScrollPos()) bLeft = false;
+ if (x1 >= nChannels) x1 = nChannels - 1;
+ if (x1 < 0) { x1 = 0; c1 = 0; bLeft = false; }
+ if (x2 >= nChannels) { x2 = nChannels-1; c2 = 4; bRight = false; }
if (x2 < 0) x2 = 0;
- if (y1 < GetYScrollPos() - (int)m_nMidRow) bTop = FALSE;
+ if (y1 < GetYScrollPos() - (int)m_nMidRow) bTop = false;
if (y1 >= nRows) y1 = nRows-1;
- if (y1 < 0) { y1 = 0; bTop = FALSE; }
- if (y2 >= nRows) { y2 = nRows-1; bBottom = FALSE; }
+ if (y1 < 0) { y1 = 0; bTop = false; }
+ if (y2 >= nRows) { y2 = nRows-1; bBottom = false; }
if (y2 < 0) y2 = 0;
dwTopLeft = (y1<<16)|(x1<<3)|c1;
dwBottomRight = ((y2+1)<<16)|(x2<<3)|(c2+1);
@@ -1300,13 +1304,15 @@
}
// rewbs.fix3417: adding error checking
CModDoc *pModDoc = GetDocument();
- if (pModDoc) {
+ if (pModDoc)
+ {
CSoundFile *pSndFile = pModDoc->GetSoundFile();
- if (pSndFile) {
+ if (pSndFile)
+ {
y1 = max(y1, 0);
- y2 = min(y2, (int)pSndFile->PatternSize[m_nPattern]);
+ y2 = min(y2, (int)pSndFile->Patterns[m_nPattern].GetNumRows());
x1 = max(x1, 0);
- x2 = min(x2, pSndFile->m_nChannels*8 - 4);
+ x2 = min(x2, pSndFile->GetNumChannels() * 8 - 4);
}
}
// end rewbs.fix3417
Modified: trunk/OpenMPT/soundlib/Snd_defs.h
===================================================================
--- trunk/OpenMPT/soundlib/Snd_defs.h 2010-03-28 19:31:53 UTC (rev 560)
+++ trunk/OpenMPT/soundlib/Snd_defs.h 2010-03-28 22:53:43 UTC (rev 561)
@@ -123,39 +123,39 @@
// Channel flags:
// Bits 0-7: Sample Flags
-#define CHN_16BIT 0x01
-#define CHN_LOOP 0x02
-#define CHN_PINGPONGLOOP 0x04
-#define CHN_SUSTAINLOOP 0x08
-#define CHN_PINGPONGSUSTAIN 0x10
-#define CHN_PANNING 0x20
-#define CHN_STEREO 0x40
-#define CHN_PINGPONGFLAG 0x80 //When flag is on, sample is processed backwards
+#define CHN_16BIT 0x01 // 16-bit sample
+#define CHN_LOOP 0x02 // looped sample
+#define CHN_PINGPONGLOOP 0x04 // bidi-looped sample
+#define CHN_SUSTAINLOOP 0x08 // sample with sustain loop
+#define CHN_PINGPONGSUSTAIN 0x10 // sample with bidi sustain loop
+#define CHN_PANNING 0x20 // sample with forced panning
+#define CHN_STEREO 0x40 // stereo sample
+#define CHN_PINGPONGFLAG 0x80 // when flag is on, sample is processed backwards
// Bits 8-31: Channel Flags
-#define CHN_MUTE 0x100
-#define CHN_KEYOFF 0x200
-#define CHN_NOTEFADE 0x400
-#define CHN_SURROUND 0x800
-#define CHN_NOIDO 0x1000
-#define CHN_HQSRC 0x2000
-#define CHN_FILTER 0x4000
-#define CHN_VOLUMERAMP 0x8000
-#define CHN_VIBRATO 0x10000
-#define CHN_TREMOLO 0x20000
-#define CHN_PANBRELLO 0x40000
-#define CHN_PORTAMENTO 0x80000
-#define CHN_GLISSANDO 0x100000
-#define CHN_VOLENV 0x200000
-#define CHN_PANENV 0x400000
-#define CHN_PITCHENV 0x800000
-#define CHN_FASTVOLRAMP 0x1000000
-#define CHN_EXTRALOUD 0x2000000
-#define CHN_REVERB 0x4000000
-#define CHN_NOREVERB 0x8000000
-#define CHN_SOLO 0x10000000 // -> CODE#0012 -> DESC="midi keyboard split" -! NEW_FEATURE#0012
-#define CHN_NOFX 0x20000000 // -> CODE#0015 -> DESC="channels management dlg" -! NEW_FEATURE#0015
-#define CHN_SYNCMUTE 0x40000000
-#define CHN_FILTERENV 0x80000000
+#define CHN_MUTE 0x100 // muted channel
+#define CHN_KEYOFF 0x200 // exit sustain
+#define CHN_NOTEFADE 0x400 // fade note (instrument mode)
+#define CHN_SURROUND 0x800 // use surround channel
+#define CHN_NOIDO 0x1000 // ???
+#define CHN_HQSRC 0x2000 // ???
+#define CHN_FILTER 0x4000 // filtered output
+#define CHN_VOLUMERAMP 0x8000 // ramp volume
+#define CHN_VIBRATO 0x10000 // apply vibrato
+#define CHN_TREMOLO 0x20000 // apply tremolo
+#define CHN_PANBRELLO 0x40000 // apply panbrello
+#define CHN_PORTAMENTO 0x80000 // apply portamento
+#define CHN_GLISSANDO 0x100000 // glissando mode
+#define CHN_VOLENV 0x200000 // volume envelope is active
+#define CHN_PANENV 0x400000 // pan envelope is active
+#define CHN_PITCHENV 0x800000 // pitch envelope is active
+#define CHN_FASTVOLRAMP 0x1000000 // ramp volume very fast
+#define CHN_EXTRALOUD 0x2000000 // force master volume to 0x100
+#define CHN_REVERB 0x4000000 // apply reverb
+#define CHN_NOREVERB 0x8000000 // forbid reverb
+#define CHN_SOLO 0x10000000 // solo channel -> CODE#0012 -> DESC="midi keyboard split" -! NEW_FEATURE#0012
+#define CHN_NOFX 0x20000000 // dry channel -> CODE#0015 -> DESC="channels management dlg" -! NEW_FEATURE#0015
+#define CHN_SYNCMUTE 0x40000000 // keep sample sync on mute
+#define CHN_FILTERENV 0x80000000 // force pitch envelope to act as filter envelope
#define CHN_SAMPLEFLAGS (CHN_16BIT|CHN_LOOP|CHN_PINGPONGLOOP|CHN_SUSTAINLOOP|CHN_PINGPONGSUSTAIN|CHN_PANNING|CHN_STEREO|CHN_PINGPONGFLAG)
#define CHN_CHANNELFLAGS (~CHN_SAMPLEFLAGS)
Modified: trunk/OpenMPT/soundlib/Sndmix.cpp
===================================================================
--- trunk/OpenMPT/soundlib/Sndmix.cpp 2010-03-28 19:31:53 UTC (rev 560)
+++ trunk/OpenMPT/soundlib/Sndmix.cpp 2010-03-28 22:53:43 UTC (rev 561)
@@ -912,6 +912,9 @@
for (UINT nChn=0; nChn<MAX_CHANNELS; nChn++,pChn++)
{
skipchn:
+
+ MODINSTRUMENT *pIns = pChn->pModInstrument;
+
if ((pChn->dwFlags & CHN_NOTEFADE) && (!(pChn->nFadeOutVol|pChn->nRightVol|pChn->nLeftVol)))
{
pChn->nLength = 0;
@@ -1071,7 +1074,8 @@
{
MODINSTRUMENT *pIns = pChn->pModInstrument;
// Volume Envelope
- if ((pChn->dwFlags & CHN_VOLENV) && (pIns->VolEnv.nNodes))
+ // IT Compatibility: S77 does not disable the volume envelope, it just pauses the counter
+ if (((pChn->dwFlags & CHN_VOLENV) || ((pIns->VolEnv.dwFlags & ENV_ENABLED) && IsCompatibleMode(TRK_IMPULSETRACKER))) && (pIns->VolEnv.nNodes))
{
int envvol = getVolEnvValueFromPosition(pChn->nVolEnvPosition, pIns);
@@ -1097,7 +1101,8 @@
vol = (vol * CLAMP(envvol, 0, 512)) >> 8;
}
// Panning Envelope
- if ((pChn->dwFlags & CHN_PANENV) && (pIns->PanEnv.nNodes))
+ // IT Compatibility: S79 does not disable the panning envelope, it just pauses the counter
+ if (((pChn->dwFlags & CHN_PANENV) || ((pIns->PanEnv.dwFlags & ENV_ENABLED) && IsCompatibleMode(TRK_IMPULSETRACKER))) && (pIns->PanEnv.nNodes))
{
int envpos = pChn->nPanEnvPosition;
UINT pt = pIns->PanEnv.nNodes - 1;
@@ -1273,9 +1278,9 @@
period = CLAMP(period, 113 * 4, 856 * 4);
// Pitch/Filter Envelope
- if ((pChn->pModInstrument) && (pChn->dwFlags & CHN_PITCHENV) && (pChn->pModInstrument->PitchEnv.nNodes))
+ // IT Compatibility: S7B does not disable the pitch envelope, it just pauses the counter
+ if ((pIns) && ((pChn->dwFlags & CHN_PITCHENV) || ((pIns->PitchEnv.dwFlags & ENV_ENABLED) && IsCompatibleMode(TRK_IMPULSETRACKER))) && (pChn->pModInstrument->PitchEnv.nNodes))
{
- MODINSTRUMENT *pIns = pChn->pModInstrument;
int envpos = pChn->nPitchEnvPosition;
UINT pt = pIns->PitchEnv.nNodes - 1;
for (UINT i=0; i<(UINT)(pIns->PitchEnv.nNodes-1); i++)
@@ -1583,7 +1588,7 @@
}*/
UINT freq = 0;
- if(m_nType != MOD_TYPE_MPT || !pChn->pModInstrument || pChn->pModInstrument->pTuning == NULL)
+ if(m_nType != MOD_TYPE_MPT || !pIns || pIns->pTuning == nullptr)
{
freq = GetFreqFromPeriod(period, pChn->nC5Speed, nPeriodFrac);
}
@@ -1591,7 +1596,7 @@
{
if(pChn->m_CalculateFreq || (pChn->m_ReCalculateFreqOnFirstTick && m_nTickCount == 0))
{
- pChn->m_Freq = pChn->nC5Speed * vibratoFactor * pChn->pModInstrument->pTuning->GetRatio(pChn->nNote - NOTE_MIDDLEC + arpeggioSteps, pChn->nFineTune+pChn->m_PortamentoFineSteps);
+ pChn->m_Freq = pChn->nC5Speed * vibratoFactor * pIns->pTuning->GetRatio(pChn->nNote - NOTE_MIDDLEC + arpeggioSteps, pChn->nFineTune+pChn->m_PortamentoFineSteps);
if(!pChn->m_CalculateFreq)
pChn->m_ReCalculateFreqOnFirstTick = false;
else
@@ -1602,8 +1607,8 @@
}
//Applying Pitch/Tempo lock.
- if(m_nType & (MOD_TYPE_IT | MOD_TYPE_MPT) && pChn->pModInstrument && pChn->pModInstrument->wPitchToTempoLock)
- freq *= (float)m_nMusicTempo / (float)pChn->pModInstrument->wPitchToTempoLock;
+ if(m_nType & (MOD_TYPE_IT | MOD_TYPE_MPT) && pIns && pIns->wPitchToTempoLock)
+ freq *= (float)m_nMusicTempo / (float)pIns->wPitchToTempoLock;
if ((m_nType & (MOD_TYPE_IT | MOD_TYPE_MPT)) && (freq < 256))
@@ -1621,9 +1626,8 @@
}
// Increment envelope position
- if (pChn->pModInstrument)
+ if (pIns)
{
- MODINSTRUMENT *pIns = pChn->pModInstrument;
// Volume Envelope
if (pChn->dwFlags & CHN_VOLENV)
{
@@ -1852,7 +1856,8 @@
if (pChn->nInc >= 0xFE00) pChn->dwFlags |= CHN_NOIDO;
#endif // FASTSOUNDLIB
}
- if (m_pConfig->getUseGlobalPreAmp()) {
+ if (m_pConfig->getUseGlobalPreAmp())
+ {
pChn->nNewRightVol >>= MIXING_ATTENUATION;
pChn->nNewLeftVol >>= MIXING_ATTENUATION;
}
@@ -1989,9 +1994,9 @@
MODINSTRUMENT *pIns = pChn->pModInstrument;
IMixPlugin *pPlugin = NULL;
- if ((instr) && (instr < MAX_INSTRUMENTS)) {
+ 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)) {
@@ -2060,7 +2065,7 @@
}
int CSoundFile::getVolEnvValueFromPosition(int position, MODINSTRUMENT* pIns)
-//------------------------------------------------------------------------------
+//---------------------------------------------------------------------------
{
UINT pt = pIns->VolEnv.nNodes - 1;
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <sag...@us...> - 2010-03-28 19:32:00
|
Revision: 560
http://modplug.svn.sourceforge.net/modplug/?rev=560&view=rev
Author: saga-games
Date: 2010-03-28 19:31:53 +0000 (Sun, 28 Mar 2010)
Log Message:
-----------
[Ref] Rewrote nonsensical mod effect -> colour translation code in the pattern editor; also using a nice lookup table for the volume column now.
[Mod] Replaced default VU-meter colours for the MPT scheme by more pleasant colours that were already used for the other themes.
[Imp] INI File: Autosave / Soundfont sections are now also using relative paths.
Modified Paths:
--------------
trunk/OpenMPT/mptrack/Draw_pat.cpp
trunk/OpenMPT/mptrack/MainFrm.cpp
trunk/OpenMPT/mptrack/Moptions.cpp
trunk/OpenMPT/mptrack/Mptrack.cpp
trunk/OpenMPT/mptrack/Mptrack.h
Modified: trunk/OpenMPT/mptrack/Draw_pat.cpp
===================================================================
--- trunk/OpenMPT/mptrack/Draw_pat.cpp 2010-03-28 17:21:44 UTC (rev 559)
+++ trunk/OpenMPT/mptrack/Draw_pat.cpp 2010-03-28 19:31:53 UTC (rev 560)
@@ -897,34 +897,10 @@
tx_col = MODCOLOR_TEXTSELECTED;
bk_col = MODCOLOR_BACKSELECTED;
} else
- if ((!m->IsPcNote()) && (m->volcmd) && (CMainFrame::m_dwPatternSetup & PATTERN_EFFECTHILIGHT))
+ if ((!m->IsPcNote()) && (m->volcmd) && (m->volcmd < MAX_VOLCMDS) && (CMainFrame::m_dwPatternSetup & PATTERN_EFFECTHILIGHT))
{
- switch(m->volcmd)
- {
- case VOLCMD_VOLUME:
- case VOLCMD_VOLSLIDEUP:
- case VOLCMD_VOLSLIDEDOWN:
- case VOLCMD_FINEVOLUP:
- case VOLCMD_FINEVOLDOWN:
- tx_col = MODCOLOR_VOLUME;
- break;
- case VOLCMD_PANNING:
- case VOLCMD_PANSLIDELEFT:
- case VOLCMD_PANSLIDERIGHT:
- tx_col = MODCOLOR_PANNING;
- break;
- case VOLCMD_VIBRATOSPEED:
- case VOLCMD_VIBRATODEPTH:
- case VOLCMD_TONEPORTAMENTO:
- case VOLCMD_PORTAUP:
- case VOLCMD_PORTADOWN:
- tx_col = MODCOLOR_PITCH;
- break;
- case VOLCMD_VELOCITY: //rewbs.velocity
- case VOLCMD_OFFSET: //rewbs.volOff
- // default color
- break;
- }
+ if(gVolEffectColors[m->volcmd] != 0)
+ tx_col = gVolEffectColors[m->volcmd];
}
// Drawing Volume
m_Dib.SetTextColor(tx_col, bk_col);
@@ -941,21 +917,8 @@
fx_col = row_col;
if (!isPCnote && (m->command) && (m->command < MAX_EFFECTS) && (CMainFrame::m_dwPatternSetup & PATTERN_EFFECTHILIGHT))
{
- switch(gEffectColors[m->command])
- {
- case MODCOLOR_VOLUME:
- fx_col = MODCOLOR_VOLUME;
- break;
- case MODCOLOR_PANNING:
- fx_col = MODCOLOR_PANNING;
- break;
- case MODCOLOR_PITCH:
- fx_col = MODCOLOR_PITCH;
- break;
- case MODCOLOR_GLOBALS:
- fx_col = MODCOLOR_GLOBALS;
- break;
- }
+ if(gEffectColors[m->command] != 0)
+ fx_col = gEffectColors[m->command];
}
if (!(dwSpeedUpMask & 0x08))
{
Modified: trunk/OpenMPT/mptrack/MainFrm.cpp
===================================================================
--- trunk/OpenMPT/mptrack/MainFrm.cpp 2010-03-28 17:21:44 UTC (rev 559)
+++ trunk/OpenMPT/mptrack/MainFrm.cpp 2010-03-28 19:31:53 UTC (rev 560)
@@ -251,12 +251,12 @@
HPEN CMainFrame::gpenVuMeter[NUM_VUMETER_PENS*2];
COLORREF CMainFrame::rgbCustomColors[MAX_MODCOLORS] =
{
- 0xFFFFFF, 0x000000, 0xC0C0C0, 0x000000, 0x000000, 0xFFFFFF, 0x0000FF,
- 0x80FFFF, 0x000000, 0xE0E8E0,
+ RGB(0xFF, 0xFF, 0xFF), RGB(0x00, 0x00, 0x00), RGB(0xC0, 0xC0, 0xC0), RGB(0x00, 0x00, 0x00), RGB(0x00, 0x00, 0x00), RGB(0xFF, 0xFF, 0xFF), 0x0000FF,
+ RGB(0xFF, 0xFF, 0x80), RGB(0x00, 0x00, 0x00), RGB(0xE0, 0xE8, 0xE0),
// Effect Colors
- 0x800000, 0x808000, 0x008000, 0x808000, 0x008080, 0x000080, 0xFF0000,
+ RGB(0x00, 0x00, 0x80), RGB(0x00, 0x80, 0x80), RGB(0x00, 0x80, 0x00), RGB(0x00, 0x80, 0x80), RGB(0x80, 0x80, 0x00), RGB(0x80, 0x00, 0x00), RGB(0x00, 0x00, 0xFF),
// VU-Meters
- 0x00FF00, 0x00FFFF, 0x0000FF,
+ RGB(0x00, 0xC8, 0x00), RGB(0xFF, 0xC8, 0x00), RGB(0xE1, 0x00, 0x00),
// Channel separators
GetSysColor(COLOR_BTNSHADOW), GetSysColor(COLOR_BTNFACE), GetSysColor(COLOR_BTNHIGHLIGHT),
// Blend colour
@@ -274,9 +274,9 @@
};
-CInputHandler *CMainFrame::m_InputHandler = NULL; //rewbs.customKeys
-CAutoSaver *CMainFrame::m_pAutoSaver = NULL; //rewbs.autosave
-CPerformanceCounter *CMainFrame::m_pPerfCounter = NULL;
+CInputHandler *CMainFrame::m_InputHandler = nullptr; //rewbs.customKeys
+CAutoSaver *CMainFrame::m_pAutoSaver = nullptr; //rewbs.autosave
+CPerformanceCounter *CMainFrame::m_pPerfCounter = nullptr;
static UINT indicators[] =
{
@@ -295,15 +295,15 @@
//----------------------
{
m_bModTreeHasFocus = false; //rewbs.customKeys
- m_pNoteMapHasFocus = NULL; //rewbs.customKeys
+ m_pNoteMapHasFocus = nullptr; //rewbs.customKeys
m_pOrderlistHasFocus = nullptr;
m_bOptionsLocked = false; //rewbs.customKeys
- m_pJustModifiedDoc = NULL;
- m_pModPlaying = NULL;
+ m_pJustModifiedDoc = nullptr;
+ m_pModPlaying = nullptr;
m_hFollowSong = NULL;
m_hWndMidi = NULL;
- m_pSndFile = NULL;
+ m_pSndFile = nullptr;
m_dwStatus = 0;
m_dwElapsedTime = 0;
m_dwTimeSec = 0;
@@ -360,11 +360,10 @@
CString storedVersion = GetPrivateProfileCString("Version", "Version", "", theApp.GetConfigFileName());
//If version number stored in INI is 1.17.02.40 or later, load setting from INI file.
//Else load settings from Registry
- if (storedVersion >= "1.17.02.40") {
+ if (storedVersion >= "1.17.02.40")
LoadIniSettings();
- } else {
+ else
LoadRegistrySettings();
- }
m_InputHandler = new CInputHandler(this); //rewbs.customKeys
m_pPerfCounter= new CPerformanceCounter();
@@ -488,7 +487,9 @@
m_pAutoSaver->SetSaveInterval(GetPrivateProfileLong("AutoSave", "IntervalMinutes", 10, iniFile));
m_pAutoSaver->SetHistoryDepth(GetPrivateProfileLong("AutoSave", "BackupHistory", 3, iniFile));
m_pAutoSaver->SetUseOriginalPath(GetPrivateProfileLong("AutoSave", "UseOriginalPath", true, iniFile) != 0);
- m_pAutoSaver->SetPath(GetPrivateProfileCString("AutoSave", "Path", "", iniFile));
+ GetPrivateProfileString("AutoSave", "Path", "", szPath, INIBUFFERSIZE, iniFile);
+ RelativePathToAbsolute(szPath);
+ m_pAutoSaver->SetPath(szPath);
m_pAutoSaver->SetFilenameTemplate(GetPrivateProfileCString("AutoSave", "FileNameTemplate", "", iniFile));
}
@@ -1024,7 +1025,12 @@
WritePrivateProfileLong("AutoSave", "IntervalMinutes", m_pAutoSaver->GetSaveInterval(), iniFile);
WritePrivateProfileLong("AutoSave", "BackupHistory", m_pAutoSaver->GetHistoryDepth(), iniFile);
WritePrivateProfileLong("AutoSave", "UseOriginalPath", m_pAutoSaver->GetUseOriginalPath(), iniFile);
- WritePrivateProfileString("AutoSave", "Path", m_pAutoSaver->GetPath(), iniFile);
+ _tcscpy(szPath, m_pAutoSaver->GetPath());
+ if(bConvertPaths)
+ {
+ AbsolutePathToRelative(szPath);
+ }
+ WritePrivateProfileString("AutoSave", "Path", szPath, iniFile);
WritePrivateProfileString("AutoSave", "FileNameTemplate", m_pAutoSaver->GetFilenameTemplate(), iniFile);
theApp.SaveChords(Chords);
Modified: trunk/OpenMPT/mptrack/Moptions.cpp
===================================================================
--- trunk/OpenMPT/mptrack/Moptions.cpp 2010-03-28 17:21:44 UTC (rev 559)
+++ trunk/OpenMPT/mptrack/Moptions.cpp 2010-03-28 19:31:53 UTC (rev 560)
@@ -408,9 +408,9 @@
CustomColors[MODCOLOR_PANNING] = RGB(0x00, 0x80, 0x80);
CustomColors[MODCOLOR_PITCH] = RGB(0x80, 0x80, 0x00);
CustomColors[MODCOLOR_GLOBALS] = RGB(0x80, 0x00, 0x00);
- CustomColors[MODCOLOR_VUMETER_LO] = RGB(0x00, 0xFF, 0x00);
- CustomColors[MODCOLOR_VUMETER_MED] = RGB(0xFF, 0xFF, 0x00);
- CustomColors[MODCOLOR_VUMETER_HI] = RGB(0xFF, 0x00, 0x00);
+ CustomColors[MODCOLOR_VUMETER_LO] = RGB(0x00, 0xC8, 0x00);
+ CustomColors[MODCOLOR_VUMETER_MED] = RGB(0xFF, 0xC8, 0x00);
+ CustomColors[MODCOLOR_VUMETER_HI] = RGB(0xE1, 0x00, 0x00);
CustomColors[MODCOLOR_SEPSHADOW] = GetSysColor(COLOR_BTNSHADOW);
CustomColors[MODCOLOR_SEPFACE] = GetSysColor(COLOR_BTNFACE);
CustomColors[MODCOLOR_SEPHILITE] = GetSysColor(COLOR_BTNHIGHLIGHT);
Modified: trunk/OpenMPT/mptrack/Mptrack.cpp
===================================================================
--- trunk/OpenMPT/mptrack/Mptrack.cpp 2010-03-28 17:21:44 UTC (rev 559)
+++ trunk/OpenMPT/mptrack/Mptrack.cpp 2010-03-28 19:31:53 UTC (rev 560)
@@ -221,9 +221,18 @@
0, MODCOLOR_VOLUME, MODCOLOR_VOLUME, MODCOLOR_GLOBALS,
MODCOLOR_GLOBALS, 0, MODCOLOR_PITCH, MODCOLOR_PANNING,
MODCOLOR_PITCH, MODCOLOR_PANNING, 0, 0,
- //0,/*rewbs.smoothVST*/ ,0/*rewbs.velocity*/,
+ 0, 0, 0, MODCOLOR_PITCH,
+ MODCOLOR_PITCH,
};
+const BYTE gVolEffectColors[MAX_VOLCMDS] =
+{
+ 0, MODCOLOR_VOLUME, MODCOLOR_PANNING, MODCOLOR_VOLUME,
+ MODCOLOR_VOLUME, MODCOLOR_VOLUME, MODCOLOR_VOLUME, MODCOLOR_PITCH,
+ MODCOLOR_PITCH, MODCOLOR_PANNING, MODCOLOR_PANNING, MODCOLOR_PITCH,
+ MODCOLOR_PITCH, MODCOLOR_PITCH, 0, 0,
+};
+
static void ShowChangesDialog()
//-----------------------------
{
@@ -447,15 +456,19 @@
CString storedVersion = CMainFrame::GetPrivateProfileCString("Version", "Version", "", theApp.GetConfigFileName());
//If version number stored in INI is 1.17.02.40 or later, load DLS from INI file.
//Else load DLS from Registry
- if (storedVersion >= "1.17.02.40") {
+ if (storedVersion >= "1.17.02.40")
+ {
CHAR s[MAX_PATH];
UINT numBanks = CMainFrame::GetPrivateProfileLong("DLS Banks", "NumBanks", 0, theApp.GetConfigFileName());
for (UINT i=0; i<numBanks; i++) {
- wsprintf(s, "Bank%d", i+1);
- CString dlsFileName = CMainFrame::GetPrivateProfileCString("DLS Banks", s, "", theApp.GetConfigFileName());
- AddDLSBank(dlsFileName);
+ wsprintf(s, _T("Bank%d"), i+1);
+ TCHAR szPath[_MAX_PATH];
+ GetPrivateProfileString("DLS Banks", s, "", szPath, INIBUFFERSIZE, theApp.GetConfigFileName());
+ CMainFrame::RelativePathToAbsolute(szPath);
+ AddDLSBank(szPath);
}
- } else {
+ } else
+ {
LoadRegistryDLS();
}
@@ -520,21 +533,22 @@
BOOL CTrackApp::SaveDefaultDLSBanks()
//-----------------------------------
{
- CHAR s[64];
+ TCHAR s[64];
+ TCHAR szPath[_MAX_PATH];
DWORD nBanks = 0;
for (UINT i=0; i<MAX_DLS_BANKS; i++) {
- if (!gpDLSBanks[i]) {
+ if (!gpDLSBanks[i] || !gpDLSBanks[i]->GetFileName() || !gpDLSBanks[i]->GetFileName()[0])
continue;
- }
- LPCSTR pszBankName = gpDLSBanks[i]->GetFileName();
- if (!(pszBankName) || !(pszBankName[0])) {
- continue;
+ _tcsncpy(szPath, gpDLSBanks[i]->GetFileName(), ARRAYELEMCOUNT(szPath) - 1);
+ if(IsPortableMode())
+ {
+ CMainFrame::AbsolutePathToRelative(szPath);
}
- wsprintf(s, "Bank%d", nBanks+1);
- WritePrivateProfileString("DLS Banks", s, pszBankName, theApp.GetConfigFileName());
+ wsprintf(s, _T("Bank%d"), nBanks+1);
+ WritePrivateProfileString("DLS Banks", s, szPath, theApp.GetConfigFileName());
nBanks++;
}
@@ -1496,7 +1510,7 @@
GetModuleFileName(AfxGetInstanceHandle(), s, sizeof(s));
GetShortPathName(s, exename, sizeof(exename));
if (RegCreateKey(HKEY_CLASSES_ROOT,
- "ModPlugPlayer\\shell\\Edit\\command",
+ "OpenMPTFile\\shell\\Edit\\command",
&key) == ERROR_SUCCESS)
{
strcpy(s, exename);
@@ -1505,7 +1519,7 @@
RegCloseKey(key);
}
if (RegCreateKey(HKEY_CLASSES_ROOT,
- "ModPlugPlayer\\shell\\Edit\\ddeexec",
+ "OpenMPTFile\\shell\\Edit\\ddeexec",
&key) == ERROR_SUCCESS)
{
strcpy(s, "[Edit(\"%1\")]");
@@ -1876,7 +1890,7 @@
"coda for sample drawing code|"
"http://coda.s3m.us/|"
"Storlek for all the IT compatibility hints and testcases|"
- "as well as the IMF loader|"
+ "as well as the IMF and ULT loaders|"
"http://schismtracker.org/|"
"kode54 for the PSM and J2B loaders|"
"http://kode54.foobar2000.org/|"
Modified: trunk/OpenMPT/mptrack/Mptrack.h
===================================================================
--- trunk/OpenMPT/mptrack/Mptrack.h 2010-03-28 17:21:44 UTC (rev 559)
+++ trunk/OpenMPT/mptrack/Mptrack.h 2010-03-28 19:31:53 UTC (rev 560)
@@ -427,6 +427,7 @@
// Tables
extern const BYTE gEffectColors[MAX_EFFECTS];
+extern const BYTE gVolEffectColors[MAX_VOLCMDS];
extern const LPCSTR szNoteNames[12];
extern const LPCTSTR szDefaultNoteNames[NOTE_MAX];
//const LPCTSTR szSpecialNoteNames[NOTE_MAX_SPECIAL - NOTE_MIN_SPECIAL + 1] = {TEXT("PCs"), TEXT("PC"), TEXT("~~"), TEXT("^^"), TEXT("==")};
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <sag...@us...> - 2010-03-28 17:21:51
|
Revision: 559
http://modplug.svn.sourceforge.net/modplug/?rev=559&view=rev
Author: saga-games
Date: 2010-03-28 17:21:44 +0000 (Sun, 28 Mar 2010)
Log Message:
-----------
[New] INI Settings: When portable mode is enabled, the most common paths in mptrack.ini are now translated to relative paths (if possible). MIDI library, soundfont and plugin paths are not translated to relative paths (yet).
[Fix] XM Loader: Some XMs not made with ModPlug were recognized as files made with MPT.
[Imp/Ref] It's now possible to link several pattern undo commands together (to undo them in one step). That way, overflow paste now only uses undo step.
Modified Paths:
--------------
trunk/OpenMPT/mptrack/MainFrm.cpp
trunk/OpenMPT/mptrack/Mainfrm.h
trunk/OpenMPT/mptrack/Modedit.cpp
trunk/OpenMPT/mptrack/Undo.cpp
trunk/OpenMPT/mptrack/Undo.h
trunk/OpenMPT/soundlib/Load_xm.cpp
Modified: trunk/OpenMPT/mptrack/MainFrm.cpp
===================================================================
--- trunk/OpenMPT/mptrack/MainFrm.cpp 2010-03-28 16:24:23 UTC (rev 558)
+++ trunk/OpenMPT/mptrack/MainFrm.cpp 2010-03-28 17:21:44 UTC (rev 559)
@@ -267,6 +267,11 @@
TCHAR CMainFrame::m_szDefaultDirectory[NUM_DIRS][_MAX_PATH] = {0};
TCHAR CMainFrame::m_szWorkingDirectory[NUM_DIRS][_MAX_PATH] = {0};
TCHAR CMainFrame::m_szKbdFile[_MAX_PATH] = ""; //rewbs.customKeys
+// Directory to INI setting translation
+const TCHAR CMainFrame::m_szDirectoryToSettingsName[NUM_DIRS][32] =
+{
+ _T("Songs_Directory"), _T("Samples_Directory"), _T("Instruments_Directory"), _T("Plugins_Directory"), _T("Plugin_Presets_Directory"), _T("Export_Directory"), _T("")
+};
CInputHandler *CMainFrame::m_InputHandler = NULL; //rewbs.customKeys
@@ -451,19 +456,18 @@
m_nSampleUndoMaxBuffer = max(1, m_nSampleUndoMaxBuffer) << 20;
TCHAR szPath[_MAX_PATH] = "";
- GetPrivateProfileString("Paths", "Songs_Directory", GetDefaultDirectory(DIR_MODS), szPath, INIBUFFERSIZE, iniFile);
- SetDefaultDirectory(szPath, DIR_MODS);
- GetPrivateProfileString("Paths", "Samples_Directory", GetDefaultDirectory(DIR_SAMPLES), szPath, INIBUFFERSIZE, iniFile);
- SetDefaultDirectory(szPath, DIR_SAMPLES);
- GetPrivateProfileString("Paths", "Instruments_Directory", GetDefaultDirectory(DIR_INSTRUMENTS), szPath, INIBUFFERSIZE, iniFile);
- SetDefaultDirectory(szPath, DIR_INSTRUMENTS);
- GetPrivateProfileString("Paths", "Plugins_Directory", GetDefaultDirectory(DIR_PLUGINS), szPath, INIBUFFERSIZE, iniFile);
- SetDefaultDirectory(szPath, DIR_PLUGINS);
- GetPrivateProfileString("Paths", "Plugin_Presets_Directory", GetDefaultDirectory(DIR_PLUGINPRESETS), szPath, INIBUFFERSIZE, iniFile);
- SetDefaultDirectory(szPath, DIR_PLUGINPRESETS);
- GetPrivateProfileString("Paths", "Export_Directory", GetDefaultDirectory(DIR_EXPORT), szPath, INIBUFFERSIZE, iniFile);
- SetDefaultDirectory(szPath, DIR_EXPORT);
+ for(size_t i = 0; i < NUM_DIRS; i++)
+ {
+ if(m_szDirectoryToSettingsName[i][0] == 0)
+ continue;
+
+ GetPrivateProfileString("Paths", m_szDirectoryToSettingsName[i], GetDefaultDirectory(static_cast<Directory>(i)), szPath, INIBUFFERSIZE, iniFile);
+ RelativePathToAbsolute(szPath);
+ SetDefaultDirectory(szPath, static_cast<Directory>(i), false);
+
+ }
GetPrivateProfileString("Paths", "Key_Config_File", m_szKbdFile, m_szKbdFile, INIBUFFERSIZE, iniFile);
+ RelativePathToAbsolute(m_szKbdFile);
CSoundFile::m_nXBassDepth = GetPrivateProfileLong("Effects", "XBassDepth", 0, iniFile);
CSoundFile::m_nXBassRange = GetPrivateProfileLong("Effects", "XBassRange", 0, iniFile);
@@ -980,14 +984,29 @@
WritePrivateProfileDWord("Pattern Editor", "Record", gbPatternRecord, iniFile);
WritePrivateProfileDWord("Pattern Editor", "AutoChordWaitTime", gnAutoChordWaitTime, iniFile);
- WritePrivateProfileString("Paths", "Songs_Directory", GetDefaultDirectory(DIR_MODS), iniFile);
- WritePrivateProfileString("Paths", "Samples_Directory", GetDefaultDirectory(DIR_SAMPLES), iniFile);
- WritePrivateProfileString("Paths", "Instruments_Directory", GetDefaultDirectory(DIR_INSTRUMENTS), iniFile);
- WritePrivateProfileString("Paths", "Plugins_Directory", GetDefaultDirectory(DIR_PLUGINS), iniFile);
- WritePrivateProfileString("Paths", "Plugin_Presets_Directory", GetDefaultDirectory(DIR_PLUGINPRESETS), iniFile);
- WritePrivateProfileString("Paths", "Export_Directory", GetDefaultDirectory(DIR_EXPORT), iniFile);
- WritePrivateProfileString("Paths", "Key_Config_File", m_szKbdFile, iniFile);
+ // Write default paths
+ const bool bConvertPaths = theApp.IsPortableMode();
+ TCHAR szPath[_MAX_PATH] = "";
+ for(size_t i = 0; i < NUM_DIRS; i++)
+ {
+ if(m_szDirectoryToSettingsName[i][0] == 0)
+ continue;
+ _tcscpy(szPath, GetDefaultDirectory(static_cast<Directory>(i)));
+ if(bConvertPaths)
+ {
+ AbsolutePathToRelative(szPath);
+ }
+ WritePrivateProfileString("Paths", m_szDirectoryToSettingsName[i], szPath, iniFile);
+
+ }
+ _tcscpy(szPath, m_szKbdFile);
+ if(bConvertPaths)
+ {
+ AbsolutePathToRelative(szPath);
+ }
+ WritePrivateProfileString("Paths", "Key_Config_File", szPath, iniFile);
+
WritePrivateProfileLong("Effects", "XBassDepth", CSoundFile::m_nXBassDepth, iniFile);
WritePrivateProfileLong("Effects", "XBassRange", CSoundFile::m_nXBassRange, iniFile);
WritePrivateProfileLong("Effects", "ReverbDepth", CSoundFile::m_nReverbDepth, iniFile);
@@ -3104,3 +3123,77 @@
{
return m_szWorkingDirectory[dir];
}
+
+
+// Convert an absolute path to a path that's relative to OpenMPT's directory.
+// Paths are relative to the executable path.
+// nLength specifies the maximum number of character that can be written into szPath,
+// including the trailing null char.
+template <size_t nLength>
+void CMainFrame::AbsolutePathToRelative(TCHAR (&szPath)[nLength])
+//---------------------------------------------------------------
+{
+ STATIC_ASSERT(nLength >= 3);
+
+ if(_tcslen(szPath) == 0)
+ return;
+
+ const size_t nStrLength = nLength - 1; // "usable" length, i.e. not including the null char.
+ TCHAR szExePath[nLength], szTempPath[nLength];
+ _tcsncpy(szExePath, theApp.GetAppDirPath(), nStrLength);
+ SetNullTerminator(szExePath);
+
+ // Path is OpenMPT's directory or a sub directory ("C:\OpenMPT\Somepath" => ".\Somepath")
+ if(!_tcsncicmp(szExePath, szPath, _tcslen(szExePath)))
+ {
+ _tcscpy(szTempPath, _T(".\\")); // ".\"
+ _tcsncat(szTempPath, &szPath[_tcslen(szExePath)], nStrLength - 2); // "Somepath"
+ _tcscpy(szPath, szTempPath);
+ } else
+ // Path is on the same drive as OpenMPT ("C:\Somepath" => "\Somepath")
+ if(!_tcsncicmp(szExePath, szPath, 1))
+ {
+ _tcsncpy(szTempPath, &szPath[2], nStrLength); // "\Somepath"
+ _tcscpy(szPath, szTempPath);
+ }
+ SetNullTerminator(szPath);
+}
+
+
+// Convert a relative path to an absolute path.
+// Paths are relative to the executable path.
+// nLength specifies the maximum number of character that can be written into szPath,
+// including the trailing null char.
+template <size_t nLength>
+void CMainFrame::RelativePathToAbsolute(TCHAR (&szPath)[nLength])
+//---------------------------------------------------------------
+{
+ STATIC_ASSERT(nLength >= 3);
+
+ if(_tcslen(szPath) == 0)
+ return;
+
+ const size_t nStrLength = nLength - 1; // "usable" length, i.e. not including the null char.
+ TCHAR szExePath[nLength], szTempPath[nLength];
+ _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, szPath, nStrLength - 2); // "\Somepath\"
+ _tcscpy(szPath, szTempPath);
+ } else
+ // Path is OpenMPT's directory or a sub directory (".\Somepath\" => "C:\OpenMPT\Somepath\")
+ if(!_tcsncicmp(szPath, _T(".\\"), 2))
+ {
+ _tcsncpy(szTempPath, szExePath, nStrLength); // "C:\OpenMPT\"
+ if(_tcslen(szTempPath) < nStrLength)
+ {
+ _tcsncat(szTempPath, &szPath[2], nStrLength - _tcslen(szTempPath)); // "Somepath"
+ }
+ _tcscpy(szPath, szTempPath);
+ }
+ SetNullTerminator(szPath);
+}
Modified: trunk/OpenMPT/mptrack/Mainfrm.h
===================================================================
--- trunk/OpenMPT/mptrack/Mainfrm.h 2010-03-28 16:24:23 UTC (rev 558)
+++ trunk/OpenMPT/mptrack/Mainfrm.h 2010-03-28 17:21:44 UTC (rev 559)
@@ -616,11 +616,19 @@
static LPCTSTR GetWorkingDirectory(Directory dir);
static void SetDefaultDirectory(const LPCTSTR szFilenameFrom, Directory dir, bool bStripFilename = false);
static LPCTSTR GetDefaultDirectory(Directory dir);
+
+ template <size_t nLength>
+ static void AbsolutePathToRelative(TCHAR (&szPath)[nLength]);
+ template <size_t nLength>
+ static void RelativePathToAbsolute(TCHAR (&szPath)[nLength]);
+
protected:
static void SetDirectory(const LPCTSTR szFilenameFrom, Directory dir, TCHAR (&pDirs)[NUM_DIRS][_MAX_PATH], bool bStripFilename);
+
// Directory Arrays (default dir + last dir)
static TCHAR m_szDefaultDirectory[NUM_DIRS][_MAX_PATH];
static TCHAR m_szWorkingDirectory[NUM_DIRS][_MAX_PATH];
+ static const TCHAR m_szDirectoryToSettingsName[NUM_DIRS][32];
// Overrides
Modified: trunk/OpenMPT/mptrack/Modedit.cpp
===================================================================
--- trunk/OpenMPT/mptrack/Modedit.cpp 2010-03-28 16:24:23 UTC (rev 558)
+++ trunk/OpenMPT/mptrack/Modedit.cpp 2010-03-28 17:21:44 UTC (rev 559)
@@ -1204,7 +1204,7 @@
UINT ncol = (dwBeginSel & 0xFFFF) >> 3;
UINT col;
bool bS3MCommands = false, bOk = false;
- bool bPrepareUndo = true;
+ bool bPrepareUndo = true, bFirstUndo = true;
MODTYPE origFormat = MOD_TYPE_IT;
UINT len = 0, startLen;
@@ -1278,8 +1278,9 @@
// 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]);
+ GetPatternUndo()->PrepareUndo(nPattern, 0, 0, m_SndFile.m_nChannels, m_SndFile.PatternSize[nPattern], !bFirstUndo);
bPrepareUndo = false;
+ bFirstUndo = false;
}
// ITSyle mixpaste requires that we keep a copy of the thing we are about to paste on
Modified: trunk/OpenMPT/mptrack/Undo.cpp
===================================================================
--- trunk/OpenMPT/mptrack/Undo.cpp 2010-03-28 16:24:23 UTC (rev 558)
+++ trunk/OpenMPT/mptrack/Undo.cpp 2010-03-28 17:21:44 UTC (rev 559)
@@ -37,8 +37,9 @@
// - y: first row
// - cx: width
// - cy: height
-bool CPatternUndo::PrepareUndo(PATTERNINDEX pattern, UINT x, UINT y, UINT cx, UINT cy)
-//------------------------------------------------------------------------------------
+// - 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)
+//---------------------------------------------------------------------------------------------------------
{
if(m_pModDoc == nullptr) return false;
CSoundFile *pSndFile = m_pModDoc->GetSoundFile();
@@ -73,6 +74,7 @@
sUndo.cx = cx;
sUndo.cy = cy;
sUndo.pbuffer = pUndoData;
+ sUndo.linkToPrevious = linkToPrevious;
pPattern += x + y * pSndFile->m_nChannels;
for (UINT iy = 0; iy < cy; iy++)
{
@@ -92,6 +94,15 @@
PATTERNINDEX CPatternUndo::Undo()
//-------------------------------
{
+ return Undo(false);
+}
+
+
+// Restore an undo point. Returns which pattern has been modified.
+// linkedFromPrevious is true if a connected undo even is going to be deleted.
+PATTERNINDEX CPatternUndo::Undo(bool linkedFromPrevious)
+//------------------------------------------------------
+{
if(m_pModDoc == nullptr) return PATTERNINDEX_INVALID;
CSoundFile *pSndFile = m_pModDoc->GetSoundFile();
if(pSndFile == nullptr) return PATTERNINDEX_INVALID;
@@ -99,6 +110,7 @@
MODCOMMAND *pUndoData, *pPattern;
PATTERNINDEX nPattern;
ROWINDEX nRows;
+ bool linkToPrevious = false;
if (CanUndo() == false) return PATTERNINDEX_INVALID;
@@ -106,6 +118,9 @@
while(UndoBuffer.back().pattern >= pSndFile->Patterns.Size())
{
RemoveLastUndoStep();
+ // The command which was connect to this command is no more valid, so don't search for the next command.
+ if(linkedFromPrevious)
+ return PATTERNINDEX_INVALID;
}
// Select most recent undo slot
@@ -128,6 +143,7 @@
CSoundFile::FreePattern(oldPattern);
}
}
+ linkToPrevious = pUndo->linkToPrevious;
pUndoData = pUndo->pbuffer;
pPattern = pSndFile->Patterns[nPattern];
if (!pSndFile->Patterns[nPattern]) return PATTERNINDEX_INVALID;
@@ -143,7 +159,13 @@
RemoveLastUndoStep();
if (CanUndo() == false) m_pModDoc->UpdateAllViews(NULL, HINT_UNDO);
- return nPattern;
+ if(linkToPrevious)
+ {
+ return Undo(true);
+ } else
+ {
+ return nPattern;
+ }
}
Modified: trunk/OpenMPT/mptrack/Undo.h
===================================================================
--- trunk/OpenMPT/mptrack/Undo.h 2010-03-28 16:24:23 UTC (rev 558)
+++ trunk/OpenMPT/mptrack/Undo.h 2010-03-28 17:21:44 UTC (rev 559)
@@ -21,6 +21,7 @@
UINT column, row;
UINT cx, cy;
MODCOMMAND *pbuffer;
+ bool linkToPrevious;
};
//================
@@ -35,23 +36,26 @@
// Pattern undo helper functions
void DeleteUndoStep(const UINT nStep);
+ PATTERNINDEX Undo(bool linkedFromPrevious);
public:
// Pattern undo functions
void ClearUndo();
- bool PrepareUndo(PATTERNINDEX pattern, UINT x, UINT y, UINT cx, UINT cy);
+ bool PrepareUndo(PATTERNINDEX pattern, UINT x, UINT y, UINT cx, UINT cy, bool linkToPrevious = false);
PATTERNINDEX Undo();
bool CanUndo();
void RemoveLastUndoStep();
void SetParent(CModDoc *pModDoc) {m_pModDoc = pModDoc;}
- CPatternUndo() {
+ CPatternUndo()
+ {
UndoBuffer.clear();
m_pModDoc = nullptr;
};
- ~CPatternUndo() {
+ ~CPatternUndo()
+ {
ClearUndo();
};
@@ -112,11 +116,13 @@
void SetParent(CModDoc *pModDoc) {m_pModDoc = pModDoc;}
- CSampleUndo() {
+ CSampleUndo()
+ {
UndoBuffer.clear();
m_pModDoc = nullptr;
};
- ~CSampleUndo() {
+ ~CSampleUndo()
+ {
ClearUndo();
};
Modified: trunk/OpenMPT/soundlib/Load_xm.cpp
===================================================================
--- trunk/OpenMPT/soundlib/Load_xm.cpp 2010-03-28 16:24:23 UTC (rev 558)
+++ trunk/OpenMPT/soundlib/Load_xm.cpp 2010-03-28 17:21:44 UTC (rev 559)
@@ -664,8 +664,10 @@
// Read mix plugins information
if (dwMemPos + 8 < dwMemLength)
{
+ DWORD dwOldPos = dwMemPos;
dwMemPos += LoadMixPlugins(lpStream+dwMemPos, dwMemLength-dwMemPos);
- bMadeWithModPlug = true;
+ if(dwMemPos != dwOldPos)
+ bMadeWithModPlug = true;
}
// Check various things to find out whether this has been made with MPT.
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <rel...@us...> - 2010-03-28 16:24:30
|
Revision: 558
http://modplug.svn.sourceforge.net/modplug/?rev=558&view=rev
Author: relabsoluness
Date: 2010-03-28 16:24:23 +0000 (Sun, 28 Mar 2010)
Log Message:
-----------
[Mod] MPTM: Increased internal file version number and now user will be shown warning about "last saved with a more recent version of OpenMPT" only if the internal file version has increased. Also OpenMPT will now reject to load MPTM file if its file version is above certain limit.
[Mod] Version: Changed to 1.18.01.00.
[Fix] Song cleanup: Fixed a memory leak in pattern name handling.
[Mod] Resource: Removed resource ID duplicate.
Modified Paths:
--------------
trunk/OpenMPT/mptrack/CleanupSong.cpp
trunk/OpenMPT/mptrack/Moddoc.cpp
trunk/OpenMPT/mptrack/resource.h
trunk/OpenMPT/mptrack/version.h
trunk/OpenMPT/soundlib/Load_it.cpp
Modified: trunk/OpenMPT/mptrack/CleanupSong.cpp
===================================================================
--- trunk/OpenMPT/mptrack/CleanupSong.cpp 2010-03-28 00:09:41 UTC (rev 557)
+++ trunk/OpenMPT/mptrack/CleanupSong.cpp 2010-03-28 16:24:23 UTC (rev 558)
@@ -452,8 +452,8 @@
// Reorder patterns & Delete unused patterns
BEGIN_CRITICAL();
{
- UINT npatnames = pSndFile->m_nPatternNames;
- LPSTR lpszpatnames = pSndFile->m_lpszPatternNames;
+ const UINT npatnames = pSndFile->m_nPatternNames;
+ const LPSTR lpszpatnames = pSndFile->m_lpszPatternNames;
pSndFile->m_nPatternNames = 0;
pSndFile->m_lpszPatternNames = NULL;
for (PATTERNINDEX i = 0; i < maxPatIndex; i++)
@@ -487,6 +487,8 @@
{
pSndFile->Patterns[nPat].SetData(pPatterns[nPat], nPatRows[nPat]);
}
+
+ delete[] lpszpatnames;
}
END_CRITICAL();
EndWaitCursor();
Modified: trunk/OpenMPT/mptrack/Moddoc.cpp
===================================================================
--- trunk/OpenMPT/mptrack/Moddoc.cpp 2010-03-28 00:09:41 UTC (rev 557)
+++ trunk/OpenMPT/mptrack/Moddoc.cpp 2010-03-28 16:24:23 UTC (rev 558)
@@ -191,6 +191,16 @@
}
EndWaitCursor();
+
+ // Show log messages from loaders.
+ if (GetLog() != nullptr)
+ {
+ CString sTemp;
+ sTemp.Format("File: %s\nLast saved with: %s, current version is %s\n\n%s", lpszPathName, (LPCTSTR)MptVersion::ToStr(m_SndFile.m_dwLastSavedWithVersion), MptVersion::str, GetLog());
+ AfxMessageBox(sTemp, MB_ICONINFORMATION);
+ ClearLog();
+ }
+
if ((m_SndFile.m_nType == MOD_TYPE_NONE) || (!m_SndFile.m_nChannels)) return FALSE;
// Midi Import
if (m_SndFile.m_nType == MOD_TYPE_MID)
@@ -366,7 +376,11 @@
// -> DESC="channels management dlg"
ReinitRecordState();
// -! NEW_FEATURE#0015
- if (m_SndFile.m_dwLastSavedWithVersion > MptVersion::num) {
+
+ // Show warning if file was made with more recent version of OpenMPT except for MPTM-files,
+ // which uses CModDocs log-mechanism to show messages.
+ if (m_SndFile.m_dwLastSavedWithVersion > MptVersion::num && m_SndFile.GetType() != MOD_TYPE_MPT)
+ {
char s[256];
wsprintf(s, "Warning: this song was last saved with a more recent version of OpenMPT.\r\nSong saved with: v%s. Current version: v%s.\r\n",
(LPCTSTR)MptVersion::ToStr(m_SndFile.m_dwLastSavedWithVersion),
Modified: trunk/OpenMPT/mptrack/resource.h
===================================================================
--- trunk/OpenMPT/mptrack/resource.h 2010-03-28 00:09:41 UTC (rev 557)
+++ trunk/OpenMPT/mptrack/resource.h 2010-03-28 16:24:23 UTC (rev 558)
@@ -103,8 +103,7 @@
#define IDB_SPLASHTEST 432
#define IDB_SPLASHNOFOLDFIN 435
#define IDR_VSTMENU 436
-#define IDB_VISNODE1 436
-#define IDB_VISPCNODE 436
+#define IDB_VISPCNODE 437
#define IDD_DEFAULTPLUGINEDITOR 438
#define IDD_CHANNELMANAGER 440
#define IDD_SOUNDBANK_INFO1 441
Modified: trunk/OpenMPT/mptrack/version.h
===================================================================
--- trunk/OpenMPT/mptrack/version.h 2010-03-28 00:09:41 UTC (rev 557)
+++ trunk/OpenMPT/mptrack/version.h 2010-03-28 16:24:23 UTC (rev 558)
@@ -14,8 +14,8 @@
//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 00
-#define VER_MINORMINOR 01
+#define VER_MINOR 01
+#define VER_MINORMINOR 00
//Creates version number from version parts that appears in version string.
//For example MAKE_VERSION_NUMERIC(1,17,02,28) gives version number of
Modified: trunk/OpenMPT/soundlib/Load_it.cpp
===================================================================
--- trunk/OpenMPT/soundlib/Load_it.cpp 2010-03-28 00:09:41 UTC (rev 557)
+++ trunk/OpenMPT/soundlib/Load_it.cpp 2010-03-28 16:24:23 UTC (rev 558)
@@ -28,7 +28,26 @@
#define str_pattern (GetStrI18N((_TEXT("pattern"))))
#define str_PatternSetTruncationNote (GetStrI18N((_TEXT("The module contains %u patterns but only %u patterns can be loaded in this OpenMPT version."))))
#define str_SequenceTruncationNote (GetStrI18N((_TEXT("Module has sequence of length %u; it will be truncated to maximum supported length, %u."))))
+#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 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):
+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.
+0x88B -> 0x88C: Changed type in which tuning number is printed to file: size_t -> uint16.
+0x88A -> 0x88B: Changed order-to-pattern-index table type from BYTE-array to vector<UINT>.
+*/
+
+
+
+
static bool AreNonDefaultTuningsUsed(CSoundFile& sf)
//--------------------------------------------------
{
@@ -939,6 +958,20 @@
if(pifh->cwtv == 0x214 && pifh->cmwt == 0x202)
m_dwLastSavedWithVersion = MAKE_VERSION_NUMERIC(1, 09, 00, 00);
}
+ else // case: type == MOD_TYPE_MPT
+ {
+ if (pifh->cwtv >= verMptFileVerLoadLimit)
+ {
+ if (GetpModDoc())
+ GetpModDoc()->AddToLog(str_LoadingIncompatibleVersion);
+ return false;
+ }
+ else if (pifh->cwtv > verMptFileVer)
+ {
+ if (GetpModDoc())
+ GetpModDoc()->AddToLog(str_LoadingMoreRecentVersion);
+ }
+ }
}
if(GetType() == MOD_TYPE_IT) mptStartPos = dwMemLength;
@@ -1500,7 +1533,7 @@
if(version >= 0x88D)
{
srlztn::Ssb ssb(iStrm);
- ssb.BeginRead("mptm", 1);
+ ssb.BeginRead("mptm", MptVersion::num);
ssb.ReadItem(GetTuneSpecificTunings(), "0", 1, &ReadTuningCollection);
ssb.ReadItem(*this, "1", 1, &ReadTuningMap);
ssb.ReadItem(Order, "2", 1, &ReadModSequenceOld);
@@ -1847,17 +1880,8 @@
//VERSION
if(GetType() == MOD_TYPE_MPT)
{
- header.cwtv = 0x88E; // Used in OMPT-hack versioning.
+ header.cwtv = verMptFileVer; // Used in OMPT-hack versioning.
header.cmwt = 0x888;
- /*
- Version history:
- 0x88D(v.02.49) -> 0x88E: Changed ID to that of IT and undone the orderlist change done in
- 0x88A->0x88B. Now extended orderlist is saved as extension.
- 0x88C(v.02.48) -> 0x88D: Some tuning related changes - that part fails to read on older versions.
- 0x88B -> 0x88C: Changed type in which tuning number is printed
- to file: size_t -> uint16.
- 0x88A -> 0x88B: Changed order-to-pattern-index table type from BYTE-array to vector<UINT>.
- */
}
else //IT
{
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <sag...@us...> - 2010-03-28 00:09:47
|
Revision: 557
http://modplug.svn.sourceforge.net/modplug/?rev=557&view=rev
Author: saga-games
Date: 2010-03-28 00:09:41 +0000 (Sun, 28 Mar 2010)
Log Message:
-----------
[Fix] Song Cleanup: "Remove unused samples" was broken in the last revision (strangely, no debug assertions appeared in the IDE...)
[Fix] Sample Editor: When applying time stretch / pitch shift to an 8-bit sample and selecting the sample partly lead to partial upsampling, instead of upsampling the whole sample.
Modified Paths:
--------------
trunk/OpenMPT/mptrack/CleanupSong.cpp
trunk/OpenMPT/mptrack/Ctrl_smp.cpp
trunk/OpenMPT/mptrack/Ctrl_smp.h
Modified: trunk/OpenMPT/mptrack/CleanupSong.cpp
===================================================================
--- trunk/OpenMPT/mptrack/CleanupSong.cpp 2010-03-27 20:21:45 UTC (rev 556)
+++ trunk/OpenMPT/mptrack/CleanupSong.cpp 2010-03-28 00:09:41 UTC (rev 557)
@@ -515,13 +515,14 @@
vector<bool> bIns;
int nExt = 0;
int nRemoved = 0;
- bIns.resize(pSndFile->GetNumSamples(), false);
+ bIns.resize(pSndFile->GetNumSamples() + 1, false);
BeginWaitCursor();
for (SAMPLEINDEX nSmp = pSndFile->m_nSamples; nSmp >= 1; nSmp--) if (pSndFile->Samples[nSmp].pSample)
{
if (!pSndFile->IsSampleUsed(nSmp))
{
+ m_pModDoc->GetSampleUndo()->PrepareUndo(nSmp, sundo_delete);
BEGIN_CRITICAL();
pSndFile->DestroySample(nSmp);
if ((nSmp == pSndFile->m_nSamples) && (nSmp > 1)) pSndFile->m_nSamples--;
@@ -531,12 +532,12 @@
}
if (pSndFile->m_nInstruments)
{
- for (UINT ipat=0; ipat<pSndFile->Patterns.Size(); ipat++)
+ for (PATTERNINDEX nPat = 0; nPat < pSndFile->GetNumPatterns(); nPat++)
{
- MODCOMMAND *p = pSndFile->Patterns[ipat];
+ MODCOMMAND *p = pSndFile->Patterns[nPat];
if (p)
{
- UINT jmax = pSndFile->PatternSize[ipat] * pSndFile->m_nChannels;
+ UINT jmax = pSndFile->PatternSize[nPat] * pSndFile->m_nChannels;
for (UINT j=0; j<jmax; j++, p++)
{
if ((p->note) && (p->note <= NOTE_MAX))
@@ -581,9 +582,9 @@
{
if ((!bIns[nSmp]) && (pSndFile->Samples[nSmp].pSample))
{
+ m_pModDoc->GetSampleUndo()->PrepareUndo(nSmp, sundo_delete);
BEGIN_CRITICAL();
pSndFile->DestroySample(nSmp);
- m_pModDoc->GetSampleUndo()->PrepareUndo(nSmp, sundo_delete);
if ((nSmp == pSndFile->m_nSamples) && (nSmp > 1)) pSndFile->m_nSamples--;
END_CRITICAL();
nRemoved++;
Modified: trunk/OpenMPT/mptrack/Ctrl_smp.cpp
===================================================================
--- trunk/OpenMPT/mptrack/Ctrl_smp.cpp 2010-03-27 20:21:45 UTC (rev 556)
+++ trunk/OpenMPT/mptrack/Ctrl_smp.cpp 2010-03-28 00:09:41 UTC (rev 557)
@@ -1489,13 +1489,7 @@
m_pModDoc->AdjustEndOfSample(m_nSample);
if (selection.bSelected == true)
{
- SAMPLEVIEWSTATE viewstate;
- memset(&viewstate, 0, sizeof(viewstate));
- SendViewMessage(VIEWMSG_SAVESTATE, (LPARAM)&viewstate);
-
- viewstate.dwBeginSel = dwStart;
- viewstate.dwEndSel = dwEnd + (dwEnd-dwStart);
- SendViewMessage(VIEWMSG_LOADSTATE, (LPARAM)&viewstate);
+ SetSelectionPoints(dwStart, dwEnd + (dwEnd - dwStart));
}
m_pModDoc->UpdateAllViews(NULL, (m_nSample << HINT_SHIFT_SMP) | HINT_SAMPLEDATA | HINT_SAMPLEINFO, NULL);
m_pModDoc->SetModified();
@@ -1623,13 +1617,7 @@
m_pModDoc->AdjustEndOfSample(m_nSample);
if (selection.bSelected == true)
{
- SAMPLEVIEWSTATE viewstate;
- memset(&viewstate, 0, sizeof(viewstate));
- SendViewMessage(VIEWMSG_SAVESTATE, (LPARAM)&viewstate);
-
- viewstate.dwBeginSel = dwStart;
- viewstate.dwEndSel = dwStart + dwRemove;
- SendViewMessage(VIEWMSG_LOADSTATE, (LPARAM)&viewstate);
+ SetSelectionPoints(dwStart, dwStart + dwRemove);
}
m_pModDoc->UpdateAllViews(NULL, (m_nSample << HINT_SHIFT_SMP) | HINT_SAMPLEDATA | HINT_SAMPLEINFO, NULL);
m_pModDoc->SetModified();
@@ -1727,7 +1715,8 @@
if(!pSmp || pSmp->nLength == 0) goto error;
// Time stretching
- if(IsDlgButtonChecked(IDC_CHECK3)){
+ if(IsDlgButtonChecked(IDC_CHECK3))
+ {
UpdateData(TRUE); //Ensure m_dTimeStretchRatio is up-to-date with textbox content
errorcode = TimeStretch((float)(m_dTimeStretchRatio / 100.0));
@@ -1742,7 +1731,8 @@
}
// Pitch shifting
- else{
+ else
+ {
// Get selected pitch modifier [-12,+12]
CComboBox *combo = (CComboBox *)GetDlgItem(IDC_COMBO4);
float pm = float(combo->GetCurSel()) - 12.0f;
@@ -1761,27 +1751,29 @@
// Error management
error:
- if(errorcode > 0){
- CHAR str[64];
- switch(errorcode & 0xff){
- case 1 : wsprintf(str,"Pitch %s...",(errorcode>>8) == 1 ? "< 0.5" : "> 2.0");
+ if(errorcode > 0)
+ {
+ TCHAR str[64];
+ switch(errorcode & 0xff)
+ {
+ case 1 : wsprintf(str, _T("Pitch %s..."), (errorcode >> 8) == 1 ? _T("< 0.5") : _T("> 2.0"));
break;
- case 2 : wsprintf(str,"Stretch ratio is too %s. Must be between 50% and 200%.",(errorcode>>8) == 1 ? "low" : "high");
+ case 2 : wsprintf(str, _T("Stretch ratio is too %s. Must be between 50% and 200%."), (errorcode >> 8) == 1 ? _T("low") : _T("high"));
break;
- case 3 : wsprintf(str,"Not enough memory...");
+ case 3 : wsprintf(str, _T("Not enough memory..."));
break;
- case 5 : wsprintf(str, "Too low sample rate");
+ case 5 : wsprintf(str, _T("Too low sample rate"));
break;
- case 6 : wsprintf(str, "Too short sample");
+ case 6 : wsprintf(str, _T("Too short sample"));
break;
- default: wsprintf(str,"Unknown Error...");
+ default: wsprintf(str, _T("Unknown Error..."));
break;
}
AfxMessageBox(str, MB_ICONERROR);
}
// Update sample view
- m_pModDoc->UpdateAllViews(NULL, (m_nSample << HINT_SHIFT_SMP) | HINT_SAMPLEDATA | HINT_SAMPLEINFO, NULL); // !!!! see CODE#0006, update#3
+ m_pModDoc->UpdateAllViews(NULL, (m_nSample << HINT_SHIFT_SMP) | HINT_SAMPLEDATA | HINT_SAMPLEINFO, NULL);
m_pModDoc->SetModified();
}
@@ -1828,13 +1820,14 @@
}
// Get number of channels & sample size
- BYTE smpsize = pSmp->GetElementarySampleSize();
- const UINT nChn = pSmp->GetNumChannels();
+ uint8 smpsize = pSmp->GetElementarySampleSize();
+ const uint8 nChn = pSmp->GetNumChannels();
// Stretching is implemented only for 16-bit samples.
if(smpsize != 2)
{
// This has to be converted to 16-bit first.
+ SetSelectionPoints(0, 0); // avoid partial upsampling.
OnUpsample();
smpsize = pSmp->GetElementarySampleSize();
}
@@ -2033,6 +2026,7 @@
if(smpsize != 2)
{
// This has to be converted to 16-bit first.
+ SetSelectionPoints(0, 0); // avoid partial upsampling.
OnUpsample();
smpsize = pSmp->GetElementarySampleSize();
}
@@ -3032,3 +3026,19 @@
return points;
}
+// Set the currently select part of the sample.
+// To reset the selection, use nStart = nEnd = 0.
+void CCtrlSamples::SetSelectionPoints(UINT nStart, UINT nEnd)
+//-----------------------------------------------------------
+{
+ nStart = CLAMP(nStart, 0, m_pSndFile->Samples[m_nSample].nLength);
+ nEnd = CLAMP(nEnd, 0, m_pSndFile->Samples[m_nSample].nLength);
+
+ SAMPLEVIEWSTATE viewstate;
+ memset(&viewstate, 0, sizeof(viewstate));
+ SendViewMessage(VIEWMSG_SAVESTATE, (LPARAM)&viewstate);
+
+ viewstate.dwBeginSel = nStart;
+ viewstate.dwEndSel = nEnd;
+ SendViewMessage(VIEWMSG_LOADSTATE, (LPARAM)&viewstate);
+}
Modified: trunk/OpenMPT/mptrack/Ctrl_smp.h
===================================================================
--- trunk/OpenMPT/mptrack/Ctrl_smp.h 2010-03-27 20:21:45 UTC (rev 556)
+++ trunk/OpenMPT/mptrack/Ctrl_smp.h 2010-03-28 00:09:41 UTC (rev 557)
@@ -44,7 +44,9 @@
// Applies amplification to sample. Negative values
// can be used to invert phase.
void ApplyAmplify(LONG nAmp, bool bFadeIn = false, bool bFadeOut = false);
+
SELECTIONPOINTS GetSelectionPoints();
+ void SetSelectionPoints(UINT nStart, UINT nEnd);
public:
CCtrlSamples();
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <sag...@us...> - 2010-03-27 20:21:51
|
Revision: 556
http://modplug.svn.sourceforge.net/modplug/?rev=556&view=rev
Author: saga-games
Date: 2010-03-27 20:21:45 +0000 (Sat, 27 Mar 2010)
Log Message:
-----------
[Fix] Note Properties: Vibrato and Tremolo were erroneously marked as commands with no effect memory.
[New] Pattern Editor: When the PT1x mode or the S3M "Amiga" flag are enabled, dodgy notes (i.e lower than C-4 or higher than B-6) are marked red.
Modified Paths:
--------------
trunk/OpenMPT/mptrack/Draw_pat.cpp
trunk/OpenMPT/mptrack/Mainfrm.h
trunk/OpenMPT/mptrack/Moddoc.cpp
Modified: trunk/OpenMPT/mptrack/Draw_pat.cpp
===================================================================
--- trunk/OpenMPT/mptrack/Draw_pat.cpp 2010-03-26 23:11:20 UTC (rev 555)
+++ trunk/OpenMPT/mptrack/Draw_pat.cpp 2010-03-27 20:21:45 UTC (rev 556)
@@ -131,6 +131,7 @@
b = hilightcolor(GetBValue(CMainFrame::rgbCustomColors[MODCOLOR_BACKHILIGHT]),
GetBValue(CMainFrame::rgbCustomColors[MODCOLOR_BACKNORMAL]));
m_Dib.SetColor(MODCOLOR_2NDHIGHLIGHT, RGB(r,g,b));
+ m_Dib.SetColor(MODCOLOR_DODGY_COMMANDS, RGB(255, 0, 0));
m_Dib.SetBlendColor(CMainFrame::rgbCustomColors[MODCOLOR_BLENDCOLOR]);
}
@@ -845,6 +846,9 @@
if ((CMainFrame::m_dwPatternSetup & PATTERN_EFFECTHILIGHT) && (m->note) && (m->note <= NOTE_MAX))
{
tx_col = MODCOLOR_NOTE;
+ // Highlight notes that are not supported by the Amiga
+ if((pSndFile->m_dwSongFlags & (SONG_PT1XMODE|SONG_AMIGALIMITS)) && (m->note < NOTE_MIDDLEC - 12 || m->note >= NOTE_MIDDLEC + 2 * 12))
+ tx_col = MODCOLOR_DODGY_COMMANDS;
}
if (col_sel & 0x01)
{
Modified: trunk/OpenMPT/mptrack/Mainfrm.h
===================================================================
--- trunk/OpenMPT/mptrack/Mainfrm.h 2010-03-26 23:11:20 UTC (rev 555)
+++ trunk/OpenMPT/mptrack/Mainfrm.h 2010-03-27 20:21:45 UTC (rev 556)
@@ -156,6 +156,7 @@
MAX_MODCOLORS,
// Internal color codes
MODCOLOR_2NDHIGHLIGHT,
+ MODCOLOR_DODGY_COMMANDS,
MAX_MODPALETTECOLORS
};
Modified: trunk/OpenMPT/mptrack/Moddoc.cpp
===================================================================
--- trunk/OpenMPT/mptrack/Moddoc.cpp 2010-03-26 23:11:20 UTC (rev 555)
+++ trunk/OpenMPT/mptrack/Moddoc.cpp 2010-03-27 20:21:45 UTC (rev 556)
@@ -2461,7 +2461,7 @@
if (param)
wsprintf(s, "speed %d", param);
else
- strcpy(s, szContinueOrIgnore);
+ strcpy(s, "continue");
break;
case CMD_VIBRATO:
@@ -2471,7 +2471,7 @@
if (param)
wsprintf(s, "speed=%d depth=%d", param >> 4, param & 0x0F);
else
- strcpy(s, szContinueOrIgnore);
+ strcpy(s, "continue");
break;
case CMD_SPEED:
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <sag...@us...> - 2010-03-26 23:11:27
|
Revision: 555
http://modplug.svn.sourceforge.net/modplug/?rev=555&view=rev
Author: saga-games
Date: 2010-03-26 23:11:20 +0000 (Fri, 26 Mar 2010)
Log Message:
-----------
[Fix] 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] Added some nullptr checks for instruments here and there
[Ref] Some more refactoring.
Modified Paths:
--------------
trunk/OpenMPT/mptrack/CleanupSong.cpp
trunk/OpenMPT/mptrack/Ctrl_ins.cpp
trunk/OpenMPT/mptrack/Ctrl_pat.cpp
trunk/OpenMPT/mptrack/Moddoc.cpp
trunk/OpenMPT/mptrack/Modedit.cpp
trunk/OpenMPT/mptrack/View_ins.cpp
trunk/OpenMPT/mptrack/View_ins.h
trunk/OpenMPT/mptrack/dlg_misc.cpp
trunk/OpenMPT/soundlib/Sampleio.cpp
trunk/OpenMPT/soundlib/Sndfile.cpp
Modified: trunk/OpenMPT/mptrack/CleanupSong.cpp
===================================================================
--- trunk/OpenMPT/mptrack/CleanupSong.cpp 2010-03-26 23:00:54 UTC (rev 554)
+++ trunk/OpenMPT/mptrack/CleanupSong.cpp 2010-03-26 23:11:20 UTC (rev 555)
@@ -512,9 +512,10 @@
if(pSndFile == nullptr) return false;
CHAR s[512];
- BOOL bIns[MAX_SAMPLES];
- UINT nExt = 0;
- UINT nRemoved = 0;
+ vector<bool> bIns;
+ int nExt = 0;
+ int nRemoved = 0;
+ bIns.resize(pSndFile->GetNumSamples(), false);
BeginWaitCursor();
for (SAMPLEINDEX nSmp = pSndFile->m_nSamples; nSmp >= 1; nSmp--) if (pSndFile->Samples[nSmp].pSample)
@@ -530,7 +531,6 @@
}
if (pSndFile->m_nInstruments)
{
- memset(bIns, 0, sizeof(bIns));
for (UINT ipat=0; ipat<pSndFile->Patterns.Size(); ipat++)
{
MODCOMMAND *p = pSndFile->Patterns[ipat];
@@ -547,7 +547,7 @@
if (pIns)
{
UINT n = pIns->Keyboard[p->note-1];
- if (n < MAX_SAMPLES) bIns[n] = TRUE;
+ if (n <= pSndFile->GetNumSamples()) bIns[n] = true;
}
} else
{
@@ -557,7 +557,7 @@
if (pIns)
{
UINT n = pIns->Keyboard[p->note-1];
- if (n < MAX_SAMPLES) bIns[n] = TRUE;
+ if (n <= pSndFile->GetNumSamples()) bIns[n] = true;
}
}
}
@@ -565,28 +565,29 @@
}
}
}
- for (UINT ichk=1; ichk<MAX_SAMPLES; ichk++)
+ for (SAMPLEINDEX ichk = 1; ichk <= pSndFile->GetNumSamples(); ichk++)
{
if ((!bIns[ichk]) && (pSndFile->Samples[ichk].pSample)) nExt++;
}
}
EndWaitCursor();
- if (nExt && !((pSndFile->m_nType & MOD_TYPE_IT) && (pSndFile->m_dwSongFlags&SONG_ITPROJECT)))
+ if (nExt && !((pSndFile->m_nType & 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");
+ "but not used in the song. Do you want to remove them?", nExt, (nExt == 1) ? "" : "s");
if (::MessageBox(NULL, s, "Sample Cleanup", MB_YESNO | MB_ICONQUESTION) == IDYES)
{
- for (SAMPLEINDEX j = 1; j < MAX_SAMPLES; j++)
+ for (SAMPLEINDEX nSmp = 1; nSmp <= pSndFile->GetNumSamples(); nSmp++)
{
- if ((!bIns[j]) && (pSndFile->Samples[j].pSample))
+ if ((!bIns[nSmp]) && (pSndFile->Samples[nSmp].pSample))
{
BEGIN_CRITICAL();
- pSndFile->DestroySample(j);
- if ((j == pSndFile->m_nSamples) && (j > 1)) pSndFile->m_nSamples--;
+ pSndFile->DestroySample(nSmp);
+ m_pModDoc->GetSampleUndo()->PrepareUndo(nSmp, sundo_delete);
+ if ((nSmp == pSndFile->m_nSamples) && (nSmp > 1)) pSndFile->m_nSamples--;
END_CRITICAL();
nRemoved++;
- m_pModDoc->GetSampleUndo()->ClearUndo(j);
+ m_pModDoc->GetSampleUndo()->ClearUndo(nSmp);
}
}
wsprintf(s, "%d unused sample%s removed\n" ,nRemoved, (nRemoved == 1) ? "" : "s");
@@ -594,7 +595,7 @@
return true;
}
}
- return false;
+ return (nRemoved > 0);
}
@@ -615,8 +616,8 @@
if (nLoopOpt == 0) return false;
CHAR s[512];
- wsprintf(s, "OpenMPT detected %d sample%s with unused data after the loop end point,\n"
- "Do you want to optimize it, and remove this unused data?", nLoopOpt, (nLoopOpt == 1) ? "" : "s");
+ wsprintf(s, "%d sample%s unused data after the loop end point,\n"
+ "Do you want to optimize %s and remove this unused data?", nLoopOpt, (nLoopOpt == 1) ? " has" : "s have", (nLoopOpt == 1) ? "it" : "them");
if (::MessageBox(NULL, s, "Sample Optimization", MB_YESNO | MB_ICONQUESTION) == IDYES)
{
for (SAMPLEINDEX nSmp = 1; nSmp <= pSndFile->m_nSamples; nSmp++)
@@ -684,11 +685,13 @@
memset(pSndFile->m_szNames[i], 0, sizeof(pSndFile->m_szNames[i]));
// Also update instrument mapping (if module is in instrument mode)
- for(INSTRUMENTINDEX iInstr = 1; iInstr <= pSndFile->m_nInstruments; iInstr++){
- if(pSndFile->Instruments[iInstr]){
- MODINSTRUMENT *p = pSndFile->Instruments[iInstr];
+ for(INSTRUMENTINDEX nIns = 1; nIns <= pSndFile->m_nInstruments; nIns++)
+ {
+ MODINSTRUMENT *pIns = pSndFile->Instruments[nIns];
+ if(pIns)
+ {
for(WORD iNote = 0; iNote < 128; iNote++)
- if(p->Keyboard[iNote] == i) p->Keyboard[iNote] = nSampleMap[i];
+ if(pIns->Keyboard[iNote] == i) pIns->Keyboard[iNote] = nSampleMap[i];
}
}
}
@@ -840,7 +843,8 @@
for (PLUGINDEX nPlug = 0; nPlug < MAX_MIXPLUGINS; nPlug++) {
//Is the plugin assigned to a channel?
- for (CHANNELINDEX nChn = 0; nChn < pSndFile->GetNumChannels(); nChn++) {
+ for (CHANNELINDEX nChn = 0; nChn < pSndFile->GetNumChannels(); nChn++)
+ {
if (pSndFile->ChnSettings[nChn].nMixPlugin == nPlug + 1u) {
usedmap[nPlug] = true;
break;
@@ -848,21 +852,24 @@
}
//Is the plugin used by an instrument?
- for (INSTRUMENTINDEX nIns=1; nIns<=pSndFile->GetNumInstruments(); nIns++) {
- if (pSndFile->Instruments[nIns] && (pSndFile->Instruments[nIns]->nMixPlug == nPlug+1)) {
+ for (INSTRUMENTINDEX nIns=1; nIns<=pSndFile->GetNumInstruments(); nIns++)
+ {
+ if (pSndFile->Instruments[nIns] && (pSndFile->Instruments[nIns]->nMixPlug == nPlug+1))
+ {
usedmap[nPlug] = true;
break;
}
}
//Is the plugin assigned to master?
- if (pSndFile->m_MixPlugins[nPlug].Info.dwInputRouting & MIXPLUG_INPUTF_MASTEREFFECT) {
+ if (pSndFile->m_MixPlugins[nPlug].Info.dwInputRouting & MIXPLUG_INPUTF_MASTEREFFECT)
usedmap[nPlug] = true;
- }
//all outputs of used plugins count as used
- if (usedmap[nPlug]!=0) {
- if (pSndFile->m_MixPlugins[nPlug].Info.dwOutputRouting & 0x80) {
+ if (usedmap[nPlug]!=0)
+ {
+ if (pSndFile->m_MixPlugins[nPlug].Info.dwOutputRouting & 0x80)
+ {
int output = pSndFile->m_MixPlugins[nPlug].Info.dwOutputRouting & 0x7f;
usedmap[output] = true;
}
@@ -872,7 +879,7 @@
UINT nRemoved = m_pModDoc->RemovePlugs(usedmap);
- return (nRemoved > 0) ? true : false;
+ return (nRemoved > 0);
}
@@ -908,7 +915,7 @@
pSndFile->m_nRestartPos = 0;
// reset instruments (if there are any)
- for(INSTRUMENTINDEX i = 1; i <= pSndFile->m_nInstruments; i++)
+ for(INSTRUMENTINDEX i = 1; i <= pSndFile->m_nInstruments; i++) if(pSndFile->Instruments[i])
{
pSndFile->Instruments[i]->nFadeOut = 256;
pSndFile->Instruments[i]->nGlobalVol = 64;
Modified: trunk/OpenMPT/mptrack/Ctrl_ins.cpp
===================================================================
--- trunk/OpenMPT/mptrack/Ctrl_ins.cpp 2010-03-26 23:00:54 UTC (rev 554)
+++ trunk/OpenMPT/mptrack/Ctrl_ins.cpp 2010-03-26 23:11:20 UTC (rev 555)
@@ -652,8 +652,13 @@
if (m_pModDoc)
{
MODINSTRUMENT *pIns = m_pModDoc->GetSoundFile()->Instruments[m_nInstrument];
- if (m_bIns) m_nOldIns = pIns->Keyboard[m_nNote];
- else m_nOldNote = pIns->NoteMap[m_nNote];
+ if(pIns)
+ {
+ if (m_bIns)
+ m_nOldIns = pIns->Keyboard[m_nNote];
+ else
+ m_nOldNote = pIns->NoteMap[m_nNote];
+ }
}
return true;
}
@@ -2626,10 +2631,10 @@
{
if (m_pModDoc == 0 || m_pSndFile == 0
|| m_nInstrument > m_pSndFile->GetNumInstruments()
- || m_pSndFile->Instruments[m_nInstrument] == NULL) return;
+ || m_pSndFile->Instruments[m_nInstrument] == nullptr) return;
MODINSTRUMENT* const pIns = m_pSndFile->Instruments[m_nInstrument];
- if(pIns->pTuning == NULL)
+ if(pIns->pTuning == nullptr)
{
m_ComboTuning.SetCurSel(0);
return;
Modified: trunk/OpenMPT/mptrack/Ctrl_pat.cpp
===================================================================
--- trunk/OpenMPT/mptrack/Ctrl_pat.cpp 2010-03-26 23:00:54 UTC (rev 554)
+++ trunk/OpenMPT/mptrack/Ctrl_pat.cpp 2010-03-26 23:11:20 UTC (rev 555)
@@ -285,9 +285,8 @@
{
for (UINT i=1; i<=m_pSndFile->m_nInstruments; i++)
{
- if (m_pSndFile->Instruments[i] == NULL) {
+ if (m_pSndFile->Instruments[i] == nullptr)
continue;
- }
CString sDisplayName;
if (m_pModDoc->GetSplitKeyboardSettings()->IsSplitActive())
@@ -1180,7 +1179,7 @@
void CCtrlPatterns::TogglePluginEditor()
//--------------------------------------
{
- if ((m_nInstrument) && (m_pModDoc))
+ if(m_nInstrument && m_pModDoc && m_pSndFile && m_pSndFile->Instruments[m_nInstrument])
{
UINT nPlug = m_pSndFile->Instruments[m_nInstrument]->nMixPlug;
if (nPlug) //if not no plugin
Modified: trunk/OpenMPT/mptrack/Moddoc.cpp
===================================================================
--- trunk/OpenMPT/mptrack/Moddoc.cpp 2010-03-26 23:00:54 UTC (rev 554)
+++ trunk/OpenMPT/mptrack/Moddoc.cpp 2010-03-26 23:11:20 UTC (rev 555)
@@ -3515,7 +3515,7 @@
// If instrument name is empty, use name of the sample mapped to C-5.
if (instrumentName.IsEmpty())
{
- const SAMPLEINDEX nSmp = m_SndFile.Instruments[nInstr]->Keyboard[60];
+ const SAMPLEINDEX nSmp = m_SndFile.Instruments[nInstr]->Keyboard[NOTE_MIDDLEC - 1];
if (nSmp < ARRAYELEMCOUNT(m_SndFile.Samples) && m_SndFile.Samples[nSmp].pSample)
instrumentName.Format(TEXT("s: %s"), m_SndFile.GetSampleName(nSmp)); //60 is C-5
}
Modified: trunk/OpenMPT/mptrack/Modedit.cpp
===================================================================
--- trunk/OpenMPT/mptrack/Modedit.cpp 2010-03-26 23:00:54 UTC (rev 554)
+++ trunk/OpenMPT/mptrack/Modedit.cpp 2010-03-26 23:11:20 UTC (rev 555)
@@ -154,7 +154,7 @@
for (UINT i2=0; i2<m_SndFile.m_nInstruments; i2++) if (m_SndFile.Instruments[i2])
{
delete m_SndFile.Instruments[i2];
- m_SndFile.Instruments[i2] = NULL;
+ m_SndFile.Instruments[i2] = nullptr;
}
m_SndFile.m_nInstruments = 0;
END_CRITICAL();
@@ -1387,8 +1387,8 @@
}
}
// Effect value
- if (s[9] > ' ' && (!doMixPaste || ((!doITStyleMix && origModCmd.param==0) ||
- (doITStyleMix && origModCmd.command==0 && origModCmd.param==0))))
+ if (s[9] > ' ' && (!doMixPaste || ((!doITStyleMix && (origModCmd.command == CMD_NONE || origModCmd.param == 0)) ||
+ (doITStyleMix && origModCmd.command == CMD_NONE && origModCmd.param == 0))))
{
m[col].param = 0;
if (s[9] != '.')
Modified: trunk/OpenMPT/mptrack/View_ins.cpp
===================================================================
--- trunk/OpenMPT/mptrack/View_ins.cpp 2010-03-26 23:00:54 UTC (rev 554)
+++ trunk/OpenMPT/mptrack/View_ins.cpp 2010-03-26 23:11:20 UTC (rev 555)
@@ -350,13 +350,8 @@
bool CViewInstrument::EnvGetVolEnv() const
//----------------------------------------
{
- CModDoc *pModDoc = GetDocument();
- if (pModDoc)
- {
- CSoundFile *pSndFile = pModDoc->GetSoundFile();
- MODINSTRUMENT *pIns = pSndFile->Instruments[m_nInstrument];
- if (pIns) return (pIns->VolEnv.dwFlags & ENV_ENABLED) ? true : false;
- }
+ MODINSTRUMENT *pIns = GetInstrumentPtr();
+ if (pIns) return (pIns->VolEnv.dwFlags & ENV_ENABLED) ? true : false;
return false;
}
@@ -364,13 +359,8 @@
bool CViewInstrument::EnvGetPanEnv() const
//----------------------------------------
{
- CModDoc *pModDoc = GetDocument();
- if (pModDoc)
- {
- CSoundFile *pSndFile = pModDoc->GetSoundFile();
- MODINSTRUMENT *pIns = pSndFile->Instruments[m_nInstrument];
- if (pIns) return (pIns->PanEnv.dwFlags & ENV_ENABLED) ? true : false;
- }
+ MODINSTRUMENT *pIns = GetInstrumentPtr();
+ if (pIns) return (pIns->PanEnv.dwFlags & ENV_ENABLED) ? true : false;
return false;
}
@@ -378,13 +368,8 @@
bool CViewInstrument::EnvGetPitchEnv() const
//------------------------------------------
{
- CModDoc *pModDoc = GetDocument();
- if (pModDoc)
- {
- CSoundFile *pSndFile = pModDoc->GetSoundFile();
- MODINSTRUMENT *pIns = pSndFile->Instruments[m_nInstrument];
- if (pIns) return ((pIns->PitchEnv.dwFlags & (ENV_ENABLED|ENV_FILTER)) == ENV_ENABLED) ? true : false;
- }
+ MODINSTRUMENT *pIns = GetInstrumentPtr();
+ if (pIns) return ((pIns->PitchEnv.dwFlags & (ENV_ENABLED|ENV_FILTER)) == ENV_ENABLED) ? true : false;
return false;
}
@@ -392,13 +377,8 @@
bool CViewInstrument::EnvGetFilterEnv() const
//-------------------------------------------
{
- CModDoc *pModDoc = GetDocument();
- if (pModDoc)
- {
- CSoundFile *pSndFile = pModDoc->GetSoundFile();
- MODINSTRUMENT *pIns = pSndFile->Instruments[m_nInstrument];
- if (pIns) return ((pIns->PitchEnv.dwFlags & (ENV_ENABLED|ENV_FILTER)) == (ENV_ENABLED|ENV_FILTER)) ? true : false;
- }
+ MODINSTRUMENT *pIns = GetInstrumentPtr();
+ if (pIns) return ((pIns->PitchEnv.dwFlags & (ENV_ENABLED|ENV_FILTER)) == (ENV_ENABLED|ENV_FILTER)) ? true : false;
return false;
}
@@ -559,12 +539,9 @@
bool CViewInstrument::EnvSetVolEnv(bool bEnable)
//----------------------------------------------
{
- CModDoc *pModDoc = GetDocument();
- if(pModDoc == nullptr) return false;
- CSoundFile *pSndFile = pModDoc->GetSoundFile();
- if(pSndFile == nullptr) return false;
- MODINSTRUMENT *pIns = pSndFile->Instruments[m_nInstrument];
+ MODINSTRUMENT *pIns = GetInstrumentPtr();
if(pIns == nullptr) return false;
+ CSoundFile *pSndFile = GetDocument()->GetSoundFile(); // security checks are done in GetInstrumentPtr()
return EnvToggleEnv(&pIns->VolEnv, pSndFile, pIns, bEnable, 64, CHN_VOLENV);
}
@@ -573,12 +550,9 @@
bool CViewInstrument::EnvSetPanEnv(bool bEnable)
//----------------------------------------------
{
- CModDoc *pModDoc = GetDocument();
- if(pModDoc == nullptr) return false;
- CSoundFile *pSndFile = pModDoc->GetSoundFile();
- if(pSndFile == nullptr) return false;
- MODINSTRUMENT *pIns = pSndFile->Instruments[m_nInstrument];
+ MODINSTRUMENT *pIns = GetInstrumentPtr();
if(pIns == nullptr) return false;
+ CSoundFile *pSndFile = GetDocument()->GetSoundFile(); // security checks are done in GetInstrumentPtr()
return EnvToggleEnv(&pIns->PanEnv, pSndFile, pIns, bEnable, 32, CHN_PANENV);
}
@@ -587,12 +561,9 @@
bool CViewInstrument::EnvSetPitchEnv(bool bEnable)
//------------------------------------------------
{
- CModDoc *pModDoc = GetDocument();
- if(pModDoc == nullptr) return false;
- CSoundFile *pSndFile = pModDoc->GetSoundFile();
- if(pSndFile == nullptr) return false;
- MODINSTRUMENT *pIns = pSndFile->Instruments[m_nInstrument];
+ MODINSTRUMENT *pIns = GetInstrumentPtr();
if(pIns == nullptr) return false;
+ CSoundFile *pSndFile = GetDocument()->GetSoundFile(); // security checks are done in GetInstrumentPtr()
pIns->PitchEnv.dwFlags &= ~ENV_FILTER;
return EnvToggleEnv(&pIns->PitchEnv, pSndFile, pIns, bEnable, 32, CHN_PITCHENV);
@@ -602,12 +573,9 @@
bool CViewInstrument::EnvSetFilterEnv(bool bEnable)
//-------------------------------------------------
{
- CModDoc *pModDoc = GetDocument();
- if(pModDoc == nullptr) return false;
- CSoundFile *pSndFile = pModDoc->GetSoundFile();
- if(pSndFile == nullptr) return false;
- MODINSTRUMENT *pIns = pSndFile->Instruments[m_nInstrument];
+ MODINSTRUMENT *pIns = GetInstrumentPtr();
if(pIns == nullptr) return false;
+ CSoundFile *pSndFile = GetDocument()->GetSoundFile(); // security checks are done in GetInstrumentPtr()
pIns->PitchEnv.dwFlags &= ~ENV_FILTER;
return EnvToggleEnv(&pIns->PitchEnv, pSndFile, pIns, bEnable, 64, CHN_PITCHENV, ENV_FILTER);
@@ -2435,16 +2403,23 @@
}
-// Get a pointer to the currently selected envelope.
-INSTRUMENTENVELOPE *CViewInstrument::GetEnvelopePtr() const
-//---------------------------------------------------------
+// Get a pointer to the currently active instrument.
+MODINSTRUMENT *CViewInstrument::GetInstrumentPtr() const
+//------------------------------------------------------
{
- // First do some standard checks...
CModDoc *pModDoc = GetDocument();
if(pModDoc == nullptr) return nullptr;
CSoundFile *pSndFile = pModDoc->GetSoundFile();
if(pSndFile == nullptr) return nullptr;
- MODINSTRUMENT *pIns = pSndFile->Instruments[m_nInstrument];
+ return pSndFile->Instruments[m_nInstrument];
+}
+
+// Get a pointer to the currently selected envelope.
+INSTRUMENTENVELOPE *CViewInstrument::GetEnvelopePtr() const
+//---------------------------------------------------------
+{
+ // First do some standard checks...
+ MODINSTRUMENT *pIns = GetInstrumentPtr();
if(pIns == nullptr) return nullptr;
// Now for the real thing.
Modified: trunk/OpenMPT/mptrack/View_ins.h
===================================================================
--- trunk/OpenMPT/mptrack/View_ins.h 2010-03-26 23:00:54 UTC (rev 554)
+++ trunk/OpenMPT/mptrack/View_ins.h 2010-03-26 23:11:20 UTC (rev 555)
@@ -117,6 +117,7 @@
// Misc stuff
void UpdateScrollSize();
BOOL SetCurrentInstrument(INSTRUMENTINDEX nIns, enmEnvelopeTypes m_nEnv = ENV_VOLUME);
+ MODINSTRUMENT *GetInstrumentPtr() const;
INSTRUMENTENVELOPE *GetEnvelopePtr() const;
UINT EnvInsertPoint(int nTick, int nValue);
bool EnvRemovePoint(UINT nPoint);
Modified: trunk/OpenMPT/mptrack/dlg_misc.cpp
===================================================================
--- trunk/OpenMPT/mptrack/dlg_misc.cpp 2010-03-26 23:00:54 UTC (rev 554)
+++ trunk/OpenMPT/mptrack/dlg_misc.cpp 2010-03-26 23:11:20 UTC (rev 555)
@@ -409,7 +409,7 @@
BOOL CModTypeDlg::VerifyData()
-//---------------------------------
+//----------------------------
{
int temp_nRPB = GetDlgItemInt(IDC_ROWSPERBEAT);
@@ -2735,9 +2735,8 @@
if (m_pSndFile->m_nInstruments) {
for (INSTRUMENTINDEX nIns = 1; nIns <= m_pSndFile->m_nInstruments; nIns++)
{
- if (m_pSndFile->Instruments[nIns] == nullptr) {
+ if (m_pSndFile->Instruments[nIns] == nullptr)
continue;
- }
CString displayName = m_pSndFile->GetpModDoc()->GetPatternViewInstrumentName(nIns);
int n = m_CbnSplitInstrument.AddString(displayName);
Modified: trunk/OpenMPT/soundlib/Sampleio.cpp
===================================================================
--- trunk/OpenMPT/soundlib/Sampleio.cpp 2010-03-26 23:00:54 UTC (rev 554)
+++ trunk/OpenMPT/soundlib/Sampleio.cpp 2010-03-26 23:11:20 UTC (rev 555)
@@ -120,8 +120,8 @@
// -! NEW_FEATURE#0023
MODINSTRUMENT *pIns = Instruments[nInstr];
- Instruments[nInstr] = NULL;
- for (UINT i=0; i<MAX_CHANNELS; i++)
+ Instruments[nInstr] = nullptr;
+ for(CHANNELINDEX i = 0; i < MAX_CHANNELS; i++)
{
if (Chn[i].pModInstrument == pIns)
{
Modified: trunk/OpenMPT/soundlib/Sndfile.cpp
===================================================================
--- trunk/OpenMPT/soundlib/Sndfile.cpp 2010-03-26 23:00:54 UTC (rev 554)
+++ trunk/OpenMPT/soundlib/Sndfile.cpp 2010-03-26 23:11:20 UTC (rev 555)
@@ -860,10 +860,10 @@
pSmp->pSample = nullptr;
}
}
- for (i=0; i<MAX_INSTRUMENTS; i++)
+ for (i = 0; i < MAX_INSTRUMENTS; i++)
{
delete Instruments[i];
- Instruments[i] = NULL;
+ Instruments[i] = nullptr;
}
for (i=0; i<MAX_MIXPLUGINS; i++)
{
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <rel...@us...> - 2010-03-26 23:01:01
|
Revision: 554
http://modplug.svn.sourceforge.net/modplug/?rev=554&view=rev
Author: relabsoluness
Date: 2010-03-26 23:00:54 +0000 (Fri, 26 Mar 2010)
Log Message:
-----------
[Fix] Internal: Build fixes.
Modified Paths:
--------------
trunk/OpenMPT/soundlib/Load_ult.cpp
trunk/OpenMPT/zlib/contrib/vstudio/vc7/zlibstat.vcproj
trunk/OpenMPT/zlib/contrib/vstudio/vc9/zlibstat.vcproj
Modified: trunk/OpenMPT/soundlib/Load_ult.cpp
===================================================================
--- trunk/OpenMPT/soundlib/Load_ult.cpp 2010-03-26 19:17:27 UTC (rev 553)
+++ trunk/OpenMPT/soundlib/Load_ult.cpp 2010-03-26 23:00:54 UTC (rev 554)
@@ -395,7 +395,7 @@
pSmp->nC5Speed = ultSmp.speed;
if(ultSmp.finetune)
{
- pSmp->nC5Speed = (UINT)(((double)pSmp->nC5Speed) * pow(2, (((double)ultSmp.finetune) / (12.0 * 32768))));
+ pSmp->nC5Speed = (UINT)(((double)pSmp->nC5Speed) * pow(2.0, (((double)ultSmp.finetune) / (12.0 * 32768))));
}
if(ultSmp.flags & ULT_LOOP)
Modified: trunk/OpenMPT/zlib/contrib/vstudio/vc7/zlibstat.vcproj
===================================================================
--- trunk/OpenMPT/zlib/contrib/vstudio/vc7/zlibstat.vcproj 2010-03-26 19:17:27 UTC (rev 553)
+++ trunk/OpenMPT/zlib/contrib/vstudio/vc7/zlibstat.vcproj 2010-03-26 23:00:54 UTC (rev 554)
@@ -231,9 +231,6 @@
RelativePath="..\..\masmx86\gvmat32c.c">
</File>
<File
- RelativePath="..\..\..\gzio.c">
- </File>
- <File
RelativePath="..\..\..\infback.c">
</File>
<File
Modified: trunk/OpenMPT/zlib/contrib/vstudio/vc9/zlibstat.vcproj
===================================================================
--- trunk/OpenMPT/zlib/contrib/vstudio/vc9/zlibstat.vcproj 2010-03-26 19:17:27 UTC (rev 553)
+++ trunk/OpenMPT/zlib/contrib/vstudio/vc9/zlibstat.vcproj 2010-03-26 23:00:54 UTC (rev 554)
@@ -26,7 +26,7 @@
OutputDirectory="x86\ZlibStat$(ConfigurationName)"
IntermediateDirectory="x86\ZlibStat$(ConfigurationName)\Tmp"
ConfigurationType="4"
- InheritedPropertySheets="C:\Program Files (x86)\Microsoft Visual Studio 9.0\VC\VCProjectDefaults\UpgradeFromVC70.vsprops"
+ InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC70.vsprops"
UseOfMFC="0"
ATLMinimizesCRunTimeLibraryUsage="false"
>
@@ -99,7 +99,7 @@
OutputDirectory="x86\ZlibStat$(ConfigurationName)"
IntermediateDirectory="x86\ZlibStat$(ConfigurationName)\Tmp"
ConfigurationType="4"
- InheritedPropertySheets="C:\Program Files (x86)\Microsoft Visual Studio 9.0\VC\VCProjectDefaults\UpgradeFromVC70.vsprops"
+ InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC70.vsprops"
UseOfMFC="0"
ATLMinimizesCRunTimeLibraryUsage="false"
>
@@ -173,7 +173,7 @@
OutputDirectory="x86\ZlibStat$(ConfigurationName)"
IntermediateDirectory="x86\ZlibStat$(ConfigurationName)\Tmp"
ConfigurationType="4"
- InheritedPropertySheets="C:\Program Files (x86)\Microsoft Visual Studio 9.0\VC\VCProjectDefaults\UpgradeFromVC70.vsprops"
+ InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC70.vsprops"
UseOfMFC="0"
ATLMinimizesCRunTimeLibraryUsage="false"
>
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <sag...@us...> - 2010-03-26 19:17:33
|
Revision: 553
http://modplug.svn.sourceforge.net/modplug/?rev=553&view=rev
Author: saga-games
Date: 2010-03-26 19:17:27 +0000 (Fri, 26 Mar 2010)
Log Message:
-----------
[Fix] Many dialogs don't check if their SndFile pointer is valid, so using the global "close file" shortcut can crash them. As a lazy fix, this shortcut is now only allowed if the main window has the focus.
Modified Paths:
--------------
trunk/OpenMPT/mptrack/Moddoc.cpp
trunk/OpenMPT/mptrack/Moddoc.h
Modified: trunk/OpenMPT/mptrack/Moddoc.cpp
===================================================================
--- trunk/OpenMPT/mptrack/Moddoc.cpp 2010-03-26 17:14:18 UTC (rev 552)
+++ trunk/OpenMPT/mptrack/Moddoc.cpp 2010-03-26 19:17:27 UTC (rev 553)
@@ -3300,7 +3300,7 @@
case kcApproxRealBPM: OnApproximateBPM(); break;
case kcFileSave: DoSave(m_strPathName, 0); break;
case kcFileSaveAs: DoSave(NULL, 1); break;
- case kcFileClose: OnFileClose(); break;
+ case kcFileClose: SafeFileClose(); break;
case kcPlayPatternFromCursor: OnPatternPlay(); break;
case kcPlayPatternFromStart: OnPatternRestart(); break;
@@ -3543,4 +3543,12 @@
displayName.Format(TEXT("%s (%s)"), (LPCTSTR)instrumentName, (LPCTSTR)pluginName);
}
return displayName;
+}
+
+void CModDoc::SafeFileClose()
+//--------------------------
+{
+ // Verify that the main window has the focus. This saves us a lot of trouble because active dialogs normally don't check if their pSndFile pointers are still valid.
+ if(GetActiveWindow() == CMainFrame::GetMainFrame()->m_hWnd)
+ OnFileClose();
}
\ No newline at end of file
Modified: trunk/OpenMPT/mptrack/Moddoc.h
===================================================================
--- trunk/OpenMPT/mptrack/Moddoc.h 2010-03-26 17:14:18 UTC (rev 552)
+++ trunk/OpenMPT/mptrack/Moddoc.h 2010-03-26 19:17:27 UTC (rev 553)
@@ -292,6 +292,8 @@
bool MergeSequences();
bool ConvertSubsongsToMultipleSequences();
+ bool HasMPTHacks(bool autofix = false);
+
bool m_bHasValidPath; //becomes true if document is loaded or saved.
// Fix: save pattern scrollbar position when switching to other tab
CSize GetOldPatternScrollbarsPos() const { return m_szOldPatternScrollbarsPos; };
@@ -322,6 +324,7 @@
virtual BOOL OnOpenDocument(LPCTSTR lpszPathName);
virtual BOOL OnSaveDocument(LPCTSTR lpszPathName);
virtual void OnCloseDocument();
+ void SafeFileClose();
// -> CODE#0023
// -> DESC="IT project files (.itp)"
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <sag...@us...> - 2010-03-26 17:14:28
|
Revision: 552
http://modplug.svn.sourceforge.net/modplug/?rev=552&view=rev
Author: saga-games
Date: 2010-03-26 17:14:18 +0000 (Fri, 26 Mar 2010)
Log Message:
-----------
[Imp] In the cleanup dialog, mutually exclusive items are now automatically unchecked, to avoid confusion.
[Imp] Treeview: Improved order dragging; It is now also possible to drag an order into a non-MPT module. In that case, the old orderlist will be replaced.
Modified Paths:
--------------
trunk/OpenMPT/mptrack/CleanupSong.cpp
trunk/OpenMPT/mptrack/CleanupSong.h
trunk/OpenMPT/mptrack/View_tre.cpp
Modified: trunk/OpenMPT/mptrack/CleanupSong.cpp
===================================================================
--- trunk/OpenMPT/mptrack/CleanupSong.cpp 2010-03-26 13:23:03 UTC (rev 551)
+++ trunk/OpenMPT/mptrack/CleanupSong.cpp 2010-03-26 17:14:18 UTC (rev 552)
@@ -44,6 +44,25 @@
IDC_CHK_RESET_VARIABLES,
};
+// Options that are mutually exclusive to each other
+ENUM_CLEANUP_OPTIONS const CModCleanupDlg::m_nMutuallyExclusive[CU_MAX_CLEANUP_OPTIONS] =
+{
+ // patterns
+ CU_REMOVE_PATTERNS, CU_CLEANUP_PATTERNS, CU_REMOVE_PATTERNS,
+ // orders
+ CU_REMOVE_ORDERS, CU_MERGE_SEQUENCES,
+ // samples
+ CU_REMOVE_SAMPLES, CU_CLEANUP_SAMPLES, CU_REMOVE_SAMPLES,
+ CU_REMOVE_SAMPLES,
+ // instruments
+ CU_REMOVE_INSTRUMENTS, CU_CLEANUP_INSTRUMENTS,
+ // plugins
+ CU_REMOVE_PLUGINS, CU_CLEANUP_PLUGINS,
+ // misc
+ CU_NONE,
+
+};
+
///////////////////////////////////////////////////////////////////////
// CModCleanupDlg
@@ -52,6 +71,21 @@
ON_COMMAND(IDC_BTN_CLEANUP_SONG, OnPresetCleanupSong)
ON_COMMAND(IDC_BTN_COMPO_CLEANUP, OnPresetCompoCleanup)
+ ON_COMMAND(IDC_CHK_CLEANUP_PATTERNS, OnVerifyMutualExclusive)
+ ON_COMMAND(IDC_CHK_REMOVE_PATTERNS, OnVerifyMutualExclusive)
+ ON_COMMAND(IDC_CHK_REARRANGE_PATTERNS, OnVerifyMutualExclusive)
+ ON_COMMAND(IDC_CHK_MERGE_SEQUENCES, OnVerifyMutualExclusive)
+ ON_COMMAND(IDC_CHK_REMOVE_ORDERS, OnVerifyMutualExclusive)
+ ON_COMMAND(IDC_CHK_CLEANUP_SAMPLES, OnVerifyMutualExclusive)
+ ON_COMMAND(IDC_CHK_REMOVE_SAMPLES, OnVerifyMutualExclusive)
+ ON_COMMAND(IDC_CHK_REARRANGE_SAMPLES, OnVerifyMutualExclusive)
+ ON_COMMAND(IDC_CHK_OPTIMIZE_SAMPLES, OnVerifyMutualExclusive)
+ ON_COMMAND(IDC_CHK_CLEANUP_INSTRUMENTS, OnVerifyMutualExclusive)
+ ON_COMMAND(IDC_CHK_REMOVE_INSTRUMENTS, OnVerifyMutualExclusive)
+ ON_COMMAND(IDC_CHK_CLEANUP_PLUGINS, OnVerifyMutualExclusive)
+ ON_COMMAND(IDC_CHK_REMOVE_PLUGINS, OnVerifyMutualExclusive)
+ ON_COMMAND(IDC_CHK_RESET_VARIABLES, OnVerifyMutualExclusive)
+
ON_NOTIFY_EX_RANGE(TTN_NEEDTEXTW, 0, 0xFFFF, &CModCleanupDlg::OnToolTipNotify)
ON_NOTIFY_EX_RANGE(TTN_NEEDTEXTA, 0, 0xFFFF, &CModCleanupDlg::OnToolTipNotify)
//}}AFX_MSG_MAP
@@ -139,7 +173,34 @@
}
+void CModCleanupDlg::OnVerifyMutualExclusive()
+//--------------------------------------------
+{
+ HWND hFocus = GetFocus()->m_hWnd;
+ for(int i = 0; i < CU_MAX_CLEANUP_OPTIONS; i++)
+ {
+ // if this item is focussed, we have just (un)checked it.
+ if(hFocus == GetDlgItem(m_nCleanupIDtoDlgID[i])->m_hWnd)
+ {
+ // if we just unchecked it, there's nothing to verify.
+ if(IsDlgButtonChecked(m_nCleanupIDtoDlgID[i]) == FALSE)
+ return;
+ // now we can disable all elements that are mutually exclusive.
+ if(m_nMutuallyExclusive[i] != CU_NONE)
+ CheckDlgButton(m_nCleanupIDtoDlgID[m_nMutuallyExclusive[i]], MF_UNCHECKED);
+ // find other elements which are mutually exclusive with the selected element.
+ for(int j = 0; j < CU_MAX_CLEANUP_OPTIONS; j++)
+ {
+ if(m_nMutuallyExclusive[j] == i)
+ CheckDlgButton(m_nCleanupIDtoDlgID[j], MF_UNCHECKED);
+ }
+ return;
+ }
+ }
+}
+
+
void CModCleanupDlg::OnPresetCleanupSong()
//----------------------------------------
{
Modified: trunk/OpenMPT/mptrack/CleanupSong.h
===================================================================
--- trunk/OpenMPT/mptrack/CleanupSong.h 2010-03-26 13:23:03 UTC (rev 551)
+++ trunk/OpenMPT/mptrack/CleanupSong.h 2010-03-26 17:14:18 UTC (rev 552)
@@ -31,7 +31,8 @@
// misc
CU_RESET_VARIABLES,
- CU_MAX_CLEANUP_OPTIONS
+ CU_NONE,
+ CU_MAX_CLEANUP_OPTIONS = CU_NONE
};
//==================================
@@ -43,6 +44,7 @@
CWnd *m_wParent;
static bool m_bCheckBoxes[CU_MAX_CLEANUP_OPTIONS]; // Checkbox state
static const WORD m_nCleanupIDtoDlgID[CU_MAX_CLEANUP_OPTIONS]; // Checkbox -> Control ID LUT
+ static const ENUM_CLEANUP_OPTIONS m_nMutuallyExclusive[CU_MAX_CLEANUP_OPTIONS]; // Options that are mutually exclusive to each other.
// Actual cleanup implementations:
// Patterns
@@ -80,6 +82,7 @@
//{{AFX_MSG(CModCleanupDlg)
afx_msg void OnPresetCleanupSong();
afx_msg void OnPresetCompoCleanup();
+ afx_msg void OnVerifyMutualExclusive();
//}}AFX_MSG
DECLARE_MESSAGE_MAP()
};
\ No newline at end of file
Modified: trunk/OpenMPT/mptrack/View_tre.cpp
===================================================================
--- trunk/OpenMPT/mptrack/View_tre.cpp 2010-03-26 13:23:03 UTC (rev 551)
+++ trunk/OpenMPT/mptrack/View_tre.cpp 2010-03-26 17:14:18 UTC (rev 552)
@@ -2052,7 +2052,7 @@
case MODITEM_HDR_ORDERS:
// Drop your sequences here.
// At the moment, only dropping sequences into another module is possible.
- if((modItemDragType == MODITEM_SEQUENCE || modItemDragType == MODITEM_HDR_ORDERS) && pSndFile && pSndFile->GetType() == MOD_TYPE_MPT && pInfoDrag && pModDoc != pInfoDrag->pModDoc)
+ if((modItemDragType == MODITEM_SEQUENCE || modItemDragType == MODITEM_HDR_ORDERS) && pSndFile && pInfoDrag && pModDoc != pInfoDrag->pModDoc)
{
if(bDoDrop)
{
@@ -2065,12 +2065,31 @@
const ModSequence *pOrigSeq = &(pDragSndFile->Order.GetSequence(nOrigSeq));
if(pOrigSeq == nullptr) return false;
- pSndFile->Order.AddSequence(false);
- pSndFile->Order.resize(pOrigSeq->GetLength(), pSndFile->Order.GetInvalidPatIndex());
- for(ORDERINDEX nOrd = 0; nOrd < pOrigSeq->GetLengthTailTrimmed(); nOrd++)
+ if(pSndFile->GetType() == MOD_TYPE_MPT)
{
- pSndFile->Order[nOrd] = pDragSndFile->Order.GetSequence(nOrigSeq)[nOrd];
+ pSndFile->Order.AddSequence(false);
}
+ else
+ {
+ if(::MessageBox(0, _T("Replace the current orderlist?"), _T("Sequence import"), MB_YESNO|MB_ICONQUESTION) == IDNO)
+ return false;
+ }
+ pSndFile->Order.resize(min(pSndFile->GetModSpecifications().ordersMax, pOrigSeq->GetLength()), pSndFile->Order.GetInvalidPatIndex());
+ for(ORDERINDEX nOrd = 0; nOrd < min(pSndFile->GetModSpecifications().ordersMax,pOrigSeq->GetLengthTailTrimmed()); nOrd++)
+ {
+ PATTERNINDEX nOrigPat = pDragSndFile->Order.GetSequence(nOrigSeq)[nOrd];
+ // translate pattern index
+ if(nOrigPat == pDragSndFile->Order.GetInvalidPatIndex())
+ pSndFile->Order[nOrd] = pSndFile->Order.GetInvalidPatIndex();
+ else if(nOrigPat == pDragSndFile->Order.GetIgnoreIndex() && pSndFile->GetModSpecifications().hasIgnoreIndex)
+ pSndFile->Order[nOrd] = pSndFile->Order.GetIgnoreIndex();
+ else if(nOrigPat == pDragSndFile->Order.GetIgnoreIndex() && !pSndFile->GetModSpecifications().hasIgnoreIndex)
+ pSndFile->Order[nOrd] = pSndFile->Order.GetInvalidPatIndex();
+ else if(nOrigPat >= pSndFile->GetModSpecifications().patternsMax)
+ pSndFile->Order[nOrd] = pSndFile->Order.GetInvalidPatIndex();
+ else
+ pSndFile->Order[nOrd] = nOrigPat;
+ }
pModDoc->UpdateAllViews(NULL, HINT_MODSEQUENCE, NULL);
pModDoc->SetModified();
}
@@ -2240,7 +2259,7 @@
{
CModDoc *pModDoc = DocInfo[m_nDragDocNdx]->pModDoc;
CSoundFile *pSndFile = (pModDoc) ? pModDoc->GetSoundFile() : nullptr;
- if(pSndFile && pSndFile->GetType() == MOD_TYPE_MPT && pSndFile->Order.GetNumSequences() == 1)
+ if(pSndFile && pSndFile->Order.GetNumSequences() == 1)
bDrag = true;
}
break;
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|