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
(46) |
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
|
From: <sag...@us...> - 2011-05-20 14:17:08
|
Revision: 877
http://modplug.svn.sourceforge.net/modplug/?rev=877&view=rev
Author: saga-games
Date: 2011-05-20 14:17:01 +0000 (Fri, 20 May 2011)
Log Message:
-----------
[Imp] IT / FT2 envelope limitations are now adhered in the envelope editor in compatible mode.
Modified Paths:
--------------
trunk/OpenMPT/mptrack/View_ins.cpp
trunk/OpenMPT/mptrack/View_ins.h
Modified: trunk/OpenMPT/mptrack/View_ins.cpp
===================================================================
--- trunk/OpenMPT/mptrack/View_ins.cpp 2011-05-17 18:33:34 UTC (rev 876)
+++ trunk/OpenMPT/mptrack/View_ins.cpp 2011-05-20 14:17:01 UTC (rev 877)
@@ -274,8 +274,14 @@
{
if (nTick >= 0)
{
- int mintick = (nPoint) ? envelope->Ticks[nPoint-1] : 0;
- int maxtick = envelope->Ticks[nPoint+1];
+ int mintick = (nPoint) ? envelope->Ticks[nPoint - 1] : 0;
+ int maxtick = envelope->Ticks[nPoint + 1];
+ // Can't have multiple points on same tick
+ if(GetDocument()->GetSoundFile()->IsCompatibleMode(TRK_IMPULSETRACKER|TRK_FASTTRACKER2))
+ {
+ mintick++;
+ maxtick--;
+ }
if (nPoint + 1 == (int)envelope->nNodes) maxtick = ENVELOPE_MAX_LENGTH;
if (nTick < mintick) nTick = mintick;
if (nTick > maxtick) nTick = maxtick;
@@ -2310,7 +2316,7 @@
{
INSTRUMENTENVELOPE *pEnv = GetEnvelopePtr();
if(pEnv == nullptr || !IsDragItemEnvPoint()) return;
- if(m_nDragItem == 1 || pEnv->Ticks[m_nDragItem - 1] == pEnv->Ticks[m_nDragItem - 2])
+ if(m_nDragItem == 1 || !CanMovePoint(m_nDragItem - 1, -1))
return;
pEnv->Ticks[m_nDragItem - 1]--;
@@ -2324,7 +2330,7 @@
{
INSTRUMENTENVELOPE *pEnv = GetEnvelopePtr();
if(pEnv == nullptr || !IsDragItemEnvPoint()) return;
- if(m_nDragItem == 1 || (m_nDragItem < pEnv->nNodes && pEnv->Ticks[m_nDragItem - 1] == pEnv->Ticks[m_nDragItem]))
+ if(m_nDragItem == 1 || !CanMovePoint(m_nDragItem - 1, 1))
return;
pEnv->Ticks[m_nDragItem - 1]++;
@@ -2500,6 +2506,36 @@
}
+bool CViewInstrument::CanMovePoint(UINT envPoint, int step)
+//---------------------------------------------------------
+{
+ INSTRUMENTENVELOPE *pEnv = GetEnvelopePtr();
+ if(pEnv == nullptr) return false;
+
+ // Can't move first point
+ if(envPoint == 0)
+ {
+ return false;
+ }
+ // Can't move left of previous point
+ if((step < 0) && (pEnv->Ticks[envPoint] - pEnv->Ticks[envPoint - 1] >= -step + GetDocument()->GetSoundFile()->IsCompatibleMode(TRK_IMPULSETRACKER|TRK_FASTTRACKER2) ? 0 : 1))
+ {
+ return false;
+ }
+ // Can't move right of next point
+ if((step > 0) && (envPoint < pEnv->nNodes - 1) && (pEnv->Ticks[envPoint + 1] - pEnv->Ticks[envPoint] >= step + GetDocument()->GetSoundFile()->IsCompatibleMode(TRK_IMPULSETRACKER|TRK_FASTTRACKER2) ? 0 : 1))
+ {
+ return false;
+ }
+ // Limit envelope length
+ if((envPoint == pEnv->nNodes - 1) && pEnv->Ticks[envPoint] + step > ENVELOPE_MAX_LENGTH)
+ {
+ return false;
+ }
+ return true;
+}
+
+
BOOL CViewInstrument::OnMouseWheel(UINT nFlags, short zDelta, CPoint pt)
//----------------------------------------------------------------------
{
Modified: trunk/OpenMPT/mptrack/View_ins.h
===================================================================
--- trunk/OpenMPT/mptrack/View_ins.h 2011-05-17 18:33:34 UTC (rev 876)
+++ trunk/OpenMPT/mptrack/View_ins.h 2011-05-20 14:17:01 UTC (rev 877)
@@ -81,6 +81,7 @@
// Misc.
bool EnvSetValue(int nPoint, int nTick=-1, int nValue=-1);
+ bool CanMovePoint(UINT envPoint, int step);
// Set loop points
bool EnvSetLoopStart(int nPoint);
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <sag...@us...> - 2011-05-17 18:33:43
|
Revision: 876
http://modplug.svn.sourceforge.net/modplug/?rev=876&view=rev
Author: saga-games
Date: 2011-05-17 18:33:34 +0000 (Tue, 17 May 2011)
Log Message:
-----------
[Fix] Welcome to episode 2938 of "this should not have happened afterall". When playing a pattern that is not in the sequence that has more rows than the last played order item, SetRowVisited crashed. I have no idea why it even got there.
[Ref] Made pattern rename code look less stupid.
Modified Paths:
--------------
trunk/OpenMPT/mptrack/Ctrl_pat.cpp
trunk/OpenMPT/soundlib/Snd_fx.cpp
Modified: trunk/OpenMPT/mptrack/Ctrl_pat.cpp
===================================================================
--- trunk/OpenMPT/mptrack/Ctrl_pat.cpp 2011-05-16 14:23:08 UTC (rev 875)
+++ trunk/OpenMPT/mptrack/Ctrl_pat.cpp 2011-05-17 18:33:34 UTC (rev 876)
@@ -1067,13 +1067,13 @@
{
if ((m_pSndFile) && (m_pModDoc) && (!IsLocked()))
{
- CHAR s[256], sold[128] = "";
- PATTERNINDEX nPat = (PATTERNINDEX)SendViewMessage(VIEWMSG_GETCURRENTPATTERN);
+ const PATTERNINDEX nPat = (PATTERNINDEX)SendViewMessage(VIEWMSG_GETCURRENTPATTERN);
- m_EditPatName.GetWindowText(s, MAX_PATTERNNAME);
- s[MAX_PATTERNNAME - 1] = 0;
- m_pSndFile->Patterns[nPat].GetName(sold, CountOf(sold));
- if (strcmp(s, sold))
+ CHAR s[MAX_PATTERNNAME];
+ m_EditPatName.GetWindowText(s, CountOf(s));
+ SetNullTerminator(s);
+
+ if (m_pSndFile->Patterns[nPat].GetName().Compare(s))
{
if(m_pSndFile->Patterns[nPat].SetName(s))
{
Modified: trunk/OpenMPT/soundlib/Snd_fx.cpp
===================================================================
--- trunk/OpenMPT/soundlib/Snd_fx.cpp 2011-05-16 14:23:08 UTC (rev 875)
+++ trunk/OpenMPT/soundlib/Snd_fx.cpp 2011-05-17 18:33:34 UTC (rev 876)
@@ -3993,7 +3993,7 @@
{
const MODCHANNEL *pChn = &Chn[nChn];
// Unlike channel settings, pModInstrument is copied from the original chan to the NNA chan,
- // so we don't nee to worry about finding the master chan.
+ // so we don't need to worry about finding the master chan.
UINT nPlugin=0;
if (pChn && pChn->pModInstrument) {
@@ -4148,7 +4148,7 @@
//--------------------------------------------------------------------------------------------------------------------------
{
const ORDERINDEX nMaxOrd = Order.GetLengthTailTrimmed();
- if(nOrd >= nMaxOrd || nRow > Patterns[Order[nOrd]].GetNumRows())
+ if(nOrd >= nMaxOrd || nRow >= Patterns[Order[nOrd]].GetNumRows())
{
return;
}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <sag...@us...> - 2011-05-16 14:23:15
|
Revision: 875
http://modplug.svn.sourceforge.net/modplug/?rev=875&view=rev
Author: saga-games
Date: 2011-05-16 14:23:08 +0000 (Mon, 16 May 2011)
Log Message:
-----------
[Ref] Moved CRawSampleDlg to SampleEditorDialogs.cpp
Modified Paths:
--------------
trunk/OpenMPT/mptrack/Ctrl_smp.cpp
trunk/OpenMPT/mptrack/Mpdlgs.cpp
trunk/OpenMPT/mptrack/Mpdlgs.h
trunk/OpenMPT/mptrack/SampleEditorDialogs.cpp
trunk/OpenMPT/mptrack/SampleEditorDialogs.h
Modified: trunk/OpenMPT/mptrack/Ctrl_smp.cpp
===================================================================
--- trunk/OpenMPT/mptrack/Ctrl_smp.cpp 2011-05-15 20:29:13 UTC (rev 874)
+++ trunk/OpenMPT/mptrack/Ctrl_smp.cpp 2011-05-16 14:23:08 UTC (rev 875)
@@ -9,7 +9,6 @@
#include "SampleEditorDialogs.h"
#include "dlg_misc.h"
#include "PSRatioCalc.h" //rewbs.timeStretchMods
-#include "mpdlgs.h"
#include "soundtouch/SoundTouch.h"
#include "soundtouch/TDStretch.h"
#include "soundtouch/SoundTouchDLL.h"
Modified: trunk/OpenMPT/mptrack/Mpdlgs.cpp
===================================================================
--- trunk/OpenMPT/mptrack/Mpdlgs.cpp 2011-05-15 20:29:13 UTC (rev 874)
+++ trunk/OpenMPT/mptrack/Mpdlgs.cpp 2011-05-16 14:23:08 UTC (rev 875)
@@ -1104,45 +1104,6 @@
}
-//////////////////////////////////////////////////////////////
-// CRawSampleDlg
-
-UINT CRawSampleDlg::m_nFormat = ER_8BIT | ER_UNSIGNED | ER_MONO;
-
-BOOL CRawSampleDlg::OnInitDialog()
-//--------------------------------
-{
- CDialog::OnInitDialog();
- UpdateDialog();
- return TRUE;
-}
-
-
-void CRawSampleDlg::OnOK()
-//------------------------
-{
- m_nFormat = 0;
- if(IsDlgButtonChecked(IDC_RADIO1)) m_nFormat |= ER_8BIT;
- if(IsDlgButtonChecked(IDC_RADIO2)) m_nFormat |= ER_16BIT;
- if(IsDlgButtonChecked(IDC_RADIO3)) m_nFormat |= ER_UNSIGNED;
- if(IsDlgButtonChecked(IDC_RADIO4)) m_nFormat |= ER_SIGNED;
- if(IsDlgButtonChecked(IDC_RADIO5)) m_nFormat |= ER_MONO;
- if(IsDlgButtonChecked(IDC_RADIO6)) m_nFormat |= ER_STEREO;
- m_bRememberFormat = IsDlgButtonChecked(IDC_CHK_REMEMBERSETTINGS) ? true : false;
- CDialog::OnOK();
-}
-
-
-void CRawSampleDlg::UpdateDialog()
-//--------------------------------
-{
- CheckRadioButton(IDC_RADIO1, IDC_RADIO2, (m_nFormat & ER_8BIT) ? IDC_RADIO1 : IDC_RADIO2 );
- CheckRadioButton(IDC_RADIO3, IDC_RADIO4, (m_nFormat & ER_UNSIGNED) ? IDC_RADIO3 : IDC_RADIO4);
- CheckRadioButton(IDC_RADIO5, IDC_RADIO6, (m_nFormat & ER_MONO) ? IDC_RADIO5 : IDC_RADIO6);
- CheckDlgButton(IDC_CHK_REMEMBERSETTINGS, (m_bRememberFormat) ? MF_CHECKED : MF_UNCHECKED);
-}
-
-
/////////////////////////////////////////////////////////////
// CMidiSetupDlg
Modified: trunk/OpenMPT/mptrack/Mpdlgs.h
===================================================================
--- trunk/OpenMPT/mptrack/Mpdlgs.h 2011-05-15 20:29:13 UTC (rev 874)
+++ trunk/OpenMPT/mptrack/Mpdlgs.h 2011-05-16 14:23:08 UTC (rev 875)
@@ -130,42 +130,6 @@
};
-#define ER_8BIT 0x01
-#define ER_16BIT 0x02
-
-#define ER_SIGNED 0x10
-#define ER_UNSIGNED 0x20
-
-#define ER_MONO 0x0100
-#define ER_STEREO 0x0200
-
-//=================================
-class CRawSampleDlg: public CDialog
-//=================================
-{
-protected:
- static UINT m_nFormat;
- bool m_bRememberFormat;
-
-public:
- static const UINT GetSampleFormat() { return m_nFormat; }
- static void SetSampleFormat(UINT nFormat) { m_nFormat = nFormat; }
- const bool GetRemeberFormat() { return m_bRememberFormat; };
- void SetRememberFormat(bool bRemember) { m_bRememberFormat = bRemember; };
-
-public:
- CRawSampleDlg(CWnd *parent = NULL):CDialog(IDD_LOADRAWSAMPLE, parent)
- {
- m_bRememberFormat = false;
- }
-
-protected:
- virtual BOOL OnInitDialog();
- virtual void OnOK();
- void UpdateDialog();
-};
-
-
//=======================================
class CMidiSetupDlg: public CPropertyPage
//=======================================
Modified: trunk/OpenMPT/mptrack/SampleEditorDialogs.cpp
===================================================================
--- trunk/OpenMPT/mptrack/SampleEditorDialogs.cpp 2011-05-15 20:29:13 UTC (rev 874)
+++ trunk/OpenMPT/mptrack/SampleEditorDialogs.cpp 2011-05-16 14:23:08 UTC (rev 875)
@@ -56,6 +56,45 @@
}
+//////////////////////////////////////////////////////////////
+// Sample import dialog
+
+UINT CRawSampleDlg::m_nFormat = ER_8BIT | ER_UNSIGNED | ER_MONO;
+
+BOOL CRawSampleDlg::OnInitDialog()
+//--------------------------------
+{
+ CDialog::OnInitDialog();
+ UpdateDialog();
+ return TRUE;
+}
+
+
+void CRawSampleDlg::OnOK()
+//------------------------
+{
+ m_nFormat = 0;
+ if(IsDlgButtonChecked(IDC_RADIO1)) m_nFormat |= ER_8BIT;
+ if(IsDlgButtonChecked(IDC_RADIO2)) m_nFormat |= ER_16BIT;
+ if(IsDlgButtonChecked(IDC_RADIO3)) m_nFormat |= ER_UNSIGNED;
+ if(IsDlgButtonChecked(IDC_RADIO4)) m_nFormat |= ER_SIGNED;
+ if(IsDlgButtonChecked(IDC_RADIO5)) m_nFormat |= ER_MONO;
+ if(IsDlgButtonChecked(IDC_RADIO6)) m_nFormat |= ER_STEREO;
+ m_bRememberFormat = IsDlgButtonChecked(IDC_CHK_REMEMBERSETTINGS) ? true : false;
+ CDialog::OnOK();
+}
+
+
+void CRawSampleDlg::UpdateDialog()
+//--------------------------------
+{
+ CheckRadioButton(IDC_RADIO1, IDC_RADIO2, (m_nFormat & ER_8BIT) ? IDC_RADIO1 : IDC_RADIO2 );
+ CheckRadioButton(IDC_RADIO3, IDC_RADIO4, (m_nFormat & ER_UNSIGNED) ? IDC_RADIO3 : IDC_RADIO4);
+ CheckRadioButton(IDC_RADIO5, IDC_RADIO6, (m_nFormat & ER_MONO) ? IDC_RADIO5 : IDC_RADIO6);
+ CheckDlgButton(IDC_CHK_REMEMBERSETTINGS, (m_bRememberFormat) ? MF_CHECKED : MF_UNCHECKED);
+}
+
+
/////////////////////////////////////////////////////////////////////////
// Add silence dialog - add silence to a sample
Modified: trunk/OpenMPT/mptrack/SampleEditorDialogs.h
===================================================================
--- trunk/OpenMPT/mptrack/SampleEditorDialogs.h 2011-05-15 20:29:13 UTC (rev 874)
+++ trunk/OpenMPT/mptrack/SampleEditorDialogs.h 2011-05-16 14:23:08 UTC (rev 875)
@@ -29,6 +29,45 @@
};
+//////////////////////////////////////////////////////////////////////////
+// Sample import dialog
+
+#define ER_8BIT 0x01
+#define ER_16BIT 0x02
+
+#define ER_SIGNED 0x10
+#define ER_UNSIGNED 0x20
+
+#define ER_MONO 0x0100
+#define ER_STEREO 0x0200
+
+//=================================
+class CRawSampleDlg: public CDialog
+//=================================
+{
+protected:
+ static UINT m_nFormat;
+ bool m_bRememberFormat;
+
+public:
+ static const UINT GetSampleFormat() { return m_nFormat; }
+ static void SetSampleFormat(UINT nFormat) { m_nFormat = nFormat; }
+ const bool GetRemeberFormat() { return m_bRememberFormat; };
+ void SetRememberFormat(bool bRemember) { m_bRememberFormat = bRemember; };
+
+public:
+ CRawSampleDlg(CWnd *parent = NULL):CDialog(IDD_LOADRAWSAMPLE, parent)
+ {
+ m_bRememberFormat = false;
+ }
+
+protected:
+ virtual BOOL OnInitDialog();
+ virtual void OnOK();
+ void UpdateDialog();
+};
+
+
/////////////////////////////////////////////////////////////////////////
// Add silence dialog - add silence to a sample
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <sag...@us...> - 2011-05-15 20:29:22
|
Revision: 874
http://modplug.svn.sourceforge.net/modplug/?rev=874&view=rev
Author: saga-games
Date: 2011-05-15 20:29:13 +0000 (Sun, 15 May 2011)
Log Message:
-----------
[Fix] Added a fix for the recent VS2008 security update bloatage...
[Fix] Hopefully this fixes the line endings in History.txt...
[Mod] Installer: Added option to view release notes after installation.
[Ref] Minor refactoring in view_pat.cpp
Modified Paths:
--------------
trunk/OpenMPT/installer/install.iss
trunk/OpenMPT/mptrack/STDAFX.CPP
trunk/OpenMPT/mptrack/View_pat.cpp
trunk/OpenMPT/packageTemplate/History.txt
Modified: trunk/OpenMPT/installer/install.iss
===================================================================
--- trunk/OpenMPT/installer/install.iss 2011-05-15 20:26:20 UTC (rev 873)
+++ trunk/OpenMPT/installer/install.iss 2011-05-15 20:29:13 UTC (rev 874)
@@ -115,8 +115,9 @@
[Run]
; duh
+Filename: "https://sourceforge.net/projects/kernelex/"; Description: "Download KernelEx (required on Windows 98 / Me)"; Flags: shellexec nowait postinstall skipifsilent; Check: not UsingWinNT();
+Filename: "{app}\OMPT_{#GetAppVersionShort}_ReleaseNotes.html"; Description: "View Release Notes"; Flags: shellexec nowait postinstall skipifsilent
Filename: {app}\mptrack.exe; Parameters: """{app}\ExampleSongs\manwe - evening glow.it"""; Description: {cm:LaunchProgram,OpenMPT}; Flags: nowait postinstall skipifsilent
-Filename: "https://sourceforge.net/projects/kernelex/"; Description: "Download KernelEx (required on Windows 98 / Me)"; Flags: shellexec nowait postinstall skipifsilent; Check: not UsingWinNT();
[UninstallDelete]
; internet shortcut has to be deleted manually
Modified: trunk/OpenMPT/mptrack/STDAFX.CPP
===================================================================
--- trunk/OpenMPT/mptrack/STDAFX.CPP 2011-05-15 20:26:20 UTC (rev 873)
+++ trunk/OpenMPT/mptrack/STDAFX.CPP 2011-05-15 20:29:13 UTC (rev 874)
@@ -4,3 +4,29 @@
#include "stdafx.h"
+// Fix for VS2008 SP1 bloatage (http://tedwvc.wordpress.com/2011/04/16/static-mfc-code-bloat-problem-from-vc2010-is-now-in-vc2008-sp1security-fix/):
+
+// this is our own local copy of the AfxLoadSystemLibraryUsingFullPath function
+HMODULE AfxLoadSystemLibraryUsingFullPath(const WCHAR *pszLibrary)
+{
+ WCHAR wszLoadPath[MAX_PATH+1];
+ if (::GetSystemDirectoryW(wszLoadPath, _countof(wszLoadPath)) == 0)
+ {
+ return NULL;
+ }
+
+ if (wszLoadPath[wcslen(wszLoadPath)-1] != L'\\')
+ {
+ if (wcscat_s(wszLoadPath, _countof(wszLoadPath), L"\\") != 0)
+ {
+ return NULL;
+ }
+ }
+
+ if (wcscat_s(wszLoadPath, _countof(wszLoadPath), pszLibrary) != 0)
+ {
+ return NULL;
+ }
+
+ return(::AfxCtxLoadLibraryW(wszLoadPath));
+}
Modified: trunk/OpenMPT/mptrack/View_pat.cpp
===================================================================
--- trunk/OpenMPT/mptrack/View_pat.cpp 2011-05-15 20:26:20 UTC (rev 873)
+++ trunk/OpenMPT/mptrack/View_pat.cpp 2011-05-15 20:29:13 UTC (rev 874)
@@ -5070,17 +5070,21 @@
UINT startRow = GetSelectionStartRow();
UINT endRow = GetSelectionEndRow();
- if (ListChansWhereColSelected(NOTE_COLUMN, validChans)>0) {
- for (int valChnIdx=0; valChnIdx<validChans.GetCount(); valChnIdx++) {
+ if (ListChansWhereColSelected(NOTE_COLUMN, validChans) > 0)
+ {
+ for (int valChnIdx=0; valChnIdx<validChans.GetCount(); valChnIdx++)
+ {
if (IsInterpolationPossible(startRow, endRow,
- validChans[valChnIdx], NOTE_COLUMN, pSndFile)) {
+ validChans[valChnIdx], NOTE_COLUMN, pSndFile))
+ {
greyed=0; //Can do interpolation.
break;
}
}
}
- if (!greyed || !(CMainFrame::m_dwPatternSetup&PATTERN_OLDCTXMENUSTYLE)) {
+ if (!greyed || !(CMainFrame::m_dwPatternSetup&PATTERN_OLDCTXMENUSTYLE))
+ {
AppendMenu(hMenu, MF_STRING|greyed, ID_PATTERN_INTERPOLATE_NOTE, "Interpolate Note\t" + ih->GetKeyTextFromCommand(kcPatternInterpolateNote));
return true;
}
@@ -5096,16 +5100,20 @@
UINT startRow = GetSelectionStartRow();
UINT endRow = GetSelectionEndRow();
- if (ListChansWhereColSelected(VOL_COLUMN, validChans)>0) {
- for (int valChnIdx=0; valChnIdx<validChans.GetCount(); valChnIdx++) {
+ if (ListChansWhereColSelected(VOL_COLUMN, validChans) > 0)
+ {
+ for (int valChnIdx=0; valChnIdx<validChans.GetCount(); valChnIdx++)
+ {
if (IsInterpolationPossible(startRow, endRow,
- validChans[valChnIdx], VOL_COLUMN, pSndFile)) {
- greyed=0; //Can do interpolation.
+ validChans[valChnIdx], VOL_COLUMN, pSndFile))
+ {
+ greyed = 0; //Can do interpolation.
break;
}
}
}
- if (!greyed || !(CMainFrame::m_dwPatternSetup&PATTERN_OLDCTXMENUSTYLE)) {
+ if (!greyed || !(CMainFrame::m_dwPatternSetup&PATTERN_OLDCTXMENUSTYLE))
+ {
AppendMenu(hMenu, MF_STRING|greyed, ID_PATTERN_INTERPOLATE_VOLUME, "Interpolate Vol Col\t" + ih->GetKeyTextFromCommand(kcPatternInterpolateVol));
return true;
}
@@ -5122,26 +5130,33 @@
UINT startRow = GetSelectionStartRow();
UINT endRow = GetSelectionEndRow();
- if (ListChansWhereColSelected(EFFECT_COLUMN, validChans)>0) {
- for (int valChnIdx=0; valChnIdx<validChans.GetCount(); valChnIdx++) {
- if (IsInterpolationPossible(startRow, endRow, validChans[valChnIdx], EFFECT_COLUMN, pSndFile)) {
+ if (ListChansWhereColSelected(EFFECT_COLUMN, validChans) > 0)
+ {
+ for (int valChnIdx=0; valChnIdx<validChans.GetCount(); valChnIdx++)
+ {
+ if (IsInterpolationPossible(startRow, endRow, validChans[valChnIdx], EFFECT_COLUMN, pSndFile))
+ {
greyed=0; //Can do interpolation.
break;
}
}
}
- if (ListChansWhereColSelected(PARAM_COLUMN, validChans)>0) {
- for (int valChnIdx=0; valChnIdx<validChans.GetCount(); valChnIdx++) {
- if (IsInterpolationPossible(startRow, endRow, validChans[valChnIdx], EFFECT_COLUMN, pSndFile)) {
- greyed=0; //Can do interpolation.
+ if (ListChansWhereColSelected(PARAM_COLUMN, validChans) > 0)
+ {
+ for (int valChnIdx=0; valChnIdx<validChans.GetCount(); valChnIdx++)
+ {
+ if (IsInterpolationPossible(startRow, endRow, validChans[valChnIdx], EFFECT_COLUMN, pSndFile))
+ {
+ greyed = 0; //Can do interpolation.
break;
}
}
}
- if (!greyed || !(CMainFrame::m_dwPatternSetup&PATTERN_OLDCTXMENUSTYLE)) {
+ if (!greyed || !(CMainFrame::m_dwPatternSetup&PATTERN_OLDCTXMENUSTYLE))
+ {
AppendMenu(hMenu, MF_STRING|greyed, ID_PATTERN_INTERPOLATE_EFFECT, "Interpolate Effect\t" + ih->GetKeyTextFromCommand(kcPatternInterpolateEffect));
return true;
}
@@ -5161,10 +5176,10 @@
AppendMenu(pasteSpecialMenu, MF_STRING, ID_EDIT_PASTEFLOOD, "Paste Flood\t" + ih->GetKeyTextFromCommand(kcEditPasteFlood));
AppendMenu(pasteSpecialMenu, MF_STRING, ID_EDIT_PUSHFORWARDPASTE, "Push Forward Paste (Insert)\t" + ih->GetKeyTextFromCommand(kcEditPushForwardPaste));
- DWORD greyed = pModDoc->GetPatternUndo()->CanUndo()?FALSE:MF_GRAYED;
+ DWORD greyed = pModDoc->GetPatternUndo()->CanUndo() ? MF_ENABLED : MF_GRAYED;
if (!greyed || !(CMainFrame::m_dwPatternSetup & PATTERN_OLDCTXMENUSTYLE))
{
- AppendMenu(hMenu, MF_STRING|greyed, ID_EDIT_UNDO, "Undo\t" + ih->GetKeyTextFromCommand(kcEditUndo));
+ AppendMenu(hMenu, MF_STRING | greyed, ID_EDIT_UNDO, "Undo\t" + ih->GetKeyTextFromCommand(kcEditUndo));
}
AppendMenu(hMenu, MF_STRING, ID_CLEAR_SELECTION, "Clear selection\t" + ih->GetKeyTextFromCommand(kcSampleDelete));
Modified: trunk/OpenMPT/packageTemplate/History.txt
===================================================================
--- trunk/OpenMPT/packageTemplate/History.txt 2011-05-15 20:26:20 UTC (rev 873)
+++ trunk/OpenMPT/packageTemplate/History.txt 2011-05-15 20:29:13 UTC (rev 874)
@@ -1,1983 +1,1983 @@
-OpenMPT - Full Version History
-------------------------------
-
-[Fix]: bug fix
-[New]: new feature
-[Imp]: improvement
-[Reg]: known issue / regression
-[Mod]: change
-[Var]: other
-(tx XYZ): thanks to XYZ for telling us about the bug / requesting the feature
-
-
-v1.19.02.00 (May 2011, revision 871)
-------------------------------------
-Pattern tab
- [New] <Jojo> Channels can now be moved by dragging their channel header. Holding Shift while doing so duplicates the channel.
- [Imp] <Jojo> Moving channels through the channel manager creates an undo point now.
- [Fix] <Jojo> Order list info text now truncates list length after the first "---" pattern for MOD files in hex display mode as well.
-
-Pattern tab::Note properties
- [Fix] <Jojo> Axx is not limited to value 7F anymore in IT / S3M format.
-
-VST
- [New] <Jojo> New menu entry in the plugin editor: Create instrument from plugin
- [Fix] <Jojo> Fixed note handling in VST editor of plugins that actually don't support MIDI input (http://bugs.openmpt.org/view.php?id=102)
-
-Mod Conversion
- [Imp] <Jojo> Improved conversion of Sxx (IT / S3M) and PC Notes.
- [Mod] <Jojo> When converting from MOD / S3M to XM / IT, compatible play is automatically enabled.
- [Fix] <Jojo> Sustain loop conversion didn't work
-
-Playback
- [Fix] <Jojo> The first triggered note in the pattern / sample / instrument editor is not cut off anymore (tx C-jeff, http://bugs.openmpt.org/view.php?id=123)
-
-IT
- [Imp] <Jojo> When clearing MIDI macros during loading, only the Zxx macros are cleared, but not the global (currently unused) configuration.
- [Fix] <Jojo> Panning slides with both parameter nibbles set were not ignored in compatible mode.
-
-XM
- [Fix] <Jojo> When using compatibility export, the number of samples per instrument is now limited to 16.
-
-MOD
- [Imp] <Jojo> Instead of cutting the order list after the first --- pattern, such order items are simply removed from the saved order list. (http://bugs.openmpt.org/view.php?id=118)
- [Fix] <Jojo> "+++" separator patterns were allowed in MOD files, which made them break in other trackers / players. (http://bugs.openmpt.org/view.php?id=118)
-
-S3M
- [Imp] <Jojo> When clearing MIDI macros during loading, only the Zxx macros are cleared, but not the global (currently unused) configuration.
-
-Other formats
- [Imp] <Jojo> DMF Loader was rewritten completely and is a whole lot more accurate now.
- [Fix] <Jojo> J2B Loader: Empty sample slots are now treated correct in new (RIFF AM) J2B files.
- [Fix] <Jojo> DBM Loader: Global volume was scaled wrong.
- [Fix] <Jojo> 8SVX Loader: If no sample could be found in the file, the loader does not claim to have successfully loaded a sample anymore. (http://bugs.openmpt.org/view.php?id=117)
-
-Misc
- [New] <Jojo> OpenMPT can now automatically check for updates (daily / weekly / monthly)
- [Mod] <Jojo> "Embed MIDI macros" is now only enabled during song creation if the user's default MIDI macro setup differs from standard configuration.
- [Fix] <Jojo> When using "Convert instruments to samples" in the Song Cleanup dialog, "Remove samples associated with an instrument" actually destroyed all samples.
- [Reg] <Jojo> Removed hidden INI flag to suppress warnings when encountering keymaps with unknown items. This option was introduced when faulty keymaps threw multiple message boxes, but now it's just one and it shouldn't be ignored...
-
-
-v1.19.01.00 (April 2011, revision 836)
---------------------------------------
-Pattern tab
- [New] <Jojo> Clicking and dragging the row numbers selects the whole row in Excel / Calc style (http://bugs.openmpt.org/view.php?id=45)
- [New] <Jojo> The new keyboard shortcuts "Select beat" and "Select measure" can be used to automatically extend the current selection to the beat / measure boundaries.
- [New] <Jojo> Experimental feature: Play the whole pattern row when entering notes and chords into the pattern editor. This can be enabled from the setup screen.
- [Mod] <Jojo> Using the Goto Dialog updates channel parameters and sets the elapsed time now. (http://bugs.openmpt.org/view.php?id=28)
- [Mod] <Jojo> Undo steps have been increased from 100 to 1000.
- [Fix] <Jojo> Shrink selection is more consistent with Shrink pattern now: Entries on odd rows are not ignored anymore if there is no entry in the even rows. Also, cleaning of the pattern after shrinking the selection has been fixed - it cleaned whole commands instead of just the selected parts of a command. (http://bugs.openmpt.org/view.php?id=89)
- [Fix] <Jojo> Cursor paste was possible even when editing was disabled.
- [Fix] <Jojo> Using Right-Click -> Change Plugin on PC notes did not work for plugin numbers that were higher than the highest instrument number.
- [Fix] <Jojo> When entering chords into the pattern editor, the module was only marked as modified if the base note of the chord was changed.
- [Fix] <Jojo> When jumping to an order which is normally not played, the song variables are now reset (previously, if the main song had f.e. a global volume fade out at the end, this was retained when switching to an unplayed order, effectively muting all sub songs).
- [Fix] <Jojo> OpenMPT does not crash anymore when applying the Amplify command on a pattern selection that just covers the note / instrument column of the first channel.
- [Fix] <Jojo> Queueing a "---" or "+++" item now automatically moves the queue "cursor" to the next available pattern. Previously, queueing a "---" pattern restarted the song.
- [Fix] <Jojo> Changing a channel name from the pattern editor didn't mark the document as modified (http://bugs.openmpt.org/view.php?id=65)
- [Fix] <Jojo> When restarting a pattern, the song timer was not reset properly.
- [Fix] <Jojo> Entering a note-off event in the MOD format created an unnecessary undo event.
- [Fix] <Jojo> Automation data is not written to the pattern if the current module format does not support smooth midi macros.
- [Fix] <Jojo> Selections were not clamped properly to the end of the pattern sometimes.
- [Reg] <Jojo> The "Position aware timer" option is gone. The position aware timer is now automatically used. It was optional in the first place because of some buggy code, which is now fixed.
-
-Pattern tab::Note properties
- [Fix] <Jojo> The meaning of Q0x was displayed wrong for IT / S3M.
- [Fix] <Jojo> Changing a value didn't create an undo point. (http://bugs.openmpt.org/view.php?id=56)
- [Fix] <Jojo> Setting the PC note plugin didn't work.
-
-Pattern tab::Find/replace
- [New] <Jojo> Added Find / Replace mode: Find in current pattern selection. (http://bugs.openmpt.org/view.php?id=42)
- [Imp] <Jojo> When changing the content of a combobox, the corresponding checkbox is now automatically checked. Likewise, the "Replace By" checkbox is checked if a checkbox or combobox on the "Replace" tab is enabled.
- [Mod] <Jojo> "Replace All" just creates one undo point now.
-
-Pattern tab::GUI
- [Imp] <Jojo> Special paste modes have been moved to a sub menu in the context menu, to save some space.
- [Imp] <Jojo> Status bar now indicates if highpass filter is enabled on a channel. (http://bugs.openmpt.org/view.php?id=92)
- [Imp] <Jojo> The dodgy note colour is now also customisable.
- [Mod] <Jojo> When removing a channel (via context menu) that contains no data in any pattern, no warning is shown anymore.
-
-Sample tab
- [New] <Jojo> There's a new tool to create seamless sample loops: The loop crossfader. Includes a new keyboard shortcut. (http://bugs.openmpt.org/view.php?id=53)
- [New] <Jojo> The new "sample grid" feature can create equally-sized sample selections, so it is f.e. easy to split a sample into four equally-sized samples.
- [New] <Jojo> New context menu item and keyboard shortcut: Quick fade for samples. If the sample start is selected, a fade-in is automatically performed. Likewise, if the sample end is selected, a fade-out is performed. If neither is selected, the default amplification dialog is shown.
- [Imp] <re> Ctrl + Mouse Wheel can now be used for zooming into the sample data.
- [Mod] <Jojo> Undo steps have been increased from 100 to 1000 (per sample).
- [Fix] <Jojo> When cutting samples with a loop, the loop end point was not always moved correctly if the cut start was in the loop.
- [Fix] <Jojo> Loop point controls also accept large numbers to be inputted manually.
- [Fix] <Jojo> Sample Undo didn't preserve the sample name.
- [Fix] <re> Changing zoom level should now preserve the view position better. (http://bugs.openmpt.org/view.php?id=3)
-
-Instrument tab
- [New] <Jojo> Clicking on an empty plugin slot in the plugin dropdown list opens the "Add Plugin" dialog (tx coda)
- [Imp] <re> Ctrl + Mouse Wheel can now be used for zooming into the envelopes.
- [Imp] <Jojo> When pressing the up arrow key in the sample map while the cursor is on the lowest note (C-0), the sample map doesn't lose focus anymore. It is also not possible anymore to move the sample map out of view by clicking the area above the lowest note.
- [Mod] <Jojo> Copying and pasting envelopes with no points isn't possible anymore. (Who wants to do that anyway?)
- [Fix] <Jojo> Fadeout control also accepts large numbers to be inputted manually. (http://bugs.openmpt.org/view.php?id=81)
- [Fix] <Jojo> Changing the filter mode didn't mark the file as modified.
- [Fix] <Jojo> The note mapping doesn't allow items anymore that aren't notes (such as "no note" or "note cut"). Such notes couldn't be entered manually, however when converting from other formats this was possible and it could crash the tracker (http://bugs.openmpt.org/view.php?id=61).
- [Fix] <Jojo> Various actions in the instrument note map and envelope view should now also mark the instrument as modified (when working in the ITP format).
-
-VST
- [New] <Jojo> Plugins can now request common file dialogs (file and directory selection).
- [Mod] <Jojo> When automatically inserting a new instrument from the VST editor, the bank and patch values are now not filled in anymore, so it is easier to change to another patch while editing.
- [Mod] <Jojo> Various small improvements to support VST 2.4 plugins better.
- [Fix] <Jojo> Speaker arrangement is now sent to the plugins upon initialization. This fixes Voxengo SPAN 2 (a VST 2.4 plugin). Does this break other multichannel plugins?
- [Fix] <Jojo> The time signature sent to VST plugins should be correct now. The denominator is always assumed to be 4, so a 6/8 signature is for example not possible.
- [Fix] <Jojo> The EnergyXT GUI does now also work after closing and re-opening the VST editor. (tx Nahkranoth, http://forum.openmpt.org/index.php?topic=2307.0)
- [Fix] <Jojo> Fixed garbage characters shown in preset fields of plugins that don't return program names.
-
-Mod Conversion
- [Imp] <Jojo> If the new format doesn't support restart positions, it is now tried to convert the restart position to a pattern command.
- [Imp] <Jojo> When converting patterns from a format with instruments to a format without instruments (or when removing all instruments using the cleanup dialog), the instrument note mapping is now also taken care of.
- [Imp] <Jojo> Sample sustain loops are now converted to normal loops if needed and possible.
- [Imp] <Jojo> Bidi loops are disabled when converting to MOD / S3M now.
- [Imp] <Jojo> More warnings are shown, old warning messages were improved.
- [Imp] <Jojo> Volume command priority when converting from XM to IT / S3M has been changed - Cxx overrides vxx in XM, so this is now taken into account.
- [Imp] <Jojo> When converting to XM, the E60 bug is now tried to be compensated.
- [Fix] <Jojo> Q0y means "no volume change" in S3M / IT, but R0y means "continue volume change" in FT2, and converting from IT / S3M to XM didn't consider this. Q0y is now converted to R8y, and E9y is now converted to Q0y (instead of Q8y).
-
-Playback
- [New] <Jojo> New mix mode: Compatible. This is used for MOD / S3M / XM / IT by default and has more appropriate mixing levels for those formats (same levels as Schism Tracker) than mix mode RC3, and it forces soft panning to be *disabled*. Please use compatible mixing levels when working with legacy formats from now on. (http://bugs.openmpt.org/view.php?id=6)
- [Imp] <Jojo> Improved the algorithm for finding a free channel for note playback in the editor (does not affect normal module playback).
- [Mod] <Jojo> A new mechanism is used to determine the end of playback. This introduces some great changes in the code. One advantage of the new mechanism is that backwards playing patterns can now be exported to WAV properly (http://bugs.openmpt.org/view.php?id=21). The new code might not stop playback properly if "loop song" is disabled and the user jumped around in the module - let's see how that works... (it's not like this has worked properly before anyway)
- [Fix] <Jojo> Pattern jumps to the same row + pattern as the jump command are not ignored anymore. (http://forum.openmpt.org/index.php?topic=1810.0)
-
-IT
- [New] <Jojo> Edit history information can now be read from and saved to IT / MPTM files. This is based on an undocumented feature in Impulse Tracker. Use View -> Edit History for viewing or deleting this information.
- [Imp] <Jojo> IT files made with Modplug Tracker 1.00a5 are now also detected as such. Since long patterns can also be created in other trackers (e.g. Chibi), long patterns are not used to identify files made with MPT anymore.
- [Mod] <Jojo> Sane values are used again for the "cwtv" and "cmwt" header fields when saving IT files; in fact the same values as in compatibility export are used. To be able to distinguish between raped and compatibility-exported IT files, "OMPT" is written in the "reserved" header field. As a consequence, IT files made with OpenMPT can now be loaded in Impulse Tracker again.
- [Fix] <Jojo> Incorrect notes were memorized for PPS (and possibly other effects) when working with instruments that had non-default note assignments (f.e. C-5 => D-4)
- [Fix] <Jojo> In compatible mode, bidi loops are now treated like in IT's software mixer. (http://bugs.openmpt.org/view.php?id=29)
- [Fix] <Jojo> Sample autovibrato is now hopefully a bit closer to Impulse Tracker in compatible mode... (http://bugs.openmpt.org/view.php?id=5)
- [Fix] <Jojo> The envelope handling was altered slightly to work more like in Schism Tracker. This fixes a combination of Envelope Carry + Portamento as it can be found in "electric bunny" by Alpha C.
- [Fix] <Jojo> Various fixes to playback of multi-sample instruments. "Ultima Ratio" by Nebularia and "Shuttle Departure" by Sphenx sound better now.
- [Fix] <Jojo> The extended sample map is not saved anymore in the instrument headers when using compatibility export.
-
-IT::Loading and Saving
- [Imp] <Jojo> Autovibrato sweep is now fixed when loading IT files made with old versions of (Open)MPT.
- [Mod] <Jojo> MIDI macros are now cleared when loading IT files made with old Impulse Tracker versions (< 2.14), so that Zxx commands won't break the songs anymore (fixes denonde.it, fix from Schism Tracker).
- [Fix] <Jojo> Note mapping items that aren't notes (f.e. empty notes) are now ignored when loading and saving.
- [Fix] <Jojo> When saving, non-existing envelopes are now replaced by a default (disabled) envelope, so that they can still be edited in Impulse Tracker.
-
-MPTM
- [New] <Jojo> Each pattern can now have a custom time signature (rows per beat and rows per measure) which can be set from the pattern properties dialog. (http://forum.openmpt.org/index.php?topic=4022.0)
- [New] <Jojo> Edit history information (read the "IT" section above for an explanation)
-
-XM
- [Fix] <Jojo> Various mind-boggling combinations of EDx, notes and instrument numbers should work correctly in compatible mode now.
- [Fix] <Jojo> When there's a instrument number next to a 3xx effect which differs from the previous instrument number, it resets the instrument properties of the previous instrument in compatible mode.
- [Fix] <Jojo> Portamento combined with an Offset command results in the offset command being ignored in compatible mode.
- [Fix] <Jojo> XM Loader: Fixed handling of instruments with no samples, so that instruments assigned to VST plugins work correctly.
-
-MOD
- [Imp] <Jojo> It's now possible to create MOD files with more than 64 distinct patterns. Just like in ProTracker, such MOD files are identified by the "M!K!" signature (instead of M.K.)
- [Fix] <Jojo> The maximum speed for MOD files was off by one in some places (31 instead of 32).
-
-MOD::Loading
- [New] <Jojo> Heuristic detection for VBlank MODs. Most MODs use the CIA timer instead of VBlank timing, but some don't.
- [New] <Jojo> Heuristic detection for PT 1.x playback mode: If there is pattern data that looks like it needs on-the-fly sample swapping, PT 1.x mode is enabled.
- [New] <Jojo> Heuristic detection for MODs with 7-bit panning, which is then automatically converted to 8-bit panning.
- [Fix] <Jojo> Tentative fix for MODs with short loops at the sample start that were most likely not intended.
-
-S3M
- [Mod] <Jojo> Changed some code in the S3M loader that should only affect really broken S3M files which every player handles different anyway (at least my broken version of aa-polym.s3m sounds better now)
- [Fix] <Jojo> Octave 8 was allowed in S3M files while it shouldn't (it wasn't even saved in the file)
- [Fix] <Jojo> S3M Loader: Fix to pattern loader (for empty patterns)
- [Fix] <Jojo> Removed the X param (#) effect from the supported effect list.
- [Fix] <Jojo> Speed and tempo values are now adjusted to what Scream Tracker actually expects (speed 1 - 254, tempo 33 - 255) - anything out of this range is ignored by Scream Tracker, so it is now also ignored by OpenMPT.
- [Fix] <Jojo> Pattern breaks >= C40 are now ignored.
- [Fix] <Jojo> Global volume commands > V40 are now ignored.
-
-Other formats
- [Imp] <Jojo> Garbage characters in sample / instrument / song names should be gone now.. This should f.e. avoid sample names like " ntitled" turning up in modules after deleting sample names.
- [Imp] <Jojo> Improved handling of the note cut effect in PTM (Polytracker) files a bit.
- [Mod] <Jojo> Improved portamento import precision for DBM and ULT loaders (patch from Schism Tracker)
- [Mod] <Jojo> Added a version check to the ITP loader (why was this not there in the first place?)
- [Fix] <Jojo> As MTM files were converted to MOD automatically when being loaded, channel panning was lost. Now they're loaded as S3M instead.
- [Fix] <Jojo> Short loops in AMF / MED files are now ignored (http://bugs.openmpt.org/view.php?id=70) - probably caused by bad MOD conversions, at least in the AMF example?
- [Reg] <Jojo> Disabled the Velvet Studio loader for now, since it either crashes on almost all AMS files or at least imports them completely wrong.
-
-Misc
- [New] <Jojo> WAV Export: Sample-exact cue points are now written at each pattern transition.
- [New] <Jojo> Most MPT hacks in modules can now be found through View -> Find MPT Hacks in Song.
- [Imp] <Jojo> Paths to VST plugins in mptrack.ini and plugin.cache are now also relative in portable mode. This means that finally, *all* stored paths are now relative in portable mode.
- [Imp] <Jojo> Additional new keyboard shortcuts: Panic, View Edit History, Set Invalid / Ignore (--- / +++) Pattern (in the orderlist), plus the ones mentioned in above categories
- [Imp] <Jojo> Some improvements were made to the Registry / INI reading: If there were no Registry settings because MPT 1.16 was previously not installed, the INI file is now also read as it might contain some lines created by the installer.
- [Imp] <Jojo> Sound Setup: For ASIO devices, only supported sampling rates are now shown.
- [Imp] <Jojo> The instrument list on the comments tab also shows assigned plugins now.
- [Imp] <Jojo> Added Mix Paste (IT Style) to the "Paste Special" edit menu
- [Imp] <Jojo> Macro Editor: User is now warned if the current macro configuration differs from the default configuration but embedding macro configuration is disabled.
- [Mod] <Jojo> Changes to keymap file handling: The active keymap is now always saved to Keybindings.mkb (in either %APPDATA%\OpenMPT or the executable's directory). Any other keymaps are now only overwritten when using the "Save keys as" function. (http://bugs.openmpt.org/view.php?id=20)
- [Mod] <Jojo> On first run, the default ASIO driver is now chosen instead of DirectSound (if there is one).
- [Mod] <Jojo> The "Original" mix mode now also has a version number (1.16) to reflect what the "original" thing is.
- [Mod] <Jojo> Updated genre list in the MP3 export dialog.
- [Mod] <Jojo> When using the ACM MP3 codec, 320kbit/s bitrate should now be available.
- [Mod] <Jojo> "No extra-loud samples" is now enabled by default (as it's more suitable for mixmodes RC3 and Original)
- [Mod] <Jojo> The MMX acceleration label in the Soundcard setup dialog is now updated according to the multimedia extensions that are supported by the CPU (3DNow! / SSE)
- [Mod] <Jojo> Updated unmo3.dll to version 2.4.0.1
- [Mod] <Jojo> Updated the internet link list in the Help menu.
- [Fix] <Jojo> Mod Cleanup: Rearrange patterns was broken when using more than one sequence in the MPTM format. (tx Skaven)
- [Fix] <Jojo> Mod Cleanup: Various sample / instrument rearranging functions broke PC Notes.
- [Fix] <Jojo> The text length was calculated wrong in the message reader, leading to a possible buffer overflow when reading song messages with mixed line endings where CR or LF line endings were expected.
- [Fix] <Jojo> When there was no INI file, the size of the upper pattern view was defaulting to a wrong value.
- [Fix] <Jojo> The ID3v2 "comments" field was not formatted properly when exporting to MP3.
- [Fix] <Jojo> unmo3.dll and uxtheme.dll (for theming the general tab) are now loaded "safely", to avoid the currently spreading DLL exploits.
- [Fix] <Jojo> Editing a sample / instrument name on the comments tab didn't mark the module as modified (tx djmakas)
- [Fix] <Jojo> When changing the font size of the song message while the comments tab is open, the message editor is now resized instantly. Previously, only the font size was updated.
- [Reg] <Jojo> "Set highlights to songs' time signatures" is gone. Custom song highlighting is now always applied, and the values found in the colour options are now always applied to new modules.
-
-
-v1.18.03.00 (August 2010, revision 673)
----------------------------------------
-General tab
- [Imp] <Jojo> To prevent OpenMPT from hanging while switching between plugins (or switching to the general tab), the preset box is only filled when it gets the focus. This makes working with Synth1 a lot easier, since it has an insane amount of presets... :)
- [Mod] <Jojo> Changed tab order of the lower panel (now it's more logical to me)
-
-Sequence editor
- [Imp] <Jojo> When inserting patterns at an empty position, the position counter is not increased anymore.
- [Imp] <Jojo> Improved sequence name display in context menu for empty sequences.
-
-Pattern tab::pattern editing
- [Imp] <Jojo> Just like in MPT 1.16, it is now possible again to interpolate between an effect and "nothing". In that case, the same value as the already existing one is repeated between the two rows.
- [Fix] <Jojo> When the first column of a pattern selection (larger than one selection field) was the parameter column, PC Note values in this column were not reset properly.
- [Fix] <Jojo> Pattern Editor: Transposing notes up/down doesn't allow notes which are actually supported by the current module format (f.e. notes below C-1 in XMs) anymore.
- [Fix] <Jojo> Keyboard shortcut for toggling record state didn't save the change, so it was reset with every new module.
-
-Pattern tab::Note properties
- [Imp] <Jojo> Effect info now shows the real finetune values for E5x in MOD/XM and E2x in S3M instead of just 0...15.
- [Imp] <Jojo> Set envelope position effect (Lxx in XM) is now explained better.
- [Fix] <Jojo> Fixed a null pointer related crash when accessing the note properties of malicious and not-so-malicious modules (f.e. jt_pools.xm) which have more than 256 sample slots.
-
-Sample tab
- [New] <Jojo> It's now also possible to create sample selections using Shift + click (this is still behaving a bit non-obvious if you don't know what you're doing :).
- [New] <Jojo> Sample Drawing: Horizontal lines can now be drawn by holding down the shift key.
- [Imp] <Jojo> Finetune range is now limited from -8 to 7 for MOD files.
- [Imp] <Jojo> When hovering the relative note and finetune controls, the actual C-5 frequency is now also shown for MOD files. Previously, this only worked for XM files.
- [Fix] <Jojo> When using the spin button next to the finetune or frequency control, the module was not marked as modified.
-
-Instrument tab
- [New] <Jojo> Pressing Ctrl while dragging a point in the envelope editor now also moves the tail of the envelope.
- [Imp] <Jojo> More helpful value display for the panning envelope in the status bar with indication what's left and what's right.
- [Imp] <Jojo> If an instrument is not initialized yet, this is done automatically now, so that changes done to the instrument are not lost, although it looks like they are actually applied (f.e. when trying to edit a previously deleted instrument).
- [Imp] <Jojo> Fadeout values up to 32767 are allowed again for XM files, as FT2 can actually handle them (and other apps like Milky support them as well)
- [Imp] <Jojo> Panning ranges from 0 to 256 again for MPTM, and from 0 to 64 for IT files (previously, it ranged from 0 to 255).
- [Imp] <Jojo> Sample Map accepts various new shortcuts now.
- [Imp] <Jojo> When pasting an envelope with a release node, it's now ignored in formats that don't support it.
- [Reg] <Jojo> Envelope release nodes cannot be enabled for IT files anymore, but they are still played for compatibility. (One has to start removing the crap from the old formats at some point...)
-
-Treeview
- [Imp] <Jojo> Treeview: Ask for confirmation when deleting patterns, samples, instruments, sequences.
- [Fix] <Jojo> Deleting a sample from the treeview and then applying undo for this sample in the sample editor crashed OpenMPT.
-
-Mod conversion
- [Imp] <Jojo> Some improvements with converting note cuts, ECx/SCx and EDx/SDx.
- [Imp] <Jojo> When converting to XM, rogue note delays are removed from the patterns to avoid interference with a FT2 bug.
- [Imp] <Jojo> Envelope release nodes are now removed when converting from MPTM.
- [Fix] <Jojo> When converting to MPTM, "+++" separator patterns are not recognized as sub tune indicators anymore, as that was quite annoying.
- [Fix] <Jojo> Channel settings were not reset properly for MOD/XM/S3M, only the first channel was fixed. (tx Sam_Zen)
- [Fix] <Jojo> Extra fine portamento was not converted properly when converting from IT/MPTM/S3M to XM.
-
-Playback (see also format-specific changes below)
- [Mod] <Jojo> Invert loop (.MOD effect) is now ignored on 16-bit samples (only important during editing, since .MODs can only contain 8-bit samples anyway)
- [Fix] <Jojo> The Pattern Loop command did not work properly on rows > 255
-
-IT::Saving
- [Imp] <Jojo> If a plugin is specified for an IT instrument and no MIDI channel is assigned, the plugin is written into the IT instrument header (in MPT 1.16's old manner), so that MPT 1.16 / XMPlay / BASS can make us of "FX Send" again. (tx Skaven)
- [Imp] <Jojo> If filter envelopes are used, a different value for the cmwt ("compatible with") field is now used in compatibility export (like in SchismTracker).
- [Fix] <Jojo> Instrument panning was not converted properly.
-
-XM
- [Fix] <Jojo> Various fixes to the pattern loop command (E6x), including a crucial FT2 bug: When E60 is used on a pattern row x, the following pattern also starts from row x instead of the beginning of the pattern, unless there was a Dxx or Cxx effect.
- [Fix] <Jojo> Prevent notes to be stopped after a fadeout. This way, a portamento effect can pick up a faded instrument which is long enough. This occours for example in the bassline (channel 11) of jt_burn.xm. Not tested with many XMs yet, I hope this won't break anything else...
-
-XM::Saving
- [Imp] <Jojo> Panbrello is not saved anymore in compatibility mode.
- [Fix] <Jojo> Completely empty patterns are loaded as empty 64-row patterns in FT2, regardless of their original size. This is now being circumvented by adding a D00 effect at the end of such patterns.
- [Fix] <Jojo> Saving XM files with 127 channels (sigh) was broken.
-
-S3M
- [Fix] <Jojo> Samples with very short loops (4 bytes) are now loaded properly. Fixes "a tiny problem.s3m" by \slash.
- [Fix] <Jojo> Notes with an SD0 effect were not ignored properly when there was a row delay effect on the same row. Now they should be ignored in any case.
-
-Other formats
- [Imp] <Jojo> Song messages are now loaded with more accuracy for some formats.
- [Imp] <Jojo> J2B Loader: Files with extended instrument settings and multiple samples per instrument work properly now. Such J2B files were not used in the game but have been created by JJ2 players using MOD2J2B.
- [Imp] <Jojo> OKT Loader: Completely new IFF-based loader, translated from SchismTracker code with permission from Storlek. This loader is a *lot* more accurate, but still misses a few pattern effects.
- [Imp] <Jojo> PSM Loader: Small improvements.
- [Fix] <Jojo> MTM Loader: The "beats per track" (means lines per pattern) setting is now taken into account.
- [Fix] <Jojo> PSM16 Loader: Since the control channels were muted, tempo commands were ignored, effectively slowing down some PSM16 tracks.
- [Fix] <re> MPTM Saver: When deleting patterns using the treeview, it was possible that Parameter Control Notes were not saved properly anymore.
-
-Misc
- [New] <Jojo> Experimental "panic" button on the main toolbar. At the moment, it just kills all VSTi and sample voices.
- [Imp] <Jojo> Added mnemonic codes to the wave export controls.
- [Mod] <Jojo> In the mod type dialog, the "misc flags" can now be toggled using check buttons instead of an edit field.
- [Mod] <Jojo> Various file loaders / savers: A new logging mechanism is used to display only one message box with errors and warnings instead of many message boxes.
- [Mod] <Jojo> Updated DE_jojo.mkb to include new shortcuts, remapped a few others (for IT-style).
- [Mod] <Jojo> Updated FR_mpt_(legovitch).mkb and NO_mpt_classic_(rakib).mkb (tx Paul Legovitch, Rakib).
- [Fix] <Jojo> Colour Setup: Some colours in the MPT default colour scheme were not set up properly when switching between presets.
-
-
-v1.18.02.00 (May 2010, revision 610)
-------------------------------------
-General tab
- [Imp] <Jojo> Disabled tempo slider for MOD files (it was just confusing)
- [Imp] <Jojo> Disabled global volume slider for MOD files, instead enabled the sample pre-amp slider (so it is also possible to make output louder)
- [Imp] <Jojo> The "output to" dropdown list also shows the actual plugin name now (instead of just the library name).
- [Fix] <Jojo> Moving a plugin in MOD/S3M files doesn't mark them as modified anymore. The channel fx dropdown lists are now also disabled for those module types.
- [Fix] <Jojo> The restart position edit control is disabled for S3M files.
- [Fix] <coda> The background colour of the tabs in the channel configuration is now also correct when using WinXP Luna or Vista/Win7 Aero.
-
-Sequence editor
- [New] <Jojo> "Select All" shortcut also works here now.
- [Imp] <Jojo> The sequence menu also allows to insert empty sequences now.
- [Fix] <Jojo> Jumping between patterns also stops VSTi notes now.
-
-Pattern tab::pattern editing
- [New] <Jojo> Extended context menu for PC Notes
- [New] <Jojo> Key shortcut + context menu entry for toggling the plugin editor of the PC Note that's under the cursor.
- [Imp] <Jojo> Overflow paste now only uses one undo step.
- [Imp] <Jojo> Instead of simply ignoring note off/cut/fade when working with .MOD files, it is converted to C00.
- [Fix] <rewbs> Effect visualizer is now aware of PC Notes (http://forum.openmpt.org/index.php?topic=3836.0).
- [Fix] <Jojo> When using MIDI record or split keyboard settings, volume data was written into the volume column in MOD format.
- [Fix] <Jojo> When converting PC Notes to MIDI Macros, the instrument index is now also cleaned as well. Noticeable for example when pasting PC Notes into an IT module.
- [Fix] <Jojo> Now, plugin slot 100 can also be automated using PC Notes.
- [Fix] <Jojo> When pasting pattern data that exactly reached the pattern end with overflow paste enabled, a redundant undo point was created.
- [Fix] <Jojo> Entered (volume) effects are now properly validated (makes a difference f.e. in MOD format where it was previously possible to enter effects like Hxx)
- [Fix] <Jojo> Mix Paste: When in MPT behaviour mode, empty FX commands were not overwritten properly when there previously was an effect in that field but only the effect number (and not the param value) was reset.
- [Fix] <Jojo> When deleting all patterns via the treeview and then switching to the pattern editor, pattern 0 is not created automatically anymore, to avoid confusion.
- [Reg] <Jojo> Creating a selection using the Shift key + Mouse click now only works if there was previously no selection made; This seems reasonable as the old shift - behaviour seems to be widely used.
-
-Pattern tab::GUI
- [New] <Jojo> When the PT1x mode or the S3M "Amiga" flag are enabled, dodgy notes (i.e lower than C-4 or higher than B-6) are marked red.
- [Imp] <Jojo> The status bar shows plugin and parameter names for PC Notes now as well.
- [Imp] <Jojo> Effect vis: Make use of song's own row highlighting variables instead of fixed global ones.
- [Fix] <Jojo> The status bar ("Position x of y") only the showed order length for the first sub tune if sub tunes were separated by an "---" order item.
- [Fix] <Jojo> Changing a channel plugin in MOD/S3M files doesn't mark them as modified anymore.
- [Fix] <Jojo> When working with multiple sequences, switching to the pattern editor for the first time automatically marked the document as modified.
-
-Pattern tab::Note properties
- [Imp] <Jojo> Don't allow values > 63 for "break to row" commands in MOD/S3M.
- [Imp] <Jojo> 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.
- [Fix] <Jojo> In the note properties, the Gxx effect for XM files was not limited properly.
- [Fix] <Jojo> In Note Properties, the waveform display for S[345]x (and equivalent MOD/XM effects) was not always fully visible ("continue" addition was cut off)
- [Fix] <Jojo> Display "fine" / "extra fine" portamento effects properly (S3M/IT/MPTM), display SFx macro properly, display MOD effects with no memory properly.
-
-Pattern tab::Find/replace
- [Fix] <Jojo> Find/Replace didn't work properly when replacing PC Notes with something that's not a PC Note.
- [Fix] <Jojo> Instead of turning "Follow Song" off, the Find/Replace dialog toggled it.
-
-Sample tab
- [New] <Jojo> Shift+New = Clone sample slot
- [New] <Jojo> Option to not ask for RAW import settings again (settings are remembered independently for all modules)
- [Imp] <Jojo> Remember previous settings in RAW import dialog
- [Imp] <Jojo> When enabling (sustain) loop and no loop points are set yet, the loop is now set automatically to full sample length or the currently selected part of the sample.
- [Imp] <Jojo> Sample name and filename length are now properly limited.
- [Fix] <Jojo> When applying time stretch / pitch shift to an 8-bit sample and selecting the sample partly lead to partial upsampling, instead of upsampling the whole sample.
- [Fix] <Jojo> Sample Undo: If no custom value was set, the default value was set ridiculously high (tx Paul Legovitch)
- [Fix] <Jojo> Sample Undo: Fixed another possible problem when undoing actions with very little memory left.
- [Fix] <Jojo> It was not possible to create the last sample slot (i.e. pressing "new sample" with a MOD file that had 30 samples would result in an error, although MOD supports 31 samples).
- [Fix] <Jojo> When loading an extremely short raw file (f.e. 1 byte) twice, it crashed OpenMPT.
-
-Instrument tab
- [New] <Jojo> Envelope zooming. Might still look very weird (especially the first tick and around loop points). Includes two new keyboard shortcuts.
- [New] <Jojo> Transpose Up/Down for sample map.
- [New] <Jojo> 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.
- [Imp] <Jojo> When pasting an envelope, it's now also automatically enabled.
- [Imp] <Jojo> Instrument name and filename length are now properly limited.
- [Imp] <Jojo> "Scale envelope points" is now also available for scaling the values of the points (y axis).
- [Fix] <Jojo> The panning spin button ranged from 0 to 256, however when saving to .IT, 256 was wrapping over to 0. Panning is now limited from 0 to 255.
- [Fix] <Jojo> It was impossible to assign plugin slot 100 to an instrument.
-
-Comments tab
- [Fix] <Jojo> Correct C-5 frequency is now also shown for XM modules.
- [Fix] <Jojo> When editing sample / instrument names, they are limited properly in length now.
-
-Treeview
- [New] <Jojo> Sequences can now be copied to other modules by simply dragging the sequence header into the the other module's sequence header. Does only work between two different modules, not within the same module, and it will not copy the pattern contents.
- [Imp] <Jojo> Display sequence index next to sequence names.
- [Imp] <Jojo> Improved order dragging; It is now also possible to drag an order into a non-MPTM module. In that case, the old orderlist will be replaced.
- [Imp] <Jojo> J2B files were not shown in the treeview.
- [Fix] <Jojo> Soundfont samples were not playing correctly anymore. Note that soundfont samples in the MIDI library still don't work.
- [Fix] <Jojo> 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)
- [Fix] <Jojo> "Bypass" action for VSTs didn't set the document as modified.
- [Fix] <Jojo> Right-Click on module -> Close didn't ask for confirmation when the document was modified.
- [Fix] <Jojo> Insert/Duplicate sequence actions didn't set the document modified. Grey out those two actions if no additional sequences can be added.
-
-VST
- [New] <Jojo> 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.
- [Imp] <Jojo> VST Editor: Instead of just saying the user that the plugin has to be assigned to an instrument to play notes, they are queried now whether they want to automatically add an instrument.
- [Imp] <Jojo> VST Editor: Added shortcuts for "toggle bypass", "pass keys to plug" and "record params to pattern"
- [Mod] <Jojo> VST Editor: Changed number of patches per sub menu from 100 to 128. Now, one sub menu equals ones MIDI bank (more logical)
- [Fix] <Jojo> VST Editor: Preset names starting with ' ' >= char > 'A' were cropped (i.e. "123ABC" was displayed as "ABC")
- [Fix] <Jojo> VST Editor: Changing a plugin parameter in MOD/S3M files doesn't mark them as modified anymore.
- [Fix] <Jojo> Even if an instrument was muted, a VSTi assigned to this instrument was still playing in the pattern.
- [Fix] <re> Some VSTs that previously wouldn't load might now load fine.
- [Fix] <re> Returned host CanDo-values were wrong (since pre-RC1 era).
-
-Mod conversion
- [Fix] <Jojo> When converting from MOD to S3M or IT, the Invert Loop effect was not removed.
- [Fix] <Jojo> When converting from MPTM to another format, the first sequence name is removed and the sequence is now sized properly when merging multiple sequences (tx Skaven).
- [Fix] <Jojo> When converting between XM and IT, the sample autovibrato "sweep" factor is now fixed a bit (since sweep = 0 equals "no sweep" in XM, and "no vibrato" in IT).
- [Fix] <Jojo> When removing instruments from the treeview and converting the module to a different format which also supports instruments, OpenMPT crashed.
- [Fix] <Jojo> When converting to MOD/S3M, the extended filter range flag was not deactivated.
- [Fix] <Jojo> S00 (IT/S3M) does not equal E00 (MOD/XM), as Exx doesn't have effect memory. Trying to convert S00 to the last used value now.
- [Fix] <Jojo> If necessary (S3M), the restart position attribute is reset.
- [Fix] <re> Merging multiple sequences didn't properly convert '---'/'+++' orders.
-
-IT
- [Imp] <Jojo> IT Saver: Compatibility export saves stereo samples again, as other tracker like Schism also support this (and so do the official IT specs).
- [Fix] <Jojo> IT Saver: Fixed IT sample flags which could potentially cause IT to screw up on loading/saving MPT-made modules with samples that are not used by an instrument.
- [Fix] <Jojo> IT Loader: ChibiTracker uses a different newline characater for the comments text, which was not handled properly.
- [Fix] <Jojo> (fix from SchismTracker) IT Loader: Ignore stereo sample flag when loading old IT files (older than IT 2.14) since Impulse Tracker did not reset this flag when importing stereo samples back then.
- [Fix] <Jojo> ITI/ITS Loader: Sample flags were not reset when a sample slot was overwritten when loading ITI or ITS files. That way, it was possible that f.e. the bidi loop flag was not disabled when loading a new sample that had a normal loop.
- [Fix] <Jojo> IT Compatibility: Note Cut really cuts notes and does not just mute them (so that following volume commands could restore the sample)
- [Fix] <Jojo> IT Compatibility: Always reset autovibrato settings when there's an instrument number (fix from SchismTracker)
- [Fix] <Jojo> IT Compatibility: S77 / S79/ S7B are supposed to pause the envelope, not disable it.
- [Fix] <Jojo> IT Compatibility: ignore slide commands with both nibbles set (f.e. D55, PA1, ...)
- [Fix] <Jojo> IT Compatibility: Default Vibrato/Tremolo/Panbrello waveform values to sine waveform if out of range (e.g. S35)
-
-IT/MPTM/ITP, Instrument extension handling:
- [Fix] <re> Fixes to instrument envelope flag handling (broken in 1.18.00.00).
-
-XM
- [Imp] <Jojo> XM Loader: Improved detection of an old version of MPT (1.09?).
- [Fix] <Jojo> XM Loader: Some XMs not made with ModPlug were recognized as files made with MPT.
- [Fix] <Jojo> XM Loader: The last XM instrument was not always loaded.
- [Fix] <Jojo> XM Loader: Early versions of Skale Tracker (R.I.P.) apparently wrote malformed XM sample headers, so OpenMPT failed to load such modules. Such files should be loaded correctly now (fixes IFULOVE.XM by yeep).
- [Fix] <Jojo> XM Compatibility: Volume column doesn't have an effect memory, most effects with param = 0 are useless. Those are ignored in compatibility mode playback and also when exporting the file in compatibility mode.
- [Fix] <Jojo> XM Compatibility: Improved handling of the situation when a 3xx effect was used, but previously no note was playing.
- [Fix] <Jojo> XM Compatibility: An instrument change next to a portamento event is now ignored (fixes partytime.xm by cancer)
-
-MOD
- [Imp] <Jojo> Module creation: When creating a new .MOD, it has 31 sample slots by default.
- [Imp] <Jojo> Playback: When the PT1x flag is activated, Amiga note range limits are automatically taken into account.
- [Fix] <Jojo> MOD Saving: Samples were shifted badly if the sample size was odd. (wow, this is an OLD bug!)
- [Fix] <Jojo> MOD Saving: If a sample had loop points set, but loop disabled, they were still saved in the .MOD file, resulting in the loop being enabled automatically.
- [Fix] <Jojo> MOD Loader: Very short loops (4-8 bytes long) are not ignored anymore. This fixes "Crew Generation" by Necros.
-
-S3M
- [Imp] <Jojo> S3M Loader: Display a message if an S3M file contains Adlib instruments (rare).
- [Fix] <Jojo> S3M Playback: In ST3, muted channels are completely ignored, not even effects are interpreted. Let's try this in MPT, too.
- [Fix] <Jojo> S3M Compatibility: Slightly better handling of vibrato/tremolo waveform types (although the ST3 help screen says that continuous vibrato/tremolo is possible, it does actually not work.)
- [Reg] <Jojo> Cannot create S3M files with more than 100 patterns anymore, because...
- [Fix] <Jojo> ... it was possible to create S3M files where the 256 parapointers were not enough, resulting in incomplete/broken files.
- [Fix] <Jojo> S3M Compatibility: Note Cut really cuts notes and does not just mute them (so that following volume commands could restore the sample)
-
-MPTM
- [New] <rewbs> Added combined note delay & note cut command for MPTM only (":xy" means delay until tick x and play for y ticks).
- [New] <Jojo> MPTM command S7D explicitly enforces pitch envelope, S7E enforces filter envelope.
- [Fix] <Jojo> MPTM Saving: A missing null pointer check crashed OpenMPT when trying to access a deleted instrument slot.
-
-Other formats
- [Imp] <Jojo> MT2 Loader (MadTracker): Make use of the "lines per beat" header field. 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 much because MT2 support was already 100% broken before this. :) Some MT example tunes sound a bit better now at least.
- [Fix] <Jojo> PTM Loader: Fixed an unhandled null pointer exception that occured when loading some unsupported RAR files.
- [Fix] <Jojo> PSM16 Loader: Fix for note cut on tick 0 (warbot tune from Silverball)
- [Fix] <Jojo> Threw out the old ULT loader in favor of Storlek's loader from SchismTracker (used with permission from the author himself). This is a lot more accurate than MPT's old loader.
- [Fix] <Jojo> DBM Loader: Various fixes to increase import precision and an endianness fix
- [Fix] <Jojo> AMF DSM Loader: Made some changes to the pattern reader, which eliminate the strange "vC7" commands in the pattern. I have found no hints on whether my fix is correct or not, apart from the fact that those AMF files that I have play a lot better now. And it makes kind of sense...
- [Fix] <Jojo> IMF Loader: Some fixes copied from Schism (copied from MikMod)
-
-Module cleanup
- [Imp] <Jojo> In the cleanup dialog, mutually exclusive items are now automatically unchecked, to avoid confusion.
- [Imp] <Jojo> Made the dialog look a bit nicer.
- [Fix] <Jojo> Because of an error in pattern count retrieval, the last pattern was not checked when looking for unused samples which sometimes resulted in deleted samples (although they were actually used).
- [Fix] <re> Fixed a memory leak in pattern name handling.
-
-Wave Export
- [New] <Jojo> It is now also possible to render by instrument (i.e. one wave file per instrument).
- [Imp] <Jojo> The "render by channel" mode ignores empty channels now.
- [Imp] <Jojo> When switching to another task and switching back to OpenMPT, it is now less likely that the infamous "OpenMPT does not respond" dialog from Windows occours.
-
-Misc
- [New] <Jojo> INI Settings: When portable mode is enabled, the most common paths in mptrack.ini are now translated to relative paths (if possible). Plugin paths are not translated to relative paths (yet).
- [New] <Jojo> Modules in gzip archives (single-file .gz archives) can now be imported, just to satisfy my laziness when downloading gzipped modules from Amiga Music Preservation. :-P
- [Imp] <Jojo> Mod Loaders: Instead of creating message boxes in various places, errors are now written to the log and one message box is shown for each file.
- [Imp] <Jojo> Binary files are now less often falsely recognized as early MOD files (15 samples without header): If the orderlist contains orderlist items > 128, loading is canceled.
- [Imp] <Jojo> Song Properties: Tool tips are shown for various controls.
- [Mod] <Jojo> Options: Removed the "space bar repeats previous action" option, as it did not work anymore since the new keyhandler is used; in fact, this option can be achieved instead by using the "on key hold" for the "quick paste" key shortcut.
- [Reg] <rewbs> Removed old "velocity" volume command, which was experimental and unused.
- [Mod] <Jojo> Replaced default VU-meter colours for the MPT scheme by more pleasant colours that were already used for the other themes.
- [Mod] <Jojo> Updated internet links (ModPlug Central Forums link is now a permalink)
- [Fix] <Jojo> Multi window edit: When (un)muting a channel from the general tab in window 1, it was instantly shown in the pattern editor of window 2, but not vice versa.
- [Fix] <Jojo> Channel Manager: When removing channels using the channel manager, their names were not cleared properly.
- [Fix] <Jojo> Song Length Detection: *Much* more accurate song length detection! Doesn't get tricked by pattern jumps anymore, hehe. :)
- [Fix] <Jojo/re> Instrument IO: Flags from old ITI/XI files should also be loaded correctly now (broken in 1.18.00.00)
- [Fix] <Jojo> When using the "close file" shortcut several times in a row so that multiple message boxes popped up, it was possible to crash OpenMPT.
- [Reg] <Jojo> Removed AutodetectITplaystyle option, since the tracker detection works reliably enough now. Tracker detection can not be ignored anymore now.
-
-Installer/release package
- [New] <Jojo> Ladies and gentlemen... we finally have an installer. :)
- [Mod] <Jojo> Added OpenMPT 1.18 release notes documents
- [Mod] <Jojo> Updated DE_jojo.mkb
- [Mod] <Jojo> Updated Paul Legovitch's keymap (now also suitable for desktop keyboards)
- [Mod] <re> Updated default keybindings.
-
-
-v1.18.00.00 (January 2010, revision 475) internal test build
-------------------------------------------------------------
-General tab
- [Fix] <Jojo> Channel name input field was not limited properly.
-
-Sequence editor
- [New] <re> Can now copy/cut/paste order selections.
- [Imp] <Jojo> Using the keyboard manager for shortcuts. 0...9, + and - keys are now also configurable.
- [Imp] <Jojo> Duplicate / Create new pattern shortcuts do also work here now.
- [Imp] <Jojo> Show cut/copy/paste orders in context menu.
- [Imp] <Jojo> Middle click can now also be used for queuing patterns.
- [Fix] <Jojo> Pasting orders now removes "+++" items if they are not supported by the current format.
- [Fix] <Jojo> Fixed display error when selecting multiple orders, inserting them and clicking on another order (only first order of previous selection was un-highlighted).
-
-Pattern tab::Pattern editing
- [New] <Jojo> New paste mode "push forward paste", which resembles the default paste behaviour of Impulse Tracker. Includes new shortcut.
- [New] <Jojo> New paste mode "paste flood" pastes the clipboard content again and again until it hits the bottom of the pattern (overflow paste will be disabled automatically if paste flood is used, for obvious reasons).
- [Imp] <Jojo> When using the MPTM format, plugin param changes are written to the pattern as PC Notes (instead of smooth midi macros).
- [Imp] <Jojo> Assume that the clipboard pattern format is IT (instead of MOD) if no information about the format is available.
- [Imp] <Jojo> Pattern c&p: convert pasted commands if necessary.
- [Mod] <re> Pattern c&p: Mix paste shouldn't anymore trigger conversion on modcommands that weren't changed at all. Now, however, partial conversion will not be done so this still needs further fixing.
- [Fix] <Jojo> Pattern c&p: invalid commands are not pasted anymore.
- [Imp] <Jojo> If "record note off" is enabled and Note Off commands are not supported by the current format, try Note Cut and volume commands.
- [Mod] <Jojo> It is impossible to enter something into the volume column in MOD format now.
- [Mod] <Jojo> When interpolating PC Notes, the plugin number and note type won't get overridden if the note type is already PC or PCs.
- [Fix] <re> Pattern c&p: Mix paste should behave better with parameter control notes.
- [Fix] <...
[truncated message content] |
|
From: <sag...@us...> - 2011-05-15 20:26:28
|
Revision: 873
http://modplug.svn.sourceforge.net/modplug/?rev=873&view=rev
Author: saga-games
Date: 2011-05-15 20:26:20 +0000 (Sun, 15 May 2011)
Log Message:
-----------
[Ref] Pattern names are now stored in CPattern.
[Fix] ITP Saver: Fixed nasty bug when the internal order length was not 256.
Modified Paths:
--------------
trunk/OpenMPT/mptrack/CleanupSong.cpp
trunk/OpenMPT/mptrack/Ctrl_pat.cpp
trunk/OpenMPT/mptrack/Ctrl_seq.cpp
trunk/OpenMPT/mptrack/MPTHacks.cpp
trunk/OpenMPT/mptrack/Modedit.cpp
trunk/OpenMPT/mptrack/PatternEditorDialogs.cpp
trunk/OpenMPT/mptrack/View_tre.cpp
trunk/OpenMPT/soundlib/Load_ams.cpp
trunk/OpenMPT/soundlib/Load_it.cpp
trunk/OpenMPT/soundlib/Load_itp.cpp
trunk/OpenMPT/soundlib/Load_med.cpp
trunk/OpenMPT/soundlib/Load_mid.cpp
trunk/OpenMPT/soundlib/Load_psm.cpp
trunk/OpenMPT/soundlib/Load_xm.cpp
trunk/OpenMPT/soundlib/Sndfile.cpp
trunk/OpenMPT/soundlib/Sndfile.h
trunk/OpenMPT/soundlib/pattern.cpp
trunk/OpenMPT/soundlib/pattern.h
trunk/OpenMPT/soundlib/patternContainer.cpp
trunk/OpenMPT/soundlib/patternContainer.h
Modified: trunk/OpenMPT/mptrack/CleanupSong.cpp
===================================================================
--- trunk/OpenMPT/mptrack/CleanupSong.cpp 2011-05-13 16:02:13 UTC (rev 872)
+++ trunk/OpenMPT/mptrack/CleanupSong.cpp 2011-05-15 20:26:20 UTC (rev 873)
@@ -340,6 +340,20 @@
///////////////////////////////////////////////////////////////////////
// Actual cleanup implementations
+struct OrigPatSettings
+{
+ bool isPatUsed; // Is pattern used in sequence?
+ PATTERNINDEX newIndex; // map old pattern index <-> new pattern index
+ // This stuff is needed for copying the old pattern properties to the new pattern number
+ MODCOMMAND *data; // original pattern data
+ ROWINDEX numRows; // original pattern sizes
+ ROWINDEX rowsPerBeat; // original pattern highlight
+ ROWINDEX rowsPerMeasure; // original pattern highlight
+ CString name; // original pattern name
+};
+
+const OrigPatSettings defaultSettings = {false, 0, nullptr, 0, 0, 0, ""};
+
// Remove unused patterns / rearrange patterns
// If argument bRemove is true, unused patterns are removed. Else, patterns are only rearranged.
bool CModCleanupDlg::RemoveUnusedPatterns(bool bRemove)
@@ -350,13 +364,7 @@
const SEQUENCEINDEX maxSeqIndex = pSndFile->Order.GetNumSequences();
const PATTERNINDEX maxPatIndex = pSndFile->Patterns.Size();
- vector<bool> bPatUsed(maxPatIndex, false); // used patterns
- vector<PATTERNINDEX> nPatMap(maxPatIndex, 0); // map old pattern index <-> new pattern index
- // Those vectors are needed for copying the old pattern properties to the new pattern number
- vector<MODCOMMAND*> pPatterns(maxPatIndex, nullptr); // original pattern data
- vector<ROWINDEX> nPatRows(maxPatIndex, 0); // original pattern sizes
- vector<ROWINDEX> nPatRowsPerBeat(maxPatIndex, 0); // original pattern highlight
- vector<ROWINDEX> nPatRowsPerMeasure(maxPatIndex, 0); // original pattern highlight
+ vector<OrigPatSettings> patternSettings(maxPatIndex, defaultSettings);
CHAR s[512];
bool bReordered = false;
@@ -374,7 +382,7 @@
if (n < maxPatIndex)
{
if (n >= maxpat) maxpat = n + 1;
- bPatUsed[n] = true;
+ patternSettings[n].isPatUsed = true;
}
}
}
@@ -386,7 +394,7 @@
while (imax > 0)
{
imax--;
- if ((pSndFile->Patterns[imax]) && (bPatUsed[imax])) break;
+ if ((pSndFile->Patterns[imax]) && (patternSettings[imax].isPatUsed)) break;
}
nMinToRemove = imax + 1;
}
@@ -407,7 +415,7 @@
size_t nWaste = 0;
for (UINT ichk=0; ichk < maxPatIndex; ichk++)
{
- if ((pSndFile->Patterns[ichk]) && (!bPatUsed[ichk])) nWaste++;
+ if ((pSndFile->Patterns[ichk]) && (!patternSettings[ichk].isPatUsed)) nWaste++;
}
if ((bRemove) && (nWaste))
@@ -419,7 +427,7 @@
}
for(PATTERNINDEX i = 0; i < maxPatIndex; i++)
- nPatMap[i] = PATTERNINDEX_INVALID;
+ patternSettings[i].newIndex = PATTERNINDEX_INVALID;
SEQUENCEINDEX oldSequence = pSndFile->Order.GetCurrentSequenceIndex(); // workaround, as GetSequence doesn't allow writing to sequences ATM
@@ -434,8 +442,8 @@
PATTERNINDEX n = pSndFile->Order.GetSequence(nSeq)[imap];
if (n < maxPatIndex)
{
- if (nPatMap[n] == PATTERNINDEX_INVALID) nPatMap[n] = nPats++;
- pSndFile->Order[imap] = nPatMap[n];
+ if (patternSettings[n].newIndex == PATTERNINDEX_INVALID) patternSettings[n].newIndex = nPats++;
+ pSndFile->Order[imap] = patternSettings[n].newIndex;
}
}
// Add unused patterns at the end
@@ -443,9 +451,9 @@
{
for(PATTERNINDEX iadd = 0; iadd < maxPatIndex; iadd++)
{
- if((pSndFile->Patterns[iadd]) && (nPatMap[iadd] >= maxPatIndex))
+ if((pSndFile->Patterns[iadd]) && (patternSettings[iadd].newIndex >= maxPatIndex))
{
- nPatMap[iadd] = nPats++;
+ patternSettings[iadd].newIndex = nPats++;
}
}
}
@@ -460,35 +468,20 @@
// Reorder patterns & Delete unused patterns
BEGIN_CRITICAL();
{
- const UINT npatnames = pSndFile->m_nPatternNames;
- const LPSTR lpszpatnames = pSndFile->m_lpszPatternNames;
- pSndFile->m_nPatternNames = 0;
- pSndFile->m_lpszPatternNames = nullptr;
for (PATTERNINDEX i = 0; i < maxPatIndex; i++)
{
- PATTERNINDEX k = nPatMap[i];
+ PATTERNINDEX k = patternSettings[i].newIndex;
if (k < maxPatIndex)
{
if (i != k) bReordered = true;
- // Remap pattern names
- if (i < npatnames)
- {
- UINT noldpatnames = pSndFile->m_nPatternNames;
- LPSTR lpszoldpatnames = pSndFile->m_lpszPatternNames;
- pSndFile->m_nPatternNames = npatnames;
- pSndFile->m_lpszPatternNames = lpszpatnames;
- pSndFile->GetPatternName(i, s);
- pSndFile->m_nPatternNames = noldpatnames;
- pSndFile->m_lpszPatternNames = lpszoldpatnames;
- if (s[0]) pSndFile->SetPatternName(k, s);
- }
- nPatRows[k] = pSndFile->Patterns[i].GetNumRows();
- pPatterns[k] = pSndFile->Patterns[i];
+ patternSettings[k].numRows = pSndFile->Patterns[i].GetNumRows();
+ patternSettings[k].data = pSndFile->Patterns[i];
if(pSndFile->Patterns[i].GetOverrideSignature())
{
- nPatRowsPerBeat[k] = pSndFile->Patterns[i].GetRowsPerBeat();
- nPatRowsPerMeasure[k] = pSndFile->Patterns[i].GetRowsPerMeasure();
+ patternSettings[k].rowsPerBeat = pSndFile->Patterns[i].GetRowsPerBeat();
+ patternSettings[k].rowsPerMeasure = pSndFile->Patterns[i].GetRowsPerMeasure();
}
+ patternSettings[k].name = pSndFile->Patterns[i].GetName();
} else
if (pSndFile->Patterns[i])
{
@@ -498,11 +491,10 @@
}
for (PATTERNINDEX nPat = 0; nPat < maxPatIndex; nPat++)
{
- pSndFile->Patterns[nPat].SetData(pPatterns[nPat], nPatRows[nPat]);
- pSndFile->Patterns[nPat].SetSignature(nPatRowsPerBeat[nPat], nPatRowsPerMeasure[nPat]);
+ pSndFile->Patterns[nPat].SetData(patternSettings[nPat].data, patternSettings[nPat].numRows);
+ pSndFile->Patterns[nPat].SetSignature(patternSettings[nPat].rowsPerBeat, patternSettings[nPat].rowsPerMeasure);
+ pSndFile->Patterns[nPat].SetName(patternSettings[nPat].name);
}
-
- delete[] lpszpatnames;
}
END_CRITICAL();
EndWaitCursor();
Modified: trunk/OpenMPT/mptrack/Ctrl_pat.cpp
===================================================================
--- trunk/OpenMPT/mptrack/Ctrl_pat.cpp 2011-05-13 16:02:13 UTC (rev 872)
+++ trunk/OpenMPT/mptrack/Ctrl_pat.cpp 2011-05-15 20:26:20 UTC (rev 873)
@@ -149,7 +149,7 @@
m_EditSequence.SetParent(this);
m_EditSpacing.SetParent(this);
m_EditPatName.SetParent(this);
- m_EditPatName.SetLimitText(MAX_PATTERNNAME);
+ m_EditPatName.SetLimitText(MAX_PATTERNNAME - 1);
m_EditOrderListMargins.SetParent(this);
m_EditOrderListMargins.SetLimitText(3);
// Spin controls
@@ -328,7 +328,7 @@
nPat = (PATTERNINDEX)(dwHintMask >> HINT_SHIFT_PAT);
else
nPat = (PATTERNINDEX)SendViewMessage(VIEWMSG_GETCURRENTPATTERN);
- m_pSndFile->GetPatternName(nPat, s, sizeof(s));
+ m_pSndFile->Patterns[nPat].GetName(s, CountOf(s));
m_EditPatName.SetWindowText(s);
BOOL bXMIT = (m_pSndFile->m_nType & (MOD_TYPE_XM|MOD_TYPE_IT|MOD_TYPE_MPT)) ? TRUE : FALSE;
m_ToolBar.EnableButton(ID_PATTERN_MIDIMACRO, bXMIT);
@@ -1071,13 +1071,15 @@
PATTERNINDEX nPat = (PATTERNINDEX)SendViewMessage(VIEWMSG_GETCURRENTPATTERN);
m_EditPatName.GetWindowText(s, MAX_PATTERNNAME);
- s[MAX_PATTERNNAME-1] = 0;
- m_pSndFile->GetPatternName(nPat, sold, sizeof(sold));
+ s[MAX_PATTERNNAME - 1] = 0;
+ m_pSndFile->Patterns[nPat].GetName(sold, CountOf(sold));
if (strcmp(s, sold))
{
- m_pSndFile->SetPatternName(nPat, s);
- if (m_pSndFile->m_nType & (MOD_TYPE_XM|MOD_TYPE_IT|MOD_TYPE_MPT)) m_pModDoc->SetModified();
- m_pModDoc->UpdateAllViews(NULL, (nPat << HINT_SHIFT_PAT) | HINT_PATNAMES, this);
+ if(m_pSndFile->Patterns[nPat].SetName(s))
+ {
+ if (m_pSndFile->m_nType & (MOD_TYPE_XM|MOD_TYPE_IT|MOD_TYPE_MPT)) m_pModDoc->SetModified();
+ m_pModDoc->UpdateAllViews(NULL, (nPat << HINT_SHIFT_PAT) | HINT_PATNAMES, this);
+ }
}
}
}
Modified: trunk/OpenMPT/mptrack/Ctrl_seq.cpp
===================================================================
--- trunk/OpenMPT/mptrack/Ctrl_seq.cpp 2011-05-13 16:02:13 UTC (rev 872)
+++ trunk/OpenMPT/mptrack/Ctrl_seq.cpp 2011-05-15 20:26:20 UTC (rev 873)
@@ -493,6 +493,7 @@
if (nCurNdx >= pSndFile->Patterns.Size()) nCurNdx = 0;
nCurNdx = nCurNdx * 10 + static_cast<PATTERNINDEX>(enterNum);
+ STATIC_ASSERT(MAX_PATTERNS < 10000);
if ((nCurNdx >= 1000) && (nCurNdx > nMaxNdx)) nCurNdx %= 1000;
if ((nCurNdx >= 100) && (nCurNdx > nMaxNdx)) nCurNdx %= 100;
if ((nCurNdx >= 10) && (nCurNdx > nMaxNdx)) nCurNdx %= 10;
@@ -732,10 +733,10 @@
if (m_nScrollPos < pSndFile->Order.GetLength())
{
PATTERNINDEX nPat = pSndFile->Order[m_nScrollPos];
- if ((nPat < pSndFile->Patterns.Size()) && (nPat < pSndFile->m_nPatternNames))
+ if (nPat < pSndFile->Patterns.Size())
{
- CHAR szpat[40] = "";
- if (pSndFile->GetPatternName(nPat, szpat))
+ CHAR szpat[MAX_PATTERNNAME] = "";
+ if (pSndFile->Patterns[nPat].GetName(szpat, MAX_PATTERNNAME) && strlen(szpat))
{
wsprintf(s+strlen(s), ": %s", szpat);
}
Modified: trunk/OpenMPT/mptrack/MPTHacks.cpp
===================================================================
--- trunk/OpenMPT/mptrack/MPTHacks.cpp 2011-05-13 16:02:13 UTC (rev 872)
+++ trunk/OpenMPT/mptrack/MPTHacks.cpp 2011-05-15 20:26:20 UTC (rev 873)
@@ -163,26 +163,18 @@
}
// Check for pattern names
- foundHere = false;
- for(PATTERNINDEX i = 0; i < m_SndFile.GetNumPatterns(); i++)
+ if(m_SndFile.Patterns.GetNumNamedPatterns() > 0)
{
- if(m_SndFile.Patterns.IsValidPat(i))
+ AddToLog("Found pattern names\n");
+ foundHacks = true;
+ if(autofix)
{
- TCHAR tempname[MAX_PATTERNNAME];
- MemsetZero(tempname);
- m_SndFile.GetPatternName(i, tempname, sizeof(tempname));
- if(strcmp(tempname, "") != 0)
+ for(PATTERNINDEX i = 0; i < m_SndFile.GetNumPatterns(); i++)
{
- foundHere = foundHacks = true;
- if(autofix)
- m_SndFile.SetPatternName(i, "");
- else
- break;
+ m_SndFile.Patterns[i].SetName("");
}
}
}
- if(foundHere)
- AddToLog("Found pattern names\n");
// Check for too many channels
if(m_SndFile.GetNumChannels() > originalSpecs->channelsMax || m_SndFile.GetNumChannels() < originalSpecs->channelsMin)
Modified: trunk/OpenMPT/mptrack/Modedit.cpp
===================================================================
--- trunk/OpenMPT/mptrack/Modedit.cpp 2011-05-13 16:02:13 UTC (rev 872)
+++ trunk/OpenMPT/mptrack/Modedit.cpp 2011-05-15 20:26:20 UTC (rev 873)
@@ -628,7 +628,6 @@
if ((nPat < m_SndFile.Patterns.Size()) && (m_SndFile.Patterns[nPat]))
{
BEGIN_CRITICAL();
- m_SndFile.SetPatternName(nPat, "");
m_SndFile.Patterns.Remove(nPat);
END_CRITICAL();
SetModified();
Modified: trunk/OpenMPT/mptrack/PatternEditorDialogs.cpp
===================================================================
--- trunk/OpenMPT/mptrack/PatternEditorDialogs.cpp 2011-05-13 16:02:13 UTC (rev 872)
+++ trunk/OpenMPT/mptrack/PatternEditorDialogs.cpp 2011-05-15 20:26:20 UTC (rev 873)
@@ -427,8 +427,8 @@
SetDlgItemText(IDC_TEXT1, s);
// Window title
- CHAR szName[MAX_PATTERNNAME + 2];
- pSndFile->GetPatternName(m_nPattern, szName, MAX_PATTERNNAME);
+ CHAR szName[MAX_PATTERNNAME + 1];
+ pSndFile->Patterns[m_nPattern].GetName(szName, MAX_PATTERNNAME);
if(strlen(szName))
{
strcat(szName, ")");
Modified: trunk/OpenMPT/mptrack/View_tre.cpp
===================================================================
--- trunk/OpenMPT/mptrack/View_tre.cpp 2011-05-13 16:02:13 UTC (rev 872)
+++ trunk/OpenMPT/mptrack/View_tre.cpp 2011-05-15 20:26:20 UTC (rev 873)
@@ -805,7 +805,7 @@
if (pSndFile->Order.GetSequence(nSeq)[iOrd] < pSndFile->Patterns.Size())
{
stmp[0] = 0;
- pSndFile->GetPatternName(pSndFile->Order.GetSequence(nSeq)[iOrd], stmp, sizeof(stmp));
+ pSndFile->Patterns[pSndFile->Order.GetSequence(nSeq)[iOrd]].GetName(stmp, CountOf(stmp));
if (stmp[0])
{
wsprintf(s, (CMainFrame::m_dwPatternSetup & PATTERN_HEXDISPLAY) ? "[%02Xh] %d: %s" : "[%02d] %d: %s",
@@ -866,7 +866,7 @@
if (pSndFile->Patterns[iPat])
{
stmp[0] = 0;
- pSndFile->GetPatternName(iPat, stmp, sizeof(stmp));
+ pSndFile->Patterns[iPat].GetName(stmp, CountOf(stmp));
if (stmp[0])
{
wsprintf(s, "%d: %s", iPat, stmp);
Modified: trunk/OpenMPT/soundlib/Load_ams.cpp
===================================================================
--- trunk/OpenMPT/soundlib/Load_ams.cpp 2011-05-13 16:02:13 UTC (rev 872)
+++ trunk/OpenMPT/soundlib/Load_ams.cpp 2011-05-15 20:26:20 UTC (rev 873)
@@ -146,19 +146,20 @@
}
// Read Pattern Names
- m_lpszPatternNames = new char[pfh->patterns * 32];
- if (!m_lpszPatternNames) return true;
- m_nPatternNames = pfh->patterns;
- memset(m_lpszPatternNames, 0, m_nPatternNames * 32);
- for (UINT pNam=0; pNam < m_nPatternNames; pNam++)
+ for (UINT pNam = 0; pNam < pfh->patterns; pNam++)
{
- if (dwMemPos + 32 >= dwMemLength) return true;
+ if (dwMemPos + 1 >= dwMemLength) return true;
tmp = lpStream[dwMemPos++];
- tmp2 = (tmp < 32) ? tmp : 31;
- if (tmp2) memcpy(m_lpszPatternNames+pNam*32, lpStream+dwMemPos, tmp2);
+ tmp2 = min(tmp, MAX_PATTERNNAME - 1); // not counting null char
+ if (dwMemPos + tmp >= dwMemLength) return true;
+ Patterns.Insert(pNam, 64); // Create pattern now, so that the name won't be overwritten later.
+ if(tmp2)
+ {
+ Patterns[pNam].SetName((char *)(lpStream + dwMemPos), tmp2 + 1);
+ }
dwMemPos += tmp;
}
-
+
// Read Song Comments
tmp = *((WORD *)(lpStream+dwMemPos));
dwMemPos += 2;
@@ -183,7 +184,7 @@
UINT len = *((DWORD *)(lpStream + dwMemPos));
dwMemPos += 4;
if ((len >= dwMemLength) || (dwMemPos + len > dwMemLength)) return true;
- Patterns.Insert(iPat, 64);
+ // Pattern has been inserted when reading pattern names
MODCOMMAND* m = Patterns[iPat];
if (!m) return true;
const BYTE *p = lpStream + dwMemPos;
Modified: trunk/OpenMPT/soundlib/Load_it.cpp
===================================================================
--- trunk/OpenMPT/soundlib/Load_it.cpp 2011-05-13 16:02:13 UTC (rev 872)
+++ trunk/OpenMPT/soundlib/Load_it.cpp 2011-05-15 20:26:20 UTC (rev 873)
@@ -465,6 +465,18 @@
}
+void CopyPatternName(CPattern &pattern, char **patNames, UINT &patNamesLen)
+//-------------------------------------------------------------------------
+{
+ if(*patNames != nullptr && patNamesLen > 0)
+ {
+ pattern.SetName(*patNames, min(MAX_PATTERNNAME, patNamesLen));
+ *patNames += MAX_PATTERNNAME;
+ patNamesLen -= min(MAX_PATTERNNAME, patNamesLen);
+ }
+}
+
+
bool CSoundFile::ReadIT(const LPCBYTE lpStream, const DWORD dwMemLength)
//----------------------------------------------------------------------
{
@@ -809,19 +821,16 @@
}
// Read pattern names: "PNAM"
+ char *patNames = nullptr;
+ UINT patNamesLen = 0;
if ((dwMemPos + 8 < dwMemLength) && (*((DWORD *)(lpStream+dwMemPos)) == 0x4d414e50))
{
- UINT len = *((DWORD *)(lpStream+dwMemPos+4));
+ patNamesLen = *((DWORD *)(lpStream + dwMemPos + 4));
dwMemPos += 8;
- if ((dwMemPos + len <= dwMemLength) && (len <= patpos.size()*MAX_PATTERNNAME) && (len >= MAX_PATTERNNAME))
+ if ((dwMemPos + patNamesLen <= dwMemLength) && (patNamesLen > 0))
{
- m_lpszPatternNames = new char[len];
- if (m_lpszPatternNames)
- {
- m_nPatternNames = len / MAX_PATTERNNAME;
- memcpy(m_lpszPatternNames, lpStream+dwMemPos, len);
- }
- dwMemPos += len;
+ patNames = (char *)(lpStream + dwMemPos);
+ dwMemPos += patNamesLen;
}
}
@@ -923,6 +932,8 @@
if (i >= len) break;
}
}
+
+
// Reading Instruments
m_nInstruments = 0;
if (pifh->flags & 0x04) m_nInstruments = pifh->insnum;
@@ -1061,6 +1072,8 @@
#endif // MODPLUG_TRACKER
break;
}
+ // Now (after the Insert() call), we can read the pattern name.
+ CopyPatternName(Patterns[npat], &patNames, patNamesLen);
continue;
}
UINT len = *((WORD *)(lpStream+patpos[npat]));
@@ -1070,6 +1083,9 @@
if(Patterns.Insert(npat, rows)) continue;
+ // Now (after the Insert() call), we can read the pattern name.
+ CopyPatternName(Patterns[npat], &patNames, patNamesLen);
+
memset(lastvalue, 0, sizeof(lastvalue));
memset(chnmask, 0, sizeof(chnmask));
MODCOMMAND *m = Patterns[npat];
@@ -1469,12 +1485,10 @@
dwExtra += sizeof(MODMIDICFG);
}
// Pattern Names
- if ((m_nPatternNames) && (m_lpszPatternNames))
+ const PATTERNINDEX numNamedPats = Patterns.GetNumNamedPatterns();
+ if (numNamedPats > 0)
{
- dwPatNamLen = m_nPatternNames * MAX_PATTERNNAME;
- while ((dwPatNamLen >= MAX_PATTERNNAME) && (!m_lpszPatternNames[dwPatNamLen-MAX_PATTERNNAME])) dwPatNamLen -= MAX_PATTERNNAME;
- if (dwPatNamLen < MAX_PATTERNNAME) dwPatNamLen = 0;
- if (dwPatNamLen) dwExtra += dwPatNamLen + 8;
+ dwExtra += (numNamedPats * MAX_PATTERNNAME) + 8;
}
// Mix Plugins
dwExtra += SaveMixPlugins(NULL, TRUE);
@@ -1500,14 +1514,22 @@
fwrite(&m_MidiCfg, 1, sizeof(MODMIDICFG), f);
}
// Writing pattern names
- if (dwPatNamLen)
+ if (numNamedPats)
{
DWORD d = 0x4d414e50;
fwrite(&d, 1, 4, f);
- fwrite(&dwPatNamLen, 1, 4, f);
- fwrite(m_lpszPatternNames, 1, dwPatNamLen, f);
+ d = numNamedPats * MAX_PATTERNNAME;
+ fwrite(&d, 1, 4, f);
+
+ for(PATTERNINDEX nPat = 0; nPat < numNamedPats; nPat++)
+ {
+ char name[MAX_PATTERNNAME];
+ MemsetZero(name);
+ Patterns[nPat].GetName(name, MAX_PATTERNNAME);
+ fwrite(name, 1, MAX_PATTERNNAME, f);
+ }
}
- // Writing channel Names
+ // Writing channel names
if (dwChnNamLen)
{
DWORD d = 0x4d414e43;
Modified: trunk/OpenMPT/soundlib/Load_itp.cpp
===================================================================
--- trunk/OpenMPT/soundlib/Load_itp.cpp 2011-05-13 16:02:13 UTC (rev 872)
+++ trunk/OpenMPT/soundlib/Load_itp.cpp 2011-05-15 20:26:20 UTC (rev 873)
@@ -230,25 +230,19 @@
// m_nPatternNames
memcpy(&id,lpStream+dwMemPos,sizeof(DWORD));
- m_nPatternNames = id;
+ const PATTERNINDEX numNamedPats = id;
dwMemPos += sizeof(DWORD);
// pattern name string length (=MAX_PATTERNNAME)
memcpy(&id,lpStream+dwMemPos,sizeof(DWORD));
- len = id;
+ const DWORD patNameLen = id;
dwMemPos += sizeof(DWORD);
// m_lpszPatternNames
- if (len<=MAX_PATTERNNAME && m_nPatternNames<=MAX_PATTERNS)
- {
- m_lpszPatternNames = new char[m_nPatternNames * len];
- ASSERT_CAN_READ(m_nPatternNames * len);
- memcpy(&m_lpszPatternNames[0],lpStream+dwMemPos,m_nPatternNames * len);
- }
- else return false;
+ ASSERT_CAN_READ(numNamedPats * patNameLen);
+ char *patNames = (char *)(lpStream + dwMemPos);
+ dwMemPos += numNamedPats * patNameLen;
- dwMemPos += m_nPatternNames * len;
-
// modcommand data length
ASSERT_CAN_READ(4);
memcpy(&id,lpStream+dwMemPos,sizeof(DWORD));
@@ -275,6 +269,11 @@
dwMemPos += m_nChannels * Patterns[npat].GetNumRows() * n;
continue;
}
+ if(npat < numNamedPats && patNameLen > 0)
+ {
+ Patterns[npat].SetName(patNames, patNameLen);
+ patNames += patNameLen;
+ }
// Pattern data
long datasize = m_nChannels * Patterns[npat].GetNumRows() * n;
@@ -583,7 +582,7 @@
fwrite(&id, 1, sizeof(id), f);
// order array
- Order.WriteAsByte(f, MAX_ORDERS);
+ Order.WriteAsByte(f, id);
// Song Patterns
@@ -592,13 +591,22 @@
fwrite(&id, 1, sizeof(id), f);
// number of pattern name strings
- id = m_nPatternNames;
+ PATTERNINDEX numNamedPats = Patterns.GetNumNamedPatterns();
+ numNamedPats = min(numNamedPats, MAX_PATTERNS);
+ id = numNamedPats;
fwrite(&id, 1, sizeof(id), f);
// length of a pattern name string
id = MAX_PATTERNNAME;
fwrite(&id, 1, sizeof(id), f);
- fwrite(&m_lpszPatternNames[0], 1, m_nPatternNames * MAX_PATTERNNAME, f);
+ // pattern name string
+ for(PATTERNINDEX nPat = 0; nPat < numNamedPats; nPat++)
+ {
+ char name[MAX_PATTERNNAME];
+ MemsetZero(name);
+ Patterns[nPat].GetName(name, MAX_PATTERNNAME);
+ fwrite(name, 1, MAX_PATTERNNAME, f);
+ }
// modcommand data length
id = sizeof(MODCOMMAND_ORIGINAL);
Modified: trunk/OpenMPT/soundlib/Load_med.cpp
===================================================================
--- trunk/OpenMPT/soundlib/Load_med.cpp 2011-05-13 16:02:13 UTC (rev 872)
+++ trunk/OpenMPT/soundlib/Load_med.cpp 2011-05-15 20:26:20 UTC (rev 873)
@@ -867,7 +867,7 @@
UINT namelen = BigEndian(pbi->blocknamelen);
if ((nameofs < dwMemLength) && (namelen < dwMemLength - nameofs))
{
- SetPatternName(iBlk, (LPCSTR)(lpStream+nameofs));
+ Patterns[iBlk].SetName((char *)(lpStream + nameofs), namelen);
}
}
if (pbi->cmdexttable)
Modified: trunk/OpenMPT/soundlib/Load_mid.cpp
===================================================================
--- trunk/OpenMPT/soundlib/Load_mid.cpp 2011-05-13 16:02:13 UTC (rev 872)
+++ trunk/OpenMPT/soundlib/Load_mid.cpp 2011-05-15 20:26:20 UTC (rev 873)
@@ -760,7 +760,7 @@
} else
if (!trk)
{
- SetPatternName(pat, s);
+ Patterns[pat].SetName(s);
}
#ifdef MIDI_LOG
Log("Track #%d, META 0x%02X, Pattern %d: ", trk, i, pat);
Modified: trunk/OpenMPT/soundlib/Load_psm.cpp
===================================================================
--- trunk/OpenMPT/soundlib/Load_psm.cpp 2011-05-13 16:02:13 UTC (rev 872)
+++ trunk/OpenMPT/soundlib/Load_psm.cpp 2011-05-15 20:26:20 UTC (rev 873)
@@ -766,7 +766,7 @@
// set the subsong name to all pattern names
for(PATTERNINDEX nPat = startPattern; nPat <= endPattern; nPat++)
{
- SetPatternName(nPat, subsongs[i].songName);
+ Patterns[nPat].SetName(subsongs[i].songName);
}
// subsongs with different panning setup -> write to pattern (MUSIC_C.PSM)
Modified: trunk/OpenMPT/soundlib/Load_xm.cpp
===================================================================
--- trunk/OpenMPT/soundlib/Load_xm.cpp 2011-05-13 16:02:13 UTC (rev 872)
+++ trunk/OpenMPT/soundlib/Load_xm.cpp 2011-05-15 20:26:20 UTC (rev 873)
@@ -625,15 +625,15 @@
// Read pattern names: "PNAM"
if ((dwMemPos + 8 < dwMemLength) && (LittleEndian(*((DWORD *)(lpStream+dwMemPos))) == 0x4d414e50))
{
- UINT len = *((DWORD *)(lpStream+dwMemPos+4));
+ UINT len = *((DWORD *)(lpStream + dwMemPos + 4));
dwMemPos += 8;
- if ((dwMemPos + len <= dwMemLength) && (len <= MAX_PATTERNS*MAX_PATTERNNAME) && (len >= MAX_PATTERNNAME))
+ if ((dwMemPos + len <= dwMemLength) && (len <= MAX_PATTERNS * MAX_PATTERNNAME) && (len >= MAX_PATTERNNAME))
{
- m_lpszPatternNames = new char[len];
- if (m_lpszPatternNames)
+ DWORD pos = 0;
+ PATTERNINDEX nPat = 0;
+ for(pos = 0; pos < len; pos += MAX_PATTERNNAME, nPat++)
{
- m_nPatternNames = len / MAX_PATTERNNAME;
- memcpy(m_lpszPatternNames, lpStream+dwMemPos, len);
+ Patterns[nPat].SetName((char *)(lpStream + dwMemPos + pos), min(MAX_PATTERNNAME, len - pos));
}
dwMemPos += len;
}
@@ -1100,16 +1100,20 @@
fwrite(&m_MidiCfg, 1, sizeof(MODMIDICFG), f);
}
// Writing Pattern Names
- if ((m_nPatternNames) && (m_lpszPatternNames))
+ const PATTERNINDEX numNamedPats = Patterns.GetNumNamedPatterns();
+ if (numNamedPats > 0)
{
- DWORD dwLen = m_nPatternNames * MAX_PATTERNNAME;
- while ((dwLen >= MAX_PATTERNNAME) && (!m_lpszPatternNames[dwLen-MAX_PATTERNNAME])) dwLen -= MAX_PATTERNNAME;
- if (dwLen >= MAX_PATTERNNAME)
+ DWORD dwLen = numNamedPats * MAX_PATTERNNAME;
+ DWORD d = 0x4d414e50;
+ fwrite(&d, 1, 4, f);
+ fwrite(&dwLen, 1, 4, f);
+
+ for(PATTERNINDEX nPat = 0; nPat < numNamedPats; nPat++)
{
- DWORD d = 0x4d414e50;
- fwrite(&d, 1, 4, f);
- fwrite(&dwLen, 1, 4, f);
- fwrite(m_lpszPatternNames, 1, dwLen, f);
+ char name[MAX_PATTERNNAME];
+ MemsetZero(name);
+ Patterns[nPat].GetName(name, MAX_PATTERNNAME);
+ fwrite(name, 1, MAX_PATTERNNAME, f);
}
}
// Writing Channel Names
Modified: trunk/OpenMPT/soundlib/Sndfile.cpp
===================================================================
--- trunk/OpenMPT/soundlib/Sndfile.cpp 2011-05-13 16:02:13 UTC (rev 872)
+++ trunk/OpenMPT/soundlib/Sndfile.cpp 2011-05-15 20:26:20 UTC (rev 873)
@@ -455,8 +455,6 @@
m_nMixChannels = 0;
m_nSamples = 0;
m_nInstruments = 0;
- m_nPatternNames = 0;
- m_lpszPatternNames = NULL;
m_lpszSongComments = nullptr;
m_nFreqFactor = m_nTempoFactor = 128;
m_nMasterVolume = 128;
@@ -547,9 +545,7 @@
m_nMaxPeriod = 32767;
m_nSamplePreAmp = 48;
m_nVSTiVolume = 48;
- m_nPatternNames = 0;
m_nMaxOrderPosition = 0;
- m_lpszPatternNames = NULL;
m_lpszSongComments = nullptr;
m_nMixLevels = mixLevels_compatible; // Will be overridden if appropriate.
memset(Samples, 0, sizeof(Samples));
@@ -853,11 +849,7 @@
{
size_t i;
Patterns.DestroyPatterns();
- m_nPatternNames = 0;
- delete[] m_lpszPatternNames;
- m_lpszPatternNames = NULL;
-
FreeMessage();
for (i=1; i<MAX_SAMPLES; i++)
@@ -2477,51 +2469,6 @@
}
-BOOL CSoundFile::SetPatternName(PATTERNINDEX nPat, LPCSTR lpszName)
-//------------------------------------------------------------------
-{
- CHAR szName[MAX_PATTERNNAME] = "";
- if (nPat >= Patterns.Size()) return FALSE;
- if (lpszName) lstrcpyn(szName, lpszName, MAX_PATTERNNAME);
- SpaceToNullString(szName); //szName[MAX_PATTERNNAME-1] = 0;
- if (!m_lpszPatternNames) m_nPatternNames = 0;
- if (nPat >= m_nPatternNames)
- {
- //if (!lpszName[0]) return TRUE;
- UINT len = (nPat+1)*MAX_PATTERNNAME;
- CHAR *p = new CHAR[len];
- if (!p) return FALSE;
- memset(p, 0, len);
- if (m_lpszPatternNames)
- {
- memcpy(p, m_lpszPatternNames, m_nPatternNames * MAX_PATTERNNAME);
- delete[] m_lpszPatternNames;
- m_lpszPatternNames = NULL;
- }
- m_lpszPatternNames = p;
- m_nPatternNames = nPat + 1;
- }
- memcpy(m_lpszPatternNames + nPat * MAX_PATTERNNAME, szName, MAX_PATTERNNAME);
- return TRUE;
-}
-
-
-BOOL CSoundFile::GetPatternName(PATTERNINDEX nPat, LPSTR lpszName, UINT cbSize) const
-//-----------------------------------------------------------------------------------
-{
- if ((!lpszName) || (!cbSize)) return FALSE;
- lpszName[0] = 0;
- if (cbSize > MAX_PATTERNNAME) cbSize = MAX_PATTERNNAME;
- if ((m_lpszPatternNames) && (nPat < m_nPatternNames))
- {
- memcpy(lpszName, m_lpszPatternNames + nPat * MAX_PATTERNNAME, cbSize);
- lpszName[cbSize-1] = 0;
- return TRUE;
- }
- return FALSE;
-}
-
-
#ifndef FASTSOUNDLIB
// Check whether a sample is used.
@@ -2572,7 +2519,7 @@
}
-// Detect samples are are referenced by an instrument, but actually not used in a song.
+// Detect samples that are referenced by an instrument, but actually not used in a song.
// Only works in instrument mode. Unused samples are marked as false in the vector.
SAMPLEINDEX CSoundFile::DetectUnusedSamples(vector<bool> &sampleUsed) const
//-------------------------------------------------------------------------
@@ -2737,8 +2684,8 @@
void CSoundFile::DeleteStaticdata()
//---------------------------------
{
- delete s_pTuningsSharedLocal; s_pTuningsSharedLocal = 0;
- delete s_pTuningsSharedBuiltIn; s_pTuningsSharedBuiltIn = 0;
+ delete s_pTuningsSharedLocal; s_pTuningsSharedLocal = nullptr;
+ delete s_pTuningsSharedBuiltIn; s_pTuningsSharedBuiltIn = nullptr;
}
bool CSoundFile::SaveStaticTunings()
Modified: trunk/OpenMPT/soundlib/Sndfile.h
===================================================================
--- trunk/OpenMPT/soundlib/Sndfile.h 2011-05-13 16:02:13 UTC (rev 872)
+++ trunk/OpenMPT/soundlib/Sndfile.h 2011-05-15 20:26:20 UTC (rev 873)
@@ -653,8 +653,8 @@
LONG m_nMinPeriod, m_nMaxPeriod; // min period = highest possible frequency, max period = lowest possible frequency
LONG m_nRepeatCount; // -1 means repeat infinitely.
DWORD m_nGlobalFadeSamples, m_nGlobalFadeMaxSamples;
- UINT m_nMaxOrderPosition, m_nPatternNames;
- LPSTR m_lpszSongComments, m_lpszPatternNames;
+ UINT m_nMaxOrderPosition;
+ LPSTR m_lpszSongComments;
UINT ChnMix[MAX_CHANNELS]; // Channels to be mixed
MODCHANNEL Chn[MAX_CHANNELS]; // Mixing channels... First m_nChannel channels are master channels (i.e. they are never NNA channels)!
MODCHANNELSETTINGS ChnSettings[MAX_BASECHANNELS]; // Initial channels settings
@@ -740,8 +740,6 @@
bool IsPaused() const { return (m_dwSongFlags & (SONG_PAUSED|SONG_STEP)) ? true : false; } // Added SONG_STEP as it seems to be desirable in most cases to check for this as well.
void LoopPattern(PATTERNINDEX nPat, ROWINDEX nRow = 0);
void CheckCPUUsage(UINT nCPU);
- BOOL SetPatternName(PATTERNINDEX nPat, LPCSTR lpszName);
- BOOL GetPatternName(PATTERNINDEX nPat, LPSTR lpszName, UINT cbSize=MAX_PATTERNNAME) const;
void SetupITBidiMode();
@@ -928,7 +926,7 @@
DWORD IsSongFinished(UINT nOrder, UINT nRow) const;
void UpdateTimeSignature();
- UINT GetNumTicksOnCurrentRow() { return m_nMusicSpeed * (m_nPatternDelay + 1) + m_nFrameDelay; };
+ UINT GetNumTicksOnCurrentRow() const { return m_nMusicSpeed * (m_nPatternDelay + 1) + m_nFrameDelay; };
public:
// Write pattern effect functions
bool TryWriteEffect(PATTERNINDEX nPat, ROWINDEX nRow, BYTE nEffect, BYTE nParam, bool bIsVolumeEffect, CHANNELINDEX nChn = CHANNELINDEX_INVALID, bool bAllowMultipleEffects = true, writeEffectAllowRowChange allowRowChange = weIgnore, bool bRetry = true);
Modified: trunk/OpenMPT/soundlib/pattern.cpp
===================================================================
--- trunk/OpenMPT/soundlib/pattern.cpp 2011-05-13 16:02:13 UTC (rev 872)
+++ trunk/OpenMPT/soundlib/pattern.cpp 2011-05-15 20:26:20 UTC (rev 873)
@@ -126,6 +126,7 @@
m_Rows = m_RowsPerBeat = m_RowsPerMeasure = 0;
FreePattern(m_ModCommands);
m_ModCommands = nullptr;
+ m_PatternName.Empty();
//END_CRITICAL();
}
@@ -211,6 +212,38 @@
}
+bool CPattern::SetName(char *newName, size_t maxChars)
+//----------------------------------------------------
+{
+ if(newName == nullptr || maxChars == 0)
+ {
+ return false;
+ }
+ m_PatternName.SetString(newName, maxChars - 1);
+ return true;
+}
+
+
+bool CPattern::GetName(char *buffer, size_t maxChars) const
+//---------------------------------------------------------
+{
+ if(buffer == nullptr || maxChars == 0)
+ {
+ return false;
+ }
+ strncpy(buffer, m_PatternName, maxChars - 1);
+ buffer[maxChars - 1] = '\0';
+ return true;
+}
+
+
+////////////////////////////////////////////////////////////////////////
+//
+// Static allocation / deallocation methods
+//
+////////////////////////////////////////////////////////////////////////
+
+
MODCOMMAND *CPattern::AllocatePattern(ROWINDEX rows, CHANNELINDEX nchns)
//----------------------------------------------------------------------
{
@@ -227,6 +260,13 @@
}
+////////////////////////////////////////////////////////////////////////
+//
+// ITP functions
+//
+////////////////////////////////////////////////////////////////////////
+
+
bool CPattern::WriteITPdata(FILE* f) const
//----------------------------------------
{
Modified: trunk/OpenMPT/soundlib/pattern.h
===================================================================
--- trunk/OpenMPT/soundlib/pattern.h 2011-05-13 16:02:13 UTC (rev 872)
+++ trunk/OpenMPT/soundlib/pattern.h 2011-05-15 20:26:20 UTC (rev 873)
@@ -30,6 +30,7 @@
m_Rows = pat.m_Rows;
m_RowsPerBeat = pat.m_RowsPerBeat;
m_RowsPerMeasure = pat.m_RowsPerMeasure;
+ m_PatternName = pat.m_PatternName;
return *this;
}
//END: OPERATORS
@@ -71,6 +72,12 @@
bool SetSignature(const ROWINDEX rowsPerBeat, const ROWINDEX rowsPerMeasure);
void RemoveSignature() { m_RowsPerBeat = m_RowsPerMeasure = 0; }
+ // Patter name functions (for both CString and char[] arrays) - bool functions return true on success.
+ bool SetName(char *newName, size_t maxChars = MAX_PATTERNNAME);
+ bool SetName(CString newName) { m_PatternName = newName; return true; };
+ bool GetName(char *buffer, size_t maxChars = MAX_PATTERNNAME) const;
+ CString GetName() const { return m_PatternName; };
+
// Double number of rows
bool Expand();
@@ -117,6 +124,7 @@
ROWINDEX m_Rows;
ROWINDEX m_RowsPerBeat; // patterns-specific time signature. if != 0, this is implicitely set.
ROWINDEX m_RowsPerMeasure; // dito
+ CString m_PatternName;
CPatternContainer& m_rPatternContainer;
//END: DATA
};
Modified: trunk/OpenMPT/soundlib/patternContainer.cpp
===================================================================
--- trunk/OpenMPT/soundlib/patternContainer.cpp 2011-05-13 16:02:13 UTC (rev 872)
+++ trunk/OpenMPT/soundlib/patternContainer.cpp 2011-05-15 20:26:20 UTC (rev 873)
@@ -61,9 +61,10 @@
{
CPattern::FreePattern(m_Patterns[index].m_ModCommands);
}
- m_Patterns[index].m_ModCommands = CPattern::AllocatePattern(rows, m_rSndFile.m_nChannels);
+ m_Patterns[index].m_ModCommands = CPattern::AllocatePattern(rows, m_rSndFile.GetNumChannels());
m_Patterns[index].m_Rows = rows;
m_Patterns[index].RemoveSignature();
+ m_Patterns[index].SetName("");
if(!m_Patterns[index]) return true;
@@ -153,6 +154,25 @@
}
+PATTERNINDEX CPatternContainer::GetNumNamedPatterns() const
+//---------------------------------------------------------
+{
+ if(Size() == 0)
+ {
+ return 0;
+ }
+ for(PATTERNINDEX nPat = Size(); nPat > 0; nPat--)
+ {
+ if(m_Patterns[nPat - 1].GetName() != "")
+ {
+ return nPat;
+ }
+ }
+ return 0;
+}
+
+
+
void WriteModPatterns(std::ostream& oStrm, const CPatternContainer& patc)
//----------------------------------------------------------------------
{
Modified: trunk/OpenMPT/soundlib/patternContainer.h
===================================================================
--- trunk/OpenMPT/soundlib/patternContainer.h 2011-05-13 16:02:13 UTC (rev 872)
+++ trunk/OpenMPT/soundlib/patternContainer.h 2011-05-15 20:26:20 UTC (rev 873)
@@ -76,6 +76,9 @@
void OnModTypeChanged(const MODTYPE oldtype);
+ // Returns index of highest pattern with pattern named + 1.
+ PATTERNINDEX GetNumNamedPatterns() const;
+
//END: INTERFACE METHODS
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <sag...@us...> - 2011-05-13 16:02:20
|
Revision: 872
http://modplug.svn.sourceforge.net/modplug/?rev=872&view=rev
Author: saga-games
Date: 2011-05-13 16:02:13 +0000 (Fri, 13 May 2011)
Log Message:
-----------
Created tag for OpenMPT 1.19.02.00
Added Paths:
-----------
tags/1.19.02.00/
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <sag...@us...> - 2011-05-13 13:59:27
|
Revision: 871
http://modplug.svn.sourceforge.net/modplug/?rev=871&view=rev
Author: saga-games
Date: 2011-05-13 13:59:18 +0000 (Fri, 13 May 2011)
Log Message:
-----------
[Mod] Updated package template and installer code
[Fix] Fixed memory leak in internet update code when download code fails (which practically shouldn't happen at all)
[Mod] OpenMPT: Version is no 1.19.02.00
Modified Paths:
--------------
trunk/OpenMPT/installer/install-unmo3-free-itd.iss
trunk/OpenMPT/installer/install-unmo3-free.iss
trunk/OpenMPT/installer/install.iss
trunk/OpenMPT/installer/packageTemplate/readme.txt
trunk/OpenMPT/mptrack/UpdateCheck.cpp
trunk/OpenMPT/mptrack/version.h
trunk/OpenMPT/packageTemplate/History.txt
trunk/OpenMPT/packageTemplate/OMPT_1.19_ReleaseNotes.html
trunk/OpenMPT/packageTemplate/readme.txt
Removed Paths:
-------------
trunk/OpenMPT/mptrack/Mptrack.opt
trunk/OpenMPT/mptrack/mptrack.plg
Modified: trunk/OpenMPT/installer/install-unmo3-free-itd.iss
===================================================================
--- trunk/OpenMPT/installer/install-unmo3-free-itd.iss 2011-05-10 14:27:05 UTC (rev 870)
+++ trunk/OpenMPT/installer/install-unmo3-free-itd.iss 2011-05-13 13:59:18 UTC (rev 871)
@@ -23,7 +23,7 @@
begin
if(GetSHA1OfFile(ExpandConstant('{tmp}\openmpt-unmo3.dll.tmp')) <> '393be7e0f50c62d142386a16d6855ca771025554') then
begin
- MsgBox('Warning: unmo3.dll has been downloaded, but its checksum is wrong! This means that either the downloaded file is corrupted or that a newer version of unmo3.dll is available. The file has thus not been installed. Please obtain unmo3.dll from http://openmpt.com/ and verify its checksum.', mbCriticalError, MB_OK)
+ MsgBox('Warning: unmo3.dll has been downloaded, but its checksum is wrong! This means that either the downloaded file is corrupted or that a newer version of unmo3.dll is available. The file has thus not been installed. Please obtain unmo3.dll from http://openmpt.org/ and verify its checksum.', mbCriticalError, MB_OK)
end else
begin
FileCopy(ExpandConstant('{tmp}\openmpt-unmo3.dll.tmp'), ExpandConstant('{app}\unmo3.dll'), true);
Modified: trunk/OpenMPT/installer/install-unmo3-free.iss
===================================================================
--- trunk/OpenMPT/installer/install-unmo3-free.iss 2011-05-10 14:27:05 UTC (rev 870)
+++ trunk/OpenMPT/installer/install-unmo3-free.iss 2011-05-13 13:59:18 UTC (rev 871)
@@ -22,7 +22,7 @@
begin
if(GetSHA1OfFile(ExpandConstant('{tmp}\openmpt-unmo3.dll.tmp')) <> '393be7e0f50c62d142386a16d6855ca771025554') then
begin
- MsgBox('Warning: unmo3.dll has been downloaded, but its checksum is wrong! This means that either the downloaded file is corrupted or that a newer version of unmo3.dll is available. The file has thus not been installed. Please obtain unmo3.dll from http://openmpt.com/ and verify its checksum.', mbCriticalError, MB_OK)
+ MsgBox('Warning: unmo3.dll has been downloaded, but its checksum is wrong! This means that either the downloaded file is corrupted or that a newer version of unmo3.dll is available. The file has thus not been installed. Please obtain unmo3.dll from http://openmpt.org/ and verify its checksum.', mbCriticalError, MB_OK)
end else
begin
FileCopy(ExpandConstant('{tmp}\openmpt-unmo3.dll.tmp'), ExpandConstant('{app}\unmo3.dll'), true);
Modified: trunk/OpenMPT/installer/install.iss
===================================================================
--- trunk/OpenMPT/installer/install.iss 2011-05-10 14:27:05 UTC (rev 870)
+++ trunk/OpenMPT/installer/install.iss 2011-05-13 13:59:18 UTC (rev 871)
@@ -73,8 +73,8 @@
; release notes
Source: ..\packageTemplate\ReleaseNotesImages\general\*.*; DestDir: {app}\ReleaseNotesImages\general\; Flags: ignoreversion sortfilesbyextension
-Source: ..\packageTemplate\ReleaseNotesImages\1.19\*.*; DestDir: {app}\ReleaseNotesImages\1.19\; Flags: ignoreversion sortfilesbyextension
-Source: ..\packageTemplate\OMPT_1.19_ReleaseNotes.html; DestDir: {app}; Flags: ignoreversion
+Source: ..\packageTemplate\ReleaseNotesImages\{#GetAppVersionShort}\*.*; DestDir: {app}\ReleaseNotesImages\{#GetAppVersionShort}\; Flags: ignoreversion sortfilesbyextension
+Source: ..\packageTemplate\OMPT_{#GetAppVersionShort}_ReleaseNotes.html; DestDir: {app}; Flags: ignoreversion
; soundtouch license stuff
Source: ..\packageTemplate\SoundTouch\*.*; DestDir: {app}\SoundTouch; Flags: ignoreversion sortfilesbyextension
Modified: trunk/OpenMPT/installer/packageTemplate/readme.txt
===================================================================
--- trunk/OpenMPT/installer/packageTemplate/readme.txt 2011-05-10 14:27:05 UTC (rev 870)
+++ trunk/OpenMPT/installer/packageTemplate/readme.txt 2011-05-13 13:59:18 UTC (rev 871)
@@ -34,14 +34,14 @@
Release package contents:
-------------------------
-extraKeymaps(folder): Additional key bindings for the keyboard manager,
- available in several flavours (including MPT classic, FastTracker and
+extraKeymaps (folder): Additional key bindings for the keyboard manager,
+ available in several flavours (including MPT classic, Fasttracker 2 and
Impulse Tracker) and country-specific layouts.
-soundtouch(folder): SoundTouch readme and copying.txt
-ReleaseNotesImages(folder): Images using in the release notes document.
-ExampleSongs(folder): A set of module files which should give an impression of
+SoundTouch (folder): SoundTouch readme and license
+ReleaseNotesImages (folder): Files used in the release notes document.
+ExampleSongs (folder): A set of module files which should give an impression of
what can be done in OpenMPT with only a few kilobytes.
-history.txt: Version history.
+History.txt: Version history.
mptrack.exe: Main executable.
OpenMPT_SoundTouch_i16.dll: Slightly customized SoundTouch library used in time
stretching feature.
Deleted: trunk/OpenMPT/mptrack/Mptrack.opt
===================================================================
--- trunk/OpenMPT/mptrack/Mptrack.opt 2011-05-10 14:27:05 UTC (rev 870)
+++ trunk/OpenMPT/mptrack/Mptrack.opt 2011-05-13 13:59:18 UTC (rev 871)
@@ -1,31 +0,0 @@
-\xD0\xCFࡱ\xE1 |
|
From: <sag...@us...> - 2011-05-10 14:27:16
|
Revision: 870
http://modplug.svn.sourceforge.net/modplug/?rev=870&view=rev
Author: saga-games
Date: 2011-05-10 14:27:05 +0000 (Tue, 10 May 2011)
Log Message:
-----------
[Mod] Changed some terms as suggested in http://bugs.openmpt.org/view.php?id=100
[Mod] Removed inline modifier from SanitizeFilename()
[Mod] Updated release notes
[Mod] OpenMPT: Version is now 1.19.01.07
Modified Paths:
--------------
trunk/OpenMPT/mptrack/CommandSet.cpp
trunk/OpenMPT/mptrack/InputHandler.cpp
trunk/OpenMPT/mptrack/View_pat.cpp
trunk/OpenMPT/mptrack/misc_util.h
trunk/OpenMPT/mptrack/mptrack.rc
trunk/OpenMPT/mptrack/version.h
trunk/OpenMPT/packageTemplate/OMPT_1.19_ReleaseNotes.html
Modified: trunk/OpenMPT/mptrack/CommandSet.cpp
===================================================================
--- trunk/OpenMPT/mptrack/CommandSet.cpp 2011-05-09 14:28:38 UTC (rev 869)
+++ trunk/OpenMPT/mptrack/CommandSet.cpp 2011-05-10 14:27:05 UTC (rev 870)
@@ -564,7 +564,7 @@
DefineKeyCommand(kcOrderlistPatPlus, 1817, kcVisible, kcNoDummy, _T("Increase pattern index "));
DefineKeyCommand(kcOrderlistPatMinus, 1818, kcVisible, kcNoDummy, _T("Decrease pattern index"));
DefineKeyCommand(kcShowSplitKeyboardSettings, 1819, kcVisible, kcNoDummy, _T("Split Keyboard Settings dialog"));
- DefineKeyCommand(kcEditPushForwardPaste, 1820, kcVisible, kcNoDummy, _T("Push Forward Paste"));
+ DefineKeyCommand(kcEditPushForwardPaste, 1820, kcVisible, kcNoDummy, _T("Push Forward Paste (Insert)"));
DefineKeyCommand(kcInstrumentEnvelopePointMoveLeft, 1821, kcVisible, kcNoDummy, _T("Move envelope point left"));
DefineKeyCommand(kcInstrumentEnvelopePointMoveRight, 1822, kcVisible, kcNoDummy, _T("Move envelope point right"));
DefineKeyCommand(kcInstrumentEnvelopePointMoveUp, 1823, kcVisible, kcNoDummy, _T("Move envelope point up"));
@@ -597,7 +597,7 @@
DefineKeyCommand(kcInsNoteMapEditSampleMap, 1850, kcVisible, kcNoDummy, _T("Edit sample map"));
DefineKeyCommand(kcInstrumentCtrlDuplicate, 1851, kcVisible, kcNoDummy, _T("Duplicate instrument"));
DefineKeyCommand(kcPanic, 1852, kcVisible, kcNoDummy, _T("Panic"));
- DefineKeyCommand(kcOrderlistPatIgnore, 1853, kcVisible, kcNoDummy, _T("Ignore (+++) Index"));
+ DefineKeyCommand(kcOrderlistPatIgnore, 1853, kcVisible, kcNoDummy, _T("Separator (+++) Index"));
DefineKeyCommand(kcOrderlistPatInvalid, 1854, kcVisible, kcNoDummy, _T("Invalid (---) Index"));
DefineKeyCommand(kcViewEditHistory, 1855, kcVisible, kcNoDummy, _T("View Edit History"));
DefineKeyCommand(kcSampleQuickFade, 1856, kcVisible, kcNoDummy, _T("Quick fade"));
Modified: trunk/OpenMPT/mptrack/InputHandler.cpp
===================================================================
--- trunk/OpenMPT/mptrack/InputHandler.cpp 2011-05-09 14:28:38 UTC (rev 869)
+++ trunk/OpenMPT/mptrack/InputHandler.cpp 2011-05-10 14:27:05 UTC (rev 870)
@@ -448,7 +448,7 @@
case ID_EDIT_PASTE_SPECIAL: s="&Mix Paste\t"; c=kcEditMixPaste; break;
case ID_EDIT_MIXPASTE_ITSTYLE: s="&Mix Paste (IT Style)\t"; c=kcEditMixPasteITStyle; break;
case ID_EDIT_PASTEFLOOD: s="Paste Fl&ood\t"; c=kcEditPasteFlood; break;
- case ID_EDIT_PUSHFORWARDPASTE: s="&Push Forward Paste\t"; c=kcEditPushForwardPaste; break;
+ case ID_EDIT_PUSHFORWARDPASTE: s="&Push Forward Paste (Insert)\t"; c=kcEditPushForwardPaste; break;
case ID_VIEW_GLOBALS: s="&General\t"; c=kcViewGeneral; break;
case ID_VIEW_SAMPLES: s="&Samples\t"; c=kcViewSamples; break;
Modified: trunk/OpenMPT/mptrack/View_pat.cpp
===================================================================
--- trunk/OpenMPT/mptrack/View_pat.cpp 2011-05-09 14:28:38 UTC (rev 869)
+++ trunk/OpenMPT/mptrack/View_pat.cpp 2011-05-10 14:27:05 UTC (rev 870)
@@ -5159,7 +5159,7 @@
AppendMenu(pasteSpecialMenu, MF_STRING, ID_EDIT_MIXPASTE, "Mix Paste\t" + ih->GetKeyTextFromCommand(kcEditMixPaste));
AppendMenu(pasteSpecialMenu, MF_STRING, ID_EDIT_MIXPASTE_ITSTYLE, "Mix Paste (IT Style)\t" + ih->GetKeyTextFromCommand(kcEditMixPasteITStyle));
AppendMenu(pasteSpecialMenu, MF_STRING, ID_EDIT_PASTEFLOOD, "Paste Flood\t" + ih->GetKeyTextFromCommand(kcEditPasteFlood));
- AppendMenu(pasteSpecialMenu, MF_STRING, ID_EDIT_PUSHFORWARDPASTE, "Push Forward Paste\t" + ih->GetKeyTextFromCommand(kcEditPushForwardPaste));
+ AppendMenu(pasteSpecialMenu, MF_STRING, ID_EDIT_PUSHFORWARDPASTE, "Push Forward Paste (Insert)\t" + ih->GetKeyTextFromCommand(kcEditPushForwardPaste));
DWORD greyed = pModDoc->GetPatternUndo()->CanUndo()?FALSE:MF_GRAYED;
if (!greyed || !(CMainFrame::m_dwPatternSetup & PATTERN_OLDCTXMENUSTYLE))
Modified: trunk/OpenMPT/mptrack/misc_util.h
===================================================================
--- trunk/OpenMPT/mptrack/misc_util.h 2011-05-09 14:28:38 UTC (rev 869)
+++ trunk/OpenMPT/mptrack/misc_util.h 2011-05-10 14:27:05 UTC (rev 870)
@@ -124,8 +124,8 @@
// Sanitize a filename (remove special chars)
template <size_t size>
-inline void SanitizeFilename(char (&buffer)[size])
-//------------------------------------------------
+void SanitizeFilename(char (&buffer)[size])
+//-----------------------------------------
{
STATIC_ASSERT(size > 0);
for(size_t i = 0; i < size; i++)
Modified: trunk/OpenMPT/mptrack/mptrack.rc
===================================================================
--- trunk/OpenMPT/mptrack/mptrack.rc 2011-05-09 14:28:38 UTC (rev 869)
+++ trunk/OpenMPT/mptrack/mptrack.rc 2011-05-10 14:27:05 UTC (rev 870)
@@ -2014,7 +2014,7 @@
MENUITEM "&Mix Paste\tCtrl+M", ID_EDIT_PASTE_SPECIAL
MENUITEM "Mix Paste (IT Style)", ID_EDIT_MIXPASTE_ITSTYLE
MENUITEM "Paste &Flood", ID_EDIT_PASTEFLOOD
- MENUITEM "&Push Forward Paste", ID_EDIT_PUSHFORWARDPASTE
+ MENUITEM "&Push Forward Paste (Insert)", ID_EDIT_PUSHFORWARDPASTE
END
MENUITEM "Select &All\tCtrl+5", ID_EDIT_SELECT_ALL
MENUITEM SEPARATOR
Modified: trunk/OpenMPT/mptrack/version.h
===================================================================
--- trunk/OpenMPT/mptrack/version.h 2011-05-09 14:28:38 UTC (rev 869)
+++ trunk/OpenMPT/mptrack/version.h 2011-05-10 14:27:05 UTC (rev 870)
@@ -15,7 +15,7 @@
#define VER_MAJORMAJOR 1
#define VER_MAJOR 19
#define VER_MINOR 01
-#define VER_MINORMINOR 06
+#define VER_MINORMINOR 07
//Creates version number from version parts that appears in version string.
//For example MAKE_VERSION_NUMERIC(1,17,02,28) gives version number of
Modified: trunk/OpenMPT/packageTemplate/OMPT_1.19_ReleaseNotes.html
===================================================================
--- trunk/OpenMPT/packageTemplate/OMPT_1.19_ReleaseNotes.html 2011-05-09 14:28:38 UTC (rev 869)
+++ trunk/OpenMPT/packageTemplate/OMPT_1.19_ReleaseNotes.html 2011-05-10 14:27:05 UTC (rev 870)
@@ -88,6 +88,7 @@
<a href="ReleaseNotesImages/1.19/edithistory.png"><img src="ReleaseNotesImages/1.19/edithistory.png" width="240" height="163" alt="Edit history dialog" title="Edit history dialog (click to view big screenshot)" /></a>
</div>
<ul>
+ <li>OpenMPT comes with an automated <strong>update check</strong> again, which can notify you of new program versions.</li>
<li>Based on an undocumented feature in Impulse Tracker, OpenMPT can now save an <strong>edit history</strong> in IT and MPTM files, which reveals when and for how long a module has been edited in the tracker.</li>
<li>When exporting to WAV, <strong>cue points</strong> are now inserted at every pattern transition.</li>
<li>The last remaining absolute paths in the settings files have been removed; OpenMPT is now <strong>fully portable</strong>!</li>
@@ -102,6 +103,7 @@
<img src="ReleaseNotesImages/1.19/timesignature.png" width="291" height="228" alt="Per-pattern time signatures" title="Per-pattern time signatures" />
</div>
<ul>
+ <li><strong>Channels can be moved</strong> by dragging the channel headers.</li>
<li><strong>Per-pattern time signatures</strong> allow to override the global time signature. This is especially useful in modern tempo mode if you want to use several time signatures in the same song, or if you just temporarily need more detail in a pattern.</li>
<li>You can now <strong>select whole rows</strong> by clicking / dragging the row index on the left side of the pattern.</li>
<li>There are new shortcuts for <strong>selecting a whole beat or measure</strong>.</li>
@@ -132,6 +134,7 @@
<h3>VST Plugins</h3>
<ul>
<li><strong>Much improved compatibility</strong> with many VST 2.4 plugins! Examples of plugins that work better in this version: Voxengo SPAN 2, Angelina, EnergyXT, MetroGnome.</li>
+ <li>It is even easier to <strong>create multiple mod instruments</strong> from a plugin now: Simply choose "Create instrument from plugin" from the plugin editor's "File" menu.</li>
</ul>
<h3>There's more...</h3>
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <sag...@us...> - 2011-05-09 14:28:46
|
Revision: 869
http://modplug.svn.sourceforge.net/modplug/?rev=869&view=rev
Author: saga-games
Date: 2011-05-09 14:28:38 +0000 (Mon, 09 May 2011)
Log Message:
-----------
[Ref] Lots of oneliner refactoring that ought to be commited at some point.
[Mod] Updated docs.
Modified Paths:
--------------
trunk/OpenMPT/TODO
trunk/OpenMPT/mptrack/Mod2wave.cpp
trunk/OpenMPT/mptrack/Moddoc.cpp
trunk/OpenMPT/mptrack/Modedit.cpp
trunk/OpenMPT/mptrack/SampleGenerator.cpp
trunk/OpenMPT/mptrack/View_pat.cpp
trunk/OpenMPT/mptrack/mod2midi.cpp
trunk/OpenMPT/mptrack/tagging.cpp
trunk/OpenMPT/packageTemplate/History.txt
trunk/OpenMPT/soundlib/Load_mod.cpp
trunk/OpenMPT/soundlib/Load_psm.cpp
trunk/OpenMPT/soundlib/midi.h
trunk/OpenMPT/soundlib/patternContainer.cpp
Modified: trunk/OpenMPT/TODO
===================================================================
--- trunk/OpenMPT/TODO 2011-05-08 20:31:56 UTC (rev 868)
+++ trunk/OpenMPT/TODO 2011-05-09 14:28:38 UTC (rev 869)
@@ -6,7 +6,7 @@
* Developement of a proper MPTM format. Currently, it's just based on the
Impulse Tracker format and new features are hacked on at the end of the file.
Not very nice!
-* Better VST support. Currently, many great VST 2.4 features like busses are not
+* Better VST support. Currently, many great VST 2.4 features like buses are not
supported.
Modified: trunk/OpenMPT/mptrack/Mod2wave.cpp
===================================================================
--- trunk/OpenMPT/mptrack/Mod2wave.cpp 2011-05-08 20:31:56 UTC (rev 868)
+++ trunk/OpenMPT/mptrack/Mod2wave.cpp 2011-05-09 14:28:38 UTC (rev 869)
@@ -700,6 +700,7 @@
// No pattern cue points yet
m_pSndFile->m_PatternCuePoints.clear();
+ m_pSndFile->m_PatternCuePoints.reserve(m_pSndFile->Order.GetLength());
// Process the conversion
UINT nBytesPerSample = (CSoundFile::gnBitsPerSample * CSoundFile::gnChannels) / 8;
Modified: trunk/OpenMPT/mptrack/Moddoc.cpp
===================================================================
--- trunk/OpenMPT/mptrack/Moddoc.cpp 2011-05-08 20:31:56 UTC (rev 868)
+++ trunk/OpenMPT/mptrack/Moddoc.cpp 2011-05-09 14:28:38 UTC (rev 869)
@@ -845,26 +845,29 @@
}
UINT CModDoc::PlayNote(UINT note, UINT nins, UINT nsmp, BOOL bpause, LONG nVol, LONG loopstart, LONG loopend, int nCurrentChn, const uint32 nStartPos) //rewbs.vstiLive: added current chan param
-//-----------------------------------------------------------------------------------------------------------
+//----------------------------------------------------------------------------------------------------------------------------------------------------
{
CMainFrame *pMainFrm = CMainFrame::GetMainFrame();
UINT nChn = m_SndFile.m_nChannels;
if ((!pMainFrm) || (!note)) return FALSE;
if (nVol > 256) nVol = 256;
- if (note <= NOTE_MAX)
+ if (NOTE_IS_VALID(note))
{
BEGIN_CRITICAL();
//kill notes if required.
- if ( (bpause) || (m_SndFile.IsPaused()) || pMainFrm->GetModPlaying() != this) {
+ if ( (bpause) || (m_SndFile.IsPaused()) || pMainFrm->GetModPlaying() != this)
+ {
//OnPlayerPause(); // pause song - pausing VSTis is too slow
pMainFrm->SetLastMixActiveTime(); // mark activity
// All notes off
- for (UINT i=0; i<MAX_CHANNELS; i++) {
- if ((i < m_SndFile.m_nChannels) || (m_SndFile.Chn[i].nMasterChn)) {
+ for (UINT i=0; i<MAX_CHANNELS; i++)
+ {
+ if ((i < m_SndFile.m_nChannels) || (m_SndFile.Chn[i].nMasterChn))
+ {
m_SndFile.Chn[i].dwFlags |= CHN_KEYOFF | CHN_NOTEFADE;
m_SndFile.Chn[i].nFadeOutVol = 0;
}
@@ -890,12 +893,13 @@
MODCHANNEL *pChn = &m_SndFile.Chn[nChn];
//stop channel, just in case.
- if (pChn->nLength) {
+ if (pChn->nLength)
+ {
pChn->nPos = pChn->nPosLo = pChn->nLength = 0;
}
- //reset channel properties; in theory the chan is completely unused anyway.
- pChn->dwFlags &= 0xFF;
+ // reset channel properties; in theory the chan is completely unused anyway.
+ pChn->dwFlags &= CHN_SAMPLEFLAGS;
pChn->dwFlags &= ~(CHN_MUTE);
pChn->nGlobalVol = 64;
pChn->nInsVol = 64;
@@ -905,14 +909,16 @@
pChn->nCutOff = 0x7F;
pChn->nResonance = 0;
pChn->nVolume = 256;
- pChn->nMasterChn = 0; //remove NNA association
+ pChn->nMasterChn = 0; // remove NNA association
pChn->nNewNote = static_cast<BYTE>(note);
- if (nins) { //Set instrument
+ if (nins) // Set instrument
+ {
m_SndFile.resetEnvelopes(pChn);
m_SndFile.InstrumentChange(pChn, nins);
}
- else if ((nsmp) && (nsmp < MAX_SAMPLES)) { //Or set sample
+ else if ((nsmp) && (nsmp < MAX_SAMPLES)) // Or set sample
+ {
MODSAMPLE *pSmp = &m_SndFile.Samples[nsmp];
pChn->pCurrentSample = pSmp->pSample;
pChn->pModInstrument = nullptr;
@@ -946,9 +952,11 @@
}
// handle extra-loud flag
- if ((!(CMainFrame::m_dwPatternSetup & PATTERN_NOEXTRALOUD)) && (nsmp)) {
+ if ((!(CMainFrame::m_dwPatternSetup & PATTERN_NOEXTRALOUD)) && (nsmp))
+ {
pChn->dwFlags |= CHN_EXTRALOUD;
- } else {
+ } else
+ {
pChn->dwFlags &= ~CHN_EXTRALOUD;
}
Modified: trunk/OpenMPT/mptrack/Modedit.cpp
===================================================================
--- trunk/OpenMPT/mptrack/Modedit.cpp 2011-05-08 20:31:56 UTC (rev 868)
+++ trunk/OpenMPT/mptrack/Modedit.cpp 2011-05-09 14:28:38 UTC (rev 869)
@@ -356,7 +356,7 @@
if (pPlug->pPluginData)
{
- delete pPlug->pPluginData;
+ delete[] pPlug->pPluginData;
pPlug->pPluginData = NULL;
}
if (pPlug->pMixPlugin)
@@ -369,7 +369,7 @@
delete pPlug->pMixState;
}
- memset(&(pPlug->Info), 0, sizeof(SNDMIXPLUGININFO));
+ MemsetZero(pPlug->Info);
Log("Zeroing range (%d) %X - %X\n", nPlug, &(pPlug->Info), &(pPlug->Info)+sizeof(SNDMIXPLUGININFO));
pPlug->nPluginDataSize=0;
pPlug->fDryRatio=0;
Modified: trunk/OpenMPT/mptrack/SampleGenerator.cpp
===================================================================
--- trunk/OpenMPT/mptrack/SampleGenerator.cpp 2011-05-08 20:31:56 UTC (rev 868)
+++ trunk/OpenMPT/mptrack/SampleGenerator.cpp 2011-05-09 14:28:38 UTC (rev 869)
@@ -57,7 +57,7 @@
sample_clipping = dlg.GetClipping();
expression = dlg.GetExpression();
isDone = CanRenderSample();
- if(isDone) isDone = TestExpression(); // show dialog again if the formular can't be parsed.
+ if(isDone) isDone = TestExpression(); // show dialog again if the formula can't be parsed.
result = true;
} else
{
Modified: trunk/OpenMPT/mptrack/View_pat.cpp
===================================================================
--- trunk/OpenMPT/mptrack/View_pat.cpp 2011-05-08 20:31:56 UTC (rev 868)
+++ trunk/OpenMPT/mptrack/View_pat.cpp 2011-05-09 14:28:38 UTC (rev 869)
@@ -2567,20 +2567,20 @@
nRows = pSndFile->Patterns[m_nPattern].GetNumRows();
pOldPattern = pSndFile->Patterns[m_nPattern];
if ((nChannels < 1) || (nRows < 1) || (!pOldPattern)) return;
- dx = (int)((m_dwDragPos & 0xFFF8) >> 3) - (int)((m_dwStartSel & 0xFFF8) >> 3);
+ dx = (int)GetChanFromCursor(m_dwDragPos) - (int)GetChanFromCursor(m_dwStartSel);
dy = (int)GetRowFromCursor(m_dwDragPos) - (int)GetRowFromCursor(m_dwStartSel);
if ((!dx) && (!dy)) return;
pModDoc->GetPatternUndo()->PrepareUndo(m_nPattern, 0,0, nChannels, nRows);
pNewPattern = CPattern::AllocatePattern(nRows, nChannels);
if (!pNewPattern) return;
- x1 = (m_dwBeginSel & 0xFFF8) >> 3;
- y1 = (m_dwBeginSel) >> 16;
- x2 = (m_dwEndSel & 0xFFF8) >> 3;
- y2 = (m_dwEndSel) >> 16;
- c1 = (m_dwBeginSel&7);
- c2 = (m_dwEndSel&7);
- if (c1 > 3) c1 = 3;
- if (c2 > 3) c2 = 3;
+ x1 = GetChanFromCursor(m_dwBeginSel);
+ y1 = GetRowFromCursor(m_dwBeginSel);
+ x2 = GetChanFromCursor(m_dwEndSel);
+ y2 = GetRowFromCursor(m_dwEndSel);
+ c1 = GetColTypeFromCursor(m_dwBeginSel);
+ c2 = GetColTypeFromCursor(m_dwEndSel);
+ if (c1 > EFFECT_COLUMN) c1 = EFFECT_COLUMN;
+ if (c2 > EFFECT_COLUMN) c2 = EFFECT_COLUMN;
xc1 = x1*4+c1;
xc2 = x2*4+c2;
xmc1 = xc1+dx*4;
@@ -2645,7 +2645,7 @@
if (c2 >= 3) c2 = 4;
// Fix: Horizontal scrollbar pos screwed when selecting with mouse
SetCursorPosition( y1, (x1<<3)|c1 );
- SetCurSel((y1<<16)|(x1<<3)|c1, (y2<<16)|(x2<<3)|c2);
+ SetCurSel(CreateCursor(y1, x1, c1), CreateCursor(y2, x2, c2));
InvalidatePattern();
CPattern::FreePattern(pOldPattern);
pModDoc->SetModified();
Modified: trunk/OpenMPT/mptrack/mod2midi.cpp
===================================================================
--- trunk/OpenMPT/mptrack/mod2midi.cpp 2011-05-08 20:31:56 UTC (rev 868)
+++ trunk/OpenMPT/mptrack/mod2midi.cpp 2011-05-09 14:28:38 UTC (rev 869)
@@ -134,7 +134,7 @@
strcpy(m_szFileName, pszPathName);
_splitpath(pszPathName, NULL, NULL, NULL, fext);
if (!_stricmp(fext, ".rmi")) m_bRmi = TRUE;
- memset(m_InstrMap, 0, sizeof(m_InstrMap));
+ MemsetZero(m_InstrMap);
for (UINT nIns=1; nIns<=m_pSndFile->m_nInstruments; nIns++)
{
MODINSTRUMENT *pIns = m_pSndFile->Instruments[nIns];
Modified: trunk/OpenMPT/mptrack/tagging.cpp
===================================================================
--- trunk/OpenMPT/mptrack/tagging.cpp 2011-05-08 20:31:56 UTC (rev 868)
+++ trunk/OpenMPT/mptrack/tagging.cpp 2011-05-09 14:28:38 UTC (rev 869)
@@ -125,7 +125,7 @@
WAVEDATAHEADER chunk;
CHAR s[256];
DWORD info_ofs, end_ofs;
- DWORD zero = 0;
+ const DWORD zero = 0;
info_ofs = ftell(f);
if (info_ofs & 1)
Modified: trunk/OpenMPT/packageTemplate/History.txt
===================================================================
--- trunk/OpenMPT/packageTemplate/History.txt 2011-05-08 20:31:56 UTC (rev 868)
+++ trunk/OpenMPT/packageTemplate/History.txt 2011-05-09 14:28:38 UTC (rev 869)
@@ -10,44 +10,55 @@
(tx XYZ): thanks to XYZ for telling us about the bug / requesting the feature
-v1.19.02.00 (***** 2011, revision 861)
---------------------------------------
-Pattern tab::Note properties
- [New] <Jojo> Channels can now be moved by dragging their channel header. Holding Shift while doing so duplicates the channel
+v1.19.02.00 (May 2011, revision 869)
+------------------------------------
+Pattern tab
+ [New] <Jojo> Channels can now be moved by dragging their channel header. Holding Shift while doing so duplicates the channel.
[Imp] <Jojo> Moving channels through the channel manager creates an undo point now.
- [Fix] <Jojo> Axx is not limited to value 7F anymore in IT / S3M format.
[Fix] <Jojo> Order list info text now truncates list length after the first "---" pattern for MOD files in hex display mode as well.
+Pattern tab::Note properties
+ [Fix] <Jojo> Axx is not limited to value 7F anymore in IT / S3M format.
+
VST
[New] <Jojo> New menu entry in the plugin editor: Create instrument from plugin
[Fix] <Jojo> Fixed note handling in VST editor of plugins that actually don't support MIDI input (http://bugs.openmpt.org/view.php?id=102)
Mod Conversion
[Imp] <Jojo> Improved conversion of Sxx (IT / S3M) and PC Notes.
- [Mod] <Jojo> When converting from MOD/S3M to XM/IT, compatible play is automatically enabled.
+ [Mod] <Jojo> When converting from MOD / S3M to XM / IT, compatible play is automatically enabled.
[Fix] <Jojo> Sustain loop conversion didn't work
+Playback
+ [Fix] <Jojo> The first triggered note in the pattern / sample / instrument editor is not cut off anymore (tx C-jeff, http://bugs.openmpt.org/view.php?id=123)
+
IT
+ [Imp] <Jojo> When clearing MIDI macros during loading, only the Zxx macros are cleared, but not the global (currently unused) configuration.
[Fix] <Jojo> Panning slides with both parameter nibbles set were not ignored in compatible mode.
XM
[Fix] <Jojo> When using compatibility export, the number of samples per instrument is now limited to 16.
MOD
- [Fix] <Jojo> "+++" separator patterns were allowed in MOD files, which made them break in other trackers / players (tx 404notfound)
+ [Imp] <Jojo> Instead of cutting the order list after the first --- pattern, such order items are simply removed from the saved order list. (http://bugs.openmpt.org/view.php?id=118)
+ [Fix] <Jojo> "+++" separator patterns were allowed in MOD files, which made them break in other trackers / players. (http://bugs.openmpt.org/view.php?id=118)
+S3M
+ [Imp] <Jojo> When clearing MIDI macros during loading, only the Zxx macros are cleared, but not the global (currently unused) configuration.
Other formats
[Imp] <Jojo> DMF Loader was rewritten completely and is a whole lot more accurate now.
- [Fix] <Jojo> J2B Loader: Empty sample slots are now treated correct in new J2B (AM) files.
+ [Fix] <Jojo> J2B Loader: Empty sample slots are now treated correct in new (RIFF AM) J2B files.
[Fix] <Jojo> DBM Loader: Global volume was scaled wrong.
- [Fix] <Jojo> 8SVX Loader: If no sample could be found in the file, the loader does not claim to have successfully loaded a sample anymore.
+ [Fix] <Jojo> 8SVX Loader: If no sample could be found in the file, the loader does not claim to have successfully loaded a sample anymore. (http://bugs.openmpt.org/view.php?id=117)
Misc
[New] <Jojo> OpenMPT can now automatically check for updates (daily / weekly / monthly)
+ [Mod] <Jojo> "Embed MIDI macros" is now only enabled during song creation if the user's default MIDI macro setup differs from standard configuration.
[Fix] <Jojo> When using "Convert instruments to samples" in the Song Cleanup dialog, "Remove samples associated with an instrument" actually destroyed all samples.
[Reg] <Jojo> Removed hidden INI flag to suppress warnings when encountering keymaps with unknown items. This option was introduced when faulty keymaps threw multiple message boxes, but now it's just one and it shouldn't be ignored...
+
v1.19.01.00 (April 2011, revision 836)
--------------------------------------
Pattern tab
@@ -1046,13 +1057,13 @@
[Mod] <Jojo> Sustain loop will now be enabled when setting it to sample selection. (rev. 231)
[Mod] <Jojo> Sample editing: If possible, use loop points as trim limits if there's no selection chosen. (rev. 230)
[Mod] <re> Time stretching is now implemented with SoundTouch library. (rev. 228)
- [Mod] <re> Disabled pitchshifting/time stretching of 8-bit samples(didn't seem to work). (rev. 228)
+ [Mod] <re> Disabled pitchshifting/time stretching of 8-bit samples (didn't seem to work). (rev. 228)
Instrument tab
[Fix] <Jojo> Envelope view: Middle line will now be drawn in panning and pitch/filter envelopes even if row guidelines are enabled. (rev. 254)
[Mod] <Jojo> Instrument tab: Sample map can now map "No sample". (rev. 236)
- [Mod] <re> Changed default instrument plug volume command handling from Dry/Wet to none. Also added ini-setting with which one can set the default value used for new instruments. Ini setting is "DefaultPlugVolumeHandling" in [Misc], possible values are 0,1,2. (rev. 238)
+ [Mod] <re> Changed default instrument plug volume command handling from Dry/Wet to none. Also added INI setting with which one can set the default value used for new instruments. INI setting is "DefaultPlugVolumeHandling" in [Misc], possible values are 0,1,2. (rev. 238)
MPTM
[Fix] <re> Pattern cleanup: In some cases sequence wasn't cleaned properly for mptm. (rev. 239)
@@ -1081,14 +1092,13 @@
[Fix] <Jojo & re> Fixes to MOD saving: it should now be possible to create ProTracker compatible MOD files with compatibility export. (rev. 256)
Package template
- [Mod] <Jojo> PackageTemplate: Update to DE_jojo.mkb keymap
+ [Mod] <Jojo> Updated DE_jojo.mkb keymap
Misc
[Fix] <from libmodplug> Fix to faulty portamento handling on loading AMF.
[Fix] <various> Lots of smaller bug fixes.
-
v1.17.02.52 (14 Apr 2008, revision 210)
---------------------------------------
[Fix] <re> Shouldn't need winhttp anymore (at least now that updatecheck is disabled). Dependency caused problems in Win98.
Modified: trunk/OpenMPT/soundlib/Load_mod.cpp
===================================================================
--- trunk/OpenMPT/soundlib/Load_mod.cpp 2011-05-08 20:31:56 UTC (rev 868)
+++ trunk/OpenMPT/soundlib/Load_mod.cpp 2011-05-09 14:28:38 UTC (rev 869)
@@ -489,7 +489,7 @@
}
}
}
- // Arbitrary thershold for going into PT1x mode: 16 "sample swaps" in one pattern.
+ // Arbitrary threshold for going into PT1x mode: 16 "sample swaps" in one pattern.
if(instrWithoutNoteCount > 16)
{
m_dwSongFlags |= SONG_PT1XMODE;
Modified: trunk/OpenMPT/soundlib/Load_psm.cpp
===================================================================
--- trunk/OpenMPT/soundlib/Load_psm.cpp 2011-05-08 20:31:56 UTC (rev 868)
+++ trunk/OpenMPT/soundlib/Load_psm.cpp 2011-05-09 14:28:38 UTC (rev 869)
@@ -160,10 +160,10 @@
m_nVSTiVolume = m_nSamplePreAmp = 48; // not supported in this format, so use a good default value
// pattern offset and identifier
- PATTERNINDEX numPatterns = 0; // used for setting up the orderlist - final pattern count
- vector<uint32> patternOffsets; // pattern offsets (sorted as they occour in the file)
- vector<uint32> patternIDs; // pattern IDs (sorted as they occour in the file)
- vector<uint32> orderOffsets; // combine the upper two vectors to get the offsets for each order item
+ PATTERNINDEX numPatterns = 0; // used for setting up the orderlist - final pattern count
+ vector<uint32> patternOffsets; // pattern offsets (sorted as they occour in the file)
+ vector<uint32> patternIDs; // pattern IDs (sorted as they occour in the file)
+ vector<uint32> orderOffsets; // combine the upper two vectors to get the offsets for each order item
patternOffsets.clear();
patternIDs.clear();
orderOffsets.clear();
@@ -253,7 +253,7 @@
if(subChunkSize < 9) return false;
// First two bytes = Number of chunks that follow
//uint16 nTotalChunks = LittleEndian(*(uint16 *)(lpStream + dwChunkPos));
-
+
// Now, the interesting part begins!
DWORD dwSettingsOffset = dwChunkPos + 2;
uint16 nChunkCount = 0, nFirstOrderChunk = uint16_max;
Modified: trunk/OpenMPT/soundlib/midi.h
===================================================================
--- trunk/OpenMPT/soundlib/midi.h 2011-05-08 20:31:56 UTC (rev 868)
+++ trunk/OpenMPT/soundlib/midi.h 2011-05-09 14:28:38 UTC (rev 869)
@@ -18,7 +18,10 @@
{
MIDIEVENT_NOTEOFF = 0x8,
MIDIEVENT_NOTEON = 0x9,
+ MIDIEVENT_POLYAFTERTOUCH = 0xA,
MIDIEVENT_CONTROLLERCHANGE = 0xB,
+ MIDIEVENT_PROGRAMCHANGE = 0xC,
+ MIDIEVENT_CHANAFTERTOUCH = 0xD,
MIDIEVENT_PITCHBEND = 0xE,
MIDISTATUS_ACTIVESENSING = 0xFE
};
Modified: trunk/OpenMPT/soundlib/patternContainer.cpp
===================================================================
--- trunk/OpenMPT/soundlib/patternContainer.cpp 2011-05-08 20:31:56 UTC (rev 868)
+++ trunk/OpenMPT/soundlib/patternContainer.cpp 2011-05-09 14:28:38 UTC (rev 869)
@@ -87,7 +87,7 @@
if(!IsValidPat(nPat))
return false;
- MODCOMMAND *m = m_Patterns[nPat].m_ModCommands;
+ const MODCOMMAND *m = m_Patterns[nPat].m_ModCommands;
for(size_t i = m_Patterns[nPat].GetNumChannels() * m_Patterns[nPat].GetNumRows(); i > 0; i--, m++)
{
if(!m->IsEmpty(true))
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <sag...@us...> - 2011-05-08 20:32:02
|
Revision: 868
http://modplug.svn.sourceforge.net/modplug/?rev=868&view=rev
Author: saga-games
Date: 2011-05-08 20:31:56 +0000 (Sun, 08 May 2011)
Log Message:
-----------
README clarification
Modified Paths:
--------------
trunk/OpenMPT/README
Modified: trunk/OpenMPT/README
===================================================================
--- trunk/OpenMPT/README 2011-05-08 20:24:49 UTC (rev 867)
+++ trunk/OpenMPT/README 2011-05-08 20:31:56 UTC (rev 868)
@@ -13,7 +13,8 @@
Coding conventions (see below for an example):
-* Functions / methods are "underlined".
+* Functions / methods are "underlined" (The "//------" comment, see below for an
+ example what it should look like).
* Place curly braces at the beginning of the line, not at the end
* Generally make use of the custom index types like SAMPLEINDEX or ORDERINDEX
when referring to samples, orders, etc.
@@ -21,6 +22,7 @@
* CSoundFile::IsCompatibleMode() so that modules made with previous versions of
MPT still sound correct (if the change is extremely small, this might be
unnecessary)
+* CamelCase function and variable names are preferred.
* When checking the module type, use something like
if(GetType() & MOD_TYPE_XXX)
instead of
@@ -31,7 +33,7 @@
Code example:
-void foo::bar(int foobar)
+void Foo::Bar(int foobar)
//-----------------------
{
while(true)
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <sag...@us...> - 2011-05-08 20:24:56
|
Revision: 867
http://modplug.svn.sourceforge.net/modplug/?rev=867&view=rev
Author: saga-games
Date: 2011-05-08 20:24:49 +0000 (Sun, 08 May 2011)
Log Message:
-----------
[Ref] More pattern cursor refactoring.
Modified Paths:
--------------
trunk/OpenMPT/mptrack/View_pat.cpp
trunk/OpenMPT/mptrack/View_pat.h
Modified: trunk/OpenMPT/mptrack/View_pat.cpp
===================================================================
--- trunk/OpenMPT/mptrack/View_pat.cpp 2011-05-08 19:43:27 UTC (rev 866)
+++ trunk/OpenMPT/mptrack/View_pat.cpp 2011-05-08 20:24:49 UTC (rev 867)
@@ -217,7 +217,7 @@
bUpdateScroll = true;
}
if (m_nRow >= pSndFile->Patterns[m_nPattern].GetNumRows()) m_nRow = 0;
- int sel = m_dwCursor | (m_nRow << 16);
+ int sel = CreateCursor(m_nRow) | m_dwCursor;
SetCurSel(sel, sel);
UpdateSizes();
UpdateScrollSize();
@@ -331,7 +331,7 @@
// Fix: Horizontal scrollbar pos screwed when selecting with mouse
UpdateScrollbarPositions(bUpdateHorizontalScrollbar);
InvalidateRow();
- int sel = m_dwCursor | (m_nRow << 16);
+ int sel = CreateCursor(m_nRow) | m_dwCursor;
int sel0 = sel;
if ((m_dwStatus & (PATSTATUS_KEYDRAGSEL|PATSTATUS_MOUSEDRAGSEL))
&& (!(m_dwStatus & PATSTATUS_DRAGNDROPEDIT))) sel0 = m_dwStartSel;
@@ -367,7 +367,7 @@
}
if ((ncol >> 3) >= pSndFile->GetNumChannels()) return FALSE;
m_dwCursor = ncol;
- int sel = m_dwCursor | (m_nRow << 16);
+ int sel = CreateCursor(m_nRow) | m_dwCursor;
int sel0 = sel;
if ((m_dwStatus & (PATSTATUS_KEYDRAGSEL|PATSTATUS_MOUSEDRAGSEL))
&& (!(m_dwStatus & PATSTATUS_DRAGNDROPEDIT))) sel0 = m_dwStartSel;
@@ -609,7 +609,7 @@
}
if (m_pEditWnd)
{
- m_pEditWnd->ShowEditWindow(m_nPattern, (m_nRow << 16) | m_dwCursor);
+ m_pEditWnd->ShowEditWindow(m_nPattern, CreateCursor(m_nRow) | m_dwCursor);
return TRUE;
}
return FALSE;
@@ -1110,7 +1110,7 @@
//-----------------------------------------------------------
{
DWORD dwPos = GetPositionFromPoint(point);
- if ((dwPos == ((m_nRow << 16) | m_dwCursor)) && (point.y >= m_szHeader.cy))
+ if ((dwPos == (CreateCursor(m_nRow) | m_dwCursor)) && (point.y >= m_szHeader.cy))
{
if (ShowEditWindow()) return;
}
@@ -1437,7 +1437,7 @@
UINT max = pModDoc->GetSoundFile()->Patterns[m_nPattern].GetNumRows();
if ((row) && (row >= max)) row = max-1;
dwPos &= 0xFFFF;
- dwPos |= (row << 16);
+ dwPos |= CreateCursor(row);
}
// Drag & Drop editing
if (m_dwStatus & PATSTATUS_DRAGNDROPEDIT)
@@ -1474,9 +1474,7 @@
if (pModDoc)
{
CSoundFile *pSndFile = pModDoc->GetSoundFile();
- SetCurSel(0, ((pSndFile->Patterns[m_nPattern].GetNumRows()-1) << 16)
- | ((pSndFile->m_nChannels - 1) << 3)
- | (4));
+ SetCurSel(CreateCursor(0), CreateCursor(pSndFile->Patterns[m_nPattern].GetNumRows() - 1, pSndFile->GetNumChannels() - 1, LAST_COLUMN));
}
}
@@ -1488,9 +1486,7 @@
if (pModDoc)
{
CSoundFile *pSndFile = pModDoc->GetSoundFile();
- SetCurSel(m_nMenuParam & 0xFFF8,
- ((pSndFile->Patterns[m_nPattern].GetNumRows()-1) << 16)
- | ((m_nMenuParam & 0xFFF8)+4));
+ SetCurSel(CreateCursor(0, GetChanFromCursor(m_nMenuParam), 0), CreateCursor(pSndFile->Patterns[m_nPattern].GetNumRows() - 1, GetChanFromCursor(m_nMenuParam), LAST_COLUMN));
}
}
@@ -1502,14 +1498,13 @@
if (pModDoc)
{
CSoundFile *pSndFile = pModDoc->GetSoundFile();
- DWORD dwBeginSel = m_dwCursor & 0xFFF8;
- DWORD dwEndSel = ((pSndFile->Patterns[m_nPattern].GetNumRows()-1) << 16) | ((m_dwCursor & 0xFFF8)+4);
+ DWORD dwBeginSel = CreateCursor(0, GetChanFromCursor(m_dwCursor), 0);
+ DWORD dwEndSel = CreateCursor(pSndFile->Patterns[m_nPattern].GetNumRows() - 1, GetChanFromCursor(m_dwCursor), LAST_COLUMN);
// If column is already selected, select the current pattern
if ((dwBeginSel == m_dwBeginSel) && (dwEndSel == m_dwEndSel))
{
- dwBeginSel = 0;
- dwEndSel &= 0xFFFF0000;
- dwEndSel |= ((pSndFile->m_nChannels-1) << 3) + 4;
+ dwBeginSel = CreateCursor(0);
+ dwEndSel = CreateCursor(pSndFile->Patterns[m_nPattern].GetNumRows() - 1, pSndFile->GetNumChannels() - 1, LAST_COLUMN);
}
SetCurSel(dwBeginSel, dwEndSel);
}
@@ -1690,7 +1685,7 @@
}
}
//rewbs.customKeys
- DWORD finalPos = (GetSelectionStartRow() << 16) | (m_dwEndSel & 0xFFFF);
+ DWORD finalPos = CreateCursor(GetSelectionStartRow()) | (m_dwEndSel & 0xFFFF);
SetCurSel(finalPos, finalPos);
// Fix: Horizontal scrollbar pos screwed when selecting with mouse
SetCursorPosition( GetRowFromCursor(finalPos), finalPos & 0xFFFF );
@@ -2259,10 +2254,10 @@
if (((pMainFrm->GetFollowSong(pModDoc) != m_hWnd) || (pSndFile->IsPaused()) || (!(m_dwStatus & PATSTATUS_FOLLOWSONG))))
{
- DWORD sel = (nChn << 3) | (m_nRow << 16);
+ DWORD sel = CreateCursor(m_nRow, nChn, 0);
InvalidateArea(sel, sel + LAST_COLUMN);
SetCurrentRow(m_nRow + m_nSpacing);
- sel = m_dwCursor | (m_nRow << 16);
+ sel = CreateCursor(m_nRow) | m_dwCursor;
SetCurSel(sel, sel);
}
}
@@ -3695,7 +3690,7 @@
case kcNavigateLeftSelect:
case kcNavigateLeft: if ((CMainFrame::m_dwPatternSetup & PATTERN_WRAP) && (!m_dwCursor))
- SetCurrentColumn((((pSndFile->m_nChannels-1) << 3) | 4));
+ SetCurrentColumn((((pSndFile->GetNumChannels() - 1) << 3) | 4));
else
SetCurrentColumn(m_dwCursor - 1);
return wParam;
@@ -3712,7 +3707,7 @@
SetCurrentColumn((((GetChanFromCursor(m_dwCursor) - 1) % pSndFile->m_nChannels) << 3) | GetColTypeFromCursor(m_dwCursor));
else
SetCurrentColumn(GetColTypeFromCursor(m_dwCursor) | ((pSndFile->m_nChannels-1) << 3));
- UINT n = (m_nRow << 16) | (m_dwCursor);
+ UINT n = CreateCursor(m_nRow) | m_dwCursor;
SetCurSel(n, n); return wParam;}
case kcHomeHorizontalSelect:
@@ -3727,15 +3722,15 @@
case kcHomeAbsolute: if (m_dwCursor) SetCurrentColumn(0); if (m_nRow > 0) SetCurrentRow(0); return wParam;
case kcEndHorizontalSelect:
- case kcEndHorizontal: if (m_dwCursor!=(((pSndFile->m_nChannels-1) << 3) | 4)) SetCurrentColumn(((pSndFile->m_nChannels-1) << 3) | 4);
+ case kcEndHorizontal: if (m_dwCursor!=(((pSndFile->GetNumChannels() - 1) << 3) | 4)) SetCurrentColumn(((pSndFile->m_nChannels-1) << 3) | 4);
else if (m_nRow < pModDoc->GetPatternSize(m_nPattern) - 1) SetCurrentRow(pModDoc->GetPatternSize(m_nPattern) - 1);
return wParam;
case kcEndVerticalSelect:
case kcEndVertical: if (m_nRow < pModDoc->GetPatternSize(m_nPattern) - 1) SetCurrentRow(pModDoc->GetPatternSize(m_nPattern) - 1);
- else if (m_dwCursor!=(((pSndFile->m_nChannels-1) << 3) | 4)) SetCurrentColumn(((pSndFile->m_nChannels-1) << 3) | 4);
+ else if (m_dwCursor!=(((pSndFile->GetNumChannels() - 1) << 3) | 4)) SetCurrentColumn(((pSndFile->m_nChannels-1) << 3) | 4);
return wParam;
case kcEndAbsoluteSelect:
- case kcEndAbsolute: SetCurrentColumn(((pSndFile->m_nChannels-1) << 3) | 4); if (m_nRow < pModDoc->GetPatternSize(m_nPattern) - 1) SetCurrentRow(pModDoc->GetPatternSize(m_nPattern) - 1); return wParam;
+ case kcEndAbsolute: SetCurrentColumn(((pSndFile->GetNumChannels() - 1) << 3) | 4); if (m_nRow < pModDoc->GetPatternSize(m_nPattern) - 1) SetCurrentRow(pModDoc->GetPatternSize(m_nPattern) - 1); return wParam;
case kcNextPattern: { UINT n = m_nPattern + 1;
while ((n < pSndFile->Patterns.Size()) && (!pSndFile->Patterns[n])) n++;
@@ -3753,14 +3748,14 @@
return wParam; }
case kcSelectWithCopySelect:
case kcSelectWithNav:
- case kcSelect: if (!(m_dwStatus & (PATSTATUS_DRAGNDROPEDIT|PATSTATUS_SELECTROW))) m_dwStartSel = (m_nRow << 16) | m_dwCursor;
+ case kcSelect: if (!(m_dwStatus & (PATSTATUS_DRAGNDROPEDIT|PATSTATUS_SELECTROW))) m_dwStartSel = CreateCursor(m_nRow) | m_dwCursor;
m_dwStatus |= PATSTATUS_KEYDRAGSEL; return wParam;
case kcSelectOffWithCopySelect:
case kcSelectOffWithNav:
case kcSelectOff: m_dwStatus &= ~PATSTATUS_KEYDRAGSEL; return wParam;
case kcCopySelectWithSelect:
case kcCopySelectWithNav:
- case kcCopySelect: if (!(m_dwStatus & (PATSTATUS_DRAGNDROPEDIT|PATSTATUS_SELECTROW))) m_dwStartSel = (m_nRow << 16) | m_dwCursor;
+ case kcCopySelect: if (!(m_dwStatus & (PATSTATUS_DRAGNDROPEDIT|PATSTATUS_SELECTROW))) m_dwStartSel = CreateCursor(m_nRow) | m_dwCursor;
m_dwStatus |= PATSTATUS_CTRLDRAGSEL; return wParam;
case kcCopySelectOffWithSelect:
case kcCopySelectOffWithNav:
@@ -3777,15 +3772,15 @@
case kcClearFieldStep: OnClearField(GetColTypeFromCursor(m_dwCursor), true); return wParam;
case kcClearFieldStepITStyle: OnClearField(GetColTypeFromCursor(m_dwCursor), true, true); return wParam;
case kcDeleteRows: OnDeleteRows(); return wParam;
- case kcDeleteAllRows: DeleteRows(0, pSndFile->m_nChannels-1,1); return wParam;
+ case kcDeleteAllRows: DeleteRows(0, pSndFile->GetNumChannels() - 1, 1); return wParam;
case kcInsertRow: OnInsertRows(); return wParam;
- case kcInsertAllRows: InsertRows(0, pSndFile->m_nChannels-1); return wParam;
+ case kcInsertAllRows: InsertRows(0, pSndFile->GetNumChannels() - 1); return wParam;
case kcShowNoteProperties: ShowEditWindow(); return wParam;
case kcShowPatternProperties: OnPatternProperties(); return wParam;
case kcShowMacroConfig: SendCtrlMessage(CTRLMSG_SETUPMACROS); return wParam;
case kcShowSplitKeyboardSettings: SetSplitKeyboardSettings(); return wParam;
- case kcShowEditMenu: {CPoint pt = GetPointFromPosition((m_nRow << 16) | m_dwCursor);
+ case kcShowEditMenu: {CPoint pt = GetPointFromPosition(CreateCursor(m_nRow) | m_dwCursor);
OnRButtonDown(0, pt); }
return wParam;
case kcPatternGoto: OnEditGoto(); return wParam;
@@ -3807,7 +3802,7 @@
case kcCopyAndLoseSelection:
{
OnEditCopy();
- int sel = m_dwCursor | (m_nRow << 16);
+ int sel = CreateCursor(m_nRow) | m_dwCursor;
SetCurSel(sel, sel);
return wParam;
}
@@ -3971,7 +3966,7 @@
if (IsEditingEnabled_bmsg())
{
- DWORD sel = (m_nRow << 16) | m_dwCursor;
+ DWORD sel = CreateCursor(m_nRow) | m_dwCursor;
SetCurSel(sel, sel);
sel &= ~7;
if(oldcmd != *p)
@@ -4046,7 +4041,7 @@
}
}
- DWORD sel = (m_nRow << 16) | m_dwCursor;
+ DWORD sel = CreateCursor(m_nRow) | m_dwCursor;
SetCurSel(sel, sel);
sel &= ~7;
if(oldcmd != *p)
@@ -4093,7 +4088,7 @@
}
}
- DWORD sel = (m_nRow << 16) | m_dwCursor;
+ DWORD sel = CreateCursor(m_nRow) | m_dwCursor;
SetCurSel(sel, sel);
sel &= ~7;
if(*p != oldcmd)
@@ -4232,7 +4227,7 @@
// Update only if not recording live.
if(bIsLiveRecord == false)
{
- DWORD sel = (nRow << 16) | (nChn << 3);
+ DWORD sel = CreateCursor(nRow, nChn, 0);
InvalidateArea(sel, sel + LAST_COLUMN);
UpdateIndicator();
}
@@ -4307,7 +4302,7 @@
if (IsEditingEnabled_bmsg())
{
- DWORD sel = (m_nRow << 16) | m_dwCursor;
+ DWORD sel = CreateCursor(m_nRow) | m_dwCursor;
SetCurSel(sel, sel);
sel &= ~7;
if(*p != oldcmd)
@@ -4369,7 +4364,7 @@
{
pModDoc->GetPatternUndo()->PrepareUndo(m_nPattern, nChn, nRow, 1, 1);
pSndFile->Patterns[m_nPattern].GetpModCommand(nRow, nChn)->note = note;
- const DWORD sel = (nRow << 16) | m_dwCursor;
+ const DWORD sel = CreateCursor(nRow) | m_dwCursor;
pModDoc->SetModified();
InvalidateArea(sel, sel + LAST_COLUMN);
UpdateIndicator();
@@ -4508,7 +4503,7 @@
// -- if recording, handle post note entry behaviour (move cursor etc..)
if(bRecordEnabled)
{
- DWORD sel = (nRow << 16) | m_dwCursor;
+ DWORD sel = CreateCursor(nRow) | m_dwCursor;
if(bIsLiveRecord == false)
{ // Update only when not recording live.
SetCurSel(sel, sel);
@@ -4540,7 +4535,7 @@
} // we must remember to not step back should the next note form a chord.
}
- DWORD sel = m_dwCursor | (m_nRow << 16);
+ DWORD sel = CreateCursor(m_nRow) | m_dwCursor;
SetCurSel(sel, sel);
}
@@ -4679,9 +4674,9 @@
// -- write notedata
if(bRecordEnabled)
{
- DWORD sel = (m_nRow << 16) | m_dwCursor;
+ DWORD sel = CreateCursor(m_nRow) | m_dwCursor;
SetCurSel(sel, sel);
- sel &= ~7;
+ sel = GetRowFromCursor(sel) | GetChanFromCursor(sel);
if(modified)
{
for(CHANNELINDEX n = 0; n < pSndFile->GetNumChannels(); n++)
@@ -4750,7 +4745,7 @@
{
if ((m_nSpacing > 0) && (m_nSpacing <= MAX_SPACING))
SetCurrentRow(m_nRow + m_nSpacing);
- DWORD sel = m_dwCursor | (m_nRow << 16);
+ DWORD sel = CreateCursor(m_nRow) | m_dwCursor;
SetCurSel(sel, sel);
}
@@ -4793,9 +4788,9 @@
if(IsEditingEnabled_bmsg())
{
- DWORD sel = (m_nRow << 16) | m_dwCursor;
+ DWORD sel = CreateCursor(m_nRow) | m_dwCursor;
SetCurSel(sel, sel);
- sel &= ~7;
+ sel = GetRowFromCursor(sel) | GetChanFromCursor(sel);
if(*p != oldcmd)
{
pModDoc->SetModified();
@@ -4807,7 +4802,7 @@
{
if ((m_nSpacing > 0) && (m_nSpacing <= MAX_SPACING))
SetCurrentRow(m_nRow+m_nSpacing);
- DWORD sel = m_dwCursor | (m_nRow << 16);
+ DWORD sel = CreateCursor(m_nRow) | m_dwCursor;
SetCurSel(sel, sel);
}
} else
@@ -5733,31 +5728,33 @@
// Snap to end of beat / measure of lower-right corner of current selection
const ROWINDEX endRow = GetSelectionEndRow() + adjust - (GetSelectionEndRow() % adjust) - 1;
- DWORD startMask = (GetSelectionStartChan() << 3), endMask = (GetSelectionEndChan() << 3);
+ CHANNELINDEX startChannel = GetSelectionStartChan(), endChannel = GetSelectionEndChan();
+ UINT startColumn = 0, endColumn = 0;
if(m_dwBeginSel == m_dwEndSel)
{
// No selection has been made yet => expand selection to whole channel.
- endMask |= LAST_COLUMN; // Extend to param column;
+ endColumn = LAST_COLUMN; // Extend to param column
} else if(startRow == GetSelectionStartRow() && endRow == GetSelectionEndRow())
{
// Whole beat or measure is already selected
if(GetColTypeFromCursor(m_dwBeginSel) == NOTE_COLUMN && GetColTypeFromCursor(m_dwEndSel) == LAST_COLUMN)
{
// Whole channel is already selected => expand selection to whole row.
- startMask = 0;
- endMask = 0xFFFF;
+ startChannel = startColumn = 0;
+ endChannel = MAX_BASECHANNELS;
+ endColumn = LAST_COLUMN;
} else
{
// Channel is only partly selected => expand to whole channel first.
- endMask |= LAST_COLUMN; // Extend to param column;
+ endColumn = LAST_COLUMN; // Extend to param column
}
}
else
{
// Some arbitrary selection: Remember start / end column
- startMask |= GetColTypeFromCursor(m_dwBeginSel);
- endMask |= GetColTypeFromCursor(m_dwEndSel);
+ startColumn = GetColTypeFromCursor(m_dwBeginSel);
+ endColumn = GetColTypeFromCursor(m_dwEndSel);
}
- SetCurSel((startRow << 16) | startMask, (endRow << 16) | endMask);
+ SetCurSel(CreateCursor(startRow, startChannel, startColumn), CreateCursor(endRow, endChannel, endColumn));
}
Modified: trunk/OpenMPT/mptrack/View_pat.h
===================================================================
--- trunk/OpenMPT/mptrack/View_pat.h 2011-05-08 19:43:27 UTC (rev 866)
+++ trunk/OpenMPT/mptrack/View_pat.h 2011-05-08 20:24:49 UTC (rev 867)
@@ -375,6 +375,7 @@
static ROWINDEX GetRowFromCursor(DWORD cursor) { return (cursor >> 16); };
static CHANNELINDEX GetChanFromCursor(DWORD cursor) { return static_cast<CHANNELINDEX>((cursor & 0xFFFF) >> 3); };
static UINT GetColTypeFromCursor(DWORD cursor) { return (cursor & 0x07); };
+ static DWORD CreateCursor(ROWINDEX row, CHANNELINDEX channel = 0, UINT column = 0) { return (row << 16) | ((channel << 3) & 0x1FFF) | (column & 0x07); };
bool IsInterpolationPossible(ROWINDEX startRow, ROWINDEX endRow, CHANNELINDEX chan, PatternColumns colType, CSoundFile* pSndFile);
void Interpolate(PatternColumns type);
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <sag...@us...> - 2011-05-08 19:43:33
|
Revision: 866
http://modplug.svn.sourceforge.net/modplug/?rev=866&view=rev
Author: saga-games
Date: 2011-05-08 19:43:27 +0000 (Sun, 08 May 2011)
Log Message:
-----------
Added helpful documents to repo
Added Paths:
-----------
trunk/OpenMPT/README
trunk/OpenMPT/TODO
Added: trunk/OpenMPT/README
===================================================================
--- trunk/OpenMPT/README (rev 0)
+++ trunk/OpenMPT/README 2011-05-08 19:43:27 UTC (rev 866)
@@ -0,0 +1,42 @@
+How to compile the code:
+
+- Visual Studio 2003/2005/2008/2010 is required. Express versions won't work as
+ they don't include MFC.
+- The VST 2.4 and ASIO SDKs are needed for compiling with VST and ASIO support.
+ If you don't want this, uncomment #define NO_VST and #define NO_ASIO in the
+ file StdAfx.h. If you need further help with the VST and ASIO SDKs, get in
+ touch with the main developers.
+- You need the DirectX SDK to enable DirectSound output. If you don't want this,
+ uncomment #define NO_DSOUND in the file StdAfx.h.
+
+
+
+Coding conventions (see below for an example):
+
+* Functions / methods are "underlined".
+* Place curly braces at the beginning of the line, not at the end
+* Generally make use of the custom index types like SAMPLEINDEX or ORDERINDEX
+ when referring to samples, orders, etc.
+* When changing playback behaviour, make sure that you use the function
+* CSoundFile::IsCompatibleMode() so that modules made with previous versions of
+ MPT still sound correct (if the change is extremely small, this might be
+ unnecessary)
+* When checking the module type, use something like
+ if(GetType() & MOD_TYPE_XXX)
+ instead of
+ if(GetType() == MOD_TYPE_XXX)
+ as it could be theoretically possible that two mod types are set (currently
+ this doesn't happen, but in the future this might actually be used as a code
+ feature :)
+
+Code example:
+
+void foo::bar(int foobar)
+//-----------------------
+{
+ while(true)
+ {
+ // some code
+ }
+}
+
Added: trunk/OpenMPT/TODO
===================================================================
--- trunk/OpenMPT/TODO (rev 0)
+++ trunk/OpenMPT/TODO 2011-05-08 19:43:27 UTC (rev 866)
@@ -0,0 +1,17 @@
+Of course there is still something that can be improved in OpenMPT, but there
+are some things which definitely should be done at some point. Those include:
+
+* Getting rid of the buggy MFC code. Instead use something like Qt.
+* While we're at it, make OpenMPT cross-platform. :)
+* Developement of a proper MPTM format. Currently, it's just based on the
+ Impulse Tracker format and new features are hacked on at the end of the file.
+ Not very nice!
+* Better VST support. Currently, many great VST 2.4 features like busses are not
+ supported.
+
+
+Some things that could also be implemented:
+
+* Resizable channels with multiple effect columns. This might not be trivial at
+ all, especially when dealing with effects which could interfer with each other
+ (f.e. porta up in one column, porta down in another).
\ No newline at end of file
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <sag...@us...> - 2011-05-04 20:18:46
|
Revision: 865
http://modplug.svn.sourceforge.net/modplug/?rev=865&view=rev
Author: saga-games
Date: 2011-05-04 20:18:40 +0000 (Wed, 04 May 2011)
Log Message:
-----------
[Mod] Song Creation: If the user's default MIDI macro configuration is the standard configuration, it is not embedded by default anymore.
[Fix] The first played note in the pattern / sample editor is not cut off anymore (tx C-jeff, http://bugs.openmpt.org/view.php?id=123)
Modified Paths:
--------------
trunk/OpenMPT/mptrack/Moddoc.cpp
trunk/OpenMPT/mptrack/version.h
Modified: trunk/OpenMPT/mptrack/Moddoc.cpp
===================================================================
--- trunk/OpenMPT/mptrack/Moddoc.cpp 2011-05-03 22:36:08 UTC (rev 864)
+++ trunk/OpenMPT/mptrack/Moddoc.cpp 2011-05-04 20:18:40 UTC (rev 865)
@@ -154,13 +154,19 @@
m_SndFile.Create(NULL, this, 0);
m_SndFile.ChangeModTypeTo(CTrackApp::GetDefaultDocType());
- if(CTrackApp::IsProject()) {
+ if(CTrackApp::IsProject())
+ {
m_SndFile.m_dwSongFlags |= SONG_ITPROJECT;
}
- if (m_SndFile.m_nType & (MOD_TYPE_XM | MOD_TYPE_IT | MOD_TYPE_MPT)) {
+ theApp.GetDefaultMidiMacro(&m_SndFile.m_MidiCfg);
+ if (m_SndFile.m_nType & (MOD_TYPE_XM | MOD_TYPE_IT | MOD_TYPE_MPT))
+ {
m_SndFile.m_dwSongFlags |= SONG_LINEARSLIDES;
- m_SndFile.m_dwSongFlags |= SONG_EMBEDMIDICFG;
+ if(!IsMacroDefaultSetupUsed())
+ {
+ m_SndFile.m_dwSongFlags |= SONG_EMBEDMIDICFG;
+ }
}
@@ -170,7 +176,6 @@
// ...and the order length
m_SndFile.Order.resize(min(ModSequenceSet::s_nCacheSize, m_SndFile.GetModSpecifications().ordersMax));
- theApp.GetDefaultMidiMacro(&m_SndFile.m_MidiCfg);
ReinitRecordState();
InitializeMod();
SetModifiedFlag(FALSE);
@@ -849,6 +854,7 @@
if (nVol > 256) nVol = 256;
if (note <= NOTE_MAX)
{
+
BEGIN_CRITICAL();
//kill notes if required.
@@ -865,6 +871,17 @@
}
}
+ END_CRITICAL();
+
+ if (pMainFrm->GetModPlaying() != this)
+ {
+ m_SndFile.m_dwSongFlags |= SONG_PAUSED;
+ pMainFrm->PlayMod(this, m_hWndFollow, m_dwNotifyType);
+ }
+ CMainFrame::EnableLowLatencyMode();
+
+ BEGIN_CRITICAL();
+
//find a channel if required
//if (nCurrentChn<0) {
nChn = FindAvailableChannel();
@@ -986,12 +1003,6 @@
END_CRITICAL();
- if (pMainFrm->GetModPlaying() != this)
- {
- m_SndFile.m_dwSongFlags |= SONG_PAUSED;
- pMainFrm->PlayMod(this, m_hWndFollow, m_dwNotifyType);
- }
- CMainFrame::EnableLowLatencyMode();
} else
{
BEGIN_CRITICAL();
@@ -3171,6 +3182,7 @@
enmParameteredMacroType CModDoc::GetMacroType(CString value)
//----------------------------------------------------------
{
+ value.Remove(' ');
if (value.Compare("")==0) return sfx_unused;
if (value.Compare("F0F000z")==0) return sfx_cutoff;
if (value.Compare("F0F001z")==0) return sfx_reso;
@@ -3186,6 +3198,7 @@
int CModDoc::MacroToPlugParam(CString macro)
//------------------------------------------
{
+ macro.Remove(' ');
int code=0;
char* param = (char *) (LPCTSTR) macro;
param += 4;
@@ -3204,6 +3217,7 @@
int CModDoc::MacroToMidiCC(CString macro)
//---------------------------------------
{
+ macro.Remove(' ');
int code=0;
char* param = (char *) (LPCTSTR) macro;
param += 2;
Modified: trunk/OpenMPT/mptrack/version.h
===================================================================
--- trunk/OpenMPT/mptrack/version.h 2011-05-03 22:36:08 UTC (rev 864)
+++ trunk/OpenMPT/mptrack/version.h 2011-05-04 20:18:40 UTC (rev 865)
@@ -15,7 +15,7 @@
#define VER_MAJORMAJOR 1
#define VER_MAJOR 19
#define VER_MINOR 01
-#define VER_MINORMINOR 05
+#define VER_MINORMINOR 06
//Creates version number from version parts that appears in version string.
//For example MAKE_VERSION_NUMERIC(1,17,02,28) gives version number of
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <sag...@us...> - 2011-05-03 22:36:15
|
Revision: 864
http://modplug.svn.sourceforge.net/modplug/?rev=864&view=rev
Author: saga-games
Date: 2011-05-03 22:36:08 +0000 (Tue, 03 May 2011)
Log Message:
-----------
[Imp] MOD Saving: Instead of cutting the order list after the first +++ or --- pattern, such order items are simply removed from the saved order list.
Modified Paths:
--------------
trunk/OpenMPT/soundlib/Load_mod.cpp
Modified: trunk/OpenMPT/soundlib/Load_mod.cpp
===================================================================
--- trunk/OpenMPT/soundlib/Load_mod.cpp 2011-05-02 22:05:59 UTC (rev 863)
+++ trunk/OpenMPT/soundlib/Load_mod.cpp 2011-05-03 22:36:08 UTC (rev 864)
@@ -385,7 +385,7 @@
if(bFLT8)
{
- // FLT8 has only equal order items, so divide by two.
+ // FLT8 has only even order items, so divide by two.
for(ORDERINDEX nOrd = 0; nOrd < Order.GetLength(); nOrd++)
Order[nOrd] >>= 1;
}
@@ -564,11 +564,11 @@
if ((!m_nChannels) || (!lpszFileName)) return false;
if ((f = fopen(lpszFileName, "wb")) == NULL) return false;
- memset(ord, 0, sizeof(ord));
- memset(inslen, 0, sizeof(inslen));
+ MemsetZero(ord);
+ MemsetZero(inslen);
if (m_nInstruments)
{
- memset(insmap, 0, sizeof(insmap));
+ MemsetZero(insmap);
for (UINT i=1; i<32; i++) if (Instruments[i])
{
for (UINT j=0; j<128; j++) if (Instruments[i]->Keyboard[j])
@@ -614,22 +614,19 @@
fwrite(bTab, 30, 1, f);
}
// Writing number of patterns
- UINT nbp = 0, norders = 128;
- for (UINT iord=0; iord<128; iord++)
+ UINT nbp = 0, norders = 0;
+ for (UINT iord = 0; iord < 128; iord++)
{
- if (Order[iord] == Order.GetInvalidPatIndex() || Order[iord] == Order.GetIgnoreIndex())
+ // Ignore +++ and --- patterns in order list, as well as high patterns (MOD officially only supports up to 128 patterns)
+ if (Order[iord] < 0x80)
{
- norders = iord;
- break;
+ if (nbp <= Order[iord]) nbp = Order[iord] + 1;
+ ord[norders++] = Order[iord];
}
- if ((Order[iord] < 0x80) && (nbp <= Order[iord])) nbp = Order[iord] + 1;
}
bTab[0] = norders;
bTab[1] = m_nRestartPos;
fwrite(bTab, 2, 1, f);
- // Writing pattern list
- if (norders) Order.WriteToByteArray(ord, norders, 128);
-
fwrite(ord, 128, 1, f);
// Writing signature
if (m_nChannels == 4)
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <sag...@us...> - 2011-05-02 22:06:06
|
Revision: 863
http://modplug.svn.sourceforge.net/modplug/?rev=863&view=rev
Author: saga-games
Date: 2011-05-02 22:05:59 +0000 (Mon, 02 May 2011)
Log Message:
-----------
[Mod] GUID can now be sent on update check (currently unused on the server side). This also introduces a change in the update URL format.
Modified Paths:
--------------
trunk/OpenMPT/mptrack/MainFrm.cpp
trunk/OpenMPT/mptrack/UpdateCheck.cpp
trunk/OpenMPT/mptrack/UpdateCheck.h
trunk/OpenMPT/mptrack/mptrack.rc
trunk/OpenMPT/mptrack/version.h
Modified: trunk/OpenMPT/mptrack/MainFrm.cpp
===================================================================
--- trunk/OpenMPT/mptrack/MainFrm.cpp 2011-05-02 21:13:34 UTC (rev 862)
+++ trunk/OpenMPT/mptrack/MainFrm.cpp 2011-05-02 22:05:59 UTC (rev 863)
@@ -387,6 +387,17 @@
vIniVersion = MptVersion::ToNum(gcsPreviousVersion);
gcsInstallGUID = GetPrivateProfileCString("Version", "InstallGUID", "", iniFile);
+ if(gcsInstallGUID == "")
+ {
+ //No GUID found in INI file - generate one.
+ GUID guid;
+ CoCreateGuid(&guid);
+ BYTE* Str;
+ UuidToString((UUID*)&guid, &Str);
+ gcsInstallGUID.Format("%s", (LPTSTR)Str);
+ RpcStringFree(&Str);
+ }
+
gbMdiMaximize = GetPrivateProfileLong("Display", "MDIMaximize", true, iniFile);
glTreeWindowWidth = GetPrivateProfileLong("Display", "MDITreeWidth", 160, iniFile);
glTreeSplitRatio = GetPrivateProfileLong("Display", "MDITreeRatio", 128, iniFile);
@@ -421,6 +432,7 @@
outTime,
GetPrivateProfileInt("Update", "UpdateCheckPeriod", CUpdateCheck::GetUpdateCheckPeriod(), iniFile),
GetPrivateProfileCString("Update", "UpdateURL", CUpdateCheck::GetUpdateURL(), iniFile),
+ GetPrivateProfileInt("Update", "SendGUID", CUpdateCheck::GetSendGUID() ? 1 : 0, iniFile) ? true : false,
GetPrivateProfileInt("Update", "ShowUpdateHint", CUpdateCheck::GetShowUpdateHint() ? 1 : 0, iniFile) ? true : false
);
}
@@ -435,7 +447,7 @@
#ifndef NO_DSOUND
DWORD defaultDevice = SNDDEV_BUILD_ID(0, SNDDEV_DSOUND); // first DirectSound device
#else
- DWORD defaultDevice = SNDDEV_BUILD_ID(0, SNDDEV_WAVEOUT); // first DirectSound device
+ DWORD defaultDevice = SNDDEV_BUILD_ID(0, SNDDEV_WAVEOUT); // first WaveOut device
#endif // NO_DSOUND
#ifndef NO_ASIO
// If there's an ASIO device available, prefer it over DirectSound
@@ -1026,6 +1038,7 @@
WritePrivateProfileString("Update", "LastUpdateCheck", outDate, iniFile);
WritePrivateProfileLong("Update", "UpdateCheckPeriod", CUpdateCheck::GetUpdateCheckPeriod(), iniFile);
WritePrivateProfileString("Update", "UpdateURL", CUpdateCheck::GetUpdateURL(), iniFile);
+ WritePrivateProfileLong("Update", "SendGUID", CUpdateCheck::GetSendGUID() ? 1 : 0, iniFile);
WritePrivateProfileLong("Update", "ShowUpdateHint", CUpdateCheck::GetShowUpdateHint() ? 1 : 0, iniFile);
}
Modified: trunk/OpenMPT/mptrack/UpdateCheck.cpp
===================================================================
--- trunk/OpenMPT/mptrack/UpdateCheck.cpp 2011-05-02 21:13:34 UTC (rev 862)
+++ trunk/OpenMPT/mptrack/UpdateCheck.cpp 2011-05-02 22:05:59 UTC (rev 863)
@@ -17,12 +17,13 @@
#endif
-const CString CUpdateCheck::defaultUpdateURL = "http://update.openmpt.org/check/%s";
+const CString CUpdateCheck::defaultUpdateURL = "http://update.openmpt.org/check/$VERSION/$GUID";
// Static configuration variables
time_t CUpdateCheck::lastUpdateCheck = 0;
int CUpdateCheck::updateCheckPeriod = 7;
CString CUpdateCheck::updateBaseURL = CUpdateCheck::defaultUpdateURL;
+bool CUpdateCheck::sendGUID = true;
bool CUpdateCheck::showUpdateHint = true;
@@ -93,21 +94,12 @@
}
CUpdateCheck::showUpdateHint = false;
+ // Prepare UA / URL strings...
const CString userAgent = CString("OpenMPT ") + MptVersion::str;
- CString updateURL;
- updateURL.Format(CUpdateCheck::updateBaseURL, MptVersion::str);
+ CString updateURL = CUpdateCheck::updateBaseURL;
+ updateURL.Replace("$VERSION", MptVersion::str);
+ updateURL.Replace("$GUID", GetSendGUID() ? CMainFrame::gcsInstallGUID : "anonymous");
- /*if (CMainFrame::gcsInstallGUID == "")
- {
- //No GUID found in INI file - generate one.
- GUID guid;
- CoCreateGuid(&guid);
- BYTE* Str;
- UuidToString((UUID*)&guid, &Str);
- CMainFrame::gcsInstallGUID.Format("%s", (LPTSTR)Str);
- RpcStringFree(&Str);
- }*/
-
// Establish a connection.
caller->internetHandle = InternetOpen(userAgent, INTERNET_OPEN_TYPE_PRECONFIG, NULL, NULL, 0);
if(caller->internetHandle == NULL)
@@ -278,6 +270,7 @@
ON_COMMAND(IDC_RADIO2, OnSettingsChanged)
ON_COMMAND(IDC_RADIO3, OnSettingsChanged)
ON_COMMAND(IDC_RADIO4, OnSettingsChanged)
+ ON_COMMAND(IDC_CHECK1, OnSettingsChanged)
ON_EN_CHANGE(IDC_EDIT1, OnSettingsChanged)
END_MESSAGE_MAP()
@@ -296,6 +289,7 @@
case 31: radioID = IDC_RADIO4; break;
}
CheckRadioButton(IDC_RADIO1, IDC_RADIO4, radioID);
+ CheckDlgButton(IDC_CHECK1, CUpdateCheck::GetSendGUID() ? MF_CHECKED : MF_UNCHECKED);
SetDlgItemText(IDC_EDIT1, CUpdateCheck::GetUpdateURL());
const time_t t = CUpdateCheck::GetLastUpdateCheck();
@@ -325,7 +319,7 @@
CString updateURL;
GetDlgItemText(IDC_EDIT1, updateURL);
- CUpdateCheck::SetUpdateSettings(CUpdateCheck::GetLastUpdateCheck(), updateCheckPeriod, updateURL, CUpdateCheck::GetShowUpdateHint());
+ CUpdateCheck::SetUpdateSettings(CUpdateCheck::GetLastUpdateCheck(), updateCheckPeriod, updateURL, IsDlgButtonChecked(IDC_CHECK1) ? true : false, CUpdateCheck::GetShowUpdateHint());
CPropertyPage::OnOK();
}
Modified: trunk/OpenMPT/mptrack/UpdateCheck.h
===================================================================
--- trunk/OpenMPT/mptrack/UpdateCheck.h 2011-05-02 21:13:34 UTC (rev 862)
+++ trunk/OpenMPT/mptrack/UpdateCheck.h 2011-05-02 22:05:59 UTC (rev 863)
@@ -36,9 +36,10 @@
static time_t GetLastUpdateCheck() { return lastUpdateCheck; };
static int GetUpdateCheckPeriod() { return updateCheckPeriod; };
static CString GetUpdateURL() { return updateBaseURL; };
+ static bool GetSendGUID() { return sendGUID; }
static bool GetShowUpdateHint() { return showUpdateHint; };
- static void SetUpdateSettings(time_t last, int period, CString url, bool showHint)
- { lastUpdateCheck = last; updateCheckPeriod = period; updateBaseURL = url; showUpdateHint = showHint; };
+ static void SetUpdateSettings(time_t last, int period, CString url, bool sendID, bool showHint)
+ { lastUpdateCheck = last; updateCheckPeriod = period; updateBaseURL = url; sendGUID = sendID; showUpdateHint = showHint; };
protected:
@@ -46,6 +47,7 @@
static time_t lastUpdateCheck; // Time of last successful update check
static int updateCheckPeriod; // Check for updates every x days
static CString updateBaseURL; // URL where the version check should be made.
+ static bool sendGUID; // Send GUID to collect basic stats
static bool showUpdateHint; // Show hint on first automatic update
bool isAutoUpdate; // Are we running an automatic update check?
Modified: trunk/OpenMPT/mptrack/mptrack.rc
===================================================================
--- trunk/OpenMPT/mptrack/mptrack.rc 2011-05-02 21:13:34 UTC (rev 862)
+++ trunk/OpenMPT/mptrack/mptrack.rc 2011-05-02 22:05:59 UTC (rev 863)
@@ -196,13 +196,17 @@
CONTROL "Daily",IDC_RADIO2,"Button",BS_AUTORADIOBUTTON,12,30,240,8
CONTROL "Weekly (recommended)",IDC_RADIO3,"Button",BS_AUTORADIOBUTTON,12,42,240,8
CONTROL "Monthly",IDC_RADIO4,"Button",BS_AUTORADIOBUTTON,12,54,240,8
- GROUPBOX "Advanced Settings",IDC_STATIC,6,78,258,60
- LTEXT "Update server URL:",IDC_STATIC,12,90,186,8
- EDITTEXT IDC_EDIT1,12,102,246,12,ES_AUTOHSCROLL
- LTEXT "",IDC_LASTUPDATE,6,168,258,24
- LTEXT "Do not change this unless you are absolutely sure of what you are doing.",IDC_STATIC,12,120,246,12
- PUSHBUTTON "Check for Updates",IDC_BUTTON1,6,144,84,18
- PUSHBUTTON "Reset",IDC_BUTTON2,204,87,54,12
+ GROUPBOX "Privacy Settings",IDC_STATIC,6,78,258,54
+ CONTROL "Allow us to collect basic update statistics",IDC_CHECK1,
+ "Button",BS_AUTOCHECKBOX | WS_TABSTOP,12,90,246,12
+ LTEXT "If enabled, a randomized user ID is created and transmitted with every update check. This ID can not be linked to you or your computer in any way.",IDC_STATIC,12,102,246,24
+ GROUPBOX "Advanced Settings",IDC_STATIC,6,138,258,60
+ LTEXT "Update server URL:",IDC_STATIC,12,150,186,8
+ EDITTEXT IDC_EDIT1,12,162,246,12,ES_AUTOHSCROLL
+ PUSHBUTTON "Reset",IDC_BUTTON2,204,146,54,12
+ LTEXT "Do not change this unless you are absolutely sure of what you are doing.",IDC_STATIC,12,180,246,12
+ PUSHBUTTON "Check for Updates",IDC_BUTTON1,6,204,84,18
+ LTEXT "",IDC_LASTUPDATE,6,228,258,24
END
@@ -1194,7 +1198,7 @@
END
IDD_MIDIMACRO DIALOGEX 0, 0, 358, 354
-STYLE DS_SETFONT | DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU
+STYLE DS_SETFONT | DS_MODALFRAME | DS_FIXEDSYS | WS_POPUP | WS_CAPTION | WS_SYSMENU
EXSTYLE WS_EX_TOOLWINDOW
CAPTION "Zxx Macros Configuration"
FONT 8, "MS Shell Dlg", 0, 0, 0x0
Modified: trunk/OpenMPT/mptrack/version.h
===================================================================
--- trunk/OpenMPT/mptrack/version.h 2011-05-02 21:13:34 UTC (rev 862)
+++ trunk/OpenMPT/mptrack/version.h 2011-05-02 22:05:59 UTC (rev 863)
@@ -15,7 +15,7 @@
#define VER_MAJORMAJOR 1
#define VER_MAJOR 19
#define VER_MINOR 01
-#define VER_MINORMINOR 04
+#define VER_MINORMINOR 05
//Creates version number from version parts that appears in version string.
//For example MAKE_VERSION_NUMERIC(1,17,02,28) gives version number of
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <sag...@us...> - 2011-05-02 21:13:41
|
Revision: 862
http://modplug.svn.sourceforge.net/modplug/?rev=862&view=rev
Author: saga-games
Date: 2011-05-02 21:13:34 +0000 (Mon, 02 May 2011)
Log Message:
-----------
[Fix] Pattern Editor: Dropping a channel header on the plugin buttons below the channels also moved it.
[Imp] IT / S3M Loaders: Clearing the MIDI macros only clears the Zxx part now.
Modified Paths:
--------------
trunk/OpenMPT/mptrack/View_pat.cpp
trunk/OpenMPT/soundlib/Load_it.cpp
trunk/OpenMPT/soundlib/Load_s3m.cpp
Modified: trunk/OpenMPT/mptrack/View_pat.cpp
===================================================================
--- trunk/OpenMPT/mptrack/View_pat.cpp 2011-05-02 17:40:15 UTC (rev 861)
+++ trunk/OpenMPT/mptrack/View_pat.cpp 2011-05-02 21:13:34 UTC (rev 862)
@@ -1184,7 +1184,7 @@
pModDoc->MuteChannel(nItemNo, !pModDoc->IsChannelMuted(nItemNo));
pModDoc->UpdateAllViews(this, HINT_MODCHANNELS | ((nItemNo / CHANNELS_IN_TAB) << HINT_SHIFT_CHNTAB));
}
- } else if(nTargetNo < pModDoc->GetNumChannels())
+ } else if(nTargetNo < pModDoc->GetNumChannels() && (m_nDropItem & DRAGITEM_MASK) == DRAGITEM_CHNHEADER)
{
// Dragged to other channel header => move or copy channel
@@ -5230,7 +5230,7 @@
bool CViewPattern::BuildChannelControlCtxMenu(HMENU hMenu)
-//--------------------------------------------------------------------
+//--------------------------------------------------------
{
AppendMenu(hMenu, MF_SEPARATOR, 0, "");
Modified: trunk/OpenMPT/soundlib/Load_it.cpp
===================================================================
--- trunk/OpenMPT/soundlib/Load_it.cpp 2011-05-02 17:40:15 UTC (rev 861)
+++ trunk/OpenMPT/soundlib/Load_it.cpp 2011-05-02 21:13:34 UTC (rev 862)
@@ -803,7 +803,8 @@
// Ignore MIDI data. Fixes some files like denonde.it that were made with old versions of Impulse Tracker (which didn't support Zxx filters) and have Zxx effects in the patterns.
if (pifh->cwtv < 0x0214)
{
- MemsetZero(m_MidiCfg);
+ MemsetZero(m_MidiCfg.szMidiSFXExt);
+ MemsetZero(m_MidiCfg.szMidiZXXExt);
m_dwSongFlags |= SONG_EMBEDMIDICFG;
}
Modified: trunk/OpenMPT/soundlib/Load_s3m.cpp
===================================================================
--- trunk/OpenMPT/soundlib/Load_s3m.cpp 2011-05-02 17:40:15 UTC (rev 861)
+++ trunk/OpenMPT/soundlib/Load_s3m.cpp 2011-05-02 21:13:34 UTC (rev 862)
@@ -262,8 +262,11 @@
bKeepMidiMacros = true; // simply load Zxx commands
}
- if(!bKeepMidiMacros) // Remove macros so they don't interfere with other tunes
- memset(&m_MidiCfg, 0, sizeof(m_MidiCfg));
+ if(!bKeepMidiMacros) // Remove macros so they don't interfere with tunes made in trackers that don't support Zxx
+ {
+ MemsetZero(m_MidiCfg.szMidiSFXExt);
+ MemsetZero(m_MidiCfg.szMidiZXXExt);
+ }
dwMemPos = 0x60;
m_nType = MOD_TYPE_S3M;
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <sag...@us...> - 2011-05-02 17:40:22
|
Revision: 861
http://modplug.svn.sourceforge.net/modplug/?rev=861&view=rev
Author: saga-games
Date: 2011-05-02 17:40:15 +0000 (Mon, 02 May 2011)
Log Message:
-----------
[Fix] 8SVX Loader: If no sample could be found in the file, the loader does not claim to have successfully loaded a sample anymore.
[Mod] Updated History.txt
Modified Paths:
--------------
trunk/OpenMPT/packageTemplate/History.txt
trunk/OpenMPT/soundlib/Sampleio.cpp
Modified: trunk/OpenMPT/packageTemplate/History.txt
===================================================================
--- trunk/OpenMPT/packageTemplate/History.txt 2011-04-29 21:32:29 UTC (rev 860)
+++ trunk/OpenMPT/packageTemplate/History.txt 2011-05-02 17:40:15 UTC (rev 861)
@@ -10,12 +10,13 @@
(tx XYZ): thanks to XYZ for telling us about the bug / requesting the feature
-v1.19.02.00 (***** 2011, revision 848)
+v1.19.02.00 (***** 2011, revision 861)
--------------------------------------
Pattern tab::Note properties
[New] <Jojo> Channels can now be moved by dragging their channel header. Holding Shift while doing so duplicates the channel
[Imp] <Jojo> Moving channels through the channel manager creates an undo point now.
[Fix] <Jojo> Axx is not limited to value 7F anymore in IT / S3M format.
+ [Fix] <Jojo> Order list info text now truncates list length after the first "---" pattern for MOD files in hex display mode as well.
VST
[New] <Jojo> New menu entry in the plugin editor: Create instrument from plugin
@@ -23,17 +24,28 @@
Mod Conversion
[Imp] <Jojo> Improved conversion of Sxx (IT / S3M) and PC Notes.
+ [Mod] <Jojo> When converting from MOD/S3M to XM/IT, compatible play is automatically enabled.
[Fix] <Jojo> Sustain loop conversion didn't work
IT
[Fix] <Jojo> Panning slides with both parameter nibbles set were not ignored in compatible mode.
-Other modules
+XM
+ [Fix] <Jojo> When using compatibility export, the number of samples per instrument is now limited to 16.
+
+MOD
+ [Fix] <Jojo> "+++" separator patterns were allowed in MOD files, which made them break in other trackers / players (tx 404notfound)
+
+
+Other formats
[Imp] <Jojo> DMF Loader was rewritten completely and is a whole lot more accurate now.
[Fix] <Jojo> J2B Loader: Empty sample slots are now treated correct in new J2B (AM) files.
+ [Fix] <Jojo> DBM Loader: Global volume was scaled wrong.
+ [Fix] <Jojo> 8SVX Loader: If no sample could be found in the file, the loader does not claim to have successfully loaded a sample anymore.
Misc
[New] <Jojo> OpenMPT can now automatically check for updates (daily / weekly / monthly)
+ [Fix] <Jojo> When using "Convert instruments to samples" in the Song Cleanup dialog, "Remove samples associated with an instrument" actually destroyed all samples.
[Reg] <Jojo> Removed hidden INI flag to suppress warnings when encountering keymaps with unknown items. This option was introduced when faulty keymaps threw multiple message boxes, but now it's just one and it shouldn't be ignored...
v1.19.01.00 (April 2011, revision 836)
@@ -166,7 +178,7 @@
[Fix] <Jojo> Pattern breaks >= C40 are now ignored.
[Fix] <Jojo> Global volume commands > V40 are now ignored.
-Other modules
+Other formats
[Imp] <Jojo> Garbage characters in sample / instrument / song names should be gone now.. This should f.e. avoid sample names like " ntitled" turning up in modules after deleting sample names.
[Imp] <Jojo> Improved handling of the note cut effect in PTM (Polytracker) files a bit.
[Mod] <Jojo> Improved portamento import precision for DBM and ULT loaders (patch from Schism Tracker)
@@ -277,7 +289,7 @@
[Fix] <Jojo> Samples with very short loops (4 bytes) are now loaded properly. Fixes "a tiny problem.s3m" by \slash.
[Fix] <Jojo> Notes with an SD0 effect were not ignored properly when there was a row delay effect on the same row. Now they should be ignored in any case.
-Other modules
+Other formats
[Imp] <Jojo> Song messages are now loaded with more accuracy for some formats.
[Imp] <Jojo> J2B Loader: Files with extended instrument settings and multiple samples per instrument work properly now. Such J2B files were not used in the game but have been created by JJ2 players using MOD2J2B.
[Imp] <Jojo> OKT Loader: Completely new IFF-based loader, translated from SchismTracker code with permission from Storlek. This loader is a *lot* more accurate, but still misses a few pattern effects.
@@ -447,7 +459,7 @@
[New] <Jojo> MPTM command S7D explicitly enforces pitch envelope, S7E enforces filter envelope.
[Fix] <Jojo> MPTM Saving: A missing null pointer check crashed OpenMPT when trying to access a deleted instrument slot.
-Other modules
+Other formats
[Imp] <Jojo> MT2 Loader (MadTracker): Make use of the "lines per beat" header field. 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 much because MT2 support was already 100% broken before this. :) Some MT example tunes sound a bit better now at least.
[Fix] <Jojo> PTM Loader: Fixed an unhandled null pointer exception that occured when loading some unsupported RAR files.
[Fix] <Jojo> PSM16 Loader: Fix for note cut on tick 0 (warbot tune from Silverball)
Modified: trunk/OpenMPT/soundlib/Sampleio.cpp
===================================================================
--- trunk/OpenMPT/soundlib/Sampleio.cpp 2011-04-29 21:32:29 UTC (rev 860)
+++ trunk/OpenMPT/soundlib/Sampleio.cpp 2011-05-02 17:40:15 UTC (rev 861)
@@ -2138,14 +2138,15 @@
DWORD dwChunkId = *((LPDWORD)(lpMemFile+dwMemPos));
DWORD dwChunkLen = BigEndian(*((LPDWORD)(lpMemFile+dwMemPos+4)));
LPBYTE pChunkData = (LPBYTE)(lpMemFile+dwMemPos+8);
- if (dwChunkLen > dwFileLength - dwMemPos) break;
+ // Hack for broken files: Trim claimed length if it's too long
+ dwChunkLen = min(dwChunkLen, dwFileLength - dwMemPos);
+ //if (dwChunkLen > dwFileLength - dwMemPos) break;
switch(dwChunkId)
{
case IFFID_NAME:
{
- UINT len = dwChunkLen;
- if (len > 31) len = 31;
- memset(m_szNames[nSample], 0, 32);
+ const UINT len = min(dwChunkLen, MAX_SAMPLENAME - 1);
+ MemsetZero(m_szNames[nSample]);
memcpy(m_szNames[nSample], pChunkData, len);
}
break;
@@ -2165,6 +2166,6 @@
}
dwMemPos += dwChunkLen + 8;
}
- return true;
+ return (pSmp->pSample != nullptr);
}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <sag...@us...> - 2011-04-29 21:32:36
|
Revision: 860
http://modplug.svn.sourceforge.net/modplug/?rev=860&view=rev
Author: saga-games
Date: 2011-04-29 21:32:29 +0000 (Fri, 29 Apr 2011)
Log Message:
-----------
[Fix] Orderlist info text truncates order list length after first "---" pattern for MOD files in hex display mode as well.
[Fix] "+++" separator patterns were allowed in MOD files, which made them break in other trackers / players.
[Fix] MIDI Macros are now sanitized when being loaded from files (malicious macros didn't seem to result in crashes, but let's be safe here)
[Ref] Some more refactoring
Modified Paths:
--------------
trunk/OpenMPT/mptrack/Ctrl_seq.cpp
trunk/OpenMPT/mptrack/Draw_pat.cpp
trunk/OpenMPT/mptrack/Moddoc.cpp
trunk/OpenMPT/mptrack/View_pat.cpp
trunk/OpenMPT/mptrack/View_pat.h
trunk/OpenMPT/soundlib/Load_it.cpp
trunk/OpenMPT/soundlib/Load_itp.cpp
trunk/OpenMPT/soundlib/Load_mod.cpp
trunk/OpenMPT/soundlib/Load_xm.cpp
trunk/OpenMPT/soundlib/Sampleio.cpp
trunk/OpenMPT/soundlib/Snd_fx.cpp
trunk/OpenMPT/soundlib/Sndfile.cpp
trunk/OpenMPT/soundlib/Sndfile.h
trunk/OpenMPT/soundlib/mod_specifications.h
Modified: trunk/OpenMPT/mptrack/Ctrl_seq.cpp
===================================================================
--- trunk/OpenMPT/mptrack/Ctrl_seq.cpp 2011-04-19 20:43:50 UTC (rev 859)
+++ trunk/OpenMPT/mptrack/Ctrl_seq.cpp 2011-04-29 21:32:29 UTC (rev 860)
@@ -711,21 +711,22 @@
//-------------------------------
{
CMainFrame *pMainFrm = CMainFrame::GetMainFrame();
- if ((pMainFrm) && (m_pModDoc) && (::GetFocus() == m_hWnd))
+ CSoundFile *pSndFile;
+ if ((pMainFrm != nullptr) && (m_pModDoc != nullptr) && (pSndFile = m_pModDoc->GetSoundFile()) != nullptr && (::GetFocus() == m_hWnd))
{
CHAR s[128];
- CSoundFile *pSndFile = m_pModDoc->GetSoundFile();
+ strcpy(s, "");
- s[0] = 0;
+ // MOD orderlist always ends after first empty pattern
+ const ORDERINDEX nLength = (pSndFile->GetType() & MOD_TYPE_MOD) ? pSndFile->Order.GetLengthFirstEmpty() : pSndFile->Order.GetLengthTailTrimmed();
+
if(CMainFrame::m_dwPatternSetup & PATTERN_HEXDISPLAY)
{
- wsprintf(s, "Position %02Xh of %02Xh", m_nScrollPos, pSndFile->Order.GetLengthTailTrimmed());
+ wsprintf(s, "Position %02Xh of %02Xh", m_nScrollPos, nLength);
}
else
{
- const ORDERINDEX nLength = pSndFile->Order.GetLengthTailTrimmed();
- wsprintf(s, "Position %d of %d (%02Xh of %02Xh)",
- m_nScrollPos, nLength, m_nScrollPos, nLength);
+ wsprintf(s, "Position %d of %d (%02Xh of %02Xh)", m_nScrollPos, nLength, m_nScrollPos, nLength);
}
if (m_nScrollPos < pSndFile->Order.GetLength())
Modified: trunk/OpenMPT/mptrack/Draw_pat.cpp
===================================================================
--- trunk/OpenMPT/mptrack/Draw_pat.cpp 2011-04-19 20:43:50 UTC (rev 859)
+++ trunk/OpenMPT/mptrack/Draw_pat.cpp 2011-04-29 21:32:29 UTC (rev 860)
@@ -860,7 +860,9 @@
tx_col = MODCOLOR_TEXTSELECTED;
bk_col = MODCOLOR_BACKSELECTED;
}
- if ((!*((LPDWORD)m)) && (!*(((LPWORD)m)+2)) && ((!col_sel) || (col_sel == 0x1F)))
+ // Speedup: Empty command which is either not or fully selected
+ //if ((!*((LPDWORD)m)) && (!*(((LPWORD)m)+2)) && ((!col_sel) || (col_sel == 0x1F)))
+ if (m->IsEmpty() && ((!col_sel) || (col_sel == 0x1F)))
{
m_Dib.SetTextColor(tx_col, bk_col);
m_Dib.TextBlt(xbmp, 0, nColumnWidth-4, m_szCell.cy, pfnt->nClrX, pfnt->nClrY);
@@ -875,7 +877,7 @@
if ((CMainFrame::m_dwPatternSetup & PATTERN_EFFECTHILIGHT) && (m->note) && (m->note <= NOTE_MAX))
{
tx_col = MODCOLOR_NOTE;
- // Highlight notes that are not supported by the Amiga
+ // Highlight notes that are not supported by the Amiga (for S3M this is not always correct)
if((pSndFile->m_dwSongFlags & (SONG_PT1XMODE|SONG_AMIGALIMITS)) && (m->note < NOTE_MIDDLEC - 12 || m->note >= NOTE_MIDDLEC + 2 * 12))
tx_col = MODCOLOR_DODGY_COMMANDS;
}
@@ -1187,11 +1189,13 @@
if (m_nMidRow) sizeTotal.cy += m_nMidRow * m_szCell.cy * 2;
SetScrollSizes(MM_TEXT, sizeTotal, sizePage, sizeLine);
//UpdateScrollPos(); //rewbs.FixLPsOddScrollingIssue
- if (rect.Height() >= sizeTotal.cy) {
- m_bWholePatternFitsOnScreen=true;
+ if (rect.Height() >= sizeTotal.cy)
+ {
+ m_bWholePatternFitsOnScreen = true;
m_nYScroll = 0; //rewbs.fix2977
- } else {
- m_bWholePatternFitsOnScreen=false;
+ } else
+ {
+ m_bWholePatternFitsOnScreen = false;
}
}
}
@@ -1450,7 +1454,7 @@
CSoundFile *pSndFile = pModDoc->GetSoundFile();
CHAR s[512];
UINT nChn;
- wsprintf(s, "Row %d, Col %d", GetCurrentRow(), GetCurrentChannel()+1);
+ wsprintf(s, "Row %d, Col %d", GetCurrentRow(), GetCurrentChannel() + 1);
pMainFrm->SetUserText(s);
if (::GetFocus() == m_hWnd)
{
@@ -1464,12 +1468,12 @@
switch (GetColTypeFromCursor(m_dwCursor))
{
- case 0:
+ case NOTE_COLUMN:
// display note
if(m->note >= NOTE_MIN_SPECIAL)
strcpy(s, szSpecialNoteShortDesc[m->note - NOTE_MIN_SPECIAL]);
break;
- case 1:
+ case INST_COLUMN:
// display instrument
if (m->instr)
{
@@ -1485,9 +1489,9 @@
} else
{
// "normal" instrument
- if (pSndFile->m_nInstruments)
+ if (pSndFile->GetNumInstruments())
{
- if ((m->instr <= pSndFile->m_nInstruments) && (pSndFile->Instruments[m->instr]))
+ if ((m->instr <= pSndFile->GetNumInstruments()) && (pSndFile->Instruments[m->instr]))
{
MODINSTRUMENT *pIns = pSndFile->Instruments[m->instr];
memcpy(sztmp, pIns->name, 32);
@@ -1495,7 +1499,7 @@
if ((m->note) && (m->note <= NOTE_MAX))
{
UINT nsmp = pIns->Keyboard[m->note-1];
- if ((nsmp) && (nsmp <= pSndFile->m_nSamples))
+ if ((nsmp) && (nsmp <= pSndFile->GetNumSamples()))
{
CHAR sztmp2[64] = "";
memcpy(sztmp2, pSndFile->m_szNames[nsmp], MAX_SAMPLENAME);
@@ -1509,7 +1513,7 @@
}
} else
{
- if (m->instr <= pSndFile->m_nSamples)
+ if (m->instr <= pSndFile->GetNumSamples())
{
memcpy(sztmp, pSndFile->m_szNames[m->instr], MAX_SAMPLENAME);
sztmp[32] = 0;
@@ -1520,7 +1524,7 @@
if (sztmp[0]) wsprintf(s, "%d: %s", m->instr, sztmp);
}
break;
- case 2:
+ case VOL_COLUMN:
// display volume command
if(m->IsPcNote())
{
@@ -1538,8 +1542,8 @@
if (!pModDoc->GetVolCmdInfo(pModDoc->GetIndexFromVolCmd(m->volcmd), s)) s[0] = 0;
}
break;
- case 3:
- case 4:
+ case EFFECT_COLUMN:
+ case PARAM_COLUMN:
// display effect command
if(!m->IsPcNote())
{
Modified: trunk/OpenMPT/mptrack/Moddoc.cpp
===================================================================
--- trunk/OpenMPT/mptrack/Moddoc.cpp 2011-04-19 20:43:50 UTC (rev 859)
+++ trunk/OpenMPT/mptrack/Moddoc.cpp 2011-04-29 21:32:29 UTC (rev 860)
@@ -3153,9 +3153,11 @@
//end rewbs.fix3185
//ensure order correlates with pattern.
- if (pSndFile->Order[ord]!=pat) {
+ if (pSndFile->Order[ord]!=pat)
+ {
ORDERINDEX tentativeOrder = pSndFile->FindOrder(pat);
- if (tentativeOrder != ORDERINDEX_INVALID) { //ensure a valid order exists.
+ if (tentativeOrder != ORDERINDEX_INVALID) //ensure a valid order exists.
+ {
ord = tentativeOrder;
}
}
@@ -3192,11 +3194,13 @@
if ((param[1] >= '0') && (param[1] <= '9')) code += (param[1] - '0'); else
if ((param[1] >= 'A') && (param[1] <= 'F')) code += (param[1] - 'A' + 0x0A);
- if (macro.GetLength()>=4 && macro.GetAt(3)=='0')
+ if (macro.GetLength() >= 4 && macro.GetAt(3) == '0')
return (code - 128);
else
return (code + 128);
}
+
+
int CModDoc::MacroToMidiCC(CString macro)
//---------------------------------------
{
@@ -3211,6 +3215,7 @@
return code;
}
+
int CModDoc::FindMacroForParam(long param) const
//----------------------------------------------
{
@@ -3231,6 +3236,7 @@
return -1;
}
+
// Retrieve Zxx (Z80-ZFF) type from current macro configuration
enmFixedMacroType CModDoc::GetZxxType(const CHAR (&szMidiZXXExt)[128][MACRO_LENGTH])
//----------------------------------------------------------------------------------
@@ -3256,6 +3262,7 @@
return sfx_fixed_custom; // Custom setup
}
+
// Create Zxx (Z80 - ZFF) from one out of five presets
void CModDoc::CreateZxxFromType(CHAR (&szMidiZXXExt)[128][MACRO_LENGTH], enmFixedMacroType iZxxType)
//--------------------------------------------------------------------------------------------------
@@ -3306,6 +3313,9 @@
{
return false;
}
+ // Global macros
+ // TODO
+
// SF0: Z00-Z7F controls cutoff
if(GetMacroType(pSndFile->m_MidiCfg.szMidiSFXExt[0]) != sfx_cutoff)
{
Modified: trunk/OpenMPT/mptrack/View_pat.cpp
===================================================================
--- trunk/OpenMPT/mptrack/View_pat.cpp 2011-04-19 20:43:50 UTC (rev 859)
+++ trunk/OpenMPT/mptrack/View_pat.cpp 2011-04-29 21:32:29 UTC (rev 860)
@@ -155,7 +155,6 @@
{
memset(ChnVUMeters, 0, sizeof(ChnVUMeters));
memset(OldVUMeters, 0, sizeof(OldVUMeters));
- memset(MultiRecordMask, 0, sizeof(MultiRecordMask));
// -> CODE#0012
// -> DESC="midi keyboard split"
memset(splitActiveNoteChannel, 0xFF, sizeof(splitActiveNoteChannel));
@@ -2260,9 +2259,9 @@
if (((pMainFrm->GetFollowSong(pModDoc) != m_hWnd) || (pSndFile->IsPaused()) || (!(m_dwStatus & PATSTATUS_FOLLOWSONG))))
{
- DWORD sel = m_dwCursor | (m_nRow << 16);
- InvalidateArea(sel, sel+5); //rewbs.fix3010 (no refresh under on last row)
- SetCurrentRow(m_nRow+m_nSpacing);
+ DWORD sel = (nChn << 3) | (m_nRow << 16);
+ InvalidateArea(sel, sel + LAST_COLUMN);
+ SetCurrentRow(m_nRow + m_nSpacing);
sel = m_dwCursor | (m_nRow << 16);
SetCurSel(sel, sel);
}
@@ -2569,7 +2568,7 @@
if ((pModDoc = GetDocument()) == NULL || !(IsEditingEnabled_bmsg())) return;
pSndFile = pModDoc->GetSoundFile();
- nChannels = pSndFile->m_nChannels;
+ nChannels = pSndFile->GetNumChannels();
nRows = pSndFile->Patterns[m_nPattern].GetNumRows();
pOldPattern = pSndFile->Patterns[m_nPattern];
if ((nChannels < 1) || (nRows < 1) || (!pOldPattern)) return;
@@ -3978,7 +3977,7 @@
if(oldcmd != *p)
{
pModDoc->SetModified();
- InvalidateArea(sel, sel+5);
+ InvalidateArea(sel, sel + LAST_COLUMN);
UpdateIndicator();
}
}
@@ -4053,7 +4052,7 @@
if(oldcmd != *p)
{
pModDoc->SetModified();
- InvalidateArea(sel, sel+5);
+ InvalidateArea(sel, sel + LAST_COLUMN);
UpdateIndicator();
}
} // end if mainframe & moddoc exist
@@ -4100,7 +4099,7 @@
if(*p != oldcmd)
{
pModDoc->SetModified();
- InvalidateArea(sel, sel+5);
+ InvalidateArea(sel, sel + LAST_COLUMN);
UpdateIndicator();
}
}
@@ -4234,7 +4233,7 @@
if(bIsLiveRecord == false)
{
DWORD sel = (nRow << 16) | (nChn << 3);
- InvalidateArea(sel, sel+5);
+ InvalidateArea(sel, sel + LAST_COLUMN);
UpdateIndicator();
}
@@ -4314,7 +4313,7 @@
if(*p != oldcmd)
{
pModDoc->SetModified();
- InvalidateArea(sel, sel+5);
+ InvalidateArea(sel, sel + LAST_COLUMN);
UpdateIndicator();
}
}
@@ -4372,7 +4371,7 @@
pSndFile->Patterns[m_nPattern].GetpModCommand(nRow, nChn)->note = note;
const DWORD sel = (nRow << 16) | m_dwCursor;
pModDoc->SetModified();
- InvalidateArea(sel, sel+5);
+ InvalidateArea(sel, sel + LAST_COLUMN);
UpdateIndicator();
return;
}
@@ -4521,7 +4520,7 @@
pModDoc->SetModified();
if(bIsLiveRecord == false)
{ // Update only when not recording live.
- InvalidateArea(sel, sel+5);
+ InvalidateArea(sel, sel + LAST_COLUMN);
UpdateIndicator();
}
}
Modified: trunk/OpenMPT/mptrack/View_pat.h
===================================================================
--- trunk/OpenMPT/mptrack/View_pat.h 2011-04-19 20:43:50 UTC (rev 859)
+++ trunk/OpenMPT/mptrack/View_pat.h 2011-04-29 21:32:29 UTC (rev 860)
@@ -54,7 +54,7 @@
LAST_COLUMN = PARAM_COLUMN
};
-static_assert(MAX_CHANNELS <= 0x1FFF, "Check: Channel index in pattern editor is only 13 bits wide!");
+static_assert(MAX_BASECHANNELS <= 0x1FFF, "Check: Channel index in pattern editor is only 13 bits wide!");
//Struct for controlling selection clearing. This is used to define which data fields
@@ -117,7 +117,6 @@
WORD ChnVUMeters[MAX_BASECHANNELS];
WORD OldVUMeters[MAX_BASECHANNELS];
CListBox *ChnEffectList[MAX_BASECHANNELS]; //rewbs.patPlugName
- BYTE MultiRecordMask[(MAX_CHANNELS+7)/8];
UINT m_nFoundInstrument;
UINT m_nMenuOnChan;
DWORD m_dwLastNoteEntryTime; //rewbs.customkeys
Modified: trunk/OpenMPT/soundlib/Load_it.cpp
===================================================================
--- trunk/OpenMPT/soundlib/Load_it.cpp 2011-04-19 20:43:50 UTC (rev 859)
+++ trunk/OpenMPT/soundlib/Load_it.cpp 2011-04-29 21:32:29 UTC (rev 860)
@@ -234,11 +234,11 @@
static inline UINT ConvertVolParam(UINT value)
//--------------------------------------------
{
- return (value > 9) ? 9 : value;
+ return (value > 9) ? 9 : value;
}
-// Convert MPT's internal nvelope format into an IT/MPTM envelope.
+// Convert MPT's internal envelope format into an IT/MPTM envelope.
void MPTEnvToIT(const INSTRUMENTENVELOPE *mptEnv, ITENVELOPE *itEnv, const BYTE envOffset, const BYTE envDefault)
//---------------------------------------------------------------------------------------------------------------
{
@@ -795,7 +795,8 @@
{
if (dwMemPos + sizeof(MODMIDICFG) < dwMemLength)
{
- memcpy(&m_MidiCfg, lpStream+dwMemPos, sizeof(MODMIDICFG));
+ memcpy(&m_MidiCfg, lpStream + dwMemPos, sizeof(MODMIDICFG));
+ SanitizeMacros();
dwMemPos += sizeof(MODMIDICFG);
}
}
@@ -1173,7 +1174,7 @@
{
m[ch].volcmd = VOLCMD_VIBRATODEPTH; m[ch].vol = vol - 203;
// Old versions of ModPlug saved this as vibrato speed instead, so let's fix that
- if(m_dwLastSavedWithVersion <= MAKE_VERSION_NUMERIC(1, 17, 02, 54) && interpretModPlugMade)
+ if(m_dwLastSavedWithVersion && m_dwLastSavedWithVersion <= MAKE_VERSION_NUMERIC(1, 17, 02, 54))
m[ch].volcmd = VOLCMD_VIBRATOSPEED;
} else
// 213-222: Unused (was velocity)
@@ -1348,7 +1349,7 @@
ITFILEHEADER header;
ITINSTRUMENT iti;
ITSAMPLESTRUCT itss;
- BYTE smpcount[(MAX_SAMPLES+7)/8];
+ vector<bool>smpcount(GetNumSamples(), false);
DWORD inspos[MAX_INSTRUMENTS];
vector<DWORD> patpos;
DWORD smppos[MAX_SAMPLES];
@@ -1539,7 +1540,6 @@
if (Instruments[nins])
{
MODINSTRUMENT *pIns = Instruments[nins];
- memset(smpcount, 0, sizeof(smpcount));
memcpy(iti.filename, pIns->filename, 12);
memcpy(iti.name, pIns->name, 26);
iti.mbank = pIns->wMidiBank;
@@ -1570,10 +1570,10 @@
iti.nos = 0;
for (UINT i=0; i<NOTE_MAX; i++) if (pIns->Keyboard[i] < MAX_SAMPLES)
{
- UINT smp = pIns->Keyboard[i];
- if ((smp) && (!(smpcount[smp>>3] & (1<<(smp&7)))))
+ const UINT smp = pIns->Keyboard[i];
+ if (smp && !smpcount[smp - 1])
{
- smpcount[smp>>3] |= 1 << (smp&7);
+ smpcount[smp - 1] = true;
iti.nos++;
}
iti.keyboard[i*2] = (pIns->NoteMap[i] >= NOTE_MIN && pIns->NoteMap[i] <= NOTE_MAX) ? (pIns->NoteMap[i] - 1) : i;
@@ -1978,7 +1978,7 @@
ITFILEHEADER header;
ITINSTRUMENT iti;
ITSAMPLESTRUCT itss;
- BYTE smpcount[(MAX_SAMPLES+7)/8];
+ vector<bool>smpcount(GetNumSamples(), false);
DWORD inspos[MAX_INSTRUMENTS];
DWORD patpos[MAX_PATTERNS];
DWORD smppos[MAX_SAMPLES];
@@ -2142,7 +2142,6 @@
if (Instruments[nins])
{
MODINSTRUMENT *pIns = Instruments[nins];
- memset(smpcount, 0, sizeof(smpcount));
memcpy(iti.filename, pIns->filename, 12);
memcpy(iti.name, pIns->name, 26);
SetNullTerminator(iti.name);
@@ -2165,10 +2164,10 @@
iti.nos = 0;
for (UINT i=0; i<NOTE_MAX; i++) if (pIns->Keyboard[i] < MAX_SAMPLES)
{
- UINT smp = pIns->Keyboard[i];
- if ((smp) && (!(smpcount[smp>>3] & (1<<(smp&7)))))
+ const UINT smp = pIns->Keyboard[i];
+ if (smp && !smpcount[smp - 1])
{
- smpcount[smp>>3] |= 1 << (smp&7);
+ smpcount[smp - 1] = true;
iti.nos++;
}
iti.keyboard[i*2] = (pIns->NoteMap[i] >= NOTE_MIN && pIns->NoteMap[i] <= NOTE_MAX) ? (pIns->NoteMap[i] - 1) : i;
Modified: trunk/OpenMPT/soundlib/Load_itp.cpp
===================================================================
--- trunk/OpenMPT/soundlib/Load_itp.cpp 2011-04-19 20:43:50 UTC (rev 859)
+++ trunk/OpenMPT/soundlib/Load_itp.cpp 2011-04-29 21:32:29 UTC (rev 860)
@@ -172,8 +172,10 @@
// midi cfg
ASSERT_CAN_READ(id);
- if (id<=sizeof(m_MidiCfg)) {
- memcpy(&m_MidiCfg,lpStream+dwMemPos,id);
+ if (id <= sizeof(m_MidiCfg))
+ {
+ memcpy(&m_MidiCfg, lpStream + dwMemPos, id);
+ SanitizeMacros();
dwMemPos += id;
}
Modified: trunk/OpenMPT/soundlib/Load_mod.cpp
===================================================================
--- trunk/OpenMPT/soundlib/Load_mod.cpp 2011-04-19 20:43:50 UTC (rev 859)
+++ trunk/OpenMPT/soundlib/Load_mod.cpp 2011-04-29 21:32:29 UTC (rev 860)
@@ -617,7 +617,7 @@
UINT nbp = 0, norders = 128;
for (UINT iord=0; iord<128; iord++)
{
- if (Order[iord] == Order.GetInvalidPatIndex())
+ if (Order[iord] == Order.GetInvalidPatIndex() || Order[iord] == Order.GetIgnoreIndex())
{
norders = iord;
break;
@@ -644,7 +644,8 @@
}
fwrite(bTab, 4, 1, f);
// Writing patterns
- for (UINT ipat=0; ipat<nbp; ipat++) { //for all patterns
+ for (UINT ipat=0; ipat<nbp; ipat++) //for all patterns
+ {
BYTE s[64*4];
if (Patterns[ipat]) //if pattern exists
{
Modified: trunk/OpenMPT/soundlib/Load_xm.cpp
===================================================================
--- trunk/OpenMPT/soundlib/Load_xm.cpp 2011-04-19 20:43:50 UTC (rev 859)
+++ trunk/OpenMPT/soundlib/Load_xm.cpp 2011-04-29 21:32:29 UTC (rev 860)
@@ -615,7 +615,8 @@
dwMemPos += 8;
if (len == sizeof(MODMIDICFG))
{
- memcpy(&m_MidiCfg, lpStream+dwMemPos, len);
+ memcpy(&m_MidiCfg, lpStream + dwMemPos, len);
+ SanitizeMacros();
m_dwSongFlags |= SONG_EMBEDMIDICFG;
dwMemPos += len; //rewbs.fix36946
}
Modified: trunk/OpenMPT/soundlib/Sampleio.cpp
===================================================================
--- trunk/OpenMPT/soundlib/Sampleio.cpp 2011-04-19 20:43:50 UTC (rev 859)
+++ trunk/OpenMPT/soundlib/Sampleio.cpp 2011-04-29 21:32:29 UTC (rev 860)
@@ -1787,14 +1787,14 @@
ITINSTRUMENT *iti = (ITINSTRUMENT *)buffer;
ITSAMPLESTRUCT itss;
MODINSTRUMENT *pIns = Instruments[nInstr];
- UINT smpcount[MAX_SAMPLES], smptable[MAX_SAMPLES], smpmap[MAX_SAMPLES];
+ vector<bool> smpcount(GetNumSamples(), false);
+ UINT smptable[MAX_SAMPLES], smpmap[MAX_SAMPLES];
DWORD dwPos;
FILE *f;
if ((!pIns) || (!lpszFileName)) return false;
if ((f = fopen(lpszFileName, "wb")) == NULL) return false;
memset(buffer, 0, sizeof(buffer));
- memset(smpcount, 0, sizeof(smpcount));
memset(smptable, 0, sizeof(smptable));
memset(smpmap, 0, sizeof(smpmap));
iti->id = LittleEndian(IT_IMPI); // "IMPI"
@@ -1822,10 +1822,10 @@
iti->nos = 0;
for (UINT i=0; i<NOTE_MAX; i++) if (pIns->Keyboard[i] < MAX_SAMPLES)
{
- UINT smp = pIns->Keyboard[i];
- if ((smp) && (!smpcount[smp]))
+ const UINT smp = pIns->Keyboard[i];
+ if (smp && !smpcount[smp - 1])
{
- smpcount[smp] = 1;
+ smpcount[smp - 1] = true;
smptable[iti->nos] = smp;
smpmap[smp] = iti->nos;
iti->nos++;
Modified: trunk/OpenMPT/soundlib/Snd_fx.cpp
===================================================================
--- trunk/OpenMPT/soundlib/Snd_fx.cpp 2011-04-19 20:43:50 UTC (rev 859)
+++ trunk/OpenMPT/soundlib/Snd_fx.cpp 2011-04-29 21:32:29 UTC (rev 860)
@@ -3965,10 +3965,10 @@
}
-UINT __cdecl CSoundFile::GetChannelPlugin(UINT nChn, bool respectMutes)
-//--------------------------------------------------------------
+UINT __cdecl CSoundFile::GetChannelPlugin(UINT nChn, bool respectMutes) const
+//---------------------------------------------------------------------------
{
- MODCHANNEL *pChn= &Chn[nChn];
+ const MODCHANNEL *pChn = &Chn[nChn];
// If it looks like this is an NNA channel, we need to find the master channel.
// This ensures we pick up the right ChnSettings.
@@ -3988,10 +3988,10 @@
}
-UINT CSoundFile::GetActiveInstrumentPlugin(UINT nChn, bool respectMutes)
-//-----------------------------------------------------------------------
+UINT CSoundFile::GetActiveInstrumentPlugin(UINT nChn, bool respectMutes) const
+//----------------------------------------------------------------------------
{
- MODCHANNEL *pChn = &Chn[nChn];
+ const MODCHANNEL *pChn = &Chn[nChn];
// Unlike channel settings, pModInstrument is copied from the original chan to the NNA chan,
// so we don't nee to worry about finding the master chan.
@@ -4007,8 +4007,8 @@
}
-UINT CSoundFile::GetBestMidiChan(MODCHANNEL *pChn)
-//------------------------------------------------
+UINT CSoundFile::GetBestMidiChan(const MODCHANNEL *pChn) const
+//------------------------------------------------------------
{
if (pChn && pChn->pModInstrument && pChn->pModInstrument->nMidiChannel)
{
Modified: trunk/OpenMPT/soundlib/Sndfile.cpp
===================================================================
--- trunk/OpenMPT/soundlib/Sndfile.cpp 2011-04-19 20:43:50 UTC (rev 859)
+++ trunk/OpenMPT/soundlib/Sndfile.cpp 2011-04-29 21:32:29 UTC (rev 860)
@@ -936,6 +936,25 @@
}
+// Set null terminator for all MIDI macros
+void CSoundFile::SanitizeMacros()
+//-------------------------------
+{
+ for(size_t i = 0; i < CountOf(m_MidiCfg.szMidiGlb); i++)
+ {
+ SetNullTerminator(m_MidiCfg.szMidiGlb[i]);
+ }
+ for(size_t i = 0; i < CountOf(m_MidiCfg.szMidiSFXExt); i++)
+ {
+ SetNullTerminator(m_MidiCfg.szMidiSFXExt[i]);
+ }
+ for(size_t i = 0; i < CountOf(m_MidiCfg.szMidiZXXExt); i++)
+ {
+ SetNullTerminator(m_MidiCfg.szMidiZXXExt[i]);
+ }
+}
+
+
BOOL CSoundFile::SetWaveConfig(UINT nRate,UINT nBits,UINT nChannels,BOOL bMMX)
//----------------------------------------------------------------------------
{
@@ -2620,7 +2639,7 @@
return 0;
}
SAMPLEINDEX nRemoved = 0;
- for (SAMPLEINDEX nSmp = (SAMPLEINDEX)min(GetNumSamples(), keepSamples.size() - 1); nSmp >= 1; nSmp--)
+ for(SAMPLEINDEX nSmp = (SAMPLEINDEX)min(GetNumSamples(), keepSamples.size() - 1); nSmp >= 1; nSmp--)
{
if(!keepSamples[nSmp])
{
Modified: trunk/OpenMPT/soundlib/Sndfile.h
===================================================================
--- trunk/OpenMPT/soundlib/Sndfile.h 2011-04-19 20:43:50 UTC (rev 859)
+++ trunk/OpenMPT/soundlib/Sndfile.h 2011-04-29 21:32:29 UTC (rev 860)
@@ -433,7 +433,9 @@
////////////////////////////////////////////////////////////////////
-enum {
+// Global MIDI macros
+enum
+{
MIDIOUT_START=0,
MIDIOUT_STOP,
MIDIOUT_TICK,
@@ -454,7 +456,6 @@
CHAR szMidiSFXExt[16][MACRO_LENGTH];
CHAR szMidiZXXExt[128][MACRO_LENGTH];
};
-typedef MODMIDICFG* LPMODMIDICFG;
STATIC_ASSERT(sizeof(MODMIDICFG) == 4896); // this is directly written to files, so the size must be correct!
typedef VOID (__cdecl * LPSNDMIXHOOKPROC)(int *, unsigned long, unsigned long); // buffer, samples, channels
@@ -990,6 +991,7 @@
// Misc functions
MODSAMPLE *GetSample(UINT n) { return Samples+n; }
void ResetMidiCfg();
+ void SanitizeMacros();
UINT MapMidiInstrument(DWORD dwProgram, UINT nChannel, UINT nNote);
long ITInstrToMPT(const void *p, MODINSTRUMENT *pIns, UINT trkvers); //change from BOOL for rewbs.modularInstData
UINT LoadMixPlugins(const void *pData, UINT nLen);
@@ -1051,9 +1053,9 @@
void resetEnvelopes(MODCHANNEL* pChn, enmResetEnv envToReset = ENV_RESET_ALL);
void SetDefaultInstrumentValues(MODINSTRUMENT *pIns);
private:
- UINT __cdecl GetChannelPlugin(UINT nChan, bool respectMutes);
- UINT __cdecl GetActiveInstrumentPlugin(UINT nChan, bool respectMutes);
- UINT GetBestMidiChan(MODCHANNEL *pChn);
+ UINT __cdecl GetChannelPlugin(UINT nChan, bool respectMutes) const;
+ UINT __cdecl GetActiveInstrumentPlugin(UINT nChan, bool respectMutes) const;
+ UINT GetBestMidiChan(const MODCHANNEL *pChn) const;
void HandlePatternTransitionEvents();
void BuildDefaultInstrument();
Modified: trunk/OpenMPT/soundlib/mod_specifications.h
===================================================================
--- trunk/OpenMPT/soundlib/mod_specifications.h 2011-04-19 20:43:50 UTC (rev 859)
+++ trunk/OpenMPT/soundlib/mod_specifications.h 2011-04-29 21:32:29 UTC (rev 860)
@@ -178,7 +178,7 @@
false, // No envelope release node
" 0123456789ABCD?FF?E???????????????", // Supported Effects
" ???????????????", // Supported Volume Column commands
- true, // Has "+++" pattern
+ false, // Doesn't have "+++" pattern
true, // Has restart position (order)
false, // Doesn't support plugins
false, // No custom pattern time signatures
@@ -257,7 +257,7 @@
false, // No envelope release node
" 0123456789ABCDRFFTE???GHK?YXPLZ\\?#", // Supported Effects
" vpcdabuhlrgfe?o", // Supported Volume Column commands
- true, // Has "+++" pattern
+ false, // Doesn't have "+++" pattern
true, // Has restart position (order)
true, // Supports plugins
false, // No custom pattern time signatures
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <sag...@us...> - 2011-04-19 20:43:57
|
Revision: 859
http://modplug.svn.sourceforge.net/modplug/?rev=859&view=rev
Author: saga-games
Date: 2011-04-19 20:43:50 +0000 (Tue, 19 Apr 2011)
Log Message:
-----------
Someone said...
[Mod] OpenMPT: Version is now 1.19.01.04
Modified Paths:
--------------
trunk/OpenMPT/mptrack/version.h
Modified: trunk/OpenMPT/mptrack/version.h
===================================================================
--- trunk/OpenMPT/mptrack/version.h 2011-04-19 20:42:10 UTC (rev 858)
+++ trunk/OpenMPT/mptrack/version.h 2011-04-19 20:43:50 UTC (rev 859)
@@ -15,7 +15,7 @@
#define VER_MAJORMAJOR 1
#define VER_MAJOR 19
#define VER_MINOR 01
-#define VER_MINORMINOR 03
+#define VER_MINORMINOR 04
//Creates version number from version parts that appears in version string.
//For example MAKE_VERSION_NUMERIC(1,17,02,28) gives version number of
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <sag...@us...> - 2011-04-19 20:42:16
|
Revision: 858
http://modplug.svn.sourceforge.net/modplug/?rev=858&view=rev
Author: saga-games
Date: 2011-04-19 20:42:10 +0000 (Tue, 19 Apr 2011)
Log Message:
-----------
[Fix] DBM Loader: Global volume was scaled wrong.
[Mod] OpenMPT: Version is now 1.19.01.04
Modified Paths:
--------------
trunk/OpenMPT/soundlib/LOAD_DBM.CPP
Modified: trunk/OpenMPT/soundlib/LOAD_DBM.CPP
===================================================================
--- trunk/OpenMPT/soundlib/LOAD_DBM.CPP 2011-04-17 14:15:48 UTC (rev 857)
+++ trunk/OpenMPT/soundlib/LOAD_DBM.CPP 2011-04-19 20:42:10 UTC (rev 858)
@@ -106,43 +106,48 @@
};
-void ConvertDBMEffect(uint8 *command, uint8 *param)
+void ConvertDBMEffect(uint8 &command, uint8 ¶m)
//-------------------------------------------------
{
- if(*command < ARRAYELEMCOUNT(dbm_efftrans))
- *command = dbm_efftrans[*command];
+ if(command < CountOf(dbm_efftrans))
+ command = dbm_efftrans[command];
else
- *command = CMD_NONE;
+ command = CMD_NONE;
- switch (*command)
+ switch (command)
{
case CMD_ARPEGGIO:
- if(*param == 0)
- *command = CMD_NONE;
+ if(param == 0)
+ command = CMD_NONE;
break;
case CMD_VOLUMESLIDE:
- if(*param & 0xF0)
- *param &= 0xF0;
+ if(param & 0xF0)
+ param &= 0xF0;
break;
+ case CMD_GLOBALVOLUME:
+ if(param <= 64)
+ param *= 2;
+ else
+ param = 128;
case CMD_MODCMDEX:
- switch(*param & 0xF0)
+ switch(param & 0xF0)
{
case 0x00: // set filter
- *command = CMD_NONE;
+ command = CMD_NONE;
break;
case 0x30: // play backwards
- *command = CMD_S3MCMDEX;
- *param = 0x9F;
+ command = CMD_S3MCMDEX;
+ param = 0x9F;
break;
case 0x40: // turn off sound in channel
// TODO
break;
case 0x50: // turn on/off channel
// TODO is this correct?
- if((*param & 0x0F) <= 0x01)
+ if((param & 0x0F) <= 0x01)
{
- *command = CMD_CHANNELVOLUME;
- *param = (*param == 0x50) ? 0x00 : 0x40;
+ command = CMD_CHANNELVOLUME;
+ param = (param == 0x50) ? 0x00 : 0x40;
}
break;
case 0x60: // set loop begin / loop
@@ -160,17 +165,17 @@
}
break;
case CMD_TEMPO:
- if(*param <= 0x1F) *command = CMD_SPEED;
+ if(param <= 0x1F) command = CMD_SPEED;
break;
case CMD_KEYOFF:
- if (*param == 0)
+ if (param == 0)
{
// TODO key of at tick 0
}
break;
case CMD_OFFSET:
// TODO Sample offset slide
- *command = CMD_NONE;
+ command = CMD_NONE;
break;
}
}
@@ -370,8 +375,8 @@
if (b & 0x08) param2 = pkdata[i++];
if (b & 0x10) cmd1 = pkdata[i++];
if (b & 0x20) param1 = pkdata[i++];
- ConvertDBMEffect(&cmd1, ¶m1);
- ConvertDBMEffect(&cmd2, ¶m2);
+ ConvertDBMEffect(cmd1, param1);
+ ConvertDBMEffect(cmd2, param2);
// this is the same conversion algorithm as in the ULT loader. maybe this should be merged at some point...
if (cmd2 == CMD_VOLUME || (cmd2 == CMD_NONE && cmd1 != CMD_VOLUME))
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <sag...@us...> - 2011-04-17 14:15:55
|
Revision: 857
http://modplug.svn.sourceforge.net/modplug/?rev=857&view=rev
Author: saga-games
Date: 2011-04-17 14:15:48 +0000 (Sun, 17 Apr 2011)
Log Message:
-----------
[Ref] Made MODMIDICFG arrays two-dimensional (instead of one long string)... this makes macro handling look less weird.
Modified Paths:
--------------
trunk/OpenMPT/mptrack/AbstractVstEditor.cpp
trunk/OpenMPT/mptrack/Moddoc.cpp
trunk/OpenMPT/mptrack/Moddoc.h
trunk/OpenMPT/mptrack/Mptrack.cpp
trunk/OpenMPT/mptrack/View_pat.cpp
trunk/OpenMPT/mptrack/dlg_misc.cpp
trunk/OpenMPT/mptrack/dlg_misc.h
trunk/OpenMPT/soundlib/Sampleio.cpp
trunk/OpenMPT/soundlib/Snd_fx.cpp
trunk/OpenMPT/soundlib/Sndfile.cpp
trunk/OpenMPT/soundlib/Sndfile.h
Modified: trunk/OpenMPT/mptrack/AbstractVstEditor.cpp
===================================================================
--- trunk/OpenMPT/mptrack/AbstractVstEditor.cpp 2011-04-17 12:26:43 UTC (rev 856)
+++ trunk/OpenMPT/mptrack/AbstractVstEditor.cpp 2011-04-17 14:15:48 UTC (rev 857)
@@ -51,7 +51,7 @@
ON_MESSAGE(WM_MOD_KEYCOMMAND, OnCustomKeyMsg) //rewbs.customKeys
ON_COMMAND_RANGE(ID_PLUGSELECT, ID_PLUGSELECT+MAX_MIXPLUGINS, OnToggleEditor) //rewbs.patPlugName
ON_COMMAND_RANGE(ID_SELECTINST, ID_SELECTINST+MAX_INSTRUMENTS, OnSetInputInstrument) //rewbs.patPlugName
- ON_COMMAND_RANGE(ID_LEARN_MACRO_FROM_PLUGGUI, ID_LEARN_MACRO_FROM_PLUGGUI+NMACROS, PrepareToLearnMacro)
+ ON_COMMAND_RANGE(ID_LEARN_MACRO_FROM_PLUGGUI, ID_LEARN_MACRO_FROM_PLUGGUI + NUM_MACROS, PrepareToLearnMacro)
END_MESSAGE_MAP()
CAbstractVstEditor::CAbstractVstEditor(CVstPlugin *pPlugin)
@@ -246,7 +246,7 @@
void CAbstractVstEditor::OnMacroInfo()
{ //TODO
/*
- for (UINT m=0; m<NMACROS; m++)
+ for (UINT m=0; m<NUM_MACROS; m++)
{
}
*/
@@ -568,24 +568,28 @@
int macroType,nParam,action;
CModDoc* pModDoc = m_pVstPlugin->GetModDoc();
- if (!pModDoc) {
+ if (!pModDoc)
+ {
return;
}
CMenu* pInfoMenu = m_pMenu->GetSubMenu(2);
pInfoMenu->DeleteMenu(2, MF_BYPOSITION);
- if (m_pMacroMenu->m_hMenu) {
+ if (m_pMacroMenu->m_hMenu)
+ {
m_pMacroMenu->DestroyMenu();
}
- if (!m_pMacroMenu->m_hMenu) {
+ if (!m_pMacroMenu->m_hMenu)
+ {
m_pMacroMenu->CreatePopupMenu();
}
- for (int nMacro=0; nMacro<NMACROS; nMacro++) {
+ for (int nMacro=0; nMacro<NUM_MACROS; nMacro++)
+ {
action=NULL;
greyed=true;
- macroText = &(pModDoc->GetSoundFile()->m_MidiCfg.szMidiSFXExt[nMacro*32]);
+ macroText = pModDoc->GetSoundFile()->m_MidiCfg.szMidiSFXExt[nMacro];
macroType = pModDoc->GetMacroType(macroText);
switch (macroType) {
@@ -790,8 +794,10 @@
//Then pModDoc->LearnMacro(macro, param) is called
}
-void CAbstractVstEditor::SetLearnMacro(int inMacro) {
- if (inMacro<NMACROS) {
+void CAbstractVstEditor::SetLearnMacro(int inMacro)
+{
+ if (inMacro < NUM_MACROS)
+ {
m_nLearnMacro=inMacro;
}
}
Modified: trunk/OpenMPT/mptrack/Moddoc.cpp
===================================================================
--- trunk/OpenMPT/mptrack/Moddoc.cpp 2011-04-17 12:26:43 UTC (rev 856)
+++ trunk/OpenMPT/mptrack/Moddoc.cpp 2011-04-17 14:15:48 UTC (rev 857)
@@ -2274,7 +2274,7 @@
case CMD_S3MCMDEX:
if ((param & 0xF0) == 0xF0 && !(m_SndFile.m_nType & MOD_TYPE_MOD)) //Set Macro
{
- macroText = &m_SndFile.m_MidiCfg.szMidiSFXExt[(param & 0x0F) * 32];
+ macroText = m_SndFile.m_MidiCfg.szMidiSFXExt[(param & 0x0F)];
chanSpec.Format(" to %d: ", param & 0x0F);
}
break;
@@ -2282,7 +2282,7 @@
case CMD_SMOOTHMIDI:
if (param < 0x80 && nChn != CHANNELINDEX_INVALID)
{
- macroText = &m_SndFile.m_MidiCfg.szMidiSFXExt[m_SndFile.Chn[nChn].nActiveMacro*32];
+ macroText = m_SndFile.m_MidiCfg.szMidiSFXExt[m_SndFile.Chn[nChn].nActiveMacro];
chanSpec.Format(": currently %d: ", m_SndFile.Chn[nChn].nActiveMacro);
}
else
@@ -3221,7 +3221,7 @@
}
for (int macro = 0; macro < NUM_MACROS; macro++)
{
- CString macroString = &(pSndFile->m_MidiCfg.szMidiSFXExt[macro * 32]);
+ CString macroString = pSndFile->m_MidiCfg.szMidiSFXExt[macro];
if (GetMacroType(macroString) == sfx_plug && MacroToPlugParam(macroString) == param)
{
return macro;
@@ -3232,20 +3232,20 @@
}
// Retrieve Zxx (Z80-ZFF) type from current macro configuration
-enmFixedMacroType CModDoc::GetZxxType(const CHAR (&szMidiZXXExt)[128 * 32])
-//-------------------------------------------------------------------------
+enmFixedMacroType CModDoc::GetZxxType(const CHAR (&szMidiZXXExt)[128][MACRO_LENGTH])
+//----------------------------------------------------------------------------------
{
// Compare with all possible preset patterns
for(int i = 1; i < sfx_fixed_max; i++)
{
// Prepare pattern to compare
- CHAR szPatterns[128 * 32];
+ CHAR szPatterns[128][MACRO_LENGTH];
CreateZxxFromType(szPatterns, static_cast<enmFixedMacroType>(i));
bool bFound = true;
for(int j = 0; j < 128; j++)
{
- if(strncmp(&szPatterns[j * 32], &szMidiZXXExt[j * 32], 32))
+ if(strncmp(szPatterns[j], szMidiZXXExt[j], MACRO_LENGTH))
{
bFound = false;
break;
@@ -3257,8 +3257,8 @@
}
// Create Zxx (Z80 - ZFF) from one out of five presets
-void CModDoc::CreateZxxFromType(CHAR (&szMidiZXXExt)[128 * 32], enmFixedMacroType iZxxType)
-//-----------------------------------------------------------------------------------------
+void CModDoc::CreateZxxFromType(CHAR (&szMidiZXXExt)[128][MACRO_LENGTH], enmFixedMacroType iZxxType)
+//--------------------------------------------------------------------------------------------------
{
for(int i = 0; i < 128; i++)
{
@@ -3266,30 +3266,30 @@
{
case sfx_fixed_reso4Bit:
// Type 1 - Z80 - Z8F controls resonance
- if (i < 16) wsprintf(&szMidiZXXExt[i * 32], "F0F001%02X", i * 8);
- else szMidiZXXExt[i * 32] = 0;
+ if (i < 16) wsprintf(szMidiZXXExt[i], "F0F001%02X", i * 8);
+ else strcpy(szMidiZXXExt[i], "");
break;
case sfx_fixed_reso7Bit:
// Type 2 - Z80 - ZFF controls resonance
- wsprintf(&szMidiZXXExt[i * 32], "F0F001%02X", i);
+ wsprintf(szMidiZXXExt[i], "F0F001%02X", i);
break;
case sfx_fixed_cutoff:
// Type 3 - Z80 - ZFF controls cutoff
- wsprintf(&szMidiZXXExt[i * 32], "F0F000%02X", i);
+ wsprintf(szMidiZXXExt[i], "F0F000%02X", i);
break;
case sfx_fixed_mode:
// Type 4 - Z80 - ZFF controls filter mode
- wsprintf(&szMidiZXXExt[i * 32], "F0F002%02X", i);
+ wsprintf(szMidiZXXExt[i], "F0F002%02X", i);
break;
case sfx_fixed_resomode:
// Type 5 - Z80 - Z9F controls resonance + filter mode
- if (i < 16) wsprintf(&szMidiZXXExt[i * 32], "F0F001%02X", i * 8);
- else if (i < 32) wsprintf(&szMidiZXXExt[i * 32], "F0F002%02X", (i - 16) * 8);
- else szMidiZXXExt[i * 32] = 0;
+ if (i < 16) wsprintf(szMidiZXXExt[i], "F0F001%02X", i * 8);
+ else if (i < 32) wsprintf(szMidiZXXExt[i], "F0F002%02X", (i - 16) * 8);
+ else strcpy(szMidiZXXExt[i], "");
break;
}
}
@@ -3307,7 +3307,7 @@
return false;
}
// SF0: Z00-Z7F controls cutoff
- if(GetMacroType(&(pSndFile->m_MidiCfg.szMidiSFXExt[0])) != sfx_cutoff)
+ if(GetMacroType(pSndFile->m_MidiCfg.szMidiSFXExt[0]) != sfx_cutoff)
{
return false;
}
@@ -3319,7 +3319,7 @@
// All other parametered macros are unused
for(size_t i = 1; i < NUM_MACROS; i++)
{
- if(GetMacroType(&(pSndFile->m_MidiCfg.szMidiSFXExt[i * 32])) != sfx_unused)
+ if(GetMacroType(pSndFile->m_MidiCfg.szMidiSFXExt[i]) != sfx_unused)
{
return false;
}
@@ -3666,14 +3666,15 @@
void CModDoc::LearnMacro(int macroToSet, long paramToUse)
//-------------------------------------------------------
{
- if (macroToSet<0 || macroToSet>NMACROS)
+ if (macroToSet < 0 || macroToSet > NUM_MACROS)
{
return;
}
//if macro already exists for this param, alert user and return
- for (int checkMacro=0; checkMacro<NMACROS; checkMacro++) {
- CString macroText = &(GetSoundFile()->m_MidiCfg.szMidiSFXExt[checkMacro*32]);
+ for (int checkMacro=0; checkMacro < NUM_MACROS; checkMacro++)
+ {
+ CString macroText = GetSoundFile()->m_MidiCfg.szMidiSFXExt[checkMacro];
int macroType = GetMacroType(macroText);
if (macroType==sfx_plug && MacroToPlugParam(macroText)==paramToUse) {
@@ -3685,7 +3686,7 @@
}
//set new macro
- CHAR *pMacroToSet = &(GetSoundFile()->m_MidiCfg.szMidiSFXExt[macroToSet*32]);
+ CHAR *pMacroToSet = GetSoundFile()->m_MidiCfg.szMidiSFXExt[macroToSet];
if (paramToUse<128) {
wsprintf(pMacroToSet, "F0F0%Xz",paramToUse+128);
} else if (paramToUse<384) {
Modified: trunk/OpenMPT/mptrack/Moddoc.h
===================================================================
--- trunk/OpenMPT/mptrack/Moddoc.h 2011-04-17 12:26:43 UTC (rev 856)
+++ trunk/OpenMPT/mptrack/Moddoc.h 2011-04-17 14:15:48 UTC (rev 857)
@@ -257,8 +257,8 @@
static enmParameteredMacroType GetMacroType(CString value); //rewbs.xinfo
static int MacroToPlugParam(CString value); //rewbs.xinfo
static int MacroToMidiCC(CString value);
- static enmFixedMacroType GetZxxType(const CHAR (&szMidiZXXExt)[128 * 32]);
- static void CreateZxxFromType(CHAR (&szMidiZXXExt)[128 * 32], enmFixedMacroType iZxxType);
+ static enmFixedMacroType GetZxxType(const CHAR (&szMidiZXXExt)[128][MACRO_LENGTH]);
+ static void CreateZxxFromType(CHAR (&szMidiZXXExt)[128][MACRO_LENGTH], enmFixedMacroType iZxxType);
bool IsMacroDefaultSetupUsed() const;
int FindMacroForParam(long param) const;
Modified: trunk/OpenMPT/mptrack/Mptrack.cpp
===================================================================
--- trunk/OpenMPT/mptrack/Mptrack.cpp 2011-04-17 12:26:43 UTC (rev 856)
+++ trunk/OpenMPT/mptrack/Mptrack.cpp 2011-04-17 14:15:48 UTC (rev 857)
@@ -608,13 +608,13 @@
m_szConfigFileName[0] = 0;
for (UINT i=0; i<MAX_DLS_BANKS; i++) gpDLSBanks[i] = NULL;
// Default macro config
- memset(&m_MidiCfg, 0, sizeof(m_MidiCfg));
- strcpy(&m_MidiCfg.szMidiGlb[MIDIOUT_START*32], "FF");
- strcpy(&m_MidiCfg.szMidiGlb[MIDIOUT_STOP*32], "FC");
- strcpy(&m_MidiCfg.szMidiGlb[MIDIOUT_NOTEON*32], "9c n v");
- strcpy(&m_MidiCfg.szMidiGlb[MIDIOUT_NOTEOFF*32], "9c n 0");
- strcpy(&m_MidiCfg.szMidiGlb[MIDIOUT_PROGRAM*32], "Cc p");
- strcpy(&m_MidiCfg.szMidiSFXExt[0], "F0F000z");
+ MemsetZero(m_MidiCfg);
+ strcpy(m_MidiCfg.szMidiGlb[MIDIOUT_START], "FF");
+ strcpy(m_MidiCfg.szMidiGlb[MIDIOUT_STOP], "FC");
+ strcpy(m_MidiCfg.szMidiGlb[MIDIOUT_NOTEON], "9c n v");
+ strcpy(m_MidiCfg.szMidiGlb[MIDIOUT_NOTEOFF], "9c n 0");
+ strcpy(m_MidiCfg.szMidiGlb[MIDIOUT_PROGRAM], "Cc p");
+ strcpy(m_MidiCfg.szMidiSFXExt[0], "F0F000z");
CModDoc::CreateZxxFromType(m_MidiCfg.szMidiZXXExt, sfx_fixed_reso4Bit);
}
@@ -867,17 +867,17 @@
{
CHAR s[64], snam[32];
wsprintf(snam, "SF%X", isfx);
- GetPrivateProfileString("Zxx Macros", snam, &m_MidiCfg.szMidiSFXExt[isfx*32], s, sizeof(s), m_szConfigFileName);
- s[31] = 0;
- memcpy(&m_MidiCfg.szMidiSFXExt[isfx*32], s, 32);
+ GetPrivateProfileString("Zxx Macros", snam, m_MidiCfg.szMidiSFXExt[isfx], s, CountOf(s), m_szConfigFileName);
+ s[MACRO_LENGTH - 1] = 0;
+ memcpy(m_MidiCfg.szMidiSFXExt[isfx], s, MACRO_LENGTH);
}
for (UINT izxx=0; izxx<128; izxx++)
{
CHAR s[64], snam[32];
wsprintf(snam, "Z%02X", izxx|0x80);
- GetPrivateProfileString("Zxx Macros", snam, &m_MidiCfg.szMidiZXXExt[izxx*32], s, sizeof(s), m_szConfigFileName);
- s[31] = 0;
- memcpy(&m_MidiCfg.szMidiZXXExt[izxx*32], s, 32);
+ GetPrivateProfileString("Zxx Macros", snam, m_MidiCfg.szMidiZXXExt[izxx], s, CountOf(s), m_szConfigFileName);
+ s[MACRO_LENGTH - 1] = 0;
+ memcpy(m_MidiCfg.szMidiZXXExt[izxx], s, MACRO_LENGTH);
}
// Parse command line for standard shell commands, DDE, file open
@@ -997,7 +997,7 @@
{
CHAR s[64], snam[32];
wsprintf(snam, "SF%X", isfx);
- memcpy(s, &m_MidiCfg.szMidiSFXExt[isfx*32], 32);
+ memcpy(s, m_MidiCfg.szMidiSFXExt[isfx], MACRO_LENGTH);
s[31] = 0;
if (!WritePrivateProfileString("Zxx Macros", snam, s, m_szConfigFileName)) break;
}
@@ -1005,8 +1005,8 @@
{
CHAR s[64], snam[32];
wsprintf(snam, "Z%02X", izxx|0x80);
- memcpy(s, &m_MidiCfg.szMidiZXXExt[izxx*32], 32);
- s[31] = 0;
+ memcpy(s, m_MidiCfg.szMidiZXXExt[izxx], MACRO_LENGTH);
+ s[MACRO_LENGTH - 1] = 0;
if (!WritePrivateProfileString("Zxx Macros", snam, s, m_szConfigFileName)) break;
}
}
Modified: trunk/OpenMPT/mptrack/View_pat.cpp
===================================================================
--- trunk/OpenMPT/mptrack/View_pat.cpp 2011-04-17 12:26:43 UTC (rev 856)
+++ trunk/OpenMPT/mptrack/View_pat.cpp 2011-04-17 14:15:48 UTC (rev 857)
@@ -3184,7 +3184,7 @@
//Figure out which plug param (if any) is controllable using the active macro on this channel.
long activePlugParam = -1;
BYTE activeMacro = pSndFile->Chn[nChn].nActiveMacro;
- CString activeMacroString = &(pSndFile->m_MidiCfg.szMidiSFXExt[activeMacro*32]);
+ CString activeMacroString = pSndFile->m_MidiCfg.szMidiSFXExt[activeMacro];
if (pModDoc->GetMacroType(activeMacroString) == sfx_plug)
{
activePlugParam = pModDoc->MacroToPlugParam(activeMacroString);
Modified: trunk/OpenMPT/mptrack/dlg_misc.cpp
===================================================================
--- trunk/OpenMPT/mptrack/dlg_misc.cpp 2011-04-17 12:26:43 UTC (rev 856)
+++ trunk/OpenMPT/mptrack/dlg_misc.cpp 2011-04-17 14:15:48 UTC (rev 857)
@@ -676,8 +676,8 @@
ON_CBN_SELCHANGE(IDC_MACROCC, OnCCChanged)
ON_EN_CHANGE(IDC_EDIT1, OnSFxEditChanged)
ON_EN_CHANGE(IDC_EDIT2, OnZxxEditChanged)
- ON_COMMAND_RANGE(ID_PLUGSELECT, ID_PLUGSELECT+NMACROS-1, OnViewAllParams) //rewbs.patPlugName
- ON_COMMAND_RANGE(ID_PLUGSELECT+NMACROS, ID_PLUGSELECT+NMACROS+NMACROS-1, OnSetSFx) //rewbs.patPlugName
+ ON_COMMAND_RANGE(ID_PLUGSELECT, ID_PLUGSELECT + NUM_MACROS - 1, OnViewAllParams) //rewbs.patPlugName
+ ON_COMMAND_RANGE(ID_PLUGSELECT + NUM_MACROS, ID_PLUGSELECT + NUM_MACROS + NUM_MACROS - 1, OnSetSFx) //rewbs.patPlugName
END_MESSAGE_MAP()
@@ -761,18 +761,18 @@
int offsetx=108, offsety=30, separatorx=4, separatory=2,
height=18, widthMacro=30, widthVal=55, widthType=135, widthBtn=60;
- for (UINT m=0; m<NMACROS; m++)
+ for (UINT m=0; m<NUM_MACROS; m++)
{
m_EditMacro[m].Create("", /*BS_FLAT |*/ WS_CHILD | WS_VISIBLE | WS_TABSTOP /*| WS_BORDER*/,
- CRect(offsetx, offsety+m*(separatory+height), offsetx+widthMacro, offsety+m*(separatory+height)+height), this, ID_PLUGSELECT+NMACROS+m);
+ CRect(offsetx, offsety+m*(separatory+height), offsetx+widthMacro, offsety+m*(separatory+height)+height), this, ID_PLUGSELECT+NUM_MACROS+m);
m_EditMacro[m].SetFont(GetFont());
m_EditMacroType[m].Create(ES_READONLY | WS_CHILD| WS_VISIBLE | WS_TABSTOP | WS_BORDER,
- CRect(offsetx+separatorx+widthMacro, offsety+m*(separatory+height), offsetx+widthMacro+widthType, offsety+m*(separatory+height)+height), this, ID_PLUGSELECT+NMACROS+m);
+ CRect(offsetx+separatorx+widthMacro, offsety+m*(separatory+height), offsetx+widthMacro+widthType, offsety+m*(separatory+height)+height), this, ID_PLUGSELECT+NUM_MACROS+m);
m_EditMacroType[m].SetFont(GetFont());
m_EditMacroValue[m].Create(ES_CENTER | ES_READONLY | WS_CHILD | WS_VISIBLE | WS_TABSTOP | WS_BORDER,
- CRect(offsetx+separatorx+widthType+widthMacro, offsety+m*(separatory+height), offsetx+widthMacro+widthType+widthVal, offsety+m*(separatory+height)+height), this, ID_PLUGSELECT+NMACROS+m);
+ CRect(offsetx+separatorx+widthType+widthMacro, offsety+m*(separatory+height), offsetx+widthMacro+widthType+widthVal, offsety+m*(separatory+height)+height), this, ID_PLUGSELECT+NUM_MACROS+m);
m_EditMacroValue[m].SetFont(GetFont());
m_BtnMacroShowAll[m].Create("Show All...", WS_CHILD | WS_TABSTOP | WS_VISIBLE,
@@ -807,21 +807,24 @@
UINT start, end, macroType;
int selectedMacro=m_CbnSFx.GetCurSel();
- if (macro>=0 && macro<16) {
+ if (macro>=0 && macro<16)
+ {
start=macro;
end=macro;
- } else {
+ } else
+ {
start=0;
- end=NMACROS;
+ end=NUM_MACROS;
}
- for (int m=0; m<NMACROS; m++) {
+ for (int m=0; m<NUM_MACROS; m++)
+ {
//SFx
s.Format("SF%X", m);
m_EditMacro[m].SetWindowText(s);
//Macro value:
- CString macroText = &m_MidiCfg.szMidiSFXExt[m*32];
+ CString macroText = m_MidiCfg.szMidiSFXExt[m];
m_EditMacroValue[m].SetWindowText(macroText);
m_EditMacroValue[m].SetBackColor(m == selectedMacro ? RGB(200,200,225) : RGB(245,245,245) );
@@ -865,16 +868,16 @@
sfx_preset = m_CbnSFxPreset.GetCurSel();
if (sfx < 16) {
ToggleBoxes(sfx_preset, sfx);
- memcpy(s, &m_MidiCfg.szMidiSFXExt[sfx*32], 32);
- s[31] = 0;
+ memcpy(s, m_MidiCfg.szMidiSFXExt[sfx], MACRO_LENGTH);
+ s[MACRO_LENGTH - 1] = 0;
m_EditSFx.SetWindowText(s);
}
zxx = m_CbnZxx.GetCurSel();
if (zxx < 0x80)
{
- memcpy(s, &m_MidiCfg.szMidiZXXExt[zxx*32], 32);
- s[31] = 0;
+ memcpy(s, m_MidiCfg.szMidiZXXExt[zxx], MACRO_LENGTH);
+ s[MACRO_LENGTH - 1] = 0;
m_EditZxx.SetWindowText(s);
}
UpdateMacroList();
@@ -908,9 +911,10 @@
//----------------------------------
{
UINT sfx = m_CbnSFx.GetCurSel();
- if (sfx < 16) {
+ if (sfx < 16)
+ {
CString macroText;
- memcpy(macroText.GetBuffer(32), &m_MidiCfg.szMidiSFXExt[sfx*32], 32);
+ memcpy(macroText.GetBuffer(32), m_MidiCfg.szMidiSFXExt[sfx], MACRO_LENGTH);
int preset = m_pModDoc->GetMacroType(macroText);
m_CbnSFxPreset.SetCurSel(preset);
}
@@ -926,7 +930,7 @@
if (sfx < 16)
{
- CHAR *pmacro = &m_MidiCfg.szMidiSFXExt[sfx*32];
+ CHAR *pmacro = m_MidiCfg.szMidiSFXExt[sfx];
switch(sfx_preset)
{
case sfx_unused: pmacro[0] = 0; break; // unused
@@ -959,22 +963,28 @@
void CMidiMacroSetup::OnSFxEditChanged()
//--------------------------------------
{
- CHAR s[32];
+ CHAR s[MACRO_LENGTH];
UINT sfx = m_CbnSFx.GetCurSel();
if (sfx < 16)
{
memset(s, 0, sizeof(s));
- m_EditSFx.GetWindowText(s, 31);
- s[31] = 0;
- //Make all uppercase
- _strupr(s);
- //Replace Z with z.
- char* zocc = strchr(s,'Z');
- if (zocc) zocc[0]='z';
+ m_EditSFx.GetWindowText(s, MACRO_LENGTH - 1);
+ s[MACRO_LENGTH - 1] = 0;
+ // Fix letter case
+ for(size_t i = 0; i < MACRO_LENGTH; i++)
+ {
+ if(s[i] >= 'd' && s[i] <= 'f') // a,b,c have special meanings
+ {
+ s[i] = s[i] - 'a' + 'A';
+ } else if(s[i] == 'N' || s[i] == 'V' || s[i] == 'U' || s[i] == 'X' || s[i] == 'Y' || s[i] == 'Z' || s[i] == 'P')
+ {
+ s[i] = s[i] - 'A' + 'a';
+ }
+ }
- memcpy(&m_MidiCfg.szMidiSFXExt[sfx*32], s, 32);
- int sfx_preset = m_pModDoc->GetMacroType(&(m_MidiCfg.szMidiSFXExt[sfx*32]));
- //int param = m_pModDoc->MacroToPlugParam(&(m_MidiCfg.szMidiSFXExt[sfx*32]));
+ memcpy(m_MidiCfg.szMidiSFXExt[sfx], s, MACRO_LENGTH);
+ int sfx_preset = m_pModDoc->GetMacroType(m_MidiCfg.szMidiSFXExt[sfx]);
+ //int param = m_pModDoc->MacroToPlugParam(m_MidiCfg.szMidiSFXExt[sfx]);
m_CbnSFxPreset.SetCurSel(sfx_preset);
ToggleBoxes(sfx_preset, sfx);
@@ -991,15 +1001,15 @@
if (zxx < 128)
{
memset(s, 0, sizeof(s));
- m_EditZxx.GetWindowText(s, 31);
- s[31] = 0;
- memcpy(&m_MidiCfg.szMidiZXXExt[zxx*32], s, 32);
+ m_EditZxx.GetWindowText(s, MACRO_LENGTH - 1);
+ s[MACRO_LENGTH - 1] = 0;
+ memcpy(m_MidiCfg.szMidiZXXExt[zxx], s, MACRO_LENGTH);
}
}
void CMidiMacroSetup::OnSetSFx(UINT id)
{
- m_CbnSFx.SetCurSel(id-(ID_PLUGSELECT+NMACROS));
+ m_CbnSFx.SetCurSel(id-(ID_PLUGSELECT + NUM_MACROS));
OnSFxChanged();
}
@@ -1010,7 +1020,7 @@
CString message, plugName, paramName, line;
int sfx = id-ID_PLUGSELECT;
- int param = m_pModDoc->MacroToPlugParam(&(m_MidiCfg.szMidiSFXExt[sfx*32]));
+ int param = m_pModDoc->MacroToPlugParam(m_MidiCfg.szMidiSFXExt[sfx]);
CVstPlugin *pVstPlugin;
char s[256];
message.Format("These are the parameters that can be controlled by macro SF%X:\n\n",sfx);
@@ -1056,7 +1066,7 @@
AddPluginParameternamesToCombobox(m_CbnMacroParam, *pVstPlugin);
m_CbnMacroParam.SetRedraw(TRUE);
- int param = m_pModDoc->MacroToPlugParam(&(m_MidiCfg.szMidiSFXExt[m_CbnSFx.GetCurSel()*32]));
+ int param = m_pModDoc->MacroToPlugParam(m_MidiCfg.szMidiSFXExt[m_CbnSFx.GetCurSel()]);
m_CbnMacroParam.SetCurSel(param);
}
//OnPlugParamChanged();
@@ -1095,7 +1105,7 @@
m_CbnMacroPlug.EnableWindow(TRUE);
m_CbnMacroParam.EnableWindow(TRUE);
SetDlgItemText(IDC_GENMACROLABEL, "Plug/Param");
- m_CbnMacroParam.SetCurSel(m_pModDoc->MacroToPlugParam(&(m_MidiCfg.szMidiSFXExt[sfx*32])));
+ m_CbnMacroParam.SetCurSel(m_pModDoc->MacroToPlugParam(m_MidiCfg.szMidiSFXExt[sfx]));
} else {
m_CbnMacroPlug.EnableWindow(FALSE);
m_CbnMacroParam.EnableWindow(FALSE);
@@ -1107,7 +1117,7 @@
m_CbnMacroPlug.ShowWindow(FALSE);
m_CbnMacroPlug.ShowWindow(FALSE);
SetDlgItemText(IDC_GENMACROLABEL, "MIDI CC");
- m_CbnMacroCC.SetCurSel(m_pModDoc->MacroToMidiCC(&(m_MidiCfg.szMidiSFXExt[sfx*32])));
+ m_CbnMacroCC.SetCurSel(m_pModDoc->MacroToMidiCC(m_MidiCfg.szMidiSFXExt[sfx]));
} else {
m_CbnMacroCC.EnableWindow(FALSE);
}
Modified: trunk/OpenMPT/mptrack/dlg_misc.h
===================================================================
--- trunk/OpenMPT/mptrack/dlg_misc.h 2011-04-17 12:26:43 UTC (rev 856)
+++ trunk/OpenMPT/mptrack/dlg_misc.h 2011-04-17 14:15:48 UTC (rev 857)
@@ -130,8 +130,6 @@
////////////////////////////////////////////////////////////////////////
// Midi Macros (Zxx)
-#define NMACROS 16
-
//class CColourEdit;
#include "ColourEdit.h"
@@ -149,8 +147,8 @@
protected:
CComboBox m_CbnSFx, m_CbnSFxPreset, m_CbnZxx, m_CbnZxxPreset, m_CbnMacroPlug, m_CbnMacroParam, m_CbnMacroCC;
CEdit m_EditSFx, m_EditZxx;
- CColourEdit m_EditMacroValue[NMACROS], m_EditMacroType[NMACROS]; //rewbs.macroGUI
- CButton m_EditMacro[NMACROS], m_BtnMacroShowAll[NMACROS];
+ CColourEdit m_EditMacroValue[NUM_MACROS], m_EditMacroType[NUM_MACROS]; //rewbs.macroGUI
+ CButton m_EditMacro[NUM_MACROS], m_BtnMacroShowAll[NUM_MACROS];
CSoundFile *m_pSndFile;
CModDoc *m_pModDoc;
Modified: trunk/OpenMPT/soundlib/Sampleio.cpp
===================================================================
--- trunk/OpenMPT/soundlib/Sampleio.cpp 2011-04-17 12:26:43 UTC (rev 856)
+++ trunk/OpenMPT/soundlib/Sampleio.cpp 2011-04-17 14:15:48 UTC (rev 857)
@@ -113,7 +113,7 @@
// -> CODE#0003
// -> DESC="remove instrument's samples"
//rewbs: changed message
- if(removeSamples > 0 || (removeSamples == 0 && ::MessageBox(NULL, "Remove samples associated with an instrument if it is unused?", "Removing instrument", MB_YESNO | MB_ICONQUESTION) == IDYES))
+ if(removeSamples > 0 || (removeSamples == 0 && ::MessageBox(NULL, "Remove samples associated with an instrument if they are unused?", "Removing instrument", MB_YESNO | MB_ICONQUESTION) == IDYES))
{
RemoveInstrumentSamples(nInstr);
}
@@ -505,7 +505,7 @@
// xtra field
if (pxh)
{
- if (m_nType > MOD_TYPE_S3M)
+ if (!(GetType() & (MOD_TYPE_MOD|MOD_TYPE_S3M)))
{
if (pxh->dwFlags & CHN_PINGPONGLOOP) pSmp->uFlags |= CHN_PINGPONGLOOP;
if (pxh->dwFlags & CHN_SUSTAINLOOP) pSmp->uFlags |= CHN_SUSTAINLOOP;
Modified: trunk/OpenMPT/soundlib/Snd_fx.cpp
===================================================================
--- trunk/OpenMPT/soundlib/Snd_fx.cpp 2011-04-17 12:26:43 UTC (rev 856)
+++ trunk/OpenMPT/soundlib/Snd_fx.cpp 2011-04-17 14:15:48 UTC (rev 857)
@@ -2106,9 +2106,9 @@
if((cmd == CMD_MIDI) && !(m_dwSongFlags & SONG_FIRSTTICK)) break;
if (param < 0x80)
- ProcessMidiMacro(nChn, (cmd == CMD_SMOOTHMIDI), &m_MidiCfg.szMidiSFXExt[pChn->nActiveMacro << 5], param);
+ ProcessMidiMacro(nChn, (cmd == CMD_SMOOTHMIDI), m_MidiCfg.szMidiSFXExt[pChn->nActiveMacro], param);
else
- ProcessMidiMacro(nChn, (cmd == CMD_SMOOTHMIDI), &m_MidiCfg.szMidiZXXExt[(param & 0x7F) << 5], 0);
+ ProcessMidiMacro(nChn, (cmd == CMD_SMOOTHMIDI), m_MidiCfg.szMidiZXXExt[(param & 0x7F)], 0);
break;
// IMF Commands
Modified: trunk/OpenMPT/soundlib/Sndfile.cpp
===================================================================
--- trunk/OpenMPT/soundlib/Sndfile.cpp 2011-04-17 12:26:43 UTC (rev 856)
+++ trunk/OpenMPT/soundlib/Sndfile.cpp 2011-04-17 14:15:48 UTC (rev 857)
@@ -925,14 +925,14 @@
void CSoundFile::ResetMidiCfg()
//-----------------------------
{
- memset(&m_MidiCfg, 0, sizeof(m_MidiCfg));
- lstrcpy(&m_MidiCfg.szMidiGlb[MIDIOUT_START*32], "FF");
- lstrcpy(&m_MidiCfg.szMidiGlb[MIDIOUT_STOP*32], "FC");
- lstrcpy(&m_MidiCfg.szMidiGlb[MIDIOUT_NOTEON*32], "9c n v");
- lstrcpy(&m_MidiCfg.szMidiGlb[MIDIOUT_NOTEOFF*32], "9c n 0");
- lstrcpy(&m_MidiCfg.szMidiGlb[MIDIOUT_PROGRAM*32], "Cc p");
- lstrcpy(&m_MidiCfg.szMidiSFXExt[0], "F0F000z");
- for (int iz=0; iz<16; iz++) wsprintf(&m_MidiCfg.szMidiZXXExt[iz*32], "F0F001%02X", iz*8);
+ MemsetZero(m_MidiCfg);
+ lstrcpy(m_MidiCfg.szMidiGlb[MIDIOUT_START], "FF");
+ lstrcpy(m_MidiCfg.szMidiGlb[MIDIOUT_STOP], "FC");
+ lstrcpy(m_MidiCfg.szMidiGlb[MIDIOUT_NOTEON], "9c n v");
+ lstrcpy(m_MidiCfg.szMidiGlb[MIDIOUT_NOTEOFF], "9c n 0");
+ lstrcpy(m_MidiCfg.szMidiGlb[MIDIOUT_PROGRAM], "Cc p");
+ lstrcpy(m_MidiCfg.szMidiSFXExt[0], "F0F000z");
+ for (int iz=0; iz<16; iz++) wsprintf(m_MidiCfg.szMidiZXXExt[iz], "F0F001%02X", iz*8);
}
Modified: trunk/OpenMPT/soundlib/Sndfile.h
===================================================================
--- trunk/OpenMPT/soundlib/Sndfile.h 2011-04-17 12:26:43 UTC (rev 856)
+++ trunk/OpenMPT/soundlib/Sndfile.h 2011-04-17 14:15:48 UTC (rev 857)
@@ -447,11 +447,12 @@
#define NUM_MACROS 16 // number of parametered macros
+#define MACRO_LENGTH 32 // max number of chars per macro
struct MODMIDICFG
{
- CHAR szMidiGlb[9*32];
- CHAR szMidiSFXExt[16*32];
- CHAR szMidiZXXExt[128*32];
+ CHAR szMidiGlb[9][MACRO_LENGTH];
+ CHAR szMidiSFXExt[16][MACRO_LENGTH];
+ CHAR szMidiZXXExt[128][MACRO_LENGTH];
};
typedef MODMIDICFG* LPMODMIDICFG;
STATIC_ASSERT(sizeof(MODMIDICFG) == 4896); // this is directly written to files, so the size must be correct!
@@ -654,7 +655,7 @@
UINT m_nMaxOrderPosition, m_nPatternNames;
LPSTR m_lpszSongComments, m_lpszPatternNames;
UINT ChnMix[MAX_CHANNELS]; // Channels to be mixed
- MODCHANNEL Chn[MAX_CHANNELS]; // Mixing channels
+ MODCHANNEL Chn[MAX_CHANNELS]; // Mixing channels... First m_nChannel channels are master channels (i.e. they are never NNA channels)!
MODCHANNELSETTINGS ChnSettings[MAX_BASECHANNELS]; // Initial channels settings
CPatternContainer Patterns; // Patterns
ModSequenceSet Order; // Modsequences. Order[x] returns an index of a pattern located at order x of the current sequence.
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <sag...@us...> - 2011-04-17 12:26:49
|
Revision: 856
http://modplug.svn.sourceforge.net/modplug/?rev=856&view=rev
Author: saga-games
Date: 2011-04-17 12:26:43 +0000 (Sun, 17 Apr 2011)
Log Message:
-----------
[Fix] Whoops, the refactoring broke RemoveSelectedSamples()
Modified Paths:
--------------
trunk/OpenMPT/soundlib/Sndfile.cpp
Modified: trunk/OpenMPT/soundlib/Sndfile.cpp
===================================================================
--- trunk/OpenMPT/soundlib/Sndfile.cpp 2011-04-14 14:23:39 UTC (rev 855)
+++ trunk/OpenMPT/soundlib/Sndfile.cpp 2011-04-17 12:26:43 UTC (rev 856)
@@ -2615,8 +2615,12 @@
SAMPLEINDEX CSoundFile::RemoveSelectedSamples(const vector<bool> &keepSamples)
//----------------------------------------------------------------------------
{
+ if(keepSamples.empty())
+ {
+ return 0;
+ }
SAMPLEINDEX nRemoved = 0;
- for (SAMPLEINDEX nSmp = (SAMPLEINDEX)min(MAX_SAMPLES - 1, keepSamples.size()); nSmp >= 1; nSmp--)
+ for (SAMPLEINDEX nSmp = (SAMPLEINDEX)min(GetNumSamples(), keepSamples.size() - 1); nSmp >= 1; nSmp--)
{
if(!keepSamples[nSmp])
{
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <sag...@us...> - 2011-04-14 14:23:46
|
Revision: 855
http://modplug.svn.sourceforge.net/modplug/?rev=855&view=rev
Author: saga-games
Date: 2011-04-14 14:23:39 +0000 (Thu, 14 Apr 2011)
Log Message:
-----------
[Fix] Song Cleanup: When converting instruments to samples, "Remove samples associated with an instrument" actually destroyed all samples. Removed this checkbox as the sample cleanup options can be used to do the same.
[Ref] More code cleanup...
Modified Paths:
--------------
trunk/OpenMPT/mptrack/CleanupSong.cpp
trunk/OpenMPT/soundlib/Sampleio.cpp
trunk/OpenMPT/soundlib/Sndfile.cpp
trunk/OpenMPT/soundlib/Sndfile.h
trunk/OpenMPT/soundlib/modsmp_ctrl.cpp
Modified: trunk/OpenMPT/mptrack/CleanupSong.cpp
===================================================================
--- trunk/OpenMPT/mptrack/CleanupSong.cpp 2011-04-13 20:38:28 UTC (rev 854)
+++ trunk/OpenMPT/mptrack/CleanupSong.cpp 2011-04-14 14:23:39 UTC (rev 855)
@@ -528,23 +528,20 @@
if(pSndFile == nullptr) return false;
CHAR s[512];
- vector<bool> samplesUsed;
- int nRemoved = 0;
- samplesUsed.resize(pSndFile->GetNumSamples() + 1, false);
+ vector<bool> samplesUsed(pSndFile->GetNumSamples() + 1, true);
BeginWaitCursor();
- for (SAMPLEINDEX nSmp = pSndFile->m_nSamples; nSmp >= 1; nSmp--) if (pSndFile->Samples[nSmp].pSample)
+ for (SAMPLEINDEX nSmp = pSndFile->GetNumSamples(); nSmp >= 1; nSmp--) if (pSndFile->Samples[nSmp].pSample)
{
if (!pSndFile->IsSampleUsed(nSmp))
{
+ samplesUsed[nSmp] = false;
m_pModDoc->GetSampleUndo()->PrepareUndo(nSmp, sundo_delete);
- BEGIN_CRITICAL();
- pSndFile->DestroySample(nSmp);
- if ((nSmp == pSndFile->m_nSamples) && (nSmp > 1)) pSndFile->m_nSamples--;
- END_CRITICAL();
- nRemoved++;
}
}
+ BEGIN_CRITICAL();
+ SAMPLEINDEX nRemoved = pSndFile->RemoveSelectedSamples(samplesUsed);
+ END_CRITICAL();
SAMPLEINDEX nExt = pSndFile->DetectUnusedSamples(samplesUsed);
@@ -569,7 +566,7 @@
m_pModDoc->GetSampleUndo()->ClearUndo(nSmp);
}
}
- wsprintf(s, "%d unused sample%s removed\n" ,nRemoved, (nRemoved == 1) ? "" : "s");
+ wsprintf(s, "%d unused sample%s removed\n" , nRemoved, (nRemoved == 1) ? "" : "s");
m_pModDoc->AddToLog(s);
return true;
}
@@ -971,19 +968,17 @@
CSoundFile *pSndFile = m_pModDoc->GetSoundFile();
if(pSndFile == nullptr) return false;
- if (pSndFile->m_nSamples == 0) return false;
- for (SAMPLEINDEX nSmp = 1; nSmp <= pSndFile->m_nSamples; nSmp++)
+ if (pSndFile->GetNumSamples() == 0) return false;
+ vector<bool> keepSamples(pSndFile->GetNumSamples() + 1, false);
+
+ for (SAMPLEINDEX nSmp = 1; nSmp <= pSndFile->GetNumSamples(); nSmp++)
{
m_pModDoc->GetSampleUndo()->PrepareUndo(nSmp, sundo_delete, 0, pSndFile->Samples[nSmp].nLength);
- if(pSndFile->Samples[nSmp].pSample)
- {
- BEGIN_CRITICAL();
- pSndFile->DestroySample(nSmp);
- END_CRITICAL();
- }
}
ctrlSmp::ResetSamples(*pSndFile, ctrlSmp::SmpResetInit);
- pSndFile->m_nSamples = 1;
+ BEGIN_CRITICAL();
+ pSndFile->RemoveSelectedSamples(keepSamples);
+ END_CRITICAL();
return true;
}
@@ -994,27 +989,20 @@
CSoundFile *pSndFile = m_pModDoc->GetSoundFile();
if(pSndFile == nullptr) return false;
- if (pSndFile->m_nInstruments == 0) return false;
+ if (pSndFile->GetNumInstruments() == 0) return false;
- char removeSamples = -1;
if(bConfirm)
{
- if (CMainFrame::GetMainFrame()->MessageBox("Do you want to convert all instruments to samples ?\n",
+ if (CMainFrame::GetMainFrame()->MessageBox("Do you want to convert all instruments to samples?",
"Removing all instruments", MB_YESNO | MB_ICONQUESTION) == IDYES)
{
m_pModDoc->ConvertInstrumentsToSamples();
}
-
- if (::MessageBox(NULL, "Remove samples associated with an instrument if they are unused?", "Removing all instruments", MB_YESNO | MB_ICONQUESTION) == IDYES) {
- removeSamples = 1;
- }
}
- if(removeSamples == -1) m_pModDoc->GetSampleUndo()->ClearUndo();
-
- for (INSTRUMENTINDEX i = 1; i <= pSndFile->m_nInstruments; i++)
+ for (INSTRUMENTINDEX i = 1; i <= pSndFile->GetNumInstruments(); i++)
{
- pSndFile->DestroyInstrument(i, removeSamples);
+ pSndFile->DestroyInstrument(i, -1);
}
pSndFile->m_nInstruments = 0;
Modified: trunk/OpenMPT/soundlib/Sampleio.cpp
===================================================================
--- trunk/OpenMPT/soundlib/Sampleio.cpp 2011-04-13 20:38:28 UTC (rev 854)
+++ trunk/OpenMPT/soundlib/Sampleio.cpp 2011-04-14 14:23:39 UTC (rev 855)
@@ -113,8 +113,10 @@
// -> CODE#0003
// -> DESC="remove instrument's samples"
//rewbs: changed message
- if(removeSamples > 0 || (removeSamples == 0 && ::MessageBox(NULL, "Remove samples associated with an instrument if they are unused?", "Removing instrument", MB_YESNO | MB_ICONQUESTION) == IDYES))
+ if(removeSamples > 0 || (removeSamples == 0 && ::MessageBox(NULL, "Remove samples associated with an instrument if it is unused?", "Removing instrument", MB_YESNO | MB_ICONQUESTION) == IDYES))
+ {
RemoveInstrumentSamples(nInstr);
+ }
// -! BEHAVIOUR_CHANGE#0003
// -> CODE#0023
@@ -146,8 +148,7 @@
bool CSoundFile::RemoveInstrumentSamples(INSTRUMENTINDEX nInstr)
//--------------------------------------------------------------
{
- vector<bool> sampleused;
- sampleused.resize(GetNumSamples() + 1, false);
+ vector<bool> sampleused(GetNumSamples() + 1, false);
if (Instruments[nInstr])
{
@@ -169,7 +170,7 @@
for (SAMPLEINDEX nSmp = 1; nSmp <= GetNumSamples(); nSmp++) if (sampleused[nSmp])
{
DestroySample(nSmp);
- m_szNames[nSmp][0] = 0;
+ strcpy(m_szNames[nSmp], "");
}
return true;
}
Modified: trunk/OpenMPT/soundlib/Sndfile.cpp
===================================================================
--- trunk/OpenMPT/soundlib/Sndfile.cpp 2011-04-13 20:38:28 UTC (rev 854)
+++ trunk/OpenMPT/soundlib/Sndfile.cpp 2011-04-14 14:23:39 UTC (rev 855)
@@ -2505,16 +2505,19 @@
#ifndef FASTSOUNDLIB
-bool CSoundFile::IsSampleUsed(SAMPLEINDEX nSample)
-//------------------------------------------------
+// Check whether a sample is used.
+// In sample mode, the sample numbers in all patterns are checked.
+// In instrument mode, it is only checked if a sample is referenced by an instrument (but not if the sample is actually played anywhere)
+bool CSoundFile::IsSampleUsed(SAMPLEINDEX nSample) const
+//------------------------------------------------------
{
- if ((!nSample) || (nSample > m_nSamples)) return false;
- if (m_nInstruments)
+ if ((!nSample) || (nSample > GetNumSamples())) return false;
+ if (GetNumInstruments())
{
- for (UINT i=1; i<=m_nInstruments; i++) if (Instruments[i])
+ for (UINT i = 1; i <= GetNumInstruments(); i++) if (Instruments[i])
{
MODINSTRUMENT *pIns = Instruments[i];
- for (UINT j=0; j<128; j++)
+ for (UINT j = 0; j < CountOf(pIns->Keyboard); j++)
{
if (pIns->Keyboard[j] == nSample) return true;
}
@@ -2523,7 +2526,7 @@
{
for (UINT i=0; i<Patterns.Size(); i++) if (Patterns[i])
{
- MODCOMMAND *m = Patterns[i];
+ const MODCOMMAND *m = Patterns[i];
for (UINT j=m_nChannels*Patterns[i].GetNumRows(); j; m++, j--)
{
if (m->instr == nSample && !m->IsPcNote()) return true;
@@ -2534,13 +2537,13 @@
}
-bool CSoundFile::IsInstrumentUsed(INSTRUMENTINDEX nInstr)
-//-------------------------------------------------------
+bool CSoundFile::IsInstrumentUsed(INSTRUMENTINDEX nInstr) const
+//-------------------------------------------------------------
{
- if ((!nInstr) || (nInstr > m_nInstruments) || (!Instruments[nInstr])) return false;
+ if ((!nInstr) || (nInstr > GetNumInstruments()) || (!Instruments[nInstr])) return false;
for (UINT i=0; i<Patterns.Size(); i++) if (Patterns[i])
{
- MODCOMMAND *m = Patterns[i];
+ const MODCOMMAND *m = Patterns[i];
for (UINT j=m_nChannels*Patterns[i].GetNumRows(); j; m++, j--)
{
if (m->instr == nInstr && !m->IsPcNote()) return true;
@@ -2550,8 +2553,10 @@
}
-SAMPLEINDEX CSoundFile::DetectUnusedSamples(vector<bool> &sampleUsed)
-//-------------------------------------------------------------------
+// Detect samples are are referenced by an instrument, but actually not used in a song.
+// Only works in instrument mode. Unused samples are marked as false in the vector.
+SAMPLEINDEX CSoundFile::DetectUnusedSamples(vector<bool> &sampleUsed) const
+//-------------------------------------------------------------------------
{
sampleUsed.assign(GetNumSamples() + 1, false);
@@ -2606,19 +2611,23 @@
}
-bool CSoundFile::RemoveSelectedSamples(bool *pbIns)
-//-------------------------------------------------
+// Destroy samples where keepSamples index is false. First sample is keepSamples[1]!
+SAMPLEINDEX CSoundFile::RemoveSelectedSamples(const vector<bool> &keepSamples)
+//----------------------------------------------------------------------------
{
- if (!pbIns) return false;
- for (SAMPLEINDEX nSmp=1; nSmp<MAX_SAMPLES; nSmp++)
+ SAMPLEINDEX nRemoved = 0;
+ for (SAMPLEINDEX nSmp = (SAMPLEINDEX)min(MAX_SAMPLES - 1, keepSamples.size()); nSmp >= 1; nSmp--)
{
- if ((!pbIns[nSmp]) && (Samples[nSmp].pSample))
+ if(!keepSamples[nSmp])
{
- DestroySample(nSmp);
- if ((nSmp == m_nSamples) && (nSmp > 1)) m_nSamples--;
+ if(DestroySample(nSmp))
+ {
+ nRemoved++;
+ }
+ if((nSmp == GetNumSamples()) && (nSmp > 1)) m_nSamples--;
}
}
- return true;
+ return nRemoved;
}
Modified: trunk/OpenMPT/soundlib/Sndfile.h
===================================================================
--- trunk/OpenMPT/soundlib/Sndfile.h 2011-04-13 20:38:28 UTC (rev 854)
+++ trunk/OpenMPT/soundlib/Sndfile.h 2011-04-14 14:23:39 UTC (rev 855)
@@ -948,11 +948,11 @@
//BOOL DestroyInstrument(UINT nInstr);
bool DestroyInstrument(INSTRUMENTINDEX nInstr, char removeSamples = 0);
// -! BEHAVIOUR_CHANGE#0003
- bool IsSampleUsed(SAMPLEINDEX nSample);
- bool IsInstrumentUsed(INSTRUMENTINDEX nInstr);
+ bool IsSampleUsed(SAMPLEINDEX nSample) const;
+ bool IsInstrumentUsed(INSTRUMENTINDEX nInstr) const;
bool RemoveInstrumentSamples(INSTRUMENTINDEX nInstr);
- SAMPLEINDEX DetectUnusedSamples(vector<bool> &sampleUsed);
- bool RemoveSelectedSamples(bool *pbIns);
+ SAMPLEINDEX DetectUnusedSamples(vector<bool> &sampleUsed) const;
+ SAMPLEINDEX RemoveSelectedSamples(const vector<bool> &keepSamples);
void AdjustSampleLoop(MODSAMPLE *pSmp);
// Samples file I/O
bool ReadSampleFromFile(SAMPLEINDEX nSample, LPBYTE lpMemFile, DWORD dwFileLength);
Modified: trunk/OpenMPT/soundlib/modsmp_ctrl.cpp
===================================================================
--- trunk/OpenMPT/soundlib/modsmp_ctrl.cpp 2011-04-13 20:38:28 UTC (rev 854)
+++ trunk/OpenMPT/soundlib/modsmp_ctrl.cpp 2011-04-14 14:23:39 UTC (rev 855)
@@ -226,6 +226,8 @@
switch(resetflag)
{
case SmpResetInit:
+ strcpy(rSndFile.m_szNames[i], "");
+ strcpy(rSndFile.Samples[i].filename, "");
rSndFile.Samples[i].nC5Speed = 8363;
// note: break is left out intentionally. keep this order or c&p the stuff from below if you change anything!
case SmpResetCompo:
@@ -411,7 +413,7 @@
template <class T>
void UnsignSampleImpl(T* pStart, T nOffset, const SmpLength nLength)
-//---------------------------------------------------------------------
+//------------------------------------------------------------------
{
for(SmpLength i = 0; i < nLength; i++)
{
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <sag...@us...> - 2011-04-13 20:38:35
|
Revision: 854
http://modplug.svn.sourceforge.net/modplug/?rev=854&view=rev
Author: saga-games
Date: 2011-04-13 20:38:28 +0000 (Wed, 13 Apr 2011)
Log Message:
-----------
[Fix] XM Saving: In compatible mode, the number of samples per instrument is now limited to 16.
[Ref] Eliminating more duplicate code...
Modified Paths:
--------------
trunk/OpenMPT/mptrack/CleanupSong.cpp
trunk/OpenMPT/soundlib/Load_xm.cpp
trunk/OpenMPT/soundlib/Sndfile.cpp
trunk/OpenMPT/soundlib/Sndfile.h
Modified: trunk/OpenMPT/mptrack/CleanupSong.cpp
===================================================================
--- trunk/OpenMPT/mptrack/CleanupSong.cpp 2011-04-13 20:00:31 UTC (rev 853)
+++ trunk/OpenMPT/mptrack/CleanupSong.cpp 2011-04-13 20:38:28 UTC (rev 854)
@@ -528,10 +528,9 @@
if(pSndFile == nullptr) return false;
CHAR s[512];
- vector<bool> bIns;
- int nExt = 0;
+ vector<bool> samplesUsed;
int nRemoved = 0;
- bIns.resize(pSndFile->GetNumSamples() + 1, false);
+ samplesUsed.resize(pSndFile->GetNumSamples() + 1, false);
BeginWaitCursor();
for (SAMPLEINDEX nSmp = pSndFile->m_nSamples; nSmp >= 1; nSmp--) if (pSndFile->Samples[nSmp].pSample)
@@ -546,49 +545,12 @@
nRemoved++;
}
}
- if (pSndFile->m_nInstruments)
- {
- for (PATTERNINDEX nPat = 0; nPat < pSndFile->GetNumPatterns(); nPat++)
- {
- MODCOMMAND *p = pSndFile->Patterns[nPat];
- if (p)
- {
- UINT jmax = pSndFile->Patterns[nPat].GetNumRows() * pSndFile->GetNumChannels();
- for (UINT j=0; j<jmax; j++, p++)
- {
- if ((p->note) && (p->note <= NOTE_MAX) && (!p->IsPcNote()))
- {
- if ((p->instr) && (p->instr < MAX_INSTRUMENTS))
- {
- MODINSTRUMENT *pIns = pSndFile->Instruments[p->instr];
- if (pIns)
- {
- UINT n = pIns->Keyboard[p->note-1];
- if (n <= pSndFile->GetNumSamples()) bIns[n] = true;
- }
- } else
- {
- for (UINT k=1; k<=pSndFile->m_nInstruments; k++)
- {
- MODINSTRUMENT *pIns = pSndFile->Instruments[k];
- if (pIns)
- {
- UINT n = pIns->Keyboard[p->note-1];
- if (n <= pSndFile->GetNumSamples()) bIns[n] = true;
- }
- }
- }
- }
- }
- }
- }
- for (SAMPLEINDEX ichk = 1; ichk <= pSndFile->GetNumSamples(); ichk++)
- {
- if ((!bIns[ichk]) && (pSndFile->Samples[ichk].pSample)) nExt++;
- }
- }
+
+ SAMPLEINDEX nExt = pSndFile->DetectUnusedSamples(samplesUsed);
+
EndWaitCursor();
- if (nExt && !((pSndFile->GetType() == MOD_TYPE_IT) && (pSndFile->m_dwSongFlags & SONG_ITPROJECT)))
+
+ if (nExt && !((pSndFile->GetType() == MOD_TYPE_IT) && (pSndFile->m_dwSongFlags & SONG_ITPROJECT)))
{ //We don't remove an instrument's unused samples in an ITP.
wsprintf(s, "OpenMPT detected %d sample%s referenced by an instrument,\n"
"but not used in the song. Do you want to remove them?", nExt, (nExt == 1) ? "" : "s");
@@ -596,7 +558,7 @@
{
for (SAMPLEINDEX nSmp = 1; nSmp <= pSndFile->GetNumSamples(); nSmp++)
{
- if ((!bIns[nSmp]) && (pSndFile->Samples[nSmp].pSample))
+ if ((!samplesUsed[nSmp]) && (pSndFile->Samples[nSmp].pSample))
{
m_pModDoc->GetSampleUndo()->PrepareUndo(nSmp, sundo_delete);
BEGIN_CRITICAL();
Modified: trunk/OpenMPT/soundlib/Load_xm.cpp
===================================================================
--- trunk/OpenMPT/soundlib/Load_xm.cpp 2011-04-13 20:00:31 UTC (rev 853)
+++ trunk/OpenMPT/soundlib/Load_xm.cpp 2011-04-13 20:38:28 UTC (rev 854)
@@ -175,7 +175,7 @@
p->command = src[j++];
p->param = src[j++];
}
- if (p->note == 97) p->note = 0xFF; else
+ if (p->note == 97) p->note = NOTE_KEYOFF; else
if ((p->note) && (p->note < 97)) p->note += 12;
if (p->command | p->param) pSndFile->ConvertModCommand(p);
if (p->instr == 0xff) p->instr = 0;
@@ -241,8 +241,6 @@
XMSAMPLEHEADER xmsh;
XMSAMPLESTRUCT xmss;
DWORD dwMemPos;
- BYTE samples_used[(MAX_SAMPLES + 7) / 8]; // for removing unused samples
- UINT unused_samples; // dito
bool bMadeWithModPlug = false, bProbablyMadeWithModPlug = false, bProbablyMPT109 = false, bIsFT2 = false;
@@ -300,8 +298,8 @@
if(dwMemPos == 0) return true;
}
- memset(samples_used, 0, sizeof(samples_used));
- unused_samples = 0;
+ vector<bool> samples_used; // for removing unused samples
+ SAMPLEINDEX unused_samples = 0; // dito
// Reading instruments
for (INSTRUMENTINDEX iIns = 1; iIns <= m_nInstruments; iIns++)
@@ -316,7 +314,7 @@
DWORD ihsize = LittleEndian(*((DWORD *)(lpStream + dwMemPos)));
if (dwMemPos + ihsize > dwMemLength) return true;
- memset(&pih, 0, sizeof(pih));
+ MemsetZero(pih);
memcpy(&pih, lpStream + dwMemPos, min(sizeof(pih), ihsize));
if ((Instruments[iIns] = new MODINSTRUMENT) == nullptr) continue;
@@ -357,6 +355,7 @@
bIsFT2 = true; // definitely not MPT. (or any other tracker)
}
+
if (LittleEndian(pih.size))
dwMemPos += LittleEndian(pih.size);
else
@@ -400,14 +399,14 @@
if (!unused_samples)
{
unused_samples = DetectUnusedSamples(samples_used);
- if (!unused_samples) unused_samples = 0xFFFF;
+ if (!unused_samples) unused_samples = SAMPLEINDEX_INVALID;
}
- if ((unused_samples) && (unused_samples != 0xFFFF))
+ if ((unused_samples) && (unused_samples != SAMPLEINDEX_INVALID))
{
- for (UINT iext=m_nSamples; iext>=1; iext--) if (0 == (samples_used[iext>>3] & (1<<(iext&7))))
+ for (UINT iext=m_nSamples; iext>=1; iext--) if (!samples_used[iext])
{
unused_samples--;
- samples_used[iext>>3] |= (1<<(iext&7));
+ samples_used[iext] = true;
DestroySample(iext);
n = iext;
for (UINT mapchk=0; mapchk<nmap; mapchk++)
@@ -422,7 +421,7 @@
if (pks->Keyboard[ks] == n) pks->Keyboard[ks] = 0;
}
}
- memset(&Samples[n], 0, sizeof(Samples[0]));
+ MemsetZero(Samples[n]);
break;
}
}
@@ -836,7 +835,7 @@
UINT param = ModSaveCommand(p, true, bCompatibilityExport);
UINT command = param >> 8;
param &= 0xFF;
- if (note >= 0xFE) note = 97; else
+ if (note >= NOTE_MIN_SPECIAL) note = 97; else
if ((note <= 12) || (note > 96+12)) note = 0; else
note -= 12;
UINT vol = 0;
@@ -993,7 +992,7 @@
smptable[xmih.samples++] = sample; //record in instrument's sample table
}
- if (xmih.samples >= 32) break;
+ if ((xmih.samples >= 32) || (xmih.samples >= 16 && bCompatibilityExport)) break;
xmsh.snum[j] = k; //record sample table offset in instrument's note map
}
}
Modified: trunk/OpenMPT/soundlib/Sndfile.cpp
===================================================================
--- trunk/OpenMPT/soundlib/Sndfile.cpp 2011-04-13 20:00:31 UTC (rev 853)
+++ trunk/OpenMPT/soundlib/Sndfile.cpp 2011-04-13 20:38:28 UTC (rev 854)
@@ -2550,54 +2550,58 @@
}
-UINT CSoundFile::DetectUnusedSamples(BYTE *pbIns)
-//-----------------------------------------------
+SAMPLEINDEX CSoundFile::DetectUnusedSamples(vector<bool> &sampleUsed)
+//-------------------------------------------------------------------
{
- UINT nExt = 0;
+ sampleUsed.assign(GetNumSamples() + 1, false);
- if (!pbIns) return 0;
- if (m_nInstruments)
+ if(GetNumInstruments() == 0)
{
- memset(pbIns, 0, (MAX_SAMPLES+7)/8);
- for (UINT ipat=0; ipat<Patterns.Size(); ipat++)
+ return 0;
+ }
+ SAMPLEINDEX nExt = 0;
+
+ for (PATTERNINDEX nPat = 0; nPat < GetNumPatterns(); nPat++)
+ {
+ const MODCOMMAND *p = Patterns[nPat];
+ if(p == nullptr)
{
- MODCOMMAND *p = Patterns[ipat];
- if (p)
+ continue;
+ }
+
+ UINT jmax = Patterns[nPat].GetNumRows() * GetNumChannels();
+ for (UINT j=0; j<jmax; j++, p++)
+ {
+ if ((p->note) && (p->note <= NOTE_MAX) && (!p->IsPcNote()))
{
- UINT jmax = Patterns[ipat].GetNumRows() * m_nChannels;
- for (UINT j=0; j<jmax; j++, p++)
+ if ((p->instr) && (p->instr < MAX_INSTRUMENTS))
{
- if ((p->note) && (p->note <= NOTE_MAX))
+ MODINSTRUMENT *pIns = Instruments[p->instr];
+ if (pIns)
{
- if ((p->instr) && (p->instr < MAX_INSTRUMENTS))
+ SAMPLEINDEX n = pIns->Keyboard[p->note-1];
+ if (n <= GetNumSamples()) sampleUsed[n] = true;
+ }
+ } else
+ {
+ for (INSTRUMENTINDEX k = GetNumInstruments(); k >= 1; k--)
+ {
+ MODINSTRUMENT *pIns = Instruments[k];
+ if (pIns)
{
- MODINSTRUMENT *pIns = Instruments[p->instr];
- if (pIns)
- {
- UINT n = pIns->Keyboard[p->note-1];
- if (n < MAX_SAMPLES) pbIns[n>>3] |= 1<<(n&7);
- }
- } else
- {
- for (UINT k=1; k<=m_nInstruments; k++)
- {
- MODINSTRUMENT *pIns = Instruments[k];
- if (pIns)
- {
- UINT n = pIns->Keyboard[p->note-1];
- if (n < MAX_SAMPLES) pbIns[n>>3] |= 1<<(n&7);
- }
- }
+ SAMPLEINDEX n = pIns->Keyboard[p->note-1];
+ if (n <= GetNumSamples()) sampleUsed[n] = true;
}
}
}
}
}
- for (UINT ichk=1; ichk<=m_nSamples; ichk++)
- {
- if ((0 == (pbIns[ichk>>3]&(1<<(ichk&7)))) && (Samples[ichk].pSample)) nExt++;
- }
}
+ for (SAMPLEINDEX ichk = GetNumSamples(); ichk >= 1; ichk--)
+ {
+ if ((!sampleUsed[ichk]) && (Samples[ichk].pSample)) nExt++;
+ }
+
return nExt;
}
Modified: trunk/OpenMPT/soundlib/Sndfile.h
===================================================================
--- trunk/OpenMPT/soundlib/Sndfile.h 2011-04-13 20:00:31 UTC (rev 853)
+++ trunk/OpenMPT/soundlib/Sndfile.h 2011-04-13 20:38:28 UTC (rev 854)
@@ -951,7 +951,7 @@
bool IsSampleUsed(SAMPLEINDEX nSample);
bool IsInstrumentUsed(INSTRUMENTINDEX nInstr);
bool RemoveInstrumentSamples(INSTRUMENTINDEX nInstr);
- UINT DetectUnusedSamples(BYTE *); // bitmask
+ SAMPLEINDEX DetectUnusedSamples(vector<bool> &sampleUsed);
bool RemoveSelectedSamples(bool *pbIns);
void AdjustSampleLoop(MODSAMPLE *pSmp);
// Samples file I/O
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <sag...@us...> - 2011-04-13 20:00:38
|
Revision: 853
http://modplug.svn.sourceforge.net/modplug/?rev=853&view=rev
Author: saga-games
Date: 2011-04-13 20:00:31 +0000 (Wed, 13 Apr 2011)
Log Message:
-----------
[Fix] The VST fix from rev. 844 actually broke VSTi playing.
[Mod] OpenMPT: Version is now 1.19.01.03
Modified Paths:
--------------
trunk/OpenMPT/mptrack/AbstractVstEditor.cpp
trunk/OpenMPT/mptrack/version.h
Modified: trunk/OpenMPT/mptrack/AbstractVstEditor.cpp
===================================================================
--- trunk/OpenMPT/mptrack/AbstractVstEditor.cpp 2011-04-13 17:44:31 UTC (rev 852)
+++ trunk/OpenMPT/mptrack/AbstractVstEditor.cpp 2011-04-13 20:00:31 UTC (rev 853)
@@ -367,25 +367,30 @@
m_nInstrument = GetBestInstrumentCandidate();
//only show messagebox if plug is able to process notes.
- if(m_nInstrument < 0 && m_pVstPlugin->CanRecieveMidiEvents())
+ if(m_nInstrument < 0)
{
- CModDoc *pModDoc = m_pVstPlugin->GetModDoc();
- if(pModDoc == nullptr)
- return false;
+ if(m_pVstPlugin->CanRecieveMidiEvents())
+ {
+ CModDoc *pModDoc = m_pVstPlugin->GetModDoc();
+ if(pModDoc == nullptr)
+ return false;
- if(!m_pVstPlugin->isInstrument() || pModDoc->GetSoundFile()->GetModSpecifications().instrumentsMax == 0 ||
- AfxMessageBox(_T("You need to assign an instrument to this plugin before you can play notes from here.\nCreate a new instrument and assign this plugin to the instrument?"), MB_YESNO | MB_ICONQUESTION) == IDNO)
+ if(!m_pVstPlugin->isInstrument() || pModDoc->GetSoundFile()->GetModSpecifications().instrumentsMax == 0 ||
+ AfxMessageBox(_T("You need to assign an instrument to this plugin before you can play notes from here.\nCreate a new instrument and assign this plugin to the instrument?"), MB_YESNO | MB_ICONQUESTION) == IDNO)
+ {
+ return false;
+ } else
+ {
+ return CreateInstrument();
+ }
+ } else
{
+ // Can't process notes
return false;
- } else
- {
- return CreateInstrument();
}
} else
{
- // used to return true but that doesn't make sense to me.
- // if this is true, random (sample) channels will be retriggered when pressing notes in the editor...
- return false;
+ return true;
}
}
Modified: trunk/OpenMPT/mptrack/version.h
===================================================================
--- trunk/OpenMPT/mptrack/version.h 2011-04-13 17:44:31 UTC (rev 852)
+++ trunk/OpenMPT/mptrack/version.h 2011-04-13 20:00:31 UTC (rev 853)
@@ -15,7 +15,7 @@
#define VER_MAJORMAJOR 1
#define VER_MAJOR 19
#define VER_MINOR 01
-#define VER_MINORMINOR 02
+#define VER_MINORMINOR 03
//Creates version number from version parts that appears in version string.
//For example MAKE_VERSION_NUMERIC(1,17,02,28) gives version number of
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|