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
(49) |
Jun
(55) |
Jul
(91) |
Aug
(191) |
Sep
|
Oct
(68) |
Nov
|
Dec
|
|
From: <sag...@us...> - 2010-03-19 18:43:56
|
Revision: 535
http://modplug.svn.sourceforge.net/modplug/?rev=535&view=rev
Author: saga-games
Date: 2010-03-19 18:43:47 +0000 (Fri, 19 Mar 2010)
Log Message:
-----------
[Fix] Pattern Editor: Display "fine" / "extra fine" portamento effects properly (S3M/IT/MPTM), display SFx macro properly, display MOD effects with no memory properly.
[Ref] Fixed a path in mptrack.h (which apparently doesn't work in VC6, in which OpenMPT doesn't compile properly anyway)
Modified Paths:
--------------
trunk/OpenMPT/mptrack/Moddoc.cpp
trunk/OpenMPT/mptrack/Mptrack.h
Modified: trunk/OpenMPT/mptrack/Moddoc.cpp
===================================================================
--- trunk/OpenMPT/mptrack/Moddoc.cpp 2010-03-17 23:18:14 UTC (rev 534)
+++ trunk/OpenMPT/mptrack/Moddoc.cpp 2010-03-19 18:43:47 UTC (rev 535)
@@ -2327,7 +2327,7 @@
case CMD_GLOBALVOLSLIDE:
case CMD_CHANNELVOLSLIDE:
case CMD_PANNINGSLIDE:
- if (m_SndFile.m_nType & MOD_TYPE_S3MITMPT)
+ if (m_SndFile.GetType() & MOD_TYPE_S3MITMPT)
{
if (!param) pos = 29; else
if (((param & 0x0F) == 0x0F) && (param & 0xF0))
@@ -2345,7 +2345,7 @@
}
break;
case CMD_PANNING8:
- if(m_SndFile.m_nType & MOD_TYPE_S3M)
+ if(m_SndFile.GetType() == MOD_TYPE_S3M)
{
pos = CLAMP(param, 0, 0x80);
if(param == 0xA4)
@@ -2373,7 +2373,7 @@
case CMD_GLOBALVOLSLIDE:
case CMD_CHANNELVOLSLIDE:
case CMD_PANNINGSLIDE:
- if (m_SndFile.m_nType & MOD_TYPE_S3MITMPT)
+ if (m_SndFile.GetType() & MOD_TYPE_S3MITMPT)
{
if (pos < 15) param = 15-pos; else
if (pos < 29) param = (29-pos) | 0xF0; else
@@ -2387,7 +2387,7 @@
}
break;
case CMD_PANNING8:
- if(m_SndFile.m_nType & MOD_TYPE_S3M)
+ if(m_SndFile.GetType() == MOD_TYPE_S3M)
param = (pos <= 0x80) ? pos : 0xA4;
break;
}
@@ -2398,42 +2398,58 @@
bool CModDoc::GetEffectNameEx(LPSTR pszName, UINT ndx, UINT param)
//----------------------------------------------------------------
{
- CHAR s[64];
+ char s[64];
+ char szContinueOrIgnore[16];
+
if (pszName) pszName[0] = 0;
if ((!pszName) || (ndx >= MAX_FXINFO) || (!gFXInfo[ndx].pszName)) return false;
wsprintf(pszName, "%s: ", gFXInfo[ndx].pszName);
s[0] = 0;
+ // for effects that don't have effect memory in MOD format.
+ if(m_SndFile.GetType() == MOD_TYPE_MOD)
+ strcpy(szContinueOrIgnore, "ignore");
+ else
+ strcpy(szContinueOrIgnore, "continue");
+
std::string sPlusChar = "+", sMinusChar = "-";
switch(gFXInfo[ndx].dwEffect)
{
case CMD_ARPEGGIO:
+ if(m_SndFile.GetType() == MOD_TYPE_XM) // XM also ignores this!
+ strcpy(szContinueOrIgnore, "ignore");
+
if (param)
wsprintf(s, "note+%d note+%d", param >> 4, param & 0x0F);
else
- strcpy(s, "continue");
+ strcpy(s, szContinueOrIgnore);
break;
case CMD_PORTAMENTOUP:
- if (param)
- wsprintf(s, "+%d", param);
- else
- strcpy(s, "continue");
- break;
-
case CMD_PORTAMENTODOWN:
- if (param)
- wsprintf(s, "-%d", param);
+ if(param)
+ {
+ char sign[2];
+ strcpy(sign, (gFXInfo[ndx].dwEffect == CMD_PORTAMENTOUP) ? "+" : "-");
+ if((m_SndFile.GetType() & MOD_TYPE_S3MITMPT) && ((param & 0xF0) == 0xF0))
+ wsprintf(s, "fine %s%d", sign, (param & 0x0F));
+ else if((m_SndFile.GetType() & MOD_TYPE_S3MITMPT) && ((param & 0xF0) == 0xE0))
+ wsprintf(s, "extra fine %s%d", sign, (param & 0x0F));
+ else
+ wsprintf(s, "%s%d", sign, param);
+ }
else
- strcpy(s, "continue");
+ {
+ strcpy(s, szContinueOrIgnore);
+ }
break;
case CMD_TONEPORTAMENTO:
if (param)
wsprintf(s, "speed %d", param);
else
- strcpy(s, "continue");
+ strcpy(s, szContinueOrIgnore);
break;
case CMD_VIBRATO:
@@ -2443,7 +2459,7 @@
if (param)
wsprintf(s, "speed=%d depth=%d", param >> 4, param & 0x0F);
else
- strcpy(s, "continue");
+ strcpy(s, szContinueOrIgnore);
break;
case CMD_SPEED:
@@ -2500,7 +2516,7 @@
case CMD_PANNINGSLIDE:
if(gFXInfo[ndx].dwEffect == CMD_PANNINGSLIDE)
{
- if(m_SndFile.m_nType & MOD_TYPE_XM)
+ if(m_SndFile.GetType() == MOD_TYPE_XM)
{
sPlusChar = "-> ";
sMinusChar = "<- ";
@@ -2516,11 +2532,11 @@
{
wsprintf(s, "continue");
} else
- if ((m_SndFile.m_nType & MOD_TYPE_S3MITMPT) && ((param & 0x0F) == 0x0F) && (param & 0xF0))
+ if ((m_SndFile.GetType() & MOD_TYPE_S3MITMPT) && ((param & 0x0F) == 0x0F) && (param & 0xF0))
{
wsprintf(s, "fine %s%d", sPlusChar.c_str(), param >> 4);
} else
- if ((m_SndFile.m_nType & MOD_TYPE_S3MITMPT) && ((param & 0xF0) == 0xF0) && (param & 0x0F))
+ if ((m_SndFile.GetType() & MOD_TYPE_S3MITMPT) && ((param & 0xF0) == 0xF0) && (param & 0x0F))
{
wsprintf(s, "fine %s%d", sMinusChar.c_str(), param & 0x0F);
} else
@@ -2706,8 +2722,9 @@
strcat(s, " rows");
break;
case 0xF0: // macro
- if(m_SndFile.m_nType & MOD_TYPE_MOD)
- wsprintf(s, "SF%X", param & 0x0F); break;
+ if(m_SndFile.GetType() != MOD_TYPE_MOD)
+ wsprintf(s, "SF%X", param & 0x0F);
+ break;
default:
break;
}
@@ -2754,7 +2771,7 @@
strcat(s, " rows");
break;
case 0xF0:
- if(m_SndFile.m_nType & MOD_TYPE_MOD) // invert loop
+ if(m_SndFile.GetType() == MOD_TYPE_MOD) // invert loop
{
if((param & 0x0F) == 0)
strcpy(s, "Stop");
@@ -3514,4 +3531,4 @@
displayName.Format(TEXT("%s (%s)"), (LPCTSTR)instrumentName, (LPCTSTR)pluginName);
}
return displayName;
-}
+}
\ No newline at end of file
Modified: trunk/OpenMPT/mptrack/Mptrack.h
===================================================================
--- trunk/OpenMPT/mptrack/Mptrack.h 2010-03-17 23:18:14 UTC (rev 534)
+++ trunk/OpenMPT/mptrack/Mptrack.h 2010-03-19 18:43:47 UTC (rev 535)
@@ -13,7 +13,7 @@
#endif
#include "resource.h" // main symbols
-#include "sndfile.h"
+#include "../soundlib/Sndfile.h"
#include <windows.h>
#ifdef UPDATECHECKENABLED
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <sag...@us...> - 2010-03-17 23:18:23
|
Revision: 534
http://modplug.svn.sourceforge.net/modplug/?rev=534&view=rev
Author: saga-games
Date: 2010-03-17 23:18:14 +0000 (Wed, 17 Mar 2010)
Log Message:
-----------
[Fix] Pattern Editor: In the note properties, the Gxx effect for XM files was not limited properly.
[Imp] Pattern Editor: Instead of simply ignoring note off/cut/fade when working with .MOD files, it is converted to C00.
Modified Paths:
--------------
trunk/OpenMPT/mptrack/Moddoc.cpp
trunk/OpenMPT/mptrack/View_pat.cpp
Modified: trunk/OpenMPT/mptrack/Moddoc.cpp
===================================================================
--- trunk/OpenMPT/mptrack/Moddoc.cpp 2010-03-15 20:27:57 UTC (rev 533)
+++ trunk/OpenMPT/mptrack/Moddoc.cpp 2010-03-17 23:18:14 UTC (rev 534)
@@ -2288,7 +2288,7 @@
else nmax = 0xFF;
break;
case CMD_GLOBALVOLUME:
- nmax = (nType & MOD_TYPE_IT | MOD_TYPE_MPT) ? 128 : 64;
+ nmax = (nType & (MOD_TYPE_IT|MOD_TYPE_MPT)) ? 128 : 64;
break;
case CMD_MODCMDEX:
Modified: trunk/OpenMPT/mptrack/View_pat.cpp
===================================================================
--- trunk/OpenMPT/mptrack/View_pat.cpp 2010-03-15 20:27:57 UTC (rev 533)
+++ trunk/OpenMPT/mptrack/View_pat.cpp 2010-03-17 23:18:14 UTC (rev 534)
@@ -4157,6 +4157,14 @@
else if( note < pSndFile->GetModSpecifications().noteMin)
note = pSndFile->GetModSpecifications().noteMin;
+ // Special case: Convert note off commands to C00 for MOD files
+ if((pSndFile->GetType() == MOD_TYPE_MOD) && (note == NOTE_NOTECUT || note == NOTE_FADE || note == NOTE_KEYOFF))
+ {
+ TempEnterFX(CMD_VOLUME);
+ TempEnterFXparam(0);
+ return;
+ }
+
// Check whether the module format supports the note.
if( pSndFile->GetModSpecifications().HasNote(note) == false )
return;
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <sag...@us...> - 2010-03-15 20:28:07
|
Revision: 533
http://modplug.svn.sourceforge.net/modplug/?rev=533&view=rev
Author: saga-games
Date: 2010-03-15 20:27:57 +0000 (Mon, 15 Mar 2010)
Log Message:
-----------
[Imp] MT2 Loader: Make use of the "lines per beat" header field.
[Imp] VST Editor: Added shortcuts for "toggle bypass", "pass keys to plug" and "record params to pattern"
[Mod] Keymaps: Updated DE_jojo.mkb with the new VST Editor shortcuts.
Modified Paths:
--------------
trunk/OpenMPT/mptrack/AbstractVstEditor.cpp
trunk/OpenMPT/mptrack/CommandSet.cpp
trunk/OpenMPT/mptrack/CommandSet.h
trunk/OpenMPT/packageTemplate/extraKeymaps/DE_jojo.mkb
trunk/OpenMPT/soundlib/Load_mt2.cpp
Modified: trunk/OpenMPT/mptrack/AbstractVstEditor.cpp
===================================================================
--- trunk/OpenMPT/mptrack/AbstractVstEditor.cpp 2010-03-14 18:43:27 UTC (rev 532)
+++ trunk/OpenMPT/mptrack/AbstractVstEditor.cpp 2010-03-15 20:27:57 UTC (rev 533)
@@ -311,13 +311,14 @@
switch(wParam)
{
- case kcVSTGUIPrevPreset: OnSetPreviousVSTPreset(); return wParam;
- case kcVSTGUIPrevPresetJump:OnVSTPresetBackwardJump(); return wParam;
- case kcVSTGUINextPreset: OnSetNextVSTPreset(); return wParam;
- case kcVSTGUINextPresetJump:OnVSTPresetForwardJump(); return wParam;
- case kcVSTGUIRandParams: OnRandomizePreset() ; return wParam;
-
-
+ case kcVSTGUIPrevPreset: OnSetPreviousVSTPreset(); return wParam;
+ case kcVSTGUIPrevPresetJump: OnVSTPresetBackwardJump(); return wParam;
+ case kcVSTGUINextPreset: OnSetNextVSTPreset(); return wParam;
+ case kcVSTGUINextPresetJump: OnVSTPresetForwardJump(); return wParam;
+ case kcVSTGUIRandParams: OnRandomizePreset() ; return wParam;
+ case kcVSTGUIToggleRecordParams: OnRecordAutomation(); return wParam;
+ case kcVSTGUIToggleSendKeysToPlug: OnPassKeypressesToPlug(); return wParam;
+ case kcVSTGUIBypassPlug: OnBypassPlug(); return wParam;
}
if (wParam>=kcVSTGUIStartNotes && wParam<=kcVSTGUIEndNotes)
{
@@ -590,21 +591,22 @@
void CAbstractVstEditor::UpdateOptionsMenu() {
//--------------------------------------------
- if (m_pOptionsMenu->m_hMenu) {
+ if (m_pOptionsMenu->m_hMenu)
m_pOptionsMenu->DestroyMenu();
- }
+ CInputHandler* ih = (CMainFrame::GetMainFrame())->GetInputHandler();
+
m_pOptionsMenu->CreatePopupMenu();
//Bypass
m_pOptionsMenu->AppendMenu(MF_STRING | m_pVstPlugin->IsBypassed()?MF_CHECKED:0,
- ID_PLUG_BYPASS, "&Bypass");
+ ID_PLUG_BYPASS, "&Bypass\t" + ih->GetKeyTextFromCommand(kcVSTGUIBypassPlug));
//Record Params
m_pOptionsMenu->AppendMenu(MF_STRING | m_pVstPlugin->m_bRecordAutomation?MF_CHECKED:0,
- ID_PLUG_RECORDAUTOMATION, "Record &Params");
+ ID_PLUG_RECORDAUTOMATION, "Record &Params\t" + ih->GetKeyTextFromCommand(kcVSTGUIToggleRecordParams));
//Pass on keypresses
m_pOptionsMenu->AppendMenu(MF_STRING | m_pVstPlugin->m_bPassKeypressesToPlug?MF_CHECKED:0,
- ID_PLUG_PASSKEYS, "Pass &Keys to Plug");
+ ID_PLUG_PASSKEYS, "Pass &Keys to Plug\t" + ih->GetKeyTextFromCommand(kcVSTGUIToggleSendKeysToPlug));
m_pMenu->DeleteMenu(3, MF_BYPOSITION);
Modified: trunk/OpenMPT/mptrack/CommandSet.cpp
===================================================================
--- trunk/OpenMPT/mptrack/CommandSet.cpp 2010-03-14 18:43:27 UTC (rev 532)
+++ trunk/OpenMPT/mptrack/CommandSet.cpp 2010-03-15 20:27:57 UTC (rev 533)
@@ -2575,6 +2575,21 @@
commands[kcInstrumentEnvelopeZoomOut].isDummy = false;
commands[kcInstrumentEnvelopeZoomOut].Message = "Zoom Out";
+ commands[kcVSTGUIToggleRecordParams].UID = 1839;
+ commands[kcVSTGUIToggleRecordParams].isHidden = false;
+ commands[kcVSTGUIToggleRecordParams].isDummy = false;
+ commands[kcVSTGUIToggleRecordParams].Message = "Toggle parameter recording";
+
+ commands[kcVSTGUIToggleSendKeysToPlug].UID = 1840;
+ commands[kcVSTGUIToggleSendKeysToPlug].isHidden = false;
+ commands[kcVSTGUIToggleSendKeysToPlug].isDummy = false;
+ commands[kcVSTGUIToggleSendKeysToPlug].Message = "Pass key presses to plugin";
+
+ commands[kcVSTGUIBypassPlug].UID = 1841;
+ commands[kcVSTGUIBypassPlug].isHidden = false;
+ commands[kcVSTGUIBypassPlug].isDummy = false;
+ commands[kcVSTGUIBypassPlug].Message = "Bypass plugin";
+
#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-03-14 18:43:27 UTC (rev 532)
+++ trunk/OpenMPT/mptrack/CommandSet.h 2010-03-15 20:27:57 UTC (rev 533)
@@ -983,7 +983,10 @@
kcVSTGUIPrevPresetJump,
kcVSTGUINextPresetJump,
kcVSTGUIRandParams,
- kcEndVSTGUICommands=kcVSTGUIRandParams,
+ kcVSTGUIToggleRecordParams,
+ kcVSTGUIToggleSendKeysToPlug,
+ kcVSTGUIBypassPlug,
+ kcEndVSTGUICommands=kcVSTGUIBypassPlug,
kcStartOrderlistCommands,
// Orderlist edit
Modified: trunk/OpenMPT/packageTemplate/extraKeymaps/DE_jojo.mkb
===================================================================
--- trunk/OpenMPT/packageTemplate/extraKeymaps/DE_jojo.mkb 2010-03-14 18:43:27 UTC (rev 532)
+++ trunk/OpenMPT/packageTemplate/extraKeymaps/DE_jojo.mkb 2010-03-15 20:27:57 UTC (rev 533)
@@ -306,7 +306,10 @@
13:1764:0:39:1 //Next plugin preset: NACH-RECHTS (KeyDown)
13:1782:0:38:1 //Plugin preset backward jump: NACH-OBEN (KeyDown)
13:1783:0:40:1 //Plugin preset forward jump: NACH-UNTEN (KeyDown)
-13:1765:2:82:1 //Randomize plugin parameters: Ctrl+R (KeyDown)
+13:1765:2:80:1 //Randomize plugin parameters: Ctrl+P (KeyDown)
+13:1839:2:82:1 //Toggle parameter recording: Ctrl+R (KeyDown)
+13:1840:2:75:1 //Pass key presses to plugin: Ctrl+K (KeyDown)
+13:1841:2:66:1 //Bypass plugin: Ctrl+B (KeyDown)
//----( General Context [top] (14) )------------
Modified: trunk/OpenMPT/soundlib/Load_mt2.cpp
===================================================================
--- trunk/OpenMPT/soundlib/Load_mt2.cpp 2010-03-14 18:43:27 UTC (rev 532)
+++ trunk/OpenMPT/soundlib/Load_mt2.cpp 2010-03-15 20:27:57 UTC (rev 533)
@@ -202,6 +202,8 @@
m_nDefaultSpeed = pfh->bTicksPerLine;
m_nDefaultTempo = 125;
m_dwSongFlags = SONG_ITCOMPATMODE;
+ m_nRowsPerBeat = pfh->bLinesPerBeat;
+ m_nRowsPerMeasure = m_nRowsPerBeat * 4;
if ((pfh->wSamplesPerTick > 100) && (pfh->wSamplesPerTick < 5000))
{
m_nDefaultTempo = 110250 / pfh->wSamplesPerTick;
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <sag...@us...> - 2010-03-14 18:43:37
|
Revision: 532
http://modplug.svn.sourceforge.net/modplug/?rev=532&view=rev
Author: saga-games
Date: 2010-03-14 18:43:27 +0000 (Sun, 14 Mar 2010)
Log Message:
-----------
[Fix] Comments tab: Correct C-5 frequency is now also shown if the module is an XM file.
[Fix] Slightly better MT2 (MadTracker) handling: Release node is not set anymore for each and every instrument envelope. MT2 files are now loaded as IT files by default (instead of XM) because of their extended instrument properties (NNAs, filters, etc) - I wonder what this breaks, but I don't bother because MT2 support was already 100% broken before this. :) Some MT example tunes sound a bit better now at least.
[Imp] Pattern Editor: Since the behaviour of sliding commands with both nibbles set varies from tracker to tracker, "undefined" is always shown in the note properties in such cases.
[Imp] Module creation: When creating a new .MOD, it has 31 samples by default.
[Ref] IsPortable is now static.
[Ref] Some minor refactoring.
Modified Paths:
--------------
trunk/OpenMPT/mptrack/Moddoc.cpp
trunk/OpenMPT/mptrack/Mptrack.cpp
trunk/OpenMPT/mptrack/Mptrack.h
trunk/OpenMPT/mptrack/View_ins.cpp
trunk/OpenMPT/mptrack/view_com.cpp
trunk/OpenMPT/soundlib/Load_mt2.cpp
trunk/OpenMPT/soundlib/Sndfile.cpp
Modified: trunk/OpenMPT/mptrack/Moddoc.cpp
===================================================================
--- trunk/OpenMPT/mptrack/Moddoc.cpp 2010-03-14 14:26:37 UTC (rev 531)
+++ trunk/OpenMPT/mptrack/Moddoc.cpp 2010-03-14 18:43:27 UTC (rev 532)
@@ -338,14 +338,15 @@
case MOD_TYPE_OKT:
case MOD_TYPE_AMS:
case MOD_TYPE_MT2:
- m_SndFile.ChangeModTypeTo(MOD_TYPE_XM);
+ m_SndFile.ChangeModTypeTo(MOD_TYPE_IT);
+ /*m_SndFile.ChangeModTypeTo(MOD_TYPE_XM);
if ((m_SndFile.m_nDefaultTempo == 125) && (m_SndFile.m_nDefaultSpeed == 6) && (!m_SndFile.m_nInstruments))
{
m_SndFile.m_nType = MOD_TYPE_MOD;
for (UINT i=0; i<m_SndFile.Patterns.Size(); i++)
if ((m_SndFile.Patterns[i]) && (m_SndFile.PatternSize[i] != 64))
m_SndFile.m_nType = MOD_TYPE_XM;
- }
+ }*/
break;
case MOD_TYPE_FAR:
case MOD_TYPE_PTM:
@@ -654,7 +655,7 @@
m_SndFile.m_nSamplePreAmp = m_SndFile.m_nVSTiVolume = 128;
}
- for (CHANNELINDEX nChn=0; nChn < MAX_BASECHANNELS; nChn++)
+ for (CHANNELINDEX nChn = 0; nChn < MAX_BASECHANNELS; nChn++)
{
m_SndFile.ChnSettings[nChn].dwFlags = 0;
m_SndFile.ChnSettings[nChn].nVolume = 64;
@@ -667,7 +668,7 @@
if (!m_SndFile.m_nSamples)
{
strcpy(m_SndFile.m_szNames[1], "untitled");
- m_SndFile.m_nSamples = 1;
+ m_SndFile.m_nSamples = (GetModType() == MOD_TYPE_MOD) ? 31 : 1;
ctrlSmp::ResetSamples(m_SndFile, ctrlSmp::SmpResetInit);
@@ -2523,6 +2524,10 @@
{
wsprintf(s, "fine %s%d", sMinusChar.c_str(), param & 0x0F);
} else
+ if ((param & 0x0F) != param && (param & 0xF0) != param) // both nibbles are set.
+ {
+ strcpy(s, "undefined");
+ } else
if (param & 0x0F)
{
wsprintf(s, "%s%d", sMinusChar.c_str(), param & 0x0F);
@@ -2946,6 +2951,7 @@
}
int CModDoc::GetMacroType(CString value)
+//--------------------------------------
{
if (value.Compare("")==0) return sfx_unused;
if (value.Compare("F0F000z")==0) return sfx_cutoff;
@@ -2960,6 +2966,7 @@
}
int CModDoc::MacroToPlugParam(CString macro)
+//------------------------------------------
{
int code=0;
char* param = (char *) (LPCTSTR) macro;
@@ -2975,7 +2982,9 @@
return (code+128);
}
}
-int CModDoc::MacroToMidiCC(CString macro) {
+int CModDoc::MacroToMidiCC(CString macro)
+//---------------------------------------
+{
int code=0;
char* param = (char *) (LPCTSTR) macro;
param +=2;
@@ -2987,8 +2996,9 @@
return code;
}
-int CModDoc::FindMacroForParam(long param) {
-//------------------------------------------
+int CModDoc::FindMacroForParam(long param)
+//----------------------------------------
+{
for (int macro=0; macro<16; macro++) { //what's the named_const for num macros?? :D
CString macroString = &(GetSoundFile()->m_MidiCfg.szMidiSFXExt[macro*32]);
if (GetMacroType(macroString) == sfx_plug && MacroToPlugParam(macroString) == param) {
Modified: trunk/OpenMPT/mptrack/Mptrack.cpp
===================================================================
--- trunk/OpenMPT/mptrack/Mptrack.cpp 2010-03-14 14:26:37 UTC (rev 531)
+++ trunk/OpenMPT/mptrack/Mptrack.cpp 2010-03-14 18:43:27 UTC (rev 532)
@@ -253,6 +253,7 @@
TCHAR CTrackApp::m_szExePath[_MAX_PATH] = TEXT("");
+bool CTrackApp::m_bPortableMode = false;
/////////////////////////////////////////////////////////////////////////////
// MPTRACK Command Line options
Modified: trunk/OpenMPT/mptrack/Mptrack.h
===================================================================
--- trunk/OpenMPT/mptrack/Mptrack.h 2010-03-14 14:26:37 UTC (rev 531)
+++ trunk/OpenMPT/mptrack/Mptrack.h 2010-03-14 18:43:27 UTC (rev 532)
@@ -158,7 +158,7 @@
TCHAR m_szConfigFileName[_MAX_PATH];
TCHAR m_szPluginCacheFileName[_MAX_PATH];
TCHAR m_szStringsFileName[_MAX_PATH];
- bool m_bPortableMode;
+ static bool m_bPortableMode;
#ifdef UPDATECHECKENABLED
// Internet request context
@@ -202,7 +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; }
+ static bool IsPortableMode() { return m_bPortableMode; }
LPCSTR GetPluginCacheFileName() const { return m_szPluginCacheFileName; }
LPCSTR GetConfigPath() const { return m_szConfigDirectory; }
void SetupPaths();
Modified: trunk/OpenMPT/mptrack/View_ins.cpp
===================================================================
--- trunk/OpenMPT/mptrack/View_ins.cpp 2010-03-14 14:26:37 UTC (rev 531)
+++ trunk/OpenMPT/mptrack/View_ins.cpp 2010-03-14 18:43:27 UTC (rev 532)
@@ -223,28 +223,12 @@
UINT CViewInstrument::EnvGetTick(int nPoint) const
//------------------------------------------------
{
- CModDoc *pModDoc = GetDocument();
- if (pModDoc)
- {
- CSoundFile *pSndFile = pModDoc->GetSoundFile();
- MODINSTRUMENT *pIns = pSndFile->Instruments[m_nInstrument];
- if ((pIns) && (nPoint >= 0))
- {
- switch(m_nEnv)
- {
- case ENV_VOLUME:
- if (nPoint < (int)pIns->VolEnv.nNodes) return pIns->VolEnv.Ticks[nPoint];
- break;
- case ENV_PANNING:
- if (nPoint < (int)pIns->PanEnv.nNodes) return pIns->PanEnv.Ticks[nPoint];
- break;
- case ENV_PITCH:
- if (nPoint < (int)pIns->PitchEnv.nNodes) return pIns->PitchEnv.Ticks[nPoint];
- break;
- }
- }
- }
- return 0;
+ INSTRUMENTENVELOPE *envelope = GetEnvelopePtr();
+ if(envelope == nullptr) return 0;
+ if((nPoint >= 0) && (nPoint < (int)envelope->nNodes))
+ return envelope->Ticks[nPoint];
+ else
+ return 0;
}
@@ -253,8 +237,10 @@
{
INSTRUMENTENVELOPE *envelope = GetEnvelopePtr();
if(envelope == nullptr) return 0;
- if(nPoint >= 0 && nPoint < (int)envelope->nNodes) return envelope->Values[nPoint];
- return 0;
+ if(nPoint >= 0 && nPoint < (int)envelope->nNodes)
+ return envelope->Values[nPoint];
+ else
+ return 0;
}
Modified: trunk/OpenMPT/mptrack/view_com.cpp
===================================================================
--- trunk/OpenMPT/mptrack/view_com.cpp 2010-03-14 14:26:37 UTC (rev 531)
+++ trunk/OpenMPT/mptrack/view_com.cpp 2010-03-14 18:43:27 UTC (rev 532)
@@ -298,7 +298,7 @@
{
wsprintf(s, "%d Hz",
pSndFile->GetFreqFromPeriod(
- pSndFile->GetPeriodFromNote(NOTE_MIDDLEC, pSmp->nFineTune, pSmp->nC5Speed),
+ pSndFile->GetPeriodFromNote(NOTE_MIDDLEC + pSmp->RelativeTone, pSmp->nFineTune, pSmp->nC5Speed),
pSmp->nC5Speed));
}
break;
Modified: trunk/OpenMPT/soundlib/Load_mt2.cpp
===================================================================
--- trunk/OpenMPT/soundlib/Load_mt2.cpp 2010-03-14 14:26:37 UTC (rev 531)
+++ trunk/OpenMPT/soundlib/Load_mt2.cpp 2010-03-14 18:43:27 UTC (rev 532)
@@ -124,7 +124,7 @@
#pragma pack()
-static VOID ConvertMT2Command(CSoundFile *that, MODCOMMAND *m, MT2COMMAND *p)
+static void ConvertMT2Command(CSoundFile *that, MODCOMMAND *m, MT2COMMAND *p)
//---------------------------------------------------------------------------
{
// Note
@@ -172,6 +172,7 @@
m->command = p->fxparam2;
m->param = p->fxparam1;
that->ConvertModCommand(m);
+ that->MODExx2S3MSxx(m);
} else
{
// TODO: MT2 Effects
@@ -200,6 +201,7 @@
m_nRestartPos = pfh->wRestart;
m_nDefaultSpeed = pfh->bTicksPerLine;
m_nDefaultTempo = 125;
+ m_dwSongFlags = SONG_ITCOMPATMODE;
if ((pfh->wSamplesPerTick > 100) && (pfh->wSamplesPerTick < 5000))
{
m_nDefaultTempo = 110250 / pfh->wSamplesPerTick;
@@ -406,9 +408,9 @@
Instruments[iIns] = pIns;
if (pIns)
{
- memset(pIns, 0, sizeof(MODINSTRUMENT));
+ memcpy(Instruments[iIns], &m_defaultInstrument, sizeof(MODINSTRUMENT));
memcpy(pIns->name, pmi->szName, 32);
- SpaceToNullStringFixed(pIns->name, 32);
+ SpaceToNullStringFixed(pIns->name, 31);
pIns->nGlobalVol = 64;
pIns->nPan = 128;
for (BYTE i = 0; i < NOTE_MAX; i++)
Modified: trunk/OpenMPT/soundlib/Sndfile.cpp
===================================================================
--- trunk/OpenMPT/soundlib/Sndfile.cpp 2010-03-14 14:26:37 UTC (rev 531)
+++ trunk/OpenMPT/soundlib/Sndfile.cpp 2010-03-14 18:43:27 UTC (rev 532)
@@ -1414,7 +1414,7 @@
return MOD_TYPE_MOD;
if (m_nType & (MOD_TYPE_S3M|MOD_TYPE_STM|MOD_TYPE_ULT|MOD_TYPE_FAR|MOD_TYPE_PTM))
return MOD_TYPE_S3M;
- if (m_nType & (MOD_TYPE_XM|MOD_TYPE_MED|MOD_TYPE_MTM|MOD_TYPE_MT2))
+ if (m_nType & (MOD_TYPE_XM|MOD_TYPE_MED|MOD_TYPE_MTM/*|MOD_TYPE_MT2*/))
return MOD_TYPE_XM;
if(m_nType & MOD_TYPE_MPT)
return MOD_TYPE_MPT;
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <sag...@us...> - 2010-03-14 14:26:47
|
Revision: 531
http://modplug.svn.sourceforge.net/modplug/?rev=531&view=rev
Author: saga-games
Date: 2010-03-14 14:26:37 +0000 (Sun, 14 Mar 2010)
Log Message:
-----------
[Fix] Pattern Editor: Entered (volume) effects are now properly checked (makes a difference f.e. in MOD format where it was previously possible to enter effects like Hxx)
Modified Paths:
--------------
trunk/OpenMPT/mptrack/View_pat.cpp
Modified: trunk/OpenMPT/mptrack/View_pat.cpp
===================================================================
--- trunk/OpenMPT/mptrack/View_pat.cpp 2010-03-13 22:34:51 UTC (rev 530)
+++ trunk/OpenMPT/mptrack/View_pat.cpp 2010-03-14 14:26:37 UTC (rev 531)
@@ -3724,7 +3724,6 @@
{
CSoundFile *pSndFile = pModDoc->GetSoundFile();
- if(pSndFile->m_nType & MOD_TYPE_MOD) return; // no volume column
PrepareUndo(m_dwBeginSel, m_dwEndSel);
@@ -3772,8 +3771,11 @@
}
if (vol > max) vol %= 10;
- p->volcmd = volcmd;
- p->vol = vol;
+ if(pSndFile->GetModSpecifications().HasVolCommand(volcmd))
+ {
+ p->volcmd = volcmd;
+ p->vol = vol;
+ }
}
if (IsEditingEnabled_bmsg())
@@ -3808,7 +3810,7 @@
void CViewPattern::TempEnterFX(int c)
-//---------------------------------------------------------
+//-----------------------------------
{
CMainFrame *pMainFrm = CMainFrame::GetMainFrame();
CModDoc *pModDoc = GetDocument();
@@ -3828,7 +3830,7 @@
{
ENTER_PCNOTE_VALUE(c, ValueEffectCol);
}
- else
+ else if(pSndFile->GetModSpecifications().HasCommand(c))
{
//LPCSTR lpcmd = (pSndFile->m_nType & (MOD_TYPE_MOD|MOD_TYPE_XM)) ? gszModCommands : gszS3mCommands;
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <sag...@us...> - 2010-03-13 22:34:58
|
Revision: 530
http://modplug.svn.sourceforge.net/modplug/?rev=530&view=rev
Author: saga-games
Date: 2010-03-13 22:34:51 +0000 (Sat, 13 Mar 2010)
Log Message:
-----------
[Fix] IT compatibility: ignore slide commands with both nibbles set (f.e. D55, PA1, ...)
Modified Paths:
--------------
trunk/OpenMPT/soundlib/Snd_fx.cpp
Modified: trunk/OpenMPT/soundlib/Snd_fx.cpp
===================================================================
--- trunk/OpenMPT/soundlib/Snd_fx.cpp 2010-03-13 16:02:46 UTC (rev 529)
+++ trunk/OpenMPT/soundlib/Snd_fx.cpp 2010-03-13 22:34:51 UTC (rev 530)
@@ -2408,7 +2408,10 @@
void CSoundFile::VolumeSlide(MODCHANNEL *pChn, UINT param)
//--------------------------------------------------------
{
- if (param) pChn->nOldVolumeSlide = param; else param = pChn->nOldVolumeSlide;
+ if (param)
+ pChn->nOldVolumeSlide = param;
+ else
+ param = pChn->nOldVolumeSlide;
LONG newvolume = pChn->nVolume;
if (m_nType & (MOD_TYPE_S3M|MOD_TYPE_IT|MOD_TYPE_MPT|MOD_TYPE_STM|MOD_TYPE_AMF))
{
@@ -2443,9 +2446,18 @@
}
if ((!(m_dwSongFlags & SONG_FIRSTTICK)) || (m_dwSongFlags & SONG_FASTVOLSLIDES))
{
- if (param & 0x0F) newvolume -= (int)((param & 0x0F) * 4);
- else newvolume += (int)((param & 0xF0) >> 2);
- if (m_nType & MOD_TYPE_MOD) pChn->dwFlags |= CHN_FASTVOLRAMP;
+ // IT compatibility: Ignore slide commands with both nibbles set.
+ if (param & 0x0F)
+ {
+ if(!IsCompatibleMode(TRK_IMPULSETRACKER) || (param & 0xF0) == 0)
+ newvolume -= (int)((param & 0x0F) * 4);
+ }
+ else
+ {
+ if(!IsCompatibleMode(TRK_IMPULSETRACKER) || (param & 0x0F) == 0)
+ newvolume += (int)((param & 0xF0) >> 2);
+ }
+ if (m_nType == MOD_TYPE_MOD) pChn->dwFlags |= CHN_FASTVOLRAMP;
}
newvolume = CLAMP(newvolume, 0, 256);
@@ -2457,7 +2469,10 @@
//---------------------------------------------------------
{
LONG nPanSlide = 0;
- if (param) pChn->nOldPanSlide = param; else param = pChn->nOldPanSlide;
+ if (param)
+ pChn->nOldPanSlide = param;
+ else
+ param = pChn->nOldPanSlide;
if (m_nType & (MOD_TYPE_S3M|MOD_TYPE_IT|MOD_TYPE_MPT|MOD_TYPE_STM))
{
if (((param & 0x0F) == 0x0F) && (param & 0xF0))
@@ -2486,8 +2501,17 @@
{
if (!(m_dwSongFlags & SONG_FIRSTTICK))
{
- if (param & 0x0F) nPanSlide = -(int)((param & 0x0F) << 2);
- else nPanSlide = (int)((param & 0xF0) >> 2);
+ // IT compatibility: Ignore slide commands with both nibbles set.
+ if (param & 0x0F)
+ {
+ if(!IsCompatibleMode(TRK_IMPULSETRACKER) || (param & 0xF0) == 0)
+ nPanSlide = -(int)((param & 0x0F) << 2);
+ }
+ else
+ {
+ if(!IsCompatibleMode(TRK_IMPULSETRACKER) || (param & 0x0F) == 0)
+ nPanSlide = (int)((param & 0xF0) >> 2);
+ }
// XM compatibility: FT2's panning slide is not as deep
if(IsCompatibleMode(TRK_FASTTRACKER2))
nPanSlide >>= 2;
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <sag...@us...> - 2010-03-13 16:02:53
|
Revision: 529
http://modplug.svn.sourceforge.net/modplug/?rev=529&view=rev
Author: saga-games
Date: 2010-03-13 16:02:46 +0000 (Sat, 13 Mar 2010)
Log Message:
-----------
[Ref] Removed unnecessary ancient code change comments, fixed some compiler warnings in sample editor
Modified Paths:
--------------
trunk/OpenMPT/mptrack/Ctrl_smp.cpp
trunk/OpenMPT/mptrack/Ctrl_smp.h
trunk/OpenMPT/mptrack/View_smp.cpp
Modified: trunk/OpenMPT/mptrack/Ctrl_smp.cpp
===================================================================
--- trunk/OpenMPT/mptrack/Ctrl_smp.cpp 2010-03-13 14:17:33 UTC (rev 528)
+++ trunk/OpenMPT/mptrack/Ctrl_smp.cpp 2010-03-13 16:02:46 UTC (rev 529)
@@ -53,8 +53,6 @@
#define BASENOTE_MIN (1*12) // C-1
#define BASENOTE_MAX (9*12) // C-9
-#pragma warning(disable:4244)
-
BEGIN_MESSAGE_MAP(CCtrlSamples, CModControlDlg)
//{{AFX_MSG_MAP(CCtrlSamples)
ON_WM_VSCROLL()
@@ -321,12 +319,12 @@
}
-BOOL CCtrlSamples::SetCurrentSample(UINT nSmp, LONG lZoom, BOOL bUpdNum)
-//----------------------------------------------------------------------
+bool CCtrlSamples::SetCurrentSample(SAMPLEINDEX nSmp, LONG lZoom, bool bUpdNum)
+//-----------------------------------------------------------------------------
{
CModDoc *pModDoc = GetDocument();
CSoundFile *pSndFile;
- if (!pModDoc) return FALSE;
+ if (!pModDoc) return false;
pSndFile = pModDoc->GetSoundFile();
if (pSndFile->m_nSamples < 1) pSndFile->m_nSamples = 1;
if ((nSmp < 1) || (nSmp > pSndFile->m_nSamples)) return FALSE;
@@ -335,7 +333,6 @@
if (m_nSample != nSmp)
{
m_nSample = nSmp;
- // 05/01/05 : ericus replaced "m_nSample << 24" by "m_nSample << 20" : 4000 samples -> 12bits [see Moddoc.h]
UpdateView((m_nSample << HINT_SHIFT_SMP) | HINT_SAMPLEINFO, NULL);
}
if (bUpdNum)
@@ -349,7 +346,7 @@
m_ComboZoom.SetCurSel(lZoom);
PostViewMessage(VIEWMSG_SETCURRENTSAMPLE, (lZoom << 16) | m_nSample);
UnlockControls();
- return TRUE;
+ return true;
}
@@ -392,12 +389,11 @@
}
}
}
- SetCurrentSample((lParam > 0) ? lParam : m_nSample);
+ SetCurrentSample((lParam > 0) ? ((SAMPLEINDEX)lParam) : m_nSample);
- m_nFinetuneStep = CMainFrame::GetPrivateProfileLong("Sample Editor", "FinetuneStep", 25, theApp.GetConfigFileName());
+ m_nFinetuneStep = (uint16)GetPrivateProfileInt("Sample Editor", "FinetuneStep", 25, theApp.GetConfigFileName());
// Initial Update
- // 05/01/05 : ericus replaced "m_nSample << 24" by "m_nSample << 20" : 4000 samples -> 12bits [see Moddoc.h]
if (!m_bInitialized) UpdateView((m_nSample << HINT_SHIFT_SMP) | HINT_SAMPLEINFO | HINT_MODTYPE, NULL);
CChildFrame *pFrame = (CChildFrame *)GetParentFrame();
if ((pFrame) && (m_hWndView)) PostViewMessage(VIEWMSG_LOADSTATE, (LPARAM)pFrame->GetSampleViewState());
@@ -428,7 +424,7 @@
break;
case CTRLMSG_SMP_OPENFILE:
- if (lParam) return OpenSample((LPCSTR)lParam);
+ if (lParam) return OpenSample((LPCSTR)lParam) ? TRUE : FALSE;
break;
case CTRLMSG_SMP_SONGDROP:
@@ -437,7 +433,7 @@
LPDRAGONDROP pDropInfo = (LPDRAGONDROP)lParam;
CSoundFile *pSndFile = (CSoundFile *)(pDropInfo->lDropParam);
if (pDropInfo->pModDoc) pSndFile = pDropInfo->pModDoc->GetSoundFile();
- if (pSndFile) return OpenSample(pSndFile, pDropInfo->dwDropItem);
+ if (pSndFile) return OpenSample(pSndFile, (SAMPLEINDEX)pDropInfo->dwDropItem) ? TRUE : FALSE;
}
break;
@@ -446,7 +442,7 @@
break;
case CTRLMSG_SETCURRENTINSTRUMENT:
- SetCurrentSample(lParam, -1, TRUE);
+ SetCurrentSample((SAMPLEINDEX)lParam, -1, TRUE);
break;
//rewbs.customKeys
@@ -535,8 +531,6 @@
m_ToolBar2.UpdateStyle();
}
if (!(dwHintMask & (HINT_SAMPLEINFO|HINT_MODTYPE))) return;
- // 05/01/05 : ericus replaced ">> 24" by ">> 20" : 4000 samples -> 12bits [see Moddoc.h]
- //if (((dwHintMask >> 20) != (m_nSample&0x0fff)) && (!(dwHintMask & HINT_MODTYPE))) return;
if (((dwHintMask >> HINT_SHIFT_SMP) != m_nSample) && (!(dwHintMask & HINT_MODTYPE))) return;
LockControls();
if (!m_bInitialized) dwHintMask |= HINT_MODTYPE;
@@ -691,35 +685,32 @@
}
-BOOL CCtrlSamples::OpenSample(LPCSTR lpszFileName)
+bool CCtrlSamples::OpenSample(LPCSTR lpszFileName)
//------------------------------------------------
{
CMappedFile f;
CHAR szName[_MAX_FNAME], szExt[_MAX_EXT];
LPBYTE lpFile;
DWORD len;
- BOOL bOk;
+ bool bOk = false;
BeginWaitCursor();
if ((!lpszFileName) || (!f.Open(lpszFileName)))
{
EndWaitCursor();
- return FALSE;
+ return false;
}
len = f.GetLength();
if (len > CTrackApp::gMemStatus.dwTotalPhys) len = CTrackApp::gMemStatus.dwTotalPhys;
- bOk = FALSE;
lpFile = f.Lock(len);
if (!lpFile) goto OpenError;
BEGIN_CRITICAL();
m_pModDoc->GetSampleUndo()->PrepareUndo(m_nSample, sundo_replace);
+ bOk = m_pSndFile->ReadSampleFromFile(m_nSample, lpFile, len);
- if (m_pSndFile->ReadSampleFromFile(m_nSample, lpFile, len))
- {
- bOk = TRUE;
- }
END_CRITICAL();
+
if (!bOk)
{
CRawSampleDlg dlg(this);
@@ -772,7 +763,7 @@
}
if (m_pSndFile->ReadSample(pSmp, flags, p16, l16))
{
- bOk = TRUE;
+ bOk = true;
}
END_CRITICAL();
} else
@@ -816,18 +807,17 @@
pSmp->nPan = 128;
pSmp->uFlags |= CHN_PANNING;
}
- // 05/01/05 : ericus replaced "m_nSample << 24" by "m_nSample << 20" : 4000 samples -> 12bits [see Moddoc.h]
m_pModDoc->UpdateAllViews(NULL, (m_nSample << HINT_SHIFT_SMP) | HINT_SAMPLEDATA | HINT_SAMPLEINFO | HINT_SMPNAMES, NULL);
m_pModDoc->SetModified();
}
- return TRUE;
+ return true;
}
-BOOL CCtrlSamples::OpenSample(CSoundFile *pSndFile, UINT nSample)
-//---------------------------------------------------------------
+bool CCtrlSamples::OpenSample(CSoundFile *pSndFile, SAMPLEINDEX nSample)
+//----------------------------------------------------------------------
{
- if ((!pSndFile) || (!nSample) || (nSample > pSndFile->m_nSamples)) return FALSE;
+ if ((!pSndFile) || (!nSample) || (nSample > pSndFile->m_nSamples)) return false;
BeginWaitCursor();
BEGIN_CRITICAL();
@@ -841,11 +831,10 @@
pSmp->uFlags |= CHN_PANNING;
}
END_CRITICAL();
- // 05/01/05 : ericus replaced "m_nSample << 24" by "m_nSample << 20" : 4000 samples -> 12bits [see Moddoc.h]
m_pModDoc->UpdateAllViews(NULL, (m_nSample << HINT_SHIFT_SMP) | HINT_SAMPLEDATA | HINT_SAMPLEINFO | HINT_SMPNAMES, NULL);
m_pModDoc->SetModified();
EndWaitCursor();
- return TRUE;
+ return true;
}
@@ -857,7 +846,7 @@
{
if ((!IsLocked()) && (m_pSndFile))
{
- UINT n = GetDlgItemInt(IDC_EDIT_SAMPLE);
+ SAMPLEINDEX n = (SAMPLEINDEX)GetDlgItemInt(IDC_EDIT_SAMPLE);
if ((n > 0) && (n <= m_pSndFile->m_nSamples) && (n != m_nSample))
{
SetCurrentSample(n, -1, FALSE);
@@ -913,7 +902,6 @@
}
}
- // 05/01/05 : ericus replaced "m_nSample << 24" by "m_nSample << 20" : 4000 samples -> 12bits [see Moddoc.h]
m_pModDoc->UpdateAllViews(NULL, (smp << HINT_SHIFT_SMP) | HINT_SAMPLEINFO | HINT_SAMPLEDATA | HINT_SMPNAMES);
if ((pSndFile->m_nInstruments) && (!m_pModDoc->FindSampleParent(smp)))
{
@@ -1102,7 +1090,7 @@
return;
//Default case: Normalize current sample
- UINT iMinSample = m_nSample, iMaxSample = m_nSample;
+ SAMPLEINDEX iMinSample = m_nSample, iMaxSample = m_nSample;
//If only one sample is selected, parts of it may be amplified
UINT iStart = 0, iEnd = 0;
@@ -1124,20 +1112,22 @@
BeginWaitCursor();
- BOOL bModified = FALSE;
+ bool bModified = false;
- for(UINT iSmp = iMinSample; iSmp <= iMaxSample; iSmp++)
+ for(SAMPLEINDEX iSmp = iMinSample; iSmp <= iMaxSample; iSmp++)
{
if (m_pSndFile->Samples[iSmp].pSample)
{
- BOOL bOk = FALSE;
+ bool bOk = false;
MODSAMPLE *pSmp = &m_pSndFile->Samples[iSmp];
- if(iMinSample != iMaxSample) {
+ if(iMinSample != iMaxSample)
+ {
//if more than one sample is selected, always amplify the whole sample.
iStart = 0;
iEnd = pSmp->nLength;
- } else {
+ } else
+ {
//one sample: correct the boundaries, if needed
if (iEnd > pSmp->nLength) iEnd = pSmp->nLength;
if (iStart > iEnd) iStart = iEnd;
@@ -1153,7 +1143,7 @@
if (pSmp->uFlags & CHN_16BIT)
{
- signed short *p = (signed short *)pSmp->pSample;
+ int16 *p = (int16 *)pSmp->pSample;
int max = 1;
for (UINT i = iStart; i < iEnd; i++)
{
@@ -1165,14 +1155,14 @@
max++;
for (UINT j = iStart; j < iEnd; j++)
{
- int l = p[j];
- p[j] = (l << 15) / max;
+ int l = (((int)p[j]) << 15) / max;
+ p[j] = (int16)l;
}
- bModified = bOk = TRUE;
+ bModified = bOk = true;
}
} else
{
- signed char *p = (signed char *)pSmp->pSample;
+ int8 *p = (int8 *)pSmp->pSample;
int max = 1;
for (UINT i = iStart; i < iEnd; i++)
{
@@ -1184,10 +1174,10 @@
max++;
for (UINT j = iStart; j < iEnd; j++)
{
- int l = p[j];
- p[j] = (l << 7) / max;
+ int l = (((int)p[j]) << 7) / max;
+ p[j] = (int8)l;
}
- bModified = bOk = TRUE;
+ bModified = bOk = true;
}
}
@@ -1253,7 +1243,6 @@
}
}
m_pModDoc->AdjustEndOfSample(m_nSample);
- // 05/01/05 : ericus replaced "m_nSample << 24" by "m_nSample << 20" : 4000 samples -> 12bits [see Moddoc.h]
m_pModDoc->UpdateAllViews(NULL, (m_nSample << HINT_SHIFT_SMP) | HINT_SAMPLEDATA, NULL);
m_pModDoc->SetModified();
EndWaitCursor();
@@ -1267,7 +1256,7 @@
if(!m_pModDoc || !m_pSndFile)
return;
- UINT iMinSample = m_nSample, iMaxSample = m_nSample;
+ SAMPLEINDEX iMinSample = m_nSample, iMaxSample = m_nSample;
//Shift -> Process all samples
if(CMainFrame::GetInputHandler()->ShiftPressed())
@@ -1284,11 +1273,11 @@
UINT iModified = 0;
float fReportOffset = 0;
- for(UINT iSmp = iMinSample; iSmp <= iMaxSample; iSmp++)
+ for(SAMPLEINDEX iSmp = iMinSample; iSmp <= iMaxSample; iSmp++)
{
UINT iStart, iEnd;
- if( m_pSndFile->Samples[iSmp].pSample == nullptr )
+ if(m_pSndFile->Samples[iSmp].pSample == nullptr)
continue;
if (iMinSample != iMaxSample)
@@ -1508,7 +1497,6 @@
viewstate.dwEndSel = dwEnd + (dwEnd-dwStart);
SendViewMessage(VIEWMSG_LOADSTATE, (LPARAM)&viewstate);
}
- // 05/01/05 : ericus replaced "m_nSample << 24" by "m_nSample << 20" : 4000 samples -> 12bits [see Moddoc.h]
m_pModDoc->UpdateAllViews(NULL, (m_nSample << HINT_SHIFT_SMP) | HINT_SAMPLEDATA | HINT_SAMPLEINFO, NULL);
m_pModDoc->SetModified();
}
@@ -1643,7 +1631,6 @@
viewstate.dwEndSel = dwStart + dwRemove;
SendViewMessage(VIEWMSG_LOADSTATE, (LPARAM)&viewstate);
}
- // 05/01/05 : ericus replaced "m_nSample << 24" by "m_nSample << 20" : 4000 samples -> 12bits [see Moddoc.h]
m_pModDoc->UpdateAllViews(NULL, (m_nSample << HINT_SHIFT_SMP) | HINT_SAMPLEDATA | HINT_SAMPLEINFO, NULL);
m_pModDoc->SetModified();
}
@@ -1712,9 +1699,9 @@
//Calculate/verify samplerate at C5.
long lSampleRate = pSmp->nC5Speed;
if(m_pSndFile->m_nType & (MOD_TYPE_MOD|MOD_TYPE_XM))
- lSampleRate = (double)CSoundFile::TransposeToFrequency(pSmp->RelativeTone, pSmp->nFineTune);
+ lSampleRate = CSoundFile::TransposeToFrequency(pSmp->RelativeTone, pSmp->nFineTune);
if(lSampleRate <= 0)
- lSampleRate = 8363.0;
+ lSampleRate = 8363;
//Open dialog
CPSRatioCalc dlg(pSmp->nLength, lSampleRate,
@@ -1742,15 +1729,15 @@
// Time stretching
if(IsDlgButtonChecked(IDC_CHECK3)){
UpdateData(TRUE); //Ensure m_dTimeStretchRatio is up-to-date with textbox content
- errorcode = TimeStretch(m_dTimeStretchRatio/100.0);
+ errorcode = TimeStretch((float)(m_dTimeStretchRatio / 100.0));
//Update loop points only if no error occured.
if(errorcode == 0)
{
- pSmp->nLoopStart = min(pSmp->nLoopStart * (m_dTimeStretchRatio / 100.0), pSmp->nLength);
- pSmp->nLoopEnd = min(pSmp->nLoopEnd * (m_dTimeStretchRatio/100.0), pSmp->nLength);
- pSmp->nSustainStart = min(pSmp->nSustainStart * (m_dTimeStretchRatio/100.0), pSmp->nLength);
- pSmp->nSustainEnd = min(pSmp->nSustainEnd * (m_dTimeStretchRatio/100.0), pSmp->nLength);
+ pSmp->nLoopStart = (UINT)min(pSmp->nLoopStart * (m_dTimeStretchRatio / 100.0), pSmp->nLength);
+ pSmp->nLoopEnd = (UINT)min(pSmp->nLoopEnd * (m_dTimeStretchRatio/100.0), pSmp->nLength);
+ pSmp->nSustainStart = (UINT)min(pSmp->nSustainStart * (m_dTimeStretchRatio/100.0), pSmp->nLength);
+ pSmp->nSustainEnd = (UINT)min(pSmp->nSustainEnd * (m_dTimeStretchRatio/100.0), pSmp->nLength);
}
}
@@ -1758,8 +1745,8 @@
else{
// Get selected pitch modifier [-12,+12]
CComboBox *combo = (CComboBox *)GetDlgItem(IDC_COMBO4);
- short pm = combo->GetCurSel() - 12;
- if(pm == 0) goto error;
+ float pm = float(combo->GetCurSel()) - 12.0f;
+ if(pm == 0.0f) goto error;
// Compute pitch ratio in range [0.5f ; 2.0f] (1.0f means output == input)
// * pitch up -> 1.0f + n / 12.0f -> (12.0f + n) / 12.0f , considering n : pitch modifier > 0
@@ -1799,8 +1786,8 @@
}
-int CCtrlSamples::TimeStretch(double ratio)
-//-----------------------------------------
+int CCtrlSamples::TimeStretch(float ratio)
+//----------------------------------------
{
static HANDLE handleSt = NULL; // Handle to SoundTouch object.
if((!m_pSndFile) || (!m_pSndFile->Samples[m_nSample].pSample)) return -1;
@@ -1819,7 +1806,7 @@
if(ratio <= 0.0 || ratio == 1.0) return -1;
// Convert to pitch factor
- float pitch = Round((float)ratio, 4);
+ float pitch = Round(ratio, 4);
if(pitch < 0.5f) return 2 + (1<<8);
if(pitch > 2.0f) return 2 + (2<<8);
@@ -2013,7 +2000,7 @@
// Get selected oversampling - quality - (also refered as FFT overlapping) factor
CComboBox *combo = (CComboBox *)GetDlgItem(IDC_COMBO5);
- short ovs = combo->GetCurSel() + 4;
+ long ovs = combo->GetCurSel() + 4;
// Get selected FFT size (power of 2 ; should not exceed MAX_BUFFER_LENGTH - see smbPitchShift.h)
combo = (CComboBox *)GetDlgItem(IDC_COMBO6);
@@ -2054,7 +2041,7 @@
long lSampleRate = pSmp->GetSampleRate(m_pSndFile->GetType());
// Deduce max sample value (float conversion step)
- float maxSampleValue = ( 1 << (smpsize * 8 - 1) ) - 1;
+ float maxSampleValue = float(( 1 << (smpsize * 8 - 1) ) - 1);
// Allocate working buffers
float * buffer = new float[MAX_BUFFER_LENGTH + fft];
@@ -2287,7 +2274,6 @@
}
}
m_pModDoc->AdjustEndOfSample(m_nSample);
- // 05/01/05 : ericus replaced "m_nSample << 24" by "m_nSample << 20" : 4000 samples -> 12bits [see Moddoc.h]
m_pModDoc->UpdateAllViews(NULL, (m_nSample << HINT_SHIFT_SMP) | HINT_SAMPLEDATA, NULL);
m_pModDoc->SetModified();
}
@@ -2336,7 +2322,6 @@
if (strncmp(s, m_pSndFile->m_szNames[m_nSample], 32))
{
memcpy(m_pSndFile->m_szNames[m_nSample], s, 32);
- // 05/01/05 : ericus replaced "m_nSample << 24" by "m_nSample << 20" : 4000 samples -> 12bits [see Moddoc.h]
m_pModDoc->UpdateAllViews(NULL, (m_nSample << HINT_SHIFT_SMP) | (HINT_SMPNAMES|HINT_SAMPLEINFO), this);
m_pModDoc->UpdateAllViews(NULL, HINT_INSNAMES, this);
m_pModDoc->SetModified();
@@ -2357,7 +2342,6 @@
if (strncmp(s, m_pSndFile->Samples[m_nSample].filename, 22))
{
memcpy(m_pSndFile->Samples[m_nSample].filename, s, 22);
- // 05/01/05 : ericus replaced "m_nSample << 24" by "m_nSample << 20" : 4000 samples -> 12bits [see Moddoc.h]
m_pModDoc->UpdateAllViews(NULL, (m_nSample << HINT_SHIFT_SMP) | HINT_SAMPLEINFO, this);
if (m_pSndFile->m_nType & (MOD_TYPE_S3M|MOD_TYPE_IT|MOD_TYPE_MPT)) m_pModDoc->SetModified();
}
@@ -2374,7 +2358,7 @@
nVol <<= 2;
if (nVol != m_pSndFile->Samples[m_nSample].nVolume)
{
- m_pSndFile->Samples[m_nSample].nVolume = nVol;
+ m_pSndFile->Samples[m_nSample].nVolume = (WORD)nVol;
m_pModDoc->SetModified();
}
}
@@ -2389,7 +2373,7 @@
if (nVol > 64) nVol = 64;
if (nVol != m_pSndFile->Samples[m_nSample].nGlobalVol)
{
- m_pSndFile->Samples[m_nSample].nGlobalVol = nVol;
+ m_pSndFile->Samples[m_nSample].nGlobalVol = (WORD)nVol;
m_pModDoc->SetModified();
}
}
@@ -2438,7 +2422,7 @@
//end rewbs.fix36944
if (nPan != m_pSndFile->Samples[m_nSample].nPan)
{
- m_pSndFile->Samples[m_nSample].nPan = nPan;
+ m_pSndFile->Samples[m_nSample].nPan = (WORD)nPan;
if (m_pSndFile->m_nType & (MOD_TYPE_XM|MOD_TYPE_IT|MOD_TYPE_MPT)) m_pModDoc->SetModified();
}
}
@@ -2451,7 +2435,7 @@
int n = GetDlgItemInt(IDC_EDIT5);
if (m_pSndFile->m_nType & (MOD_TYPE_IT|MOD_TYPE_S3M|MOD_TYPE_MPT))
{
- if ((n > 0) && (n <= (m_pSndFile->m_nType & MOD_TYPE_S3M) ? 65535 : 9999999) && (n != (int)m_pSndFile->Samples[m_nSample].nC5Speed))
+ if ((n > 0) && (n <= (m_pSndFile->GetType() == MOD_TYPE_S3M ? 65535 : 9999999)) && (n != (int)m_pSndFile->Samples[m_nSample].nC5Speed))
{
m_pSndFile->Samples[m_nSample].nC5Speed = n;
int transp = CSoundFile::FrequencyToTranspose(n) >> 7;
@@ -2469,8 +2453,9 @@
}
} else
{
- if ((n >= -128) && (n <= 127)) {
- m_pSndFile->Samples[m_nSample].nFineTune = n;
+ if ((n >= -128) && (n <= 127))
+ {
+ m_pSndFile->Samples[m_nSample].nFineTune = (signed char)n;
m_pModDoc->SetModified();
}
@@ -2482,12 +2467,12 @@
//-------------------------------------
{
if (IsLocked()) return;
- int n = 60 - (m_CbnBaseNote.GetCurSel() + BASENOTE_MIN);
+ int n = (NOTE_MIDDLEC - 1) - (m_CbnBaseNote.GetCurSel() + BASENOTE_MIN);
if (m_pSndFile->m_nType & (MOD_TYPE_IT|MOD_TYPE_S3M|MOD_TYPE_MPT))
{
LONG ft = CSoundFile::FrequencyToTranspose(m_pSndFile->Samples[m_nSample].nC5Speed) & 0x7f;
n = CSoundFile::TransposeToFrequency(n, ft);
- if ((n > 0) && (n <= (m_pSndFile->m_nType & MOD_TYPE_S3M) ? 65535 : 9999999) && (n != (int)m_pSndFile->Samples[m_nSample].nC5Speed))
+ if ((n > 0) && (n <= (m_pSndFile->GetType() == MOD_TYPE_S3M ? 65535 : 9999999)) && (n != (int)m_pSndFile->Samples[m_nSample].nC5Speed))
{
CHAR s[32];
m_pSndFile->Samples[m_nSample].nC5Speed = n;
@@ -2499,8 +2484,9 @@
}
} else
{
- if ((n >= -128) && (n < 128)) {
- m_pSndFile->Samples[m_nSample].RelativeTone = n;
+ if ((n >= -128) && (n < 128))
+ {
+ m_pSndFile->Samples[m_nSample].RelativeTone = (signed char)n;
m_pModDoc->SetModified();
}
}
@@ -2525,7 +2511,7 @@
m_SpinVibDepth.GetRange(lmin, lmax);
int n = GetDlgItemInt(IDC_EDIT15);
if ((n >= lmin) && (n <= lmax)) {
- m_pSndFile->Samples[m_nSample].nVibDepth = n;
+ m_pSndFile->Samples[m_nSample].nVibDepth = (BYTE)n;
m_pModDoc->SetModified();
}
}
@@ -2539,7 +2525,7 @@
m_SpinVibSweep.GetRange(lmin, lmax);
int n = GetDlgItemInt(IDC_EDIT14);
if ((n >= lmin) && (n <= lmax)) {
- m_pSndFile->Samples[m_nSample].nVibSweep = n;
+ m_pSndFile->Samples[m_nSample].nVibSweep = (BYTE)n;
m_pModDoc->SetModified();
}
}
@@ -2553,7 +2539,7 @@
m_SpinVibRate.GetRange(lmin, lmax);
int n = GetDlgItemInt(IDC_EDIT16);
if ((n >= lmin) && (n <= lmax)) {
- m_pSndFile->Samples[m_nSample].nVibRate = n;
+ m_pSndFile->Samples[m_nSample].nVibRate = (BYTE)n;
m_pModDoc->SetModified();
}
}
@@ -2605,7 +2591,6 @@
(resets sound without any reason otherwise) - bug report 1874 */
m_pModDoc->AdjustEndOfSample(m_nSample);
}
- // 05/01/05 : ericus replaced "m_nSample << 24" by "m_nSample << 20" : 4000 samples -> 12bits [see Moddoc.h]
m_pModDoc->UpdateAllViews(NULL, (m_nSample << HINT_SHIFT_SMP) | HINT_SAMPLEDATA, this);
m_pModDoc->SetModified();
}
@@ -2627,7 +2612,6 @@
(resets sound without any reason otherwise) - bug report 1874 */
m_pModDoc->AdjustEndOfSample(m_nSample);
}
- // 05/01/05 : ericus replaced "m_nSample << 24" by "m_nSample << 20" : 4000 samples -> 12bits [see Moddoc.h]
m_pModDoc->UpdateAllViews(NULL, (m_nSample << HINT_SHIFT_SMP) | HINT_SAMPLEDATA, this);
m_pModDoc->SetModified();
}
@@ -2674,7 +2658,6 @@
&& ((n < (LONG)pSmp->nSustainEnd) || (!(pSmp->uFlags & CHN_SUSTAINLOOP))))
{
pSmp->nSustainStart = n;
- // 05/01/05 : ericus replaced "m_nSample << 24" by "m_nSample << 20" : 4000 samples -> 12bits [see Moddoc.h]
m_pModDoc->UpdateAllViews(NULL, (m_nSample << HINT_SHIFT_SMP) | HINT_SAMPLEDATA, this);
m_pModDoc->SetModified();
}
@@ -2691,7 +2674,6 @@
&& ((n > (LONG)pSmp->nSustainStart) || (!(pSmp->uFlags & CHN_SUSTAINLOOP))))
{
pSmp->nSustainEnd = n;
- // 05/01/05 : ericus replaced "m_nSample << 24" by "m_nSample << 20" : 4000 samples -> 12bits [see Moddoc.h]
m_pModDoc->UpdateAllViews(NULL, (m_nSample << HINT_SHIFT_SMP) | HINT_SAMPLEDATA, this);
m_pModDoc->SetModified();
}
@@ -2702,42 +2684,45 @@
#define BIDILOOP_ACCURACY 2 // 5%
-BOOL MPT_LoopCheck(int sstart0, int sstart1, int send0, int send1)
+bool MPT_LoopCheck(int sstart0, int sstart1, int send0, int send1)
+//----------------------------------------------------------------
{
int dse0 = send0 - sstart0;
- if ((dse0 < -SMPLOOP_ACCURACY) || (dse0 > SMPLOOP_ACCURACY)) return FALSE;
+ if ((dse0 < -SMPLOOP_ACCURACY) || (dse0 > SMPLOOP_ACCURACY)) return false;
int dse1 = send1 - sstart1;
- if ((dse1 < -SMPLOOP_ACCURACY) || (dse1 > SMPLOOP_ACCURACY)) return FALSE;
+ if ((dse1 < -SMPLOOP_ACCURACY) || (dse1 > SMPLOOP_ACCURACY)) return false;
int dstart = sstart1 - sstart0;
int dend = send1 - send0;
if (!dstart) dstart = dend >> 7;
if (!dend) dend = dstart >> 7;
- if ((dstart ^ dend) < 0) return FALSE;
+ if ((dstart ^ dend) < 0) return false;
int delta = dend - dstart;
- return ((delta > -SMPLOOP_ACCURACY) && (delta < SMPLOOP_ACCURACY)) ? TRUE : FALSE;
+ return ((delta > -SMPLOOP_ACCURACY) && (delta < SMPLOOP_ACCURACY)) ? true : false;
}
-BOOL MPT_BidiEndCheck(int spos0, int spos1, int spos2)
+bool MPT_BidiEndCheck(int spos0, int spos1, int spos2)
+//----------------------------------------------------
{
int delta0 = spos1 - spos0;
int delta1 = spos2 - spos1;
int delta2 = spos2 - spos0;
if (!delta0) delta0 = delta1 >> 7;
if (!delta1) delta1 = delta0 >> 7;
- if ((delta1 ^ delta0) < 0) return FALSE;
+ if ((delta1 ^ delta0) < 0) return false;
return ((delta0 >= -1) && (delta0 <= 0) && (delta1 >= -1) && (delta1 <= 0) && (delta2 >= -1) && (delta2 <= 0));
}
-BOOL MPT_BidiStartCheck(int spos0, int spos1, int spos2)
+bool MPT_BidiStartCheck(int spos0, int spos1, int spos2)
+//------------------------------------------------------
{
int delta1 = spos1 - spos0;
int delta0 = spos2 - spos1;
int delta2 = spos2 - spos0;
if (!delta0) delta0 = delta1 >> 7;
if (!delta1) delta1 = delta0 >> 7;
- if ((delta1 ^ delta0) < 0) return FALSE;
+ if ((delta1 ^ delta0) < 0) return false;
return ((delta0 >= -1) && (delta0 <= 0) && (delta1 > -1) && (delta1 <= 0) && (delta2 >= -1) && (delta2 <= 0));
}
@@ -2752,7 +2737,7 @@
MODSAMPLE *pSmp = &m_pSndFile->Samples[nsample];
LPSTR pSample = pSmp->pSample;
short int pos;
- BOOL bRedraw = FALSE;
+ bool bRedraw = false;
LockControls();
if ((!pSmp->nLength) || (!pSample)) goto NoSample;
@@ -2765,7 +2750,7 @@
// Loop Start
if ((pos = (short int)m_SpinLoopStart.GetPos()) != 0)
{
- BOOL bOk = FALSE;
+ bool bOk = false;
LPSTR p = pSample+pSmp->nLoopStart*pinc;
int find0 = (int)pSample[pSmp->nLoopEnd*pinc-pinc];
int find1 = (int)pSample[pSmp->nLoopEnd*pinc];
@@ -2802,7 +2787,7 @@
wsprintf(s, "%u", pSmp->nLoopStart);
m_EditLoopStart.SetWindowText(s);
m_pModDoc->AdjustEndOfSample(m_nSample);
- bRedraw = TRUE;
+ bRedraw = true;
}
m_SpinLoopStart.SetPos(0);
}
@@ -2810,7 +2795,7 @@
pos = (short int)m_SpinLoopEnd.GetPos();
if ((pos) && (pSmp->nLoopEnd))
{
- BOOL bOk = FALSE;
+ bool bOk = false;
LPSTR p = pSample+pSmp->nLoopEnd*pinc;
int find0 = (int)pSample[pSmp->nLoopStart*pinc];
int find1 = (int)pSample[pSmp->nLoopStart*pinc+pinc];
@@ -2846,7 +2831,7 @@
wsprintf(s, "%u", pSmp->nLoopEnd);
m_EditLoopEnd.SetWindowText(s);
m_pModDoc->AdjustEndOfSample(m_nSample);
- bRedraw = TRUE;
+ bRedraw = true;
}
m_SpinLoopEnd.SetPos(0);
}
@@ -2854,7 +2839,7 @@
pos = (short int)m_SpinSustainStart.GetPos();
if ((pos) && (pSmp->nSustainEnd))
{
- BOOL bOk = FALSE;
+ bool bOk = false;
LPSTR p = pSample+pSmp->nSustainStart*pinc;
int find0 = (int)pSample[pSmp->nSustainEnd*pinc-pinc];
int find1 = (int)pSample[pSmp->nSustainEnd*pinc];
@@ -2890,7 +2875,7 @@
{
wsprintf(s, "%u", pSmp->nSustainStart);
m_EditSustainStart.SetWindowText(s);
- bRedraw = TRUE;
+ bRedraw = true;
}
m_SpinSustainStart.SetPos(0);
}
@@ -2898,7 +2883,7 @@
pos = (short int)m_SpinSustainEnd.GetPos();
if (pos)
{
- BOOL bOk = FALSE;
+ bool bOk = false;
LPSTR p = pSample+pSmp->nSustainEnd*pinc;
int find0 = (int)pSample[pSmp->nSustainStart*pinc];
int find1 = (int)pSample[pSmp->nSustainStart*pinc+pinc];
@@ -2933,7 +2918,7 @@
{
wsprintf(s, "%u", pSmp->nSustainEnd);
m_EditSustainEnd.SetWindowText(s);
- bRedraw = TRUE;
+ bRedraw = true;
}
m_SpinSustainEnd.SetPos(0);
}
@@ -2958,18 +2943,16 @@
m_EditFineTune.SetWindowText(s);
} else
{
- LONG d = pSmp->nFineTune + pos;
- if (d < -128) d = -128;
- if (d > 127) d = 127;
- pSmp->nFineTune = d;
+ LONG d = CLAMP(pSmp->nFineTune + pos, -128, 127);
+ pSmp->nFineTune = (signed char)d;
wsprintf(s, "%d", d);
m_EditFineTune.SetWindowText(s);
}
m_SpinFineTune.SetPos(0);
}
if ((nCode == SB_ENDSCROLL) || (nCode == SB_THUMBPOSITION)) SwitchToView();
- if (bRedraw) {
- // 05/01/05 : ericus replaced "m_nSample << 24" by "m_nSample << 20" : 4000 samples -> 12bits [see Moddoc.h]
+ if (bRedraw)
+ {
m_pModDoc->UpdateAllViews(NULL, (m_nSample << HINT_SHIFT_SMP) | HINT_SAMPLEDATA, this);
m_pModDoc->SetModified();
}
Modified: trunk/OpenMPT/mptrack/Ctrl_smp.h
===================================================================
--- trunk/OpenMPT/mptrack/Ctrl_smp.h 2010-03-13 14:17:33 UTC (rev 528)
+++ trunk/OpenMPT/mptrack/Ctrl_smp.h 2010-03-13 16:02:46 UTC (rev 529)
@@ -37,7 +37,7 @@
CComboBox m_ComboPitch, m_ComboQuality, m_ComboFFT;
int PitchShift(float pitch);
- int TimeStretch(double ratio);
+ int TimeStretch(float ratio);
void UpdateTimeStretchParameterString();
void ReadTimeStretchParameters();
@@ -50,9 +50,9 @@
CCtrlSamples();
~CCtrlSamples();
- BOOL SetCurrentSample(UINT n, LONG lZoom=-1, BOOL bUpdNum=TRUE);
- BOOL OpenSample(LPCSTR lpszFileName);
- BOOL OpenSample(CSoundFile *pSndFile, UINT nSample);
+ bool SetCurrentSample(SAMPLEINDEX nSmp, LONG lZoom = -1, bool bUpdNum = true);
+ bool OpenSample(LPCSTR lpszFileName);
+ bool OpenSample(CSoundFile *pSndFile, SAMPLEINDEX nSample);
LONG* GetSplitPosRef() {return &CMainFrame::glSampleWindowHeight;} //rewbs.varWindowSize
public:
Modified: trunk/OpenMPT/mptrack/View_smp.cpp
===================================================================
--- trunk/OpenMPT/mptrack/View_smp.cpp 2010-03-13 14:17:33 UTC (rev 528)
+++ trunk/OpenMPT/mptrack/View_smp.cpp 2010-03-13 16:02:46 UTC (rev 529)
@@ -397,11 +397,8 @@
void CViewSample::UpdateView(DWORD dwHintMask, CObject *)
//-------------------------------------------------------
{
- // 05/01/05 : ericus replaced ">> 24" by ">> 20" : 4000 samples -> 12bits [see Moddoc.h]
- //rewbs: replaced 0xff by 0x0fff for 4000 samples.
if ((dwHintMask & (HINT_MPTOPTIONS|HINT_MODTYPE))
|| ((dwHintMask & HINT_SAMPLEDATA) && (m_nSample == (dwHintMask >> HINT_SHIFT_SMP))) )
- //|| ((dwHintMask & HINT_SAMPLEDATA) && ((m_nSample&0x0fff) == (dwHintMask >> 20))) )
{
UpdateScrollSize();
UpdateNcButtonState();
@@ -1613,7 +1610,6 @@
pSmp->uFlags |= CHN_LOOP;
pModDoc->SetModified();
pModDoc->AdjustEndOfSample(m_nSample);
- // 05/01/05 : ericus replaced "m_nSample << 24" by "m_nSample << 20" : 4000 samples -> 12bits [see Moddoc.h]
pModDoc->UpdateAllViews(NULL, (m_nSample << HINT_SHIFT_SMP) | HINT_SAMPLEINFO | HINT_SAMPLEDATA, NULL);
}
}
@@ -1638,7 +1634,6 @@
pSmp->uFlags |= CHN_SUSTAINLOOP;
pModDoc->SetModified();
pModDoc->AdjustEndOfSample(m_nSample);
- // 05/01/05 : ericus replaced "m_nSample << 24" by "m_nSample << 20" : 4000 samples -> 12bits [see Moddoc.h]
pModDoc->UpdateAllViews(NULL, (m_nSample << HINT_SHIFT_SMP) | HINT_SAMPLEINFO | HINT_SAMPLEDATA, NULL);
}
}
@@ -1745,7 +1740,6 @@
SetCurSel(0, 0);
pModDoc->AdjustEndOfSample(m_nSample);
pModDoc->SetModified();
- // 05/01/05 : ericus replaced "m_nSample << 24" by "m_nSample << 20" : 4000 samples -> 12bits [see Moddoc.h]
pModDoc->UpdateAllViews(NULL, (m_nSample << HINT_SHIFT_SMP) | dwUpdateFlags, NULL);
}
@@ -1914,7 +1908,6 @@
SetCurSel(0, 0);
pModDoc->AdjustEndOfSample(m_nSample);
pModDoc->SetModified();
- // 05/01/05 : ericus replaced "m_nSample << 24" by "m_nSample << 20" : 4000 samples -> 12bits [see Moddoc.h]
pModDoc->UpdateAllViews(NULL, (m_nSample << HINT_SHIFT_SMP) | HINT_SAMPLEINFO | HINT_SAMPLEDATA, NULL);
}
CloseClipboard();
@@ -1961,7 +1954,6 @@
END_CRITICAL();
pModDoc->SetModified();
pModDoc->AdjustEndOfSample(m_nSample);
- // 05/01/05 : ericus replaced "m_nSample << 24" by "m_nSample << 20" : 4000 samples -> 12bits [see Moddoc.h]
pModDoc->UpdateAllViews(NULL, (m_nSample << HINT_SHIFT_SMP) | HINT_SAMPLEDATA | HINT_SAMPLEINFO, NULL);
}
}
@@ -2005,7 +1997,7 @@
END_CRITICAL();
pModDoc->SetModified();
pModDoc->AdjustEndOfSample(m_nSample);
- // 05/01/05 : ericus replaced "m_nSample << 24" by "m_nSample << 20" : 4000 samples -> 12bits [see Moddoc.h]
+
pModDoc->UpdateAllViews(NULL, (m_nSample << HINT_SHIFT_SMP) | HINT_SAMPLEDATA | HINT_SAMPLEINFO, NULL);
}
}
@@ -2070,7 +2062,6 @@
pModDoc->SetModified();
pModDoc->AdjustEndOfSample(m_nSample);
SetCurSel(0, 0);
- // 05/01/05 : ericus replaced "m_nSample << 24" by "m_nSample << 20" : 4000 samples -> 12bits [see Moddoc.h]
pModDoc->UpdateAllViews(NULL, (m_nSample << HINT_SHIFT_SMP) | HINT_SAMPLEDATA | HINT_SAMPLEINFO, NULL);
}
EndWaitCursor();
@@ -2274,7 +2265,6 @@
if (bUpdate)
{
pModDoc->AdjustEndOfSample(m_nSample);
- // 05/01/05 : ericus replaced "m_nSample << 24" by "m_nSample << 20" : 4000 samples -> 12bits [see Moddoc.h]
pModDoc->UpdateAllViews(NULL, (m_nSample << HINT_SHIFT_SMP) | HINT_SAMPLEDATA | HINT_SAMPLEINFO | HINT_SMPNAMES, NULL);
pModDoc->SetModified();
}
@@ -2340,7 +2330,6 @@
(resets sound without any reason otherwise) - bug report 1874 */
pModDoc->AdjustEndOfSample(m_nSample);
}
- // 05/01/05 : ericus replaced "m_nSample << 24" by "m_nSample << 20" : 4000 samples -> 12bits [see Moddoc.h]
pModDoc->UpdateAllViews(NULL, (m_nSample << HINT_SHIFT_SMP) | HINT_SAMPLEINFO | HINT_SAMPLEDATA, NULL);
}
}
@@ -2366,7 +2355,6 @@
(resets sound without any reason otherwise) - bug report 1874 */
pModDoc->AdjustEndOfSample(m_nSample);
}
- // 05/01/05 : ericus replaced "m_nSample << 24" by "m_nSample << 20" : 4000 samples -> 12bits [see Moddoc.h]
pModDoc->UpdateAllViews(NULL, (m_nSample << HINT_SHIFT_SMP) | HINT_SAMPLEINFO | HINT_SAMPLEDATA, NULL);
}
}
@@ -2387,7 +2375,6 @@
pSmp->nSustainStart = m_dwMenuParam;
pModDoc->SetModified();
pModDoc->AdjustEndOfSample(m_nSample);
- // 05/01/05 : ericus replaced "m_nSample << 24" by "m_nSample << 20" : 4000 samples -> 12bits [see Moddoc.h]
pModDoc->UpdateAllViews(NULL, (m_nSample << HINT_SHIFT_SMP) | HINT_SAMPLEINFO | HINT_SAMPLEDATA, NULL);
}
}
@@ -2408,7 +2395,6 @@
pSmp->nSustainEnd = m_dwMenuParam;
pModDoc->SetModified();
pModDoc->AdjustEndOfSample(m_nSample);
- // 05/01/05 : ericus replaced "m_nSample << 24" by "m_nSample << 20" : 4000 samples -> 12bits [see Moddoc.h]
pModDoc->UpdateAllViews(NULL, (m_nSample << HINT_SHIFT_SMP) | HINT_SAMPLEINFO | HINT_SAMPLEDATA, NULL);
}
}
@@ -2496,7 +2482,7 @@
}
LRESULT CViewSample::OnMidiMsg(WPARAM dwMidiDataParam, LPARAM)
-//-------------------------------------------------------
+//------------------------------------------------------------
{
const DWORD dwMidiData = dwMidiDataParam;
static BYTE midivolume = 127;
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <sag...@us...> - 2010-03-13 14:17:41
|
Revision: 528
http://modplug.svn.sourceforge.net/modplug/?rev=528&view=rev
Author: saga-games
Date: 2010-03-13 14:17:33 +0000 (Sat, 13 Mar 2010)
Log Message:
-----------
[Imp] Sample Editor: Remember previous settings in RAW import dialog
[New] Sample Editor: Option to not ask for RAW import settings again (settings are remembered independently for all modules)
Modified Paths:
--------------
trunk/OpenMPT/mptrack/Ctrl_smp.cpp
trunk/OpenMPT/mptrack/Ctrl_smp.h
trunk/OpenMPT/mptrack/Mpdlgs.cpp
trunk/OpenMPT/mptrack/Mpdlgs.h
trunk/OpenMPT/mptrack/mptrack.rc
trunk/OpenMPT/mptrack/resource.h
Modified: trunk/OpenMPT/mptrack/Ctrl_smp.cpp
===================================================================
--- trunk/OpenMPT/mptrack/Ctrl_smp.cpp 2010-03-13 00:22:53 UTC (rev 527)
+++ trunk/OpenMPT/mptrack/Ctrl_smp.cpp 2010-03-13 14:17:33 UTC (rev 528)
@@ -159,6 +159,7 @@
{
m_nSample = 1;
m_nLockCount = 1;
+ m_nPreviousRawFormat = 0;
}
@@ -722,9 +723,17 @@
if (!bOk)
{
CRawSampleDlg dlg(this);
+ if(m_nPreviousRawFormat != 0)
+ {
+ dlg.m_nFormat = m_nPreviousRawFormat;
+ dlg.m_bRememberFormat = true;
+ }
EndWaitCursor();
- if (dlg.DoModal() == IDOK)
+ if ((m_nPreviousRawFormat != 0) || (dlg.DoModal() == IDOK))
{
+
+ m_nPreviousRawFormat = ((dlg.m_bRememberFormat)) ? dlg.m_nFormat : 0;
+
BeginWaitCursor();
UINT flags = 0;
MODSAMPLE *pSmp = &m_pSndFile->Samples[m_nSample];
Modified: trunk/OpenMPT/mptrack/Ctrl_smp.h
===================================================================
--- trunk/OpenMPT/mptrack/Ctrl_smp.h 2010-03-13 00:22:53 UTC (rev 527)
+++ trunk/OpenMPT/mptrack/Ctrl_smp.h 2010-03-13 14:17:33 UTC (rev 528)
@@ -32,6 +32,7 @@
uint32 m_nOverlapMs;
uint16 m_nFinetuneStep; // Increment finetune by x when using spin control. Default = 25
enum {nDefaultStretchChunkSize = 8192};
+ UINT m_nPreviousRawFormat;
CComboBox m_ComboPitch, m_ComboQuality, m_ComboFFT;
Modified: trunk/OpenMPT/mptrack/Mpdlgs.cpp
===================================================================
--- trunk/OpenMPT/mptrack/Mpdlgs.cpp 2010-03-13 00:22:53 UTC (rev 527)
+++ trunk/OpenMPT/mptrack/Mpdlgs.cpp 2010-03-13 14:17:33 UTC (rev 528)
@@ -1066,6 +1066,9 @@
// CRawSampleDlg
+UINT CRawSampleDlg::m_nFormat = 0;
+
+
BOOL CRawSampleDlg::OnInitDialog()
//--------------------------------
{
@@ -1082,6 +1085,7 @@
if (IsDlgButtonChecked(IDC_RADIO2)) m_nFormat |= 1;
if (IsDlgButtonChecked(IDC_RADIO4)) m_nFormat |= 2;
if (IsDlgButtonChecked(IDC_RADIO6)) m_nFormat |= 4;
+ m_bRememberFormat = IsDlgButtonChecked(IDC_CHK_REMEMBERSETTINGS) ? true : false;
CDialog::OnOK();
}
@@ -1092,6 +1096,7 @@
CheckRadioButton(IDC_RADIO1, IDC_RADIO2, (m_nFormat & 1) ? IDC_RADIO2 : IDC_RADIO1);
CheckRadioButton(IDC_RADIO3, IDC_RADIO4, (m_nFormat & 2) ? IDC_RADIO4 : IDC_RADIO3);
CheckRadioButton(IDC_RADIO5, IDC_RADIO6, (m_nFormat & 4) ? IDC_RADIO6 : IDC_RADIO5);
+ CheckDlgButton(IDC_CHK_REMEMBERSETTINGS, (m_bRememberFormat) ? MF_CHECKED : MF_UNCHECKED);
}
Modified: trunk/OpenMPT/mptrack/Mpdlgs.h
===================================================================
--- trunk/OpenMPT/mptrack/Mpdlgs.h 2010-03-13 00:22:53 UTC (rev 527)
+++ trunk/OpenMPT/mptrack/Mpdlgs.h 2010-03-13 14:17:33 UTC (rev 528)
@@ -134,10 +134,15 @@
//=================================
{
public:
- UINT m_nFormat;
+ static UINT m_nFormat;
+ bool m_bRememberFormat;
public:
- CRawSampleDlg(CWnd *parent=NULL):CDialog(IDD_LOADRAWSAMPLE, parent) { m_nFormat = 0; }
+ CRawSampleDlg(CWnd *parent = NULL):CDialog(IDD_LOADRAWSAMPLE, parent)
+ {
+ //m_nFormat = 0;
+ m_bRememberFormat = false;
+ }
protected:
virtual BOOL OnInitDialog();
Modified: trunk/OpenMPT/mptrack/mptrack.rc
===================================================================
--- trunk/OpenMPT/mptrack/mptrack.rc 2010-03-13 00:22:53 UTC (rev 527)
+++ trunk/OpenMPT/mptrack/mptrack.rc 2010-03-13 14:17:33 UTC (rev 528)
@@ -424,23 +424,25 @@
CONTROL "Spin1",IDC_SPIN2,"msctls_updown32",UDS_SETBUDDYINT | UDS_ALIGNRIGHT | UDS_AUTOBUDDY | UDS_NOTHOUSANDS,196,232,11,14
END
-IDD_LOADRAWSAMPLE DIALOGEX 0, 0, 178, 89
-STYLE DS_SETFONT | DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU
+IDD_LOADRAWSAMPLE DIALOGEX 0, 0, 178, 95
+STYLE DS_SETFONT | DS_MODALFRAME | DS_FIXEDSYS | WS_POPUP | WS_CAPTION | WS_SYSMENU
CAPTION "Unknown file type"
FONT 8, "MS Shell Dlg", 0, 0, 0x0
BEGIN
- DEFPUSHBUTTON "OK",IDOK,66,66,50,14
- PUSHBUTTON "Cancel",IDCANCEL,120,66,50,14
- GROUPBOX "",IDC_STATIC,6,24,48,34,WS_GROUP
+ DEFPUSHBUTTON "OK",IDOK,66,72,50,14
+ PUSHBUTTON "Cancel",IDCANCEL,120,72,50,14
+ GROUPBOX "",IDC_STATIC,6,18,48,34,WS_GROUP
LTEXT "Load it as a raw sample of the following format:",IDC_STATIC,6,6,156,12
- CONTROL "8-bit",IDC_RADIO1,"Button",BS_AUTORADIOBUTTON,12,32,29,10
- CONTROL "16-bit",IDC_RADIO2,"Button",BS_AUTORADIOBUTTON,12,44,33,10
- GROUPBOX "",IDC_STATIC,60,24,54,34,WS_GROUP
- CONTROL "Unsigned",IDC_RADIO3,"Button",BS_AUTORADIOBUTTON,64,32,46,10
- CONTROL "Signed",IDC_RADIO4,"Button",BS_AUTORADIOBUTTON,64,44,38,10
- GROUPBOX "",IDC_STATIC,120,24,51,34,WS_GROUP
- CONTROL "Mono",IDC_RADIO5,"Button",BS_AUTORADIOBUTTON,126,32,34,10
- CONTROL "Stereo",IDC_RADIO6,"Button",BS_AUTORADIOBUTTON,126,44,37,10
+ CONTROL "8-bit",IDC_RADIO1,"Button",BS_AUTORADIOBUTTON,12,26,29,10
+ CONTROL "16-bit",IDC_RADIO2,"Button",BS_AUTORADIOBUTTON,12,38,33,10
+ GROUPBOX "",IDC_STATIC,60,18,54,34,WS_GROUP
+ CONTROL "Unsigned",IDC_RADIO3,"Button",BS_AUTORADIOBUTTON,64,26,46,10
+ CONTROL "Signed",IDC_RADIO4,"Button",BS_AUTORADIOBUTTON,64,38,38,10
+ GROUPBOX "",IDC_STATIC,120,18,51,34,WS_GROUP
+ CONTROL "Mono",IDC_RADIO5,"Button",BS_AUTORADIOBUTTON,126,26,34,10
+ CONTROL "Stereo",IDC_RADIO6,"Button",BS_AUTORADIOBUTTON,126,38,37,10
+ CONTROL "Remember these settings",IDC_CHK_REMEMBERSETTINGS,
+ "Button",BS_AUTOCHECKBOX | WS_TABSTOP,6,54,168,12
END
IDD_CONTROL_GLOBALS DIALOGEX 0, 0, 561, 94
@@ -1550,7 +1552,7 @@
IDD_LOADRAWSAMPLE, DIALOG
BEGIN
RIGHTMARGIN, 156
- BOTTOMMARGIN, 88
+ BOTTOMMARGIN, 94
END
IDD_CONTROL_COMMENTS, DIALOG
Modified: trunk/OpenMPT/mptrack/resource.h
===================================================================
--- trunk/OpenMPT/mptrack/resource.h 2010-03-13 00:22:53 UTC (rev 527)
+++ trunk/OpenMPT/mptrack/resource.h 2010-03-13 14:17:33 UTC (rev 528)
@@ -948,6 +948,7 @@
#define IDC_EDIT_PRESET_EXPR 2424
#define IDC_LIST_SAMPLEGEN_PRESETS 2425
#define IDC_CHECK_UNDO 2426
+#define IDC_CHK_REMEMBERSETTINGS 2427
#define ID_FILE_NEWMOD 32771
#define ID_FILE_NEWXM 32772
#define ID_FILE_NEWS3M 32773
@@ -1200,11 +1201,11 @@
#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
-#define ID_PATTERN_EDIT_PCNOTE_PLUGIN 60448
-#define ID_ENVELOPE_ZOOM_IN 60449
-#define ID_ENVELOPE_ZOOM_OUT 60450
+#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
//
@@ -1213,7 +1214,7 @@
#define _APS_3D_CONTROLS 1
#define _APS_NEXT_RESOURCE_VALUE 526
#define _APS_NEXT_COMMAND_VALUE 60451
-#define _APS_NEXT_CONTROL_VALUE 2427
+#define _APS_NEXT_CONTROL_VALUE 2428
#define _APS_NEXT_SYMED_VALUE 901
#endif
#endif
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <sag...@us...> - 2010-03-13 00:23:33
|
Revision: 527
http://modplug.svn.sourceforge.net/modplug/?rev=527&view=rev
Author: saga-games
Date: 2010-03-13 00:22:53 +0000 (Sat, 13 Mar 2010)
Log Message:
-----------
[Imp] Installer: Use DDE commands to open files.
Modified Paths:
--------------
trunk/OpenMPT/installer/filetypes.iss
Modified: trunk/OpenMPT/installer/filetypes.iss
===================================================================
--- trunk/OpenMPT/installer/filetypes.iss 2010-03-12 23:35:13 UTC (rev 526)
+++ trunk/OpenMPT/installer/filetypes.iss 2010-03-13 00:22:53 UTC (rev 527)
@@ -84,13 +84,10 @@
; important (setup)
Root: HKCR; Subkey: "OpenMPTFile"; ValueType: string; ValueName: ""; ValueData: "OpenMPT Module"; Flags: uninsdeletekey; Tasks: associate_common or associate_exotic
Root: HKCR; Subkey: "OpenMPTFile\DefaultIcon"; ValueType: string; ValueName: ""; ValueData: "{app}\mpt.ico,0"; Tasks: associate_common or associate_exotic
-Root: HKCR; Subkey: "OpenMPTFile\shell\open\command"; ValueType: string; ValueName: ""; ValueData: """{app}\mptrack.exe"" ""%1"""; Tasks: associate_common or associate_exotic
+Root: HKCR; Subkey: "OpenMPTFile\shell\Open\command"; ValueType: string; ValueName: ""; ValueData: """{app}\mptrack.exe"" ""%1"""; Tasks: associate_common or associate_exotic
+Root: HKCR; Subkey: "OpenMPTFile\shell\Open\ddeexec"; ValueType: string; ValueName: ""; ValueData: "[Edit(""%1"")]"; Tasks: associate_common or associate_exotic
[Files]
; icon file (should be moved into EXE)
Source: "mpt.ico"; DestDir: "{app}"; Flags: ignoreversion
-
-
-
-
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
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.
|