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-03-12 23:35:23
|
Revision: 526
http://modplug.svn.sourceforge.net/modplug/?rev=526&view=rev
Author: saga-games
Date: 2010-03-12 23:35:13 +0000 (Fri, 12 Mar 2010)
Log Message:
-----------
[Fix] Treeview: A crash could occour if the instrument library path was too long (f.e. because of malicious strings in the [Paths] section of the INI file)
[Imp] Treeview: J2B files were not shown in treeview.
[Ref] Added portable mode flag to CTrackApp class.
Modified Paths:
--------------
trunk/OpenMPT/mptrack/Mptrack.cpp
trunk/OpenMPT/mptrack/Mptrack.h
trunk/OpenMPT/mptrack/View_tre.cpp
Modified: trunk/OpenMPT/mptrack/Mptrack.cpp
===================================================================
--- trunk/OpenMPT/mptrack/Mptrack.cpp 2010-03-12 18:28:00 UTC (rev 525)
+++ trunk/OpenMPT/mptrack/Mptrack.cpp 2010-03-12 23:35:13 UTC (rev 526)
@@ -845,6 +845,7 @@
strcpy(m_szPluginCacheFileName, m_szConfigDirectory); // plugin cache
strcat(m_szPluginCacheFileName, "plugin.cache");
+ m_bPortableMode = bIsAppDir;
}
BOOL CTrackApp::InitInstance()
Modified: trunk/OpenMPT/mptrack/Mptrack.h
===================================================================
--- trunk/OpenMPT/mptrack/Mptrack.h 2010-03-12 18:28:00 UTC (rev 525)
+++ trunk/OpenMPT/mptrack/Mptrack.h 2010-03-12 23:35:13 UTC (rev 526)
@@ -158,6 +158,7 @@
TCHAR m_szConfigFileName[_MAX_PATH];
TCHAR m_szPluginCacheFileName[_MAX_PATH];
TCHAR m_szStringsFileName[_MAX_PATH];
+ bool m_bPortableMode;
#ifdef UPDATECHECKENABLED
// Internet request context
@@ -201,6 +202,7 @@
BOOL IsWaveExEnabled() const { return m_bExWaveSupport; }
BOOL IsDebug() const { return m_bDebugMode; }
LPCSTR GetConfigFileName() const { return m_szConfigFileName; }
+ bool IsPortableMode() const { return m_bPortableMode; }
LPCSTR GetPluginCacheFileName() const { return m_szPluginCacheFileName; }
LPCSTR GetConfigPath() const { return m_szConfigDirectory; }
void SetupPaths();
Modified: trunk/OpenMPT/mptrack/View_tre.cpp
===================================================================
--- trunk/OpenMPT/mptrack/View_tre.cpp 2010-03-12 18:28:00 UTC (rev 525)
+++ trunk/OpenMPT/mptrack/View_tre.cpp 2010-03-12 23:35:13 UTC (rev 526)
@@ -1615,8 +1615,14 @@
}
}
}
+
+ // The path is too long - we can't continue. This can actually only happen with an invalid path
+ if(strlen(szPath) >= ARRAYELEMCOUNT(szPath) - 1)
+ return;
+
// Enumerating Directories and samples/instruments
- if (szPath[strlen(szPath)-1] != '\\') strcat(szPath, "\\");
+ if (szPath[strlen(szPath) - 1] != '\\')
+ strcat(szPath, "\\");
strcpy(m_szInstrLibPath, szPath);
strcat(szPath, "*.*");
memset(&wfd, 0, sizeof(wfd));
@@ -1701,6 +1707,7 @@
|| (!lstrcmpi(s, ".wow"))
|| (!lstrcmpi(s, ".gdm"))
|| (!lstrcmpi(s, ".imf"))
+ || (!lstrcmpi(s, ".j2b"))
#ifndef NO_MO3_SUPPORT
|| (!lstrcmpi(s, ".mo3"))
#endif
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <sag...@us...> - 2010-03-12 18:28:11
|
Revision: 525
http://modplug.svn.sourceforge.net/modplug/?rev=525&view=rev
Author: saga-games
Date: 2010-03-12 18:28:00 +0000 (Fri, 12 Mar 2010)
Log Message:
-----------
[Fix] XM Loader: The last XM instrument was not always loaded.
Modified Paths:
--------------
trunk/OpenMPT/soundlib/Load_xm.cpp
Modified: trunk/OpenMPT/soundlib/Load_xm.cpp
===================================================================
--- trunk/OpenMPT/soundlib/Load_xm.cpp 2010-03-11 22:58:51 UTC (rev 524)
+++ trunk/OpenMPT/soundlib/Load_xm.cpp 2010-03-12 18:28:00 UTC (rev 525)
@@ -314,7 +314,7 @@
if (dwMemPos + sizeof(DWORD) >= dwMemLength) return true;
DWORD ihsize = LittleEndian(*((DWORD *)(lpStream + dwMemPos)));
- if (dwMemPos + ihsize >= dwMemLength) return true;
+ if (dwMemPos + ihsize > dwMemLength) return true;
memset(&pih, 0, sizeof(pih));
memcpy(&pih, lpStream + dwMemPos, min(sizeof(pih), ihsize));
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <sag...@us...> - 2010-03-11 22:59:00
|
Revision: 524
http://modplug.svn.sourceforge.net/modplug/?rev=524&view=rev
Author: saga-games
Date: 2010-03-11 22:58:51 +0000 (Thu, 11 Mar 2010)
Log Message:
-----------
[Fix] Pattern Editor: When recording plug param changes to the pattern, the wrong pattern rows were invalidated because the pattern display did not move.
[Imp] S3M Compatibility: At least process samples on muted channels so that sync can be maintained.
Modified Paths:
--------------
trunk/OpenMPT/mptrack/View_pat.cpp
trunk/OpenMPT/soundlib/Snd_fx.cpp
Modified: trunk/OpenMPT/mptrack/View_pat.cpp
===================================================================
--- trunk/OpenMPT/mptrack/View_pat.cpp 2010-03-09 22:16:06 UTC (rev 523)
+++ trunk/OpenMPT/mptrack/View_pat.cpp 2010-03-11 22:58:51 UTC (rev 524)
@@ -2999,7 +2999,7 @@
if(pRow->IsEmpty() || pRow->IsPcNote())
{
pRow->Set(NOTE_PCS, plugSlot + 1, paramIndex, static_cast<uint16>(pPlug->GetParameter(paramIndex) * MODCOMMAND::maxColumnValue));
- InvalidateRow();
+ InvalidateRow(nRow);
}
} else
{
@@ -3021,7 +3021,7 @@
if (pRow->command == 0 || pRow->command == CMD_SMOOTHMIDI || pRow->command == CMD_MIDI) { //we overwrite existing Zxx and \xx only.
pRow->command = (pSndFile->m_nType & (MOD_TYPE_IT | MOD_TYPE_MPT))?CMD_S3MCMDEX:CMD_MODCMDEX;;
pRow->param = 0xF0 + (foundMacro&0x0F);
- InvalidateRow();
+ InvalidateRow(nRow);
}
}
@@ -3031,7 +3031,7 @@
if (pRow->command == CMD_NONE || pRow->command == CMD_SMOOTHMIDI || pRow->command == CMD_MIDI) {
pRow->command = CMD_SMOOTHMIDI;
pRow->param = pPlug->GetZxxParameter(paramIndex);
- InvalidateRow();
+ InvalidateRow(nRow);
}
}
Modified: trunk/OpenMPT/soundlib/Snd_fx.cpp
===================================================================
--- trunk/OpenMPT/soundlib/Snd_fx.cpp 2010-03-09 22:16:06 UTC (rev 523)
+++ trunk/OpenMPT/soundlib/Snd_fx.cpp 2010-03-11 22:58:51 UTC (rev 524)
@@ -1177,8 +1177,6 @@
// -! NEW_FEATURE#0010
for (CHANNELINDEX nChn = 0; nChn < m_nChannels; nChn++, pChn++)
{
- if((GetType() == MOD_TYPE_S3M) && (ChnSettings[nChn].dwFlags & CHN_MUTE) != 0) // not even effects are processed on muted S3M channels
- continue;
UINT instr = pChn->nRowInstr;
UINT volcmd = pChn->nRowVolCmd;
UINT vol = pChn->nRowVolume;
@@ -1462,6 +1460,8 @@
#endif // MODPLUG_TRACKER
}
+ if((GetType() == MOD_TYPE_S3M) && (ChnSettings[nChn].dwFlags & CHN_MUTE) != 0) // not even effects are processed on muted S3M channels
+ continue;
// Volume Column Effect (except volume & panning)
/* A few notes, paraphrased from ITTECH.TXT by Storlek (creator of schismtracker):
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <sag...@us...> - 2010-03-09 22:16:15
|
Revision: 523
http://modplug.svn.sourceforge.net/modplug/?rev=523&view=rev
Author: saga-games
Date: 2010-03-09 22:16:06 +0000 (Tue, 09 Mar 2010)
Log Message:
-----------
[Fix] Note Off for VSTis was broken when the MIDI CC bug emulation was enabled.
Modified Paths:
--------------
trunk/OpenMPT/soundlib/Sndmix.cpp
Modified: trunk/OpenMPT/soundlib/Sndmix.cpp
===================================================================
--- trunk/OpenMPT/soundlib/Sndmix.cpp 2010-03-09 20:25:43 UTC (rev 522)
+++ trunk/OpenMPT/soundlib/Sndmix.cpp 2010-03-09 22:16:06 UTC (rev 523)
@@ -2004,9 +2004,12 @@
if(GetModFlag(MSF_MIDICC_BUGEMULATION))
{
- if((note >= NOTE_MIN) && (note <= NOTE_MAX))
+ if(note)
{
- pPlugin->MidiCommand(pIns->nMidiChannel, pIns->nMidiProgram, pIns->wMidiBank, pIns->NoteMap[note - 1], pChn->nVolume, nChn);
+ MODCOMMAND::NOTE realNote = note;
+ if((note >= NOTE_MIN) && (note <= NOTE_MAX))
+ realNote = pIns->NoteMap[note - 1];
+ pPlugin->MidiCommand(pIns->nMidiChannel, pIns->nMidiProgram, pIns->wMidiBank, realNote, pChn->nVolume, nChn);
} else if (volcmd == VOLCMD_VOLUME)
{
pPlugin->MidiCC(pIns->nMidiChannel, MIDICC_Volume_Fine, vol, nChn);
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <sag...@us...> - 2010-03-09 20:25:49
|
Revision: 522
http://modplug.svn.sourceforge.net/modplug/?rev=522&view=rev
Author: saga-games
Date: 2010-03-09 20:25:43 +0000 (Tue, 09 Mar 2010)
Log Message:
-----------
[Fix] Just because a variable is called "dwSomething", doesn't mean that it's supposed to be DWORD... Fixed a few variable conversions in GetLength() - Now, OpenMPT reports that Paul Legovitch's Intro.it is 58785320 minutes long instead of 0 seconds, which is not exactly correct, but the previous length was not correct either...
Modified Paths:
--------------
trunk/OpenMPT/soundlib/Snd_fx.cpp
Modified: trunk/OpenMPT/soundlib/Snd_fx.cpp
===================================================================
--- trunk/OpenMPT/soundlib/Snd_fx.cpp 2010-03-09 18:42:49 UTC (rev 521)
+++ trunk/OpenMPT/soundlib/Snd_fx.cpp 2010-03-09 20:25:43 UTC (rev 522)
@@ -90,7 +90,7 @@
ORDERINDEX nCurrentPattern = 0;
ORDERINDEX nNextPattern = 0;
PATTERNINDEX nPattern = Order[0];
- DOUBLE dwElapsedTime=0.0;
+ double dElapsedTime=0.0;
// -! NEW_FEATURE#0022
UINT nMusicSpeed=m_nDefaultSpeed, nMusicTempo=m_nDefaultTempo, nNextRow=0;
UINT nMaxRow = 0, nMaxPattern = 0;
@@ -101,7 +101,7 @@
BYTE vols[MAX_CHANNELS];
BYTE oldparam[MAX_CHANNELS];
UINT chnvols[MAX_CHANNELS];
- DWORD patloop[MAX_CHANNELS];
+ double patloop[MAX_CHANNELS];
memset(instr, 0, sizeof(instr));
memset(notes, 0, sizeof(notes));
@@ -209,7 +209,7 @@
if (!nRow)
{
for(UINT ipck = 0; ipck < m_nChannels; ipck++)
- patloop[ipck] = (DWORD)dwElapsedTime;
+ patloop[ipck] = dElapsedTime;
}
if (!bTotal)
{
@@ -316,8 +316,8 @@
if ((param & 0xF0) == 0xE0) nSpeedCount = (param & 0x0F) * nMusicSpeed; else
if ((param & 0xF0) == 0x60)
{
- if (param & 0x0F) dwElapsedTime += (dwElapsedTime - patloop[nChn]) * (param & 0x0F);
- else patloop[nChn] = (DWORD)dwElapsedTime;
+ if (param & 0x0F) dElapsedTime += (dElapsedTime - patloop[nChn]) * (double)(param & 0x0F);
+ else patloop[nChn] = dElapsedTime;
}
break;
case CMD_XFINEPORTAUPDOWN:
@@ -432,11 +432,11 @@
nSpeedCount += nMusicSpeed;
switch(m_nTempoMode) {
case tempo_mode_alternative:
- dwElapsedTime += 60000.0 / (1.65625 * (double)(nMusicSpeed * nMusicTempo)); break;
+ dElapsedTime += 60000.0 / (1.65625 * (double)(nMusicSpeed * nMusicTempo)); break;
case tempo_mode_modern:
- dwElapsedTime += 60000.0/(double)nMusicTempo / (double)m_nRowsPerBeat; break;
+ dElapsedTime += 60000.0/(double)nMusicTempo / (double)m_nRowsPerBeat; break;
case tempo_mode_classic: default:
- dwElapsedTime += (2500.0 * (double)nSpeedCount) / (double)nMusicTempo;
+ dElapsedTime += (2500.0 * (double)nSpeedCount) / (double)nMusicTempo;
}
}
@@ -457,7 +457,7 @@
}
}
- return dwElapsedTime / 1000.0;
+ return dElapsedTime / 1000.0;
}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <sag...@us...> - 2010-03-09 18:43:02
|
Revision: 521
http://modplug.svn.sourceforge.net/modplug/?rev=521&view=rev
Author: saga-games
Date: 2010-03-09 18:42:49 +0000 (Tue, 09 Mar 2010)
Log Message:
-----------
[Mod] Installer: Changed project URL again, now that there's at least a nice "in progress" site at openmpt.com
[Ref] Some more explanations for the compatibility fixes
Modified Paths:
--------------
trunk/OpenMPT/installer/install.iss
trunk/OpenMPT/soundlib/Snd_fx.cpp
trunk/OpenMPT/soundlib/Sndmix.cpp
Modified: trunk/OpenMPT/installer/install.iss
===================================================================
--- trunk/OpenMPT/installer/install.iss 2010-03-08 17:44:16 UTC (rev 520)
+++ trunk/OpenMPT/installer/install.iss 2010-03-09 18:42:49 UTC (rev 521)
@@ -9,9 +9,9 @@
AppVersion=1.18.00.00
AppName=OpenMPT
AppPublisher=OpenMPT Devs / Olivier Lapicque
-AppPublisherURL=http://www.modplug.com/
-AppSupportURL=http://www.modplug.com/
-AppUpdatesURL=http://www.modplug.com/
+AppPublisherURL=http://www.openmpt.com/
+AppSupportURL=http://www.openmpt.com/
+AppUpdatesURL=http://www.openmpt.com/
DefaultDirName={pf}\OpenMPT
DefaultGroupName=OpenMPT
AllowNoIcons=yes
@@ -142,3 +142,4 @@
#include "vst_scan.iss"
+
Modified: trunk/OpenMPT/soundlib/Snd_fx.cpp
===================================================================
--- trunk/OpenMPT/soundlib/Snd_fx.cpp 2010-03-08 17:44:16 UTC (rev 520)
+++ trunk/OpenMPT/soundlib/Snd_fx.cpp 2010-03-09 18:42:49 UTC (rev 521)
@@ -301,7 +301,7 @@
}
// -> CODE#0010
// -> DESC="add extended parameter mechanism to pattern effects"
- if(IsCompatibleMode(TRK_ALLTRACKERS))
+ if(IsCompatibleMode(TRK_ALLTRACKERS)) // clamp tempo correctly in compatible mode
nMusicTempo = CLAMP(nMusicTempo, 32, 255);
else
nMusicTempo = CLAMP(nMusicTempo, GetModSpecifications().tempoMin, GetModSpecifications().tempoMax);
@@ -321,6 +321,7 @@
}
break;
case CMD_XFINEPORTAUPDOWN:
+ // ignore high offset in compatible mode
if (((param & 0xF0) == 0xA0) && !IsCompatibleMode(TRK_FASTTRACKER2)) pChn->nOldHiOffset = param & 0x0F;
break;
}
@@ -474,7 +475,7 @@
MODSAMPLE *pSmp = &Samples[instr];
UINT note = pChn->nNewNote;
- if(note == 0 && IsCompatibleMode(TRK_IMPULSETRACKER)) return;
+ if(note == NOTE_NONE && IsCompatibleMode(TRK_IMPULSETRACKER)) return;
if ((pIns) && (note) && (note <= 128))
{
@@ -768,11 +769,13 @@
// Handle "retrigger" waveform type
if (pChn->nVibratoType < 4)
{
+ // IT Compatibilty: Slightly different waveform offsets (why does MPT have two different offsets here with IT old effects enabled and disabled?)
if(!IsCompatibleMode(TRK_IMPULSETRACKER) && (GetType() & (MOD_TYPE_IT|MOD_TYPE_MPT)) && (!(m_dwSongFlags & SONG_ITOLDEFFECTS)))
pChn->nVibratoPos = 0x10;
else
pChn->nVibratoPos = 0;
}
+ // IT Compatibility: No "retrigger" waveform here
if(!IsCompatibleMode(TRK_IMPULSETRACKER) && pChn->nTremoloType < 4)
{
pChn->nTremoloPos = 0;
@@ -812,9 +815,10 @@
pChn->nLeftVU = pChn->nRightVU = 0xFF;
pChn->dwFlags &= ~CHN_FILTER;
pChn->dwFlags |= CHN_FASTVOLRAMP;
+ //IT compatibility 15. Retrigger will not be reset (Tremor doesn't store anything here, so we just don't reset this as well)
if(!IsCompatibleMode(TRK_IMPULSETRACKER))
{
- //IT compatibility 15. Retrigger will not be reset (Tremor doesn't store anything here, so we just don't reset this as well)
+ // XM compatibility: FT2 also doesn't reset retrigger
if(!IsCompatibleMode(TRK_FASTTRACKER2)) pChn->nRetrigCount = 0;
pChn->nTremorCount = 0;
}
@@ -824,6 +828,7 @@
pChn->nResSwing = pChn->nCutSwing = 0;
if (pIns)
{
+ // IT compatibility tentative fix: Reset NNA action on every new note, even without instrument number next to note (fixes spx-farspacedance.it, but is this actually 100% correct?)
if(IsCompatibleMode(TRK_IMPULSETRACKER)) pChn->nNNA = pIns->nNNA;
if (!(pIns->VolEnv.dwFlags & ENV_CARRY)) pChn->nVolEnvPosition = 0;
if (!(pIns->PanEnv.dwFlags & ENV_CARRY)) pChn->nPanEnvPosition = 0;
@@ -833,6 +838,7 @@
// Volume Swing
if (pIns->nVolSwing)
{
+ // IT compatibility: MPT has a weird vol swing algorithm....
if(IsCompatibleMode(TRK_IMPULSETRACKER))
{
double d = 2 * (((double) rand()) / RAND_MAX) - 1;
@@ -846,6 +852,7 @@
// Pan Swing
if (pIns->nPanSwing)
{
+ // IT compatibility: MPT has a weird pan swing algorithm....
if(IsCompatibleMode(TRK_IMPULSETRACKER))
{
double d = 2 * (((double) rand()) / RAND_MAX) - 1;
@@ -883,7 +890,8 @@
{
if (pIns->nIFR & 0x80) { pChn->nResonance = pIns->nIFR & 0x7F; bFlt = true; }
if (pIns->nIFC & 0x80) { pChn->nCutOff = pIns->nIFC & 0x7F; bFlt = true; }
- if (bFlt && (pIns->nFilterMode != FLTMODE_UNCHANGED)) {
+ if (bFlt && (pIns->nFilterMode != FLTMODE_UNCHANGED))
+ {
pChn->nFilterMode = pIns->nFilterMode;
}
} else
@@ -999,22 +1007,22 @@
applyDNAtoPlug = false; //rewbs.VSTiNNA
if (((p->nMasterChn == nChn+1) || (p == pChn)) && (p->pModInstrument))
{
- BOOL bOk = FALSE;
+ bool bOk = false;
// Duplicate Check Type
switch(p->pModInstrument->nDCT)
{
// Note
case DCT_NOTE:
- if ((note) && (p->nNote == note) && (pHeader == p->pModInstrument)) bOk = TRUE;
+ if ((note) && (p->nNote == note) && (pHeader == p->pModInstrument)) bOk = true;
if (pHeader && pHeader->nMixPlug) applyDNAtoPlug = true; //rewbs.VSTiNNA
break;
// Sample
case DCT_SAMPLE:
- if ((pSample) && (pSample == p->pSample)) bOk = TRUE;
+ if ((pSample) && (pSample == p->pSample)) bOk = true;
break;
// Instrument
case DCT_INSTRUMENT:
- if (pHeader == p->pModInstrument) bOk = TRUE;
+ if (pHeader == p->pModInstrument) bOk = true;
//rewbs.VSTiNNA
if (pHeader && pHeader->nMixPlug) applyDNAtoPlug = true;
break;
@@ -1023,7 +1031,7 @@
if (pHeader && (pHeader->nMixPlug) && (pHeader->nMixPlug == p->pModInstrument->nMixPlug))
{
applyDNAtoPlug = true;
- bOk = TRUE;
+ bOk = true;
}
//end rewbs.VSTiNNA
break;
@@ -1504,6 +1512,7 @@
break;
case VOLCMD_VIBRATOSPEED:
+ // FT2 does not automatically enable vibrato with the "set vibrato speed" command
if(IsCompatibleMode(TRK_FASTTRACKER2))
pChn->nVibratoSpeed = vol & 0x0F;
else
@@ -1523,7 +1532,7 @@
break;
case VOLCMD_PORTAUP:
- //IT compatibility (one of the first - link effect memory)
+ //IT compatibility (one of the first testcases - link effect memory)
if(IsCompatibleMode(TRK_IMPULSETRACKER))
PortamentoUp(pChn, vol << 2, true);
else
@@ -1531,7 +1540,7 @@
break;
case VOLCMD_PORTADOWN:
- //IT compatibility (one of the first - link effect memory)
+ //IT compatibility (one of the first testcases - link effect memory)
if(IsCompatibleMode(TRK_IMPULSETRACKER))
PortamentoDown(pChn, vol << 2, true);
else
@@ -1646,7 +1655,7 @@
// Arpeggio
case CMD_ARPEGGIO:
- // IT compatibility 01. Don't ignore Arpeggio if no note is playing
+ // IT compatibility 01. Don't ignore Arpeggio if no note is playing (also valid for ST3)
if ((m_nTickCount) || (((!pChn->nPeriod) || !pChn->nNote) && !IsCompatibleMode(TRK_IMPULSETRACKER | TRK_SCREAMTRACKER))) break;
if ((!param) && (!(m_nType & (MOD_TYPE_S3M|MOD_TYPE_IT|MOD_TYPE_MPT)))) break;
pChn->nCommand = CMD_ARPEGGIO;
@@ -1661,9 +1670,9 @@
if (!(param & 0x0F)) param |= pChn->nRetrigParam & 0x0F;
param |= 0x100; // increment retrig count on first row
}
+ // IT compatibility 15. Retrigger
if(IsCompatibleMode(TRK_IMPULSETRACKER))
{
- // IT compatibility 15. Retrigger
if (param)
pChn->nRetrigParam = (BYTE)(param & 0xFF);
@@ -1694,17 +1703,16 @@
case CMD_TREMOR:
if (!(m_dwSongFlags & SONG_FIRSTTICK)) break;
+ // IT compatibility 12. / 13. Tremor (using modified DUMB's Tremor logic here because of old effects - http://dumb.sf.net/)
if(IsCompatibleMode(TRK_IMPULSETRACKER))
{
- // IT compatibility 12. / 13. Tremor (using modified DUMB's Tremor logic here because of old effects - http://dumb.sf.net/)
-
- if (param && !(m_dwSongFlags & SONG_ITOLDEFFECTS)) {
+ if (param && !(m_dwSongFlags & SONG_ITOLDEFFECTS))
+ {
// Old effects have different length interpretation (+1 for both on and off)
if (param & 0xf0) param -= 0x10;
if (param & 0x0f) param -= 0x01;
}
pChn->nTremorCount |= 128; // set on/off flag
-
}
else
{
@@ -1721,9 +1729,9 @@
if (!(m_dwSongFlags & SONG_FIRSTTICK)) break;
if (!(m_nType & (MOD_TYPE_IT|MOD_TYPE_MPT))) param <<= 1;
+ //IT compatibility 16. Both FT2 and IT ignore out-of-range values
if(IsCompatibleMode(TRK_IMPULSETRACKER | TRK_FASTTRACKER2))
{
- //IT compatibility 16. Both FT2 and IT ignore out-of-range values
if (param <= 128)
m_nGlobalVolume = param << 1;
}
@@ -1795,9 +1803,9 @@
// Key Off
case CMD_KEYOFF:
+ // This is how Key Off is supposed to sound... (in FT2 at least)
if(IsCompatibleMode(TRK_FASTTRACKER2))
{
- // This is how it's supposed to sound... (in FT2)
if (m_nTickCount == param)
{
// XM: Key-Off + Sample == Note Cut
@@ -1816,9 +1824,9 @@
KeyOff(nChn);
}
}
+ // This is how it's NOT supposed to sound...
else
{
- // This is how it's NOT supposed to sound...
if(m_dwSongFlags & SONG_FIRSTTICK)
KeyOff(nChn);
}
@@ -1830,7 +1838,7 @@
{
case 0x10: ExtraFinePortamentoUp(pChn, param & 0x0F); break;
case 0x20: ExtraFinePortamentoDown(pChn, param & 0x0F); break;
- // Modplug XM Extensions
+ // Modplug XM Extensions (ignore in compatible mode)
case 0x50:
case 0x60:
case 0x70:
@@ -1866,9 +1874,9 @@
{
pChn->nVolEnvPosition = param;
+ // XM compatibility: FT2 only sets the position of the Volume envelope
if(!IsCompatibleMode(TRK_FASTTRACKER2))
{
- // FT2 only sets the position of the Volume envelope
pChn->nPanEnvPosition = param;
pChn->nPitchEnvPosition = param;
if (pChn->pModInstrument)
@@ -2000,9 +2008,11 @@
//end rewbs.fix
&& ((nPosJump != (int)m_nCurrentPattern) || (nBreakRow != (int)m_nRow)))
{
+ // IT compatibility: don't reset loop count on pattern break
if (nPosJump != (int)m_nCurrentPattern && !IsCompatibleMode(TRK_IMPULSETRACKER))
{
- for (UINT i=0; i<m_nChannels; i++) Chn[i].nPatternLoopCount = 0;
+ for (CHANNELINDEX i = 0; i < m_nChannels; i++)
+ Chn[i].nPatternLoopCount = 0;
}
m_nNextPattern = nPosJump;
m_nNextRow = (UINT)nBreakRow;
@@ -2478,6 +2488,7 @@
{
if (param & 0x0F) nPanSlide = -(int)((param & 0x0F) << 2);
else nPanSlide = (int)((param & 0xF0) >> 2);
+ // XM compatibility: FT2's panning slide is not as deep
if(IsCompatibleMode(TRK_FASTTRACKER2))
nPanSlide >>= 2;
}
@@ -2644,6 +2655,7 @@
pChn->nVibratoType = param & 0x03;
} else
{
+ // IT compatibility: Ignore waveform types > 3
if(IsCompatibleMode(TRK_IMPULSETRACKER))
pChn->nVibratoType = (param < 0x04) ? param : 0;
else
@@ -2656,6 +2668,7 @@
pChn->nTremoloType = param & 0x03;
} else
{
+ // IT compatibility: Ignore waveform types > 3
if(IsCompatibleMode(TRK_IMPULSETRACKER))
pChn->nTremoloType = (param < 0x04) ? param : 0;
else
@@ -2663,7 +2676,9 @@
}
break;
// S5x: Set Panbrello Waveform
- case 0x50: if(IsCompatibleMode(TRK_IMPULSETRACKER))
+ case 0x50:
+ // IT compatibility: Ignore waveform types > 3
+ if(IsCompatibleMode(TRK_IMPULSETRACKER))
pChn->nPanbrelloType = (param < 0x04) ? param : 0;
else
pChn->nPanbrelloType = param & 0x07;
@@ -2727,6 +2742,7 @@
// S8x: Set 4-bit Panning
case 0x80: if(m_dwSongFlags & SONG_FIRSTTICK)
{
+ // IT Compatibility (and other trackers as well): panning disables surround (unless panning in rear channels is enabled, which is not supported by the original trackers anyway)
if(IsCompatibleMode(TRK_ALLTRACKERS))
{
if (!(m_dwSongFlags & SONG_SURROUNDPAN)) pChn->dwFlags &= ~CHN_SURROUND;
@@ -3215,15 +3231,19 @@
{
// IT Compatibility: Offset
if(IsCompatibleMode(TRK_IMPULSETRACKER))
+ {
if(m_dwSongFlags & SONG_ITOLDEFFECTS)
pChn->nPos = pChn->nLength; // Old FX: Clip to end of sample
else
pChn->nPos = 0; // Reset to beginning of sample
+ }
else
+ {
pChn->nPos = pChn->nLoopStart;
- if ((m_dwSongFlags & SONG_ITOLDEFFECTS) && (pChn->nLength > 4))
- {
- pChn->nPos = pChn->nLength - 2;
+ if ((m_dwSongFlags & SONG_ITOLDEFFECTS) && (pChn->nLength > 4))
+ {
+ pChn->nPos = pChn->nLength - 2;
+ }
}
} else if(IsCompatibleMode(TRK_FASTTRACKER2))
{
@@ -3251,9 +3271,9 @@
int nRetrigCount = pChn->nRetrigCount;
bool bDoRetrig = false;
+ //IT compatibility 15. Retrigger
if(IsCompatibleMode(TRK_IMPULSETRACKER))
{
- //IT compatibility 15. Retrigger
if ((m_dwSongFlags & SONG_FIRSTTICK) && pChn->nRowNote)
{
pChn->nRetrigCount = param & 0xf;
@@ -3264,10 +3284,9 @@
bDoRetrig = true;
}
}
+ // buggy-like-hell FT2 Rxy retrig!
else if(IsCompatibleMode(TRK_FASTTRACKER2) && (param & 0x100))
{
- // buggy-like-hell FT2 Rxy retrig!
-
if(m_dwSongFlags & SONG_FIRSTTICK)
{
// here are some really stupid things FT2 does
@@ -3344,12 +3363,14 @@
}
if (param < 0x100) bResetEnv = true;
}
+ // IT compatibility: Really weird combination of envelopes and retrigger (see Storlek's q.it testcase)
NoteChange(nChn, nNote, IsCompatibleMode(TRK_IMPULSETRACKER) ? true : false, bResetEnv);
if (m_nInstruments) {
ProcessMidiOut(nChn, pChn); //Send retrig to Midi
}
if ((m_nType & (MOD_TYPE_IT|MOD_TYPE_MPT)) && (!pChn->nRowNote) && (nOldPeriod)) pChn->nPeriod = nOldPeriod;
if (!(m_nType & (MOD_TYPE_S3M|MOD_TYPE_IT|MOD_TYPE_MPT))) nRetrigCount = 0;
+ // IT compatibility: see previous IT compatibility comment =)
if(IsCompatibleMode(TRK_IMPULSETRACKER)) pChn->nPos = pChn->nPosLo = 0;
if (offset) //rewbs.volOffset: apply offset on retrig
@@ -3363,6 +3384,7 @@
// buggy-like-hell FT2 Rxy retrig!
if(IsCompatibleMode(TRK_FASTTRACKER2) && (param & 0x100)) nRetrigCount++;
+ // Now we can also store the retrig value for IT...
if(!IsCompatibleMode(TRK_IMPULSETRACKER))
pChn->nRetrigCount = (BYTE)nRetrigCount;
}
@@ -3548,7 +3570,7 @@
// -> CODE#0016
// -> DESC="default tempo update"
- if(IsCompatibleMode(TRK_ALLTRACKERS))
+ if(IsCompatibleMode(TRK_ALLTRACKERS)) // clamp tempo correctly in compatible mode
m_nMusicTempo = CLAMP(m_nMusicTempo, 32, 255);
else
m_nMusicTempo = CLAMP(m_nMusicTempo, specs.tempoMin, specs.tempoMax);
Modified: trunk/OpenMPT/soundlib/Sndmix.cpp
===================================================================
--- trunk/OpenMPT/soundlib/Sndmix.cpp 2010-03-08 17:44:16 UTC (rev 520)
+++ trunk/OpenMPT/soundlib/Sndmix.cpp 2010-03-09 18:42:49 UTC (rev 521)
@@ -988,15 +988,19 @@
if (pChn->dwFlags & CHN_TREMOLO)
{
UINT trempos = pChn->nTremoloPos;
+ // IT compatibility: Why would want to not execute tremolo at volume 0?
if (vol > 0 || IsCompatibleMode(TRK_IMPULSETRACKER))
{
+ // IT compatibility: We don't need a different attenuation here because of the different tables we're going to use
const int tremattn = (m_nType & MOD_TYPE_XM || IsCompatibleMode(TRK_IMPULSETRACKER)) ? 5 : 6;
switch (pChn->nTremoloType & 0x03)
{
case 1:
+ // IT compatibility: IT has its own, more precise tables
vol += ((IsCompatibleMode(TRK_IMPULSETRACKER) ? ITRampDownTable[trempos] : ModRampDownTable[trempos]) * (int)pChn->nTremoloDepth) >> tremattn;
break;
case 2:
+ // IT compatibility: IT has its own, more precise tables
vol += ((IsCompatibleMode(TRK_IMPULSETRACKER) ? ITSquareTable[trempos] : ModSquareTable[trempos]) * (int)pChn->nTremoloDepth) >> tremattn;
break;
case 3:
@@ -1007,11 +1011,13 @@
vol += (ModRandomTable[trempos] * (int)pChn->nTremoloDepth) >> tremattn;
break;
default:
+ // IT compatibility: IT has its own, more precise tables
vol += ((IsCompatibleMode(TRK_IMPULSETRACKER) ? ITSinusTable[trempos] : ModSinusTable[trempos]) * (int)pChn->nTremoloDepth) >> tremattn;
}
}
if ((m_nTickCount) || ((m_nType & (MOD_TYPE_STM|MOD_TYPE_S3M|MOD_TYPE_IT|MOD_TYPE_MPT)) && (!(m_dwSongFlags & SONG_ITOLDEFFECTS))))
{
+ // IT compatibility: IT has its own, more precise tables
if(IsCompatibleMode(TRK_IMPULSETRACKER))
pChn->nTremoloPos = (pChn->nTremoloPos + 4 * pChn->nTremoloSpeed) & 0xFF;
else
@@ -1022,10 +1028,9 @@
// Tremor
if(pChn->nCommand == CMD_TREMOR)
{
+ // IT compatibility 12. / 13.: Tremor
if(IsCompatibleMode(TRK_IMPULSETRACKER))
{
- // IT compatibility 12. / 13.: Tremor
-
if ((pChn->nTremorCount & 128) && pChn->nLength) {
if (pChn->nTremorCount == 128)
pChn->nTremorCount = (pChn->nTremorParam >> 4) | 192;
@@ -1157,6 +1162,7 @@
{
// PPS value is 1/512, i.e. PPS=1 will adjust by 8/512 = 1/64 for each 8 semitones
// with PPS = 32 / PPC = C-5, E-6 will pan hard right (and D#6 will not)
+ // IT compatibility: IT has a wider pan range here
int pandelta = (int)pChn->nRealPan + (int)((int)(pChn->nNote - pIns->nPPC - 1) * (int)pIns->nPPS) / (int)(IsCompatibleMode(TRK_IMPULSETRACKER) ? 4 : 8);
pChn->nRealPan = CLAMP(pandelta, 0, 256);
}
@@ -1227,7 +1233,8 @@
}
}
}
- else if(IsCompatibleMode(TRK_FASTTRACKER2)) // FastTracker 2
+ // FastTracker 2: Swedish tracker logic (TM) arpeggio
+ else if(IsCompatibleMode(TRK_FASTTRACKER2))
{
BYTE note = pChn->nNote;
int arpPos = 0;
@@ -1249,7 +1256,8 @@
period = GetPeriodFromNote(note, pChn->nFineTune, pChn->nC5Speed);
}
- else // Other trackers
+ // Other trackers
+ else
{
switch(m_nTickCount % 3)
{
@@ -1347,9 +1355,11 @@
switch (pChn->nVibratoType & 0x03)
{
case 1:
+ // IT compatibility: IT has its own, more precise tables
vdelta = IsCompatibleMode(TRK_IMPULSETRACKER) ? ITRampDownTable[vibpos] : ModRampDownTable[vibpos];
break;
case 2:
+ // IT compatibility: IT has its own, more precise tables
vdelta = IsCompatibleMode(TRK_IMPULSETRACKER) ? ITSquareTable[vibpos] : ModSquareTable[vibpos];
break;
case 3:
@@ -1360,6 +1370,7 @@
vdelta = ModRandomTable[vibpos];
break;
default:
+ // IT compatibility: IT has its own, more precise tables
vdelta = IsCompatibleMode(TRK_IMPULSETRACKER) ? ITSinusTable[vibpos] : ModSinusTable[vibpos];
}
@@ -1377,8 +1388,10 @@
else //Original behavior
{
UINT vdepth;
+ // IT compatibility: correct vibrato depth
if(IsCompatibleMode(TRK_IMPULSETRACKER))
{
+ // Yes, vibrato goes backwards with old effects enabled!
if(m_dwSongFlags & SONG_ITOLDEFFECTS)
{
vdepth = 5;
@@ -1411,6 +1424,7 @@
}
if ((m_nTickCount) || ((m_nType & (MOD_TYPE_IT | MOD_TYPE_MPT)) && (!(m_dwSongFlags & SONG_ITOLDEFFECTS))))
{
+ // IT compatibility: IT has its own, more precise tables
if(IsCompatibleMode(TRK_IMPULSETRACKER))
pChn->nVibratoPos = (vibpos + 4 * pChn->nVibratoSpeed) & 0xFF;
else
@@ -1421,6 +1435,7 @@
if (pChn->dwFlags & CHN_PANBRELLO)
{
UINT panpos;
+ // IT compatibility: IT has its own, more precise tables
if(IsCompatibleMode(TRK_IMPULSETRACKER))
panpos = pChn->nPanbrelloPos & 0xFF;
else
@@ -1429,9 +1444,11 @@
switch (pChn->nPanbrelloType & 0x03)
{
case 1:
+ // IT compatibility: IT has its own, more precise tables
pdelta = IsCompatibleMode(TRK_IMPULSETRACKER) ? ITRampDownTable[panpos] : ModRampDownTable[panpos];
break;
case 2:
+ // IT compatibility: IT has its own, more precise tables
pdelta = IsCompatibleMode(TRK_IMPULSETRACKER) ? ITSquareTable[panpos] : ModSquareTable[panpos];
break;
case 3:
@@ -1442,6 +1459,7 @@
pdelta = ModRandomTable[panpos];
break;
default:
+ // IT compatibility: IT has its own, more precise tables
pdelta = IsCompatibleMode(TRK_IMPULSETRACKER) ? ITSinusTable[panpos] : ModSinusTable[panpos];
}
pChn->nPanbrelloPos += pChn->nPanbrelloSpeed;
@@ -1457,6 +1475,7 @@
{
MODSAMPLE *pSmp = pChn->pModSample;
+ // IT compatibility: No vibrato sweep = No vibrato at all!
if (pSmp->nVibSweep == 0 && !IsCompatibleMode(TRK_IMPULSETRACKER))
{
pChn->nAutoVibDepth = pSmp->nVibDepth << 8;
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <sag...@us...> - 2010-03-08 17:44:26
|
Revision: 520
http://modplug.svn.sourceforge.net/modplug/?rev=520&view=rev
Author: saga-games
Date: 2010-03-08 17:44:16 +0000 (Mon, 08 Mar 2010)
Log Message:
-----------
[Fix] S3M Playback: In ST3, muted channels are completely ignored, not even effects are interpreted. Let's try this in MPT, too.
[Fix] Pattern Editor: Find/Replace didn't work properly when replacing PC Notes with something that's not a PC Note.
[Ref] Introduced a static version of IsPcNote() to get rid of all the "note == NOTE_PC || note == NOTE_PCS".
[Ref] Some more refactoring
Modified Paths:
--------------
trunk/OpenMPT/mptrack/View_pat.cpp
trunk/OpenMPT/mptrack/dlg_misc.cpp
trunk/OpenMPT/mptrack/test/test.cpp
trunk/OpenMPT/soundlib/Snd_fx.cpp
trunk/OpenMPT/soundlib/Sndmix.cpp
trunk/OpenMPT/soundlib/modcommand.h
Modified: trunk/OpenMPT/mptrack/View_pat.cpp
===================================================================
--- trunk/OpenMPT/mptrack/View_pat.cpp 2010-03-08 14:26:04 UTC (rev 519)
+++ trunk/OpenMPT/mptrack/View_pat.cpp 2010-03-08 17:44:16 UTC (rev 520)
@@ -1878,7 +1878,16 @@
if (m_cmdReplace.note == CFindReplaceTab::replaceNotePlusOne)
{
if (m->note < NOTE_MAX) m->note++;
- } else m->note = m_cmdReplace.note;
+ } else
+ // Replace with another note
+ {
+ // If we're going to remove a PC Note, wipe out the complete column.
+ if(m->IsPcNote() && !MODCOMMAND::IsPcNote(m_cmdReplace.note))
+ {
+ m->Clear();
+ }
+ m->note = m_cmdReplace.note;
+ }
}
if ((m_dwReplaceFlags & PATSEARCH_INSTR))
{
@@ -4155,7 +4164,7 @@
const bool bIsLiveRecord = IsLiveRecord(*pMainFrm, *pModDoc, *pSndFile);
const bool usePlaybackPosition = (bIsLiveRecord && (CMainFrame::m_dwPatternSetup & PATTERN_AUTODELAY));
//Param control 'note'
- if((note == NOTE_PC || note == NOTE_PCS) && bRecordEnabled)
+ if(MODCOMMAND::IsPcNote(note) && bRecordEnabled)
{
pModDoc->GetPatternUndo()->PrepareUndo(m_nPattern, nChn, nRow, 1, 1);
pSndFile->Patterns[m_nPattern].GetpModCommand(nRow, nChn)->note = note;
Modified: trunk/OpenMPT/mptrack/dlg_misc.cpp
===================================================================
--- trunk/OpenMPT/mptrack/dlg_misc.cpp 2010-03-08 14:26:04 UTC (rev 519)
+++ trunk/OpenMPT/mptrack/dlg_misc.cpp 2010-03-08 17:44:16 UTC (rev 520)
@@ -1317,7 +1317,7 @@
{
combo->ResetContent();
- if(m_nNote == NOTE_PC || m_nNote == NOTE_PCS)
+ if(MODCOMMAND::IsPcNote(m_nNote))
{
// control plugin param note
combo->SetItemData(combo->AddString("No Effect"), 0);
@@ -1350,7 +1350,7 @@
void CPageEditNote::OnNoteChanged()
//---------------------------------
{
- bool bWasParamControl = (m_nNote == NOTE_PC || m_nNote == NOTE_PCS) ? true : false;
+ const bool bWasParamControl = MODCOMMAND::IsPcNote(m_nNote);
CComboBox *combo;
if ((combo = (CComboBox *)GetDlgItem(IDC_COMBO1)) != NULL)
@@ -1374,7 +1374,7 @@
}
}
}
- bool bIsNowParamControl = (m_nNote == NOTE_PC || m_nNote == NOTE_PCS) ? true : false;
+ const bool bIsNowParamControl = MODCOMMAND::IsPcNote(m_nNote);
if(bWasParamControl != bIsNowParamControl)
UpdateDialog();
Modified: trunk/OpenMPT/mptrack/test/test.cpp
===================================================================
--- trunk/OpenMPT/mptrack/test/test.cpp 2010-03-08 14:26:04 UTC (rev 519)
+++ trunk/OpenMPT/mptrack/test/test.cpp 2010-03-08 17:44:16 UTC (rev 520)
@@ -189,6 +189,10 @@
VERIFY_EQUAL(ConvertStrTo<float>("-87.0"), -87.0);
VERIFY_EQUAL(ConvertStrTo<double>("-0.5e-6"), -0.5e-6);
VERIFY_EQUAL(ConvertStrTo<double>("58.65403492763"), 58.65403492763);
+
+ VERIFY_EQUAL(MODCOMMAND::IsPcNote(NOTE_MAX), false);
+ VERIFY_EQUAL(MODCOMMAND::IsPcNote(NOTE_PC), true);
+ VERIFY_EQUAL(MODCOMMAND::IsPcNote(NOTE_PCS), true);
}
Modified: trunk/OpenMPT/soundlib/Snd_fx.cpp
===================================================================
--- trunk/OpenMPT/soundlib/Snd_fx.cpp 2010-03-08 14:26:04 UTC (rev 519)
+++ trunk/OpenMPT/soundlib/Snd_fx.cpp 2010-03-08 17:44:16 UTC (rev 520)
@@ -86,7 +86,10 @@
// -> CODE#0022
// -> DESC="alternative BPM/Speed interpretation method"
// UINT dwElapsedTime=0, nRow=0, nCurrentPattern=0, nNextPattern=0, nPattern=Order[0];
- UINT nRow=0, nCurrentPattern=0, nNextPattern=0, nPattern=Order[0];
+ ROWINDEX nRow = 0;
+ ORDERINDEX nCurrentPattern = 0;
+ ORDERINDEX nNextPattern = 0;
+ PATTERNINDEX nPattern = Order[0];
DOUBLE dwElapsedTime=0.0;
// -! NEW_FEATURE#0022
UINT nMusicSpeed=m_nDefaultSpeed, nMusicTempo=m_nDefaultTempo, nNextRow=0;
@@ -94,10 +97,10 @@
LONG nGlbVol = m_nDefaultGlobalVolume, nOldGlbVolSlide = 0;
BYTE samples[MAX_CHANNELS];
BYTE instr[MAX_CHANNELS];
- BYTE notes[MAX_CHANNELS];
+ UINT notes[MAX_CHANNELS];
BYTE vols[MAX_CHANNELS];
BYTE oldparam[MAX_CHANNELS];
- BYTE chnvols[MAX_CHANNELS];
+ UINT chnvols[MAX_CHANNELS];
DWORD patloop[MAX_CHANNELS];
memset(instr, 0, sizeof(instr));
@@ -107,7 +110,7 @@
memset(oldparam, 0, sizeof(oldparam));
memset(chnvols, 64, sizeof(chnvols));
memset(samples, 0, sizeof(samples));
- for (UINT icv=0; icv<m_nChannels; icv++) chnvols[icv] = ChnSettings[icv].nVolume;
+ for(CHANNELINDEX icv = 0; icv < m_nChannels; icv++) chnvols[icv] = ChnSettings[icv].nVolume;
nMaxRow = m_nNextRow;
nMaxPattern = m_nNextPattern;
nCurrentPattern = nNextPattern = 0;
@@ -206,7 +209,7 @@
if (!nRow)
{
for(UINT ipck = 0; ipck < m_nChannels; ipck++)
- patloop[ipck] = dwElapsedTime;
+ patloop[ipck] = (DWORD)dwElapsedTime;
}
if (!bTotal)
{
@@ -224,8 +227,10 @@
MODCHANNEL *pChn = Chn;
MODCOMMAND *p = Patterns[nPattern] + nRow * m_nChannels;
MODCOMMAND *nextRow = NULL;
- for (UINT nChn=0; nChn<m_nChannels; p++,pChn++, nChn++) if (*((DWORD *)p))
+ for (CHANNELINDEX nChn = 0; nChn < m_nChannels; p++, pChn++, nChn++) if (*((DWORD *)p))
{
+ if((GetType() == MOD_TYPE_S3M) && (ChnSettings[nChn].dwFlags & CHN_MUTE) != 0) // not even effects are processed on muted S3M channels
+ continue;
UINT command = p->command;
UINT param = p->param;
UINT note = p->note;
@@ -237,7 +242,7 @@
// Position Jump
case CMD_POSITIONJUMP:
positionJumpOnThisRow=true;
- nNextPattern = param;
+ 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)) {
nNextRow = 0;
@@ -283,7 +288,7 @@
case CMD_TEMPO:
if ((bAdjust) && (m_nType & (MOD_TYPE_S3M|MOD_TYPE_IT | MOD_TYPE_MPT)))
{
- if (param) pChn->nOldTempo = param; else param = pChn->nOldTempo;
+ if (param) pChn->nOldTempo = (BYTE)param; else param = pChn->nOldTempo;
}
if (param >= 0x20) nMusicTempo = param; else
// Tempo Slide
@@ -312,7 +317,7 @@
if ((param & 0xF0) == 0x60)
{
if (param & 0x0F) dwElapsedTime += (dwElapsedTime - patloop[nChn]) * (param & 0x0F);
- else patloop[nChn] = dwElapsedTime;
+ else patloop[nChn] = (DWORD)dwElapsedTime;
}
break;
case CMD_XFINEPORTAUPDOWN:
@@ -1162,8 +1167,10 @@
// -> DESC="add extended parameter mechanism to pattern effects"
MODCOMMAND* m = nullptr;
// -! NEW_FEATURE#0010
- for (UINT nChn=0; nChn<m_nChannels; nChn++, pChn++)
+ for (CHANNELINDEX nChn = 0; nChn < m_nChannels; nChn++, pChn++)
{
+ if((GetType() == MOD_TYPE_S3M) && (ChnSettings[nChn].dwFlags & CHN_MUTE) != 0) // not even effects are processed on muted S3M channels
+ continue;
UINT instr = pChn->nRowInstr;
UINT volcmd = pChn->nRowVolCmd;
UINT vol = pChn->nRowVolume;
@@ -1224,7 +1231,7 @@
// Apart from changing parameters, parameter control notes are intended to be 'invisible'.
// To achieve this, clearing the note data so that rest of the process sees the row as empty row.
- if(pChn->nRowNote == NOTE_PC || pChn->nRowNote == NOTE_PCS)
+ if(MODCOMMAND::IsPcNote(pChn->nRowNote))
{
pChn->ClearRowCmd();
instr = 0;
@@ -3980,4 +3987,4 @@
pChn->nOldFinePortaUpDown = abs(tickParam);
pChn->m_CalculateFreq = true;
-}
+}
\ No newline at end of file
Modified: trunk/OpenMPT/soundlib/Sndmix.cpp
===================================================================
--- trunk/OpenMPT/soundlib/Sndmix.cpp 2010-03-08 14:26:04 UTC (rev 519)
+++ trunk/OpenMPT/soundlib/Sndmix.cpp 2010-03-08 17:44:16 UTC (rev 520)
@@ -1535,7 +1535,7 @@
df2 = LinearSlideDownTable[n1+1];
}
n >>= 2;
- period = _muldiv(period, df1 + ((df2-df1)*(n&0x3F)>>6), 256);
+ period = _muldiv(period, df1 + ((df2 - df1) * (n & 0x3F) >> 6), 256);
nPeriodFrac = period & 0xFF;
period >>= 8;
} else
@@ -1962,7 +1962,7 @@
// Previously this function took modcommand directly from pattern. ASSERT is there
// to detect possible behaviour change now that the data is accessed from channel.
const MODCOMMAND mc = *Patterns[m_nPattern].GetpModCommand(m_nRow, static_cast<CHANNELINDEX>(nChn));
- ASSERT( mc.note == NOTE_PC || mc.note == NOTE_PCS ||
+ ASSERT( mc.IsPcNote() ||
(note == mc.note && instr == mc.instr && volcmd == mc.volcmd && vol == mc.vol));
}
@@ -2122,4 +2122,3 @@
}
}
-
Modified: trunk/OpenMPT/soundlib/modcommand.h
===================================================================
--- trunk/OpenMPT/soundlib/modcommand.h 2010-03-08 14:26:04 UTC (rev 519)
+++ trunk/OpenMPT/soundlib/modcommand.h 2010-03-08 17:44:16 UTC (rev 520)
@@ -59,6 +59,7 @@
// 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;}
// 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()
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <sag...@us...> - 2010-03-08 14:26:12
|
Revision: 519
http://modplug.svn.sourceforge.net/modplug/?rev=519&view=rev
Author: saga-games
Date: 2010-03-08 14:26:04 +0000 (Mon, 08 Mar 2010)
Log Message:
-----------
[Fix] Sample Undo: If no custom value was set, the default value was set ridiculously high (tx Paul Legovitch)
[Fix] Sample Undo: Fixed another possible problem when undoing actions with very little memory left.
Modified Paths:
--------------
trunk/OpenMPT/mptrack/MainFrm.cpp
trunk/OpenMPT/mptrack/Undo.cpp
Modified: trunk/OpenMPT/mptrack/MainFrm.cpp
===================================================================
--- trunk/OpenMPT/mptrack/MainFrm.cpp 2010-03-07 16:25:09 UTC (rev 518)
+++ trunk/OpenMPT/mptrack/MainFrm.cpp 2010-03-08 14:26:04 UTC (rev 519)
@@ -203,7 +203,7 @@
| PATTERN_SHOWPREVIOUS | PATTERN_CONTSCROLL | PATTERN_SYNCMUTE | PATTERN_AUTODELAY | PATTERN_NOTEFADE;
DWORD CMainFrame::m_nRowSpacing = 16;
DWORD CMainFrame::m_nRowSpacing2 = 4;
-UINT CMainFrame::m_nSampleUndoMaxBuffer = 100 << 20;
+UINT CMainFrame::m_nSampleUndoMaxBuffer = 0; // Real sample buffer undo size will be set later.
// GDI
HICON CMainFrame::m_hIcon = NULL;
@@ -446,7 +446,7 @@
CSoundFile::s_DefaultPlugVolumeHandling = static_cast<uint8>(GetPrivateProfileInt("Misc", "DefaultPlugVolumeHandling", PLUGIN_VOLUMEHANDLING_IGNORE, iniFile));
if(CSoundFile::s_DefaultPlugVolumeHandling > 2) CSoundFile::s_DefaultPlugVolumeHandling = PLUGIN_VOLUMEHANDLING_IGNORE;
- m_nSampleUndoMaxBuffer = GetPrivateProfileLong("Sample Editor" , "UndoBufferSize", m_nSampleUndoMaxBuffer, iniFile);
+ m_nSampleUndoMaxBuffer = GetPrivateProfileLong("Sample Editor" , "UndoBufferSize", m_nSampleUndoMaxBuffer >> 20, iniFile);
m_nSampleUndoMaxBuffer = max(1, m_nSampleUndoMaxBuffer) << 20;
TCHAR szPath[_MAX_PATH] = "";
Modified: trunk/OpenMPT/mptrack/Undo.cpp
===================================================================
--- trunk/OpenMPT/mptrack/Undo.cpp 2010-03-07 16:25:09 UTC (rev 518)
+++ trunk/OpenMPT/mptrack/Undo.cpp 2010-03-08 14:26:04 UTC (rev 519)
@@ -343,7 +343,7 @@
case sundo_delete:
// insert deleted data
pNewSample = pSndFile->AllocateSample(pUndo->OldSample.GetSampleSizeInBytes() + 4 * nBytesPerSample);
- if(pNewSample == nullptr && pUndo->OldSample.nLength > 0) return false;
+ if(pNewSample == nullptr) return false;
memcpy(pNewSample, pCurrentSample, pUndo->nChangeStart * nBytesPerSample);
memcpy(pNewSample + pUndo->nChangeStart * nBytesPerSample, pUndo->SamplePtr, nChangeLen * nBytesPerSample);
memcpy(pNewSample + pUndo->nChangeEnd * nBytesPerSample, pCurrentSample + pUndo->nChangeStart * nBytesPerSample, (pUndo->OldSample.nLength - pUndo->nChangeEnd) * nBytesPerSample);
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <sag...@us...> - 2010-03-07 16:25:17
|
Revision: 518
http://modplug.svn.sourceforge.net/modplug/?rev=518&view=rev
Author: saga-games
Date: 2010-03-07 16:25:09 +0000 (Sun, 07 Mar 2010)
Log Message:
-----------
[Mod] Updated DE_jojo.mkb
Modified Paths:
--------------
trunk/OpenMPT/packageTemplate/extraKeymaps/DE_jojo.mkb
Modified: trunk/OpenMPT/packageTemplate/extraKeymaps/DE_jojo.mkb
===================================================================
--- trunk/OpenMPT/packageTemplate/extraKeymaps/DE_jojo.mkb 2010-03-07 14:15:23 UTC (rev 517)
+++ trunk/OpenMPT/packageTemplate/extraKeymaps/DE_jojo.mkb 2010-03-07 16:25:09 UTC (rev 518)
@@ -69,8 +69,9 @@
2:1048:2:35:1 //Go to last row: Ctrl+ENDE (KeyDown)
2:1049:6:35:1 //Go to last row of last channel: Ctrl+Alt+ENDE (KeyDown)
2:1050:1:16:1 //Selection key: Shift+UMSCHALT (KeyDown)
+2:1051:2:17:1 //Copy select key: Ctrl+STRG (KeyDown)
2:1011:2:76:1 //Select channel / Select all: Ctrl+L (KeyDown)
-2:1663:0:145:1 //Toggle follow song: ROLLEN-FESTSTELL (KeyDown)
+2:1663:0:19:1 //Toggle follow song: (KeyDown)
2:1003:0:13:1 //Quick copy: EINGABE (KeyDown)
2:1004:0:32:5 //Quick paste: LEER (KeyDown|KeyHold)
2:1001:2:32:1 //Enable recording: Ctrl+LEER (KeyDown)
@@ -78,8 +79,10 @@
2:1317:4:18:1 //Set row jump on note entry: Alt (KeyDown)
2:1685:2:9:1 //Switch to order list: Ctrl+TABULATOR (KeyDown)
2:1806:2:68:1 //Duplicate pattern: Ctrl+D (KeyDown)
+2:1836:2:191:1 //Edit plugin assigned to PC note: Ctrl+# (KeyDown)
2:1662:6:80:1 //Toggle channel's plugin editor: Ctrl+Alt+P (KeyDown)
2:1062:0:93:1 //Show note properties: ANWENDUNG (KeyDown)
+2:1772:2:93:1 //Show pattern properties window: Ctrl+ANWENDUNG (KeyDown)
2:1819:2:69:1 //Split Keyboard Settings dialog: Ctrl+E (KeyDown)
2:1780:2:80:1 //Show playback time at current row: Ctrl+P (KeyDown)
2:1786:2:82:1 //Reset channel: Ctrl+R (KeyDown)
@@ -274,6 +277,8 @@
8:1790:2:68:1 //Remove DC Offset: Ctrl+D (KeyDown)
//----( Instrument Context [bottom] (9) )------------
+9:1837:0:107:5 //Zoom In: + (ZEHNERTASTATUR) (KeyDown|KeyHold)
+9:1838:0:109:5 //Zoom Out: - (ZEHNERTASTATUR) (KeyDown|KeyHold)
9:1825:1:9:5 //Select previous envelope point: Shift+TABULATOR (KeyDown|KeyHold)
9:1826:0:9:5 //Select next envelope point: TABULATOR (KeyDown|KeyHold)
9:1821:0:37:5 //Move envelope point left: NACH-LINKS (KeyDown|KeyHold)
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <sag...@us...> - 2010-03-07 14:15:34
|
Revision: 517
http://modplug.svn.sourceforge.net/modplug/?rev=517&view=rev
Author: saga-games
Date: 2010-03-07 14:15:23 +0000 (Sun, 07 Mar 2010)
Log Message:
-----------
[Fix] GDM Loader: It would have actually helped to convert the format origin table correctly... Origin formats other than MOD are now loading correctly again.
Modified Paths:
--------------
trunk/OpenMPT/soundlib/Load_gdm.cpp
Modified: trunk/OpenMPT/soundlib/Load_gdm.cpp
===================================================================
--- trunk/OpenMPT/soundlib/Load_gdm.cpp 2010-03-07 13:37:12 UTC (rev 516)
+++ trunk/OpenMPT/soundlib/Load_gdm.cpp 2010-03-07 14:15:23 UTC (rev 517)
@@ -68,10 +68,10 @@
#pragma pack()
-#define GDMHeader_Origin_Count 8
+#define GDMHeader_Origin_Count 9
static MODTYPE GDMHeader_Origin[GDMHeader_Origin_Count] =
{
- MOD_TYPE_NONE, MOD_TYPE_MOD, MOD_TYPE_S3M, MOD_TYPE_669, MOD_TYPE_FAR, MOD_TYPE_ULT, MOD_TYPE_STM, MOD_TYPE_MED
+ MOD_TYPE_NONE, MOD_TYPE_MOD, MOD_TYPE_MTM, MOD_TYPE_S3M, MOD_TYPE_669, MOD_TYPE_FAR, MOD_TYPE_ULT, MOD_TYPE_STM, MOD_TYPE_MED
};
bool CSoundFile::ReadGDM(const LPCBYTE lpStream, const DWORD dwMemLength)
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <sag...@us...> - 2010-03-07 13:37:23
|
Revision: 516
http://modplug.svn.sourceforge.net/modplug/?rev=516&view=rev
Author: saga-games
Date: 2010-03-07 13:37:12 +0000 (Sun, 07 Mar 2010)
Log Message:
-----------
[New] Orderlist: "Select All" shortcut also works here now.
[Fix] PTM Loader: Fixed an unhandled null pointer exception that occured when loading some unsupported RAR files.
[Fix] All loaders: Added another security check to the CSoundFile::Create method because of aforementioned problem.
[Fix] Treeview: "Bypass" action for VSTs didn't set the document as modified.
Modified Paths:
--------------
trunk/OpenMPT/mptrack/Ctrl_seq.cpp
trunk/OpenMPT/mptrack/View_tre.cpp
trunk/OpenMPT/soundlib/Load_ptm.cpp
trunk/OpenMPT/soundlib/Sndfile.cpp
Modified: trunk/OpenMPT/mptrack/Ctrl_seq.cpp
===================================================================
--- trunk/OpenMPT/mptrack/Ctrl_seq.cpp 2010-03-06 12:41:43 UTC (rev 515)
+++ trunk/OpenMPT/mptrack/Ctrl_seq.cpp 2010-03-07 13:37:12 UTC (rev 516)
@@ -401,11 +401,14 @@
case kcOrderlistNavigateFirstSelect:
case kcOrderlistNavigateFirst:
SetCurSelTo2ndSel(wParam == kcOrderlistNavigateFirstSelect); SetCurSel(0); return wParam;
+ case kcEditSelectAll:
+ SetCurSel(0);
+ // fallthroughs intended.
case kcOrderlistNavigateLastSelect:
case kcOrderlistNavigateLast:
if((m_pModDoc != nullptr) && (m_pModDoc->GetSoundFile() != nullptr))
{
- SetCurSelTo2ndSel(wParam == kcOrderlistNavigateLastSelect);
+ SetCurSelTo2ndSel(wParam == kcOrderlistNavigateLastSelect || wParam == kcEditSelectAll);
ORDERINDEX nLast = m_pModDoc->GetSoundFile()->Order.GetLengthTailTrimmed();
if(nLast > 0) nLast--;
SetCurSel(nLast);
Modified: trunk/OpenMPT/mptrack/View_tre.cpp
===================================================================
--- trunk/OpenMPT/mptrack/View_tre.cpp 2010-03-06 12:41:43 UTC (rev 515)
+++ trunk/OpenMPT/mptrack/View_tre.cpp 2010-03-07 13:37:12 UTC (rev 516)
@@ -2768,20 +2768,22 @@
{
pModDoc->MuteInstrument((INSTRUMENTINDEX)modItemID, (pModDoc->IsInstrumentMuted((INSTRUMENTINDEX)modItemID)) ? false : true);
UpdateView(GetDocumentIDFromModDoc(pModDoc), HINT_INSNAMES | HINT_INSTRUMENT);
- }
-
+ } else
if ((modItemType == MODITEM_EFFECT))
{
- CSoundFile *pSndFile = pModDoc ? pModDoc->GetSoundFile() : NULL;
- if (pSndFile) {
- PSNDMIXPLUGIN pPlugin = &pSndFile->m_MixPlugins[modItemID];
- if (pPlugin) {
- CVstPlugin *pVstPlugin = (CVstPlugin *)pPlugin->pMixPlugin;
- if (pVstPlugin) pVstPlugin->Bypass();
- }
- }
+ CSoundFile *pSndFile = pModDoc ? pModDoc->GetSoundFile() : nullptr;
+ if (pSndFile == nullptr)
+ return;
+ PSNDMIXPLUGIN pPlugin = &pSndFile->m_MixPlugins[modItemID];
+ if(pPlugin == nullptr)
+ return;
+ CVstPlugin *pVstPlugin = (CVstPlugin *)pPlugin->pMixPlugin;
+ if(pVstPlugin == nullptr)
+ return;
+ pVstPlugin->Bypass();
+ pModDoc->SetModified();
+ //UpdateView(GetDocumentIDFromModDoc(pModDoc), HINT_MIXPLUGINS);
}
-
}
}
Modified: trunk/OpenMPT/soundlib/Load_ptm.cpp
===================================================================
--- trunk/OpenMPT/soundlib/Load_ptm.cpp 2010-03-06 12:41:43 UTC (rev 515)
+++ trunk/OpenMPT/soundlib/Load_ptm.cpp 2010-03-07 13:37:12 UTC (rev 516)
@@ -65,6 +65,9 @@
bool CSoundFile::ReadPTM(const BYTE *lpStream, DWORD dwMemLength)
//---------------------------------------------------------------
{
+ if(lpStream == nullptr || dwMemLength < sizeof(PTMFILEHEADER))
+ return false;
+
PTMFILEHEADER pfh = *(LPPTMFILEHEADER)lpStream;
DWORD dwMemPos;
UINT nOrders;
@@ -76,12 +79,11 @@
pfh.fileflags = LittleEndianW(pfh.fileflags);
pfh.reserved2 = LittleEndianW(pfh.reserved2);
pfh.ptmf_id = LittleEndian(pfh.ptmf_id);
- for (UINT j=0; j<128; j++)
- {
- pfh.patseg[j] = LittleEndianW(pfh.patseg[j]);
+ for (UINT j = 0; j < 128; j++)
+ {
+ pfh.patseg[j] = LittleEndianW(pfh.patseg[j]);
}
- if ((!lpStream) || (dwMemLength < 1024)) return false;
if ((pfh.ptmf_id != 0x464d5450) || (!pfh.nchannels)
|| (pfh.nchannels > 32)
|| (pfh.norders > 256) || (!pfh.norders)
@@ -98,12 +100,12 @@
nOrders = (pfh.norders < MAX_ORDERS) ? pfh.norders : MAX_ORDERS-1;
Order.ReadAsByte(pfh.orders, nOrders, nOrders);
- for (UINT ipan=0; ipan<m_nChannels; ipan++)
+ for (CHANNELINDEX ipan = 0; ipan < m_nChannels; ipan++)
{
ChnSettings[ipan].nVolume = 64;
ChnSettings[ipan].nPan = ((pfh.chnpan[ipan] & 0x0F) << 4) + 4;
}
- for (UINT ismp=0; ismp<m_nSamples; ismp++, dwMemPos += SIZEOF_PTMSAMPLE)
+ for (SAMPLEINDEX ismp = 0; ismp < m_nSamples; ismp++, dwMemPos += SIZEOF_PTMSAMPLE)
{
MODSAMPLE *pSmp = &Samples[ismp+1];
PTMSAMPLE *psmp = (PTMSAMPLE *)(lpStream+dwMemPos);
Modified: trunk/OpenMPT/soundlib/Sndfile.cpp
===================================================================
--- trunk/OpenMPT/soundlib/Sndfile.cpp 2010-03-06 12:41:43 UTC (rev 515)
+++ trunk/OpenMPT/soundlib/Sndfile.cpp 2010-03-07 13:37:12 UTC (rev 516)
@@ -572,7 +572,7 @@
CZipArchive archive(glpszModExtensions);
if (CZipArchive::IsArchive((LPBYTE)lpStream, dwMemLength))
{
- if (archive.UnzipArchive((LPBYTE)lpStream, dwMemLength))
+ if (archive.UnzipArchive((LPBYTE)lpStream, dwMemLength) && archive.GetOutputFile())
{
lpStream = archive.GetOutputFile();
dwMemLength = archive.GetOutputFileLength();
@@ -583,7 +583,7 @@
CRarArchive unrar((LPBYTE)lpStream, dwMemLength, glpszModExtensions);
if (unrar.IsArchive())
{
- if (unrar.ExtrFile())
+ if (unrar.ExtrFile() && unrar.GetOutputFile())
{
lpStream = unrar.GetOutputFile();
dwMemLength = unrar.GetOutputFileLength();
@@ -594,7 +594,7 @@
CLhaArchive unlha((LPBYTE)lpStream, dwMemLength, glpszModExtensions);
if (unlha.IsArchive())
{
- if (unlha.ExtractFile())
+ if (unlha.ExtractFile() && unlha.GetOutputFile())
{
lpStream = unlha.GetOutputFile();
dwMemLength = unlha.GetOutputFileLength();
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <sag...@us...> - 2010-03-06 12:41:49
|
Revision: 515
http://modplug.svn.sourceforge.net/modplug/?rev=515&view=rev
Author: saga-games
Date: 2010-03-06 12:41:43 +0000 (Sat, 06 Mar 2010)
Log Message:
-----------
[Fix] Pattern Editor: When pasting pattern data that exactly reached the pattern end with overflow paste enabled, a redundant undo point was created.
Modified Paths:
--------------
trunk/OpenMPT/mptrack/Modedit.cpp
Modified: trunk/OpenMPT/mptrack/Modedit.cpp
===================================================================
--- trunk/OpenMPT/mptrack/Modedit.cpp 2010-03-05 19:41:15 UTC (rev 514)
+++ trunk/OpenMPT/mptrack/Modedit.cpp 2010-03-06 12:41:43 UTC (rev 515)
@@ -1204,6 +1204,7 @@
UINT ncol = (dwBeginSel & 0xFFFF) >> 3;
UINT col;
bool bS3MCommands = false, bOk = false;
+ bool bPrepareUndo = true;
MODTYPE origFormat = MOD_TYPE_IT;
UINT len = 0, startLen;
@@ -1238,7 +1239,6 @@
bS3MCommands = (origFormat & (MOD_TYPE_IT|MOD_TYPE_MPT|MOD_TYPE_S3M)) != 0 ? true : false;
bOk = true;
- GetPatternUndo()->PrepareUndo(nPattern, 0, 0, m_SndFile.m_nChannels, m_SndFile.PatternSize[nPattern]);
startLen = len;
startRow = nrow;
@@ -1275,6 +1275,13 @@
if (bSkipPaste == false)
{
+ // 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]);
+ bPrepareUndo = false;
+ }
+
// ITSyle mixpaste requires that we keep a copy of the thing we are about to paste on
// so that we can refer back to check if there was anything in e.g. the note column before we pasted.
const MODCOMMAND origModCmd = m[col];
@@ -1447,8 +1454,8 @@
nPattern = m_SndFile.Order[oNextOrder];
if(m_SndFile.Patterns.IsValidPat(nPattern) == false) goto PasteDone;
m = m_SndFile.Patterns[nPattern];
- GetPatternUndo()->PrepareUndo(nPattern, 0, 0, m_SndFile.m_nChannels, m_SndFile.PatternSize[nPattern]);
oCurrentOrder = oNextOrder;
+ bPrepareUndo = true;
}
}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <sag...@us...> - 2010-03-05 19:41:27
|
Revision: 514
http://modplug.svn.sourceforge.net/modplug/?rev=514&view=rev
Author: saga-games
Date: 2010-03-05 19:41:15 +0000 (Fri, 05 Mar 2010)
Log Message:
-----------
[New] Pattern Editor: Extended context menu for PC Notes
[Ref] Refactored code to use IsPCNote() where possible.
Modified Paths:
--------------
trunk/OpenMPT/mptrack/Draw_pat.cpp
trunk/OpenMPT/mptrack/Modedit.cpp
trunk/OpenMPT/mptrack/PSRatioCalc.cpp
trunk/OpenMPT/mptrack/View_pat.cpp
trunk/OpenMPT/mptrack/View_pat.h
trunk/OpenMPT/mptrack/dlg_misc.h
trunk/OpenMPT/soundlib/Load_it.cpp
trunk/OpenMPT/soundlib/Sndfile.cpp
trunk/OpenMPT/soundlib/pattern.cpp
Modified: trunk/OpenMPT/mptrack/Draw_pat.cpp
===================================================================
--- trunk/OpenMPT/mptrack/Draw_pat.cpp 2010-02-28 18:23:21 UTC (rev 513)
+++ trunk/OpenMPT/mptrack/Draw_pat.cpp 2010-03-05 19:41:15 UTC (rev 514)
@@ -401,7 +401,7 @@
{
PCPATTERNFONT pfnt = GetCurrentPatternFont();
- if(mc.note == NOTE_PCS || mc.note == NOTE_PC)
+ if(mc.IsPcNote())
{ //If note is parameter control note, drawing volume command differently.
const int val = min(MODCOMMAND::maxColumnValue, mc.GetValueVolCol());
@@ -805,7 +805,7 @@
MODCOMMAND *mold = m - ncols;
if (m->note == mold->note) dwSpeedUpMask |= 0x01;
if ((m->instr == mold->instr) || (m_nDetailLevel < 1)) dwSpeedUpMask |= 0x02;
- if ( m->note == NOTE_PCS || m->note == NOTE_PC || mold->note == NOTE_PCS || mold->note == NOTE_PC )
+ if ( m->IsPcNote() || mold->IsPcNote() )
{ // Handle speedup mask for PC notes.
if(m->note == mold->note)
{
@@ -893,7 +893,7 @@
tx_col = MODCOLOR_TEXTSELECTED;
bk_col = MODCOLOR_BACKSELECTED;
} else
- if (m->note != NOTE_PCS && m->note != NOTE_PC && (m->volcmd) && (CMainFrame::m_dwPatternSetup & PATTERN_EFFECTHILIGHT))
+ if ((!m->IsPcNote()) && (m->volcmd) && (CMainFrame::m_dwPatternSetup & PATTERN_EFFECTHILIGHT))
{
switch(m->volcmd)
{
@@ -931,7 +931,7 @@
// Command & param
if (m_nDetailLevel > 2)
{
- const bool isPCnote = (m->note == NOTE_PC || m->note == NOTE_PCS);
+ const bool isPCnote = m->IsPcNote();
uint16 val = m->GetValueEffectCol();
if(val > MODCOMMAND::maxColumnValue) val = MODCOMMAND::maxColumnValue;
fx_col = row_col;
@@ -1475,7 +1475,7 @@
if (m->instr)
{
CHAR sztmp[128] = "";
- if(m->note == NOTE_PC || m->note == NOTE_PCS)
+ if(m->IsPcNote())
{
// display plugin name.
if(m->instr <= MAX_MIXPLUGINS)
@@ -1523,7 +1523,7 @@
break;
case 2:
// display volume command
- if(m->note == NOTE_PC || m->note == NOTE_PCS)
+ if(m->IsPcNote())
{
// display plugin param name.
if(m->instr > 0 && m->instr <= MAX_MIXPLUGINS)
@@ -1542,7 +1542,7 @@
case 3:
case 4:
// display effect command
- if(m->note != NOTE_PC && m->note != NOTE_PCS)
+ if(!m->IsPcNote())
{
if (!pModDoc->GetEffectName(s, m->command, m->param, false, nChn)) s[0] = 0;
}
Modified: trunk/OpenMPT/mptrack/Modedit.cpp
===================================================================
--- trunk/OpenMPT/mptrack/Modedit.cpp 2010-02-28 18:23:21 UTC (rev 513)
+++ trunk/OpenMPT/mptrack/Modedit.cpp 2010-03-05 19:41:15 UTC (rev 514)
@@ -1118,7 +1118,7 @@
ncursor++;
if ((ncursor >= colmin) && (ncursor <= colmax))
{
- if(m->note == NOTE_PC || m->note == NOTE_PCS)
+ if(m->IsPcNote())
{
const uint16 val = m->GetValueVolCol();
p[6] = GetDigit<2>(val);
@@ -1143,7 +1143,7 @@
if (((ncursor >= colmin) && (ncursor <= colmax))
|| ((ncursor+1 >= colmin) && (ncursor+1 <= colmax)))
{
- if(m->note == NOTE_PC || m->note == NOTE_PCS)
+ if(m->IsPcNote())
{
const uint16 val = m->GetValueEffectCol();
p[9] = GetDigit<2>(val);
Modified: trunk/OpenMPT/mptrack/PSRatioCalc.cpp
===================================================================
--- trunk/OpenMPT/mptrack/PSRatioCalc.cpp 2010-02-28 18:23:21 UTC (rev 513)
+++ trunk/OpenMPT/mptrack/PSRatioCalc.cpp 2010-03-05 19:41:15 UTC (rev 514)
@@ -151,17 +151,7 @@
rowTime = 2500.0 * (double)m_nSpeed/(double)m_nTempo;
break;
}
-/*
- if (CMainFrame::m_dwPatternSetup & PATTERN_MODERNSPEED) {
- rowTime = 60000.0/(double)m_nTempo / (double)m_nRowsPerBeat;
- }
- else if (CMainFrame::m_dwPatternSetup & PATTERN_ALTERNTIVEBPMSPEED) {
- rowTime = 60000.0 / (1.65625 * (double)(m_nSpeed * m_nTempo));
- }
- else {
- rowTime = 2500.0 * (double)m_nSpeed/(double)m_nTempo;
- }
-*/
+
m_dRowsOrig = (double)m_lMsOrig/rowTime;
m_dRowsNew = m_dRowsOrig*(m_dRatio/100);
Modified: trunk/OpenMPT/mptrack/View_pat.cpp
===================================================================
--- trunk/OpenMPT/mptrack/View_pat.cpp 2010-02-28 18:23:21 UTC (rev 513)
+++ trunk/OpenMPT/mptrack/View_pat.cpp 2010-03-05 19:41:15 UTC (rev 514)
@@ -116,6 +116,7 @@
ON_COMMAND(ID_CHANNEL_RENAME, OnRenameChannel)
ON_COMMAND(ID_PATTERN_EDIT_PCNOTE_PLUGIN, OnTogglePCNotePluginEditor)
ON_COMMAND_RANGE(ID_CHANGE_INSTRUMENT, ID_CHANGE_INSTRUMENT+MAX_INSTRUMENTS, OnSelectInstrument)
+ ON_COMMAND_RANGE(ID_CHANGE_PCNOTE_PARAM, ID_CHANGE_PCNOTE_PARAM + MODCOMMAND::maxColumnValue, OnSelectPCNoteParam)
ON_UPDATE_COMMAND_UI(ID_EDIT_UNDO, OnUpdateUndo)
ON_COMMAND_RANGE(ID_PLUGSELECT, ID_PLUGSELECT+MAX_MIXPLUGINS, OnSelectPlugin) //rewbs.patPlugName
@@ -892,7 +893,7 @@
switch(i & 7) {
case 0: // Clear note
if (rm.note) {
- if(m->note == NOTE_PCS || m->note == NOTE_PC)
+ if(m->IsPcNote())
{ // Clear whole row if clearing PC note
m->Clear();
invalidateAllCols = true;
@@ -918,7 +919,7 @@
case 3: // Clear Command
if (rm.command) {
m->command = 0;
- if(m->note == NOTE_PC || m->note == NOTE_PCS) m->SetValueEffectCol(0);
+ if(m->IsPcNote()) m->SetValueEffectCol(0);
}
break;
case 4: // Clear Command Param
@@ -1226,9 +1227,10 @@
AppendMenu(hMenu, MF_SEPARATOR, 0, "");
if (BuildVisFXCtxMenu(hMenu, ih) | //Use bitwise ORs to avoid shortcuts
BuildAmplifyCtxMenu(hMenu, ih) |
- BuildSetInstCtxMenu(hMenu, ih, pSndFile) |
- BuildPCNoteCtxMenu(hMenu, ih, pSndFile) )
+ BuildSetInstCtxMenu(hMenu, ih, pSndFile) )
AppendMenu(hMenu, MF_SEPARATOR, 0, "");
+ if (BuildPCNoteCtxMenu(hMenu, ih, pSndFile))
+ AppendMenu(hMenu, MF_SEPARATOR, 0, "");
if (BuildGrowShrinkCtxMenu(hMenu, ih))
AppendMenu(hMenu, MF_SEPARATOR, 0, "");
if(BuildMiscCtxMenu(hMenu, ih))
@@ -1804,7 +1806,7 @@
}
// Ignore modcommands with PC/PCS notes when searching from volume or effect column.
- if( (m->note == NOTE_PC || m->note == NOTE_PCS)
+ if( (m->IsPcNote())
&&
m_dwFindFlags & (PATSEARCH_VOLCMD|PATSEARCH_VOLUME|PATSEARCH_COMMAND|PATSEARCH_PARAM))
{
@@ -2153,8 +2155,8 @@
//static void CArrayUtils<UINT>::Merge(CArray<UINT,UINT>& Dest, CArray<UINT,UINT>& Src);
-void CViewPattern::Interpolate(UINT type)
-//---------------------------------------
+void CViewPattern::Interpolate(PatternColumns type)
+//-------------------------------------------------
{
CModDoc *pModDoc = GetDocument();
if (!pModDoc)
@@ -2451,6 +2453,7 @@
if (!nIns) return;
if ((pModDoc = GetDocument()) == NULL) return;
pSndFile = pModDoc->GetSoundFile();
+ if(!pSndFile) return;
p = pSndFile->Patterns[m_nPattern];
if (!p) return;
BeginWaitCursor();
@@ -2984,7 +2987,7 @@
// MPTM: Use PC Notes
// only overwrite existing PC Notes
- if(pRow->IsEmpty() || pRow->note == NOTE_PC || pRow->note == NOTE_PCS)
+ if(pRow->IsEmpty() || pRow->IsPcNote())
{
pRow->Set(NOTE_PCS, plugSlot + 1, paramIndex, static_cast<uint16>(pPlug->GetParameter(paramIndex) * MODCOMMAND::maxColumnValue));
InvalidateRow();
@@ -3719,7 +3722,7 @@
MODCOMMAND* p = pSndFile->Patterns[m_nPattern].GetpModCommand(m_nRow, GetChanFromCursor(m_dwCursor));
MODCOMMAND oldcmd = *p; // This is the command we are about to overwrite
- if(p->note == NOTE_PC || p->note == NOTE_PCS)
+ if(p->IsPcNote())
{
ENTER_PCNOTE_VALUE(v, ValueVolCol);
}
@@ -3812,7 +3815,7 @@
PrepareUndo(m_dwBeginSel, m_dwEndSel);
- if(p->note == NOTE_PC || p->note == NOTE_PCS)
+ if(p->IsPcNote())
{
ENTER_PCNOTE_VALUE(c, ValueEffectCol);
}
@@ -3864,7 +3867,7 @@
PrepareUndo(m_dwBeginSel, m_dwEndSel);
- if(p->note == NOTE_PC || p->note == NOTE_PCS)
+ if(p->IsPcNote())
{
ENTER_PCNOTE_VALUE(v, ValueEffectCol);
}
@@ -4504,14 +4507,14 @@
switch(field)
{
- case 0: if(p->note == NOTE_PC || p->note == NOTE_PCS) p->Clear(); else {p->note = NOTE_NONE; if (ITStyle) p->instr = 0;} break; //Note
+ case 0: if(p->IsPcNote()) p->Clear(); else {p->note = NOTE_NONE; if (ITStyle) p->instr = 0;} break; //Note
case 1: p->instr = 0; break; //instr
case 2: p->vol = 0; p->volcmd = 0; break; //Vol
case 3: p->command = 0; break; //Effect
case 4: p->param = 0; break; //Param
default: p->Clear(); //If not specified, delete them all! :)
}
- if((field == 3 || field == 4) && (p->note == NOTE_PC || p->note == NOTE_PCS))
+ if((field == 3 || field == 4) && (p->IsPcNote()))
p->SetValueEffectCol(0);
if(IsEditingEnabled_bmsg())
@@ -4575,17 +4578,47 @@
UINT o_inst = GetCurrentInstrument();
UINT n_inst = nID-ID_CHANGE_INSTRUMENT;
- if (n_inst == 0) {
+ if (n_inst == 0)
+ {
RowMask sp = {0,1,0,0,0}; // Setup mask to only clear instrument data in OnClearSelection
OnClearSelection(false, sp); // Clears instrument selection from pattern
- } else {
+ } else
+ {
SendCtrlMessage(CTRLMSG_SETCURRENTINSTRUMENT, n_inst);
OnSetSelInstrument();
SendCtrlMessage(CTRLMSG_SETCURRENTINSTRUMENT, o_inst); //Restoring old instrument.
}
}
+void CViewPattern::OnSelectPCNoteParam(UINT nID)
+//----------------------------------------------
+{
+ CModDoc *pModDoc = GetDocument(); if (!pModDoc) return;
+ CSoundFile *pSndFile = pModDoc->GetSoundFile(); if (!pSndFile) return;
+ UINT paramNdx = nID - ID_CHANGE_PCNOTE_PARAM;
+ bool bModified = false;
+ MODCOMMAND *p;
+ for(ROWINDEX nRow = GetSelectionStartRow(); nRow <= GetSelectionEndRow(); nRow++)
+ {
+ for(CHANNELINDEX nChn = GetSelectionStartChan(); nChn <= GetSelectionEndChan(); nChn++)
+ {
+ p = pSndFile->Patterns[m_nPattern] + nRow * pSndFile->GetNumChannels() + nChn;
+ if(p && p->IsPcNote() && (p->GetValueVolCol() != paramNdx))
+ {
+ bModified = true;
+ p->SetValueVolCol(paramNdx);
+ }
+ }
+ }
+ if (bModified)
+ {
+ pModDoc->SetModified();
+ pModDoc->UpdateAllViews(NULL, HINT_PATTERNDATA | (m_nPattern << HINT_SHIFT_PAT), NULL);
+ }
+}
+
+
void CViewPattern::OnSelectPlugin(UINT nID)
//-----------------------------------------
{
@@ -4944,8 +4977,21 @@
CArray<UINT, UINT> validChans;
DWORD greyed = (ListChansWhereColSelected(INST_COLUMN, validChans)>0)?FALSE:MF_GRAYED;
- if (!greyed || !(CMainFrame::m_dwPatternSetup&PATTERN_OLDCTXMENUSTYLE))
+ if (!greyed || !(CMainFrame::m_dwPatternSetup & PATTERN_OLDCTXMENUSTYLE))
{
+ bool isPcNote = false;
+ MODCOMMAND *mSelStart = nullptr;
+ if((pSndFile != nullptr) && (pSndFile->Patterns.IsValidPat(m_nPattern)))
+ {
+ mSelStart = pSndFile->Patterns[m_nPattern].GetpModCommand(GetSelectionStartRow(), GetSelectionStartChan());
+ if(mSelStart != nullptr && mSelStart->IsPcNote())
+ {
+ isPcNote = true;
+ }
+ }
+ if(isPcNote)
+ return false;
+
// Create the new menu and add it to the existing menu.
HMENU instrumentChangeMenu = ::CreatePopupMenu();
AppendMenu(hMenu, MF_POPUP|greyed, (UINT)instrumentChangeMenu, "Change Instrument\t" + ih->GetKeyTextFromCommand(kcPatternSetInstrument));
@@ -5004,6 +5050,7 @@
}
+// Context menu for Param Control notes
bool CViewPattern::BuildPCNoteCtxMenu(HMENU hMenu, CInputHandler* ih, CSoundFile* pSndFile)
//-----------------------------------------------------------------------------------------
{
@@ -5013,10 +5060,46 @@
mSelStart = pSndFile->Patterns[m_nPattern].GetpModCommand(GetSelectionStartRow(), GetSelectionStartChan());
if((mSelStart == nullptr) || (!mSelStart->IsPcNote()))
return false;
- if(mSelStart->instr < 1 || mSelStart->instr > MAX_MIXPLUGINS)
- return false;
- AppendMenu(hMenu, MF_STRING, ID_PATTERN_EDIT_PCNOTE_PLUGIN, "Toggle plugin editor\t" + ih->GetKeyTextFromCommand(kcPatternEditPCNotePlugin));
+ char s[72];
+
+ // Create sub menu for "change plugin"
+ HMENU pluginChangeMenu = ::CreatePopupMenu();
+ AppendMenu(hMenu, MF_POPUP, (UINT)pluginChangeMenu, "Change Plugin\t" + ih->GetKeyTextFromCommand(kcPatternSetInstrument));
+ for(PLUGINDEX nPlg = 0; nPlg < MAX_MIXPLUGINS; nPlg++)
+ {
+ if(pSndFile->m_MixPlugins[nPlg].pMixPlugin != nullptr)
+ {
+ wsprintf(s, "%02d: %s", nPlg + 1, pSndFile->m_MixPlugins[nPlg].GetName());
+ AppendMenu(pluginChangeMenu, MF_STRING | ((nPlg + 1) == mSelStart->instr) ? MF_CHECKED : 0, ID_CHANGE_INSTRUMENT + nPlg + 1, s);
+ }
+ }
+
+ if(mSelStart->instr >= 1 && mSelStart->instr <= MAX_MIXPLUGINS)
+ {
+ CVstPlugin *plug = (CVstPlugin *)(pSndFile->m_MixPlugins[mSelStart->instr - 1].pMixPlugin);
+
+ if(plug != nullptr)
+ {
+
+ // Create sub menu for "change plugin param"
+ HMENU paramChangeMenu = ::CreatePopupMenu();
+ AppendMenu(hMenu, MF_POPUP, (UINT)paramChangeMenu, "Change Plugin Parameter\t");
+
+ char sname[64];
+ uint16 nThisParam = mSelStart->GetValueVolCol();
+ UINT nParams = plug->GetNumParameters();
+ for (UINT i = 0; i < nParams; i++)
+ {
+ plug->GetParamName(i, sname, sizeof(sname));
+ wsprintf(s, "%02d: %s", i, sname);
+ AppendMenu(paramChangeMenu, MF_STRING | (i == nThisParam) ? MF_CHECKED : 0, ID_CHANGE_PCNOTE_PARAM + i, s);
+ }
+ }
+
+ AppendMenu(hMenu, MF_STRING, ID_PATTERN_EDIT_PCNOTE_PLUGIN, "Toggle plugin editor\t" + ih->GetKeyTextFromCommand(kcPatternEditPCNotePlugin));
+ }
+
return true;
}
@@ -5041,7 +5124,7 @@
return max(GetChanFromCursor(m_dwBeginSel), GetChanFromCursor(m_dwEndSel));
}
-UINT CViewPattern::ListChansWhereColSelected(UINT colType, CArray<UINT,UINT> &chans) {
+UINT CViewPattern::ListChansWhereColSelected(PatternColumns colType, CArray<UINT,UINT> &chans) {
//----------------------------------------------------------------------------------
chans.RemoveAll();
UINT startChan = GetSelectionStartChan();
@@ -5071,7 +5154,7 @@
bool CViewPattern::IsInterpolationPossible(UINT startRow, UINT endRow,
- UINT chan, UINT colType, CSoundFile* pSndFile) {
+ UINT chan, PatternColumns colType, CSoundFile* pSndFile) {
//---------------------------------------------------------------------------------------
if (startRow == endRow) {
return false;
@@ -5082,7 +5165,7 @@
const MODCOMMAND endRowMC = *pSndFile->Patterns[m_nPattern].GetpModCommand(endRow, chan);
UINT startRowCmd, endRowCmd;
- if(colType == EFFECT_COLUMN && (startRowMC.note == NOTE_PC || startRowMC.note == NOTE_PCS || endRowMC.note == NOTE_PC || endRowMC.note == NOTE_PCS))
+ if(colType == EFFECT_COLUMN && (startRowMC.IsPcNote() || endRowMC.IsPcNote()))
return true;
switch (colType) {
Modified: trunk/OpenMPT/mptrack/View_pat.h
===================================================================
--- trunk/OpenMPT/mptrack/View_pat.h 2010-02-28 18:23:21 UTC (rev 513)
+++ trunk/OpenMPT/mptrack/View_pat.h 2010-03-05 19:41:15 UTC (rev 514)
@@ -33,7 +33,8 @@
// Row Spacing
#define MAX_SPACING 64
-enum {
+enum PatternColumns
+{
NOTE_COLUMN=0,
INST_COLUMN,
VOL_COLUMN,
@@ -300,6 +301,7 @@
afx_msg LRESULT OnCustomKeyMsg(WPARAM, LPARAM); //rewbs.customKeys
afx_msg void OnClearSelectionFromMenu();
afx_msg void OnSelectInstrument(UINT nid);
+ afx_msg void OnSelectPCNoteParam(UINT nid);
afx_msg void OnRunScript();
afx_msg void OnShowTimeAtRow();
afx_msg void OnRenameChannel();
@@ -338,14 +340,14 @@
UINT GetSelectionEndRow();
UINT GetSelectionStartChan();
UINT GetSelectionEndChan();
- UINT ListChansWhereColSelected(UINT colType, CArray<UINT,UINT> &chans);
+ UINT ListChansWhereColSelected(PatternColumns colType, CArray<UINT,UINT> &chans);
static ROWINDEX GetRowFromCursor(DWORD cursor);
static CHANNELINDEX GetChanFromCursor(DWORD cursor);
static UINT GetColTypeFromCursor(DWORD cursor);
- bool IsInterpolationPossible(UINT startRow, UINT endRow, UINT chan, UINT colType, CSoundFile* pSndFile);
- void Interpolate(UINT type);
+ bool IsInterpolationPossible(UINT startRow, UINT endRow, UINT chan, PatternColumns colType, CSoundFile* pSndFile);
+ void Interpolate(PatternColumns type);
// Return true if recording live (i.e. editing while following playback).
// rSndFile must be the CSoundFile object of given rModDoc.
Modified: trunk/OpenMPT/mptrack/dlg_misc.h
===================================================================
--- trunk/OpenMPT/mptrack/dlg_misc.h 2010-02-28 18:23:21 UTC (rev 513)
+++ trunk/OpenMPT/mptrack/dlg_misc.h 2010-03-05 19:41:15 UTC (rev 514)
@@ -271,7 +271,7 @@
public:
CPageEditVolume(CModDoc *pModDoc, CEditCommand *parent):CPageEditCommand(pModDoc, parent, IDD_PAGEEDITVOLUME) {}
- void Init(MODCOMMAND &m) { m_nVolCmd = m.volcmd; m_nVolume = m.vol; m_bIsParamControl = (m.note == NOTE_PC || m.note == NOTE_PCS) ? true : false;}
+ void Init(MODCOMMAND &m) { m_nVolCmd = m.volcmd; m_nVolume = m.vol; m_bIsParamControl = (m.IsPcNote()) ? true : false;}
void UpdateDialog();
void UpdateRanges();
@@ -303,7 +303,7 @@
CPageEditEffect(CModDoc *pModDoc, CEditCommand *parent):CPageEditCommand(pModDoc, parent, IDD_PAGEEDITEFFECT) {}
// -> CODE#0010
// -> DESC="add extended parameter mechanism to pattern effects"
- void Init(MODCOMMAND &m) { m_nCommand = m.command; m_nParam = m.param; m_pModcommand = &m; m_bIsParamControl = (m.note == NOTE_PC || m.note == NOTE_PCS) ? true : false; m_nPlugin = m.instr; m_nPluginParam = MODCOMMAND::GetValueVolCol(m.volcmd, m.vol);}
+ void Init(MODCOMMAND &m) { m_nCommand = m.command; m_nParam = m.param; m_pModcommand = &m; m_bIsParamControl = (m.IsPcNote()) ? true : false; m_nPlugin = m.instr; m_nPluginParam = MODCOMMAND::GetValueVolCol(m.volcmd, m.vol);}
void XInit(UINT xparam = 0, UINT multiplier = 1) { m_nXParam = xparam; m_nMultiplier = multiplier; }
// -! NEW_FEATURE#0010
void UpdateDialog();
Modified: trunk/OpenMPT/soundlib/Load_it.cpp
===================================================================
--- trunk/OpenMPT/soundlib/Load_it.cpp 2010-02-28 18:23:21 UTC (rev 513)
+++ trunk/OpenMPT/soundlib/Load_it.cpp 2010-03-05 19:41:15 UTC (rev 514)
@@ -2144,7 +2144,7 @@
for (UINT ch=0; ch<m_nChannels; ch++, m++)
{
// Skip mptm-specific notes.
- if(GetType() == MOD_TYPE_MPT && (m->note == NOTE_PC || m->note == NOTE_PCS))
+ if(GetType() == MOD_TYPE_MPT && (m->IsPcNote()))
{bNeedsMptPatSave = true; continue;}
BYTE b = 0;
Modified: trunk/OpenMPT/soundlib/Sndfile.cpp
===================================================================
--- trunk/OpenMPT/soundlib/Sndfile.cpp 2010-02-28 18:23:21 UTC (rev 513)
+++ trunk/OpenMPT/soundlib/Sndfile.cpp 2010-03-05 19:41:15 UTC (rev 514)
@@ -3317,7 +3317,7 @@
// Convert param control, extended envelope control
if(oldTypeIsMPT)
{
- if(m->note == NOTE_PC || m->note == NOTE_PCS)
+ if(m->IsPcNote())
{
m->param = (BYTE)(min(MODCOMMAND::maxColumnValue, m->GetValueEffectCol()) * 0x7F / MODCOMMAND::maxColumnValue);
m->command = (m->note == NOTE_PC) ? CMD_MIDI : CMD_SMOOTHMIDI; // might be removed later
Modified: trunk/OpenMPT/soundlib/pattern.cpp
===================================================================
--- trunk/OpenMPT/soundlib/pattern.cpp 2010-02-28 18:23:21 UTC (rev 513)
+++ trunk/OpenMPT/soundlib/pattern.cpp 2010-03-05 19:41:15 UTC (rev 514)
@@ -328,7 +328,7 @@
const MODCOMMAND m = *pat.GetpModCommand(r, c);
// Writing only commands not writting in IT-pattern writing:
// For now this means only NOTE_PC and NOTE_PCS.
- if(m.note != NOTE_PCS && m.note != NOTE_PC)
+ if(!m.IsPcNote())
continue;
uint8 diffmask = CreateDiffMask(lastChnMC[c], m);
uint8 chval = static_cast<uint8>(c+1);
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <sag...@us...> - 2010-02-28 18:23:31
|
Revision: 513
http://modplug.svn.sourceforge.net/modplug/?rev=513&view=rev
Author: saga-games
Date: 2010-02-28 18:23:21 +0000 (Sun, 28 Feb 2010)
Log Message:
-----------
[New] VST/Instrument handling: The IT instrument note mapping is now also applied to VST instruments (before, it was just available for samples). This way, VST instruments can be transposed easily.
[Ref] Small portions of refactoring.
Modified Paths:
--------------
trunk/OpenMPT/mptrack/Moddoc.cpp
trunk/OpenMPT/soundlib/Snd_fx.cpp
trunk/OpenMPT/soundlib/Sndmix.cpp
Modified: trunk/OpenMPT/mptrack/Moddoc.cpp
===================================================================
--- trunk/OpenMPT/mptrack/Moddoc.cpp 2010-02-25 08:09:05 UTC (rev 512)
+++ trunk/OpenMPT/mptrack/Moddoc.cpp 2010-02-28 18:23:21 UTC (rev 513)
@@ -355,6 +355,7 @@
m_SndFile.ChangeModTypeTo(MOD_TYPE_S3M);
break;
case MOD_TYPE_PSM:
+ case MOD_TYPE_ULT:
default:
m_SndFile.ChangeModTypeTo(MOD_TYPE_IT);
}
@@ -793,7 +794,7 @@
if ((!pMainFrm) || (!note)) return FALSE;
if (nVol > 256) nVol = 256;
- if (note < 128)
+ if (note <= NOTE_MAX)
{
BEGIN_CRITICAL();
@@ -923,7 +924,7 @@
if ((nPlugin) && (nPlugin <= MAX_MIXPLUGINS))
{
IMixPlugin *pPlugin = m_SndFile.m_MixPlugins[nPlugin-1].pMixPlugin;
- if (pPlugin) pPlugin->MidiCommand(pIns->nMidiChannel, pIns->nMidiProgram, pIns->wMidiBank, note, pChn->nVolume, MAX_BASECHANNELS);
+ if (pPlugin) pPlugin->MidiCommand(pIns->nMidiChannel, pIns->nMidiProgram, pIns->wMidiBank, pIns->NoteMap[note - 1], pChn->nVolume, MAX_BASECHANNELS);
//if (pPlugin) pPlugin->MidiCommand(pIns->nMidiChannel, pIns->nMidiProgram, pIns->wMidiBank, note, pChn->GetVSTVolume(), MAX_BASECHANNELS);
}
}
@@ -950,13 +951,13 @@
BOOL CModDoc::NoteOff(UINT note, BOOL bFade, UINT nins, UINT nCurrentChn) //rewbs.vstiLive: added chan and nins
-//--------------------------------------------------------------------------
+//-----------------------------------------------------------------------
{
BEGIN_CRITICAL();
-
//rewbs.vstiLive
- if (nins>0 && nins<=m_SndFile.m_nInstruments) {
+ if((nins > 0) && (nins <= m_SndFile.m_nInstruments) && (note >= NOTE_MIN) && (note <= NOTE_MAX))
+ {
MODINSTRUMENT *pIns = m_SndFile.Instruments[nins];
if (pIns && pIns->nMidiChannel > 0 && pIns->nMidiChannel < 17) // instro sends to a midi chan
@@ -970,7 +971,7 @@
if ((nPlugin) && (nPlugin <= MAX_MIXPLUGINS))
{
IMixPlugin *pPlugin = m_SndFile.m_MixPlugins[nPlugin-1].pMixPlugin;
- if (pPlugin) pPlugin->MidiCommand(pIns->nMidiChannel, pIns->nMidiProgram, pIns->wMidiBank, note+NOTE_KEYOFF, 0, MAX_BASECHANNELS);
+ if (pPlugin) pPlugin->MidiCommand(pIns->nMidiChannel, pIns->nMidiProgram, pIns->wMidiBank, pIns->NoteMap[note - 1] + NOTE_KEYOFF, 0, MAX_BASECHANNELS);
}
}
@@ -1942,19 +1943,7 @@
m_SndFile.m_nMusicTempo, m_SndFile.m_nMusicSpeed, m_SndFile.m_nRowsPerBeat, bpm);
break;
}
-/*
- if (CMainFrame::m_dwPatternSetup & PATTERN_MODERNSPEED) {
- Message.Format("Using modern speed interpretation.\n\nAssuming:\n. %d ticks per second\n. %d ticks per row\n. %d rows per beat\nthe tempo is approximately: %.20g BPM",
- m_SndFile.m_nMusicTempo, m_SndFile.m_nMusicSpeed, CMainFrame::m_nRowSpacing2, bpm);
- }
- else if (CMainFrame::m_dwPatternSetup & PATTERN_ALTERNTIVEBPMSPEED) {
- Message.Format("Using alternative tempo interpretation.\n\nAssuming:\n. %d ticks per second\n. %d ticks per row\n. %d rows per beat\nthe tempo is approximately: %.20g BPM",
- m_SndFile.m_nMusicTempo, m_SndFile.m_nMusicSpeed, CMainFrame::m_nRowSpacing2, bpm);
- } else {
- Message.Format("Using standard tempo interpretation.\n\nAssuming:\n. A mod tempo (tick duration factor) of %d\n. %d ticks per row\n. %d rows per beat\nthe tempo is approximately: %.20g BPM",
- m_SndFile.m_nMusicTempo, m_SndFile.m_nMusicSpeed, CMainFrame::m_nRowSpacing2, bpm);
- }
- */
+
CMainFrame::GetMainFrame()->MessageBox(Message, NULL, MB_OK|MB_ICONINFORMATION);
}
@@ -2667,7 +2656,7 @@
case 0x30: // vibrato waveform
case 0x40: // tremolo waveform
case 0x50: // panbrello waveform
- if(((param & 0x0F) > 0x03) && m_SndFile.IsCompatibleMode(TRK_IMPULSETRACKER | TRK_SCREAMTRACKER))
+ if(((param & 0x0F) > 0x03) && m_SndFile.IsCompatibleMode(TRK_IMPULSETRACKER))
{
strcpy(s, "ignore");
break;
Modified: trunk/OpenMPT/soundlib/Snd_fx.cpp
===================================================================
--- trunk/OpenMPT/soundlib/Snd_fx.cpp 2010-02-25 08:09:05 UTC (rev 512)
+++ trunk/OpenMPT/soundlib/Snd_fx.cpp 2010-02-28 18:23:21 UTC (rev 513)
@@ -453,18 +453,6 @@
return dwElapsedTime / 1000.0;
- /*
-// -> CODE#0022
-// -> DESC="alternative BPM/Speed interpretation method"
-// return (UINT)((dwElapsedTime+500.0) / 1000.0);
-// if(CMainFrame::m_dwPatternSetup & PATTERN_ALTERNTIVEBPMSPEED) {
- if (m_nTempoMode == tempo_mode_alternative) {
- return (UINT)((dwElapsedTime + 1000.0) / 1000.0);
- } else {
- return (UINT)((dwElapsedTime + 500.0) / 1000.0);
- }
-// -! NEW_FEATURE#0022
- */
}
@@ -485,7 +473,7 @@
if ((pIns) && (note) && (note <= 128))
{
- if (pIns->NoteMap[note-1] >= 0xFE) return;
+ if (pIns->NoteMap[note-1] >= NOTE_MIN_SPECIAL) return;
UINT n = pIns->Keyboard[note-1];
pSmp = ((n) && (n < MAX_SAMPLES)) ? &Samples[n] : NULL;
} else
@@ -1050,7 +1038,7 @@
//switch off duplicated note played on this plugin
IMixPlugin *pPlugin = m_MixPlugins[pHeader->nMixPlug-1].pMixPlugin;
if (pPlugin && p->nNote)
- pPlugin->MidiCommand(p->pModInstrument->nMidiChannel, p->pModInstrument->nMidiProgram, p->pModInstrument->wMidiBank, p->nNote+NOTE_KEYOFF, 0, i);
+ pPlugin->MidiCommand(p->pModInstrument->nMidiChannel, p->pModInstrument->nMidiProgram, p->pModInstrument->wMidiBank, p->nNote + NOTE_KEYOFF, 0, i);
break;
}
}
@@ -1264,7 +1252,7 @@
if(IsCompatibleMode(TRK_IMPULSETRACKER))
nStartTick = 1;
//ST3 ignores notes with SD0 completely
- else if(GetType() & MOD_TYPE_S3M)
+ else if(GetType() == MOD_TYPE_S3M)
nStartTick = m_nMusicSpeed;
}
@@ -2249,7 +2237,8 @@
//----------------------------------------------------------------
{
BYTE x, y;
- if (m_dwSongFlags & SONG_FIRSTTICK) {
+ if (m_dwSongFlags & SONG_FIRSTTICK)
+ {
x = param & 0xf0;
if (x)
pChn->nNoteSlideSpeed = (x >> 4);
@@ -2257,13 +2246,15 @@
if (y)
pChn->nNoteSlideStep = y;
pChn->nNoteSlideCounter = pChn->nNoteSlideSpeed;
- } else {
- if (--pChn->nNoteSlideCounter == 0) {
- pChn->nNoteSlideCounter = pChn->nNoteSlideSpeed;
- // update it
- pChn->nPeriod = GetPeriodFromNote
- (sign * pChn->nNoteSlideStep + GetNoteFromPeriod(pChn->nPeriod), 8363, 0);
- }
+ } else
+ {
+ if (--pChn->nNoteSlideCounter == 0)
+ {
+ pChn->nNoteSlideCounter = pChn->nNoteSlideSpeed;
+ // update it
+ pChn->nPeriod = GetPeriodFromNote
+ (sign * pChn->nNoteSlideStep + GetNoteFromPeriod(pChn->nPeriod), 8363, 0);
+ }
}
}
@@ -2289,7 +2280,7 @@
if(param)
pChn->nPortamentoSlide = param;
else
- if(pChn->nPortamentoSlide == NULL)
+ if(pChn->nPortamentoSlide == 0)
return;
@@ -3422,7 +3413,7 @@
if(IsCompatibleMode(TRK_IMPULSETRACKER))
nTick = 1;
// ST3 doesn't cut notes with SC0
- else if(m_nType & MOD_TYPE_S3M)
+ else if(m_nType == MOD_TYPE_S3M)
return;
}
@@ -3961,7 +3952,7 @@
void CSoundFile::PortamentoMPT(MODCHANNEL* pChn, int param)
-//----------------------------------------------------------------
+//---------------------------------------------------------
{
//Behavior: Modifies portamento by param-steps on every tick.
//Note that step meaning depends on tuning.
@@ -3972,7 +3963,7 @@
void CSoundFile::PortamentoFineMPT(MODCHANNEL* pChn, int param)
-//-------------------------------------------------------------------
+//-------------------------------------------------------------
{
//Behavior: Divides portamento change between ticks/row. For example
//if Ticks/row == 6, and param == +-6, portamento goes up/down by one tuning-dependent
Modified: trunk/OpenMPT/soundlib/Sndmix.cpp
===================================================================
--- trunk/OpenMPT/soundlib/Sndmix.cpp 2010-02-25 08:09:05 UTC (rev 512)
+++ trunk/OpenMPT/soundlib/Sndmix.cpp 2010-02-28 18:23:21 UTC (rev 513)
@@ -665,12 +665,14 @@
}
}
+#ifdef MODPLUG_TRACKER
if(CMainFrame::GetMainFrame())
{
- // If channel resetting is disabled, we will emulate a pattern break
+ // If channel resetting is disabled in MPT, we will emulate a pattern break
if(!(CMainFrame::GetMainFrame()->m_dwPatternSetup & PATTERN_RESETCHANNELS))
m_dwSongFlags |= SONG_BREAKTOROW;
}
+#endif
if (!nRestartPosOverride && !(m_dwSongFlags & SONG_BREAKTOROW))
{
@@ -1983,9 +1985,11 @@
if(GetModFlag(MSF_MIDICC_BUGEMULATION))
{
- if (note) {
- pPlugin->MidiCommand(pIns->nMidiChannel, pIns->nMidiProgram, pIns->wMidiBank, note, pChn->nVolume, nChn);
- } else if (volcmd == VOLCMD_VOLUME) {
+ if((note >= NOTE_MIN) && (note <= NOTE_MAX))
+ {
+ pPlugin->MidiCommand(pIns->nMidiChannel, pIns->nMidiProgram, pIns->wMidiBank, pIns->NoteMap[note - 1], pChn->nVolume, nChn);
+ } else if (volcmd == VOLCMD_VOLUME)
+ {
pPlugin->MidiCC(pIns->nMidiChannel, MIDICC_Volume_Fine, vol, nChn);
}
return;
@@ -2007,7 +2011,10 @@
break;
}
- pPlugin->MidiCommand(pIns->nMidiChannel, pIns->nMidiProgram, pIns->wMidiBank, note, velocity, nChn);
+ MODCOMMAND::NOTE realNote = note;
+ if((note >= NOTE_MIN) && (note <= NOTE_MAX))
+ realNote = pIns->NoteMap[note - 1];
+ pPlugin->MidiCommand(pIns->nMidiChannel, pIns->nMidiProgram, pIns->wMidiBank, realNote, velocity, nChn);
}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <sag...@us...> - 2010-02-25 08:09:12
|
Revision: 512
http://modplug.svn.sourceforge.net/modplug/?rev=512&view=rev
Author: saga-games
Date: 2010-02-25 08:09:05 +0000 (Thu, 25 Feb 2010)
Log Message:
-----------
[Imp] Installer: With the new version of InnoSetup, a "real" portable setup can now finally be created.
[Ref] More verbose description of the new song length detection code
Modified Paths:
--------------
trunk/OpenMPT/installer/install.iss
trunk/OpenMPT/soundlib/Snd_fx.cpp
Modified: trunk/OpenMPT/installer/install.iss
===================================================================
--- trunk/OpenMPT/installer/install.iss 2010-02-24 22:23:05 UTC (rev 511)
+++ trunk/OpenMPT/installer/install.iss 2010-02-25 08:09:05 UTC (rev 512)
@@ -21,14 +21,14 @@
SolidCompression=yes
WizardImageFile=install-big.bmp
WizardSmallImageFile=install-small.bmp
+CreateUninstallRegKey=not IsTaskSelected('portable')
;LicenseFile=license.txt
-;CreateUninstallRegKey=no
[Tasks]
; icons and install mode
Name: "desktopicon"; Description: "{cm:CreateDesktopIcon}"; GroupDescription: "{cm:AdditionalIcons}";
Name: "quicklaunchicon"; Description: "{cm:CreateQuickLaunchIcon}"; GroupDescription: "{cm:AdditionalIcons}"; Flags: unchecked
-Name: "portable"; Description: "Use program directory to store configuration in"; GroupDescription: "Options:"; Flags: unchecked
+Name: "portable"; Description: "Portable mode (use program folder for storing settings, no registry changes)"; GroupDescription: "Options:"; Flags: unchecked
Name: "vst_scan"; Description: "Scan for previously installed VST plugins"; GroupDescription: "Options:"; Flags: unchecked
; file associations - put this below all other [tasks]!
#include "filetypes.iss"
@@ -141,3 +141,4 @@
end;
#include "vst_scan.iss"
+
Modified: trunk/OpenMPT/soundlib/Snd_fx.cpp
===================================================================
--- trunk/OpenMPT/soundlib/Snd_fx.cpp 2010-02-24 22:23:05 UTC (rev 511)
+++ trunk/OpenMPT/soundlib/Snd_fx.cpp 2010-02-25 08:09:05 UTC (rev 512)
@@ -119,10 +119,10 @@
the song length (or found out that a given point of the module cannot be reached).
The concept is actually very simple: Store a boolean value for every row for every possible orderlist item.
To save some memory, I have decided to actually store 8 row flags in one uint8 item, to save some
- space.
- As the modplug engine already deals with pattern loops sufficiently, there's no problem with (infinite) loops
+ space. Hence, there's some funky bit-shifting here and there.
+ As the modplug engine already deals with pattern loops sufficiently, there's no problem with (infinite) pattern loops
in this code. However, if you're going to use this idea somewhere else, bare in mind that rows inside pattern loops
- should only be evaluated once, or else the algorithm will cancel!
+ should only be evaluated once, or else the algorithm will cancel too early!
*/
vector<vector<uint8> > visited_rows;
visited_rows.resize(Order.GetLengthTailTrimmed());
@@ -136,7 +136,7 @@
// (f.e. if a pattern has 7 rows, we actually need another row so it's 8 rows = 1 byte - got it? ;)
if(nSize & 7)
nSize += 8;
- nSize >>= 3;
+ nSize >>= 3; // 2^3 elements per vector unit!
visited_rows[nOrd].resize(nSize, 0);
}
@@ -186,13 +186,13 @@
// Detect backward loop (or more general: if this row has been visited before)
size_t row_slot = nRow >> 3;
- uint8 row_value = 1 << (nRow & 7);
+ uint8 row_mask = 1 << (nRow & 7);
// This should always be true - but who knows what different parts of the program could modify the patterns and orders while this test is running?
if(nCurrentPattern < visited_rows.size() && row_slot < visited_rows[nCurrentPattern].size())
{
- if((visited_rows[nCurrentPattern][row_slot] & row_value) != 0)
- break; // we visited this row already
- visited_rows[nCurrentPattern][row_slot] |= row_value;
+ if((visited_rows[nCurrentPattern][row_slot] & row_mask) != 0)
+ break; // we visited this row already - this module must be looping.
+ visited_rows[nCurrentPattern][row_slot] |= row_mask;
}
// Update next position
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <sag...@us...> - 2010-02-24 23:10:37
|
Revision: 511
http://modplug.svn.sourceforge.net/modplug/?rev=511&view=rev
Author: saga-games
Date: 2010-02-24 22:23:05 +0000 (Wed, 24 Feb 2010)
Log Message:
-----------
[Fix] Song Length Detection: *Much* more accurate song length detection! The new algorithm is explained in the code. Got rid of those evil GOTOs, wohoo!
[Fix] MPTHacks.cpp: Some IT Sxx effects (f.e. SBx) were erroneously recognized as MPT hacks.
[Fix] Mod Specs: Fixed the XM specs a bit so that they don't interfere with MPTHacks.cpp
Modified Paths:
--------------
trunk/OpenMPT/mptrack/MPTHacks.cpp
trunk/OpenMPT/soundlib/Snd_fx.cpp
trunk/OpenMPT/soundlib/mod_specifications.h
Modified: trunk/OpenMPT/mptrack/MPTHacks.cpp
===================================================================
--- trunk/OpenMPT/mptrack/MPTHacks.cpp 2010-02-24 17:05:58 UTC (rev 510)
+++ trunk/OpenMPT/mptrack/MPTHacks.cpp 2010-02-24 22:23:05 UTC (rev 511)
@@ -68,7 +68,7 @@
}
} else if(type == MOD_TYPE_IT) // modplug IT extensions
{
- if(m.command == CMD_S3MCMDEX && (m.param & 0x90) != 0 && m.param != 0x91)
+ if((m.command == CMD_S3MCMDEX) && ((m.param >> 4) == 0x09) && (m.param != 0x91))
{
*foundHacks = true;
if(autofix)
Modified: trunk/OpenMPT/soundlib/Snd_fx.cpp
===================================================================
--- trunk/OpenMPT/soundlib/Snd_fx.cpp 2010-02-24 17:05:58 UTC (rev 510)
+++ trunk/OpenMPT/soundlib/Snd_fx.cpp 2010-02-24 22:23:05 UTC (rev 511)
@@ -114,6 +114,32 @@
nPattern = Order[0];
nRow = nNextRow = 0;
+ /* Now, some fun code begins: This will determine if a specific row in a pattern (orderlist item)
+ has been visited before. This way, we can tell when the module starts to loop, i.e. when we have determined
+ the song length (or found out that a given point of the module cannot be reached).
+ The concept is actually very simple: Store a boolean value for every row for every possible orderlist item.
+ To save some memory, I have decided to actually store 8 row flags in one uint8 item, to save some
+ space.
+ As the modplug engine already deals with pattern loops sufficiently, there's no problem with (infinite) loops
+ in this code. However, if you're going to use this idea somewhere else, bare in mind that rows inside pattern loops
+ should only be evaluated once, or else the algorithm will cancel!
+ */
+ vector<vector<uint8> > visited_rows;
+ visited_rows.resize(Order.GetLengthTailTrimmed());
+ for(ORDERINDEX nOrd = 0; nOrd < Order.GetLengthTailTrimmed(); nOrd++)
+ {
+ PATTERNINDEX nPat = Order[nOrd];
+ ROWINDEX nSize = 0;
+ if(Patterns.IsValidPat(nPat))
+ nSize = Patterns[nPat].GetNumRows();
+ // as we need one vector unit per 8 rows, we will probably have to add some non-existing rows
+ // (f.e. if a pattern has 7 rows, we actually need another row so it's 8 rows = 1 byte - got it? ;)
+ if(nSize & 7)
+ nSize += 8;
+ nSize >>= 3;
+ visited_rows[nOrd].resize(nSize, 0);
+ }
+
for (;;)
{
UINT nSpeedCount = 0;
@@ -121,7 +147,7 @@
nCurrentPattern = nNextPattern;
if(nCurrentPattern >= Order.size())
- goto EndMod;
+ break;
// Check if pattern is valid
nPattern = Order[nCurrentPattern];
@@ -133,26 +159,42 @@
// End of song ?
if ((nPattern == Order.GetInvalidPatIndex()) || (nCurrentPattern >= Order.size()))
{
- goto EndMod;
+ nCurrentPattern = m_nRestartPos;
} else
{
nCurrentPattern++;
- nPattern = (nCurrentPattern < Order.size()) ? Order[nCurrentPattern] : Order.GetInvalidPatIndex();
}
+ nPattern = (nCurrentPattern < Order.size()) ? Order[nCurrentPattern] : Order.GetInvalidPatIndex();
nNextPattern = nCurrentPattern;
}
- // Weird stuff?
- if ((nPattern >= Patterns.Size()) || (!Patterns[nPattern])) break;
+ // Skip non-existing patterns
+ if ((nPattern >= Patterns.Size()) || (!Patterns[nPattern]))
+ {
+ nNextPattern = nCurrentPattern + 1;
+ continue;
+ }
// Should never happen
- if (nRow >= PatternSize[nPattern]) nRow = 0;
+ if (nRow >= PatternSize[nPattern])
+ nRow = 0;
//Check whether target reached.
if(nCurrentPattern == endOrder && nRow == endRow)
{
targetReached = true;
- goto EndMod;
+ break;
}
+ // Detect backward loop (or more general: if this row has been visited before)
+ size_t row_slot = nRow >> 3;
+ uint8 row_value = 1 << (nRow & 7);
+ // This should always be true - but who knows what different parts of the program could modify the patterns and orders while this test is running?
+ if(nCurrentPattern < visited_rows.size() && row_slot < visited_rows[nCurrentPattern].size())
+ {
+ if((visited_rows[nCurrentPattern][row_slot] & row_value) != 0)
+ break; // we visited this row already
+ visited_rows[nCurrentPattern][row_slot] |= row_value;
+ }
+
// Update next position
nNextRow = nRow + 1;
@@ -163,7 +205,8 @@
}
if (!nRow)
{
- for (UINT ipck=0; ipck<m_nChannels; ipck++) patloop[ipck] = dwElapsedTime;
+ for(UINT ipck = 0; ipck < m_nChannels; ipck++)
+ patloop[ipck] = dwElapsedTime;
}
if (!bTotal)
{
@@ -177,6 +220,7 @@
break;
}
}
+
MODCHANNEL *pChn = Chn;
MODCOMMAND *p = Patterns[nPattern] + nRow * m_nChannels;
MODCOMMAND *nextRow = NULL;
@@ -208,7 +252,7 @@
case CMD_PATTERNBREAK:
patternBreakOnThisRow=true;
//Try to check next row for XPARAM
- nextRow = NULL;
+ nextRow = nullptr;
if (nRow < PatternSize[nPattern]-1) {
nextRow = Patterns[nPattern] + (nRow+1) * m_nChannels + nChn;
}
@@ -388,13 +432,8 @@
case tempo_mode_classic: default:
dwElapsedTime += (2500.0 * (double)nSpeedCount) / (double)nMusicTempo;
}
- //Detect backwards loop
- if (nNextPattern<nCurrentPattern
- || (nNextPattern==nCurrentPattern && nNextRow<=nRow)) {
- goto EndMod;
- }
}
-EndMod:
+
if ((bAdjust) && (!bTotal))
{
m_nGlobalVolume = nGlbVol;
@@ -2597,7 +2636,7 @@
case 0x10: pChn->dwFlags &= ~CHN_GLISSANDO; if (param) pChn->dwFlags |= CHN_GLISSANDO; break;
// S2x: Set FineTune
case 0x20: if(!(m_dwSongFlags & SONG_FIRSTTICK)) break;
- pChn->nC5Speed = S3MFineTuneTable[param & 0x0F];
+ pChn->nC5Speed = S3MFineTuneTable[param];
pChn->nFineTune = MOD2XMFineTune(param);
if (pChn->nPeriod) pChn->nPeriod = GetPeriodFromNote(pChn->nNote, pChn->nFineTune, pChn->nC5Speed);
break;
@@ -2702,7 +2741,7 @@
}
break;
// S9x: Sound Control
- case 0x90: ExtendedChannelEffect(pChn, param & 0x0F); break;
+ case 0x90: ExtendedChannelEffect(pChn, param); break;
// SAx: Set 64k Offset
case 0xA0: if(m_dwSongFlags & SONG_FIRSTTICK)
{
Modified: trunk/OpenMPT/soundlib/mod_specifications.h
===================================================================
--- trunk/OpenMPT/soundlib/mod_specifications.h 2010-02-24 17:05:58 UTC (rev 510)
+++ trunk/OpenMPT/soundlib/mod_specifications.h 2010-02-24 22:23:05 UTC (rev 511)
@@ -191,7 +191,7 @@
0, //Max sample filename length
22, //Max instrument name length
0, //Max instrument filename length
- 31, //SamplesMax (actually 16 per instrument)
+ 128 * 16, //SamplesMax (actually 16 per instrument)
128, //instrumentMax
mixLevels_original, //defaultMixLevels
0, //Max MIDI mapping directives
@@ -228,7 +228,7 @@
0, //Max sample filename length
22, //Max instrument name length
0, //Max instrument filename length
- 4000, //SamplesMax
+ 256 * 16, //SamplesMax (actually 16 per instrument)
256, //instrumentMax
mixLevels_117RC3, //defaultMixLevels
200, //Max MIDI mapping directives
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <sag...@us...> - 2010-02-24 17:06:07
|
Revision: 510
http://modplug.svn.sourceforge.net/modplug/?rev=510&view=rev
Author: saga-games
Date: 2010-02-24 17:05:58 +0000 (Wed, 24 Feb 2010)
Log Message:
-----------
[Fix] XM Loader: Early versions of Skale Tracker (R.I.P.) apparently did stupid things to XM instrument headers, so mpt failed to load such modules. Tested the fix with a few hundred XMs and apparently only one XM (IFULOVE.XM) that I have has a header size that is different from the struct size - and that's the one that caused problems.
Modified Paths:
--------------
trunk/OpenMPT/soundlib/Load_xm.cpp
Modified: trunk/OpenMPT/soundlib/Load_xm.cpp
===================================================================
--- trunk/OpenMPT/soundlib/Load_xm.cpp 2010-02-23 15:53:10 UTC (rev 509)
+++ trunk/OpenMPT/soundlib/Load_xm.cpp 2010-02-24 17:05:58 UTC (rev 510)
@@ -302,10 +302,11 @@
memset(samples_used, 0, sizeof(samples_used));
unused_samples = 0;
+
// Reading instruments
for (INSTRUMENTINDEX iIns = 1; iIns <= m_nInstruments; iIns++)
{
- XMINSTRUMENTHEADER *pih;
+ XMINSTRUMENTHEADER pih;
BYTE flags[32];
DWORD samplesize[32];
UINT samplemap[32];
@@ -315,17 +316,18 @@
DWORD ihsize = LittleEndian(*((DWORD *)(lpStream + dwMemPos)));
if (dwMemPos + ihsize >= dwMemLength) return true;
- pih = (XMINSTRUMENTHEADER *)(lpStream + dwMemPos);
- if (dwMemPos + LittleEndian(pih->size) > dwMemLength) return true;
+ memset(&pih, 0, sizeof(pih));
+ memcpy(&pih, lpStream + dwMemPos, min(sizeof(pih), ihsize));
+
if ((Instruments[iIns] = new MODINSTRUMENT) == nullptr) continue;
memcpy(Instruments[iIns], &m_defaultInstrument, sizeof(MODINSTRUMENT));
Instruments[iIns]->nPluginVelocityHandling = PLUGIN_VELOCITYHANDLING_CHANNEL;
Instruments[iIns]->nPluginVolumeHandling = PLUGIN_VOLUMEHANDLING_IGNORE;
- memcpy(Instruments[iIns]->name, pih->name, 22);
+ memcpy(Instruments[iIns]->name, pih.name, 22);
SpaceToNullStringFixed(Instruments[iIns]->name, 22);
- if ((nsamples = pih->samples) > 0)
+ if ((nsamples = pih.samples) > 0)
{
/* we have samples, so let's read the rest of this instrument
the header that is being read here is not the sample header, though,
@@ -353,19 +355,23 @@
if(xmsh.midichannel != 0 || xmsh.midienabled != 0 || xmsh.midiprogram != 0 || xmsh.mutecomputer != 0 || xmsh.pitchwheelrange != 0)
bIsFT2 = true; // definitely not MPT. (or any other tracker)
- dwMemPos += LittleEndian(pih->size);
+ dwMemPos += LittleEndian(pih.size);
} else
{
- if (LittleEndian(pih->size)) dwMemPos += LittleEndian(pih->size);
- else dwMemPos += sizeof(XMINSTRUMENTHEADER);
+ if (LittleEndian(pih.size))
+ dwMemPos += LittleEndian(pih.size);
+ else
+ dwMemPos += sizeof(XMINSTRUMENTHEADER);
continue;
}
+
memset(samplemap, 0, sizeof(samplemap));
if (nsamples > 32) return true;
UINT newsamples = m_nSamples;
- for (UINT nmap=0; nmap<nsamples; nmap++)
+
+ for (UINT nmap = 0; nmap < nsamples; nmap++)
{
- UINT n = m_nSamples+nmap+1;
+ UINT n = m_nSamples + nmap + 1;
if (n >= MAX_SAMPLES)
{
n = m_nSamples;
@@ -432,7 +438,7 @@
m_nSamples = newsamples;
// Reading Volume Envelope
MODINSTRUMENT *pIns = Instruments[iIns];
- pIns->nMidiProgram = pih->type;
+ pIns->nMidiProgram = pih.type;
pIns->nFadeOut = xmsh.volfade;
pIns->nPan = 128;
pIns->nPPC = 5*12;
@@ -497,11 +503,11 @@
{
if ((dwMemPos + sizeof(xmss) > dwMemLength)
|| (dwMemPos + xmsh.shsize > dwMemLength)) return true;
- memcpy(&xmss, lpStream+dwMemPos, sizeof(xmss));
+ memcpy(&xmss, lpStream + dwMemPos, sizeof(xmss));
xmss.samplen = LittleEndian(xmss.samplen);
xmss.loopstart = LittleEndian(xmss.loopstart);
xmss.looplen = LittleEndian(xmss.looplen);
- dwMemPos += xmsh.shsize;
+ dwMemPos += sizeof(XMSAMPLESTRUCT); // was: dwMemPos += xmsh.shsize; (this fixes IFULOVE.XM)
flags[ins] = (xmss.type & 0x10) ? RS_PCM16D : RS_PCM8D;
if (xmss.type & 0x20) flags[ins] = (xmss.type & 0x10) ? RS_STPCM16D : RS_STPCM8D;
samplesize[ins] = xmss.samplen;
@@ -665,6 +671,7 @@
// Check various things to find out whether this has been made with MPT.
// Null chars in names -> most likely made with MPT, which disguises as FT2
if (!memcmp((LPCSTR)lpStream + 0x26, "FastTracker v2.00 ", 20) && bProbablyMadeWithModPlug && !bIsFT2) bMadeWithModPlug = true;
+ if (memcmp((LPCSTR)lpStream + 0x26, "FastTracker v2.00 ", 20)) bMadeWithModPlug = false; // this could happen f.e. with (early?) versions of Sk@le
if (!memcmp((LPCSTR)lpStream + 0x26, "FastTracker v 2.00 ", 20))
{
// Early MPT 1.0 alpha/beta versions
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <sag...@us...> - 2010-02-23 15:53:19
|
Revision: 509
http://modplug.svn.sourceforge.net/modplug/?rev=509&view=rev
Author: saga-games
Date: 2010-02-23 15:53:10 +0000 (Tue, 23 Feb 2010)
Log Message:
-----------
[New] Instrument Editor: Envelope zooming. Might still look very weird (especially the first tick and around loop points). Includes two new keyboard shortcuts.
Modified Paths:
--------------
trunk/OpenMPT/mptrack/CommandSet.cpp
trunk/OpenMPT/mptrack/CommandSet.h
trunk/OpenMPT/mptrack/Mainfrm.h
trunk/OpenMPT/mptrack/View_ins.cpp
trunk/OpenMPT/mptrack/View_ins.h
trunk/OpenMPT/mptrack/res/envbar.bmp
trunk/OpenMPT/mptrack/resource.h
Modified: trunk/OpenMPT/mptrack/CommandSet.cpp
===================================================================
--- trunk/OpenMPT/mptrack/CommandSet.cpp 2010-02-22 20:53:09 UTC (rev 508)
+++ trunk/OpenMPT/mptrack/CommandSet.cpp 2010-02-23 15:53:10 UTC (rev 509)
@@ -2565,7 +2565,17 @@
commands[kcPatternEditPCNotePlugin].isDummy = false;
commands[kcPatternEditPCNotePlugin].Message = "Edit plugin assigned to PC note";
- #ifdef _DEBUG
+ commands[kcInstrumentEnvelopeZoomIn].UID = 1837;
+ commands[kcInstrumentEnvelopeZoomIn].isHidden = false;
+ commands[kcInstrumentEnvelopeZoomIn].isDummy = false;
+ commands[kcInstrumentEnvelopeZoomIn].Message = "Zoom In";
+
+ commands[kcInstrumentEnvelopeZoomOut].UID = 1838;
+ commands[kcInstrumentEnvelopeZoomOut].isHidden = false;
+ commands[kcInstrumentEnvelopeZoomOut].isDummy = false;
+ commands[kcInstrumentEnvelopeZoomOut].Message = "Zoom Out";
+
+#ifdef _DEBUG
for (int i=0; i<kcNumCommands; i++) {
if (commands[i].UID != 0) { // ignore unset UIDs
for (int j=i+1; j<kcNumCommands; j++) {
Modified: trunk/OpenMPT/mptrack/CommandSet.h
===================================================================
--- trunk/OpenMPT/mptrack/CommandSet.h 2010-02-22 20:53:09 UTC (rev 508)
+++ trunk/OpenMPT/mptrack/CommandSet.h 2010-02-23 15:53:10 UTC (rev 509)
@@ -550,6 +550,8 @@
kcInstrumentLoad=kcStartInstrumentMisc,
kcInstrumentSave,
kcInstrumentNew,
+ kcInstrumentEnvelopeZoomIn,
+ kcInstrumentEnvelopeZoomOut,
kcInstrumentEnvelopePointPrev,
kcInstrumentEnvelopePointNext,
kcInstrumentEnvelopePointMoveLeft,
Modified: trunk/OpenMPT/mptrack/Mainfrm.h
===================================================================
--- trunk/OpenMPT/mptrack/Mainfrm.h 2010-02-22 20:53:09 UTC (rev 508)
+++ trunk/OpenMPT/mptrack/Mainfrm.h 2010-02-23 15:53:10 UTC (rev 509)
@@ -319,6 +319,10 @@
IIMAGE_NOFILTERSWITCH,
IIMAGE_SAMPLEMAP,
IIMAGE_GRID,
+ IIMAGE_ZOOMIN,
+ IIMAGE_NOZOOMIN,
+ IIMAGE_ZOOMOUT,
+ IIMAGE_NOZOOMOUT,
};
Modified: trunk/OpenMPT/mptrack/View_ins.cpp
===================================================================
--- trunk/OpenMPT/mptrack/View_ins.cpp 2010-02-22 20:53:09 UTC (rev 508)
+++ trunk/OpenMPT/mptrack/View_ins.cpp 2010-02-23 15:53:10 UTC (rev 509)
@@ -12,7 +12,9 @@
#include ".\view_ins.h"
#include "midi.h"
-#define ENV_ZOOM 4
+#define ENV_ZOOM 4.0f
+#define ENV_MIN_ZOOM 2.0f
+#define ENV_MAX_ZOOM 100.0f
#define ENV_DRAGLOOPSTART (MAX_ENVPOINTS + 1)
#define ENV_DRAGLOOPEND (MAX_ENVPOINTS + 2)
#define ENV_DRAGSUSTAINSTART (MAX_ENVPOINTS + 3)
@@ -45,6 +47,8 @@
ID_SEPARATOR,
ID_ENVELOPE_VIEWGRID, //rewbs.envRowGrid
ID_SEPARATOR,
+ ID_ENVELOPE_ZOOM_IN,
+ ID_ENVELOPE_ZOOM_OUT,
};
@@ -81,6 +85,8 @@
ON_COMMAND(ID_ENVELOPE_PITCH, OnEnvPitchChanged)
ON_COMMAND(ID_ENVELOPE_FILTER, OnEnvFilterChanged)
ON_COMMAND(ID_ENVELOPE_VIEWGRID, OnEnvToggleGrid) //rewbs.envRowGrid
+ ON_COMMAND(ID_ENVELOPE_ZOOM_IN, OnEnvZoomIn)
+ ON_COMMAND(ID_ENVELOPE_ZOOM_OUT, OnEnvZoomOut)
ON_COMMAND(ID_ENVSEL_VOLUME, OnSelectVolumeEnv)
ON_COMMAND(ID_ENVSEL_PANNING, OnSelectPanningEnv)
ON_COMMAND(ID_ENVSEL_PITCH, OnSelectPitchEnv)
@@ -118,7 +124,7 @@
m_GridScrollPos = -1;
//end rewbs.envRowGrid
m_nDragItem = 1;
-
+ m_fZoom = ENV_ZOOM;
}
@@ -142,9 +148,9 @@
SIZE sizeTotal, sizePage, sizeLine;
UINT ntickmax = EnvGetTick(EnvGetLastPoint());
- sizeTotal.cx = (ntickmax + 2) * ENV_ZOOM;
+ sizeTotal.cx = (INT)((ntickmax + 2) * m_fZoom);
sizeTotal.cy = 1;
- sizeLine.cx = ENV_ZOOM;
+ sizeLine.cx = (INT)m_fZoom;
sizeLine.cy = 2;
sizePage.cx = sizeLine.cx * 4;
sizePage.cy = sizeLine.cy;
@@ -625,7 +631,7 @@
int CViewInstrument::TickToScreen(int nTick) const
//------------------------------------------------
{
- return ((nTick+1) * ENV_ZOOM) - GetScrollPos(SB_HORZ);
+ return ((int)((nTick + 1) * m_fZoom)) - GetScrollPos(SB_HORZ);
}
int CViewInstrument::PointToScreen(int nPoint) const
@@ -638,14 +644,14 @@
int CViewInstrument::ScreenToTick(int x) const
//--------------------------------------------
{
- return (GetScrollPos(SB_HORZ) + x + 1 - ENV_ZOOM) / ENV_ZOOM;
+ return (int)(((float)GetScrollPos(SB_HORZ) + (float)x + 1 - m_fZoom) / m_fZoom);
}
int CViewInstrument::QuickScreenToTick(int x, int cachedScrollPos) const
//----------------------------------------------------------------------
{
- return (cachedScrollPos + x + 1 - ENV_ZOOM) / ENV_ZOOM;
+ return (int)(((float)cachedScrollPos + (float)x + 1 - m_fZoom) / m_fZoom);
}
int CViewInstrument::ScreenToValue(int y) const
@@ -745,6 +751,8 @@
case ID_ENVELOPE_FILTER: if (!(pSndFile->m_nType & (MOD_TYPE_IT|MOD_TYPE_MPT))) dwStyle |= NCBTNS_DISABLED; else
if (EnvGetFilterEnv()) dwStyle |= NCBTNS_CHECKED; break;
case ID_ENVELOPE_VIEWGRID: if (m_bGrid) dwStyle |= NCBTNS_CHECKED; break;
+ case ID_ENVELOPE_ZOOM_IN: if (m_fZoom >= ENV_MAX_ZOOM) dwStyle |= NCBTNS_DISABLED; break;
+ case ID_ENVELOPE_ZOOM_OUT: if (m_fZoom <= ENV_MIN_ZOOM) dwStyle |= NCBTNS_DISABLED; break;
}
if (m_nBtnMouseOver == i)
{
@@ -884,10 +892,10 @@
// Drawing Loop Start/End
if (EnvGetLoop())
{
- int x1 = PointToScreen(EnvGetLoopStart()) - (ENV_ZOOM/2);
+ int x1 = PointToScreen(EnvGetLoopStart()) - (int)(m_fZoom / 2);
m_dcMemMain.MoveTo(x1, 0);
m_dcMemMain.LineTo(x1, m_rcClient.bottom);
- int x2 = PointToScreen(EnvGetLoopEnd()) + (ENV_ZOOM/2);
+ int x2 = PointToScreen(EnvGetLoopEnd()) + (int)(m_fZoom / 2);
m_dcMemMain.MoveTo(x2, 0);
m_dcMemMain.LineTo(x2, m_rcClient.bottom);
}
@@ -897,12 +905,12 @@
m_dcMemMain.SelectObject(CMainFrame::penHalfDarkGray);
int nspace = m_rcClient.bottom/4;
int n1 = EnvGetSustainStart();
- int x1 = PointToScreen(n1) - (ENV_ZOOM/2);
+ int x1 = PointToScreen(n1) - (int)(m_fZoom / 2);
int y1 = ValueToScreen(EnvGetValue(n1));
m_dcMemMain.MoveTo(x1, y1 - nspace);
m_dcMemMain.LineTo(x1, y1+nspace);
int n2 = EnvGetSustainEnd();
- int x2 = PointToScreen(n2) + (ENV_ZOOM/2);
+ int x2 = PointToScreen(n2) + (int)(m_fZoom / 2);
int y2 = ValueToScreen(EnvGetValue(n2));
m_dcMemMain.MoveTo(x2, y2-nspace);
m_dcMemMain.LineTo(x2, y2+nspace);
@@ -916,7 +924,7 @@
UINT releaseNode = EnvGetReleaseNode();
for (UINT i=0; i<=maxpoint; i++)
{
- int x = (EnvGetTick(i) + 1) * ENV_ZOOM - nScrollPos;
+ int x = (int)((EnvGetTick(i) + 1) * m_fZoom) - nScrollPos;
int y = ValueToScreen(EnvGetValue(i));
rect.left = x - 3;
rect.top = y - 3;
@@ -1222,6 +1230,8 @@
case ID_ENVELOPE_FILTER: nImage = (dwStyle & NCBTNS_DISABLED) ? IIMAGE_NOFILTERSWITCH : IIMAGE_FILTERSWITCH; break;
case ID_INSTRUMENT_SAMPLEMAP: nImage = IIMAGE_SAMPLEMAP; break;
case ID_ENVELOPE_VIEWGRID: nImage = IIMAGE_GRID; break;
+ case ID_ENVELOPE_ZOOM_IN: nImage = (dwStyle & NCBTNS_DISABLED) ? IIMAGE_NOZOOMIN : IIMAGE_ZOOMIN; break;
+ case ID_ENVELOPE_ZOOM_OUT: nImage = (dwStyle & NCBTNS_DISABLED) ? IIMAGE_NOZOOMOUT : IIMAGE_ZOOMOUT; break;
}
pDC->Draw3dRect(rect.left-1, rect.top-1, ENV_LEFTBAR_CXBTN+2, ENV_LEFTBAR_CYBTN+2, c3, c4);
pDC->Draw3dRect(rect.left, rect.top, ENV_LEFTBAR_CXBTN, ENV_LEFTBAR_CYBTN, c1, c2);
@@ -1467,12 +1477,12 @@
if (pt.x <= 0)
{
UpdateScrollSize();
- OnScrollBy(CSize(pt.x-ENV_ZOOM, 0), TRUE);
+ OnScrollBy(CSize(pt.x - (int)m_fZoom, 0), TRUE);
}
if (pt.x >= m_rcClient.right-1)
{
UpdateScrollSize();
- OnScrollBy(CSize(ENV_ZOOM+pt.x-m_rcClient.right, 0), TRUE);
+ OnScrollBy(CSize((int)m_fZoom + pt.x - m_rcClient.right, 0), TRUE);
}
pModDoc->SetModified();
pModDoc->UpdateAllViews(NULL, (m_nInstrument << HINT_SHIFT_INS) | HINT_ENVELOPE, NULL);
@@ -1487,7 +1497,7 @@
rect.top = ValueToScreen(EnvGetValue(EnvGetSustainStart())) - nspace;
rect.bottom = rect.top + nspace * 2;
rect.right = PointToScreen(EnvGetSustainStart()) + 1;
- rect.left = rect.right - ENV_ZOOM*2;
+ rect.left = rect.right - (int)(m_fZoom * 2);
if (rect.PtInRect(pt))
{
bSplitCursor = TRUE; // ENV_DRAGSUSTAINSTART;
@@ -1496,7 +1506,7 @@
rect.top = ValueToScreen(EnvGetValue(EnvGetSustainEnd())) - nspace;
rect.bottom = rect.top + nspace * 2;
rect.left = PointToScreen(EnvGetSustainEnd()) - 1;
- rect.right = rect.left + ENV_ZOOM*2;
+ rect.right = rect.left + (int)(m_fZoom *2);
if (rect.PtInRect(pt)) bSplitCursor = TRUE; // ENV_DRAGSUSTAINEND;
}
}
@@ -1505,14 +1515,14 @@
rect.top = m_rcClient.top;
rect.bottom = m_rcClient.bottom;
rect.right = PointToScreen(EnvGetLoopStart()) + 1;
- rect.left = rect.right - ENV_ZOOM*2;
+ rect.left = rect.right - (int)(m_fZoom * 2);
if (rect.PtInRect(pt))
{
bSplitCursor = TRUE; // ENV_DRAGLOOPSTART;
} else
{
rect.left = PointToScreen(EnvGetLoopEnd()) - 1;
- rect.right = rect.left + ENV_ZOOM*2;
+ rect.right = rect.left + (int)(m_fZoom * 2);
if (rect.PtInRect(pt)) bSplitCursor = TRUE; // ENV_DRAGLOOPEND;
}
}
@@ -1564,7 +1574,7 @@
rect.top = ValueToScreen(EnvGetValue(EnvGetSustainStart())) - nspace;
rect.bottom = rect.top + nspace * 2;
rect.right = PointToScreen(EnvGetSustainStart()) + 1;
- rect.left = rect.right - ENV_ZOOM*2;
+ rect.left = rect.right - (int)(m_fZoom * 2);
if (rect.PtInRect(pt))
{
m_nDragItem = ENV_DRAGSUSTAINSTART;
@@ -1573,7 +1583,7 @@
rect.top = ValueToScreen(EnvGetValue(EnvGetSustainEnd())) - nspace;
rect.bottom = rect.top + nspace * 2;
rect.left = PointToScreen(EnvGetSustainEnd()) - 1;
- rect.right = rect.left + ENV_ZOOM*2;
+ rect.right = rect.left + (int)(m_fZoom * 2);
if (rect.PtInRect(pt)) m_nDragItem = ENV_DRAGSUSTAINEND;
}
}
@@ -1582,14 +1592,14 @@
rect.top = m_rcClient.top;
rect.bottom = m_rcClient.bottom;
rect.right = PointToScreen(EnvGetLoopStart()) + 1;
- rect.left = rect.right - ENV_ZOOM * 2;
+ rect.left = rect.right - (int)(m_fZoom * 2);
if (rect.PtInRect(pt))
{
m_nDragItem = ENV_DRAGLOOPSTART;
} else
{
rect.left = PointToScreen(EnvGetLoopEnd()) - 1;
- rect.right = rect.left + ENV_ZOOM*2;
+ rect.right = rect.left + (int)(m_fZoom * 2);
if (rect.PtInRect(pt)) m_nDragItem = ENV_DRAGLOOPEND;
}
}
@@ -1813,7 +1823,7 @@
//rewbs.envRowGrid
void CViewInstrument::OnEnvToggleGrid()
-//----------------------------------------
+//-------------------------------------
{
m_bGrid = !m_bGrid;
if (m_bGrid)
@@ -1862,7 +1872,7 @@
void CViewInstrument::PlayNote(UINT note)
-//-----------------------------------------------------------------
+//---------------------------------------
{
CMainFrame *pMainFrm = CMainFrame::GetMainFrame();
CModDoc *pModDoc = GetDocument();
@@ -2187,6 +2197,8 @@
case kcInstrumentNew: SendCtrlMessage(IDC_INSTRUMENT_NEW); return wParam;
// envelope editor
+ case kcInstrumentEnvelopeZoomIn: OnEnvZoomIn(); return wParam;
+ case kcInstrumentEnvelopeZoomOut: OnEnvZoomOut(); return wParam;
case kcInstrumentEnvelopePointPrev: EnvKbdSelectPrevPoint(); return wParam;
case kcInstrumentEnvelopePointNext: EnvKbdSelectNextPoint(); return wParam;
case kcInstrumentEnvelopePointMoveLeft: EnvKbdMovePointLeft(); return wParam;
@@ -2242,6 +2254,17 @@
}
+void CViewInstrument::EnvSetZoom(float fNewZoom)
+//----------------------------------------------
+{
+ m_fZoom = fNewZoom;
+ Limit(m_fZoom, ENV_MIN_ZOOM, ENV_MAX_ZOOM);
+ InvalidateRect(NULL, FALSE);
+ UpdateScrollSize();
+ UpdateNcButtonState();
+}
+
+
////////////////////////////////////////
// Envelope Editor - Keyboard actions
Modified: trunk/OpenMPT/mptrack/View_ins.h
===================================================================
--- trunk/OpenMPT/mptrack/View_ins.h 2010-02-22 20:53:09 UTC (rev 508)
+++ trunk/OpenMPT/mptrack/View_ins.h 2010-02-23 15:53:10 UTC (rev 509)
@@ -6,7 +6,7 @@
#define INSSTATUS_SPLITCURSOR 0x04
// Non-Client toolbar buttons
-#define ENV_LEFTBAR_BUTTONS 17
+#define ENV_LEFTBAR_BUTTONS 19
//==========================================
class CViewInstrument: public CModScrollView
@@ -34,6 +34,8 @@
CDC m_dcMemMain;
CBitmap m_bmpMemMain;
CBitmap* oldBitmap;
+
+ float m_fZoom;
//rewbs.envRowGrid
public:
@@ -133,6 +135,10 @@
void PlayNote(UINT note); //rewbs.customKeys
void DrawGrid(CDC *memDC, UINT speed); //rewbs.envRowGrid
+ void OnEnvZoomIn() { EnvSetZoom(m_fZoom + 1); };
+ void OnEnvZoomOut() { EnvSetZoom(m_fZoom - 1); };
+ void EnvSetZoom(float fNewZoom);
+
public:
//{{AFX_VIRTUAL(CViewInstrument)
virtual void OnDraw(CDC *);
Modified: trunk/OpenMPT/mptrack/res/envbar.bmp
===================================================================
(Binary files differ)
Modified: trunk/OpenMPT/mptrack/resource.h
===================================================================
--- trunk/OpenMPT/mptrack/resource.h 2010-02-22 20:53:09 UTC (rev 508)
+++ trunk/OpenMPT/mptrack/resource.h 2010-02-23 15:53:10 UTC (rev 509)
@@ -1203,6 +1203,8 @@
#define ID_NOTEMAP_TRANS_UP 60446
#define ID_NOTEMAP_TRANS_DOWN 60447
#define ID_PATTERN_EDIT_PCNOTE_PLUGIN 60448
+#define ID_ENVELOPE_ZOOM_IN 60449
+#define ID_ENVELOPE_ZOOM_OUT 60450
// Next default values for new objects
//
@@ -1210,7 +1212,7 @@
#ifndef APSTUDIO_READONLY_SYMBOLS
#define _APS_3D_CONTROLS 1
#define _APS_NEXT_RESOURCE_VALUE 526
-#define _APS_NEXT_COMMAND_VALUE 60449
+#define _APS_NEXT_COMMAND_VALUE 60451
#define _APS_NEXT_CONTROL_VALUE 2427
#define _APS_NEXT_SYMED_VALUE 901
#endif
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <sag...@us...> - 2010-02-22 20:53:16
|
Revision: 508
http://modplug.svn.sourceforge.net/modplug/?rev=508&view=rev
Author: saga-games
Date: 2010-02-22 20:53:09 +0000 (Mon, 22 Feb 2010)
Log Message:
-----------
[Fix] Pattern Editor: Now, plugin slot 100 can also be automated using PC Notes.
[Fix] Instrument Editor: It was impossible to assign plugin slot 100 to an instrument.
Modified Paths:
--------------
trunk/OpenMPT/mptrack/Ctrl_ins.cpp
trunk/OpenMPT/mptrack/View_pat.cpp
Modified: trunk/OpenMPT/mptrack/Ctrl_ins.cpp
===================================================================
--- trunk/OpenMPT/mptrack/Ctrl_ins.cpp 2010-02-22 00:21:17 UTC (rev 507)
+++ trunk/OpenMPT/mptrack/Ctrl_ins.cpp 2010-02-22 20:53:09 UTC (rev 508)
@@ -1174,7 +1174,7 @@
} else {
m_CbnMidiCh.SetCurSel(0);
}
- if (pIns->nMixPlug < MAX_MIXPLUGINS) {
+ if (pIns->nMixPlug <= MAX_MIXPLUGINS) {
m_CbnMixPlug.SetCurSel(pIns->nMixPlug);
} else {
m_CbnMixPlug.SetCurSel(0);
@@ -2027,7 +2027,7 @@
//---------------------------------------
{
MODINSTRUMENT *pIns = m_pSndFile->Instruments[m_nInstrument];
- BYTE nPlug = static_cast<BYTE>(m_CbnMixPlug.GetItemData(m_CbnMixPlug.GetCurSel()) & 0xff);
+ PLUGINDEX nPlug = static_cast<PLUGINDEX>(m_CbnMixPlug.GetItemData(m_CbnMixPlug.GetCurSel()) & 0xff); // TODO is the 0xFF necessary?
if (pIns)
{
@@ -2042,7 +2042,7 @@
m_CbnPluginVolumeHandling.EnableWindow();
}
- if (nPlug>=0 && nPlug<MAX_MIXPLUGINS+1)
+ if (nPlug>=0 && nPlug <= MAX_MIXPLUGINS)
{
if ((!IsLocked()) && pIns->nMixPlug != nPlug) {
m_pModDoc->SetModified();
@@ -2852,5 +2852,5 @@
m_CbnMixPlug.SetItemData(m_CbnMixPlug.AddString(s), nPlug);
}
MODINSTRUMENT *pIns = m_pSndFile->Instruments[m_nInstrument];
- if ((pIns) && (pIns->nMixPlug < MAX_MIXPLUGINS)) m_CbnMixPlug.SetCurSel(pIns->nMixPlug);
+ if ((pIns) && (pIns->nMixPlug <= MAX_MIXPLUGINS)) m_CbnMixPlug.SetCurSel(pIns->nMixPlug);
}
Modified: trunk/OpenMPT/mptrack/View_pat.cpp
===================================================================
--- trunk/OpenMPT/mptrack/View_pat.cpp 2010-02-22 00:21:17 UTC (rev 507)
+++ trunk/OpenMPT/mptrack/View_pat.cpp 2010-02-22 20:53:09 UTC (rev 508)
@@ -4078,13 +4078,26 @@
MODCOMMAND *p = pSndFile->Patterns[m_nPattern].GetpModCommand(m_nRow, nChn);
MODCOMMAND oldcmd = *p; // This is the command we are about to overwrite
- UINT instr = p->instr;
+ UINT instr = p->instr, nTotalMax, nTempMax;
+ if(p->IsPcNote()) // this is a plugin index
+ {
+ nTotalMax = MAX_MIXPLUGINS + 1;
+ nTempMax = MAX_MIXPLUGINS + 1;
+ } else if(pSndFile->GetNumInstruments() > 0) // this is an instrument index
+ {
+ nTotalMax = MAX_INSTRUMENTS;
+ nTempMax = pSndFile->GetNumInstruments();
+ } else
+ {
+ nTotalMax = MAX_SAMPLES;
+ nTempMax = pSndFile->GetNumSamples();
+ }
+
instr = ((instr * 10) + val) % 1000;
- if (instr >= MAX_INSTRUMENTS) instr = instr % 100;
- if ( ((pSndFile->m_nInstruments==0) && (pSndFile->m_nSamples<100)) || // if we're using samples & have less than 100 samples
- (pSndFile->m_nInstruments < 100)) { // or if we're using instruments and have less than 100 instruments
- instr = instr % 100; // --> ensure the entered instrument value is less than 100.
- }
+ if (instr >= nTotalMax) instr = instr % 100;
+ if (nTempMax < 100) // if we're using samples & have less than 100 samples
+ instr = instr % 100; // or if we're using instruments and have less than 100 instruments
+ // --> ensure the entered instrument value is less than 100.
p->instr = instr;
if (IsEditingEnabled_bmsg())
@@ -4973,7 +4986,7 @@
//Add options to remove instrument from selection.
AppendMenu(instrumentChangeMenu, MF_SEPARATOR, 0, 0);
AppendMenu(instrumentChangeMenu, MF_STRING, ID_CHANGE_INSTRUMENT, "Remove instrument");
- AppendMenu(instrumentChangeMenu, MF_STRING, ID_CHANGE_INSTRUMENT+GetCurrentInstrument(), "Set to current instrument");
+ AppendMenu(instrumentChangeMenu, MF_STRING, ID_CHANGE_INSTRUMENT + GetCurrentInstrument(), "Set to current instrument");
}
return true;
}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <sag...@us...> - 2010-02-22 01:08:58
|
Revision: 507
http://modplug.svn.sourceforge.net/modplug/?rev=507&view=rev
Author: saga-games
Date: 2010-02-22 00:21:17 +0000 (Mon, 22 Feb 2010)
Log Message:
-----------
[Fix] XM Loader: Last change might have changed plugin volume handling for old XM files, so let's better put those lines back.
Modified Paths:
--------------
trunk/OpenMPT/soundlib/Load_xm.cpp
Modified: trunk/OpenMPT/soundlib/Load_xm.cpp
===================================================================
--- trunk/OpenMPT/soundlib/Load_xm.cpp 2010-02-21 14:18:55 UTC (rev 506)
+++ trunk/OpenMPT/soundlib/Load_xm.cpp 2010-02-22 00:21:17 UTC (rev 507)
@@ -319,6 +319,8 @@
if (dwMemPos + LittleEndian(pih->size) > dwMemLength) return true;
if ((Instruments[iIns] = new MODINSTRUMENT) == nullptr) continue;
memcpy(Instruments[iIns], &m_defaultInstrument, sizeof(MODINSTRUMENT));
+ Instruments[iIns]->nPluginVelocityHandling = PLUGIN_VELOCITYHANDLING_CHANNEL;
+ Instruments[iIns]->nPluginVolumeHandling = PLUGIN_VOLUMEHANDLING_IGNORE;
memcpy(Instruments[iIns]->name, pih->name, 22);
SpaceToNullStringFixed(Instruments[iIns]->name, 22);
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <sag...@us...> - 2010-02-21 14:19:05
|
Revision: 506
http://modplug.svn.sourceforge.net/modplug/?rev=506&view=rev
Author: saga-games
Date: 2010-02-21 14:18:55 +0000 (Sun, 21 Feb 2010)
Log Message:
-----------
[Ref] Some refactoring in the IMF loader.
Modified Paths:
--------------
trunk/OpenMPT/soundlib/Load_imf.cpp
Modified: trunk/OpenMPT/soundlib/Load_imf.cpp
===================================================================
--- trunk/OpenMPT/soundlib/Load_imf.cpp 2010-02-21 12:35:33 UTC (rev 505)
+++ trunk/OpenMPT/soundlib/Load_imf.cpp 2010-02-21 14:18:55 UTC (rev 506)
@@ -13,27 +13,27 @@
struct IMFCHANNEL {
char name[12]; // Channel name (ASCIIZ-String, max 11 chars)
- BYTE chorus; // Default chorus
- BYTE reverb; // Default reverb
- BYTE panning; // Pan positions 00-FF
- BYTE status; // Channel status: 0 = enabled, 1 = mute, 2 = disabled (ignore effects!)
+ uint8 chorus; // Default chorus
+ uint8 reverb; // Default reverb
+ uint8 panning; // Pan positions 00-FF
+ uint8 status; // Channel status: 0 = enabled, 1 = mute, 2 = disabled (ignore effects!)
};
struct IMFHEADER {
char title[32]; // Songname (ASCIIZ-String, max. 31 chars)
- UINT16 ordnum; // Number of orders saved
- UINT16 patnum; // Number of patterns saved
- UINT16 insnum; // Number of instruments saved
- UINT16 flags; // Module flags (&1 => linear)
- BYTE unused1[8];
- BYTE tempo; // Default tempo (Axx, 1..255)
- BYTE bpm; // Default beats per minute (BPM) (Txx, 32..255)
- BYTE master; // Default mastervolume (Vxx, 0..64)
- BYTE amp; // Amplification factor (mixing volume, 4..127)
- BYTE unused2[8];
+ uint16 ordnum; // Number of orders saved
+ uint16 patnum; // Number of patterns saved
+ uint16 insnum; // Number of instruments saved
+ uint16 flags; // Module flags (&1 => linear)
+ uint8 unused1[8];
+ uint8 tempo; // Default tempo (Axx, 1..255)
+ uint8 bpm; // Default beats per minute (BPM) (Txx, 32..255)
+ uint8 master; // Default mastervolume (Vxx, 0..64)
+ uint8 amp; // Amplification factor (mixing volume, 4..127)
+ uint8 unused2[8];
char im10[4]; // 'IM10'
IMFCHANNEL channels[32]; // Channel settings
- BYTE orderlist[256]; // Order list (0xff = +++; blank out anything beyond ordnum)
+ uint8 orderlist[256]; // Order list (0xff = +++; blank out anything beyond ordnum)
};
enum {
@@ -43,44 +43,44 @@
};
struct IMFENVELOPE {
- BYTE points; // Number of envelope points
- BYTE sustain; // Envelope sustain point
- BYTE loop_start; // Envelope loop start point
- BYTE loop_end; // Envelope loop end point
- BYTE flags; // Envelope flags
- BYTE unused[3];
+ uint8 points; // Number of envelope points
+ uint8 sustain; // Envelope sustain point
+ uint8 loop_start; // Envelope loop start point
+ uint8 loop_end; // Envelope loop end point
+ uint8 flags; // Envelope flags
+ uint8 unused[3];
};
struct IMFENVNODES {
- UINT16 tick;
- UINT16 value;
+ uint16 tick;
+ uint16 value;
};
struct IMFINSTRUMENT {
char name[32]; // Inst. name (ASCIIZ-String, max. 31 chars)
- BYTE map[120]; // Multisample settings
- BYTE unused[8];
+ uint8 map[120]; // Multisample settings
+ uint8 unused[8];
IMFENVNODES nodes[3][16];
IMFENVELOPE env[3];
- UINT16 fadeout; // Fadeout rate (0...0FFFH)
- UINT16 smpnum; // Number of samples in instrument
+ uint16 fadeout; // Fadeout rate (0...0FFFH)
+ uint16 smpnum; // Number of samples in instrument
char ii10[4]; // 'II10'
};
struct IMFSAMPLE {
char filename[13]; // Sample filename (12345678.ABC) */
- BYTE unused1[3];
- UINT32 length; // Length
- UINT32 loop_start; // Loop start
- UINT32 loop_end; // Loop end
- UINT32 C5Speed; // Samplerate
- BYTE volume; // Default volume (0...64)
- BYTE panning; // Default pan (0...255)
- BYTE unused2[14];
- BYTE flags; // Sample flags
- BYTE unused3[5];
- UINT16 ems; // Reserved for internal usage
- UINT32 dram; // Reserved for internal usage
+ uint8 unused1[3];
+ uint32 length; // Length
+ uint32 loop_start; // Loop start
+ uint32 loop_end; // Loop end
+ uint32 C5Speed; // Samplerate
+ uint8 volume; // Default volume (0...64)
+ uint8 panning; // Default pan (0...255)
+ uint8 unused2[14];
+ uint8 flags; // Sample flags
+ uint8 unused3[5];
+ uint16 ems; // Reserved for internal usage
+ uint32 dram; // Reserved for internal usage
char is10[4]; // 'IS10'
};
#pragma pack()
@@ -139,7 +139,8 @@
{
BYTE n;
// fix some of them
- switch (note->command) {
+ switch (note->command)
+ {
case 0xe: // fine volslide
// hackaround to get almost-right behavior for fine slides (i think!)
if (note->param == 0)
@@ -170,7 +171,8 @@
break;
case 0x21:
n = 0;
- switch (note->param >> 4) {
+ switch (note->param >> 4)
+ {
case 0:
/* undefined, but since S0x does nothing in IT anyway, we won't care.
this is here to allow S00 to pick up the previous value (assuming IMF
@@ -217,7 +219,8 @@
break;
}
note->command = (note->command < 0x24) ? imf_efftrans[note->command] : CMD_NONE;
- if (note->command == CMD_VOLUME && note->volcmd == VOLCMD_NONE) {
+ if (note->command == CMD_VOLUME && note->volcmd == VOLCMD_NONE)
+ {
note->volcmd = VOLCMD_VOLUME;
note->vol = note->param;
note->command = CMD_NONE;
@@ -238,8 +241,9 @@
env->nSustainStart = env->nSustainEnd = imfins->env[e].sustain;
env->nReleaseNode = ENV_RELEASE_NODE_UNSET;
- for (UINT n = 0; n < env->nNodes; n++) {
- UINT16 nTick, nValue;
+ for(UINT n = 0; n < env->nNodes; n++)
+ {
+ uint16 nTick, nValue;
nTick = LittleEndianW(imfins->nodes[e][n].tick);
nValue = LittleEndianW(imfins->nodes[e][n].value) >> shift;
env->Ticks[n] = (WORD)max(min, nTick);
@@ -292,7 +296,8 @@
m_nInstruments = 0;
m_nChannels = 0;
- for (CHANNELINDEX nChn = 0; nChn < 32; nChn++) {
+ for(CHANNELINDEX nChn = 0; nChn < 32; nChn++)
+ {
ChnSettings[nChn].nPan = hdr.channels[nChn].panning * 64 / 255;
ChnSettings[nChn].nPan *= 4;
@@ -300,7 +305,8 @@
SpaceToNullStringFixed(ChnSettings[nChn].szName, 12);
// TODO: reverb/chorus?
- switch (hdr.channels[nChn].status) {
+ switch(hdr.channels[nChn].status)
+ {
case 0: // enabled; don't worry about it
m_nChannels = nChn + 1;
break;
@@ -320,11 +326,11 @@
if(!m_nChannels) return false;
Order.resize(hdr.ordnum);
- for (ORDERINDEX nOrd = 0; nOrd < hdr.ordnum; nOrd++)
+ for(ORDERINDEX nOrd = 0; nOrd < hdr.ordnum; nOrd++)
Order[nOrd] = ((hdr.orderlist[nOrd] == 0xff) ? Order.GetIgnoreIndex() : (PATTERNINDEX)hdr.orderlist[nOrd]);
// read patterns
- for (PATTERNINDEX nPat = 0; nPat < hdr.patnum; nPat++)
+ for(PATTERNINDEX nPat = 0; nPat < hdr.patnum; nPat++)
{
UINT16 length, nrows;
BYTE mask, channel;
@@ -347,7 +353,8 @@
row_data = Patterns[nPat];
row = 0;
- while (row < nrows) {
+ while(row < nrows)
+ {
ASSERT_CAN_READ(1);
mask = *((BYTE *)(lpStream + dwMemPos));
dwMemPos += 1;
@@ -359,67 +366,80 @@
channel = mask & 0x1f;
- if (ignore_channels & (1 << channel)) {
+ if(ignore_channels & (1 << channel))
+ {
/* should do this better, i.e. not go through the whole process of deciding
what to do with the effects since they're just being thrown out */
//printf("disabled channel %d contains data\n", channel + 1);
note = &junk_note;
- } else {
+ } else
+ {
note = row_data + channel;
}
- if (mask & 0x20) {
+ if(mask & 0x20)
+ {
// read note/instrument
ASSERT_CAN_READ(2);
note->note = *((BYTE *)(lpStream + dwMemPos));
note->instr = *((BYTE *)(lpStream + dwMemPos + 1));
dwMemPos += 2;
- if (note->note == 160) {
+ if (note->note == 160)
+ {
note->note = NOTE_KEYOFF; /* ??? */
- } else if (note->note == 255) {
+ } else if (note->note == 255)
+ {
note->note = NOTE_NONE; /* ??? */
- } else {
+ } else
+ {
note->note = (note->note >> 4) * 12 + (note->note & 0xf) + 12 + 1;
- if (note->note > NOTE_MAX) {
+ if(note->note > NOTE_MAX)
+ {
/*printf("%d.%d.%d: funny note 0x%02x\n",
nPat, row, channel, fp->data[fp->pos - 1]);*/
note->note = NOTE_NONE;
}
}
}
- if ((mask & 0xc0) == 0xc0) {
- BYTE e1c, e1d, e2c, e2d;
+ if((mask & 0xc0) == 0xc0)
+ {
+ uint8 e1c, e1d, e2c, e2d;
// read both effects and figure out what to do with them
ASSERT_CAN_READ(4);
- e1c = *((BYTE *)(lpStream + dwMemPos));
- e1d = *((BYTE *)(lpStream + dwMemPos + 1));
- e2c = *((BYTE *)(lpStream + dwMemPos + 2));
- e2d = *((BYTE *)(lpStream + dwMemPos + 3));
+ e1c = *((uint8 *)(lpStream + dwMemPos));
+ e1d = *((uint8 *)(lpStream + dwMemPos + 1));
+ e2c = *((uint8 *)(lpStream + dwMemPos + 2));
+ e2d = *((uint8 *)(lpStream + dwMemPos + 3));
dwMemPos += 4;
- if (e1c == 0xc) {
+ if (e1c == 0xc)
+ {
note->vol = min(e1d, 0x40);
note->volcmd = VOLCMD_VOLUME;
note->command = e2c;
note->param = e2d;
- } else if (e2c == 0xc) {
+ } else if (e2c == 0xc)
+ {
note->vol = min(e2d, 0x40);
note->volcmd = VOLCMD_VOLUME;
note->command = e1c;
note->param = e1d;
- } else if (e1c == 0xa) {
+ } else if (e1c == 0xa)
+ {
note->vol = e1d * 64 / 255;
note->volcmd = VOLCMD_PANNING;
note->command = e2c;
note->param = e2d;
- } else if (e2c == 0xa) {
+ } else if (e2c == 0xa)
+ {
note->vol = e2d * 64 / 255;
note->volcmd = VOLCMD_PANNING;
note->command = e1c;
note->param = e1d;
- } else {
+ } else
+ {
/* check if one of the effects is a 'global' effect
-- if so, put it in some unused channel instead.
otherwise pick the most important effect. */
@@ -427,20 +447,22 @@
note->command = e2c;
note->param = e2d;
}
- } else if (mask & 0xc0) {
+ } else if(mask & 0xc0)
+ {
// there's one effect, just stick it in the effect column
ASSERT_CAN_READ(2);
note->command = *((BYTE *)(lpStream + dwMemPos));
note->param = *((BYTE *)(lpStream + dwMemPos + 1));
dwMemPos += 2;
}
- if (note->command)
+ if(note->command)
import_imf_effect(note);
}
}
// read instruments
- for (INSTRUMENTINDEX nIns = 0; nIns < hdr.insnum; nIns++) {
+ for (INSTRUMENTINDEX nIns = 0; nIns < hdr.insnum; nIns++)
+ {
IMFINSTRUMENT imfins;
MODINSTRUMENT *pIns;
ASSERT_CAN_READ(sizeof(IMFINSTRUMENT));
@@ -452,14 +474,16 @@
imfins.smpnum = LittleEndianW(imfins.smpnum);
imfins.fadeout = LittleEndianW(imfins.fadeout);
- if (memcmp(imfins.ii10, "II10", 4) != 0) {
+ if(memcmp(imfins.ii10, "II10", 4) != 0)
+ {
//printf("ii10 says %02x %02x %02x %02x!\n",
// imfins.ii10[0], imfins.ii10[1], imfins.ii10[2], imfins.ii10[3]);
return false;
}
pIns = new MODINSTRUMENT;
- if (!pIns) continue;
+ if(!pIns)
+ continue;
Instruments[nIns + 1] = pIns;
memset(pIns, 0, sizeof(MODINSTRUMENT));
pIns->nPPC = 5 * 12;
@@ -468,8 +492,10 @@
memcpy(pIns->name, imfins.name, 31);
SpaceToNullStringFixed(pIns->name, 31);
- if (imfins.smpnum) {
- for (BYTE cNote = 0; cNote < 120; cNote++) {
+ if(imfins.smpnum)
+ {
+ for(BYTE cNote = 0; cNote < 120; cNote++)
+ {
pIns->NoteMap[cNote] = cNote + 1;
pIns->Keyboard[cNote] = firstsample + imfins.map[cNote];
}
@@ -481,14 +507,16 @@
load_imf_envelope(&pIns->VolEnv, &imfins, IMF_ENV_VOL);
load_imf_envelope(&pIns->PanEnv, &imfins, IMF_ENV_PAN);
load_imf_envelope(&pIns->PitchEnv, &imfins, IMF_ENV_FILTER);
- if((pIns->PitchEnv.dwFlags & ENV_ENABLED) != 0) pIns->PitchEnv.dwFlags |= ENV_FILTER;
+ if((pIns->PitchEnv.dwFlags & ENV_ENABLED) != 0)
+ pIns->PitchEnv.dwFlags |= ENV_FILTER;
// hack to get === to stop notes (from modplug's xm loader)
- if (!(pIns->VolEnv.dwFlags & ENV_ENABLED) && !pIns->nFadeOut)
+ if(!(pIns->VolEnv.dwFlags & ENV_ENABLED) && !pIns->nFadeOut)
pIns->nFadeOut = 8192;
// read this instrument's samples
- for (SAMPLEINDEX nSmp = 0; nSmp < imfins.smpnum; nSmp++) {
+ for(SAMPLEINDEX nSmp = 0; nSmp < imfins.smpnum; nSmp++)
+ {
IMFSAMPLE imfsmp;
UINT32 blen;
ASSERT_CAN_READ(sizeof(IMFSAMPLE));
@@ -497,7 +525,8 @@
dwMemPos += sizeof(IMFSAMPLE);
m_nSamples++;
- if (memcmp(imfsmp.is10, "IS10", 4) != 0) {
+ if(memcmp(imfsmp.is10, "IS10", 4) != 0)
+ {
//printf("is10 says %02x %02x %02x %02x!\n",
// imfsmp.is10[0], imfsmp.is10[1], imfsmp.is10[2], imfsmp.is10[3]);
return false;
@@ -518,7 +547,8 @@
pSample->uFlags |= CHN_LOOP;
if (imfsmp.flags & 2)
pSample->uFlags |= CHN_PINGPONGLOOP;
- if (imfsmp.flags & 4) {
+ if (imfsmp.flags & 4)
+ {
pSample->uFlags |= CHN_16BIT;
pSample->nLength >>= 1;
pSample->nLoopStart >>= 1;
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <sag...@us...> - 2010-02-21 12:35:42
|
Revision: 505
http://modplug.svn.sourceforge.net/modplug/?rev=505&view=rev
Author: saga-games
Date: 2010-02-21 12:35:33 +0000 (Sun, 21 Feb 2010)
Log Message:
-----------
[Fix] Treeview: Right-Click on module -> Close didn't ask for confirmation when the document was modified.
[Ref] XM Loader: Rewrote some lines of the instrument loader so they wouldn't confuse the "MPT hack detector".
Modified Paths:
--------------
trunk/OpenMPT/mptrack/View_tre.cpp
trunk/OpenMPT/soundlib/Load_xm.cpp
Modified: trunk/OpenMPT/mptrack/View_tre.cpp
===================================================================
--- trunk/OpenMPT/mptrack/View_tre.cpp 2010-02-20 23:13:54 UTC (rev 504)
+++ trunk/OpenMPT/mptrack/View_tre.cpp 2010-02-21 12:35:33 UTC (rev 505)
@@ -845,14 +845,14 @@
// Add Patterns
if ((pInfo->hPatterns) && (hintFlagPart != HINT_INSNAMES) && (hintFlagPart != HINT_SMPNAMES))
{
- const DWORD nPat = (lHint >> HINT_SHIFT_PAT);
+ const PATTERNINDEX nPat = (PATTERNINDEX)(lHint >> HINT_SHIFT_PAT);
pInfo->tiPatterns.resize(pSndFile->Patterns.Size(), NULL);
- UINT imin = 0, imax = pSndFile->Patterns.Size()-1;
+ PATTERNINDEX imin = 0, imax = pSndFile->Patterns.Size()-1;
if ((hintFlagPart == HINT_PATNAMES) && (nPat < pSndFile->Patterns.Size())) imin = imax = nPat;
BOOL bDelPat = FALSE;
ASSERT(pInfo->tiPatterns.size() == pSndFile->Patterns.Size());
- for (UINT iPat=imin; iPat <= imax; iPat++)
+ for(PATTERNINDEX iPat = imin; iPat <= imax; iPat++)
{
if ((bDelPat) && (pInfo->tiPatterns[iPat]))
{
@@ -3222,5 +3222,9 @@
HTREEITEM hItem = GetSelectedItem();
CModDoc *pModDoc = GetDocumentFromItem(hItem);
if(pModDoc == nullptr) return;
- pModDoc->OnCloseDocument();
+ // Spam our message to the first available view
+ POSITION pos = pModDoc->GetFirstViewPosition();
+ if(pos == NULL) return;
+ CView* pView = pModDoc->GetNextView(pos);
+ if (pView) pView->PostMessage(WM_COMMAND, ID_FILE_CLOSE);
}
Modified: trunk/OpenMPT/soundlib/Load_xm.cpp
===================================================================
--- trunk/OpenMPT/soundlib/Load_xm.cpp 2010-02-20 23:13:54 UTC (rev 504)
+++ trunk/OpenMPT/soundlib/Load_xm.cpp 2010-02-21 12:35:33 UTC (rev 505)
@@ -317,11 +317,8 @@
pih = (XMINSTRUMENTHEADER *)(lpStream + dwMemPos);
if (dwMemPos + LittleEndian(pih->size) > dwMemLength) return true;
- if ((Instruments[iIns] = new MODINSTRUMENT) == NULL) continue;
- memset(Instruments[iIns], 0, sizeof(MODINSTRUMENT));
- Instruments[iIns]->pTuning = m_defaultInstrument.pTuning;
- Instruments[iIns]->nPluginVelocityHandling = PLUGIN_VELOCITYHANDLING_CHANNEL;
- Instruments[iIns]->nPluginVolumeHandling = PLUGIN_VOLUMEHANDLING_IGNORE;
+ if ((Instruments[iIns] = new MODINSTRUMENT) == nullptr) continue;
+ memcpy(Instruments[iIns], &m_defaultInstrument, sizeof(MODINSTRUMENT));
memcpy(Instruments[iIns]->name, pih->name, 22);
SpaceToNullStringFixed(Instruments[iIns]->name, 22);
@@ -392,7 +389,7 @@
n--;
}
#ifndef FASTSOUNDLIB
- // Damn! more than 200 samples: look for duplicates
+ // Damn! Too many samples: look for duplicates
if (!n)
{
if (!unused_samples)
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <sag...@us...> - 2010-02-20 23:14:07
|
Revision: 504
http://modplug.svn.sourceforge.net/modplug/?rev=504&view=rev
Author: saga-games
Date: 2010-02-20 23:13:54 +0000 (Sat, 20 Feb 2010)
Log Message:
-----------
[New] Pattern Editor: Key shortcut + context menu entry for toggling the plugin editor of the PC note that's under the cursor.
Modified Paths:
--------------
trunk/OpenMPT/mptrack/CommandSet.cpp
trunk/OpenMPT/mptrack/CommandSet.h
trunk/OpenMPT/mptrack/View_pat.cpp
trunk/OpenMPT/mptrack/View_pat.h
trunk/OpenMPT/mptrack/resource.h
Modified: trunk/OpenMPT/mptrack/CommandSet.cpp
===================================================================
--- trunk/OpenMPT/mptrack/CommandSet.cpp 2010-02-20 21:02:02 UTC (rev 503)
+++ trunk/OpenMPT/mptrack/CommandSet.cpp 2010-02-20 23:13:54 UTC (rev 504)
@@ -2560,6 +2560,11 @@
commands[kcInstrumentEnvelopePointMoveDown8].isDummy = false;
commands[kcInstrumentEnvelopePointMoveDown8].Message = "Move envelope point down (big step)";
+ commands[kcPatternEditPCNotePlugin].UID = 1836;
+ commands[kcPatternEditPCNotePlugin].isHidden = false;
+ commands[kcPatternEditPCNotePlugin].isDummy = false;
+ commands[kcPatternEditPCNotePlugin].Message = "Edit plugin assigned to PC note";
+
#ifdef _DEBUG
for (int i=0; i<kcNumCommands; i++) {
if (commands[i].UID != 0) { // ignore unset UIDs
Modified: trunk/OpenMPT/mptrack/CommandSet.h
===================================================================
--- trunk/OpenMPT/mptrack/CommandSet.h 2010-02-20 21:02:02 UTC (rev 503)
+++ trunk/OpenMPT/mptrack/CommandSet.h 2010-02-20 23:13:54 UTC (rev 504)
@@ -221,6 +221,7 @@
kcSwitchToOrderList,
kcNewPattern,
kcDuplicatePattern,
+ kcPatternEditPCNotePlugin,
kcTogglePluginEditor,
kcShowNoteProperties,
kcShowPatternProperties,
Modified: trunk/OpenMPT/mptrack/View_pat.cpp
===================================================================
--- trunk/OpenMPT/mptrack/View_pat.cpp 2010-02-20 21:02:02 UTC (rev 503)
+++ trunk/OpenMPT/mptrack/View_pat.cpp 2010-02-20 23:13:54 UTC (rev 504)
@@ -114,6 +114,7 @@
ON_COMMAND(ID_CLEAR_SELECTION, OnClearSelectionFromMenu)
ON_COMMAND(ID_SHOWTIMEATROW, OnShowTimeAtRow)
ON_COMMAND(ID_CHANNEL_RENAME, OnRenameChannel)
+ ON_COMMAND(ID_PATTERN_EDIT_PCNOTE_PLUGIN, OnTogglePCNotePluginEditor)
ON_COMMAND_RANGE(ID_CHANGE_INSTRUMENT, ID_CHANGE_INSTRUMENT+MAX_INSTRUMENTS, OnSelectInstrument)
ON_UPDATE_COMMAND_UI(ID_EDIT_UNDO, OnUpdateUndo)
ON_COMMAND_RANGE(ID_PLUGSELECT, ID_PLUGSELECT+MAX_MIXPLUGINS, OnSelectPlugin) //rewbs.patPlugName
@@ -1225,7 +1226,8 @@
AppendMenu(hMenu, MF_SEPARATOR, 0, "");
if (BuildVisFXCtxMenu(hMenu, ih) | //Use bitwise ORs to avoid shortcuts
BuildAmplifyCtxMenu(hMenu, ih) |
- BuildSetInstCtxMenu(hMenu, ih, pSndFile) )
+ BuildSetInstCtxMenu(hMenu, ih, pSndFile) |
+ BuildPCNoteCtxMenu(hMenu, ih, pSndFile) )
AppendMenu(hMenu, MF_SEPARATOR, 0, "");
if (BuildGrowShrinkCtxMenu(hMenu, ih))
AppendMenu(hMenu, MF_SEPARATOR, 0, "");
@@ -3620,6 +3622,7 @@
case kcDuplicatePattern: SendCtrlMessage(CTRLMSG_PAT_DUPPATTERN); return wParam;
case kcSwitchToOrderList: OnSwitchToOrderList();
case kcSwitchOverflowPaste: CMainFrame::m_dwPatternSetup ^= PATTERN_OVERFLOWPASTE; return wParam;
+ case kcPatternEditPCNotePlugin: OnTogglePCNotePluginEditor(); return wParam;
}
//Ranges:
@@ -4988,6 +4991,23 @@
}
+bool CViewPattern::BuildPCNoteCtxMenu(HMENU hMenu, CInputHandler* ih, CSoundFile* pSndFile)
+//-----------------------------------------------------------------------------------------
+{
+ MODCOMMAND *mSelStart = nullptr;
+ if((pSndFile == nullptr) || (!pSndFile->Patterns.IsValidPat(m_nPattern)))
+ return false;
+ mSelStart = pSndFile->Patterns[m_nPattern].GetpModCommand(GetSelectionStartRow(), GetSelectionStartChan());
+ if((mSelStart == nullptr) || (!mSelStart->IsPcNote()))
+ return false;
+ if(mSelStart->instr < 1 || mSelStart->instr > MAX_MIXPLUGINS)
+ return false;
+
+ AppendMenu(hMenu, MF_STRING, ID_PATTERN_EDIT_PCNOTE_PLUGIN, "Toggle plugin editor\t" + ih->GetKeyTextFromCommand(kcPatternEditPCNotePlugin));
+ return true;
+}
+
+
UINT CViewPattern::GetSelectionStartRow() {
//-----------------------------------------
return min(GetRowFromCursor(m_dwBeginSel), GetRowFromCursor(m_dwEndSel));
@@ -5232,3 +5252,24 @@
SetFocus();
}
}
+
+
+void CViewPattern::OnTogglePCNotePluginEditor()
+//---------------------------------------------
+{
+ CModDoc *pModDoc = GetDocument();
+ if(pModDoc == nullptr) return;
+ CSoundFile *pSndFile = pModDoc->GetSoundFile();
+ if((pSndFile == nullptr) || (!pSndFile->Patterns.IsValidPat(m_nPattern)))
+ return;
+
+ MODCOMMAND *mSelStart = nullptr;
+ mSelStart = pSndFile->Patterns[m_nPattern].GetpModCommand(GetSelectionStartRow(), GetSelectionStartChan());
+ if((mSelStart == nullptr) || (!mSelStart->IsPcNote()))
+ return;
+ if(mSelStart->instr < 1 || mSelStart->instr > MAX_MIXPLUGINS)
+ return;
+
+ PLUGINDEX nPlg = (PLUGINDEX)(mSelStart->instr - 1);
+ pModDoc->TogglePluginEditor(nPlg);
+}
Modified: trunk/OpenMPT/mptrack/View_pat.h
===================================================================
--- trunk/OpenMPT/mptrack/View_pat.h 2010-02-20 21:02:02 UTC (rev 503)
+++ trunk/OpenMPT/mptrack/View_pat.h 2010-02-20 23:13:54 UTC (rev 504)
@@ -303,6 +303,7 @@
afx_msg void OnRunScript();
afx_msg void OnShowTimeAtRow();
afx_msg void OnRenameChannel();
+ afx_msg void OnTogglePCNotePluginEditor();
//}}AFX_MSG
DECLARE_MESSAGE_MAP()
@@ -331,6 +332,7 @@
bool BuildSetInstCtxMenu(HMENU hMenu, CInputHandler* ih, CSoundFile* pSndFile);
bool BuildAmplifyCtxMenu(HMENU hMenu, CInputHandler* ih);
bool BuildChannelMiscCtxMenu(HMENU hMenu, CSoundFile* pSndFile);
+ bool BuildPCNoteCtxMenu(HMENU hMenu, CInputHandler* ih, CSoundFile* pSndFile);
UINT GetSelectionStartRow();
UINT GetSelectionEndRow();
Modified: trunk/OpenMPT/mptrack/resource.h
===================================================================
--- trunk/OpenMPT/mptrack/resource.h 2010-02-20 21:02:02 UTC (rev 503)
+++ trunk/OpenMPT/mptrack/resource.h 2010-02-20 23:13:54 UTC (rev 504)
@@ -1202,6 +1202,7 @@
#define ID_SAMPLE_GENERATE 60445
#define ID_NOTEMAP_TRANS_UP 60446
#define ID_NOTEMAP_TRANS_DOWN 60447
+#define ID_PATTERN_EDIT_PCNOTE_PLUGIN 60448
// Next default values for new objects
//
@@ -1209,7 +1210,7 @@
#ifndef APSTUDIO_READONLY_SYMBOLS
#define _APS_3D_CONTROLS 1
#define _APS_NEXT_RESOURCE_VALUE 526
-#define _APS_NEXT_COMMAND_VALUE 60448
+#define _APS_NEXT_COMMAND_VALUE 60449
#define _APS_NEXT_CONTROL_VALUE 2427
#define _APS_NEXT_SYMED_VALUE 901
#endif
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <sag...@us...> - 2010-02-20 21:02:11
|
Revision: 503
http://modplug.svn.sourceforge.net/modplug/?rev=503&view=rev
Author: saga-games
Date: 2010-02-20 21:02:02 +0000 (Sat, 20 Feb 2010)
Log Message:
-----------
[New] Instrument Editor: Transpose Up/Down for sample map.
Modified Paths:
--------------
trunk/OpenMPT/mptrack/Ctrl_ins.cpp
trunk/OpenMPT/mptrack/Ctrl_ins.h
trunk/OpenMPT/mptrack/resource.h
trunk/OpenMPT/soundlib/modcommand.h
Modified: trunk/OpenMPT/mptrack/Ctrl_ins.cpp
===================================================================
--- trunk/OpenMPT/mptrack/Ctrl_ins.cpp 2010-02-20 20:34:40 UTC (rev 502)
+++ trunk/OpenMPT/mptrack/Ctrl_ins.cpp 2010-02-20 21:02:02 UTC (rev 503)
@@ -25,6 +25,8 @@
ON_WM_LBUTTONDOWN()
ON_WM_RBUTTONDOWN()
ON_WM_LBUTTONDBLCLK()
+ ON_COMMAND(ID_NOTEMAP_TRANS_UP, OnMapTransposeUp)
+ ON_COMMAND(ID_NOTEMAP_TRANS_DOWN, OnMapTransposeDown)
ON_COMMAND(ID_NOTEMAP_COPY_NOTE, OnMapCopyNote)
ON_COMMAND(ID_NOTEMAP_COPY_SMP, OnMapCopySample)
ON_COMMAND(ID_NOTEMAP_RESET, OnMapReset)
@@ -288,7 +290,7 @@
if (hMenu)
{
- AppendMenu(hMenu, MF_STRING, ID_INSTRUMENT_SAMPLEMAP, "Edit Sample Map");
+ AppendMenu(hMenu, MF_STRING, ID_INSTRUMENT_SAMPLEMAP, "Edit Sample &Map");
if (hSubMenu)
{
BYTE smpused[(MAX_SAMPLES+7)/8];
@@ -309,18 +311,24 @@
AppendMenu(hSubMenu, MF_STRING, ID_NOTEMAP_EDITSAMPLE+j, s);
}
}
- AppendMenu(hMenu, MF_POPUP, (UINT)hSubMenu, "Edit Sample");
+ AppendMenu(hMenu, MF_POPUP, (UINT)hSubMenu, "&Edit Sample");
AppendMenu(hMenu, MF_SEPARATOR, 0, NULL);
}
- wsprintf(s, "Map all notes to sample %d", pIns->Keyboard[m_nNote]);
+ wsprintf(s, "Map all notes to &sample %d", pIns->Keyboard[m_nNote]);
AppendMenu(hMenu, MF_STRING, ID_NOTEMAP_COPY_SMP, s);
- if(pIns->NoteMap[m_nNote] < NOTE_MIN_SPECIAL)
- wsprintf(s, "Map all notes to %s", pSndFile->GetNoteName(pIns->NoteMap[m_nNote], m_nInstrument).c_str());
- else
- wsprintf(s, "Map all notes to %s", szSpecialNoteNames[pIns->NoteMap[m_nNote] - NOTE_MIN_SPECIAL]);
- AppendMenu(hMenu, MF_STRING, ID_NOTEMAP_COPY_NOTE, s);
- AppendMenu(hMenu, MF_STRING, ID_NOTEMAP_RESET, "Reset note mapping");
- AppendMenu(hMenu, MF_STRING, ID_INSTRUMENT_DUPLICATE, "Duplicate Instrument\tShift+New");
+
+ if(pSndFile->GetType() != MOD_TYPE_XM)
+ {
+ if(pIns->NoteMap[m_nNote] < NOTE_MIN_SPECIAL)
+ wsprintf(s, "Map all ¬es to %s", pSndFile->GetNoteName(pIns->NoteMap[m_nNote], m_nInstrument).c_str());
+ else
+ wsprintf(s, "Map all ¬es to %s", szSpecialNoteNames[pIns->NoteMap[m_nNote] - NOTE_MIN_SPECIAL]);
+ AppendMenu(hMenu, MF_STRING, ID_NOTEMAP_COPY_NOTE, s);
+ AppendMenu(hMenu, MF_STRING, ID_NOTEMAP_TRANS_UP, "Transpose map &up");
+ AppendMenu(hMenu, MF_STRING, ID_NOTEMAP_TRANS_DOWN, "Transpose map &down");
+ }
+ AppendMenu(hMenu, MF_STRING, ID_NOTEMAP_RESET, "&Reset note mapping");
+ AppendMenu(hMenu, MF_STRING, ID_INSTRUMENT_DUPLICATE, "Duplicate &Instrument\tShift+New");
SetMenuDefaultItem(hMenu, ID_INSTRUMENT_SAMPLEMAP, FALSE);
ClientToScreen(&pt);
::TrackPopupMenu(hMenu, TPM_LEFTALIGN|TPM_RIGHTBUTTON, pt.x, pt.y, 0, m_hWnd, NULL);
@@ -335,56 +343,52 @@
void CNoteMapWnd::OnMapCopyNote()
//-------------------------------
{
- if (m_pModDoc)
+ if(m_pModDoc == nullptr) return;
+ CSoundFile *pSndFile;
+ MODINSTRUMENT *pIns;
+
+ pSndFile = m_pModDoc->GetSoundFile();
+ pIns = pSndFile->Instruments[m_nInstrument];
+ if (pIns)
{
- CSoundFile *pSndFile;
- MODINSTRUMENT *pIns;
-
- pSndFile = m_pModDoc->GetSoundFile();
- pIns = pSndFile->Instruments[m_nInstrument];
- if (pIns)
+ bool bModified = false;
+ UINT n = pIns->NoteMap[m_nNote];
+ for (NOTEINDEXTYPE i = 0; i < NOTE_MAX; i++) if (pIns->NoteMap[i] != n)
{
- BOOL bModified = FALSE;
- UINT n = pIns->NoteMap[m_nNote];
- for (UINT i=0; i<NOTE_MAX; i++) if (pIns->NoteMap[i] != n)
- {
- pIns->NoteMap[i] = n;
- bModified = TRUE;
- }
- if (bModified)
- {
- m_pModDoc->SetModified();
- InvalidateRect(NULL, FALSE);
- }
+ pIns->NoteMap[i] = n;
+ bModified = true;
}
+ if (bModified)
+ {
+ m_pModDoc->SetModified();
+ InvalidateRect(NULL, FALSE);
+ }
}
}
void CNoteMapWnd::OnMapCopySample()
-//-------------------------------------
+//---------------------------------
{
- if (m_pModDoc)
+ if(m_pModDoc == nullptr) return;
+ CSoundFile *pSndFile;
+ MODINSTRUMENT *pIns;
+
+ pSndFile = m_pModDoc->GetSoundFile();
+ pIns = pSndFile->Instruments[m_nInstrument];
+ if (pIns)
{
- CSoundFile *pSndFile;
- MODINSTRUMENT *pIns;
-
- pSndFile = m_pModDoc->GetSoundFile();
- pIns = pSndFile->Instruments[m_nInstrument];
- if (pIns)
+ bool bModified = false;
+ UINT n = pIns->Keyboard[m_nNote];
+ for (NOTEINDEXTYPE i = 0; i < NOTE_MAX; i++) if (pIns->Keyboard[i] != n)
{
- BOOL bModified = FALSE;
- UINT n = pIns->Keyboard[m_nNote];
- for (UINT i=0; i<NOTE_MAX; i++) if (pIns->Keyboard[i] != n)
- {
- pIns->Keyboard[i] = n;
- bModified = TRUE;
- }
- if (bModified)
- {
- m_pModDoc->SetModified();
- InvalidateRect(NULL, FALSE);
- }
+ pIns->Keyboard[i] = n;
+ bModified = true;
}
+ if (bModified)
+ {
+ m_pModDoc->SetModified();
+ InvalidateRect(NULL, FALSE);
+ }
}
}
@@ -392,27 +396,70 @@
void CNoteMapWnd::OnMapReset()
//----------------------------
{
- if (m_pModDoc)
+ if(m_pModDoc == nullptr) return;
+ CSoundFile *pSndFile;
+ MODINSTRUMENT *pIns;
+
+ pSndFile = m_pModDoc->GetSoundFile();
+ pIns = pSndFile->Instruments[m_nInstrument];
+ if (pIns)
{
- CSoundFile *pSndFile;
- MODINSTRUMENT *pIns;
-
- pSndFile = m_pModDoc->GetSoundFile();
- pIns = pSndFile->Instruments[m_nInstrument];
- if (pIns)
+ bool bModified = false;
+ for (NOTEINDEXTYPE i = 0; i < NOTE_MAX; i++) if (pIns->NoteMap[i] != i + 1)
{
- BOOL bModified = FALSE;
- for (UINT i=0; i<NOTE_MAX; i++) if (pIns->NoteMap[i] != i+1)
+ pIns->NoteMap[i] = i + 1;
+ bModified = true;
+ }
+ if (bModified)
+ {
+ m_pModDoc->SetModified();
+ InvalidateRect(NULL, FALSE);
+ }
+ }
+}
+
+
+void CNoteMapWnd::OnMapTransposeUp()
+//----------------------------------
+{
+ MapTranspose(1);
+}
+
+
+void CNoteMapWnd::OnMapTransposeDown()
+//------------------------------------
+{
+ MapTranspose(-1);
+}
+
+
+void CNoteMapWnd::MapTranspose(int nAmount)
+//-----------------------------------------
+{
+ if(m_pModDoc == nullptr || nAmount == 0) return;
+ CSoundFile *pSndFile;
+ MODINSTRUMENT *pIns;
+
+ pSndFile = m_pModDoc->GetSoundFile();
+ pIns = pSndFile->Instruments[m_nInstrument];
+ if (pIns)
+ {
+ bool bModified = false;
+ for(NOTEINDEXTYPE i = 0; i < NOTE_MAX; i++)
+ {
+ int n = pIns->NoteMap[i];
+ if ((n > NOTE_MIN && nAmount < 0) || (n < NOTE_MAX && nAmount > 0))
{
- pIns->NoteMap[i] = i+1;
- bModified = TRUE;
+ n = CLAMP(n + nAmount, NOTE_MIN, NOTE_MAX);
+ pIns->NoteMap[i] = (BYTE)n;
+ bModified = true;
}
- if (bModified)
- {
- m_pModDoc->SetModified();
- InvalidateRect(NULL, FALSE);
- }
}
+ if (bModified)
+ {
+ m_pModDoc->SetModified();
+ InvalidateRect(NULL, FALSE);
+ }
}
}
Modified: trunk/OpenMPT/mptrack/Ctrl_ins.h
===================================================================
--- trunk/OpenMPT/mptrack/Ctrl_ins.h 2010-02-20 20:34:40 UTC (rev 502)
+++ trunk/OpenMPT/mptrack/Ctrl_ins.h 2010-02-20 21:02:02 UTC (rev 503)
@@ -19,6 +19,9 @@
int m_cxFont, m_cyFont;
COLORREF colorText, colorTextSel;
+private:
+ void MapTranspose(int nAmount);
+
public:
CNoteMapWnd() { m_nPlayingNote=-1; m_nNote = 5*12; m_pModDoc = NULL; m_nInstrument = 0; m_bIns = FALSE; m_cxFont = m_cyFont = 0; m_hFont = NULL; m_nOldNote = m_nOldIns = 0; m_pParent = NULL; }
BOOL SetCurrentInstrument(CModDoc *pModDoc, UINT nIns);
@@ -47,6 +50,8 @@
afx_msg void OnPaint();
afx_msg void OnMapCopySample();
afx_msg void OnMapCopyNote();
+ afx_msg void OnMapTransposeUp();
+ afx_msg void OnMapTransposeDown();
afx_msg void OnMapReset();
afx_msg void OnEditSample(UINT nID);
afx_msg void OnEditSampleMap();
Modified: trunk/OpenMPT/mptrack/resource.h
===================================================================
--- trunk/OpenMPT/mptrack/resource.h 2010-02-20 20:34:40 UTC (rev 502)
+++ trunk/OpenMPT/mptrack/resource.h 2010-02-20 21:02:02 UTC (rev 503)
@@ -1200,6 +1200,8 @@
#define ID_SAMPLE_GENERATOR_MENU 60244
#define ID_SAMPLE_GENERATOR_PRESET_MENU 60344
#define ID_SAMPLE_GENERATE 60445
+#define ID_NOTEMAP_TRANS_UP 60446
+#define ID_NOTEMAP_TRANS_DOWN 60447
// Next default values for new objects
//
@@ -1207,7 +1209,7 @@
#ifndef APSTUDIO_READONLY_SYMBOLS
#define _APS_3D_CONTROLS 1
#define _APS_NEXT_RESOURCE_VALUE 526
-#define _APS_NEXT_COMMAND_VALUE 60446
+#define _APS_NEXT_COMMAND_VALUE 60448
#define _APS_NEXT_CONTROL_VALUE 2427
#define _APS_NEXT_SYMED_VALUE 901
#endif
Modified: trunk/OpenMPT/soundlib/modcommand.h
===================================================================
--- trunk/OpenMPT/soundlib/modcommand.h 2010-02-20 20:34:40 UTC (rev 502)
+++ trunk/OpenMPT/soundlib/modcommand.h 2010-02-20 21:02:02 UTC (rev 503)
@@ -10,6 +10,7 @@
#define NOTE_FADE 0xFD //253, IT's action for illegal notes - DO NOT SAVE AS 253 as this is IT's internal representation of "no note"!
#define NOTE_PC 0xFC //252, Param Control 'note'. Changes param value on first tick.
#define NOTE_PCS 0xFB //251, Param Control(Smooth) 'note'. Changes param value during the whole row.
+#define NOTE_MIN 1
#define NOTE_MAX 120 //Defines maximum notevalue(with index starting from 1) as well as maximum number of notes.
#define NOTE_MAX_SPECIAL NOTE_KEYOFF
#define NOTE_MIN_SPECIAL NOTE_PCS
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <sag...@us...> - 2010-02-20 20:34:46
|
Revision: 502
http://modplug.svn.sourceforge.net/modplug/?rev=502&view=rev
Author: saga-games
Date: 2010-02-20 20:34:40 +0000 (Sat, 20 Feb 2010)
Log Message:
-----------
[Imp] Pattern Editor: The status bar shows plugin and parameter names for PC notes now as well.
Modified Paths:
--------------
trunk/OpenMPT/mptrack/Draw_pat.cpp
Modified: trunk/OpenMPT/mptrack/Draw_pat.cpp
===================================================================
--- trunk/OpenMPT/mptrack/Draw_pat.cpp 2010-02-20 19:20:37 UTC (rev 501)
+++ trunk/OpenMPT/mptrack/Draw_pat.cpp 2010-02-20 20:34:40 UTC (rev 502)
@@ -1463,22 +1463,29 @@
{
MODCOMMAND *m = &pSndFile->Patterns[m_nPattern][m_nRow*pSndFile->m_nChannels+nChn];
- // Ignore update if using PC or PCs notes because instrument, volcol and effect values
- // have different meaning.
- if((m->note != NOTE_PC && m->note != NOTE_PCS) || GetColTypeFromCursor(m_dwCursor) == 0)
+ switch (GetColTypeFromCursor(m_dwCursor))
{
- switch (GetColTypeFromCursor(m_dwCursor))
+ case 0:
+ // display note
+ if(m->note >= NOTE_MIN_SPECIAL)
+ strcpy(s, szSpecialNoteShortDesc[m->note - NOTE_MIN_SPECIAL]);
+ break;
+ case 1:
+ // display instrument
+ if (m->instr)
{
- case 0:
- // display note
- if(m->note >= NOTE_MIN_SPECIAL)
- strcpy(s, szSpecialNoteShortDesc[m->note - NOTE_MIN_SPECIAL]);
- break;
- case 1:
- // display instrument
- if (m->instr)
+ CHAR sztmp[128] = "";
+ if(m->note == NOTE_PC || m->note == NOTE_PCS)
{
- CHAR sztmp[128] = "";
+ // display plugin name.
+ if(m->instr <= MAX_MIXPLUGINS)
+ {
+ strncpy(sztmp, pSndFile->m_MixPlugins[m->instr - 1].GetName(), sizeof(sztmp));
+ SetNullTerminator(sztmp);
+ }
+ } else
+ {
+ // "normal" instrument
if (pSndFile->m_nInstruments)
{
if ((m->instr <= pSndFile->m_nInstruments) && (pSndFile->Instruments[m->instr]))
@@ -1509,19 +1516,37 @@
sztmp[32] = 0;
}
}
- if (sztmp[0]) wsprintf(s, "%d: %s", m->instr, sztmp);
+
}
- break;
- case 2:
+ if (sztmp[0]) wsprintf(s, "%d: %s", m->instr, sztmp);
+ }
+ break;
+ case 2:
// display volume command
+ if(m->note == NOTE_PC || m->note == NOTE_PCS)
+ {
+ // display plugin param name.
+ if(m->instr > 0 && m->instr <= MAX_MIXPLUGINS)
+ {
+ CHAR sztmp[128] = "";
+ strncpy(sztmp, pSndFile->m_MixPlugins[m->instr - 1].GetParamName(m->GetValueVolCol()), sizeof(sztmp));
+ SetNullTerminator(sztmp);
+ if (sztmp[0]) wsprintf(s, "%d: %s", m->GetValueVolCol(), sztmp);
+ }
+ } else
+ {
+ // "normal" volume command
if (!pModDoc->GetVolCmdInfo(pModDoc->GetIndexFromVolCmd(m->volcmd), s)) s[0] = 0;
- break;
- case 3:
- case 4:
+ }
+ break;
+ case 3:
+ case 4:
// display effect command
+ if(m->note != NOTE_PC && m->note != NOTE_PCS)
+ {
if (!pModDoc->GetEffectName(s, m->command, m->param, false, nChn)) s[0] = 0;
- break;
}
+ break;
}
}
pMainFrm->SetInfoText(s);
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|