You can subscribe to this list here.
| 2006 |
Jan
|
Feb
|
Mar
(1) |
Apr
(1) |
May
|
Jun
(1) |
Jul
|
Aug
(10) |
Sep
|
Oct
|
Nov
|
Dec
(3) |
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 2007 |
Jan
(1) |
Feb
(2) |
Mar
(3) |
Apr
(2) |
May
(10) |
Jun
(2) |
Jul
(1) |
Aug
|
Sep
|
Oct
|
Nov
(3) |
Dec
|
| 2008 |
Jan
(6) |
Feb
(4) |
Mar
(5) |
Apr
(2) |
May
(1) |
Jun
(1) |
Jul
(4) |
Aug
(6) |
Sep
(2) |
Oct
(9) |
Nov
(1) |
Dec
(4) |
| 2009 |
Jan
(9) |
Feb
(2) |
Mar
(2) |
Apr
(2) |
May
(6) |
Jun
(18) |
Jul
(33) |
Aug
(39) |
Sep
(33) |
Oct
(24) |
Nov
(23) |
Dec
(22) |
| 2010 |
Jan
(29) |
Feb
(32) |
Mar
(51) |
Apr
(17) |
May
(31) |
Jun
(21) |
Jul
(32) |
Aug
(28) |
Sep
(35) |
Oct
(27) |
Nov
(11) |
Dec
(13) |
| 2011 |
Jan
(14) |
Feb
(13) |
Mar
(27) |
Apr
(27) |
May
(28) |
Jun
(20) |
Jul
(43) |
Aug
(52) |
Sep
(66) |
Oct
(61) |
Nov
(11) |
Dec
(8) |
| 2012 |
Jan
(20) |
Feb
(30) |
Mar
(38) |
Apr
(21) |
May
(33) |
Jun
(21) |
Jul
(25) |
Aug
(9) |
Sep
(24) |
Oct
(42) |
Nov
(27) |
Dec
(41) |
| 2013 |
Jan
(20) |
Feb
(35) |
Mar
(156) |
Apr
(298) |
May
(258) |
Jun
(201) |
Jul
(105) |
Aug
(60) |
Sep
(193) |
Oct
(245) |
Nov
(280) |
Dec
(194) |
| 2014 |
Jan
(63) |
Feb
(202) |
Mar
(200) |
Apr
(23) |
May
(53) |
Jun
(105) |
Jul
(18) |
Aug
(26) |
Sep
(110) |
Oct
(187) |
Nov
(97) |
Dec
(74) |
| 2015 |
Jan
(45) |
Feb
(55) |
Mar
(116) |
Apr
(116) |
May
(193) |
Jun
(164) |
Jul
(50) |
Aug
(111) |
Sep
(98) |
Oct
(71) |
Nov
(103) |
Dec
(63) |
| 2016 |
Jan
(33) |
Feb
(101) |
Mar
(182) |
Apr
(139) |
May
(140) |
Jun
(103) |
Jul
(165) |
Aug
(286) |
Sep
(208) |
Oct
(127) |
Nov
(97) |
Dec
(54) |
| 2017 |
Jan
(64) |
Feb
(335) |
Mar
(202) |
Apr
(212) |
May
(139) |
Jun
(127) |
Jul
(294) |
Aug
(154) |
Sep
(170) |
Oct
(152) |
Nov
(156) |
Dec
(62) |
| 2018 |
Jan
(168) |
Feb
(237) |
Mar
(196) |
Apr
(174) |
May
(174) |
Jun
(161) |
Jul
(127) |
Aug
(88) |
Sep
(149) |
Oct
(66) |
Nov
(52) |
Dec
(135) |
| 2019 |
Jan
(146) |
Feb
(126) |
Mar
(104) |
Apr
(58) |
May
(60) |
Jun
(28) |
Jul
(197) |
Aug
(129) |
Sep
(141) |
Oct
(148) |
Nov
(63) |
Dec
(100) |
| 2020 |
Jan
(74) |
Feb
(37) |
Mar
(59) |
Apr
(154) |
May
(194) |
Jun
(133) |
Jul
(313) |
Aug
(197) |
Sep
(49) |
Oct
(162) |
Nov
(143) |
Dec
(57) |
| 2021 |
Jan
(120) |
Feb
(107) |
Mar
(314) |
Apr
(157) |
May
(524) |
Jun
(169) |
Jul
(72) |
Aug
(133) |
Sep
(135) |
Oct
(146) |
Nov
(198) |
Dec
(325) |
| 2022 |
Jan
(409) |
Feb
(249) |
Mar
(138) |
Apr
(95) |
May
(102) |
Jun
(221) |
Jul
(66) |
Aug
(120) |
Sep
(192) |
Oct
(131) |
Nov
(53) |
Dec
(171) |
| 2023 |
Jan
(357) |
Feb
(82) |
Mar
(168) |
Apr
(218) |
May
(196) |
Jun
(86) |
Jul
(115) |
Aug
(49) |
Sep
(190) |
Oct
(102) |
Nov
(45) |
Dec
(76) |
| 2024 |
Jan
(86) |
Feb
(50) |
Mar
(324) |
Apr
(209) |
May
(197) |
Jun
(232) |
Jul
(194) |
Aug
(247) |
Sep
(219) |
Oct
(266) |
Nov
(328) |
Dec
(304) |
| 2025 |
Jan
(191) |
Feb
(115) |
Mar
(137) |
Apr
(32) |
May
(126) |
Jun
(403) |
Jul
(213) |
Aug
(203) |
Sep
(148) |
Oct
(109) |
Nov
(191) |
Dec
(209) |
| 2026 |
Jan
(127) |
Feb
(123) |
Mar
(160) |
Apr
(141) |
May
(49) |
Jun
(55) |
Jul
(91) |
Aug
(191) |
Sep
|
Oct
(68) |
Nov
|
Dec
|
|
From: <rel...@us...> - 2008-11-03 21:56:04
|
Revision: 235
http://modplug.svn.sourceforge.net/modplug/?rev=235&view=rev
Author: relabsoluness
Date: 2008-11-03 21:30:18 +0000 (Mon, 03 Nov 2008)
Log Message:
-----------
(Patch from Jojo, merged with some addition and modifications)
+ Sample tab: Signed/unsigned sample conversion.
+ Sample tab: Added button for phase invert to toolbar.
Modified Paths:
--------------
trunk/OpenMPT/mptrack/CommandSet.cpp
trunk/OpenMPT/mptrack/CommandSet.h
trunk/OpenMPT/mptrack/Ctrl_smp.cpp
trunk/OpenMPT/mptrack/Ctrl_smp.h
trunk/OpenMPT/mptrack/View_smp.cpp
trunk/OpenMPT/mptrack/mptrack.rc
trunk/OpenMPT/mptrack/res/patterns.bmp
trunk/OpenMPT/mptrack/resource.h
Modified: trunk/OpenMPT/mptrack/CommandSet.cpp
===================================================================
--- trunk/OpenMPT/mptrack/CommandSet.cpp 2008-10-25 19:06:55 UTC (rev 234)
+++ trunk/OpenMPT/mptrack/CommandSet.cpp 2008-11-03 21:30:18 UTC (rev 235)
@@ -2289,6 +2289,16 @@
commands[kcVSTGUINextPresetJump].isDummy = false;
commands[kcVSTGUINextPresetJump].Message = "Plugin preset forward jump";
+ commands[kcSampleInvert].UID = 1784;
+ commands[kcSampleInvert].Message = "Invert sample phase";
+ commands[kcSampleInvert].isHidden = false;
+ commands[kcSampleInvert].isDummy = false;
+
+ commands[kcSampleSignUnsign].UID = 1785;
+ commands[kcSampleSignUnsign].Message = "Signed/Unsigned conversion";
+ commands[kcSampleSignUnsign].isHidden = false;
+ commands[kcSampleSignUnsign].isDummy = false;
+
#ifdef _DEBUG
for (int i=0; i<kcNumCommands; i++) {
if (commands[i].UID != 0) { // ignore unset UIDs
Modified: trunk/OpenMPT/mptrack/CommandSet.h
===================================================================
--- trunk/OpenMPT/mptrack/CommandSet.h 2008-10-25 19:06:55 UTC (rev 234)
+++ trunk/OpenMPT/mptrack/CommandSet.h 2008-11-03 21:30:18 UTC (rev 235)
@@ -566,7 +566,9 @@
kcSampleDelete,
kcSampleZoomUp,
kcSampleZoomDown,
- kcEndSampleEditing=kcSampleZoomDown,
+ kcSampleInvert,
+ kcSampleSignUnsign,
+ kcEndSampleEditing=kcSampleSignUnsign,
//kcSampStartNotes to kcInsNoteMapEndNoteStops must be contiguous.
kcSampStartNotes,
Modified: trunk/OpenMPT/mptrack/Ctrl_smp.cpp
===================================================================
--- trunk/OpenMPT/mptrack/Ctrl_smp.cpp 2008-10-25 19:06:55 UTC (rev 234)
+++ trunk/OpenMPT/mptrack/Ctrl_smp.cpp 2008-11-03 21:30:18 UTC (rev 235)
@@ -65,6 +65,8 @@
ON_COMMAND(IDC_SAMPLE_DOWNSAMPLE, OnDownsample)
ON_COMMAND(IDC_SAMPLE_REVERSE, OnReverse)
ON_COMMAND(IDC_SAMPLE_SILENCE, OnSilence)
+ ON_COMMAND(IDC_SAMPLE_INVERT, OnInvert)
+ ON_COMMAND(IDC_SAMPLE_SIGN_UNSIGN, OnSignUnSign)
ON_COMMAND(IDC_CHECK1, OnSetPanningChanged)
ON_COMMAND(ID_PREVINSTRUMENT, OnPrevInstrument)
ON_COMMAND(ID_NEXTINSTRUMENT, OnNextInstrument)
@@ -209,6 +211,8 @@
m_ToolBar2.AddButton(IDC_SAMPLE_DOWNSAMPLE, 29);
m_ToolBar2.AddButton(IDC_SAMPLE_REVERSE, 11);
m_ToolBar2.AddButton(IDC_SAMPLE_SILENCE, 22);
+ m_ToolBar2.AddButton(IDC_SAMPLE_INVERT, 35);
+ m_ToolBar2.AddButton(IDC_SAMPLE_SIGN_UNSIGN, 36);
// Setup Controls
m_EditName.SetLimitText(32);
m_EditFileName.SetLimitText(22);
@@ -457,6 +461,14 @@
OnSilence();
break;
+ case IDC_SAMPLE_INVERT:
+ OnInvert();
+ break;
+
+ case IDC_SAMPLE_SIGN_UNSIGN:
+ OnSignUnSign();
+ break;
+
case IDC_SAMPLE_NORMALIZE:
OnNormalize();
break;
@@ -1075,20 +1087,17 @@
}
-void CCtrlSamples::OnAmplify()
-//----------------------------
+void CCtrlSamples::ApplyAmplify(LONG lAmp, bool bFadeIn, bool bFadeOut)
+//-----------------------------------------------------------------------
{
- static int16 snOldAmp = 100;
SAMPLEVIEWSTATE viewstate;
DWORD dwStart, dwEnd;
MODINSTRUMENT *pins;
- CAmpDlg dlg(this, snOldAmp);
memset(&viewstate, 0, sizeof(viewstate));
SendViewMessage(VIEWMSG_SAVESTATE, (LPARAM)&viewstate);
if ((!m_pModDoc) || (!m_pSndFile) || (!m_pSndFile->Ins[m_nSample].pSample)) return;
- if (dlg.DoModal() != IDOK) return;
- snOldAmp = dlg.m_nFactor;
+
BeginWaitCursor();
pins = &m_pSndFile->Ins[m_nSample];
dwStart = viewstate.dwBeginSel;
@@ -1102,8 +1111,7 @@
}
if (pins->uFlags & CHN_STEREO) { dwStart *= 2; dwEnd *= 2; }
UINT len = dwEnd - dwStart;
- LONG lAmp = dlg.m_nFactor;
- if ((dlg.m_bFadeIn) && (dlg.m_bFadeOut)) lAmp *= 4;
+ if ((bFadeIn) && (bFadeOut)) lAmp *= 4;
if (pins->uFlags & CHN_16BIT)
{
signed short *p = ((signed short *)pins->pSample) + dwStart;
@@ -1111,8 +1119,8 @@
for (UINT i=0; i<len; i++)
{
LONG l = (p[i] * lAmp) / 100;
- if (dlg.m_bFadeIn) l = (LONG)((l * (LONGLONG)i) / len);
- if (dlg.m_bFadeOut) l = (LONG)((l * (LONGLONG)(len-i)) / len);
+ if (bFadeIn) l = (LONG)((l * (LONGLONG)i) / len);
+ if (bFadeOut) l = (LONG)((l * (LONGLONG)(len-i)) / len);
if (l < -32768) l = -32768;
if (l > 32767) l = 32767;
p[i] = (signed short)l;
@@ -1124,8 +1132,8 @@
for (UINT i=0; i<len; i++)
{
LONG l = (p[i] * lAmp) / 100;
- if (dlg.m_bFadeIn) l = (LONG)((l * (LONGLONG)i) / len);
- if (dlg.m_bFadeOut) l = (LONG)((l * (LONGLONG)(len-i)) / len);
+ if (bFadeIn) l = (LONG)((l * (LONGLONG)i) / len);
+ if (bFadeOut) l = (LONG)((l * (LONGLONG)(len-i)) / len);
if (l < -128) l = -128;
if (l > 127) l = 127;
p[i] = (signed char)l;
@@ -1140,6 +1148,17 @@
}
+void CCtrlSamples::OnAmplify()
+//----------------------------
+{
+ static int16 snOldAmp = 100;
+ CAmpDlg dlg(this, snOldAmp);
+ if (dlg.DoModal() != IDOK) return;
+ snOldAmp = dlg.m_nFactor;
+ ApplyAmplify(dlg.m_nFactor, dlg.m_bFadeIn, dlg.m_bFadeOut);
+}
+
+
const int gSinc2x16Odd[16] =
{ // Kaiser window, beta=7.400
-19, 97, -295, 710, -1494, 2958, -6155, 20582, 20582, -6155, 2958, -1494, 710, -295, 97, -19,
@@ -2138,6 +2157,54 @@
}
+void CCtrlSamples::OnInvert()
+//--------------------------------
+{
+ ApplyAmplify(-100);
+}
+
+
+void CCtrlSamples::OnSignUnSign()
+//-------------------------------
+{
+ // purpose: sign/unsign a sample ("distortion")
+ SAMPLEVIEWSTATE viewstate;
+ DWORD dwStart, dwEnd;
+ MODINSTRUMENT *pins;
+
+ memset(&viewstate, 0, sizeof(viewstate));
+ SendViewMessage(VIEWMSG_SAVESTATE, (LPARAM)&viewstate);
+ if ((!m_pModDoc) || (!m_pSndFile) || (!m_pSndFile->Ins[m_nSample].pSample)) return;
+ BeginWaitCursor();
+ pins = &m_pSndFile->Ins[m_nSample];
+ dwStart = viewstate.dwBeginSel;
+ dwEnd = viewstate.dwEndSel;
+ if (dwEnd > pins->nLength) dwEnd = pins->nLength;
+ if (dwStart > dwEnd) dwStart = dwEnd;
+ if (dwStart >= dwEnd)
+ {
+ dwStart = 0;
+ dwEnd = pins->nLength;
+ }
+ if (pins->uFlags & CHN_STEREO) { dwStart *= 2; dwEnd *= 2; }
+ UINT len = dwEnd - dwStart;
+ if (pins->uFlags & CHN_16BIT)
+ {
+ signed short *p = ((signed short *)pins->pSample) + dwStart;
+ for (UINT i=0; i<len; ++i) p[i] += 0x8000; //unsign
+ } else {
+ signed char *p = ((signed char *)pins->pSample) + dwStart;
+ for (UINT i=0; i<len; ++i) p[i] += 0x80; //unsign
+ }
+
+ m_pModDoc->AdjustEndOfSample(m_nSample);
+ m_pModDoc->UpdateAllViews(NULL, (m_nSample << HINT_SHIFT_SMP) | HINT_SAMPLEDATA, NULL);
+ m_pModDoc->SetModified();
+ EndWaitCursor();
+ SwitchToView();
+}
+
+
void CCtrlSamples::OnSilence()
//----------------------------
{
Modified: trunk/OpenMPT/mptrack/Ctrl_smp.h
===================================================================
--- trunk/OpenMPT/mptrack/Ctrl_smp.h 2008-10-25 19:06:55 UTC (rev 234)
+++ trunk/OpenMPT/mptrack/Ctrl_smp.h 2008-11-03 21:30:18 UTC (rev 235)
@@ -34,6 +34,10 @@
void UpdateTimeStretchParameterString();
void ReadTimeStretchParameters();
+ // Applies amplification to sample. Negative values
+ // can be used to invert phase.
+ void ApplyAmplify(LONG nAmp, bool bFadeIn = false, bool bFadeOut = false);
+
public:
CCtrlSamples();
~CCtrlSamples();
@@ -72,6 +76,8 @@
afx_msg void OnDownsample();
afx_msg void OnReverse();
afx_msg void OnSilence();
+ afx_msg void OnInvert();
+ afx_msg void OnSignUnSign();
afx_msg void OnNameChanged();
afx_msg void OnFileNameChanged();
afx_msg void OnVolumeChanged();
Modified: trunk/OpenMPT/mptrack/View_smp.cpp
===================================================================
--- trunk/OpenMPT/mptrack/View_smp.cpp 2008-10-25 19:06:55 UTC (rev 234)
+++ trunk/OpenMPT/mptrack/View_smp.cpp 2008-11-03 21:30:18 UTC (rev 235)
@@ -2380,10 +2380,12 @@
case kcSampleSave: PostCtrlMessage(IDC_SAMPLE_SAVEAS); return wParam;
case kcSampleNew: PostCtrlMessage(IDC_SAMPLE_NEW); return wParam;
- case kcSampleReverse: PostCtrlMessage(IDC_SAMPLE_REVERSE); return wParam;
- case kcSampleSilence: PostCtrlMessage(IDC_SAMPLE_SILENCE); return wParam;
- case kcSampleNormalize: PostCtrlMessage(IDC_SAMPLE_NORMALIZE); return wParam;
- case kcSampleAmplify: PostCtrlMessage(IDC_SAMPLE_AMPLIFY); return wParam;
+ case kcSampleReverse: PostCtrlMessage(IDC_SAMPLE_REVERSE); return wParam;
+ case kcSampleSilence: PostCtrlMessage(IDC_SAMPLE_SILENCE); return wParam;
+ case kcSampleNormalize: PostCtrlMessage(IDC_SAMPLE_NORMALIZE); return wParam;
+ case kcSampleAmplify: PostCtrlMessage(IDC_SAMPLE_AMPLIFY); return wParam;
+ case kcSampleInvert: PostCtrlMessage(IDC_SAMPLE_INVERT); return wParam;
+ case kcSampleSignUnsign: PostCtrlMessage(IDC_SAMPLE_SIGN_UNSIGN); return wParam;
case kcNoteOff: PlayNote(NOTE_KEYOFF); return wParam;
case kcNoteCut: PlayNote(NOTE_NOTECUT); return wParam;
Modified: trunk/OpenMPT/mptrack/mptrack.rc
===================================================================
--- trunk/OpenMPT/mptrack/mptrack.rc 2008-10-25 19:06:55 UTC (rev 234)
+++ trunk/OpenMPT/mptrack/mptrack.rc 2008-11-03 21:30:18 UTC (rev 235)
@@ -751,7 +751,7 @@
CTEXT "Length: 000000 (16-bit)",IDC_TEXT5,175,6,90,13,
SS_CENTERIMAGE,WS_EX_STATICEDGE
CONTROL "Toolbar2",IDC_TOOLBAR2,"ToolbarWindow32",WS_GROUP |
- 0x4d,268,4,136,17
+ 0x4d,268,4,164,17
GROUPBOX "",IDC_STATIC,3,22,94,78
LTEXT "Default Volume",IDC_STATIC,8,32,49,8
LTEXT "Global Volume",IDC_STATIC,8,45,46,8
@@ -2433,6 +2433,8 @@
STRINGTABLE
BEGIN
IDC_SAMPLE_SILENCE "Silence Sample\nSilence"
+ IDC_SAMPLE_INVERT "Invert phase\nInvert phase"
+ IDC_SAMPLE_SIGN_UNSIGN "Signed/Unsigned conversion\nSigned/Unsigned conversion"
IDC_INSTRUMENT_NEW "Create a new instrument\nNew instrument (hold shift to duplicate)"
IDC_INSTRUMENT_OPEN "Import instrument\nImport instrument"
IDC_INSTRUMENT_SAVEAS "Save the current instrument to disk\nSave instrument"
Modified: trunk/OpenMPT/mptrack/res/patterns.bmp
===================================================================
(Binary files differ)
Modified: trunk/OpenMPT/mptrack/resource.h
===================================================================
--- trunk/OpenMPT/mptrack/resource.h 2008-10-25 19:06:55 UTC (rev 234)
+++ trunk/OpenMPT/mptrack/resource.h 2008-11-03 21:30:18 UTC (rev 235)
@@ -587,6 +587,8 @@
#define IDC_CHECK_EQ 2052
#define IDC_CHECK_AGC 2053
#define IDC_SAMPLE_SILENCE 2054
+#define IDC_SAMPLE_INVERT 2055
+#define IDC_SAMPLE_SIGN_UNSIGN 2056
#define IDC_INSTRUMENT_NEW 2060
#define IDC_INSTRUMENT_OPEN 2061
#define IDC_INSTRUMENT_SAVEAS 2062
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <rel...@us...> - 2008-10-25 19:07:02
|
Revision: 234
http://modplug.svn.sourceforge.net/modplug/?rev=234&view=rev
Author: relabsoluness
Date: 2008-10-25 19:06:55 +0000 (Sat, 25 Oct 2008)
Log Message:
-----------
+ Sample amplify now accepts negative values(inverts sample phase) (request 2219)
. Fixed a typo in Setup->Colors
Modified Paths:
--------------
trunk/OpenMPT/mptrack/Ctrl_smp.cpp
trunk/OpenMPT/mptrack/View_pat.cpp
trunk/OpenMPT/mptrack/dlg_misc.cpp
trunk/OpenMPT/mptrack/dlg_misc.h
trunk/OpenMPT/mptrack/mptrack.rc
Modified: trunk/OpenMPT/mptrack/Ctrl_smp.cpp
===================================================================
--- trunk/OpenMPT/mptrack/Ctrl_smp.cpp 2008-10-24 18:33:16 UTC (rev 233)
+++ trunk/OpenMPT/mptrack/Ctrl_smp.cpp 2008-10-25 19:06:55 UTC (rev 234)
@@ -1078,7 +1078,7 @@
void CCtrlSamples::OnAmplify()
//----------------------------
{
- static UINT snOldAmp = 100;
+ static int16 snOldAmp = 100;
SAMPLEVIEWSTATE viewstate;
DWORD dwStart, dwEnd;
MODINSTRUMENT *pins;
Modified: trunk/OpenMPT/mptrack/View_pat.cpp
===================================================================
--- trunk/OpenMPT/mptrack/View_pat.cpp 2008-10-24 18:33:16 UTC (rev 233)
+++ trunk/OpenMPT/mptrack/View_pat.cpp 2008-10-25 19:06:55 UTC (rev 234)
@@ -2595,7 +2595,7 @@
//-----------------------------------
{
static UINT snOldAmp = 100;
- CAmpDlg dlg(this, snOldAmp);
+ CAmpDlg dlg(this, snOldAmp, 0);
CModDoc *pModDoc = GetDocument();
BYTE chvol[MAX_BASECHANNELS];
@@ -2604,7 +2604,7 @@
CSoundFile *pSndFile = pModDoc->GetSoundFile();
BeginWaitCursor();
PrepareUndo(m_dwBeginSel, m_dwEndSel);
- snOldAmp = dlg.m_nFactor;
+ snOldAmp = static_cast<UINT>(dlg.m_nFactor);
memset(chvol, 64, sizeof(chvol));
if (pSndFile->Patterns[m_nPattern])
{
Modified: trunk/OpenMPT/mptrack/dlg_misc.cpp
===================================================================
--- trunk/OpenMPT/mptrack/dlg_misc.cpp 2008-10-24 18:33:16 UTC (rev 233)
+++ trunk/OpenMPT/mptrack/dlg_misc.cpp 2008-10-25 19:06:55 UTC (rev 234)
@@ -11,7 +11,7 @@
#include "midi.h"
#include "version.h"
-#pragma warning(disable:4244)
+#pragma warning(disable:4244) //"conversion from 'type1' to 'type2', possible loss of data"
@@ -1504,6 +1504,13 @@
///////////////////////////////////////////////////////////////////////////////
// Samples
+CAmpDlg::CAmpDlg(CWnd *parent, int16 nFactor, int16 nFactorMin, int16 nFactorMax)
+//-------------------------------------------------------------------------------
+ : CDialog(IDD_SAMPLE_AMPLIFY, parent), m_nFactor(nFactor),
+ m_nFactorMin(nFactorMin), m_nFactorMax(nFactorMax),
+ m_bFadeIn(FALSE), m_bFadeOut(FALSE)
+{}
+
BOOL CAmpDlg::OnInitDialog()
//--------------------------
{
@@ -1511,8 +1518,8 @@
CSpinButtonCtrl *spin = (CSpinButtonCtrl *)GetDlgItem(IDC_SPIN1);
if (spin)
{
- spin->SetRange(10, 800);
- spin->SetPos(m_nFactor);
+ spin->SetRange32(m_nFactorMin, m_nFactorMax);
+ spin->SetPos32(m_nFactor);
}
SetDlgItemInt(IDC_EDIT1, m_nFactor);
return TRUE;
@@ -1522,9 +1529,16 @@
void CAmpDlg::OnOK()
//------------------
{
- m_nFactor = GetDlgItemInt(IDC_EDIT1);
- m_bFadeIn = IsDlgButtonChecked(IDC_CHECK1);
- m_bFadeOut = IsDlgButtonChecked(IDC_CHECK2);
+ const int nVal = static_cast<int>(GetDlgItemInt(IDC_EDIT1));
+ if(nVal < m_nFactorMin || nVal > m_nFactorMax)
+ {
+ CString str; str.Format(GetStrI18N(__TEXT("Value should be within [%d, %d]")), m_nFactorMin, m_nFactorMax);
+ AfxMessageBox(str, MB_ICONINFORMATION);
+ return;
+ }
+ m_nFactor = static_cast<int16>(nVal);
+ m_bFadeIn = (IsDlgButtonChecked(IDC_CHECK1) != 0);
+ m_bFadeOut = (IsDlgButtonChecked(IDC_CHECK2) != 0);
CDialog::OnOK();
}
Modified: trunk/OpenMPT/mptrack/dlg_misc.h
===================================================================
--- trunk/OpenMPT/mptrack/dlg_misc.h 2008-10-24 18:33:16 UTC (rev 233)
+++ trunk/OpenMPT/mptrack/dlg_misc.h 2008-10-25 19:06:55 UTC (rev 234)
@@ -316,11 +316,11 @@
//===========================
{
public:
- UINT m_nFactor;
- BOOL m_bFadeIn, m_bFadeOut;
+ int16 m_nFactor, m_nFactorMin, m_nFactorMax;
+ bool m_bFadeIn, m_bFadeOut;
public:
- CAmpDlg(CWnd *parent, UINT nFactor=100):CDialog(IDD_SAMPLE_AMPLIFY, parent) { m_nFactor = nFactor; m_bFadeIn = m_bFadeOut = FALSE; }
+ CAmpDlg(CWnd *parent, int16 nFactor=100, int16 nFactorMin = int16_min, int16 nFactorMax = int16_max);
virtual BOOL OnInitDialog();
virtual void OnOK();
};
Modified: trunk/OpenMPT/mptrack/mptrack.rc
===================================================================
--- trunk/OpenMPT/mptrack/mptrack.rc 2008-10-24 18:33:16 UTC (rev 233)
+++ trunk/OpenMPT/mptrack/mptrack.rc 2008-10-25 19:06:55 UTC (rev 234)
@@ -454,7 +454,7 @@
LTEXT "rows",IDC_STATIC,124,88,16,8
CONTROL "",IDC_BUTTON4,"Button",BS_OWNERDRAW | BS_FLAT,54,113,
114,43
- CONTROL "Set highlights to songs' time sigatures",IDC_CHECK5,
+ CONTROL "Set highlights to songs' time signatures",IDC_CHECK5,
"Button",BS_AUTOCHECKBOX | WS_TABSTOP,10,63,136,10
END
@@ -1310,7 +1310,7 @@
FONT 8, "MS Sans Serif", 0, 0, 0x0
BEGIN
LTEXT "Amplify by",IDC_STATIC,13,19,37,8
- EDITTEXT IDC_EDIT1,54,16,40,14,ES_AUTOHSCROLL | ES_NUMBER
+ EDITTEXT IDC_EDIT1,54,16,40,14,ES_AUTOHSCROLL
CONTROL "Spin1",IDC_SPIN1,"msctls_updown32",UDS_SETBUDDYINT |
UDS_ALIGNRIGHT | UDS_AUTOBUDDY | UDS_ARROWKEYS |
UDS_NOTHOUSANDS,89,17,11,14
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <rel...@us...> - 2008-10-24 18:33:21
|
Revision: 233
http://modplug.svn.sourceforge.net/modplug/?rev=233&view=rev
Author: relabsoluness
Date: 2008-10-24 18:33:16 +0000 (Fri, 24 Oct 2008)
Log Message:
-----------
. When loading S3M files which contain Zxx-effects, user is now asked how to process them. (bug 2166)
Modified Paths:
--------------
trunk/OpenMPT/mptrack/Moddoc.h
trunk/OpenMPT/soundlib/Load_s3m.cpp
Modified: trunk/OpenMPT/mptrack/Moddoc.h
===================================================================
--- trunk/OpenMPT/mptrack/Moddoc.h 2008-10-18 21:21:29 UTC (rev 232)
+++ trunk/OpenMPT/mptrack/Moddoc.h 2008-10-24 18:33:16 UTC (rev 233)
@@ -143,6 +143,7 @@
CSoundFile *GetSoundFile() { return &m_SndFile; }
void SetPause(BOOL bPause) { m_bPaused = bPause; }
void SetModified(BOOL bModified=TRUE) { SetModifiedFlag(bModified); }
+ void SetShowSaveDialog(bool b) {m_ShowSavedialog = b;}
void PostMessageToAllViews(UINT uMsg, WPARAM wParam=0, LPARAM lParam=0);
void SendMessageToActiveViews(UINT uMsg, WPARAM wParam=0, LPARAM lParam=0);
UINT GetModType() const { return m_SndFile.m_nType; }
Modified: trunk/OpenMPT/soundlib/Load_s3m.cpp
===================================================================
--- trunk/OpenMPT/soundlib/Load_s3m.cpp 2008-10-18 21:21:29 UTC (rev 232)
+++ trunk/OpenMPT/soundlib/Load_s3m.cpp 2008-10-24 18:33:16 UTC (rev 233)
@@ -10,11 +10,49 @@
#include "stdafx.h"
#include "sndfile.h"
+#include "../mptrack/moddoc.h"
#pragma warning(disable:4244) //"conversion from 'type1' to 'type2', possible loss of data"
extern WORD S3MFineTuneTable[16];
+static void HandleZxx(uint8& nType, MODCOMMAND* const m)
+//-------------------------------------------------------------------
+{
+ if(nType == 0)
+ {
+ CString str;
+ str.Format(GetStrI18N("The S3M file contains Zxx effect. "
+ "It can be processed in the following ways:\n"
+ "Yes : Convert Zxx to S8x(set panning)-effects (PixPlay)\n"
+ "No : Remove Zxx effects\n"
+ "Cancel: Keep Zxx effects\n"
+ "\nNote that options (yes) and (no) modify the loaded pattern data."
+ ));
+ const int nResult = ::AfxMessageBox(str, MB_YESNOCANCEL|MB_ICONINFORMATION);
+
+ if(nResult == IDYES)
+ nType = 2;
+ else if(nResult == IDNO)
+ nType = 3;
+ else
+ nType = 1;
+ }
+ if(nType != 1)
+ {
+ if(nType == 2)
+ {
+ m->command = CMD_S3MCMDEX;
+ m->param = 0x80 + (m->param & 0xF);
+ }
+ else
+ {
+ m->command = 0;
+ m->param = 0;
+ }
+ }
+}
+
//////////////////////////////////////////////////////
// ScreamTracker S3M file support
@@ -335,6 +373,7 @@
}
}
// Reading patterns
+ uint8 nZxxHandling = 0;
for (UINT iPat=0; iPat<patnum; iPat++)
{
UINT nInd = ((DWORD)ptr[nins+iPat]) << 4;
@@ -387,6 +426,10 @@
m->command = src[j++];
m->param = src[j++];
if (m->command) S3MConvert(m, FALSE);
+ if(m->command == CMD_MIDI)
+ {
+ HandleZxx(nZxxHandling, m);
+ }
}
} else
{
@@ -411,6 +454,12 @@
m_nMinPeriod = 64;
m_nMaxPeriod = 32767;
if (psfh.flags & 0x10) m_dwSongFlags |= SONG_AMIGALIMITS;
+
+ if(nZxxHandling != 0 && nZxxHandling != 1 && GetpModDoc() != 0)
+ {
+ GetpModDoc()->SetModified();
+ GetpModDoc()->SetShowSaveDialog(true);
+ }
return TRUE;
}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <rel...@us...> - 2008-10-18 21:21:33
|
Revision: 232
http://modplug.svn.sourceforge.net/modplug/?rev=232&view=rev
Author: relabsoluness
Date: 2008-10-18 21:21:29 +0000 (Sat, 18 Oct 2008)
Log Message:
-----------
(Patches from Jojo, merged with some fixes)
+ In sample view: Status bar now displays offset value at given sample point.
. Small fixes to sample trimming usability.
Modified Paths:
--------------
trunk/OpenMPT/mptrack/View_smp.cpp
trunk/OpenMPT/soundlib/Sndfile.h
Modified: trunk/OpenMPT/mptrack/View_smp.cpp
===================================================================
--- trunk/OpenMPT/mptrack/View_smp.cpp 2008-10-18 12:35:46 UTC (rev 231)
+++ trunk/OpenMPT/mptrack/View_smp.cpp 2008-10-18 21:21:29 UTC (rev 232)
@@ -20,6 +20,12 @@
#define MIN_ZOOM 0
#define MAX_ZOOM 8
+// Defines the minimum length for selection for which
+// trimming will be done. This is the minimum value for
+// selection difference, so the minimum length of result
+// of trimming is nTrimLengthMin + 1.
+const uint8 nTrimLengthMin = 16;
+
const UINT cLeftBarButtons[SMP_LEFTBAR_BUTTONS] =
{
ID_SAMPLE_ZOOMUP,
@@ -1176,9 +1182,32 @@
pSndFile = pModDoc->GetSoundFile();
if (m_rcClient.PtInRect(point))
{
- LONG x = ScreenToSample(point.x);
- wsprintf(s, "Cursor: %d", x);
+ const DWORD x = ScreenToSample(point.x);
+ wsprintf(s, "Cursor: %u", x);
UpdateIndicator(s);
+ CMainFrame *pMainFrm = CMainFrame::GetMainFrame();
+
+ if (pMainFrm && m_dwEndSel <= m_dwBeginSel)
+ {
+ if(m_nSample > 0 && m_nSample < MAX_SAMPLES && x < pSndFile->Ins[m_nSample].nLength )
+ {
+ const DWORD xLow = (x / 0x100) % 0x100;
+ const DWORD xHigh = x / 0x10000;
+ const char cOffsetChar = (pSndFile->TypeIsS3M_IT_MPT()) ? gszS3mCommands[CMD_OFFSET] : gszModCommands[CMD_OFFSET];
+ const bool bHasHighOffset = (pSndFile->TypeIsS3M_IT_MPT() || (pSndFile->GetType() == MOD_TYPE_XM));
+ const char cHighOffsetChar = (pSndFile->TypeIsS3M_IT_MPT()) ? gszS3mCommands[CMD_S3MCMDEX] : gszModCommands[CMD_XFINEPORTAUPDOWN];
+
+ if(xHigh == 0)
+ wsprintf(s, "Offset: %c%02X", cOffsetChar, xLow);
+ else if(bHasHighOffset && xHigh < 0x10)
+ wsprintf(s, "Offset: %c%02X, %cA%X", cOffsetChar, xLow, cHighOffsetChar, xHigh);
+ else
+ wsprintf(s, "Beyond offset range");
+ pMainFrm->SetInfoText(s);
+ }
+ else
+ pMainFrm->SetInfoText("");
+ }
} else UpdateIndicator(NULL);
if (m_dwStatus & SMPSTATUS_MOUSEDRAG)
{
@@ -1332,13 +1361,19 @@
// "Trim" menu item is responding differently if there's no selection,
// but a loop present: "trim around loop point"! (jojo in topic 2258)
std::string sTrimMenuText = "Trim";
- bool bIsGrayed = (m_dwEndSel<=m_dwBeginSel);
+ bool bIsGrayed = ( (m_dwEndSel<=m_dwBeginSel) || (m_dwEndSel - m_dwBeginSel < nTrimLengthMin)
+ || (m_dwEndSel - m_dwBeginSel == pins->nLength)
+ );
if ((m_dwBeginSel == m_dwEndSel) && (pins->nLoopStart < pins->nLoopEnd))
{
// no selection => use loop points
sTrimMenuText += " around loop points";
- bIsGrayed = false;
+ // Check whether trim menu item can be enabled (loop not too short or long for trimming).
+ if( (pins->nLoopEnd <= pins->nLength) &&
+ (pins->nLoopEnd - pins->nLoopStart >= nTrimLengthMin) &&
+ (pins->nLoopEnd - pins->nLoopStart < pins->nLength) )
+ bIsGrayed = false;
}
sTrimMenuText += "\t" + ih->GetKeyTextFromCommand(kcSampleTrim);
@@ -1862,7 +1897,7 @@
UINT nStart = m_dwBeginSel;
UINT nEnd = m_dwEndSel - m_dwBeginSel;
- if ((pins->pSample) && (nStart+nEnd <= pins->nLength) && (nEnd >= 16))
+ if ((pins->pSample) && (nStart+nEnd <= pins->nLength) && (nEnd >= nTrimLengthMin))
{
BEGIN_CRITICAL();
{
Modified: trunk/OpenMPT/soundlib/Sndfile.h
===================================================================
--- trunk/OpenMPT/soundlib/Sndfile.h 2008-10-18 12:35:46 UTC (rev 231)
+++ trunk/OpenMPT/soundlib/Sndfile.h 2008-10-18 21:21:29 UTC (rev 232)
@@ -973,6 +973,8 @@
BOOL Destroy();
MODTYPE GetType() const { return m_nType; }
inline bool TypeIsIT_MPT() const {return (m_nType & (MOD_TYPE_IT | MOD_TYPE_MPT)) != 0;}
+ inline bool TypeIsS3M_IT_MPT() const {return (m_nType & (MOD_TYPE_S3M | MOD_TYPE_IT | MOD_TYPE_MPT)) != 0;}
+ inline bool TypeIsXM_MOD() const {return (m_nType & (MOD_TYPE_XM | MOD_TYPE_MOD)) != 0;}
CModDoc* GetpModDoc() {return m_pModDoc;}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <rel...@us...> - 2008-10-18 12:35:59
|
Revision: 231
http://modplug.svn.sourceforge.net/modplug/?rev=231&view=rev
Author: relabsoluness
Date: 2008-10-18 12:35:46 +0000 (Sat, 18 Oct 2008)
Log Message:
-----------
Patches from Jojo (with small modifications)
. File name in treeview wasn't updated when saving with new file name (bug 1731)
. BPM approximation showed wrong rows per beat in some cases (bug 2532)
. Playing sample selection didn't work properly in all cases (bug 1700).
. Setting loop points could affect playing of sample even if loop was disabled (bug 1874)
/ Play sample button now stops previous note even if mod is playing (bug 1366)
/ Sustain loop will now be enabled when setting it to sample selection.
Modified Paths:
--------------
trunk/OpenMPT/mptrack/Ctrl_smp.cpp
trunk/OpenMPT/mptrack/Moddoc.cpp
trunk/OpenMPT/mptrack/View_smp.cpp
Modified: trunk/OpenMPT/mptrack/Ctrl_smp.cpp
===================================================================
--- trunk/OpenMPT/mptrack/Ctrl_smp.cpp 2008-10-13 17:28:21 UTC (rev 230)
+++ trunk/OpenMPT/mptrack/Ctrl_smp.cpp 2008-10-18 12:35:46 UTC (rev 231)
@@ -996,7 +996,9 @@
{
if ((m_pModDoc) && (m_pSndFile))
{
- if ((m_pSndFile->IsPaused()) && (m_pModDoc->IsNotePlaying(0, m_nSample, 0)))
+ // Fix (bug report 1366).
+ // if ((m_pSndFile->IsPaused()) && (m_pModDoc->IsNotePlaying(0, m_nSample, 0)))
+ if (m_pModDoc->IsNotePlaying(0, m_nSample, 0))
{
m_pModDoc->NoteOff(0, TRUE);
} else
@@ -2488,7 +2490,12 @@
if ((n >= 0) && (n < (LONG)pins->nLength) && ((n < (LONG)pins->nLoopEnd) || (!(pins->uFlags & CHN_LOOP))))
{
pins->nLoopStart = n;
- m_pModDoc->AdjustEndOfSample(m_nSample);
+ if(pins->uFlags & CHN_LOOP)
+ {
+ /* only update sample buffer if the loop is actually enabled
+ (resets sound without any reason otherwise) - bug report 1874 */
+ m_pModDoc->AdjustEndOfSample(m_nSample);
+ }
// 05/01/05 : ericus replaced "m_nSample << 24" by "m_nSample << 20" : 4000 samples -> 12bits [see Moddoc.h]
m_pModDoc->UpdateAllViews(NULL, (m_nSample << HINT_SHIFT_SMP) | HINT_SAMPLEDATA, this);
m_pModDoc->SetModified();
@@ -2505,7 +2512,12 @@
if ((n >= 0) && (n <= (LONG)pins->nLength) && ((n > (LONG)pins->nLoopStart) || (!(pins->uFlags & CHN_LOOP))))
{
pins->nLoopEnd = n;
- m_pModDoc->AdjustEndOfSample(m_nSample);
+ if(pins->uFlags & CHN_LOOP)
+ {
+ /* only update sample buffer if the loop is actually enabled
+ (resets sound without any reason otherwise) - bug report 1874 */
+ m_pModDoc->AdjustEndOfSample(m_nSample);
+ }
// 05/01/05 : ericus replaced "m_nSample << 24" by "m_nSample << 20" : 4000 samples -> 12bits [see Moddoc.h]
m_pModDoc->UpdateAllViews(NULL, (m_nSample << HINT_SHIFT_SMP) | HINT_SAMPLEDATA, this);
m_pModDoc->SetModified();
Modified: trunk/OpenMPT/mptrack/Moddoc.cpp
===================================================================
--- trunk/OpenMPT/mptrack/Moddoc.cpp 2008-10-13 17:28:21 UTC (rev 230)
+++ trunk/OpenMPT/mptrack/Moddoc.cpp 2008-10-18 12:35:46 UTC (rev 231)
@@ -580,6 +580,7 @@
SetModified(FALSE);
m_bHasValidPath=true;
m_ShowSavedialog = false;
+ UpdateAllViews(NULL, HINT_MODGENERAL); // Update treeview (e.g. filename might have changed).
return TRUE;
} else
{
@@ -831,12 +832,15 @@
if (nVol >= 0) pChn->nVolume = nVol;
// handle sample looping.
- if ((loopstart + 16 < loopend) && (loopstart >= 0) && (loopend <= (LONG)pChn->nLength)) {
+ // Fix: Bug report 1700.
+ //if ((loopstart + 16 < loopend) && (loopstart >= 0) && (loopend <= (LONG)pChn->nLength)) {
+ if ((loopstart + 16 < loopend) && (loopstart >= 0) && (pChn->pInstrument != 0))
+ {
pChn->nPos = loopstart;
pChn->nPosLo = 0;
pChn->nLoopStart = loopstart;
pChn->nLoopEnd = loopend;
- pChn->nLength = loopend;
+ pChn->nLength = min(UINT(loopend), pChn->pInstrument->nLength);
}
// handle extra-loud flag
@@ -1960,7 +1964,7 @@
switch(m_SndFile.m_nTempoMode) {
case tempo_mode_alternative:
Message.Format("Using alternative tempo interpretation.\n\nAssuming:\n. %d ticks per second\n. %d ticks per row\n. %d rows per beat\nthe tempo is approximately: %.20g BPM",
- m_SndFile.m_nMusicTempo, m_SndFile.m_nMusicSpeed, CMainFrame::m_nRowSpacing2, bpm);
+ m_SndFile.m_nMusicTempo, m_SndFile.m_nMusicSpeed, m_SndFile.m_nRowsPerBeat, bpm);
break;
case tempo_mode_modern:
@@ -1970,7 +1974,7 @@
case tempo_mode_classic:
default:
Message.Format("Using standard tempo interpretation.\n\nAssuming:\n. A mod tempo (tick duration factor) of %d\n. %d ticks per row\n. %d rows per beat\nthe tempo is approximately: %.20g BPM",
- m_SndFile.m_nMusicTempo, m_SndFile.m_nMusicSpeed, CMainFrame::m_nRowSpacing2, bpm);
+ m_SndFile.m_nMusicTempo, m_SndFile.m_nMusicSpeed, m_SndFile.m_nRowsPerBeat, bpm);
break;
}
/*
Modified: trunk/OpenMPT/mptrack/View_smp.cpp
===================================================================
--- trunk/OpenMPT/mptrack/View_smp.cpp 2008-10-13 17:28:21 UTC (rev 230)
+++ trunk/OpenMPT/mptrack/View_smp.cpp 2008-10-18 12:35:46 UTC (rev 231)
@@ -1503,6 +1503,7 @@
{
pins->nSustainStart = m_dwBeginSel;
pins->nSustainEnd = m_dwEndSel;
+ pins->uFlags |= CHN_SUSTAINLOOP;
pModDoc->SetModified();
pModDoc->AdjustEndOfSample(m_nSample);
// 05/01/05 : ericus replaced "m_nSample << 24" by "m_nSample << 20" : 4000 samples -> 12bits [see Moddoc.h]
@@ -1914,9 +1915,9 @@
CModDoc *pModDoc = GetDocument();
if ((pModDoc) && (pMainFrm))
{
- if (note >= 0xFE)
+ if (note >= NOTE_NOTECUT)
{
- pModDoc->NoteOff(0, (note == 0xFE) ? TRUE : FALSE);
+ pModDoc->NoteOff(0, (note == NOTE_NOTECUT) ? TRUE : FALSE);
}
else
{
@@ -1926,7 +1927,9 @@
else
pModDoc->NoteOff(0, TRUE);
DWORD loopstart = m_dwBeginSel, loopend = m_dwEndSel;
- if (loopend - loopstart < (UINT)(4 << m_nZoom)) loopend = loopstart = 0;
+ if (loopend - loopstart < (UINT)(4 << m_nZoom))
+ loopend = loopstart = 0; // selection is too small -> no loop
+
pModDoc->PlayNote(note, 0, m_nSample, FALSE, -1, loopstart, loopend);
m_dwStatus |= SMPSTATUS_KEYDOWN;
s[0] = 0;
@@ -2148,7 +2151,12 @@
{
pins->nLoopStart = m_dwMenuParam;
pModDoc->SetModified();
- pModDoc->AdjustEndOfSample(m_nSample);
+ if(pins->uFlags & CHN_LOOP)
+ {
+ /* only update sample buffer if the loop is actually enabled
+ (resets sound without any reason otherwise) - bug report 1874 */
+ pModDoc->AdjustEndOfSample(m_nSample);
+ }
// 05/01/05 : ericus replaced "m_nSample << 24" by "m_nSample << 20" : 4000 samples -> 12bits [see Moddoc.h]
pModDoc->UpdateAllViews(NULL, (m_nSample << HINT_SHIFT_SMP) | HINT_SAMPLEINFO | HINT_SAMPLEDATA, NULL);
}
@@ -2168,7 +2176,12 @@
{
pins->nLoopEnd = m_dwMenuParam;
pModDoc->SetModified();
- pModDoc->AdjustEndOfSample(m_nSample);
+ if(pins->uFlags & CHN_LOOP)
+ {
+ /* only update sample buffer if the loop is actually enabled
+ (resets sound without any reason otherwise) - bug report 1874 */
+ pModDoc->AdjustEndOfSample(m_nSample);
+ }
// 05/01/05 : ericus replaced "m_nSample << 24" by "m_nSample << 20" : 4000 samples -> 12bits [see Moddoc.h]
pModDoc->UpdateAllViews(NULL, (m_nSample << HINT_SHIFT_SMP) | HINT_SAMPLEINFO | HINT_SAMPLEDATA, NULL);
}
@@ -2337,8 +2350,8 @@
case kcSampleNormalize: PostCtrlMessage(IDC_SAMPLE_NORMALIZE); return wParam;
case kcSampleAmplify: PostCtrlMessage(IDC_SAMPLE_AMPLIFY); return wParam;
- case kcNoteOff: PlayNote(255); return wParam;
- case kcNoteCut: PlayNote(254); return wParam;
+ case kcNoteOff: PlayNote(NOTE_KEYOFF); return wParam;
+ case kcNoteCut: PlayNote(NOTE_NOTECUT); return wParam;
}
if (wParam>=kcSampStartNotes && wParam<=kcSampEndNotes)
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <rel...@us...> - 2008-10-13 17:28:29
|
Revision: 230
http://modplug.svn.sourceforge.net/modplug/?rev=230&view=rev
Author: relabsoluness
Date: 2008-10-13 17:28:21 +0000 (Mon, 13 Oct 2008)
Log Message:
-----------
(Patch from Jojo)
/ Sample editing: If possible, use loop points as trim limits if there's no selection chosen.
Modified Paths:
--------------
trunk/OpenMPT/mptrack/View_smp.cpp
Modified: trunk/OpenMPT/mptrack/View_smp.cpp
===================================================================
--- trunk/OpenMPT/mptrack/View_smp.cpp 2008-10-13 15:53:01 UTC (rev 229)
+++ trunk/OpenMPT/mptrack/View_smp.cpp 2008-10-13 17:28:21 UTC (rev 230)
@@ -1322,14 +1322,32 @@
m_dwMenuParam = dwPos;
}
}
+
if (m_dwBeginSel >= m_dwEndSel)
{
if (pins->uFlags & CHN_16BIT) ::AppendMenu(hMenu, MF_STRING, ID_SAMPLE_8BITCONVERT, "Convert to 8-bit");
if (pins->uFlags & CHN_STEREO) ::AppendMenu(hMenu, MF_STRING, ID_SAMPLE_MONOCONVERT, "Convert to mono");
}
+
+ // "Trim" menu item is responding differently if there's no selection,
+ // but a loop present: "trim around loop point"! (jojo in topic 2258)
+ std::string sTrimMenuText = "Trim";
+ bool bIsGrayed = (m_dwEndSel<=m_dwBeginSel);
+
+ if ((m_dwBeginSel == m_dwEndSel) && (pins->nLoopStart < pins->nLoopEnd))
+ {
+ // no selection => use loop points
+ sTrimMenuText += " around loop points";
+ bIsGrayed = false;
+ }
- ::AppendMenu(hMenu, MF_STRING|(m_dwEndSel>m_dwBeginSel)?0:MF_GRAYED,
- ID_SAMPLE_TRIM, "Trim\t" + ih->GetKeyTextFromCommand(kcSampleTrim));
+ sTrimMenuText += "\t" + ih->GetKeyTextFromCommand(kcSampleTrim);
+
+ // change by jojo: "trim" menu item is also available
+ // if there's no selection, but loop points
+ //::AppendMenu(hMenu, MF_STRING|(m_dwEndSel>m_dwBeginSel)?0:MF_GRAYED,
+ // ID_SAMPLE_TRIM, "Trim\t" + ih->GetKeyTextFromCommand(kcSampleTrim));
+ ::AppendMenu(hMenu, MF_STRING|(bIsGrayed)?MF_GRAYED:0, ID_SAMPLE_TRIM, sTrimMenuText.c_str());
::AppendMenu(hMenu, MF_STRING, ID_EDIT_CUT, "Cut\t" + ih->GetKeyTextFromCommand(kcEditCut));
::AppendMenu(hMenu, MF_STRING, ID_EDIT_COPY, "Copy\t" + ih->GetKeyTextFromCommand(kcEditCopy));
}
@@ -1825,51 +1843,60 @@
//------------------------------
{
CModDoc *pModDoc = GetDocument();
+ //nothing loaded or invalid sample slot.
+ if(!pModDoc || m_nSample >= MAX_SAMPLES) return;
+
+ CSoundFile *pSndFile = pModDoc->GetSoundFile();
+ MODINSTRUMENT *pins = &pSndFile->Ins[m_nSample];
+
+ if(m_dwBeginSel == m_dwEndSel) {
+ // trim around loop points if there's no selection (suggested by jojo in topic 2258)
+ m_dwBeginSel = pins->nLoopStart;
+ m_dwEndSel = pins->nLoopEnd;
+ }
+
+ if (m_dwBeginSel >= m_dwEndSel) return; // invalid selection
+
BeginWaitCursor();
- if ((pModDoc) && (m_nSample < MAX_SAMPLES) && (m_dwBeginSel < m_dwEndSel))
+ UINT nStart = m_dwBeginSel;
+ UINT nEnd = m_dwEndSel - m_dwBeginSel;
+
+ if ((pins->pSample) && (nStart+nEnd <= pins->nLength) && (nEnd >= 16))
{
- CSoundFile *pSndFile = pModDoc->GetSoundFile();
- MODINSTRUMENT *pins = &pSndFile->Ins[m_nSample];
- UINT nStart = m_dwBeginSel;
- UINT nEnd = m_dwEndSel - m_dwBeginSel;
-
- if ((pins->pSample) && (nStart+nEnd <= pins->nLength) && (nEnd >= 16))
+ BEGIN_CRITICAL();
{
- BEGIN_CRITICAL();
+ UINT bend = nEnd, bstart = nStart;
+ if (pins->uFlags & CHN_16BIT) { bend <<= 1; bstart <<= 1; }
+ if (pins->uFlags & CHN_STEREO) { bend <<= 1; bstart <<= 1; }
+ signed char *p = (signed char *)pins->pSample;
+ for (UINT i=0; i<bend; i++)
{
- UINT bend = nEnd, bstart = nStart;
- if (pins->uFlags & CHN_16BIT) { bend <<= 1; bstart <<= 1; }
- if (pins->uFlags & CHN_STEREO) { bend <<= 1; bstart <<= 1; }
- signed char *p = (signed char *)pins->pSample;
- for (UINT i=0; i<bend; i++)
- {
- p[i] = p[i+bstart];
- }
+ p[i] = p[i+bstart];
}
- if (pins->nLoopStart >= nStart) pins->nLoopStart -= nStart;
- if (pins->nLoopEnd >= nStart) pins->nLoopEnd -= nStart;
- if (pins->nSustainStart >= nStart) pins->nSustainStart -= nStart;
- if (pins->nSustainEnd >= nStart) pins->nSustainEnd -= nStart;
- if (pins->nLoopEnd > nEnd) pins->nLoopEnd = nEnd;
- if (pins->nSustainEnd > nEnd) pins->nSustainEnd = nEnd;
- if (pins->nLoopStart >= pins->nLoopEnd)
- {
- pins->nLoopStart = pins->nLoopEnd = 0;
- pins->uFlags &= ~(CHN_LOOP|CHN_PINGPONGLOOP);
- }
- if (pins->nSustainStart >= pins->nSustainEnd)
- {
- pins->nSustainStart = pins->nSustainEnd = 0;
- pins->uFlags &= ~(CHN_SUSTAINLOOP|CHN_PINGPONGSUSTAIN);
- }
- pins->nLength = nEnd;
- END_CRITICAL();
- pModDoc->SetModified();
- pModDoc->AdjustEndOfSample(m_nSample);
- SetCurSel(0, 0);
- // 05/01/05 : ericus replaced "m_nSample << 24" by "m_nSample << 20" : 4000 samples -> 12bits [see Moddoc.h]
- pModDoc->UpdateAllViews(NULL, (m_nSample << HINT_SHIFT_SMP) | HINT_SAMPLEDATA | HINT_SAMPLEINFO, NULL);
}
+ if (pins->nLoopStart >= nStart) pins->nLoopStart -= nStart;
+ if (pins->nLoopEnd >= nStart) pins->nLoopEnd -= nStart;
+ if (pins->nSustainStart >= nStart) pins->nSustainStart -= nStart;
+ if (pins->nSustainEnd >= nStart) pins->nSustainEnd -= nStart;
+ if (pins->nLoopEnd > nEnd) pins->nLoopEnd = nEnd;
+ if (pins->nSustainEnd > nEnd) pins->nSustainEnd = nEnd;
+ if (pins->nLoopStart >= pins->nLoopEnd)
+ {
+ pins->nLoopStart = pins->nLoopEnd = 0;
+ pins->uFlags &= ~(CHN_LOOP|CHN_PINGPONGLOOP);
+ }
+ if (pins->nSustainStart >= pins->nSustainEnd)
+ {
+ pins->nSustainStart = pins->nSustainEnd = 0;
+ pins->uFlags &= ~(CHN_SUSTAINLOOP|CHN_PINGPONGSUSTAIN);
+ }
+ pins->nLength = nEnd;
+ END_CRITICAL();
+ pModDoc->SetModified();
+ pModDoc->AdjustEndOfSample(m_nSample);
+ SetCurSel(0, 0);
+ // 05/01/05 : ericus replaced "m_nSample << 24" by "m_nSample << 20" : 4000 samples -> 12bits [see Moddoc.h]
+ pModDoc->UpdateAllViews(NULL, (m_nSample << HINT_SHIFT_SMP) | HINT_SAMPLEDATA | HINT_SAMPLEINFO, NULL);
}
EndWaitCursor();
}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <rel...@us...> - 2008-10-13 15:53:25
|
Revision: 229
http://modplug.svn.sourceforge.net/modplug/?rev=229&view=rev
Author: relabsoluness
Date: 2008-10-13 15:53:01 +0000 (Mon, 13 Oct 2008)
Log Message:
-----------
(Patch from Jojo)
. Disabled special handling of '&'-character when drawing texts to various components where the special handling should not take place. (http://lpchip.com/modplug/viewtopic.php?t=1962)
Modified Paths:
--------------
trunk/OpenMPT/mptrack/ChannelManagerDlg.cpp
trunk/OpenMPT/mptrack/Mptrack.cpp
Modified: trunk/OpenMPT/mptrack/ChannelManagerDlg.cpp
===================================================================
--- trunk/OpenMPT/mptrack/ChannelManagerDlg.cpp 2008-10-13 15:19:08 UTC (rev 228)
+++ trunk/OpenMPT/mptrack/ChannelManagerDlg.cpp 2008-10-13 15:53:01 UTC (rev 229)
@@ -596,7 +596,7 @@
HGDIOBJ oldfont = ::SelectObject(hdc, CMainFrame::GetGUIFont());
::SetTextColor(hdc, GetSysColor(bEnable || !bActivate ? COLOR_BTNTEXT : COLOR_GRAYTEXT));
- ::DrawText(hdc, lpszText, -1, &rect, dwFlags | DT_SINGLELINE);
+ ::DrawText(hdc, lpszText, -1, &rect, dwFlags | DT_SINGLELINE | DT_NOPREFIX);
::SelectObject(hdc, oldfont);
}
}
Modified: trunk/OpenMPT/mptrack/Mptrack.cpp
===================================================================
--- trunk/OpenMPT/mptrack/Mptrack.cpp 2008-10-13 15:19:08 UTC (rev 228)
+++ trunk/OpenMPT/mptrack/Mptrack.cpp 2008-10-13 15:53:01 UTC (rev 229)
@@ -1951,7 +1951,7 @@
::SetTextColor(hdc, GetSysColor((bDisabled) ? COLOR_GRAYTEXT : COLOR_BTNTEXT));
::SetBkMode(hdc, TRANSPARENT);
HGDIOBJ oldfont = ::SelectObject(hdc, CMainFrame::GetGUIFont());
- ::DrawText(hdc, lpszText, -1, &rect, dwFlags | DT_SINGLELINE);
+ ::DrawText(hdc, lpszText, -1, &rect, dwFlags | DT_SINGLELINE | DT_NOPREFIX);
::SelectObject(hdc, oldfont);
}
}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <rel...@us...> - 2008-10-13 15:19:24
|
Revision: 228
http://modplug.svn.sourceforge.net/modplug/?rev=228&view=rev
Author: relabsoluness
Date: 2008-10-13 15:19:08 +0000 (Mon, 13 Oct 2008)
Log Message:
-----------
/ PitchShift and time stretching are back. PitchShift wasn't affected by the license problem so its back as it was, and time stretching is now implemented with SoundTouch-library. SoundTouch is used from delay loaded DLL so the main program should work even if the library is not available.
/ Pitchshifting/Time Stretching of 8-bit samples is now disabled (didn't seem to work).
+ A few new methods added to MODINSTRUMENT for readability and easier usage.
/ Restored default orderlist margins to two.
+ Added new inisetting that can be used to show/hide some hack GUI controls.
/ Rearranged control tab order in sample control to make tooltips work in it(don't know why it matters).
/ mptrack now produces program database(pdb-file) also on release build.
Modified Paths:
--------------
trunk/OpenMPT/mptrack/Ctrl_pat.cpp
trunk/OpenMPT/mptrack/Ctrl_pat.h
trunk/OpenMPT/mptrack/Ctrl_smp.cpp
trunk/OpenMPT/mptrack/Ctrl_smp.h
trunk/OpenMPT/mptrack/MPTRACK.sln
trunk/OpenMPT/mptrack/MainFrm.cpp
trunk/OpenMPT/mptrack/Mainfrm.h
trunk/OpenMPT/mptrack/mptrack.rc
trunk/OpenMPT/mptrack/mptrack.vcproj
trunk/OpenMPT/mptrack/res/MPTRACK.RC2
trunk/OpenMPT/mptrack/resource.h
trunk/OpenMPT/soundlib/Sndfile.h
Modified: trunk/OpenMPT/mptrack/Ctrl_pat.cpp
===================================================================
--- trunk/OpenMPT/mptrack/Ctrl_pat.cpp 2008-10-13 14:25:58 UTC (rev 227)
+++ trunk/OpenMPT/mptrack/Ctrl_pat.cpp 2008-10-13 15:19:08 UTC (rev 228)
@@ -13,7 +13,6 @@
//////////////////////////////////////////////////////////////
// CCtrlPatterns
-bool CCtrlPatterns::s_ShowSequenceMarginsControls = false;
BEGIN_MESSAGE_MAP(CCtrlPatterns, CModControlDlg)
//{{AFX_MSG_MAP(CCtrlPatterns)
@@ -172,7 +171,7 @@
m_SpinInstrument.SetRange(-1, 1);
m_SpinInstrument.SetPos(0);
- if(s_ShowSequenceMarginsControls == true)
+ if(CMainFrame::gbShowHackControls == true)
{
m_SpinOrderListMargins.ShowWindow(SW_SHOW);
m_EditOrderListMargins.ShowWindow(SW_SHOW);
Modified: trunk/OpenMPT/mptrack/Ctrl_pat.h
===================================================================
--- trunk/OpenMPT/mptrack/Ctrl_pat.h 2008-10-13 14:25:58 UTC (rev 227)
+++ trunk/OpenMPT/mptrack/Ctrl_pat.h 2008-10-13 15:19:08 UTC (rev 228)
@@ -144,9 +144,6 @@
// -! NEW_FEATURE#0012
public:
- static bool s_ShowSequenceMarginsControls;
-
-public:
CCtrlPatterns();
LONG* GetSplitPosRef() {return &CMainFrame::glPatternWindowHeight;} //rewbs.varWindowSize
Modified: trunk/OpenMPT/mptrack/Ctrl_smp.cpp
===================================================================
--- trunk/OpenMPT/mptrack/Ctrl_smp.cpp 2008-10-13 14:25:58 UTC (rev 227)
+++ trunk/OpenMPT/mptrack/Ctrl_smp.cpp 2008-10-13 15:19:08 UTC (rev 228)
@@ -9,10 +9,14 @@
#include "dlg_misc.h"
#include "PSRatioCalc.h" //rewbs.timeStretchMods
#include "mpdlgs.h"
+#include "soundtouch/SoundTouch.h"
+#include "soundtouch/TDStretch.h"
+#pragma warning(disable:4244) //"conversion from 'type1' to 'type2', possible loss of data"
+#include "smbPitchShift.cpp"
+#pragma warning(default:4244) //"conversion from 'type1' to 'type2', possible loss of data"
-#ifndef NO_XSOUNDLIB
- #include "smbPitchShift.h"
- #include "samplerate.h"
+#ifdef _DEBUG
+ #define new DEBUG_NEW
#endif
#ifdef _DEBUG
@@ -64,15 +68,11 @@
ON_COMMAND(IDC_CHECK1, OnSetPanningChanged)
ON_COMMAND(ID_PREVINSTRUMENT, OnPrevInstrument)
ON_COMMAND(ID_NEXTINSTRUMENT, OnNextInstrument)
-
-#ifndef NO_XSOUNDLIB
ON_COMMAND(IDC_BUTTON1, OnPitchShiftTimeStretch)
ON_COMMAND(IDC_BUTTON2, OnEstimateSampleSize)
ON_COMMAND(IDC_BUTTON3, OnPitchShiftTimeStretchAccept)
ON_COMMAND(IDC_BUTTON4, OnPitchShiftTimeStretchCancel)
ON_COMMAND(IDC_CHECK3, OnEnableStretchToSize)
-#endif
-
ON_EN_CHANGE(IDC_SAMPLE_NAME, OnNameChanged)
ON_EN_CHANGE(IDC_SAMPLE_FILENAME, OnFileNameChanged)
ON_EN_CHANGE(IDC_EDIT_SAMPLE, OnSampleChanged)
@@ -138,43 +138,39 @@
DDX_Control(pDX, IDC_EDIT14, m_EditVibSweep);
DDX_Control(pDX, IDC_EDIT15, m_EditVibDepth);
DDX_Control(pDX, IDC_EDIT16, m_EditVibRate);
-
-#ifndef NO_XSOUNDLIB
DDX_Control(pDX, IDC_COMBO4, m_ComboPitch);
DDX_Control(pDX, IDC_COMBO5, m_ComboQuality);
DDX_Control(pDX, IDC_COMBO6, m_ComboFFT);
DDX_Text(pDX, IDC_EDIT6, m_dTimeStretchRatio); //rewbs.timeStretchMods
-#endif
-
//}}AFX_DATA_MAP
}
-CCtrlSamples::CCtrlSamples()
-//--------------------------
+CCtrlSamples::CCtrlSamples() :
+//----------------------------
+ m_nStretchProcessStepLength(nDefaultStretchChunkSize),
+ m_nSequenceMs(DEFAULT_SEQUENCE_MS),
+ m_nSeekWindowMs(DEFAULT_SEEKWINDOW_MS),
+ m_nOverlapMs(DEFAULT_OVERLAP_MS)
{
m_nSample = 1;
m_nLockCount = 1;
-
-#ifndef NO_XSOUNDLIB
pSampleUndoBuffer = NULL;
UndoBufferSize = 0;
-#endif
-
}
-#ifndef NO_XSOUNDLIB
- CCtrlSamples::~CCtrlSamples()
- {
- if(pSampleUndoBuffer) CSoundFile::FreeSample(pSampleUndoBuffer);
- pSampleUndoBuffer = NULL;
- UndoBufferSize = 0;
- }
-#endif
+CCtrlSamples::~CCtrlSamples()
+//---------------------------
+{
+ if(pSampleUndoBuffer) CSoundFile::FreeSample(pSampleUndoBuffer);
+ pSampleUndoBuffer = NULL;
+ UndoBufferSize = 0;
+}
+
CRuntimeClass *CCtrlSamples::GetAssociatedViewClass()
//---------------------------------------------------
{
@@ -241,7 +237,6 @@
}
-#ifndef NO_XSOUNDLIB
m_ComboFFT.ShowWindow(SW_SHOW);
m_ComboPitch.ShowWindow(SW_SHOW);
m_ComboQuality.ShowWindow(SW_SHOW);
@@ -315,7 +310,6 @@
// Stretch to size check box
OnEnableStretchToSize();
-#endif // NO_XSOUNDLIB
return TRUE;
}
@@ -337,9 +331,7 @@
if (pSndFile->m_nSamples < 1) pSndFile->m_nSamples = 1;
if ((nSmp < 1) || (nSmp > pSndFile->m_nSamples)) return FALSE;
-#ifndef NO_XSOUNDLIB
if(pSampleUndoBuffer) OnPitchShiftTimeStretchCancel();
-#endif
LockControls();
if (m_nSample != nSmp)
@@ -511,6 +503,9 @@
return TRUE;
}
break;
+ case IDC_EDIT_STRETCHPARAMS:
+ wsprintf(pszText, "SequenceMs SeekwindowMs OverlapMs ProcessStepLength");
+ return TRUE;
}
}
return FALSE;
@@ -683,11 +678,8 @@
DWORD len;
BOOL bOk;
-#ifndef NO_XSOUNDLIB
if(pSampleUndoBuffer) OnPitchShiftTimeStretchCancel();
-#endif
-
BeginWaitCursor();
if ((!lpszFileName) || (!f.Open(lpszFileName)))
{
@@ -803,11 +795,8 @@
{
if ((!pSndFile) || (!nSample) || (nSample > pSndFile->m_nSamples)) return FALSE;
-#ifndef NO_XSOUNDLIB
if(pSampleUndoBuffer) OnPitchShiftTimeStretchCancel();
-#endif
-
BeginWaitCursor();
BEGIN_CRITICAL();
m_pSndFile->DestroySample(m_nSample);
@@ -835,10 +824,7 @@
{
if ((!IsLocked()) && (m_pSndFile))
{
-
-#ifndef NO_XSOUNDLIB
if(pSampleUndoBuffer) OnPitchShiftTimeStretchCancel();
-#endif
UINT n = GetDlgItemInt(IDC_EDIT_SAMPLE);
if ((n > 0) && (n <= m_pSndFile->m_nSamples) && (n != m_nSample))
@@ -878,10 +864,7 @@
LONG smp = m_pModDoc->InsertSample(TRUE);
if (smp > 0)
{
-
- #ifndef NO_XSOUNDLIB
if(pSampleUndoBuffer) OnPitchShiftTimeStretchCancel();
- #endif
CSoundFile *pSndFile = m_pModDoc->GetSoundFile();
SetCurrentSample(smp);
@@ -1431,25 +1414,68 @@
}
-#ifndef NO_XSOUNDLIB
-
#define MAX_BUFFER_LENGTH 8192
#define CLIP_SOUND(v) v = v < -1.0f ? -1.0f : v > 1.0f ? 1.0f : v
+void CCtrlSamples::ReadTimeStretchParameters()
+//--------------------------------------------
+{
+ CString str;
+ GetDlgItemText(IDC_EDIT_STRETCHPARAMS, str);
+ _stscanf(str, __TEXT("%u %u %u %u"),
+ &m_nSequenceMs, &m_nSeekWindowMs, &m_nOverlapMs, &m_nStretchProcessStepLength);
+}
+
+
+void CCtrlSamples::UpdateTimeStretchParameterString()
+//---------------------------------------------------
+{
+ CString str;
+ str.Format(__TEXT("%u %u %u %u"),
+ m_nSequenceMs,
+ m_nSeekWindowMs,
+ m_nOverlapMs,
+ m_nStretchProcessStepLength
+ );
+ SetDlgItemText(IDC_EDIT_STRETCHPARAMS, str);
+}
+
void CCtrlSamples::OnEnableStretchToSize()
+//----------------------------------------
{
// Enable time-stretching / disable unused pitch-shifting UI elements
if(IsDlgButtonChecked(IDC_CHECK3)){
((CComboBox *)GetDlgItem(IDC_COMBO4))->EnableWindow(FALSE);
((CEdit *)GetDlgItem(IDC_EDIT6))->EnableWindow(TRUE);
((CButton *)GetDlgItem(IDC_BUTTON2))->EnableWindow(TRUE); //rewbs.timeStretchMods
+ GetDlgItem(IDC_TEXT_QUALITY)->ShowWindow(SW_HIDE);
+ GetDlgItem(IDC_COMBO5)->ShowWindow(SW_HIDE);
+ GetDlgItem(IDC_TEXT_FFT)->ShowWindow(SW_HIDE);
+ GetDlgItem(IDC_COMBO6)->ShowWindow(SW_HIDE);
+ GetDlgItem(IDC_TEXT_PITCH)->ShowWindow(SW_HIDE);
+ GetDlgItem(IDC_COMBO4)->ShowWindow(SW_HIDE);
+ if(CMainFrame::gbShowHackControls == true)
+ {
+ GetDlgItem(IDC_TEXT_STRETCHPARAMS)->ShowWindow(SW_SHOW);
+ GetDlgItem(IDC_EDIT_STRETCHPARAMS)->ShowWindow(SW_SHOW);
+ }
SetDlgItemText(IDC_BUTTON1, "Time Stretch");
+ UpdateTimeStretchParameterString();
}
// Enable pitch-shifting / disable unused time-stretching UI elements
else{
+ ReadTimeStretchParameters();
+ GetDlgItem(IDC_TEXT_QUALITY)->ShowWindow(SW_SHOW);
+ GetDlgItem(IDC_COMBO5)->ShowWindow(SW_SHOW);
+ GetDlgItem(IDC_TEXT_FFT)->ShowWindow(SW_SHOW);
+ GetDlgItem(IDC_COMBO6)->ShowWindow(SW_SHOW);
((CComboBox *)GetDlgItem(IDC_COMBO4))->EnableWindow(TRUE);
((CEdit *)GetDlgItem(IDC_EDIT6))->EnableWindow(FALSE);
((CButton *)GetDlgItem(IDC_BUTTON2))->EnableWindow(FALSE); //rewbs.timeStretchMods
+ GetDlgItem(IDC_TEXT_STRETCHPARAMS)->ShowWindow(SW_HIDE);
+ GetDlgItem(IDC_EDIT_STRETCHPARAMS)->ShowWindow(SW_HIDE);
+ GetDlgItem(IDC_TEXT_PITCH)->ShowWindow(SW_SHOW);
+ GetDlgItem(IDC_COMBO4)->ShowWindow(SW_SHOW);
SetDlgItemText(IDC_BUTTON1, "Pitch Shift");
}
}
@@ -1519,11 +1545,14 @@
UpdateData(TRUE); //Ensure m_dTimeStretchRatio is up-to-date with textbox content
errorcode = TimeStretch(m_dTimeStretchRatio/100.0);
- //Update loop points
- pins->nLoopStart *= m_dTimeStretchRatio/100.0;
- pins->nLoopEnd *= m_dTimeStretchRatio/100.0;
- pins->nSustainStart *= m_dTimeStretchRatio/100.0;
- pins->nSustainEnd *= m_dTimeStretchRatio/100.0;
+ //Update loop points only if no error occured.
+ if(errorcode == 0)
+ {
+ pins->nLoopStart *= m_dTimeStretchRatio/100.0;
+ pins->nLoopEnd *= m_dTimeStretchRatio/100.0;
+ pins->nSustainStart *= m_dTimeStretchRatio/100.0;
+ pins->nSustainEnd *= m_dTimeStretchRatio/100.0;
+ }
//end rewbs.timeStretchMods
}
@@ -1574,6 +1603,12 @@
break;
case 3 : wsprintf(str,"Not enough memory...");
break;
+ case 4 : wsprintf(str, "Action can be applied only to 16-bit samples.");
+ break;
+ case 5 : wsprintf(str, "Too low sample rate");
+ break;
+ case 6 : wsprintf(str, "Too short sample");
+ break;
default: wsprintf(str,"Unknown Error...");
break;
}
@@ -1586,6 +1621,7 @@
}
void CCtrlSamples::OnPitchShiftTimeStretchAccept()
+//------------------------------------------------
{
// Free sample undo buffer
if(pSampleUndoBuffer) CSoundFile::FreeSample(pSampleUndoBuffer);
@@ -1662,12 +1698,25 @@
m_pModDoc->SetModified();
}
+
int CCtrlSamples::TimeStretch(double ratio)
+//-----------------------------------------
{
if((!m_pSndFile) || (!m_pSndFile->Ins[m_nSample].pSample)) return -1;
MODINSTRUMENT *pins = &m_pSndFile->Ins[m_nSample];
if(!pins) return -1;
+ // Stretching is implemented only for 16-bit samples. Return with
+ // error if trying to use wtih non 16-bit samples.
+ if(pins->GetElementarySampleSize() != 2)
+ return 4;
+
+ // SoundTouch seems to crash with short samples. Don't know what
+ // the actual limit or whether it depends on sample rate,
+ // but simply set some semiarbitrary threshold here.
+ if(pins->nLength < 256)
+ return 6;
+
// Refuse processing when ratio is negative, equal to zero or equal to 1.0
if(ratio <= 0.0 || ratio == 1.0) return -1;
@@ -1676,42 +1725,31 @@
if(pitch < 0.5f) return 2 + (1<<8);
if(pitch > 2.0f) return 2 + (2<<8);
+ soundtouch::SoundTouch* pSoundTouch = 0;
+ try
+ {
+ pSoundTouch = new soundtouch::SoundTouch;
+ }
+ catch(...)
+ { // Assuming that thrown exception means that soundtouch library could not be loaded.
+ MessageBox("Failed to load soundtouch library.", 0, MB_ICONERROR);
+ return -1;
+ }
+
// Get number of channels & sample size
- BYTE smpsize = (pins->uFlags & CHN_16BIT) ? 2 : 1;
- UINT nChn = (pins->uFlags & CHN_STEREO) ? 2 : 1;
+ const BYTE smpsize = pins->GetElementarySampleSize();
+ const UINT nChn = pins->GetNumChannels();
// Allocate new sample
- DWORD newsize = (DWORD)(0.5 + ratio * (double)pins->nLength);
+ const DWORD nNewSampleLength = (DWORD)(0.5 + ratio * (double)pins->nLength);
PVOID pSample = pins->pSample;
- PVOID pNewSample = CSoundFile::AllocateSample(newsize * nChn * smpsize);
- if(pNewSample == NULL) return 3;
+ PVOID pNewSample = CSoundFile::AllocateSample(nNewSampleLength * nChn * smpsize);
+ if(pNewSample == NULL)
+ {
+ delete pSoundTouch;
+ return 3;
+ }
- // Apply pitch-shifting step
- PitchShift(pitch);
-
- // Allocate working buffers
- UINT outputsize = (UINT)(0.5 + ratio * (double)MAX_BUFFER_LENGTH);
- if( (outputsize & 1) && (smpsize == 2 || nChn == 2) ) outputsize++;
-
- float * buffer = new float[MAX_BUFFER_LENGTH * nChn];
- float * outbuf = new float[outputsize * nChn];
-
- // Create resampler
- int error;
- SRC_STATE * resampler = src_new(SRC_SINC_BEST_QUALITY, nChn, &error) ;
-
- // Fill in resampler data struct
- SRC_DATA data;
- data.data_in = &buffer[0];
- data.input_frames = MAX_BUFFER_LENGTH;
- data.data_out = &outbuf[0];
- data.output_frames = outputsize;
- data.src_ratio = ratio;
- data.end_of_input = 0;
-
- // Deduce max sample value (float conversion step)
- float maxSampleValue = ( 1 << (smpsize * 8 - 1) ) - 1;
-
// Save process button text (to be used as "progress bar" indicator while processing)
CHAR oldText[255];
GetDlgItemText(IDC_BUTTON1, oldText, 255);
@@ -1732,16 +1770,58 @@
// Show wait mouse cursor
BeginWaitCursor();
- SetDlgItemText(IDC_STATIC1,"Resampling...");
+ SetDlgItemText(IDC_STATIC1, "Stretching...");
- // Apply stretching (resampling) step
- UINT pos = 0, posnew = 0;
- UINT len = MAX_BUFFER_LENGTH;
+ UINT pos = 0;
+ UINT len = 0; //To contain length of processing step.
- // Process sample buffer using MAX_BUFFER_LENGTH (max) sized chunk steps (in order to allow
- // the processing of BIG samples...)
- while(pos < pins->nLength){
+ // Initialize soundtouch object.
+ {
+ const uint32 nSampleRate = pins->GetSampleRate(m_pSndFile->GetType());
+ if(nSampleRate < 300) // Too low samplerate crashes soundtouch.
+ { // Limiting it to value 300(quite arbitrarily chosen).
+ delete pSoundTouch;
+ return 5;
+ }
+ pSoundTouch->setSampleRate(nSampleRate);
+ pSoundTouch->setChannels(nChn);
+ // Given ratio is time stretch ratio, and must be converted to
+ // tempo change ratio: for example time stretch ratio 2 means
+ // tempo change ratio 0.5.
+ pSoundTouch->setTempoChange( (1.0f / ratio - 1.0f) * 100.0f);
+ pSoundTouch->setSetting(SETTING_USE_QUICKSEEK, 0);
+ // Read settings from GUI.
+ ReadTimeStretchParameters();
+
+ if(m_nStretchProcessStepLength == 0) m_nStretchProcessStepLength = nDefaultStretchChunkSize;
+ if(m_nStretchProcessStepLength < 64) m_nStretchProcessStepLength = nDefaultStretchChunkSize;
+ len = m_nStretchProcessStepLength;
+
+ // Set settings to soundtouch. Zero value means 'use default', and
+ // setting value is read back after setting because not all settings are accepted.
+ if(m_nSequenceMs == 0) m_nSequenceMs = DEFAULT_SEQUENCE_MS;
+ pSoundTouch->setSetting(SETTING_SEQUENCE_MS, m_nSequenceMs);
+ m_nSequenceMs = pSoundTouch->getSetting(SETTING_SEQUENCE_MS);
+
+ if(m_nSeekWindowMs == 0) m_nSeekWindowMs = DEFAULT_SEEKWINDOW_MS;
+ pSoundTouch->setSetting(SETTING_SEEKWINDOW_MS, m_nSeekWindowMs);
+ m_nSeekWindowMs = pSoundTouch->getSetting(SETTING_SEEKWINDOW_MS);
+
+ if(m_nOverlapMs == 0) m_nOverlapMs = DEFAULT_OVERLAP_MS;
+ pSoundTouch->setSetting(SETTING_OVERLAP_MS, m_nOverlapMs);
+ m_nOverlapMs = pSoundTouch->getSetting(SETTING_OVERLAP_MS);
+
+ // Update GUI with the actual SoundTouch parameters in effect.
+ UpdateTimeStretchParameterString();
+ }
+
+ // Keeps count of the sample length received from stretching process.
+ UINT nLengthCounter = 0;
+
+ // Process sample in steps.
+ while(pos < pins->nLength)
+ {
// Current chunk size limit test
if(pos + len >= pins->nLength) len = pins->nLength - pos;
@@ -1759,58 +1839,26 @@
::DrawText(processButtonDC,progress,strlen(progress),&processButtonRect,DT_CENTER | DT_SINGLELINE | DT_VCENTER);
::GdiFlush();
- // Convert current channel's data chunk to float
- BYTE * ptr = (BYTE *)pSample + pos * smpsize * nChn;
+ // Send sampledata for processing.
+ pSoundTouch->putSamples(reinterpret_cast<int16*>(pins->pSample + pos * smpsize * nChn), len);
- for(UINT j = 0 ; j < len ; j++){
- switch(smpsize){
- case 2:
- buffer[j*nChn] = ((float)(*(SHORT *)ptr)) / maxSampleValue;
- if(nChn == 2) { ptr += 2; buffer[j*nChn+1] = ((float)(*(SHORT *)ptr)) / maxSampleValue; }
- break;
- case 1:
- buffer[j*nChn] = ((float)*ptr) / maxSampleValue;
- if(nChn == 2) { ptr++; buffer[j*nChn+1] = ((float)*ptr) / maxSampleValue; }
- break;
- }
- ptr += smpsize;
- }
+ // Receive some processed samples (it's not guaranteed that there is any available).
+ nLengthCounter += pSoundTouch->receiveSamples(reinterpret_cast<int16*>(pNewSample) + nChn * nLengthCounter, nNewSampleLength - nLengthCounter);
- // Wake up resampler...
- if(pos + MAX_BUFFER_LENGTH >= pins->nLength) data.end_of_input = 1;
- src_process(resampler, &data);
-
- // New buffer limit test (seems like, whatever the size of the last chunk, the resampler return buffer size instead of processed size)
- if(data.end_of_input && posnew + (UINT)data.output_frames_gen >= newsize) data.output_frames_gen = newsize - posnew;
-
- // Convert resampled float buffer into new sample buffer
- ptr = (BYTE *)pNewSample + posnew * smpsize * nChn;
-
- for(UINT j = 0 ; j < (UINT)data.output_frames_gen ; j++){
- // Just perform a little bit of clipping...
- float v = outbuf[j*nChn]; CLIP_SOUND(v);
- // ...before converting back to buffer
- switch(smpsize){
- case 2:
- *(SHORT *)ptr = (SHORT)(v * maxSampleValue);
- if(nChn == 2) { ptr += 2; v = outbuf[j*nChn+1]; CLIP_SOUND(v); *(SHORT *)ptr = (SHORT)(v * maxSampleValue); }
- break;
- case 1:
- *ptr = (BYTE)(v * maxSampleValue);
- if(nChn == 2) { ptr++; v = outbuf[j*nChn+1]; CLIP_SOUND(v); *ptr = (BYTE)(v * maxSampleValue); }
- break;
- }
- ptr += smpsize;
- }
-
// Next buffer chunk
- posnew += data.output_frames_gen;
- pos += MAX_BUFFER_LENGTH;
+ pos += len;
}
- // Update newsize with generated size
- newsize = posnew;
+ // The input sample should now be processed. Receive remaining samples.
+ pSoundTouch->flush();
+ while(pSoundTouch->numSamples() > 0 && nNewSampleLength > nLengthCounter)
+ {
+ nLengthCounter += pSoundTouch->receiveSamples(reinterpret_cast<int16*>(pNewSample) + nChn * nLengthCounter, nNewSampleLength - nLengthCounter);
+ }
+ delete pSoundTouch; pSoundTouch = 0;
+ ASSERT(nNewSampleLength >= nLengthCounter);
+
// Swap sample buffer pointer to new buffer, update song + sample data & free old sample buffer
BEGIN_CRITICAL();
for(UINT i=0 ; i < MAX_CHANNELS ; i++){
@@ -1822,17 +1870,9 @@
}
pins->pSample = (LPSTR)pNewSample;
CSoundFile::FreeSample(pSample);
- pins->nLength = newsize;
+ pins->nLength = min(nLengthCounter, nNewSampleLength);
END_CRITICAL();
- // Free working buffers
- data.data_in = data.data_out = NULL;
- if(buffer) delete [] buffer;
- if(outbuf) delete [] outbuf;
-
- // Free resampler
- if(resampler) src_delete(resampler);
-
// Free progress bar brushes
DeleteObject((HBRUSH)green);
DeleteObject((HBRUSH)red);
@@ -1848,6 +1888,7 @@
}
int CCtrlSamples::PitchShift(float pitch)
+//---------------------------------------
{
if((!m_pSndFile) || (!m_pSndFile->Ins[m_nSample].pSample)) return -1;
if(pitch < 0.5f) return 1 + (1<<8);
@@ -1857,6 +1898,11 @@
MODINSTRUMENT *pins = &m_pSndFile->Ins[m_nSample];
if(!pins) return 2;
+ // PitchShift seems to work only with 16-bit samples. Return with
+ // error if trying to use non 16-bit samples.
+ if(pins->GetElementarySampleSize() != 2)
+ return 4;
+
// Get number of channels & sample size
BYTE smpsize = (pins->uFlags & CHN_16BIT) ? 2 : 1;
UINT nChn = (pins->uFlags & CHN_STEREO) ? 2 : 1;
@@ -2013,9 +2059,7 @@
return 0;
}
-#endif // NO_XSOUNDLIB
-
void CCtrlSamples::OnReverse()
//----------------------------
{
Modified: trunk/OpenMPT/mptrack/Ctrl_smp.h
===================================================================
--- trunk/OpenMPT/mptrack/Ctrl_smp.h 2008-10-13 14:25:58 UTC (rev 227)
+++ trunk/OpenMPT/mptrack/Ctrl_smp.h 2008-10-13 15:19:08 UTC (rev 228)
@@ -1,10 +1,7 @@
#ifndef _CONTROL_SAMPLES_H_
#define _CONTROL_SAMPLES_H_
-// If defined, disables pitch shifting - time stretching.
-#define NO_XSOUNDLIB
-
//=======================================
class CCtrlSamples: public CModControlDlg
//=======================================
@@ -22,25 +19,25 @@
CButton m_CheckPanning;
UINT m_nSample;
double m_dTimeStretchRatio; //rewbs.timeStretchMods
-
+ uint32 m_nStretchProcessStepLength;
+ uint32 m_nSequenceMs;
+ uint32 m_nSeekWindowMs;
+ uint32 m_nOverlapMs;
+ enum {nDefaultStretchChunkSize = 8192};
-#ifndef NO_XSOUNDLIB
CComboBox m_ComboPitch, m_ComboQuality, m_ComboFFT;
PVOID pSampleUndoBuffer;
UINT UndoBufferSize;
int PitchShift(float pitch);
int TimeStretch(double ratio);
-#endif
+ void UpdateTimeStretchParameterString();
+ void ReadTimeStretchParameters();
public:
CCtrlSamples();
-
-#ifndef NO_XSOUNDLIB
~CCtrlSamples();
-#endif
-public:
BOOL SetCurrentSample(UINT n, LONG lZoom=-1, BOOL bUpdNum=TRUE);
BOOL OpenSample(LPCSTR lpszFileName);
BOOL OpenSample(CSoundFile *pSndFile, UINT nSample);
@@ -96,13 +93,11 @@
afx_msg void OnVScroll(UINT, UINT, CScrollBar *);
afx_msg LRESULT OnCustomKeyMsg(WPARAM, LPARAM); //rewbs.customKeys
-#ifndef NO_XSOUNDLIB
afx_msg void OnPitchShiftTimeStretch();
afx_msg void OnEnableStretchToSize();
afx_msg void OnEstimateSampleSize();
afx_msg void OnPitchShiftTimeStretchAccept();
afx_msg void OnPitchShiftTimeStretchCancel();
-#endif
//}}AFX_MSG
DECLARE_MESSAGE_MAP()
Modified: trunk/OpenMPT/mptrack/MPTRACK.sln
===================================================================
--- trunk/OpenMPT/mptrack/MPTRACK.sln 2008-10-13 14:25:58 UTC (rev 227)
+++ trunk/OpenMPT/mptrack/MPTRACK.sln 2008-10-13 15:19:08 UTC (rev 228)
@@ -3,6 +3,7 @@
ProjectSection(ProjectDependencies) = postProject
{1FF4AB04-B22F-4CB8-AA2A-0C5095B5FEE4} = {1FF4AB04-B22F-4CB8-AA2A-0C5095B5FEE4}
{71531076-78C7-488D-8FD6-9D841F20AADE} = {71531076-78C7-488D-8FD6-9D841F20AADE}
+ {CF3C2CA5-5D45-4635-BBA4-C1F435E10896} = {CF3C2CA5-5D45-4635-BBA4-C1F435E10896}
{3C7281B0-D0E2-48ED-AE4D-A181FC77D8F7} = {3C7281B0-D0E2-48ED-AE4D-A181FC77D8F7}
EndProjectSection
EndProject
@@ -22,6 +23,10 @@
ProjectSection(ProjectDependencies) = postProject
EndProjectSection
EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "soundtouch", "..\soundtouch\soundtouch.vcproj", "{CF3C2CA5-5D45-4635-BBA4-C1F435E10896}"
+ ProjectSection(ProjectDependencies) = postProject
+ EndProjectSection
+EndProject
Global
GlobalSection(SolutionConfiguration) = preSolution
Debug = Debug
@@ -50,6 +55,10 @@
{DCC2BB2F-6778-4FD3-9C00-D6CD8DC917B8}.Debug.Build.0 = Debug|Win32
{DCC2BB2F-6778-4FD3-9C00-D6CD8DC917B8}.Release.ActiveCfg = Release|Win32
{DCC2BB2F-6778-4FD3-9C00-D6CD8DC917B8}.Release.Build.0 = Release|Win32
+ {CF3C2CA5-5D45-4635-BBA4-C1F435E10896}.Debug.ActiveCfg = Debug|Win32
+ {CF3C2CA5-5D45-4635-BBA4-C1F435E10896}.Debug.Build.0 = Debug|Win32
+ {CF3C2CA5-5D45-4635-BBA4-C1F435E10896}.Release.ActiveCfg = Release|Win32
+ {CF3C2CA5-5D45-4635-BBA4-C1F435E10896}.Release.Build.0 = Release|Win32
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
EndGlobalSection
Modified: trunk/OpenMPT/mptrack/MainFrm.cpp
===================================================================
--- trunk/OpenMPT/mptrack/MainFrm.cpp 2008-10-13 14:25:58 UTC (rev 227)
+++ trunk/OpenMPT/mptrack/MainFrm.cpp 2008-10-13 15:19:08 UTC (rev 228)
@@ -133,6 +133,7 @@
UINT CMainFrame::m_nFilterIndex = 0;
UINT CMainFrame::m_nLastOptionsPage = 0;
BOOL CMainFrame::gbMdiMaximize = FALSE;
+bool CMainFrame::gbShowHackControls = false;
//rewbs.varWindowSize
LONG CMainFrame::glCtrlWindowHeight = 188; //obsolete, for backwards compat only
LONG CMainFrame::glGeneralWindowHeight = 178;
@@ -427,8 +428,8 @@
gbPatternPluginNames = GetPrivateProfileDWord("Pattern Editor", "Plugin-Names", true, iniFile);
gbPatternRecord = GetPrivateProfileDWord("Pattern Editor", "Record", true, iniFile);
gnAutoChordWaitTime = GetPrivateProfileDWord("Pattern Editor", "AutoChordWaitTime", 60, iniFile);
- CCtrlPatterns::s_ShowSequenceMarginsControls = (0 != GetPrivateProfileDWord("Pattern Editor", "ShowSequenceMarginsControls", 0, iniFile));
- COrderList::s_nDefaultMargins = static_cast<BYTE>(GetPrivateProfileInt("Pattern Editor", "DefaultSequenceMargins", 0, iniFile));
+ COrderList::s_nDefaultMargins = static_cast<BYTE>(GetPrivateProfileInt("Pattern Editor", "DefaultSequenceMargins", 2, iniFile));
+ gbShowHackControls = (0 != GetPrivateProfileDWord("Misc", "ShowHackControls", 0, iniFile));
GetPrivateProfileString("Paths", "Songs_Directory", m_szModDir, m_szModDir, INIBUFFERSIZE, iniFile);
GetPrivateProfileString("Paths", "Samples_Directory", m_szSmpDir, m_szSmpDir, INIBUFFERSIZE, iniFile);
Modified: trunk/OpenMPT/mptrack/Mainfrm.h
===================================================================
--- trunk/OpenMPT/mptrack/Mainfrm.h 2008-10-13 14:25:58 UTC (rev 227)
+++ trunk/OpenMPT/mptrack/Mainfrm.h 2008-10-13 15:19:08 UTC (rev 228)
@@ -365,6 +365,7 @@
// Globals
static UINT m_nLastOptionsPage, m_nFilterIndex;
static BOOL gbMdiMaximize;
+ static bool gbShowHackControls;
static LONG glCtrlWindowHeight, glTreeWindowWidth, glTreeSplitRatio;
static LONG glGeneralWindowHeight, glPatternWindowHeight, glSampleWindowHeight,
glInstrumentWindowHeight, glCommentsWindowHeight, glGraphWindowHeight; //rewbs.varWindowSize
Modified: trunk/OpenMPT/mptrack/mptrack.rc
===================================================================
--- trunk/OpenMPT/mptrack/mptrack.rc 2008-10-13 14:25:58 UTC (rev 227)
+++ trunk/OpenMPT/mptrack/mptrack.rc 2008-10-13 15:19:08 UTC (rev 228)
@@ -675,23 +675,15 @@
BEGIN
CONTROL "Toolbar1",IDC_TOOLBAR1,"ToolbarWindow32",WS_GROUP |
0x4d,4,4,55,17
- RTEXT "Sample",IDC_STATIC,62,8,24,8
EDITTEXT IDC_EDIT_SAMPLE,90,6,35,12,ES_AUTOHSCROLL | ES_NUMBER
CONTROL "Spin6",IDC_SPIN_SAMPLE,"msctls_updown32",UDS_WRAP |
UDS_SETBUDDYINT | UDS_ALIGNRIGHT | UDS_AUTOBUDDY |
UDS_NOTHOUSANDS,118,4,11,14
COMBOBOX IDC_COMBO_ZOOM,131,6,41,89,CBS_DROPDOWNLIST | WS_VSCROLL
- CTEXT "Length: 000000 (16-bit)",IDC_TEXT5,175,6,90,13,
- SS_CENTERIMAGE,WS_EX_STATICEDGE
- CONTROL "Toolbar2",IDC_TOOLBAR2,"ToolbarWindow32",WS_GROUP |
- 0x4d,268,4,136,17
- GROUPBOX "",IDC_STATIC,3,22,94,78
- LTEXT "Default Volume",IDC_STATIC,8,32,49,8
EDITTEXT IDC_EDIT7,57,30,36,12,ES_NUMBER
CONTROL "Spin1",IDC_SPIN7,"msctls_updown32",UDS_SETBUDDYINT |
UDS_ALIGNRIGHT | UDS_AUTOBUDDY | UDS_NOTHOUSANDS,87,29,
11,11
- LTEXT "Global Volume",IDC_STATIC,8,45,46,8
EDITTEXT IDC_EDIT8,57,43,36,12,ES_NUMBER
CONTROL "Spin1",IDC_SPIN8,"msctls_updown32",UDS_SETBUDDYINT |
UDS_ALIGNRIGHT | UDS_AUTOBUDDY | UDS_NOTHOUSANDS,87,42,
@@ -702,79 +694,46 @@
CONTROL "Spin1",IDC_SPIN9,"msctls_updown32",UDS_SETBUDDYINT |
UDS_ALIGNRIGHT | UDS_AUTOBUDDY | UDS_NOTHOUSANDS,87,56,
11,11
- LTEXT "FineTune",IDC_TEXT7,8,73,37,8
EDITTEXT IDC_EDIT5,48,70,45,12,ES_AUTOHSCROLL
CONTROL "Spin1",IDC_SPIN5,"msctls_updown32",UDS_ALIGNRIGHT |
UDS_AUTOBUDDY | UDS_NOTHOUSANDS,87,69,11,11
- LTEXT "Transpose",IDC_TEXT6,8,86,38,8
COMBOBOX IDC_COMBO_BASENOTE,48,83,45,89,CBS_DROPDOWNLIST |
WS_VSCROLL
- CTEXT "Name",IDC_STATIC,102,26,28,12,SS_CENTERIMAGE | NOT
- WS_GROUP,WS_EX_STATICEDGE
EDITTEXT IDC_SAMPLE_NAME,129,26,135,12,ES_AUTOHSCROLL
- CTEXT "File",IDC_STATIC,269,26,23,13,SS_CENTERIMAGE | NOT
- WS_GROUP | WS_TABSTOP,WS_EX_STATICEDGE
EDITTEXT IDC_SAMPLE_FILENAME,292,26,72,13,ES_AUTOHSCROLL
- GROUPBOX "Loop",IDC_STATIC,102,43,79,57
- LTEXT "Type",IDC_STATIC,107,57,17,8
COMBOBOX IDC_COMBO1,130,54,45,46,CBS_DROPDOWNLIST | WS_TABSTOP
- LTEXT "Start",IDC_STATIC,107,73,16,8
EDITTEXT IDC_EDIT1,130,70,45,12,ES_NUMBER
CONTROL "Spin1",IDC_SPIN1,"msctls_updown32",UDS_ALIGNRIGHT |
UDS_AUTOBUDDY | UDS_NOTHOUSANDS,169,69,11,11
- LTEXT "End",IDC_STATIC,107,86,14,8
EDITTEXT IDC_EDIT2,130,83,45,12,ES_NUMBER
CONTROL "Spin1",IDC_SPIN2,"msctls_updown32",UDS_ALIGNRIGHT |
UDS_AUTOBUDDY | UDS_NOTHOUSANDS,169,84,11,11
- GROUPBOX "Sustain Loop",IDC_STATIC,185,43,79,57
- LTEXT "Type",IDC_STATIC,189,57,17,8
COMBOBOX IDC_COMBO2,212,54,45,46,CBS_DROPDOWNLIST | WS_TABSTOP
- LTEXT "Start",IDC_STATIC,189,73,16,8
EDITTEXT IDC_EDIT3,212,70,45,12,ES_NUMBER
CONTROL "Spin1",IDC_SPIN3,"msctls_updown32",UDS_ALIGNRIGHT |
UDS_AUTOBUDDY | UDS_NOTHOUSANDS,253,70,11,11
- LTEXT "End",IDC_STATIC,189,86,14,8
EDITTEXT IDC_EDIT4,212,83,45,12,ES_NUMBER
CONTROL "Spin1",IDC_SPIN4,"msctls_updown32",UDS_ALIGNRIGHT |
UDS_AUTOBUDDY | UDS_NOTHOUSANDS,253,83,11,11
- GROUPBOX "",IDC_STATIC,269,43,96,57
COMBOBOX IDC_COMBO3,275,59,47,70,CBS_DROPDOWNLIST | WS_TABSTOP
- LTEXT "Depth",IDC_STATIC,327,50,20,8
EDITTEXT IDC_EDIT15,327,59,32,12,ES_NUMBER
CONTROL "Depth",IDC_SPIN12,"msctls_updown32",UDS_SETBUDDYINT |
UDS_ALIGNRIGHT | UDS_AUTOBUDDY | UDS_NOTHOUSANDS,353,59,
11,11
- LTEXT "Sweep",IDC_STATIC,275,74,23,8
EDITTEXT IDC_EDIT14,275,83,38,12,ES_NUMBER
CONTROL "Sweep",IDC_SPIN11,"msctls_updown32",UDS_SETBUDDYINT |
UDS_ALIGNRIGHT | UDS_AUTOBUDDY | UDS_NOTHOUSANDS,305,84,
11,11
- LTEXT "Rate",IDC_STATIC,321,74,16,8
EDITTEXT IDC_EDIT16,321,83,38,12,ES_NUMBER
CONTROL "Rate",IDC_SPIN13,"msctls_updown32",UDS_SETBUDDYINT |
UDS_ALIGNRIGHT | UDS_AUTOBUDDY | UDS_NOTHOUSANDS,353,83,
11,11
- LTEXT "Auto-Vibrato",IDC_STATIC,275,50,41,8
- GROUPBOX "Pitch shifting / Time stretching",
- IDC_GROUPBOX_PITCH_TIME,370,22,150,78,NOT WS_VISIBLE
- LTEXT "Pitch",IDC_TEXT_PITCH,374,38,23,10,NOT WS_VISIBLE
- LTEXT "Quality",IDC_TEXT_QUALITY,374,54,23,10,NOT WS_VISIBLE
- LTEXT "FFT",IDC_TEXT_FFT,374,70,23,10,NOT WS_VISIBLE
+ CONTROL "Time stretching",IDC_CHECK3,"Button",BS_AUTOCHECKBOX |
+ BS_LEFTTEXT | BS_FLAT | NOT WS_VISIBLE | WS_TABSTOP,446,
+ 36,68,11
CONTROL "Preview mode",IDC_CHECK2,"Button",BS_AUTOCHECKBOX |
BS_LEFTTEXT | BS_FLAT | NOT WS_VISIBLE | WS_TABSTOP,373,
83,65,11
- CONTROL "Time stretching",IDC_CHECK3,"Button",BS_AUTOCHECKBOX |
- BS_LEFTTEXT | BS_FLAT | NOT WS_VISIBLE | WS_TABSTOP,446,
- 36,68,11
- EDITTEXT IDC_EDIT6,446,51,45,13,ES_RIGHT | ES_AUTOHSCROLL | NOT
- WS_VISIBLE,WS_EX_RIGHT
- CTEXT "Static",IDC_TEXT_PREVIEW,448,69,67,10,NOT WS_VISIBLE
- PUSHBUTTON "Process",IDC_BUTTON1,448,80,67,16,NOT WS_VISIBLE,
- WS_EX_CLIENTEDGE
- PUSHBUTTON "...",IDC_BUTTON2,502,51,13,13,NOT WS_VISIBLE,
- WS_EX_CLIENTEDGE
- PUSHBUTTON "Keep",IDC_BUTTON3,448,82,32,13,NOT WS_VISIBLE,
- WS_EX_CLIENTEDGE
PUSHBUTTON "Restore",IDC_BUTTON4,482,82,33,13,NOT WS_VISIBLE,
WS_EX_CLIENTEDGE
COMBOBOX IDC_COMBO4,400,35,39,61,CBS_DROPDOWNLIST | NOT
@@ -783,7 +742,50 @@
WS_VISIBLE | WS_VSCROLL | WS_GROUP | WS_TABSTOP
COMBOBOX IDC_COMBO6,400,67,39,61,CBS_DROPDOWNLIST | NOT
WS_VISIBLE | WS_VSCROLL | WS_GROUP | WS_TABSTOP
+ EDITTEXT IDC_EDIT_STRETCHPARAMS,374,51,64,12,ES_AUTOHSCROLL
+ EDITTEXT IDC_EDIT6,446,51,45,12,ES_RIGHT | ES_AUTOHSCROLL | NOT
+ WS_VISIBLE,WS_EX_RIGHT
+ PUSHBUTTON "...",IDC_BUTTON2,502,51,13,13,NOT WS_VISIBLE,
+ WS_EX_CLIENTEDGE
+ RTEXT "Sample",IDC_STATIC,62,8,24,8
+ CTEXT "Length: 000000 (16-bit)",IDC_TEXT5,175,6,90,13,
+ SS_CENTERIMAGE,WS_EX_STATICEDGE
+ CONTROL "Toolbar2",IDC_TOOLBAR2,"ToolbarWindow32",WS_GROUP |
+ 0x4d,268,4,136,17
+ GROUPBOX "",IDC_STATIC,3,22,94,78
+ LTEXT "Default Volume",IDC_STATIC,8,32,49,8
+ LTEXT "Global Volume",IDC_STATIC,8,45,46,8
+ LTEXT "FineTune",IDC_TEXT7,8,73,37,8
+ LTEXT "Transpose",IDC_TEXT6,8,86,38,8
+ CTEXT "Name",IDC_STATIC,102,26,28,12,SS_CENTERIMAGE | NOT
+ WS_GROUP,WS_EX_STATICEDGE
+ CTEXT "File",IDC_STATIC,269,26,23,13,SS_CENTERIMAGE | NOT
+ WS_GROUP | WS_TABSTOP,WS_EX_STATICEDGE
+ GROUPBOX "Loop",IDC_STATIC,102,43,79,57
+ LTEXT "Type",IDC_STATIC,107,57,17,8
+ LTEXT "Start",IDC_STATIC,107,73,16,8
+ LTEXT "End",IDC_STATIC,107,86,14,8
+ GROUPBOX "Sustain Loop",IDC_STATIC,185,43,79,57
+ LTEXT "Type",IDC_STATIC,189,57,17,8
+ LTEXT "Start",IDC_STATIC,189,73,16,8
+ LTEXT "End",IDC_STATIC,189,86,14,8
+ GROUPBOX "",IDC_STATIC,269,43,96,57
+ LTEXT "Auto-Vibrato",IDC_STATIC,275,50,41,8
+ LTEXT "Sweep",IDC_STATIC,275,74,23,8
+ LTEXT "Depth",IDC_STATIC,327,50,20,8
+ LTEXT "Rate",IDC_STATIC,321,74,16,8
+ GROUPBOX "Pitch shifting / Time stretching",
+ IDC_GROUPBOX_PITCH_TIME,370,22,150,78,NOT WS_VISIBLE
+ PUSHBUTTON "Process",IDC_BUTTON1,448,80,67,16,NOT WS_VISIBLE,
+ WS_EX_CLIENTEDGE
+ LTEXT "Pitch",IDC_TEXT_PITCH,373,36,23,10,NOT WS_VISIBLE
+ LTEXT "Quality",IDC_TEXT_QUALITY,374,54,23,10,NOT WS_VISIBLE
+ LTEXT "FFT",IDC_TEXT_FFT,374,68,23,10,NOT WS_VISIBLE
+ CTEXT "Static",IDC_TEXT_PREVIEW,448,69,67,10,NOT WS_VISIBLE
+ PUSHBUTTON "Keep",IDC_BUTTON3,448,82,32,13,NOT WS_VISIBLE,
+ WS_EX_CLIENTEDGE
LTEXT "%",IDC_TEXT_PERCENT,494,53,8,10,NOT WS_VISIBLE
+ LTEXT "Parameters",IDC_TEXT_STRETCHPARAMS,385,38,39,8
END
IDD_CONTROL_INSTRUMENTS DIALOGEX 0, 0, 558, 173
Modified: trunk/OpenMPT/mptrack/mptrack.vcproj
===================================================================
--- trunk/OpenMPT/mptrack/mptrack.vcproj 2008-10-13 14:25:58 UTC (rev 227)
+++ trunk/OpenMPT/mptrack/mptrack.vcproj 2008-10-13 15:19:08 UTC (rev 228)
@@ -24,7 +24,7 @@
AdditionalOptions="/EHsc"
Optimization="0"
OptimizeForProcessor="1"
- AdditionalIncludeDirectories="..\unlha,..\unzip,..\unrar,..\soundlib,..\include,..\xsoundlib"
+ AdditionalIncludeDirectories="..\unlha,..\unzip,..\unrar,..\soundlib,..\include,..\xsoundlib,..\"
PreprocessorDefinitions="_DEBUG,WIN32,_WINDOWS,ENABLE_EQ,MODPLUG_TRACKER,NO_PACKING,HAVE_DOT_NET,ENABLE_AMD,ENABLE_SSE,ENABLE_AMDNOW,ENABLE_MMX"
StringPooling="TRUE"
BasicRuntimeChecks="3"
@@ -48,13 +48,13 @@
<Tool
Name="VCLinkerTool"
AdditionalOptions="/MACHINE:I386"
- AdditionalDependencies="winmm.lib strmiids.lib dmoguids.lib version.lib opengl32.lib glu32.lib Rpcrt4.lib"
+ AdditionalDependencies="winmm.lib strmiids.lib dmoguids.lib version.lib opengl32.lib glu32.lib Rpcrt4.lib delayimp.lib"
OutputFile=".\Debug/mptrack.exe"
Version="5.0"
LinkIncremental="2"
SuppressStartupBanner="TRUE"
AdditionalLibraryDirectories=""
- DelayLoadDLLs=""
+ DelayLoadDLLs="OpenMPT_soundtouch.dll"
GenerateDebugInformation="TRUE"
AssemblyDebug="1"
ProgramDatabaseFile=".\Debug/mptrack.pdb"
@@ -104,7 +104,7 @@
GlobalOptimizations="TRUE"
InlineFunctionExpansion="2"
OptimizeForWindowsApplication="TRUE"
- AdditionalIncludeDirectories="..\unlha,..\unzip,..\unrar,..\soundlib,..\include,..\xsoundlib"
+ AdditionalIncludeDirectories="..\unlha,..\unzip,..\unrar,..\soundlib,..\include,..\xsoundlib,..\"
PreprocessorDefinitions="NDEBUG,WIN32,_WINDOWS,ENABLE_MMX,ENABLE_EQ,MODPLUG_TRACKER,NO_PACKING,HAVE_DOT_NET,ENABLE_AMD,ENABLE_SSE,ENABLE_AMDNOW"
StringPooling="TRUE"
RuntimeLibrary="0"
@@ -119,21 +119,26 @@
ProgramDataBaseFileName=".\Release/"
WarningLevel="3"
SuppressStartupBanner="FALSE"
+ DebugInformationFormat="3"
CompileAs="0"/>
<Tool
Name="VCCustomBuildTool"/>
<Tool
Name="VCLinkerTool"
AdditionalOptions="/MACHINE:I386"
- AdditionalDependencies="winmm.lib strmiids.lib dmoguids.lib version.lib opengl32.lib glu32.lib Rpcrt4.lib"
+ AdditionalDependencies="winmm.lib strmiids.lib dmoguids.lib version.lib opengl32.lib glu32.lib Rpcrt4.lib delayimp.lib"
OutputFile=".\Bin/mptrack.exe"
Version="5.0"
LinkIncremental="1"
SuppressStartupBanner="TRUE"
AdditionalLibraryDirectories=""
+ DelayLoadDLLs="OpenMPT_soundtouch.dll"
+ GenerateDebugInformation="TRUE"
GenerateMapFile="FALSE"
MapFileName=".\Release/mptrack.map"
- SubSystem="2"/>
+ SubSystem="2"
+ OptimizeReferences="2"
+ EnableCOMDATFolding="2"/>
<Tool
Name="VCMIDLTool"
PreprocessorDefinitions="NDEBUG"
Modified: trunk/OpenMPT/mptrack/res/MPTRACK.RC2
===================================================================
--- trunk/OpenMPT/mptrack/res/MPTRACK.RC2 2008-10-13 14:25:58 UTC (rev 227)
+++ trunk/OpenMPT/mptrack/res/MPTRACK.RC2 2008-10-13 15:19:08 UTC (rev 228)
@@ -43,7 +43,7 @@
VALUE "FileDescription", "OpenMPT / ModPlug Tracker"
VALUE "FileVersion", VER_FILEVERSION_STR
VALUE "InternalName", "Modplug Tracker"
- VALUE "LegalCopyright", "Copyright \xA91997-2003 Olivier Lapicque; \xA92004-2007 GPL."
+ VALUE "LegalCopyright", "Copyright \xA91997-2003 Olivier Lapicque; \xA92004-2008 contributors."
VALUE "LegalTrademarks", "M.O.D.P.L.U.G"
VALUE "OriginalFilename", "mptrack.exe"
VALUE "PrivateBuild", ""
Modified: trunk/OpenMPT/mptrack/resource.h
===================================================================
--- trunk/OpenMPT/mptrack/resource.h 2008-10-13 14:25:58 UTC (rev 227)
+++ trunk/OpenMPT/mptrack/resource.h 2008-10-13 15:19:08 UTC (rev 228)
@@ -818,6 +818,8 @@
#define IDC_TEXT_QUALITY 2330
#define IDC_TEXT_FFT 2331
#define IDC_TEXT_PERCENT 2332
+#define IDC_TEXT_STRETCHPARAMS 2337
+#define IDC_EDIT_STRETCHPARAMS 2338
#define ID_FILE_NEWMOD 32771
#define ID_FILE_NEWXM 32772
#define ID_FILE_NEWS3M 32773
@@ -1049,7 +1051,7 @@
#define _APS_3D_CONTROLS 1
#define _APS_NEXT_RESOURCE_VALUE 516
#define _APS_NEXT_COMMAND_VALUE 59212
-#define _APS_NEXT_CONTROL_VALUE 2333
+#define _APS_NEXT_CONTROL_VALUE 2339
#define _APS_NEXT_SYMED_VALUE 901
#endif
#endif
Modified: trunk/OpenMPT/soundlib/Sndfile.h
===================================================================
--- trunk/OpenMPT/soundlib/Sndfile.h 2008-10-13 14:25:58 UTC (rev 227)
+++ trunk/OpenMPT/soundlib/Sndfile.h 2008-10-13 15:19:08 UTC (rev 228)
@@ -427,14 +427,18 @@
BYTE nVibRate;
CHAR name[22];
- //Should return the size which pSample is at least.
- DWORD GetSampleSizeInBytes() const
- {
- DWORD len = nLength;
- if(uFlags & CHN_16BIT) len *= 2;
- if(uFlags & CHN_STEREO) len *= 2;
- return len;
- }
+ // Return the size of one (elementary) sample in bytes.
+ uint8 GetElementarySampleSize() const {return (uFlags & CHN_16BIT) ? 2 : 1;}
+
+ // Return the number of channels in the sample.
+ uint8 GetNumChannels() const {return (uFlags & CHN_STEREO) ? 2 : 1;}
+
+ // Return the size which pSample is at least.
+ DWORD GetSampleSizeInBytes() const {return nLength * GetNumChannels() * GetElementarySampleSize();}
+
+ // Returns sample rate of the sample. The argument is needed because
+ // the sample rate is obtained differently for different module types.
+ uint32 GetSampleRate(const MODTYPE type) const;
};
@@ -1293,7 +1297,18 @@
long GetSampleOffset();
};
+inline uint32 MODINSTRUMENT::GetSampleRate(const MODTYPE type) const
+//------------------------------------------------------------------
+{
+ uint32 nRate;
+ if(type & (MOD_TYPE_MOD|MOD_TYPE_XM))
+ nRate = CSoundFile::TransposeToFrequency(RelativeTone, nFineTune);
+ else
+ nRate = nC4Speed;
+ return (nRate > 0) ? nRate : 8363;
+}
+
inline IMixPlugin* CSoundFile::GetInstrumentPlugin(INSTRUMENTINDEX instr)
//----------------------------------------------------------------
{
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <rel...@us...> - 2008-10-13 14:26:27
|
Revision: 227
http://modplug.svn.sourceforge.net/modplug/?rev=227&view=rev
Author: relabsoluness
Date: 2008-10-13 14:25:58 +0000 (Mon, 13 Oct 2008)
Log Message:
-----------
+ Added SoundTouch library to SVN(LGPL); to be used for time stretching.
Added Paths:
-----------
trunk/OpenMPT/soundtouch/
trunk/OpenMPT/soundtouch/3dnow_win.cpp
trunk/OpenMPT/soundtouch/AAFilter.cpp
trunk/OpenMPT/soundtouch/AAFilter.h
trunk/OpenMPT/soundtouch/BPMDetect.h
trunk/OpenMPT/soundtouch/COPYING.TXT
trunk/OpenMPT/soundtouch/FIFOSampleBuffer.cpp
trunk/OpenMPT/soundtouch/FIFOSampleBuffer.h
trunk/OpenMPT/soundtouch/FIFOSamplePipe.h
trunk/OpenMPT/soundtouch/FIRFilter.cpp
trunk/OpenMPT/soundtouch/FIRFilter.h
trunk/OpenMPT/soundtouch/README.html
trunk/OpenMPT/soundtouch/RateTransposer.cpp
trunk/OpenMPT/soundtouch/RateTransposer.h
trunk/OpenMPT/soundtouch/STTypes.h
trunk/OpenMPT/soundtouch/SoundTouch.cpp
trunk/OpenMPT/soundtouch/SoundTouch.h
trunk/OpenMPT/soundtouch/TDStretch.cpp
trunk/OpenMPT/soundtouch/TDStretch.h
trunk/OpenMPT/soundtouch/cpu_detect.h
trunk/OpenMPT/soundtouch/cpu_detect_x86_win.cpp
trunk/OpenMPT/soundtouch/mmx_optimized.cpp
trunk/OpenMPT/soundtouch/soundtouch-1.3.1.zip
trunk/OpenMPT/soundtouch/soundtouch.vcproj
trunk/OpenMPT/soundtouch/sse_optimized.cpp
Added: trunk/OpenMPT/soundtouch/3dnow_win.cpp
===================================================================
--- trunk/OpenMPT/soundtouch/3dnow_win.cpp (rev 0)
+++ trunk/OpenMPT/soundtouch/3dnow_win.cpp 2008-10-13 14:25:58 UTC (rev 227)
@@ -0,0 +1,350 @@
+////////////////////////////////////////////////////////////////////////////////
+///
+/// Win32 version of the AMD 3DNow! optimized routines for AMD K6-2/Athlon
+/// processors. All 3DNow! optimized functions have been gathered into this
+/// single source code file, regardless to their class or original source code
+/// file, in order to ease porting the library to other compiler and processor
+/// platforms.
+///
+/// By the way; the performance gain depends heavily on the CPU generation: On
+/// K6-2 these routines provided speed-up of even 2.4 times, while on Athlon the
+/// difference to the original routines stayed at unremarkable 8%! Such a small
+/// improvement on Athlon is due to 3DNow can perform only two operations in
+/// parallel, and obviously also the Athlon FPU is doing a very good job with
+/// the standard C floating point routines! Here these routines are anyway,
+/// although it might not be worth the effort to convert these to GCC platform,
+/// for Athlon CPU at least. The situation is different regarding the SSE
+/// optimizations though, thanks to the four parallel operations of SSE that
+/// already make a difference.
+///
+/// This file is to be compiled in Windows platform with Microsoft Visual C++
+/// Compiler. Please see '3dnow_gcc.cpp' for the gcc compiler version for all
+/// GNU platforms (if file supplied).
+///
+/// NOTICE: If using Visual Studio 6.0, you'll need to install the "Visual C++
+/// 6.0 processor pack" update to support 3DNow! instruction set. The update is
+/// available for download at Microsoft Developers Network, see here:
+/// http://msdn.microsoft.com/vstudio/downloads/tools/ppack/default.aspx
+///
+/// If the above URL is expired or removed, go to "http://msdn.microsoft.com" and
+/// perform a search with keywords "processor pack".
+///
+/// Author : Copyright (c) Olli Parviainen
+/// Author e-mail : oparviai 'at' iki.fi
+/// SoundTouch WWW: http://www.surina.net/soundtouch
+///
+////////////////////////////////////////////////////////////////////////////////
+//
+// Last changed : $Date: 2006/02/05 16:44:06 $
+// File revision : $Revision: 1.10 $
+//
+// $Id: 3dnow_win.cpp,v 1.10 2006/02/05 16:44:06 Olli Exp $
+//
+////////////////////////////////////////////////////////////////////////////////
+//
+// License :
+//
+// SoundTouch audio processing library
+// Copyright (c) Olli Parviainen
+//
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+//
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Lesser General Public License for more details.
+//
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+//
+////////////////////////////////////////////////////////////////////////////////
+
+#include "cpu_detect.h"
+#include "STTypes.h"
+
+#ifndef WIN32
+#error "wrong platform - this source code file is exclusively for Win32 platform"
+#endif
+
+using namespace soundtouch;
+
+#ifdef ALLOW_3DNOW
+// 3DNow! routines available only with float sample type
+
+//////////////////////////////////////////////////////////////////////////////
+//
+// implementation of 3DNow! optimized functions of class 'TDStretch3DNow'
+//
+//////////////////////////////////////////////////////////////////////////////
+
+#include "TDStretch.h"
+#include <limits.h>
+
+// these are declared in 'TDStretch.cpp'
+extern int scanOffsets[4][24];
+
+
+// Calculates cross correlation of two buffers
+double TDStretch3DNow::calcCrossCorrStereo(const float *pV1, const float *pV2) const
+{
+ uint overlapLengthLocal = overlapLength;
+ float corr;
+
+ // Calculates the cross-correlation value between 'pV1' and 'pV2' vectors
+ /*
+ c-pseudocode:
+
+ corr = 0;
+ for (i = 0; i < overlapLength / 4; i ++)
+ {
+ corr += pV1[0] * pV2[0];
+ pV1[1] * pV2[1];
+ pV1[2] * pV2[2];
+ pV1[3] * pV2[3];
+ pV1[4] * pV2[4];
+ pV1[5] * pV2[5];
+ pV1[6] * pV2[6];
+ pV1[7] * pV2[7];
+
+ pV1 += 8;
+ pV2 += 8;
+ }
+ */
+
+ _asm
+ {
+ // give prefetch hints to CPU of what data are to be needed soonish.
+ // give more aggressive hints on pV1 as that changes more between different calls
+ // while pV2 stays the same.
+ prefetch [pV1]
+ prefetch [pV2]
+ prefetch [pV1 + 32]
+
+ mov eax, dword ptr pV2
+ mov ebx, dword ptr pV1
+
+ pxor mm0, mm0
+
+ mov ecx, overlapLengthLocal
+ shr ecx, 2 // div by four
+
+ loop1:
+ movq mm1, [eax]
+ prefetch [eax + 32] // give a prefetch hint to CPU what data are to be needed soonish
+ pfmul mm1, [ebx]
+ prefetch [ebx + 64] // give a prefetch hint to CPU what data are to be needed soonish
+
+ movq mm2, [eax + 8]
+ pfadd mm0, mm1
+ pfmul mm2, [ebx + 8]
+
+ movq mm3, [eax + 16]
+ pfadd mm0, mm2
+ pfmul mm3, [ebx + 16]
+
+ movq mm4, [eax + 24]
+ pfadd mm0, mm3
+ pfmul mm4, [ebx + 24]
+
+ add eax, 32
+ pfadd mm0, mm4
+ add ebx, 32
+
+ dec ecx
+ jnz loop1
+
+ // add halfs of mm0 together and return the result.
+ // note: mm1 is used as a dummy parameter only, we actually don't care about it's value
+ pfacc mm0, mm1
+ movd corr, mm0
+ femms
+ }
+
+ return corr;
+}
+
+
+
+
+//////////////////////////////////////////////////////////////////////////////
+//
+// implementation of 3DNow! optimized functions of class 'FIRFilter'
+//
+//////////////////////////////////////////////////////////////////////////////
+
+#include "FIRFilter.h"
+
+FIRFilter3DNow::FIRFilter3DNow() : FIRFilter()
+{
+ filterCoeffsUnalign = NULL;
+}
+
+
+FIRFilter3DNow::~FIRFilter3DNow()
+{
+ delete[] filterCoeffsUnalign;
+}
+
+
+// (overloaded) Calculates filter coefficients for 3DNow! routine
+void FIRFilter3DNow::setCoefficients(const float *coeffs, uint newLength, uint uResultDivFactor)
+{
+ uint i;
+ float fDivider;
+
+ FIRFilter::setCoefficients(coeffs, newLength, uResultDivFactor);
+
+ // Scale the filter coefficients so that it won't be necessary to scale the filtering result
+ // also rearrange coefficients suitably for 3DNow!
+ // Ensure that filter coeffs array is aligned to 16-byte boundary
+ delete[] filterCoeffsUnalign;
+ filterCoeffsUnalign = new float[2 * newLength + 4];
+ filterCoeffsAlign = (float *)(((uint)filterCoeffsUnalign + 15) & -16);
+
+ fDivider = (float)resultDivider;
+
+ // rearrange the filter coefficients for mmx routines
+ for (i = 0; i < newLength; i ++)
+ {
+ filterCoeffsAlign[2 * i + 0] =
+ filterCoeffsAlign[2 * i + 1] = coeffs[i + 0] / fDivider;
+ }
+}
+
+
+// 3DNow!-optimized version of the filter routine for stereo sound
+uint FIRFilter3DNow::evaluateFilterStereo(float *dest, const float *src, const uint numSamples) const
+{
+ float *filterCoeffsLocal = filterCoeffsAlign;
+ uint count = (numSamples - length) & -2;
+ uint lengthLocal = length / 4;
+
+ assert(length != 0);
+ assert(count % 2 == 0);
+
+ /* original code:
+
+ double suml1, suml2;
+ double sumr1, sumr2;
+ uint i, j;
+
+ for (j = 0; j < count; j += 2)
+ {
+ const float *ptr;
+
+ suml1 = sumr1 = 0.0;
+ suml2 = sumr2 = 0.0;
+ ptr = src;
+ filterCoeffsLocal = filterCoeffs;
+ for (i = 0; i < lengthLocal; i ++)
+ {
+ // unroll loop for efficiency.
+
+ suml1 += ptr[0] * filterCoeffsLocal[0] +
+ ptr[2] * filterCoeffsLocal[2] +
+ ptr[4] * filterCoeffsLocal[4] +
+ ptr[6] * filterCoeffsLocal[6];
+
+ sumr1 += ptr[1] * filterCoeffsLocal[1] +
+ ptr[3] * filterCoeffsLocal[3] +
+ ptr[5] * filterCoeffsLocal[5] +
+ ptr[7] * filterCoeffsLocal[7];
+
+ suml2 += ptr[8] * filterCoeffsLocal[0] +
+ ptr[10] * filterCoeffsLocal[2] +
+ ptr[12] * filterCoeffsLocal[4] +
+ ptr[14] * filterCoeffsLocal[6];
+
+ sumr2 += ptr[9] * filterCoeffsLocal[1] +
+ ptr[11] * filterCoeffsLocal[3] +
+ ptr[13] * filterCoeffsLocal[5] +
+ ptr[15] * filterCoeffsLocal[7];
+
+ ptr += 16;
+ filterCoeffsLocal += 8;
+ }
+ dest[0] = (float)suml1;
+ dest[1] = (float)sumr1;
+ dest[2] = (float)suml2;
+ dest[3] = (float)sumr2;
+
+ src += 4;
+ dest += 4;
+ }
+
+ */
+ _asm
+ {
+ mov eax, dword ptr dest
+ mov ebx, dword ptr src
+ mov edx, count
+ shr edx, 1
+
+ loop1:
+ // "outer loop" : during each round 2*2 output samples are calculated
+ prefetch [ebx] // give a prefetch hint to CPU what data are to be needed soonish
+ prefetch [filterCoeffsLocal] // give a prefetch hint to CPU what data are to be needed soonish
+
+ mov esi, ebx
+ mov edi, filterCoeffsLocal
+ pxor mm0, mm0
+ pxor mm1, mm1
+ mov ecx, lengthLocal
+
+ loop2:
+ // "inner loop" : during each round four FIR filter taps are evaluated for 2*2 output samples
+ movq mm2, [edi]
+ movq mm3, mm2
+ prefetch [edi + 32] // give a prefetch hint to CPU what data are to be needed soonish
+ pfmul mm2, [esi]
+ prefetch [esi + 32] // give a prefetch hint to CPU what data are to be needed soonish
+ pfmul mm3, [esi + 8]
+
+ movq mm4, [edi + 8]
+ movq mm5, mm4
+ pfadd mm0, mm2
+ pfmul mm4, [esi + 8]
+ pfadd mm1, mm3
+ pfmul mm5, [esi + 16]
+
+ movq mm2, [edi + 16]
+ movq mm6, mm2
+ pfadd mm0, mm4
+ pfmul mm2, [esi + 16]
+ pfadd mm1, mm5
+ pfmul mm6, [esi + 24]
+
+ movq mm3, [edi + 24]
+ movq mm7, mm3
+ pfadd mm0, mm2
+ pfmul mm3, [esi + 24]
+ pfadd mm1, mm6
+ pfmul mm7, [esi + 32]
+ add esi, 32
+ pfadd mm0, mm3
+ add edi, 32
+ pfadd mm1, mm7
+
+ dec ecx
+ jnz loop2
+
+ movq [eax], mm0
+ add ebx, 16
+ movq [eax + 8], mm1
+ add eax, 16
+
+ dec edx
+ jnz loop1
+
+ femms
+ }
+
+ return count;
+}
+
+
+#endif // ALLOW_3DNOW
Added: trunk/OpenMPT/soundtouch/AAFilter.cpp
===================================================================
--- trunk/OpenMPT/soundtouch/AAFilter.cpp (rev 0)
+++ trunk/OpenMPT/soundtouch/AAFilter.cpp 2008-10-13 14:25:58 UTC (rev 227)
@@ -0,0 +1,184 @@
+////////////////////////////////////////////////////////////////////////////////
+///
+/// FIR low-pass (anti-alias) filter with filter coefficient design routine and
+/// MMX optimization.
+///
+/// Anti-alias filter is used to prevent folding of high frequencies when
+/// transposing the sample rate with interpolation.
+///
+/// Author : Copyright (c) Olli Parviainen
+/// Author e-mail : oparviai 'at' iki.fi
+/// SoundTouch WWW: http://www.surina.net/soundtouch
+///
+////////////////////////////////////////////////////////////////////////////////
+//
+// Last changed : $Date: 2006/02/05 16:44:06 $
+// File revision : $Revision: 1.9 $
+//
+// $Id: AAFilter.cpp,v 1.9 2006/02/05 16:44:06 Olli Exp $
+//
+////////////////////////////////////////////////////////////////////////////////
+//
+// License :
+//
+// SoundTouch audio processing library
+// Copyright (c) Olli Parviainen
+//
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+//
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Lesser General Public License for more details.
+//
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+//
+////////////////////////////////////////////////////////////////////////////////
+
+#include <memory.h>
+#include <assert.h>
+#include <math.h>
+#include <stdlib.h>
+#include "AAFilter.h"
+#include "FIRFilter.h"
+
+using namespace soundtouch;
+
+#define PI 3.141592655357989
+#define TWOPI (2 * PI)
+
+/*****************************************************************************
+ *
+ * Implementation of the class 'AAFilter'
+ *
+ *****************************************************************************/
+
+AAFilter::AAFilter(const uint length)
+{
+ pFIR = FIRFilter::newInstance();
+ cutoffFreq = 0.5;
+ setLength(length);
+}
+
+
+
+AAFilter::~AAFilter()
+{
+ delete pFIR;
+}
+
+
+
+// Sets new anti-alias filter cut-off edge frequency, scaled to
+// sampling frequency (nyquist frequency = 0.5).
+// The filter will cut frequencies higher than the given frequency.
+void AAFilter::setCutoffFreq(const double newCutoffFreq)
+{
+ cutoffFreq = newCutoffFreq;
+ calculateCoeffs();
+}
+
+
+
+// Sets number of FIR filter taps
+void AAFilter::setLength(const uint newLength)
+{
+ length = newLength;
+ calculateCoeffs();
+}
+
+
+
+// Calculates coefficients for a low-pass FIR filter using Hamming window
+void AAFilter::calculateCoeffs()
+{
+ uint i;
+ double cntTemp, temp, tempCoeff,h, w;
+ double fc2, wc;
+ double scaleCoeff, sum;
+ double *work;
+ SAMPLETYPE *coeffs;
+
+ assert(length > 0);
+ assert(length % 4 == 0);
+ assert(cutoffFreq >= 0);
+ assert(cutoffFreq <= 0.5);
+
+ work = new double[length];
+ coeffs = new SAMPLETYPE[length];
+
+ fc2 = 2.0 * cutoffFreq;
+ wc = PI * fc2;
+ tempCoeff = TWOPI / (double)length;
+
+ sum = 0;
+ for (i = 0; i < length; i ++)
+ {
+ cntTemp = (double)i - (double)(length / 2);
+
+ temp = cntTemp * wc;
+ if (temp != 0)
+ {
+ h = fc2 * sin(temp) / temp; // sinc function
+ }
+ else
+ {
+ h = 1.0;
+ }
+ w = 0.54 + 0.46 * cos(tempCoeff * cntTemp); // hamming window
+
+ temp = w * h;
+ work[i] = temp;
+
+ // calc net sum of coefficients
+ sum += temp;
+ }
+
+ // ensure the sum of coefficients is larger than zero
+ assert(sum > 0);
+
+ // ensure we've really designed a lowpass filter...
+ assert(work[length/2] > 0);
+ assert(work[length/2 + 1] > -1e-6);
+ assert(work[length/2 - 1] > -1e-6);
+
+ // Calculate a scaling coefficient in such a way that the result can be
+ // divided by 16384
+ scaleCoeff = 16384.0f / sum;
+
+ for (i = 0; i < length; i ++)
+ {
+ // scale & round to nearest integer
+ temp = work[i] * scaleCoeff;
+ temp += (temp >= 0) ? 0.5 : -0.5;
+ // ensure no overfloods
+ assert(temp >= -32768 && temp <= 32767);
+ coeffs[i] = (SAMPLETYPE)temp;
+ }
+
+ // Set coefficients. Use divide factor 14 => divide result by 2^14 = 16384
+ pFIR->setCoefficients(coeffs, length, 14);
+
+ delete[] work;
+ delete[] coeffs;
+}
+
+
+// Applies the filter to the given sequence of samples.
+// Note : The amount of outputted samples is by value of 'filter length'
+// smaller than the amount of input samples.
+uint AAFilter::evaluate(SAMPLETYPE *dest, const SAMPLETYPE *src, uint numSamples, uint numChannels) const
+{
+ return pFIR->evaluate(dest, src, numSamples, numChannels);
+}
+
+
+uint AAFilter::getLength() const
+{
+ return pFIR->getLength();
+}
Added: trunk/OpenMPT/soundtouch/AAFilter.h
===================================================================
--- trunk/OpenMPT/soundtouch/AAFilter.h (rev 0)
+++ trunk/OpenMPT/soundtouch/AAFilter.h 2008-10-13 14:25:58 UTC (rev 227)
@@ -0,0 +1,91 @@
+////////////////////////////////////////////////////////////////////////////////
+///
+/// Sampled sound tempo changer/time stretch algorithm. Changes the sound tempo
+/// while maintaining the original pitch by using a time domain WSOLA-like method
+/// with several performance-increasing tweaks.
+///
+/// Anti-alias filter is used to prevent folding of high frequencies when
+/// transposing the sample rate with interpolation.
+///
+/// Author : Copyright (c) Olli Parviainen
+/// Author e-mail : oparviai 'at' iki.fi
+/// SoundTouch WWW: http://www.surina.net/soundtouch
+///
+////////////////////////////////////////////////////////////////////////////////
+//
+// Last changed : $Date: 2006/02/05 16:44:06 $
+// File revision : $Revision: 1.10 $
+//
+// $Id: AAFilter.h,v 1.10 2006/02/05 16:44:06 Olli Exp $
+//
+////////////////////////////////////////////////////////////////////////////////
+//
+// License :
+//
+// SoundTouch audio processing library
+// Copyright (c) Olli Parviainen
+//
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+//
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Lesser General Public License for more details.
+//
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+//
+////////////////////////////////////////////////////////////////////////////////
+
+#ifndef AAFilter_H
+#define AAFilter_H
+
+#include "STTypes.h"
+
+namespace soundtouch
+{
+
+class AAFilter
+{
+protected:
+ class FIRFilter *pFIR;
+
+ /// Low-pass filter cut-off frequency, negative = invalid
+ double cutoffFreq;
+
+ /// num of filter taps
+ uint length;
+
+ /// Calculate the FIR coefficients realizing the given cutoff-frequency
+ void calculateCoeffs();
+public:
+ AAFilter(uint length);
+
+ ~AAFilter();
+
+ /// Sets new anti-alias filter cut-off edge frequency, scaled to sampling
+ /// frequency (nyquist frequency = 0.5). The filter will cut off the
+ /// frequencies than that.
+ void setCutoffFreq(double newCutoffFreq);
+
+ /// Sets number of FIR filter taps, i.e. ~filter complexity
+ void setLength(uint newLength);
+
+ uint getLength() const;
+
+ /// Applies the filter to the given sequence of samples.
+ /// Note : The amount of outputted samples is by value of 'filter length'
+ /// smaller than the amount of input samples.
+ uint evaluate(SAMPLETYPE *dest,
+ const SAMPLETYPE *src,
+ uint numSamples,
+ uint numChannels) const;
+};
+
+}
+
+#endif
Added: trunk/OpenMPT/soundtouch/BPMDetect.h
===================================================================
--- trunk/OpenMPT/soundtouch/BPMDetect.h (rev 0)
+++ trunk/OpenMPT/soundtouch/BPMDetect.h 2008-10-13 14:25:58 UTC (rev 227)
@@ -0,0 +1,159 @@
+////////////////////////////////////////////////////////////////////////////////
+///
+/// Beats-per-minute (BPM) detection routine.
+///
+/// The beat detection algorithm works as follows:
+/// - Use function 'inputSamples' to input a chunks of samples to the class for
+/// analysis. It's a good idea to enter a large sound file or stream in smallish
+/// chunks of around few kilosamples in order not to extinguish too much RAM memory.
+/// - Input sound data is decimated to approx 500 Hz to reduce calculation burden,
+/// which is basically ok as low (bass) frequencies mostly determine the beat rate.
+/// Simple averaging is used for anti-alias filtering because the resulting signal
+/// quality isn't of that high importance.
+/// - Decimated sound data is enveloped, i.e. the amplitude shape is detected by
+/// taking absolute value that's smoothed by sliding average. Signal levels that
+/// are below a couple of times the general RMS amplitude level are cut away to
+/// leave only notable peaks there.
+/// - Repeating sound patterns (e.g. beats) are detected by calculating short-term
+/// autocorrelation function of the enveloped signal.
+/// - After whole sound data file has been analyzed as above, the bpm level is
+/// detected by function 'getBpm' that finds the highest peak of the autocorrelation
+/// function, calculates it's precise location and converts this reading to bpm's.
+///
+/// Author : Copyright (c) Olli Parviainen
+/// Author e-mail : oparviai 'at' iki.fi
+/// SoundTouch WWW: http://www.surina.net/soundtouch
+///
+////////////////////////////////////////////////////////////////////////////////
+//
+// Last changed : $Date: 2006/02/05 16:44:06 $
+// File revision : $Revision: 1.5 $
+//
+// $Id: BPMDetect.h,v 1.5 2006/02/05 16:44:06 Olli Exp $
+//
+////////////////////////////////////////////////////////////////////////////////
+//
+// License :
+//
+// SoundTouch audio processing library
+// Copyright (c) Olli Parviainen
+//
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+//
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Lesser General Public License for more details.
+//
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+//
+////////////////////////////////////////////////////////////////////////////////
+
+#ifndef _BPMDetect_H_
+#define _BPMDetect_H_
+
+#include "STTypes.h"
+#include "FIFOSampleBuffer.h"
+
+/// Minimum allowed BPM rate. Used to restrict accepted result above a reasonable limit.
+#define MIN_BPM 45
+
+/// Maximum allowed BPM rate. Used to restrict accepted result below a reasonable limit.
+#define MAX_BPM 230
+
+
+/// Class for calculating BPM rate for audio data.
+class BPMDetect
+{
+protected:
+ /// Auto-correlation accumulator bins.
+ float *xcorr;
+
+ /// Amplitude envelope sliding average approximation level accumulator
+ float envelopeAccu;
+
+ /// RMS volume sliding average approximation level accumulator
+ float RMSVolumeAccu;
+
+ /// Sample average counter.
+ int decimateCount;
+
+ /// Sample average accumulator for FIFO-like decimation.
+ soundtouch::LONG_SAMPLETYPE decimateSum;
+
+ /// Decimate sound by this coefficient to reach approx. 500 Hz.
+ int decimateBy;
+
+ /// Auto-correlation window length
+ int windowLen;
+
+ /// Number of channels (1 = mono, 2 = stereo)
+ int channels;
+
+ /// sample rate
+ int sampleRate;
+
+ /// Beginning of auto-correlation window: Autocorrelation isn't being updated for
+ /// the first these many correlation bins.
+ int windowStart;
+
+ /// FIFO-buffer for decimated processing samples.
+ soundtouch::FIFOSampleBuffer *buffer;
+
+ /// Initialize the class for processing.
+ void init(int numChannels, int sampleRate);
+
+ /// Updates auto-correlation function for given number of decimated samples that
+ /// are read from the internal 'buffer' pipe (samples aren't removed from the pipe
+ /// though).
+ void updateXCorr(int process_samples /// How many samples are processed.
+ );
+
+ /// Decimates samples to approx. 500 Hz.
+ ///
+ /// \return Number of output samples.
+ int decimate(soundtouch::SAMPLETYPE *dest, ///< Destination buffer
+ const soundtouch::SAMPLETYPE *src, ///< Source sample buffer
+ int numsamples ///< Number of source samples.
+ );
+
+ /// Calculates amplitude envelope for the buffer of samples.
+ /// Result is output to 'samples'.
+ void calcEnvelope(soundtouch::SAMPLETYPE *samples, ///< Pointer to input/output data buffer
+ int numsamples ///< Number of samples in buffer
+ );
+
+public:
+ /// Constructor.
+ BPMDetect(int numChannels, ///< Number of channels in sample data.
+ int sampleRate ///< Sample rate in Hz.
+ );
+
+ /// Destructor.
+ virtual ~BPMDetect();
+
+ /// Inputs a block of samples for analyzing: Envelopes the samples and then
+ /// updates the autocorrelation estimation. When whole song data has been input
+ /// in smaller blocks using this function, read the resulting bpm with 'getBpm'
+ /// function.
+ ///
+ /// Notice that data in 'samples' array can be disrupted in processing.
+ void inputSamples(soundtouch::SAMPLETYPE *samples, ///< Pointer to input/working data buffer
+ int numSamples ///< Number of samples in buffer
+ );
+
+
+ /// Analyzes the results and returns the BPM rate. Use this function to read result
+ /// after whole song data has been input to the class by consecutive calls of
+ /// 'inputSamples' function.
+ ///
+ /// \return Beats-per-minute rate, or zero if detection failed.
+ float getBpm();
+};
+
+#endif // _BPMDetect_H_
Added: trunk/OpenMPT/soundtouch/COPYING.TXT
===================================================================
--- trunk/OpenMPT/soundtouch/COPYING.TXT (rev 0)
+++ trunk/OpenMPT/soundtouch/COPYING.TXT 2008-10-13 14:25:58 UTC (rev 227)
@@ -0,0 +1,458 @@
+ GNU LESSER GENERAL PUBLIC LICENSE
+ Version 2.1, February 1999
+
+ Copyright (C) 1991, 1999 Free Software Foundation, Inc.
+ 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ Everyone is permitted to copy and distribute verbatim copies
+ of this license document, but changing it is not allowed.
+
+[This is the first released version of the Lesser GPL. It also counts
+ as the successor of the GNU Library Public License, version 2, hence
+ the version number 2.1.]
+
+ Preamble
+
+ The licenses for most software are designed to take away your
+freedom to share and change it. By contrast, the GNU General Public
+Licenses are intended to guarantee your freedom to share and change
+free software--to make sure the software is free for all its users.
+
+ This license, the Lesser General Public License, applies to some
+specially designated software packages--typically libraries--of the
+Free Software Foundation and other authors who decide to use it. You
+can use it too, but we suggest you first think carefully about whether
+this license or the ordinary General Public License is the better
+strategy to use in any particular case, based on the explanations below.
+
+ When we speak of free software, we are referring to freedom of use,
+not price. Our General Public Licenses are designed to make sure that
+you have the freedom to distribute copies of free software (and charge
+for this service if you wish); that you receive source code or can get
+it if you want it; that you can change the software and use pieces of
+it in new free programs; and that you are informed that you can do
+these things.
+
+ To protect your rights, we need to make restrictions that forbid
+distributors to deny you these rights or to ask you to surrender these
+rights. These restrictions translate to certain responsibilities for
+you if you distribute copies of the library or if you modify it.
+
+ For example, if you distribute copies of the library, whether gratis
+or for a fee, you must give the recipients all the rights that we gave
+you. You must make sure that they, too, receive or can get the source
+code. If you link other code with the library, you must provide
+complete object files to the recipients, so that they can relink them
+with the library after making changes to the library and recompiling
+it. And you must show them these terms so they know their rights.
+
+ We protect your rights with a two-step method: (1) we copyright the
+library, and (2) we offer you this license, which gives you legal
+permission to copy, distribute and/or modify the library.
+
+ To protect each distributor, we want to make it very clear that
+there is no warranty for the free library. Also, if the library is
+modified by someone else and passed on, the recipients should know
+that what they have is not the original version, so that the original
+author's reputation will not be affected by problems that might be
+introduced by others.
+
+ Finally, software patents pose a constant threat to the existence of
+any free program. We wish to make sure that a company cannot
+effectively restrict the users of a free program by obtaining a
+restrictive license from a patent holder. Therefore, we insist that
+any patent license obtained for a version of the library must be
+consistent with the full freedom of use specified in this license.
+
+ Most GNU software, including some libraries, is covered by the
+ordinary GNU General Public License. This license, the GNU Lesser
+General Public License, applies to certain designated libraries, and
+is quite different from the ordinary General Public License. We use
+this license for certain libraries in order to permit linking those
+libraries into non-free programs.
+
+ When a program is linked with a library, whether statically or using
+a shared library, the combination of the two is legally speaking a
+combined work, a derivative of the original library. The ordinary
+General Public License therefore permits such linking only if the
+entire combination fits its criteria of freedom. The Lesser General
+Public License permits more lax criteria for linking other code with
+the library.
+
+ We call this license the "Lesser" General Public License because it
+does Less to protect the user's freedom than the ordinary General
+Public License. It also provides other free software developers Less
+of an advantage over competing non-free programs. These disadvantages
+are the reason we use the ordinary General Public License for many
+libraries. However, the Lesser license provides advantages in certain
+special circumstances.
+
+ For example, on rare occasions, there may be a special need to
+encourage the widest possible use of a certain library, so that it becomes
+a de-facto standard. To achieve this, non-free programs must be
+allowed to use the library. A more frequent case is that a free
+library does the same job as widely used non-free libraries. In this
+case, there is little to gain by limiting the free library to free
+software only, so we use the Lesser General Public License.
+
+ In other cases, permission to use a particular library in non-free
+programs enables a greater number of people to use a large body of
+free software. For example, permission to use the GNU C Library in
+non-free programs enables many more people to use the whole GNU
+operating system, as well as its variant, the GNU/Linux operating
+system.
+
+ Although the Lesser General Public License is Less protective of the
+users' freedom, it does ensure that the user of a program that is
+linked with the Library has the freedom and the wherewithal to run
+that program using a modified version of the Library.
+
+ The precise terms and conditions for copying, distribution and
+modification follow. Pay close attention to the difference between a
+"work based on the library" and a "work that uses the library". The
+former contains code derived from the library, whereas the latter must
+be combined with the library in order to run.
+
+ GNU LESSER GENERAL PUBLIC LICENSE
+ TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
+
+ 0. This License Agreement applies to any software library or other
+program which contains a notice placed by the copyright holder or
+other authorized party saying it may be distributed under the terms of
+this Lesser General Public License (also called "this License").
+Each licensee is addressed as "you".
+
+ A "library" means a collection of software functions and/or data
+prepared so as to be conveniently linked with application programs
+(which use some of those functions and data) to form executables.
+
+ The "Library", below, refers to any such software library or work
+which has been distributed under these terms. A "work based on the
+Library" means either the Library or any derivative work under
+copyright law: that is to say, a work containing the Library or a
+portion of it, either verbatim or with modifications and/or translated
+straightforwardly into another language. (Hereinafter, translation is
+included without limitation in the term "modification".)
+
+ "Source code" for a work means the preferred form of the work for
+making modifications to it. For a library, complete source code means
+all the source code for all modules it contains, plus any associated
+interface definition files, plus the scripts used to control compilation
+and installation of the library.
+
+ Activities other than copying, distribution and modification are not
+covered by this License; they are outside its scope. The act of
+running a program using the Library is not restricted, and output from
+such a program is covered only if its contents constitute a work based
+on the Library (independent of the use of the Library in a tool for
+writing it). Whether that is true depends on what the Library does
+and what the program that uses the Library does.
+
+ 1. You may copy and distribute verbatim copies of the Library's
+complete source code as you receive it, in any medium, provided that
+you conspicuously and appropriately publish on each copy an
+appropriate copyright notice and disclaimer of warranty; keep intact
+all the notices that refer to this License and to the absence of any
+warranty; and distribute a copy of this License along with the
+Library.
+
+ You may charge a fee for the physical act of transferring a copy,
+and you may at your option offer warranty protection in exchange for a
+fee.
+
+ 2. You may modify your copy or copies of the Library or any portion
+of it, thus forming a work based on the Library, and copy and
+distribute such modifications or work under the terms of Section 1
+above, provided that you also meet all of these conditions:
+
+ a) The modified work must itself be a software library.
+
+ b) You must cause the files modified to carry prominent notices
+ stating that you changed the files and the date of any change.
+
+ c) You must cause the whole of the work to be licensed at no
+ charge to all third parties under the terms of this License.
+
+ d) If a facility in the modified Library refers to a function or a
+ table of data to be supplied by an application program that uses
+ the facility, other than as an argument passed when the facility
+ is invoked, then you must make a good faith effort to ensure that,
+ in the event an application does not supply such function or
+ table, the facility still operates, and performs whatever part of
+ its purpose remains meaningful.
+
+ (For example, a function in a library to compute square roots has
+ a purpose that is entirely well-defined independent of the
+ application. Therefore, Subsection 2d requires that any
+ application-supplied function or table used by this function must
+ be optional: if the application does not supply it, the square
+ root function must still compute square roots.)
+
+These requirements apply to the modified work as a whole. If
+identifiable sections of that work are not derived from the Library,
+and can be reasonably considered independent and separate works in
+themselves, then this License, and its terms, do not apply to those
+sections when you distribute them as separate works. But when you
+distribute the same sections as part of a whole which is a work based
+on the Library, the distribution of the whole must be on the terms of
+this License, whose permissions for other licensees extend to the
+entire whole, and thus to each and every part regardless of who wrote
+it.
+
+Thus, it is not the intent of this section to claim rights or contest
+your rights to work written entirely by you; rather, the intent is to
+exercise the right to control the distribution of derivative or
+collective works based on the Library.
+
+In addition, mere aggregation of another work not based on the Library
+with the Library (or with a work based on the Library) on a volume of
+a storage or distribution medium does not bring the other work under
+the scope of this License.
+
+ 3. You may opt to apply the terms of the ordinary GNU General Public
+License instead of this License to a given copy of the Library. To do
+this, you must alter all the notices that refer to this License, so
+that they refer to the ordinary GNU General Public License, version 2,
+instead of to this License. (If a newer version than version 2 of the
+ordinary GNU General Public License has appeared, then you can specify
+that version instead if you wish.) Do not make any other change in
+these notices.
+
+ Once this change is made in a given copy, it is irreversible for
+that copy, so the ordinary GNU General Public License applies to all
+subsequent copies and derivative works made from that copy.
+
+ This option is useful when you wish to copy part of the code of
+the Library into a program that is not a library.
+
+ 4. You may copy and distribute the Library (or a portion or
+derivative of it, under Section 2) in object code or executable form
+under the terms of Sections 1 and 2 above provided that you accompany
+it with the complete corresponding machine-readable source code, which
+must be distributed under the terms of Sections 1 and 2 above on a
+medium customarily used for software interchange.
+
+ If distribution of object code is made by offering access to copy
+from a designated place, then offering equivalent access to copy the
+source code from the same place satisfies the requirement to
+distribute the source code, even though third parties are not
+compelled to copy the source along with the object code.
+
+ 5. A program that contains no derivative of any portion of the
+Library, but is designed to work with the Library by being compiled or
+linked with it, is called a "work that uses the Library". Such a
+work, in isolation, is not a derivative work of the Library, and
+therefore falls outside the scope of this License.
+
+ However, linking a "work that uses the Library" with the Library
+creates an executable that is a derivative of the Library (because it
+contains portions of the Library), rather than a "work that uses the
+library". The executable is therefore covered by this License.
+Section 6 states terms for distribution of such executables.
+
+ When a "work that uses the Library" uses material from a header file
+that is part of the Library, the object code for the work may be a
+derivative work of the Library even though the source code is not.
+Whether this is true is especially significant if the work can be
+linked without the Library, or if the work is itself a library. The
+threshold for this to be true is not precisely defined by law.
+
+ If such an object file uses only numerical parameters, data
+structure layouts and accessors, and small macros and small inline
+functions (ten lines or less in length), then the use of the object
+file is unrestricted, regardless of whether it is legally a derivative
+work. (Executables containing this object code plus portions of the
+Library will still fall under Section 6.)
+
+ Otherwise, if the work is a derivative of the Library, you may
+distribute the object code for the work under the terms of Section 6.
+Any executables containing that work also fall under Section 6,
+whether or not they are linked directly with the Library itself.
+
+ 6. As an exception to the Sections above, you may also combine or
+link a "work that uses the Library" with the Library to produce a
+work containing portions of the Library, and distribute that work
+under terms of your choice, provided that the terms permit
+modification of the work for the customer's own use and reverse
+engineering for debugging such modifications.
+
+ You must give prominent notice with each copy of the work that the
+Library is used in it and that the Library and its use are covered by
+this License. You must supply a copy of this License. If the work
+during execution displays copyright notices, you must include the
+copyright notice for the Library among them, as well as a reference
+directing the user to the copy of this License. Also, you must do one
+of these things:
+
+ a) Accompany the work with the complete corresponding
+ machine-readable source code for the Library including whatever
+ changes were used in the work (which must be distributed under
+ Sections 1 and 2 above); and, if the work is an executable linked
+ with the Library, with the complete machine-readable "work that
+ uses the Library", as object code and/or source code, so that the
+ user can modify the Library and then relink to produce a modified
+ executable containing the modified Library. (It is understood
+ that the user who changes the contents of definitions files in the
+ Library will not necessarily be able to recompile the application
+ to use the modified definitions.)
+
+ b) Use a suitable shared library mechanism for linking with the
+ Library. A suitable mechanism is one that (1) uses at run time a
+ copy of the library already present on the user's computer system,
+ rather than copying library functions into the executable, and (2)
+ will operate properly with a modified version of the library, if
+ the user installs one, as long as the modified version is
+ interface-compatible with the version that the work was made with.
+
+ c) Accompany the work with a written offer, valid for at
+ least three years, to give the same user the materials
+ specified in Subsection 6a, above, for a charge no more
+ than the cost of performing this distribution.
+
+ d) If distribution of the work is made by offering access to copy
+ from a designated place, offer equivalent access to copy the above
+ specified materials from the same place.
+
+ e) Verify that the user has already received a copy of these
+ materials or that you have already sent this user a copy.
+
+ For an executable, the required form of the "work that uses the
+Library" must include any data and utility programs needed for
+reproducing the executable from it. However, as a special exception,
+the materials to be distributed need not include anything that is
+normally distributed (in either source or binary form) with the major
+components (compiler, kernel, and so on) of the operating system on
+which the executable runs, unless that component itself accompanies
+the executable.
+
+ It may happen that this requirement contradicts the license
+restrictions of other proprietary libraries that do not normally
+accompany the operating system. Such a contradiction means you cannot
+use both them and the Library together in an executable that you
+distribute.
+
+ 7. You may place library facilities that are a work based on the
+Library side-by-side in a single library together with other library
+facilities not covered by this License, and distribute such a combined
+library, provided that the separate distribution of the work based on
+the Library and of the other library facilities is otherwise
+permitted, and provided that you do these two things:
+
+ a) Accompany the combined library with a copy of the same work
+ based on the Library, uncombined with any other library
+ facilities. This must be distributed under the terms of the
+ Sections above.
+
+ b) Give prominent notice with the combined library of the fact
+ that part of it is a work based on the Library, and explaining
+ where to find the accompanying uncombined form of the same work.
+
+ 8. You may not copy, modify, sublicense, link with, or distribute
+the Library except as expressly provided under this License. Any
+attempt otherwise to copy, modify, sublicense, link with, or
+distribute the Library is void, and will automatically terminate your
+rights under this License. However, parties who have received copies,
+or rights, from you under this License will not have their licenses
+terminated so long as such parties remain in full compliance.
+
+ 9. You are not required to accept this License, since you have not
+signed it. However, nothing else grants you permission to modify or
+distribute the Library or its derivative works. These actions are
+prohibited by law if you do not accept this License. Therefore, by
+modifying or distributing the Library (or any work based on the
+Library), you indicate your acceptance of this License to do so, and
+all its terms and conditions for copying, distributing or modifying
+the Library or works based on it.
+
+ 10. Each time you redistribute the Library (or any work based on the
+Library), the recipient automatically receives a license from the
+original licensor to copy, distribute, link with or modify the Library
+subject to these terms and conditions. You may not impose any further
+restrictions on the recipients' exercise of the rights granted herein.
+You are not responsible for enforcing compliance by third parties with
+this License.
+
+ 11. If, as a consequence of a court judgment or allegation of patent
+infringement or for any other reason (not limited to patent issues),
+conditions are imposed on you (whether by court order, agreement or
+otherwise) that contradict the conditions of this License, they do not
+excuse you from the conditions of this License. If you cannot
+distribute so as to satisfy simultaneously your obligations under this
+License and any other pertinent obligations, then as a consequence you
+may not distribute the Library at all. For example, if a patent
+license would not permit royalty-free redistribution of the Library by
+all those who receive copies directly or indirectly through you, then
+the only way you could satisfy both it and this License would be to
+refrain entirely from distribution of the Library.
+
+If any portion of this section is held invalid or unenforceable under any
+particular circumstance, the balance of the section is intended to apply,
+and the section as a whole is intended to apply in other circumstances.
+
+It is not the purpose of this section to induce you to infringe any
+patents or other property right claims or to contest validity of any
+such claims; this section has the sole purpose of protecting the
+integrity of the free software distribution system which is
+implemented by public license practices. Many people have made
+generous contributions to the wide range of software distributed
+through that system in reliance on consistent application of that
+system; it is up to the author/donor to decide if he or she is willing
+to distribute software through any other system and a licensee cannot
+impose that choice.
+
+This section is intended to make thoroughly clear what is believed to
+be a consequence of the rest of this License.
+
+ 12. If the distribution and/or use of the Library is restricted in
+certain countries either by patents or by copyrighted interfaces, the
+original copyright holder who places the Library under this License may add
+an explicit geographical distribution limitation excluding those countries,
+so that distribution is permitted only in or among countries not thus
+excluded. In such case, this License incorporates the limitation as if
+written in the body of this License.
+
+ 13. The Free Software Foundation may publish revised and/or new
+versions of the Lesser General Public License from time to time.
+Such new versions will be similar in spirit to the present version,
+but may differ in detail to address new problems or concerns.
+
+Each version is given a distinguishing version number. If the Library
+specifies a version number of this License which applies to it and
+"any later version", you have the option of following the terms and
+conditions either of that version or of any later version published by
+the Free Software Foundation. If the Library does not specify a
+license version number, you may choose any version ever published by
+the Free Software Foundation.
+
+ 14. If you wish to incorporate parts of the Library into other free
+programs whose distribution conditions are incompatible with these,
+write to the author to ask for permission. For software which is
+copyrighted by the Free Software Foundation, write to the Free
+Software Foundation; we sometimes make exceptions for this. Our
+decision will be guided by the two goals of preserving the free status
+of all derivatives of our free software and of promoting the sharing
+and reuse of software generally.
+
+ NO WARRANTY
+
+ 15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO
+WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW.
+EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR
+OTHER PARTIES PROVIDE THE LIBRARY "AS IS" WITHOUT WARRANTY OF ANY
+KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE
+IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE
+LIBRARY IS WITH YOU. SHOULD THE LIBRARY PROVE DEFECTIVE, YOU ASSUME
+THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
+
+ 16. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN
+WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY
+AND/OR REDISTRIBUTE THE LIBRARY AS PERMITTED ABOVE, BE LIABLE TO YOU
+FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR
+CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE
+LIBRARY (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING
+RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A
+FAILURE OF THE LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF
+SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH
+DAMAGES.
+
+ END OF TERMS AND CONDITIONS
Added: trunk/OpenMPT/soundtouch/FIFOSampleBuffer.cpp
===================================================================
--- trunk/OpenMPT/soundtouch/FIFOSampleBuffer.cpp (rev 0)
+++ trunk/OpenMPT/soundtouch/FIFOSampleBuffer.cpp 2008-10-13 14:25:58 UTC (rev 227)
@@ -0,0 +1,252 @@
+////////////////////////////////////////////////////////////////////////////////
+///
+/// A buffer class for temporarily storaging sound samples, operates as a
+/// first-in-first-out pipe.
+///
+/// Samples are added to the end of the sample buffer with the 'putSamples'
+/// function, and are received from the beginning of the buffer by calling
+/// the 'receiveSamples' function. The class automatically removes the
+/// outputted samples from the buffer, as well as grows the buffer size
+/// whenever necessary.
+///
+/// Author : Copyright (c) Olli Parviainen
+/// Author e-mail : oparviai 'at' iki.fi
+/// SoundTouch WWW: http://www.surina.net/soundtouch
+///
+////////////////////////////////////////////////////////////////////////////////
+//
+// Last changed : $Date: 2006/02/05 16:44:06 $
+// File revision : $Revision: 1.11 $
+//
+// $Id: FIFOSampleBuffer.cpp,v 1.11 2006/02/05 16:44:06 Olli Exp $
+//
+////////////////////////////////////////////////////////////////////////////////
+//
+// License :
+//
+// SoundTouch audio processing library
+// Copyright (c) Olli Parviainen
+//
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+//
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Lesser General Public License for more details.
+//
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+//
+////////////////////////////////////////////////////////////////////////////////
+
+#include <stdlib.h>
+#include <memory.h>
+#include <string.h>
+#include <assert.h>
+#include <stdexcept>
+
+#include "FIFOSampleBuffer.h"
+
+using namespace soundtouch;
+
+// Constructor
+FIFOSampleBuffer::FIFOSampleBuffer(uint numChannels)
+{
+ sizeInBytes = 0; // reasonable initial value
+ buffer = NULL; //new SAMPLETYPE[sizeInBytes / sizeof(SAMPLETYPE)];
+ bufferUnaligned = NULL;
+ samplesInBuffer = 0;
+ bufferPos = 0;
+ channels = numChannels;
+}
+
+
+// destructor
+FIFOSampleBuffer::~FIFOSampleBuffer()
+{
+ delete[] bufferUnaligned;
+}
+
+
+// Sets number of channels, 1 = mono, 2 = stereo
+void FIFOSampleBuffer::setChannels(const uint numChannels)
+{
+ uint usedBytes;
+
+ usedBytes = channels * samplesInBuffer;
+ channels = numChannels;
+ samplesInBuffer = usedBytes / channels;
+}
+
+
+// if output location pointer 'bufferPos' isn't zero, 'rewinds' the buffer and
+// zeroes this pointer by copying samples from the 'bufferPos' pointer
+// location on to the beginning of the buffer.
+void FIFOSampleBuffer::rewind()
+{
+ if (bufferPos)
+ {
+ memmove(buffer, ptrBegin(), sizeof(SAMPLETYPE) * channels * samplesInBuffer);
+ bufferPos = 0;
+ }
+}
+
+
+// Adds 'numSamples' pcs of samples from the 'samples' memory position to
+// the sample buffer.
+void FIFOSampleBuffer::putSamples(const SAMPLETYPE *samples, uint numSamples)
+{
+ memcpy(ptrEnd(numSamples), samples, sizeof(SAMPLETYPE) * numSamples * channels);
+ samplesInBuffer += numSamples;
+}
+
+
+// Increases the number of samples in the buffer without copying any actual
+// samples.
+//
+// This function is used to update the number of samples in the sample buffer
+// when accessing the buffer directly with 'ptrEnd' function. Please be
+// careful though!
+void FIFOSampleBuffer::putSamples(uint numSamples)
+{
+ uint req;
+
+ req = samplesInBuffer + numSamples;
+ ensureCapacity(req);
+ samplesInBuffer += numSamples;
+}
+
+
+// Returns a pointer to the end of the used part of the sample buffer (i.e.
+// where the new samples are to be inserted). This function may be used for
+// inserting new samples into the sample buffer directly. Please be careful!
+//
+// Parameter 'slackCapacity' tells the function how much free capacity (in
+// terms of samples) there _at least_ should be, in order to the caller to
+// succesfully insert all the required samples to the buffer. When necessary,
+// the function grows the buffer size to comply with this requirement.
+//
+// When using this function as means for inserting new samples, also remember
+// to increase the sample count afterwards, by calling the
+// 'putSamples(numSamples)' function.
+SAMPLETYPE *FIFOSampleBuffer::ptrEnd(uint slackCapacity)
+{
+ ensureCapacity(samplesInBuffer + slackCapacity);
+ return buffer + samplesInBuffer * channels;
+}
+
+
+// Returns a pointer to the beginning of the currently non-outputted samples.
+// This function is provided for accessing the output samples directly.
+// Please be careful!
+//
+// When using this function to output samples, also remember to 'remove' the
+// outputted samples from the buffer by calling the
+// 'receiveSamples(numSamples)' function
+SAMPLETYPE *FIFOSampleBuffer::ptrBegin() const
+{
+ return buffer + bufferPos * channels;
+}
+
+
+// Ensures that the buffer has enought capacity, i.e. space for _at least_
+// 'capacityRequirement' number of samples. The buffer is grown in steps of
+// 4 kilobytes to eliminate the need for frequently growing up the buffer,
+// as well as to round the buffer size up to the virtual memory page size.
+void FIFOSampleBuffer::ensureCapacity(uint capacityRequirement)
+{
+ SAMPLETYPE *tempUnaligned, *temp;
+
+ if (capacityRequirement > getCapacity())
+ {
+ // enlarge the buffer in 4kbyte steps (round up to next 4k boundary)
+ sizeInBytes = (capacityRequirement * channels * sizeof(SAMPLETYPE) + 4095) & -4096;
+ assert(sizeInBytes % 2 == 0);
+ tempUnaligned = new SAMPLETYPE[sizeInBytes / sizeof(SAMPLETYPE) + 16 / sizeof(SAMPLETYPE)];
+ if (tempUnaligned == NULL)
+ {
+ throw std::runtime_error("Couldn't allocate memory!\n");
+ }
+ temp = (SAMPLETYPE *)(((ulong)tempUnaligned + 15) & -16);
+ memcpy(temp, ptrBegin(), samplesInBuffer * channels * sizeof(SAMPLETYPE));
+ delete[] bufferUnaligned;
+ buffer = temp;
+ bufferUnaligned = tempUnaligned;
+ bufferPos = 0;
+ }
+ else
+ {
+ // simply rewind the buffer (if necessary)
+ rewind();
+ }
+}
+
+
+// Returns the current buffer capacity in terms of samples
+uint FIFOSampleBuffer::getCapacity() const
+{
+...
[truncated message content] |
|
From: <rel...@us...> - 2008-10-10 17:39:41
|
Revision: 226
http://modplug.svn.sourceforge.net/modplug/?rev=226&view=rev
Author: relabsoluness
Date: 2008-10-10 17:39:28 +0000 (Fri, 10 Oct 2008)
Log Message:
-----------
(Patch from Jojo)
/ Channel manager now shows channel numbers with named channels.
Modified Paths:
--------------
trunk/OpenMPT/mptrack/ChannelManagerDlg.cpp
Modified: trunk/OpenMPT/mptrack/ChannelManagerDlg.cpp
===================================================================
--- trunk/OpenMPT/mptrack/ChannelManagerDlg.cpp 2008-09-16 16:51:25 UTC (rev 225)
+++ trunk/OpenMPT/mptrack/ChannelManagerDlg.cpp 2008-10-10 17:39:28 UTC (rev 226)
@@ -776,7 +776,7 @@
ii = pattern[i];
if(m_pSndFile->ChnSettings[ii].szName[0] > 0x20)
- wsprintf(s, "%s", m_pSndFile->ChnSettings[ii].szName);
+ wsprintf(s, "%d: %s", (ii+1), m_pSndFile->ChnSettings[ii].szName);
else
wsprintf(s, "Channel %d", ii+1);
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <xp...@us...> - 2008-09-11 13:07:37
|
Revision: 224
http://modplug.svn.sourceforge.net/modplug/?rev=224&view=rev
Author: xphanoo
Date: 2008-09-11 13:07:33 +0000 (Thu, 11 Sep 2008)
Log Message:
-----------
modifications:
-2 BITMAP files (img_list.bmp and MAINBAR.BMP). they are now in 24-bit and there are new icons inside
-maibar.cpp & mainfrm.cpp, only a few lines added, to enable the support for these new 24-bit (true color) images
Modified Paths:
--------------
branches/devBranch_1_17_03/mptrack/MainFrm.cpp
branches/devBranch_1_17_03/mptrack/Mainbar.cpp
branches/devBranch_1_17_03/mptrack/res/MAINBAR.BMP
branches/devBranch_1_17_03/mptrack/res/img_list.bmp
Modified: branches/devBranch_1_17_03/mptrack/MainFrm.cpp
===================================================================
--- branches/devBranch_1_17_03/mptrack/MainFrm.cpp 2008-09-07 22:13:53 UTC (rev 223)
+++ branches/devBranch_1_17_03/mptrack/MainFrm.cpp 2008-09-11 13:07:33 UTC (rev 224)
@@ -679,9 +679,15 @@
//-----------------------------------------------------
{
if (CMDIFrameWnd::OnCreate(lpCreateStruct) == -1) return -1;
- // Load resources
+ // Load resources - 24-bit icons
m_hIcon = theApp.LoadIcon(IDR_MAINFRAME);
- m_ImageList.Create(IDB_IMAGELIST, 16, 0, RGB(0,128,128));
+ CBitmap bitmap2;
+ bitmap2.LoadBitmap(IDB_IMAGELIST);
+ m_ImageList.Create(16,16,ILC_COLORDDB|ILC_MASK,17,1);
+ m_ImageList.Add(&bitmap2,RGB(255,0,255));
+ SendMessage(TB_SETIMAGELIST,0,(LPARAM)m_ImageList.m_hImageList);
+ bitmap2.Detach();
+
m_hGUIFont = (HFONT)GetStockObject(DEFAULT_GUI_FONT);
m_hFixedFont = ::CreateFont(12,5, 0,0, 300,
FALSE, FALSE, FALSE,
Modified: branches/devBranch_1_17_03/mptrack/Mainbar.cpp
===================================================================
--- branches/devBranch_1_17_03/mptrack/Mainbar.cpp 2008-09-07 22:13:53 UTC (rev 223)
+++ branches/devBranch_1_17_03/mptrack/Mainbar.cpp 2008-09-11 13:07:33 UTC (rev 224)
@@ -226,7 +226,16 @@
DWORD dwStyle = WS_CHILD | WS_VISIBLE | CBRS_TOP | CBRS_SIZE_DYNAMIC | CBRS_TOOLTIPS | CBRS_FLYBY;
if (!CToolBar::Create(parent, dwStyle)) return FALSE;
- if (!LoadBitmap(IDB_MAINBAR)) return FALSE;
+ // 24-bit icons
+ CImageList imageList;
+ CBitmap bitmap;
+ if (!bitmap.LoadBitmap(IDB_MAINBAR)) return FALSE;
+ imageList.Create(16,16,ILC_COLORDDB|ILC_MASK,17,1);
+ imageList.Add(&bitmap,RGB(255,0,255));
+ SendMessage(TB_SETIMAGELIST,0,(LPARAM)imageList.m_hImageList);
+ imageList.Detach();
+ bitmap.Detach();
+
if (!SetButtons(MainButtons, sizeof(MainButtons)/sizeof(UINT))) return FALSE;
nCurrentSpeed = 6;
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <rel...@us...> - 2008-09-07 22:14:02
|
Revision: 223
http://modplug.svn.sourceforge.net/modplug/?rev=223&view=rev
Author: relabsoluness
Date: 2008-09-07 22:13:53 +0000 (Sun, 07 Sep 2008)
Log Message:
-----------
./ Name changes and update fixes to plugin velocity/volume handling controls in instrument tab.
. Further fixes to ReadSample/itp vulnerabilities. (http://secunia.com/advisories/21418/)
. Fix to possible crash in LOAD_AMF.CPP.
. Fixed wrong default velocity/volume handling when loading XM files.
? Deleted miscellaneous items from version control.
? Removed GPL notifications from soundlib files.
- pitch shift/time stretch is gone. Can be enabled by disabling definition NO_XSOUNDLIB and adding xsoundlib.lib to linking.
Modified Paths:
--------------
trunk/OpenMPT/mptrack/Ctrl_ins.cpp
trunk/OpenMPT/mptrack/Ctrl_smp.cpp
trunk/OpenMPT/mptrack/Ctrl_smp.h
trunk/OpenMPT/mptrack/MPTRACK.sln
trunk/OpenMPT/mptrack/mptrack.rc
trunk/OpenMPT/mptrack/mptrack.vcproj
trunk/OpenMPT/mptrack/resource.h
trunk/OpenMPT/soundlib/Dlsbank.cpp
trunk/OpenMPT/soundlib/Fastmix.cpp
trunk/OpenMPT/soundlib/LOAD_AMF.CPP
trunk/OpenMPT/soundlib/Load_it.cpp
trunk/OpenMPT/soundlib/Load_mid.cpp
trunk/OpenMPT/soundlib/Load_xm.cpp
trunk/OpenMPT/soundlib/Mmcmp.cpp
trunk/OpenMPT/soundlib/Mmx_mix.cpp
trunk/OpenMPT/soundlib/Sampleio.cpp
trunk/OpenMPT/soundlib/Snd_dsp.cpp
trunk/OpenMPT/soundlib/Snd_eq.cpp
trunk/OpenMPT/soundlib/Snd_flt.cpp
trunk/OpenMPT/soundlib/Snd_fx.cpp
trunk/OpenMPT/soundlib/Sndfile.cpp
trunk/OpenMPT/soundlib/Sndfile.h
trunk/OpenMPT/soundlib/Sndmix.cpp
trunk/OpenMPT/soundlib/Tables.cpp
trunk/OpenMPT/soundlib/Waveform.cpp
Removed Paths:
-------------
trunk/OpenMPT/mptrack/Debug/
trunk/OpenMPT/mptrack/bin/getVersionFromCode.pl
trunk/OpenMPT/mptrack/bin/version
Modified: trunk/OpenMPT/mptrack/Ctrl_ins.cpp
===================================================================
--- trunk/OpenMPT/mptrack/Ctrl_ins.cpp 2008-08-24 20:33:31 UTC (rev 222)
+++ trunk/OpenMPT/mptrack/Ctrl_ins.cpp 2008-09-07 22:13:53 UTC (rev 223)
@@ -805,7 +805,7 @@
m_CbnFilterMode.SetItemData(m_CbnFilterMode.AddString("Force highpass"), FLTMODE_HIGHPASS);
//VST velocity/volume handling
- m_CbnPluginVelocityHandling.AddString("Use channelvolume");
+ m_CbnPluginVelocityHandling.AddString("Use note volume");
m_CbnPluginVelocityHandling.AddString("Process as volume");
m_CbnPluginVolumeHandling.AddString("MIDI volume");
m_CbnPluginVolumeHandling.AddString("Dry/Wet ratio");
@@ -1177,6 +1177,21 @@
CheckDlgButton(IDC_CHECK_PITCHTEMPOLOCK, MF_UNCHECKED);
OnBnClickedCheckPitchtempolock();
+
+ if(m_pSndFile->GetType() & (MOD_TYPE_XM|MOD_TYPE_IT|MOD_TYPE_MPT))
+ {
+ if(m_CbnMixPlug.GetCurSel() > 0 && m_pSndFile->GetModFlag(MSF_MIDICC_BUGEMULATION) == false)
+ {
+ m_CbnPluginVelocityHandling.EnableWindow(TRUE);
+ m_CbnPluginVolumeHandling.EnableWindow(TRUE);
+ }
+ else
+ {
+ m_CbnPluginVelocityHandling.EnableWindow(FALSE);
+ m_CbnPluginVolumeHandling.EnableWindow(FALSE);
+ }
+
+ }
} else
{
m_EditName.SetWindowText("");
Modified: trunk/OpenMPT/mptrack/Ctrl_smp.cpp
===================================================================
--- trunk/OpenMPT/mptrack/Ctrl_smp.cpp 2008-08-24 20:33:31 UTC (rev 222)
+++ trunk/OpenMPT/mptrack/Ctrl_smp.cpp 2008-09-07 22:13:53 UTC (rev 223)
@@ -10,10 +10,10 @@
#include "PSRatioCalc.h" //rewbs.timeStretchMods
#include "mpdlgs.h"
-// -> CODE#0029
-// -> DESC="pitch shifting - time stretching"
-#include "smbPitchShift.h"
-#include "samplerate.h"
+#ifndef NO_XSOUNDLIB
+ #include "smbPitchShift.h"
+ #include "samplerate.h"
+#endif
#ifdef _DEBUG
#include <math.h>
@@ -65,14 +65,13 @@
ON_COMMAND(ID_PREVINSTRUMENT, OnPrevInstrument)
ON_COMMAND(ID_NEXTINSTRUMENT, OnNextInstrument)
-// -> CODE#0029
-// -> DESC="pitch shifting - time stretching"
+#ifndef NO_XSOUNDLIB
ON_COMMAND(IDC_BUTTON1, OnPitchShiftTimeStretch)
ON_COMMAND(IDC_BUTTON2, OnEstimateSampleSize)
ON_COMMAND(IDC_BUTTON3, OnPitchShiftTimeStretchAccept)
ON_COMMAND(IDC_BUTTON4, OnPitchShiftTimeStretchCancel)
ON_COMMAND(IDC_CHECK3, OnEnableStretchToSize)
-// -! TEST#0029
+#endif
ON_EN_CHANGE(IDC_SAMPLE_NAME, OnNameChanged)
ON_EN_CHANGE(IDC_SAMPLE_FILENAME, OnFileNameChanged)
@@ -140,13 +139,12 @@
DDX_Control(pDX, IDC_EDIT15, m_EditVibDepth);
DDX_Control(pDX, IDC_EDIT16, m_EditVibRate);
-// -> CODE#0029
-// -> DESC="pitch shifting - time stretching"
+#ifndef NO_XSOUNDLIB
DDX_Control(pDX, IDC_COMBO4, m_ComboPitch);
DDX_Control(pDX, IDC_COMBO5, m_ComboQuality);
DDX_Control(pDX, IDC_COMBO6, m_ComboFFT);
DDX_Text(pDX, IDC_EDIT6, m_dTimeStretchRatio); //rewbs.timeStretchMods
-// -! TEST#0029
+#endif
//}}AFX_DATA_MAP
}
@@ -158,25 +156,25 @@
m_nSample = 1;
m_nLockCount = 1;
-// -> CODE#0029
-// -> DESC="pitch shifting - time stretching"
+#ifndef NO_XSOUNDLIB
pSampleUndoBuffer = NULL;
UndoBufferSize = 0;
-// -! TEST#0029
+#endif
+
}
-// -> CODE#0029
-// -> DESC="pitch shifting - time stretching"
-CCtrlSamples::~CCtrlSamples()
-{
- if(pSampleUndoBuffer) CSoundFile::FreeSample(pSampleUndoBuffer);
- pSampleUndoBuffer = NULL;
- UndoBufferSize = 0;
-}
-// -! TEST#0029
+#ifndef NO_XSOUNDLIB
+ CCtrlSamples::~CCtrlSamples()
+ {
+ if(pSampleUndoBuffer) CSoundFile::FreeSample(pSampleUndoBuffer);
+ pSampleUndoBuffer = NULL;
+ UndoBufferSize = 0;
+ }
+#endif
+
CRuntimeClass *CCtrlSamples::GetAssociatedViewClass()
//---------------------------------------------------
{
@@ -242,8 +240,28 @@
m_CbnBaseNote.AddString(s);
}
-// -> CODE#0029
-// -> DESC="pitch shifting - time stretching"
+
+#ifndef NO_XSOUNDLIB
+ m_ComboFFT.ShowWindow(SW_SHOW);
+ m_ComboPitch.ShowWindow(SW_SHOW);
+ m_ComboQuality.ShowWindow(SW_SHOW);
+ m_ComboFFT.ShowWindow(SW_SHOW);
+
+ GetDlgItem(IDC_BUTTON1)->ShowWindow(SW_SHOW); // PitchShiftTimeStretch
+ GetDlgItem(IDC_BUTTON2)->ShowWindow(SW_SHOW); // EstimateSampleSize
+ GetDlgItem(IDC_BUTTON3)->ShowWindow(SW_SHOW); // PitchShiftTimeStretchAccept
+ GetDlgItem(IDC_BUTTON4)->ShowWindow(SW_SHOW); // PitchShiftTimeStretchCancel
+ GetDlgItem(IDC_CHECK2)->ShowWindow(SW_SHOW); // Preview mode
+ GetDlgItem(IDC_CHECK3)->ShowWindow(SW_SHOW); // EnableStretchToSize
+ GetDlgItem(IDC_EDIT6)->ShowWindow(SW_SHOW); //
+ GetDlgItem(IDC_GROUPBOX_PITCH_TIME)->ShowWindow(SW_SHOW); //
+ GetDlgItem(IDC_TEXT_PITCH)->ShowWindow(SW_SHOW); //
+ GetDlgItem(IDC_TEXT_QUALITY)->ShowWindow(SW_SHOW); //
+ GetDlgItem(IDC_TEXT_FFT)->ShowWindow(SW_SHOW); //
+ GetDlgItem(IDC_TEXT_PREVIEW)->ShowWindow(SW_SHOW); //
+ GetDlgItem(IDC_GROUPBOX_PITCH_TIME)->ShowWindow(SW_SHOW); //
+ GetDlgItem(IDC_TEXT_PERCENT)->ShowWindow(SW_SHOW); //
+
CHAR str[16];
// Pitch selection
@@ -297,7 +315,7 @@
// Stretch to size check box
OnEnableStretchToSize();
-// -! TEST#0029
+#endif // NO_XSOUNDLIB
return TRUE;
}
@@ -319,10 +337,9 @@
if (pSndFile->m_nSamples < 1) pSndFile->m_nSamples = 1;
if ((nSmp < 1) || (nSmp > pSndFile->m_nSamples)) return FALSE;
-// -> CODE#0029
-// -> DESC="pitch shifting - time stretching"
+#ifndef NO_XSOUNDLIB
if(pSampleUndoBuffer) OnPitchShiftTimeStretchCancel();
-// -! TEST#0029
+#endif
LockControls();
if (m_nSample != nSmp)
@@ -666,11 +683,11 @@
DWORD len;
BOOL bOk;
-// -> CODE#0029
-// -> DESC="pitch shifting - time stretching"
+#ifndef NO_XSOUNDLIB
if(pSampleUndoBuffer) OnPitchShiftTimeStretchCancel();
-// -! TEST#0029
+#endif
+
BeginWaitCursor();
if ((!lpszFileName) || (!f.Open(lpszFileName)))
{
@@ -786,11 +803,11 @@
{
if ((!pSndFile) || (!nSample) || (nSample > pSndFile->m_nSamples)) return FALSE;
-// -> CODE#0029
-// -> DESC="pitch shifting - time stretching"
+#ifndef NO_XSOUNDLIB
if(pSampleUndoBuffer) OnPitchShiftTimeStretchCancel();
-// -! TEST#0029
+#endif
+
BeginWaitCursor();
BEGIN_CRITICAL();
m_pSndFile->DestroySample(m_nSample);
@@ -819,10 +836,9 @@
if ((!IsLocked()) && (m_pSndFile))
{
-// -> CODE#0029
-// -> DESC="pitch shifting - time stretching"
+#ifndef NO_XSOUNDLIB
if(pSampleUndoBuffer) OnPitchShiftTimeStretchCancel();
-// -! TEST#0029
+#endif
UINT n = GetDlgItemInt(IDC_EDIT_SAMPLE);
if ((n > 0) && (n <= m_pSndFile->m_nSamples) && (n != m_nSample))
@@ -863,10 +879,9 @@
if (smp > 0)
{
-// -> CODE#0029
-// -> DESC="pitch shifting - time stretching"
+ #ifndef NO_XSOUNDLIB
if(pSampleUndoBuffer) OnPitchShiftTimeStretchCancel();
-// -! TEST#0029
+ #endif
CSoundFile *pSndFile = m_pModDoc->GetSoundFile();
SetCurrentSample(smp);
@@ -1416,8 +1431,7 @@
}
-// -> CODE#0029
-// -> DESC="pitch shifting - time stretching"
+#ifndef NO_XSOUNDLIB
#define MAX_BUFFER_LENGTH 8192
#define CLIP_SOUND(v) v = v < -1.0f ? -1.0f : v > 1.0f ? 1.0f : v
@@ -1998,9 +2012,10 @@
return 0;
}
-// -! TEST#0029
+#endif // NO_XSOUNDLIB
+
void CCtrlSamples::OnReverse()
//----------------------------
{
Modified: trunk/OpenMPT/mptrack/Ctrl_smp.h
===================================================================
--- trunk/OpenMPT/mptrack/Ctrl_smp.h 2008-08-24 20:33:31 UTC (rev 222)
+++ trunk/OpenMPT/mptrack/Ctrl_smp.h 2008-09-07 22:13:53 UTC (rev 223)
@@ -1,7 +1,10 @@
#ifndef _CONTROL_SAMPLES_H_
#define _CONTROL_SAMPLES_H_
+// If defined, disables pitch shifting - time stretching.
+#define NO_XSOUNDLIB
+
//=======================================
class CCtrlSamples: public CModControlDlg
//=======================================
@@ -21,23 +24,21 @@
double m_dTimeStretchRatio; //rewbs.timeStretchMods
-// -> CODE#0029
-// -> DESC="pitch shifting - time stretching"
+#ifndef NO_XSOUNDLIB
CComboBox m_ComboPitch, m_ComboQuality, m_ComboFFT;
PVOID pSampleUndoBuffer;
UINT UndoBufferSize;
int PitchShift(float pitch);
int TimeStretch(double ratio);
-// -! TEST#0029
+#endif
public:
CCtrlSamples();
-// -> CODE#0029
-// -> DESC="pitch shifting - time stretching"
+#ifndef NO_XSOUNDLIB
~CCtrlSamples();
-// -! TEST#0029
+#endif
public:
BOOL SetCurrentSample(UINT n, LONG lZoom=-1, BOOL bUpdNum=TRUE);
@@ -94,14 +95,14 @@
afx_msg void OnVibRateChanged();
afx_msg void OnVScroll(UINT, UINT, CScrollBar *);
afx_msg LRESULT OnCustomKeyMsg(WPARAM, LPARAM); //rewbs.customKeys
-// -> CODE#0029
-// -> DESC=""
+
+#ifndef NO_XSOUNDLIB
afx_msg void OnPitchShiftTimeStretch();
afx_msg void OnEnableStretchToSize();
afx_msg void OnEstimateSampleSize();
afx_msg void OnPitchShiftTimeStretchAccept();
afx_msg void OnPitchShiftTimeStretchCancel();
-// -! TEST#0029
+#endif
//}}AFX_MSG
DECLARE_MESSAGE_MAP()
Modified: trunk/OpenMPT/mptrack/MPTRACK.sln
===================================================================
--- trunk/OpenMPT/mptrack/MPTRACK.sln 2008-08-24 20:33:31 UTC (rev 222)
+++ trunk/OpenMPT/mptrack/MPTRACK.sln 2008-09-07 22:13:53 UTC (rev 223)
@@ -2,7 +2,6 @@
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "mptrack", "mptrack.vcproj", "{DB18719C-9177-4632-A9E0-7E72E2E6B05E}"
ProjectSection(ProjectDependencies) = postProject
{1FF4AB04-B22F-4CB8-AA2A-0C5095B5FEE4} = {1FF4AB04-B22F-4CB8-AA2A-0C5095B5FEE4}
- {DCC2BB2F-6778-4FD3-9C00-D6CD8DC917B8} = {DCC2BB2F-6778-4FD3-9C00-D6CD8DC917B8}
{71531076-78C7-488D-8FD6-9D841F20AADE} = {71531076-78C7-488D-8FD6-9D841F20AADE}
{3C7281B0-D0E2-48ED-AE4D-A181FC77D8F7} = {3C7281B0-D0E2-48ED-AE4D-A181FC77D8F7}
EndProjectSection
Deleted: trunk/OpenMPT/mptrack/bin/getVersionFromCode.pl
===================================================================
--- trunk/OpenMPT/mptrack/bin/getVersionFromCode.pl 2008-08-24 20:33:31 UTC (rev 222)
+++ trunk/OpenMPT/mptrack/bin/getVersionFromCode.pl 2008-09-07 22:13:53 UTC (rev 223)
@@ -1,9 +0,0 @@
-open(I, "mptrack.rc");
-
-while(<I>) {
- if (/\VALUE "FileVersion", "([0-9]*), ([0-9]*), ([0-9]*), ([0-9]*)".*/) {
- printf("%d.%02d.%02d.%02d", $1, $2, $3, $4);
- }
-}
-
-close(I);
\ No newline at end of file
Deleted: trunk/OpenMPT/mptrack/bin/version
===================================================================
--- trunk/OpenMPT/mptrack/bin/version 2008-08-24 20:33:31 UTC (rev 222)
+++ trunk/OpenMPT/mptrack/bin/version 2008-09-07 22:13:53 UTC (rev 223)
@@ -1 +0,0 @@
-1.17.02.48
\ No newline at end of file
Modified: trunk/OpenMPT/mptrack/mptrack.rc
===================================================================
--- trunk/OpenMPT/mptrack/mptrack.rc 2008-08-24 20:33:31 UTC (rev 222)
+++ trunk/OpenMPT/mptrack/mptrack.rc 2008-09-07 22:13:53 UTC (rev 223)
@@ -755,29 +755,35 @@
UDS_ALIGNRIGHT | UDS_AUTOBUDDY | UDS_NOTHOUSANDS,353,83,
11,11
LTEXT "Auto-Vibrato",IDC_STATIC,275,50,41,8
- GROUPBOX "Pitch shifting / Time stretching",IDC_STATIC,370,22,150,
- 78
- LTEXT "Pitch",IDC_STATIC,374,38,23,10
- LTEXT "Quality",IDC_STATIC,374,54,23,10
- LTEXT "FFT",IDC_STATIC,374,70,23,10
+ GROUPBOX "Pitch shifting / Time stretching",
+ IDC_GROUPBOX_PITCH_TIME,370,22,150,78,NOT WS_VISIBLE
+ LTEXT "Pitch",IDC_TEXT_PITCH,374,38,23,10,NOT WS_VISIBLE
+ LTEXT "Quality",IDC_TEXT_QUALITY,374,54,23,10,NOT WS_VISIBLE
+ LTEXT "FFT",IDC_TEXT_FFT,374,70,23,10,NOT WS_VISIBLE
CONTROL "Preview mode",IDC_CHECK2,"Button",BS_AUTOCHECKBOX |
- BS_LEFTTEXT | BS_FLAT | WS_TABSTOP,373,83,65,11
+ BS_LEFTTEXT | BS_FLAT | NOT WS_VISIBLE | WS_TABSTOP,373,
+ 83,65,11
CONTROL "Time stretching",IDC_CHECK3,"Button",BS_AUTOCHECKBOX |
- BS_LEFTTEXT | BS_FLAT | WS_TABSTOP,446,36,68,11
- EDITTEXT IDC_EDIT6,446,51,45,13,ES_RIGHT | ES_AUTOHSCROLL,
- WS_EX_RIGHT
- CTEXT "Static",IDC_STATIC1,448,69,67,10
- PUSHBUTTON "Process",IDC_BUTTON1,448,80,67,16,0,WS_EX_CLIENTEDGE
- PUSHBUTTON "...",IDC_BUTTON2,502,51,13,13,0,WS_EX_CLIENTEDGE
- PUSHBUTTON "Keep",IDC_BUTTON3,448,82,32,13,0,WS_EX_CLIENTEDGE
- PUSHBUTTON "Restore",IDC_BUTTON4,482,82,33,13,0,WS_EX_CLIENTEDGE
- COMBOBOX IDC_COMBO4,400,35,39,61,CBS_DROPDOWNLIST | WS_VSCROLL |
- WS_GROUP | WS_TABSTOP
- COMBOBOX IDC_COMBO5,400,51,39,86,CBS_DROPDOWNLIST | WS_VSCROLL |
- WS_GROUP | WS_TABSTOP
- COMBOBOX IDC_COMBO6,400,67,39,61,CBS_DROPDOWNLIST | WS_VSCROLL |
- WS_GROUP | WS_TABSTOP
- LTEXT "%",IDC_STATIC,494,53,8,10
+ BS_LEFTTEXT | BS_FLAT | NOT WS_VISIBLE | WS_TABSTOP,446,
+ 36,68,11
+ EDITTEXT IDC_EDIT6,446,51,45,13,ES_RIGHT | ES_AUTOHSCROLL | NOT
+ WS_VISIBLE,WS_EX_RIGHT
+ CTEXT "Static",IDC_TEXT_PREVIEW,448,69,67,10,NOT WS_VISIBLE
+ PUSHBUTTON "Process",IDC_BUTTON1,448,80,67,16,NOT WS_VISIBLE,
+ WS_EX_CLIENTEDGE
+ PUSHBUTTON "...",IDC_BUTTON2,502,51,13,13,NOT WS_VISIBLE,
+ WS_EX_CLIENTEDGE
+ PUSHBUTTON "Keep",IDC_BUTTON3,448,82,32,13,NOT WS_VISIBLE,
+ WS_EX_CLIENTEDGE
+ PUSHBUTTON "Restore",IDC_BUTTON4,482,82,33,13,NOT WS_VISIBLE,
+ WS_EX_CLIENTEDGE
+ COMBOBOX IDC_COMBO4,400,35,39,61,CBS_DROPDOWNLIST | NOT
+ WS_VISIBLE | WS_VSCROLL | WS_GROUP | WS_TABSTOP
+ COMBOBOX IDC_COMBO5,400,51,39,86,CBS_DROPDOWNLIST | NOT
+ WS_VISIBLE | WS_VSCROLL | WS_GROUP | WS_TABSTOP
+ COMBOBOX IDC_COMBO6,400,67,39,61,CBS_DROPDOWNLIST | NOT
+ WS_VISIBLE | WS_VSCROLL | WS_GROUP | WS_TABSTOP
+ LTEXT "%",IDC_TEXT_PERCENT,494,53,8,10,NOT WS_VISIBLE
END
IDD_CONTROL_INSTRUMENTS DIALOGEX 0, 0, 558, 173
@@ -852,9 +858,9 @@
CONTROL "",IDC_SPIN11,"msctls_updown32",UDS_SETBUDDYINT |
UDS_ALIGNRIGHT | UDS_AUTOBUDDY | UDS_NOTHOUSANDS,351,153,
8,11
- COMBOBOX IDC_PLUGIN_VELOCITYSTYLE,371,115,82,50,CBS_DROPDOWNLIST |
+ COMBOBOX IDC_PLUGIN_VELOCITYSTYLE,367,115,83,50,CBS_DROPDOWNLIST |
WS_VSCROLL | WS_TABSTOP
- COMBOBOX IDC_PLUGIN_VOLUMESTYLE,373,148,77,53,CBS_DROPDOWNLIST |
+ COMBOBOX IDC_PLUGIN_VOLUMESTYLE,367,148,83,53,CBS_DROPDOWNLIST |
WS_VSCROLL | WS_TABSTOP
COMBOBOX IDC_COMBOTUNING,367,39,86,48,CBS_DROPDOWNLIST |
WS_VSCROLL | WS_TABSTOP
@@ -915,10 +921,10 @@
RTEXT "--",IDC_TEXT1,204,62,27,8
GROUPBOX "Pitch/Tempo Lock",IDC_STATIC,364,57,89,25
GROUPBOX "Sample Map",IDC_STATIC,461,27,62,141
- CTEXT "Note Velocity",IDC_STATIC,374,101,77,10,SS_CENTERIMAGE,
- WS_EX_STATICEDGE
- CTEXT "Volume command effect",IDC_STATIC,374,133,77,10,
+ CTEXT "Velocity handling",IDC_STATIC,367,102,83,10,
SS_CENTERIMAGE,WS_EX_STATICEDGE
+ CTEXT "Volume handling",IDC_STATIC,367,133,83,10,
+ SS_CENTERIMAGE,WS_EX_STATICEDGE
GROUPBOX "Tuning (experimental)",IDC_STATIC,364,28,92,28
END
Modified: trunk/OpenMPT/mptrack/mptrack.vcproj
===================================================================
--- trunk/OpenMPT/mptrack/mptrack.vcproj 2008-08-24 20:33:31 UTC (rev 222)
+++ trunk/OpenMPT/mptrack/mptrack.vcproj 2008-09-07 22:13:53 UTC (rev 223)
@@ -48,12 +48,12 @@
<Tool
Name="VCLinkerTool"
AdditionalOptions="/MACHINE:I386"
- AdditionalDependencies="winmm.lib strmiids.lib dmoguids.lib xsoundlib.lib version.lib opengl32.lib glu32.lib Rpcrt4.lib"
+ AdditionalDependencies="winmm.lib strmiids.lib dmoguids.lib version.lib opengl32.lib glu32.lib Rpcrt4.lib"
OutputFile=".\Debug/mptrack.exe"
Version="5.0"
LinkIncremental="2"
SuppressStartupBanner="TRUE"
- AdditionalLibraryDirectories="..\xsoundlib\Debug"
+ AdditionalLibraryDirectories=""
DelayLoadDLLs=""
GenerateDebugInformation="TRUE"
AssemblyDebug="1"
@@ -125,12 +125,12 @@
<Tool
Name="VCLinkerTool"
AdditionalOptions="/MACHINE:I386"
- AdditionalDependencies="winmm.lib strmiids.lib dmoguids.lib xsoundlib.lib version.lib opengl32.lib glu32.lib Rpcrt4.lib"
+ AdditionalDependencies="winmm.lib strmiids.lib dmoguids.lib version.lib opengl32.lib glu32.lib Rpcrt4.lib"
OutputFile=".\Bin/mptrack.exe"
Version="5.0"
LinkIncremental="1"
SuppressStartupBanner="TRUE"
- AdditionalLibraryDirectories="..\xsoundlib\Release"
+ AdditionalLibraryDirectories=""
GenerateMapFile="FALSE"
MapFileName=".\Release/mptrack.map"
SubSystem="2"/>
Modified: trunk/OpenMPT/mptrack/resource.h
===================================================================
--- trunk/OpenMPT/mptrack/resource.h 2008-08-24 20:33:31 UTC (rev 222)
+++ trunk/OpenMPT/mptrack/resource.h 2008-09-07 22:13:53 UTC (rev 223)
@@ -701,6 +701,7 @@
#define IDC_CHORDDETECTWAITTIME 2206
#define IDC_STATIC2 2207
#define IDC_STATIC1 2208
+#define IDC_TEXT_PREVIEW 2208
#define IDC_MACROPLUG 2209
#define IDC_MACROPARAM 2210
#define IDC_SAMPLE_LENGTH_NEW 2211
@@ -812,6 +813,11 @@
#define IDC_SPINMOVEMAPPING 2325
#define IDC_BUTTON_HALF 2326
#define IDC_BUTTON_DOUBLE 2327
+#define IDC_GROUPBOX_PITCH_TIME 2328
+#define IDC_TEXT_PITCH 2329
+#define IDC_TEXT_QUALITY 2330
+#define IDC_TEXT_FFT 2331
+#define IDC_TEXT_PERCENT 2332
#define ID_FILE_NEWMOD 32771
#define ID_FILE_NEWXM 32772
#define ID_FILE_NEWS3M 32773
@@ -1043,7 +1049,7 @@
#define _APS_3D_CONTROLS 1
#define _APS_NEXT_RESOURCE_VALUE 516
#define _APS_NEXT_COMMAND_VALUE 59212
-#define _APS_NEXT_CONTROL_VALUE 2328
+#define _APS_NEXT_CONTROL_VALUE 2333
#define _APS_NEXT_SYMED_VALUE 901
#endif
#endif
Modified: trunk/OpenMPT/soundlib/Dlsbank.cpp
===================================================================
--- trunk/OpenMPT/soundlib/Dlsbank.cpp 2008-08-24 20:33:31 UTC (rev 222)
+++ trunk/OpenMPT/soundlib/Dlsbank.cpp 2008-09-07 22:13:53 UTC (rev 223)
@@ -1,10 +1,10 @@
/*
- * This program is free software; you can redistribute it and modify it
- * under the terms of the GNU General Public License as published by the
- * Free Software Foundation; either version 2 of the license or (at your
- * option) any later version.
+ * OpenMPT
*
+ * Dlsbank.cpp
+ *
* Authors: Olivier Lapicque <oli...@jp...>
+ * OpenMPT devs
*/
///////////////////////////////////////////////////////////////////////////
Modified: trunk/OpenMPT/soundlib/Fastmix.cpp
===================================================================
--- trunk/OpenMPT/soundlib/Fastmix.cpp 2008-08-24 20:33:31 UTC (rev 222)
+++ trunk/OpenMPT/soundlib/Fastmix.cpp 2008-09-07 22:13:53 UTC (rev 223)
@@ -1,10 +1,10 @@
/*
- * This program is free software; you can redistribute it and modify it
- * under the terms of the GNU General Public License as published by the
- * Free Software Foundation; either version 2 of the license or (at your
- * option) any later version.
+ * OpenMPT
*
+ * Fastmix.cpp
+ *
* Authors: Olivier Lapicque <oli...@jp...>
+ * OpenMPT devs
*/
#include "stdafx.h"
Modified: trunk/OpenMPT/soundlib/LOAD_AMF.CPP
===================================================================
--- trunk/OpenMPT/soundlib/LOAD_AMF.CPP 2008-08-24 20:33:31 UTC (rev 222)
+++ trunk/OpenMPT/soundlib/LOAD_AMF.CPP 2008-09-07 22:13:53 UTC (rev 223)
@@ -165,7 +165,7 @@
-BOOL CSoundFile::ReadAMF(LPCBYTE lpStream, DWORD dwMemLength)
+BOOL CSoundFile::ReadAMF(LPCBYTE lpStream, const DWORD dwMemLength)
//-----------------------------------------------------------
{
const AMFFILEHEADER *pfh = (AMFFILEHEADER *)lpStream;
@@ -251,7 +251,8 @@
MODINSTRUMENT *psmp = &Ins[iData+1];
if (psmp->nLength)
{
- dwMemPos += ReadSample(psmp, RS_PCM8S, (LPCSTR)(lpStream+dwMemPos), dwMemLength);
+ if(dwMemPos > dwMemLength) return FALSE;
+ dwMemPos += ReadSample(psmp, RS_PCM8S, (LPCSTR)(lpStream+dwMemPos), dwMemLength - dwMemPos);
}
}
return TRUE;
Modified: trunk/OpenMPT/soundlib/Load_it.cpp
===================================================================
--- trunk/OpenMPT/soundlib/Load_it.cpp 2008-08-24 20:33:31 UTC (rev 222)
+++ trunk/OpenMPT/soundlib/Load_it.cpp 2008-09-07 22:13:53 UTC (rev 223)
@@ -1,10 +1,10 @@
/*
- * This program is free software; you can redistribute it and modify it
- * under the terms of the GNU General Public License as published by the
- * Free Software Foundation; either version 2 of the license or (at your
- * option) any later version.
+ * OpenMPT
*
+ * Load_it.cpp
+ *
* Authors: Olivier Lapicque <oli...@jp...>
+ * OpenMPT devs
*/
#include "stdafx.h"
@@ -473,8 +473,13 @@
DWORD streamPos = 0;
DWORD version;
- if(dwMemLength < 12) return FALSE;
+ // Macro used to make sure that given amount of bytes can be read.
+ // Returns FALSE from this function if reading is not possible.
+ #define ASSERT_CAN_READ(x) \
+ if( streamPos > dwMemLength || x > dwMemLength - streamPos ) return FALSE;
+ ASSERT_CAN_READ(12);
+
// Check file ID
memcpy(&id,lpStream+streamPos,sizeof(DWORD));
@@ -494,7 +499,8 @@
streamPos += sizeof(DWORD);
// name string
- if (streamPos+len<=dwMemLength && len<=sizeof(m_szNames[0])) {
+ ASSERT_CAN_READ(len);
+ if (len<=sizeof(m_szNames[0])) {
memcpy(m_szNames[0],lpStream+streamPos,len);
streamPos += len;
m_szNames[0][sizeof(m_szNames[0])-1] = '\0';
@@ -504,7 +510,7 @@
// Song comments
// comment string length
- if(streamPos + 4 > dwMemLength) return FALSE;
+ ASSERT_CAN_READ(4);
memcpy(&id,lpStream+streamPos,sizeof(DWORD));
streamPos += sizeof(DWORD);
if(id > uint16_max) return FALSE;
@@ -519,13 +525,15 @@
m_lpszSongComments = NULL;
// m_lpszSongComments
- if (m_lpszSongComments && id && streamPos + id <= dwMemLength) {
+ if (m_lpszSongComments && id)
+ {
+ ASSERT_CAN_READ(id);
memcpy(&m_lpszSongComments[0],lpStream+streamPos,id);
streamPos += id;
}
// Song global config
- if(streamPos + 5*4 > dwMemLength) return FALSE;
+ ASSERT_CAN_READ(5*4);
// m_dwSongFlags
memcpy(&id,lpStream+streamPos,sizeof(DWORD));
@@ -555,7 +563,7 @@
streamPos += sizeof(DWORD);
// Song channels data
- if(streamPos + 2*4 > dwMemLength) return FALSE;
+ ASSERT_CAN_READ(2*4);
// m_nChannels
memcpy(&id,lpStream+streamPos,sizeof(DWORD));
@@ -571,9 +579,8 @@
// Channels' data
for(i=0; i<m_nChannels; i++){
+ ASSERT_CAN_READ(3*4 + len);
- if(streamPos + 3*4 + len > dwMemLength) return FALSE;
-
// ChnSettings[i].nPan
memcpy(&id,lpStream+streamPos,sizeof(DWORD));
ChnSettings[i].nPan = id;
@@ -596,23 +603,24 @@
// Song mix plugins
// size of mix plugins data
- if(streamPos + 4 > dwMemLength) return FALSE;
+ ASSERT_CAN_READ(4);
memcpy(&id,lpStream+streamPos,sizeof(DWORD));
streamPos += sizeof(DWORD);
// mix plugins
- if(id > dwMemLength - streamPos) return FALSE;
+ ASSERT_CAN_READ(id);
streamPos += LoadMixPlugins(lpStream+streamPos, id);
// Song midi config
// midi cfg data length
- if(streamPos + 4 > dwMemLength) return FALSE;
+ ASSERT_CAN_READ(4);
memcpy(&id,lpStream+streamPos,sizeof(DWORD));
streamPos += sizeof(DWORD);
// midi cfg
- if (id<=sizeof(m_MidiCfg) && id+streamPos<=dwMemLength) {
+ ASSERT_CAN_READ(id);
+ if (id<=sizeof(m_MidiCfg)) {
memcpy(&m_MidiCfg,lpStream+streamPos,id);
streamPos += id;
}
@@ -620,14 +628,14 @@
// Song Instruments
// m_nInstruments
- if(streamPos + 4 > dwMemLength) return FALSE;
+ ASSERT_CAN_READ(4);
memcpy(&id,lpStream+streamPos,sizeof(DWORD));
m_nInstruments = id;
- if(m_nInstruments > 256) return FALSE;
+ if(m_nInstruments > MAX_INSTRUMENTS) return FALSE;
streamPos += sizeof(DWORD);
// path string length (=_MAX_PATH)
- if(streamPos + 4 > dwMemLength) return FALSE;
+ ASSERT_CAN_READ(4);
memcpy(&id,lpStream+streamPos,sizeof(DWORD));
len = id;
if(len > _MAX_PATH) return FALSE;
@@ -635,35 +643,30 @@
// instruments' paths
for(i=0; i<m_nInstruments; i++){
- if (len+streamPos<=dwMemLength)
- {
- memcpy(&m_szInstrumentPath[i][0],lpStream+streamPos,len);
- streamPos += len;
- }
- else return FALSE;
+ ASSERT_CAN_READ(len);
+ memcpy(&m_szInstrumentPath[i][0],lpStream+streamPos,len);
+ streamPos += len;
}
// Song Orders
// size of order array (=MAX_ORDERS)
- if(streamPos + 4 > dwMemLength) return FALSE;
+ ASSERT_CAN_READ(4);
memcpy(&id,lpStream+streamPos,sizeof(DWORD));
size = id;
if(size > MAX_ORDERS) return FALSE;
streamPos += sizeof(DWORD);
// order data
- if (size+streamPos<=dwMemLength)
- {
- Order.ReadAsByte(lpStream+streamPos, size, dwMemLength-streamPos);
- streamPos += size;
- }
- else return FALSE;
+ ASSERT_CAN_READ(size);
+ Order.ReadAsByte(lpStream+streamPos, size, dwMemLength-streamPos);
+ streamPos += size;
+
// Song Patterns
- if(streamPos + 12 > dwMemLength) return FALSE;
+ ASSERT_CAN_READ(3*4);
// number of patterns (=MAX_PATTERNS)
memcpy(&id,lpStream+streamPos,sizeof(DWORD));
size = id;
@@ -684,6 +687,7 @@
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+streamPos,m_nPatternNames * len);
}
else return FALSE;
@@ -691,9 +695,10 @@
streamPos += m_nPatternNames * len;
// modcommand data length
- if(streamPos + 4 > dwMemLength) return FALSE;
+ ASSERT_CAN_READ(4);
memcpy(&id,lpStream+streamPos,sizeof(DWORD));
n = id;
+ if(n != 6) return FALSE;
streamPos += sizeof(DWORD);
for(UINT npat=0; npat<size; npat++){
@@ -702,9 +707,9 @@
if(Patterns[npat]) { FreePattern(Patterns[npat]); Patterns[npat] = NULL; }
// PatternSize[npat]
- if(streamPos + 4 > dwMemLength) return FALSE;
+ ASSERT_CAN_READ(4);
memcpy(&id,lpStream+streamPos,sizeof(DWORD));
- if(id > 1024) return FALSE;
+ if(id > MAX_PATTERN_ROWS) return FALSE;
Patterns[npat].Resize(id);
streamPos += sizeof(DWORD);
@@ -736,14 +741,14 @@
ITSAMPLESTRUCT pis;
// Read original number of samples
- if(streamPos + 4 > dwMemLength) return FALSE;
+ ASSERT_CAN_READ(4);
memcpy(&id,lpStream+streamPos,sizeof(DWORD));
if(id > MAX_SAMPLES) return FALSE;
m_nSamples = id;
streamPos += sizeof(DWORD);
// Read number of embeded samples
- if(streamPos + 4 > dwMemLength) return FALSE;
+ ASSERT_CAN_READ(4);
memcpy(&id,lpStream+streamPos,sizeof(DWORD));
if(id > MAX_SAMPLES) return FALSE;
n = id;
@@ -752,7 +757,7 @@
// Read samples
for(i=0; i<n; i++){
- if(streamPos + 4 + sizeof(ITSAMPLESTRUCT) + 4 > dwMemLength) return FALSE;
+ ASSERT_CAN_READ(4 + sizeof(ITSAMPLESTRUCT) + 4);
// Sample id number
memcpy(&id,lpStream+streamPos,sizeof(DWORD));
@@ -841,7 +846,7 @@
__int16 fsize = 0;
BYTE * ptr = (BYTE *)(lpStream + streamPos);
- if (streamPos + 4 <= dwMemLength) {
+ if (streamPos <= dwMemLength - 4) {
fcode = (*((__int32 *)ptr));
}
@@ -903,6 +908,8 @@
}
return TRUE;
+
+ #undef ASSERT_CAN_READ
}
// -! NEW_FEATURE#0023
Modified: trunk/OpenMPT/soundlib/Load_mid.cpp
===================================================================
--- trunk/OpenMPT/soundlib/Load_mid.cpp 2008-08-24 20:33:31 UTC (rev 222)
+++ trunk/OpenMPT/soundlib/Load_mid.cpp 2008-09-07 22:13:53 UTC (rev 223)
@@ -1,10 +1,10 @@
/*
- * This program is free software; you can redistribute it and modify it
- * under the terms of the GNU General Public License as published by the
- * Free Software Foundation; either version 2 of the license or (at your
- * option) any later version.
+ * OpenMPT
*
+ * Load_mid.cpp
+ *
* Authors: Olivier Lapicque <oli...@jp...>
+ * OpenMPT devs
*/
//////////////////////////////////////////////
Modified: trunk/OpenMPT/soundlib/Load_xm.cpp
===================================================================
--- trunk/OpenMPT/soundlib/Load_xm.cpp 2008-08-24 20:33:31 UTC (rev 222)
+++ trunk/OpenMPT/soundlib/Load_xm.cpp 2008-09-07 22:13:53 UTC (rev 223)
@@ -404,6 +404,8 @@
penv->nPan = 128;
penv->nPPC = 5*12;
SetDefaultInstrumentValues(penv);
+ penv->nPluginVelocityHandling = PLUGIN_VELOCITYHANDLING_CHANNEL;
+ penv->nPluginVolumeHandling = PLUGIN_VOLUMEHANDLING_IGNORE;
if (xmsh.vtype & 1) penv->dwFlags |= ENV_VOLUME;
if (xmsh.vtype & 2) penv->dwFlags |= ENV_VOLSUSTAIN;
if (xmsh.vtype & 4) penv->dwFlags |= ENV_VOLLOOP;
Modified: trunk/OpenMPT/soundlib/Mmcmp.cpp
===================================================================
--- trunk/OpenMPT/soundlib/Mmcmp.cpp 2008-08-24 20:33:31 UTC (rev 222)
+++ trunk/OpenMPT/soundlib/Mmcmp.cpp 2008-09-07 22:13:53 UTC (rev 223)
@@ -1,9 +1,8 @@
/*
- * This program is free software; you can redistribute it and modify it
- * under the terms of the GNU General Public License as published by the
- * Free Software Foundation; either version 2 of the license or (at your
- * option) any later version.
+ * OpenMPT
*
+ * Mmcmp.cpp
+ *
* Authors: Olivier Lapicque <oli...@jp...>
*/
Modified: trunk/OpenMPT/soundlib/Mmx_mix.cpp
===================================================================
--- trunk/OpenMPT/soundlib/Mmx_mix.cpp 2008-08-24 20:33:31 UTC (rev 222)
+++ trunk/OpenMPT/soundlib/Mmx_mix.cpp 2008-09-07 22:13:53 UTC (rev 223)
@@ -1,10 +1,11 @@
/*
- * This program is free software; you can redistribute it and modify it
- * under the terms of the GNU General Public License as published by the
- * Free Software Foundation; either version 2 of the license or (at your
- * option) any later version.
+ * OpenMPT
*
+ * Mmx_mix.cpp
+ *
* Authors: Olivier Lapicque <oli...@jp...>
+ * OpenMPT devs
+ *
* Name Date Description
* Olivier Lapicque --/--/-- Creation
* Trevor Nunes 26/01/04 encapsulated MMX,AMD,SSE with #define flags
Modified: trunk/OpenMPT/soundlib/Sampleio.cpp
===================================================================
--- trunk/OpenMPT/soundlib/Sampleio.cpp 2008-08-24 20:33:31 UTC (rev 222)
+++ trunk/OpenMPT/soundlib/Sampleio.cpp 2008-09-07 22:13:53 UTC (rev 223)
@@ -1,10 +1,10 @@
/*
- * This program is free software; you can redistribute it and modify it
- * under the terms of the GNU General Public License as published by the
- * Free Software Foundation; either version 2 of the license or (at your
- * option) any later version.
+ * OpenMPT
*
+ * Sampleio.cpp
+ *
* Authors: Olivier Lapicque <oli...@jp...>
+ * OpenMPT devs
*/
#include "stdafx.h"
Modified: trunk/OpenMPT/soundlib/Snd_dsp.cpp
===================================================================
--- trunk/OpenMPT/soundlib/Snd_dsp.cpp 2008-08-24 20:33:31 UTC (rev 222)
+++ trunk/OpenMPT/soundlib/Snd_dsp.cpp 2008-09-07 22:13:53 UTC (rev 223)
@@ -1,10 +1,10 @@
/*
- * This program is free software; you can redistribute it and modify it
- * under the terms of the GNU General Public License as published by the
- * Free Software Foundation; either version 2 of the license or (at your
- * option) any later version.
+ * OpenMPT
*
+ * Snd_dsp.cpp
+ *
* Authors: Olivier Lapicque <oli...@jp...>
+ * OpenMPT devs
*/
#include "stdafx.h"
Modified: trunk/OpenMPT/soundlib/Snd_eq.cpp
===================================================================
--- trunk/OpenMPT/soundlib/Snd_eq.cpp 2008-08-24 20:33:31 UTC (rev 222)
+++ trunk/OpenMPT/soundlib/Snd_eq.cpp 2008-09-07 22:13:53 UTC (rev 223)
@@ -1,10 +1,10 @@
/*
- * This program is free software; you can redistribute it and modify it
- * under the terms of the GNU General Public License as published by the
- * Free Software Foundation; either version 2 of the license or (at your
- * option) any later version.
+ * OpenMPT
*
+ * Snd_eq.cpp
+ *
* Authors: Olivier Lapicque <oli...@jp...>
+ * OpenMPT devs
*
* Name Date Description
*
Modified: trunk/OpenMPT/soundlib/Snd_flt.cpp
===================================================================
--- trunk/OpenMPT/soundlib/Snd_flt.cpp 2008-08-24 20:33:31 UTC (rev 222)
+++ trunk/OpenMPT/soundlib/Snd_flt.cpp 2008-09-07 22:13:53 UTC (rev 223)
@@ -1,10 +1,10 @@
/*
- * This program is free software; you can redistribute it and modify it
- * under the terms of the GNU General Public License as published by the
- * Free Software Foundation; either version 2 of the license or (at your
- * option) any later version.
+ * OpenMPT
*
+ * Snd_flt.cpp
+ *
* Authors: Olivier Lapicque <oli...@jp...>
+ * OpenMPT devs
*/
#include "stdafx.h"
Modified: trunk/OpenMPT/soundlib/Snd_fx.cpp
===================================================================
--- trunk/OpenMPT/soundlib/Snd_fx.cpp 2008-08-24 20:33:31 UTC (rev 222)
+++ trunk/OpenMPT/soundlib/Snd_fx.cpp 2008-09-07 22:13:53 UTC (rev 223)
@@ -1,10 +1,10 @@
/*
- * This program is free software; you can redistribute it and modify it
- * under the terms of the GNU General Public License as published by the
- * Free Software Foundation; either version 2 of the license or (at your
- * option) any later version.
+ * OpenMPT
*
+ * Snd_fx.cpp
+ *
* Authors: Olivier Lapicque <oli...@jp...>
+ * OpenMPT devs
*/
#include "stdafx.h"
Modified: trunk/OpenMPT/soundlib/Sndfile.cpp
===================================================================
--- trunk/OpenMPT/soundlib/Sndfile.cpp 2008-08-24 20:33:31 UTC (rev 222)
+++ trunk/OpenMPT/soundlib/Sndfile.cpp 2008-09-07 22:13:53 UTC (rev 223)
@@ -1,10 +1,10 @@
/*
- * This program is free software; you can redistribute it and modify it
- * under the terms of the GNU General Public License as published by the
- * Free Software Foundation; either version 2 of the license or (at your
- * option) any later version.
+ * OpenMPT
*
+ * Sndfile.cpp
+ *
* Authors: Olivier Lapicque <oli...@jp...>
+ * OpenMPT devs
*/
#include "stdafx.h"
@@ -19,6 +19,8 @@
#include <vector>
#include <algorithm>
+#define str_SampleAllocationError (GetStrI18N(_TEXT("Sample allocation error")))
+#define str_Error (GetStrI18N(_TEXT("Error")))
#ifndef NO_COPYRIGHT
#ifndef NO_MMCMP_SUPPORT
@@ -1891,10 +1893,12 @@
UINT CSoundFile::ReadSample(MODINSTRUMENT *pIns, UINT nFlags, LPCSTR lpMemFile, DWORD dwMemLength, const WORD format)
//-----------------------------------------------------------------------------------------------------------------------
{
+ if(pIns->nLength > MAX_SAMPLE_LENGTH)
+ pIns->nLength = MAX_SAMPLE_LENGTH;
+
UINT len = 0, mem = pIns->nLength+6;
if ((!pIns) || (pIns->nLength < 4) || (!lpMemFile)) return 0;
- if (pIns->nLength > MAX_SAMPLE_LENGTH) pIns->nLength = MAX_SAMPLE_LENGTH;
pIns->uFlags &= ~(CHN_16BIT|CHN_STEREO);
if (nFlags & RSF_16BIT)
{
@@ -1906,11 +1910,24 @@
mem *= 2;
pIns->uFlags |= CHN_STEREO;
}
+
if ((pIns->pSample = AllocateSample(mem)) == NULL)
{
pIns->nLength = 0;
return 0;
}
+
+ // Check that allocated memory size is not less than what the modinstrument itself
+ // thinks it is.
+ if( mem < pIns->GetSampleSizeInBytes() )
+ {
+ pIns->nLength = 0;
+ FreeSample(pIns->pSample);
+ pIns->pSample = NULL;
+ MessageBox(0, str_SampleAllocationError, str_Error, MB_ICONERROR);
+ return 0;
+ }
+
switch(nFlags)
{
// 1: 8-bit unsigned PCM data
Modified: trunk/OpenMPT/soundlib/Sndfile.h
===================================================================
--- trunk/OpenMPT/soundlib/Sndfile.h 2008-08-24 20:33:31 UTC (rev 222)
+++ trunk/OpenMPT/soundlib/Sndfile.h 2008-09-07 22:13:53 UTC (rev 223)
@@ -1,11 +1,12 @@
/*
- * This program is free software; you can redistribute it and modify it
- * under the terms of the GNU General Public License as published by the
- * Free Software Foundation; either version 2 of the license or (at your
- * option) any later version.
+ * OpenMPT
*
+ * Sndfile.h
+ *
* Authors: Olivier Lapicque <oli...@jp...>
+ * OpenMPT devs
*/
+
#include "../mptrack/SoundFilePlayConfig.h"
#include "tuning.h"
#include "mod_specifications.h"
@@ -30,7 +31,8 @@
#define MOD_AMIGAC2 0x1AB
// -> CODE#0006
// -> DESC="misc quantity changes"
-#define MAX_SAMPLE_LENGTH 0x10000000 // 0x04000000 (64MB -> now 256MB)
+#define MAX_SAMPLE_LENGTH 0x10000000 // 0x04000000 (64MB -> now 256MB).
+ // Note: Sample size in bytes can be more than 256 MB.
// -! BEHAVIOUR_CHANGE#0006
#define MAX_SAMPLE_RATE 100000
#define MAX_ORDERS 256
@@ -45,7 +47,8 @@
//#else
// -> CODE#0006
// -> DESC="misc quantity changes"
-#define MAX_CHANNELS 256 //200 //Note: MAX_BASECHANNELS defines max pattern channels
+#define MAX_CHANNELS 256 //200 //Note: This is the maximum number of sound channels,
+ // see MAX_BASECHANNELS for max pattern channels.
// -! BEHAVIOUR_CHANGE#0006
//#endif
// -> CODE#0006
@@ -1050,7 +1053,7 @@
BOOL ReadDMF(LPCBYTE lpStream, DWORD dwMemLength);
BOOL ReadPTM(LPCBYTE lpStream, DWORD dwMemLength);
BOOL ReadDBM(LPCBYTE lpStream, DWORD dwMemLength);
- BOOL ReadAMF(LPCBYTE lpStream, DWORD dwMemLength);
+ BOOL ReadAMF(LPCBYTE lpStream, const DWORD dwMemLength);
BOOL ReadMT2(LPCBYTE lpStream, DWORD dwMemLength);
BOOL ReadPSM(LPCBYTE lpStream, DWORD dwMemLength);
BOOL ReadJ2B(LPCBYTE lpStream, DWORD dwMemLength);
Modified: trunk/OpenMPT/soundlib/Sndmix.cpp
===================================================================
--- trunk/OpenMPT/soundlib/Sndmix.cpp 2008-08-24 20:33:31 UTC (rev 222)
+++ trunk/OpenMPT/soundlib/Sndmix.cpp 2008-09-07 22:13:53 UTC (rev 223)
@@ -1,10 +1,10 @@
/*
- * This program is free software; you can redistribute it and modify it
- * under the terms of the GNU General Public License as published by the
- * Free Software Foundation; either version 2 of the license or (at your
- * option) any later version.
+ * OpenMPT
*
+ * Sndmix.cpp
+ *
* Authors: Olivier Lapicque <oli...@jp...>
+ * OpenMPT devs
*/
#include "stdafx.h"
Modified: trunk/OpenMPT/soundlib/Tables.cpp
===================================================================
--- trunk/OpenMPT/soundlib/Tables.cpp 2008-08-24 20:33:31 UTC (rev 222)
+++ trunk/OpenMPT/soundlib/Tables.cpp 2008-09-07 22:13:53 UTC (rev 223)
@@ -1,10 +1,10 @@
/*
- * This program is free software; you can redistribute it and modify it
- * under the terms of the GNU General Public License as published by the
- * Free Software Foundation; either version 2 of the license or (at your
- * option) any later version.
+ * OpenMPT
*
+ * Tables.cpp
+ *
* Authors: Olivier Lapicque <oli...@jp...>
+ * OpenMPT devs
*
* Name Date Description:
* Olivier Lapicque --/--/-- Creator
Modified: trunk/OpenMPT/soundlib/Waveform.cpp
===================================================================
--- trunk/OpenMPT/soundlib/Waveform.cpp 2008-08-24 20:33:31 UTC (rev 222)
+++ trunk/OpenMPT/soundlib/Waveform.cpp 2008-09-07 22:13:53 UTC (rev 223)
@@ -1,10 +1,10 @@
/*
- * This program is free software; you can redistribute it and modify it
- * under the terms of the GNU General Public License as published by the
- * Free Software Foundation; either version 2 of the license or (at your
- * option) any later version.
+ * OpenMPT
*
+ * Waveform.cpp
+ *
* Authors: Olivier Lapicque <oli...@jp...>
+ * OpenMPT devs
*/
#include "stdafx.h"
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <rel...@us...> - 2008-08-24 20:33:39
|
Revision: 222
http://modplug.svn.sourceforge.net/modplug/?rev=222&view=rev
Author: relabsoluness
Date: 2008-08-24 20:33:31 +0000 (Sun, 24 Aug 2008)
Log Message:
-----------
[Mod] Moved HasNote-inquiries from CSoundFile to CModSpecifications along with related changes to CModSpecifications. Adds additional restrictions to entering notes to pattern (e.g. for MOD: notes below C-3, which don't get saved to file, won't be recorded to pattern).
Modified Paths:
--------------
branches/devBranch_1_17_03/mptrack/View_pat.cpp
branches/devBranch_1_17_03/mptrack/dlg_misc.cpp
branches/devBranch_1_17_03/mptrack/mptrack.vcproj
branches/devBranch_1_17_03/mptrack/test/test.cpp
branches/devBranch_1_17_03/soundlib/Load_it.cpp
branches/devBranch_1_17_03/soundlib/OrderToPatternTable.cpp
branches/devBranch_1_17_03/soundlib/Sndfile.cpp
branches/devBranch_1_17_03/soundlib/Sndfile.h
branches/devBranch_1_17_03/soundlib/modspecifications.h
Added Paths:
-----------
branches/devBranch_1_17_03/soundlib/modspecifications.cpp
Modified: branches/devBranch_1_17_03/mptrack/View_pat.cpp
===================================================================
--- branches/devBranch_1_17_03/mptrack/View_pat.cpp 2008-08-22 18:08:38 UTC (rev 221)
+++ branches/devBranch_1_17_03/mptrack/View_pat.cpp 2008-08-24 20:33:31 UTC (rev 222)
@@ -4017,8 +4017,13 @@
UINT nRow = m_nRow;
CSoundFile *pSndFile = pModDoc->GetSoundFile();
+ if(note > pSndFile->GetModSpecifications().noteMax && note < NOTE_MIN_SPECIAL)
+ note = pSndFile->GetModSpecifications().noteMax;
+ else if( note < pSndFile->GetModSpecifications().noteMin)
+ note = pSndFile->GetModSpecifications().noteMin;
+
// Check whether the module format supports the note.
- if( pSndFile->HasNote(note) == false )
+ if( pSndFile->GetModSpecifications().HasNote(note) == false )
return;
UINT nChn = GetChanFromCursor(m_dwCursor);
@@ -4037,8 +4042,6 @@
return;
}
- if (note > NOTE_MAX && note<254) note = NOTE_MAX;
-
bool usePlaybackPosition = (m_dwStatus & PATSTATUS_FOLLOWSONG) && // work out whether we should use
(pMainFrm->GetFollowSong(pModDoc) == m_hWnd) && // player engine position or
!(pSndFile->IsPaused()) && // edit cursor position
Modified: branches/devBranch_1_17_03/mptrack/dlg_misc.cpp
===================================================================
--- branches/devBranch_1_17_03/mptrack/dlg_misc.cpp 2008-08-22 18:08:38 UTC (rev 221)
+++ branches/devBranch_1_17_03/mptrack/dlg_misc.cpp 2008-08-24 20:33:31 UTC (rev 222)
@@ -632,7 +632,7 @@
{
combo->SetItemData(combo->AddString("any"), findAny);
}
- AppendNotesToControl(*combo, pSndFile);
+ AppendNotesToControl(*combo);
UINT ncount = combo->GetCount();
for (UINT i=0; i<ncount; i++) if (m_nNote == combo->GetItemData(i))
@@ -2713,7 +2713,9 @@
void AppendNotesToControl(CComboBox& combobox, const CSoundFile* const pSndFile)
//----------------------------------------------------------------------------------
{
- for(MODCOMMAND::NOTE nNote=1; nNote<=NOTE_MAX; nNote++)
+ const MODCOMMAND::NOTE noteStart = (pSndFile != nullptr) ? pSndFile->GetModSpecifications().noteMin : 1;
+ const MODCOMMAND::NOTE noteEnd = (pSndFile != nullptr) ? pSndFile->GetModSpecifications().noteMax : NOTE_MAX;
+ for(MODCOMMAND::NOTE nNote = noteStart; nNote <= noteEnd; nNote++)
{
combobox.SetItemData(combobox.AddString(szDefaultNoteNames[nNote-1]), nNote);
}
@@ -2721,7 +2723,7 @@
{
if(pSndFile != 0)
{
- if(pSndFile->HasSpecialNote(nNote) == true)
+ if(pSndFile->GetModSpecifications().HasNote(nNote) == true)
{
int k = combobox.AddString(szSpecialNoteNames[nNote-NOTE_MIN_SPECIAL]);
combobox.SetItemData(k, nNote);
@@ -2736,14 +2738,16 @@
void AppendNotesToControl(CComboBox& combobox, const CSoundFile& rSndFile, const INSTRUMENTINDEX iInstr)
//----------------------------------------------------------------------------------------------------------
{
- for (MODCOMMAND::NOTE i=1; i<=NOTE_MAX; i++)
+ const MODCOMMAND::NOTE noteStart = rSndFile.GetModSpecifications().noteMin;
+ const MODCOMMAND::NOTE noteEnd = rSndFile.GetModSpecifications().noteMax;
+ for(MODCOMMAND::NOTE note = noteStart; note <= noteEnd; note++)
{
- combobox.SetItemData(combobox.AddString(rSndFile.GetNoteName(i, iInstr).c_str()), i);
+ combobox.SetItemData(combobox.AddString(rSndFile.GetNoteName(note, iInstr).c_str()), note);
}
for(MODCOMMAND::NOTE note = NOTE_MIN_SPECIAL-1; note++ < NOTE_MAX_SPECIAL;)
{
- if(rSndFile.HasSpecialNote(note) == true)
+ if(rSndFile.GetModSpecifications().HasNote(note) == true)
{
combobox.SetItemData(combobox.AddString(szSpecialNoteShortDesc[note-NOTE_MIN_SPECIAL]), note);
}
Modified: branches/devBranch_1_17_03/mptrack/mptrack.vcproj
===================================================================
--- branches/devBranch_1_17_03/mptrack/mptrack.vcproj 2008-08-22 18:08:38 UTC (rev 221)
+++ branches/devBranch_1_17_03/mptrack/mptrack.vcproj 2008-08-24 20:33:31 UTC (rev 222)
@@ -350,6 +350,9 @@
RelativePath=".\modedit.cpp">
</File>
<File
+ RelativePath="..\soundlib\modspecifications.cpp">
+ </File>
+ <File
RelativePath=".\Moptions.cpp">
</File>
<File
Modified: branches/devBranch_1_17_03/mptrack/test/test.cpp
===================================================================
--- branches/devBranch_1_17_03/mptrack/test/test.cpp 2008-08-22 18:08:38 UTC (rev 221)
+++ branches/devBranch_1_17_03/mptrack/test/test.cpp 2008-08-24 20:33:31 UTC (rev 222)
@@ -10,8 +10,6 @@
#include "../misc_util.h"
-STATIC_ASSERT(sizeof(MODCOMMAND_ORIGINAL) == 6);
-
#ifdef ENABLE_TESTS
namespace MptTest
@@ -60,11 +58,13 @@
void TestMisc()
+//-------------
{
STATIC_ASSERT(SMP_16BIT == CHN_16BIT);
STATIC_ASSERT(SMP_STEREO == CHN_STEREO);
+ STATIC_ASSERT(sizeof(MODCOMMAND_ORIGINAL) == 6);
STATIC_ASSERT( sizeof(SNDMIXPLUGININFO) == 128 ); //Comment right after the struct said: "Size should be 128"
- VERIFY_EQUAL( (MAX_BASECHANNELS >= MPTM_SPECS.channelsMax), true );
+ VERIFY_EQUAL( (MAX_BASECHANNELS >= ModSpecs::mptm.channelsMax), true );
}
void TestVersion()
Modified: branches/devBranch_1_17_03/soundlib/Load_it.cpp
===================================================================
--- branches/devBranch_1_17_03/soundlib/Load_it.cpp 2008-08-22 18:08:38 UTC (rev 221)
+++ branches/devBranch_1_17_03/soundlib/Load_it.cpp 2008-08-24 20:33:31 UTC (rev 222)
@@ -1133,7 +1133,7 @@
UINT len = *((WORD *)(lpStream+patpos[patchk]));
UINT rows = *((WORD *)(lpStream+patpos[patchk]+2));
- if(rows <= IT_MPTEXT_SPECS.patternRowsMax && rows > IT_STD_SPECS.patternRowsMax)
+ if(rows <= ModSpecs::it_ext.patternRowsMax && rows > ModSpecs::it.patternRowsMax)
{
interpretModplugmade = true;
hasModplugExtensions = true;
Modified: branches/devBranch_1_17_03/soundlib/OrderToPatternTable.cpp
===================================================================
--- branches/devBranch_1_17_03/soundlib/OrderToPatternTable.cpp 2008-08-22 18:08:38 UTC (rev 221)
+++ branches/devBranch_1_17_03/soundlib/OrderToPatternTable.cpp 2008-08-24 20:33:31 UTC (rev 222)
@@ -163,7 +163,7 @@
{
uint16 size;
istrm.read(reinterpret_cast<char*>(&size), 2);
- if(size > MPTM_SPECS.ordersMax) size = MPTM_SPECS.ordersMax;
+ if(size > ModSpecs::mptm.ordersMax) size = ModSpecs::mptm.ordersMax;
m_rOrders.resize(size);
if(size == 0) {m_rOrders.assign(MAX_ORDERS, m_rOrders.GetInvalidPatIndex()); return;}
Modified: branches/devBranch_1_17_03/soundlib/Sndfile.cpp
===================================================================
--- branches/devBranch_1_17_03/soundlib/Sndfile.cpp 2008-08-22 18:08:38 UTC (rev 221)
+++ branches/devBranch_1_17_03/soundlib/Sndfile.cpp 2008-08-24 20:33:31 UTC (rev 222)
@@ -391,7 +391,7 @@
PatternSize(*this), Patterns(*this),
Order(*this),
m_PlaybackEventer(*this),
- m_pModSpecs(&IT_MPTEXT_SPECS),
+ m_pModSpecs(&ModSpecs::it_ext),
m_MIDIMapper(*this)
//----------------------
{
@@ -2867,24 +2867,24 @@
switch(type)
{
case MOD_TYPE_MPT:
- pModSpecs = &MPTM_SPECS;
+ pModSpecs = &ModSpecs::mptm;
break;
case MOD_TYPE_IT:
- pModSpecs = &IT_MPTEXT_SPECS;
+ pModSpecs = &ModSpecs::it_ext;
break;
case MOD_TYPE_XM:
- pModSpecs = &XM_MPTEXT_SPECS;
+ pModSpecs = &ModSpecs::xm_ext;
break;
case MOD_TYPE_S3M:
- pModSpecs = &S3M_MPTEXT_SPECS;
+ pModSpecs = &ModSpecs::s3m_ext;
break;
case MOD_TYPE_MOD:
default:
- pModSpecs = &MOD_MPTEXT_SPECS;
+ pModSpecs = &ModSpecs::mod_ext;
break;
}
}
@@ -2956,36 +2956,3 @@
return *p;
}
-
-bool CSoundFile::HasNote(MODCOMMAND::NOTE note) const
-//----------------------------------------------
-{
- // TOFIX: This note range is not valid for all modtypes.
- if(note >= 1 && note <= NOTE_MAX)
- return true;
- else
- return HasSpecialNote(note);
-}
-
-bool CSoundFile::HasSpecialNote(MODCOMMAND::NOTE note) const
-//----------------------------------------------------------
-{
- if(note < NOTE_MIN_SPECIAL || note > NOTE_MAX_SPECIAL)
- return false;
-
- if(GetType() == MOD_TYPE_MPT)
- return true;
-
- if(note == NOTE_PC || note == NOTE_PCS)
- return false;
-
- if(GetType() == MOD_TYPE_IT)
- return true;
- if(GetType() == MOD_TYPE_XM)
- return (note != NOTE_NOTECUT) ? true : false;
- if(GetType() == MOD_TYPE_S3M)
- return (note != NOTE_KEYOFF) ? true : false;
-
- return false;
-}
-
Modified: branches/devBranch_1_17_03/soundlib/Sndfile.h
===================================================================
--- branches/devBranch_1_17_03/soundlib/Sndfile.h 2008-08-22 18:08:38 UTC (rev 221)
+++ branches/devBranch_1_17_03/soundlib/Sndfile.h 2008-08-24 20:33:31 UTC (rev 222)
@@ -99,8 +99,8 @@
};
+using ModSpecs::CModSpecifications;
-
class CTuningCollection;
//==============
@@ -113,13 +113,6 @@
public: //Misc
void ChangeModTypeTo(const MODTYPE& newType);
-
- // Return true iff current module format has given note.
- // Possible note values: [1, NOTE_MAX], [NOTE_MIN_SPECIAL, NOTE_MAX_SPECIAL]
- bool HasNote(MODCOMMAND::NOTE) const;
-
- // Return true iff current module format has given special note(such as note cut).
- bool HasSpecialNote(MODCOMMAND::NOTE) const;
//Return value in seconds.
double GetPlaybackTimeAt(ORDERINDEX, ROWINDEX);
Added: branches/devBranch_1_17_03/soundlib/modspecifications.cpp
===================================================================
--- branches/devBranch_1_17_03/soundlib/modspecifications.cpp (rev 0)
+++ branches/devBranch_1_17_03/soundlib/modspecifications.cpp 2008-08-24 20:33:31 UTC (rev 222)
@@ -0,0 +1,25 @@
+#include <stdafx.h>
+#include "modspecifications.h"
+
+namespace ModSpecs
+{
+
+bool CModSpecifications::HasNote(MODCOMMAND::NOTE note) const
+//------------------------------------------------------------
+{
+ if(note >= noteMin && note <= noteMax)
+ return true;
+ else if(note >= NOTE_MIN_SPECIAL && note <= NOTE_MAX_SPECIAL)
+ {
+ if(note == NOTE_NOTECUT)
+ return hasNoteCut;
+ else if(note == NOTE_KEYOFF)
+ return hasNoteOff;
+ else
+ return (memcmp(fileExtension, mptm.fileExtension, 4) == 0);
+ }
+ return false;
+}
+
+} //namespace ModSpecs
+
Modified: branches/devBranch_1_17_03/soundlib/modspecifications.h
===================================================================
--- branches/devBranch_1_17_03/soundlib/modspecifications.h 2008-08-22 18:08:38 UTC (rev 221)
+++ branches/devBranch_1_17_03/soundlib/modspecifications.h 2008-08-24 20:33:31 UTC (rev 222)
@@ -1,7 +1,10 @@
#ifndef MOD_SPECIFICATIONS_H
#define MOD_SPECIFICATIONS_H
+#include "modcommand.h"
+#include "../mptrack/SoundFilePlayConfig.h"
+
//Module IDs
#define MOD_TYPE_NONE 0x00
#define MOD_TYPE_MOD 0x01
@@ -38,20 +41,28 @@
const BYTE MSF_OLDVOLSWING = 1; //IT/MPT
const BYTE MSF_MIDICC_BUGEMULATION = 2; //IT/MPT/XM
-//Simple struct to gather various modspecifications in one place.
+namespace ModSpecs
+{
+
+// Struct to gather various modspecifications in one place.
+
struct CModSpecifications
//=======================
{
+ // Return true iff format has given note.
+ bool HasNote(MODCOMMAND::NOTE note) const;
+
//NOTE: If changing order, update all initializations below.
- char fileExtension[5];
+ char fileExtension[5]; // File extension without dot.
+ MODCOMMAND::NOTE noteMin; // Minimum note index (indecing starts from 1)
+ MODCOMMAND::NOTE noteMax; // Maximum note index (indecing starts from 1)
+ bool hasNoteCut; // True iff format has notecut.
+ bool hasNoteOff; // True iff format has noteoff.
PATTERNINDEX patternsMax;
ORDERINDEX ordersMax;
- CHANNELINDEX channelsMin;
- CHANNELINDEX channelsMax;
- //Note: The two above refer to the user editable pattern channels,
- //not to the internal sound channels. Maybe there should be a separate
- //setting for those(January 2007).
+ CHANNELINDEX channelsMin; // Minimum number of editable channels in pattern.
+ CHANNELINDEX channelsMax; // Maximum number of editable channels in pattern.
TEMPO tempoMin;
TEMPO tempoMax;
ROWINDEX patternRowsMin;
@@ -64,7 +75,7 @@
};
-const CModSpecifications MPTM_SPECS =
+const CModSpecifications mptm =
{
/*
TODO: Proper, less arbitrarily chosen, values here.
@@ -72,6 +83,10 @@
-savefile format and GUI methods can handle new values(might not be a small task :).
*/
"MPTm", //File extension
+ 1, //Minimum note index
+ NOTE_MAX, //Maximum note index
+ true, //Has notecut.
+ true, //Has noteoff.
4000, //Pattern max.
4000, //Order max.
4, //Channel min
@@ -90,10 +105,14 @@
-const CModSpecifications MOD_STD_SPECS =
+const CModSpecifications mod =
{
//TODO: Set correct values.
"mod", //File extension
+ 37, //Minimum note index
+ 108, //Maximum note index
+ false, //Has notecut.
+ false, //Has noteoff.
64, //Pattern max.
128, //Order max.
4, //Channel min
@@ -109,10 +128,15 @@
0, //Max MIDI mapping directives
};
-const CModSpecifications MOD_MPTEXT_SPECS =
+// MOD with MPT extensions.
+const CModSpecifications mod_ext =
{
//TODO: Set correct values.
"mod", //File extension
+ 37, //Minimum note index
+ 108, //Maximum note index
+ false, //Has notecut.
+ false, //Has noteoff.
64, //Pattern max.
128, //Order max.
4, //Channel min
@@ -128,10 +152,14 @@
0 //Max MIDI mapping directives
};
-const CModSpecifications XM_STD_SPECS =
+const CModSpecifications xm =
{
//TODO: Set correct values.
"xm", //File extension
+ 13, //Minimum note index
+ 108, //Maximum note index
+ false, //Has notecut.
+ true, //Has noteoff.
64, //Pattern max.
128, //Order max.
4, //Channel min
@@ -147,11 +175,15 @@
0 //Max MIDI mapping directives
};
-
-const CModSpecifications XM_MPTEXT_SPECS =
+// XM with MPT extensions
+const CModSpecifications xm_ext =
{
//TODO: Set correct values.
"xm", //File extension
+ 13, //Minimum note index
+ 108, //Maximum note index
+ false, //Has notecut.
+ true, //Has noteoff.
240, //Pattern max.
256, //Order max.
4, //Channel min
@@ -167,10 +199,14 @@
200 //Max MIDI mapping directives
};
-const CModSpecifications S3M_STD_SPECS =
+const CModSpecifications s3m =
{
//TODO: Set correct values.
"s3m", //File extension
+ 13, //Minimum note index
+ NOTE_MAX, //Maximum note index
+ true, //Has notecut.
+ false, //Has noteoff.
240, //Pattern max.
256, //Order max.
4, //Channel min
@@ -186,10 +222,15 @@
0 //Max MIDI mapping directives
};
-const CModSpecifications S3M_MPTEXT_SPECS =
+// S3M with MPT extensions
+const CModSpecifications s3m_ext =
{
//TODO: Set correct values.
"s3m", //File extension
+ 13, //Minimum note index
+ NOTE_MAX, //Maximum note index
+ true, //Has notecut.
+ false, //Has noteoff.
240, //Pattern max.
256, //Order max.
4, //Channel min
@@ -205,10 +246,14 @@
0 //Max MIDI mapping directives
};
-const CModSpecifications IT_STD_SPECS =
+const CModSpecifications it =
{
//TODO: Set correct values.
"it", //File extension
+ 1, //Minimum note index
+ NOTE_MAX, //Maximum note index
+ true, //Has notecut.
+ true, //Has noteoff.
240, //Pattern max.
200, //Order max.
4, //Channel min
@@ -224,10 +269,14 @@
0 //Max MIDI mapping directives
};
-const CModSpecifications IT_MPTEXT_SPECS =
+const CModSpecifications it_ext =
{
//TODO: Set correct values.
"it", //File extension
+ 1, //Minimum note index
+ NOTE_MAX, //Maximum note index
+ true, //Has notecut.
+ true, //Has noteoff.
240, //Pattern max.
256, //Order max.
4, //Channel min
@@ -243,7 +292,7 @@
200 //Max MIDI mapping directives
};
+} //namespace ModSpecs
-
#endif
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <rel...@us...> - 2008-08-22 18:08:48
|
Revision: 221
http://modplug.svn.sourceforge.net/modplug/?rev=221&view=rev
Author: relabsoluness
Date: 2008-08-22 18:08:38 +0000 (Fri, 22 Aug 2008)
Log Message:
-----------
[New] Experimental parameter control 'notes' for controlling plug params(only in MPTm). Is more or less fully functional with the big exception that there's no saving or loading. Among other things, includes modifications/additions to: keyshortcuts, various GUI components, pattern draw methods, clipboard handling, pattern editing functions, ProcessEffects().
[Fix] Some checks added to pattern editing to prevent entering notes which are not supported by the module format.
Internal:
[Ref] Find/Replace dialog: Added enums for special items.
[Mod] Disabled keyconfig log messages which filled the debug output.
[Mod] Modification to IMixPlugin for easier parameter modification.
[Ref] Created new note name arrays and functions for populating comboboxes with note names.
[Mod] Removed constructor from modcommand and instrumentheader.
[Mod] ProcessMidiOut() now takes modcommand data from modchannel rowdata instead from pattern.
[Misc] Various smaller changes (new asserts here and there etc.)
Modified Paths:
--------------
branches/devBranch_1_17_03/mptrack/CommandSet.cpp
branches/devBranch_1_17_03/mptrack/CommandSet.h
branches/devBranch_1_17_03/mptrack/Ctrl_ins.cpp
branches/devBranch_1_17_03/mptrack/Ctrl_pat.cpp
branches/devBranch_1_17_03/mptrack/Ctrl_smp.cpp
branches/devBranch_1_17_03/mptrack/Draw_pat.cpp
branches/devBranch_1_17_03/mptrack/Modedit.cpp
branches/devBranch_1_17_03/mptrack/Mptrack.cpp
branches/devBranch_1_17_03/mptrack/Mptrack.h
branches/devBranch_1_17_03/mptrack/View_pat.cpp
branches/devBranch_1_17_03/mptrack/View_pat.h
branches/devBranch_1_17_03/mptrack/View_smp.cpp
branches/devBranch_1_17_03/mptrack/View_tre.cpp
branches/devBranch_1_17_03/mptrack/Vstplug.cpp
branches/devBranch_1_17_03/mptrack/Vstplug.h
branches/devBranch_1_17_03/mptrack/dlg_misc.cpp
branches/devBranch_1_17_03/mptrack/dlg_misc.h
branches/devBranch_1_17_03/mptrack/misc_util.h
branches/devBranch_1_17_03/mptrack/mod2midi.cpp
branches/devBranch_1_17_03/mptrack/res/view_pat.bmp
branches/devBranch_1_17_03/mptrack/test/test.cpp
branches/devBranch_1_17_03/mptrack/typedefs.h
branches/devBranch_1_17_03/mptrack/version.h
branches/devBranch_1_17_03/soundlib/LOAD_DMF.CPP
branches/devBranch_1_17_03/soundlib/Mmx_mix.cpp
branches/devBranch_1_17_03/soundlib/Snd_fx.cpp
branches/devBranch_1_17_03/soundlib/Sndfile.cpp
branches/devBranch_1_17_03/soundlib/Sndfile.h
branches/devBranch_1_17_03/soundlib/Sndmix.cpp
branches/devBranch_1_17_03/soundlib/mixplug.h
branches/devBranch_1_17_03/soundlib/modchannel.h
branches/devBranch_1_17_03/soundlib/modcommand.h
branches/devBranch_1_17_03/soundlib/modins.h
Modified: branches/devBranch_1_17_03/mptrack/CommandSet.cpp
===================================================================
--- branches/devBranch_1_17_03/mptrack/CommandSet.cpp 2008-08-17 11:30:18 UTC (rev 220)
+++ branches/devBranch_1_17_03/mptrack/CommandSet.cpp 2008-08-22 18:08:38 UTC (rev 221)
@@ -5,6 +5,15 @@
#include <stdio.h>
#include <stdlib.h>
+#define ENABLE_LOGGING 0
+
+#if(ENABLE_LOGGING)
+ //
+#else
+ #define Log
+#endif
+
+
bool CCommandSet::s_bShowErrorOnUnknownKeybinding = true;
CCommandSet::CCommandSet(void)
@@ -2289,6 +2298,16 @@
commands[kcVSTGUINextPresetJump].isDummy = false;
commands[kcVSTGUINextPresetJump].Message = "Plugin preset forward jump";
+ commands[kcNotePC].UID = 1784;
+ commands[kcNotePC].isHidden = false;
+ commands[kcNotePC].isDummy = false;
+ commands[kcNotePC].Message = "Parameter control(MPTm only)";
+
+ commands[kcNotePCS].UID = 1785;
+ commands[kcNotePCS].isHidden = false;
+ commands[kcNotePCS].isDummy = false;
+ commands[kcNotePCS].Message = "Parameter control(smooth)(MPTm only)";
+
#ifdef _DEBUG
for (int i=0; i<kcNumCommands; i++) {
if (commands[i].UID != 0) { // ignore unset UIDs
Modified: branches/devBranch_1_17_03/mptrack/CommandSet.h
===================================================================
--- branches/devBranch_1_17_03/mptrack/CommandSet.h 2008-08-17 11:30:18 UTC (rev 220)
+++ branches/devBranch_1_17_03/mptrack/CommandSet.h 2008-08-22 18:08:38 UTC (rev 221)
@@ -431,7 +431,9 @@
kcNoteOff,
kcNoteCutOld,
kcNoteOffOld,
- kcEndNoteMisc=kcNoteOffOld,
+ kcNotePC,
+ kcNotePCS,
+ kcEndNoteMisc=kcNotePCS,
//Set instruments
Modified: branches/devBranch_1_17_03/mptrack/Ctrl_ins.cpp
===================================================================
--- branches/devBranch_1_17_03/mptrack/Ctrl_ins.cpp 2008-08-17 11:30:18 UTC (rev 220)
+++ branches/devBranch_1_17_03/mptrack/Ctrl_ins.cpp 2008-08-22 18:08:38 UTC (rev 221)
@@ -822,11 +822,7 @@
// Pitch/Pan Separation
m_SpinPPS.SetRange(-32, +32);
// Pitch/Pan Center
- for (UINT n=0; n<=NOTE_MAX; n++)
- {
- wsprintf(s, "%s%d", szNoteNames[n % 12], n/12);
- m_ComboPPC.SetItemData(m_ComboPPC.AddString(s), n);
- }
+ AppendNotesToControl(m_ComboPPC, 0, NOTE_MAX-1);
// -> CODE#0027
// -> DESC="per-instrument volume ramping setup (refered as attack)"
Modified: branches/devBranch_1_17_03/mptrack/Ctrl_pat.cpp
===================================================================
--- branches/devBranch_1_17_03/mptrack/Ctrl_pat.cpp 2008-08-17 11:30:18 UTC (rev 220)
+++ branches/devBranch_1_17_03/mptrack/Ctrl_pat.cpp 2008-08-22 18:08:38 UTC (rev 221)
@@ -189,11 +189,8 @@
//CHAR s[8];
CHAR s[10];
- for(int i = 0 ; i < NOTE_MAX ; i++){
- wsprintf(s, "%s%d", szNoteNames[i % 12], i/12);
- int n = m_CbnSplitNote.AddString(s);
- m_CbnSplitNote.SetItemData(n, i);
- }
+ AppendNotesToControl(m_CbnSplitNote, 0, NOTE_MAX - 1);
+
m_nSplitInstrument = 0;
m_nSplitNote = 60;
m_CbnSplitNote.SetCurSel(m_nSplitNote);
Modified: branches/devBranch_1_17_03/mptrack/Ctrl_smp.cpp
===================================================================
--- branches/devBranch_1_17_03/mptrack/Ctrl_smp.cpp 2008-08-17 11:30:18 UTC (rev 220)
+++ branches/devBranch_1_17_03/mptrack/Ctrl_smp.cpp 2008-08-22 18:08:38 UTC (rev 221)
@@ -235,13 +235,9 @@
m_SpinVibSweep.SetRange(0, 64);
m_SpinVibDepth.SetRange(0, 64);
m_SpinVibRate.SetRange(0, 64);
- for (UINT i=BASENOTE_MIN; i<BASENOTE_MAX; i++)
- {
- CHAR s[32];
- wsprintf(s, "%s%d", szNoteNames[i%12], i/12);
- m_CbnBaseNote.AddString(s);
- }
+ AppendNotesToControl(m_CbnBaseNote, BASENOTE_MIN, BASENOTE_MAX-1);
+
// -> CODE#0029
// -> DESC="pitch shifting - time stretching"
CHAR str[16];
Modified: branches/devBranch_1_17_03/mptrack/Draw_pat.cpp
===================================================================
--- branches/devBranch_1_17_03/mptrack/Draw_pat.cpp 2008-08-17 11:30:18 UTC (rev 220)
+++ branches/devBranch_1_17_03/mptrack/Draw_pat.cpp 2008-08-22 18:08:38 UTC (rev 221)
@@ -329,7 +329,15 @@
{
m_Dib.TextBlt(x, y, dx, COLUMN_HEIGHT, xsrc, ysrc + 14*COLUMN_HEIGHT);
} else
+ if(note >= NOTE_PC)
{
+ m_Dib.TextBlt(x, y, dx, COLUMN_HEIGHT, xsrc, ysrc + 15*COLUMN_HEIGHT);
+ } else
+ if(note >= NOTE_PCS)
+ {
+ m_Dib.TextBlt(x, y, dx, COLUMN_HEIGHT, xsrc, ysrc + 16*COLUMN_HEIGHT);
+ } else
+ {
if(pTuning)
{ // Drawing custom note names
string noteStr = pTuning->GetNoteName(note-NOTE_MIDDLEC);
@@ -387,24 +395,40 @@
}
-void CViewPattern::DrawVolumeCommand(int x, int y, UINT volcmd, UINT vol)
-//-----------------------------------------------------------------------
+void CViewPattern::DrawVolumeCommand(int x, int y, const MODCOMMAND mc)
+//---------------------------------------------------------------------
{
PCPATTERNFONT pfnt = GetCurrentPatternFont();
- if (volcmd)
- {
- volcmd &= 0x0F;
- vol &= 0x7F;
- m_Dib.TextBlt(x, y, pfnt->nVolCmdWidth, COLUMN_HEIGHT,
- pfnt->nVolX, pfnt->nVolY+volcmd*COLUMN_HEIGHT);
+
+ if(mc.note == NOTE_PCS || mc.note == NOTE_PC)
+ { //If note is parameter control 'note', drawing volume command differently.
+ const int val = min(MODCOMMAND::maxColumnValue, mc.GetValueVolCol());
+
+ m_Dib.TextBlt(x, y, 1, COLUMN_HEIGHT, pfnt->nClrX, pfnt->nClrY);
+ m_Dib.TextBlt(x + 1, y, pfnt->nVolCmdWidth, COLUMN_HEIGHT,
+ pfnt->nNumX, pfnt->nNumY+(val / 100)*COLUMN_HEIGHT);
m_Dib.TextBlt(x+pfnt->nVolCmdWidth, y, pfnt->nVolHiWidth, COLUMN_HEIGHT,
- pfnt->nNumX, pfnt->nNumY+(vol / 10)*COLUMN_HEIGHT);
+ pfnt->nNumX, pfnt->nNumY+((val / 10)%10)*COLUMN_HEIGHT);
m_Dib.TextBlt(x+pfnt->nVolCmdWidth+pfnt->nVolHiWidth, y, pfnt->nEltWidths[2]-(pfnt->nVolCmdWidth+pfnt->nVolHiWidth), COLUMN_HEIGHT,
- pfnt->nNumX, pfnt->nNumY+(vol % 10)*COLUMN_HEIGHT);
- } else
+ pfnt->nNumX, pfnt->nNumY+(val % 10)*COLUMN_HEIGHT);
+ }
+ else
{
- int srcx = pfnt->nEltWidths[0] + pfnt->nEltWidths[1];
- m_Dib.TextBlt(x, y, pfnt->nEltWidths[2], COLUMN_HEIGHT, pfnt->nClrX+srcx, pfnt->nClrY);
+ if (mc.volcmd)
+ {
+ const int volcmd = (mc.volcmd & 0x0F);
+ const int vol = (mc.vol & 0x7F);
+ m_Dib.TextBlt(x, y, pfnt->nVolCmdWidth, COLUMN_HEIGHT,
+ pfnt->nVolX, pfnt->nVolY+volcmd*COLUMN_HEIGHT);
+ m_Dib.TextBlt(x+pfnt->nVolCmdWidth, y, pfnt->nVolHiWidth, COLUMN_HEIGHT,
+ pfnt->nNumX, pfnt->nNumY+(vol / 10)*COLUMN_HEIGHT);
+ m_Dib.TextBlt(x+pfnt->nVolCmdWidth+pfnt->nVolHiWidth, y, pfnt->nEltWidths[2]-(pfnt->nVolCmdWidth+pfnt->nVolHiWidth), COLUMN_HEIGHT,
+ pfnt->nNumX, pfnt->nNumY+(vol % 10)*COLUMN_HEIGHT);
+ } else
+ {
+ int srcx = pfnt->nEltWidths[0] + pfnt->nEltWidths[1];
+ m_Dib.TextBlt(x, y, pfnt->nEltWidths[2], COLUMN_HEIGHT, pfnt->nClrX+srcx, pfnt->nClrY);
+ }
}
}
@@ -780,8 +804,19 @@
MODCOMMAND *mold = m - ncols;
if (m->note == mold->note) dwSpeedUpMask |= 0x01;
if ((m->instr == mold->instr) || (m_nDetailLevel < 1)) dwSpeedUpMask |= 0x02;
- if (((m->volcmd == mold->volcmd) && ((!m->volcmd) || (m->vol == mold->vol))) || (m_nDetailLevel < 2)) dwSpeedUpMask |= 0x04;
- if ((m->command == mold->command) || (m_nDetailLevel < 3)) dwSpeedUpMask |= (m->command) ? 0x08 : 0x18;
+ if ( m->note == NOTE_PCS || m->note == NOTE_PC || mold->note == NOTE_PCS || mold->note == NOTE_PC )
+ { // Handle speedup mask for PC notes.
+ if(m->note == mold->note)
+ {
+ if(m->GetValueVolCol() == mold->GetValueVolCol() || (m_nDetailLevel < 2)) dwSpeedUpMask |= 0x04;
+ if(m->GetValueEffectCol() == mold->GetValueEffectCol() || (m_nDetailLevel < 3)) dwSpeedUpMask |= 0x18;
+ }
+ }
+ else
+ {
+ if (((m->volcmd == mold->volcmd) && ((!m->volcmd) || (m->vol == mold->vol))) || (m_nDetailLevel < 2)) dwSpeedUpMask |= 0x04;
+ if ((m->command == mold->command) || (m_nDetailLevel < 3)) dwSpeedUpMask |= (m->command) ? 0x08 : 0x18;
+ }
if (dwSpeedUpMask == 0x1F) goto DoBlit;
}
bColSel[col] |= 0x40;
@@ -857,7 +892,7 @@
tx_col = MODCOLOR_TEXTSELECTED;
bk_col = MODCOLOR_BACKSELECTED;
} else
- if ((m->volcmd) && (CMainFrame::m_dwPatternSetup & PATTERN_EFFECTHILIGHT))
+ if (m->note != NOTE_PCS && m->note != NOTE_PC && (m->volcmd) && (CMainFrame::m_dwPatternSetup & PATTERN_EFFECTHILIGHT))
{
switch(m->volcmd)
{
@@ -886,15 +921,18 @@
}
// Drawing Volume
m_Dib.SetTextColor(tx_col, bk_col);
- DrawVolumeCommand(xbmp+x, 0, m->volcmd, m->vol);
+ DrawVolumeCommand(xbmp+x, 0, *m);
}
x += pfnt->nEltWidths[2];
}
// Command & param
if (m_nDetailLevel > 2)
{
+ const bool isPCnote = (m->note == NOTE_PC || m->note == NOTE_PCS);
+ uint16 val = m->GetValueEffectCol();
+ if(val > MODCOMMAND::maxColumnValue) val = MODCOMMAND::maxColumnValue;
fx_col = row_col;
- if ((m->command) && (m->command < MAX_EFFECTS) && (CMainFrame::m_dwPatternSetup & PATTERN_EFFECTHILIGHT))
+ if (!isPCnote && (m->command) && (m->command < MAX_EFFECTS) && (CMainFrame::m_dwPatternSetup & PATTERN_EFFECTHILIGHT))
{
switch(gEffectColors[m->command])
{
@@ -921,17 +959,26 @@
tx_col = MODCOLOR_TEXTSELECTED;
bk_col = MODCOLOR_BACKSELECTED;
}
+
// Drawing Command
m_Dib.SetTextColor(tx_col, bk_col);
- if (m->command)
+ if(isPCnote)
{
- UINT command = m->command & 0x3F;
- int n = (pSndFile->m_nType & (MOD_TYPE_MOD|MOD_TYPE_XM)) ? gszModCommands[command] : gszS3mCommands[command];
- if (n <= ' ') n = '?';
- DrawLetter(xbmp+x, 0, (char)n, pfnt->nEltWidths[3], pfnt->nCmdOfs);
- } else
+ m_Dib.TextBlt(xbmp + x, 0, 2, COLUMN_HEIGHT, pfnt->nClrX+x, pfnt->nClrY);
+ m_Dib.TextBlt(xbmp + x + 2, 0, pfnt->nEltWidths[3], m_szCell.cy, pfnt->nNumX, pfnt->nNumY+(val / 100)*COLUMN_HEIGHT);
+ }
+ else
{
- m_Dib.TextBlt(xbmp+x, 0, pfnt->nEltWidths[3], COLUMN_HEIGHT, pfnt->nClrX+x, pfnt->nClrY);
+ if (m->command)
+ {
+ UINT command = m->command & 0x3F;
+ int n = (pSndFile->m_nType & (MOD_TYPE_MOD|MOD_TYPE_XM)) ? gszModCommands[command] : gszS3mCommands[command];
+ if (n <= ' ') n = '?';
+ DrawLetter(xbmp+x, 0, (char)n, pfnt->nEltWidths[3], pfnt->nCmdOfs);
+ } else
+ {
+ m_Dib.TextBlt(xbmp+x, 0, pfnt->nEltWidths[3], COLUMN_HEIGHT, pfnt->nClrX+x, pfnt->nClrY);
+ }
}
}
x += pfnt->nEltWidths[3];
@@ -945,15 +992,24 @@
tx_col = MODCOLOR_TEXTSELECTED;
bk_col = MODCOLOR_BACKSELECTED;
}
+
// Drawing param
m_Dib.SetTextColor(tx_col, bk_col);
- if (m->command)
+ if(isPCnote)
{
- m_Dib.TextBlt(xbmp+x, 0, pfnt->nParamHiWidth, m_szCell.cy, pfnt->nNumX, pfnt->nNumY+(m->param >> 4)*COLUMN_HEIGHT);
- m_Dib.TextBlt(xbmp+x+pfnt->nParamHiWidth, 0, pfnt->nEltWidths[4]-pfnt->nParamHiWidth, m_szCell.cy, pfnt->nNumX+1, pfnt->nNumY+(m->param & 0x0F)*COLUMN_HEIGHT);
- } else
+ m_Dib.TextBlt(xbmp + x, 0, pfnt->nParamHiWidth, m_szCell.cy, pfnt->nNumX, pfnt->nNumY+((val / 10) % 10)*COLUMN_HEIGHT);
+ m_Dib.TextBlt(xbmp + x + pfnt->nParamHiWidth, 0, pfnt->nEltWidths[4]-pfnt->nParamHiWidth, m_szCell.cy, pfnt->nNumX+1, pfnt->nNumY+(val % 10)*COLUMN_HEIGHT);
+ }
+ else
{
- m_Dib.TextBlt(xbmp+x, 0, pfnt->nEltWidths[4], m_szCell.cy, pfnt->nClrX+x, pfnt->nClrY);
+ if (m->command)
+ {
+ m_Dib.TextBlt(xbmp+x, 0, pfnt->nParamHiWidth, m_szCell.cy, pfnt->nNumX, pfnt->nNumY+(m->param >> 4)*COLUMN_HEIGHT);
+ m_Dib.TextBlt(xbmp+x+pfnt->nParamHiWidth, 0, pfnt->nEltWidths[4]-pfnt->nParamHiWidth, m_szCell.cy, pfnt->nNumX+1, pfnt->nNumY+(m->param & 0x0F)*COLUMN_HEIGHT);
+ } else
+ {
+ m_Dib.TextBlt(xbmp+x, 0, pfnt->nEltWidths[4], m_szCell.cy, pfnt->nClrX+x, pfnt->nClrY);
+ }
}
}
}
@@ -1396,59 +1452,65 @@
pMainFrm->SetUserText(s);
if (::GetFocus() == m_hWnd)
{
- nChn = (m_dwCursor & 0xFFFF) >> 3;
+ nChn = GetChanFromCursor(m_dwCursor);
s[0] = 0;
if ((!(m_dwStatus & (PATSTATUS_KEYDRAGSEL/*|PATSTATUS_MOUSEDRAGSEL*/))) //rewbs.xinfo: update indicator even when dragging
&& (m_dwBeginSel == m_dwEndSel) && (pSndFile->Patterns[m_nPattern])
&& (m_nRow < pSndFile->PatternSize[m_nPattern]) && (nChn < pSndFile->m_nChannels))
{
MODCOMMAND *m = &pSndFile->Patterns[m_nPattern][m_nRow*pSndFile->m_nChannels+nChn];
- switch (m_dwCursor & 7)
+
+ //For now, ignore update if using PC or PCs notes because instrument, volcol and effect values
+ //are meaningless for these notes.
+ if(m->note != NOTE_PC && m->note != NOTE_PCS)
{
- case 1:
- if (m->instr)
+ switch (GetColTypeFromCursor(m_dwCursor))
{
- CHAR sztmp[128] = "";
- if (pSndFile->m_nInstruments)
+ case 1:
+ if (m->instr)
{
- if ((m->instr <= pSndFile->m_nInstruments) && (pSndFile->Headers[m->instr]))
+ CHAR sztmp[128] = "";
+ if (pSndFile->m_nInstruments)
{
- INSTRUMENTHEADER *penv = pSndFile->Headers[m->instr];
- memcpy(sztmp, penv->name, 32);
- sztmp[32] = 0;
- if ((m->note) && (m->note <= NOTE_MAX))
+ if ((m->instr <= pSndFile->m_nInstruments) && (pSndFile->Headers[m->instr]))
{
- UINT nsmp = penv->Keyboard[m->note-1];
- if ((nsmp) && (nsmp <= pSndFile->m_nSamples))
+ INSTRUMENTHEADER *penv = pSndFile->Headers[m->instr];
+ memcpy(sztmp, penv->name, 32);
+ sztmp[32] = 0;
+ if ((m->note) && (m->note <= NOTE_MAX))
{
- CHAR sztmp2[64] = "";
- memcpy(sztmp2, pSndFile->m_szNames[nsmp], 32);
- sztmp2[32] = 0;
- if (sztmp2[0])
+ UINT nsmp = penv->Keyboard[m->note-1];
+ if ((nsmp) && (nsmp <= pSndFile->m_nSamples))
{
- wsprintf(sztmp+strlen(sztmp), " (%d: %s)", nsmp, sztmp2);
+ CHAR sztmp2[64] = "";
+ memcpy(sztmp2, pSndFile->m_szNames[nsmp], 32);
+ sztmp2[32] = 0;
+ if (sztmp2[0])
+ {
+ wsprintf(sztmp+strlen(sztmp), " (%d: %s)", nsmp, sztmp2);
+ }
}
}
}
- }
- } else
- {
- if (m->instr <= pSndFile->m_nSamples)
+ } else
{
- memcpy(sztmp, pSndFile->m_szNames[m->instr], 32);
- sztmp[32] = 0;
+ if (m->instr <= pSndFile->m_nSamples)
+ {
+ memcpy(sztmp, pSndFile->m_szNames[m->instr], 32);
+ sztmp[32] = 0;
+ }
}
+ if (sztmp[0]) wsprintf(s, "%d: %s", m->instr, sztmp);
}
- if (sztmp[0]) wsprintf(s, "%d: %s", m->instr, sztmp);
+ break;
+ case 2:
+ if (!pModDoc->GetVolCmdInfo(pModDoc->GetIndexFromVolCmd(m->volcmd), s)) s[0] = 0;
+ break;
+ case 3:
+ case 4:
+ if (!pModDoc->GetEffectName(s, m->command, m->param, FALSE, nChn)) s[0] = 0;
+ break;
}
- break;
- case 2:
- if (!pModDoc->GetVolCmdInfo(pModDoc->GetIndexFromVolCmd(m->volcmd), s)) s[0] = 0;
- break;
- case 3:
- case 4:
- if (!pModDoc->GetEffectName(s, m->command, m->param, FALSE, nChn)) s[0] = 0;
- break;
}
}
pMainFrm->SetInfoText(s);
Modified: branches/devBranch_1_17_03/mptrack/Modedit.cpp
===================================================================
--- branches/devBranch_1_17_03/mptrack/Modedit.cpp 2008-08-17 11:30:18 UTC (rev 220)
+++ branches/devBranch_1_17_03/mptrack/Modedit.cpp 2008-08-22 18:08:38 UTC (rev 221)
@@ -19,7 +19,19 @@
#define str_mptm_conversion_warning GetStrI18N(_TEXT("Conversion from mptm to any other moduletype may makes certain features unavailable and is not guaranteed to work properly. Do the conversion anyway?"))
+const size_t Pow10Table[10] = {1, 10, 100, 1000, 10000, 100000, 1000000, 10000000, 100000000, 1000000000};
+// Return D'th digit(character) of given value.
+// GetDigit<0>(123) == '3'
+// GetDigit<1>(123) == '2'
+// GetDigit<2>(123) == '1'
+template<BYTE D>
+inline TCHAR GetDigit(const size_t val)
+{
+ return (D > 9) ? '0' : 48 + ((val / Pow10Table[D]) % 10);
+}
+
+
//////////////////////////////////////////////////////////////////////
// Module type conversion
@@ -1492,6 +1504,8 @@
case 0: p[1] = p[2] = p[3] = '.'; break;
case NOTE_KEYOFF: p[1] = p[2] = p[3] = '='; break;
case NOTE_NOTECUT: p[1] = p[2] = p[3] = '^'; break;
+ case NOTE_PC: p[1] = 'P'; p[2] = 'C'; p[3] = ' '; break;
+ case NOTE_PCS: p[1] = 'P'; p[2] = 'C'; p[3] = 'S'; break;
default:
p[1] = szNoteNames[(note-1) % 12][0];
p[2] = szNoteNames[(note-1) % 12][1];
@@ -1519,12 +1533,22 @@
ncursor++;
if ((ncursor >= colmin) && (ncursor <= colmax))
{
- if ((m->volcmd) && (m->volcmd <= MAX_VOLCMDS))
+ if(m->note == NOTE_PC || m->note == NOTE_PCS)
{
- p[6] = gszVolCommands[m->volcmd];
- p[7] = '0' + (m->vol / 10);
- p[8] = '0' + (m->vol % 10);
- } else p[6] = p[7] = p[8] = '.';
+ const uint16 val = m->GetValueVolCol();
+ p[6] = GetDigit<2>(val);
+ p[7] = GetDigit<1>(val);
+ p[8] = GetDigit<0>(val);
+ }
+ else
+ {
+ if ((m->volcmd) && (m->volcmd <= MAX_VOLCMDS))
+ {
+ p[6] = gszVolCommands[m->volcmd];
+ p[7] = '0' + (m->vol / 10);
+ p[8] = '0' + (m->vol % 10);
+ } else p[6] = p[7] = p[8] = '.';
+ }
} else
{
p[6] = p[7] = p[8] = ' ';
@@ -1534,18 +1558,28 @@
if (((ncursor >= colmin) && (ncursor <= colmax))
|| ((ncursor+1 >= colmin) && (ncursor+1 <= colmax)))
{
- if (m->command)
+ if(m->note == NOTE_PC || m->note == NOTE_PCS)
{
- if (m_SndFile.m_nType & (MOD_TYPE_S3M|MOD_TYPE_IT|MOD_TYPE_MPT))
- p[9] = gszS3mCommands[m->command];
- else
- p[9] = gszModCommands[m->command];
- } else p[9] = '.';
- if (m->param)
+ const uint16 val = m->GetValueEffectCol();
+ p[9] = GetDigit<2>(val);
+ p[10] = GetDigit<1>(val);
+ p[11] = GetDigit<0>(val);
+ }
+ else
{
- p[10] = szHexChar[m->param >> 4];
- p[11] = szHexChar[m->param & 0x0F];
- } else p[10] = p[11] = '.';
+ if (m->command)
+ {
+ if (m_SndFile.m_nType & (MOD_TYPE_S3M|MOD_TYPE_IT|MOD_TYPE_MPT))
+ p[9] = gszS3mCommands[m->command];
+ else
+ p[9] = gszModCommands[m->command];
+ } else p[9] = '.';
+ if (m->param)
+ {
+ p[10] = szHexChar[m->param >> 4];
+ p[11] = szHexChar[m->param & 0x0F];
+ } else p[10] = p[11] = '.';
+ }
} else
{
p[9] = p[10] = p[11] = ' ';
@@ -1636,6 +1670,13 @@
m[col].note = 0;
if (s[0] == '=') m[col].note = NOTE_KEYOFF; else
if (s[0] == '^') m[col].note = NOTE_NOTECUT; else
+ if (s[0] == 'P')
+ {
+ if(s[2] == 'S')
+ m[col].note = NOTE_PCS;
+ else
+ m[col].note = NOTE_PC;
+ } else
if (s[0] != '.')
{
for (UINT i=0; i<12; i++)
@@ -1663,68 +1704,92 @@
{
if (s[5] != '.')
{
- m[col].volcmd = 0;
- for (UINT i=1; i<MAX_VOLCMDS; i++)
+ if(m[col].note == NOTE_PCS || m[col].note == NOTE_PC)
{
- if (s[5] == gszVolCommands[i])
+ char val[4];
+ memcpy(val, s+5, 3);
+ val[3] = 0;
+ m[col].SetValueVolCol(ConvertStrTo<uint16>(val));
+ }
+ else
+ {
+ m[col].volcmd = 0;
+ for (UINT i=1; i<MAX_VOLCMDS; i++)
{
- m[col].volcmd = i;
- break;
+ if (s[5] == gszVolCommands[i])
+ {
+ m[col].volcmd = i;
+ break;
+ }
}
+ m[col].vol = (s[6]-'0')*10 + (s[7]-'0');
}
- m[col].vol = (s[6]-'0')*10 + (s[7]-'0');
} else m[col].volcmd = m[col].vol = 0;
}
- if (s[8] > ' ' && (!mix || ((!ITStyleMix && origModCmd.command==0) ||
- (ITStyleMix && origModCmd.command==0 && origModCmd.param==0))))
+
+ if(m[col].note == NOTE_PCS || m[col].note == NOTE_PC)
{
- m[col].command = 0;
- if (s[8] != '.')
+ if(s[8] != '.')
{
- LPCSTR psc = (bS3M) ? gszS3mCommands : gszModCommands;
- for (UINT i=1; i<MAX_EFFECTS; i++)
- {
- if ((s[8] == psc[i]) && (psc[i] != '?')) m[col].command = i;
- }
+ char val[4];
+ memcpy(val, s+8, 3);
+ val[3] = 0;
+ m[col].SetValueEffectCol(ConvertStrTo<uint16>(val));
}
}
- // Effect value
- if (s[9] > ' ' && (!mix || ((!ITStyleMix && origModCmd.param==0) ||
- (ITStyleMix && origModCmd.command==0 && origModCmd.param==0))))
+ else
{
- m[col].param = 0;
- if (s[9] != '.')
+ if (s[8] > ' ' && (!mix || ((!ITStyleMix && origModCmd.command==0) ||
+ (ITStyleMix && origModCmd.command==0 && origModCmd.param==0))))
{
- for (UINT i=0; i<16; i++)
+ m[col].command = 0;
+ if (s[8] != '.')
{
- if (s[9] == szHexChar[i]) m[col].param |= (i<<4);
- if (s[10] == szHexChar[i]) m[col].param |= i;
+ LPCSTR psc = (bS3M) ? gszS3mCommands : gszModCommands;
+ for (UINT i=1; i<MAX_EFFECTS; i++)
+ {
+ if ((s[8] == psc[i]) && (psc[i] != '?')) m[col].command = i;
+ }
}
}
- }
- // Checking command
- if (m_SndFile.m_nType & (MOD_TYPE_MOD|MOD_TYPE_XM))
- {
- switch (m[col].command)
+ // Effect value
+ if (s[9] > ' ' && (!mix || ((!ITStyleMix && origModCmd.param==0) ||
+ (ITStyleMix && origModCmd.command==0 && origModCmd.param==0))))
{
- case CMD_SPEED:
- case CMD_TEMPO:
- if (!bS3M) m[col].command = (m[col].param <= spdmax) ? CMD_SPEED : CMD_TEMPO;
- else
+ m[col].param = 0;
+ if (s[9] != '.')
{
- if ((m[col].command == CMD_SPEED) && (m[col].param > spdmax)) m[col].param = CMD_TEMPO; else
- if ((m[col].command == CMD_TEMPO) && (m[col].param <= spdmax)) m[col].param = CMD_SPEED;
+ for (UINT i=0; i<16; i++)
+ {
+ if (s[9] == szHexChar[i]) m[col].param |= (i<<4);
+ if (s[10] == szHexChar[i]) m[col].param |= i;
+ }
}
- break;
}
- } else
- {
- switch (m[col].command)
+ // Checking command
+ if (m_SndFile.m_nType & (MOD_TYPE_MOD|MOD_TYPE_XM))
{
- case CMD_SPEED:
- case CMD_TEMPO:
- if (!bS3M) m[col].command = (m[col].param <= spdmax) ? CMD_SPEED : CMD_TEMPO;
- break;
+ switch (m[col].command)
+ {
+ case CMD_SPEED:
+ case CMD_TEMPO:
+ if (!bS3M) m[col].command = (m[col].param <= spdmax) ? CMD_SPEED : CMD_TEMPO;
+ else
+ {
+ if ((m[col].command == CMD_SPEED) && (m[col].param > spdmax)) m[col].param = CMD_TEMPO; else
+ if ((m[col].command == CMD_TEMPO) && (m[col].param <= spdmax)) m[col].param = CMD_SPEED;
+ }
+ break;
+ }
+ } else
+ {
+ switch (m[col].command)
+ {
+ case CMD_SPEED:
+ case CMD_TEMPO:
+ if (!bS3M) m[col].command = (m[col].param <= spdmax) ? CMD_SPEED : CMD_TEMPO;
+ break;
+ }
}
}
}
Modified: branches/devBranch_1_17_03/mptrack/Mptrack.cpp
===================================================================
--- branches/devBranch_1_17_03/mptrack/Mptrack.cpp 2008-08-17 11:30:18 UTC (rev 220)
+++ branches/devBranch_1_17_03/mptrack/Mptrack.cpp 2008-08-22 18:08:38 UTC (rev 221)
@@ -172,6 +172,19 @@
"F#", "G-", "G#", "A-", "A#", "B-"
};
+LPCSTR szDefaultNoteNames[NOTE_MAX] = {
+ "C-0", "C#0", "D-0", "D#0", "E-0", "F-0", "F#0", "G-0", "G#0", "A-0", "A#0", "B-0",
+ "C-1", "C#1", "D-1", "D#1", "E-1", "F-1", "F#1", "G-1", "G#1", "A-1", "A#1", "B-1",
+ "C-2", "C#2", "D-2", "D#2", "E-2", "F-2", "F#2", "G-2", "G#2", "A-2", "A#2", "B-2",
+ "C-3", "C#3", "D-3", "D#3", "E-3", "F-3", "F#3", "G-3", "G#3", "A-3", "A#3", "B-3",
+ "C-4", "C#4", "D-4", "D#4", "E-4", "F-4", "F#4", "G-4", "G#4", "A-4", "A#4", "B-4",
+ "C-5", "C#5", "D-5", "D#5", "E-5", "F-5", "F#5", "G-5", "G#5", "A-5", "A#5", "B-5",
+ "C-6", "C#6", "D-6", "D#6", "E-6", "F-6", "F#6", "G-6", "G#6", "A-6", "A#6", "B-6",
+ "C-7", "C#7", "D-7", "D#7", "E-7", "F-7", "F#7", "G-7", "G#7", "A-7", "A#7", "B-7",
+ "C-8", "C#8", "D-8", "D#8", "E-8", "F-8", "F#8", "G-8", "G#8", "A-8", "A#8", "B-8",
+ "C-9", "C#9", "D-9", "D#9", "E-9", "F-9", "F#9", "G-9", "G#9", "A-9", "A#9", "B-9",
+};
+
LPCSTR szHexChar = "0123456789ABCDEF";
LPCSTR gszModCommands = " 0123456789ABCDRFFTE???GHK?YXPLZ\\:#"; //rewbs.smoothVST: added last \ (written as \\); rewbs.velocity: added last :
LPCSTR gszS3mCommands = " JFEGHLKRXODB?CQATI?SMNVW?UY?P?Z\\:#"; //rewbs.smoothVST: added last \ (written as \\); rewbs.velocity: added last :
@@ -663,7 +676,7 @@
m_pDocManager = new CModDocManager();
#ifdef _DEBUG
- // ASSERT((sizeof(MODCHANNEL)&7) == 0);
+ ASSERT((sizeof(MODCHANNEL)&7) == 0);
// Disabled by rewbs for smoothVST. Might cause minor perf issues due to increased cache misses?
#endif
@@ -1082,15 +1095,12 @@
void CTrackApp::LoadChords(PMPTCHORD pChords)
//-------------------------------------------
-{
- CHAR snam[32];
-
+{
if (!m_szConfigFileName[0]) return;
for (UINT i=0; i<3*12; i++)
{
LONG chord;
- wsprintf(snam, "%s%d", szNoteNames[i%12], i/12);
- if ((chord = GetPrivateProfileInt("Chords", snam, -1, m_szConfigFileName)) >= 0)
+ if ((chord = GetPrivateProfileInt("Chords", szDefaultNoteNames[i], -1, m_szConfigFileName)) >= 0)
{
if ((chord & 0xFFFFFFC0) || (!pChords[i].notes[0]))
{
@@ -1107,14 +1117,13 @@
void CTrackApp::SaveChords(PMPTCHORD pChords)
//-------------------------------------------
{
- CHAR s[64], snam[32];
+ CHAR s[64];
if (!m_szConfigFileName[0]) return;
for (UINT i=0; i<3*12; i++)
{
- wsprintf(snam, "%s%d", szNoteNames[i%12], i/12);
wsprintf(s, "%d", (pChords[i].key) | (pChords[i].notes[0] << 6) | (pChords[i].notes[1] << 12) | (pChords[i].notes[2] << 18));
- if (!WritePrivateProfileString("Chords", snam, s, m_szConfigFileName)) break;
+ if (!WritePrivateProfileString("Chords", szDefaultNoteNames[i], s, m_szConfigFileName)) break;
}
}
Modified: branches/devBranch_1_17_03/mptrack/Mptrack.h
===================================================================
--- branches/devBranch_1_17_03/mptrack/Mptrack.h 2008-08-17 11:30:18 UTC (rev 220)
+++ branches/devBranch_1_17_03/mptrack/Mptrack.h 2008-08-22 18:08:38 UTC (rev 221)
@@ -379,10 +379,25 @@
void Log(LPCSTR format,...);
UINT MsgBox(UINT nStringID, CWnd *p=NULL, LPCSTR lpszTitle=NULL, UINT n=MB_OK);
void ErrorBox(UINT nStringID, CWnd*p=NULL);
+
+// Helper function declarations.
void AddPluginNamesToCombobox(CComboBox& CBox, SNDMIXPLUGIN* plugarray, const bool librarynames = false);
void AddPluginParameternamesToCombobox(CComboBox& CBox, SNDMIXPLUGIN& plugarray);
void AddPluginParameternamesToCombobox(CComboBox& CBox, CVstPlugin& plug);
+// Append note names from zero-based range [noteStart, noteEnd] to given combobox.
+void AppendNotesToControl(CComboBox& combobox, const MODCOMMAND::NOTE noteStart, const MODCOMMAND::NOTE noteEnd);
+
+// Append note names to combobox. If pSndFile != nullPrt, appends only notes that are
+// available in the module type.
+void AppendNotesToControl(CComboBox& combobox, const CSoundFile* const pSndFile = nullptr);
+
+// Append note names of instrument iInstr in rSndFile to combobox.
+void AppendNotesToControl(CComboBox& combobox, const CSoundFile& rSndFile, const INSTRUMENTINDEX iInstr);
+
+// Returns note name(such as "C-5") of given note using note indecing [1, NOTE_MAX].
+const char* GetNoteStr(const MODCOMMAND::NOTE);
+
///////////////////////////////////////////////////
// Tables
#define MAX_EFFECTS 35 //rewbs.smoothVST & rewbs.velocity: increased from 32. Wonder what this will break...
@@ -391,6 +406,14 @@
extern BYTE gEffectColors[MAX_EFFECTS];
extern LPCSTR szNoteNames[12];
+extern LPCSTR szDefaultNoteNames[NOTE_MAX];
+LPCSTR const szSpecialNoteNames[NOTE_MAX_SPECIAL-NOTE_MIN_SPECIAL + 1] = {"PCs", "PC", "^^", "=="};
+LPCSTR const szSpecialNoteShortDesc[NOTE_MAX_SPECIAL-NOTE_MIN_SPECIAL + 1] = {"Param control(smooth)", "Param control", "Note Cut", "Note Off"};
+
+// Make sure that szSpecialNoteNames-array includes note string for every special note.
+STATIC_ASSERT(NOTE_MAX_SPECIAL - NOTE_MIN_SPECIAL + 1 == ARRAYELEMCOUNT(szSpecialNoteNames));
+STATIC_ASSERT(ARRAYELEMCOUNT(szSpecialNoteShortDesc) == ARRAYELEMCOUNT(szSpecialNoteNames));
+
extern LPCSTR szHexChar;
extern LPCSTR gszModCommands;
extern LPCSTR gszS3mCommands;
Modified: branches/devBranch_1_17_03/mptrack/View_pat.cpp
===================================================================
--- branches/devBranch_1_17_03/mptrack/View_pat.cpp 2008-08-17 11:30:18 UTC (rev 220)
+++ branches/devBranch_1_17_03/mptrack/View_pat.cpp 2008-08-22 18:08:38 UTC (rev 221)
@@ -23,9 +23,9 @@
#pragma warning(disable:4244) //"conversion from 'type1' to 'type2', possible loss of data"
-MODCOMMAND CViewPattern::m_cmdOld;
-MODCOMMAND CViewPattern::m_cmdFind;
-MODCOMMAND CViewPattern::m_cmdReplace;
+MODCOMMAND CViewPattern::m_cmdOld = {0,0,0,0,0,0};
+MODCOMMAND CViewPattern::m_cmdFind = {0,0,0,0,0,0};
+MODCOMMAND CViewPattern::m_cmdReplace = {0,0,0,0,0,0};
DWORD CViewPattern::m_dwFindFlags = 0;
DWORD CViewPattern::m_dwReplaceFlags = 0;
UINT CViewPattern::m_nFindMinChn = 0;
@@ -835,7 +835,7 @@
{
UINT chn = i >> 3;
MODCOMMAND *blank= &p[row * pSndFile->m_nChannels + chn];
- *blank = MODCOMMAND();
+ *blank = MODCOMMAND::Empty();
}
}
m_dwBeginSel = startSel;
@@ -872,6 +872,7 @@
PrepareUndo(m_dwBeginSel, m_dwEndSel);
DWORD tmp = m_dwEndSel;
+ bool invalidateAllCols = false;
for (UINT row=(m_dwBeginSel >> 16); row<=(m_dwEndSel >> 16); row++) { // for all selected rows
for (UINT i=(m_dwBeginSel & 0xFFFF); i<=(m_dwEndSel & 0xFFFF); i++) if ((i & 7) < 5) { // for all selected cols
@@ -882,8 +883,17 @@
switch(i & 7) {
case 0: // Clear note
if (rm.note) {
- m->note = 0;
- if (ITStyle) m->instr = 0;
+ if(m->note == NOTE_PCS || m->note == NOTE_PC)
+ { // Clear whole row if clearing PC note
+ m->Clear();
+ invalidateAllCols = true;
+ }
+ else
+ {
+ m->note = 0;
+ if (ITStyle) m->instr = 0;
+ }
+
}
break;
case 1: // Clear instrument
@@ -911,7 +921,17 @@
} //end selected columns
} //end selected rows
- if ((tmp & 7) == 3) tmp++;
+ // If selection ends on effect command column, extent invalidation area to
+ // effect param column as well.
+ if ((tmp & 7) == EFFECT_COLUMN)
+ tmp++;
+
+ // If invalidation on all columns is wanted, extent invalidation area.
+ if(invalidateAllCols)
+ tmp += LAST_COLUMN - (tmp % 8);
+
+ ASSERT(tmp % 8 <= LAST_COLUMN);
+
InvalidateArea(m_dwBeginSel, tmp);
pModDoc->SetModified();
pModDoc->UpdateAllViews(this, HINT_PATTERNDATA | (m_nPattern << HINT_SHIFT_PAT), NULL);
@@ -1774,7 +1794,7 @@
UINT ch = n % pSndFile->m_nChannels;
if ((ch < m_nFindMinChn) || (ch > m_nFindMaxChn)) bFound = FALSE;
}
- if (((m_dwFindFlags & PATSEARCH_NOTE) && ((m->note != m_cmdFind.note) && ((m_cmdFind.note != 0xFD) || (!m->note) || (m->note & 0x80))))
+ if (((m_dwFindFlags & PATSEARCH_NOTE) && ((m->note != m_cmdFind.note) && ((m_cmdFind.note != CFindReplaceTab::findAny) || (!m->note) || (m->note & 0x80))))
|| ((m_dwFindFlags & PATSEARCH_INSTR) && (m->instr != m_cmdFind.instr))
|| ((m_dwFindFlags & PATSEARCH_VOLCMD) && (m->volcmd != m_cmdFind.volcmd))
|| ((m_dwFindFlags & PATSEARCH_VOLUME) && (m->vol != m_cmdFind.vol))
@@ -1782,10 +1802,21 @@
|| ((m_dwFindFlags & PATSEARCH_PARAM) && (m->param != m_cmdFind.param)))
{
bFound = FALSE;
- } else
- if (((m_dwFindFlags & (PATSEARCH_COMMAND|PATSEARCH_PARAM)) == PATSEARCH_COMMAND) && (bEffectEx))
+ }
+ else
{
- if ((m->param & 0xF0) != (m_cmdFind.param & 0xF0)) bFound = FALSE;
+ if (((m_dwFindFlags & (PATSEARCH_COMMAND|PATSEARCH_PARAM)) == PATSEARCH_COMMAND) && (bEffectEx))
+ {
+ if ((m->param & 0xF0) != (m_cmdFind.param & 0xF0)) bFound = FALSE;
+ }
+
+ // Ignore modcommands with PC/PCS notes when searching from volume or effect column.
+ if( (m->note == NOTE_PC || m->note == NOTE_PCS)
+ &&
+ m_dwFindFlags & (PATSEARCH_VOLCMD|PATSEARCH_VOLUME|PATSEARCH_COMMAND|PATSEARCH_PARAM))
+ {
+ bFound = FALSE;
+ }
}
// Found!
if (bFound)
@@ -1828,22 +1859,22 @@
if ((m_dwReplaceFlags & PATSEARCH_NOTE))
{
// -1 octave
- if (m_cmdReplace.note == 0xFA)
+ if (m_cmdReplace.note == CFindReplaceTab::replaceMinusOctave)
{
if (m->note > 12) m->note -= 12;
} else
// +1 octave
- if (m_cmdReplace.note == 0xFB)
+ if (m_cmdReplace.note == CFindReplaceTab::replacePlusOctave)
{
- if (m->note <= 108) m->note += 12;
+ if (m->note <= NOTE_MAX - 12) m->note += 12;
} else
// Note--
- if (m_cmdReplace.note == 0xFC)
+ if (m_cmdReplace.note == CFindReplaceTab::replaceMinusOne)
{
if (m->note > 1) m->note--;
} else
// Note++
- if (m_cmdReplace.note == 0xFD)
+ if (m_cmdReplace.note == CFindReplaceTab::replacePlusOne)
{
if (m->note < NOTE_MAX) m->note++;
} else m->note = m_cmdReplace.note;
@@ -1851,12 +1882,12 @@
if ((m_dwReplaceFlags & PATSEARCH_INSTR))
{
// Instr--
- if (m_cmdReplace.instr == 0xFC)
+ if (m_cmdReplace.instr == CFindReplaceTab::replaceMinusOne)
{
if (m->instr > 1) m->instr--;
} else
// Instr++
- if (m_cmdReplace.instr == 0xFD)
+ if (m_cmdReplace.instr == CFindReplaceTab::replacePlusOne)
{
if (m->instr < MAX_INSTRUMENTS-1) m->instr++;
} else m->instr = m_cmdReplace.instr;
@@ -1896,11 +1927,7 @@
{
if (m_dwFindFlags & PATSEARCH_NOTE)
{
- UINT note = m_cmdFind.note;
- if (note == 0) strcpy(szFind, "..."); else
- if (note == 0xFE) strcpy(szFind, "^^ "); else
- if (note == 0xFF) strcpy(szFind, "== "); else
- wsprintf(szFind, "%s%d", szNoteNames[(note-1) % 12], (note-1)/12);
+ wsprintf(szFind, "%s", GetNoteStr(m_cmdFind.note));
} else strcpy(szFind, "???");
strcat(szFind, " ");
if (m_dwFindFlags & PATSEARCH_INSTR)
@@ -2024,7 +2051,6 @@
UINT nCursor = m_dwCursor & 0x07;
CSoundFile *pSndFile = pModDoc->GetSoundFile();
MODCOMMAND *p = pSndFile->Patterns[m_nPattern] + m_nRow*pSndFile->m_nChannels + nChn;
- MODCOMMAND oldcmd = *p;
switch(nCursor)
{
@@ -2156,7 +2182,6 @@
//for all channels where type is selected
for (int chnIdx=0; chnIdx<nValidChans; chnIdx++) {
- MODCOMMAND *pcmd = pSndFile->Patterns[m_nPattern];
UINT nchn = validChans[chnIdx];
UINT row0 = GetSelectionStartRow();
UINT row1 = GetSelectionEndRow();
@@ -2169,28 +2194,51 @@
PrepareUndo(m_dwBeginSel, m_dwEndSel);
}
- int vsrc, vdest, vcmd, verr, distance;
+ bool doPCinterpolation = false;
+
+ int vsrc, vdest, vcmd = 0, verr = 0, distance;
distance = row1 - row0;
+ const MODCOMMAND srcCmd = *pSndFile->Patterns[m_nPattern].GetpModCommand(row0, nchn);
+ const MODCOMMAND destCmd = *pSndFile->Patterns[m_nPattern].GetpModCommand(row1, nchn);
+
+ MODCOMMAND::NOTE PCnote = 0;
+ uint16 PCinst = 0, PCparam = 0;
+
switch(type) {
case NOTE_COLUMN:
- vsrc = pcmd[row0 * pSndFile->m_nChannels + nchn].note;
- vdest = pcmd[row1 * pSndFile->m_nChannels + nchn].note;
- vcmd = pcmd[row0 * pSndFile->m_nChannels + nchn].instr;
- verr = (distance * 59) / 120;
+ vsrc = srcCmd.note;
+ vdest = destCmd.note;
+ vcmd = srcCmd.instr;
+ verr = (distance * 59) / NOTE_MAX;
break;
case VOL_COLUMN:
- vsrc = pcmd[row0 * pSndFile->m_nChannels + nchn].vol;
- vdest = pcmd[row1 * pSndFile->m_nChannels + nchn].vol;
- vcmd = pcmd[row0 * pSndFile->m_nChannels + nchn].volcmd;
+ vsrc = srcCmd.vol;
+ vdest = destCmd.vol;
+ vcmd = srcCmd.volcmd;
verr = (distance * 63) / 128;
break;
case PARAM_COLUMN:
case EFFECT_COLUMN:
- vsrc = pcmd[row0 * pSndFile->m_nChannels + nchn].param;
- vdest = pcmd[row1 * pSndFile->m_nChannels + nchn].param;
- vcmd = pcmd[row0 * pSndFile->m_nChannels + nchn].command;
- verr = (distance * 63) / 128;
+ if(srcCmd.note == NOTE_PC || srcCmd.note == NOTE_PCS || destCmd.note == NOTE_PCS || destCmd.note == NOTE_PC)
+ {
+ doPCinterpolation = true;
+ PCnote = (srcCmd.note == NOTE_PC || srcCmd.note == NOTE_PCS) ? srcCmd.note : destCmd.note;
+ vsrc = srcCmd.GetValueEffectCol();
+ vdest = destCmd.GetValueEffectCol();
+ PCparam = srcCmd.GetValueVolCol();
+ if(PCparam == 0) PCparam = destCmd.GetValueVolCol();
+ PCinst = srcCmd.instr;
+ if(PCinst == 0)
+ PCinst = destCmd.instr;
+ }
+ else
+ {
+ vsrc = srcCmd.param;
+ vdest = destCmd.param;
+ vcmd = srcCmd.command;
+ verr = (distance * 63) / 128;
+ }
break;
default:
ASSERT(false);
@@ -2198,8 +2246,9 @@
}
if (vdest < vsrc) verr = -verr;
- pcmd += row0 * pSndFile->m_nChannels + nchn;
+ MODCOMMAND* pcmd = pSndFile->Patterns[m_nPattern].GetpModCommand(row0, nchn);
+
for (UINT i=0; i<=distance; i++, pcmd += pSndFile->m_nChannels) {
switch(type) {
@@ -2218,11 +2267,23 @@
}
break;
case EFFECT_COLUMN:
- if ((!pcmd->command) || (pcmd->command == vcmd)) {
- int val = vsrc + ((vdest - vsrc) * (int)i + verr) / distance;
- pcmd->param = (BYTE)val;
- pcmd->command = vcmd;
+ if(doPCinterpolation)
+ { // With PC/PCs notes, copy PCs note and plug index to all rows where
+ // effect interpolation is done.
+ const uint16 val = static_cast<uint16>(vsrc + i * float(vdest - vsrc) / distance);
+ pcmd->note = PCnote;
+ pcmd->instr = PCinst;
+ pcmd->SetValueVolCol(PCparam);
+ pcmd->SetValueEffectCol(val);
}
+ else
+ {
+ if ((!pcmd->command) || (pcmd->command == vcmd)) {
+ int val = vsrc + ((vdest - vsrc) * (int)i + verr) / distance;
+ pcmd->param = (BYTE)val;
+ pcmd->command = vcmd;
+ }
+ }
break;
default:
ASSERT(false);
@@ -3390,6 +3451,8 @@
case kcNoteCutOld: TempEnterNote(NOTE_NOTECUT, true); return wParam;
case kcNoteOff: TempEnterNote(NOTE_KEYOFF, false); return wParam;
case kcNoteOffOld: TempEnterNote(NOTE_KEYOFF, true); return wParam;
+ case kcNotePC: TempEnterNote(NOTE_PC); return wParam;
+ case kcNotePCS: TempEnterNote(NOTE_PCS); return wParam;
case kcEditUndo: OnEditUndo(); return wParam;
case kcEditFind: OnEditFind(); return wParam;
@@ -3478,6 +3541,19 @@
return NULL;
}
+#define ENTER_PCNOTE_VALUE(v, method) \
+ { \
+ if((v >= 0) && (v <= 9)) \
+ { \
+ uint16 val = p->Get##method##(); \
+ /* Move existing digits to left, drop out leftmost digit and */ \
+ /* push new digit to the least meaning digit. */ \
+ val = (val % 100) * 10 + v; \
+ if(val > MODCOMMAND::maxColumnValue) val = MODCOMMAND::maxColumnValue; \
+ p->Set##method##(val); \
+ } \
+ }
+
void CViewPattern::TempEnterVol(int v)
//------------------------------------
{
@@ -3488,55 +3564,57 @@
{
CSoundFile *pSndFile = pModDoc->GetSoundFile();
- MODCOMMAND *p = pSndFile->Patterns[m_nPattern], *prowbase;
-
- MODCOMMAND oldcmd; // This is the command we are about to overwrite
+
PrepareUndo(m_dwBeginSel, m_dwEndSel);
- // -- Work out where to put the new data
- UINT nChn = (m_dwCursor & 0xFFFF) >> 3;
- prowbase = p + m_nRow * pSndFile->m_nChannels;
- p = prowbase + nChn;
- oldcmd = *p;
+ MODCOMMAND* p = pSndFile->Patterns[m_nPattern].GetpModCommand(m_nRow, GetChanFromCursor(m_dwCursor));
+ MODCOMMAND oldcmd = *p; // This is the command we are about to overwrite
- UINT volcmd = p->volcmd;
- UINT vol = p->vol;
- if ((v >= 0) && (v <= 9))
+ if(p->note == NOTE_PC || p->note == NOTE_PCS)
{
- vol = ((vol * 10) + v) % 100;
- if (!volcmd) volcmd = VOLCMD_VOLUME;
+ ENTER_PCNOTE_VALUE(v, ValueVolCol);
}
else
- switch(v+kcSetVolumeStart)
+ {
+ UINT volcmd = p->volcmd;
+ UINT vol = p->vol;
+ if ((v >= 0) && (v <= 9))
{
- case kcSetVolumeVol: volcmd = VOLCMD_VOLUME; break;
- case kcSetVolumePan: volcmd = VOLCMD_PANNING; break;
- case kcSetVolumeVolSlideUp: volcmd = VOLCMD_VOLSLIDEUP; break;
- case kcSetVolumeVolSlideDown: volcmd = VOLCMD_VOLSLIDEDOWN; break;
- case kcSetVolumeFineVolUp: volcmd = VOLCMD_FINEVOLUP; break;
- case kcSetVolumeFineVolDown: volcmd = VOLCMD_FINEVOLDOWN; break;
- case kcSetVolumeVibratoSpd: volcmd = VOLCMD_VIBRATOSPEED; break;
- case kcSetVolumeVibrato: volcmd = VOLCMD_VIBRATO; break;
- case kcSetVolumeXMPanLeft: if (pSndFile->m_nType & MOD_TYPE_XM) volcmd = VOLCMD_PANSLIDELEFT; break;
- case kcSetVolumeXMPanRight: if (pSndFile->m_nType & MOD_TYPE_XM) volcmd = VOLCMD_PANSLIDERIGHT; break;
- case kcSetVolumePortamento: volcmd = VOLCMD_TONEPORTAMENTO; break;
- case kcSetVolumeITPortaUp: if (pSndFile->m_nType & (MOD_TYPE_IT | MOD_TYPE_MPT)) volcmd = VOLCMD_PORTAUP; break;
- case kcSetVolumeITPortaDown: if (pSndFile->m_nType & (MOD_TYPE_IT | MOD_TYPE_MPT)) volcmd = VOLCMD_PORTADOWN; break;
- case kcSetVolumeITVelocity: if (pSndFile->m_nType & (MOD_TYPE_IT | MOD_TYPE_MPT)) volcmd = VOLCMD_VELOCITY; break; //rewbs.velocity
- case kcSetVolumeITOffset: if (pSndFile->m_nType & (MOD_TYPE_IT | MOD_TYPE_MPT)) volcmd = VOLCMD_OFFSET; break; //rewbs.volOff
+ vol = ((vol * 10) + v) % 100;
+ if (!volcmd) volcmd = VOLCMD_VOLUME;
}
- if ((pSndFile->m_nType & MOD_TYPE_MOD) && (volcmd > VOLCMD_PANNING)) volcmd = vol = 0;
+ else
+ switch(v+kcSetVolumeStart)
+ {
+ case kcSetVolumeVol: volcmd = VOLCMD_VOLUME; break;
+ case kcSetVolumePan: volcmd = VOLCMD_PANNING; break;
+ case kcSetVolumeVolSlideUp: volcmd = VOLCMD_VOLSLIDEUP; break;
+ case kcSetVolumeVolSlideDown: volcmd = VOLCMD_VOLSLIDEDOWN; break;
+ case kcSetVolumeFineVolUp: volcmd = VOLCMD_FINEVOLUP; break;
+ case kcSetVolumeFineVolDown: volcmd = VOLCMD_FINEVOLDOWN; break;
+ case kcSetVolumeVibratoSpd: volcmd = VOLCMD_VIBRATOSPEED; break;
+ case kcSetVolumeVibrato: volcmd = VOLCMD_VIBRATO; break;
+ case kcSetVolumeXMPanLeft: if (pSndFile->m_nType & MOD_TYPE_XM) volcmd = VOLCMD_PANSLIDELEFT; break;
+ case kcSetVolumeXMPanRight: if (pSndFile->m_nType & MOD_TYPE_XM) volcmd = VOLCMD_PANSLIDERIGHT; break;
+ case kcSetVolumePortamento: volcmd = VOLCMD_TONEPORTAMENTO; break;
+ case kcSetVolumeITPortaUp: if (pSndFile->m_nType & (MOD_TYPE_IT | MOD_TYPE_MPT)) volcmd = VOLCMD_PORTAUP; break;
+ case kcSetVolumeITPortaDown: if (pSndFile->m_nType & (MOD_TYPE_IT | MOD_TYPE_MPT)) volcmd = VOLCMD_PORTADOWN; break;
+ case kcSetVolumeITVelocity: if (pSndFile->m_nType & (MOD_TYPE_IT | MOD_TYPE_MPT)) volcmd = VOLCMD_VELOCITY; break; //rewbs.velocity
+ case kcSetVolumeITOffset: if (pSndFile->m_nType & (MOD_TYPE_IT | MOD_TYPE_MPT)) volcmd = VOLCMD_OFFSET; break; //rewbs.volOff
+ }
+ if ((pSndFile->m_nType & MOD_TYPE_MOD) && (volcmd > VOLCMD_PANNING)) volcmd = vol = 0;
- UINT max = 64;
- if (volcmd > VOLCMD_PANNING)
- {
- max = (pSndFile->m_nType == MOD_TYPE_XM) ? 0x0F : 9;
+ UINT max = 64;
+ if (volcmd > VOLCMD_PANNING)
+ {
+ max = (pSndFile->m_nType == MOD_TYPE_XM) ? 0x0F : 9;
+ }
+
+ if (vol > max) vol %= 10;
+ p->volcmd = volcmd;
+ p->vol = vol;
}
- if (vol > max) vol %= 10;
- p->volcmd = volcmd;
- p->vol = vol;
-
if (IsEditingEnabled_bmsg())
{
DWORD sel = (m_nRow << 16) | m_dwCursor;
@@ -3574,6 +3652,8 @@
CMainFrame *pMainFrm = CMainFrame::GetMainFrame();
CModDoc *pModDoc = GetDocument();
+ if(!IsEditingEnabled_bmsg()) return;
+
if ((pModDoc) && (pMainFrm))
{
CSoundFile *pSndFile = pModDoc->GetSoundFile();
@@ -3581,39 +3661,42 @@
MODCOMMAND *p = pSndFile->Patterns[m_nPattern].GetpModCommand(m_nRow, GetChanFromCursor(m_dwCursor));
MODCOMMAND oldcmd = *p; // This is the command we are about to overwrite
- //if(p->command != 0 && !overwrite) return true;
-
PrepareUndo(m_dwBeginSel, m_dwEndSel);
- //LPCSTR lpcmd = (pSndFile->m_nType & (MOD_TYPE_MOD|MOD_TYPE_XM)) ? gszModCommands : gszS3mCommands;
- if (c)
+ if(p->note == NOTE_PC || p->note == NOTE_PCS)
{
- if ((c == m_cmdOld.command) && (!p->param) && (!p->command)) p->param = m_cmdOld.param;
- else m_cmdOld.param = 0;
- m_cmdOld.command = c;
+ ENTER_PCNOTE_VALUE(c, ValueEffectCol);
}
- p->command = c;
-
- // Check for MOD/XM Speed/Tempo command
- if ((pSndFile->m_nType & (MOD_TYPE_MOD|MOD_TYPE_XM))
- && ((p->command == CMD_SPEED) || (p->command == CMD_TEMPO)))
+ else
{
- UINT maxspd = (pSndFile->m_nType & MOD_TYPE_XM) ? 0x1F : 0x20;
- p->command = (p->param <= maxspd) ? CMD_SPEED : CMD_TEMPO;
- }
- if (IsEditingEnabled_bmsg())
- {
- DWORD sel = (m_nRow << 16) | m_dwCursor;
- SetCurSel(sel, sel);
- sel &= ~7;
- if(oldcmd != *p)
+ //LPCSTR lpcmd = (pSndFile->m_nType & (MOD_TYPE_MOD|MOD_TYPE_XM)) ? gszModCommands : gszS3mCommands;
+ if (c)
{
- pModDoc->SetModified();
- InvalidateArea(sel, sel+5);
- UpdateIndicator();
+ if ((c == m_cmdOld.command) && (!p->param) && (!p->command)) p->param = m_cmdOld.param;
+ else m_cmdOld.param = 0;
+ m_cmdOld.command = c;
}
+ p->command = c;
+
+ // Check for MOD/XM Speed/Tempo command
+ if ((pSndFile->m_nType & (MOD_TYPE_MOD|MOD_TYPE_XM))
+ && ((p->command == CMD_SPEED) || (p->command == CMD_TEMPO)))
+ {
+ UINT maxspd = (pSndFile->m_nType & MOD_TYPE_XM) ? 0x1F : 0x20;
+ p->command = (p->param <= maxspd) ? CMD_SPEED : CMD_TEMPO;
+ }
}
+
+ DWORD sel = (m_nRow << 16) | m_dwCursor;
+ SetCurSel(sel, sel);
+ sel &= ~7;
+ if(oldcmd != *p)
+ {
+ pModDoc->SetModified();
+ InvalidateArea(sel, sel+5);
+ UpdateIndicator();
+ }
} // end if mainframe & moddoc exist
}
@@ -3627,38 +3710,42 @@
if ((pModDoc) && (pMainFrm))
{
CSoundFile *pSndFile = pModDoc->GetSoundFile();
- MODCOMMAND oldcmd; // This is the command we are about to overwrite
MODCOMMAND *p = pSndFile->Patterns[m_nPattern].GetpModCommand(m_nRow, GetChanFromCursor(m_dwCursor));
- oldcmd = *p;
+ MODCOMMAND oldcmd = *p; // This is the command we are about to overwrite
PrepareUndo(m_dwBeginSel, m_dwEndSel);
- //if(enterAsAbsoluteValue) p->param = v;
- //else p->param = (p->param << 4) | v;
-
- p->param = (p->param << 4) | v;
- if (p->command == m_cmdOld.command) m_cmdOld.param = p->param;
-
-/*
- if (v >= 0 && v <= 9)
+ if(p->note == NOTE_PC || p->note == NOTE_PCS)
{
- p->param = (p->param << 4) | v;
- if (p->command == m_cmdOld.command) m_cmdOld.param = p->param;
+ ENTER_PCNOTE_VALUE(v, ValueEffectCol);
}
- else if (v >= 10 && v <= 15)
+ else
{
- p->param = (p->param << 4) | (v + 0x0A);
+
+ p->param = (p->param << 4) | v;
if (p->command == m_cmdOld.command) m_cmdOld.param = p->param;
+
+ /*
+ if (v >= 0 && v <= 9)
+ {
+ p->param = (p->param << 4) | v;
+ if (p->command == m_cmdOld.command) m_cmdOld.param = p->param;
+ }
+ else if (v >= 10 && v <= 15)
+ {
+ p->param = (p->param << 4) | (v + 0x0A);
+ if (p->command == m_cmdOld.command) m_cmdOld.param = p->param;
+ }
+ */
+ // Check for MOD/XM Speed/Tempo command
+ if ((pSndFile->m_nType & (MOD_TYPE_MOD|MOD_TYPE_XM))
+ && ((p->command == CMD_SPEED) || (p->command == CMD_TEMPO)))
+ {
+ UINT maxspd = (pSndFile->m_nType & MOD_TYPE_XM) ? 0x1F : 0x20;
+ p->command = (p->param <= maxspd) ? CMD_SPEED : CMD_TEMPO;
+ }
}
-*/
- // Check for MOD/XM Speed/Tempo command
- if ((pSndFile->m_nType & (MOD_TYPE_MOD|MOD_TYPE_XM))
- && ((p->command == CMD_SPEED) || (p->command == CMD_TEMPO)))
- {
- UINT maxspd = (pSndFile->m_nType & MOD_TYPE_XM) ? 0x1F : 0x20;
- p->command = (p->param <= maxspd) ? CMD_SPEED : CMD_TEMPO;
- }
if (IsEditingEnabled())
{
@@ -3930,12 +4017,28 @@
UINT nRow = m_nRow;
CSoundFile *pSndFile = pModDoc->GetSoundFile();
+ // Check whether the module format supports the note.
+ if( pSndFile->HasNote(note) == false )
+ return;
+
UINT nChn = GetChanFromCursor(m_dwCursor);
BYTE recordGroup = pModDoc->IsChannelRecord(nChn);
UINT nPlayIns = 0;
PrepareUndo(m_dwBeginSel, m_dwEndSel);
- if (note > NOTE_MAX && note < 254) note = NOTE_MAX;
+ //Param control 'note'
+ if((note == NOTE_PC || note == NOTE_PCS) && IsEditingEnabled())
+ {
+ pSndFile->Patterns[m_nPattern].GetpModCommand(nRow, nChn)->note = note;
+ const DWORD sel = (nRow << 16) | m_dwCursor;
+ pModDoc->SetModified();
+ InvalidateArea(sel, sel+5);
+ UpdateIndicator();
+ return;
+ }
+
+ if (note > NOTE_MAX && note<254) note = NOTE_MAX;
+
bool usePlaybackPosition = (m_dwStatus & PATSTATUS_FOLLOWSONG) && // work out whether we should use
(pMainFrm->GetFollowSong(pModDoc) == m_hWnd) && // player engine position or
!(pSndFile->IsPaused()) && // edit cursor position
@@ -4106,7 +4209,7 @@
CSoundFile *pSndFile = pModDoc->GetSoundFile();
MODCOMMAND *p = pSndFile->Patterns[m_nPattern], *prowbase;
MODCOMMAND oldcmd; // This is the command we are about to overwrite
- UINT nChn = (m_dwCursor & 0xFFFF) >> 3;
+ UINT nChn = GetChanFromCursor(m_dwCursor);
UINT nPlayIns = 0;
PrepareUndo(m_dwBeginSel, m_dwEndSel);
bool isSplit;
@@ -4256,16 +4359,12 @@
switch(field)
{
- case 0: p->note = 0; if (ITStyle) p->instr = 0; break; //Note
+ case 0: if(p->note == NOTE_PC || p->note == NOTE_PCS) p->Clear(); else {p->note = 0; if (ITStyle) p->instr = 0;} break; //Note
case 1: p->instr = 0; break; //instr
case 2: p->vol = 0; p->volcmd = 0; break; //Vol
case 3: p->command = 0; break; //Effect
case 4: p->param = 0; break; //Param
- default: p->note = 0; //If not specified, delete them all! :)
- p->instr = 0;
- p->vol = 0; p->volcmd = 0;
- p->command = 0;
- p->param = 0;
+ default: p->Clear(); //If not specified, delete them all! :)
}
if(IsEditingEnabled_bmsg())
@@ -4790,28 +4889,32 @@
bool CViewPattern::IsInterpolationPossible(UINT startRow, UINT endRow,
UINT chan, UINT colType, CSoundFile* pSndFile) {
//---------------------------------------------------------------------------------------
- bool result = false;
- MODCOMMAND *pcmd = pSndFile->Patterns[m_nPattern];
- UINT startRowCmd, endRowCmd;
-
if (startRow == endRow) {
return false;
}
+ bool result = false;
+ const MODCOMMAND startRowMC = *pSndFile->Patterns[m_nPattern].GetpModCommand(startRow, chan);
+ const MODCOMMAND endRowMC = *pSndFile->Patterns[m_nPattern].GetpModCommand(endRow, chan);
+ UINT startRowCmd, endRowCmd;
+
+ if(colType == EFFECT_COLUMN && (startRowMC.note == NOTE_PC || startRowMC.note == NOTE_PCS || endRowMC.note == NOTE_PC || endRowMC.note == NOTE_PCS))
+ return true;
+
switch (colType) {
case NOTE_COLUMN:
- startRowCmd = pcmd[startRow*pSndFile->m_nChannels+chan].note;
- endRowCmd = pcmd[endRow*pSndFile->m_nChannels+chan].note;
+ startRowCmd = startRowMC.note;
+ endRowCmd = endRowMC.note;
result = (startRowCmd>0 && endRowCmd>0);
break;
case EFFECT_COLUMN:
- startRowCmd = pcmd[startRow*pSndFile->m_nChannels+chan].command;
- endRowCmd = pcmd[endRow*pSndFile->m_nChannels+chan].command;
+ startRowCmd = startRowMC.command;
+ endRowCmd = endRowMC.command;
result = (startRowCmd == endRowCmd) && (startRowCmd>0 && endRowCmd>0);
break;
case VOL_COLUMN:
- startRowCmd = pcmd[startRow*pSndFile->m_nChannels+chan].volcmd;
- endRowCmd = pcmd[endRow*pSndFile->m_nChannels+chan].volcmd;
+ startRowCmd = startRowMC.volcmd;
+ endRowCmd = endRowMC.volcmd;
result = (startRowCmd == endRowCmd) && (startRowCmd>0 && endRowCmd>0);
break;
default:
Modified: branches/devBranch_1_17_03/mptrack/View_pat.h
===================================================================
--- branches/devBranch_1_17_03/mptrack/View_pat.h 2008-08-17 11:30:18 UTC (rev 220)
+++ branches/devBranch_1_17_03/mptrack/View_pat.h 2008-08-22 18:08:38 UTC (rev 221)
@@ -36,6 +36,7 @@
VOL_COLUMN,
EFFECT_COLUMN,
PARAM_COLUMN,
+ LAST_COLUMN = PARAM_COLUMN
};
@@ -164,7 +165,7 @@
void DrawLetter(int x, int y, char letter, int sizex=10, int ofsx=0);
void DrawNote(int x, int y, UINT note, CTuning* pTuning = NULL);
void DrawInstrument(int x, int y, UINT instr);
- void DrawVolumeCommand(int x, int y, UINT volcmd, UINT vol);
+ void DrawVolumeCommand(int x, int y, const MODCOMMAND mc);
void DrawChannelVUMeter(HDC hdc, int x, int y, UINT nChn);
void UpdateAllVUMeters(MPTNOTIFICATION *pnotify);
void DrawDragSel(HDC hdc);
Modified: branches/devBranch_1_17_03/mptrack/View_smp.cpp
===================================================================
--- branches/devBranch_1_17_03/mptrack/View_smp.cpp 2008-08-17 11:30:18 UTC (rev 220)
+++ branches/devBranch_1_17_03/mptrack/View_smp.cpp 2008-08-22 18:08:38 UTC (rev 221)
@@ -1903,8 +1903,10 @@
pModDoc->PlayNote(note, 0, m_nSample, FALSE, -1, loopstart, loopend);
m_dwStatus |= SMPSTATUS_KEYDOWN;
s[0] = 0;
- if ((note) && (note <= NOTE_MAX)) wsprintf(s, "%s%d", szNoteNames[(note-1)%12], (note-1)/12);
- pMainFrm->SetInfoText(s);
+ if ((note) && (note <= NOTE_MAX))
+ pMainFrm->SetInfoText(szDefaultNoteNames[note-1]);
+ else
+ pMainFrm->SetInfoText(s);
}
}
Modified: branches/devBranch_1_17_03/mptrack/View_tre.cpp
===================================================================
--- branches/devBranch_1_17_03/mptrack/View_tre.cpp 2008-08-17 11:30:18 UTC (rev 220)
+++ branches/devBranch_1_17_03/mptrack/View_tre.cpp 2008-08-22 18:08:38 UTC (rev 221)
@@ -400,8 +400,7 @@
for (UINT iPerc=24; iPerc<=84; iPerc++)
{
DWORD dwImage = IMAGE_NOSAMPLE;
- wsprintf(s, "%s%d: %s", szNoteNames[iPerc%12], iPerc/12,
- szMidiPercussionNames[iPerc-24]);
+ wsprintf(s, "%s: %s", szDefaultNoteNames[iPerc], szMidiPercussionNames[iPerc-24]);
if ((lpMidiLib) && (lpMidiLib->MidiMap[iPerc|0x80]) && (lpMidiLib->MidiMap[iPerc|0x80][0]))
{
_splitpath(lpMidiLib->MidiMap[iPerc|0x80], NULL, NULL, szName, szExt);
Modified: branches/devBranch_1_17_03/mptrack/Vstplug.cpp
===================================================================
--- branches/devBranch_1_17_03/mptrack/Vstplug.cpp 2008-08-17 11:30:18 UTC (rev 220)
+++ branches/devBranch_1_17_03/mptrack/Vstplug.cpp 2008-08-22 18:08:38 UTC (rev 221)
@@ -1928,11 +1928,11 @@
}
-FLOAT CVstPlugin::GetParameter(UINT nIndex)
-//-----------------------------------------
+PlugParamValue CVstPlugin::GetParameter(PlugParamIndex nIndex)
+//------------------------------------------------------------
{
FLOAT fResult = 0;
- if ((m_pEffect) && ((long)nIndex < m_pEffect->numParams) && (m_pEffect->getParameter))
+ if ((m_pEffect) && (nIndex < m_pEffect->numParams) && (m_pEffect->getParameter))
{
try {
fResult = m_pEffect->getParameter(m_pEffect, nIndex);
@@ -1951,11 +1951,11 @@
}
-VOID CVstPlugin::SetParameter(UINT nIndex, FLOAT fValue)
-//------------------------------------------------------
+VOID CVstPlugin::SetParameter(PlugParamIndex nIndex, PlugParamValue fValue)
+//-------------------------------------------------------------------------
{
try {
- if ((m_pEffect) && ((long)nIndex < m_pEffect->numParams) && (m_pEffect->setParameter))
+ if ((m_pEffect) && (nIndex < m_pEffect->numParams) && (m_pEffect->setParameter))
{
if ((fValue >= 0.0f) && (fValue <= 1.0f))
m_pEffect->setParameter(m_pEffect, nIndex, fValue);
Modified: branches/devBranch_1_17_03/mptrack/Vstplug.h
===================================================================
--- branches/devBranch_1_17_03/mptrack/Vstplug.h 2008-08-17 11:30:18 UTC (rev 220)
+++ branches/devBranch_1_17_03/mptrack/Vstplug.h 2008-08-22 18:08:38 UTC (rev 221)
@@ -125,8 +125,8 @@
//BOOL SavePreset(LPCSTR lpszFileName);
//BOOL LoadPreset(LPCSTR lpszFileName);
// -! NEW_FEATURE#0002
- FLOAT GetParameter(UINT nIndex);
- VOID SetParameter(UINT nIndex, FLOAT fValue);
+ PlugParamValue GetParameter(PlugParamIndex nIndex);
+ VOID SetParameter(PlugParamIndex nIndex, PlugParamValue fValue);
VOID GetParamName(UINT nIndex, LPSTR pszName, UINT cbSize);
VOID GetParamLabel(UINT nIndex, LPSTR pszLabel);
VOID GetParamDisplay(UINT nIndex, LPSTR pszDisplay);
Modified: branches/devBranch_1_17_03/mptrack/dlg_misc.cpp
===================================================================
--- branches/devBranch_1_17_03/mptrack/dlg_misc.cpp 2008-08-17 11:30:18 UTC (rev 220)
+++ branches/devBranch_1_17_03/mptrack/dlg_misc.cpp 2008-08-22 18:08:38 UTC (rev 221)
@@ -11,7 +11,7 @@
#include "midi.h"
#include "version.h"
-#pragma warning(disable:4244)
+//#pragma warning(disable:4244) //"conversion from 'type1' to 'type2', possible loss of data"
@@ -22,7 +22,7 @@
{
if(xparam == NULL || multiplier == NULL) return;
- MODCOMMAND mca;
+ MODCOMMAND mca = MODCOMMAND::Empty();
UINT i,xp = 0, ml = 1;
int nCmdRow = (int)nRow;
@@ -620,24 +620,20 @@
// Note
if ((combo = (CComboBox *)GetDlgItem(IDC_COMBO1)) != NULL)
{
+ combo->InitStorage(150, 4);
combo->SetItemData(combo->AddString("..."), 0);
if (m_bReplace)
{
- combo->SetItemData(combo->AddString("note-1"), 0xFC);
- combo->SetItem...
[truncated message content] |
|
From: <rel...@us...> - 2008-08-17 11:30:26
|
Revision: 220
http://modplug.svn.sourceforge.net/modplug/?rev=220&view=rev
Author: relabsoluness
Date: 2008-08-17 11:30:18 +0000 (Sun, 17 Aug 2008)
Log Message:
-----------
[Ref(refactoring)] sndfile.h refactoring: among other things, created files for sample, instrument(header), channel, mixplugin and mixer code and moved related code from sndfile.h.
[Ref] Moved pattern, playbackeventer and sequence files from mptrack to soundlib.
Modified Paths:
--------------
branches/devBranch_1_17_03/mptrack/mptrack.vcproj
branches/devBranch_1_17_03/mptrack/test/test.cpp
branches/devBranch_1_17_03/mptrack/test/test.h
branches/devBranch_1_17_03/soundlib/Sndfile.cpp
branches/devBranch_1_17_03/soundlib/Sndfile.h
branches/devBranch_1_17_03/soundlib/midi.h
branches/devBranch_1_17_03/soundlib/modcommand.h
Added Paths:
-----------
branches/devBranch_1_17_03/soundlib/OrderToPatternTable.cpp
branches/devBranch_1_17_03/soundlib/OrderToPatternTable.h
branches/devBranch_1_17_03/soundlib/PlaybackEventer.cpp
branches/devBranch_1_17_03/soundlib/PlaybackEventer.h
branches/devBranch_1_17_03/soundlib/mixer.h
branches/devBranch_1_17_03/soundlib/mixplug.h
branches/devBranch_1_17_03/soundlib/modchannel.h
branches/devBranch_1_17_03/soundlib/modins.h
branches/devBranch_1_17_03/soundlib/modsmp.h
branches/devBranch_1_17_03/soundlib/modspecifications.h
branches/devBranch_1_17_03/soundlib/pattern.cpp
branches/devBranch_1_17_03/soundlib/pattern.h
branches/devBranch_1_17_03/soundlib/patternContainer.cpp
branches/devBranch_1_17_03/soundlib/patternContainer.h
Removed Paths:
-------------
branches/devBranch_1_17_03/mptrack/OrderToPatternTable.cpp
branches/devBranch_1_17_03/mptrack/OrderToPatternTable.h
branches/devBranch_1_17_03/mptrack/PlaybackEventer.cpp
branches/devBranch_1_17_03/mptrack/PlaybackEventer.h
branches/devBranch_1_17_03/mptrack/pattern.cpp
branches/devBranch_1_17_03/mptrack/pattern.h
branches/devBranch_1_17_03/mptrack/patternContainer.cpp
branches/devBranch_1_17_03/mptrack/patternContainer.h
branches/devBranch_1_17_03/soundlib/mod_specifications.h
Deleted: branches/devBranch_1_17_03/mptrack/OrderToPatternTable.cpp
===================================================================
--- branches/devBranch_1_17_03/mptrack/OrderToPatternTable.cpp 2008-08-16 17:24:05 UTC (rev 219)
+++ branches/devBranch_1_17_03/mptrack/OrderToPatternTable.cpp 2008-08-17 11:30:18 UTC (rev 220)
@@ -1,180 +0,0 @@
-#include "stdafx.h"
-#include "sndfile.h"
-#include "ordertopatterntable.h"
-
-DWORD COrderToPatternTable::Unserialize(const BYTE* const src, const DWORD memLength)
-//-------------------------------------------------------------------------
-{
- if(memLength < 2 + 4) return 0;
- uint16 version = 0;
- uint32 s = 0;
- DWORD memPos = 0;
- memcpy(&version, src, sizeof(version));
- memPos += sizeof(version);
- if(version != 0) return memPos;
- memcpy(&s, src+memPos, sizeof(s));
- memPos += sizeof(s);
- if(s > 65000) return true;
- if(memLength < memPos+s*4) return memPos;
-
- resize(s);
- for(size_t i = 0; i<s; i++, memPos +=4 )
- {
- uint32 temp;
- memcpy(&temp, src+memPos, 4);
- (*this)[i] = static_cast<PATTERNINDEX>(temp);
- }
- return memPos;
-}
-
-
-size_t COrderToPatternTable::WriteToByteArray(BYTE* dest, const UINT numOfBytes, const UINT destSize)
-//-----------------------------------------------------------------------------
-{
- if(numOfBytes > destSize) return true;
- if(size() < numOfBytes) resize(numOfBytes, 0xFF);
- UINT i = 0;
- for(i = 0; i<numOfBytes; i++)
- {
- dest[i] = static_cast<BYTE>((*this)[i]);
- }
- return i; //Returns the number of bytes written.
-}
-
-
-size_t COrderToPatternTable::WriteAsByte(FILE* f, const UINT count)
-//---------------------------------------------------------------
-{
- if(size() < count) resize(count, GetInvalidPatIndex());
-
- size_t i = 0;
-
- for(i = 0; i<count; i++)
- {
- const PATTERNINDEX pat = (*this)[i];
- BYTE temp = static_cast<BYTE>((*this)[i]);
-
- if(pat > 0xFD)
- {
- if(pat == GetInvalidPatIndex()) temp = 0xFF;
- else temp = 0xFE;
- }
- fwrite(&temp, 1, 1, f);
- }
- return i; //Returns the number of bytes written.
-}
-
-bool COrderToPatternTable::ReadAsByte(const BYTE* pFrom, const int howMany, const int memLength)
-//-------------------------------------------------------------------------
-{
- if(howMany < 0 || howMany > memLength) return true;
- if(m_rSndFile.GetType() != MOD_TYPE_MPT && howMany > MAX_ORDERS) return true;
-
- if(size() < static_cast<size_t>(howMany))
- resize(howMany, GetInvalidPatIndex());
-
- for(int i = 0; i<howMany; i++, pFrom++)
- (*this)[i] = *pFrom;
- return false;
-}
-
-
-bool COrderToPatternTable::NeedsExtraDatafield() const
-//----------------------------------------------
-{
- if(m_rSndFile.GetType() == MOD_TYPE_MPT && m_rSndFile.Patterns.Size() > 0xFD)
- return true;
- else
- return false;
-}
-
-
-void COrderToPatternTable::OnModTypeChanged(const MODTYPE oldtype)
-//----------------------------------------------------------------
-{
- const CModSpecifications specs = m_rSndFile.GetModSpecifications();
-
- //Resize orderlist if needed. Because old orderlist had MAX_ORDERS(256) elements, not making it
- //smaller than that even if the modtype doesn't support that many orders.
- if(specs.ordersMax < GetCount())
- {
- resize(max(MAX_ORDERS, specs.ordersMax));
- for(ORDERINDEX i = GetCount(); i>specs.ordersMax; --i) (*this)[i-1] = GetInvalidPatIndex();
- }
-
- //Replace items used to denote end of song/skip order.
- replace(begin(), end(), GetInvalidPatIndex(oldtype), GetInvalidPatIndex());
- replace(begin(), end(), GetIgnoreIndex(oldtype), GetIgnoreIndex());
-}
-
-
-ORDERINDEX COrderToPatternTable::GetNextOrderIgnoringSkips(const ORDERINDEX start) const
-//-------------------------------------------------------------------------------------
-{
- const ORDERINDEX count = GetCount();
- if(count == 0) return 0;
- ORDERINDEX next = min(count-1, start+1);
- while(next+1 < count && (*this)[next] == GetIgnoreIndex()) next++;
- return next;
-}
-
-ORDERINDEX COrderToPatternTable::GetPreviousOrderIgnoringSkips(const ORDERINDEX start) const
-//-------------------------------------------------------------------------------------
-{
- const ORDERINDEX count = GetCount();
- if(start == 0 || count == 0) return 0;
- ORDERINDEX prev = min(start-1, count-1);
- while(prev > 0 && (*this)[prev] == GetIgnoreIndex()) prev--;
- return prev;
-}
-
-
-PATTERNINDEX COrderToPatternTable::GetInvalidPatIndex(const MODTYPE type) {return type == MOD_TYPE_MPT ? 65535 : 0xFF;}
-PATTERNINDEX COrderToPatternTable::GetIgnoreIndex(const MODTYPE type) {return type == MOD_TYPE_MPT ? 65534 : 0xFE;}
-
-PATTERNINDEX COrderToPatternTable::GetInvalidPatIndex() const {return GetInvalidPatIndex(m_rSndFile.GetType());}
-PATTERNINDEX COrderToPatternTable::GetIgnoreIndex() const {return GetIgnoreIndex(m_rSndFile.GetType());}
-
-
-
-
-//--------------------------------------------------
-//--------------------------------------------------
-//--------------------------------------------------
-
-using namespace srlztn;
-
-void COrderSerialization::ProWrite(OUTSTREAM& ostrm) const
-//--------------------------------------------------------
-{
- uint16 size = static_cast<uint16>(m_rOrders.size());
- ostrm.write(reinterpret_cast<const char*>(&size), 2);
- const COrderToPatternTable::const_iterator endIter = m_rOrders.end();
- for(COrderToPatternTable::const_iterator citer = m_rOrders.begin(); citer != endIter; citer++)
- {
- const uint16 temp = static_cast<uint16>(*citer);
- ostrm.write(reinterpret_cast<const char*>(&temp), 2);
- }
-}
-
-
-void COrderSerialization::ProRead(INSTREAM& istrm, const uint64 /*datasize*/)
-//---------------------------------------------------------------------------
-{
- uint16 size;
- istrm.read(reinterpret_cast<char*>(&size), 2);
- if(size > MPTM_SPECS.ordersMax) size = MPTM_SPECS.ordersMax;
- m_rOrders.resize(size);
- if(size == 0) {m_rOrders.assign(MAX_ORDERS, m_rOrders.GetInvalidPatIndex()); return;}
-
- const COrderToPatternTable::const_iterator endIter = m_rOrders.end();
- for(COrderToPatternTable::iterator iter = m_rOrders.begin(); iter != endIter; iter++)
- {
- uint16 temp;
- istrm.read(reinterpret_cast<char*>(&temp), 2);
- *iter = temp;
- }
-}
-
-
-
Deleted: branches/devBranch_1_17_03/mptrack/OrderToPatternTable.h
===================================================================
--- branches/devBranch_1_17_03/mptrack/OrderToPatternTable.h 2008-08-16 17:24:05 UTC (rev 219)
+++ branches/devBranch_1_17_03/mptrack/OrderToPatternTable.h 2008-08-17 11:30:18 UTC (rev 220)
@@ -1,68 +0,0 @@
-#ifndef ORDERTOPATTERNTABLE_H
-#define ORDERTOPATTERNTABLE_H
-
-#include "serialization_utils.h"
-#include <vector>
-using std::vector;
-
-class CSoundFile;
-class COrderToPatternTable;
-
-#pragma warning(disable:4244) //conversion from 'type1' to 'type2', possible loss of data
-
-class COrderSerialization : public srlztn::ABCSerializationStreamer
-//=========================================================
-{
-public:
- COrderSerialization(COrderToPatternTable& ordertable) : m_rOrders(ordertable) {}
- virtual void ProWrite(srlztn::OUTSTREAM& ostrm) const;
- virtual void ProRead(srlztn::INSTREAM& istrm, const uint64 /*datasize*/);
-private:
- COrderToPatternTable& m_rOrders;
-};
-
-//==============================================
-class COrderToPatternTable : public vector<PATTERNINDEX>
-//==============================================
-{
-public:
- COrderToPatternTable(const CSoundFile& sndFile) : m_rSndFile(sndFile) {}
-
- bool ReadAsByte(const BYTE* pFrom, const int howMany, const int memLength);
-
- size_t WriteAsByte(FILE* f, const UINT count);
-
- size_t WriteToByteArray(BYTE* dest, const UINT numOfBytes, const UINT destSize);
-
- ORDERINDEX GetCount() const {return size();}
-
- //Deprecated function used for MPTm's created in 1.17.02.46 - 1.17.02.48.
- DWORD Unserialize(const BYTE* const src, const DWORD memLength);
-
- //Returns true if the IT orderlist datafield is not sufficient to store orderlist information.
- bool NeedsExtraDatafield() const;
-
- void OnModTypeChanged(const MODTYPE oldtype);
-
- PATTERNINDEX GetInvalidPatIndex() const; //To correspond 0xFF
- static PATTERNINDEX GetInvalidPatIndex(const MODTYPE type);
-
- PATTERNINDEX GetIgnoreIndex() const; //To correspond 0xFE
- static PATTERNINDEX GetIgnoreIndex(const MODTYPE type);
-
- //Returns the previous/next order ignoring skip indeces(+++).
- //If no previous/next order exists, return first/last order, and zero
- //when orderlist is empty.
- ORDERINDEX GetNextOrderIgnoringSkips(const ORDERINDEX start) const;
- ORDERINDEX GetPreviousOrderIgnoringSkips(const ORDERINDEX start) const;
-
- COrderSerialization* NewReadWriteObject() {return new COrderSerialization(*this);}
-
-private:
- const CSoundFile& m_rSndFile;
-};
-
-#pragma warning(default:4244)
-
-#endif
-
Deleted: branches/devBranch_1_17_03/mptrack/PlaybackEventer.cpp
===================================================================
--- branches/devBranch_1_17_03/mptrack/PlaybackEventer.cpp 2008-08-16 17:24:05 UTC (rev 219)
+++ branches/devBranch_1_17_03/mptrack/PlaybackEventer.cpp 2008-08-17 11:30:18 UTC (rev 220)
@@ -1,31 +0,0 @@
-#include "stdafx.h"
-#include "PlaybackEventer.h"
-#include "sndfile.h"
-
-CPlaybackEventer::~CPlaybackEventer()
-//---------------------------------
-{
-}
-
-void CPlaybackEventer::PatternTranstionChnSolo(const CHANNELINDEX chnIndex)
-//-------------------------------------------------------------------------
-{
- if(chnIndex >= m_rSndFile.m_nChannels)
- return;
-
- for(CHANNELINDEX i = 0; i<m_rSndFile.m_nChannels; i++)
- {
- m_rSndFile.m_bChannelMuteTogglePending[i] = (m_rSndFile.ChnSettings[i].dwFlags & CHN_MUTE) ? false : true;
- }
- m_rSndFile.m_bChannelMuteTogglePending[chnIndex] = (m_rSndFile.ChnSettings[chnIndex].dwFlags & CHN_MUTE) ? true : false;
-}
-
-
-void CPlaybackEventer::PatternTransitionChnUnmuteAll()
-//----------------------------------------------------
-{
- for(CHANNELINDEX i = 0; i<m_rSndFile.m_nChannels; i++)
- {
- m_rSndFile.m_bChannelMuteTogglePending[i] = (m_rSndFile.ChnSettings[i].dwFlags & CHN_MUTE) ? true : false;
- }
-}
\ No newline at end of file
Deleted: branches/devBranch_1_17_03/mptrack/PlaybackEventer.h
===================================================================
--- branches/devBranch_1_17_03/mptrack/PlaybackEventer.h 2008-08-16 17:24:05 UTC (rev 219)
+++ branches/devBranch_1_17_03/mptrack/PlaybackEventer.h 2008-08-17 11:30:18 UTC (rev 220)
@@ -1,25 +0,0 @@
-#ifndef PLAYBACKEVENTER_H
-#define PLAYBACKEVENTER_H
-
-#include "pattern.h"
-
-class CSoundFile;
-
-//====================
-class CPlaybackEventer
-//====================
-{
-public:
- CPlaybackEventer(CSoundFile& sndf) : m_rSndFile(sndf) {}
- ~CPlaybackEventer();
-
- //SetPatternEvent(const PATTERNINDEX pattern, const ROWINDEX row, const CHANNELINDEX column);
-
- void PatternTranstionChnSolo(const CHANNELINDEX chnIndex);
- void PatternTransitionChnUnmuteAll();
-
-private:
- CSoundFile& m_rSndFile;
-};
-
-#endif
Modified: branches/devBranch_1_17_03/mptrack/mptrack.vcproj
===================================================================
--- branches/devBranch_1_17_03/mptrack/mptrack.vcproj 2008-08-16 17:24:05 UTC (rev 219)
+++ branches/devBranch_1_17_03/mptrack/mptrack.vcproj 2008-08-17 11:30:18 UTC (rev 220)
@@ -377,13 +377,13 @@
RelativePath=".\OpenGLEditor.cpp">
</File>
<File
- RelativePath=".\OrderToPatternTable.cpp">
+ RelativePath="..\soundlib\OrderToPatternTable.cpp">
</File>
<File
- RelativePath=".\pattern.cpp">
+ RelativePath="..\soundlib\pattern.cpp">
</File>
<File
- RelativePath=".\patternContainer.cpp">
+ RelativePath="..\soundlib\patternContainer.cpp">
</File>
<File
RelativePath=".\PatternGotoDialog.cpp">
@@ -392,7 +392,7 @@
RelativePath=".\PerformanceCounter.cpp">
</File>
<File
- RelativePath=".\PlaybackEventer.cpp">
+ RelativePath="..\soundlib\PlaybackEventer.cpp">
</File>
<File
RelativePath=".\PSRatioCalc.cpp">
@@ -748,13 +748,19 @@
RelativePath=".\misc_util.h">
</File>
<File
+ RelativePath="..\soundlib\mixer.h">
+ </File>
+ <File
+ RelativePath="..\soundlib\mixplug.h">
+ </File>
+ <File
RelativePath=".\mod2midi.h">
</File>
<File
RelativePath=".\mod2wave.h">
</File>
<File
- RelativePath="..\soundlib\mod_specifications.h">
+ RelativePath="..\soundlib\modchannel.h">
</File>
<File
RelativePath="..\soundlib\modcommand.h">
@@ -763,6 +769,15 @@
RelativePath=".\moddoc.h">
</File>
<File
+ RelativePath="..\soundlib\modins.h">
+ </File>
+ <File
+ RelativePath="..\soundlib\modsmp.h">
+ </File>
+ <File
+ RelativePath="..\soundlib\modspecifications.h">
+ </File>
+ <File
RelativePath=".\Moptions.h">
</File>
<File
@@ -787,13 +802,13 @@
RelativePath=".\order.h">
</File>
<File
- RelativePath=".\OrderToPatternTable.h">
+ RelativePath="..\soundlib\OrderToPatternTable.h">
</File>
<File
- RelativePath=".\pattern.h">
+ RelativePath="..\soundlib\pattern.h">
</File>
<File
- RelativePath=".\patternContainer.h">
+ RelativePath="..\soundlib\patternContainer.h">
</File>
<File
RelativePath=".\PatternGotoDialog.h">
@@ -802,7 +817,7 @@
RelativePath=".\PerformanceCounter.h">
</File>
<File
- RelativePath=".\PlaybackEventer.h">
+ RelativePath="..\soundlib\PlaybackEventer.h">
</File>
<File
RelativePath=".\PSRatioCalc.h">
Deleted: branches/devBranch_1_17_03/mptrack/pattern.cpp
===================================================================
--- branches/devBranch_1_17_03/mptrack/pattern.cpp 2008-08-16 17:24:05 UTC (rev 219)
+++ branches/devBranch_1_17_03/mptrack/pattern.cpp 2008-08-17 11:30:18 UTC (rev 220)
@@ -1,232 +0,0 @@
-#include "stdafx.h"
-#include "pattern.h"
-#include "patternContainer.h"
-#include "mainfrm.h"
-#include "moddoc.h"
-
-
-CHANNELINDEX CPattern::GetNumChannels() const
-//-------------------------------------------
-{
- return m_rPatternContainer.GetSoundFile().GetNumChannels();
-}
-
-bool CPattern::Resize(const ROWINDEX newRowCount, const bool showDataLossWarning)
-//-------------------------------------------
-{
- if(m_ModCommands == NULL)
- {
- //For Mimicing old behavior of setting patternsize before even having the
- //actual pattern allocated.
- m_Rows = newRowCount;
- return false;
- }
-
-
- CSoundFile& sndFile = m_rPatternContainer.GetSoundFile();
- const CModSpecifications& specs = sndFile.GetModSpecifications();
- if(sndFile.m_pModDoc == NULL) return true;
- CModDoc& rModDoc = *sndFile.m_pModDoc;
- if(newRowCount > specs.patternRowsMax || newRowCount < specs.patternRowsMin)
- return true;
-
- if (newRowCount == m_Rows) return false;
- rModDoc.BeginWaitCursor();
- BEGIN_CRITICAL();
- if (newRowCount > m_Rows)
- {
- MODCOMMAND *p = CSoundFile::AllocatePattern(newRowCount, sndFile.m_nChannels);
- if (p)
- {
- memcpy(p, m_ModCommands, sndFile.m_nChannels*m_Rows*sizeof(MODCOMMAND));
- CSoundFile::FreePattern(m_ModCommands);
- m_ModCommands = p;
- m_Rows = newRowCount;
- }
- } else
- {
- BOOL bOk = TRUE;
- MODCOMMAND *p = m_ModCommands;
- UINT ndif = (m_Rows - newRowCount) * sndFile.m_nChannels;
- UINT npos = newRowCount * sndFile.m_nChannels;
- if(showDataLossWarning)
- {
- for (UINT i=0; i<ndif; i++)
- {
- if (*((DWORD *)(p+i+npos)))
- {
- bOk = FALSE;
- break;
- }
- }
- if (!bOk && showDataLossWarning)
- {
- END_CRITICAL();
- rModDoc.EndWaitCursor();
- if (CMainFrame::GetMainFrame()->MessageBox("Data at the end of the pattern will be lost.\nDo you want to continue",
- "Shrink Pattern", MB_YESNO|MB_ICONQUESTION) == IDYES) bOk = TRUE;
- rModDoc.BeginWaitCursor();
- BEGIN_CRITICAL();
- }
- }
- if (bOk)
- {
- MODCOMMAND *pnew = CSoundFile::AllocatePattern(newRowCount, sndFile.m_nChannels);
- if (pnew)
- {
- memcpy(pnew, m_ModCommands, sndFile.m_nChannels*newRowCount*sizeof(MODCOMMAND));
- CSoundFile::FreePattern(m_ModCommands);
- m_ModCommands = pnew;
- m_Rows = newRowCount;
- }
- }
- }
- END_CRITICAL();
- rModDoc.EndWaitCursor();
- rModDoc.SetModified();
- return (newRowCount == m_Rows) ? false : true;
-}
-
-
-bool CPattern::ClearData()
-//------------------------
-{
- BEGIN_CRITICAL();
- m_Rows = 0;
- CSoundFile::FreePattern(m_ModCommands);
- m_ModCommands = NULL;
- END_CRITICAL();
- return false;
-}
-
-bool CPattern::Expand()
-//---------------------
-{
- MODCOMMAND *newPattern, *oldPattern;
- UINT nRows, nChns;
-
- CSoundFile& sndFile = m_rPatternContainer.GetSoundFile();
- if(sndFile.m_pModDoc == NULL) return true;
-
- CModDoc& rModDoc = *sndFile.m_pModDoc;
-
- if ((!m_ModCommands) || (m_Rows > sndFile.GetModSpecifications().patternRowsMax / 2)) return true;
-
- rModDoc.BeginWaitCursor();
- nRows = m_Rows;
- nChns = sndFile.m_nChannels;
- newPattern = CSoundFile::AllocatePattern(nRows*2, nChns);
- if (!newPattern) return true;
-
- const UINT nPattern = m_rPatternContainer.GetIndex(this);
- rModDoc.PrepareUndo(nPattern, 0,0, nChns, nRows);
- oldPattern = m_ModCommands;
- for (UINT y=0; y<nRows; y++)
- {
- memcpy(newPattern+y*2*nChns, oldPattern+y*nChns, nChns*sizeof(MODCOMMAND));
- }
- m_ModCommands = newPattern;
- m_Rows = nRows * 2;
- CSoundFile::FreePattern(oldPattern); oldPattern= NULL;
- rModDoc.SetModified();
- rModDoc.UpdateAllViews(NULL, HINT_PATTERNDATA | (nPattern << HINT_SHIFT_PAT), NULL);
- rModDoc.EndWaitCursor();
- return false;
-}
-
-bool CPattern::Shrink()
-//---------------------
-{
- UINT nRows, nChns;
-
- if (!m_ModCommands || m_Rows < 32) return true;
-
- CSoundFile& sndFile = m_rPatternContainer.GetSoundFile();
- if(sndFile.m_pModDoc == NULL) return true;
-
- CModDoc& rModDoc = *sndFile.m_pModDoc;
-
- rModDoc.BeginWaitCursor();
- nRows = m_Rows;
- nChns = sndFile.m_nChannels;
- const UINT nPattern = m_rPatternContainer.GetIndex(this);
- rModDoc.PrepareUndo(nPattern, 0,0, nChns, nRows);
- nRows /= 2;
- for (UINT y=0; y<nRows; y++)
- {
- MODCOMMAND *psrc = sndFile.Patterns[nPattern] + (y * 2 * nChns);
- MODCOMMAND *pdest = sndFile.Patterns[nPattern] + (y * nChns);
- for (UINT x=0; x<nChns; x++)
- {
- pdest[x] = psrc[x];
- if ((!pdest[x].note) && (!pdest[x].instr))
- {
- pdest[x].note = psrc[x+nChns].note;
- pdest[x].instr = psrc[x+nChns].instr;
- if (psrc[x+nChns].volcmd)
- {
- pdest[x].volcmd = psrc[x+nChns].volcmd;
- pdest[x].vol = psrc[x+nChns].vol;
- }
- if (!pdest[x].command)
- {
- pdest[x].command = psrc[x+nChns].command;
- pdest[x].param = psrc[x+nChns].param;
- }
- }
- }
- }
- m_Rows = nRows;
- rModDoc.SetModified();
- rModDoc.UpdateAllViews(NULL, HINT_PATTERNDATA | (nPattern << HINT_SHIFT_PAT), NULL);
- rModDoc.EndWaitCursor();
- return false;
-}
-
-
-
-bool CPattern::WriteITPdata(FILE* f) const
-//----------------------------------------
-{
- for(ROWINDEX r = 0; r<GetNumRows(); r++)
- {
- for(CHANNELINDEX c = 0; c<GetNumChannels(); c++)
- {
- MODCOMMAND mc = GetModCommand(r,c);
- fwrite(&mc, sizeof(MODCOMMAND), 1, f);
- }
- }
- return false;
-}
-
-bool CPattern::ReadITPdata(const BYTE* const lpStream, DWORD& streamPos, const DWORD datasize, const DWORD dwMemLength)
-//-----------------------------------------------------------------------------------------------
-{
- if(streamPos > dwMemLength || datasize >= dwMemLength - streamPos || datasize < sizeof(MODCOMMAND_ORIGINAL))
- return true;
-
- const DWORD startPos = streamPos;
- ROWINDEX counter = 0;
- while(streamPos - startPos + sizeof(MODCOMMAND_ORIGINAL) <= datasize)
- {
- MODCOMMAND_ORIGINAL temp;
- memcpy(&temp, lpStream+streamPos, sizeof(MODCOMMAND_ORIGINAL));
- MODCOMMAND& mc = GetModCommand(counter);
- mc.command = temp.command;
- mc.instr = temp.instr;
- mc.note = temp.note;
- mc.param = temp.param;
- mc.vol = temp.vol;
- mc.volcmd = temp.volcmd;
- streamPos += sizeof(MODCOMMAND_ORIGINAL);
- counter++;
- }
- if(streamPos != startPos + datasize)
- {
- ASSERT(false);
- return true;
- }
- else
- return false;
-}
-
Deleted: branches/devBranch_1_17_03/mptrack/pattern.h
===================================================================
--- branches/devBranch_1_17_03/mptrack/pattern.h 2008-08-16 17:24:05 UTC (rev 219)
+++ branches/devBranch_1_17_03/mptrack/pattern.h 2008-08-17 11:30:18 UTC (rev 220)
@@ -1,82 +0,0 @@
-#ifndef PATTERN_H
-#define PATTERN_H
-
-#include <vector>
-#include "modcommand.h"
-
-using std::vector;
-
-class CPatternContainer;
-
-
-//============
-class CPattern
-//============
-{
- friend class CPatternContainer;
-
-public:
-//BEGIN: OPERATORS
- //To mimic MODCOMMAND*
- operator MODCOMMAND*() {return m_ModCommands;}
- operator const MODCOMMAND*() const {return m_ModCommands;}
- CPattern& operator=(MODCOMMAND* const p) {m_ModCommands = p; return *this;}
- CPattern& operator=(const CPattern& pat)
- {
- m_ModCommands = pat.m_ModCommands;
- m_Rows = pat.m_Rows;
- return *this;
- }
-//END: OPERATORS
-
-//BEGIN: INTERFACE METHODS
-public:
- MODCOMMAND* GetpModCommand(const ROWINDEX r, const CHANNELINDEX c) {return &m_ModCommands[r*GetNumChannels()+c];}
- const MODCOMMAND* GetpModCommand(const ROWINDEX r, const CHANNELINDEX c) const {return &m_ModCommands[r*GetNumChannels()+c];}
-
- ROWINDEX GetNumRows() const {return m_Rows;}
-
- CHANNELINDEX GetNumChannels() const;
-
- bool Resize(const ROWINDEX newRowCount, const bool showDataLossWarning = true);
-
- bool ClearData();
-
- bool SetData(MODCOMMAND* p, const ROWINDEX rows) {m_ModCommands = p; m_Rows = rows; return false;}
-
- bool Expand();
-
- bool Shrink();
-
- bool WriteITPdata(FILE* f) const;
- bool ReadITPdata(const BYTE* const lpStream, DWORD& streamPos, const DWORD datasize, const DWORD dwMemLength);
- //Parameters:
- //1. Pointer to the beginning of the stream
- //2. Tells where to start(lpStream+streamPos) and number of bytes read is added to it.
- //3. How many bytes to read
- //4. Length of the stream.
- //Returns true on error.
-
-//END: INTERFACE METHODS
-
- CPattern(CPatternContainer& patCont) : m_ModCommands(0), m_Rows(64), m_rPatternContainer(patCont) {}
-
-private:
- MODCOMMAND& GetModCommand(ROWINDEX i) {return m_ModCommands[i];}
- //Returns modcommand from (floor[i/channelCount], i%channelCount)
-
- MODCOMMAND& GetModCommand(ROWINDEX r, CHANNELINDEX c) {return m_ModCommands[r*GetNumChannels()+c];}
- const MODCOMMAND& GetModCommand(ROWINDEX r, CHANNELINDEX c) const {return m_ModCommands[r*GetNumChannels()+c];}
-
-
-//BEGIN: DATA
-private:
- MODCOMMAND* m_ModCommands;
- ROWINDEX m_Rows;
- CPatternContainer& m_rPatternContainer;
-//END: DATA
-};
-
-
-
-#endif
Deleted: branches/devBranch_1_17_03/mptrack/patternContainer.cpp
===================================================================
--- branches/devBranch_1_17_03/mptrack/patternContainer.cpp 2008-08-16 17:24:05 UTC (rev 219)
+++ branches/devBranch_1_17_03/mptrack/patternContainer.cpp 2008-08-17 11:30:18 UTC (rev 220)
@@ -1,87 +0,0 @@
-#include "stdafx.h"
-#include "patternContainer.h"
-#include "sndfile.h"
-#include "mainfrm.h"
-
-int CPatternContainer::Insert(const ROWINDEX rows)
-//---------------------------------------------
-{
- PATTERNINDEX i = 0;
- for(i = 0; i<m_Patterns.size(); i++)
- if(!m_Patterns[i]) break;
- if(Insert(i, rows))
- return -1;
- else return i;
-
-}
-
-
-bool CPatternContainer::Insert(const PATTERNINDEX index, const ROWINDEX rows)
-//---------------------------------------------------------------
-{
- const CModSpecifications& specs = m_rSndFile.GetModSpecifications();
- if(index >= specs.patternsMax || index > m_Patterns.size() || rows > specs.patternRowsMax)
- return true;
- if(index < m_Patterns.size() && m_Patterns[index])
- return true;
-
- if(index == m_Patterns.size())
- {
- if(index < specs.patternsMax)
- m_Patterns.push_back(MODPATTERN(*this));
- else
- {
- ErrorBox(IDS_ERR_TOOMANYPAT, CMainFrame::GetMainFrame());
- return true;
- }
- }
-
- m_Patterns[index] = CSoundFile::AllocatePattern(rows, m_rSndFile.m_nChannels);
- m_Patterns[index].m_Rows = rows;
-
- if(!m_Patterns[index]) return true;
-
- return false;
-}
-
-bool CPatternContainer::Remove(const PATTERNINDEX ipat)
-//----------------------------------------------
-{
- if(ipat >= m_Patterns.size())
- return true;
-
- return m_Patterns[ipat].ClearData();
-}
-
-PATTERNINDEX CPatternContainer::GetIndex(const MODPATTERN* const pPat) const
-//------------------------------------------------------------------
-{
- const PATTERNINDEX endI = static_cast<PATTERNINDEX>(m_Patterns.size());
- for(PATTERNINDEX i = 0; i<endI; i++)
- if(&m_Patterns[i] == pPat) return i;
-
- return endI;
-}
-
-
-void CPatternContainer::ResizeArray(const PATTERNINDEX newSize)
-//-------------------------------------------------------------
-{
- if(Size() <= newSize)
- m_Patterns.resize(newSize, MODPATTERN(*this));
- else
- {
- for(PATTERNINDEX i = Size(); i > newSize; i--) Remove(i-1);
- m_Patterns.resize(newSize, MODPATTERN(*this));
- }
-}
-
-
-void CPatternContainer::OnModTypeChanged(const MODTYPE /*oldtype*/)
-//----------------------------------------------------------
-{
- const CModSpecifications specs = m_rSndFile.GetModSpecifications();
- if(specs.patternsMax < Size()) ResizeArray(max(MAX_PATTERNS, specs.patternsMax));
- else if(Size() < MAX_PATTERNS) ResizeArray(MAX_PATTERNS);
-}
-
Deleted: branches/devBranch_1_17_03/mptrack/patternContainer.h
===================================================================
--- branches/devBranch_1_17_03/mptrack/patternContainer.h 2008-08-16 17:24:05 UTC (rev 219)
+++ branches/devBranch_1_17_03/mptrack/patternContainer.h 2008-08-17 11:30:18 UTC (rev 220)
@@ -1,71 +0,0 @@
-#ifdef __SNDFILE_H
-
-#ifndef PATTERNCONTAINER_H
-#define PATTERNCONTAINER_H
-
-#include "pattern.h"
-#include <limits>
-
-class CSoundFile;
-typedef CPattern MODPATTERN;
-
-//=====================
-class CPatternContainer
-//=====================
-{
-//BEGIN: TYPEDEFS
-public:
- typedef vector<MODPATTERN> PATTERNVECTOR;
-//END: TYPEDEFS
-
-
-//BEGIN: OPERATORS
-public:
- //To mimic old pattern == MODCOMMAND* behavior.
- MODPATTERN& operator[](const int pat) {return m_Patterns[pat];}
- const MODPATTERN& operator[](const int pat) const {return m_Patterns[pat];}
-//END: OPERATORS
-
-//BEGIN: INTERFACE METHODS
-public:
- CPatternContainer(CSoundFile& sndFile) : m_rSndFile(sndFile) {m_Patterns.assign(MAX_PATTERNS, MODPATTERN(*this));}
-
- //Note: No memory handling here.
- void ClearPatterns() {m_Patterns.assign(m_Patterns.size(), MODPATTERN(*this));}
-
- //Insert (default)pattern to given position. If pattern already exists at that position,
- //ignoring request.
- bool Insert(const PATTERNINDEX index, const ROWINDEX rows);
-
- //Insert pattern to position with the lowest index, and return that index, -1
- //on failure.
- int Insert(const ROWINDEX rows);
-
- //Remove pattern from given position. Currently it actually makes the pattern
- //'invisible' - the pattern data is cleared but the actual pattern object won't get removed.
- bool Remove(const PATTERNINDEX index);
-
- PATTERNINDEX Size() const {return static_cast<PATTERNINDEX>(m_Patterns.size());}
-
- CSoundFile& GetSoundFile() {return m_rSndFile;}
-
- //Returns the index of given pattern, Size() if not found.
- PATTERNINDEX GetIndex(const MODPATTERN* const pPat) const;
-
- void ResizeArray(const PATTERNINDEX newSize);
-
- void OnModTypeChanged(const MODTYPE oldtype);
-
-//END: INTERFACE METHODS
-
-
-//BEGIN: DATA MEMBERS
-private:
- PATTERNVECTOR m_Patterns;
- CSoundFile& m_rSndFile;
-//END: DATA MEMBERS
-
-};
-
-#endif
-#endif
Modified: branches/devBranch_1_17_03/mptrack/test/test.cpp
===================================================================
--- branches/devBranch_1_17_03/mptrack/test/test.cpp 2008-08-16 17:24:05 UTC (rev 219)
+++ branches/devBranch_1_17_03/mptrack/test/test.cpp 2008-08-17 11:30:18 UTC (rev 220)
@@ -5,6 +5,7 @@
#include "stdafx.h"
#include "test.h"
+#include "../../soundlib/Sndfile.h"
#include "../version.h"
#include "../misc_util.h"
@@ -41,6 +42,7 @@
void TestVersion();
+void TestMisc();
@@ -49,10 +51,19 @@
//------------
{
DO_TEST(TestVersion);
-
+ DO_TEST(TestMisc);
MessageBox(0, "Tests were run", "Testing", MB_ICONINFORMATION);
}
+
+void TestMisc()
+{
+ STATIC_ASSERT(SMP_16BIT == CHN_16BIT);
+ STATIC_ASSERT(SMP_STEREO == CHN_STEREO);
+ STATIC_ASSERT( sizeof(SNDMIXPLUGININFO) == 128 ); //Comment right after the struct said: "Size should be 128"
+ VERIFY_EQUAL( (MAX_BASECHANNELS >= MPTM_SPECS.channelsMax), true );
+}
+
void TestVersion()
//----------------
{
Modified: branches/devBranch_1_17_03/mptrack/test/test.h
===================================================================
--- branches/devBranch_1_17_03/mptrack/test/test.h 2008-08-16 17:24:05 UTC (rev 219)
+++ branches/devBranch_1_17_03/mptrack/test/test.h 2008-08-17 11:30:18 UTC (rev 220)
@@ -1,7 +1,7 @@
#ifndef _TEST_H
#define _TEST_H
-//#define ENABLE_TESTS
+#define ENABLE_TESTS
namespace MptTest
{
Copied: branches/devBranch_1_17_03/soundlib/OrderToPatternTable.cpp (from rev 218, branches/devBranch_1_17_03/mptrack/OrderToPatternTable.cpp)
===================================================================
--- branches/devBranch_1_17_03/soundlib/OrderToPatternTable.cpp (rev 0)
+++ branches/devBranch_1_17_03/soundlib/OrderToPatternTable.cpp 2008-08-17 11:30:18 UTC (rev 220)
@@ -0,0 +1,180 @@
+#include "stdafx.h"
+#include "sndfile.h"
+#include "ordertopatterntable.h"
+
+DWORD COrderToPatternTable::Unserialize(const BYTE* const src, const DWORD memLength)
+//-------------------------------------------------------------------------
+{
+ if(memLength < 2 + 4) return 0;
+ uint16 version = 0;
+ uint32 s = 0;
+ DWORD memPos = 0;
+ memcpy(&version, src, sizeof(version));
+ memPos += sizeof(version);
+ if(version != 0) return memPos;
+ memcpy(&s, src+memPos, sizeof(s));
+ memPos += sizeof(s);
+ if(s > 65000) return true;
+ if(memLength < memPos+s*4) return memPos;
+
+ resize(s);
+ for(size_t i = 0; i<s; i++, memPos +=4 )
+ {
+ uint32 temp;
+ memcpy(&temp, src+memPos, 4);
+ (*this)[i] = static_cast<PATTERNINDEX>(temp);
+ }
+ return memPos;
+}
+
+
+size_t COrderToPatternTable::WriteToByteArray(BYTE* dest, const UINT numOfBytes, const UINT destSize)
+//-----------------------------------------------------------------------------
+{
+ if(numOfBytes > destSize) return true;
+ if(size() < numOfBytes) resize(numOfBytes, 0xFF);
+ UINT i = 0;
+ for(i = 0; i<numOfBytes; i++)
+ {
+ dest[i] = static_cast<BYTE>((*this)[i]);
+ }
+ return i; //Returns the number of bytes written.
+}
+
+
+size_t COrderToPatternTable::WriteAsByte(FILE* f, const UINT count)
+//---------------------------------------------------------------
+{
+ if(size() < count) resize(count, GetInvalidPatIndex());
+
+ size_t i = 0;
+
+ for(i = 0; i<count; i++)
+ {
+ const PATTERNINDEX pat = (*this)[i];
+ BYTE temp = static_cast<BYTE>((*this)[i]);
+
+ if(pat > 0xFD)
+ {
+ if(pat == GetInvalidPatIndex()) temp = 0xFF;
+ else temp = 0xFE;
+ }
+ fwrite(&temp, 1, 1, f);
+ }
+ return i; //Returns the number of bytes written.
+}
+
+bool COrderToPatternTable::ReadAsByte(const BYTE* pFrom, const int howMany, const int memLength)
+//-------------------------------------------------------------------------
+{
+ if(howMany < 0 || howMany > memLength) return true;
+ if(m_rSndFile.GetType() != MOD_TYPE_MPT && howMany > MAX_ORDERS) return true;
+
+ if(size() < static_cast<size_t>(howMany))
+ resize(howMany, GetInvalidPatIndex());
+
+ for(int i = 0; i<howMany; i++, pFrom++)
+ (*this)[i] = *pFrom;
+ return false;
+}
+
+
+bool COrderToPatternTable::NeedsExtraDatafield() const
+//----------------------------------------------
+{
+ if(m_rSndFile.GetType() == MOD_TYPE_MPT && m_rSndFile.Patterns.Size() > 0xFD)
+ return true;
+ else
+ return false;
+}
+
+
+void COrderToPatternTable::OnModTypeChanged(const MODTYPE oldtype)
+//----------------------------------------------------------------
+{
+ const CModSpecifications specs = m_rSndFile.GetModSpecifications();
+
+ //Resize orderlist if needed. Because old orderlist had MAX_ORDERS(256) elements, not making it
+ //smaller than that even if the modtype doesn't support that many orders.
+ if(specs.ordersMax < GetCount())
+ {
+ resize(max(MAX_ORDERS, specs.ordersMax));
+ for(ORDERINDEX i = GetCount(); i>specs.ordersMax; --i) (*this)[i-1] = GetInvalidPatIndex();
+ }
+
+ //Replace items used to denote end of song/skip order.
+ replace(begin(), end(), GetInvalidPatIndex(oldtype), GetInvalidPatIndex());
+ replace(begin(), end(), GetIgnoreIndex(oldtype), GetIgnoreIndex());
+}
+
+
+ORDERINDEX COrderToPatternTable::GetNextOrderIgnoringSkips(const ORDERINDEX start) const
+//-------------------------------------------------------------------------------------
+{
+ const ORDERINDEX count = GetCount();
+ if(count == 0) return 0;
+ ORDERINDEX next = min(count-1, start+1);
+ while(next+1 < count && (*this)[next] == GetIgnoreIndex()) next++;
+ return next;
+}
+
+ORDERINDEX COrderToPatternTable::GetPreviousOrderIgnoringSkips(const ORDERINDEX start) const
+//-------------------------------------------------------------------------------------
+{
+ const ORDERINDEX count = GetCount();
+ if(start == 0 || count == 0) return 0;
+ ORDERINDEX prev = min(start-1, count-1);
+ while(prev > 0 && (*this)[prev] == GetIgnoreIndex()) prev--;
+ return prev;
+}
+
+
+PATTERNINDEX COrderToPatternTable::GetInvalidPatIndex(const MODTYPE type) {return type == MOD_TYPE_MPT ? 65535 : 0xFF;}
+PATTERNINDEX COrderToPatternTable::GetIgnoreIndex(const MODTYPE type) {return type == MOD_TYPE_MPT ? 65534 : 0xFE;}
+
+PATTERNINDEX COrderToPatternTable::GetInvalidPatIndex() const {return GetInvalidPatIndex(m_rSndFile.GetType());}
+PATTERNINDEX COrderToPatternTable::GetIgnoreIndex() const {return GetIgnoreIndex(m_rSndFile.GetType());}
+
+
+
+
+//--------------------------------------------------
+//--------------------------------------------------
+//--------------------------------------------------
+
+using namespace srlztn;
+
+void COrderSerialization::ProWrite(OUTSTREAM& ostrm) const
+//--------------------------------------------------------
+{
+ uint16 size = static_cast<uint16>(m_rOrders.size());
+ ostrm.write(reinterpret_cast<const char*>(&size), 2);
+ const COrderToPatternTable::const_iterator endIter = m_rOrders.end();
+ for(COrderToPatternTable::const_iterator citer = m_rOrders.begin(); citer != endIter; citer++)
+ {
+ const uint16 temp = static_cast<uint16>(*citer);
+ ostrm.write(reinterpret_cast<const char*>(&temp), 2);
+ }
+}
+
+
+void COrderSerialization::ProRead(INSTREAM& istrm, const uint64 /*datasize*/)
+//---------------------------------------------------------------------------
+{
+ uint16 size;
+ istrm.read(reinterpret_cast<char*>(&size), 2);
+ if(size > MPTM_SPECS.ordersMax) size = MPTM_SPECS.ordersMax;
+ m_rOrders.resize(size);
+ if(size == 0) {m_rOrders.assign(MAX_ORDERS, m_rOrders.GetInvalidPatIndex()); return;}
+
+ const COrderToPatternTable::const_iterator endIter = m_rOrders.end();
+ for(COrderToPatternTable::iterator iter = m_rOrders.begin(); iter != endIter; iter++)
+ {
+ uint16 temp;
+ istrm.read(reinterpret_cast<char*>(&temp), 2);
+ *iter = temp;
+ }
+}
+
+
+
Property changes on: branches/devBranch_1_17_03/soundlib/OrderToPatternTable.cpp
___________________________________________________________________
Added: svn:mergeinfo
+
Copied: branches/devBranch_1_17_03/soundlib/OrderToPatternTable.h (from rev 218, branches/devBranch_1_17_03/mptrack/OrderToPatternTable.h)
===================================================================
--- branches/devBranch_1_17_03/soundlib/OrderToPatternTable.h (rev 0)
+++ branches/devBranch_1_17_03/soundlib/OrderToPatternTable.h 2008-08-17 11:30:18 UTC (rev 220)
@@ -0,0 +1,70 @@
+#ifndef ORDERTOPATTERNTABLE_H
+#define ORDERTOPATTERNTABLE_H
+
+#include "../mptrack/serialization_utils.h"
+#include <vector>
+using std::vector;
+
+class CSoundFile;
+class COrderToPatternTable;
+
+
+
+#pragma warning(disable:4244) //conversion from 'type1' to 'type2', possible loss of data
+
+class COrderSerialization : public srlztn::ABCSerializationStreamer
+//=========================================================
+{
+public:
+ COrderSerialization(COrderToPatternTable& ordertable) : m_rOrders(ordertable) {}
+ virtual void ProWrite(srlztn::OUTSTREAM& ostrm) const;
+ virtual void ProRead(srlztn::INSTREAM& istrm, const uint64 /*datasize*/);
+private:
+ COrderToPatternTable& m_rOrders;
+};
+
+//==============================================
+class COrderToPatternTable : public vector<PATTERNINDEX>
+//==============================================
+{
+public:
+ COrderToPatternTable(const CSoundFile& sndFile) : m_rSndFile(sndFile) {}
+
+ bool ReadAsByte(const BYTE* pFrom, const int howMany, const int memLength);
+
+ size_t WriteAsByte(FILE* f, const UINT count);
+
+ size_t WriteToByteArray(BYTE* dest, const UINT numOfBytes, const UINT destSize);
+
+ ORDERINDEX GetCount() const {return size();}
+
+ //Deprecated function used for MPTm's created in 1.17.02.46 - 1.17.02.48.
+ DWORD Unserialize(const BYTE* const src, const DWORD memLength);
+
+ //Returns true if the IT orderlist datafield is not sufficient to store orderlist information.
+ bool NeedsExtraDatafield() const;
+
+ void OnModTypeChanged(const MODTYPE oldtype);
+
+ PATTERNINDEX GetInvalidPatIndex() const; //To correspond 0xFF
+ static PATTERNINDEX GetInvalidPatIndex(const MODTYPE type);
+
+ PATTERNINDEX GetIgnoreIndex() const; //To correspond 0xFE
+ static PATTERNINDEX GetIgnoreIndex(const MODTYPE type);
+
+ //Returns the previous/next order ignoring skip indeces(+++).
+ //If no previous/next order exists, return first/last order, and zero
+ //when orderlist is empty.
+ ORDERINDEX GetNextOrderIgnoringSkips(const ORDERINDEX start) const;
+ ORDERINDEX GetPreviousOrderIgnoringSkips(const ORDERINDEX start) const;
+
+ COrderSerialization* NewReadWriteObject() {return new COrderSerialization(*this);}
+
+private:
+ const CSoundFile& m_rSndFile;
+};
+
+#pragma warning(default:4244)
+
+#endif
+
Property changes on: branches/devBranch_1_17_03/soundlib/OrderToPatternTable.h
___________________________________________________________________
Added: svn:mergeinfo
+
Copied: branches/devBranch_1_17_03/soundlib/PlaybackEventer.cpp (from rev 218, branches/devBranch_1_17_03/mptrack/PlaybackEventer.cpp)
===================================================================
--- branches/devBranch_1_17_03/soundlib/PlaybackEventer.cpp (rev 0)
+++ branches/devBranch_1_17_03/soundlib/PlaybackEventer.cpp 2008-08-17 11:30:18 UTC (rev 220)
@@ -0,0 +1,31 @@
+#include "stdafx.h"
+#include "PlaybackEventer.h"
+#include "sndfile.h"
+
+CPlaybackEventer::~CPlaybackEventer()
+//---------------------------------
+{
+}
+
+void CPlaybackEventer::PatternTranstionChnSolo(const CHANNELINDEX chnIndex)
+//-------------------------------------------------------------------------
+{
+ if(chnIndex >= m_rSndFile.m_nChannels)
+ return;
+
+ for(CHANNELINDEX i = 0; i<m_rSndFile.m_nChannels; i++)
+ {
+ m_rSndFile.m_bChannelMuteTogglePending[i] = (m_rSndFile.ChnSettings[i].dwFlags & CHN_MUTE) ? false : true;
+ }
+ m_rSndFile.m_bChannelMuteTogglePending[chnIndex] = (m_rSndFile.ChnSettings[chnIndex].dwFlags & CHN_MUTE) ? true : false;
+}
+
+
+void CPlaybackEventer::PatternTransitionChnUnmuteAll()
+//----------------------------------------------------
+{
+ for(CHANNELINDEX i = 0; i<m_rSndFile.m_nChannels; i++)
+ {
+ m_rSndFile.m_bChannelMuteTogglePending[i] = (m_rSndFile.ChnSettings[i].dwFlags & CHN_MUTE) ? true : false;
+ }
+}
\ No newline at end of file
Property changes on: branches/devBranch_1_17_03/soundlib/PlaybackEventer.cpp
___________________________________________________________________
Added: svn:mergeinfo
+
Copied: branches/devBranch_1_17_03/soundlib/PlaybackEventer.h (from rev 218, branches/devBranch_1_17_03/mptrack/PlaybackEventer.h)
===================================================================
--- branches/devBranch_1_17_03/soundlib/PlaybackEventer.h (rev 0)
+++ branches/devBranch_1_17_03/soundlib/PlaybackEventer.h 2008-08-17 11:30:18 UTC (rev 220)
@@ -0,0 +1,25 @@
+#ifndef PLAYBACKEVENTER_H
+#define PLAYBACKEVENTER_H
+
+#include "pattern.h"
+
+class CSoundFile;
+
+//====================
+class CPlaybackEventer
+//====================
+{
+public:
+ CPlaybackEventer(CSoundFile& sndf) : m_rSndFile(sndf) {}
+ ~CPlaybackEventer();
+
+ //SetPatternEvent(const PATTERNINDEX pattern, const ROWINDEX row, const CHANNELINDEX column);
+
+ void PatternTranstionChnSolo(const CHANNELINDEX chnIndex);
+ void PatternTransitionChnUnmuteAll();
+
+private:
+ CSoundFile& m_rSndFile;
+};
+
+#endif
Property changes on: branches/devBranch_1_17_03/soundlib/PlaybackEventer.h
___________________________________________________________________
Added: svn:mergeinfo
+
Modified: branches/devBranch_1_17_03/soundlib/Sndfile.cpp
===================================================================
--- branches/devBranch_1_17_03/soundlib/Sndfile.cpp 2008-08-16 17:24:05 UTC (rev 219)
+++ branches/devBranch_1_17_03/soundlib/Sndfile.cpp 2008-08-17 11:30:18 UTC (rev 220)
@@ -406,7 +406,7 @@
m_lpszSongComments = NULL;
m_nFreqFactor = m_nTempoFactor = 128;
m_nMasterVolume = 128;
- m_nMinPeriod = 0x20;
+ m_nMinPeriod = MIN_PERIOD;
m_nMaxPeriod = 0x7FFF;
m_nRepeatCount = 0;
m_nSeqOverride = 0;
Modified: branches/devBranch_1_17_03/soundlib/Sndfile.h
===================================================================
--- branches/devBranch_1_17_03/soundlib/Sndfile.h 2008-08-16 17:24:05 UTC (rev 219)
+++ branches/devBranch_1_17_03/soundlib/Sndfile.h 2008-08-17 11:30:18 UTC (rev 220)
@@ -6,295 +6,47 @@
*
* Authors: Olivier Lapicque <oli...@jp...>
*/
+
+#ifndef __SNDFILE_H
+#define __SNDFILE_H
+
#include "../mptrack/SoundFilePlayConfig.h"
#include "tuning.h"
-#include "mod_specifications.h"
+#include "modspecifications.h"
#include <vector>
#include <bitset>
#include "midi.h"
using std::bitset;
-#ifndef __SNDFILE_H
-#define __SNDFILE_H
#ifndef LPCBYTE
-typedef const BYTE * LPCBYTE;
+ typedef const BYTE * LPCBYTE;
#endif
-// -> CODE#0008
-// -> DESC="#define to set pattern size"
-#define MAX_PATTERN_ROWS 1024
-// -! BEHAVIOUR_CHANGE#0008
-
#define MOD_AMIGAC2 0x1AB
-// -> CODE#0006
-// -> DESC="misc quantity changes"
-#define MAX_SAMPLE_LENGTH 0x10000000 // 0x04000000 (64MB -> now 256MB)
-// -! BEHAVIOUR_CHANGE#0006
-#define MAX_SAMPLE_RATE 100000
-#define MAX_ORDERS 256
-#define MAX_PATTERNS 240
-#define MAX_SAMPLES 4000
-// -> CODE#0006
-// -> DESC="misc quantity changes"
-#define MAX_INSTRUMENTS 256 //200
-// -! BEHAVIOUR_CHANGE#0006
-//#ifdef FASTSOUNDLIB
-//#define MAX_CHANNELS 80
-//#else
-// -> CODE#0006
-// -> DESC="misc quantity changes"
-#define MAX_CHANNELS 256 //200 //Note: MAX_BASECHANNELS defines max pattern channels
-// -! BEHAVIOUR_CHANGE#0006
-//#endif
-// -> CODE#0006
-// -> DESC="misc quantity changes"
-//#ifdef FASTSOUNDLIB
-//#define MAX_BASECHANNELS 64
-//#else
-#define MAX_BASECHANNELS 127 //Max pattern channels.
-//#endif
-// -! BEHAVIOUR_CHANGE#0006
-#define MAX_ENVPOINTS 32
-#define MIN_PERIOD 0x0020
-#define MAX_PERIOD 0xFFFF
-#define MAX_PATTERNNAME 32
-#define MAX_CHANNELNAME 20
#define MAX_INFONAME 80
-#define MAX_EQ_BANDS 6
-// -> CODE#0006
-// -> DESC="misc quantity changes"
+
#define MAX_MIXPLUGINS 100 //50
-// -! BEHAVIOUR_CHANGE#0006
#define MAX_PLUGPRESETS 1000 //rewbs.plugPresets
+#define MAX_INSTRUMENTS 256 //200
+#define MAX_SAMPLES 4000
+#define MAX_PATTERNS 240 //Old maximum patterncount.
+#define MAX_ORDERS 256 //Old maximum ordercount.
-#define MOD_TYPE_NONE 0x00
-#define MOD_TYPE_MOD 0x01
-#define MOD_TYPE_S3M 0x02
-#define MOD_TYPE_XM 0x04
-#define MOD_TYPE_MED 0x08
-#define MOD_TYPE_MTM 0x10
-#define MOD_TYPE_IT 0x20
-#define MOD_TYPE_669 0x40
-#define MOD_TYPE_ULT 0x80
-#define MOD_TYPE_STM 0x100
-#define MOD_TYPE_FAR 0x200
-#define MOD_TYPE_WAV 0x400
-#define MOD_TYPE_AMF 0x800
-#define MOD_TYPE_AMS 0x1000
-#define MOD_TYPE_DSM 0x2000
-#define MOD_TYPE_MDL 0x4000
-#define MOD_TYPE_OKT 0x8000
-#define MOD_TYPE_MID 0x10000
-#define MOD_TYPE_DMF 0x20000
-#define MOD_TYPE_PTM 0x40000
-#define MOD_TYPE_DBM 0x80000
-#define MOD_TYPE_MT2 0x100000
-#define MOD_TYPE_AMF0 0x200000
-#define MOD_TYPE_PSM 0x400000
-#define MOD_TYPE_J2B 0x800000
-#define MOD_TYPE_MPT 0x1000000
-#define MOD_TYPE_UMX 0x80000000 // Fake type
-#define MAX_MODTYPE 24
+#ifdef FASTSOUNDLIB
+ #define MAX_CHANNELS 80
+#else
+ #define MAX_CHANNELS 256 //200 //Note: MAX_BASECHANNELS defines max pattern channels
+#endif
+#ifdef FASTSOUNDLIB
+ #define MAX_BASECHANNELS 64
+#else
+ #define MAX_BASECHANNELS 127 //Max pattern channels.
+#endif
-// Channel flags:
-// Bits 0-7: Sample Flags
-#define CHN_16BIT 0x01
-#define CHN_LOOP 0x02
-#define CHN_PINGPONGLOOP 0x04
-#define CHN_SUSTAINLOOP 0x08
-#define CHN_PINGPONGSUSTAIN 0x10
-#define CHN_PANNING 0x20
-#define CHN_STEREO 0x40
-#define CHN_PINGPONGFLAG 0x80 //When flag is on, bidiloop is processed backwards?
-// Bits 8-31: Channel Flags
-#define CHN_MUTE 0x100
-#define CHN_KEYOFF 0x200
-#define CHN_NOTEFADE 0x400
-#define CHN_SURROUND 0x800
-#define CHN_NOIDO 0x1000
-#define CHN_HQSRC 0x2000
-#define CHN_FILTER 0x4000
-#define CHN_VOLUMERAMP 0x8000
-#define CHN_VIBRATO 0x10000
-#define CHN_TREMOLO 0x20000
-#define CHN_PANBRELLO 0x40000
-#define CHN_PORTAMENTO 0x80000
-#define CHN_GLISSANDO 0x100000
-#define CHN_VOLENV 0x200000
-#define CHN_PANENV 0x400000
-#define CHN_PITCHENV 0x800000
-#define CHN_FASTVOLRAMP 0x1000000
-#define CHN_EXTRALOUD 0x2000000
-#define CHN_REVERB 0x4000000
-#define CHN_NOREVERB 0x8000000
-// -> CODE#0012
-// -> DESC="midi keyboard split"
-#define CHN_SOLO 0x10000000
-// -! NEW_FEATURE#0012
-
-// -> CODE#0015
-// -> DESC="channels management dlg"
-#define CHN_NOFX 0x20000000
-// -! NEW_FEATURE#0015
-
-#define CHN_SYNCMUTE 0x40000000
-
-#define ENV_VOLUME 0x0001
-#define ENV_VOLSUSTAIN 0x0002
-#define ENV_VOLLOOP 0x0004
-#define ENV_PANNING 0x0008
-#define ENV_PANSUSTAIN 0x0010
-#define ENV_PANLOOP 0x0020
-#define ENV_PITCH 0x0040
-#define ENV_PITCHSUSTAIN 0x0080
-#define ENV_PITCHLOOP 0x0100
-#define ENV_SETPANNING 0x0200
-#define ENV_FILTER 0x0400
-#define ENV_VOLCARRY 0x0800
-#define ENV_PANCARRY 0x1000
-#define ENV_PITCHCARRY 0x2000
-#define ENV_MUTE 0x4000
-
-#define CMD_NONE 0
-#define CMD_ARPEGGIO 1
-#define CMD_PORTAMENTOUP 2
-#define CMD_PORTAMENTODOWN 3
-#define CMD_TONEPORTAMENTO 4
-#define CMD_VIBRATO 5
-#define CMD_TONEPORTAVOL 6
-#define CMD_VIBRATOVOL 7
-#define CMD_TREMOLO 8
-#define CMD_PANNING8 9
-#define CMD_OFFSET 10
-#define CMD_VOLUMESLIDE 11
-#define CMD_POSITIONJUMP 12
-#define CMD_VOLUME 13
-#define CMD_PATTERNBREAK 14
-#define CMD_RETRIG 15
-#define CMD_SPEED 16
-#define CMD_TEMPO 17
-#define CMD_TREMOR 18
-#define CMD_MODCMDEX 19
-#define CMD_S3MCMDEX 20
-#define CMD_CHANNELVOLUME 21
-#define CMD_CHANNELVOLSLIDE 22
-#define CMD_GLOBALVOLUME 23
-#define CMD_GLOBALVOLSLIDE 24
-#define CMD_KEYOFF 25
-#define CMD_FINEVIBRATO 26
-#define CMD_PANBRELLO 27
-#define CMD_XFINEPORTAUPDOWN 28
-#define CMD_PANNINGSLIDE 29
-#define CMD_SETENVPOSITION 30
-#define CMD_MIDI 31
-#define CMD_SMOOTHMIDI 32 //rewbs.smoothVST
-#define CMD_VELOCITY 33 //rewbs.velocity
-// -> CODE#0010
-// -> DESC="add extended parameter mechanism to pattern effects"
-#define CMD_XPARAM 34
-// -! NEW_FEATURE#0010
-
-// Filter Modes
-#define FLTMODE_UNCHANGED 0xFF
-#define FLTMODE_LOWPASS 0
-#define FLTMODE_HIGHPASS 1
-#define FLTMODE_BANDPASS 2
-
-// Volume Column commands
-#define VOLCMD_VOLUME 1
-#define VOLCMD_PANNING 2
-#define VOLCMD_VOLSLIDEUP 3
-#define VOLCMD_VOLSLIDEDOWN 4
-#define VOLCMD_FINEVOLUP 5
-#define VOLCMD_FINEVOLDOWN 6
-#define VOLCMD_VIBRATOSPEED 7
-#define VOLCMD_VIBRATO 8
-#define VOLCMD_PANSLIDELEFT 9
-#define VOLCMD_PANSLIDERIGHT 10
-#define VOLCMD_TONEPORTAMENTO 11
-#define VOLCMD_PORTAUP 12
-#define VOLCMD_PORTADOWN 13
-#define VOLCMD_VELOCITY 14 //rewbs.velocity
-#define VOLCMD_OFFSET 15 //rewbs.volOff
-
-#define RSF_16BIT 0x04
-#define RSF_STEREO 0x08
-
-#define RS_PCM8S 0 // 8-bit signed
-#define RS_PCM8U 1 // 8-bit unsigned
-#define RS_PCM8D 2 // 8-bit delta values
-#define RS_ADPCM4 3 // 4-bit ADPCM-packed
-#define RS_PCM16D 4 // 16-bit delta values
-#define RS_PCM16S 5 // 16-bit signed
-#define RS_PCM16U 6 // 16-bit unsigned
-#define RS_PCM16M 7 // 16-bit motorola order
-#define RS_STPCM8S (RS_PCM8S|RSF_STEREO) // stereo 8-bit signed
-#define RS_STPCM8U (RS_PCM8U|RSF_STEREO) // stereo 8-bit unsigned
-#define RS_STPCM8D (RS_PCM8D|RSF_STEREO) // stereo 8-bit delta values
-#define RS_STPCM16S (RS_PCM16S|RSF_STEREO) // stereo 16-bit signed
-#define RS_STPCM16U (RS_PCM16U|RSF_STEREO) // stereo 16-bit unsigned
-#define RS_STPCM16D (RS_PCM16D|RSF_STEREO) // stereo 16-bit delta values
-#define RS_STPCM16M (RS_PCM16M|RSF_STEREO) // stereo 16-bit signed big endian
-// IT 2.14 compressed samples
-#define RS_IT2148 0x10
-#define RS_IT21416 0x14
-#define RS_IT2158 0x12
-#define RS_IT21516 0x16
-// AMS Packed Samples
-#define RS_AMS8 0x11
-#define RS_AMS16 0x15
-// DMF Huffman compression
-#define RS_DMF8 0x13
-#define RS_DMF16 0x17
-// MDL Huffman compression
-#define RS_MDL8 0x20
-#define RS_MDL16 0x24
-#define RS_PTM8DTO16 0x25
-// Stereo Interleaved Samples
-#define RS_STIPCM8S (RS_PCM8S|0x40|RSF_STEREO) // stereo 8-bit signed
-#define RS_STIPCM8U (RS_PCM8U|0x40|RSF_STEREO) // stereo 8-bit unsigned
-#define RS_STIPCM16S (RS_PCM16S|0x40|RSF_STEREO) // stereo 16-bit signed
-#define RS_STIPCM16U (RS_PCM16U|0x40|RSF_STEREO) // stereo 16-bit unsigned
-#define RS_STIPCM16M (RS_PCM16M|0x40|RSF_STEREO) // stereo 16-bit signed big endian
-// 24-bit signed
-#define RS_PCM24S (RS_PCM16S|0x80) // mono 24-bit signed
-#define RS_STIPCM24S (RS_PCM16S|0x80|RSF_STEREO) // stereo 24-bit signed
-// 32-bit
-#define RS_PCM32S (RS_PCM16S|0xC0) // mono 32-bit signed
-#define RS_STIPCM32S (RS_PCM16S|0xC0|RSF_STEREO) // stereo 32-bit signed
-
-
-
-// NNA types (New Note Action)
-#define NNA_NOTECUT 0
-#define NNA_CONTINUE 1
-#define NNA_NOTEOFF 2
-#define NNA_NOTEFADE 3
-
-// DCT types (Duplicate Check Types)
-#define DCT_NONE 0
-#define DCT_NOTE 1
-#define DCT_SAMPLE 2
-#define DCT_INSTRUMENT 3
-#define DCT_PLUGIN 4 //rewbs.VSTiNNA
-
-// DNA types (Duplicate Note Action)
-#define DNA_NOTECUT 0
-#define DNA_NOTEOFF 1
-#define DNA_NOTEFADE 2
-
-// Mixer Hardware-Dependent features
-#define SYSMIX_ENABLEMMX 0x01
-#define SYSMIX_SLOWCPU 0x02
-#define SYSMIX_FASTCPU 0x04
-#define SYSMIX_MMXEX 0x08
-#define SYSMIX_3DNOW 0x10
-#define SYSMIX_SSE 0x20
-
// Module flags
#define SONG_EMBEDMIDICFG 0x0001
#define SONG_FASTVOLSLIDES 0x0002
@@ -313,499 +65,26 @@
#define SONG_SURROUNDPAN 0x4000
#define SONG_EXFILTERRANGE 0x8000
#define SONG_AMIGALIMITS 0x10000
-// -> CODE#0023
-// -> DESC="IT project files (.itp)"
-#define SONG_ITPROJECT 0x20000
-#define SONG_ITPEMBEDIH 0x40000
-// -! NEW_FEATURE#0023
+#define SONG_ITPROJECT 0x20000 //.itp
+#define SONG_ITPEMBEDIH 0x40000 //.itp
-// Global Options (Renderer)
-#define SNDMIX_REVERSESTEREO 0x0001
-#define SNDMIX_NOISEREDUCTION 0x0002
-#define SNDMIX_AGC 0x0004
-#define SNDMIX_NORESAMPLING 0x0008
-// SNDMIX_NOLINEARSRCMODE is the default
-//#define SNDMIX_HQRESAMPLER 0x0010 //rewbs.resamplerConf: renamed SNDMIX_HQRESAMPLER to SNDMIX_SPLINESRCMODE
-#define SNDMIX_SPLINESRCMODE 0x0010
-#define SNDMIX_MEGABASS 0x0020
-#define SNDMIX_SURROUND 0x0040
-#define SNDMIX_REVERB 0x0080
-#define SNDMIX_EQ 0x0100
-#define SNDMIX_SOFTPANNING 0x0200
-//#define SNDMIX_ULTRAHQSRCMODE 0x0400 //rewbs.resamplerConf: renamed SNDMIX_ULTRAHQSRCMODE to SNDMIX_POLYPHASESRCMODE
-#define SNDMIX_POLYPHASESRCMODE 0x0400
-#define SNDMIX_FIRFILTERSRCMODE 0x0800 //rewbs: added SNDMIX_FIRFILTERSRCMODE
-//rewbs.resamplerConf: for stuff that applies to cubic spline, polyphase and FIR
-#define SNDMIX_HQRESAMPLER (SNDMIX_SPLINESRCMODE|SNDMIX_POLYPHASESRCMODE|SNDMIX_FIRFILTERSRCMODE)
+#include "mixer.h"
+#include "modsmp.h"
+#include "modins.h"
+#include "modchannel.h"
+#include "modcommand.h"
+#include "mixplug.h"
+#include "pattern.h"
+#include "patternContainer.h"
+#include "ordertopatterntable.h"
+#include "playbackEventer.h"
-////rewbs.resamplerConf: for stuff that applies to polyphase and FIR
-#define SNDMIX_ULTRAHQSRCMODE (SNDMIX_POLYPHASESRCMODE|SNDMIX_FIRFILTERSRCMODE)
-
-// Misc Flags (can safely be turned on or off)
-#define SNDMIX_DIRECTTODISK 0x10000
-#define SNDMIX_ENABLEMMX 0x20000
-#define SNDMIX_NOBACKWARDJUMPS 0x40000
-#define SNDMIX_MAXDEFAULTPAN 0x80000 // Used by the MOD loader
-#define SNDMIX_MUTECHNMODE 0x100000 // Notes are not played on muted channels
-#define SNDMIX_EMULATE_MIX_BUGS 0x200000 // rewbs.emulateMixBugs
-
-#define MAX_GLOBAL_VOLUME 256
-
-// Resampling modes
-enum {
- SRCMODE_NEAREST,
- SRCMODE_LINEAR,
- SRCMODE_SPLINE,
- SRCMODE_POLYPHASE,
- SRCMODE_FIRFILTER, //rewbs.resamplerConf
- SRCMODE_DEFAULT,
- NUM_SRC_MODES
-};
-
-enum {
- ENV_RESET_ALL,
- ENV_RESET_VOL,
- ENV_RESET_PAN,
- ENV_RESET_PITCH,
- ENV_RELEASE_NODE_UNSET=0xFF,
- NOT_YET_RELEASED=-1
-};
-
-enum {
- CHANNEL_ONLY = 0,
- INSTRUMENT_ONLY = 1,
- PRIORITISE_INSTRUMENT = 2,
- PRIORITISE_CHANNEL = 3,
- EVEN_IF_MUTED = false,
- RESPECT_MUTES = true,
-};
-
-//Plugin velocity handling options
-enum PLUGVELOCITYHANDLING
-{
- PLUGIN_VELOCITYHANDLING_CHANNEL = 0,
- PLUGIN_VELOCITYHANDLING_VOLUME
-};
-
-//Plugin volumecommand handling options
-enum PLUGVOLUMEHANDLING
-{
- PLUGIN_VOLUMEHANDLING_MIDI = 0,
- PLUGIN_VOLUMEHANDLING_DRYWET,
- PLUGIN_VOLUMEHANDLING_IGNORE,
-};
-
-// filtermodes
-/*enum {
- INST_FILTERMODE_DEFAULT=0,
- INST_FILTERMODE_HIGHPASS,
- INST_FILTERMODE_LOWPASS,
- INST_NUMFILTERMODES
-};*/
-
-// Sample Struct
-struct MODINSTRUMENT
-{
- UINT nLength,nLoopStart,nLoopEnd;
- //nLength <-> Number of 'frames'?
- UINT nSustainStart, nSustainEnd;
- LPSTR pSample;
- UINT nC4Speed;
- WORD nPan;
- WORD nVolume;
- WORD nGlobalVol;
- WORD uFlags;
- signed char RelativeTone;
- signed char nFineTune;
- BYTE nVibType;
- BYTE nVibSweep;
- BYTE nVibDepth;
- BYTE nVibRate;
- CHAR name[22];
-
- //Should return the size which pSample is at least.
- DWORD GetSampleSizeInBytes() const
- {
- DWORD len = nLength;
- if(uFlags & CHN_16BIT) len *= 2;
- if(uFlags & CHN_STEREO) len *= 2;
- return len;
- }
-};
-
-
-// -> CODE#0027
-// -> DESC="per-instrument volume ramping setup (refered as attack)"
-
-/*---------------------------------------------------------------------------------------------
------------------------------------------------------------------------------------------------
------------------------------------------------------------------------------------------------
-MODULAR STRUCT DECLARATIONS :
------------------------------------------------------------------------------------------------
------------------------------------------------------------------------------------------------
----------------------------------------------------------------------------------------------*/
-
-// Instrument Struct
-struct INSTRUMENTHEADER
-{
- UINT nFadeOut;
- DWORD dwFlags;
- UINT nGlobalVol;
- UINT nPan;
- UINT nVolEnv; //Number of points in the volume envelope
- UINT nPanEnv;
- UINT nPitchEnv;
- BYTE nVolLoopStart;
- BYTE nVolLoopEnd;
- BYTE nVolSustainBegin;
- BYTE nVolSustainEnd;
- BYTE nPanLoopStart;
- BYTE nPanLoopEnd;
- BYTE nPanSustainBegin;
- BYTE nPanSustainEnd;
- BYTE nPitchLoopStart;
- BYTE nPitchLoopEnd;
- BYTE nPitchSustainBegin;
- BYTE nPitchSustainEnd;
- BYTE nNNA;
- BYTE nDCT;
- BYTE nDNA;
- BYTE nPanSwing;
- BYTE nVolSwing;
- BYTE nIFC;
- BYTE nIFR;
- WORD wMidiBank;
- BYTE nMidiProgram;
- BYTE nMidiChannel;
- BYTE nMidiDrumKey;
- signed char nPPS; //Pitch to Pan Separator?
- unsigned char nPPC; //Pitch Centre?
- WORD VolPoints[MAX_ENVPOINTS];
- WORD PanPoints[MAX_ENVPOINTS];
- WORD PitchPoints[MAX_ENVPOINTS];
- BYTE VolEnv[MAX_ENVPOINTS];
- BYTE PanEnv[MAX_ENVPOINTS];
- BYTE PitchEnv[MAX_ENVPOINTS];
- BYTE NoteMap[128];
- WORD Keyboard[128];
- CHAR name[32];
- CHAR filename[12];
- BYTE nMixPlug; //rewbs.instroVSTi
-// -> CODE#0027
-// -> DESC="per-instrument volume ramping setup (refered as attack)"
- USHORT nVolRamp;
-// -! NEW_FEATURE#0027
- UINT nResampling;
- BYTE nCutSwing;
- BYTE nResSwing;
- BYTE nFilterMode;
- BYTE nPitchEnvReleaseNode;
- BYTE nPanEnvReleaseNode;
- BYTE nVolEnvReleaseNode;
- WORD wPitchToTempoLock;
- BYTE nPluginVelocityHandling;
- BYTE nPluginVolumeHandling;
-// !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
-// WHEN adding new members here, ALSO update Sndfile.cpp (instructions near the top of this file)!
-// !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
-
- CTuning* pTuning;
- static CTuning* s_DefaultTuning;
-
- INSTRUMENTHEADER(CTuning* const pT = s_DefaultTuning) : pTuning(pT) {}
-
- void SetTuning(CTuning* pT)
- {
- pTuning = pT;
- }
-
-
-
-};
-
-//INSTRUMENTHEADER;
-
-// -----------------------------------------------------------------------------------------
-// MODULAR INSTRUMENTHEADER FIELD ACCESS : body content at the (near) top of Sndfile.cpp !!!
-// -----------------------------------------------------------------------------------------
+// Modular instrumentheader field access.
extern void WriteInstrumentHeaderStruct(INSTRUMENTHEADER * input, FILE * file);
extern BYTE * GetInstrumentHeaderFieldPointer(INSTRUMENTHEADER * input, __int32 fcode, __int16 fsize);
-// -! NEW_FEATURE#0027
-// --------------------------------------------------------------------------------------------
-// --------------------------------------------------------------------------------------------
-
-
-// Channel Struct
-typedef struct _MODCHANNEL
-{
- // First 32-bytes: Most used mixing information: don't change it
- LPSTR pCurrentSam...
[truncated message content] |
|
From: <rel...@us...> - 2008-08-16 17:24:09
|
Revision: 219
http://modplug.svn.sourceforge.net/modplug/?rev=219&view=rev
Author: relabsoluness
Date: 2008-08-16 17:24:05 +0000 (Sat, 16 Aug 2008)
Log Message:
-----------
[Svn] Removed old MPTm_Tuning dev branch
Removed Paths:
-------------
branches/OpenMPT_MPTm_Tuning/
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <rel...@us...> - 2008-08-16 17:14:25
|
Revision: 218
http://modplug.svn.sourceforge.net/modplug/?rev=218&view=rev
Author: relabsoluness
Date: 2008-08-16 17:14:22 +0000 (Sat, 16 Aug 2008)
Log Message:
-----------
[Svn](change in SVN)
Created dev branch for refactoring and for new experimental plugin parameter controls. No new code yet.
Added Paths:
-----------
branches/devBranch_1_17_03/
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <rel...@us...> - 2008-08-07 19:27:36
|
Revision: 217
http://modplug.svn.sourceforge.net/modplug/?rev=217&view=rev
Author: relabsoluness
Date: 2008-08-07 19:27:32 +0000 (Thu, 07 Aug 2008)
Log Message:
-----------
+ Added letter 'b' to drawable letters in pattern view.
/ Tweaking of custom note printing in pattern view (still far from good).
. nSpaceX/Y location in patternfont struct did not point to white location.
/ #-character used as X parameter indicator is redrawn to be the same as the sharp symbol in notenames.
? Small readability changes to mpt_midi.cpp
Modified Paths:
--------------
trunk/OpenMPT/mptrack/Draw_pat.cpp
trunk/OpenMPT/mptrack/Mpt_midi.cpp
trunk/OpenMPT/mptrack/res/view_pat.bmp
Modified: trunk/OpenMPT/mptrack/Draw_pat.cpp
===================================================================
--- trunk/OpenMPT/mptrack/Draw_pat.cpp 2008-07-25 20:20:15 UTC (rev 216)
+++ trunk/OpenMPT/mptrack/Draw_pat.cpp 2008-08-07 19:27:32 UTC (rev 217)
@@ -55,7 +55,7 @@
{
92,13, // Column Width & Height
0,0, // Clear location
- 32,207, // Space Location
+ 130,8, // Space Location.
{20, 20, 24, 9, 15}, // Element Widths
20,13, // Numbers 0-F (hex)
30,13, // Numbers 10-19 (dec)
@@ -78,7 +78,7 @@
{
70,11, // Column Width & Height
92,0, // Clear location
- 32,207, // Space Location
+ 130,8, // Space Location.
{16, 14, 18, 7, 11}, // Element Widths
108,13, // Numbers 0-F (hex)
120,13, // Numbers 10-19 (dec)
@@ -294,13 +294,18 @@
break;
//end rewbs.velocity
case ' ':
- srcx = pfnt->nClrX;
- srcy = pfnt->nClrY;
+ srcx = pfnt->nSpaceX;
+ srcy = pfnt->nSpaceY;
break;
case '-':
- srcx = pfnt->nNoteX + pfnt->nNoteWidth/2;
- srcy = pfnt->nNoteY + COLUMN_HEIGHT;
+ srcx = pfnt->nAlphaAM_X;
+ srcy = pfnt->nAlphaAM_Y + 15 * COLUMN_HEIGHT;
break;
+ case 'b':
+ srcx = pfnt->nAlphaAM_X;
+ srcy = pfnt->nAlphaAM_Y + 14 * COLUMN_HEIGHT;
+ break;
+
}
m_Dib.TextBlt(x, y, sizex, COLUMN_HEIGHT, srcx+ofsx, srcy);
}
@@ -326,12 +331,24 @@
} else
{
if(pTuning)
- {
+ { // Drawing custom note names
string noteStr = pTuning->GetNoteName(note-NOTE_MIDDLEC);
- noteStr.resize(3, ' ');
- DrawLetter(x, y, noteStr[0]);
- DrawLetter(x + pfnt->nNoteWidth/2, y, noteStr[1]);
- DrawLetter(x + pfnt->nNoteWidth, y, noteStr[2]);
+ if(noteStr.size() < 3)
+ noteStr.resize(3, ' ');
+
+ // Hack: Manual tweaking for default/small font displays.
+ if(pfnt == &gDefaultPatternFont)
+ {
+ DrawLetter(x, y, noteStr[0], 7, 0);
+ DrawLetter(x + 7, y, noteStr[1], 6, 0);
+ DrawLetter(x + 13, y, noteStr[2], 7, 1);
+ }
+ else
+ {
+ DrawLetter(x, y, noteStr[0], 5, 0);
+ DrawLetter(x + 5, y, noteStr[1], 5, 0);
+ DrawLetter(x + 10, y, noteStr[2], 6, 0);
+ }
}
else //Original
{
Modified: trunk/OpenMPT/mptrack/Mpt_midi.cpp
===================================================================
--- trunk/OpenMPT/mptrack/Mpt_midi.cpp 2008-07-25 20:20:15 UTC (rev 216)
+++ trunk/OpenMPT/mptrack/Mpt_midi.cpp 2008-08-07 19:27:32 UTC (rev 217)
@@ -40,18 +40,18 @@
void ApplyTransposeKeyboardSetting(CMainFrame& rMainFrm, DWORD& dwParam1)
//------------------------------------------------------------------------
{
- if ((CMainFrame::m_dwMidiSetup & MIDISETUP_TRANSPOSEKEYBOARD)
- && ((dwParam1 & 0x0F) != 9))
+ if ( (CMainFrame::m_dwMidiSetup & MIDISETUP_TRANSPOSEKEYBOARD)
+ && (GetFromMIDIMsg_Channel(dwParam1) != 9) )
{
int nTranspose = rMainFrm.GetBaseOctave() - 4;
if (nTranspose)
{
- int note = (dwParam1 >> 8) & 0xFF;
+ int note = GetFromMIDIMsg_DataByte1(dwParam1);
if (note < 0x80)
{
note += nTranspose*12;
if (note < 0) note = 0;
- if (note > 119) note = 119;
+ if (note > NOTE_MAX - 1) note = NOTE_MAX - 1;
// -> CODE#0011
// -> DESC="bug fix about transpose midi keyboard option"
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <rel...@us...> - 2008-07-25 20:20:22
|
Revision: 216
http://modplug.svn.sourceforge.net/modplug/?rev=216&view=rev
Author: relabsoluness
Date: 2008-07-25 20:20:15 +0000 (Fri, 25 Jul 2008)
Log Message:
-----------
./ Merged module loaders from libmodplug along with some tiny changes; should not affect functionality.
Modified Paths:
--------------
trunk/OpenMPT/soundlib/LOAD_AMF.CPP
trunk/OpenMPT/soundlib/LOAD_DBM.CPP
trunk/OpenMPT/soundlib/LOAD_DMF.CPP
trunk/OpenMPT/soundlib/LOAD_DSM.CPP
trunk/OpenMPT/soundlib/Load_669.cpp
trunk/OpenMPT/soundlib/Load_ams.cpp
trunk/OpenMPT/soundlib/Load_far.cpp
trunk/OpenMPT/soundlib/Load_mdl.cpp
trunk/OpenMPT/soundlib/Load_med.cpp
trunk/OpenMPT/soundlib/Load_mod.cpp
trunk/OpenMPT/soundlib/Load_mt2.cpp
trunk/OpenMPT/soundlib/Load_mtm.cpp
trunk/OpenMPT/soundlib/Load_okt.cpp
trunk/OpenMPT/soundlib/Load_psm.cpp
trunk/OpenMPT/soundlib/Load_ptm.cpp
trunk/OpenMPT/soundlib/Load_s3m.cpp
trunk/OpenMPT/soundlib/Load_stm.cpp
trunk/OpenMPT/soundlib/Load_ult.cpp
trunk/OpenMPT/soundlib/Load_umx.cpp
trunk/OpenMPT/soundlib/Load_wav.cpp
trunk/OpenMPT/soundlib/Load_xm.cpp
trunk/OpenMPT/soundlib/Sndfile.h
trunk/OpenMPT/soundlib/load_j2b.cpp
Modified: trunk/OpenMPT/soundlib/LOAD_AMF.CPP
===================================================================
--- trunk/OpenMPT/soundlib/LOAD_AMF.CPP 2008-07-11 16:17:21 UTC (rev 215)
+++ trunk/OpenMPT/soundlib/LOAD_AMF.CPP 2008-07-25 20:20:15 UTC (rev 216)
@@ -1,10 +1,10 @@
/*
- * This program is free software; you can redistribute it and modify it
- * under the terms of the GNU General Public License as published by the
- * Free Software Foundation; either version 2 of the license or (at your
- * option) any later version.
+ * This source code is public domain.
*
+ * Copied to OpenMPT from libmodplug.
+ *
* Authors: Olivier Lapicque <oli...@jp...>
+ * OpenMPT dev(s) (miscellaneous modifications)
*/
///////////////////////////////////////////////////
@@ -21,7 +21,7 @@
//#define AMFLOG
-#pragma warning(disable:4244)
+#pragma warning(disable:4244) //"conversion from 'type1' to 'type2', possible loss of data"
#pragma pack(1)
@@ -58,7 +58,7 @@
//-------------------------------------------------------------------------------
{
UINT lastinstr = 0;
- UINT nTrkSize = *(USHORT *)pTrack;
+ UINT nTrkSize = LittleEndianW(*(USHORT *)pTrack);
nTrkSize += (UINT)pTrack[2] << 16;
pTrack += 3;
while (nTrkSize--)
@@ -168,7 +168,7 @@
BOOL CSoundFile::ReadAMF(LPCBYTE lpStream, DWORD dwMemLength)
//-----------------------------------------------------------
{
- AMFFILEHEADER *pfh = (AMFFILEHEADER *)lpStream;
+ const AMFFILEHEADER *pfh = (AMFFILEHEADER *)lpStream;
DWORD dwMemPos;
if ((!lpStream) || (dwMemLength < 2048)) return FALSE;
@@ -203,9 +203,9 @@
psmp->nGlobalVol = 64;
if (psmp->nVolume > 0x40) psmp->nVolume = 0x40;
psmp->nVolume <<= 2;
- psmp->nLength = *((LPDWORD)(lpStream+dwMemPos+25));
- psmp->nLoopStart = *((LPDWORD)(lpStream+dwMemPos+29));
- psmp->nLoopEnd = psmp->nLoopStart + *((LPDWORD)(lpStream+dwMemPos+33));
+ psmp->nLength = LittleEndian(*((LPDWORD)(lpStream+dwMemPos+25)));
+ psmp->nLoopStart = LittleEndian(*((LPDWORD)(lpStream+dwMemPos+29)));
+ psmp->nLoopEnd = psmp->nLoopStart + LittleEndian(*((LPDWORD)(lpStream+dwMemPos+33)));
if ((psmp->nLoopEnd > psmp->nLoopStart) && (psmp->nLoopEnd <= psmp->nLength))
{
psmp->uFlags = CHN_LOOP;
@@ -262,7 +262,7 @@
DWORD sampleseekpos[MAX_SAMPLES];
if ((pfh->szAMF[0] != 'A') || (pfh->szAMF[1] != 'M') || (pfh->szAMF[2] != 'F')
- || (pfh->version < 10) || (pfh->version > 14) || (!pfh->numtracks)
+ || (pfh->version < 10) || (pfh->version > 14) || (!LittleEndianW(pfh->numtracks))
|| (!pfh->numorders) || (pfh->numorders > MAX_PATTERNS)
|| (!pfh->numsamples) || (pfh->numsamples > MAX_SAMPLES)
|| (pfh->numchannels < 4) || (pfh->numchannels > 32))
@@ -313,7 +313,7 @@
Patterns[iOrd].Resize(64);
if (pfh->version >= 14)
{
- Patterns[iOrd].Resize(*(USHORT *)(lpStream+dwMemPos));
+ Patterns[iOrd].Resize(LittleEndianW(*(USHORT *)(lpStream+dwMemPos)));
dwMemPos += 2;
}
ptracks[iOrd] = (USHORT *)(lpStream+dwMemPos);
@@ -331,26 +331,27 @@
dwMemPos += sizeof(AMFSAMPLE);
memcpy(m_szNames[iIns+1], psh->samplename, 32);
memcpy(pins->name, psh->filename, 13);
- pins->nLength = psh->length;
- pins->nC4Speed = psh->c2spd;
+ pins->nLength = LittleEndian(psh->length);
+ pins->nC4Speed = LittleEndianW(psh->c2spd);
pins->nGlobalVol = 64;
pins->nVolume = psh->volume * 4;
if (pfh->version >= 11)
{
- pins->nLoopStart = *(DWORD *)(lpStream+dwMemPos);
- pins->nLoopEnd = *(DWORD *)(lpStream+dwMemPos+4);
+ pins->nLoopStart = LittleEndian(*(DWORD *)(lpStream+dwMemPos));
+ pins->nLoopEnd = LittleEndian(*(DWORD *)(lpStream+dwMemPos+4));
dwMemPos += 8;
} else
{
- pins->nLoopStart = *(WORD *)(lpStream+dwMemPos);
+ pins->nLoopStart = LittleEndianW(*(WORD *)(lpStream+dwMemPos));
pins->nLoopEnd = pins->nLength;
dwMemPos += 2;
}
sampleseekpos[iIns] = 0;
- if ((psh->type) && (psh->offset < dwMemLength-1))
+ if ((psh->type) && (LittleEndian(psh->offset) < dwMemLength-1))
{
- sampleseekpos[iIns] = psh->offset;
- if (psh->offset > maxsampleseekpos) maxsampleseekpos = psh->offset;
+ sampleseekpos[iIns] = LittleEndian(psh->offset);
+ if (LittleEndian(psh->offset) > maxsampleseekpos)
+ maxsampleseekpos = LittleEndian(psh->offset);
if ((pins->nLoopEnd > pins->nLoopStart + 2)
&& (pins->nLoopEnd <= pins->nLength)) pins->uFlags |= CHN_LOOP;
}
@@ -368,7 +369,7 @@
memset(pTrackData, 0, sizeof(pTrackData));
for (UINT iTrack=0; iTrack<realtrackcnt; iTrack++) if (dwMemPos + 3 <= dwMemLength)
{
- UINT nTrkSize = *(USHORT *)(lpStream+dwMemPos);
+ UINT nTrkSize = LittleEndianW(*(USHORT *)(lpStream+dwMemPos));
nTrkSize += (UINT)lpStream[dwMemPos+2] << 16;
if (dwMemPos + nTrkSize * 3 + 3 <= dwMemLength)
{
@@ -384,10 +385,10 @@
Patterns[iPat] = p;
for (UINT iChn=0; iChn<m_nChannels; iChn++)
{
- UINT nTrack = ptracks[iPat][iChn];
+ UINT nTrack = LittleEndianW(ptracks[iPat][iChn]);
if ((nTrack) && (nTrack <= pfh->numtracks))
{
- UINT realtrk = pTrackMap[nTrack-1];
+ UINT realtrk = LittleEndianW(pTrackMap[nTrack-1]);
if (realtrk)
{
realtrk--;
Modified: trunk/OpenMPT/soundlib/LOAD_DBM.CPP
===================================================================
--- trunk/OpenMPT/soundlib/LOAD_DBM.CPP 2008-07-11 16:17:21 UTC (rev 215)
+++ trunk/OpenMPT/soundlib/LOAD_DBM.CPP 2008-07-25 20:20:15 UTC (rev 216)
@@ -1,10 +1,11 @@
/*
- * This program is free software; you can redistribute it and modify it
- * under the terms of the GNU General Public License as published by the
- * Free Software Foundation; either version 2 of the license or (at your
- * option) any later version.
+ * This source code is public domain.
*
- * Authors: Olivier Lapicque <oli...@jp...>
+ * Copied to OpenMPT from libmodplug.
+ *
+ * Authors: Olivier Lapicque <oli...@jp...>,
+ * Adam Goode <ad...@ev...> (endian and char fixes for PPC)
+ * OpenMPT dev(s) (miscellaneous modifications)
*/
///////////////////////////////////////////////////////////////
@@ -18,7 +19,7 @@
#include "stdafx.h"
#include "sndfile.h"
-#pragma warning(disable:4244)
+#pragma warning(disable:4244) //"conversion from 'type1' to 'type2', possible loss of data"
#define DBM_FILE_MAGIC 0x304d4244
#define DBM_ID_NAME 0x454d414e
@@ -99,7 +100,7 @@
BOOL CSoundFile::ReadDBM(const BYTE *lpStream, DWORD dwMemLength)
//---------------------------------------------------------------
{
- DBMFILEHEADER *pfh = (DBMFILEHEADER *)lpStream;
+ const DBMFILEHEADER *pfh = (DBMFILEHEADER *)lpStream;
DWORD dwMemPos;
UINT nOrders, nSamples, nInstruments, nPatterns;
@@ -152,7 +153,6 @@
nsmp = BigEndianW(pih->sampleno);
psmp = ((nsmp) && (nsmp < MAX_SAMPLES)) ? &Ins[nsmp] : NULL;
memset(penv, 0, sizeof(INSTRUMENTHEADER));
- penv->pTuning = penv->s_DefaultTuning;
memcpy(penv->name, pih->name, 30);
if (psmp)
{
Modified: trunk/OpenMPT/soundlib/LOAD_DMF.CPP
===================================================================
--- trunk/OpenMPT/soundlib/LOAD_DMF.CPP 2008-07-11 16:17:21 UTC (rev 215)
+++ trunk/OpenMPT/soundlib/LOAD_DMF.CPP 2008-07-25 20:20:15 UTC (rev 216)
@@ -1,10 +1,10 @@
/*
- * This program is free software; you can redistribute it and modify it
- * under the terms of the GNU General Public License as published by the
- * Free Software Foundation; either version 2 of the license or (at your
- * option) any later version.
+ * This source code is public domain.
*
+ * Copied to OpenMPT from libmodplug.
+ *
* Authors: Olivier Lapicque <oli...@jp...>
+ * OpenMPT dev(s) (miscellaneous modifications)
*/
///////////////////////////////////////////////////////
@@ -15,7 +15,7 @@
//#define DMFLOG
-#pragma warning(disable:4244)
+#pragma warning(disable:4244) //"conversion from 'type1' to 'type2', possible loss of data"
#pragma pack(1)
@@ -89,7 +89,7 @@
BOOL CSoundFile::ReadDMF(const BYTE *lpStream, DWORD dwMemLength)
//---------------------------------------------------------------
{
- DMFHEADER *pfh = (DMFHEADER *)lpStream;
+ const DMFHEADER *pfh = (DMFHEADER *)lpStream;
DMFINFO *psi;
DMFSEQU *sequ;
DWORD dwMemPos;
@@ -121,7 +121,7 @@
if ((psi->infosize > dwMemLength) || (psi->infosize + dwMemPos + 8 > dwMemLength)) goto dmfexit;
if ((psi->infosize >= 8) && (!m_lpszSongComments))
{
- m_lpszSongComments = new CHAR[psi->infosize];
+ m_lpszSongComments = new char[psi->infosize];
if (m_lpszSongComments)
{
for (UINT i=0; i<psi->infosize-1; i++)
Modified: trunk/OpenMPT/soundlib/LOAD_DSM.CPP
===================================================================
--- trunk/OpenMPT/soundlib/LOAD_DSM.CPP 2008-07-11 16:17:21 UTC (rev 215)
+++ trunk/OpenMPT/soundlib/LOAD_DSM.CPP 2008-07-25 20:20:15 UTC (rev 216)
@@ -1,10 +1,10 @@
/*
- * This program is free software; you can redistribute it and modify it
- * under the terms of the GNU General Public License as published by the
- * Free Software Foundation; either version 2 of the license or (at your
- * option) any later version.
+ * This source code is public domain.
*
+ * Copied to OpenMPT from libmodplug.
+ *
* Authors: Olivier Lapicque <oli...@jp...>
+ *
*/
//////////////////////////////////////////////
Modified: trunk/OpenMPT/soundlib/Load_669.cpp
===================================================================
--- trunk/OpenMPT/soundlib/Load_669.cpp 2008-07-11 16:17:21 UTC (rev 215)
+++ trunk/OpenMPT/soundlib/Load_669.cpp 2008-07-25 20:20:15 UTC (rev 216)
@@ -1,10 +1,11 @@
/*
- * This program is free software; you can redistribute it and modify it
- * under the terms of the GNU General Public License as published by the
- * Free Software Foundation; either version 2 of the license or (at your
- * option) any later version.
+ * This source code is public domain.
*
- * Authors: Olivier Lapicque <oli...@jp...>
+ * Copied to OpenMPT from libmodplug.
+ *
+ * Authors: Olivier Lapicque <oli...@jp...>,
+ * Adam Goode <ad...@ev...> (endian and char fixes for PPC)
+ * OpenMPT dev(s) (miscellaneous modifications)
*/
////////////////////////////////////////////////////////////
@@ -14,12 +15,12 @@
#include "stdafx.h"
#include "sndfile.h"
-#pragma warning(disable:4244)
+#pragma warning(disable:4244) //"conversion from 'type1' to 'type2', possible loss of data"
typedef struct tagFILEHEADER669
{
WORD sig; // 'if' or 'JN'
- char songmessage[108]; // Song Message
+ signed char songmessage[108]; // Song Message
BYTE samples; // number of samples (1-64)
BYTE patterns; // number of patterns (1-128)
BYTE restartpos;
@@ -47,15 +48,15 @@
DWORD dwMemPos = 0;
if ((!lpStream) || (dwMemLength < sizeof(FILEHEADER669))) return FALSE;
- if ((pfh->sig != 0x6669) && (pfh->sig != 0x4E4A)) return FALSE;
- b669Ext = (pfh->sig == 0x4E4A) ? TRUE : FALSE;
+ if ((LittleEndianW(pfh->sig) != 0x6669) && (LittleEndianW(pfh->sig) != 0x4E4A)) return FALSE;
+ b669Ext = (LittleEndianW(pfh->sig) == 0x4E4A) ? TRUE : FALSE;
if ((!pfh->samples) || (pfh->samples > 64) || (pfh->restartpos >= 128)
|| (!pfh->patterns) || (pfh->patterns > 128)) return FALSE;
DWORD dontfuckwithme = 0x1F1 + pfh->samples * sizeof(SAMPLE669) + pfh->patterns * 0x600;
if (dontfuckwithme > dwMemLength) return FALSE;
for (UINT ichk=0; ichk<pfh->samples; ichk++)
{
- DWORD len = *((DWORD *)(&psmp[ichk].length));
+ DWORD len = LittleEndian(*((DWORD *)(&psmp[ichk].length)));
dontfuckwithme += len;
}
if (dontfuckwithme > dwMemLength) return FALSE;
@@ -71,9 +72,9 @@
m_nSamples = pfh->samples;
for (UINT nins=1; nins<=m_nSamples; nins++, psmp++)
{
- DWORD len = *((DWORD *)(&psmp->length));
- DWORD loopstart = *((DWORD *)(&psmp->loopstart));
- DWORD loopend = *((DWORD *)(&psmp->loopend));
+ DWORD len = LittleEndian(*((DWORD *)(&psmp->length)));
+ DWORD loopstart = LittleEndian(*((DWORD *)(&psmp->loopstart)));
+ DWORD loopend = LittleEndian(*((DWORD *)(&psmp->loopend)));
if (len > MAX_SAMPLE_LENGTH) len = MAX_SAMPLE_LENGTH;
if ((loopend > len) && (!loopstart)) loopend = 0;
if (loopend > len) loopend = len;
Modified: trunk/OpenMPT/soundlib/Load_ams.cpp
===================================================================
--- trunk/OpenMPT/soundlib/Load_ams.cpp 2008-07-11 16:17:21 UTC (rev 215)
+++ trunk/OpenMPT/soundlib/Load_ams.cpp 2008-07-25 20:20:15 UTC (rev 216)
@@ -1,10 +1,10 @@
/*
- * This program is free software; you can redistribute it and modify it
- * under the terms of the GNU General Public License as published by the
- * Free Software Foundation; either version 2 of the license or (at your
- * option) any later version.
+ * This source code is public domain.
*
+ * Copied to OpenMPT from libmodplug.
+ *
* Authors: Olivier Lapicque <oli...@jp...>
+ * OpenMPT dev(s) (miscellaneous modifications)
*/
//////////////////////////////////////////////
@@ -13,13 +13,13 @@
#include "stdafx.h"
#include "sndfile.h"
-#pragma warning(disable:4244)
+#pragma warning(disable:4244) //"conversion from 'type1' to 'type2', possible loss of data"
#pragma pack(1)
typedef struct AMSFILEHEADER
{
- CHAR szHeader[7]; // "Extreme"
+ char szHeader[7]; // "Extreme"
BYTE verlo, verhi; // 0x??,0x01
BYTE chncfg;
BYTE samples;
@@ -107,7 +107,7 @@
dwMemPos += tmp;
}
// Read Pattern Names
- m_lpszPatternNames = new CHAR[pfh->patterns * 32];
+ m_lpszPatternNames = new char[pfh->patterns * 32];
if (!m_lpszPatternNames) return TRUE;
m_nPatternNames = pfh->patterns;
memset(m_lpszPatternNames, 0, m_nPatternNames * 32);
@@ -125,7 +125,7 @@
if (dwMemPos + tmp >= dwMemLength) return TRUE;
if (tmp)
{
- m_lpszSongComments = new CHAR[tmp+1];
+ m_lpszSongComments = new char[tmp+1];
if (!m_lpszSongComments) return TRUE;
memset(m_lpszSongComments, 0, tmp+1);
memcpy(m_lpszSongComments, lpStream + dwMemPos, tmp);
@@ -312,7 +312,7 @@
BOOL CSoundFile::ReadAMS2(LPCBYTE lpStream, DWORD dwMemLength)
//------------------------------------------------------------
{
- AMS2FILEHEADER *pfh = (AMS2FILEHEADER *)lpStream;
+ const AMS2FILEHEADER *pfh = (AMS2FILEHEADER *)lpStream;
AMS2SONGHEADER *psh;
DWORD dwMemPos;
BYTE smpmap[16];
@@ -356,7 +356,6 @@
if (!penv) return TRUE;
memset(smpmap, 0, sizeof(smpmap));
memset(penv, 0, sizeof(INSTRUMENTHEADER));
- penv->pTuning = penv->s_DefaultTuning;
for (UINT ismpmap=0; ismpmap<pins->samples; ismpmap++)
{
if ((ismpmap >= 16) || (m_nSamples+1 >= MAX_SAMPLES)) break;
@@ -434,7 +433,7 @@
UINT composernamelen = lpStream[dwMemPos];
if (composernamelen)
{
- m_lpszSongComments = new CHAR[composernamelen+1];
+ m_lpszSongComments = new char[composernamelen+1];
if (m_lpszSongComments)
{
memcpy(m_lpszSongComments, lpStream+dwMemPos+1, composernamelen);
@@ -485,7 +484,7 @@
{
if ((patnamlen) && (patnamlen < MAX_PATTERNNAME))
{
- CHAR s[MAX_PATTERNNAME];
+ char s[MAX_PATTERNNAME];
memcpy(s, lpStream+dwMemPos+3, patnamlen);
s[patnamlen] = 0;
SetPatternName(ipat, s);
@@ -565,16 +564,16 @@
void AMSUnpack(const char *psrc, UINT inputlen, char *pdest, UINT dmax, char packcharacter)
{
UINT tmplen = dmax;
- char *amstmp = new char[tmplen];
+ signed char *amstmp = new signed char[tmplen];
if (!amstmp) return;
// Unpack Loop
{
- char *p = amstmp;
+ signed char *p = amstmp;
UINT i=0, j=0;
while ((i < inputlen) && (j < tmplen))
{
- char ch = psrc[i++];
+ signed char ch = psrc[i++];
if (ch == packcharacter)
{
BYTE ch2 = psrc[i++];
@@ -592,7 +591,7 @@
}
// Bit Unpack Loop
{
- char *p = amstmp;
+ signed char *p = amstmp;
UINT bitcount = 0x80, dh;
UINT k=0;
for (UINT i=0; i<dmax; i++)
@@ -616,12 +615,12 @@
}
// Delta Unpack
{
- char old = 0;
+ signed char old = 0;
for (UINT i=0; i<dmax; i++)
{
int pos = ((LPBYTE)pdest)[i];
if ((pos != 128) && (pos & 0x80)) pos = -(pos & 0x7F);
- old -= (char)pos;
+ old -= (signed char)pos;
pdest[i] = old;
}
}
Modified: trunk/OpenMPT/soundlib/Load_far.cpp
===================================================================
--- trunk/OpenMPT/soundlib/Load_far.cpp 2008-07-11 16:17:21 UTC (rev 215)
+++ trunk/OpenMPT/soundlib/Load_far.cpp 2008-07-25 20:20:15 UTC (rev 216)
@@ -1,10 +1,10 @@
/*
- * This program is free software; you can redistribute it and modify it
- * under the terms of the GNU General Public License as published by the
- * Free Software Foundation; either version 2 of the license or (at your
- * option) any later version.
+ * This source code is public domain.
*
+ * Copied to OpenMPT from libmodplug.
+ *
* Authors: Olivier Lapicque <oli...@jp...>
+ * OpenMPT dev(s) (miscellaneous modifications)
*/
////////////////////////////////////////
@@ -13,7 +13,7 @@
#include "stdafx.h"
#include "sndfile.h"
-#pragma warning(disable:4244)
+#pragma warning(disable:4244) //"conversion from 'type1' to 'type2', possible loss of data"
#define FARFILEMAGIC 0xFE524146 // "FAR"
@@ -61,15 +61,21 @@
BOOL CSoundFile::ReadFAR(const BYTE *lpStream, DWORD dwMemLength)
//---------------------------------------------------------------
{
- FARHEADER1 *pmh1 = (FARHEADER1 *)lpStream;
+ if(dwMemLength < sizeof(FARHEADER1))
+ return FALSE;
+
+ FARHEADER1 farHeader;
+ memcpy(&farHeader, lpStream, sizeof(FARHEADER1));
+ FARHEADER1 *pmh1 = &farHeader;
FARHEADER2 *pmh2;
DWORD dwMemPos = sizeof(FARHEADER1);
UINT headerlen;
BYTE samplemap[8];
- if ((!lpStream) || (dwMemLength < 1024) || (pmh1->id != FARFILEMAGIC)
+ if ((!lpStream) || (dwMemLength < 1024) || (LittleEndian(pmh1->id) != FARFILEMAGIC)
|| (pmh1->magic2[0] != 13) || (pmh1->magic2[1] != 10) || (pmh1->magic2[2] != 26)) return FALSE;
- headerlen = pmh1->headerlen;
+ headerlen = LittleEndianW(pmh1->headerlen);
+ pmh1->stlen = LittleEndianW( pmh1->stlen ); /* inplace byteswap -- Toad */
if ((headerlen >= dwMemLength) || (dwMemPos + pmh1->stlen + sizeof(FARHEADER2) >= dwMemLength)) return FALSE;
// Globals
m_nType = MOD_TYPE_FAR;
@@ -80,6 +86,7 @@
m_nDefaultSpeed = pmh1->speed;
m_nDefaultTempo = 80;
m_nDefaultGlobalVolume = 256;
+
memcpy(m_szNames[0], pmh1->songname, 32);
// Channel Setting
for (UINT nchpan=0; nchpan<16; nchpan++)
@@ -101,7 +108,10 @@
dwMemPos += pmh1->stlen;
}
// Reading orders
- pmh2 = (FARHEADER2 *)(lpStream + dwMemPos);
+ if (sizeof(FARHEADER2) > dwMemLength - dwMemPos) return TRUE;
+ FARHEADER2 farHeader2;
+ memcpy(&farHeader2, lpStream + dwMemPos, sizeof(FARHEADER2));
+ pmh2 = &farHeader2;
dwMemPos += sizeof(FARHEADER2);
if (dwMemPos >= dwMemLength) return TRUE;
for (UINT iorder=0; iorder<MAX_ORDERS; iorder++)
@@ -112,6 +122,14 @@
// Reading Patterns
dwMemPos += headerlen - (869 + pmh1->stlen);
if (dwMemPos >= dwMemLength) return TRUE;
+
+ // byteswap pattern data.
+ for(uint16 psfix = 256; psfix--;)
+ {
+ pmh2->patsiz[psfix] = LittleEndianW( pmh2->patsiz[psfix] ) ;
+ }
+ // end byteswap of pattern data
+
WORD *patsiz = (WORD *)pmh2->patsiz;
for (UINT ipat=0; ipat<256; ipat++) if (patsiz[ipat])
{
@@ -228,13 +246,14 @@
for (UINT ismp=0; ismp<64; ismp++, pins++) if (samplemap[ismp >> 3] & (1 << (ismp & 7)))
{
if (dwMemPos + sizeof(FARSAMPLE) > dwMemLength) return TRUE;
- FARSAMPLE *pfs = (FARSAMPLE *)(lpStream + dwMemPos);
+ const FARSAMPLE *pfs = reinterpret_cast<const FARSAMPLE*>(lpStream + dwMemPos);
dwMemPos += sizeof(FARSAMPLE);
m_nSamples = ismp + 1;
memcpy(m_szNames[ismp+1], pfs->samplename, 32);
- pins->nLength = pfs->length;
- pins->nLoopStart = pfs->reppos;
- pins->nLoopEnd = pfs->repend;
+ const DWORD length = LittleEndian( pfs->length );
+ pins->nLength = length;
+ pins->nLoopStart = LittleEndian(pfs->reppos) ;
+ pins->nLoopEnd = LittleEndian(pfs->repend) ;
pins->nFineTune = 0;
pins->nC4Speed = 8363*2;
pins->nGlobalVol = 64;
@@ -253,7 +272,7 @@
ReadSample(pins, (pins->uFlags & CHN_16BIT) ? RS_PCM16S : RS_PCM8S,
(LPSTR)(lpStream+dwMemPos), dwMemLength - dwMemPos);
}
- dwMemPos += pfs->length;
+ dwMemPos += length;
}
return TRUE;
}
Modified: trunk/OpenMPT/soundlib/Load_mdl.cpp
===================================================================
--- trunk/OpenMPT/soundlib/Load_mdl.cpp 2008-07-11 16:17:21 UTC (rev 215)
+++ trunk/OpenMPT/soundlib/Load_mdl.cpp 2008-07-25 20:20:15 UTC (rev 216)
@@ -1,9 +1,8 @@
/*
- * This program is free software; you can redistribute it and modify it
- * under the terms of the GNU General Public License as published by the
- * Free Software Foundation; either version 2 of the license or (at your
- * option) any later version.
+ * This source code is public domain.
*
+ * Copied to OpenMPT from libmodplug.
+ *
* Authors: Olivier Lapicque <oli...@jp...>
*/
@@ -15,7 +14,7 @@
//#define MDL_LOG
-#pragma warning(disable:4244)
+#pragma warning(disable:4244) //"conversion from 'type1' to 'type2', possible loss of data"
typedef struct MDLSONGHEADER
{
@@ -328,7 +327,6 @@
if ((Headers[nins] = new INSTRUMENTHEADER) == NULL) break;
INSTRUMENTHEADER *penv = Headers[nins];
memset(penv, 0, sizeof(INSTRUMENTHEADER));
- penv->pTuning = penv->s_DefaultTuning;
memcpy(penv->name, lpStream+dwPos+2, 32);
penv->nGlobalVol = 64;
penv->nPPC = 5*12;
Modified: trunk/OpenMPT/soundlib/Load_med.cpp
===================================================================
--- trunk/OpenMPT/soundlib/Load_med.cpp 2008-07-11 16:17:21 UTC (rev 215)
+++ trunk/OpenMPT/soundlib/Load_med.cpp 2008-07-25 20:20:15 UTC (rev 216)
@@ -1,10 +1,10 @@
/*
- * This program is free software; you can redistribute it and modify it
- * under the terms of the GNU General Public License as published by the
- * Free Software Foundation; either version 2 of the license or (at your
- * option) any later version.
+ * This source code is public domain.
*
- * Authors: Olivier Lapicque <oli...@jp...>
+ * Copied to OpenMPT from libmodplug.
+ *
+ * Authors: Olivier Lapicque <oli...@jp...>,
+ * OpenMPT dev(s) (miscellaneous modifications)
*/
#include "stdafx.h"
@@ -493,7 +493,7 @@
// Check for 'MMDx'
DWORD dwSong = BigEndian(pmmh->song);
if ((dwSong >= dwMemLength) || (dwSong + sizeof(MMD0SONGHEADER) >= dwMemLength)) return FALSE;
- version = (char)((pmmh->id >> 24) & 0xFF);
+ version = (signed char)((pmmh->id >> 24) & 0xFF);
if ((version < '0') || (version > '3')) return FALSE;
#ifdef MED_LOG
Log("\nLoading MMD%c module (flags=0x%02X)...\n", version, BigEndian(pmmh->mmdflags));
@@ -699,7 +699,7 @@
UINT annotxt = BigEndian(pmex->annotxt);
UINT annolen = BigEndian(pmex->annolen);
annolen = min(annolen, MED_MAX_COMMENT_LENGTH); //Thanks to Luigi Auriemma for pointing out an overflow risk
- if ((annotxt) && (annolen) && (annotxt+annolen <= dwMemLength) ) {
+ if ((annotxt) && (annolen) && (annolen <= dwMemLength) && (annotxt <= dwMemLength - annolen) ) {
m_lpszSongComments = new char[annolen+1];
if (m_lpszSongComments) {
memcpy(m_lpszSongComments, lpStream+annotxt, annolen);
Modified: trunk/OpenMPT/soundlib/Load_mod.cpp
===================================================================
--- trunk/OpenMPT/soundlib/Load_mod.cpp 2008-07-11 16:17:21 UTC (rev 215)
+++ trunk/OpenMPT/soundlib/Load_mod.cpp 2008-07-25 20:20:15 UTC (rev 216)
@@ -1,16 +1,17 @@
/*
- * This program is free software; you can redistribute it and modify it
- * under the terms of the GNU General Public License as published by the
- * Free Software Foundation; either version 2 of the license or (at your
- * option) any later version.
+ * This source code is public domain.
*
- * Authors: Olivier Lapicque <oli...@jp...>
+ * Copied to OpenMPT from libmodplug.
+ *
+ * Authors: Olivier Lapicque <oli...@jp...>,
+ * Adam Goode <ad...@ev...> (endian and char fixes for PPC)
+ * OpenMPT dev(s) (miscellaneous modifications)
*/
#include "stdafx.h"
#include "sndfile.h"
-#pragma warning(disable:4244)
+#pragma warning(disable:4244) //"conversion from 'type1' to 'type2', possible loss of data"
extern WORD ProTrackerPeriodTable[6*12];
@@ -98,7 +99,7 @@
command = 0x08;
if (bXM)
{
- if ((m_nType & (MOD_TYPE_IT|MOD_TYPE_MPT)) && (m_nType != MOD_TYPE_XM) && (param <= 0x80))
+ if (!(m_nType & (MOD_TYPE_IT|MOD_TYPE_MPT)) && (m_nType != MOD_TYPE_XM) && (param <= 0x80))
{
param <<= 1;
if (param > 255) param = 255;
@@ -170,7 +171,7 @@
BYTE nOrders;
BYTE nRestartPos;
BYTE Orders[128];
- CHAR Magic[4];
+ char Magic[4];
} MODMAGIC, *PMODMAGIC;
#pragma pack()
@@ -184,7 +185,7 @@
BOOL CSoundFile::ReadMod(const BYTE *lpStream, DWORD dwMemLength)
//---------------------------------------------------------------
{
- CHAR s[1024];
+ char s[1024];
DWORD dwMemPos, dwTotalSampleLen;
PMODMAGIC pMagic;
UINT nErr;
Modified: trunk/OpenMPT/soundlib/Load_mt2.cpp
===================================================================
--- trunk/OpenMPT/soundlib/Load_mt2.cpp 2008-07-11 16:17:21 UTC (rev 215)
+++ trunk/OpenMPT/soundlib/Load_mt2.cpp 2008-07-25 20:20:15 UTC (rev 216)
@@ -250,7 +250,7 @@
{
DWORD nTxtLen = dwLen;
if (nTxtLen > 32000) nTxtLen = 32000;
- m_lpszSongComments = new CHAR[nTxtLen];
+ m_lpszSongComments = new char[nTxtLen];
if (m_lpszSongComments)
{
memcpy(m_lpszSongComments, lpStream+dwMemPos+1, nTxtLen-1);
@@ -405,7 +405,6 @@
if (penv)
{
memset(penv, 0, sizeof(INSTRUMENTHEADER));
- penv->pTuning = penv->s_DefaultTuning;
memcpy(penv->name, pmi->szName, 32);
penv->nGlobalVol = 64;
penv->nPan = 128;
Modified: trunk/OpenMPT/soundlib/Load_mtm.cpp
===================================================================
--- trunk/OpenMPT/soundlib/Load_mtm.cpp 2008-07-11 16:17:21 UTC (rev 215)
+++ trunk/OpenMPT/soundlib/Load_mtm.cpp 2008-07-25 20:20:15 UTC (rev 216)
@@ -1,16 +1,16 @@
/*
- * This program is free software; you can redistribute it and modify it
- * under the terms of the GNU General Public License as published by the
- * Free Software Foundation; either version 2 of the license or (at your
- * option) any later version.
+ * This source code is public domain.
*
+ * Copied to OpenMPT from libmodplug.
+ *
* Authors: Olivier Lapicque <oli...@jp...>
+ *
*/
#include "stdafx.h"
#include "sndfile.h"
-#pragma warning(disable:4244)
+#pragma warning(disable:4244) //"conversion from 'type1' to 'type2', possible loss of data"
//////////////////////////////////////////////////////////
// MTM file support (import only)
@@ -19,7 +19,7 @@
typedef struct tagMTMSAMPLE
{
- CHAR samplename[22];
+ char samplename[22];
DWORD length;
DWORD reppos;
DWORD repend;
@@ -31,8 +31,8 @@
typedef struct tagMTMHEADER
{
- CHAR id[4]; // MTM file marker + version
- CHAR songname[20]; // ASCIIZ songname
+ char id[4]; // MTM file marker + version
+ char songname[20]; // ASCIIZ songname
WORD numtracks; // number of tracks saved
BYTE lastpattern; // last pattern number saved
BYTE lastorder; // last order number to play (songlength-1)
Modified: trunk/OpenMPT/soundlib/Load_okt.cpp
===================================================================
--- trunk/OpenMPT/soundlib/Load_okt.cpp 2008-07-11 16:17:21 UTC (rev 215)
+++ trunk/OpenMPT/soundlib/Load_okt.cpp 2008-07-25 20:20:15 UTC (rev 216)
@@ -1,10 +1,11 @@
/*
- * This program is free software; you can redistribute it and modify it
- * under the terms of the GNU General Public License as published by the
- * Free Software Foundation; either version 2 of the license or (at your
- * option) any later version.
+ * This source code is public domain.
*
- * Authors: Olivier Lapicque <oli...@jp...>
+ * Copied to OpenMPT from libmodplug.
+ *
+ * Authors: Olivier Lapicque <oli...@jp...>,
+ * Adam Goode <ad...@ev...> (endian and char fixes for PPC)
+ *
*/
//////////////////////////////////////////////
@@ -13,7 +14,7 @@
#include "stdafx.h"
#include "sndfile.h"
-#pragma warning(disable:4244)
+#pragma warning(disable:4244) //"conversion from 'type1' to 'type2', possible loss of data"
typedef struct OKTFILEHEADER
{
Modified: trunk/OpenMPT/soundlib/Load_psm.cpp
===================================================================
--- trunk/OpenMPT/soundlib/Load_psm.cpp 2008-07-11 16:17:21 UTC (rev 215)
+++ trunk/OpenMPT/soundlib/Load_psm.cpp 2008-07-25 20:20:15 UTC (rev 216)
@@ -1,8 +1,5 @@
/*
- * This program is free software; you can redistribute it and modify it
- * under the terms of the GNU General Public License as published by the
- * Free Software Foundation; either version 2 of the license or (at your
- * option) any later version.
+ * This source code is public domain.
*
* Authors: Olivier Lapicque <oli...@jp...>
*/
Modified: trunk/OpenMPT/soundlib/Load_ptm.cpp
===================================================================
--- trunk/OpenMPT/soundlib/Load_ptm.cpp 2008-07-11 16:17:21 UTC (rev 215)
+++ trunk/OpenMPT/soundlib/Load_ptm.cpp 2008-07-25 20:20:15 UTC (rev 216)
@@ -1,10 +1,11 @@
/*
- * This program is free software; you can redistribute it and modify it
- * under the terms of the GNU General Public License as published by the
- * Free Software Foundation; either version 2 of the license or (at your
- * option) any later version.
+ * This source code is public domain.
*
- * Authors: Olivier Lapicque <oli...@jp...>
+ * Copied to OpenMPT from libmodplug.
+ *
+ * Authors: Olivier Lapicque <oli...@jp...>,
+ * Adam Goode <ad...@ev...> (endian and char fixes for PPC)
+ * OpenMPT dev(s) (miscellaneous modifications)
*/
//////////////////////////////////////////////
@@ -13,7 +14,7 @@
#include "stdafx.h"
#include "sndfile.h"
-#pragma warning(disable:4244)
+#pragma warning(disable:4244) //"conversion from 'type1' to 'type2', possible loss of data"
#pragma pack(1)
@@ -52,7 +53,7 @@
WORD loopbeg[2]; // start of loop
WORD loopend[2]; // end of loop
WORD gusdata[8];
- CHAR samplename[28]; // name of sample, asciiz
+ char samplename[28]; // name of sample, asciiz
DWORD ptms_id; // sample identification, 'PTMS' or 0x534d5450
} PTMSAMPLE;
@@ -64,29 +65,42 @@
BOOL CSoundFile::ReadPTM(const BYTE *lpStream, DWORD dwMemLength)
//---------------------------------------------------------------
{
- LPPTMFILEHEADER pfh = (LPPTMFILEHEADER)lpStream;
+ PTMFILEHEADER pfh = *(LPPTMFILEHEADER)lpStream;
DWORD dwMemPos;
UINT nOrders;
+ pfh.norders = LittleEndianW(pfh.norders);
+ pfh.nsamples = LittleEndianW(pfh.nsamples);
+ pfh.npatterns = LittleEndianW(pfh.npatterns);
+ pfh.nchannels = LittleEndianW(pfh.nchannels);
+ pfh.fileflags = LittleEndianW(pfh.fileflags);
+ pfh.reserved2 = LittleEndianW(pfh.reserved2);
+ pfh.ptmf_id = LittleEndian(pfh.ptmf_id);
+ for (UINT j=0; j<128; j++)
+ {
+ pfh.patseg[j] = LittleEndianW(pfh.patseg[j]);
+ }
+
if ((!lpStream) || (dwMemLength < 1024)) return FALSE;
- if ((pfh->ptmf_id != 0x464d5450) || (!pfh->nchannels) || (pfh->nchannels > 32)
- || (pfh->norders > 256) || (!pfh->norders)
- || (!pfh->nsamples) || (pfh->nsamples > 255)
- || (!pfh->npatterns) || (pfh->npatterns > 128)
- || (SIZEOF_PTMFILEHEADER+pfh->nsamples*SIZEOF_PTMSAMPLE >= (int)dwMemLength)) return FALSE;
- memcpy(m_szNames[0], pfh->songname, 28);
+ if ((pfh.ptmf_id != 0x464d5450) || (!pfh.nchannels)
+ || (pfh.nchannels > 32)
+ || (pfh.norders > 256) || (!pfh.norders)
+ || (!pfh.nsamples) || (pfh.nsamples > 255)
+ || (!pfh.npatterns) || (pfh.npatterns > 128)
+ || (SIZEOF_PTMFILEHEADER+pfh.nsamples*SIZEOF_PTMSAMPLE >= (int)dwMemLength)) return FALSE;
+ memcpy(m_szNames[0], pfh.songname, 28);
m_szNames[0][28] = 0;
m_nType = MOD_TYPE_PTM;
- m_nChannels = pfh->nchannels;
- m_nSamples = (pfh->nsamples < MAX_SAMPLES) ? pfh->nsamples : MAX_SAMPLES-1;
+ m_nChannels = pfh.nchannels;
+ m_nSamples = (pfh.nsamples < MAX_SAMPLES) ? pfh.nsamples : MAX_SAMPLES-1;
dwMemPos = SIZEOF_PTMFILEHEADER;
- nOrders = (pfh->norders < MAX_ORDERS) ? pfh->norders : MAX_ORDERS-1;
- Order.ReadAsByte(pfh->orders, nOrders, nOrders);
+ nOrders = (pfh.norders < MAX_ORDERS) ? pfh.norders : MAX_ORDERS-1;
+ Order.ReadAsByte(pfh.orders, nOrders, nOrders);
for (UINT ipan=0; ipan<m_nChannels; ipan++)
{
ChnSettings[ipan].nVolume = 64;
- ChnSettings[ipan].nPan = ((pfh->chnpan[ipan] & 0x0F) << 4) + 4;
+ ChnSettings[ipan].nPan = ((pfh.chnpan[ipan] & 0x0F) << 4) + 4;
}
for (UINT ismp=0; ismp<m_nSamples; ismp++, dwMemPos += SIZEOF_PTMSAMPLE)
{
@@ -99,16 +113,16 @@
pins->nGlobalVol = 64;
pins->nPan = 128;
pins->nVolume = psmp->volume << 2;
- pins->nC4Speed = psmp->nC4Spd << 1;
+ pins->nC4Speed = LittleEndianW(psmp->nC4Spd) << 1;
pins->uFlags = 0;
if ((psmp->sampletype & 3) == 1)
{
UINT smpflg = RS_PCM8D;
DWORD samplepos;
- pins->nLength = *(LPDWORD)(psmp->length);
- pins->nLoopStart = *(LPDWORD)(psmp->loopbeg);
- pins->nLoopEnd = *(LPDWORD)(psmp->loopend);
- samplepos = *(LPDWORD)(&psmp->fileofs);
+ pins->nLength = LittleEndian(*(LPDWORD)(psmp->length));
+ pins->nLoopStart = LittleEndian(*(LPDWORD)(psmp->loopbeg));
+ pins->nLoopEnd = LittleEndian(*(LPDWORD)(psmp->loopend));
+ samplepos = LittleEndian(*(LPDWORD)(&psmp->fileofs));
if (psmp->sampletype & 4) pins->uFlags |= CHN_LOOP;
if (psmp->sampletype & 8) pins->uFlags |= CHN_PINGPONGLOOP;
if (psmp->sampletype & 16)
@@ -126,9 +140,9 @@
}
}
// Reading Patterns
- for (UINT ipat=0; ipat<pfh->npatterns; ipat++)
+ for (UINT ipat=0; ipat<pfh.npatterns; ipat++)
{
- dwMemPos = ((UINT)pfh->patseg[ipat]) << 4;
+ dwMemPos = ((UINT)pfh.patseg[ipat]) << 4;
if ((!dwMemPos) || (dwMemPos >= dwMemLength)) continue;
if(Patterns.Insert(ipat, 64))
break;
Modified: trunk/OpenMPT/soundlib/Load_s3m.cpp
===================================================================
--- trunk/OpenMPT/soundlib/Load_s3m.cpp 2008-07-11 16:17:21 UTC (rev 215)
+++ trunk/OpenMPT/soundlib/Load_s3m.cpp 2008-07-25 20:20:15 UTC (rev 216)
@@ -1,16 +1,17 @@
/*
- * This program is free software; you can redistribute it and modify it
- * under the terms of the GNU General Public License as published by the
- * Free Software Foundation; either version 2 of the license or (at your
- * option) any later version.
+ * This source code is public domain.
*
- * Authors: Olivier Lapicque <oli...@jp...>
+ * Copied to OpenMPT from libmodplug.
+ *
+ * Authors: Olivier Lapicque <oli...@jp...>,
+ * Adam Goode <ad...@ev...> (endian and char fixes for PPC)
+ * OpenMPT dev(s) (miscellaneous modifications)
*/
#include "stdafx.h"
#include "sndfile.h"
-#pragma warning(disable:4244) //conversion from 'type1' to 'type2', possible loss of data
+#pragma warning(disable:4244) //"conversion from 'type1' to 'type2', possible loss of data"
extern WORD S3MFineTuneTable[16];
@@ -207,45 +208,56 @@
BYTE s[1024];
DWORD dwMemPos;
BYTE insflags[128], inspack[128];
- S3MFILEHEADER *psfh = (S3MFILEHEADER *)lpStream;
+ S3MFILEHEADER psfh = *(S3MFILEHEADER *)lpStream;
+ psfh.reserved1 = LittleEndianW(psfh.reserved1);
+ psfh.ordnum = LittleEndianW(psfh.ordnum);
+ psfh.insnum = LittleEndianW(psfh.insnum);
+ psfh.patnum = LittleEndianW(psfh.patnum);
+ psfh.flags = LittleEndianW(psfh.flags);
+ psfh.cwtv = LittleEndianW(psfh.cwtv);
+ psfh.version = LittleEndianW(psfh.version);
+ psfh.scrm = LittleEndian(psfh.scrm);
+ psfh.special = LittleEndianW(psfh.special);
+
if ((!lpStream) || (dwMemLength <= sizeof(S3MFILEHEADER)+sizeof(S3MSAMPLESTRUCT)+64)) return FALSE;
- if (psfh->scrm != 0x4D524353) return FALSE;
+ if (psfh.scrm != 0x4D524353) return FALSE;
dwMemPos = 0x60;
m_nType = MOD_TYPE_S3M;
memset(m_szNames,0,sizeof(m_szNames));
- memcpy(m_szNames[0], psfh->name, 28);
+ memcpy(m_szNames[0], psfh.name, 28);
// Speed
- m_nDefaultSpeed = psfh->speed;
+ m_nDefaultSpeed = psfh.speed;
if (m_nDefaultSpeed < 1) m_nDefaultSpeed = 6;
if (m_nDefaultSpeed > 0x1F) m_nDefaultSpeed = 0x1F;
// Tempo
- m_nDefaultTempo = psfh->tempo;
+ m_nDefaultTempo = psfh.tempo;
if (m_nDefaultTempo < 40) m_nDefaultTempo = 40;
if (m_nDefaultTempo > 240) m_nDefaultTempo = 240;
// Global Volume
- m_nDefaultGlobalVolume = psfh->globalvol << 2;
+ m_nDefaultGlobalVolume = psfh.globalvol << 2;
if ((!m_nDefaultGlobalVolume) || (m_nDefaultGlobalVolume > 256)) m_nDefaultGlobalVolume = 256;
- m_nSamplePreAmp = psfh->mastervol & 0x7F;
+ m_nSamplePreAmp = psfh.mastervol & 0x7F;
// Channels
m_nChannels = 4;
for (UINT ich=0; ich<32; ich++)
{
ChnSettings[ich].nPan = 128;
ChnSettings[ich].nVolume = 64;
+
ChnSettings[ich].dwFlags = CHN_MUTE;
- if (psfh->channels[ich] != 0xFF)
+ if (psfh.channels[ich] != 0xFF)
{
m_nChannels = ich+1;
- UINT b = psfh->channels[ich] & 0x0F;
+ UINT b = psfh.channels[ich] & 0x0F;
ChnSettings[ich].nPan = (b & 8) ? 0xC0 : 0x40;
ChnSettings[ich].dwFlags = 0;
}
}
if (m_nChannels < 4) m_nChannels = 4;
- if ((psfh->cwtv < 0x1320) || (psfh->flags & 0x40)) m_dwSongFlags |= SONG_FASTVOLSLIDES;
+ if ((psfh.cwtv < 0x1320) || (psfh.flags & 0x40)) m_dwSongFlags |= SONG_FASTVOLSLIDES;
// Reading pattern order
- UINT iord = psfh->ordnum;
+ UINT iord = psfh.ordnum;
if (iord<1) iord = 1;
if (iord > MAX_ORDERS) iord = MAX_ORDERS;
if (iord)
@@ -255,17 +267,21 @@
}
if ((iord & 1) && (lpStream[dwMemPos] == 0xFF)) dwMemPos++;
// Reading file pointers
- insnum = nins = psfh->insnum;
+ insnum = nins = psfh.insnum;
if (insnum >= MAX_SAMPLES) insnum = MAX_SAMPLES-1;
m_nSamples = insnum;
- patnum = npat = psfh->patnum;
+ patnum = npat = psfh.patnum;
if (patnum > MAX_PATTERNS) patnum = MAX_PATTERNS;
memset(ptr, 0, sizeof(ptr));
if (nins+npat)
{
memcpy(ptr, lpStream+dwMemPos, 2*(nins+npat));
dwMemPos += 2*(nins+npat);
- if (psfh->panning_present == 252)
+ const UINT nLoopEnd = min(256, nins+npat);
+ for (UINT j = 0; j < nLoopEnd; ++j) {
+ ptr[j] = LittleEndianW(ptr[j]);
+ }
+ if (psfh.panning_present == 252)
{
const BYTE *chnpan = lpStream+dwMemPos;
for (UINT i=0; i<32; i++) if (chnpan[i] & 0x20)
@@ -289,14 +305,14 @@
lstrcpy(m_szNames[iSmp], (LPCSTR)&s[0x30]);
if ((s[0]==1) && (s[0x4E]=='R') && (s[0x4F]=='S'))
{
- UINT j = *((LPDWORD)(s+0x10));
+ UINT j = LittleEndian(*((LPDWORD)(s+0x10)));
if (j > MAX_SAMPLE_LENGTH) j = MAX_SAMPLE_LENGTH;
if (j < 4) j = 0;
Ins[iSmp].nLength = j;
- j = *((LPDWORD)(s+0x14));
+ j = LittleEndian(*((LPDWORD)(s+0x14)));
if (j >= Ins[iSmp].nLength) j = Ins[iSmp].nLength - 1;
Ins[iSmp].nLoopStart = j;
- j = *((LPDWORD)(s+0x18));
+ j = LittleEndian(*((LPDWORD)(s+0x18)));
if (j > MAX_SAMPLE_LENGTH) j = MAX_SAMPLE_LENGTH;
if (j < 4) j = 0;
if (j > Ins[iSmp].nLength) j = Ins[iSmp].nLength;
@@ -306,11 +322,11 @@
Ins[iSmp].nVolume = j << 2;
Ins[iSmp].nGlobalVol = 64;
if (s[0x1F]&1) Ins[iSmp].uFlags |= CHN_LOOP;
- j = *((LPDWORD)(s+0x20));
+ j = LittleEndian(*((LPDWORD)(s+0x20)));
if (!j) j = 8363;
if (j < 1024) j = 1024;
Ins[iSmp].nC4Speed = j;
- insfile[iSmp] = ((DWORD)*((LPWORD)(s+0x0E))) << 4;
+ insfile[iSmp] = ((DWORD)LittleEndianW(*((LPWORD)(s+0x0E)))) << 4;
insfile[iSmp] += ((DWORD)(BYTE)s[0x0D]) << 20;
if (insfile[iSmp] > dwMemLength) insfile[iSmp] &= 0xFFFF;
if ((Ins[iSmp].nLoopStart >= Ins[iSmp].nLoopEnd) || (Ins[iSmp].nLoopEnd - Ins[iSmp].nLoopStart < 8))
@@ -323,7 +339,7 @@
{
UINT nInd = ((DWORD)ptr[nins+iPat]) << 4;
if (nInd + 0x40 > dwMemLength) continue;
- WORD len = *((WORD *)(lpStream+nInd));
+ WORD len = LittleEndianW(*((WORD *)(lpStream+nInd)));
nInd += 2;
bool fail = Patterns.Insert(iPat, 64);
if ((!len) || (nInd + len > dwMemLength - 6)
@@ -385,7 +401,7 @@
// Reading samples
for (UINT iRaw=1; iRaw<=insnum; iRaw++) if ((Ins[iRaw].nLength) && (insfile[iRaw]))
{
- UINT flags = (psfh->version == 1) ? RS_PCM8S : RS_PCM8U;
+ UINT flags = (psfh.version == 1) ? RS_PCM8S : RS_PCM8U;
if (insflags[iRaw-1] & 4) flags += 5;
if (insflags[iRaw-1] & 2) flags |= RSF_STEREO;
if (inspack[iRaw-1] == 4) flags = RS_ADPCM4;
@@ -394,7 +410,7 @@
}
m_nMinPeriod = 64;
m_nMaxPeriod = 32767;
- if (psfh->flags & 0x10) m_dwSongFlags |= SONG_AMIGALIMITS;
+ if (psfh.flags & 0x10) m_dwSongFlags |= SONG_AMIGALIMITS;
return TRUE;
}
Modified: trunk/OpenMPT/soundlib/Load_stm.cpp
===================================================================
--- trunk/OpenMPT/soundlib/Load_stm.cpp 2008-07-11 16:17:21 UTC (rev 215)
+++ trunk/OpenMPT/soundlib/Load_stm.cpp 2008-07-25 20:20:15 UTC (rev 216)
@@ -1,16 +1,16 @@
/*
- * This program is free software; you can redistribute it and modify it
- * under the terms of the GNU General Public License as published by the
- * Free Software Foundation; either version 2 of the license or (at your
- * option) any later version.
+ * This source code is public domain.
*
+ * Copied to OpenMPT from libmodplug.
+ *
* Authors: Olivier Lapicque <oli...@jp...>
+ *
*/
#include "stdafx.h"
#include "sndfile.h"
-#pragma warning(disable:4244)
+#pragma warning(disable:4244) //"conversion from 'type1' to 'type2', possible loss of data"
#pragma pack(1)
@@ -41,8 +41,8 @@
// Raw STM header struct:
typedef struct tagSTMHEADER
{
- CHAR songname[20];
- CHAR trackername[8]; // !SCREAM! for ST 2.xx
+ char songname[20];
+ char trackername[8]; // !SCREAM! for ST 2.xx
CHAR unused; // 0x1A
CHAR filetype; // 1=song, 2=module (only 2 is supported, of course) :)
CHAR ver_major; // Like 2
@@ -97,14 +97,14 @@
STMSAMPLE *pStm = &phdr->sample[nIns]; // STM sample data
memcpy(pIns->name, pStm->filename, 13);
memcpy(m_szNames[nIns+1], pStm->filename, 12);
- pIns->nC4Speed = pStm->c2spd;
+ pIns->nC4Speed = LittleEndianW(pStm->c2spd);
pIns->nGlobalVol = 64;
pIns->nVolume = pStm->volume << 2;
if (pIns->nVolume > 256) pIns->nVolume = 256;
- pIns->nLength = pStm->length;
+ pIns->nLength = LittleEndianW(pStm->length);
if ((pIns->nLength < 4) || (!pIns->nVolume)) pIns->nLength = 0;
- pIns->nLoopStart = pStm->loopbeg;
- pIns->nLoopEnd = pStm->loopend;
+ pIns->nLoopStart = LittleEndianW(pStm->loopbeg);
+ pIns->nLoopEnd = LittleEndianW(pStm->loopend);
if ((pIns->nLoopEnd > pIns->nLoopStart) && (pIns->nLoopEnd != 0xFFFF)) pIns->uFlags |= CHN_LOOP;
}
dwMemPos = sizeof(STMHEADER);
Modified: trunk/OpenMPT/soundlib/Load_ult.cpp
===================================================================
--- trunk/OpenMPT/soundlib/Load_ult.cpp 2008-07-11 16:17:21 UTC (rev 215)
+++ trunk/OpenMPT/soundlib/Load_ult.cpp 2008-07-25 20:20:15 UTC (rev 216)
@@ -1,16 +1,16 @@
/*
- * This program is free software; you can redistribute it and modify it
- * under the terms of the GNU General Public License as published by the
- * Free Software Foundation; either version 2 of the license or (at your
- * option) any later version.
+ * This source code is public domain.
*
+ * Copied to OpenMPT from libmodplug.
+ *
* Authors: Olivier Lapicque <oli...@jp...>
+ *
*/
#include "stdafx.h"
#include "sndfile.h"
-#pragma warning(disable:4244)
+#pragma warning(disable:4244) //"conversion from 'type1' to 'type2', possible loss of data"
#define ULT_16BIT 0x04
#define ULT_LOOP 0x08
@@ -21,8 +21,8 @@
// Raw ULT header struct:
typedef struct tagULTHEADER
{
- CHAR id[15];
- CHAR songtitle[32];
+ char id[15];
+ char songtitle[32];
BYTE reserved;
} ULTHEADER;
@@ -135,7 +135,7 @@
// Allocating Patterns
for (UINT nAllocPat=0; nAllocPat<nop; nAllocPat++)
{
- if (nAllocPat < Patterns.Size())
+ if (nAllocPat < MAX_PATTERNS)
{
Patterns.Insert(nAllocPat, 64);
}
Modified: trunk/OpenMPT/soundlib/Load_umx.cpp
===================================================================
--- trunk/OpenMPT/soundlib/Load_umx.cpp 2008-07-11 16:17:21 UTC (rev 215)
+++ trunk/OpenMPT/soundlib/Load_umx.cpp 2008-07-25 20:20:15 UTC (rev 216)
@@ -1,9 +1,8 @@
/*
- * This program is free software; you can redistribute it and modify it
- * under the terms of the GNU General Public License as published by the
- * Free Software Foundation; either version 2 of the license or (at your
- * option) any later version.
+ * This source code is public domain.
*
+ * Copied to OpenMPT from libmodplug.
+ *
* Authors: Olivier Lapicque <oli...@jp...>
*/
@@ -18,13 +17,13 @@
{
if ((!lpStream) || (dwMemLength < 0x800)) return FALSE;
// Rip Mods from UMX
- if ((*((DWORD *)(lpStream+0x20)) < dwMemLength)
- && (*((DWORD *)(lpStream+0x18)) <= dwMemLength - 0x10)
- && (*((DWORD *)(lpStream+0x18)) >= dwMemLength - 0x200))
+ if ((LittleEndian(*((DWORD *)(lpStream+0x20))) < dwMemLength)
+ && (LittleEndian(*((DWORD *)(lpStream+0x18))) <= dwMemLength - 0x10)
+ && (LittleEndian(*((DWORD *)(lpStream+0x18))) >= dwMemLength - 0x200))
{
for (UINT uscan=0x40; uscan<0x500; uscan++)
{
- DWORD dwScan = *((DWORD *)(lpStream+uscan));
+ DWORD dwScan = LittleEndian(*((DWORD *)(lpStream+uscan)));
// IT
if (dwScan == 0x4D504D49)
{
Modified: trunk/OpenMPT/soundlib/Load_wav.cpp
===================================================================
--- trunk/OpenMPT/soundlib/Load_wav.cpp 2008-07-11 16:17:21 UTC (rev 215)
+++ trunk/OpenMPT/soundlib/Load_wav.cpp 2008-07-25 20:20:15 UTC (rev 216)
@@ -1,10 +1,10 @@
/*
- * This program is free software; you can redistribute it and modify it
- * under the terms of the GNU General Public License as published by the
- * Free Software Foundation; either version 2 of the license or (at your
- * option) any later version.
+ * This source code is public domain.
*
+ * Copied to OpenMPT from libmodplug.
+ *
* Authors: Olivier Lapicque <oli...@jp...>
+ * OpenMPT dev(s) (miscellaneous modifications)
*/
#include "stdafx.h"
@@ -120,7 +120,7 @@
{
int slsize = pfmt->bitspersample >> 3;
signed short *p = (signed short *)pins->pSample;
- char *psrc = (char *)(lpStream+dwMemPos+8+nChn*slsize+slsize-2);
+ signed char *psrc = (signed char *)(lpStream+dwMemPos+8+nChn*slsize+slsize-2);
for (UINT i=0; i<len; i++)
{
p[i] = *((signed short *)psrc);
@@ -133,7 +133,7 @@
signed char *psrc = (signed char *)(lpStream+dwMemPos+8+nChn);
for (UINT i=0; i<len; i++)
{
- p[i] = (char)((*psrc) + 0x80);
+ p[i] = (signed char)((*psrc) + 0x80);
psrc += samplesize;
}
p[len+1] = p[len] = p[len-1];
Modified: trunk/OpenMPT/soundlib/Load_xm.cpp
===================================================================
--- trunk/OpenMPT/soundlib/Load_xm.cpp 2008-07-11 16:17:21 UTC (rev 215)
+++ trunk/OpenMPT/soundlib/Load_xm.cpp 2008-07-25 20:20:15 UTC (rev 216)
@@ -1,10 +1,9 @@
/*
- * This program is free software; you can redistribute it and modify it
- * under the terms of the GNU General Public License as published by the
- * Free Software Foundation; either version 2 of the license or (at your
- * option) any later version.
+ * Copied to OpenMPT from libmodplug.
*
- * Authors: Olivier Lapicque <oli...@jp...>
+ * Authors: Olivier Lapicque <oli...@jp...>,
+ * Adam Goode <ad...@ev...> (endian and char fixes for PPC)
+ * OpenMPT dev(s) (miscellaneous modifications)
*/
#include "stdafx.h"
@@ -100,11 +99,11 @@
if ((!lpStream) || (dwMemLength < 0x200)) return FALSE;
if (_strnicmp((LPCSTR)lpStream, "Extended Module", 15)) return FALSE;
memcpy(m_szNames[0], lpStream+17, 20);
- dwHdrSize = *((DWORD *)(lpStream+60));
- norders = *((WORD *)(lpStream+64));
+ dwHdrSize = LittleEndian(*((DWORD *)(lpStream+60)));
+ norders = LittleEndianW(*((WORD *)(lpStream+64)));
if ((!norders) || (norders > MAX_ORDERS)) return FALSE;
- restartpos = *((WORD *)(lpStream+66));
- channels = *((WORD *)(lpStream+68));
+ restartpos = LittleEndianW(*((WORD *)(lpStream+66)));
+ channels = LittleEndianW(*((WORD *)(lpStream+68)));
// -> CODE#0006
// -> DESC="misc quantity changes"
// if ((!channels) || (channels > 64)) return FALSE;
@@ -115,17 +114,18 @@
m_nMaxPeriod = 54784;
m_nChannels = channels;
if (restartpos < norders) m_nRestartPos = restartpos;
- patterns = *((WORD *)(lpStream+70));
+ patterns = LittleEndianW(*((WORD *)(lpStream+70)));
if (patterns > 256) patterns = 256;
- instruments = *((WORD *)(lpStream+72));
+ instruments = LittleEndianW(*((WORD *)(lpStream+72)));
if (instruments >= MAX_INSTRUMENTS) instruments = MAX_INSTRUMENTS-1;
m_nInstruments = instruments;
m_nSamples = 0;
memcpy(&xmflags, lpStream+74, 2);
+ xmflags = LittleEndianW(xmflags);
if (xmflags & 1) m_dwSongFlags |= SONG_LINEARSLIDES;
if (xmflags & 0x1000) m_dwSongFlags |= SONG_EXFILTERRANGE;
- defspeed = *((WORD *)(lpStream+76));
- deftempo = *((WORD *)(lpStream+78));
+ defspeed = LittleEndianW(*((WORD *)(lpStream+76)));
+ deftempo = LittleEndianW(*((WORD *)(lpStream+78)));
// -> CODE#0016
// -> DESC="default tempo update"
// if ((deftempo >= 32) && (deftempo < 256)) m_nDefaultTempo = deftempo;
@@ -172,20 +172,20 @@
UINT ipatmap = pattern_map[ipat];
DWORD dwSize = 0;
WORD rows=64, packsize=0;
- dwSize = *((DWORD *)(lpStream+dwMemPos));
+ dwSize = LittleEndian(*((DWORD *)(lpStream+dwMemPos)));
while ((dwMemPos + dwSize >= dwMemLength) || (dwSize & 0xFFFFFF00))
{
if (dwMemPos + 4 >= dwMemLength) break;
dwMemPos++;
- dwSize = *((DWORD *)(lpStream+dwMemPos));
+ dwSize = LittleEndian(*((DWORD *)(lpStream+dwMemPos)));
}
- rows = *((WORD *)(lpStream+dwMemPos+5));
+ rows = LittleEndianW(*((WORD *)(lpStream+dwMemPos+5)));
// -> CODE#0008
// -> DESC="#define to set pattern size"
// if ((!rows) || (rows > 256)) rows = 64;
if ((!rows) || (rows > MAX_PATTERN_ROWS)) rows = 64;
// -> BEHAVIOUR_CHANGE#0008
- packsize = *((WORD *)(lpStream+dwMemPos+7));
+ packsize = LittleEndianW(*((WORD *)(lpStream+dwMemPos+7)));
if (dwMemPos + dwSize + 4 > dwMemLength) return TRUE;
dwMemPos += dwSize;
if (dwMemPos + packsize + 4 > dwMemLength) return TRUE;
@@ -284,7 +284,7 @@
// Wrong offset check
while (dwMemPos + 4 < dwMemLength)
{
- DWORD d = *((DWORD *)(lpStream+dwMemPos));
+ DWORD d = LittleEndian(*((DWORD *)(lpStream+dwMemPos)));
if (d < 0x300) break;
dwMemPos++;
}
@@ -301,7 +301,7 @@
if (dwMemPos + sizeof(XMINSTRUMENTHEADER) >= dwMemLength) return TRUE;
pih = (XMINSTRUMENTHEADER *)(lpStream+dwMemPos);
- if (dwMemPos + pih->size > dwMemLength) return TRUE;
+ if (dwMemPos + LittleEndian(pih->size) > dwMemLength) return TRUE;
if ((Headers[iIns] = new INSTRUMENTHEADER) == NULL) continue;
memset(Headers[iIns], 0, sizeof(INSTRUMENTHEADER));
Headers[iIns]->pTuning = m_defaultInstrument.pTuning;
@@ -313,10 +313,17 @@
{
if (dwMemPos + sizeof(XMSAMPLEHEADER) > dwMemLength) return TRUE;
memcpy(&xmsh, lpStream+dwMemPos+sizeof(XMINSTRUMENTHEADER), sizeof(XMSAMPLEHEADER));
- dwMemPos += pih->size;
+ xmsh.shsize = LittleEndian(xmsh.shsize);
+ for (int i = 0; i < 24; ++i) {
+ xmsh.venv[i] = LittleEndianW(xmsh.venv[i]);
+ xmsh.penv[i] = LittleEndianW(xmsh.penv[i]);
+ }
+ xmsh.volfade = LittleEndianW(xmsh.volfade);
+ xmsh.res = LittleEndianW(xmsh.res);
+ dwMemPos += LittleEndian(pih->size);
} else
{
- if (pih->size) dwMemPos += pih->size;
+ if (LittleEndian(pih->size)) dwMemPos += LittleEndian(pih->size);
else dwMemPos += sizeof(XMINSTRUMENTHEADER);
continue;
}
@@ -456,6 +463,9 @@
if ((dwMemPos + sizeof(xmss) > dwMemLength)
|| (dwMemPos + xmsh.shsize > dwMemLength)) return TRUE;
memcpy(&xmss, lpStream+dwMemPos, sizeof(xmss));
+ xmss.samplen = LittleEndian(xmss.samplen);
+ xmss.loopstart = LittleEndian(xmss.loopstart);
+ xmss.looplen = LittleEndian(xmss.looplen);
dwMemPos += xmsh.shsize;
flags[ins] = (xmss.type & 0x10) ? RS_PCM16D : RS_PCM8D;
if (xmss.type & 0x20) flags[ins] = (xmss.type & 0x10) ? RS_STPCM16D : RS_STPCM8D;
@@ -528,7 +538,7 @@
}
}
// Read song comments: "TEXT"
- if ((dwMemPos + 8 < dwMemLength) && (*((DWORD *)(lpStream+dwMemPos)) == 0x74786574))
+ if ((dwMemPos + 8 < dwMemLength) && (LittleEndian(*((DWORD *)(lpStream+dwMemPos))) == 0x74786574))
{
UINT len = *((DWORD *)(lpStream+dwMemPos+4));
dwMemPos += 8;
@@ -544,7 +554,7 @@
}
}
// Read midi config: "MIDI"
- if ((dwMemPos + 8 < dwMemLength) && (*((DWORD *)(lpStream+dwMemPos)) == 0x4944494D))
+ if ((dwMemPos + 8 < dwMemLength) && (LittleEndian(*((DWORD *)(lpStream+dwMemPos))) == 0x4944494D))
{
UINT len = *((DWORD *)(lpStream+dwMemPos+4));
dwMemPos += 8;
@@ -556,7 +566,7 @@
}
}
// Read pattern names: "PNAM"
- if ((dwMemPos + 8 < dwMemLength) && (*((DWORD *)(lpStream+dwMemPos)) == 0x4d414e50))
+ if ((dwMemPos + 8 < dwMemLength) && (LittleEndian(*((DWORD *)(lpStream+dwMemPos))) == 0x4d414e50))
{
UINT len = *((DWORD *)(lpStream+dwMemPos+4));
dwMemPos += 8;
@@ -572,7 +582,7 @@
}
}
// Read channel names: "CNAM"
- if ((dwMemPos + 8 < dwMemLength) && (*((DWORD *)(lpStream+dwMemPos)) == 0x4d414e43))
+ if ((dwMemPos + 8 < dwMemLength) && (LittleEndian(*((DWORD *)(lpStream+dwMemPos))) == 0x4d414e43))
{
UINT len = *((DWORD *)(lpStream+dwMemPos+4));
dwMemPos += 8;
Modified: trunk/OpenMPT/soundlib/Sndfile.h
===================================================================
--- trunk/OpenMPT/soundlib/Sndfile.h 2008-07-11 16:17:21 UTC (rev 215)
+++ trunk/OpenMPT/soundlib/Sndfile.h 2008-07-25 20:20:15 UTC (rev 216)
@@ -1300,7 +1300,14 @@
return NULL;
}
-
+// Ending swaps:
+// BigEndian(x) may be used either to:
+// -Convert DWORD x, which is in big endian format(for example read from file),
+// to endian format of current architecture.
+// -Convert value x from endian format of current architecture to big endian format.
+// Similarly LittleEndian(x) converts known little endian format to format of current
+// endian architecture or value x in format of current architecture to little endian
+// format.
#ifdef PLATFORM_BIG_ENDIAN
// PPC
inline DWORD LittleEndian(DWORD x) { return ((x & 0xFF) << 24) | ((x & 0xFF00) << 8) | ((x & 0xFF0000) >> 8) | ((x & 0xFF000000) >> 24); }
@@ -1315,6 +1322,8 @@
#define LittleEndianW(x) (x)
#endif
+
+
//////////////////////////////////////////////////////////
// WAVE format information
Modified: trunk/OpenMPT/soundlib/load_j2b.cpp
===================================================================
--- trunk/OpenMPT/soundlib/load_j2b.cpp 2008-07-11 16:17:21 UTC (rev 215)
+++ trunk/OpenMPT/soundlib/load_j2b.cpp 2008-07-25 20:20:15 UTC (rev 216)
@@ -1,8 +1,5 @@
/*
- * This program is free software; you can redistribute it and modify it
- * under the terms of the GNU General Public License as published by the
- * Free Software Foundation; either version 2 of the license or (at your
- * option) any later version.
+ * This source code is public domain.
*
* Authors: Olivier Lapicque <oli...@jp...>
*/
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <rel...@us...> - 2008-07-11 16:17:31
|
Revision: 215
http://modplug.svn.sourceforge.net/modplug/?rev=215&view=rev
Author: relabsoluness
Date: 2008-07-11 09:17:21 -0700 (Fri, 11 Jul 2008)
Log Message:
-----------
/ Changes to project files: Now there are only Debug and Release configurations.
Modified Paths:
--------------
trunk/OpenMPT/mptrack/MPTRACK.sln
trunk/OpenMPT/mptrack/mptrack.vcproj
trunk/OpenMPT/unlha/unlha.vcproj
trunk/OpenMPT/unrar/UNRAR.vcproj
trunk/OpenMPT/unzip/unzip.vcproj
trunk/OpenMPT/xsoundlib/xsoundlib.vcproj
Modified: trunk/OpenMPT/mptrack/MPTRACK.sln
===================================================================
--- trunk/OpenMPT/mptrack/MPTRACK.sln 2008-07-06 12:24:33 UTC (rev 214)
+++ trunk/OpenMPT/mptrack/MPTRACK.sln 2008-07-11 16:17:21 UTC (rev 215)
@@ -25,63 +25,32 @@
EndProject
Global
GlobalSection(SolutionConfiguration) = preSolution
- Athlon32 = Athlon32
Debug = Debug
- Generic = Generic
- P3 = P3
- P4-Athlon64 = P4-Athlon64
+ Release = Release
EndGlobalSection
+ GlobalSection(ProjectDependencies) = postSolution
+ EndGlobalSection
GlobalSection(ProjectConfiguration) = postSolution
- {DB18719C-9177-4632-A9E0-7E72E2E6B05E}.Athlon32.ActiveCfg = Athlon32|Win32
- {DB18719C-9177-4632-A9E0-7E72E2E6B05E}.Athlon32.Build.0 = Athlon32|Win32
{DB18719C-9177-4632-A9E0-7E72E2E6B05E}.Debug.ActiveCfg = Debug|Win32
{DB18719C-9177-4632-A9E0-7E72E2E6B05E}.Debug.Build.0 = Debug|Win32
- {DB18719C-9177-4632-A9E0-7E72E2E6B05E}.Generic.ActiveCfg = Generic|Win32
- {DB18719C-9177-4632-A9E0-7E72E2E6B05E}.Generic.Build.0 = Generic|Win32
- {DB18719C-9177-4632-A9E0-7E72E2E6B05E}.P3.ActiveCfg = P3|Win32
- {DB18719C-9177-4632-A9E0-7E72E2E6B05E}.P3.Build.0 = P3|Win32
- {DB18719C-9177-4632-A9E0-7E72E2E6B05E}.P4-Athlon64.ActiveCfg = P4-Athlon64|Win32
- {DB18719C-9177-4632-A9E0-7E72E2E6B05E}.P4-Athlon64.Build.0 = P4-Athlon64|Win32
- {71531076-78C7-488D-8FD6-9D841F20AADE}.Athlon32.ActiveCfg = Athlon32|Win32
- {71531076-78C7-488D-8FD6-9D841F20AADE}.Athlon32.Build.0 = Athlon32|Win32
+ {DB18719C-9177-4632-A9E0-7E72E2E6B05E}.Release.ActiveCfg = Release|Win32
+ {DB18719C-9177-4632-A9E0-7E72E2E6B05E}.Release.Build.0 = Release|Win32
{71531076-78C7-488D-8FD6-9D841F20AADE}.Debug.ActiveCfg = Debug|Win32
{71531076-78C7-488D-8FD6-9D841F20AADE}.Debug.Build.0 = Debug|Win32
- {71531076-78C7-488D-8FD6-9D841F20AADE}.Generic.ActiveCfg = Generic|Win32
- {71531076-78C7-488D-8FD6-9D841F20AADE}.Generic.Build.0 = Generic|Win32
- {71531076-78C7-488D-8FD6-9D841F20AADE}.P3.ActiveCfg = P3|Win32
- {71531076-78C7-488D-8FD6-9D841F20AADE}.P3.Build.0 = P3|Win32
- {71531076-78C7-488D-8FD6-9D841F20AADE}.P4-Athlon64.ActiveCfg = P4-Athlon64|Win32
- {71531076-78C7-488D-8FD6-9D841F20AADE}.P4-Athlon64.Build.0 = P4-Athlon64|Win32
- {3C7281B0-D0E2-48ED-AE4D-A181FC77D8F7}.Athlon32.ActiveCfg = Athlon32|Win32
- {3C7281B0-D0E2-48ED-AE4D-A181FC77D8F7}.Athlon32.Build.0 = Athlon32|Win32
+ {71531076-78C7-488D-8FD6-9D841F20AADE}.Release.ActiveCfg = Release|Win32
+ {71531076-78C7-488D-8FD6-9D841F20AADE}.Release.Build.0 = Release|Win32
{3C7281B0-D0E2-48ED-AE4D-A181FC77D8F7}.Debug.ActiveCfg = Debug|Win32
{3C7281B0-D0E2-48ED-AE4D-A181FC77D8F7}.Debug.Build.0 = Debug|Win32
- {3C7281B0-D0E2-48ED-AE4D-A181FC77D8F7}.Generic.ActiveCfg = Generic|Win32
- {3C7281B0-D0E2-48ED-AE4D-A181FC77D8F7}.Generic.Build.0 = Generic|Win32
- {3C7281B0-D0E2-48ED-AE4D-A181FC77D8F7}.P3.ActiveCfg = P3|Win32
- {3C7281B0-D0E2-48ED-AE4D-A181FC77D8F7}.P3.Build.0 = P3|Win32
- {3C7281B0-D0E2-48ED-AE4D-A181FC77D8F7}.P4-Athlon64.ActiveCfg = P4-Athlon64|Win32
- {3C7281B0-D0E2-48ED-AE4D-A181FC77D8F7}.P4-Athlon64.Build.0 = P4-Athlon64|Win32
- {1FF4AB04-B22F-4CB8-AA2A-0C5095B5FEE4}.Athlon32.ActiveCfg = Athlon32|Win32
- {1FF4AB04-B22F-4CB8-AA2A-0C5095B5FEE4}.Athlon32.Build.0 = Athlon32|Win32
+ {3C7281B0-D0E2-48ED-AE4D-A181FC77D8F7}.Release.ActiveCfg = Release|Win32
+ {3C7281B0-D0E2-48ED-AE4D-A181FC77D8F7}.Release.Build.0 = Release|Win32
{1FF4AB04-B22F-4CB8-AA2A-0C5095B5FEE4}.Debug.ActiveCfg = Debug|Win32
{1FF4AB04-B22F-4CB8-AA2A-0C5095B5FEE4}.Debug.Build.0 = Debug|Win32
- {1FF4AB04-B22F-4CB8-AA2A-0C5095B5FEE4}.Generic.ActiveCfg = Generic|Win32
- {1FF4AB04-B22F-4CB8-AA2A-0C5095B5FEE4}.Generic.Build.0 = Generic|Win32
- {1FF4AB04-B22F-4CB8-AA2A-0C5095B5FEE4}.P3.ActiveCfg = P3|Win32
- {1FF4AB04-B22F-4CB8-AA2A-0C5095B5FEE4}.P3.Build.0 = P3|Win32
- {1FF4AB04-B22F-4CB8-AA2A-0C5095B5FEE4}.P4-Athlon64.ActiveCfg = P4-Athlon64|Win32
- {1FF4AB04-B22F-4CB8-AA2A-0C5095B5FEE4}.P4-Athlon64.Build.0 = P4-Athlon64|Win32
- {DCC2BB2F-6778-4FD3-9C00-D6CD8DC917B8}.Athlon32.ActiveCfg = Athlon32|Win32
- {DCC2BB2F-6778-4FD3-9C00-D6CD8DC917B8}.Athlon32.Build.0 = Athlon32|Win32
+ {1FF4AB04-B22F-4CB8-AA2A-0C5095B5FEE4}.Release.ActiveCfg = Release|Win32
+ {1FF4AB04-B22F-4CB8-AA2A-0C5095B5FEE4}.Release.Build.0 = Release|Win32
{DCC2BB2F-6778-4FD3-9C00-D6CD8DC917B8}.Debug.ActiveCfg = Debug|Win32
{DCC2BB2F-6778-4FD3-9C00-D6CD8DC917B8}.Debug.Build.0 = Debug|Win32
- {DCC2BB2F-6778-4FD3-9C00-D6CD8DC917B8}.Generic.ActiveCfg = Generic|Win32
- {DCC2BB2F-6778-4FD3-9C00-D6CD8DC917B8}.Generic.Build.0 = Generic|Win32
- {DCC2BB2F-6778-4FD3-9C00-D6CD8DC917B8}.P3.ActiveCfg = P3|Win32
- {DCC2BB2F-6778-4FD3-9C00-D6CD8DC917B8}.P3.Build.0 = P3|Win32
- {DCC2BB2F-6778-4FD3-9C00-D6CD8DC917B8}.P4-Athlon64.ActiveCfg = P4-Athlon64|Win32
- {DCC2BB2F-6778-4FD3-9C00-D6CD8DC917B8}.P4-Athlon64.Build.0 = P4-Athlon64|Win32
+ {DCC2BB2F-6778-4FD3-9C00-D6CD8DC917B8}.Release.ActiveCfg = Release|Win32
+ {DCC2BB2F-6778-4FD3-9C00-D6CD8DC917B8}.Release.Build.0 = Release|Win32
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
EndGlobalSection
Modified: trunk/OpenMPT/mptrack/mptrack.vcproj
===================================================================
--- trunk/OpenMPT/mptrack/mptrack.vcproj 2008-07-06 12:24:33 UTC (rev 214)
+++ trunk/OpenMPT/mptrack/mptrack.vcproj 2008-07-11 16:17:21 UTC (rev 215)
@@ -90,7 +90,7 @@
Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
</Configuration>
<Configuration
- Name="Generic|Win32"
+ Name="Release|Win32"
OutputDirectory="$(ConfigurationName)"
IntermediateDirectory="$(ConfigurationName)"
ConfigurationType="1"
@@ -110,12 +110,13 @@
RuntimeLibrary="0"
BufferSecurityCheck="TRUE"
EnableFunctionLevelLinking="FALSE"
+ ForceConformanceInForLoopScope="TRUE"
UsePrecompiledHeader="3"
PrecompiledHeaderThrough="stdafx.h"
- PrecompiledHeaderFile=".\Generic/mptrack.pch"
- AssemblerListingLocation=".\Generic/"
- ObjectFile=".\Generic/"
- ProgramDataBaseFileName=".\Generic/"
+ PrecompiledHeaderFile=".\Release/mptrack.pch"
+ AssemblerListingLocation=".\Release/"
+ ObjectFile=".\Release/"
+ ProgramDataBaseFileName=".\Release/"
WarningLevel="3"
SuppressStartupBanner="FALSE"
CompileAs="0"/>
@@ -129,9 +130,9 @@
Version="5.0"
LinkIncremental="1"
SuppressStartupBanner="TRUE"
- AdditionalLibraryDirectories="..\xsoundlib\Generic"
+ AdditionalLibraryDirectories="..\xsoundlib\Release"
GenerateMapFile="FALSE"
- MapFileName=".\Generic/mptrack.map"
+ MapFileName=".\Release/mptrack.map"
SubSystem="2"/>
<Tool
Name="VCMIDLTool"
@@ -161,222 +162,6 @@
<Tool
Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
</Configuration>
- <Configuration
- Name="P3|Win32"
- OutputDirectory="$(ConfigurationName)"
- IntermediateDirectory="$(ConfigurationName)"
- ConfigurationType="1"
- UseOfMFC="1"
- ATLMinimizesCRunTimeLibraryUsage="FALSE">
- <Tool
- Name="VCCLCompilerTool"
- AdditionalOptions="/EHsc"
- InlineFunctionExpansion="1"
- OptimizeForProcessor="2"
- OptimizeForWindowsApplication="TRUE"
- AdditionalIncludeDirectories="..\unlha,..\unzip,..\unrar,..\soundlib,..\include,..\xsoundlib"
- PreprocessorDefinitions="NDEBUG,WIN32,_WINDOWS,ENABLE_MMX,ENABLE_EQ,MODPLUG_TRACKER,NO_PACKING,HAVE_DOT_NET,ENABLE_AMD,ENABLE_SSE,ENABLE_AMDNOW"
- StringPooling="TRUE"
- RuntimeLibrary="0"
- BufferSecurityCheck="FALSE"
- EnableFunctionLevelLinking="FALSE"
- EnableEnhancedInstructionSet="1"
- UsePrecompiledHeader="3"
- PrecompiledHeaderThrough="stdafx.h"
- PrecompiledHeaderFile=".\P3/mptrack.pch"
- AssemblerListingLocation=".\P3/"
- ObjectFile=".\P3/"
- ProgramDataBaseFileName=".\P3/"
- WarningLevel="3"
- SuppressStartupBanner="TRUE"
- CompileAs="0"/>
- <Tool
- Name="VCCustomBuildTool"/>
- <Tool
- Name="VCLinkerTool"
- AdditionalOptions="/MACHINE:I386"
- AdditionalDependencies="winmm.lib strmiids.lib dmoguids.lib xsoundlib.lib version.lib opengl32.lib glu32.lib Rpcrt4.lib winhttp.lib"
- OutputFile=".\Bin/mptrack_P3.exe"
- Version="5.0"
- LinkIncremental="1"
- SuppressStartupBanner="TRUE"
- AdditionalLibraryDirectories="..\xsoundlib\P3"
- GenerateMapFile="FALSE"
- MapFileName=".\P3/mptrack.map"
- SubSystem="2"/>
- <Tool
- Name="VCMIDLTool"
- PreprocessorDefinitions="NDEBUG"
- MkTypLibCompatible="TRUE"
- SuppressStartupBanner="TRUE"
- TargetEnvironment="1"
- TypeLibraryName=".\Bin/mptrack.tlb"/>
- <Tool
- Name="VCPostBuildEventTool"
- CommandLine="perl $(TargetDir)/getVersionFromCode.pl > $(TargetDir)/version"/>
- <Tool
- Name="VCPreBuildEventTool"/>
- <Tool
- Name="VCPreLinkEventTool"/>
- <Tool
- Name="VCResourceCompilerTool"
- PreprocessorDefinitions="NDEBUG"
- Culture="1033"/>
- <Tool
- Name="VCWebServiceProxyGeneratorTool"/>
- <Tool
- Name="VCXMLDataGeneratorTool"/>
- <Tool
- Name="VCWebDeploymentTool"/>
- <Tool
- Name="VCManagedWrapperGeneratorTool"/>
- <Tool
- Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
- </Configuration>
- <Configuration
- Name="Athlon32|Win32"
- OutputDirectory="$(ConfigurationName)"
- IntermediateDirectory="$(ConfigurationName)"
- ConfigurationType="1"
- UseOfMFC="1"
- ATLMinimizesCRunTimeLibraryUsage="FALSE">
- <Tool
- Name="VCCLCompilerTool"
- AdditionalOptions="/EHsc"
- InlineFunctionExpansion="1"
- OptimizeForProcessor="3"
- OptimizeForWindowsApplication="TRUE"
- AdditionalIncludeDirectories="..\unlha,..\unzip,..\unrar,..\soundlib,..\include,..\xsoundlib"
- PreprocessorDefinitions="NDEBUG,WIN32,_WINDOWS,ENABLE_MMX,ENABLE_EQ,MODPLUG_TRACKER,NO_PACKING,HAVE_DOT_NET,ENABLE_AMD,ENABLE_SSE,ENABLE_AMDNOW"
- StringPooling="TRUE"
- RuntimeLibrary="0"
- BufferSecurityCheck="FALSE"
- EnableFunctionLevelLinking="FALSE"
- EnableEnhancedInstructionSet="1"
- UsePrecompiledHeader="3"
- PrecompiledHeaderThrough="stdafx.h"
- PrecompiledHeaderFile=".\Athlon32/mptrack.pch"
- AssemblerListingLocation=".\Athlon32/"
- ObjectFile=".\Athlon32/"
- ProgramDataBaseFileName=".\Athlon32/"
- WarningLevel="3"
- SuppressStartupBanner="TRUE"
- CompileAs="0"/>
- <Tool
- Name="VCCustomBuildTool"/>
- <Tool
- Name="VCLinkerTool"
- AdditionalOptions="/MACHINE:I386"
- AdditionalDependencies="winmm.lib strmiids.lib dmoguids.lib xsoundlib.lib version.lib opengl32.lib glu32.lib Rpcrt4.lib winhttp.lib"
- OutputFile=".\Bin/mptrack_athlon32.exe"
- Version="5.0"
- LinkIncremental="1"
- SuppressStartupBanner="TRUE"
- AdditionalLibraryDirectories="..\xsoundlib\Athlon32"
- GenerateMapFile="FALSE"
- MapFileName=".\Athlon32/mptrack.map"
- SubSystem="2"/>
- <Tool
- Name="VCMIDLTool"
- PreprocessorDefinitions="NDEBUG"
- MkTypLibCompatible="TRUE"
- SuppressStartupBanner="TRUE"
- TargetEnvironment="1"
- TypeLibraryName=".\Bin/mptrack.tlb"/>
- <Tool
- Name="VCPostBuildEventTool"
- CommandLine="perl $(TargetDir)/getVersionFromCode.pl > $(TargetDir)/version"/>
- <Tool
- Name="VCPreBuildEventTool"/>
- <Tool
- Name="VCPreLinkEventTool"/>
- <Tool
- Name="VCResourceCompilerTool"
- PreprocessorDefinitions="NDEBUG"
- Culture="1033"/>
- <Tool
- Name="VCWebServiceProxyGeneratorTool"/>
- <Tool
- Name="VCXMLDataGeneratorTool"/>
- <Tool
- Name="VCWebDeploymentTool"/>
- <Tool
- Name="VCManagedWrapperGeneratorTool"/>
- <Tool
- Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
- </Configuration>
- <Configuration
- Name="P4-Athlon64|Win32"
- OutputDirectory="$(ConfigurationName)"
- IntermediateDirectory="$(ConfigurationName)"
- ConfigurationType="1"
- UseOfMFC="1"
- ATLMinimizesCRunTimeLibraryUsage="FALSE">
- <Tool
- Name="VCCLCompilerTool"
- AdditionalOptions="/EHsc"
- InlineFunctionExpansion="2"
- OptimizeForProcessor="3"
- OptimizeForWindowsApplication="TRUE"
- AdditionalIncludeDirectories="..\unlha,..\unzip,..\unrar,..\soundlib,..\include,..\xsoundlib"
- PreprocessorDefinitions="NDEBUG,WIN32,_WINDOWS,ENABLE_MMX,ENABLE_EQ,MODPLUG_TRACKER,NO_PACKING,HAVE_DOT_NET,ENABLE_AMD,ENABLE_SSE,ENABLE_AMDNOW"
- StringPooling="TRUE"
- RuntimeLibrary="0"
- BufferSecurityCheck="FALSE"
- EnableFunctionLevelLinking="FALSE"
- EnableEnhancedInstructionSet="2"
- UsePrecompiledHeader="3"
- PrecompiledHeaderThrough="stdafx.h"
- PrecompiledHeaderFile=".\P4-Athlon64/mptrack.pch"
- AssemblerListingLocation=".\P4-Athlon64/"
- ObjectFile=".\P4-Athlon64/"
- ProgramDataBaseFileName=".\P4-Athlon64/"
- WarningLevel="3"
- SuppressStartupBanner="TRUE"
- CompileAs="0"/>
- <Tool
- Name="VCCustomBuildTool"/>
- <Tool
- Name="VCLinkerTool"
- AdditionalOptions="/MACHINE:I386"
- AdditionalDependencies="winmm.lib strmiids.lib dmoguids.lib xsoundlib.lib version.lib opengl32.lib glu32.lib Rpcrt4.lib winhttp.lib"
- OutputFile=".\Bin/mptrack_P4-Athlon64.exe"
- Version="5.0"
- LinkIncremental="1"
- SuppressStartupBanner="TRUE"
- AdditionalLibraryDirectories="..\xsoundlib\P4-Athlon64"
- GenerateMapFile="FALSE"
- MapFileName=".\P4-Athlon64/mptrack.map"
- SubSystem="2"/>
- <Tool
- Name="VCMIDLTool"
- PreprocessorDefinitions="NDEBUG"
- MkTypLibCompatible="TRUE"
- SuppressStartupBanner="TRUE"
- TargetEnvironment="1"
- TypeLibraryName=".\Bin/mptrack.tlb"/>
- <Tool
- Name="VCPostBuildEventTool"
- CommandLine="perl $(TargetDir)/getVersionFromCode.pl > $(TargetDir)/version"/>
- <Tool
- Name="VCPreBuildEventTool"/>
- <Tool
- Name="VCPreLinkEventTool"/>
- <Tool
- Name="VCResourceCompilerTool"
- PreprocessorDefinitions="NDEBUG"
- Culture="1033"/>
- <Tool
- Name="VCWebServiceProxyGeneratorTool"/>
- <Tool
- Name="VCXMLDataGeneratorTool"/>
- <Tool
- Name="VCWebDeploymentTool"/>
- <Tool
- Name="VCManagedWrapperGeneratorTool"/>
- <Tool
- Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
- </Configuration>
</Configurations>
<References>
</References>
@@ -636,29 +421,11 @@
<File
RelativePath="..\Soundlib\Snd_rvb.cpp">
<FileConfiguration
- Name="Generic|Win32">
+ Name="Release|Win32">
<Tool
Name="VCCLCompilerTool"
AssemblerOutput="4"/>
</FileConfiguration>
- <FileConfiguration
- Name="P3|Win32">
- <Tool
- Name="VCCLCompilerTool"
- AssemblerOutput="4"/>
- </FileConfiguration>
- <FileConfiguration
- Name="Athlon32|Win32">
- <Tool
- Name="VCCLCompilerTool"
- AssemblerOutput="4"/>
- </FileConfiguration>
- <FileConfiguration
- Name="P4-Athlon64|Win32">
- <Tool
- Name="VCCLCompilerTool"
- AssemblerOutput="4"/>
- </FileConfiguration>
</File>
<File
RelativePath="..\Soundlib\snddev.cpp">
@@ -681,29 +448,11 @@
UsePrecompiledHeader="1"/>
</FileConfiguration>
<FileConfiguration
- Name="Generic|Win32">
+ Name="Release|Win32">
<Tool
Name="VCCLCompilerTool"
UsePrecompiledHeader="1"/>
</FileConfiguration>
- <FileConfiguration
- Name="P3|Win32">
- <Tool
- Name="VCCLCompilerTool"
- UsePrecompiledHeader="1"/>
- </FileConfiguration>
- <FileConfiguration
- Name="Athlon32|Win32">
- <Tool
- Name="VCCLCompilerTool"
- UsePrecompiledHeader="1"/>
- </FileConfiguration>
- <FileConfiguration
- Name="P4-Athlon64|Win32">
- <Tool
- Name="VCCLCompilerTool"
- UsePrecompiledHeader="1"/>
- </FileConfiguration>
</File>
<File
RelativePath="..\soundlib\Tables.cpp">
Modified: trunk/OpenMPT/unlha/unlha.vcproj
===================================================================
--- trunk/OpenMPT/unlha/unlha.vcproj 2008-07-06 12:24:33 UTC (rev 214)
+++ trunk/OpenMPT/unlha/unlha.vcproj 2008-07-11 16:17:21 UTC (rev 215)
@@ -62,7 +62,7 @@
Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
</Configuration>
<Configuration
- Name="Generic|Win32"
+ Name="Release|Win32"
OutputDirectory="$(ConfigurationName)"
IntermediateDirectory="$(ConfigurationName)"
ConfigurationType="4"
@@ -112,153 +112,6 @@
<Tool
Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
</Configuration>
- <Configuration
- Name="P3|Win32"
- OutputDirectory="$(ConfigurationName)"
- IntermediateDirectory="$(ConfigurationName)"
- ConfigurationType="4"
- UseOfMFC="0"
- ATLMinimizesCRunTimeLibraryUsage="FALSE"
- CharacterSet="2">
- <Tool
- Name="VCCLCompilerTool"
- Optimization="1"
- InlineFunctionExpansion="1"
- PreprocessorDefinitions="WIN32;NDEBUG;_LIB"
- StringPooling="TRUE"
- RuntimeLibrary="0"
- EnableFunctionLevelLinking="TRUE"
- PrecompiledHeaderFile=".\Release/unlha.pch"
- AssemblerListingLocation=".\Release/"
- ObjectFile=".\Release/"
- ProgramDataBaseFileName=".\Release/"
- WarningLevel="3"
- SuppressStartupBanner="TRUE"/>
- <Tool
- Name="VCCustomBuildTool"/>
- <Tool
- Name="VCLibrarianTool"
- OutputFile=".\bin\unlha.lib"
- SuppressStartupBanner="TRUE"/>
- <Tool
- Name="VCMIDLTool"/>
- <Tool
- Name="VCPostBuildEventTool"/>
- <Tool
- Name="VCPreBuildEventTool"/>
- <Tool
- Name="VCPreLinkEventTool"/>
- <Tool
- Name="VCResourceCompilerTool"
- PreprocessorDefinitions="NDEBUG"
- Culture="1033"/>
- <Tool
- Name="VCWebServiceProxyGeneratorTool"/>
- <Tool
- Name="VCXMLDataGeneratorTool"/>
- <Tool
- Name="VCManagedWrapperGeneratorTool"/>
- <Tool
- Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
- </Configuration>
- <Configuration
- Name="Athlon32|Win32"
- OutputDirectory="$(ConfigurationName)"
- IntermediateDirectory="$(ConfigurationName)"
- ConfigurationType="4"
- UseOfMFC="0"
- ATLMinimizesCRunTimeLibraryUsage="FALSE"
- CharacterSet="2">
- <Tool
- Name="VCCLCompilerTool"
- Optimization="1"
- InlineFunctionExpansion="1"
- PreprocessorDefinitions="WIN32;NDEBUG;_LIB"
- StringPooling="TRUE"
- RuntimeLibrary="0"
- EnableFunctionLevelLinking="TRUE"
- PrecompiledHeaderFile=".\Release/unlha.pch"
- AssemblerListingLocation=".\Release/"
- ObjectFile=".\Release/"
- ProgramDataBaseFileName=".\Release/"
- WarningLevel="3"
- SuppressStartupBanner="TRUE"/>
- <Tool
- Name="VCCustomBuildTool"/>
- <Tool
- Name="VCLibrarianTool"
- OutputFile=".\bin\unlha.lib"
- SuppressStartupBanner="TRUE"/>
- <Tool
- Name="VCMIDLTool"/>
- <Tool
- Name="VCPostBuildEventTool"/>
- <Tool
- Name="VCPreBuildEventTool"/>
- <Tool
- Name="VCPreLinkEventTool"/>
- <Tool
- Name="VCResourceCompilerTool"
- PreprocessorDefinitions="NDEBUG"
- Culture="1033"/>
- <Tool
- Name="VCWebServiceProxyGeneratorTool"/>
- <Tool
- Name="VCXMLDataGeneratorTool"/>
- <Tool
- Name="VCManagedWrapperGeneratorTool"/>
- <Tool
- Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
- </Configuration>
- <Configuration
- Name="P4-Athlon64|Win32"
- OutputDirectory="$(ConfigurationName)"
- IntermediateDirectory="$(ConfigurationName)"
- ConfigurationType="4"
- UseOfMFC="0"
- ATLMinimizesCRunTimeLibraryUsage="FALSE"
- CharacterSet="2">
- <Tool
- Name="VCCLCompilerTool"
- Optimization="1"
- InlineFunctionExpansion="1"
- PreprocessorDefinitions="WIN32;NDEBUG;_LIB"
- StringPooling="TRUE"
- RuntimeLibrary="0"
- EnableFunctionLevelLinking="TRUE"
- PrecompiledHeaderFile=".\Release/unlha.pch"
- AssemblerListingLocation=".\Release/"
- ObjectFile=".\Release/"
- ProgramDataBaseFileName=".\Release/"
- WarningLevel="3"
- SuppressStartupBanner="TRUE"/>
- <Tool
- Name="VCCustomBuildTool"/>
- <Tool
- Name="VCLibrarianTool"
- OutputFile=".\bin\unlha.lib"
- SuppressStartupBanner="TRUE"/>
- <Tool
- Name="VCMIDLTool"/>
- <Tool
- Name="VCPostBuildEventTool"/>
- <Tool
- Name="VCPreBuildEventTool"/>
- <Tool
- Name="VCPreLinkEventTool"/>
- <Tool
- Name="VCResourceCompilerTool"
- PreprocessorDefinitions="NDEBUG"
- Culture="1033"/>
- <Tool
- Name="VCWebServiceProxyGeneratorTool"/>
- <Tool
- Name="VCXMLDataGeneratorTool"/>
- <Tool
- Name="VCManagedWrapperGeneratorTool"/>
- <Tool
- Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
- </Configuration>
</Configurations>
<References>
</References>
@@ -277,33 +130,12 @@
BasicRuntimeChecks="3"/>
</FileConfiguration>
<FileConfiguration
- Name="Generic|Win32">
+ Name="Release|Win32">
<Tool
Name="VCCLCompilerTool"
Optimization="1"
PreprocessorDefinitions=""/>
</FileConfiguration>
- <FileConfiguration
- Name="P3|Win32">
- <Tool
- Name="VCCLCompilerTool"
- Optimization="1"
- PreprocessorDefinitions=""/>
- </FileConfiguration>
- <FileConfiguration
- Name="Athlon32|Win32">
- <Tool
- Name="VCCLCompilerTool"
- Optimization="1"
- PreprocessorDefinitions=""/>
- </FileConfiguration>
- <FileConfiguration
- Name="P4-Athlon64|Win32">
- <Tool
- Name="VCCLCompilerTool"
- Optimization="1"
- PreprocessorDefinitions=""/>
- </FileConfiguration>
</File>
</Filter>
<Filter
Modified: trunk/OpenMPT/unrar/UNRAR.vcproj
===================================================================
--- trunk/OpenMPT/unrar/UNRAR.vcproj 2008-07-06 12:24:33 UTC (rev 214)
+++ trunk/OpenMPT/unrar/UNRAR.vcproj 2008-07-11 16:17:21 UTC (rev 215)
@@ -59,7 +59,7 @@
Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
</Configuration>
<Configuration
- Name="Generic|Win32"
+ Name="Release|Win32"
OutputDirectory="$(ConfigurationName)"
IntermediateDirectory="$(ConfigurationName)"
ConfigurationType="4"
@@ -107,147 +107,6 @@
<Tool
Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
</Configuration>
- <Configuration
- Name="P3|Win32"
- OutputDirectory="$(ConfigurationName)"
- IntermediateDirectory="$(ConfigurationName)"
- ConfigurationType="4"
- UseOfMFC="0"
- ATLMinimizesCRunTimeLibraryUsage="FALSE">
- <Tool
- Name="VCCLCompilerTool"
- Optimization="1"
- InlineFunctionExpansion="1"
- PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS"
- StringPooling="TRUE"
- RuntimeLibrary="0"
- EnableFunctionLevelLinking="TRUE"
- PrecompiledHeaderFile=".\Release/UNRAR.pch"
- AssemblerListingLocation=".\Release/"
- ObjectFile=".\Release/"
- ProgramDataBaseFileName=".\Release/"
- WarningLevel="3"
- SuppressStartupBanner="TRUE"/>
- <Tool
- Name="VCCustomBuildTool"/>
- <Tool
- Name="VCLibrarianTool"
- OutputFile=".\bin\UNRAR.lib"
- SuppressStartupBanner="TRUE"/>
- <Tool
- Name="VCMIDLTool"/>
- <Tool
- Name="VCPostBuildEventTool"/>
- <Tool
- Name="VCPreBuildEventTool"/>
- <Tool
- Name="VCPreLinkEventTool"/>
- <Tool
- Name="VCResourceCompilerTool"
- Culture="1033"/>
- <Tool
- Name="VCWebServiceProxyGeneratorTool"/>
- <Tool
- Name="VCXMLDataGeneratorTool"/>
- <Tool
- Name="VCManagedWrapperGeneratorTool"/>
- <Tool
- Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
- </Configuration>
- <Configuration
- Name="Athlon32|Win32"
- OutputDirectory="$(ConfigurationName)"
- IntermediateDirectory="$(ConfigurationName)"
- ConfigurationType="4"
- UseOfMFC="0"
- ATLMinimizesCRunTimeLibraryUsage="FALSE">
- <Tool
- Name="VCCLCompilerTool"
- Optimization="1"
- InlineFunctionExpansion="1"
- PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS"
- StringPooling="TRUE"
- RuntimeLibrary="0"
- EnableFunctionLevelLinking="TRUE"
- PrecompiledHeaderFile=".\Release/UNRAR.pch"
- AssemblerListingLocation=".\Release/"
- ObjectFile=".\Release/"
- ProgramDataBaseFileName=".\Release/"
- WarningLevel="3"
- SuppressStartupBanner="TRUE"/>
- <Tool
- Name="VCCustomBuildTool"/>
- <Tool
- Name="VCLibrarianTool"
- OutputFile=".\bin\UNRAR.lib"
- SuppressStartupBanner="TRUE"/>
- <Tool
- Name="VCMIDLTool"/>
- <Tool
- Name="VCPostBuildEventTool"/>
- <Tool
- Name="VCPreBuildEventTool"/>
- <Tool
- Name="VCPreLinkEventTool"/>
- <Tool
- Name="VCResourceCompilerTool"
- Culture="1033"/>
- <Tool
- Name="VCWebServiceProxyGeneratorTool"/>
- <Tool
- Name="VCXMLDataGeneratorTool"/>
- <Tool
- Name="VCManagedWrapperGeneratorTool"/>
- <Tool
- Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
- </Configuration>
- <Configuration
- Name="P4-Athlon64|Win32"
- OutputDirectory="$(ConfigurationName)"
- IntermediateDirectory="$(ConfigurationName)"
- ConfigurationType="4"
- UseOfMFC="0"
- ATLMinimizesCRunTimeLibraryUsage="FALSE">
- <Tool
- Name="VCCLCompilerTool"
- Optimization="1"
- InlineFunctionExpansion="1"
- PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS"
- StringPooling="TRUE"
- RuntimeLibrary="0"
- EnableFunctionLevelLinking="TRUE"
- PrecompiledHeaderFile=".\Release/UNRAR.pch"
- AssemblerListingLocation=".\Release/"
- ObjectFile=".\Release/"
- ProgramDataBaseFileName=".\Release/"
- WarningLevel="3"
- SuppressStartupBanner="TRUE"/>
- <Tool
- Name="VCCustomBuildTool"/>
- <Tool
- Name="VCLibrarianTool"
- OutputFile=".\bin\UNRAR.lib"
- SuppressStartupBanner="TRUE"/>
- <Tool
- Name="VCMIDLTool"/>
- <Tool
- Name="VCPostBuildEventTool"/>
- <Tool
- Name="VCPreBuildEventTool"/>
- <Tool
- Name="VCPreLinkEventTool"/>
- <Tool
- Name="VCResourceCompilerTool"
- Culture="1033"/>
- <Tool
- Name="VCWebServiceProxyGeneratorTool"/>
- <Tool
- Name="VCXMLDataGeneratorTool"/>
- <Tool
- Name="VCManagedWrapperGeneratorTool"/>
- <Tool
- Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
- </Configuration>
</Configurations>
<References>
</References>
@@ -262,33 +121,12 @@
PreprocessorDefinitions=""/>
</FileConfiguration>
<FileConfiguration
- Name="Generic|Win32">
+ Name="Release|Win32">
<Tool
Name="VCCLCompilerTool"
Optimization="1"
PreprocessorDefinitions=""/>
</FileConfiguration>
- <FileConfiguration
- Name="P3|Win32">
- <Tool
- Name="VCCLCompilerTool"
- Optimization="1"
- PreprocessorDefinitions=""/>
- </FileConfiguration>
- <FileConfiguration
- Name="Athlon32|Win32">
- <Tool
- Name="VCCLCompilerTool"
- Optimization="1"
- PreprocessorDefinitions=""/>
- </FileConfiguration>
- <FileConfiguration
- Name="P4-Athlon64|Win32">
- <Tool
- Name="VCCLCompilerTool"
- Optimization="1"
- PreprocessorDefinitions=""/>
- </FileConfiguration>
</File>
</Files>
<Globals>
Modified: trunk/OpenMPT/unzip/unzip.vcproj
===================================================================
--- trunk/OpenMPT/unzip/unzip.vcproj 2008-07-06 12:24:33 UTC (rev 214)
+++ trunk/OpenMPT/unzip/unzip.vcproj 2008-07-11 16:17:21 UTC (rev 215)
@@ -59,7 +59,7 @@
Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
</Configuration>
<Configuration
- Name="Generic|Win32"
+ Name="Release|Win32"
OutputDirectory="$(ConfigurationName)"
IntermediateDirectory="$(ConfigurationName)"
ConfigurationType="4"
@@ -107,147 +107,6 @@
<Tool
Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
</Configuration>
- <Configuration
- Name="P3|Win32"
- OutputDirectory="$(ConfigurationName)"
- IntermediateDirectory="$(ConfigurationName)"
- ConfigurationType="4"
- UseOfMFC="0"
- ATLMinimizesCRunTimeLibraryUsage="FALSE">
- <Tool
- Name="VCCLCompilerTool"
- Optimization="1"
- InlineFunctionExpansion="1"
- PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS"
- StringPooling="TRUE"
- RuntimeLibrary="0"
- EnableFunctionLevelLinking="TRUE"
- PrecompiledHeaderFile=".\Release/unzip.pch"
- AssemblerListingLocation=".\Release/"
- ObjectFile=".\Release/"
- ProgramDataBaseFileName=".\Release/"
- WarningLevel="3"
- SuppressStartupBanner="TRUE"/>
- <Tool
- Name="VCCustomBuildTool"/>
- <Tool
- Name="VCLibrarianTool"
- OutputFile=".\bin\unzip.lib"
- SuppressStartupBanner="TRUE"/>
- <Tool
- Name="VCMIDLTool"/>
- <Tool
- Name="VCPostBuildEventTool"/>
- <Tool
- Name="VCPreBuildEventTool"/>
- <Tool
- Name="VCPreLinkEventTool"/>
- <Tool
- Name="VCResourceCompilerTool"
- Culture="1033"/>
- <Tool
- Name="VCWebServiceProxyGeneratorTool"/>
- <Tool
- Name="VCXMLDataGeneratorTool"/>
- <Tool
- Name="VCManagedWrapperGeneratorTool"/>
- <Tool
- Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
- </Configuration>
- <Configuration
- Name="Athlon32|Win32"
- OutputDirectory="$(ConfigurationName)"
- IntermediateDirectory="$(ConfigurationName)"
- ConfigurationType="4"
- UseOfMFC="0"
- ATLMinimizesCRunTimeLibraryUsage="FALSE">
- <Tool
- Name="VCCLCompilerTool"
- Optimization="1"
- InlineFunctionExpansion="1"
- PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS"
- StringPooling="TRUE"
- RuntimeLibrary="0"
- EnableFunctionLevelLinking="TRUE"
- PrecompiledHeaderFile=".\Release/unzip.pch"
- AssemblerListingLocation=".\Release/"
- ObjectFile=".\Release/"
- ProgramDataBaseFileName=".\Release/"
- WarningLevel="3"
- SuppressStartupBanner="TRUE"/>
- <Tool
- Name="VCCustomBuildTool"/>
- <Tool
- Name="VCLibrarianTool"
- OutputFile=".\bin\unzip.lib"
- SuppressStartupBanner="TRUE"/>
- <Tool
- Name="VCMIDLTool"/>
- <Tool
- Name="VCPostBuildEventTool"/>
- <Tool
- Name="VCPreBuildEventTool"/>
- <Tool
- Name="VCPreLinkEventTool"/>
- <Tool
- Name="VCResourceCompilerTool"
- Culture="1033"/>
- <Tool
- Name="VCWebServiceProxyGeneratorTool"/>
- <Tool
- Name="VCXMLDataGeneratorTool"/>
- <Tool
- Name="VCManagedWrapperGeneratorTool"/>
- <Tool
- Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
- </Configuration>
- <Configuration
- Name="P4-Athlon64|Win32"
- OutputDirectory="$(ConfigurationName)"
- IntermediateDirectory="$(ConfigurationName)"
- ConfigurationType="4"
- UseOfMFC="0"
- ATLMinimizesCRunTimeLibraryUsage="FALSE">
- <Tool
- Name="VCCLCompilerTool"
- Optimization="1"
- InlineFunctionExpansion="1"
- PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS"
- StringPooling="TRUE"
- RuntimeLibrary="0"
- EnableFunctionLevelLinking="TRUE"
- PrecompiledHeaderFile=".\Release/unzip.pch"
- AssemblerListingLocation=".\Release/"
- ObjectFile=".\Release/"
- ProgramDataBaseFileName=".\Release/"
- WarningLevel="3"
- SuppressStartupBanner="TRUE"/>
- <Tool
- Name="VCCustomBuildTool"/>
- <Tool
- Name="VCLibrarianTool"
- OutputFile=".\bin\unzip.lib"
- SuppressStartupBanner="TRUE"/>
- <Tool
- Name="VCMIDLTool"/>
- <Tool
- Name="VCPostBuildEventTool"/>
- <Tool
- Name="VCPreBuildEventTool"/>
- <Tool
- Name="VCPreLinkEventTool"/>
- <Tool
- Name="VCResourceCompilerTool"
- Culture="1033"/>
- <Tool
- Name="VCWebServiceProxyGeneratorTool"/>
- <Tool
- Name="VCXMLDataGeneratorTool"/>
- <Tool
- Name="VCManagedWrapperGeneratorTool"/>
- <Tool
- Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
- </Configuration>
</Configurations>
<References>
</References>
@@ -265,33 +124,12 @@
PreprocessorDefinitions=""/>
</FileConfiguration>
<FileConfiguration
- Name="Generic|Win32">
+ Name="Release|Win32">
<Tool
Name="VCCLCompilerTool"
Optimization="1"
PreprocessorDefinitions=""/>
</FileConfiguration>
- <FileConfiguration
- Name="P3|Win32">
- <Tool
- Name="VCCLCompilerTool"
- Optimization="1"
- PreprocessorDefinitions=""/>
- </FileConfiguration>
- <FileConfiguration
- Name="Athlon32|Win32">
- <Tool
- Name="VCCLCompilerTool"
- Optimization="1"
- PreprocessorDefinitions=""/>
- </FileConfiguration>
- <FileConfiguration
- Name="P4-Athlon64|Win32">
- <Tool
- Name="VCCLCompilerTool"
- Optimization="1"
- PreprocessorDefinitions=""/>
- </FileConfiguration>
</File>
</Filter>
<Filter
Modified: trunk/OpenMPT/xsoundlib/xsoundlib.vcproj
===================================================================
--- trunk/OpenMPT/xsoundlib/xsoundlib.vcproj 2008-07-06 12:24:33 UTC (rev 214)
+++ trunk/OpenMPT/xsoundlib/xsoundlib.vcproj 2008-07-11 16:17:21 UTC (rev 215)
@@ -53,7 +53,7 @@
Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
</Configuration>
<Configuration
- Name="Generic|Win32"
+ Name="Release|Win32"
OutputDirectory="$(ConfigurationName)"
IntermediateDirectory="$(ConfigurationName)"
ConfigurationType="4"
@@ -93,120 +93,6 @@
<Tool
Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
</Configuration>
- <Configuration
- Name="P3|Win32"
- OutputDirectory="$(ConfigurationName)"
- IntermediateDirectory="$(ConfigurationName)"
- ConfigurationType="4"
- CharacterSet="2">
- <Tool
- Name="VCCLCompilerTool"
- PreprocessorDefinitions="WIN32;NDEBUG;_LIB"
- RuntimeLibrary="4"
- UsePrecompiledHeader="3"
- WarningLevel="3"
- Detect64BitPortabilityProblems="TRUE"
- DebugInformationFormat="3"/>
- <Tool
- Name="VCCustomBuildTool"/>
- <Tool
- Name="VCLibrarianTool"
- OutputFile="$(OutDir)/xsoundlib.lib"/>
- <Tool
- Name="VCMIDLTool"/>
- <Tool
- Name="VCPostBuildEventTool"/>
- <Tool
- Name="VCPreBuildEventTool"/>
- <Tool
- Name="VCPreLinkEventTool"/>
- <Tool
- Name="VCResourceCompilerTool"/>
- <Tool
- Name="VCWebServiceProxyGeneratorTool"/>
- <Tool
- Name="VCXMLDataGeneratorTool"/>
- <Tool
- Name="VCManagedWrapperGeneratorTool"/>
- <Tool
- Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
- </Configuration>
- <Configuration
- Name="Athlon32|Win32"
- OutputDirectory="$(ConfigurationName)"
- IntermediateDirectory="$(ConfigurationName)"
- ConfigurationType="4"
- CharacterSet="2">
- <Tool
- Name="VCCLCompilerTool"
- PreprocessorDefinitions="WIN32;NDEBUG;_LIB"
- RuntimeLibrary="4"
- UsePrecompiledHeader="3"
- WarningLevel="3"
- Detect64BitPortabilityProblems="TRUE"
- DebugInformationFormat="3"/>
- <Tool
- Name="VCCustomBuildTool"/>
- <Tool
- Name="VCLibrarianTool"
- OutputFile="$(OutDir)/xsoundlib.lib"/>
- <Tool
- Name="VCMIDLTool"/>
- <Tool
- Name="VCPostBuildEventTool"/>
- <Tool
- Name="VCPreBuildEventTool"/>
- <Tool
- Name="VCPreLinkEventTool"/>
- <Tool
- Name="VCResourceCompilerTool"/>
- <Tool
- Name="VCWebServiceProxyGeneratorTool"/>
- <Tool
- Name="VCXMLDataGeneratorTool"/>
- <Tool
- Name="VCManagedWrapperGeneratorTool"/>
- <Tool
- Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
- </Configuration>
- <Configuration
- Name="P4-Athlon64|Win32"
- OutputDirectory="$(ConfigurationName)"
- IntermediateDirectory="$(ConfigurationName)"
- ConfigurationType="4"
- CharacterSet="2">
- <Tool
- Name="VCCLCompilerTool"
- PreprocessorDefinitions="WIN32;NDEBUG;_LIB"
- RuntimeLibrary="4"
- UsePrecompiledHeader="3"
- WarningLevel="3"
- Detect64BitPortabilityProblems="TRUE"
- DebugInformationFormat="3"/>
- <Tool
- Name="VCCustomBuildTool"/>
- <Tool
- Name="VCLibrarianTool"
- OutputFile="$(OutDir)/xsoundlib.lib"/>
- <Tool
- Name="VCMIDLTool"/>
- <Tool
- Name="VCPostBuildEventTool"/>
- <Tool
- Name="VCPreBuildEventTool"/>
- <Tool
- Name="VCPreLinkEventTool"/>
- <Tool
- Name="VCResourceCompilerTool"/>
- <Tool
- Name="VCWebServiceProxyGeneratorTool"/>
- <Tool
- Name="VCXMLDataGeneratorTool"/>
- <Tool
- Name="VCManagedWrapperGeneratorTool"/>
- <Tool
- Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
- </Configuration>
</Configurations>
<References>
</References>
@@ -221,29 +107,11 @@
<File
RelativePath=".\smbPitchShift.cpp">
<FileConfiguration
- Name="Generic|Win32">
+ Name="Release|Win32">
<Tool
Name="VCCLCompilerTool"
UsePrecompiledHeader="3"/>
</FileConfiguration>
- <FileConfiguration
- Name="P3|Win32">
- <Tool
- Name="VCCLCompilerTool"
- UsePrecompiledHeader="3"/>
- </FileConfiguration>
- <FileConfiguration
- Name="Athlon32|Win32">
- <Tool
- Name="VCCLCompilerTool"
- UsePrecompiledHeader="3"/>
- </FileConfiguration>
- <FileConfiguration
- Name="P4-Athlon64|Win32">
- <Tool
- Name="VCCLCompilerTool"
- UsePrecompiledHeader="3"/>
- </FileConfiguration>
</File>
<File
RelativePath=".\src_linear.cpp">
@@ -263,29 +131,11 @@
UsePrecompiledHeader="1"/>
</FileConfiguration>
<FileConfiguration
- Name="Generic|Win32">
+ Name="Release|Win32">
<Tool
Name="VCCLCompilerTool"
UsePrecompiledHeader="1"/>
</FileConfiguration>
- <FileConfiguration
- Name="P3|Win32">
- <Tool
- Name="VCCLCompilerTool"
- UsePrecompiledHeader="1"/>
- </FileConfiguration>
- <FileConfiguration
- Name="Athlon32|Win32">
- <Tool
- Name="VCCLCompilerTool"
- UsePrecompiledHeader="1"/>
- </FileConfiguration>
- <FileConfiguration
- Name="P4-Athlon64|Win32">
- <Tool
- Name="VCCLCompilerTool"
- UsePrecompiledHeader="1"/>
- </FileConfiguration>
</File>
</Filter>
<Filter
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <rel...@us...> - 2008-07-06 12:24:37
|
Revision: 214
http://modplug.svn.sourceforge.net/modplug/?rev=214&view=rev
Author: relabsoluness
Date: 2008-07-06 05:24:33 -0700 (Sun, 06 Jul 2008)
Log Message:
-----------
[Fix] Autosave should now behave properly even when it gets called while previous autosave is in progress.
[Fix/Mod] Changes/fixes to pattern data writing when dealing with lots of pattern data for S3M, XM, IT and MPTM. It was possible that not all pattern data was written but the user wasn't informed about this. Modified so that write buffers are made larger if needed, and note is shown if some pattern data is not written due to file format limits.
Modified Paths:
--------------
trunk/OpenMPT/mptrack/AutoSaver.cpp
trunk/OpenMPT/mptrack/AutoSaver.h
trunk/OpenMPT/soundlib/Load_it.cpp
trunk/OpenMPT/soundlib/Load_s3m.cpp
trunk/OpenMPT/soundlib/Load_xm.cpp
Modified: trunk/OpenMPT/mptrack/AutoSaver.cpp
===================================================================
--- trunk/OpenMPT/mptrack/AutoSaver.cpp 2008-07-05 12:59:07 UTC (rev 213)
+++ trunk/OpenMPT/mptrack/AutoSaver.cpp 2008-07-06 12:24:33 UTC (rev 214)
@@ -21,12 +21,13 @@
// Construction/Destruction
///////////////////////////
-CAutoSaver::CAutoSaver()
+CAutoSaver::CAutoSaver() : m_bSaveInProgress(false)
{
}
CAutoSaver::CAutoSaver(bool enabled, int saveInterval, int backupHistory,
- bool useOriginalPath, CString path, CString fileNameTemplate)
+ bool useOriginalPath, CString path, CString fileNameTemplate) :
+ m_bSaveInProgress(false)
{
m_nLastSave = timeGetTime();
m_bEnabled = enabled;
@@ -49,13 +50,18 @@
{
bool success = true;
- if (CheckTimer(curTime)) { //if time to save
-
+ //If time to save and not already having save in progress.
+ if (CheckTimer(curTime) && !m_bSaveInProgress) {
+ m_bSaveInProgress = true;
CDocTemplate *pDocTemplate;
CModDoc *pModDoc;
POSITION posTemplate,posDocument;
CTrackApp *pTrackApp=(CTrackApp*)::AfxGetApp();
- if (!pTrackApp) return false;
+ if (!pTrackApp)
+ {
+ m_bSaveInProgress = false;
+ return false;
+ }
pTrackApp->BeginWaitCursor(); //display hour glass
@@ -80,6 +86,7 @@
} //end pointless template loop (we have just 1 template)
m_nLastSave = timeGetTime();
pTrackApp->EndWaitCursor(); //end display hour glass
+ m_bSaveInProgress = false;
}
return success;
Modified: trunk/OpenMPT/mptrack/AutoSaver.h
===================================================================
--- trunk/OpenMPT/mptrack/AutoSaver.h 2008-07-05 12:59:07 UTC (rev 213)
+++ trunk/OpenMPT/mptrack/AutoSaver.h 2008-07-06 12:24:33 UTC (rev 214)
@@ -39,6 +39,10 @@
//internal implementation members
private:
+
+ //Flag to prevent autosave from starting new saving if previous is still in progress.
+ bool m_bSaveInProgress;
+
bool m_bEnabled;
DWORD m_nLastSave;
DWORD m_nSaveInterval;
Modified: trunk/OpenMPT/soundlib/Load_it.cpp
===================================================================
--- trunk/OpenMPT/soundlib/Load_it.cpp 2008-07-05 12:59:07 UTC (rev 213)
+++ trunk/OpenMPT/soundlib/Load_it.cpp 2008-07-06 12:24:33 UTC (rev 214)
@@ -30,6 +30,10 @@
using std::istrstream;
using namespace srlztn; //SeRiaLiZaTioN
+#define str_MBtitle (GetStrI18N((_TEXT("Saving IT"))))
+#define str_tooMuchPatternData (GetStrI18N((_TEXT("Warning: File format limit was reached. Some pattern data may not get written to file."))))
+#define str_pattern (GetStrI18N((_TEXT("pattern"))))
+
static bool AreNonDefaultTuningsUsed(CSoundFile& sf)
//--------------------------------------------------
{
@@ -2322,9 +2326,18 @@
}
}
buf[len++] = 0;
- dwPos += len;
- patinfo[0] += len;
- fwrite(buf, 1, len, f);
+ if(patinfo[0] > uint16_max - len)
+ {
+ CString str; str.Format("%s (%s %u)", str_tooMuchPatternData, str_pattern, npat);
+ MessageBox(0, str, str_MBtitle, MB_ICONWARNING);
+ break;
+ }
+ else
+ {
+ dwPos += len;
+ patinfo[0] += len;
+ fwrite(buf, 1, len, f);
+ }
}
fseek(f, dwPatPos, SEEK_SET);
fwrite(patinfo, 8, 1, f);
Modified: trunk/OpenMPT/soundlib/Load_s3m.cpp
===================================================================
--- trunk/OpenMPT/soundlib/Load_s3m.cpp 2008-07-05 12:59:07 UTC (rev 213)
+++ trunk/OpenMPT/soundlib/Load_s3m.cpp 2008-07-06 12:24:33 UTC (rev 214)
@@ -10,7 +10,7 @@
#include "stdafx.h"
#include "sndfile.h"
-#pragma warning(disable:4244)
+#pragma warning(disable:4244) //conversion from 'type1' to 'type2', possible loss of data
extern WORD S3MFineTuneTable[16];
@@ -400,9 +400,9 @@
#ifndef MODPLUG_NO_FILESAVE
-#pragma warning(disable:4100)
+#pragma warning(disable:4100) //unreferenced formal parameter
-static BYTE S3MFiller[16] =
+static const BYTE S3MFiller[16] =
{
0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80,
0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80
@@ -417,7 +417,6 @@
UINT nbo,nbi,nbp,i;
WORD patptr[128];
WORD insptr[128];
- BYTE buffer[5*1024];
S3MSAMPLESTRUCT insex[128];
if ((!m_nChannels) || (!lpszFileName)) return FALSE;
@@ -498,7 +497,7 @@
for (i=0; i<nbp; i++)
{
WORD len = 64;
- memset(buffer, 0, sizeof(buffer));
+ vector<BYTE> buffer(5*1024, 0);
patptr[i] = ofs / 16;
if (Patterns[i])
{
@@ -552,17 +551,23 @@
buffer[len++] = command;
buffer[len++] = param;
}
- if (len > sizeof(buffer) - 20) break;
+ if (len > buffer.size() - 20)
+ { //Buffer running out? Make it larger.
+ buffer.resize(buffer.size() + 1024, 0);
+ }
}
}
buffer[len++] = 0;
- if (len > sizeof(buffer) - 20) break;
+ if (len > buffer.size() - 20)
+ { //Buffer running out? Make it larger.
+ buffer.resize(buffer.size() + 1024, 0);
+ }
}
}
buffer[0] = (len - 2) & 0xFF;
buffer[1] = (len - 2) >> 8;
len = (len+15) & (~0x0F);
- fwrite(buffer, len, 1, f);
+ fwrite(&buffer[0], len, 1, f);
ofs += len;
}
// Writing samples
Modified: trunk/OpenMPT/soundlib/Load_xm.cpp
===================================================================
--- trunk/OpenMPT/soundlib/Load_xm.cpp 2008-07-05 12:59:07 UTC (rev 213)
+++ trunk/OpenMPT/soundlib/Load_xm.cpp 2008-07-06 12:24:33 UTC (rev 214)
@@ -14,8 +14,13 @@
////////////////////////////////////////////////////////
// FastTracker II XM file support
-#pragma warning(disable:4244)
+#pragma warning(disable:4244) //conversion from 'type1' to 'type2', possible loss of data
+#define str_MBtitle (GetStrI18N((_TEXT("Saving XM"))))
+#define str_tooMuchPatternData (GetStrI18N((_TEXT("Warning: File format limit was reached. Some pattern data may not get written to file."))))
+#define str_pattern (GetStrI18N((_TEXT("pattern"))))
+
+
#pragma pack(1)
typedef struct tagXMFILEHEADER
{
@@ -651,7 +656,8 @@
BOOL CSoundFile::SaveXM(LPCSTR lpszFileName, UINT nPacking)
//---------------------------------------------------------
{
- BYTE s[64*64*5];
+ //BYTE s[64*64*5];
+ vector<BYTE> s(64*64*5, 0);
XMFILEHEADER header;
XMINSTRUMENTHEADER xmih;
XMSAMPLEHEADER xmsh;
@@ -668,7 +674,7 @@
lstrcpy((LPSTR)&s[1], (nPacking) ? "MOD Plugin packed " : "FastTracker v2.00 ");
s[21] = 0x04;
s[22] = 0x01;
- fwrite(s, 23, 1, f);
+ fwrite(&s[0], 23, 1, f);
// Writing song header
memset(&header, 0, sizeof(header));
header.size = sizeof(XMFILEHEADER);
@@ -761,12 +767,20 @@
if (b & 8) s[len++] = command;
if (b & 16) s[len++] = param;
}
- if (len > sizeof(s) - 5) break;
+ if(len > s.size() - 5) //Buffer running out? Make it larger.
+ s.resize(s.size() + 10*1024, 0);
+
+ if(len > uint16_max - 5u) //Reaching the limits of file format?
+ {
+ CString str; str.Format("%s (%s %u)", str_tooMuchPatternData, str_pattern, i);
+ MessageBox(0, str, str_MBtitle, MB_ICONWARNING);
+ break;
+ }
}
xmph[7] = (BYTE)(len & 0xFF);
xmph[8] = (BYTE)(len >> 8);
fwrite(xmph, 1, 9, f);
- fwrite(s, 1, len, f);
+ fwrite(&s[0], 1, len, f);
} else
{
memset(&xmph, 0, sizeof(xmph));
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <rel...@us...> - 2008-07-05 12:59:11
|
Revision: 213
http://modplug.svn.sourceforge.net/modplug/?rev=213&view=rev
Author: relabsoluness
Date: 2008-07-05 05:59:07 -0700 (Sat, 05 Jul 2008)
Log Message:
-----------
/ Change to version handling along with minor changes to version information. The version related values and functions are now defined in version.h and the version resource is defined in mptrack.rc2(to be edited manually, not with Visual Studio).
+ Added _very_ primitive (unit) test framework and some version handling tests.
Modified Paths:
--------------
trunk/OpenMPT/mptrack/MainFrm.cpp
trunk/OpenMPT/mptrack/Mainfrm.h
trunk/OpenMPT/mptrack/Moddoc.cpp
trunk/OpenMPT/mptrack/Mptrack.cpp
trunk/OpenMPT/mptrack/Stdafx.h
trunk/OpenMPT/mptrack/dlg_misc.cpp
trunk/OpenMPT/mptrack/mptrack.rc
trunk/OpenMPT/mptrack/mptrack.vcproj
trunk/OpenMPT/mptrack/res/MPTRACK.RC2
trunk/OpenMPT/soundlib/Load_it.cpp
trunk/OpenMPT/soundlib/Load_xm.cpp
trunk/OpenMPT/soundlib/Sndfile.cpp
Added Paths:
-----------
trunk/OpenMPT/mptrack/test/
trunk/OpenMPT/mptrack/test/test.cpp
trunk/OpenMPT/mptrack/test/test.h
trunk/OpenMPT/mptrack/version.h
Removed Paths:
-------------
trunk/OpenMPT/mptrack/VersionNo.h
Modified: trunk/OpenMPT/mptrack/MainFrm.cpp
===================================================================
--- trunk/OpenMPT/mptrack/MainFrm.cpp 2008-06-07 12:17:24 UTC (rev 212)
+++ trunk/OpenMPT/mptrack/MainFrm.cpp 2008-07-05 12:59:07 UTC (rev 213)
@@ -22,6 +22,7 @@
#include "MIDIMappingDialog.h"
// -! NEW_FEATURE#0015
#include <direct.h>
+#include "version.h"
#ifdef _DEBUG
#define new DEBUG_NEW
@@ -598,7 +599,7 @@
dwDWORDSize = sizeof(DWORD);
DWORD dwPreviousVersion;
RegQueryValueEx(key, "Version", NULL, &dwREG_DWORD, (LPBYTE)&dwPreviousVersion, &dwDWORDSize);
- gcsPreviousVersion=GetVersionString(dwPreviousVersion);
+ gcsPreviousVersion = MptVersion::ToStr(dwPreviousVersion);
RegCloseKey(key);
}
m_pAutoSaver = new CAutoSaver(asEnabled, asInterval, asBackupHistory, asUseOriginalPath, asPath, asFileNameTemplate);
@@ -619,7 +620,7 @@
#ifdef DEBUG
title += CString(" DEBUG");
#endif
- title += CString(" ") + GetFullVersionString();
+ title += CString(" ") + MptVersion::str;
SetTitle(title);
OnUpdateFrameTitle(false);
@@ -863,7 +864,7 @@
{
CString iniFile = theApp.GetConfigFileName();
- CString version = CMainFrame::GetFullVersionString();
+ CString version = MptVersion::str;
WritePrivateProfileString("Version", "Version", version, iniFile);
WritePrivateProfileString("Version", "InstallGUID", gcsInstallGUID, iniFile);
WritePrivateProfileLong("Version", "CheckForUpdates", gnCheckForUpdates, iniFile);
@@ -1632,70 +1633,7 @@
/////////////////////////////////////////////////////////////////////////////
// CMainFrame static helpers
-DWORD CMainFrame::GetFullVersionNumeric() {
- char szFullPath[MAX_PATH];
- DWORD dwVerHnd;
- DWORD dwVerInfoSize;
- // Get version information from the application
- ::GetModuleFileName(NULL, szFullPath, sizeof(szFullPath));
- dwVerInfoSize = ::GetFileVersionInfoSize(szFullPath, &dwVerHnd);
- if (!dwVerInfoSize) {
- return 0;
- }
- char* pVersionInfo = new char[dwVerInfoSize];
- if (!pVersionInfo) {
- return 0;
- }
- char* szVer = NULL;
- UINT uVerLength;
- if (!(::GetFileVersionInfo((LPTSTR)szFullPath, (DWORD)dwVerHnd,
- (DWORD)dwVerInfoSize, (LPVOID)pVersionInfo))) {
- delete[] pVersionInfo;
- return 0;
- }
- if (!(::VerQueryValue(pVersionInfo, TEXT("\\StringFileInfo\\040904b0\\FileVersion"),
- (LPVOID*)&szVer, &uVerLength))) {
- delete[] pVersionInfo;
- return 0;
- }
-
- //version will be like: 1, 17, 2, 38
- CString version = szVer;
- delete[] pVersionInfo;
-
- int v1, v2, v3, v4;
- sscanf(version, "%x, %x, %x, %x", &v1, &v2, &v3, &v4);
- DWORD versionLong = VERSIONNUMBER(v1, v2, v3, v4);
- return versionLong;
-}
-
-CString CMainFrame::GetFullVersionString()
-//------------------------------------
-{
- return GetVersionString(GetFullVersionNumeric());
-
-}
-
-CString CMainFrame::GetVersionString(DWORD v)
-//-------------------------------------------
-{
- CString version;
- if (v==0) {
- version = "Unknown";
- }
- else {
- version.Format("%X.%02X.%02X.%02X",
- (v>>24)&0xFF,
- (v>>16)&0xFF,
- (v>>8)&0xFF,
- (v)&0xFF);
- }
- return version;
-}
-
-
-
void CMainFrame::UpdateColors()
//-----------------------------
{
Modified: trunk/OpenMPT/mptrack/Mainfrm.h
===================================================================
--- trunk/OpenMPT/mptrack/Mainfrm.h 2008-06-07 12:17:24 UTC (rev 212)
+++ trunk/OpenMPT/mptrack/Mainfrm.h 2008-07-05 12:59:07 UTC (rev 213)
@@ -489,9 +489,6 @@
public:
static CMainFrame *GetMainFrame() { return (CMainFrame *)theApp.m_pMainWnd; }
static VOID UpdateColors();
- static CString GetFullVersionString();
- static DWORD GetFullVersionNumeric();
- static CString GetVersionString(DWORD);
static HICON GetModIcon() { return m_hIcon; }
static HFONT GetGUIFont() { return m_hGUIFont; }
static HFONT GetFixedFont() { return m_hFixedFont; }
Modified: trunk/OpenMPT/mptrack/Moddoc.cpp
===================================================================
--- trunk/OpenMPT/mptrack/Moddoc.cpp 2008-06-07 12:17:24 UTC (rev 212)
+++ trunk/OpenMPT/mptrack/Moddoc.cpp 2008-07-05 12:59:07 UTC (rev 213)
@@ -12,6 +12,7 @@
#include "mod2wave.h"
#include "mod2midi.h"
#include "vstplug.h"
+#include "version.h"
#ifdef _DEBUG
#define new DEBUG_NEW
@@ -354,11 +355,11 @@
// -> DESC="channels management dlg"
ReinitRecordState();
// -! NEW_FEATURE#0015
- if (m_SndFile.m_dwLastSavedWithVersion > CMainFrame::GetFullVersionNumeric()) {
+ if (m_SndFile.m_dwLastSavedWithVersion > MptVersion::num) {
char s[256];
wsprintf(s, "Warning: this song was last saved with a more recent version of OpenMPT.\r\nSong saved with: v%s. Current version: v%s.\r\n",
- CMainFrame::GetVersionString(m_SndFile.m_dwLastSavedWithVersion),
- CMainFrame::GetFullVersionString());
+ MptVersion::ToStr(m_SndFile.m_dwLastSavedWithVersion),
+ MptVersion::str);
::AfxMessageBox(s);
}
@@ -376,7 +377,7 @@
TCHAR fext[_MAX_EXT]="";
UINT nType = m_SndFile.m_nType, dwPacking = 0;
BOOL bOk = FALSE;
- m_SndFile.m_dwLastSavedWithVersion = CMainFrame::GetFullVersionNumeric();
+ m_SndFile.m_dwLastSavedWithVersion = MptVersion::num;
if (!lpszPathName) return FALSE;
_tsplitpath(lpszPathName, NULL, NULL, NULL, fext);
if (!lstrcmpi(fext, ".mod")) nType = MOD_TYPE_MOD; else
Modified: trunk/OpenMPT/mptrack/Mptrack.cpp
===================================================================
--- trunk/OpenMPT/mptrack/Mptrack.cpp 2008-06-07 12:17:24 UTC (rev 212)
+++ trunk/OpenMPT/mptrack/Mptrack.cpp 2008-07-05 12:59:07 UTC (rev 213)
@@ -14,6 +14,8 @@
#include "hyperEdit.h"
#include "bladedll.h"
#include "commctrl.h"
+#include "version.h"
+#include "test/test.h"
// rewbs.memLeak
#define CRTDBG_MAP_ALLOC
@@ -818,13 +820,18 @@
*/
// Open settings if the previous execution was with an earlier version.
- if (!cmdInfo.m_bNoSettingsOnNewVersion && CMainFrame::gcsPreviousVersion < CMainFrame::GetFullVersionString()) {
+ if (!cmdInfo.m_bNoSettingsOnNewVersion && MptVersion::ToNum(CMainFrame::gcsPreviousVersion) < MptVersion::num) {
StopSplashScreen();
ShowChangesDialog();
m_pMainWnd->PostMessage(WM_COMMAND, ID_VIEW_OPTIONS);
}
EndWaitCursor();
+
+ #ifdef ENABLE_TESTS
+ MptTest::DoTests();
+ #endif
+
return TRUE;
}
@@ -1602,7 +1609,7 @@
m_bmp.LoadBitmap(MAKEINTRESOURCE(IDB_MPTRACK));
wsprintf(s, "Build Date: %s", gszBuildDate);
SetDlgItemText(IDC_EDIT2, s);
- SetDlgItemText(IDC_EDIT3, CString("Open Modplug Tracker, version ") + CMainFrame::GetFullVersionString() + " (development build)");
+ SetDlgItemText(IDC_EDIT3, CString("Open Modplug Tracker, version ") + MptVersion::str + " (development build)");
m_heContact.SetWindowText(
"Contact / Discussion:\r\n\
Modified: trunk/OpenMPT/mptrack/Stdafx.h
===================================================================
--- trunk/OpenMPT/mptrack/Stdafx.h 2008-06-07 12:17:24 UTC (rev 212)
+++ trunk/OpenMPT/mptrack/Stdafx.h 2008-07-05 12:59:07 UTC (rev 213)
@@ -76,8 +76,6 @@
#include "typedefs.h"
-#define VERSIONNUMBER(v1, v2, v3, v4) ((v1 << 24) + (v2 << 16) + (v3 << 8) + v4)
-
//To mark string that should be translated in case of multilingual version.
#define GetStrI18N(x) (x)
Deleted: trunk/OpenMPT/mptrack/VersionNo.h
===================================================================
--- trunk/OpenMPT/mptrack/VersionNo.h 2008-06-07 12:17:24 UTC (rev 212)
+++ trunk/OpenMPT/mptrack/VersionNo.h 2008-07-05 12:59:07 UTC (rev 213)
@@ -1,4 +0,0 @@
-#define FILE_VERSION 2,0,0,1
-#define PRODUCT_VERSION 2,0,0,1
-#define FILE_VERSION_STR "1, 0, 0, 1\n"
-#define PRODUCT_VERSION_STR "Modplug Tracker"
Modified: trunk/OpenMPT/mptrack/dlg_misc.cpp
===================================================================
--- trunk/OpenMPT/mptrack/dlg_misc.cpp 2008-06-07 12:17:24 UTC (rev 212)
+++ trunk/OpenMPT/mptrack/dlg_misc.cpp 2008-07-05 12:59:07 UTC (rev 213)
@@ -9,6 +9,7 @@
#include "ChannelManagerDlg.h"
#include ".\dlg_misc.h"
#include "midi.h"
+#include "version.h"
#pragma warning(disable:4244)
@@ -198,8 +199,8 @@
SetDlgItemText(IDC_EDIT5, "Created with:");
SetDlgItemText(IDC_EDIT6, "Last saved with:");
- SetDlgItemText(IDC_EDIT1, CMainFrame::GetVersionString(m_pSndFile->m_dwCreatedWithVersion));
- SetDlgItemText(IDC_EDIT2, CMainFrame::GetVersionString(m_pSndFile->m_dwLastSavedWithVersion));
+ SetDlgItemText(IDC_EDIT1, MptVersion::ToStr(m_pSndFile->m_dwCreatedWithVersion));
+ SetDlgItemText(IDC_EDIT2, MptVersion::ToStr(m_pSndFile->m_dwLastSavedWithVersion));
m_EditFlag.SetLimitText(16);
Modified: trunk/OpenMPT/mptrack/mptrack.rc
===================================================================
--- trunk/OpenMPT/mptrack/mptrack.rc 2008-06-07 12:17:24 UTC (rev 212)
+++ trunk/OpenMPT/mptrack/mptrack.rc 2008-07-05 12:59:07 UTC (rev 213)
@@ -1942,46 +1942,6 @@
/////////////////////////////////////////////////////////////////////////////
//
-// Version
-//
-
-VS_VERSION_INFO VERSIONINFO
- FILEVERSION 1,17,2,53
- PRODUCTVERSION 0,0,0,0
- FILEFLAGSMASK 0x3fL
-#ifdef _DEBUG
- FILEFLAGS 0x9L
-#else
- FILEFLAGS 0x8L
-#endif
- FILEOS 0x4L
- FILETYPE 0x1L
- FILESUBTYPE 0x0L
-BEGIN
- BLOCK "StringFileInfo"
- BEGIN
- BLOCK "040904b0"
- BEGIN
- VALUE "CompanyName", "Olivier Lapicque / OpenMPT team"
- VALUE "FileDescription", "OpenMPT / ModPlug Tracker"
- VALUE "FileVersion", "1, 17, 2, 53"
- VALUE "InternalName", "Modplug Tracker"
- VALUE "LegalCopyright", "Copyright \xA91997-2003 Olivier Lapicque; \xA92004-2007 GPL."
- VALUE "LegalTrademarks", "M.O.D.P.L.U.G"
- VALUE "OriginalFilename", "mptrack.exe"
- VALUE "ProductName", "OpenMPT / ModPlug Tracker"
- VALUE "ProductVersion", "0, 0, 0, 0"
- END
- END
- BLOCK "VarFileInfo"
- BEGIN
- VALUE "Translation", 0x409, 1200
- END
-END
-
-
-/////////////////////////////////////////////////////////////////////////////
-//
// DESIGNINFO
//
Modified: trunk/OpenMPT/mptrack/mptrack.vcproj
===================================================================
--- trunk/OpenMPT/mptrack/mptrack.vcproj 2008-06-07 12:17:24 UTC (rev 212)
+++ trunk/OpenMPT/mptrack/mptrack.vcproj 2008-07-05 12:59:07 UTC (rev 213)
@@ -1086,6 +1086,9 @@
RelativePath=".\typedefs.h">
</File>
<File
+ RelativePath=".\version.h">
+ </File>
+ <File
RelativePath=".\view_com.h">
</File>
<File
@@ -1135,6 +1138,16 @@
</File>
</Filter>
</Filter>
+ <Filter
+ Name="test"
+ Filter="">
+ <File
+ RelativePath=".\test\test.cpp">
+ </File>
+ <File
+ RelativePath=".\test\test.h">
+ </File>
+ </Filter>
<File
RelativePath=".\mptrack.reg">
</File>
Modified: trunk/OpenMPT/mptrack/res/MPTRACK.RC2
===================================================================
--- trunk/OpenMPT/mptrack/res/MPTRACK.RC2 2008-06-07 12:17:24 UTC (rev 212)
+++ trunk/OpenMPT/mptrack/res/MPTRACK.RC2 2008-07-05 12:59:07 UTC (rev 213)
@@ -10,4 +10,51 @@
/////////////////////////////////////////////////////////////////////////////
// Add manually edited resources here...
+#include "version.h"
+#include <winver.h>
+
+#define VER_FILEVERSION VER_MAJORMAJOR,VER_MAJOR,VER_MINOR,VER_MINORMINOR
+#define VER_FILEVERSION_STR STRINGIZE(VER_FILEVERSION)
+
+#ifndef _DEBUG
+ #define VER_DEBUG 0
+#else
+ #define VER_DEBUG VS_FF_DEBUG
+#endif
+
+#define VER_FILEFLAGSMASK VS_FFI_FILEFLAGSMASK
+#define VER_FILEFLAGS (VS_FF_PRIVATEBUILD|VS_FF_PRERELEASE|VER_DEBUG)
+//Note: Changing this might need changes to BLOCK "StringFileInfo" defined below.
+
+VS_VERSION_INFO VERSIONINFO
+ FILEVERSION VER_FILEVERSION
+ PRODUCTVERSION VER_FILEVERSION
+ FILEFLAGSMASK VER_FILEFLAGSMASK
+ FILEFLAGS VER_FILEFLAGS
+ FILEOS 0x4L
+ FILETYPE 0x1L
+ FILESUBTYPE 0x0L
+BEGIN
+ BLOCK "StringFileInfo"
+ BEGIN
+ BLOCK "040904b0"
+ BEGIN
+ VALUE "CompanyName", "Olivier Lapicque / OpenMPT team"
+ VALUE "FileDescription", "OpenMPT / ModPlug Tracker"
+ VALUE "FileVersion", VER_FILEVERSION_STR
+ VALUE "InternalName", "Modplug Tracker"
+ VALUE "LegalCopyright", "Copyright \xA91997-2003 Olivier Lapicque; \xA92004-2007 GPL."
+ VALUE "LegalTrademarks", "M.O.D.P.L.U.G"
+ VALUE "OriginalFilename", "mptrack.exe"
+ VALUE "PrivateBuild", ""
+ VALUE "ProductName", "OpenMPT / ModPlug Tracker"
+ VALUE "ProductVersion", VER_FILEVERSION_STR
+ END
+ END
+ BLOCK "VarFileInfo"
+ BEGIN
+ VALUE "Translation", 0x409, 1200
+ END
+END
+
/////////////////////////////////////////////////////////////////////////////
Added: trunk/OpenMPT/mptrack/test/test.cpp
===================================================================
--- trunk/OpenMPT/mptrack/test/test.cpp (rev 0)
+++ trunk/OpenMPT/mptrack/test/test.cpp 2008-07-05 12:59:07 UTC (rev 213)
@@ -0,0 +1,125 @@
+/*
+ * Miscellaneous (unit) tests.
+ *
+ */
+
+#include "stdafx.h"
+#include "test.h"
+#include "../version.h"
+#include "../misc_util.h"
+
+#ifdef ENABLE_TESTS
+
+namespace MptTest
+{
+
+//Verify that given parameters are 'equal'(show error message if not).
+//The exact meaning of equality is not specified; for now using operator!=.
+//The macro is active in both 'debug' and 'release' build.
+#define VERIFY_EQUAL(x,y) \
+ if((x) != (y)) \
+ { \
+ CString str; \
+ str.Format("File: " STRINGIZE(__FILE__) "\nLine: " STRINGIZE(__LINE__) "\n\nVERIFY_EQUAL failed when comparing\n" #x "\nand\n" #y); \
+ MessageBox(0, str, "VERIFY_EQUAL failed", MB_ICONERROR); \
+ }
+
+
+#define DO_TEST(func) \
+try \
+{ \
+ func(); \
+} \
+catch(const std::exception& e) \
+{ \
+ MessageBox(0, CString("Test \"" STRINGIZE(func) "\" threw an exception, message: ") + e.what(), "Test \"" STRINGIZE(func) "\": Exception was thrown", MB_ICONERROR); \
+} \
+catch(...) \
+{ \
+ MessageBox(0, CString("Test \"" STRINGIZE(func) "\" threw an unknown exception."), "Test \"" STRINGIZE(func) "\": Exception was thrown", MB_ICONERROR); \
+}
+
+
+void TestVersion();
+
+
+
+
+void DoTests()
+//------------
+{
+ DO_TEST(TestVersion);
+
+ MessageBox(0, "Tests were run", "Testing", MB_ICONINFORMATION);
+}
+
+void TestVersion()
+//----------------
+{
+ //Verify that macros and functions work.
+ {
+ VERIFY_EQUAL( MPT_VERSION_NUMERIC, MptVersion::num );
+ VERIFY_EQUAL( CString(MPT_VERSION_STR), CString(MptVersion::str) );
+ VERIFY_EQUAL( MptVersion::ToNum(MptVersion::ToStr(MptVersion::num)), MptVersion::num );
+ VERIFY_EQUAL( MptVersion::ToStr(MptVersion::ToNum(MptVersion::str)), MptVersion::str );
+ VERIFY_EQUAL( MptVersion::ToStr(18285096), "1.17.02.28" );
+ VERIFY_EQUAL( MptVersion::ToNum("1.17.02.28"), 18285096 );
+ VERIFY_EQUAL( MptVersion::ToNum(MptVersion::str), MptVersion::num );
+ VERIFY_EQUAL( MptVersion::ToStr(MptVersion::num), MptVersion::str );
+ STATIC_ASSERT( MAKE_VERSION_NUMERIC(1,17,2,28) == 18285096 );
+ STATIC_ASSERT( MAKE_VERSION_NUMERIC(1,17,02,48) == 18285128 );
+ STATIC_ASSERT( MAKE_VERSION_NUMERIC(01,17,02,52) == 18285138 );
+ }
+
+ //Verify that the version obtained from the executable file is the same as
+ //defined in MptVersion.
+ {
+ char szFullPath[MAX_PATH];
+ DWORD dwVerHnd;
+ DWORD dwVerInfoSize;
+
+ // Get version information from the application
+ ::GetModuleFileName(NULL, szFullPath, sizeof(szFullPath));
+ dwVerInfoSize = ::GetFileVersionInfoSize(szFullPath, &dwVerHnd);
+ if (!dwVerInfoSize)
+ throw std::runtime_error("!dwVerInfoSize is true");
+
+ char* pVersionInfo = new char[dwVerInfoSize];
+ if (!pVersionInfo)
+ throw std::runtime_error("!pVersionInfo is true");
+
+ char* szVer = NULL;
+ UINT uVerLength;
+ if (!(::GetFileVersionInfo((LPTSTR)szFullPath, (DWORD)dwVerHnd,
+ (DWORD)dwVerInfoSize, (LPVOID)pVersionInfo))) {
+ delete[] pVersionInfo;
+ throw std::runtime_error("GetFileVersionInfo() returned false");
+ }
+ if (!(::VerQueryValue(pVersionInfo, TEXT("\\StringFileInfo\\040904b0\\FileVersion"),
+ (LPVOID*)&szVer, &uVerLength))) {
+ delete[] pVersionInfo;
+ throw std::runtime_error("VerQueryValue() returned false");
+ }
+
+ CString version = szVer;
+ delete[] pVersionInfo;
+
+ //version string should be like: 1,17,2,38 Change ',' to '.' to get format 1.17.2.38
+ version.Replace(',', '.');
+
+ VERIFY_EQUAL( version, MptVersion::str );
+ VERIFY_EQUAL( MptVersion::ToNum(version), MptVersion::num );
+ }
+}
+
+}; //Namespace MptTest
+
+#else //Case: ENABLE_TESTS is not defined.
+
+namespace MptTest
+{
+ void DoTests() {}
+};
+
+#endif
+
Added: trunk/OpenMPT/mptrack/test/test.h
===================================================================
--- trunk/OpenMPT/mptrack/test/test.h (rev 0)
+++ trunk/OpenMPT/mptrack/test/test.h 2008-07-05 12:59:07 UTC (rev 213)
@@ -0,0 +1,11 @@
+#ifndef _TEST_H
+#define _TEST_H
+
+//#define ENABLE_TESTS
+
+namespace MptTest
+{
+ void DoTests();
+};
+
+#endif // _TEST_H
Added: trunk/OpenMPT/mptrack/version.h
===================================================================
--- trunk/OpenMPT/mptrack/version.h (rev 0)
+++ trunk/OpenMPT/mptrack/version.h 2008-07-05 12:59:07 UTC (rev 213)
@@ -0,0 +1,58 @@
+/*
+ * Version related stuff.
+ *
+ */
+
+#ifndef _VERSION_H
+#define _VERSION_H
+
+//STRINGIZE makes a string of given argument. If used with #defined value,
+//the string is made of the contents of the defined value.
+#define HELPER_STRINGIZE(x) #x
+#define STRINGIZE(x) HELPER_STRINGIZE(x)
+
+//Version definitions. The only thing that needs to be changed when changing version number.
+#define VER_MAJORMAJOR 1
+#define VER_MAJOR 17
+#define VER_MINOR 02
+#define VER_MINORMINOR 53
+
+//Creates version number from version parts that appears in version string.
+//For example MAKE_VERSION_NUMERIC(1,17,02,28) gives version number of
+//version 1.17.02.28.
+#define MAKE_VERSION_NUMERIC(v0,v1,v2,v3) ((0x##v0 << 24) + (0x##v1<<16) + (0x##v2<<8) + (0x##v3))
+
+//Version string. For example "1.17.02.28"
+#define MPT_VERSION_STR STRINGIZE(VER_MAJORMAJOR)"."STRINGIZE(VER_MAJOR)"."STRINGIZE(VER_MINOR)"."STRINGIZE(VER_MINORMINOR)
+
+//Numerical value of the version.
+#define MPT_VERSION_NUMERIC MAKE_VERSION_NUMERIC(VER_MAJORMAJOR,VER_MAJOR,VER_MINOR,VER_MINORMINOR)
+
+namespace MptVersion
+{
+ typedef uint32 VersionNum;
+ const VersionNum num = MPT_VERSION_NUMERIC;
+ const char* const str = MPT_VERSION_STR;
+
+ //Returns numerical version value from given version string.
+ inline VersionNum ToNum(const char* const s)
+ {
+ int v1, v2, v3, v4;
+ sscanf(s, "%x.%x.%x.%x", &v1, &v2, &v3, &v4);
+ return ((v1 << 24) + (v2 << 16) + (v3 << 8) + v4);
+ }
+ //Returns version string from given numerical version value.
+ inline CString ToStr(const VersionNum v)
+ {
+ CString strVersion;
+ if(v == 0)
+ strVersion = "Unknown";
+ else
+ strVersion.Format("%X.%02X.%02X.%02X", (v>>24)&0xFF, (v>>16)&0xFF, (v>>8)&0xFF, (v)&0xFF);
+ return strVersion;
+ }
+}; //namespace MptVersion
+
+
+
+#endif // _VERSION_H
Modified: trunk/OpenMPT/soundlib/Load_it.cpp
===================================================================
--- trunk/OpenMPT/soundlib/Load_it.cpp 2008-06-07 12:17:24 UTC (rev 212)
+++ trunk/OpenMPT/soundlib/Load_it.cpp 2008-07-05 12:59:07 UTC (rev 213)
@@ -20,6 +20,7 @@
#include <fstream>
#include <strstream>
#include <list>
+#include "../mptrack/version.h"
using std::map;
using std::list;
using std::vector;
@@ -891,7 +892,7 @@
m_nMaxPeriod = 0xF000;
m_nMinPeriod = 8;
- if(m_dwLastSavedWithVersion < VERSIONNUMBER(0x1, 0x17, 0x2, 0x50))
+ if(m_dwLastSavedWithVersion < MAKE_VERSION_NUMERIC(1, 17, 2, 50))
{
SetModFlag(MSF_MIDICC_BUGEMULATION, true);
SetModFlag(MSF_OLDVOLSWING, true);
@@ -1490,7 +1491,7 @@
}
}
- if(m_dwLastSavedWithVersion < VERSIONNUMBER(0x1, 0x17, 0x2, 0x50))
+ if(m_dwLastSavedWithVersion < MAKE_VERSION_NUMERIC(1, 17, 2, 50))
{
SetModFlag(MSF_MIDICC_BUGEMULATION, true);
SetModFlag(MSF_OLDVOLSWING, true);
Modified: trunk/OpenMPT/soundlib/Load_xm.cpp
===================================================================
--- trunk/OpenMPT/soundlib/Load_xm.cpp 2008-06-07 12:17:24 UTC (rev 212)
+++ trunk/OpenMPT/soundlib/Load_xm.cpp 2008-07-05 12:59:07 UTC (rev 213)
@@ -9,6 +9,7 @@
#include "stdafx.h"
#include "sndfile.h"
+#include "../mptrack/version.h"
////////////////////////////////////////////////////////
// FastTracker II XM file support
@@ -633,7 +634,7 @@
if( code == 'MPTS' )
{
LoadExtendedSongProperties(MOD_TYPE_XM, ptr, lpStream, dwMemLength);
- if(m_dwLastSavedWithVersion < VERSIONNUMBER(0x1, 0x17, 0x2, 0x50))
+ if(m_dwLastSavedWithVersion < MAKE_VERSION_NUMERIC(1, 17, 2, 50))
SetModFlag(MSF_MIDICC_BUGEMULATION, true);
}
Modified: trunk/OpenMPT/soundlib/Sndfile.cpp
===================================================================
--- trunk/OpenMPT/soundlib/Sndfile.cpp 2008-06-07 12:17:24 UTC (rev 212)
+++ trunk/OpenMPT/soundlib/Sndfile.cpp 2008-07-05 12:59:07 UTC (rev 213)
@@ -11,6 +11,7 @@
#include "../mptrack/mptrack.h"
#include "../mptrack/mainfrm.h"
#include "../mptrack/moddoc.h"
+#include "../mptrack/version.h"
#include "sndfile.h"
#include "aeffectx.h"
#include "wavConverter.h"
@@ -600,7 +601,7 @@
#endif
} else {
// New song
- m_dwCreatedWithVersion = CMainFrame::GetFullVersionNumeric();
+ m_dwCreatedWithVersion = MptVersion::num;
}
// Adjust song names
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <rel...@us...> - 2008-06-07 12:17:55
|
Revision: 212
http://modplug.svn.sourceforge.net/modplug/?rev=212&view=rev
Author: relabsoluness
Date: 2008-06-07 05:17:24 -0700 (Sat, 07 Jun 2008)
Log Message:
-----------
./ Increased pattern index hint size from 8 bits to 12 bits. Should fix pattern name
update bug when using more than 255 pattern. (http://lpchip.com/modplug/viewtopic.php?t=2344)
. Refactoring and fixes to UpdateView hint parameter handling. Affects at least some treeview related GUI updates.
/ Show note about pre-amp setting before changing it.
/ Changed pattern/order limit for MPTm from 65000 to 4000.
./ Minor tweaks and fixes here and there.
Internal:
/ Refactoring: Added defines for maximum note value and note cut/off values.
/ Refactoring: Moved some CCtrlPatterns code from ChannelManagerDlg.cpp to ctrl_pat.cpp
Modified Paths:
--------------
trunk/OpenMPT/mptrack/ChannelManagerDlg.cpp
trunk/OpenMPT/mptrack/Ctrl_ins.cpp
trunk/OpenMPT/mptrack/Ctrl_pat.cpp
trunk/OpenMPT/mptrack/Ctrl_smp.cpp
trunk/OpenMPT/mptrack/Draw_pat.cpp
trunk/OpenMPT/mptrack/EffectVis.cpp
trunk/OpenMPT/mptrack/Moddoc.cpp
trunk/OpenMPT/mptrack/Moddoc.h
trunk/OpenMPT/mptrack/Modedit.cpp
trunk/OpenMPT/mptrack/Mpdlgs.cpp
trunk/OpenMPT/mptrack/Mpdlgs.h
trunk/OpenMPT/mptrack/Mptrack.cpp
trunk/OpenMPT/mptrack/Stdafx.h
trunk/OpenMPT/mptrack/View_gen.cpp
trunk/OpenMPT/mptrack/View_gen.h
trunk/OpenMPT/mptrack/View_ins.cpp
trunk/OpenMPT/mptrack/View_pat.cpp
trunk/OpenMPT/mptrack/View_pat.h
trunk/OpenMPT/mptrack/View_smp.cpp
trunk/OpenMPT/mptrack/View_tre.cpp
trunk/OpenMPT/mptrack/Vstplug.cpp
trunk/OpenMPT/mptrack/dlg_misc.cpp
trunk/OpenMPT/mptrack/dlg_misc.h
trunk/OpenMPT/mptrack/misc_util.h
trunk/OpenMPT/mptrack/mod2midi.cpp
trunk/OpenMPT/mptrack/mptrack.rc
trunk/OpenMPT/mptrack/mptrack.vcproj
trunk/OpenMPT/mptrack/pattern.cpp
trunk/OpenMPT/mptrack/view_com.cpp
trunk/OpenMPT/soundlib/Dlsbank.cpp
trunk/OpenMPT/soundlib/LOAD_DBM.CPP
trunk/OpenMPT/soundlib/Load_ams.cpp
trunk/OpenMPT/soundlib/Load_it.cpp
trunk/OpenMPT/soundlib/Load_mdl.cpp
trunk/OpenMPT/soundlib/Load_med.cpp
trunk/OpenMPT/soundlib/Load_mid.cpp
trunk/OpenMPT/soundlib/Load_mt2.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/ChannelManagerDlg.cpp
===================================================================
--- trunk/OpenMPT/mptrack/ChannelManagerDlg.cpp 2008-05-10 13:27:55 UTC (rev 211)
+++ trunk/OpenMPT/mptrack/ChannelManagerDlg.cpp 2008-06-07 12:17:24 UTC (rev 212)
@@ -1,14 +1,16 @@
#include "stdafx.h"
-#include "mptrack.h"
#include "mainfrm.h"
-#include "childfrm.h"
#include "moddoc.h"
-#include "globals.h"
-#include "dlg_misc.h"
-#include "ctrl_pat.h"
-#include "view_pat.h"
+#include "view_gen.h"
#include "ChannelManagerDlg.h"
+//#include "mptrack.h"
+//#include "childfrm.h"
+//#include "globals.h"
+//#include "dlg_misc.h"
+//#include "ctrl_pat.h"
+//#include "view_pat.h"
+
///////////////////////////////////////////////////////////
// CChannelManagerDlg
@@ -1114,7 +1116,7 @@
pModDoc->MuteChannel(n,!pModDoc->IsChannelMuted(n));
}
pModDoc->SetModified();
- pModDoc->UpdateAllViews(NULL, HINT_MODCHANNELS | (n << 24));
+ pModDoc->UpdateAllViews(NULL, HINT_MODCHANNELS | ((n/CHANNELS_IN_TAB) << HINT_SHIFT_CHNTAB));
break;
case 1:
UINT r;
@@ -1132,7 +1134,7 @@
if(button == CM_BT_LEFT) pModDoc->NoFxChannel(n,FALSE);
else pModDoc->NoFxChannel(n,TRUE);
pModDoc->SetModified();
- pModDoc->UpdateAllViews(NULL, HINT_MODCHANNELS | (n << 24));
+ pModDoc->UpdateAllViews(NULL, HINT_MODCHANNELS | ((n/CHANNELS_IN_TAB) << HINT_SHIFT_CHNTAB));
break;
case 3:
if(button == CM_BT_LEFT){
@@ -1174,36 +1176,7 @@
// -! NEW_FEATURE#0015
-BOOL CCtrlPatterns::OnMouseWheel(UINT nFlags, short zDelta, CPoint pt)
-//--------------------------------------------------------------------
-{
- // TODO: Add your message handler code here and/or call default
- if (nFlags==0) {
- PostViewMessage(VIEWMSG_DOSCROLL, zDelta);
- }
- return CModControlDlg::OnMouseWheel(nFlags, zDelta, pt);
-}
-
-BOOL CCtrlPatterns::OnToolTip(UINT /*id*/, NMHDR *pNMHDR, LRESULT* /*pResult*/)
-//---------------------------------------------------------------------
-{
- TOOLTIPTEXT *pTTT = (TOOLTIPTEXT *)pNMHDR;
- UINT nID =pNMHDR->idFrom;
- if (pTTT->uFlags & TTF_IDISHWND)
- {
- // idFrom is actually the HWND of the tool
- nID = ::GetDlgCtrlID((HWND)nID);
- if(nID)
- {
- pTTT->lpszText = MAKEINTRESOURCE(nID);
- pTTT->hinst = AfxGetResourceHandle();
- return(TRUE);
- }
- }
-
- return FALSE;
-}
void CChannelManagerDlg::OnLButtonDblClk(UINT nFlags, CPoint point)
{
// TODO: Add your message handler code here and/or call default
Modified: trunk/OpenMPT/mptrack/Ctrl_ins.cpp
===================================================================
--- trunk/OpenMPT/mptrack/Ctrl_ins.cpp 2008-05-10 13:27:55 UTC (rev 211)
+++ trunk/OpenMPT/mptrack/Ctrl_ins.cpp 2008-06-07 12:17:24 UTC (rev 212)
@@ -113,7 +113,7 @@
//------------------------------------------
{
if (nNote == m_nNote) return TRUE;
- if (nNote >= 120) return FALSE;
+ if (nNote >= NOTE_MAX) return FALSE;
m_nNote = nNote;
InvalidateRect(NULL, FALSE);
return TRUE;
@@ -166,7 +166,7 @@
string temp = pSndFile->GetNoteName(nPos+1, m_nInstrument);
temp.resize(4);
- if ((nPos >= 0) && (nPos < 120)) wsprintf(s, "%s", temp.c_str());
+ if ((nPos >= 0) && (nPos < NOTE_MAX)) wsprintf(s, "%s", temp.c_str());
rect.SetRect(0, ypaint, m_cxFont, ypaint+m_cyFont);
DrawButtonRect(hdc, &rect, s, FALSE, FALSE);
// Mapped Note
@@ -174,12 +174,12 @@
rect.left = rect.right;
rect.right = m_cxFont*2-1;
strcpy(s, "...");
- if ((penv) && (nPos >= 0) && (nPos < 120) && (penv->NoteMap[nPos]))
+ if ((penv) && (nPos >= 0) && (nPos < NOTE_MAX) && (penv->NoteMap[nPos]))
{
UINT n = penv->NoteMap[nPos];
- if (n == 0xFF) strcpy(s, "==="); else
- if (n == 0xFE) strcpy(s, "^^^"); else
- if (n <= 120)
+ if (n == NOTE_KEYOFF) strcpy(s, "==="); else
+ if (n == NOTE_NOTECUT) strcpy(s, "^^^"); else
+ if (n <= NOTE_MAX)
{
string temp = pSndFile->GetNoteName(n, m_nInstrument);
temp.resize(4);
@@ -200,7 +200,7 @@
rect.left = rcClient.left + m_cxFont*2+3;
rect.right = rcClient.right;
strcpy(s, " ..");
- if ((penv) && (nPos >= 0) && (nPos < 120) && (penv->Keyboard[nPos]))
+ if ((penv) && (nPos >= 0) && (nPos < NOTE_MAX) && (penv->Keyboard[nPos]))
{
wsprintf(s, "%3d", penv->Keyboard[nPos]);
}
@@ -298,7 +298,7 @@
{
BYTE smpused[(MAX_SAMPLES+7)/8];
memset(smpused, 0, sizeof(smpused));
- for (UINT i=1; i<120; i++)
+ for (UINT i=1; i<NOTE_MAX; i++)
{
UINT nsmp = penv->Keyboard[i];
if (nsmp < MAX_SAMPLES) smpused[nsmp>>3] |= 1 << (nsmp & 7);
@@ -346,7 +346,7 @@
{
BOOL bModified = FALSE;
UINT n = penv->Keyboard[m_nNote];
- for (UINT i=0; i<120; i++) if (penv->Keyboard[i] != n)
+ for (UINT i=0; i<NOTE_MAX; i++) if (penv->Keyboard[i] != n)
{
penv->Keyboard[i] = n;
bModified = TRUE;
@@ -374,7 +374,7 @@
if (penv)
{
BOOL bModified = FALSE;
- for (UINT i=0; i<120; i++) if (penv->NoteMap[i] != i+1)
+ for (UINT i=0; i<NOTE_MAX; i++) if (penv->NoteMap[i] != i+1)
{
penv->NoteMap[i] = i+1;
bModified = TRUE;
@@ -448,13 +448,13 @@
{
CSoundFile *pSndFile = m_pModDoc->GetSoundFile();
INSTRUMENTHEADER *penv = pSndFile->Headers[m_nInstrument];
- if ((penv) && (m_nNote < 120))
+ if ((penv) && (m_nNote < NOTE_MAX))
{
if (!m_bIns && (pSndFile->m_nType & (MOD_TYPE_IT|MOD_TYPE_MPT)))
{
UINT n = penv->NoteMap[m_nNote];
BOOL bOk = FALSE;
- if ((note > 0) && (note <= 120))
+ if ((note > 0) && (note <= NOTE_MAX))
{
n = note;
bOk = TRUE;
@@ -480,7 +480,7 @@
{
CSoundFile *pSndFile = m_pModDoc->GetSoundFile();
INSTRUMENTHEADER *penv = pSndFile->Headers[m_nInstrument];
- if ((penv) && (m_nNote < 120)) {
+ if ((penv) && (m_nNote < NOTE_MAX)) {
if ((m_bIns) && (((c >= '0') && (c <= '9')) || (c == ' '))) { //in sample # column
@@ -568,7 +568,7 @@
if (m_nNote > 0) { m_nNote = 0; bRedraw = TRUE; }
break;
case VK_NEXT:
- if (m_nNote+3 < 120) { m_nNote+=3; bRedraw = TRUE; } else
+ if (m_nNote+3 < NOTE_MAX) { m_nNote+=3; bRedraw = TRUE; } else
if (m_nNote < 119) { m_nNote = 119; bRedraw = TRUE; }
break;
case VK_TAB:
@@ -822,7 +822,7 @@
// Pitch/Pan Separation
m_SpinPPS.SetRange(-32, +32);
// Pitch/Pan Center
- for (UINT n=0; n<=120; n++)
+ for (UINT n=0; n<=NOTE_MAX; n++)
{
wsprintf(s, "%s%d", szNoteNames[n % 12], n/12);
m_ComboPPC.SetItemData(m_ComboPPC.AddString(s), n);
@@ -863,7 +863,7 @@
{
m_nInstrument = nIns;
m_NoteMap.SetCurrentInstrument(m_pModDoc, m_nInstrument);
- UpdateView((m_nInstrument << 24) | HINT_INSTRUMENT | HINT_ENVELOPE, NULL);
+ UpdateView((m_nInstrument << HINT_SHIFT_INS) | HINT_INSTRUMENT | HINT_ENVELOPE, NULL);
} else
{
// Just in case
@@ -939,7 +939,7 @@
SetCurrentInstrument((lParam > 0) ? lParam : m_nInstrument);
// Initial Update
- if (!m_bInitialized) UpdateView((m_nInstrument << 24) | HINT_INSTRUMENT | HINT_ENVELOPE | HINT_MODTYPE, NULL);
+ if (!m_bInitialized) UpdateView((m_nInstrument << HINT_SHIFT_INS) | HINT_INSTRUMENT | HINT_ENVELOPE | HINT_MODTYPE, NULL);
CChildFrame *pFrame = (CChildFrame *)GetParentFrame();
if (pFrame) PostViewMessage(VIEWMSG_LOADSTATE, (LPARAM)pFrame->GetInstrumentViewState());
@@ -1027,7 +1027,7 @@
if (dwHintMask & HINT_MIXPLUGINS) OnMixPlugChanged();
UnlockControls();
if (!(dwHintMask & (HINT_INSTRUMENT|HINT_ENVELOPE|HINT_MODTYPE))) return;
- if (((dwHintMask >> 24) != m_nInstrument) && (dwHintMask & (HINT_INSTRUMENT|HINT_ENVELOPE)) && (!(dwHintMask & HINT_MODTYPE))) return;
+ if (((dwHintMask >> HINT_SHIFT_INS) != m_nInstrument) && (dwHintMask & (HINT_INSTRUMENT|HINT_ENVELOPE)) && (!(dwHintMask & HINT_MODTYPE))) return;
LockControls();
if (!m_bInitialized) dwHintMask |= HINT_MODTYPE;
if (dwHintMask & HINT_MODTYPE)
@@ -1185,6 +1185,9 @@
m_CbnPluginVolumeHandling.EnableWindow(FALSE);
m_CbnPluginVelocityHandling.SetCurSel(-1);
m_CbnPluginVolumeHandling.SetCurSel(-1);
+ if(m_nInstrument > m_pSndFile->GetNumInstruments())
+ SetCurrentInstrument(m_pSndFile->GetNumInstruments());
+
}
m_NoteMap.InvalidateRect(NULL, FALSE);
}
@@ -1295,7 +1298,7 @@
if (m_pModDoc)
{
m_pModDoc->SetModified();
- m_pModDoc->UpdateAllViews(NULL, (m_nInstrument << 24) | HINT_INSTRUMENT | HINT_ENVELOPE | HINT_INSNAMES | HINT_SMPNAMES);
+ m_pModDoc->UpdateAllViews(NULL, (m_nInstrument << HINT_SHIFT_INS) | HINT_INSTRUMENT | HINT_ENVELOPE | HINT_INSNAMES | HINT_SMPNAMES);
}
} else bOk = FALSE;
}
@@ -1328,7 +1331,7 @@
m_pSndFile->ReadInstrumentFromSong(m_nInstrument, pSndFile, nInstr);
END_CRITICAL();
m_pModDoc->SetModified();
- m_pModDoc->UpdateAllViews(NULL, (m_nInstrument << 24) | HINT_INSTRUMENT | HINT_ENVELOPE | HINT_INSNAMES | HINT_SMPNAMES);
+ m_pModDoc->UpdateAllViews(NULL, (m_nInstrument << HINT_SHIFT_INS) | HINT_INSTRUMENT | HINT_ENVELOPE | HINT_INSNAMES | HINT_SMPNAMES);
if (bFirst) m_pModDoc->UpdateAllViews(NULL, HINT_MODTYPE | HINT_INSNAMES | HINT_SMPNAMES);
m_pModDoc->SetModified();
EndWaitCursor();
@@ -1465,13 +1468,13 @@
return;
}
BOOL bFirst = (pSndFile->m_nInstruments) ? FALSE : TRUE;
- LONG smp = m_pModDoc->InsertInstrument(0);
- if (smp > 0)
+ LONG ins = m_pModDoc->InsertInstrument(0);
+ if (ins > 0)
{
- SetCurrentInstrument(smp);
- m_pModDoc->UpdateAllViews(NULL, (smp << 24) | HINT_INSTRUMENT | HINT_INSNAMES | HINT_ENVELOPE);
+ SetCurrentInstrument(ins);
+ m_pModDoc->UpdateAllViews(NULL, (ins << HINT_SHIFT_INS) | HINT_INSTRUMENT | HINT_INSNAMES | HINT_ENVELOPE);
}
- if (bFirst) m_pModDoc->UpdateAllViews(NULL, (smp << 24) | HINT_MODTYPE | HINT_INSTRUMENT | HINT_INSNAMES);
+ if (bFirst) m_pModDoc->UpdateAllViews(NULL, (ins << HINT_SHIFT_INS) | HINT_MODTYPE | HINT_INSTRUMENT | HINT_INSNAMES);
if (m_pParent) m_pParent->InstrumentChanged(m_nInstrument);
}
SwitchToView();
@@ -1487,13 +1490,13 @@
if ((pSndFile->m_nType & (MOD_TYPE_IT | MOD_TYPE_MPT)) && (pSndFile->m_nInstruments > 0))
{
BOOL bFirst = (pSndFile->m_nInstruments) ? FALSE : TRUE;
- LONG smp = m_pModDoc->InsertInstrument(0, m_nInstrument);
- if (smp > 0)
+ LONG ins = m_pModDoc->InsertInstrument(0, m_nInstrument);
+ if (ins > 0)
{
- SetCurrentInstrument(smp);
- m_pModDoc->UpdateAllViews(NULL, (smp << 24) | HINT_INSTRUMENT | HINT_INSNAMES | HINT_ENVELOPE);
+ SetCurrentInstrument(ins);
+ m_pModDoc->UpdateAllViews(NULL, (ins << HINT_SHIFT_INS) | HINT_INSTRUMENT | HINT_INSNAMES | HINT_ENVELOPE);
}
- if (bFirst) m_pModDoc->UpdateAllViews(NULL, (smp << 24) | HINT_MODTYPE | HINT_INSTRUMENT | HINT_INSNAMES);
+ if (bFirst) m_pModDoc->UpdateAllViews(NULL, (ins << HINT_SHIFT_INS) | HINT_MODTYPE | HINT_INSTRUMENT | HINT_INSNAMES);
if (m_pParent) m_pParent->InstrumentChanged(m_nInstrument);
}
}
@@ -1658,7 +1661,7 @@
// -! NEW_FEATURE#0023
memcpy(penv->name, s, 32);
m_pModDoc->SetModified();
- m_pModDoc->UpdateAllViews(NULL, (m_nInstrument << 24) | HINT_INSNAMES, this);
+ m_pModDoc->UpdateAllViews(NULL, (m_nInstrument << HINT_SHIFT_INS) | HINT_INSNAMES, this);
}
}
}
@@ -1993,7 +1996,7 @@
m_CbnPluginVolumeHandling.SetCurSel(penv->nPluginVolumeHandling);
m_pModDoc->UpdateAllViews(NULL, HINT_MIXPLUGINS, this);
- m_pModDoc->UpdateAllViews(NULL, (m_nInstrument << 24) | HINT_INSNAMES, this);
+ m_pModDoc->UpdateAllViews(NULL, (m_nInstrument << HINT_SHIFT_INS) | HINT_INSNAMES, this);
if (penv->nMixPlug) //if we have not just set to no plugin
{
@@ -2007,7 +2010,7 @@
if (pPlug->pMixPlugin->isInstrument() && penv->nMidiChannel==0) {
penv->nMidiChannel=1;
m_pSndFile->instrumentModified[m_nInstrument-1] = TRUE;
- UpdateView((m_nInstrument << 24) | HINT_INSTRUMENT, NULL);
+ UpdateView((m_nInstrument << HINT_SHIFT_INS) | HINT_INSTRUMENT, NULL);
}
return;
}
@@ -2425,7 +2428,7 @@
if (dlg.DoModal() == IDOK)
{
m_pModDoc->SetModified();
- m_pModDoc->UpdateAllViews(NULL, (m_nInstrument << 24) | HINT_INSTRUMENT, this);
+ m_pModDoc->UpdateAllViews(NULL, (m_nInstrument << HINT_SHIFT_INS) | HINT_INSTRUMENT, this);
m_NoteMap.InvalidateRect(NULL, FALSE);
}
}
@@ -2505,7 +2508,7 @@
pInstH->SetTuning(NULL);
END_CRITICAL();
m_pModDoc->SetModified();
- UpdateView((m_nInstrument << 24) | HINT_INSTRUMENT);
+ UpdateView((m_nInstrument << HINT_SHIFT_INS) | HINT_INSTRUMENT);
return;
}
@@ -2533,7 +2536,7 @@
pInstH->SetTuning(&tc->GetTuning(sel));
END_CRITICAL();
m_pModDoc->SetModified();
- UpdateView((m_nInstrument << 24) | HINT_INSTRUMENT);
+ UpdateView((m_nInstrument << HINT_SHIFT_INS) | HINT_INSTRUMENT);
return;
}
@@ -2559,7 +2562,7 @@
//new tuning(s) come visible.
BuildTuningComboBox();
- UpdateView((m_nInstrument << 24) | HINT_INSTRUMENT);
+ UpdateView((m_nInstrument << HINT_SHIFT_INS) | HINT_INSTRUMENT);
}
@@ -2611,7 +2614,7 @@
penv->SetTuning(penv->s_DefaultTuning);
END_CRITICAL();
m_pModDoc->SetModified();
- UpdateView((m_nInstrument << 24) | HINT_INSTRUMENT);
+ UpdateView((m_nInstrument << HINT_SHIFT_INS) | HINT_INSTRUMENT);
}
void CCtrlInstruments::OnEnChangeEditPitchtempolock()
Modified: trunk/OpenMPT/mptrack/Ctrl_pat.cpp
===================================================================
--- trunk/OpenMPT/mptrack/Ctrl_pat.cpp 2008-05-10 13:27:55 UTC (rev 211)
+++ trunk/OpenMPT/mptrack/Ctrl_pat.cpp 2008-06-07 12:17:24 UTC (rev 212)
@@ -189,7 +189,7 @@
//CHAR s[8];
CHAR s[10];
- for(int i = 0 ; i < 120 ; i++){
+ for(int i = 0 ; i < NOTE_MAX ; i++){
wsprintf(s, "%s%d", szNoteNames[i % 12], i/12);
int n = m_CbnSplitNote.AddString(s);
m_CbnSplitNote.SetItemData(n, i);
@@ -338,7 +338,7 @@
{
UINT nPat;
if (dwHintMask&HINT_PATNAMES) {
- nPat=(dwHintMask>>24)&0xFF;
+ nPat = (dwHintMask >> HINT_SHIFT_PAT);
} else {
nPat = SendViewMessage(VIEWMSG_GETCURRENTPATTERN);
}
@@ -378,7 +378,7 @@
return m_OrderList.GetCurrentPattern();
case CTRLMSG_PATTERNCHANGED:
- UpdateView((lParam << 24) | HINT_PATNAMES, NULL);
+ UpdateView((lParam << HINT_SHIFT_PAT) | HINT_PATNAMES, NULL);
break;
case CTRLMSG_PAT_PREVINSTRUMENT:
@@ -1087,7 +1087,7 @@
{
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 << 24) | HINT_PATNAMES, this);
+ m_pModDoc->UpdateAllViews(NULL, (nPat << HINT_SHIFT_PAT) | HINT_PATNAMES, this);
}
}
}
@@ -1220,4 +1220,37 @@
}
-//end rewbs.instroVST
\ No newline at end of file
+//end rewbs.instroVST
+
+
+BOOL CCtrlPatterns::OnMouseWheel(UINT nFlags, short zDelta, CPoint pt)
+//--------------------------------------------------------------------
+{
+ // TODO: Add your message handler code here and/or call default
+
+ if (nFlags==0) {
+ PostViewMessage(VIEWMSG_DOSCROLL, zDelta);
+ }
+ return CModControlDlg::OnMouseWheel(nFlags, zDelta, pt);
+}
+
+BOOL CCtrlPatterns::OnToolTip(UINT /*id*/, NMHDR *pNMHDR, LRESULT* /*pResult*/)
+//---------------------------------------------------------------------
+{
+ TOOLTIPTEXT *pTTT = (TOOLTIPTEXT *)pNMHDR;
+ UINT nID =pNMHDR->idFrom;
+ if (pTTT->uFlags & TTF_IDISHWND)
+ {
+ // idFrom is actually the HWND of the tool
+ nID = ::GetDlgCtrlID((HWND)nID);
+ if(nID)
+ {
+ pTTT->lpszText = MAKEINTRESOURCE(nID);
+ pTTT->hinst = AfxGetResourceHandle();
+ return(TRUE);
+ }
+ }
+
+ return FALSE;
+}
+
Modified: trunk/OpenMPT/mptrack/Ctrl_smp.cpp
===================================================================
--- trunk/OpenMPT/mptrack/Ctrl_smp.cpp 2008-05-10 13:27:55 UTC (rev 211)
+++ trunk/OpenMPT/mptrack/Ctrl_smp.cpp 2008-06-07 12:17:24 UTC (rev 212)
@@ -329,7 +329,7 @@
{
m_nSample = nSmp;
// 05/01/05 : ericus replaced "m_nSample << 24" by "m_nSample << 20" : 4000 samples -> 12bits [see Moddoc.h]
- UpdateView((m_nSample << 20) | HINT_SAMPLEINFO, NULL);
+ UpdateView((m_nSample << HINT_SHIFT_SMP) | HINT_SAMPLEINFO, NULL);
}
if (bUpdNum)
{
@@ -388,7 +388,7 @@
SetCurrentSample((lParam > 0) ? lParam : m_nSample);
// Initial Update
// 05/01/05 : ericus replaced "m_nSample << 24" by "m_nSample << 20" : 4000 samples -> 12bits [see Moddoc.h]
- if (!m_bInitialized) UpdateView((m_nSample << 20) | HINT_SAMPLEINFO | HINT_MODTYPE, NULL);
+ if (!m_bInitialized) UpdateView((m_nSample << HINT_SHIFT_SMP) | HINT_SAMPLEINFO | HINT_MODTYPE, NULL);
CChildFrame *pFrame = (CChildFrame *)GetParentFrame();
if ((pFrame) && (m_hWndView)) PostViewMessage(VIEWMSG_LOADSTATE, (LPARAM)pFrame->GetSampleViewState());
SwitchToView();
@@ -511,7 +511,8 @@
}
if (!(dwHintMask & (HINT_SAMPLEINFO|HINT_MODTYPE))) return;
// 05/01/05 : ericus replaced ">> 24" by ">> 20" : 4000 samples -> 12bits [see Moddoc.h]
- if (((dwHintMask >> 20) != (m_nSample&0x0fff)) && (!(dwHintMask & HINT_MODTYPE))) return;
+ //if (((dwHintMask >> 20) != (m_nSample&0x0fff)) && (!(dwHintMask & HINT_MODTYPE))) return;
+ if (((dwHintMask >> HINT_SHIFT_SMP) != m_nSample) && (!(dwHintMask & HINT_MODTYPE))) return;
LockControls();
if (!m_bInitialized) dwHintMask |= HINT_MODTYPE;
// Updating Ranges
@@ -773,7 +774,7 @@
pins->uFlags |= CHN_PANNING;
}
// 05/01/05 : ericus replaced "m_nSample << 24" by "m_nSample << 20" : 4000 samples -> 12bits [see Moddoc.h]
- m_pModDoc->UpdateAllViews(NULL, (m_nSample << 20) | HINT_SAMPLEDATA | HINT_SAMPLEINFO | HINT_SMPNAMES, NULL);
+ m_pModDoc->UpdateAllViews(NULL, (m_nSample << HINT_SHIFT_SMP) | HINT_SAMPLEDATA | HINT_SAMPLEINFO | HINT_SMPNAMES, NULL);
m_pModDoc->SetModified();
}
return TRUE;
@@ -802,7 +803,7 @@
}
END_CRITICAL();
// 05/01/05 : ericus replaced "m_nSample << 24" by "m_nSample << 20" : 4000 samples -> 12bits [see Moddoc.h]
- m_pModDoc->UpdateAllViews(NULL, (m_nSample << 20) | HINT_SAMPLEDATA | HINT_SAMPLEINFO | HINT_SMPNAMES, NULL);
+ m_pModDoc->UpdateAllViews(NULL, (m_nSample << HINT_SHIFT_SMP) | HINT_SAMPLEDATA | HINT_SAMPLEINFO | HINT_SMPNAMES, NULL);
m_pModDoc->SetModified();
EndWaitCursor();
return TRUE;
@@ -870,14 +871,14 @@
CSoundFile *pSndFile = m_pModDoc->GetSoundFile();
SetCurrentSample(smp);
// 05/01/05 : ericus replaced "m_nSample << 24" by "m_nSample << 20" : 4000 samples -> 12bits [see Moddoc.h]
- m_pModDoc->UpdateAllViews(NULL, (smp << 20) | HINT_SAMPLEINFO | HINT_SAMPLEDATA | HINT_SMPNAMES);
+ m_pModDoc->UpdateAllViews(NULL, (smp << HINT_SHIFT_SMP) | HINT_SAMPLEINFO | HINT_SAMPLEDATA | HINT_SMPNAMES);
if ((pSndFile->m_nInstruments) && (!m_pModDoc->FindSampleParent(smp)))
{
if (MessageBox("This sample is not used by any instrument. Do you want to create a new instrument using this sample ?",
NULL, MB_YESNO|MB_ICONQUESTION) == IDYES)
{
UINT nins = m_pModDoc->InsertInstrument(smp);
- m_pModDoc->UpdateAllViews(NULL, (nins << 24) | HINT_INSTRUMENT | HINT_INSNAMES | HINT_ENVELOPE);
+ m_pModDoc->UpdateAllViews(NULL, (nins << HINT_SHIFT_INS) | HINT_INSTRUMENT | HINT_INSNAMES | HINT_ENVELOPE);
m_pParent->InstrumentChanged(nins);
}
}
@@ -1065,7 +1066,7 @@
{
m_pModDoc->AdjustEndOfSample(m_nSample);
// 05/01/05 : ericus replaced "m_nSample << 24" by "m_nSample << 20" : 4000 samples -> 12bits [see Moddoc.h]
- m_pModDoc->UpdateAllViews(NULL, (m_nSample << 20) | HINT_SAMPLEDATA, NULL);
+ m_pModDoc->UpdateAllViews(NULL, (m_nSample << HINT_SHIFT_SMP) | HINT_SAMPLEDATA, NULL);
m_pModDoc->SetModified();
}
}
@@ -1132,7 +1133,7 @@
}
m_pModDoc->AdjustEndOfSample(m_nSample);
// 05/01/05 : ericus replaced "m_nSample << 24" by "m_nSample << 20" : 4000 samples -> 12bits [see Moddoc.h]
- m_pModDoc->UpdateAllViews(NULL, (m_nSample << 20) | HINT_SAMPLEDATA, NULL);
+ m_pModDoc->UpdateAllViews(NULL, (m_nSample << HINT_SHIFT_SMP) | HINT_SAMPLEDATA, NULL);
m_pModDoc->SetModified();
EndWaitCursor();
SwitchToView();
@@ -1282,7 +1283,7 @@
SendViewMessage(VIEWMSG_LOADSTATE, (LPARAM)&viewstate);
}
// 05/01/05 : ericus replaced "m_nSample << 24" by "m_nSample << 20" : 4000 samples -> 12bits [see Moddoc.h]
- m_pModDoc->UpdateAllViews(NULL, (m_nSample << 20) | HINT_SAMPLEDATA | HINT_SAMPLEINFO, NULL);
+ m_pModDoc->UpdateAllViews(NULL, (m_nSample << HINT_SHIFT_SMP) | HINT_SAMPLEDATA | HINT_SAMPLEINFO, NULL);
m_pModDoc->SetModified();
}
EndWaitCursor();
@@ -1407,7 +1408,7 @@
SendViewMessage(VIEWMSG_LOADSTATE, (LPARAM)&viewstate);
}
// 05/01/05 : ericus replaced "m_nSample << 24" by "m_nSample << 20" : 4000 samples -> 12bits [see Moddoc.h]
- m_pModDoc->UpdateAllViews(NULL, (m_nSample << 20) | HINT_SAMPLEDATA | HINT_SAMPLEINFO, NULL);
+ m_pModDoc->UpdateAllViews(NULL, (m_nSample << HINT_SHIFT_SMP) | HINT_SAMPLEDATA | HINT_SAMPLEINFO, NULL);
m_pModDoc->SetModified();
}
EndWaitCursor();
@@ -1566,7 +1567,7 @@
}
// Update sample view
- m_pModDoc->UpdateAllViews(NULL, (m_nSample << 20) | HINT_SAMPLEDATA | HINT_SAMPLEINFO, NULL); // !!!! see CODE#0006, update#3
+ m_pModDoc->UpdateAllViews(NULL, (m_nSample << HINT_SHIFT_SMP) | HINT_SAMPLEDATA | HINT_SAMPLEINFO, NULL); // !!!! see CODE#0006, update#3
m_pModDoc->SetModified();
}
@@ -1643,7 +1644,7 @@
OnPitchShiftTimeStretchAccept();
// Update sample view
- m_pModDoc->UpdateAllViews(NULL, (m_nSample << 20) | HINT_SAMPLEDATA | HINT_SAMPLEINFO, NULL); // !!!! see CODE#0006, update#3
+ m_pModDoc->UpdateAllViews(NULL, (m_nSample << HINT_SHIFT_SMP) | HINT_SAMPLEDATA | HINT_SAMPLEINFO, NULL); // !!!! see CODE#0006, update#3
m_pModDoc->SetModified();
}
@@ -2068,7 +2069,7 @@
}
m_pModDoc->AdjustEndOfSample(m_nSample);
// 05/01/05 : ericus replaced "m_nSample << 24" by "m_nSample << 20" : 4000 samples -> 12bits [see Moddoc.h]
- m_pModDoc->UpdateAllViews(NULL, (m_nSample << 20) | HINT_SAMPLEDATA, NULL);
+ m_pModDoc->UpdateAllViews(NULL, (m_nSample << HINT_SHIFT_SMP) | HINT_SAMPLEDATA, NULL);
m_pModDoc->SetModified();
}
EndWaitCursor();
@@ -2125,7 +2126,7 @@
}
m_pModDoc->AdjustEndOfSample(m_nSample);
// 05/01/05 : ericus replaced "m_nSample << 24" by "m_nSample << 20" : 4000 samples -> 12bits [see Moddoc.h]
- m_pModDoc->UpdateAllViews(NULL, (m_nSample << 20) | HINT_SAMPLEDATA, NULL);
+ m_pModDoc->UpdateAllViews(NULL, (m_nSample << HINT_SHIFT_SMP) | HINT_SAMPLEDATA, NULL);
m_pModDoc->SetModified();
}
EndWaitCursor();
@@ -2173,7 +2174,7 @@
{
memcpy(m_pSndFile->m_szNames[m_nSample], s, 32);
// 05/01/05 : ericus replaced "m_nSample << 24" by "m_nSample << 20" : 4000 samples -> 12bits [see Moddoc.h]
- m_pModDoc->UpdateAllViews(NULL, (m_nSample << 20) | (HINT_SMPNAMES|HINT_SAMPLEINFO), this);
+ m_pModDoc->UpdateAllViews(NULL, (m_nSample << HINT_SHIFT_SMP) | (HINT_SMPNAMES|HINT_SAMPLEINFO), this);
m_pModDoc->UpdateAllViews(NULL, HINT_INSNAMES, this);
m_pModDoc->SetModified();
}
@@ -2194,7 +2195,7 @@
{
memcpy(m_pSndFile->Ins[m_nSample].name, s, 22);
// 05/01/05 : ericus replaced "m_nSample << 24" by "m_nSample << 20" : 4000 samples -> 12bits [see Moddoc.h]
- m_pModDoc->UpdateAllViews(NULL, (m_nSample << 20) | HINT_SAMPLEINFO, this);
+ m_pModDoc->UpdateAllViews(NULL, (m_nSample << HINT_SHIFT_SMP) | HINT_SAMPLEINFO, this);
if (m_pSndFile->m_nType & (MOD_TYPE_S3M|MOD_TYPE_IT|MOD_TYPE_MPT)) m_pModDoc->SetModified();
}
}
@@ -2430,7 +2431,7 @@
pins->nLoopStart = n;
m_pModDoc->AdjustEndOfSample(m_nSample);
// 05/01/05 : ericus replaced "m_nSample << 24" by "m_nSample << 20" : 4000 samples -> 12bits [see Moddoc.h]
- m_pModDoc->UpdateAllViews(NULL, (m_nSample << 20) | HINT_SAMPLEDATA, this);
+ m_pModDoc->UpdateAllViews(NULL, (m_nSample << HINT_SHIFT_SMP) | HINT_SAMPLEDATA, this);
m_pModDoc->SetModified();
}
}
@@ -2447,7 +2448,7 @@
pins->nLoopEnd = n;
m_pModDoc->AdjustEndOfSample(m_nSample);
// 05/01/05 : ericus replaced "m_nSample << 24" by "m_nSample << 20" : 4000 samples -> 12bits [see Moddoc.h]
- m_pModDoc->UpdateAllViews(NULL, (m_nSample << 20) | HINT_SAMPLEDATA, this);
+ m_pModDoc->UpdateAllViews(NULL, (m_nSample << HINT_SHIFT_SMP) | HINT_SAMPLEDATA, this);
m_pModDoc->SetModified();
}
}
@@ -2487,7 +2488,7 @@
{
pins->nSustainStart = n;
// 05/01/05 : ericus replaced "m_nSample << 24" by "m_nSample << 20" : 4000 samples -> 12bits [see Moddoc.h]
- m_pModDoc->UpdateAllViews(NULL, (m_nSample << 20) | HINT_SAMPLEDATA, this);
+ m_pModDoc->UpdateAllViews(NULL, (m_nSample << HINT_SHIFT_SMP) | HINT_SAMPLEDATA, this);
m_pModDoc->SetModified();
}
}
@@ -2504,7 +2505,7 @@
{
pins->nSustainEnd = n;
// 05/01/05 : ericus replaced "m_nSample << 24" by "m_nSample << 20" : 4000 samples -> 12bits [see Moddoc.h]
- m_pModDoc->UpdateAllViews(NULL, (m_nSample << 20) | HINT_SAMPLEDATA, this);
+ m_pModDoc->UpdateAllViews(NULL, (m_nSample << HINT_SHIFT_SMP) | HINT_SAMPLEDATA, this);
m_pModDoc->SetModified();
}
}
@@ -2783,7 +2784,7 @@
if ((nCode == SB_ENDSCROLL) || (nCode == SB_THUMBPOSITION)) SwitchToView();
if (bRedraw) {
// 05/01/05 : ericus replaced "m_nSample << 24" by "m_nSample << 20" : 4000 samples -> 12bits [see Moddoc.h]
- m_pModDoc->UpdateAllViews(NULL, (m_nSample << 20) | HINT_SAMPLEDATA, this);
+ m_pModDoc->UpdateAllViews(NULL, (m_nSample << HINT_SHIFT_SMP) | HINT_SAMPLEDATA, this);
m_pModDoc->SetModified();
}
UnlockControls();
Modified: trunk/OpenMPT/mptrack/Draw_pat.cpp
===================================================================
--- trunk/OpenMPT/mptrack/Draw_pat.cpp 2008-05-10 13:27:55 UTC (rev 211)
+++ trunk/OpenMPT/mptrack/Draw_pat.cpp 2008-06-07 12:17:24 UTC (rev 212)
@@ -183,7 +183,10 @@
{
InvalidateChannelsHeaders();
}
- if (((dwHintMask & 0xFFFFFF) == HINT_PATTERNDATA) & (m_nPattern != (dwHintMask >> 24))) return;
+ //if (((dwHintMask & 0xFFFFFF) == HINT_PATTERNDATA) & (m_nPattern != (dwHintMask >> HINT_SHIFT_PAT))) return;
+ if ( (HintFlagPart(dwHintMask) == HINT_PATTERNDATA) && (m_nPattern != (dwHintMask >> HINT_SHIFT_PAT)) )
+ return;
+
if (dwHintMask & (HINT_MODTYPE|HINT_PATTERNDATA))
{
InvalidatePattern(FALSE);
@@ -193,7 +196,7 @@
// -> CODE#0008
// -> DESC"#define to set pattern max size (number of rows) limit (now set to 1024 instead of 256)"
// InvalidateRow(dwHintMask >> 24);
- InvalidateRow(dwHintMask >> 22);
+ InvalidateRow(dwHintMask >> HINT_SHIFT_ROW);
// -! BEHAVIOUR_CHANGE#0008
}
@@ -313,11 +316,11 @@
{
m_Dib.TextBlt(x, y, dx, COLUMN_HEIGHT, xsrc, ysrc);
} else
- if (note == 0xFE)
+ if (note == NOTE_NOTECUT)
{
m_Dib.TextBlt(x, y, dx, COLUMN_HEIGHT, xsrc, ysrc + 13*COLUMN_HEIGHT);
} else
- if (note >= 0xFF)
+ if (note >= NOTE_KEYOFF)
{
m_Dib.TextBlt(x, y, dx, COLUMN_HEIGHT, xsrc, ysrc + 14*COLUMN_HEIGHT);
} else
@@ -335,8 +338,11 @@
UINT o = (note-1) / 12; //Octave
UINT n = (note-1) % 12; //Note
m_Dib.TextBlt(x, y, pfnt->nNoteWidth, COLUMN_HEIGHT, xsrc, ysrc+(n+1)*COLUMN_HEIGHT);
- m_Dib.TextBlt(x+pfnt->nNoteWidth, y, pfnt->nOctaveWidth, COLUMN_HEIGHT,
- pfnt->nNumX, pfnt->nNumY+o*COLUMN_HEIGHT);
+ if(o <= 9)
+ m_Dib.TextBlt(x+pfnt->nNoteWidth, y, pfnt->nOctaveWidth, COLUMN_HEIGHT,
+ pfnt->nNumX, pfnt->nNumY+o*COLUMN_HEIGHT);
+ else
+ DrawLetter(x+pfnt->nNoteWidth, y, '?', pfnt->nOctaveWidth);
}
}
}
@@ -409,8 +415,8 @@
yofs = GetYScrollPos();
pSndFile = pModDoc->GetSoundFile();
nColumnWidth = m_szCell.cx;
- nrows = pSndFile->PatternSize[m_nPattern];
- ncols = pSndFile->m_nChannels;
+ nrows = (pSndFile->Patterns[m_nPattern]) ? pSndFile->PatternSize[m_nPattern] : 0;
+ ncols = pSndFile->GetNumChannels();
xpaint = m_szHeader.cx;
ypaint = rcClient.top;
ncolhdr = xofs;
@@ -783,7 +789,7 @@
{
tx_col = row_col;
bk_col = row_bkcol;
- if ((CMainFrame::m_dwPatternSetup & PATTERN_EFFECTHILIGHT) && (m->note) && (m->note <= 120))
+ if ((CMainFrame::m_dwPatternSetup & PATTERN_EFFECTHILIGHT) && (m->note) && (m->note <= NOTE_MAX))
{
tx_col = MODCOLOR_NOTE;
}
@@ -1393,7 +1399,7 @@
INSTRUMENTHEADER *penv = pSndFile->Headers[m->instr];
memcpy(sztmp, penv->name, 32);
sztmp[32] = 0;
- if ((m->note) && (m->note <= 120))
+ if ((m->note) && (m->note <= NOTE_MAX))
{
UINT nsmp = penv->Keyboard[m->note-1];
if ((nsmp) && (nsmp <= pSndFile->m_nSamples))
Modified: trunk/OpenMPT/mptrack/EffectVis.cpp
===================================================================
--- trunk/OpenMPT/mptrack/EffectVis.cpp 2008-05-10 13:27:55 UTC (rev 211)
+++ trunk/OpenMPT/mptrack/EffectVis.cpp 2008-06-07 12:17:24 UTC (rev 212)
@@ -617,7 +617,7 @@
MakeChange(m_nDragItem, paramValue);
m_pModDoc->SetModified();
- m_pModDoc->UpdateAllViews(NULL, HINT_PATTERNDATA | (m_nPattern << 24), NULL);
+ m_pModDoc->UpdateAllViews(NULL, HINT_PATTERNDATA | (m_nPattern << HINT_SHIFT_PAT), NULL);
}
else if ((m_dwStatus & FXVSTATUS_LDRAGGING))
{
@@ -652,7 +652,7 @@
m_nLastDrawnRow = row;
m_pModDoc->SetModified();
- m_pModDoc->UpdateAllViews(NULL, HINT_PATTERNDATA | (m_nPattern << 24), NULL);
+ m_pModDoc->UpdateAllViews(NULL, HINT_PATTERNDATA | (m_nPattern << HINT_SHIFT_PAT), NULL);
}
//update status bar
Modified: trunk/OpenMPT/mptrack/Moddoc.cpp
===================================================================
--- trunk/OpenMPT/mptrack/Moddoc.cpp 2008-05-10 13:27:55 UTC (rev 211)
+++ trunk/OpenMPT/mptrack/Moddoc.cpp 2008-06-07 12:17:24 UTC (rev 212)
@@ -372,14 +372,13 @@
BOOL CModDoc::OnSaveDocument(LPCTSTR lpszPathName)
//------------------------------------------------
{
-
static int greccount = 0;
- CHAR fext[_MAX_EXT]="";
+ TCHAR fext[_MAX_EXT]="";
UINT nType = m_SndFile.m_nType, dwPacking = 0;
BOOL bOk = FALSE;
m_SndFile.m_dwLastSavedWithVersion = CMainFrame::GetFullVersionNumeric();
if (!lpszPathName) return FALSE;
- _splitpath(lpszPathName, NULL, NULL, NULL, fext);
+ _tsplitpath(lpszPathName, NULL, NULL, NULL, fext);
if (!lstrcmpi(fext, ".mod")) nType = MOD_TYPE_MOD; else
if (!lstrcmpi(fext, ".s3m")) nType = MOD_TYPE_S3M; else
if (!lstrcmpi(fext, ".xm")) nType = MOD_TYPE_XM; else
@@ -421,6 +420,7 @@
// -> CODE#0023
// -> DESC="IT project files (.itp)"
BOOL CModDoc::SaveModified()
+//--------------------------
{
if((m_SndFile.m_nType & MOD_TYPE_IT) && m_SndFile.m_dwSongFlags & SONG_ITPROJECT && !(m_SndFile.m_dwSongFlags & SONG_ITPEMBEDIH)){
@@ -435,8 +435,8 @@
for(UINT i = 0 ; i < m_SndFile.m_nInstruments ; i++){
if(m_SndFile.m_szInstrumentPath[i][0] != '\0'){
int size = strlen(m_SndFile.m_szInstrumentPath[i]);
- BOOL iti = stricmp(&m_SndFile.m_szInstrumentPath[i][size-3],"iti") == 0;
- BOOL xi = stricmp(&m_SndFile.m_szInstrumentPath[i][size-2],"xi") == 0;
+ BOOL iti = _stricmp(&m_SndFile.m_szInstrumentPath[i][size-3],"iti") == 0;
+ BOOL xi = _stricmp(&m_SndFile.m_szInstrumentPath[i][size-2],"xi") == 0;
if(iti || (!iti && !xi && m_SndFile.m_nType & (MOD_TYPE_IT|MOD_TYPE_MPT)))
m_SndFile.SaveITIInstrument(i+1, m_SndFile.m_szInstrumentPath[i]);
@@ -1247,7 +1247,7 @@
penv = m_SndFile.Headers[nIns];
if (penv)
{
- for (UINT i=0; i<120; i++)
+ for (UINT i=0; i<NOTE_MAX; i++)
{
if (penv->Keyboard[i] == nSmp) return TRUE;
}
@@ -1265,7 +1265,7 @@
INSTRUMENTHEADER *penv = m_SndFile.Headers[i];
if (penv)
{
- for (UINT j=0; j<120; j++)
+ for (UINT j=0; j<NOTE_MAX; j++)
{
if (penv->Keyboard[j] == nSmp) return i;
}
@@ -1283,7 +1283,7 @@
penv = m_SndFile.Headers[nIns];
if (penv)
{
- for (UINT i=0; i<120; i++)
+ for (UINT i=0; i<NOTE_MAX; i++)
{
UINT n = penv->Keyboard[i];
if ((n) && (n <= m_SndFile.m_nSamples)) return n;
Modified: trunk/OpenMPT/mptrack/Moddoc.h
===================================================================
--- trunk/OpenMPT/mptrack/Moddoc.h 2008-05-10 13:27:55 UTC (rev 211)
+++ trunk/OpenMPT/mptrack/Moddoc.h 2008-06-07 12:17:24 UTC (rev 212)
@@ -10,11 +10,8 @@
#endif // _MSC_VER >= 1000
#include "sndfile.h"
+#include "misc_util.h"
-// C-5
-#define NOTE_MIDDLEC (5*12+1)
-#define NOTE_KEYOFF 0xFF
-#define NOTE_NOTECUT 0xFE
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
@@ -39,6 +36,19 @@
#define HINT_UNDO 0x10000
#define HINT_MIXPLUGINS 0x20000
#define HINT_SPEEDCHANGE 0x40000 //rewbs.envRowGrid
+#define HINT_MAXHINTFLAG HINT_SPEEDCHANGE
+//Bits 0-18 are reserved.
+#define HINT_MASK_FLAGS (2*HINT_MAXHINTFLAG - 1) //When applied to hint parameter, should give the flag part.
+#define HINT_MASK_ITEM (~HINT_MASK_FLAGS) //To nullify update hintbits from hint parameter.
+#define HintFlagPart(x) ((x) & HINT_MASK_FLAGS)
+
+//If fails, hint flagbits|itembits does not enable all bits;
+//might be worthwhile to check the reason.
+STATIC_ASSERT( (HINT_MASK_ITEM | HINT_MASK_FLAGS) == -1 );
+
+//If fails, hint param flag and item parts overlap; might be a problem.
+STATIC_ASSERT( (HINT_MASK_ITEM & HINT_MASK_FLAGS) == 0 );
+
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
// NOTE : be carefull when adding new flags !!!
// -------------------------------------------------------------------------------------------------------------------------
@@ -50,6 +60,32 @@
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
+
+//Updateview hints can, in addition to the actual hints, contain
+//addition data such as pattern or instrument index. The
+//values below define the number of bits used for these.
+#define HINT_BITS_PATTERN 12
+#define HINT_BITS_ROWS 10
+#define HINT_BITS_SAMPLE 12
+#define HINT_BITS_INST 8
+#define HINT_BITS_CHNTAB 8
+
+//Defines bit shift values used for setting/retrieving the additional hint data to/from hint parameter.
+#define HINT_SHIFT_PAT (32 - HINT_BITS_PATTERN)
+#define HINT_SHIFT_ROW (32 - HINT_BITS_ROWS)
+#define HINT_SHIFT_SMP (32 - HINT_BITS_SAMPLE)
+#define HINT_SHIFT_INS (32 - HINT_BITS_INST)
+#define HINT_SHIFT_CHNTAB (32 - HINT_BITS_CHNTAB)
+
+//Check that hint bit counts are not too large given the number of hint flags.
+STATIC_ASSERT( ((-1 << HINT_SHIFT_PAT) & HINT_MASK_ITEM) == (-1 << HINT_SHIFT_PAT) );
+STATIC_ASSERT( ((-1 << HINT_SHIFT_ROW) & HINT_MASK_ITEM) == (-1 << HINT_SHIFT_ROW) );
+STATIC_ASSERT( ((-1 << HINT_SHIFT_SMP) & HINT_MASK_ITEM) == (-1 << HINT_SHIFT_SMP) );
+STATIC_ASSERT( ((-1 << HINT_SHIFT_INS) & HINT_MASK_ITEM) == (-1 << HINT_SHIFT_INS) );
+STATIC_ASSERT( ((-1 << HINT_SHIFT_CHNTAB) & HINT_MASK_ITEM) == (-1 << HINT_SHIFT_CHNTAB) );
+
+
+
// Undo
#define MAX_UNDO_LEVEL 100
Modified: trunk/OpenMPT/mptrack/Modedit.cpp
===================================================================
--- trunk/OpenMPT/mptrack/Modedit.cpp 2008-05-10 13:27:55 UTC (rev 211)
+++ trunk/OpenMPT/mptrack/Modedit.cpp 2008-06-07 12:17:24 UTC (rev 212)
@@ -8,15 +8,18 @@
#include "dlg_misc.h"
#include "dlsbank.h"
-#pragma warning(disable:4244)
+#pragma warning(disable:4244) //"conversion from 'type1' to 'type2', possible loss of data"
+
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
+#define str_mptm_conversion_warning GetStrI18N(_TEXT("Conversion from mptm to any other moduletype may makes certain features unavailable and is not guaranteed to work properly. Do the conversion anyway?"))
+
//////////////////////////////////////////////////////////////////////
// Module type conversion
@@ -52,9 +55,36 @@
if(oldTypeIsMPT)
{
- if(::MessageBox(NULL, "Convertion from MPTm to any other modtype makes certain features unavailable and is not guaranteed to work properly; Do the convertion anyway?",
- "Notice", MB_YESNO) != IDYES)
+ if(::MessageBox(NULL, str_mptm_conversion_warning, 0, MB_YESNO) != IDYES)
return FALSE;
+
+ /*
+ Incomplete list of MPTm-only features and extensions in the old formats:
+
+ Features only available for MPTm:
+ -User definable tunings.
+ -Extended pattern range
+ -Extended sequence
+
+ Extended features in IT/XM/S3M/MOD(not all listed below are available in all of those formats):
+ -plugs
+ -Extended ranges for
+ -sample count
+ -instrument count
+ -pattern count
+ -sequence size
+ -Row count
+ -channel count
+ -tempo limits
+ -Extended sample/instrument properties.
+ -MIDI mapping directives
+ -Versioninfo
+ -channel names
+ -pattern names
+ -Alternative tempomodes
+ -For more info, see e.g. SaveExtendedSongProperties(), SaveExtendedInstrumentProperties()
+ */
+
}
// Check if conversion to 64 rows is necessary
@@ -270,7 +300,7 @@
INSTRUMENTHEADER *penv = m_SndFile.Headers[j];
if (penv)
{
- for (UINT k=0; k<120; k++)
+ for (UINT k=0; k<NOTE_MAX; k++)
{
if ((penv->NoteMap[k]) && (penv->NoteMap[k] != (BYTE)(k+1)))
{
@@ -665,7 +695,7 @@
UINT jmax = m_SndFile.PatternSize[ipat] * m_SndFile.m_nChannels;
for (UINT j=0; j<jmax; j++, p++)
{
- if ((p->note) && (p->note <= 120))
+ if ((p->note) && (p->note <= NOTE_MAX))
{
if ((p->instr) && (p->instr < MAX_INSTRUMENTS))
{
@@ -1460,8 +1490,8 @@
switch(note)
{
case 0: p[1] = p[2] = p[3] = '.'; break;
- case 0xFF: p[1] = p[2] = p[3] = '='; break;
- case 0xFE: p[1] = p[2] = p[3] = '^'; break;
+ case NOTE_KEYOFF: p[1] = p[2] = p[3] = '='; break;
+ case NOTE_NOTECUT: p[1] = p[2] = p[3] = '^'; break;
default:
p[1] = szNoteNames[(note-1) % 12][0];
p[2] = szNoteNames[(note-1) % 12][1];
@@ -1604,8 +1634,8 @@
(ITStyleMix && origModCmd.note==0 && origModCmd.instr==0 && origModCmd.volcmd==0))))
{
m[col].note = 0;
- if (s[0] == '=') m[col].note = 0xFF; else
- if (s[0] == '^') m[col].note = 0xFE; else
+ if (s[0] == '=') m[col].note = NOTE_KEYOFF; else
+ if (s[0] == '^') m[col].note = NOTE_NOTECUT; else
if (s[0] != '.')
{
for (UINT i=0; i<12; i++)
@@ -1710,7 +1740,7 @@
if (bOk)
{
SetModified();
- UpdateAllViews(NULL, HINT_PATTERNDATA | (nPattern << 24), NULL);
+ UpdateAllViews(NULL, HINT_PATTERNDATA | (nPattern << HINT_SHIFT_PAT), NULL);
}
}
CloseClipboard();
@@ -1831,7 +1861,7 @@
INSTRUMENTHEADER *penv = m_SndFile.Headers[nIns];
UINT susBegin=0, susEnd=0, loopBegin=0, loopEnd=0, bSus=0, bLoop=0, bCarry=0, nPoints=0, releaseNode = ENV_RELEASE_NODE_UNSET;
DWORD dwMemSize = GlobalSize(hCpy), dwPos = strlen(pszEnvHdr);
- if ((dwMemSize > dwPos) && (!strnicmp(p, pszEnvHdr, dwPos-2)))
+ if ((dwMemSize > dwPos) && (!_strnicmp(p, pszEnvHdr, dwPos-2)))
{
for (UINT h=0; h<8; h++)
{
@@ -1947,7 +1977,7 @@
GlobalUnlock(hCpy);
CloseClipboard();
SetModified();
- UpdateAllViews(NULL, (nIns << 24) | HINT_ENVELOPE, NULL);
+ UpdateAllViews(NULL, (nIns << HINT_SHIFT_INS) | HINT_ENVELOPE, NULL);
}
EndWaitCursor();
return TRUE;
Modified: trunk/OpenMPT/mptrack/Mpdlgs.cpp
===================================================================
--- trunk/OpenMPT/mptrack/Mpdlgs.cpp 2008-05-10 13:27:55 UTC (rev 211)
+++ trunk/OpenMPT/mptrack/Mpdlgs.cpp 2008-06-07 12:17:24 UTC (rev 212)
@@ -7,9 +7,12 @@
#include "moptions.h"
#include "moddoc.h"
#include "snddev.h"
+#include ".\mpdlgs.h"
-#pragma warning(disable:4244)
+#define str_preampChangeNote GetStrI18N(_TEXT("Note: Pre-Amp setting affects sample volume only. Changing this setting may cause undesired effects on volume balance between sample based instruments and plugin instrument."))
+//#pragma warning(disable:4244) //"conversion from 'type1' to 'type2', possible loss of data"
+
LPCSTR szCPUNames[8] =
{
"133MHz",
@@ -165,11 +168,9 @@
}
// Pre-Amplification
{
- int n = (CMainFrame::m_nPreAmp - 64) / 8;
- if ((n < 0) || (n > 40)) n = 16;
m_SliderPreAmp.SetTicFreq(5);
m_SliderPreAmp.SetRange(0, 40);
- m_SliderPreAmp.SetPos(40 - n);
+ SetPreAmpSliderPosition();
}
// Sound Device
{
@@ -255,18 +256,36 @@
}
+void COptionsSoundcard::SetPreAmpSliderPosition()
+//-----------------------------------------------
+{
+ int n = (CMainFrame::m_nPreAmp - 64) / 8;
+ if ((n < 0) || (n > 40)) n = 16;
+ m_SliderPreAmp.SetPos(40 - n);
+}
+
+
void COptionsSoundcard::OnVScroll(UINT n, UINT pos, CScrollBar *p)
//----------------------------------------------------------------
{
CPropertyPage::OnVScroll(n, pos, p);
// PreAmp
{
- int n = 40 - m_SliderPreAmp.GetPos();
- if ((n >= 0) && (n <= 40)) // approximately +/- 10dB
+ if(m_PreAmpNoteShowed == true)
{
- CMainFrame *pMainFrm = CMainFrame::GetMainFrame();
- if (pMainFrm) pMainFrm->SetPreAmp(64 + (n * 8));
+ int n = 40 - m_SliderPreAmp.GetPos();
+ if ((n >= 0) && (n <= 40)) // approximately +/- 10dB
+ {
+ CMainFrame *pMainFrm = CMainFrame::GetMainFrame();
+ if (pMainFrm) pMainFrm->SetPreAmp(64 + (n * 8));
+ }
}
+ else
+ {
+ m_PreAmpNoteShowed = true;
+ MessageBox(str_preampChangeNote, _TEXT(""), MB_ICONINFORMATION);
+ SetPreAmpSliderPosition();
+ }
}
}
@@ -464,7 +483,7 @@
//rewbs.resamplerConf
OnResamplerChanged();
char s[20] = "";
- ltoa(CMainFrame::glVolumeRampSamples,s, 10);
+ _ltoa(CMainFrame::glVolumeRampSamples,s, 10);
m_CEditRamping.SetWindowText(s);
//end rewbs.resamplerConf
return TRUE;
@@ -499,7 +518,7 @@
//rewbs.resamplerConf
void COptionsPlayer::OnWFIRTypeChanged()
{
- CMainFrame::gbWFIRType = m_CbnWFIRType.GetCurSel();
+ CMainFrame::gbWFIRType = static_cast<BYTE>(m_CbnWFIRType.GetCurSel());
OnSettingsChanged();
}
@@ -1150,5 +1169,3 @@
return CPropertyPage::OnSetActive();
}
-
-
Modified: trunk/OpenMPT/mptrack/Mpdlgs.h
===================================================================
--- trunk/OpenMPT/mptrack/Mpdlgs.h 2008-05-10 13:27:55 UTC (rev 211)
+++ trunk/OpenMPT/mptrack/Mpdlgs.h 2008-06-07 12:17:24 UTC (rev 212)
@@ -17,11 +17,16 @@
DWORD m_dwRate, m_dwSoundSetup, m_nBitsPerSample, m_nChannels;
DWORD m_nBufferLength;
DWORD m_nSoundDevice;
+ bool m_PreAmpNoteShowed;
public:
COptionsSoundcard(DWORD rate, DWORD q, DWORD bits, DWORD chns, DWORD bufsize, DWORD sd):CPropertyPage(IDD_OPTIONS_SOUNDCARD)
- { m_dwRate = rate; m_dwSoundSetup = q; m_nBitsPerSample = bits; m_nChannels = chns; m_nBufferLength = bufsize; m_nSoundDevice = sd; }
+ { m_dwRate = rate; m_dwSoundSetup = q; m_nBitsPerSample = bits; m_nChannels = chns;
+ m_nBufferLength = bufsize; m_nSoundDevice = sd; m_PreAmpNoteShowed = false;}
+private:
+ void SetPreAmpSliderPosition();
+
protected:
virtual BOOL OnInitDialog();
virtual void OnOK();
Modified: trunk/OpenMPT/mptrack/Mptrack.cpp
===================================================================
--- trunk/OpenMPT/mptrack/Mptrack.cpp 2008-05-10 13:27:55 UTC (rev 211)
+++ trunk/OpenMPT/mptrack/Mptrack.cpp 2008-06-07 12:17:24 UTC (rev 212)
@@ -632,11 +632,13 @@
// Initialize OLE MFC support
AfxOleInit();
// Standard initialization
+/*
#ifdef _AFXDLL
Enable3dControls(); // Call this when using MFC in a shared DLL
#else
Enable3dControlsStatic(); // Call this when linking to MFC statically
#endif
+*/
// Change the registry key under which our settings are stored.
//SetRegistryKey(_T("Olivier Lapicque"));
Modified: trunk/OpenMPT/mptrack/Stdafx.h
===================================================================
--- trunk/OpenMPT/mptrack/Stdafx.h 2008-05-10 13:27:55 UTC (rev 211)
+++ trunk/OpenMPT/mptrack/Stdafx.h 2008-06-07 12:17:24 UTC (rev 212)
@@ -78,6 +78,9 @@
#define VERSIONNUMBER(v1, v2, v3, v4) ((v1 << 24) + (v2 << 16) + (v3 << 8) + v4)
+//To mark string that should be translated in case of multilingual version.
+#define GetStrI18N(x) (x)
+
//{{AFX_INSERT_LOCATION}}
// Microsoft Developer Studio will insert additional declarations immediately before the previous line.
Modified: trunk/OpenMPT/mptrack/View_gen.cpp
===================================================================
--- trunk/OpenMPT/mptrack/View_gen.cpp 2008-05-10 13:27:55 UTC (rev 211)
+++ trunk/OpenMPT/mptrack/View_gen.cpp 2008-06-07 12:17:24 UTC (rev 212)
@@ -283,7 +283,7 @@
void CViewGlobals::OnUpdate(CView* pView, LPARAM lHint, CObject*pHint)
//--------------------------------------------------------------------
{
- if (((lHint & 0xFFFF) == HINT_MODCHANNELS) && ((lHint >> 24) != m_nActiveTab)) return;
+ if ((HintFlagPart(lHint) == HINT_MODCHANNELS) && ((lHint >> HINT_SHIFT_CHNTAB) != m_nActiveTab)) return;
if (pView != this) UpdateView(lHint, pHint);
}
@@ -329,7 +329,6 @@
}
if (nOldSel >= (UINT)nTabCount) nOldSel = 0;
- //Changing the order of these calls seemed to fix a GUI bug (http://lpchip.com/modplug/viewtopic.php?t=1324)
m_TabCtrl.SetRedraw(TRUE);
m_TabCtrl.SetCurSel(nOldSel);
@@ -560,263 +559,90 @@
if (pResult) *pResult = 0;
}
-
-void CViewGlobals::OnMute1()
-//--------------------------
+void CViewGlobals::OnMute(const CHANNELINDEX chnMod4, const UINT itemID)
+//---------------------------------------------------------
{
CModDoc *pModDoc = GetDocument();
- BOOL b = (IsDlgButtonChecked(IDC_CHECK1)) ? TRUE : FALSE;
- UINT nChn = m_nActiveTab * 4;
if (pModDoc)
{
+ const BOOL b = (IsDlgButtonChecked(itemID)) ? TRUE : FALSE;
+ const UINT nChn = m_nActiveTab * 4 + chnMod4;
pModDoc->MuteChannel(nChn, b);
- pModDoc->UpdateAllViews(this, HINT_MODCHANNELS | (m_nActiveTab << 24));
+ pModDoc->UpdateAllViews(this, HINT_MODCHANNELS | (m_nActiveTab << HINT_SHIFT_CHNTAB));
}
}
+void CViewGlobals::OnMute1() {OnMute(0, IDC_CHECK1);}
+void CViewGlobals::OnMute2() {OnMute(1, IDC_CHECK3);}
+void CViewGlobals::OnMute3() {OnMute(2, IDC_CHECK5);}
+void CViewGlobals::OnMute4() {OnMute(3, IDC_CHECK7);}
-void CViewGlobals::OnMute2()
-//--------------------------
-{
- CModDoc *pModDoc = GetDocument();
- BOOL b = (IsDlgButtonChecked(IDC_CHECK3)) ? TRUE : FALSE;
- UINT nChn = m_nActiveTab * 4 + 1;
-
- if (pModDoc)
- {
- pModDoc->MuteChannel(nChn, b);
- pModDoc->UpdateAllViews(this, HINT_MODCHANNELS | (m_nActiveTab << 24));
- }
-}
-
-void CViewGlobals::OnMute3()
-//--------------------------
+void CViewGlobals::OnSurround(const CHANNELINDEX chnMod4, const UINT itemID)
+//--------------------------------------------------------------
{
CModDoc *pModDoc = GetDocument();
- BOOL b = (IsDlgButtonChecked(IDC_CHECK5)) ? TRUE : FALSE;
- UINT nChn = m_nActiveTab * 4 + 2;
if (pModDoc)
{
- pModDoc->MuteChannel(nChn, b);
- pModDoc->UpdateAllViews(this, HINT_MODCHANNELS | (m_nActiveTab << 24));
- }
-}
-
-
-void CViewGlobals::OnMute4()
-//--------------------------
-{
- CModDoc *pModDoc = GetDocument();
- BOOL b = (IsDlgButtonChecked(IDC_CHECK7)) ? TRUE : FALSE;
- UINT nChn = m_nActiveTab * 4 + 3;
-
- if (pModDoc)
- {
- pModDoc->MuteChannel(nChn, b);
- pModDoc->UpdateAllViews(this, HINT_MODCHANNELS | (m_nActiveTab << 24));
- }
-}
-
-
-void CViewGlobals::OnSurround1()
-//------------------------------
-{
- CModDoc *pModDoc = GetDocument();
- BOOL b = (IsDlgButtonChecked(IDC_CHECK2)) ? TRUE : FALSE;
- UINT nChn = m_nActiveTab * 4;
-
- if (pModDoc)
- {
+ const BOOL b = (IsDlgButtonChecked(itemID)) ? TRUE : FALSE;
+ const UINT nChn = m_nActiveTab * 4 + chnMod4;
pModDoc->SurroundChannel(nChn, b);
- pModDoc->UpdateAllViews(this, HINT_MODCHANNELS | (m_nActiveTab << 24));
+ pModDoc->UpdateAllViews(this, HINT_MODCHANNELS | (m_nActiveTab << HINT_SHIFT_CHNTAB));
}
}
+void CViewGlobals::OnSurround1() {OnSurround(0, IDC_CHECK2);}
+void CViewGlobals::OnSurround2() {OnSurround(1, IDC_CHECK4);}
+void CViewGlobals::OnSurround3() {OnSurround(2, IDC_CHECK6);}
+void CViewGlobals::OnSurround4() {OnSurround(3, IDC_CHECK8);}
-void CViewGlobals::OnSurround2()
-//------------------------------
+void CViewGlobals::OnEditVol(const CHANNELINDEX chnMod4, const UINT itemID)
+//------------------------------------------------------------
{
CModDoc *pModDoc = GetDocument();
- BOOL b = (IsDlgButtonChecked(IDC_CHECK4)) ? TRUE : FALSE;
- UINT nChn = m_nActiveTab * 4 + 1;
-
- if (pModDoc)
- {
- pModDoc->SurroundChannel(nChn, b);
- pModDoc->UpdateAllViews(this, HINT_MODCHANNELS | (m_nActiveTab << 24));
- }
-}
-
-
-void CViewGlobals::OnSurround3()
-//------------------------------
-{
- CModDoc *pModDoc = GetDocument();
- BOOL b = (IsDlgButtonChecked(IDC_CHECK6)) ? TRUE : FALSE;
- UINT nChn = m_nActiveTab * 4 + 2;
-
- if (pModDoc)
- {
- pModDoc->SurroundChannel(nChn, b);
- pModDoc->UpdateAllViews(this, HINT_MODCHANNELS | (m_nActiveTab << 24));
- }
-}
-
-
-void CViewGlobals::OnSurround4()
-//------------------------------
-{
- CModDoc *pModDoc = GetDocument();
- BOOL b = (IsDlgButtonChecked(IDC_CHECK8)) ? TRUE : FALSE;
- UINT nChn = m_nActiveTab * 4 + 3;
-
- if (pModDoc)
- {
- pModDoc->SurroundChannel(nChn, b);
- pModDoc->UpdateAllViews(this, HINT_MODCHANNELS | (m_nActiveTab << 24));
- }
-}
-
-
-void CViewGlobals::OnEditVol1()
-//-----------------------------
-{
- CModDoc *pModDoc = GetDocument();
- UINT nChn = m_nActiveTab * 4;
- int vol = GetDlgItemIntEx(IDC_EDIT1);
+ const UINT nChn = m_nActiveTab * 4 + chnMod4;
+ const int vol = GetDlgItemIntEx(itemID);
if ((pModDoc) && (vol >= 0) && (vol <= 64) && (!m_nLockCount))
{
if (pModDoc->SetChannelGlobalVolume(nChn, vol))
{
- m_sbVolume[0].SetPos(vol);
- pModDoc->UpdateAllViews(this, HINT_MODCHANNELS | (m_nActiveTab << 24));
+ m_sbVolume[chnMod4].SetPos(vol);
+ pModDoc->UpdateAllViews(this, HINT_MODCHANNELS | (m_nActiveTab << HINT_SHIFT_CHNTAB));
}
}
}
+void CViewGlobals::OnEditVol1() {OnEditVol(0, IDC_EDIT1);}
+void CViewGlobals::OnEditVol2() {OnEditVol(1, IDC_EDIT3);}
+void CViewGlobals::OnEditVol3() {OnEditVol(2, IDC_EDIT5);}
+void CViewGlobals::OnEditVol4() {OnEditVol(3, IDC_EDIT7);}
-void CViewGlobals::OnEditVol2()
-//-----------------------------
-{
- CModDoc *pModDoc = GetDocument();
- UINT nChn = m_nActiveTab * 4 + 1;
- int vol = GetDlgItemIntEx(IDC_EDIT3);
- if ((pModDoc) && (vol >= 0) && (vol <= 64) && (!m_nLockCount))
- {
- if (pModDoc->SetChannelGlobalVolume(nChn, vol))
- {
- m_sbVolume[1].SetPos(vol);
- pModDoc->UpdateAllViews(this, HINT_MODCHANNELS | (m_nActiveTab << 24));
- }
- }
-}
-
-void CViewGlobals::OnEditVol3()
-//-----------------------------
+void CViewGlobals::OnEditPan(const CHANNELINDEX chnMod4, const UINT itemID)
+//--------------------------------------------------------
{
CModDoc *pModDoc = GetDocument();
- UINT nChn = m_nActiveTab * 4 + 2;
- int vol = GetDlgItemIntEx(IDC_EDIT5);
- if ((pModDoc) && (vol >= 0) && (vol <= 64) && (!m_nLockCount))
- {
- if (pModDoc->SetChannelGlobalVolume(nChn, vol))
- {
- m_sbVolume[2].SetPos(vol);
- pModDoc->UpdateAllViews(this, HINT_MODCHANNELS | (m_nActiveTab << 24));
- }
- }
-}
-
-
-void CViewGlobals::OnEditVol4()
-//-----------------------------
-{
- CModDoc *pModDoc = GetDocument();
- UINT nChn = m_nActiveTab * 4 + 3;
- int vol = GetDlgItemIntEx(IDC_EDIT7);
- if ((pModDoc) && (vol >= 0) && (vol <= 64) && (!m_nLockCount))
- {
- if (pModDoc->SetChannelGlobalVolume(nChn, vol))
- {
- m_sbVolume[3].SetPos(vol);
- pModDoc->UpdateAllViews(this, HINT_MODCHANNELS | (m_nActiveTab << 24));
- }
- }
-}
-
-
-void CViewGlobals::OnEditPan1()
-//-----------------------------
-{
- CModDoc *pModDoc = GetDocument();
- UINT nChn = m_nActiveTab * 4;
- int pan = GetDlgItemIntEx(IDC_EDIT2);
+ const UINT nChn = m_nActiveTab * 4 + chnMod4;
+ const int pan = GetDlgItemIntEx(itemID);
if ((pModDoc) && (pan >= 0) && (pan <= 256) && (!m_nLockCount))
{
if (pModDoc->SetChannelDefaultPan(nChn, pan))
{
- m_sbPan[0].SetPos(pan/4);
- pModDoc->UpdateAllViews(this, HINT_MODCHANNELS | (m_nActiveTab << 24));
+ m_sbPan[chnMod4].SetPos(pan/4);
+ pModDoc->UpdateAllViews(this, HINT_MODCHANNELS | (m_nActiveTab << HINT_SHIFT_CHNTAB));
}
}
}
-void CViewGlobals::OnEditPan2()
-//-----------------------------
-{
- CModDoc *pModDoc = GetDocument();
- UINT nChn = m_nActiveTab * 4 + 1;
- int pan = GetDlgItemIntEx(IDC_EDIT4);
- if ((pModDoc) && (pan >= 0) && (pan <= 256) && (!m_nLockCount))
- {
- if (pModDoc->SetChannelDefaultPan(nChn, pan))
- {
- m_sbPan[1].SetPos(pan/4);
- pModDoc->UpdateAllViews(this, HINT_MODCHANNELS | (m_nActiveTab << 24));
- }
- }
-}
+void CViewGlobals::OnEditPan1() {OnEditPan(0, IDC_EDIT2);}
+void CViewGlobals::OnEditPan2() {OnEditPan(1, IDC_EDIT4);}
+void CViewGlobals::OnEditPan3() {OnEditPan(2, IDC_EDIT6);}
+void CViewGlobals::OnEditPan4() {OnEditPan(3, IDC_EDIT8);}
-void CViewGlobals::OnEditPan3()
-//-----------------------------
-{
- CModDoc *pModDoc = GetDocument();
- UINT nChn = m_nActiveTab * 4 + 2;
- int pan = GetDlgItemIntEx(IDC_EDIT6);
- if ((pModDoc) && (pan >= 0) && (pan <= 256) && (!m_nLockCount))
- {
- if (pModDoc->SetChannelDefaultPan(nChn, pan))
- {
- m_sbPan[2].SetPos(pan/4);
- pModDoc->UpdateAllViews(this, HINT_MODCHANNELS | (m_nActiveTab << 24));
- }
- }
-}
-
-
-void CViewGlobals::OnEditPan4()
-//-----------------------------
-{
- CModDoc *pModDoc = GetDocument();
- UINT nChn = m_nActiveTab * 4 + 3;
- int pan = GetDlgItemIntEx(IDC_EDIT8);
- if ((pModDoc) && (pan >= 0) && (pan <= 256) && (!m_nLockCount))
- {
- if (pModDoc->SetChannelDefaultPan(nChn, pan))
- {
- m_sbPan[3].SetPos(pan/4);
- pModDoc->UpdateAllViews(this, HINT_MODCHANNELS | (m_nActiveTab << 24));
- }
- }
-}
-
-
void CViewGlobals::OnHScroll(UINT nSBCode, UINT nPos, CScrollBar* pScrollBar)
//---------------------------------------------------------------------------
{
@@ -880,7 +706,7 @@
}
//end rewbs.dryRatio
- if (bUpdate) pModDoc->UpdateAllViews(this, HINT_MODCHANNELS | (m_nActiveTab << 24));
+ if (bUpdate) pModDoc->UpdateAllViews(this, HINT_MODCHANNELS | (m_nActiveTab << HINT_SHIFT_CHNTAB));
UnlockControls();
if ((pScrollBar) && (pScrollBar->m_hWnd == m_sbValue.m_hWnd))
@@ -952,8 +778,8 @@
}
-void CViewGlobals::OnEditName1()
-//------------------------------
+void CViewGlobals::OnEditName(const CHANNELINDEX chnMod4, const UINT itemID)
+//----------------------------------------------------------------------
{
CModDoc *pModDoc = GetDocument();
@@ -961,181 +787,53 @@
{
CSoundFile *pSndFile = pModDoc->GetSoundFile();
CHAR s[MAX_CHANNELNAME+4];
- UINT nChn = m_nActiveTab * 4;
+ const UINT nChn = m_nActiveTab * 4 + chnMod4;
memset(s, 0, sizeof(s));
- GetDlgItemText(IDC_EDIT9, s, sizeof(s));
+ GetDlgItemText(itemID, s, sizeof(s));
s[MAX_CHANNELNAME+1] = 0;
if ((pSndFile->m_nType & (MOD_TYPE_XM|MOD_TYPE_IT|MOD_TYPE_MPT)) && (nChn < pSndFile->m_nChannels) && (strncmp(s, pSndFile->ChnSettings[nChn].szName, MAX_CHANNELNAME)))
{
memcpy(pSndFile->ChnSettings[nChn].szName, s, MAX_CHANNELNAME);
pSndFile->ChnSettings[nChn].szName[ARRAYELEMCOUNT(pSndFile->ChnSettings[nChn].szName)-1] = 0;
pModDoc->SetModified();
- pModDoc->UpdateAllViews(this, HINT_MODCHANNELS | (m_nActiveTab << 24));
+ pModDoc->UpdateAllViews(this, HINT_MODCHANNELS | (m_nActiveTab << HINT_SHIFT_CHNTAB));
}
}
}
+void CViewGlobals::OnEditName1() {OnEditName(0, IDC_EDIT9);}
+void CViewGlobals::OnEditName2() {OnEditName(1, IDC_EDIT10);}
+void CViewGlobals::OnEditName3() {OnEditName(2, IDC_EDIT11);}
+void CViewGlobals::OnEditName4() {OnEditName(3, IDC_EDIT12);}
-void CViewGlobals::OnEditName2()
-//------------------------------
+void CViewGlobals::OnFxChanged(const CHANNELINDEX chnMod4)
+//--------------------------------------------------------
{
CModDoc *pModDoc = GetDocument();
- if ((pModDoc) && (!m_nLockCount))
- {
- CSoundFile *pSndFile = pModDoc->GetSoundFile();
- CHAR s[MAX_CHANNELNAME+4];
- UINT nChn = m_nActiveTab * 4 + 1;
-
- memset(s, 0, sizeof(s));
- GetDlgItemText(IDC_EDIT10, s, sizeof(s));
- s[MAX_CHANNELNAME+1] = 0;
- if ((pSndFile->m_nType & (MOD_TYPE_XM|MOD_TYPE_IT|MOD_TYPE_MPT)) && (nChn < pSndFile->m_nChannels) && (strncmp(s, pSndFile->ChnSettings[nChn].szName, MAX_CHANNELNAME)))
- {
- memcpy(pSndFile->ChnSettings[nChn].szName, s, MAX_CHANNELNAME);
- pSndFile->ChnSettings[nChn].szName[ARRAYELEMCOUNT(pSndFile->ChnSettings[nChn].szName)-1] = 0;
- pModDoc->SetModified();
- pModDoc->UpdateAllViews(this, HINT_MODCHANNELS | (m_nActiveTab << 24));
- }
- }
-}
-
-
-void CViewGlobals::OnEditName3()
-//------------------------------
-{
- CModDoc *pModDoc = GetDocument();
-
- if ((pModDoc) && (!m_nLockCount))
- {
- CSoundFile *pSndFile = pModDoc->GetSoundFile();
- CHAR s[MAX_CHANNELNAME+4];
- UINT nChn = m_nActiveTab * 4 + 2;
-
- memset(s, 0, sizeof(s));
- GetDlgItemText(IDC_EDIT11, s, sizeof(s));
- s[MAX_CHANNELNAME+1] = 0;
- if ((pSndFile->m_nType & (MOD_TYPE_XM|MOD_TYPE_IT|MOD_TYPE_MPT)) && (nChn < pSndFile->m_nChannels) && (strncmp(s, pSndFile->ChnSettings[nChn].szName, MAX_CHANNELNAME)))
- {
- memcpy(pSndFile->ChnSettings[nChn].szName, s, MAX_CHANNELNAME);
- pSndFile->ChnSettings[nChn].szName[ARRAYELEMCOUNT(pSndFile->ChnSettings[nChn].szName)-1] = 0;
- pModDoc->SetModified();
- pModDoc->UpdateAllViews(this, HINT_MODCHANNELS | (m_nActiveTab << 24));
- }
- }
-}
-
-
-void CViewGlobals::OnEditName4()
-//------------------------------
-{
- CModDoc *pModDoc = GetDocument();
-
- if ((pModDoc) && (!m_nLockCount))
- {
- CSoundFile *pSndFile = pModDoc->GetSoundFile();
- CHAR s[MAX_CHANNELNAME+4];
- UINT nChn = m_nActiveTab * 4 + 3;
-
- memset(s, 0, sizeof(s));
- GetDlgItemText(IDC_EDIT12, s, sizeof(s));
- s[MAX_CHANNELNAME+1] = 0;
- if ((pSndFile->m_nType & (MOD_TYPE_XM|MOD_TYPE_IT|MOD_TYPE_MPT)) && (nChn < pSndFile->m_nChannels) && (strncmp(s, pSndFile->ChnSettings[nChn].szName, MAX_CHANNELNAME)))
- {
- memcpy(pSndFile->ChnSettings[nChn].szName, s, MAX_CHANNELNAME);
- pSndFile->ChnSettings[nChn].szName[ARRAYELEMCOUNT(pSndFi...
[truncated message content] |
|
From: <rel...@us...> - 2008-05-10 13:28:05
|
Revision: 211
http://modplug.svn.sourceforge.net/modplug/?rev=211&view=rev
Author: relabsoluness
Date: 2008-05-10 06:27:55 -0700 (Sat, 10 May 2008)
Log Message:
-----------
. Fix to crash when loading samples in sample tab; occurs usually with big samples.
. Fix to assigning wrong size to orderlist in COrderToPatternTable::OnModTypeChanged. Can(?) cause crashes or other problems at least when saving XM files. Bug was introduced in rev. 199, thus existing in builds .51 and .52.
. Fixes to modspecifications
Internal:
/ Some minor modifications e.g. to remove compiler warnings in VC2008.
Modified Paths:
--------------
trunk/OpenMPT/mptrack/AutoSaver.cpp
trunk/OpenMPT/mptrack/CreditStatic.cpp
trunk/OpenMPT/mptrack/Mptrack.cpp
trunk/OpenMPT/mptrack/OrderToPatternTable.cpp
trunk/OpenMPT/mptrack/View_smp.cpp
trunk/OpenMPT/soundlib/Load_mid.cpp
trunk/OpenMPT/soundlib/Load_mod.cpp
trunk/OpenMPT/soundlib/Load_stm.cpp
trunk/OpenMPT/soundlib/Load_umx.cpp
trunk/OpenMPT/soundlib/Load_xm.cpp
trunk/OpenMPT/soundlib/mod_specifications.h
Modified: trunk/OpenMPT/mptrack/AutoSaver.cpp
===================================================================
--- trunk/OpenMPT/mptrack/AutoSaver.cpp 2008-04-13 21:53:04 UTC (rev 210)
+++ trunk/OpenMPT/mptrack/AutoSaver.cpp 2008-05-10 13:27:55 UTC (rev 211)
@@ -223,7 +223,7 @@
{
// We do not call CModDoc::DoSave as this populates the Recent Files
// list with backups... hence we have duplicated code.. :(
- bool success=false;
+ BOOL success=false;
CSoundFile* pSndFile = pModDoc->GetSoundFile();
if (pSndFile) {
@@ -252,7 +252,7 @@
//Do nothing
}
}
- return success;
+ return (success == TRUE);
}
void CAutoSaver::CleanUpBackups(CModDoc *pModDoc)
@@ -354,7 +354,7 @@
m_pAutoSaver->SetFilenameTemplate(""); //TODO
m_pAutoSaver->SetHistoryDepth(GetDlgItemInt(IDC_AUTOSAVE_HISTORY));
m_pAutoSaver->SetSaveInterval(GetDlgItemInt(IDC_AUTOSAVE_INTERVAL));
- m_pAutoSaver->SetUseOriginalPath(IsDlgButtonChecked(IDC_AUTOSAVE_USEORIGDIR));
+ m_pAutoSaver->SetUseOriginalPath(IsDlgButtonChecked(IDC_AUTOSAVE_USEORIGDIR) == BST_CHECKED);
GetDlgItemText(IDC_AUTOSAVE_PATH, tempPath);
if (!tempPath.IsEmpty() && (tempPath.Right(1)!="\\"))
tempPath.Append("\\");
@@ -385,7 +385,7 @@
void CAutoSaverGUI::OnBnClickedAutosaveEnable()
{
- bool enabled = IsDlgButtonChecked(IDC_AUTOSAVE_ENABLE);
+ BOOL enabled = IsDlgButtonChecked(IDC_AUTOSAVE_ENABLE);
::EnableWindow(::GetDlgItem(m_hWnd, IDC_AUTOSAVE_INTERVAL), enabled);
::EnableWindow(::GetDlgItem(m_hWnd, IDC_AUTOSAVE_HISTORY), enabled);
::EnableWindow(::GetDlgItem(m_hWnd, IDC_AUTOSAVE_USEORIGDIR), enabled);
@@ -399,7 +399,7 @@
void CAutoSaverGUI::OnBnClickedAutosaveUseorigdir()
{
if (IsDlgButtonChecked(IDC_AUTOSAVE_ENABLE)) {
- bool enabled = IsDlgButtonChecked(IDC_AUTOSAVE_USEORIGDIR);
+ BOOL enabled = IsDlgButtonChecked(IDC_AUTOSAVE_USEORIGDIR);
::EnableWindow(::GetDlgItem(m_hWnd, IDC_AUTOSAVE_PATH), !enabled);
::EnableWindow(::GetDlgItem(m_hWnd, IDC_AUTOSAVE_BROWSE), !enabled);
OnSettingsChanged();
Modified: trunk/OpenMPT/mptrack/CreditStatic.cpp
===================================================================
--- trunk/OpenMPT/mptrack/CreditStatic.cpp 2008-04-13 21:53:04 UTC (rev 210)
+++ trunk/OpenMPT/mptrack/CreditStatic.cpp 2008-05-10 13:27:55 UTC (rev 211)
@@ -113,13 +113,13 @@
ASSERT(credits);
- if((str = strdup(credits)) == NULL)
+ if((str = _tcsdup(credits)) == NULL)
return;
m_ArrCredit.RemoveAll();
ptr1 = str;
- while((ptr2 = strchr(ptr1,delimiter)) != NULL) {
+ while((ptr2 = _tcschr(ptr1,delimiter)) != NULL) {
*ptr2 = '\0';
m_ArrCredit.AddTail(ptr1);
ptr1 = ptr2+1;
Modified: trunk/OpenMPT/mptrack/Mptrack.cpp
===================================================================
--- trunk/OpenMPT/mptrack/Mptrack.cpp 2008-04-13 21:53:04 UTC (rev 210)
+++ trunk/OpenMPT/mptrack/Mptrack.cpp 2008-05-10 13:27:55 UTC (rev 211)
@@ -53,9 +53,9 @@
{
if (lpszPathName)
{
- CHAR s[_MAX_EXT];
- _splitpath(lpszPathName, NULL, NULL, NULL, s);
- if (!stricmp(s, ".dll"))
+ TCHAR s[_MAX_EXT];
+ _tsplitpath(lpszPathName, NULL, NULL, NULL, s);
+ if (!_tcsicmp(s, _TEXT(".dll")))
{
CVstPluginManager *pPluginManager = theApp.GetPluginManager();
if (pPluginManager)
@@ -696,7 +696,7 @@
if (m_pszProfileName) {
free((void *)m_pszProfileName);
}
- m_pszProfileName = strdup(m_szConfigFileName);
+ m_pszProfileName = _tcsdup(m_szConfigFileName);
LoadStdProfileSettings(10); // Load standard INI file options (including MRU)
@@ -1483,8 +1483,8 @@
-97, -92, -86, -80, -74, -68, -62, -56, -49, -43, -37, -31, -25, -18, -12, -6
};
-#define Sinus(x) __SinusTable[x&0xFF]
-#define Cosinus(x) __SinusTable[(x+0x40)&0xFF]
+#define Sinus(x) __SinusTable[(x)&0xFF]
+#define Cosinus(x) __SinusTable[((x)+0x40)&0xFF]
#define PI 3.14159265358979323f
BOOL CPaletteBitmap::Animate()
Modified: trunk/OpenMPT/mptrack/OrderToPatternTable.cpp
===================================================================
--- trunk/OpenMPT/mptrack/OrderToPatternTable.cpp 2008-04-13 21:53:04 UTC (rev 210)
+++ trunk/OpenMPT/mptrack/OrderToPatternTable.cpp 2008-05-10 13:27:55 UTC (rev 211)
@@ -94,11 +94,11 @@
{
const CModSpecifications specs = m_rSndFile.GetModSpecifications();
- //Resize orderlist if needed. Because old orderlist had 256 elements, not making it
+ //Resize orderlist if needed. Because old orderlist had MAX_ORDERS(256) elements, not making it
//smaller than that even if the modtype doesn't support that many orders.
if(specs.ordersMax < GetCount())
{
- resize(max(MAX_PATTERNS, specs.ordersMax));
+ resize(max(MAX_ORDERS, specs.ordersMax));
for(ORDERINDEX i = GetCount(); i>specs.ordersMax; --i) (*this)[i-1] = GetInvalidPatIndex();
}
Modified: trunk/OpenMPT/mptrack/View_smp.cpp
===================================================================
--- trunk/OpenMPT/mptrack/View_smp.cpp 2008-04-13 21:53:04 UTC (rev 210)
+++ trunk/OpenMPT/mptrack/View_smp.cpp 2008-05-10 13:27:55 UTC (rev 211)
@@ -595,7 +595,9 @@
int smplsize, oldsmin, oldsmax;
int yrange = cy/2;
signed char *psample = (signed char *)pSampleData;
- int y0 = 0, xmax, posincr, posfrac, poshi;
+ //int y0 = 0, xmax, posincr, posfrac, poshi;
+ int32 y0 = 0, xmax, poshi;
+ uint64 posincr, posfrac;
if (len <= 0) return;
smplsize = (uFlags & CHN_16BIT) ? 2 : 1;
@@ -612,21 +614,24 @@
{
xmax = len>>(m_nZoom-1);
if (xmax > cx) xmax = cx;
- posincr = 1<<(m_nZoom-1+16);
+ posincr = (uint64(1) << (m_nZoom-1+16));
} else
{
xmax = cx;
- posincr = _muldiv(len, 0x10000, cx);
+ //posincr = _muldiv(len, 0x10000, cx);
+ posincr = uint64(len) * uint64(0x10000) / uint64(cx);
}
::MoveToEx(hdc, 0, ymed, NULL);
posfrac = 0;
poshi = 0;
for (int x=0; x<xmax; x++)
{
- int smin, smax, scanlen;
+ //int smin, smax, scanlen;
+ int smin, smax;
+ int32 scanlen;
posfrac += posincr;
- scanlen = (posfrac+0xffff) >> 16;
+ scanlen = static_cast<int32>((posfrac+0xffff) >> 16);
if (poshi >= len) poshi = len-1;
if (poshi+scanlen > len) scanlen = len-poshi;
if (scanlen < 1) scanlen = 1;
@@ -692,7 +697,7 @@
::LineTo(hdc, x, smin);
oldsmin = smin;
oldsmax = smax;
- poshi += (posfrac>>16);
+ poshi += static_cast<int32>(posfrac>>16);
posfrac &= 0xffff;
}
}
@@ -2320,4 +2325,4 @@
}
return NULL;
-}
\ No newline at end of file
+}
Modified: trunk/OpenMPT/soundlib/Load_mid.cpp
===================================================================
--- trunk/OpenMPT/soundlib/Load_mid.cpp 2008-04-13 21:53:04 UTC (rev 210)
+++ trunk/OpenMPT/soundlib/Load_mid.cpp 2008-05-10 13:27:55 UTC (rev 211)
@@ -763,7 +763,7 @@
CHAR s[32];
memcpy(s, ptrk->ptracks, k);
s[k] = 0;
- if ((!strnicmp(s, "Copyri", 6)) || (!s[0])) break;
+ if ((!_strnicmp(s, "Copyri", 6)) || (!s[0])) break;
if (i == 0x03)
{
if (!m_szNames[0][0]) strcpy(m_szNames[0], s);
Modified: trunk/OpenMPT/soundlib/Load_mod.cpp
===================================================================
--- trunk/OpenMPT/soundlib/Load_mod.cpp 2008-04-13 21:53:04 UTC (rev 210)
+++ trunk/OpenMPT/soundlib/Load_mod.cpp 2008-05-10 13:27:55 UTC (rev 211)
@@ -348,7 +348,7 @@
LPSTR p = (LPSTR)(lpStream+dwMemPos);
UINT flags = 0;
if (dwMemPos + 5 >= dwMemLength) break;
- if (!strnicmp(p, "ADPCM", 5))
+ if (!_strnicmp(p, "ADPCM", 5))
{
flags = 3;
p += 5;
Modified: trunk/OpenMPT/soundlib/Load_stm.cpp
===================================================================
--- trunk/OpenMPT/soundlib/Load_stm.cpp 2008-04-13 21:53:04 UTC (rev 210)
+++ trunk/OpenMPT/soundlib/Load_stm.cpp 2008-05-10 13:27:55 UTC (rev 211)
@@ -67,8 +67,8 @@
if ((!lpStream) || (dwMemLength < sizeof(STMHEADER))) return FALSE;
if ((phdr->filetype != 2) || (phdr->unused != 0x1A)
- || ((strnicmp(phdr->trackername, "!SCREAM!", 8))
- && (strnicmp(phdr->trackername, "BMOD2STM", 8)))) return FALSE;
+ || ((_strnicmp(phdr->trackername, "!SCREAM!", 8))
+ && (_strnicmp(phdr->trackername, "BMOD2STM", 8)))) return FALSE;
memcpy(m_szNames[0], phdr->songname, 20);
// Read STM header
m_nType = MOD_TYPE_STM;
Modified: trunk/OpenMPT/soundlib/Load_umx.cpp
===================================================================
--- trunk/OpenMPT/soundlib/Load_umx.cpp 2008-04-13 21:53:04 UTC (rev 210)
+++ trunk/OpenMPT/soundlib/Load_umx.cpp 2008-05-10 13:27:55 UTC (rev 211)
@@ -38,7 +38,7 @@
return ReadS3M(lpStream + dwRipOfs, dwMemLength - dwRipOfs);
}
// XM
- if (!strnicmp((LPCSTR)(lpStream+uscan), "Extended Module", 15))
+ if (!_strnicmp((LPCSTR)(lpStream+uscan), "Extended Module", 15))
{
DWORD dwRipOfs = uscan;
return ReadXM(lpStream + dwRipOfs, dwMemLength - dwRipOfs);
Modified: trunk/OpenMPT/soundlib/Load_xm.cpp
===================================================================
--- trunk/OpenMPT/soundlib/Load_xm.cpp 2008-04-13 21:53:04 UTC (rev 210)
+++ trunk/OpenMPT/soundlib/Load_xm.cpp 2008-05-10 13:27:55 UTC (rev 211)
@@ -680,6 +680,9 @@
header.norder++;
if ((Order[i] >= header.patterns) && (Order[i] < MAX_PATTERNS)) header.patterns = Order[i]+1;
}*/
+ if(Order.GetCount() < MAX_ORDERS)
+ Order.resize(MAX_ORDERS, Order.GetInvalidPatIndex());
+
for (i=MAX_ORDERS-1; i>=0; i--) { // walk backwards over orderlist
if ((Order[i]!=0xFF) && (header.norder==0)) {
header.norder=i+1; //find last used order
Modified: trunk/OpenMPT/soundlib/mod_specifications.h
===================================================================
--- trunk/OpenMPT/soundlib/mod_specifications.h 2008-04-13 21:53:04 UTC (rev 210)
+++ trunk/OpenMPT/soundlib/mod_specifications.h 2008-05-10 13:27:55 UTC (rev 211)
@@ -4,6 +4,7 @@
//Simple struct to gather various modspecifications in one place.
//Feel free to improve.
struct CModSpecifications
+//=======================
{
//NOTE: If changing order, update all initializations below.
char fileExtension[5];
@@ -108,7 +109,7 @@
256, //Max pattern rows
20, //Max mod name length
31, //SamplesMax
- 256, //instrumentMax
+ 200, //instrumentMax
mixLevels_original, //defaultMixLevels
0 //Max MIDI mapping directives
};
@@ -118,16 +119,16 @@
{
//TODO: Set correct values.
"xm", //File extension
- 64, //Pattern max.
- 128, //Order max.
+ 240, //Pattern max.
+ 256, //Order max.
4, //Channel min
- 64, //Channel max
+ 127, //Channel max
32, //Min tempo
512, //Max tempo
4, //Min pattern rows
1024, //Max pattern rows
20, //Max mod name length
- 31, //SamplesMax
+ 4000, //SamplesMax
256, //instrumentMax
mixLevels_117RC3, //defaultMixLevels
200 //Max MIDI mapping directives
@@ -146,7 +147,7 @@
64, //Min pattern rows
64, //Max pattern rows
27, //Max mod name length
- 31, //SamplesMax
+ 99, //SamplesMax
0, //instrumentMax
mixLevels_original, //defaultMixLevels
0 //Max MIDI mapping directives
@@ -165,7 +166,7 @@
64, //Min pattern rows
64, //Max pattern rows
27, //Max mod name length
- 31, //SamplesMax
+ 99, //SamplesMax
0, //instrumentMax
mixLevels_original, //defaultMixLevels
0 //Max MIDI mapping directives
@@ -185,7 +186,7 @@
256, //Max pattern rows
25, //Max mod name length
256, //SamplesMax
- 256, //instrumentMax
+ 200, //instrumentMax
mixLevels_original, //defaultMixLevels
0 //Max MIDI mapping directives
};
@@ -212,6 +213,4 @@
-
-
#endif
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <rel...@us...> - 2008-04-13 21:53:27
|
Revision: 210
http://modplug.svn.sourceforge.net/modplug/?rev=210&view=rev
Author: relabsoluness
Date: 2008-04-13 14:53:04 -0700 (Sun, 13 Apr 2008)
Log Message:
-----------
1.17.02.52
. Shouldn't need winhttp anymore(at least now that updatecheck is disabled). Dependency caused problems in Win98.
Modified Paths:
--------------
trunk/OpenMPT/mptrack/Mptrack.cpp
trunk/OpenMPT/mptrack/Mptrack.h
trunk/OpenMPT/mptrack/bin/mptrack.exe
trunk/OpenMPT/mptrack/mptrack.vcproj
Modified: trunk/OpenMPT/mptrack/Mptrack.cpp
===================================================================
--- trunk/OpenMPT/mptrack/Mptrack.cpp 2008-04-05 20:56:19 UTC (rev 209)
+++ trunk/OpenMPT/mptrack/Mptrack.cpp 2008-04-13 21:53:04 UTC (rev 210)
@@ -565,7 +565,6 @@
m_hBladeEnc = NULL;
m_hLameEnc = NULL;
m_hACMInst = NULL;
- m_pRequestContext = NULL;
m_hAlternateResourceHandle = NULL;
m_szConfigFileName[0] = 0;
for (UINT i=0; i<MAX_DLS_BANKS; i++) gpDLSBanks[i] = NULL;
@@ -578,6 +577,10 @@
strcpy(&m_MidiCfg.szMidiGlb[MIDIOUT_PROGRAM*32], "Cc p");
strcpy(&m_MidiCfg.szMidiSFXExt[0], "F0F000z");
for (int iz=0; iz<16; iz++) wsprintf(&m_MidiCfg.szMidiZXXExt[iz*32], "F0F001%02X", iz*8);
+
+ #ifdef UPDATECHECKENABLED
+ m_pRequestContext = NULL;
+ #endif
}
/////////////////////////////////////////////////////////////////////////////
@@ -823,6 +826,8 @@
return TRUE;
}
+
+#ifdef UPDATECHECKENABLED
void __stdcall CTrackApp::InternetRequestCallback( HINTERNET /*hInternet*/, DWORD_PTR userData, DWORD dwInternetStatus,
LPVOID /*lpvStatusInformation*/, DWORD /*dwStatusInformationLength*/)
//-----------------------------------------------------------------------------------------------------
@@ -999,9 +1004,9 @@
}
}
+#endif
-
int CTrackApp::ExitInstance()
//---------------------------
{
@@ -1054,8 +1059,10 @@
UninitializeACM();
// Cleanup the internet request, in case it is still active.
+ #ifdef UPDATECHECKENABLED
CleanupInternetRequest(m_pRequestContext);
delete m_pRequestContext;
+ #endif
return CWinApp::ExitInstance();
}
Modified: trunk/OpenMPT/mptrack/Mptrack.h
===================================================================
--- trunk/OpenMPT/mptrack/Mptrack.h 2008-04-05 20:56:19 UTC (rev 209)
+++ trunk/OpenMPT/mptrack/Mptrack.h 2008-04-13 21:53:04 UTC (rev 210)
@@ -15,9 +15,12 @@
#include "resource.h" // main symbols
#include "sndfile.h"
#include <windows.h>
-#include <Specstrings.h> // In VC2003, '__in' was undefined in winhttp.h
-#include <winhttp.h>
+#ifdef UPDATECHECKENABLED
+ #include <Specstrings.h> // In VC2003, '__in' was undefined in winhttp.h
+ #include <winhttp.h>
+#endif
+
class CModDoc;
class CVstPluginManager;
@@ -99,6 +102,7 @@
/////////////////////////////////////////////////////////////////////////////
// Internet connection context
+#ifdef UPDATECHECKENABLED
typedef struct REQUEST_CONTEXT {
HINTERNET hSession;
HINTERNET hConnection;
@@ -106,6 +110,7 @@
LPSTR lpBuffer; // Buffer for storing read data
LPSTR postData;
} REQUEST_CONTEXT;
+#endif
/////////////////////////////////////////////////////////////////////////////
// CTrackApp:
@@ -138,8 +143,11 @@
CHAR m_szConfigFileName[_MAX_PATH];
CHAR m_szPluginCacheFileName[_MAX_PATH];
CHAR m_szStringsFileName[_MAX_PATH];
+
+ #ifdef UPDATECHECKENABLED
// Internet request context
REQUEST_CONTEXT *m_pRequestContext;
+ #endif
public:
CTrackApp();
@@ -181,11 +189,14 @@
protected:
VOID StartSplashScreen();
VOID StopSplashScreen();
- VOID UpdateCheck();
- static void __stdcall InternetRequestCallback( HINTERNET hInternet, DWORD_PTR dwContext, DWORD dwInternetStatus,
- LPVOID lpvStatusInformation, DWORD dwStatusInformationLength);
- static void CleanupInternetRequest(REQUEST_CONTEXT *pRequestContext);
+ #ifdef UPDATECHECKENABLED
+ VOID UpdateCheck();
+ static void __stdcall InternetRequestCallback( HINTERNET hInternet, DWORD_PTR dwContext, DWORD dwInternetStatus,
+ LPVOID lpvStatusInformation, DWORD dwStatusInformationLength);
+ static void CleanupInternetRequest(REQUEST_CONTEXT *pRequestContext);
+ #endif
+
// Localized strings
public:
VOID ImportLocalizedStrings();
Modified: trunk/OpenMPT/mptrack/bin/mptrack.exe
===================================================================
(Binary files differ)
Modified: trunk/OpenMPT/mptrack/mptrack.vcproj
===================================================================
--- trunk/OpenMPT/mptrack/mptrack.vcproj 2008-04-05 20:56:19 UTC (rev 209)
+++ trunk/OpenMPT/mptrack/mptrack.vcproj 2008-04-13 21:53:04 UTC (rev 210)
@@ -48,13 +48,13 @@
<Tool
Name="VCLinkerTool"
AdditionalOptions="/MACHINE:I386"
- AdditionalDependencies="winmm.lib strmiids.lib dmoguids.lib xsoundlib.lib version.lib opengl32.lib glu32.lib Rpcrt4.lib winhttp.lib"
+ AdditionalDependencies="winmm.lib strmiids.lib dmoguids.lib xsoundlib.lib version.lib opengl32.lib glu32.lib Rpcrt4.lib"
OutputFile=".\Debug/mptrack.exe"
Version="5.0"
LinkIncremental="2"
SuppressStartupBanner="TRUE"
AdditionalLibraryDirectories="..\xsoundlib\Debug"
- DelayLoadDLLs="winhttp.dll"
+ DelayLoadDLLs=""
GenerateDebugInformation="TRUE"
AssemblyDebug="1"
ProgramDatabaseFile=".\Debug/mptrack.pdb"
@@ -124,7 +124,7 @@
<Tool
Name="VCLinkerTool"
AdditionalOptions="/MACHINE:I386"
- AdditionalDependencies="winmm.lib strmiids.lib dmoguids.lib xsoundlib.lib version.lib opengl32.lib glu32.lib Rpcrt4.lib winhttp.lib"
+ AdditionalDependencies="winmm.lib strmiids.lib dmoguids.lib xsoundlib.lib version.lib opengl32.lib glu32.lib Rpcrt4.lib"
OutputFile=".\Bin/mptrack.exe"
Version="5.0"
LinkIncremental="1"
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|