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
(48) |
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
|
From: <sag...@us...> - 2011-07-26 19:04:14
|
Revision: 929
http://modplug.svn.sourceforge.net/modplug/?rev=929&view=rev
Author: saga-games
Date: 2011-07-26 19:04:08 +0000 (Tue, 26 Jul 2011)
Log Message:
-----------
Experimental new code...
[New] Adding / removing channels through the pattern editor now creates an undo point.
[Fix] Moving channels and then undoing the move preserves old channel settings (http://bugs.openmpt.org/view.php?id=156).
Modified Paths:
--------------
trunk/OpenMPT/mptrack/Moddoc.h
trunk/OpenMPT/mptrack/Modedit.cpp
trunk/OpenMPT/mptrack/Undo.cpp
trunk/OpenMPT/mptrack/Undo.h
Modified: trunk/OpenMPT/mptrack/Moddoc.h
===================================================================
--- trunk/OpenMPT/mptrack/Moddoc.h 2011-07-26 00:22:44 UTC (rev 928)
+++ trunk/OpenMPT/mptrack/Moddoc.h 2011-07-26 19:04:08 UTC (rev 929)
@@ -277,9 +277,9 @@
bool ChangeModType(MODTYPE wType);
bool ChangeNumChannels(CHANNELINDEX nNewChannels, const bool showCancelInRemoveDlg = true);
- CHANNELINDEX ReArrangeChannels(const vector<CHANNELINDEX> &fromToArray);
+ bool RemoveChannels(const vector<bool> &keepMask);
+ CHANNELINDEX ReArrangeChannels(const vector<CHANNELINDEX> &fromToArray, const bool createUndoPoint = true);
bool MoveChannel(CHANNELINDEX chn_from, CHANNELINDEX chn_to);
- bool RemoveChannels(const vector<bool> &keepMask);
void CheckUsedChannels(vector<bool> &usedMask, CHANNELINDEX maxRemoveCount = MAX_BASECHANNELS) const;
bool ConvertInstrumentsToSamples();
Modified: trunk/OpenMPT/mptrack/Modedit.cpp
===================================================================
--- trunk/OpenMPT/mptrack/Modedit.cpp 2011-07-26 00:22:44 UTC (rev 928)
+++ trunk/OpenMPT/mptrack/Modedit.cpp 2011-07-26 19:04:08 UTC (rev 929)
@@ -138,8 +138,8 @@
// Base code for adding, removing, moving and duplicating channels. Returns new number of channels on success, CHANNELINDEX_INVALID otherwise.
// The new channel vector can contain CHANNELINDEX_INVALID for adding new (empty) channels.
-CHANNELINDEX CModDoc::ReArrangeChannels(const vector<CHANNELINDEX> &newOrder)
-//---------------------------------------------------------------------------
+CHANNELINDEX CModDoc::ReArrangeChannels(const vector<CHANNELINDEX> &newOrder, const bool createUndoPoint)
+//-------------------------------------------------------------------------------------------------------
{
//newOrder[i] tells which current channel should be placed to i:th position in
//the new order, or if i is not an index of current channels, then new channel is
@@ -157,20 +157,25 @@
}
bool first = true;
- if(nRemainingChannels != GetNumChannels())
+ // Find highest valid pattern number for storing channel undo data with, since the pattern with the highest number will be undone first.
+ PATTERNINDEX highestPattern = 0;
+ for(PATTERNINDEX nPat = m_SndFile.Patterns.Size() - 1; nPat > 0; nPat--)
{
- // For now, changing number of channels can't be undone
- GetPatternUndo()->ClearUndo();
+ if(m_SndFile.Patterns.IsValidPat(nPat))
+ {
+ highestPattern = nPat;
+ break;
+ }
}
BEGIN_CRITICAL();
- for(PATTERNINDEX nPat = 0; nPat < m_SndFile.Patterns.Size(); nPat++)
+ for(PATTERNINDEX nPat = 0; nPat <= highestPattern; nPat++)
{
- if(m_SndFile.Patterns[nPat])
+ if(m_SndFile.Patterns.IsValidPat(nPat))
{
- if(nRemainingChannels == GetNumChannels())
+ if(createUndoPoint)
{
- GetPatternUndo()->PrepareUndo(nPat, 0, 0, GetNumChannels(), m_SndFile.Patterns[nPat].GetNumRows(), !first);
+ GetPatternUndo()->PrepareUndo(nPat, 0, 0, GetNumChannels(), m_SndFile.Patterns[nPat].GetNumRows(), !first, (nPat == highestPattern));
first = false;
}
@@ -795,9 +800,9 @@
case NOTE_NONE: p[1] = p[2] = p[3] = '.'; break;
case NOTE_KEYOFF: p[1] = p[2] = p[3] = '='; break;
case NOTE_NOTECUT: p[1] = p[2] = p[3] = '^'; break;
- case NOTE_FADE: p[1] = p[2] = p[3] = '~'; break;
- 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;
+ case NOTE_FADE: 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];
Modified: trunk/OpenMPT/mptrack/Undo.cpp
===================================================================
--- trunk/OpenMPT/mptrack/Undo.cpp 2011-07-26 00:22:44 UTC (rev 928)
+++ trunk/OpenMPT/mptrack/Undo.cpp 2011-07-26 19:04:08 UTC (rev 929)
@@ -39,8 +39,9 @@
// - numChns: width
// - numRows: height
// - linkToPrevious: Don't create a separate undo step, but link this to the previous undo event. Useful for commands that modify several patterns at once.
-bool CPatternUndo::PrepareUndo(PATTERNINDEX pattern, CHANNELINDEX firstChn, ROWINDEX firstRow, CHANNELINDEX numChns, ROWINDEX numRows, bool linkToPrevious)
-//---------------------------------------------------------------------------------------------------------------------------------------------------------
+// - storeChannelInfo: Also store current channel header information (pan / volume / etc. settings) and number of channels in this undo point.
+bool CPatternUndo::PrepareUndo(PATTERNINDEX pattern, CHANNELINDEX firstChn, ROWINDEX firstRow, CHANNELINDEX numChns, ROWINDEX numRows, bool linkToPrevious, bool storeChannelInfo)
+//--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
{
if(m_pModDoc == nullptr) return false;
CSoundFile *pSndFile = m_pModDoc->GetSoundFile();
@@ -84,6 +85,17 @@
pPattern += pSndFile->GetNumChannels();
}
+ if(storeChannelInfo)
+ {
+ sUndo.channelInfo = new PATTERNUNDOINFO;
+ sUndo.channelInfo->oldNumChannels = pSndFile->GetNumChannels();
+ sUndo.channelInfo->settings = new MODCHANNELSETTINGS[pSndFile->GetNumChannels()];
+ memcpy(sUndo.channelInfo->settings, pSndFile->ChnSettings, sizeof(MODCHANNELSETTINGS) * pSndFile->GetNumChannels());
+ } else
+ {
+ sUndo.channelInfo = nullptr;
+ }
+
UndoBuffer.push_back(sUndo);
if (bUpdate) m_pModDoc->UpdateAllViews(NULL, HINT_UNDO);
@@ -127,6 +139,30 @@
// Select most recent undo slot
const PATTERNUNDOBUFFER *pUndo = &UndoBuffer.back();
+ if(pUndo->channelInfo != nullptr)
+ {
+ if(pUndo->channelInfo->oldNumChannels > pSndFile->GetNumChannels())
+ {
+ // First add some channels again...
+ vector<CHANNELINDEX> channels(pUndo->channelInfo->oldNumChannels, CHANNELINDEX_INVALID);
+ for(CHANNELINDEX i = 0; i < pSndFile->GetNumChannels(); i++)
+ {
+ channels[i] = i;
+ }
+ m_pModDoc->ReArrangeChannels(channels, false);
+ } else if(pUndo->channelInfo->oldNumChannels < pSndFile->GetNumChannels())
+ {
+ // ... or remove newly added channels
+ vector<CHANNELINDEX> channels(pUndo->channelInfo->oldNumChannels);
+ for(CHANNELINDEX i = 0; i < pUndo->channelInfo->oldNumChannels; i++)
+ {
+ channels[i] = i;
+ }
+ m_pModDoc->ReArrangeChannels(channels, false);
+ }
+ memcpy(pSndFile->ChnSettings, pUndo->channelInfo->settings, sizeof(MODCHANNELSETTINGS) * pUndo->channelInfo->oldNumChannels);
+ }
+
nPattern = pUndo->pattern;
nRows = pUndo->patternsize;
if(pUndo->firstChannel + pUndo->numChannels <= pSndFile->GetNumChannels())
@@ -159,14 +195,14 @@
RemoveLastUndoStep();
- if (CanUndo() == false) m_pModDoc->UpdateAllViews(NULL, HINT_UNDO);
+ if(CanUndo() == false) m_pModDoc->UpdateAllViews(NULL, HINT_UNDO);
+
if(linkToPrevious)
{
- return Undo(true);
- } else
- {
- return nPattern;
+ nPattern = Undo(true);
}
+
+ return nPattern;
}
@@ -183,7 +219,12 @@
//-------------------------------------------
{
if(nStep >= UndoBuffer.size()) return;
- if (UndoBuffer[nStep].pbuffer) delete[] UndoBuffer[nStep].pbuffer;
+ if(UndoBuffer[nStep].pbuffer) delete[] UndoBuffer[nStep].pbuffer;
+ if(UndoBuffer[nStep].channelInfo)
+ {
+ delete[] UndoBuffer[nStep].channelInfo->settings;
+ delete UndoBuffer[nStep].channelInfo;
+ }
UndoBuffer.erase(UndoBuffer.begin() + nStep);
}
Modified: trunk/OpenMPT/mptrack/Undo.h
===================================================================
--- trunk/OpenMPT/mptrack/Undo.h 2011-07-26 00:22:44 UTC (rev 928)
+++ trunk/OpenMPT/mptrack/Undo.h 2011-07-26 19:04:08 UTC (rev 929)
@@ -14,6 +14,13 @@
/////////////////////////////////////////////////////////////////////////////////////////
// Pattern Undo
+// Additional undo information, as required
+struct PATTERNUNDOINFO
+{
+ MODCHANNELSETTINGS *settings;
+ CHANNELINDEX oldNumChannels;
+};
+
struct PATTERNUNDOBUFFER
{
PATTERNINDEX pattern;
@@ -21,6 +28,7 @@
CHANNELINDEX firstChannel, numChannels;
ROWINDEX firstRow, numRows;
MODCOMMAND *pbuffer;
+ PATTERNUNDOINFO *channelInfo;
bool linkToPrevious;
};
@@ -29,7 +37,7 @@
//================
{
-private:
+protected:
std::vector<PATTERNUNDOBUFFER> UndoBuffer;
CModDoc *m_pModDoc;
@@ -42,7 +50,7 @@
// Pattern undo functions
void ClearUndo();
- bool PrepareUndo(PATTERNINDEX pattern, CHANNELINDEX firstChn, ROWINDEX firstRow, CHANNELINDEX numChns, ROWINDEX numRows, bool linkToPrevious = false);
+ bool PrepareUndo(PATTERNINDEX pattern, CHANNELINDEX firstChn, ROWINDEX firstRow, CHANNELINDEX numChns, ROWINDEX numRows, bool linkToPrevious = false, bool storeChannelInfo = false);
PATTERNINDEX Undo();
bool CanUndo();
void RemoveLastUndoStep();
@@ -93,7 +101,7 @@
//===============
{
-private:
+protected:
// Undo buffer
std::vector<std::vector<SAMPLEUNDOBUFFER> > UndoBuffer;
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <sag...@us...> - 2011-07-26 00:22:50
|
Revision: 928
http://modplug.svn.sourceforge.net/modplug/?rev=928&view=rev
Author: saga-games
Date: 2011-07-26 00:22:44 +0000 (Tue, 26 Jul 2011)
Log Message:
-----------
[Fix] Envelope Editor: When editing the first envelope node while compatible playback mode was enabled, it was moved to the second tick.
[Imp] IT Loader: Showing MPT alpha and beta versions as such in the version information.
Modified Paths:
--------------
trunk/OpenMPT/mptrack/View_ins.cpp
trunk/OpenMPT/soundlib/Load_it.cpp
Modified: trunk/OpenMPT/mptrack/View_ins.cpp
===================================================================
--- trunk/OpenMPT/mptrack/View_ins.cpp 2011-07-23 19:34:13 UTC (rev 927)
+++ trunk/OpenMPT/mptrack/View_ins.cpp 2011-07-26 00:22:44 UTC (rev 928)
@@ -278,7 +278,7 @@
int maxtick = envelope->Ticks[nPoint + 1];
if (nPoint + 1 == (int)envelope->nNodes) maxtick = ENVELOPE_MAX_LENGTH;
// Can't have multiple points on same tick
- if(GetDocument()->GetSoundFile()->IsCompatibleMode(TRK_IMPULSETRACKER|TRK_FASTTRACKER2) && mintick < maxtick - 1)
+ if(nPoint > 0 && GetDocument()->GetSoundFile()->IsCompatibleMode(TRK_IMPULSETRACKER|TRK_FASTTRACKER2) && mintick < maxtick - 1)
{
mintick++;
if (nPoint + 1 < (int)envelope->nNodes) maxtick--;
Modified: trunk/OpenMPT/soundlib/Load_it.cpp
===================================================================
--- trunk/OpenMPT/soundlib/Load_it.cpp 2011-07-23 19:34:13 UTC (rev 927)
+++ trunk/OpenMPT/soundlib/Load_it.cpp 2011-07-26 00:22:44 UTC (rev 928)
@@ -556,7 +556,7 @@
else if(pifh->cwtv == 0x0214 && pifh->cmwt == 0x0200 && pifh->reserved == 0)
{
// ModPlug Tracker 1.00a5, instruments 560 bytes apart
- m_dwLastSavedWithVersion = MAKE_VERSION_NUMERIC(1, 00, 00, 00);
+ m_dwLastSavedWithVersion = MAKE_VERSION_NUMERIC(1, 00, 00, A5);
interpretModPlugMade = true;
}
}
@@ -3265,8 +3265,8 @@
if( (size <= 63*2) && (size % 2 == 0) )
{
const BYTE* pData = ptr;
- STATIC_ASSERT(ARRAYELEMCOUNT(ChnSettings) >= 64);
- const __int16 nLoopLimit = min(size/2, ARRAYELEMCOUNT(ChnSettings) - 64);
+ STATIC_ASSERT(CountOf(ChnSettings) >= 64);
+ const __int16 nLoopLimit = min(size/2, CountOf(ChnSettings) - 64);
for(__int16 i = 0; i<nLoopLimit; i++, pData += 2) if(pData[0] != 0xFF)
{
ChnSettings[i+64].nVolume = pData[1];
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <sag...@us...> - 2011-07-23 19:34:23
|
Revision: 927
http://modplug.svn.sourceforge.net/modplug/?rev=927&view=rev
Author: saga-games
Date: 2011-07-23 19:34:13 +0000 (Sat, 23 Jul 2011)
Log Message:
-----------
[Ref] Big refactoring commit. All application settings that previously were stored as static variables in CMainFrame have been moved to a new class, TrackerSettings. The Settings can be retrieved through CMainFrame::GetSettings().
[Imp] Added "/Portable" command line switch.
Modified Paths:
--------------
trunk/OpenMPT/mptrack/AbstractVstEditor.cpp
trunk/OpenMPT/mptrack/Childfrm.cpp
trunk/OpenMPT/mptrack/Ctrl_com.cpp
trunk/OpenMPT/mptrack/Ctrl_com.h
trunk/OpenMPT/mptrack/Ctrl_gen.cpp
trunk/OpenMPT/mptrack/Ctrl_gen.h
trunk/OpenMPT/mptrack/Ctrl_ins.cpp
trunk/OpenMPT/mptrack/Ctrl_ins.h
trunk/OpenMPT/mptrack/Ctrl_pat.cpp
trunk/OpenMPT/mptrack/Ctrl_pat.h
trunk/OpenMPT/mptrack/Ctrl_seq.cpp
trunk/OpenMPT/mptrack/Ctrl_smp.cpp
trunk/OpenMPT/mptrack/Ctrl_smp.h
trunk/OpenMPT/mptrack/Draw_pat.cpp
trunk/OpenMPT/mptrack/Globals.cpp
trunk/OpenMPT/mptrack/InputHandler.cpp
trunk/OpenMPT/mptrack/KeyConfigDlg.cpp
trunk/OpenMPT/mptrack/MainFrm.cpp
trunk/OpenMPT/mptrack/Mainbar.cpp
trunk/OpenMPT/mptrack/Mainfrm.h
trunk/OpenMPT/mptrack/Moddoc.cpp
trunk/OpenMPT/mptrack/Modedit.cpp
trunk/OpenMPT/mptrack/Moptions.cpp
trunk/OpenMPT/mptrack/Mpdlgs.cpp
trunk/OpenMPT/mptrack/Mpt_midi.cpp
trunk/OpenMPT/mptrack/Mptrack.cpp
trunk/OpenMPT/mptrack/Mptrack.h
trunk/OpenMPT/mptrack/TuningDialog.cpp
trunk/OpenMPT/mptrack/Undo.cpp
trunk/OpenMPT/mptrack/UpdateCheck.cpp
trunk/OpenMPT/mptrack/View_gen.cpp
trunk/OpenMPT/mptrack/View_ins.cpp
trunk/OpenMPT/mptrack/View_pat.cpp
trunk/OpenMPT/mptrack/View_smp.cpp
trunk/OpenMPT/mptrack/View_tre.cpp
trunk/OpenMPT/mptrack/Vstplug.cpp
trunk/OpenMPT/mptrack/ctrl_graph.h
trunk/OpenMPT/mptrack/dlg_misc.cpp
trunk/OpenMPT/mptrack/mptrack.vcproj
trunk/OpenMPT/mptrack/mptrack_08.vcproj
trunk/OpenMPT/mptrack/mptrack_10.vcxproj
trunk/OpenMPT/soundlib/Load_mid.cpp
trunk/OpenMPT/soundlib/SNDDEV.H
trunk/OpenMPT/soundlib/Snddev.cpp
trunk/OpenMPT/soundlib/Sndfile.cpp
trunk/OpenMPT/soundlib/Sndmix.cpp
trunk/OpenMPT/soundlib/Tables.cpp
trunk/OpenMPT/soundlib/WindowedFIR.cpp
trunk/OpenMPT/soundlib/WindowedFIR.h
Added Paths:
-----------
trunk/OpenMPT/mptrack/TrackerSettings.cpp
trunk/OpenMPT/mptrack/TrackerSettings.h
Modified: trunk/OpenMPT/mptrack/AbstractVstEditor.cpp
===================================================================
--- trunk/OpenMPT/mptrack/AbstractVstEditor.cpp 2011-07-22 23:02:11 UTC (rev 926)
+++ trunk/OpenMPT/mptrack/AbstractVstEditor.cpp 2011-07-23 19:34:13 UTC (rev 927)
@@ -115,10 +115,10 @@
FileDlgResult files = CTrackApp::ShowOpenSaveFileDialog(true, "fxp", "",
"VST Program (*.fxp)|*.fxp||",
- CMainFrame::GetWorkingDirectory(DIR_PLUGINPRESETS));
+ CMainFrame::GetSettings().GetWorkingDirectory(DIR_PLUGINPRESETS));
if(files.abort) return;
- CMainFrame::SetWorkingDirectory(files.workingDirectory.c_str(), DIR_PLUGINPRESETS, true);
+ CMainFrame::GetSettings().SetWorkingDirectory(files.workingDirectory.c_str(), DIR_PLUGINPRESETS, true);
//TODO: exception handling to distinguish errors at this level.
if (m_pVstPlugin->LoadProgram(files.first_file.c_str()))
@@ -138,10 +138,10 @@
FileDlgResult files = CTrackApp::ShowOpenSaveFileDialog(false, "fxp", "",
"VST Program (*.fxp)|*.fxp||",
- CMainFrame::GetWorkingDirectory(DIR_PLUGINPRESETS));
+ CMainFrame::GetSettings().GetWorkingDirectory(DIR_PLUGINPRESETS));
if(files.abort) return;
- CMainFrame::SetWorkingDirectory(files.workingDirectory.c_str(), DIR_PLUGINPRESETS, true);
+ CMainFrame::GetSettings().SetWorkingDirectory(files.workingDirectory.c_str(), DIR_PLUGINPRESETS, true);
//TODO: exception handling
if (!(m_pVstPlugin->SaveProgram(files.first_file.c_str())))
Modified: trunk/OpenMPT/mptrack/Childfrm.cpp
===================================================================
--- trunk/OpenMPT/mptrack/Childfrm.cpp 2011-07-22 23:02:11 UTC (rev 926)
+++ trunk/OpenMPT/mptrack/Childfrm.cpp 2011-07-23 19:34:13 UTC (rev 927)
@@ -85,7 +85,7 @@
{
if ((--glMdiOpenCount) == 0)
{
- CMainFrame::gbMdiMaximize = m_bMaxWhenClosed;
+ CMainFrame::GetSettings().gbMdiMaximize = m_bMaxWhenClosed;
}
}
@@ -98,7 +98,7 @@
// add the first splitter pane - the default view in row 0
//int cy = CMainFrame::glCtrlWindowHeight;
- int cy = CMainFrame::glGeneralWindowHeight; //rewbs.varWindowSize - default to general tab.
+ int cy = CMainFrame::GetSettings().glGeneralWindowHeight; //rewbs.varWindowSize - default to general tab.
if (cy <= 1) cy = (lpcs->cy*2) / 3;
if (!m_wndSplitter.CreateView(0, 0, pContext->m_pNewViewClass, CSize(0, cy), pContext)) return FALSE;
@@ -134,7 +134,7 @@
void CChildFrame::ActivateFrame(int nCmdShow)
//-------------------------------------------
{
- if ((glMdiOpenCount == 1) && (CMainFrame::gbMdiMaximize) && (nCmdShow == -1))
+ if ((glMdiOpenCount == 1) && (CMainFrame::GetSettings().gbMdiMaximize) && (nCmdShow == -1))
{
nCmdShow = SW_SHOWMAXIMIZED;
}
@@ -239,7 +239,7 @@
CRect rect;
m_bMaxWhenClosed = IsZoomed();
- if (bForce) CMainFrame::gbMdiMaximize = m_bMaxWhenClosed;
+ if (bForce) CMainFrame::GetSettings().gbMdiMaximize = m_bMaxWhenClosed;
if (!IsIconic())
{
CWnd *pWnd = m_wndSplitter.GetPane(0, 0);
@@ -249,18 +249,18 @@
LONG l = rect.Height();
//rewbs.varWindowSize - not the nicest piece of code, but we need to distinguish btw the views:
if (strcmp("CViewGlobals",m_szCurrentViewClassName) == 0)
- CMainFrame::glGeneralWindowHeight = l;
+ CMainFrame::GetSettings().glGeneralWindowHeight = l;
else if (strcmp("CViewPattern", m_szCurrentViewClassName) == 0)
- CMainFrame::glPatternWindowHeight = l;
+ CMainFrame::GetSettings().glPatternWindowHeight = l;
else if (strcmp("CViewSample", m_szCurrentViewClassName) == 0)
- CMainFrame::glSampleWindowHeight = l;
+ CMainFrame::GetSettings().glSampleWindowHeight = l;
else if (strcmp("CViewInstrument", m_szCurrentViewClassName) == 0)
- CMainFrame::glInstrumentWindowHeight = l;
+ CMainFrame::GetSettings().glInstrumentWindowHeight = l;
else if (strcmp("CViewComments", m_szCurrentViewClassName) == 0)
- CMainFrame::glCommentsWindowHeight = l;
+ CMainFrame::GetSettings().glCommentsWindowHeight = l;
//rewbs.graph
else if (strcmp("CViewGraph", m_szCurrentViewClassName) == 0)
- CMainFrame::glGraphWindowHeight = l;
+ CMainFrame::GetSettings().glGraphWindowHeight = l;
//end rewbs.graph
}
Modified: trunk/OpenMPT/mptrack/Ctrl_com.cpp
===================================================================
--- trunk/OpenMPT/mptrack/Ctrl_com.cpp 2011-07-22 23:02:11 UTC (rev 926)
+++ trunk/OpenMPT/mptrack/Ctrl_com.cpp 2011-07-23 19:34:13 UTC (rev 927)
@@ -82,7 +82,7 @@
rect.right = rcClient.right - rect.left;
if ((rect.right > rect.left) && (rect.bottom > rect.top))
{
- int cxmax = (CMainFrame::m_dwPatternSetup & PATTERN_LARGECOMMENTS) ? 80*8 : 80*6;
+ int cxmax = (CMainFrame::GetSettings().m_dwPatternSetup & PATTERN_LARGECOMMENTS) ? 80*8 : 80*6;
int cx = rect.Width(), cy = rect.Height();
if (cx > cxmax) cx = cxmax;
if ((cx != cx0) || (cy != cy0)) m_EditComments.SetWindowPos(NULL, 0,0, cx, cy, SWP_NOMOVE|SWP_NOZORDER|SWP_DRAWFRAME);
@@ -97,7 +97,7 @@
if (m_nLockCount) return;
m_nLockCount++;
HFONT newfont;
- if (CMainFrame::m_dwPatternSetup & PATTERN_LARGECOMMENTS)
+ if (CMainFrame::GetSettings().m_dwPatternSetup & PATTERN_LARGECOMMENTS)
newfont = CMainFrame::GetLargeFixedFont();
else
newfont = CMainFrame::GetFixedFont();
Modified: trunk/OpenMPT/mptrack/Ctrl_com.h
===================================================================
--- trunk/OpenMPT/mptrack/Ctrl_com.h 2011-07-22 23:02:11 UTC (rev 926)
+++ trunk/OpenMPT/mptrack/Ctrl_com.h 2011-07-23 19:34:13 UTC (rev 927)
@@ -12,7 +12,7 @@
public:
CCtrlComments();
- LONG* GetSplitPosRef() {return &CMainFrame::glCommentsWindowHeight;} //rewbs.varWindowSize
+ LONG* GetSplitPosRef() {return &CMainFrame::GetSettings().glCommentsWindowHeight;} //rewbs.varWindowSize
public:
//{{AFX_DATA(CCtrlComments)
Modified: trunk/OpenMPT/mptrack/Ctrl_gen.cpp
===================================================================
--- trunk/OpenMPT/mptrack/Ctrl_gen.cpp 2011-07-22 23:02:11 UTC (rev 926)
+++ trunk/OpenMPT/mptrack/Ctrl_gen.cpp 2011-07-23 19:34:13 UTC (rev 927)
@@ -252,9 +252,9 @@
}
if (dwHint & HINT_MPTSETUP)
{
- DWORD dwSetup = CMainFrame::m_dwQuality;
- m_ComboResampling.SetCurSel(CMainFrame::m_nSrcMode);
- CheckDlgButton(IDC_CHECK_LOOPSONG, (CMainFrame::gbLoopSong) ? TRUE : FALSE);
+ DWORD dwSetup = CMainFrame::GetSettings().m_dwQuality;
+ m_ComboResampling.SetCurSel(CMainFrame::GetSettings().m_nSrcMode);
+ CheckDlgButton(IDC_CHECK_LOOPSONG, (CMainFrame::GetSettings().gbLoopSong) ? TRUE : FALSE);
CheckDlgButton(IDC_CHECK_AGC, (dwSetup & QUALITY_AGC) ? TRUE : FALSE);
CheckDlgButton(IDC_CHECK_BASS, (dwSetup & QUALITY_MEGABASS) ? TRUE : FALSE);
CheckDlgButton(IDC_CHECK_REVERB, (dwSetup & QUALITY_REVERB) ? TRUE : FALSE);
@@ -508,10 +508,10 @@
//--------------------------------------
{
DWORD n = m_ComboResampling.GetCurSel();
- if ((n < NUM_SRC_MODES) && (n != CMainFrame::m_nSrcMode))
+ if ((n < NUM_SRC_MODES) && (n != CMainFrame::GetSettings().m_nSrcMode))
{
CMainFrame *pMainFrm = CMainFrame::GetMainFrame();
- if (pMainFrm) pMainFrm->SetupPlayer(CMainFrame::m_dwQuality, n);
+ if (pMainFrm) pMainFrm->SetupPlayer(CMainFrame::GetSettings().m_dwQuality, n);
}
}
@@ -519,12 +519,12 @@
void CCtrlGeneral::OnLoopSongChanged()
//------------------------------------
{
- CMainFrame::gbLoopSong = IsDlgButtonChecked(IDC_CHECK_LOOPSONG);
+ CMainFrame::GetSettings().gbLoopSong = IsDlgButtonChecked(IDC_CHECK_LOOPSONG);
CModDoc *pModDoc = GetDocument();
if (pModDoc)
{
CSoundFile *pSndFile = pModDoc->GetSoundFile();
- if (pSndFile) pSndFile->SetRepeatCount((CMainFrame::gbLoopSong) ? -1 : 0);
+ if (pSndFile) pSndFile->SetRepeatCount((CMainFrame::GetSettings().gbLoopSong) ? -1 : 0);
}
}
@@ -533,12 +533,12 @@
//-------------------------------
{
BOOL b = IsDlgButtonChecked(IDC_CHECK_AGC);
- DWORD dwQuality = CMainFrame::m_dwQuality & ~QUALITY_AGC;
+ DWORD dwQuality = CMainFrame::GetSettings().m_dwQuality & ~QUALITY_AGC;
if (b) dwQuality |= QUALITY_AGC;
- if (dwQuality != CMainFrame::m_dwQuality)
+ if (dwQuality != CMainFrame::GetSettings().m_dwQuality)
{
CMainFrame *pMainFrm = CMainFrame::GetMainFrame();
- if (pMainFrm) pMainFrm->SetupPlayer(dwQuality, CMainFrame::m_nSrcMode);
+ if (pMainFrm) pMainFrm->SetupPlayer(dwQuality, CMainFrame::GetSettings().m_nSrcMode);
}
}
@@ -547,12 +547,12 @@
//---------------------------------
{
BOOL b = IsDlgButtonChecked(IDC_CHECK_BASS);
- DWORD dwQuality = CMainFrame::m_dwQuality & ~QUALITY_MEGABASS;
+ DWORD dwQuality = CMainFrame::GetSettings().m_dwQuality & ~QUALITY_MEGABASS;
if (b) dwQuality |= QUALITY_MEGABASS;
- if (dwQuality != CMainFrame::m_dwQuality)
+ if (dwQuality != CMainFrame::GetSettings().m_dwQuality)
{
CMainFrame *pMainFrm = CMainFrame::GetMainFrame();
- if (pMainFrm) pMainFrm->SetupPlayer(dwQuality, CMainFrame::m_nSrcMode);
+ if (pMainFrm) pMainFrm->SetupPlayer(dwQuality, CMainFrame::GetSettings().m_nSrcMode);
}
}
@@ -561,12 +561,12 @@
//----------------------------------
{
BOOL b = IsDlgButtonChecked(IDC_CHECK_REVERB);
- DWORD dwQuality = CMainFrame::m_dwQuality & ~QUALITY_REVERB;
+ DWORD dwQuality = CMainFrame::GetSettings().m_dwQuality & ~QUALITY_REVERB;
if (b) dwQuality |= QUALITY_REVERB;
- if (dwQuality != CMainFrame::m_dwQuality)
+ if (dwQuality != CMainFrame::GetSettings().m_dwQuality)
{
CMainFrame *pMainFrm = CMainFrame::GetMainFrame();
- if (pMainFrm) pMainFrm->SetupPlayer(dwQuality, CMainFrame::m_nSrcMode);
+ if (pMainFrm) pMainFrm->SetupPlayer(dwQuality, CMainFrame::GetSettings().m_nSrcMode);
}
}
@@ -575,12 +575,12 @@
//------------------------------------
{
BOOL b = IsDlgButtonChecked(IDC_CHECK_SURROUND);
- DWORD dwQuality = CMainFrame::m_dwQuality & ~QUALITY_SURROUND;
+ DWORD dwQuality = CMainFrame::GetSettings().m_dwQuality & ~QUALITY_SURROUND;
if (b) dwQuality |= QUALITY_SURROUND;
- if (dwQuality != CMainFrame::m_dwQuality)
+ if (dwQuality != CMainFrame::GetSettings().m_dwQuality)
{
CMainFrame *pMainFrm = CMainFrame::GetMainFrame();
- if (pMainFrm) pMainFrm->SetupPlayer(dwQuality, CMainFrame::m_nSrcMode);
+ if (pMainFrm) pMainFrm->SetupPlayer(dwQuality, CMainFrame::GetSettings().m_nSrcMode);
}
}
@@ -589,12 +589,12 @@
//-------------------------------------
{
BOOL b = IsDlgButtonChecked(IDC_CHECK_EQ);
- DWORD dwQuality = CMainFrame::m_dwQuality & ~QUALITY_EQ;
+ DWORD dwQuality = CMainFrame::GetSettings().m_dwQuality & ~QUALITY_EQ;
if (b) dwQuality |= QUALITY_EQ;
- if (dwQuality != CMainFrame::m_dwQuality)
+ if (dwQuality != CMainFrame::GetSettings().m_dwQuality)
{
CMainFrame *pMainFrm = CMainFrame::GetMainFrame();
- if (pMainFrm) pMainFrm->SetupPlayer(dwQuality, CMainFrame::m_nSrcMode);
+ if (pMainFrm) pMainFrm->SetupPlayer(dwQuality, CMainFrame::GetSettings().m_nSrcMode);
}
}
Modified: trunk/OpenMPT/mptrack/Ctrl_gen.h
===================================================================
--- trunk/OpenMPT/mptrack/Ctrl_gen.h 2011-07-22 23:02:11 UTC (rev 926)
+++ trunk/OpenMPT/mptrack/Ctrl_gen.h 2011-07-23 19:34:13 UTC (rev 927)
@@ -33,7 +33,7 @@
{
public:
CCtrlGeneral();
- LONG* GetSplitPosRef() {return &CMainFrame::glGeneralWindowHeight;} //rewbs.varWindowSize
+ LONG* GetSplitPosRef() {return &CMainFrame::GetSettings().glGeneralWindowHeight;} //rewbs.varWindowSize
private:
void setAsDecibels(LPSTR stringToSet, double value, double valueAtZeroDB);
Modified: trunk/OpenMPT/mptrack/Ctrl_ins.cpp
===================================================================
--- trunk/OpenMPT/mptrack/Ctrl_ins.cpp 2011-07-22 23:02:11 UTC (rev 926)
+++ trunk/OpenMPT/mptrack/Ctrl_ins.cpp 2011-07-23 19:34:13 UTC (rev 927)
@@ -1436,7 +1436,7 @@
{
TCHAR szName[_MAX_FNAME], szExt[_MAX_EXT];
_tsplitpath(lpszFileName, nullptr, nullptr, szName, szExt);
- CMainFrame::SetWorkingDirectory(lpszFileName, DIR_INSTRUMENTS, true);
+ CMainFrame::GetSettings().SetWorkingDirectory(lpszFileName, DIR_INSTRUMENTS, true);
if (!pIns->name[0])
{
@@ -1672,12 +1672,12 @@
"GF1 Patches (*.pat)|*.pat|"
"Impulse Tracker Instruments (*.iti)|*.iti|"
"All Files (*.*)|*.*||",
- CMainFrame::GetWorkingDirectory(DIR_INSTRUMENTS),
+ CMainFrame::GetSettings().GetWorkingDirectory(DIR_INSTRUMENTS),
true,
&nLastIndex);
if(files.abort) return;
- CMainFrame::SetWorkingDirectory(files.workingDirectory.c_str(), DIR_INSTRUMENTS, true);
+ CMainFrame::GetSettings().SetWorkingDirectory(files.workingDirectory.c_str(), DIR_INSTRUMENTS, true);
for(size_t counter = 0; counter < files.filenames.size(); counter++)
{
@@ -1726,7 +1726,7 @@
"Impulse Tracker Instruments (*.iti)|*.iti||" :
"Impulse Tracker Instruments (*.iti)|*.iti|"
"FastTracker II Instruments (*.xi)|*.xi||",
- CMainFrame::GetWorkingDirectory(DIR_INSTRUMENTS));
+ CMainFrame::GetSettings().GetWorkingDirectory(DIR_INSTRUMENTS));
if(files.abort) return;
BeginWaitCursor();
@@ -1752,7 +1752,7 @@
strcpy(szFileName, drive);
strcat(szFileName, path);
- CMainFrame::SetWorkingDirectory(files.workingDirectory.c_str(), DIR_INSTRUMENTS);
+ CMainFrame::GetSettings().SetWorkingDirectory(files.workingDirectory.c_str(), DIR_INSTRUMENTS);
// -> CODE#0023
// -> DESC="IT project files (.itp)"
Modified: trunk/OpenMPT/mptrack/Ctrl_ins.h
===================================================================
--- trunk/OpenMPT/mptrack/Ctrl_ins.h 2011-07-22 23:02:11 UTC (rev 926)
+++ trunk/OpenMPT/mptrack/Ctrl_ins.h 2011-07-23 19:34:13 UTC (rev 927)
@@ -119,7 +119,7 @@
BOOL OpenInstrument(CSoundFile *pSndFile, UINT nInstr);
BOOL EditSample(UINT nSample);
VOID UpdateFilterText();
- LONG* GetSplitPosRef() {return &CMainFrame::glInstrumentWindowHeight;} //rewbs.varWindowSize
+ LONG* GetSplitPosRef() {return &CMainFrame::GetSettings().glInstrumentWindowHeight;} //rewbs.varWindowSize
public:
//{{AFX_VIRTUAL(CCtrlInstruments)
Modified: trunk/OpenMPT/mptrack/Ctrl_pat.cpp
===================================================================
--- trunk/OpenMPT/mptrack/Ctrl_pat.cpp 2011-07-22 23:02:11 UTC (rev 926)
+++ trunk/OpenMPT/mptrack/Ctrl_pat.cpp 2011-07-23 19:34:13 UTC (rev 927)
@@ -91,9 +91,9 @@
{
m_nInstrument = 0;
- m_bVUMeters = CMainFrame::gbPatternVUMeters;
- m_bPluginNames = CMainFrame::gbPatternPluginNames; //rewbs.patPlugNames
- m_bRecord = CMainFrame::gbPatternRecord;
+ m_bVUMeters = CMainFrame::GetSettings().gbPatternVUMeters;
+ m_bPluginNames = CMainFrame::GetSettings().gbPatternPluginNames; //rewbs.patPlugNames
+ m_bRecord = CMainFrame::GetSettings().gbPatternRecord;
m_nDetailLevel = 4;
}
@@ -143,7 +143,7 @@
m_ToolBar.AddButton(ID_PATTERNDETAIL_MED, TIMAGE_PATTERN_DETAIL_MED, TBSTYLE_CHECK, TBSTATE_ENABLED);
m_ToolBar.AddButton(ID_PATTERNDETAIL_HI, TIMAGE_PATTERN_DETAIL_HI, TBSTYLE_CHECK, TBSTATE_ENABLED|TBSTATE_CHECKED);
m_ToolBar.AddButton(ID_SEPARATOR, 0, TBSTYLE_SEP);
- m_ToolBar.AddButton(ID_OVERFLOWPASTE, TIMAGE_PATTERN_OVERFLOWPASTE, TBSTYLE_CHECK, ((CMainFrame::m_dwPatternSetup & PATTERN_OVERFLOWPASTE) ? TBSTATE_CHECKED : 0) | TBSTATE_ENABLED);
+ m_ToolBar.AddButton(ID_OVERFLOWPASTE, TIMAGE_PATTERN_OVERFLOWPASTE, TBSTYLE_CHECK, ((CMainFrame::GetSettings().m_dwPatternSetup & PATTERN_OVERFLOWPASTE) ? TBSTATE_CHECKED : 0) | TBSTATE_ENABLED);
// Special edit controls -> tab switch to view
m_EditSequence.SetParent(this);
@@ -154,12 +154,12 @@
m_EditOrderListMargins.SetLimitText(3);
// Spin controls
m_SpinSpacing.SetRange(0, MAX_SPACING);
- m_SpinSpacing.SetPos(CMainFrame::gnPatternSpacing);
+ m_SpinSpacing.SetPos(CMainFrame::GetSettings().gnPatternSpacing);
m_SpinInstrument.SetRange(-1, 1);
m_SpinInstrument.SetPos(0);
- if(CMainFrame::gbShowHackControls == true)
+ if(CMainFrame::GetSettings().gbShowHackControls == true)
{
m_SpinOrderListMargins.ShowWindow(SW_SHOW);
m_EditOrderListMargins.ShowWindow(SW_SHOW);
@@ -172,9 +172,9 @@
m_EditOrderListMargins.ShowWindow(SW_HIDE);
}
- SetDlgItemInt(IDC_EDIT_SPACING, CMainFrame::gnPatternSpacing);
+ SetDlgItemInt(IDC_EDIT_SPACING, CMainFrame::GetSettings().gnPatternSpacing);
SetDlgItemInt(IDC_EDIT_ORDERLIST_MARGINS, m_OrderList.GetMargins());
- CheckDlgButton(IDC_PATTERN_FOLLOWSONG, !(CMainFrame::m_dwPatternSetup & PATTERN_FOLLOWSONGOFF)); //rewbs.noFollow - set to unchecked
+ CheckDlgButton(IDC_PATTERN_FOLLOWSONG, !(CMainFrame::GetSettings().m_dwPatternSetup & PATTERN_FOLLOWSONGOFF)); //rewbs.noFollow - set to unchecked
m_SpinSequence.SetRange(0, m_pSndFile->Order.GetNumSequences() - 1);
m_SpinSequence.SetPos(m_pSndFile->Order.GetCurrentSequenceIndex());
@@ -264,8 +264,8 @@
m_ToolBar.UpdateStyle();
// -> CODE#0007
// -> DESC="uncheck follow song checkbox by default"
- //CheckDlgButton(IDC_PATTERN_FOLLOWSONG, (CMainFrame::m_dwPatternSetup & PATTERN_FOLLOWSONGOFF) ? MF_UNCHECKED : MF_CHECKED);
- m_ToolBar.SetState(ID_OVERFLOWPASTE, ((CMainFrame::m_dwPatternSetup & PATTERN_OVERFLOWPASTE) ? TBSTATE_CHECKED : 0) | TBSTATE_ENABLED);
+ //CheckDlgButton(IDC_PATTERN_FOLLOWSONG, (CMainFrame::GetSettings().m_dwPatternSetup & PATTERN_FOLLOWSONGOFF) ? MF_UNCHECKED : MF_CHECKED);
+ m_ToolBar.SetState(ID_OVERFLOWPASTE, ((CMainFrame::GetSettings().m_dwPatternSetup & PATTERN_OVERFLOWPASTE) ? TBSTATE_CHECKED : 0) | TBSTATE_ENABLED);
// -! BEHAVIOUR_CHANGE#0007
}
if (dwHintMask & (HINT_MODTYPE|HINT_INSNAMES|HINT_SMPNAMES|HINT_PATNAMES))
@@ -436,7 +436,7 @@
case CTRLMSG_SETRECORD:
if (lParam >= 0) m_bRecord = (BOOL)(lParam); else m_bRecord = !m_bRecord;
m_ToolBar.SetState(IDC_PATTERN_RECORD, ((m_bRecord) ? TBSTATE_CHECKED : 0)|TBSTATE_ENABLED);
- CMainFrame::gbPatternRecord = m_bRecord;
+ CMainFrame::GetSettings().gbPatternRecord = m_bRecord;
SendViewMessage(VIEWMSG_SETRECORD, m_bRecord);
break;
@@ -701,13 +701,13 @@
{
if ((m_EditSpacing.m_hWnd) && (m_EditSpacing.GetWindowTextLength() > 0))
{
- CMainFrame::gnPatternSpacing = GetDlgItemInt(IDC_EDIT_SPACING);
- if (CMainFrame::gnPatternSpacing > MAX_SPACING)
+ CMainFrame::GetSettings().gnPatternSpacing = GetDlgItemInt(IDC_EDIT_SPACING);
+ if (CMainFrame::GetSettings().gnPatternSpacing > MAX_SPACING)
{
- CMainFrame::gnPatternSpacing = MAX_SPACING;
- SetDlgItemInt(IDC_EDIT_SPACING, CMainFrame::gnPatternSpacing, FALSE);
+ CMainFrame::GetSettings().gnPatternSpacing = MAX_SPACING;
+ SetDlgItemInt(IDC_EDIT_SPACING, CMainFrame::GetSettings().gnPatternSpacing, FALSE);
}
- SendViewMessage(VIEWMSG_SETSPACING, CMainFrame::gnPatternSpacing);
+ SendViewMessage(VIEWMSG_SETSPACING, CMainFrame::GetSettings().gnPatternSpacing);
}
}
@@ -940,7 +940,7 @@
{
UINT nState = m_ToolBar.GetState(IDC_PATTERN_RECORD);
m_bRecord = ((nState & TBSTATE_CHECKED) != 0);
- CMainFrame::gbPatternRecord = m_bRecord;
+ CMainFrame::GetSettings().gbPatternRecord = m_bRecord;
SendViewMessage(VIEWMSG_SETRECORD, m_bRecord);
SwitchToView();
}
@@ -951,7 +951,7 @@
{
UINT nState = m_ToolBar.GetState(ID_PATTERN_VUMETERS);
m_bVUMeters = ((nState & TBSTATE_CHECKED) != 0);
- CMainFrame::gbPatternVUMeters = m_bVUMeters;
+ CMainFrame::GetSettings().gbPatternVUMeters = m_bVUMeters;
SendViewMessage(VIEWMSG_SETVUMETERS, m_bVUMeters);
SwitchToView();
}
@@ -962,7 +962,7 @@
{
UINT nState = m_ToolBar.GetState(ID_VIEWPLUGNAMES);
m_bPluginNames = ((nState & TBSTATE_CHECKED) != 0);
- CMainFrame::gbPatternPluginNames = m_bPluginNames;
+ CMainFrame::GetSettings().gbPatternPluginNames = m_bPluginNames;
SendViewMessage(VIEWMSG_SETPLUGINNAMES, m_bPluginNames);
SwitchToView();
}
@@ -1191,7 +1191,7 @@
void CCtrlPatterns::OnToggleOverflowPaste()
//-------------------------------------
{
- CMainFrame::m_dwPatternSetup ^= PATTERN_OVERFLOWPASTE;
+ CMainFrame::GetSettings().m_dwPatternSetup ^= PATTERN_OVERFLOWPASTE;
UpdateView(HINT_MPTOPTIONS, NULL);
SwitchToView();
}
Modified: trunk/OpenMPT/mptrack/Ctrl_pat.h
===================================================================
--- trunk/OpenMPT/mptrack/Ctrl_pat.h 2011-07-22 23:02:11 UTC (rev 926)
+++ trunk/OpenMPT/mptrack/Ctrl_pat.h 2011-07-23 19:34:13 UTC (rev 927)
@@ -30,7 +30,7 @@
ORDERINDEX m_nDragOrder;
//To tell how many orders('orderboxes') to show at least
//on both sides of current order(when updating orderslist position).
- BYTE m_nOrderlistMargins;
+ int m_nOrderlistMargins;
CModDoc *m_pModDoc;
CCtrlPatterns *m_pParent;
@@ -38,8 +38,6 @@
COrderList();
virtual ~COrderList() {}
- static BYTE s_nDefaultMargins;
-
public:
BOOL Init(const CRect&, CCtrlPatterns *pParent, CModDoc *, HFONT hFont);
void InvalidateSelection() const;
@@ -176,7 +174,7 @@
public:
CCtrlPatterns();
- LONG* GetSplitPosRef() {return &CMainFrame::glPatternWindowHeight;} //rewbs.varWindowSize
+ LONG* GetSplitPosRef() {return &CMainFrame::GetSettings().glPatternWindowHeight;} //rewbs.varWindowSize
public:
void SetCurrentPattern(PATTERNINDEX nPat);
Modified: trunk/OpenMPT/mptrack/Ctrl_seq.cpp
===================================================================
--- trunk/OpenMPT/mptrack/Ctrl_seq.cpp 2011-07-22 23:02:11 UTC (rev 926)
+++ trunk/OpenMPT/mptrack/Ctrl_seq.cpp 2011-07-23 19:34:13 UTC (rev 927)
@@ -68,8 +68,6 @@
END_MESSAGE_MAP()
-BYTE COrderList::s_nDefaultMargins = 0;
-
bool COrderList::IsOrderInMargins(int order, int startOrder)
//----------------------------------------------------------
{
@@ -111,7 +109,7 @@
m_pModDoc = nullptr;
m_nScrollPos = m_nXScroll = 0;
m_nScrollPos2nd = ORDERINDEX_INVALID;
- m_nOrderlistMargins = s_nDefaultMargins;
+ m_nOrderlistMargins = CMainFrame::GetSettings().orderlistMargins;
m_bScrolling = false;
m_bDragging = false;
}
@@ -721,7 +719,7 @@
// MOD orderlist always ends after first empty pattern
const ORDERINDEX nLength = (pSndFile->GetType() & MOD_TYPE_MOD) ? pSndFile->Order.GetLengthFirstEmpty() : pSndFile->Order.GetLengthTailTrimmed();
- if(CMainFrame::m_dwPatternSetup & PATTERN_HEXDISPLAY)
+ if(CMainFrame::GetSettings().m_dwPatternSetup & PATTERN_HEXDISPLAY)
{
wsprintf(s, "Position %02Xh of %02Xh", m_nScrollPos, nLength);
}
@@ -1385,7 +1383,7 @@
BYTE COrderList::SetMargins(int i)
//--------------------------------
{
- m_nOrderlistMargins = static_cast<BYTE>(i);
+ m_nOrderlistMargins = i;
return GetMargins();
}
Modified: trunk/OpenMPT/mptrack/Ctrl_smp.cpp
===================================================================
--- trunk/OpenMPT/mptrack/Ctrl_smp.cpp 2011-07-22 23:02:11 UTC (rev 926)
+++ trunk/OpenMPT/mptrack/Ctrl_smp.cpp 2011-07-23 19:34:13 UTC (rev 927)
@@ -796,7 +796,7 @@
if (bOk)
{
MODSAMPLE *pSmp = &m_pSndFile->Samples[m_nSample];
- CMainFrame::SetWorkingDirectory(lpszFileName, DIR_SAMPLES, true);
+ CMainFrame::GetSettings().SetWorkingDirectory(lpszFileName, DIR_SAMPLES, true);
if (!pSmp->filename[0])
{
CHAR szFullFilename[_MAX_PATH];
@@ -951,12 +951,12 @@
"AIFF Files (*.aiff;*.8svx)|*.aif;*.aiff;*.8sv;*.8svx;*.svx|"
"Raw Samples (*.raw,*.snd,*.pcm)|*.raw;*.snd;*.pcm|"
"All Files (*.*)|*.*||",
- CMainFrame::GetWorkingDirectory(DIR_SAMPLES),
+ CMainFrame::GetSettings().GetWorkingDirectory(DIR_SAMPLES),
true,
&nLastIndex);
if(files.abort) return;
- CMainFrame::SetWorkingDirectory(files.workingDirectory.c_str(), DIR_SAMPLES, true);
+ CMainFrame::GetSettings().SetWorkingDirectory(files.workingDirectory.c_str(), DIR_SAMPLES, true);
for(size_t counter = 0; counter < files.filenames.size(); counter++)
{
@@ -1025,7 +1025,7 @@
FileDlgResult files = CTrackApp::ShowOpenSaveFileDialog(false, "wav", szFileName,
"Wave File (*.wav)|*.wav|"
"RAW Audio (*.raw)|*.raw||",
- CMainFrame::GetWorkingDirectory(DIR_SAMPLES));
+ CMainFrame::GetSettings().GetWorkingDirectory(DIR_SAMPLES));
if(files.abort) return;
BeginWaitCursor();
@@ -1076,7 +1076,7 @@
ErrorBox(IDS_ERR_SAVESMP, this);
} else
{
- CMainFrame::SetWorkingDirectory(files.workingDirectory.c_str(), DIR_SAMPLES, true);
+ CMainFrame::GetSettings().SetWorkingDirectory(files.workingDirectory.c_str(), DIR_SAMPLES, true);
}
SwitchToView();
}
Modified: trunk/OpenMPT/mptrack/Ctrl_smp.h
===================================================================
--- trunk/OpenMPT/mptrack/Ctrl_smp.h 2011-07-22 23:02:11 UTC (rev 926)
+++ trunk/OpenMPT/mptrack/Ctrl_smp.h 2011-07-23 19:34:13 UTC (rev 927)
@@ -55,7 +55,7 @@
bool SetCurrentSample(SAMPLEINDEX nSmp, LONG lZoom = -1, bool bUpdNum = true);
bool OpenSample(LPCSTR lpszFileName);
bool OpenSample(CSoundFile *pSndFile, SAMPLEINDEX nSample);
- LONG* GetSplitPosRef() {return &CMainFrame::glSampleWindowHeight;} //rewbs.varWindowSize
+ LONG* GetSplitPosRef() {return &CMainFrame::GetSettings().glSampleWindowHeight;} //rewbs.varWindowSize
public:
//{{AFX_VIRTUAL(CCtrlSamples)
Modified: trunk/OpenMPT/mptrack/Draw_pat.cpp
===================================================================
--- trunk/OpenMPT/mptrack/Draw_pat.cpp 2011-07-22 23:02:11 UTC (rev 926)
+++ trunk/OpenMPT/mptrack/Draw_pat.cpp 2011-07-23 19:34:13 UTC (rev 927)
@@ -136,7 +136,7 @@
inline PCPATTERNFONT GetCurrentPatternFont()
//------------------------------------------
{
- return (CMainFrame::m_dwPatternSetup & PATTERN_SMALLFONT) ? &gSmallPatternFont : &gDefaultPatternFont;
+ return (CMainFrame::GetSettings().m_dwPatternSetup & PATTERN_SMALLFONT) ? &gSmallPatternFont : &gDefaultPatternFont;
}
@@ -158,15 +158,15 @@
{
BYTE r,g,b;
- m_Dib.SetAllColors(0, MAX_MODCOLORS, CMainFrame::rgbCustomColors);
- r = hilightcolor(GetRValue(CMainFrame::rgbCustomColors[MODCOLOR_BACKHILIGHT]),
- GetRValue(CMainFrame::rgbCustomColors[MODCOLOR_BACKNORMAL]));
- g = hilightcolor(GetGValue(CMainFrame::rgbCustomColors[MODCOLOR_BACKHILIGHT]),
- GetGValue(CMainFrame::rgbCustomColors[MODCOLOR_BACKNORMAL]));
- b = hilightcolor(GetBValue(CMainFrame::rgbCustomColors[MODCOLOR_BACKHILIGHT]),
- GetBValue(CMainFrame::rgbCustomColors[MODCOLOR_BACKNORMAL]));
+ m_Dib.SetAllColors(0, MAX_MODCOLORS, CMainFrame::GetSettings().rgbCustomColors);
+ r = hilightcolor(GetRValue(CMainFrame::GetSettings().rgbCustomColors[MODCOLOR_BACKHILIGHT]),
+ GetRValue(CMainFrame::GetSettings().rgbCustomColors[MODCOLOR_BACKNORMAL]));
+ g = hilightcolor(GetGValue(CMainFrame::GetSettings().rgbCustomColors[MODCOLOR_BACKHILIGHT]),
+ GetGValue(CMainFrame::GetSettings().rgbCustomColors[MODCOLOR_BACKNORMAL]));
+ b = hilightcolor(GetBValue(CMainFrame::GetSettings().rgbCustomColors[MODCOLOR_BACKHILIGHT]),
+ GetBValue(CMainFrame::GetSettings().rgbCustomColors[MODCOLOR_BACKNORMAL]));
m_Dib.SetColor(MODCOLOR_2NDHIGHLIGHT, RGB(r,g,b));
- m_Dib.SetBlendColor(CMainFrame::rgbCustomColors[MODCOLOR_BLENDCOLOR]);
+ m_Dib.SetBlendColor(CMainFrame::GetSettings().rgbCustomColors[MODCOLOR_BLENDCOLOR]);
}
@@ -612,7 +612,7 @@
BOOL bPrevPatFound = FALSE;
// Display previous pattern
- if (CMainFrame::m_dwPatternSetup & PATTERN_SHOWPREVIOUS)
+ if (CMainFrame::GetSettings().m_dwPatternSetup & PATTERN_SHOWPREVIOUS)
{
const ORDERINDEX startOrder = static_cast<ORDERINDEX>(SendCtrlMessage(CTRLMSG_GETCURRENTORDER));
if(startOrder > 0)
@@ -657,7 +657,7 @@
DrawPatternData(hdc, pSndFile, m_nPattern, TRUE, (pMainFrm->GetModPlaying() == pModDoc) ? TRUE : FALSE,
yofs, nrows, xofs, rcClient, &ypaint);
// Display next pattern
- if ((CMainFrame::m_dwPatternSetup & PATTERN_SHOWPREVIOUS) && (ypaint < rcClient.bottom) && (ypaint == ypatternend))
+ if ((CMainFrame::GetSettings().m_dwPatternSetup & PATTERN_SHOWPREVIOUS) && (ypaint < rcClient.bottom) && (ypaint == ypatternend))
{
int nVisRows = (rcClient.bottom - ypaint + m_szCell.cy - 1) / m_szCell.cy;
if ((nVisRows > 0) && (m_nMidRow))
@@ -777,7 +777,7 @@
{
UINT col, xbmp, nbmp, oldrowcolor;
- wsprintf(s, (CMainFrame::m_dwPatternSetup & PATTERN_HEXDISPLAY) ? "%02X" : "%d", row);
+ wsprintf(s, (CMainFrame::GetSettings().m_dwPatternSetup & PATTERN_HEXDISPLAY) ? "%02X" : "%d", row);
rect.left = 0;
rect.top = ypaint;
rect.right = rcClient.right;
@@ -803,7 +803,7 @@
nMeasure = pSndFile->Patterns[nPattern].GetRowsPerMeasure();
}
// secondary highlight (beats)
- if ((CMainFrame::m_dwPatternSetup & PATTERN_2NDHIGHLIGHT)
+ if ((CMainFrame::GetSettings().m_dwPatternSetup & PATTERN_2NDHIGHLIGHT)
&& (nBeat) && (nBeat < nrows))
{
if (!(row % nBeat))
@@ -812,7 +812,7 @@
}
}
// primary highlight (measures)
- if ((CMainFrame::m_dwPatternSetup & PATTERN_STDHIGHLIGHT)
+ if ((CMainFrame::GetSettings().m_dwPatternSetup & PATTERN_STDHIGHLIGHT)
&& (nMeasure) && (nMeasure < nrows))
{
if (!(row % nMeasure))
@@ -905,7 +905,7 @@
{
tx_col = row_col;
bk_col = row_bkcol;
- if ((CMainFrame::m_dwPatternSetup & PATTERN_EFFECTHILIGHT) && (m->note) && (m->note <= NOTE_MAX))
+ if ((CMainFrame::GetSettings().m_dwPatternSetup & PATTERN_EFFECTHILIGHT) && (m->note) && (m->note <= NOTE_MAX))
{
tx_col = MODCOLOR_NOTE;
// Highlight notes that are not supported by the Amiga (for S3M this is not always correct)
@@ -932,7 +932,7 @@
{
tx_col = row_col;
bk_col = row_bkcol;
- if ((CMainFrame::m_dwPatternSetup & PATTERN_EFFECTHILIGHT) && (m->instr))
+ if ((CMainFrame::GetSettings().m_dwPatternSetup & PATTERN_EFFECTHILIGHT) && (m->instr))
{
tx_col = MODCOLOR_INSTRUMENT;
}
@@ -959,7 +959,7 @@
tx_col = MODCOLOR_TEXTSELECTED;
bk_col = MODCOLOR_BACKSELECTED;
} else
- if ((!m->IsPcNote()) && (m->volcmd) && (m->volcmd < MAX_VOLCMDS) && (CMainFrame::m_dwPatternSetup & PATTERN_EFFECTHILIGHT))
+ if ((!m->IsPcNote()) && (m->volcmd) && (m->volcmd < MAX_VOLCMDS) && (CMainFrame::GetSettings().m_dwPatternSetup & PATTERN_EFFECTHILIGHT))
{
if(volEffectColors[m->volcmd] != 0)
tx_col = volEffectColors[m->volcmd];
@@ -977,7 +977,7 @@
uint16 val = m->GetValueEffectCol();
if(val > MODCOMMAND::maxColumnValue) val = MODCOMMAND::maxColumnValue;
fx_col = row_col;
- if (!isPCnote && (m->command) && (m->command < MAX_EFFECTS) && (CMainFrame::m_dwPatternSetup & PATTERN_EFFECTHILIGHT))
+ if (!isPCnote && (m->command) && (m->command < MAX_EFFECTS) && (CMainFrame::GetSettings().m_dwPatternSetup & PATTERN_EFFECTHILIGHT))
{
if(effectColors[m->command] != 0)
fx_col = effectColors[m->command];
@@ -1216,7 +1216,7 @@
sizePage.cy = sizeLine.cy * 8;
GetClientRect(&rect);
m_nMidRow = 0;
- if (CMainFrame::m_dwPatternSetup & PATTERN_CENTERROW) m_nMidRow = (rect.Height() - m_szHeader.cy) / (m_szCell.cy << 1);
+ if (CMainFrame::GetSettings().m_dwPatternSetup & PATTERN_CENTERROW) m_nMidRow = (rect.Height() - m_szHeader.cy) / (m_szCell.cy << 1);
if (m_nMidRow) sizeTotal.cy += m_nMidRow * m_szCell.cy * 2;
SetScrollSizes(MM_TEXT, sizeTotal, sizePage, sizeLine);
//UpdateScrollPos(); //rewbs.FixLPsOddScrollingIssue
Modified: trunk/OpenMPT/mptrack/Globals.cpp
===================================================================
--- trunk/OpenMPT/mptrack/Globals.cpp 2011-07-22 23:02:11 UTC (rev 926)
+++ trunk/OpenMPT/mptrack/Globals.cpp 2011-07-23 19:34:13 UTC (rev 927)
@@ -716,7 +716,7 @@
if (m_hWnd)
{
LONG lStyleOld = GetWindowLong(m_hWnd, GWL_STYLE);
- if (CMainFrame::m_dwPatternSetup & PATTERN_FLATBUTTONS)
+ if (CMainFrame::GetSettings().m_dwPatternSetup & PATTERN_FLATBUTTONS)
lStyleOld |= TBSTYLE_FLAT;
else
lStyleOld &= ~TBSTYLE_FLAT;
Modified: trunk/OpenMPT/mptrack/InputHandler.cpp
===================================================================
--- trunk/OpenMPT/mptrack/InputHandler.cpp 2011-07-22 23:02:11 UTC (rev 926)
+++ trunk/OpenMPT/mptrack/InputHandler.cpp 2011-07-23 19:34:13 UTC (rev 927)
@@ -26,7 +26,7 @@
if (sDefaultPath.GetLength() > MAX_PATH - 1)
sDefaultPath = "";
- const bool bNoExistingKbdFileSetting = (CMainFrame::m_szKbdFile[0] == 0);
+ const bool bNoExistingKbdFileSetting = (CMainFrame::GetSettings().m_szKbdFile[0] == 0);
// 1. Try to load keybindings from the path saved in the settings.
// 2. If the setting doesn't exist or the loading fails, try to load from default location.
@@ -34,10 +34,10 @@
// 4. If there were no keybinging setting already, create a keybinding file to default location
// and set it's path to settings.
- if (bNoExistingKbdFileSetting || !(activeCommandSet->LoadFile(CMainFrame::m_szKbdFile)))
+ if (bNoExistingKbdFileSetting || !(activeCommandSet->LoadFile(CMainFrame::GetSettings().m_szKbdFile)))
{
if (bNoExistingKbdFileSetting)
- _tcscpy(CMainFrame::m_szKbdFile, sDefaultPath);
+ _tcscpy(CMainFrame::GetSettings().m_szKbdFile, sDefaultPath);
bool bSuccess = false;
if (PathFileExists(sDefaultPath) == TRUE)
bSuccess = activeCommandSet->LoadFile(sDefaultPath);
@@ -54,14 +54,14 @@
bSuccess = activeCommandSet->LoadFile(iStrm, TEXT("\"executable resource\""));
FreeResource(hglob);
if (bSuccess && bNoExistingKbdFileSetting)
- activeCommandSet->SaveFile(CMainFrame::m_szKbdFile, false);
+ activeCommandSet->SaveFile(CMainFrame::GetSettings().m_szKbdFile, false);
}
}
if (bSuccess == false)
AfxMessageBox(IDS_UNABLE_TO_LOAD_KEYBINDINGS, MB_ICONERROR);
}
// We will only overwrite the default Keybindings.mkb file from now on.
- _tcscpy(CMainFrame::m_szKbdFile, sDefaultPath);
+ _tcscpy(CMainFrame::GetSettings().m_szKbdFile, sDefaultPath);
//Get Keymap
activeCommandSet->GenKeyMap(keyMap);
Modified: trunk/OpenMPT/mptrack/KeyConfigDlg.cpp
===================================================================
--- trunk/OpenMPT/mptrack/KeyConfigDlg.cpp 2011-07-22 23:02:11 UTC (rev 926)
+++ trunk/OpenMPT/mptrack/KeyConfigDlg.cpp 2011-07-23 19:34:13 UTC (rev 927)
@@ -134,12 +134,12 @@
//-----------------------------------
{
CPropertyPage::OnInitDialog();
- m_nCurCategory=-1;
- m_nCurHotKey=-1;
- m_nCurKeyChoice=-1;
- m_bModified=false;
- m_bChoiceModified=false;
- m_sFullPathName=CMainFrame::m_szKbdFile;
+ m_nCurCategory = -1;
+ m_nCurHotKey = -1;
+ m_nCurKeyChoice = -1;
+ m_bModified = false;
+ m_bChoiceModified = false;
+ m_sFullPathName = CMainFrame::GetSettings().m_szKbdFile;
plocalCmdSet = new CCommandSet();
plocalCmdSet->Copy(CMainFrame::GetInputHandler()->activeCommandSet);
@@ -159,7 +159,7 @@
m_eReport.SetWindowText("");
CString s;
- s.Format("%d", CMainFrame::gnAutoChordWaitTime);
+ s.Format("%d", CMainFrame::GetSettings().gnAutoChordWaitTime);
m_eChordWaitTime.SetWindowText(s);
return TRUE;
}
@@ -622,7 +622,7 @@
CString cs;
m_eChordWaitTime.GetWindowText(cs);
- CMainFrame::gnAutoChordWaitTime = atoi(cs);
+ CMainFrame::GetSettings().gnAutoChordWaitTime = atoi(cs);
CPropertyPage::OnOK();
}
@@ -639,7 +639,7 @@
std::string filename = m_sFullPathName;
FileDlgResult files = CTrackApp::ShowOpenSaveFileDialog(true, "mkb", filename,
"OpenMPT Key Bindings (*.mkb)|*.mkb||",
- CMainFrame::m_szKbdFile);
+ CMainFrame::GetSettings().m_szKbdFile);
if(files.abort) return;
m_sFullPathName = files.first_file.c_str();
@@ -653,7 +653,7 @@
std::string filename = m_sFullPathName;
FileDlgResult files = CTrackApp::ShowOpenSaveFileDialog(false, "mkb", filename,
"OpenMPT Key Bindings (*.mkb)|*.mkb||",
- CMainFrame::m_szKbdFile);
+ CMainFrame::GetSettings().m_szKbdFile);
if(files.abort) return;
m_sFullPathName = files.first_file.c_str();
@@ -663,11 +663,11 @@
bool COptionsKeyboard::TentativeSetToDefaultFile(CString m_sFullPathName)
{
- if (m_sFullPathName.Compare(CMainFrame::m_szKbdFile))
+ if (m_sFullPathName.Compare(CMainFrame::GetSettings().m_szKbdFile))
{
if (AfxMessageBox("Load this keyboard config file when MPT starts up?", MB_YESNO) == IDYES)
{
- strcpy(CMainFrame::m_szKbdFile,m_sFullPathName);
+ strcpy(CMainFrame::GetSettings().m_szKbdFile,m_sFullPathName);
OnSettingsChanged(); // Enable "apply" button
UpdateDialog();
return true;
Modified: trunk/OpenMPT/mptrack/MainFrm.cpp
===================================================================
--- trunk/OpenMPT/mptrack/MainFrm.cpp 2011-07-22 23:02:11 UTC (rev 926)
+++ trunk/OpenMPT/mptrack/MainFrm.cpp 2011-07-23 19:34:13 UTC (rev 927)
@@ -32,17 +32,9 @@
static char THIS_FILE[] = __FILE__;
#endif
-#define MAINFRAME_REGKEY_BASE "Software\\Olivier Lapicque\\"
-#define MAINFRAME_REGKEY_DEFAULT "ModPlug Tracker"
-#define MAINFRAME_REGEXT_WINDOW "\\Window"
-#define MAINFRAME_REGEXT_SETTINGS "\\Settings"
-
#define MPTTIMER_PERIOD 200
-extern UINT gnMidiImportSpeed;
-extern UINT gnMidiPatternLen;
-
//========================================
class CMPTSoundSource: public ISoundSource
//========================================
@@ -121,46 +113,13 @@
static DWORD gsdwTotalSamples = 0;
static DWORD gdwPlayLatency = 0;
+TrackerSettings CMainFrame::m_Settings;
+
// Globals
-UINT CMainFrame::gnPatternSpacing = 0;
-BOOL CMainFrame::gbPatternRecord = TRUE;
-BOOL CMainFrame::gbPatternVUMeters = FALSE;
-BOOL CMainFrame::gbPatternPluginNames = TRUE;
DWORD CMainFrame::gdwNotificationType = MPTNOTIFY_DEFAULT;
UINT CMainFrame::m_nLastOptionsPage = 0;
-BOOL CMainFrame::gbMdiMaximize = FALSE;
-bool CMainFrame::gbShowHackControls = false;
-//rewbs.varWindowSize
-LONG CMainFrame::glGeneralWindowHeight = 178;
-LONG CMainFrame::glPatternWindowHeight = 152;
-LONG CMainFrame::glSampleWindowHeight = 188;
-LONG CMainFrame::glInstrumentWindowHeight = 300;
-LONG CMainFrame::glCommentsWindowHeight = 288;
-LONG CMainFrame::glGraphWindowHeight = 288; //rewbs.graph
-//end rewbs.varWindowSize
-LONG CMainFrame::glTreeWindowWidth = 160;
-LONG CMainFrame::glTreeSplitRatio = 128;
HHOOK CMainFrame::ghKbdHook = NULL;
-CString CMainFrame::gcsPreviousVersion = "";
-CString CMainFrame::gcsInstallGUID = "";
-DWORD CMainFrame::gnHotKeyMask = 0;
-// Audio Setup
-//rewbs.resamplerConf
-long CMainFrame::glVolumeRampSamples = 42;
-double CMainFrame::gdWFIRCutoff = 0.97;
-BYTE CMainFrame::gbWFIRType = 7; //WFIR_KAISER4T;
-//end rewbs.resamplerConf
-UINT CMainFrame::gnAutoChordWaitTime = 60;
-
-int CMainFrame::gnPlugWindowX = 243;
-int CMainFrame::gnPlugWindowY = 273;
-int CMainFrame::gnPlugWindowWidth = 370;
-int CMainFrame::gnPlugWindowHeight = 332;
-DWORD CMainFrame::gnPlugWindowLast = 0;
-
-uint32 CMainFrame::gnMsgBoxVisiblityFlags = uint32_max;
-
CRITICAL_SECTION CMainFrame::m_csAudio;
HANDLE CMainFrame::m_hPlayThread = NULL;
DWORD CMainFrame::m_dwPlayThreadId = 0;
@@ -173,35 +132,8 @@
LONG CMainFrame::sdwSamplesPerSec = 44100;
LONG CMainFrame::sdwAudioBufferSize = MAX_AUDIO_BUFFERSIZE;
UINT CMainFrame::gdwIdleTime = 0;
-DWORD CMainFrame::m_dwRate = 44100;
-DWORD CMainFrame::m_dwSoundSetup = SOUNDSETUP_SECONDARY;
-DWORD CMainFrame::m_nChannels = 2;
-DWORD CMainFrame::m_dwQuality = 0;
-DWORD CMainFrame::m_nSrcMode = SRCMODE_LINEAR;
-DWORD CMainFrame::m_nBitsPerSample = 16;
-DWORD CMainFrame::m_nPreAmp = 128;
-DWORD CMainFrame::gbLoopSong = TRUE;
-#ifndef NO_DSOUND
-LONG CMainFrame::m_nWaveDevice = SNDDEV_BUILD_ID(0, SNDDEV_DSOUND);
-#else
-LONG CMainFrame::m_nWaveDevice = SNDDEV_BUILD_ID(0, SNDDEV_WAVEOUT);
-#endif // NO_DSOUND
-LONG CMainFrame::m_nMidiDevice = 0;
-DWORD CMainFrame::m_nBufferLength = 75;
LONG CMainFrame::gnLVuMeter = 0;
LONG CMainFrame::gnRVuMeter = 0;
-EQPRESET CMainFrame::m_EqSettings = { "", {16,16,16,16,16,16}, { 125, 300, 600, 1250, 4000, 8000 } };
-// Midi Setup
-DWORD CMainFrame::m_dwMidiSetup = MIDISETUP_RECORDVELOCITY|MIDISETUP_RECORDNOTEOFF;
-// Pattern Setup
-DWORD CMainFrame::m_dwPatternSetup = PATTERN_PLAYNEWNOTE | PATTERN_EFFECTHILIGHT
- | PATTERN_SMALLFONT | PATTERN_CENTERROW
- | PATTERN_DRAGNDROPEDIT | PATTERN_FLATBUTTONS | PATTERN_NOEXTRALOUD
- | PATTERN_2NDHIGHLIGHT | PATTERN_STDHIGHLIGHT /*| PATTERN_HILITETIMESIGS*/
- | PATTERN_SHOWPREVIOUS | PATTERN_CONTSCROLL | PATTERN_SYNCMUTE | PATTERN_AUTODELAY | PATTERN_NOTEFADE;
-DWORD CMainFrame::m_nRowSpacing = 16; // primary highlight (measures)
-DWORD CMainFrame::m_nRowSpacing2 = 4; // secondary highlight (beats)
-UINT CMainFrame::m_nSampleUndoMaxBuffer = 0; // Real sample buffer undo size will be set later.
// GDI
HICON CMainFrame::m_hIcon = NULL;
@@ -248,33 +180,7 @@
LPMODPLUGDIB CMainFrame::bmpVisNode = NULL;
LPMODPLUGDIB CMainFrame::bmpVisPcNode = NULL;
HPEN CMainFrame::gpenVuMeter[NUM_VUMETER_PENS*2];
-COLORREF CMainFrame::rgbCustomColors[MAX_MODCOLORS] =
- {
- RGB(0xFF, 0xFF, 0xFF), RGB(0x00, 0x00, 0x00), RGB(0xC0, 0xC0, 0xC0), RGB(0x00, 0x00, 0x00), RGB(0x00, 0x00, 0x00), RGB(0xFF, 0xFF, 0xFF), 0x0000FF,
- RGB(0xFF, 0xFF, 0x80), RGB(0x00, 0x00, 0x00), RGB(0xE0, 0xE8, 0xE0),
- // Effect Colors
- RGB(0x00, 0x00, 0x80), RGB(0x00, 0x80, 0x80), RGB(0x00, 0x80, 0x00), RGB(0x00, 0x80, 0x80), RGB(0x80, 0x80, 0x00), RGB(0x80, 0x00, 0x00), RGB(0x00, 0x00, 0xFF),
- // VU-Meters
- RGB(0x00, 0xC8, 0x00), RGB(0xFF, 0xC8, 0x00), RGB(0xE1, 0x00, 0x00),
- // Channel separators
- GetSysColor(COLOR_BTNSHADOW), GetSysColor(COLOR_BTNFACE), GetSysColor(COLOR_BTNHIGHLIGHT),
- // Blend colour
- GetSysColor(COLOR_BTNFACE),
- // Dodgy commands
- RGB(0xC0, 0x00, 0x00),
- };
-// Directory Arrays (Default + Last)
-TCHAR CMainFrame::m_szDefaultDirectory[NUM_DIRS][_MAX_PATH] = {0};
-TCHAR CMainFrame::m_szWorkingDirectory[NUM_DIRS][_MAX_PATH] = {0};
-TCHAR CMainFrame::m_szKbdFile[_MAX_PATH] = ""; //rewbs.customKeys
-// Directory to INI setting translation
-const TCHAR CMainFrame::m_szDirectoryToSettingsName[NUM_DIRS][32] =
-{
- _T("Songs_Directory"), _T("Samples_Directory"), _T("Instruments_Directory"), _T("Plugins_Directory"), _T("Plugin_Presets_Directory"), _T("Export_Directory"), _T("")
-};
-
-
CInputHandler *CMainFrame::m_InputHandler = nullptr; //rewbs.customKeys
CAutoSaver *CMainFrame::m_pAutoSaver = nullptr; //rewbs.autosave
CPerformanceCounter *CMainFrame::m_pPerfCounter = nullptr;
@@ -315,57 +221,15 @@
m_szInfoText[0] = 0;
m_szXInfoText[0]= 0; //rewbs.xinfo
- for(UINT i = 0; i < NUM_DIRS; i++)
- {
- if (i == DIR_TUNING) // Hack: Tuning folder is set already so don't reset it.
- continue;
- MemsetZero(m_szDefaultDirectory[i]);
- MemsetZero(m_szWorkingDirectory[i]);
- }
-
m_dTotalCPU=0;
MemsetZero(gpenVuMeter);
- // Default chords
- MemsetZero(Chords);
- for (UINT ichord=0; ichord<3*12; ichord++)
- {
- Chords[ichord].key = (BYTE)ichord;
- Chords[ichord].notes[0] = 0;
- Chords[ichord].notes[1] = 0;
- Chords[ichord].notes[2] = 0;
- // Major Chords
- if (ichord < 12)
- {
- Chords[ichord].notes[0] = (BYTE)(ichord+5);
- Chords[ichord].notes[1] = (BYTE)(ichord+8);
- Chords[ichord].notes[2] = (BYTE)(ichord+11);
- } else
- // Minor Chords
- if (ichord < 24)
- {
- Chords[ichord].notes[0] = (BYTE)(ichord-8);
- Chords[ichord].notes[1] = (BYTE)(ichord-4);
- Chords[ichord].notes[2] = (BYTE)(ichord-1);
- }
- }
-
// Create Audio Critical Section
MemsetZero(m_csAudio);
InitializeCriticalSection(&m_csAudio);
- m_csRegKey.Format("%s%s", MAINFRAME_REGKEY_BASE, MAINFRAME_REGKEY_DEFAULT);
- m_csRegSettings.Format("%s%s", m_csRegKey, MAINFRAME_REGEXT_SETTINGS);
- m_csRegWindow.Format("%s%s", m_csRegKey, MAINFRAME_REGEXT_WINDOW);
+ m_Settings.LoadSettings();
- CString storedVersion = GetPrivateProfileCString("Version", "Version", "", theApp.GetConfigFileName());
- // If version number stored in INI is 1.17.02.40 or later, always load setting from INI file.
- // If it isn't, try loading from Registry first, then from the INI file.
- if (storedVersion >= "1.17.02.40" || !LoadRegistrySettings())
- {
- LoadIniSettings();
- }
-
m_InputHandler = new CInputHandler(this); //rewbs.customKeys
m_pPerfCounter= new CPerformanceCounter();
@@ -373,363 +237,7 @@
CSoundFile::LoadStaticTunings();
}
-void CMainFrame::LoadIniSettings()
-//--------------------------------
-{
- CString iniFile = theApp.GetConfigFileName();
- //CHAR collectedString[INIBUFFERSIZE];
- MptVersion::VersionNum vIniVersion;
- gcsPreviousVersion = GetPrivateProfileCString("Version", "Version", "", iniFile);
- if(gcsPreviousVersion == "")
- vIniVersion = MptVersion::num;
- else
- vIniVersion = MptVersion::ToNum(gcsPreviousVersion);
-
- gcsInstallGUID = GetPrivateProfileCString("Version", "InstallGUID", "", iniFile);
- if(gcsInstallGUID == "")
- {
- // No GUID found in INI file - generate one.
- GUID guid;
- CoCreateGuid(&guid);
- BYTE* Str;
- UuidToString((UUID*)&guid, &Str);
- gcsInstallGUID.Format("%s", (LPTSTR)Str);
- RpcStringFree(&Str);
- }
-
- gbMdiMaximize = GetPrivateProfileLong("Display", "MDIMaximize", true, iniFile);
- glTreeWindowWidth = GetPrivateProfileLong("Display", "MDITreeWidth", 160, iniFile);
- glTreeSplitRatio = GetPrivateProfileLong("Display", "MDITreeRatio", 128, iniFile);
- glGeneralWindowHeight = GetPrivateProfileLong("Display", "MDIGeneralHeight", 178, iniFile);
- glPatternWindowHeight = GetPrivateProfileLong("Display", "MDIPatternHeight", 152, iniFile);
- glSampleWindowHeight = GetPrivateProfileLong("Display", "MDISampleHeight", 188, iniFile);
- glInstrumentWindowHeight = GetPrivateProfileLong("Display", "MDIInstrumentHeight", 300, iniFile);
- glCommentsWindowHeight = GetPrivateProfileLong("Display", "MDICommentsHeight", 288, iniFile);
- glGraphWindowHeight = GetPrivateProfileLong("Display", "MDIGraphHeight", 288, iniFile); //rewbs.graph
- gnPlugWindowX = GetPrivateProfileInt("Display", "PlugSelectWindowX", 243, iniFile);
- gnPlugWindowY = GetPrivateProfileInt("Display", "PlugSelectWindowY", 273, iniFile);
- gnPlugWindowWidth = GetPrivateProfileInt("Display", "PlugSelectWindowWidth", 370, iniFile);
- gnPlugWindowHeight = GetPrivateProfileInt("Display", "PlugSelectWindowHeight", 332, iniFile);
- gnPlugWindowLast = GetPrivateProfileDWord("Display", "PlugSelectWindowLast", 0, iniFile);
- gnMsgBoxVisiblityFlags = GetPrivateProfileDWord("Display", "MsgBoxVisibilityFlags", uint32_max, iniFile);
-
- // Internet Update
- {
- tm lastUpdate;
- MemsetZero(lastUpdate);
- CString s = GetPrivateProfileCString("Update", "LastUpdateCheck", "1970-01-01 00:00", iniFile);
- if(sscanf(s, "%04d-%02d-%02d %02d:%02d", &lastUpdate.tm_year, &lastUpdate.tm_mon, &lastUpdate.tm_mday, &lastUpdate.tm_hour, &lastUpdate.tm_min) == 5)
- {
- lastUpdate.tm_year -= 1900;
- lastUpdate.tm_mon--;
- }
-
- time_t outTime = Util::sdTime::MakeGmTime(lastUpdate);
-
- if(outTime < 0) outTime = 0;
-
- CUpdateCheck::SetUpdateSettings
- (
- outTime,
- GetPrivateProfileInt("Update", "UpdateCheckPeriod", CUpdateCheck::GetUpdateCheckPeriod(), iniFile),
- GetPrivateProfileCString("Update", "UpdateURL", CUpdateCheck::GetUpdateURL(), iniFile),
- GetPrivateProfileInt("Update", "SendGUID", CUpdateCheck::GetSendGUID() ? 1 : 0, iniFile) ? true : false,
- GetPrivateProfileInt("Update", "ShowUpdateHint", CUpdateCheck::GetShowUpdateHint() ? 1 : 0, iniFile) ? true : false
- );
- }
-
- CHAR s[16];
- for (int ncol = 0; ncol < MAX_MODCOLORS; ncol++)
- {
- wsprintf(s, "Color%02d", ncol);
- rgbCustomColors[ncol] = GetPrivateProfileDWord("Display", s, rgbCustomColors[ncol], iniFile);
- }
-
-#ifndef NO_DSOUND
- DWORD defaultDevice = SNDDEV_BUILD_ID(0, SNDDEV_DSOUND); // first DirectSound device
-#else
- DWORD defaultDevice = SNDDEV_BUILD_ID(0, SNDDEV_WAVEOUT); // first WaveOut device
-#endif // NO_DSOUND
-#ifndef NO_ASIO
- // If there's an ASIO device available, prefer it over DirectSound
- if(EnumerateSoundDevices(SNDDEV_ASIO, 0, nullptr, 0))
- {
- defaultDevice = SNDDEV_BUILD_ID(0, SNDDEV_ASIO);
- }
-#endif // NO_ASIO
- m_nWaveDevice = GetPrivateProfileLong("Sound Settings", "WaveDevice", defaultDevice, iniFile);
- m_dwSoundSetup = GetPrivateProfileDWord("Sound Settings", "SoundSetup", SOUNDSETUP_SECONDARY, iniFile);
- m_dwQuality = GetPrivateProfileDWord("Sound Settings", "Quality", 0, iniFile);
- m_nSrcMode = GetPrivateProfileDWord("Sound Settings", "SrcMode", SRCMODE_POLYPHASE, iniFile);
- m_dwRate = GetPrivateProfileDWord("Sound Settings", "Mixing_Rate", 0, iniFile);
- m_nBitsPerSample = GetPrivateProfileDWord("Sound Settings", "BitsPerSample", 16, iniFile);
- m_nChannels = GetPrivateProfileDWord("Sound Settings", "ChannelMode", 2, iniFile);
- m_nBufferLength = GetPrivateProfileDWord("Sound Settings", "BufferLength", 50, iniFile);
- if(m_nBufferLength < SNDDEV_MINBUFFERLEN) m_nBufferLength = SNDDEV_MINBUFFERLEN;
- if(m_nBufferLength > SNDDEV_MAXBUFFERLEN) m_nBufferLength = SNDDEV_MAXBUFFERLEN;
- if(m_dwRate == 0)
- {
- m_dwRate = 44100;
-#ifndef NO_ASIO
- // If no mixing rate is specified and we're using ASIO, get a mixing rate supported by the device.
- if(SNDDEV_GET_TYPE(m_nWaveDevice) == SNDDEV_ASIO)
- {
- ISoundDevice *dummy;
- if(CreateSoundDevice(SNDDEV_ASIO, &dummy))
- {
- m_dwRate = dummy->GetCurrentSampleRate(SNDDEV_GET_NUMBER(m_nWaveDevice));
- delete dummy;
- }
- }
-#endif // NO_ASIO
- }
-
- m_nPreAmp = GetPrivateProfileDWord("Sound Settings", "PreAmp", 128, iniFile);
- CSoundFile::m_nStereoSeparation = GetPrivateProfileLong("Sound Settings", "StereoSeparation", 128, iniFile);
- CSoundFile::m_nMaxMixChannels = GetPrivateProfileLong("Sound Settings", "MixChannels", MAX_CHANNELS, iniFile);
- gbWFIRType = static_cast<BYTE>(GetPrivateProfileDWord("Sound Settings", "XMMSModplugResamplerWFIRType", 7, iniFile));
- gdWFIRCutoff = static_cast<double>(GetPrivateProfileLong("Sound Settings", "ResamplerWFIRCutoff", 97, iniFile))/100.0;
- glVolumeRampSamples = GetPrivateProfileLong("Sound Settings", "VolumeRampSamples", 42, iniFile);
-
- m_dwMidiSetup = GetPrivateProfileDWord("MIDI Settings", "MidiSetup", m_dwMidiSetup, iniFile);
- m_nMidiDevice = GetPrivateProfileDWord("MIDI Settings", "MidiDevice", m_nMidiDevice, iniFile);
- gnMidiImportSpeed = GetPrivateProfileLong("MIDI Settings", "MidiImportSpeed", gnMidiImportSpeed, iniFile);
- gnMidiPatternLen = GetPrivateProfileLong("MIDI Settings", "MidiImportPatLen", gnMidiPatternLen, iniFile);
-
- m_dwPatternSetup = GetPrivateProfileDWord("Pattern Editor", "PatternSetup", m_dwPatternSetup, iniFile);
- if(vIniVersion < MAKE_VERSION_NUMERIC(1,17,02,50))
- m_dwPatternSetup |= PATTERN_NOTEFADE;
- if(vIniVersion < MAKE_VERSION_NUMERIC(1,17,03,01))
- m_dwPatternSetup |= PATTERN_RESETCHANNELS;
- if(vIniVersion < MAKE_VERSION_NUMERIC(1,19,00,07))
- m_dwPatternSetup &= ~0x800; // this was previously deprecated and is now used for something else
- if(vIniVersion < MptVersion::num)
- m_dwPatternSetup &= ~(0x200000|0x400000|0x10000000); // various deprecated old options
-
- m_nRowSpacing = GetPrivateProfileDWord("Pattern Editor", "RowSpacing", 16, iniFile);
- m_nRowSpacing2 = GetPrivateProfileDWord("Pattern Editor", "RowSpacing2", 4, iniFile);
- gbLoopSong = GetPrivateProfileDWord("Pattern Editor", "LoopSong", true, iniFile);
- gnPatternSpacing = GetPrivateProfileDWord("Pattern Editor", "Spacing", 1, iniFile);
- gbPatternVUMeters = GetPrivateProfileDWord("Pattern Editor", "VU-Meters", false, iniFile);
- gbPatternPluginNames = GetPrivateProfileDWord("Pattern Editor", "Plugin-Names", true, iniFile);
- gbPatternRecord = GetPrivateProfileDWord("Pattern Editor", "Record", true, iniFile);
- gnAutoChordWaitTime = GetPrivateProfileDWord("Pattern Editor", "AutoChordWaitTime", 60, iniFile);
- COrderList::s_nDefaultMargins = static_cast<BYTE>(GetPrivateProfileInt("Pattern Editor", "DefaultSequenceMargins", 2, iniFile));
- gbShowHackControls = (0 != GetPrivateProfileDWord("Misc", "ShowHackControls", 0, iniFile));
- CSoundFile::s_DefaultPlugVolumeHandling = static_cast<uint8>(GetPrivateProfileInt("Misc", "DefaultPlugVolumeHandling", PLUGIN_VOLUMEHANDLING_IGNORE, iniFile));
- if(CSoundFile::s_DefaultPlugVolumeHandling > 2) CSoundFile::s_DefaultPlugVolumeHandling = PLUGIN_VOLUMEHANDLING_IGNORE;
-
- m_nSampleUndoMaxBuffer = GetPrivateProfileLong("Sample Editor" , "UndoBufferSize", m_nSampleUndoMaxBuffer >> 20, iniFile);
- m_nSampleUndoMaxBuffer = max(1, m_nSampleUndoMaxBuffer) << 20;
-
- TCHAR szPath[_MAX_PATH] = "";
- for(size_t i = 0; i < NUM_DIRS; i++)
- {
- if(m_szDirectoryToSettingsName[i][0] == 0)
- continue;
-
- GetPrivateProfileString("Paths", m_szDirectoryToSettingsName[i], GetDefaultDirectory(static_cast<Directory>(i)), szPath, CountOf(szPath), iniFile);
- RelativePathToAbsolute(szPath);
- SetDefaultDirectory(szPath, static_cast<Directory>(i), false);
-
- }
- GetPrivateProfileString("Paths", "Key_Config_File", m_szKbdFile, m_szKbdFile, INIBUFFERSIZE, iniFile);
- RelativePathToAbsolute(m_szKbdFile);
-
- CSoundFile::m_nXBassDepth = GetPrivateProfileLong("Effects", "XBassDepth", 0, iniFile);
- CSoundFile::m_nXBassRange = GetPrivateProfileLong("Effects", "XBassRange", 0, iniFile);
- CSoundFile::m_nReverbDepth = GetPrivateProfileLong("Effects", "ReverbDepth", 0, iniFile);
- CSoundFile::gnReverbType = GetPrivateProfileLong("Effects", "ReverbType", 0, iniFile);
- CSoundFile::m_nProLogicDepth = GetPrivateProfileLong("Effects", "ProLogicDepth", 0, iniFile);
- CSoundFile::m_nProLogicDelay = GetPrivateProfileLong("Effects", "ProLogicDelay", 0, iniFile);
-
- GetPrivateProfileStruct("Effects", "EQ_Settings", &m_EqSettings, sizeof(EQPRESET), iniFile);
- GetPrivateProfileStruct("Effects", "EQ_User1", &CEQSetupDlg::gUserPresets[0], sizeof(EQPRESET), iniFile);
- GetPrivateProfileStruct("Effects", "EQ_User2", &CEQSetupDlg::gUserPresets[1], sizeof(EQPRESET), iniFile);
- GetPrivateProfileStruct("Effects", "EQ_User3", &CEQSetupDlg::gUserPresets[2], sizeof(EQPRESET), iniFile);
- GetPrivateProfileStruct("Effects", "EQ_User4", &CEQSetupDlg::gUserPresets[3], sizeof(EQPRESET), iniFile);
-
-
- m_pAutoSaver = new CAutoSaver();
- GetPrivateProfileLong("AutoSave", "Enabled", true, iniFile)?m_pAutoSaver->Enable():m_pAutoSaver->Disable();
- m_pAutoSaver->SetSaveInterval(GetPrivateProfileLong("AutoSave", "IntervalMinutes", 10, iniFile));
- m_pAutoSaver->SetHistoryDepth(GetPrivateProfileLong("AutoSave", "BackupHistory", 3, iniFile));
- m_pAutoSaver->SetUseOriginalPath(GetPrivateProfileLong("AutoSave", "UseOriginalPath", true, iniFile) != 0);
- GetPrivateProfileString("AutoSave", "Path", "", szPath, INIBUFFERSIZE, iniFile);
- RelativePathToAbsolute(szPath);
- m_pAutoSaver->SetPath(szPath);
- m_pAutoSaver->SetFilenameTemplate(GetPrivateProfileCString("AutoSave", "FileNameTemplate", "", iniFile));
-}
-
-bool CMainFrame::LoadRegistrySettings()
-//-------------------------------------
-{
-
- HKEY key;
- DWORD dwREG_DWORD = REG_DWORD;
- DWORD dwREG_SZ = REG_SZ;
- DWORD dwDWORDSize = sizeof(UINT);
- DWORD dwCRSIZE = sizeof(COLORREF);
-
-
- bool asEnabled=true;
- int asInterval=10;
- int asBackupHistory=3;
- bool asUseOriginalPath=true;
- CString asPath ="";
- CString asFileNameTemplate="";
-
- if (RegOpenKeyEx(HKEY_CURRENT_USER, m_csRegWindow, 0, KEY_READ, &key) == ERROR_SUCCESS)
- {
- DWORD d = 0;
- RegQueryValueEx(key, "Maximized", NULL, &dwREG_DWORD, (LPBYTE)&d, &dwDWORDSize);
- if (d) theApp.m_nCmdShow = SW_SHOWMAXIMIZED;
- RegQueryValueEx(key, "MDIMaximize", NULL, &dwREG_DWORD, (LPBYTE)&gbMdiMaximize, &dwDWORDSize);
- RegQueryValueEx(key, "MDITreeWidth", NULL, &dwREG_DWORD, (LPBYTE)&glTreeWindowWidth, &dwDWORDSize);
- RegQueryValueEx(key, "MDIGeneralHeight", NULL, &dwREG_DWORD, (LPBYTE)&glGeneralWindowHeight, &dwDWORDSize);
- RegQueryValueEx(key, "MDIPatternHeight", NULL, &dwREG_DWORD, (LPBYTE)&glPatternWindowHeight, &dwDWORDSize);
- RegQueryValueEx(key, "MDISampleHeight", NULL, &dwREG_DWORD, (LPBYTE)&glSampleWindowHeight, &dwDWORDSize);
- RegQueryValueEx(key, "MDIInstrumentHeight", NULL, &dwREG_DWORD, (LPBYTE)&glInstrumentWindowHeight, &dwDWORDSize);
- RegQueryValueEx(key, "MDICommentsHeight", NULL, &dwREG_DWORD, (LPBYTE)&glCommentsWindowHeight, &dwDWORDSize);
- RegQueryValueEx(key, "MDIGraphHeight", NULL, &dwREG_DWORD, (LPBYTE)&glGraphWindowHeight, &dwDWORDSize); //rewbs.graph
- RegQueryValueEx(key, "MDITreeRatio", NULL, &dwREG_DWORD, (LPBYTE)&glTreeSplitRatio, &dwDWORDSize);
- // Colors
- for (int ncol=0; ncol<MAX_MODCOLORS; ncol++)
- {
- CHAR s[64];
- wsprintf(s, "Color%02d", ncol);
- RegQueryValueEx(key, s, NULL, &dwREG_DWORD, (LPBYTE)&rgbCustomColors[ncol], &dwCRSIZE);
- }
- RegCloseKey(key);
- }
-
- if (RegOpenKeyEx(HKEY_CURRENT_USER, m_csRegKey, 0, KEY_READ, &key) == ERROR_SUCCESS)
- {
- RegQueryValueEx(key, "SoundSetup", NULL, &dwREG_DWORD, (LPBYTE)&m_dwSoundSetup, &dwDWORDSize);
- RegQueryValueEx(key, "Quality", NULL, &dwREG_DWORD, (LPBYTE)&m_dwQuality, &dwDWORDSize);
- RegQueryValueEx(key, "SrcMode", NULL, &dwREG_DWORD, (LPBYTE)&m_nSrcMode, &dwDWORDSize);
- RegQueryValueEx(key, "Mixing_Rate", NULL, &dwREG_DWORD, (LPBYTE)&m_dwRate, &dwDWORDSize);
- RegQueryValueEx(key, "BufferLength", NULL, &dwREG_DWORD, (LPBYTE)&m_nBufferLength, &dwDWORDSize);
- if ((m_nBufferLength < 10) || (m_nBufferLength > 200)) m_nBufferLength = 100;
- RegQueryValueEx(key, "PreAmp", NULL, &dwREG_DWORD, (LPBYTE)&m_nPreAmp, &dwDWORDSize);
-
- CHAR sPath[_MAX_PATH] = "";
- DWORD dwSZSIZE = sizeof(sPath);
- RegQueryValueEx(key, "Songs_Directory", NULL, &dwREG_SZ, (LPBYTE)sPath, &dwSZSIZE);
- SetDefaultDirectory(sPath, DIR_MODS);
- dwSZSIZE = sizeof(sPath);
- RegQueryValueEx(key, "Samples_Directory", NULL, &dwREG_SZ, (LPBYTE)sPath, &dwSZSIZE);
- SetDefaultDirectory(sPath, DIR_SAMPLES);
- dwSZSIZE = sizeof(sPath);
- RegQueryValueEx(key, "Instruments_Directory", NULL, &dwREG_SZ, (LPBYTE)sPath, &dwSZSIZE);
- SetDefaultDirectory(sPath, DIR_INSTRUMENTS);
- dwSZSIZE = sizeof(sPath);
- RegQueryValueEx(key, "Plugins_Directory", NULL, &dwREG_SZ, (LPBYTE)sPath, &dwSZSIZE);
- SetDefaultDirectory(sPath, DIR_PLUGINS);
- dwSZSIZE = sizeof(m_szKbdFile);
- RegQueryValueEx(key, "Key_Config_File", NULL, &dwREG_SZ, (LPBYTE)m_szKbdFile, &dwSZSIZE);
-
- RegQueryValueEx(key, "XBassDepth", NULL, &dwREG_DWORD, (LPBYTE)&CSoundFile::m_nXBassDepth, &dwDWORDSize);
- RegQueryValueEx(key, "XBassRange", NULL, &dwREG_DWORD, (LPBYTE)&CSoundFile::m_nXBassRange, &dwDWORDSize);
- RegQueryValueEx(key, "ReverbDepth", NULL, &dwREG_DWORD, (LPBYTE)&CSoundFile::m_nReverbDepth, &dwDWORDSize);
- RegQueryValueEx(key, "ReverbType", NULL, &dwREG_DWORD, (LPBYTE)&CSoundFile::gnReverbType, &dwDWORDSize);
- RegQueryValueEx(key, "Pr...
[truncated message content] |
|
From: <sag...@us...> - 2011-07-22 23:02:17
|
Revision: 926
http://modplug.svn.sourceforge.net/modplug/?rev=926&view=rev
Author: saga-games
Date: 2011-07-22 23:02:11 +0000 (Fri, 22 Jul 2011)
Log Message:
-----------
[Mod] Renamed "Find" to "Find / Replace" (http://forum.openmpt.org/index.php?topic=4055.0)
Modified Paths:
--------------
trunk/OpenMPT/mptrack/CommandSet.cpp
trunk/OpenMPT/mptrack/InputHandler.cpp
Modified: trunk/OpenMPT/mptrack/CommandSet.cpp
===================================================================
--- trunk/OpenMPT/mptrack/CommandSet.cpp 2011-07-22 21:52:30 UTC (rev 925)
+++ trunk/OpenMPT/mptrack/CommandSet.cpp 2011-07-22 23:02:11 UTC (rev 926)
@@ -434,7 +434,7 @@
DefineKeyCommand(kcEditPaste, 1362, kcVisible, kcNoDummy, _T("Paste"));
DefineKeyCommand(kcEditMixPaste, 1363, kcVisible, kcNoDummy, _T("Mix Paste"));
DefineKeyCommand(kcEditSelectAll, 1364, kcVisible, kcNoDummy, _T("SelectAll"));
- DefineKeyCommand(kcEditFind, 1365, kcVisible, kcNoDummy, _T("Find"));
+ DefineKeyCommand(kcEditFind, 1365, kcVisible, kcNoDummy, _T("Find / Replace"));
DefineKeyCommand(kcEditFindNext, 1366, kcVisible, kcNoDummy, _T("Find Next"));
DefineKeyCommand(kcViewMain, 1367, kcVisible, kcNoDummy, _T("Toggle Main View"));
DefineKeyCommand(kcViewTree, 1368, kcVisible, kcNoDummy, _T("Toggle Tree View"));
Modified: trunk/OpenMPT/mptrack/InputHandler.cpp
===================================================================
--- trunk/OpenMPT/mptrack/InputHandler.cpp 2011-07-22 21:52:30 UTC (rev 925)
+++ trunk/OpenMPT/mptrack/InputHandler.cpp 2011-07-22 23:02:11 UTC (rev 926)
@@ -426,7 +426,7 @@
case ID_IMPORT_MIDILIB: s="Import &MIDI Library...\t"; c=kcFileImportMidiLib; break;
case ID_ADD_SOUNDBANK: s="Add Sound &Bank...\t"; c=kcFileAddSoundBank; break;
- case ID_PLAYER_PLAY: s="Pause/&Resume\t"; c= kcPlayPauseSong; break;
+ case ID_PLAYER_PLAY: s="Pause / &Resume\t"; c= kcPlayPauseSong; break;
case ID_PLAYER_PLAYFROMSTART: s="&Play from start\t"; c=kcPlaySongFromStart; break;
case ID_PLAYER_STOP: s="&Stop\t"; c=kcStopSong; break;
case ID_PLAYER_PAUSE: s="P&ause\t"; c=kcPauseSong; break;
@@ -440,7 +440,7 @@
case ID_EDIT_PASTE: s="&Paste\t"; c=kcEditPaste; break;
case ID_EDIT_SELECT_ALL: s="Select &All\t"; c=kcEditSelectAll; break;
case ID_EDIT_CLEANUP: s="C&leanup"; break;
- case ID_EDIT_FIND: s="&Find\t"; c=kcEditFind; break;
+ case ID_EDIT_FIND: s="&Find / Replace\t"; c=kcEditFind; break;
case ID_EDIT_FINDNEXT: s="Find &Next\t"; c=kcEditFindNext; break;
case ID_EDIT_GOTO_MENU: s="&Goto\t"; c=kcPatternGoto; break;
case ID_EDIT_SPLITKEYBOARDSETTINGS: s="Split &Keyboard Settings\t"; c=kcShowSplitKeyboardSettings; break;
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <sag...@us...> - 2011-07-22 21:52:37
|
Revision: 925
http://modplug.svn.sourceforge.net/modplug/?rev=925&view=rev
Author: saga-games
Date: 2011-07-22 21:52:30 +0000 (Fri, 22 Jul 2011)
Log Message:
-----------
[Fix] Mod Conversion: Global volume ranges were not updated when converting between IT and S3M/XM.
Modified Paths:
--------------
trunk/OpenMPT/soundlib/modcommand.cpp
Modified: trunk/OpenMPT/soundlib/modcommand.cpp
===================================================================
--- trunk/OpenMPT/soundlib/modcommand.cpp 2011-07-22 21:31:18 UTC (rev 924)
+++ trunk/OpenMPT/soundlib/modcommand.cpp 2011-07-22 21:52:30 UTC (rev 925)
@@ -328,11 +328,38 @@
case CMD_SMOOTHMIDI:
m->command = CMD_MIDI;
break;
+ case CMD_GLOBALVOLUME:
+ m->param = (min(0x80, m->param) + 1) / 2;
+ break;
default:
break;
}
} // End if (oldTypeIsIT_MPT && newTypeIsS3M)
+ //////////////////////
+ // Convert IT to XM
+ if(oldTypeIsIT_MPT && newTypeIsXM)
+ {
+ switch(m->command)
+ {
+ case CMD_GLOBALVOLUME:
+ m->param = (min(0x80, m->param) + 1) / 2;
+ break;
+ }
+ } // End if(oldTypeIsIT_MPT && newTypeIsXM)
+
+ //////////////////////
+ // Convert XM to IT
+ if(oldTypeIsXM && newTypeIsIT_MPT)
+ {
+ switch(m->command)
+ {
+ case CMD_GLOBALVOLUME:
+ m->param = min(0x80, m->param * 2);
+ break;
+ }
+ } // End if(oldTypeIsIT_MPT && newTypeIsXM)
+
///////////////////////////////////
// MOD <-> XM: Speed/Tempo update
if(oldTypeIsMOD && newTypeIsXM)
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <sag...@us...> - 2011-07-22 21:31:25
|
Revision: 924
http://modplug.svn.sourceforge.net/modplug/?rev=924&view=rev
Author: saga-games
Date: 2011-07-22 21:31:18 +0000 (Fri, 22 Jul 2011)
Log Message:
-----------
[Mod] Realigned find/replace dialog a bit, to fit long note names for Note Cut/Off/Fade.
[Fix] Some unsupported effects were shown in the Find/Replace dialog.
Modified Paths:
--------------
trunk/OpenMPT/mptrack/Mptrack.h
trunk/OpenMPT/mptrack/PatternEditorDialogs.cpp
trunk/OpenMPT/mptrack/mptrack.rc
Modified: trunk/OpenMPT/mptrack/Mptrack.h
===================================================================
--- trunk/OpenMPT/mptrack/Mptrack.h 2011-07-22 20:54:18 UTC (rev 923)
+++ trunk/OpenMPT/mptrack/Mptrack.h 2011-07-22 21:31:18 UTC (rev 924)
@@ -397,13 +397,13 @@
extern const LPCSTR szNoteNames[12];
extern const LPCTSTR szDefaultNoteNames[NOTE_MAX];
-//const LPCTSTR szSpecialNoteNames[NOTE_MAX_SPECIAL - NOTE_MIN_SPECIAL + 1] = {TEXT("PCs"), TEXT("PC"), TEXT("~~"), TEXT("^^"), TEXT("==")};
-const LPCTSTR szSpecialNoteNames[NOTE_MAX_SPECIAL - NOTE_MIN_SPECIAL + 1] = {TEXT("PCs"), TEXT("PC"), TEXT("Note Fade"), TEXT("Note Cut"), TEXT("Note Off")};
-const LPCTSTR szSpecialNoteShortDesc[NOTE_MAX_SPECIAL - NOTE_MIN_SPECIAL + 1] = {TEXT("Param Control (Smooth)"), TEXT("Param Control"), TEXT("Note Fade"), TEXT("Note Cut"), TEXT("Note Off")};
+//const LPCTSTR szSpecialNoteNames[] = {TEXT("PCs"), TEXT("PC"), TEXT("~~"), TEXT("^^"), TEXT("==")};
+const LPCTSTR szSpecialNoteNames[] = {TEXT("PCs"), TEXT("PC"), TEXT("~~ (Note Fade)"), TEXT("^^ (Note Cut)"), TEXT("== (Note Off)")};
+const LPCTSTR szSpecialNoteShortDesc[] = {TEXT("Param Control (Smooth)"), TEXT("Param Control"), TEXT("Note Fade"), TEXT("Note Cut"), TEXT("Note Off")};
// Make sure that special note arrays include string for every note.
-STATIC_ASSERT(NOTE_MAX_SPECIAL - NOTE_MIN_SPECIAL + 1 == ARRAYELEMCOUNT(szSpecialNoteNames));
-STATIC_ASSERT(ARRAYELEMCOUNT(szSpecialNoteShortDesc) == ARRAYELEMCOUNT(szSpecialNoteNames));
+STATIC_ASSERT(NOTE_MAX_SPECIAL - NOTE_MIN_SPECIAL + 1 == CountOf(szSpecialNoteNames));
+STATIC_ASSERT(CountOf(szSpecialNoteShortDesc) == CountOf(szSpecialNoteNames));
const LPCSTR szHexChar = "0123456789ABCDEF";
const TCHAR gszEmpty[] = TEXT("");
Modified: trunk/OpenMPT/mptrack/PatternEditorDialogs.cpp
===================================================================
--- trunk/OpenMPT/mptrack/PatternEditorDialogs.cpp 2011-07-22 20:54:18 UTC (rev 923)
+++ trunk/OpenMPT/mptrack/PatternEditorDialogs.cpp 2011-07-22 21:31:18 UTC (rev 924)
@@ -154,8 +154,8 @@
combo->SetItemData(combo->AddString("..."), 0);
if (m_bReplace)
{
- combo->SetItemData(combo->AddString("note-1"), replaceNoteMinusOne);
- combo->SetItemData(combo->AddString("note+1"), replaceNotePlusOne);
+ combo->SetItemData(combo->AddString("note -1"), replaceNoteMinusOne);
+ combo->SetItemData(combo->AddString("note +1"), replaceNotePlusOne);
combo->SetItemData(combo->AddString("-1 oct"), replaceNoteMinusOctave);
combo->SetItemData(combo->AddString("+1 oct"), replaceNotePlusOctave);
} else
@@ -177,8 +177,8 @@
combo->SetItemData(combo->AddString(".."), 0);
if (m_bReplace)
{
- combo->SetItemData(combo->AddString("ins-1"), replaceInstrumentMinusOne);
- combo->SetItemData(combo->AddString("ins+1"), replaceInstrumentPlusOne);
+ combo->SetItemData(combo->AddString("ins -1"), replaceInstrumentMinusOne);
+ combo->SetItemData(combo->AddString("ins +1"), replaceInstrumentPlusOne);
}
for (UINT n=1; n<MAX_INSTRUMENTS; n++)
{
@@ -209,8 +209,10 @@
UINT count = m_pModDoc->GetNumVolCmds();
for (UINT n=0; n<count; n++)
{
- m_pModDoc->GetVolCmdInfo(n, s);
- if (s[0]) combo->SetItemData(combo->AddString(s), n);
+ if(m_pModDoc->GetVolCmdInfo(n, s) && s[0])
+ {
+ combo->SetItemData(combo->AddString(s), n);
+ }
}
combo->SetCurSel(0);
UINT fxndx = m_pModDoc->GetIndexFromVolCmd(m_nVolCmd);
@@ -244,8 +246,10 @@
UINT count = m_pModDoc->GetNumEffects();
for (UINT n=0; n<count; n++)
{
- m_pModDoc->GetEffectInfo(n, s, true);
- if (s[0]) combo->SetItemData(combo->AddString(s), n);
+ if(m_pModDoc->GetEffectInfo(n, s, true) && s[0])
+ {
+ combo->SetItemData(combo->AddString(s), n);
+ }
}
combo->SetCurSel(0);
UINT fxndx = m_pModDoc->GetIndexFromEffect(m_nCommand, m_nParam);
@@ -423,17 +427,18 @@
m_nPattern,
pSndFile->Patterns[m_nPattern].GetNumRows(),
(pSndFile->Patterns[m_nPattern].GetNumRows() == 1) ? "" : "s",
- (pSndFile->Patterns[m_nPattern].GetNumRows() * pSndFile->m_nChannels * sizeof(MODCOMMAND)) / 1024);
+ (pSndFile->Patterns[m_nPattern].GetNumRows() * pSndFile->GetNumChannels() * sizeof(MODCOMMAND)) / 1024);
SetDlgItemText(IDC_TEXT1, s);
- // Window title
- CHAR szName[MAX_PATTERNNAME + 1];
- pSndFile->Patterns[m_nPattern].GetName(szName, MAX_PATTERNNAME);
- if(strlen(szName))
+ // Window title
+ const CString patternName = pSndFile->Patterns[m_nPattern].GetName();
+ wsprintf(s, "Pattern Properties for Pattern #%d", m_nPattern);
+ if(!patternName.IsEmpty())
{
- strcat(szName, ")");
+ strcat(s, " (");
+ strcat(s, patternName);
+ strcat(s, ")");
}
- wsprintf(s, "Pattern Properties for Pattern #%d%s%s", m_nPattern, strlen(szName) ? " (" : "", szName);
SetWindowText(s);
// pattern time signature
Modified: trunk/OpenMPT/mptrack/mptrack.rc
===================================================================
--- trunk/OpenMPT/mptrack/mptrack.rc 2011-07-22 20:54:18 UTC (rev 923)
+++ trunk/OpenMPT/mptrack/mptrack.rc 2011-07-22 21:31:18 UTC (rev 924)
@@ -943,53 +943,53 @@
CTEXT "Wet Dry Ratio",IDC_STATIC8,245,282,65,14,SS_CENTERIMAGE,WS_EX_STATICEDGE
END
-IDD_EDIT_FIND DIALOGEX 0, 0, 182, 161
+IDD_EDIT_FIND DIALOGEX 0, 0, 214, 162
STYLE DS_SETFONT | DS_FIXEDSYS | WS_CHILD | WS_CAPTION
CAPTION "Find"
FONT 8, "MS Shell Dlg", 0, 0, 0x0
BEGIN
- GROUPBOX "Search for:",IDC_STATIC,4,4,174,107
- CONTROL "Note",IDC_CHECK1,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,13,17,31,10
- COMBOBOX IDC_COMBO1,13,28,41,94,CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP
- CONTROL "Instrument",IDC_CHECK2,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,60,17,49,10
- COMBOBOX IDC_COMBO2,60,28,106,103,CBS_DROPDOWNLIST | CBS_SORT | WS_VSCROLL | WS_TABSTOP
- CONTROL "Volume Effect",IDC_CHECK3,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,13,46,60,10
- COMBOBOX IDC_COMBO3,13,58,94,77,CBS_DROPDOWNLIST | CBS_SORT | WS_VSCROLL | WS_TABSTOP
- CONTROL "Volume Data",IDC_CHECK4,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,117,46,56,10
- COMBOBOX IDC_COMBO4,117,58,48,77,CBS_DROPDOWNLIST | CBS_SORT | WS_VSCROLL | WS_TABSTOP
- CONTROL "Effect",IDC_CHECK5,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,13,78,35,10
- COMBOBOX IDC_COMBO5,13,92,94,71,CBS_DROPDOWNLIST | CBS_SORT | WS_VSCROLL | WS_TABSTOP
- CONTROL "Effect Data",IDC_CHECK6,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,117,78,52,10
- COMBOBOX IDC_COMBO6,117,92,48,68,CBS_DROPDOWNLIST | CBS_SORT | WS_VSCROLL | WS_TABSTOP
- CONTROL "Find in current pattern",IDC_RADIO1,"Button",BS_AUTORADIOBUTTON,6,120,96,8
- CONTROL "Find in the whole song",IDC_RADIO2,"Button",BS_AUTORADIOBUTTON,6,144,102,8
- CONTROL "Only in channels",IDC_CHECK7,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,105,117,70,10
- EDITTEXT IDC_EDIT1,117,130,22,12,ES_AUTOHSCROLL | ES_NUMBER
- CTEXT "to",IDC_STATIC,143,131,8,8
- EDITTEXT IDC_EDIT2,155,130,22,12,ES_AUTOHSCROLL | ES_NUMBER
- CONTROL "Find in current selection",IDC_RADIO3,"Button",BS_AUTORADIOBUTTON,6,132,102,8
+ GROUPBOX "Search for:",IDC_STATIC,4,4,206,110
+ CONTROL "Note",IDC_CHECK1,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,12,18,60,10
+ COMBOBOX IDC_COMBO1,12,30,59,94,CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP
+ CONTROL "Instrument",IDC_CHECK2,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,84,18,114,10
+ COMBOBOX IDC_COMBO2,84,30,114,103,CBS_DROPDOWNLIST | CBS_SORT | WS_VSCROLL | WS_TABSTOP
+ CONTROL "Volume Effect",IDC_CHECK3,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,12,48,114,10
+ COMBOBOX IDC_COMBO3,12,60,114,77,CBS_DROPDOWNLIST | CBS_SORT | WS_VSCROLL | WS_TABSTOP
+ CONTROL "Volume Data",IDC_CHECK4,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,138,48,60,10
+ COMBOBOX IDC_COMBO4,138,60,60,77,CBS_DROPDOWNLIST | CBS_SORT | WS_VSCROLL | WS_TABSTOP
+ CONTROL "Effect",IDC_CHECK5,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,12,78,114,10
+ COMBOBOX IDC_COMBO5,12,90,113,71,CBS_DROPDOWNLIST | CBS_SORT | WS_VSCROLL | WS_TABSTOP
+ CONTROL "Effect Data",IDC_CHECK6,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,138,78,60,10
+ COMBOBOX IDC_COMBO6,138,90,60,68,CBS_DROPDOWNLIST | CBS_SORT | WS_VSCROLL | WS_TABSTOP
+ CONTROL "Find in current pattern",IDC_RADIO1,"Button",BS_AUTORADIOBUTTON,6,120,108,8
+ CONTROL "Find in the whole song",IDC_RADIO2,"Button",BS_AUTORADIOBUTTON,6,144,108,8
+ CONTROL "Only in channels",IDC_CHECK7,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,120,120,70,10
+ EDITTEXT IDC_EDIT1,132,132,28,12,ES_AUTOHSCROLL | ES_NUMBER
+ CTEXT "to",IDC_STATIC,164,134,8,8
+ EDITTEXT IDC_EDIT2,176,132,28,12,ES_AUTOHSCROLL | ES_NUMBER
+ CONTROL "Find in current selection",IDC_RADIO3,"Button",BS_AUTORADIOBUTTON,6,132,108,8
END
-IDD_EDIT_REPLACE DIALOGEX 0, 0, 182, 145
-STYLE DS_SETFONT | WS_CHILD | WS_CAPTION
+IDD_EDIT_REPLACE DIALOGEX 0, 0, 214, 149
+STYLE DS_SETFONT | DS_FIXEDSYS | WS_CHILD | WS_CAPTION
CAPTION "Replace"
FONT 8, "MS Shell Dlg", 0, 0, 0x0
BEGIN
- GROUPBOX "",IDC_STATIC,4,4,174,137
+ GROUPBOX "",IDC_STATIC,4,4,206,140
CONTROL "Replace By:",IDC_CHECK7,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,12,15,63,10
- CONTROL "Note",IDC_CHECK1,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,13,31,31,10
- COMBOBOX IDC_COMBO1,13,42,41,93,CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP
- CONTROL "Instrument",IDC_CHECK2,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,60,31,49,10
- COMBOBOX IDC_COMBO2,60,42,106,92,CBS_DROPDOWNLIST | CBS_SORT | WS_VSCROLL | WS_TABSTOP
- CONTROL "Volume Effect",IDC_CHECK3,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,13,60,60,10
- COMBOBOX IDC_COMBO3,13,71,94,64,CBS_DROPDOWNLIST | CBS_SORT | WS_VSCROLL | WS_TABSTOP
- CONTROL "Volume Data",IDC_CHECK4,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,117,60,56,10
- COMBOBOX IDC_COMBO4,117,71,48,64,CBS_DROPDOWNLIST | CBS_SORT | WS_VSCROLL | WS_TABSTOP
- CONTROL "Effect",IDC_CHECK5,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,13,92,35,10
- COMBOBOX IDC_COMBO5,13,106,94,70,CBS_DROPDOWNLIST | CBS_SORT | WS_VSCROLL | WS_TABSTOP
- CONTROL "Effect Data",IDC_CHECK6,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,117,92,52,10
- COMBOBOX IDC_COMBO6,117,106,48,80,CBS_DROPDOWNLIST | CBS_SORT | WS_VSCROLL | WS_TABSTOP
- CONTROL "Replace All (No confirmation)",IDC_CHECK8,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,12,125,144,10
+ CONTROL "Note",IDC_CHECK1,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,12,30,60,10
+ COMBOBOX IDC_COMBO1,12,42,59,93,CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP
+ CONTROL "Instrument",IDC_CHECK2,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,84,30,114,10
+ COMBOBOX IDC_COMBO2,84,42,114,92,CBS_DROPDOWNLIST | CBS_SORT | WS_VSCROLL | WS_TABSTOP
+ CONTROL "Volume Effect",IDC_CHECK3,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,13,60,113,10
+ COMBOBOX IDC_COMBO3,12,72,114,64,CBS_DROPDOWNLIST | CBS_SORT | WS_VSCROLL | WS_TABSTOP
+ CONTROL "Volume Data",IDC_CHECK4,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,138,60,60,10
+ COMBOBOX IDC_COMBO4,138,72,60,64,CBS_DROPDOWNLIST | CBS_SORT | WS_VSCROLL | WS_TABSTOP
+ CONTROL "Effect",IDC_CHECK5,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,12,90,114,10
+ COMBOBOX IDC_COMBO5,12,102,114,70,CBS_DROPDOWNLIST | CBS_SORT | WS_VSCROLL | WS_TABSTOP
+ CONTROL "Effect Data",IDC_CHECK6,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,138,90,60,10
+ COMBOBOX IDC_COMBO6,138,102,60,80,CBS_DROPDOWNLIST | CBS_SORT | WS_VSCROLL | WS_TABSTOP
+ CONTROL "Replace All (No confirmation)",IDC_CHECK8,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,12,126,186,10
END
IDD_PATTERN_PROPERTIES DIALOGEX 0, 0, 190, 127
@@ -1716,9 +1716,16 @@
IDD_EDIT_FIND, DIALOG
BEGIN
- BOTTOMMARGIN, 145
+ RIGHTMARGIN, 176
+ BOTTOMMARGIN, 146
END
+ IDD_EDIT_REPLACE, DIALOG
+ BEGIN
+ RIGHTMARGIN, 182
+ BOTTOMMARGIN, 148
+ END
+
IDD_PATTERN_PROPERTIES, DIALOG
BEGIN
LEFTMARGIN, 4
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <sag...@us...> - 2011-07-22 20:54:24
|
Revision: 923
http://modplug.svn.sourceforge.net/modplug/?rev=923&view=rev
Author: saga-games
Date: 2011-07-22 20:54:18 +0000 (Fri, 22 Jul 2011)
Log Message:
-----------
[Ref] Moved effect colour assignment arrays from mptrack to draw_pat
Modified Paths:
--------------
trunk/OpenMPT/mptrack/Draw_pat.cpp
trunk/OpenMPT/mptrack/Mptrack.cpp
trunk/OpenMPT/mptrack/Mptrack.h
Modified: trunk/OpenMPT/mptrack/Draw_pat.cpp
===================================================================
--- trunk/OpenMPT/mptrack/Draw_pat.cpp 2011-07-22 17:43:39 UTC (rev 922)
+++ trunk/OpenMPT/mptrack/Draw_pat.cpp 2011-07-22 20:54:18 UTC (rev 923)
@@ -98,7 +98,38 @@
// some additions there.
+/////////////////////////////////////////////////////////////////////////////
+// Effect colour codes
+// Effect number => Effect colour assignment
+const BYTE effectColors[] =
+{
+ 0, 0, MODCOLOR_PITCH, MODCOLOR_PITCH,
+ MODCOLOR_PITCH, MODCOLOR_PITCH, MODCOLOR_VOLUME, MODCOLOR_VOLUME,
+ MODCOLOR_VOLUME, MODCOLOR_PANNING, 0, MODCOLOR_VOLUME,
+ MODCOLOR_GLOBALS, MODCOLOR_VOLUME, MODCOLOR_GLOBALS, 0,
+ MODCOLOR_GLOBALS, MODCOLOR_GLOBALS, 0, 0,
+ 0, MODCOLOR_VOLUME, MODCOLOR_VOLUME, MODCOLOR_GLOBALS,
+ MODCOLOR_GLOBALS, 0, MODCOLOR_PITCH, MODCOLOR_PANNING,
+ MODCOLOR_PITCH, MODCOLOR_PANNING, 0, 0,
+ 0, 0, 0, MODCOLOR_PITCH,
+ MODCOLOR_PITCH,
+};
+
+STATIC_ASSERT(CountOf(effectColors) == MAX_EFFECTS);
+
+// Volume effect number => Effect colour assignment
+const BYTE volEffectColors[] =
+{
+ 0, MODCOLOR_VOLUME, MODCOLOR_PANNING, MODCOLOR_VOLUME,
+ MODCOLOR_VOLUME, MODCOLOR_VOLUME, MODCOLOR_VOLUME, MODCOLOR_PITCH,
+ MODCOLOR_PITCH, MODCOLOR_PANNING, MODCOLOR_PANNING, MODCOLOR_PITCH,
+ MODCOLOR_PITCH, MODCOLOR_PITCH, 0, 0,
+};
+
+STATIC_ASSERT(CountOf(volEffectColors) == MAX_VOLCMDS);
+
+
/////////////////////////////////////////////////////////////////////////////
// CViewPattern Drawing Implementation
@@ -930,8 +961,8 @@
} else
if ((!m->IsPcNote()) && (m->volcmd) && (m->volcmd < MAX_VOLCMDS) && (CMainFrame::m_dwPatternSetup & PATTERN_EFFECTHILIGHT))
{
- if(gVolEffectColors[m->volcmd] != 0)
- tx_col = gVolEffectColors[m->volcmd];
+ if(volEffectColors[m->volcmd] != 0)
+ tx_col = volEffectColors[m->volcmd];
}
// Drawing Volume
m_Dib.SetTextColor(tx_col, bk_col);
@@ -948,8 +979,8 @@
fx_col = row_col;
if (!isPCnote && (m->command) && (m->command < MAX_EFFECTS) && (CMainFrame::m_dwPatternSetup & PATTERN_EFFECTHILIGHT))
{
- if(gEffectColors[m->command] != 0)
- fx_col = gEffectColors[m->command];
+ if(effectColors[m->command] != 0)
+ fx_col = effectColors[m->command];
}
if (!(dwSpeedUpMask & 0x08))
{
Modified: trunk/OpenMPT/mptrack/Mptrack.cpp
===================================================================
--- trunk/OpenMPT/mptrack/Mptrack.cpp 2011-07-22 17:43:39 UTC (rev 922)
+++ trunk/OpenMPT/mptrack/Mptrack.cpp 2011-07-22 20:54:18 UTC (rev 923)
@@ -212,28 +212,6 @@
TEXT("C-9"), TEXT("C#9"), TEXT("D-9"), TEXT("D#9"), TEXT("E-9"), TEXT("F-9"), TEXT("F#9"), TEXT("G-9"), TEXT("G#9"), TEXT("A-9"), TEXT("A#9"), TEXT("B-9"),
};
-const BYTE gEffectColors[MAX_EFFECTS] =
-{
- 0, 0, MODCOLOR_PITCH, MODCOLOR_PITCH,
- MODCOLOR_PITCH, MODCOLOR_PITCH, MODCOLOR_VOLUME, MODCOLOR_VOLUME,
- MODCOLOR_VOLUME, MODCOLOR_PANNING, 0, MODCOLOR_VOLUME,
- MODCOLOR_GLOBALS, MODCOLOR_VOLUME, MODCOLOR_GLOBALS, 0,
- MODCOLOR_GLOBALS, MODCOLOR_GLOBALS, 0, 0,
- 0, MODCOLOR_VOLUME, MODCOLOR_VOLUME, MODCOLOR_GLOBALS,
- MODCOLOR_GLOBALS, 0, MODCOLOR_PITCH, MODCOLOR_PANNING,
- MODCOLOR_PITCH, MODCOLOR_PANNING, 0, 0,
- 0, 0, 0, MODCOLOR_PITCH,
- MODCOLOR_PITCH,
-};
-
-const BYTE gVolEffectColors[MAX_VOLCMDS] =
-{
- 0, MODCOLOR_VOLUME, MODCOLOR_PANNING, MODCOLOR_VOLUME,
- MODCOLOR_VOLUME, MODCOLOR_VOLUME, MODCOLOR_VOLUME, MODCOLOR_PITCH,
- MODCOLOR_PITCH, MODCOLOR_PANNING, MODCOLOR_PANNING, MODCOLOR_PITCH,
- MODCOLOR_PITCH, MODCOLOR_PITCH, 0, 0,
-};
-
static void ShowChangesDialog()
//-----------------------------
{
Modified: trunk/OpenMPT/mptrack/Mptrack.h
===================================================================
--- trunk/OpenMPT/mptrack/Mptrack.h 2011-07-22 17:43:39 UTC (rev 922)
+++ trunk/OpenMPT/mptrack/Mptrack.h 2011-07-22 20:54:18 UTC (rev 923)
@@ -395,8 +395,6 @@
///////////////////////////////////////////////////
// Tables
-extern const BYTE gEffectColors[MAX_EFFECTS];
-extern const BYTE gVolEffectColors[MAX_VOLCMDS];
extern const LPCSTR szNoteNames[12];
extern const LPCTSTR szDefaultNoteNames[NOTE_MAX];
//const LPCTSTR szSpecialNoteNames[NOTE_MAX_SPECIAL - NOTE_MIN_SPECIAL + 1] = {TEXT("PCs"), TEXT("PC"), TEXT("~~"), TEXT("^^"), TEXT("==")};
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <sag...@us...> - 2011-07-22 17:43:45
|
Revision: 922
http://modplug.svn.sourceforge.net/modplug/?rev=922&view=rev
Author: saga-games
Date: 2011-07-22 17:43:39 +0000 (Fri, 22 Jul 2011)
Log Message:
-----------
Created tag for OpenMPT 1.19.03.00
Added Paths:
-----------
tags/1.19.03.00/
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <sag...@us...> - 2011-07-22 16:46:44
|
Revision: 921
http://modplug.svn.sourceforge.net/modplug/?rev=921&view=rev
Author: saga-games
Date: 2011-07-22 16:46:37 +0000 (Fri, 22 Jul 2011)
Log Message:
-----------
[Mod] Updated History.txt
[Mod] OpenMPT: Version is now 1.19.03.00
Modified Paths:
--------------
trunk/OpenMPT/mptrack/version.h
trunk/OpenMPT/packageTemplate/History.txt
Modified: trunk/OpenMPT/mptrack/version.h
===================================================================
--- trunk/OpenMPT/mptrack/version.h 2011-07-21 16:39:15 UTC (rev 920)
+++ trunk/OpenMPT/mptrack/version.h 2011-07-22 16:46:37 UTC (rev 921)
@@ -14,8 +14,8 @@
//Version definitions. The only thing that needs to be changed when changing version number.
#define VER_MAJORMAJOR 1
#define VER_MAJOR 19
-#define VER_MINOR 02
-#define VER_MINORMINOR 10
+#define VER_MINOR 03
+#define VER_MINORMINOR 00
//Creates version number from version parts that appears in version string.
//For example MAKE_VERSION_NUMERIC(1,17,02,28) gives version number of
Modified: trunk/OpenMPT/packageTemplate/History.txt
===================================================================
--- trunk/OpenMPT/packageTemplate/History.txt 2011-07-21 16:39:15 UTC (rev 920)
+++ trunk/OpenMPT/packageTemplate/History.txt 2011-07-22 16:46:37 UTC (rev 921)
@@ -10,13 +10,14 @@
(tx XYZ): thanks to XYZ for telling us about the bug / requesting the feature
-v1.19.03.00 (*** 2011, revision 912)
-------------------------------------
+v1.19.03.00 (July 2011, revision 921)
+-------------------------------------
General tab
[Imp] <Jojo> When editing panning, surround is disabled and when enabling surround, panning is reset.
[Imp] <Jojo> When moving a plugin to another slot, plugins routing their output to the selected plugin are now taken into account when choosing a default slot to move the plugin to.
Pattern tab
+ [Imp] <Jojo> Channel Surround status is now also indicated in the status bar.
[Fix] <Jojo> When playing a pattern that is actually not in the sequence and that has more rows than the last played order item, a crash could occour while playing those extra rows. (Welcome to episode 2938 of "this should not have happened afterall")
[Fix] <Jojo> Shift + Channel Dragging killed the last channel (http://bugs.openmpt.org/view.php?id=133).
[Fix] <Jojo> When using the pattern play controls (f.e. "Replay Pattern") on a pattern that isn't played in the normal play sequence, tempo and global volume commands on the first played row are not ignored anymore.
@@ -27,31 +28,37 @@
Sample tab
[Imp] <Jojo> When selecting parts of the sample, the selection range is now also displayed in samples, not only seconds (tx jmkz, http://bugs.openmpt.org/view.php?id=136).
[Imp] <Jojo> When changing the sample's global volume while removing DC offset, the change is now instantly applied to all channels that are currently playing the sample.
+ [Fix] <Jojo> 8-Bit Stereo samples were not saved correctly (tx jmkz, http://bugs.openmpt.org/view.php?id=153).
Instrument tab
[Imp] <Jojo> When in compatible mode, two envelope points cannot share the same tick anymore.
[Fix] <Jojo> Suggested filename when saving instrument was sometimes cut off.
VST
- [Fix] <Jojo> When a plugin requests song position in nano secods, the correct value should now be returned.
+ [Fix] <Jojo> When a plugin requests song position in nano seconds, the correct value should now be returned.
[Fix] <Jojo> Loading a VST preset (fxp) didn't mark the document as modified (tx BooT-SectoR-ViruZ)
+Playback
+ [Fix] <Jojo> Filters in XM files aren't reset with every new note anymore (this broke some versions ago).
+
IT
[Fix] <Jojo> Saving IT instruments (in both IT and ITI files) with an invalid sample map crashed the tracker (http://bugs.openmpt.org/view.php?id=142)
[Fix] <Jojo> (Also applies to MOD) When swapping samples on the fly and the current playback position is beyond the new sample's length, it's reset to 0.
MPTM
- [Fix] <Jojo> Saving long envelopes (> 25 envelope points) in the MPTM format was broken since... well, actually, it never worked in any officially released version.
+ [Fix] <Jojo> Saving long envelopes (> 25 envelope points) in the MPTM format was broken since... well, actually, it never worked in any officially released version. Now you can finally have up to 240 envelope points.
Other formats
[Fix] <Jojo> ITP Saver: Fixed nasty bug when the internal order length was not 256.
[Fix] <Jojo> IMF Loader: Orpheus' 8-Bit cutoff range was not converted to MPT's 7-Bit range.
Misc
- [Imp] <Jojo> Tagging: ID3 tags also contain a TDRC tag now, since this should be used instead of TYER in ID3v2.4. Also added a TPBM (beats per minute) tag.
+ [Imp] <Jojo> Tagging: ID3 tags contain a TDRC tag instead of TYER now, as recommend by the ID3v2.4 standard. Also added a TPBM (beats per minute) tag.
[Imp] <Jojo> Hack detection also notifies about stereo samples in XM files now.
[Imp] <Jojo> Fixed tab order in the pitch shift dialog.
[Mod] <Jojo> Song Properties: Legacy Mixmodes RC1 and RC2 are now only displayed if they are actually used by the module.
+ [Mod] <Jojo> When loading a module made with a newer version of OpenMPT which only differs in the build number (last number in the version), no warning is shown anymore. For all other cases, the warning is now also shown for MPTM files.
+ [Mod] <Jojo> If opening MIDI In fails, the MIDI config dialog is shown.
[Fix] <Jojo> MP3 export should no longer result in a heap corruption and thus crash the tracker (http://bugs.openmpt.org/view.php?id=97).
[Fix] <Jojo> Rendering sub songs to WAV resulted in an endless render loop.
[Fix] <Jojo> Setup Dialog: Fixed the checkbox list so that it doesn't look weird under Wine and doesn't crash when compiling OpenMPT with VS2010 (tx jmkz).
@@ -218,7 +225,7 @@
[Fix] <Jojo> XM Loader: Fixed handling of instruments with no samples, so that instruments assigned to VST plugins work correctly.
MOD
- [Imp] <Jojo> It's now possible to create MOD files with more than 64 distinct patterns. Just like in ProTracker, such MOD files are identified by the "M!K!" signature (instead of M.K.)
+ [Imp] <Jojo> It's now possible to create MOD files with more than 64 (and up to 128) distinct patterns. Just like in ProTracker, such MOD files are identified by the "M!K!" signature (instead of M.K.)
[Fix] <Jojo> The maximum speed for MOD files was off by one in some places (31 instead of 32).
MOD::Loading
@@ -481,7 +488,7 @@
[Fix] <Jojo> ITI/ITS Loader: Sample flags were not reset when a sample slot was overwritten when loading ITI or ITS files. That way, it was possible that f.e. the bidi loop flag was not disabled when loading a new sample that had a normal loop.
[Fix] <Jojo> IT Compatibility: Note Cut really cuts notes and does not just mute them (so that following volume commands could restore the sample)
[Fix] <Jojo> IT Compatibility: Always reset autovibrato settings when there's an instrument number (fix from SchismTracker)
- [Fix] <Jojo> IT Compatibility: S77 / S79/ S7B are supposed to pause the envelope, not disable it.
+ [Fix] <Jojo> IT Compatibility: S77 / S79 / S7B are supposed to pause the envelope, not disable it.
[Fix] <Jojo> IT Compatibility: ignore slide commands with both nibbles set (f.e. D55, PA1, ...)
[Fix] <Jojo> IT Compatibility: Default Vibrato/Tremolo/Panbrello waveform values to sine waveform if out of range (e.g. S35)
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <sag...@us...> - 2011-07-21 16:39:22
|
Revision: 920
http://modplug.svn.sourceforge.net/modplug/?rev=920&view=rev
Author: saga-games
Date: 2011-07-21 16:39:15 +0000 (Thu, 21 Jul 2011)
Log Message:
-----------
[Ref] Got rid of global gszModCommands / gszS3mCommands / gszVolCommands effect letter arrays. Always using modspecs-specific effect letter descriptions now.
Modified Paths:
--------------
trunk/OpenMPT/mptrack/Draw_pat.cpp
trunk/OpenMPT/mptrack/Moddoc.cpp
trunk/OpenMPT/mptrack/Modedit.cpp
trunk/OpenMPT/mptrack/Mptrack.h
trunk/OpenMPT/mptrack/View_pat.cpp
trunk/OpenMPT/mptrack/View_smp.cpp
Modified: trunk/OpenMPT/mptrack/Draw_pat.cpp
===================================================================
--- trunk/OpenMPT/mptrack/Draw_pat.cpp 2011-07-16 22:43:01 UTC (rev 919)
+++ trunk/OpenMPT/mptrack/Draw_pat.cpp 2011-07-21 16:39:15 UTC (rev 920)
@@ -973,7 +973,7 @@
if (m->command)
{
UINT command = m->command & 0x3F;
- int n = (pSndFile->m_nType & (MOD_TYPE_MOD|MOD_TYPE_XM)) ? gszModCommands[command] : gszS3mCommands[command];
+ int n = pSndFile->GetModSpecifications().GetEffectLetter(command);
ASSERT(n > ' ');
//if (n <= ' ') n = '?';
DrawLetter(xbmp+x, 0, (char)n, pfnt->nEltWidths[3], pfnt->nCmdOfs);
Modified: trunk/OpenMPT/mptrack/Moddoc.cpp
===================================================================
--- trunk/OpenMPT/mptrack/Moddoc.cpp 2011-07-16 22:43:01 UTC (rev 919)
+++ trunk/OpenMPT/mptrack/Moddoc.cpp 2011-07-21 16:39:15 UTC (rev 920)
@@ -2282,8 +2282,7 @@
if ((bXX) && (bSupported))
{
strcpy(pszDescription, " xx: ");
- LPCSTR pszCmd = (m_SndFile.m_nType & (MOD_TYPE_MOD|MOD_TYPE_XM)) ? gszModCommands : gszS3mCommands;
- pszDescription[0] = pszCmd[command];
+ pszDescription[0] = m_SndFile.GetModSpecifications().GetEffectLetter(command);
if ((gFXInfo[fxndx].dwParamMask & 0xF0) == 0xF0) pszDescription[1] = szHexChar[gFXInfo[fxndx].dwParamValue >> 4];
if ((gFXInfo[fxndx].dwParamMask & 0x0F) == 0x0F) pszDescription[2] = szHexChar[gFXInfo[fxndx].dwParamValue & 0x0F];
}
Modified: trunk/OpenMPT/mptrack/Modedit.cpp
===================================================================
--- trunk/OpenMPT/mptrack/Modedit.cpp 2011-07-16 22:43:01 UTC (rev 919)
+++ trunk/OpenMPT/mptrack/Modedit.cpp 2011-07-21 16:39:15 UTC (rev 920)
@@ -269,7 +269,7 @@
if(chnFrom < chnTo)
{
CHANNELINDEX temp = newOrder[chnFrom];
- for(UINT i = chnFrom; i < chnTo; i++)
+ for(CHANNELINDEX i = chnFrom; i < chnTo; i++)
{
newOrder[i] = newOrder[i + 1];
}
@@ -278,7 +278,7 @@
else //case chnFrom > chnTo(can't be equal, since it has been examined earlier.)
{
CHANNELINDEX temp = newOrder[chnFrom];
- for(UINT i = chnFrom; i >= chnTo + 1; i--)
+ for(CHANNELINDEX i = chnFrom; i >= chnTo + 1; i--)
{
newOrder[i] = newOrder[i - 1];
}
@@ -836,7 +836,7 @@
{
if ((m->volcmd) && (m->volcmd <= MAX_VOLCMDS))
{
- p[6] = gszVolCommands[m->volcmd];
+ p[6] = m_SndFile.GetModSpecifications().GetVolEffectLetter(m->volcmd);
p[7] = '0' + (m->vol / 10);
p[8] = '0' + (m->vol % 10);
} else p[6] = p[7] = p[8] = '.';
@@ -861,10 +861,7 @@
{
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];
+ p[9] = m_SndFile.GetModSpecifications().GetEffectLetter(m->command);
} else p[9] = '.';
if (m->param)
{
@@ -944,6 +941,7 @@
}
}
+ const CModSpecifications &sourceSpecs = CSoundFile::GetModSpecifications(origFormat);
const bool bS3MCommands = (origFormat & (MOD_TYPE_IT|MOD_TYPE_MPT|MOD_TYPE_S3M)) != 0 ? true : false;
pos = startPos;
@@ -1057,7 +1055,8 @@
m[col].volcmd = 0;
for (UINT i=1; i<MAX_VOLCMDS; i++)
{
- if (s[5] == gszVolCommands[i])
+ const char cmd = sourceSpecs.GetVolEffectLetter(i);
+ if (s[5] == cmd && cmd != '?')
{
m[col].volcmd = i;
break;
@@ -1086,10 +1085,14 @@
m[col].command = 0;
if (s[8] != '.')
{
- LPCSTR psc = (bS3MCommands) ? gszS3mCommands : gszModCommands;
for (UINT i=1; i<MAX_EFFECTS; i++)
{
- if ((s[8] == psc[i]) && (psc[i] != '?')) m[col].command = i;
+ const char cmd = sourceSpecs.GetEffectLetter(i);
+ if (s[8] == cmd && cmd != '?')
+ {
+ m[col].command = i;
+ break;
+ }
}
}
}
Modified: trunk/OpenMPT/mptrack/Mptrack.h
===================================================================
--- trunk/OpenMPT/mptrack/Mptrack.h 2011-07-16 22:43:01 UTC (rev 919)
+++ trunk/OpenMPT/mptrack/Mptrack.h 2011-07-21 16:39:15 UTC (rev 920)
@@ -408,9 +408,6 @@
STATIC_ASSERT(ARRAYELEMCOUNT(szSpecialNoteShortDesc) == ARRAYELEMCOUNT(szSpecialNoteNames));
const LPCSTR szHexChar = "0123456789ABCDEF";
-const LPCSTR gszModCommands = " 0123456789ABCDRFFTE???GHK?YXPLZ\\?#??"; //rewbs.smoothVST: added last \ (written as \\);
-const LPCSTR gszS3mCommands = " JFEGHLKRXODB?CQATI?SMNVW?UY?P?Z\\:#??"; //rewbs.smoothVST: added last \ (written as \\);
-const LPCSTR gszVolCommands = " vpcdabuhlrgfe:o";
const TCHAR gszEmpty[] = TEXT("");
// Defined in load_mid.cpp
Modified: trunk/OpenMPT/mptrack/View_pat.cpp
===================================================================
--- trunk/OpenMPT/mptrack/View_pat.cpp 2011-07-16 22:43:01 UTC (rev 919)
+++ trunk/OpenMPT/mptrack/View_pat.cpp 2011-07-21 16:39:15 UTC (rev 920)
@@ -2120,7 +2120,7 @@
if (m_findReplace.dwFindFlags & PATSEARCH_VOLCMD)
{
if (m_findReplace.cmdFind.volcmd)
- wsprintf(&szFind[strlen(szFind)], "%c", gszVolCommands[m_findReplace.cmdFind.volcmd]);
+ wsprintf(&szFind[strlen(szFind)], "%c", pSndFile->GetModSpecifications().GetVolEffectLetter(m_findReplace.cmdFind.volcmd));
else
strcat(szFind, ".");
} else strcat(szFind, "?");
@@ -2133,12 +2133,11 @@
{
if (m_findReplace.cmdFind.command)
{
- if (pSndFile->m_nType & (MOD_TYPE_S3M|MOD_TYPE_IT|MOD_TYPE_MPT))
- wsprintf(&szFind[strlen(szFind)], "%c", gszS3mCommands[m_findReplace.cmdFind.command]);
- else
- wsprintf(&szFind[strlen(szFind)], "%c", gszModCommands[m_findReplace.cmdFind.command]);
+ wsprintf(&szFind[strlen(szFind)], "%c", pSndFile->GetModSpecifications().GetEffectLetter(m_findReplace.cmdFind.command));
} else
+ {
strcat(szFind, ".");
+ }
} else strcat(szFind, "?");
if (m_findReplace.dwFindFlags & PATSEARCH_PARAM)
{
@@ -3328,6 +3327,10 @@
break;
+ case MIDIEVENT_POLYAFTERTOUCH:
+ case MIDIEVENT_CHANAFTERTOUCH:
+ break;
+
case MIDIEVENT_CONTROLLERCHANGE: //Controller change
switch(nByte1)
{
@@ -4020,7 +4023,6 @@
else if(pSndFile->GetModSpecifications().HasCommand(c))
{
- //LPCSTR lpcmd = (pSndFile->m_nType & (MOD_TYPE_MOD|MOD_TYPE_XM)) ? gszModCommands : gszS3mCommands;
if (c)
{
if ((c == m_cmdOld.command) && (!p->param) && (!p->command)) p->param = m_cmdOld.param;
Modified: trunk/OpenMPT/mptrack/View_smp.cpp
===================================================================
--- trunk/OpenMPT/mptrack/View_smp.cpp 2011-07-16 22:43:01 UTC (rev 919)
+++ trunk/OpenMPT/mptrack/View_smp.cpp 2011-07-21 16:39:15 UTC (rev 920)
@@ -1291,7 +1291,7 @@
const char cOffsetChar = pSndFile->GetModSpecifications().GetEffectLetter(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];
+ const char cHighOffsetChar = pSndFile->GetModSpecifications().GetEffectLetter((pSndFile->TypeIsS3M_IT_MPT()) ? CMD_S3MCMDEX : CMD_XFINEPORTAUPDOWN);
if(xHigh == 0)
wsprintf(s, "Offset: %c%02X", cOffsetChar, xLow);
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <sag...@us...> - 2011-07-16 22:43:08
|
Revision: 919
http://modplug.svn.sourceforge.net/modplug/?rev=919&view=rev
Author: saga-games
Date: 2011-07-16 22:43:01 +0000 (Sat, 16 Jul 2011)
Log Message:
-----------
[Mod] If opening MIDI In fails, the config dialog is shown.
Modified Paths:
--------------
trunk/OpenMPT/mptrack/Mpt_midi.cpp
Modified: trunk/OpenMPT/mptrack/Mpt_midi.cpp
===================================================================
--- trunk/OpenMPT/mptrack/Mpt_midi.cpp 2011-07-16 20:29:21 UTC (rev 918)
+++ trunk/OpenMPT/mptrack/Mpt_midi.cpp 2011-07-16 22:43:01 UTC (rev 919)
@@ -5,6 +5,7 @@
#include "moddoc.h"
#include "dlsbank.h"
#include "midi.h"
+#include "Moptions.h" // for OPTIONS_PAGE_MIDI
//#define MPTMIDI_RECORDLOG
@@ -122,6 +123,11 @@
if (midiInOpen(&shMidiIn, m_nMidiDevice, (DWORD)MidiInCallBack, 0, CALLBACK_FUNCTION) != MMSYSERR_NOERROR)
{
shMidiIn = NULL;
+
+ // Show MIDI configuration on fail.
+ CMainFrame::m_nLastOptionsPage = OPTIONS_PAGE_MIDI;
+ CMainFrame::GetMainFrame()->OnViewOptions();
+
return FALSE;
}
midiInStart(shMidiIn);
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <sag...@us...> - 2011-07-16 20:29:28
|
Revision: 918
http://modplug.svn.sourceforge.net/modplug/?rev=918&view=rev
Author: saga-games
Date: 2011-07-16 20:29:21 +0000 (Sat, 16 Jul 2011)
Log Message:
-----------
[Fix] Filters in XM files shouldn't be reset with every new note anymore. (*sigh*)
Modified Paths:
--------------
trunk/OpenMPT/soundlib/Sndfile.cpp
Modified: trunk/OpenMPT/soundlib/Sndfile.cpp
===================================================================
--- trunk/OpenMPT/soundlib/Sndfile.cpp 2011-07-15 22:14:45 UTC (rev 917)
+++ trunk/OpenMPT/soundlib/Sndfile.cpp 2011-07-16 20:29:21 UTC (rev 918)
@@ -2687,7 +2687,7 @@
m_defaultInstrument.nPPC = 5*12;
m_defaultInstrument.nGlobalVol=64;
m_defaultInstrument.nPan = 0x20 << 2;
- m_defaultInstrument.nIFC = 0xFF;
+ //m_defaultInstrument.nIFC = 0xFF;
m_defaultInstrument.PanEnv.nReleaseNode=ENV_RELEASE_NODE_UNSET;
m_defaultInstrument.PitchEnv.nReleaseNode=ENV_RELEASE_NODE_UNSET;
m_defaultInstrument.VolEnv.nReleaseNode=ENV_RELEASE_NODE_UNSET;
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <sag...@us...> - 2011-07-15 22:14:52
|
Revision: 917
http://modplug.svn.sourceforge.net/modplug/?rev=917&view=rev
Author: saga-games
Date: 2011-07-15 22:14:45 +0000 (Fri, 15 Jul 2011)
Log Message:
-----------
[Fix] 8-Bit Stereo Samples were not saved correctly. (http://bugs.openmpt.org/view.php?id=153)
Modified Paths:
--------------
trunk/OpenMPT/soundlib/Sampleio.cpp
trunk/OpenMPT/soundlib/Sndfile.cpp
Modified: trunk/OpenMPT/soundlib/Sampleio.cpp
===================================================================
--- trunk/OpenMPT/soundlib/Sampleio.cpp 2011-07-10 16:52:57 UTC (rev 916)
+++ trunk/OpenMPT/soundlib/Sampleio.cpp 2011-07-15 22:14:45 UTC (rev 917)
@@ -566,22 +566,20 @@
format.format = 1;
format.freqHz = pSmp->nC5Speed;
if (m_nType & (MOD_TYPE_MOD|MOD_TYPE_XM)) format.freqHz = TransposeToFrequency(pSmp->RelativeTone, pSmp->nFineTune);
- format.channels = (pSmp->uFlags & CHN_STEREO) ? 2 : 1;
- format.bitspersample = (pSmp->uFlags & CHN_16BIT) ? 16 : 8;
- format.samplesize = (format.channels*format.bitspersample)>>3;
+ format.channels = pSmp->GetNumChannels();
+ format.bitspersample = pSmp->GetElementarySampleSize() * 8;
+ format.samplesize = pSmp->GetBytesPerSample() * 8;
format.bytessec = format.freqHz*format.samplesize;
data.id_data = IFFID_data;
UINT nType;
- data.length = pSmp->nLength;
+ data.length = pSmp->GetSampleSizeInBytes();
if (pSmp->uFlags & CHN_STEREO)
{
nType = (pSmp->uFlags & CHN_16BIT) ? RS_STIPCM16S : RS_STIPCM8U;
- data.length *= 2;
} else
{
nType = (pSmp->uFlags & CHN_16BIT) ? RS_PCM16S : RS_PCM8U;
}
- if (pSmp->uFlags & CHN_16BIT) data.length *= 2;
header.filesize += data.length;
fwrite(&header, 1, sizeof(header), f);
fwrite(&format, 1, sizeof(format), f);
@@ -781,7 +779,7 @@
}
-VOID PatchToSample(CSoundFile *that, UINT nSample, LPBYTE lpStream, DWORD dwMemLength)
+void PatchToSample(CSoundFile *that, UINT nSample, LPBYTE lpStream, DWORD dwMemLength)
//------------------------------------------------------------------------------------
{
MODSAMPLE *pIns = &that->Samples[nSample];
@@ -877,7 +875,7 @@
// -! BEHAVIOUR_CHANGE#0003
pIns = new MODINSTRUMENT;
if (!pIns) return false;
- memset(pIns, 0, sizeof(MODINSTRUMENT));
+ MemsetZero(*pIns);
pIns->pTuning = pIns->s_DefaultTuning;
Instruments[nInstr] = pIns;
nSamples = plh->samples;
Modified: trunk/OpenMPT/soundlib/Sndfile.cpp
===================================================================
--- trunk/OpenMPT/soundlib/Sndfile.cpp 2011-07-10 16:52:57 UTC (rev 916)
+++ trunk/OpenMPT/soundlib/Sndfile.cpp 2011-07-15 22:14:45 UTC (rev 917)
@@ -1743,6 +1743,23 @@
if(f) fwrite(pSample, 1, len, f);
break;
+ // Stereo unsigned interleaved
+ case RS_STIPCM8U:
+ len = nLen * 2;
+ bufcount = 0;
+ for (UINT j=0; j<len; j++)
+ {
+ *((uint8 *)(&buffer[bufcount])) = *((uint8 *)(&pSample[j])) + 0x80;
+ bufcount++;
+ if (bufcount >= sizeof(buffer))
+ {
+ if(f) fwrite(buffer, 1, bufcount, f);
+ bufcount = 0;
+ }
+ }
+ if (bufcount) if(f) fwrite(buffer, 1, bufcount, f);
+ break;
+
// Default: assume 8-bit PCM data
default:
len = nLen;
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <sag...@us...> - 2011-07-10 16:53:03
|
Revision: 916
http://modplug.svn.sourceforge.net/modplug/?rev=916&view=rev
Author: saga-games
Date: 2011-07-10 16:52:57 +0000 (Sun, 10 Jul 2011)
Log Message:
-----------
[Fix] VSTi Notes were not stopped properly in compatible mode if the sample map entry for the note was transpased.
[Mod] OpenMPT: Version is now 1.19.02.10
Modified Paths:
--------------
trunk/OpenMPT/mptrack/version.h
trunk/OpenMPT/soundlib/Snd_fx.cpp
Modified: trunk/OpenMPT/mptrack/version.h
===================================================================
--- trunk/OpenMPT/mptrack/version.h 2011-07-07 20:30:45 UTC (rev 915)
+++ trunk/OpenMPT/mptrack/version.h 2011-07-10 16:52:57 UTC (rev 916)
@@ -15,7 +15,7 @@
#define VER_MAJORMAJOR 1
#define VER_MAJOR 19
#define VER_MINOR 02
-#define VER_MINORMINOR 09
+#define VER_MINORMINOR 10
//Creates version number from version parts that appears in version string.
//For example MAKE_VERSION_NUMERIC(1,17,02,28) gives version number of
Modified: trunk/OpenMPT/soundlib/Snd_fx.cpp
===================================================================
--- trunk/OpenMPT/soundlib/Snd_fx.cpp 2011-07-07 20:30:45 UTC (rev 915)
+++ trunk/OpenMPT/soundlib/Snd_fx.cpp 2011-07-10 16:52:57 UTC (rev 916)
@@ -1225,7 +1225,13 @@
{
// apply NNA to this Plug iff this plug is currently playing a note on this tracking chan
// (and if it is playing a note, we know that would be the last note played on this chan).
- applyNNAtoPlug = pPlugin->isPlaying(pChn->nNote, pChn->pModInstrument->nMidiChannel, nChn);
+ MODCOMMAND::NOTE note = pChn->nNote;
+ // Caution: When in compatible mode, MODCHANNEL::nNote stores the "real" note, not the mapped note!
+ if(IsCompatibleMode(TRK_IMPULSETRACKER) && note < CountOf(pChn->pModInstrument->NoteMap))
+ {
+ note = pChn->pModInstrument->NoteMap[note - 1];
+ }
+ applyNNAtoPlug = pPlugin->isPlaying(note, pChn->pModInstrument->nMidiChannel, nChn);
}
}
}
@@ -4231,3 +4237,4 @@
return 1;
}
}
+
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <sag...@us...> - 2011-07-07 20:30:51
|
Revision: 915
http://modplug.svn.sourceforge.net/modplug/?rev=915&view=rev
Author: saga-games
Date: 2011-07-07 20:30:45 +0000 (Thu, 07 Jul 2011)
Log Message:
-----------
[Imp] Pattern Editor: Channel Surround status is now also indicated in the status bar.
[Ref] Some MemsetZero refactoring action
Modified Paths:
--------------
trunk/OpenMPT/mptrack/Draw_pat.cpp
trunk/OpenMPT/mptrack/MainFrm.cpp
trunk/OpenMPT/mptrack/Vstplug.cpp
trunk/OpenMPT/soundlib/Sndfile.cpp
Modified: trunk/OpenMPT/mptrack/Draw_pat.cpp
===================================================================
--- trunk/OpenMPT/mptrack/Draw_pat.cpp 2011-07-02 13:10:28 UTC (rev 914)
+++ trunk/OpenMPT/mptrack/Draw_pat.cpp 2011-07-07 20:30:45 UTC (rev 915)
@@ -1574,14 +1574,15 @@
if (!pSndFile) return;
//xtraInfo.Format("Chan: %d; macro: %X; cutoff: %X; reso: %X; pan: %X",
- xtraInfo.Format("Chn:%d; Vol:%X; Mac:%X; Cut:%X%s; Res:%X; Pan:%X",
+ xtraInfo.Format("Chn:%d; Vol:%X; Mac:%X; Cut:%X%s; Res:%X; Pan:%X%s",
nChn+1,
pSndFile->Chn[nChn].nGlobalVol,
pSndFile->Chn[nChn].nActiveMacro,
pSndFile->Chn[nChn].nCutOff,
(pSndFile->Chn[nChn].nFilterMode == FLTMODE_HIGHPASS) ? "-Hi" : "",
pSndFile->Chn[nChn].nResonance,
- pSndFile->Chn[nChn].nPan);
+ pSndFile->Chn[nChn].nPan,
+ (pSndFile->Chn[nChn].dwFlags & CHN_SURROUND) ? "-S" : "");
pMainFrm->SetXInfoText(xtraInfo);
}
Modified: trunk/OpenMPT/mptrack/MainFrm.cpp
===================================================================
--- trunk/OpenMPT/mptrack/MainFrm.cpp 2011-07-02 13:10:28 UTC (rev 914)
+++ trunk/OpenMPT/mptrack/MainFrm.cpp 2011-07-07 20:30:45 UTC (rev 915)
@@ -351,7 +351,7 @@
}
// Create Audio Critical Section
- memset(&m_csAudio, 0, sizeof(CRITICAL_SECTION));
+ MemsetZero(m_csAudio);
InitializeCriticalSection(&m_csAudio);
m_csRegKey.Format("%s%s", MAINFRAME_REGKEY_BASE, MAINFRAME_REGKEY_DEFAULT);
@@ -2022,7 +2022,7 @@
if (m_hFollowSong)
{
MPTNOTIFICATION mn;
- memset(&mn, 0, sizeof(mn));
+ MemsetZero(mn);
mn.dwType = MPTNOTIFY_STOP;
::SendMessage(m_hFollowSong, WM_MOD_UPDATEPOSITION, 0, (LPARAM)&mn);
}
@@ -2038,12 +2038,16 @@
//Commented above line - why loop should be disabled when pausing?
m_pSndFile->m_dwSongFlags &= ~SONG_PAUSED;
- if (m_pSndFile == &m_WaveFile) {
+ if (m_pSndFile == &m_WaveFile)
+ {
m_pSndFile = NULL;
m_WaveFile.Destroy();
- } else {
- for (UINT i=m_pSndFile->m_nChannels; i<MAX_CHANNELS; i++) {
- if (!(m_pSndFile->Chn[i].nMasterChn)) {
+ } else
+ {
+ for (UINT i=m_pSndFile->m_nChannels; i<MAX_CHANNELS; i++)
+ {
+ if (!(m_pSndFile->Chn[i].nMasterChn))
+ {
m_pSndFile->Chn[i].nPos = m_pSndFile->Chn[i].nPosLo = m_pSndFile->Chn[i].nLength = 0;
}
}
@@ -2509,12 +2513,15 @@
int nPlugslot=-1;
CModDoc* pModDoc = GetActiveDoc();
- if (pModDoc) {
+ if (pModDoc)
+ {
CSoundFile *pSndFile = pModDoc->GetSoundFile();
//Find empty plugin slot
- for (int nPlug=0; nPlug<MAX_MIXPLUGINS; nPlug++) {
+ for (int nPlug=0; nPlug<MAX_MIXPLUGINS; nPlug++)
+ {
PSNDMIXPLUGIN pCandidatePlugin = &pSndFile->m_MixPlugins[nPlug];
- if (pCandidatePlugin->pMixPlugin == NULL) {
+ if (pCandidatePlugin->pMixPlugin == NULL)
+ {
nPlugslot=nPlug;
break;
}
@@ -2522,7 +2529,8 @@
}
CSelectPluginDlg dlg(GetActiveDoc(), nPlugslot, this);
dlg.DoModal();
- if (pModDoc) {
+ if (pModDoc)
+ {
//Refresh views
pModDoc->UpdateAllViews(NULL, HINT_MIXPLUGINS|HINT_MODTYPE);
//Refresh Controls
@@ -2539,10 +2547,12 @@
void CMainFrame::OnChannelManager()
//---------------------------------
{
- if(GetActiveDoc() && CChannelManagerDlg::sharedInstance()){
+ if(GetActiveDoc() && CChannelManagerDlg::sharedInstance())
+ {
if(CChannelManagerDlg::sharedInstance()->IsDisplayed())
CChannelManagerDlg::sharedInstance()->Hide();
- else{
+ else
+ {
CChannelManagerDlg::sharedInstance()->SetDocument(NULL);
CChannelManagerDlg::sharedInstance()->Show();
}
@@ -2640,9 +2650,11 @@
}
m_wndToolBar.SetCurrentSong(m_pSndFile);
- if (m_pAutoSaver && m_pAutoSaver->IsEnabled()) {
+ if (m_pAutoSaver && m_pAutoSaver->IsEnabled())
+ {
bool success = m_pAutoSaver->DoSave(curTime);
- if (!success) { //autosave failure; bring up options.
+ if (!success) // autosave failure; bring up options.
+ {
CMainFrame::m_nLastOptionsPage = OPTIONS_PAGE_AUTOSAVE;
OnViewOptions();
}
@@ -2656,7 +2668,8 @@
pModDoc->SetModifiedFlag(pModDoc->m_bDocModified);
pModDoc->m_bModifiedChanged=false;
}*/
- if (m_pJustModifiedDoc) {
+ if (m_pJustModifiedDoc)
+ {
m_pJustModifiedDoc->SetModified(true);
m_pJustModifiedDoc = NULL;
}
@@ -3091,10 +3104,12 @@
//---------------------------------------------------------
{
static bool firstShow = true;
- if (bShow && !IsWindowVisible() && firstShow) {
+ if (bShow && !IsWindowVisible() && firstShow)
+ {
firstShow = false;
WINDOWPLACEMENT wpl;
- if (GetPrivateProfileStruct("Display", "WindowPlacement", &wpl, sizeof(WINDOWPLACEMENT), theApp.GetConfigFileName())) {
+ if (GetPrivateProfileStruct("Display", "WindowPlacement", &wpl, sizeof(WINDOWPLACEMENT), theApp.GetConfigFileName()))
+ {
SetWindowPlacement(&wpl);
}
}
Modified: trunk/OpenMPT/mptrack/Vstplug.cpp
===================================================================
--- trunk/OpenMPT/mptrack/Vstplug.cpp 2011-07-02 13:10:28 UTC (rev 914)
+++ trunk/OpenMPT/mptrack/Vstplug.cpp 2011-07-07 20:30:45 UTC (rev 915)
@@ -1412,7 +1412,7 @@
if (m_pPlugin->pPluginData) delete[] m_pPlugin->pPluginData;
m_pPlugin->pPluginData = NULL;
// Initialize plugin info
- memset(&m_pPlugin->Info, 0, sizeof(m_pPlugin->Info));
+ MemsetZero(m_pPlugin->Info);
m_pPlugin->Info.dwPluginId1 = pFactory->dwPluginId1;
m_pPlugin->Info.dwPluginId2 = pFactory->dwPluginId2;
@@ -1462,7 +1462,7 @@
if (m_pPlugin->pPluginData) delete[] m_pPlugin->pPluginData;
m_pPlugin->pPluginData = NULL;
// Clear plugin info
- memset(&m_pPlugin->Info, 0, sizeof(m_pPlugin->Info));
+ MemsetZero(m_pPlugin->Info);
END_CRITICAL();
}
@@ -1599,7 +1599,7 @@
//--------------------------------------------------------------------------------------------------------------
{
TVINSERTSTRUCT tvis;
- memset(&tvis, 0, sizeof(tvis));
+ MemsetZero(tvis);
tvis.hParent = hParent;
tvis.hInsertAfter = (bSort) ? TVI_SORT : TVI_FIRST;
Modified: trunk/OpenMPT/soundlib/Sndfile.cpp
===================================================================
--- trunk/OpenMPT/soundlib/Sndfile.cpp 2011-07-02 13:10:28 UTC (rev 914)
+++ trunk/OpenMPT/soundlib/Sndfile.cpp 2011-07-07 20:30:45 UTC (rev 915)
@@ -475,27 +475,27 @@
m_pModDoc = NULL;
m_dwLastSavedWithVersion=0;
m_dwCreatedWithVersion=0;
- memset(m_bChannelMuteTogglePending, 0, sizeof(m_bChannelMuteTogglePending));
+ MemsetZero(m_bChannelMuteTogglePending);
// -> CODE#0023
// -> DESC="IT project files (.itp)"
for(UINT i = 0; i < MAX_INSTRUMENTS; i++)
{
- m_szInstrumentPath[i][0] = '\0';
+ MemsetZero(m_szInstrumentPath[i]);
}
// -! NEW_FEATURE#0023
- memset(Chn, 0, sizeof(Chn));
- memset(ChnMix, 0, sizeof(ChnMix));
- memset(Samples, 0, sizeof(Samples));
- memset(ChnSettings, 0, sizeof(ChnSettings));
- memset(Instruments, 0, sizeof(Instruments));
+ MemsetZero(Chn);
+ MemsetZero(ChnMix);
+ MemsetZero(Samples);
+ MemsetZero(ChnSettings);
+ MemsetZero(Instruments);
+ MemsetZero(m_szNames);
+ MemsetZero(m_MixPlugins);
+ MemsetZero(m_SongEQ);
Order.Init();
Patterns.ClearPatterns();
- memset(m_szNames, 0, sizeof(m_szNames));
- memset(m_MixPlugins, 0, sizeof(m_MixPlugins));
- memset(&m_SongEQ, 0, sizeof(m_SongEQ));
m_lTotalSampleCount=0;
m_pConfig = new CSoundFilePlayConfig();
@@ -548,16 +548,16 @@
m_nMaxOrderPosition = 0;
m_lpszSongComments = nullptr;
m_nMixLevels = mixLevels_compatible; // Will be overridden if appropriate.
- memset(Samples, 0, sizeof(Samples));
- memset(ChnMix, 0, sizeof(ChnMix));
- memset(Chn, 0, sizeof(Chn));
- memset(Instruments, 0, sizeof(Instruments));
+ MemsetZero(Samples);
+ MemsetZero(ChnMix);
+ MemsetZero(Chn);
+ MemsetZero(Instruments);
+ MemsetZero(m_szNames);
+ MemsetZero(m_MixPlugins);
+ MemsetZero(m_SongEQ);
//Order.assign(MAX_ORDERS, Order.GetInvalidPatIndex());
Order.resize(1);
Patterns.ClearPatterns();
- memset(m_szNames, 0, sizeof(m_szNames));
- memset(m_MixPlugins, 0, sizeof(m_MixPlugins));
- memset(&m_SongEQ, 0, sizeof(m_SongEQ));
ResetMidiCfg();
for (CHANNELINDEX nChn = 0; nChn < MAX_BASECHANNELS; nChn++)
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <sag...@us...> - 2011-07-02 13:10:35
|
Revision: 914
http://modplug.svn.sourceforge.net/modplug/?rev=914&view=rev
Author: saga-games
Date: 2011-07-02 13:10:28 +0000 (Sat, 02 Jul 2011)
Log Message:
-----------
[Fix] Tagging: Added text ending character to text strings in ID3v2 tags.
[Mod] Mod Loading: When loading a file made with a newer version of OpenMPT that only differs in the build number (last number in the version), no warning is shown anymore. For all other cases, the warning is now also shown for MPTM files.
Modified Paths:
--------------
trunk/OpenMPT/mptrack/Moddoc.cpp
trunk/OpenMPT/mptrack/tagging.cpp
trunk/OpenMPT/mptrack/test/test.cpp
trunk/OpenMPT/mptrack/version.h
Modified: trunk/OpenMPT/mptrack/Moddoc.cpp
===================================================================
--- trunk/OpenMPT/mptrack/Moddoc.cpp 2011-07-02 12:28:51 UTC (rev 913)
+++ trunk/OpenMPT/mptrack/Moddoc.cpp 2011-07-02 13:10:28 UTC (rev 914)
@@ -397,9 +397,8 @@
ReinitRecordState();
// -! NEW_FEATURE#0015
- // Show warning if file was made with more recent version of OpenMPT except for MPTM-files,
- // which uses CModDocs log-mechanism to show messages.
- if (m_SndFile.m_dwLastSavedWithVersion > MptVersion::num && m_SndFile.GetType() != MOD_TYPE_MPT)
+ // Show warning if file was made with more recent version of OpenMPT except
+ if(MptVersion::RemoveBuildNumber(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",
Modified: trunk/OpenMPT/mptrack/tagging.cpp
===================================================================
--- trunk/OpenMPT/mptrack/tagging.cpp 2011-07-02 12:28:51 UTC (rev 913)
+++ trunk/OpenMPT/mptrack/tagging.cpp 2011-07-02 13:10:28 UTC (rev 914)
@@ -62,12 +62,12 @@
WriteID3v2Frame("TCOM", artist, f);
WriteID3v2Frame("TALB", album, f);
WriteID3v2Frame("TCON", genre, f);
- WriteID3v2Frame("TYER", year, f);
+ //WriteID3v2Frame("TYER", year, f); // Deprecated
WriteID3v2Frame("TDRC", year, f);
+ WriteID3v2Frame("TBPM", bpm, f);
WriteID3v2Frame("WXXX", url, f);
WriteID3v2Frame("TENC", encoder, f);
WriteID3v2Frame("COMM", comments, f);
- WriteID3v2Frame("TBPM", bpm, f);
// Write Padding
for(size_t i = 0; i < ID3v2_PADDING; i++)
@@ -102,6 +102,7 @@
sFramecontent = ID3v2_TEXTENDING + sFramecontent;
}
sFramecontent = ID3v2_CHARSET + sFramecontent;
+ sFramecontent += ID3v2_TEXTENDING;
TAGID3v2FRAME tFrame;
Modified: trunk/OpenMPT/mptrack/test/test.cpp
===================================================================
--- trunk/OpenMPT/mptrack/test/test.cpp 2011-07-02 12:28:51 UTC (rev 913)
+++ trunk/OpenMPT/mptrack/test/test.cpp 2011-07-02 13:10:28 UTC (rev 914)
@@ -98,6 +98,11 @@
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 );
+ VERIFY_EQUAL( MptVersion::RemoveBuildNumber(MAKE_VERSION_NUMERIC(1,19,02,00)), MAKE_VERSION_NUMERIC(1,19,02,00));
+ VERIFY_EQUAL( MptVersion::RemoveBuildNumber(MAKE_VERSION_NUMERIC(1,18,03,20)), MAKE_VERSION_NUMERIC(1,18,03,00));
+ VERIFY_EQUAL( MptVersion::IsTestBuild(MAKE_VERSION_NUMERIC(1,18,01,13)), true);
+ VERIFY_EQUAL( MptVersion::IsTestBuild(MAKE_VERSION_NUMERIC(1,19,01,00)), false);
+ VERIFY_EQUAL( MptVersion::IsTestBuild(MAKE_VERSION_NUMERIC(1,17,02,54)), false);
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 );
Modified: trunk/OpenMPT/mptrack/version.h
===================================================================
--- trunk/OpenMPT/mptrack/version.h 2011-07-02 12:28:51 UTC (rev 913)
+++ trunk/OpenMPT/mptrack/version.h 2011-07-02 13:10:28 UTC (rev 914)
@@ -34,15 +34,16 @@
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)
+ // Returns numerical version value from given version string.
+ static 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)
+ };
+
+ // Returns version string from given numerical version value.
+ static CString ToStr(const VersionNum v)
{
CString strVersion;
if(v == 0)
@@ -50,6 +51,20 @@
else
strVersion.Format("%X.%02X.%02X.%02X", (v>>24)&0xFF, (v>>16)&0xFF, (v>>8)&0xFF, (v)&0xFF);
return strVersion;
+ };
+
+ // Return a version without build number (the last number in the version).
+ // The current versioning scheme uses this number only for test builds, and it should be 00 for official builds,
+ // So sometimes it might be wanted to do comparisons without the build number.
+ static VersionNum RemoveBuildNumber(const VersionNum num)
+ {
+ return (num & 0xFFFFFF00);
+ };
+
+ // Returns true if a given version number is from a test build, false if it's a release build.
+ static bool IsTestBuild(const VersionNum num)
+ {
+ return ((num > MAKE_VERSION_NUMERIC(1,17,02,54) && num < MAKE_VERSION_NUMERIC(1,18,02,00)) || (num > MAKE_VERSION_NUMERIC(1,18,02,00) && RemoveBuildNumber(num) != num));
}
}; //namespace MptVersion
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <sag...@us...> - 2011-07-02 12:28:58
|
Revision: 913
http://modplug.svn.sourceforge.net/modplug/?rev=913&view=rev
Author: saga-games
Date: 2011-07-02 12:28:51 +0000 (Sat, 02 Jul 2011)
Log Message:
-----------
[Fix] Hopefully the final fix for ACM MP3 export...
Modified Paths:
--------------
trunk/OpenMPT/mptrack/Mod2wave.cpp
trunk/OpenMPT/mptrack/Mptrack.cpp
Modified: trunk/OpenMPT/mptrack/Mod2wave.cpp
===================================================================
--- trunk/OpenMPT/mptrack/Mod2wave.cpp 2011-07-01 20:15:53 UTC (rev 912)
+++ trunk/OpenMPT/mptrack/Mod2wave.cpp 2011-07-02 12:28:51 UTC (rev 913)
@@ -81,7 +81,7 @@
}
m_dwFileLimit = 0;
m_dwSongLimit = 0;
- memset(&WaveFormat, 0, sizeof(WaveFormat));
+ MemsetZero(WaveFormat);
WaveFormat.Format.wFormatTag = WAVE_FORMAT_PCM;
WaveFormat.Format.nChannels = 2;
WaveFormat.Format.nSamplesPerSec = 44100;
@@ -359,8 +359,8 @@
m_bDriversEnumerated = FALSE;
m_nNumFormats = 0;
m_nNumDrivers = 0;
- memset(&afd, 0, sizeof(afd));
- memset(pwfx, 0, sizeof(wfx));
+ MemsetZero(afd);
+ MemsetZero(*pwfx);
afd.cbStruct = sizeof(ACMFORMATDETAILS);
afd.dwFormatTag = WAVE_FORMAT_PCM;
afd.pwfx = pwfx;
@@ -401,8 +401,8 @@
m_nDriverIndex = m_CbnDriver.GetItemData(m_CbnDriver.GetCurSel());
m_bInitialFound = FALSE;
if (m_nDriverIndex >= m_nNumDrivers) m_nDriverIndex = 0;
- memset(&afd, 0, sizeof(afd));
- memset(wfx, 0, sizeof(wfx));
+ MemsetZero(afd);
+ MemsetZero(wfx);
afd.cbStruct = sizeof(ACMFORMATDETAILS);
afd.dwFormatTag = WAVE_FORMAT_PCM;
afd.pwfx = pwfx;
@@ -452,7 +452,7 @@
{
if (Drivers[i] == hdid) return TRUE;
}
- memset(&add, 0, sizeof(add));
+ MemsetZero(add);
add.cbStruct = sizeof(add);
if (theApp.AcmDriverDetails(hdid, &add, 0L) == MMSYSERR_NOERROR)
{
@@ -993,9 +993,9 @@
// Open the ACM Driver
if (theApp.AcmDriverOpen(&hADriver, m_hadid, 0L) != MMSYSERR_NOERROR) goto OnError;
if (theApp.AcmStreamOpen(&hAStream, hADriver, &wfxSrc, m_pwfx, NULL, 0L, 0L, ACM_STREAMOPENF_NONREALTIME) != MMSYSERR_NOERROR) goto OnError;
- // Next call is useless for BLADEenc/LAMEenc. Is it required for ACM codecs?
+ // This call is useless for BLADEenc/LAMEenc, but required for ACM codecs!
if (theApp.AcmStreamSize(hAStream, WAVECONVERTBUFSIZE, &dwDstBufSize, ACM_STREAMSIZEF_SOURCE) != MMSYSERR_NOERROR) goto OnError;
- ASSERT(dwDstBufSize <= WAVECONVERTBUFSIZE);
+ // This call is useless for ACM, but required for BLADEenc/LAMEenc codecs!
if (theApp.AcmStreamSize(hAStream, WAVECONVERTBUFSIZE, &dwDstBufSize, ACM_STREAMSIZEF_DESTINATION) != MMSYSERR_NOERROR) goto OnError;
//if (dwDstBufSize > 0x10000) dwDstBufSize = 0x10000;
pcmBuffer = new BYTE[WAVECONVERTBUFSIZE];
Modified: trunk/OpenMPT/mptrack/Mptrack.cpp
===================================================================
--- trunk/OpenMPT/mptrack/Mptrack.cpp 2011-07-01 20:15:53 UTC (rev 912)
+++ trunk/OpenMPT/mptrack/Mptrack.cpp 2011-07-02 12:28:51 UTC (rev 913)
@@ -807,7 +807,7 @@
//m_hAlternateResourceHandle = LoadLibrary("mpt_intl.dll");
- memset(&gMemStatus, 0, sizeof(gMemStatus));
+ MemsetZero(gMemStatus);
GlobalMemoryStatus(&gMemStatus);
#if 0
Log("Physical: %lu\n", gMemStatus.dwTotalPhys);
@@ -2075,7 +2075,7 @@
// & release builds when ran directly from vs.net
m_pTextDib = lpTextDib;
- memset(&m_Dib, 0, sizeof(m_Dib));
+ MemsetZero(m_Dib);
m_nTextColor = 0;
m_nBkColor = 1;
m_Dib.bmiHeader.biSize = sizeof(BITMAPINFOHEADER);
@@ -2743,6 +2743,8 @@
}
if (m_hACMInst)
{
+ if (fdwSize & ACM_STREAMSIZEF_DESTINATION) // Why does acmStreamSize return ACMERR_NOTPOSSIBLE in this case?
+ return MMSYSERR_NOERROR;
PFNACMSTREAMSIZE pfnAcmStreamSize = (PFNACMSTREAMSIZE)GetProcAddress(m_hACMInst, "acmStreamSize");
if (pfnAcmStreamSize) return pfnAcmStreamSize(has, cbInput, pdwOutputBytes, fdwSize);
}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <sag...@us...> - 2011-07-01 20:16:00
|
Revision: 912
http://modplug.svn.sourceforge.net/modplug/?rev=912&view=rev
Author: saga-games
Date: 2011-07-01 20:15:53 +0000 (Fri, 01 Jul 2011)
Log Message:
-----------
[Fix] IT/MOD Replay: When swapping samples on the fly and the current playback position is beyond the new sample's length, it's reset to 0 (may not be 100% accurate)
[Ref] Some oneliner changes
[Mod] Updated history.txt
[Mod] OpenMPT: Version is now 1.19.02.09
Modified Paths:
--------------
trunk/OpenMPT/mptrack/View_smp.cpp
trunk/OpenMPT/mptrack/Vstplug.cpp
trunk/OpenMPT/mptrack/version.h
trunk/OpenMPT/packageTemplate/History.txt
trunk/OpenMPT/soundlib/Snd_fx.cpp
Modified: trunk/OpenMPT/mptrack/View_smp.cpp
===================================================================
--- trunk/OpenMPT/mptrack/View_smp.cpp 2011-07-01 20:00:39 UTC (rev 911)
+++ trunk/OpenMPT/mptrack/View_smp.cpp 2011-07-01 20:15:53 UTC (rev 912)
@@ -164,6 +164,7 @@
m_nScrollFactor = 0;
UINT cx0 = m_sizeTotal.cx;
UINT cx = cx0;
+ // Limit scroll size. FIXME: For long samples, this causes the last few sampling points to be invisible! (Rounding error?)
while (cx > 30000)
{
m_nScrollFactor++;
Modified: trunk/OpenMPT/mptrack/Vstplug.cpp
===================================================================
--- trunk/OpenMPT/mptrack/Vstplug.cpp 2011-07-01 20:00:39 UTC (rev 911)
+++ trunk/OpenMPT/mptrack/Vstplug.cpp 2011-07-01 20:15:53 UTC (rev 912)
@@ -287,11 +287,8 @@
if (!hLib && dw != ERROR_MOD_NOT_FOUND) // "File not found errors" are annoying.
{
TCHAR szBuf[256];
- LPVOID lpMsgBuf;
- FormatMessage(FORMAT_MESSAGE_ALLOCATE_BUFFER | FORMAT_MESSAGE_FROM_SYSTEM, NULL, dw, MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT), (LPTSTR) &lpMsgBuf, 0, NULL );
- wsprintf(szBuf, "Warning: encountered problem when loading plugin dll. Error %d: %s", dw, lpMsgBuf);
+ wsprintf(szBuf, "Warning: encountered problem when loading plugin dll. Error %d: %s", dw, GetErrorMessage(dw));
MessageBox(NULL, szBuf, "DEBUG: Error when loading plugin dll", MB_OK);
- LocalFree(lpMsgBuf);
}
#endif //_DEBUG
//end rewbs.VSTcompliance
@@ -1801,7 +1798,6 @@
//rewbs.VSTcompliance
//Store a pointer so we can get the CVstPlugin object from the basic VST effect object.
- //Assuming 32bit address space...
m_pEffect->resvd1=ToVstPtr(this);
//rewbs.plugDocAware
m_pSndFile = pSndFile;
@@ -2935,6 +2931,7 @@
if ((nMidiProg < 0x80) && (progChanged || bankChanged /*|| chanChanged */ ))
{
pCh->nProgram = nMidiProg;
+ //GetSoundFile()->ProcessMIDIMacro(trackChannel, false, GetSoundFile()->m_MidiCfg.szMidiGlb[MIDIOUT_PROGRAM], 0);
MidiSend((nMidiProg<<8)|(0xC0|nCh));
}
Modified: trunk/OpenMPT/mptrack/version.h
===================================================================
--- trunk/OpenMPT/mptrack/version.h 2011-07-01 20:00:39 UTC (rev 911)
+++ trunk/OpenMPT/mptrack/version.h 2011-07-01 20:15:53 UTC (rev 912)
@@ -15,7 +15,7 @@
#define VER_MAJORMAJOR 1
#define VER_MAJOR 19
#define VER_MINOR 02
-#define VER_MINORMINOR 08
+#define VER_MINORMINOR 09
//Creates version number from version parts that appears in version string.
//For example MAKE_VERSION_NUMERIC(1,17,02,28) gives version number of
Modified: trunk/OpenMPT/packageTemplate/History.txt
===================================================================
--- trunk/OpenMPT/packageTemplate/History.txt 2011-07-01 20:00:39 UTC (rev 911)
+++ trunk/OpenMPT/packageTemplate/History.txt 2011-07-01 20:15:53 UTC (rev 912)
@@ -10,28 +10,53 @@
(tx XYZ): thanks to XYZ for telling us about the bug / requesting the feature
-v1.20.01.00 (*** 2011, revision 887)
+v1.19.03.00 (*** 2011, revision 912)
------------------------------------
+General tab
+ [Imp] <Jojo> When editing panning, surround is disabled and when enabling surround, panning is reset.
+ [Imp] <Jojo> When moving a plugin to another slot, plugins routing their output to the selected plugin are now taken into account when choosing a default slot to move the plugin to.
+
Pattern tab
[Fix] <Jojo> When playing a pattern that is actually not in the sequence and that has more rows than the last played order item, a crash could occour while playing those extra rows. (Welcome to episode 2938 of "this should not have happened afterall")
- [Fix] <Jojo> Shift + Channel Dragging killed the last channel.
+ [Fix] <Jojo> Shift + Channel Dragging killed the last channel (http://bugs.openmpt.org/view.php?id=133).
[Fix] <Jojo> When using the pattern play controls (f.e. "Replay Pattern") on a pattern that isn't played in the normal play sequence, tempo and global volume commands on the first played row are not ignored anymore.
+ [Fix] <Jojo> Songs shouldn't stop anymore after playing them one time and if playback was initially started using a pattern play mode with loop enabled (http://bugs.openmpt.org/view.php?id=11)
+ [Fix] <Jojo> When overwriting PC notes with normal notes, the pattern cell is now cleared properly.
+ [Fix] <Jojo> Using the "Paste Pattern" menu entry in the order list didn't refresh the pattern display.
Sample tab
- [Imp] <Jojo> When selecting parts of the sample, the selection range is now also displayed in samples, not only seconds.
+ [Imp] <Jojo> When selecting parts of the sample, the selection range is now also displayed in samples, not only seconds (tx jmkz, http://bugs.openmpt.org/view.php?id=136).
+ [Imp] <Jojo> When changing the sample's global volume while removing DC offset, the change is now instantly applied to all channels that are currently playing the sample.
Instrument tab
[Imp] <Jojo> When in compatible mode, two envelope points cannot share the same tick anymore.
+ [Fix] <Jojo> Suggested filename when saving instrument was sometimes cut off.
VST
[Fix] <Jojo> When a plugin requests song position in nano secods, the correct value should now be returned.
[Fix] <Jojo> Loading a VST preset (fxp) didn't mark the document as modified (tx BooT-SectoR-ViruZ)
+IT
+ [Fix] <Jojo> Saving IT instruments (in both IT and ITI files) with an invalid sample map crashed the tracker (http://bugs.openmpt.org/view.php?id=142)
+ [Fix] <Jojo> (Also applies to MOD) When swapping samples on the fly and the current playback position is beyond the new sample's length, it's reset to 0.
+
+MPTM
+ [Fix] <Jojo> Saving long envelopes (> 25 envelope points) in the MPTM format was broken since... well, actually, it never worked in any officially released version.
+
Other formats
[Fix] <Jojo> ITP Saver: Fixed nasty bug when the internal order length was not 256.
[Fix] <Jojo> IMF Loader: Orpheus' 8-Bit cutoff range was not converted to MPT's 7-Bit range.
+Misc
+ [Imp] <Jojo> Tagging: ID3 tags also contain a TDRC tag now, since this should be used instead of TYER in ID3v2.4. Also added a TPBM (beats per minute) tag.
+ [Imp] <Jojo> Hack detection also notifies about stereo samples in XM files now.
+ [Imp] <Jojo> Fixed tab order in the pitch shift dialog.
+ [Mod] <Jojo> Song Properties: Legacy Mixmodes RC1 and RC2 are now only displayed if they are actually used by the module.
+ [Fix] <Jojo> MP3 export should no longer result in a heap corruption and thus crash the tracker (http://bugs.openmpt.org/view.php?id=97).
+ [Fix] <Jojo> Rendering sub songs to WAV resulted in an endless render loop.
+ [Fix] <Jojo> Setup Dialog: Fixed the checkbox list so that it doesn't look weird under Wine and doesn't crash when compiling OpenMPT with VS2010 (tx jmkz).
+
v1.19.02.00 (May 2011, revision 871)
------------------------------------
Pattern tab
Modified: trunk/OpenMPT/soundlib/Snd_fx.cpp
===================================================================
--- trunk/OpenMPT/soundlib/Snd_fx.cpp 2011-07-01 20:00:39 UTC (rev 911)
+++ trunk/OpenMPT/soundlib/Snd_fx.cpp 2011-07-01 20:15:53 UTC (rev 912)
@@ -730,6 +730,19 @@
if (pChn->dwFlags & CHN_PINGPONGSUSTAIN) pChn->dwFlags |= CHN_PINGPONGLOOP;
}
if ((pChn->dwFlags & CHN_LOOP) && (pChn->nLoopEnd < pChn->nLength)) pChn->nLength = pChn->nLoopEnd;
+
+ // Fix sample position on instrument change. This is needed for PT1x MOD and IT "on the fly" sample change.
+ if(pChn->nPos >= pChn->nLength)
+ {
+ if((m_nType & MOD_TYPE_IT))
+ {
+ pChn->nPos = pChn->nPosLo = 0;
+ } else if((m_nType & MOD_TYPE_MOD)) // TODO does not always seem to work, especially with short chip samples?
+ {
+ pChn->nPos = pChn->nLoopStart;
+ pChn->nPosLo = 0;
+ }
+ }
}
@@ -773,8 +786,7 @@
//IT compatibility tentative fix: Clear channel note memory.
if(IsCompatibleMode(TRK_IMPULSETRACKER))
{
- pChn->nNote = NOTE_NONE;
- pChn->nNewNote = NOTE_NONE;
+ pChn->nNote = pChn->nNewNote = NOTE_NONE;
}
return;
}
@@ -4218,4 +4230,4 @@
// invalid patterns consist of a "fake" row.
return 1;
}
-}
\ No newline at end of file
+}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <sag...@us...> - 2011-07-01 20:00:45
|
Revision: 911
http://modplug.svn.sourceforge.net/modplug/?rev=911&view=rev
Author: saga-games
Date: 2011-07-01 20:00:39 +0000 (Fri, 01 Jul 2011)
Log Message:
-----------
[Fix] Revision 901 broke entering numbers into the pan fields on the general tab.
Revision Links:
--------------
http://modplug.svn.sourceforge.net/modplug/?rev=901&view=rev
Modified Paths:
--------------
trunk/OpenMPT/mptrack/View_gen.cpp
Modified: trunk/OpenMPT/mptrack/View_gen.cpp
===================================================================
--- trunk/OpenMPT/mptrack/View_gen.cpp 2011-07-01 18:50:13 UTC (rev 910)
+++ trunk/OpenMPT/mptrack/View_gen.cpp 2011-07-01 20:00:39 UTC (rev 911)
@@ -636,7 +636,8 @@
{
m_sbPan[chnMod4].SetPos(pan/4);
pModDoc->UpdateAllViews(this, HINT_MODCHANNELS | (m_nActiveTab << HINT_SHIFT_CHNTAB));
- UpdateView(HINT_MODCHANNELS);
+ // Surround is forced off when changing pan, so uncheck the checkbox.
+ CheckDlgButton(IDC_CHECK2 + chnMod4 * 2, BST_UNCHECKED);
}
}
}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <sag...@us...> - 2011-07-01 18:50:19
|
Revision: 910
http://modplug.svn.sourceforge.net/modplug/?rev=910&view=rev
Author: saga-games
Date: 2011-07-01 18:50:13 +0000 (Fri, 01 Jul 2011)
Log Message:
-----------
[Fix] More fixes to MP3 export... Should be "about right" now.
Modified Paths:
--------------
trunk/OpenMPT/mptrack/Mod2wave.cpp
trunk/OpenMPT/mptrack/Mptrack.cpp
Modified: trunk/OpenMPT/mptrack/Mod2wave.cpp
===================================================================
--- trunk/OpenMPT/mptrack/Mod2wave.cpp 2011-07-01 18:04:04 UTC (rev 909)
+++ trunk/OpenMPT/mptrack/Mod2wave.cpp 2011-07-01 18:50:13 UTC (rev 910)
@@ -956,36 +956,30 @@
void CDoAcmConvert::OnButton1()
//-----------------------------
{
- BOOL bSaveWave;
+ bool bSaveWave = false;
CHAR s[80], fext[_MAX_EXT];
WAVEFILEHEADER wfh;
WAVEDATAHEADER wdh, chunk;
ACMSTREAMHEADER ash;
WAVEFORMATEX wfxSrc;
- HACMDRIVER had;
- HACMSTREAM has;
+ HACMDRIVER hADriver = nullptr;
+ HACMSTREAM hAStream = nullptr;
HWND progress;
MSG msg;
- LPBYTE pcmBuffer, dstBuffer;
+ LPBYTE pcmBuffer = nullptr, dstBuffer = nullptr; // Render and conversion buffers
UINT retval = IDCANCEL, pos, n;
DWORD dwDstBufSize, pcmBufSize, data_ofs;
uint64 ullMaxSamples, ullSamples;
int oldrepeat;
- BOOL bPrepared, bFinished;
+ bool bPrepared = false, bFinished = false;
FILE *f;
- had = NULL;
- has = NULL;
- dstBuffer = NULL;
- pcmBuffer = NULL;
- bPrepared = FALSE;
progress = ::GetDlgItem(m_hWnd, IDC_PROGRESS1);
if ((!m_pSndFile) || (!m_lpszFileName) || (!m_pwfx) || (!m_hadid)) goto OnError;
SetPriorityClass(GetCurrentProcess(), NORMAL_PRIORITY_CLASS);
- bSaveWave = FALSE;
_splitpath(m_lpszFileName, NULL, NULL, NULL, fext);
if (((m_bSaveInfoField) && (m_pwfx->wFormatTag != WAVE_FORMAT_MPEGLAYER3))
- || (!lstrcmpi(fext, ".wav"))) bSaveWave = TRUE;
+ || (!lstrcmpi(fext, ".wav"))) bSaveWave = true;
MemsetZero(wfxSrc);
wfxSrc.wFormatTag = WAVE_FORMAT_PCM;
wfxSrc.nSamplesPerSec = m_pwfx->nSamplesPerSec;
@@ -997,9 +991,12 @@
wfxSrc.cbSize = 0;
dwDstBufSize = WAVECONVERTBUFSIZE;
// Open the ACM Driver
- if (theApp.AcmDriverOpen(&had, m_hadid, 0L) != MMSYSERR_NOERROR) goto OnError;
- if (theApp.AcmStreamOpen(&has, had, &wfxSrc, m_pwfx, NULL, 0L, 0L, ACM_STREAMOPENF_NONREALTIME) != MMSYSERR_NOERROR) goto OnError;
- if (theApp.AcmStreamSize(has, WAVECONVERTBUFSIZE, &dwDstBufSize, ACM_STREAMSIZEF_SOURCE | ACM_STREAMSIZEF_DESTINATION) != MMSYSERR_NOERROR) goto OnError;
+ if (theApp.AcmDriverOpen(&hADriver, m_hadid, 0L) != MMSYSERR_NOERROR) goto OnError;
+ if (theApp.AcmStreamOpen(&hAStream, hADriver, &wfxSrc, m_pwfx, NULL, 0L, 0L, ACM_STREAMOPENF_NONREALTIME) != MMSYSERR_NOERROR) goto OnError;
+ // Next call is useless for BLADEenc/LAMEenc. Is it required for ACM codecs?
+ if (theApp.AcmStreamSize(hAStream, WAVECONVERTBUFSIZE, &dwDstBufSize, ACM_STREAMSIZEF_SOURCE) != MMSYSERR_NOERROR) goto OnError;
+ ASSERT(dwDstBufSize <= WAVECONVERTBUFSIZE);
+ if (theApp.AcmStreamSize(hAStream, WAVECONVERTBUFSIZE, &dwDstBufSize, ACM_STREAMSIZEF_DESTINATION) != MMSYSERR_NOERROR) goto OnError;
//if (dwDstBufSize > 0x10000) dwDstBufSize = 0x10000;
pcmBuffer = new BYTE[WAVECONVERTBUFSIZE];
dstBuffer = new BYTE[dwDstBufSize];
@@ -1012,8 +1009,8 @@
ash.cbSrcLength = WAVECONVERTBUFSIZE;
ash.pbDst = dstBuffer;
ash.cbDstLength = dwDstBufSize;
- if (theApp.AcmStreamPrepareHeader(has, &ash, 0L) != MMSYSERR_NOERROR) goto OnError;
- bPrepared = TRUE;
+ if (theApp.AcmStreamPrepareHeader(hAStream, &ash, 0L) != MMSYSERR_NOERROR) goto OnError;
+ bPrepared = true;
// Creating the output file
if ((f = fopen(m_lpszFileName, "wb")) == NULL)
{
@@ -1082,7 +1079,6 @@
ullSamples = 0;
pos = 0;
pcmBufSize = WAVECONVERTBUFSIZE;
- bFinished = FALSE;
// Writing File
CMainFrame::GetMainFrame()->InitRenderer(m_pSndFile); //rewbs.VSTTimeInfo
@@ -1092,12 +1088,12 @@
if (!bFinished)
{
lRead = m_pSndFile->Read(pcmBuffer + WAVECONVERTBUFSIZE - pcmBufSize, pcmBufSize);
- if (!lRead) bFinished = TRUE;
+ if (!lRead) bFinished = true;
}
ullSamples += lRead;
ash.cbSrcLength = lRead * wfxSrc.nBlockAlign + WAVECONVERTBUFSIZE - pcmBufSize;
ash.cbDstLengthUsed = 0;
- if (theApp.AcmStreamConvert(has, &ash, (lRead) ? ACM_STREAMCONVERTF_BLOCKALIGN : ACM_STREAMCONVERTF_END) != MMSYSERR_NOERROR) break;
+ if (theApp.AcmStreamConvert(hAStream, &ash, (lRead) ? ACM_STREAMCONVERTF_BLOCKALIGN : ACM_STREAMCONVERTF_END) != MMSYSERR_NOERROR) break;
do
{
if (::PeekMessage(&msg, m_hWnd, 0, 0, PM_REMOVE))
@@ -1169,9 +1165,9 @@
fclose(f);
if (!m_bAbort) retval = IDOK;
OnError:
- if (bPrepared) theApp.AcmStreamUnprepareHeader(has, &ash, 0L);
- if (has != NULL) theApp.AcmStreamClose(has, 0L);
- if (had != NULL) theApp.AcmDriverClose(had, 0L);
+ if (bPrepared) theApp.AcmStreamUnprepareHeader(hAStream, &ash, 0L);
+ if (hAStream != NULL) theApp.AcmStreamClose(hAStream, 0L);
+ if (hADriver != NULL) theApp.AcmDriverClose(hADriver, 0L);
if (pcmBuffer) delete[] pcmBuffer;
if (dstBuffer) delete[] dstBuffer;
//rewbs: reduce to normal priority during debug for easier hang debugging
Modified: trunk/OpenMPT/mptrack/Mptrack.cpp
===================================================================
--- trunk/OpenMPT/mptrack/Mptrack.cpp 2011-07-01 18:04:04 UTC (rev 909)
+++ trunk/OpenMPT/mptrack/Mptrack.cpp 2011-07-01 18:50:13 UTC (rev 910)
@@ -2322,7 +2322,7 @@
/////////////////////////////////////////////////////////////////////////////////////////
-// MPEG Layer-3 Functions (through ACM)
+// MPEG Layer-3 Functions (through ACM - access to LAMEenc and BLADEenc is emulated through the ACM interface)
typedef struct BLADEENCSTREAMINFO
{
@@ -2424,8 +2424,8 @@
BYTE wfx[256];
WAVEFORMATEX *pwfx = (WAVEFORMATEX *)&wfx;
- memset(&afd, 0, sizeof(afd));
- memset(pwfx, 0, sizeof(wfx));
+ MemsetZero(afd);
+ MemsetZero(*pwfx);
afd.cbStruct = sizeof(ACMFORMATDETAILS);
afd.dwFormatTag = WAVE_FORMAT_PCM;
afd.pwfx = pwfx;
@@ -2731,11 +2731,11 @@
{
if (fdwSize & ACM_STREAMSIZEF_DESTINATION)
{
- *pdwOutputBytes = pbeCfg->dwInputSamples * sizeof(SHORT);
+ *pdwOutputBytes = pbeCfg->dwOutputSamples * sizeof(short);
} else
if (fdwSize & ACM_STREAMSIZEF_SOURCE)
{
- *pdwOutputBytes = pbeCfg->dwOutputSamples;
+ *pdwOutputBytes = pbeCfg->dwInputSamples * sizeof(short);
}
return MMSYSERR_NOERROR;
}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <sag...@us...> - 2011-07-01 18:04:11
|
Revision: 909
http://modplug.svn.sourceforge.net/modplug/?rev=909&view=rev
Author: saga-games
Date: 2011-07-01 18:04:04 +0000 (Fri, 01 Jul 2011)
Log Message:
-----------
[Mod] Song Properties: Legacy Mixmodes RC1 and RC2 are now only displayed if they are currently being used.
[Imp] Sample Editor: When changing the sample's global volume while removing DC offset, the change is now instantly applied to all channels that are currently playing the sample.
[Fix] Minor fixes to Macro configuration GUI.
[Mod] MPTM Load/Save test is now only executed if mptrack.exe is residing in the project directory structure
Modified Paths:
--------------
trunk/OpenMPT/mptrack/dlg_misc.cpp
trunk/OpenMPT/mptrack/test/test.cpp
trunk/OpenMPT/soundlib/modsmp_ctrl.cpp
Modified: trunk/OpenMPT/mptrack/dlg_misc.cpp
===================================================================
--- trunk/OpenMPT/mptrack/dlg_misc.cpp 2011-06-29 23:28:00 UTC (rev 908)
+++ trunk/OpenMPT/mptrack/dlg_misc.cpp 2011-07-01 18:04:04 UTC (rev 909)
@@ -66,8 +66,8 @@
//------------------------------
{
CDialog::OnInitDialog();
- m_nType = m_pSndFile->m_nType;
- m_nChannels = m_pSndFile->m_nChannels;
+ m_nType = m_pSndFile->GetType();
+ m_nChannels = m_pSndFile->GetNumChannels();
m_dwSongFlags = m_pSndFile->m_dwSongFlags;
SetDlgItemInt(IDC_ROWSPERBEAT, m_pSndFile->m_nDefaultRowsPerBeat);
SetDlgItemInt(IDC_ROWSPERMEASURE, m_pSndFile->m_nDefaultRowsPerMeasure);
@@ -98,28 +98,32 @@
m_TempoModeBox.SetItemData(m_TempoModeBox.AddString("Classic"), tempo_mode_classic);
m_TempoModeBox.SetItemData(m_TempoModeBox.AddString("Alternative"), tempo_mode_alternative);
m_TempoModeBox.SetItemData(m_TempoModeBox.AddString("Modern (accurate)"), tempo_mode_modern);
- switch(m_pSndFile->m_nTempoMode)
+ m_TempoModeBox.SetCurSel(0);
+ for(int i = m_TempoModeBox.GetCount(); i > 0; i--)
{
- case tempo_mode_alternative: m_TempoModeBox.SetCurSel(1); break;
- case tempo_mode_modern: m_TempoModeBox.SetCurSel(2); break;
- case tempo_mode_classic:
- default: m_TempoModeBox.SetCurSel(0); break;
+ if(m_TempoModeBox.GetItemData(i) == m_pSndFile->m_nTempoMode)
+ {
+ m_TempoModeBox.SetCurSel(i);
+ break;
+ }
}
m_PlugMixBox.SetItemData(m_PlugMixBox.AddString("OpenMPT 1.17RC3"), mixLevels_117RC3);
- m_PlugMixBox.SetItemData(m_PlugMixBox.AddString("OpenMPT 1.17RC2"), mixLevels_117RC2);
- m_PlugMixBox.SetItemData(m_PlugMixBox.AddString("OpenMPT 1.17RC1"), mixLevels_117RC1);
+ if(m_pSndFile->m_nMixLevels == mixLevels_117RC2) // Only shown for backwards compatibility with existing tunes
+ m_PlugMixBox.SetItemData(m_PlugMixBox.AddString("OpenMPT 1.17RC2"), mixLevels_117RC2);
+ if(m_pSndFile->m_nMixLevels == mixLevels_117RC1) // Dito
+ m_PlugMixBox.SetItemData(m_PlugMixBox.AddString("OpenMPT 1.17RC1"), mixLevels_117RC1);
m_PlugMixBox.SetItemData(m_PlugMixBox.AddString("Original (MPT 1.16)"), mixLevels_original);
m_PlugMixBox.SetItemData(m_PlugMixBox.AddString("Compatible"), mixLevels_compatible);
//m_PlugMixBox.SetItemData(m_PlugMixBox.AddString("Test"), mixLevels_Test);
- switch(m_pSndFile->m_nMixLevels)
+ m_PlugMixBox.SetCurSel(0);
+ for(int i = m_PlugMixBox.GetCount(); i > 0; i--)
{
- //case mixLevels_Test: m_PlugMixBox.SetCurSel(5); break;
- case mixLevels_compatible: m_PlugMixBox.SetCurSel(4); break; case mixLevels_original: m_PlugMixBox.SetCurSel(3); break;
- case mixLevels_117RC1: m_PlugMixBox.SetCurSel(2); break;
- case mixLevels_117RC2: m_PlugMixBox.SetCurSel(1); break;
- case mixLevels_117RC3:
- default: m_PlugMixBox.SetCurSel(0); break;
+ if(m_PlugMixBox.GetItemData(i) == m_pSndFile->m_nMixLevels)
+ {
+ m_PlugMixBox.SetCurSel(i);
+ break;
+ }
}
SetDlgItemText(IDC_TEXT_CREATEDWITH, "Created with:");
@@ -720,8 +724,8 @@
CHAR s[128];
CDialog::OnInitDialog();
CheckDlgButton(IDC_CHECK1, m_bEmbed);
- m_EditSFx.SetLimitText(31);
- m_EditZxx.SetLimitText(31);
+ m_EditSFx.SetLimitText(MACRO_LENGTH - 1);
+ m_EditZxx.SetLimitText(MACRO_LENGTH - 1);
for (UINT isfx=0; isfx<16; isfx++)
{
@@ -739,12 +743,14 @@
m_CbnSFxPreset.AddString("Custom");
OnSFxChanged();
- for (UINT cc=MIDICC_start; cc<=MIDICC_end; cc++) {
+ for (UINT cc=MIDICC_start; cc<=MIDICC_end; cc++)
+ {
wsprintf(s, "CC %02d %s", cc, MidiCCNames[cc]);
m_CbnMacroCC.SetItemData(m_CbnMacroCC.AddString(s), cc);
}
- for (UINT zxx=0; zxx<128; zxx++) {
+ for (UINT zxx=0; zxx<128; zxx++)
+ {
wsprintf(s, "Z%02X", zxx|0x80);
m_CbnZxx.AddString(s);
}
@@ -759,7 +765,7 @@
UpdateDialog();
int offsetx=108, offsety=30, separatorx=4, separatory=2,
- height=18, widthMacro=30, widthVal=55, widthType=135, widthBtn=60;
+ height=18, widthMacro=30, widthVal=90, widthType=135, widthBtn=60;
for (UINT m=0; m<NUM_MACROS; m++)
{
@@ -784,7 +790,7 @@
for (UINT plug=0; plug<MAX_MIXPLUGINS; plug++)
{
PSNDMIXPLUGIN p = &(m_pSndFile->m_MixPlugins[plug]);
- p->Info.szLibraryName[63] = 0;
+ SetNullTerminator(p->Info.szLibraryName);
if (p->Info.szLibraryName[0])
{
wsprintf(s, "FX%d: %s", plug+1, p->Info.szName);
@@ -801,7 +807,7 @@
//----------------------------------------------
{
if (!m_EditMacro[0])
- return; //GUI not yet initiali
+ return; //GUI not yet initialized
CString s, macroText;
UINT start, end, macroType;
@@ -861,15 +867,16 @@
void CMidiMacroSetup::UpdateDialog()
//----------------------------------
{
- CHAR s[32];
+ CHAR s[MACRO_LENGTH];
UINT sfx, sfx_preset, zxx;
sfx = m_CbnSFx.GetCurSel();
sfx_preset = m_CbnSFxPreset.GetCurSel();
- if (sfx < 16) {
+ if (sfx < 16)
+ {
ToggleBoxes(sfx_preset, sfx);
memcpy(s, m_MidiCfg.szMidiSFXExt[sfx], MACRO_LENGTH);
- s[MACRO_LENGTH - 1] = 0;
+ SetNullTerminator(s);
m_EditSFx.SetWindowText(s);
}
@@ -877,7 +884,7 @@
if (zxx < 0x80)
{
memcpy(s, m_MidiCfg.szMidiZXXExt[zxx], MACRO_LENGTH);
- s[MACRO_LENGTH - 1] = 0;
+ SetNullTerminator(s);
m_EditZxx.SetWindowText(s);
}
UpdateMacroList();
@@ -914,7 +921,7 @@
if (sfx < 16)
{
CString macroText;
- memcpy(macroText.GetBuffer(32), m_MidiCfg.szMidiSFXExt[sfx], MACRO_LENGTH);
+ memcpy(macroText.GetBuffer(MACRO_LENGTH), m_MidiCfg.szMidiSFXExt[sfx], MACRO_LENGTH);
int preset = m_pModDoc->GetMacroType(macroText);
m_CbnSFxPreset.SetCurSel(preset);
}
@@ -933,7 +940,7 @@
CHAR *pmacro = m_MidiCfg.szMidiSFXExt[sfx];
switch(sfx_preset)
{
- case sfx_unused: pmacro[0] = 0; break; // unused
+ case sfx_unused: strcpy(pmacro, ""); break; // unused
case sfx_cutoff: strcpy(pmacro, "F0F000z"); break; // cutoff
case sfx_reso: strcpy(pmacro, "F0F001z"); break; // reso
case sfx_mode: strcpy(pmacro, "F0F002z"); break; // mode
@@ -996,7 +1003,7 @@
void CMidiMacroSetup::OnZxxEditChanged()
//--------------------------------------
{
- CHAR s[32];
+ CHAR s[MACRO_LENGTH];
UINT zxx = m_CbnZxx.GetCurSel();
if (zxx < 128)
{
@@ -1008,12 +1015,14 @@
}
void CMidiMacroSetup::OnSetSFx(UINT id)
+//-------------------------------------
{
m_CbnSFx.SetCurSel(id-(ID_PLUGSELECT + NUM_MACROS));
OnSFxChanged();
}
void CMidiMacroSetup::OnViewAllParams(UINT id)
+//--------------------------------------------
{
if (!m_pSndFile)
return;
@@ -1045,7 +1054,7 @@
}
void CMidiMacroSetup::OnPlugChanged()
-//------------------------------------
+//-----------------------------------
{
if (!m_pSndFile)
return;
@@ -1073,63 +1082,72 @@
}
void CMidiMacroSetup::OnPlugParamChanged()
+//----------------------------------------
{
CString macroText;
UINT param = m_CbnMacroParam.GetItemData(m_CbnMacroParam.GetCurSel());
- if (param<128) {
- macroText.Format("F0F0%02Xz",param+128);
+ if (param < 128)
+ {
+ macroText.Format("F0F0%02Xz",param + 128);
m_EditSFx.SetWindowText(macroText);
- } else if (param<384) {
- macroText.Format("F0F1%02Xz",param-128);
+ } else if (param < 384)
+ {
+ macroText.Format("F0F1%02Xz",param - 128);
m_EditSFx.SetWindowText(macroText);
- } else {
+ } else
+ {
::AfxMessageBox("Warning: Currently MPT can only assign macros to parameters 0 to 383");
param = 383;
}
}
-void CMidiMacroSetup::OnCCChanged() {
+void CMidiMacroSetup::OnCCChanged()
+//---------------------------------
+{
CString macroText;
UINT cc = m_CbnMacroCC.GetItemData(m_CbnMacroCC.GetCurSel());
macroText.Format("BK%02Xz", cc&0xFF);
m_EditSFx.SetWindowText(macroText);
}
-void CMidiMacroSetup::ToggleBoxes(UINT sfx_preset, UINT sfx) {
+void CMidiMacroSetup::ToggleBoxes(UINT sfx_preset, UINT sfx)
+//----------------------------------------------------------
+{
- if (sfx_preset == sfx_plug) {
+ if (sfx_preset == sfx_plug)
+ {
m_CbnMacroCC.ShowWindow(FALSE);
m_CbnMacroPlug.ShowWindow(TRUE);
- m_CbnMacroPlug.ShowWindow(TRUE);
+ m_CbnMacroParam.ShowWindow(TRUE);
m_CbnMacroPlug.EnableWindow(TRUE);
m_CbnMacroParam.EnableWindow(TRUE);
SetDlgItemText(IDC_GENMACROLABEL, "Plug/Param");
m_CbnMacroParam.SetCurSel(m_pModDoc->MacroToPlugParam(m_MidiCfg.szMidiSFXExt[sfx]));
- } else {
+ } else
+ {
m_CbnMacroPlug.EnableWindow(FALSE);
m_CbnMacroParam.EnableWindow(FALSE);
}
- if (sfx_preset == sfx_cc) {
+ if (sfx_preset == sfx_cc)
+ {
m_CbnMacroCC.EnableWindow(TRUE);
m_CbnMacroCC.ShowWindow(TRUE);
m_CbnMacroPlug.ShowWindow(FALSE);
- m_CbnMacroPlug.ShowWindow(FALSE);
+ m_CbnMacroParam.ShowWindow(FALSE);
SetDlgItemText(IDC_GENMACROLABEL, "MIDI CC");
m_CbnMacroCC.SetCurSel(m_pModDoc->MacroToMidiCC(m_MidiCfg.szMidiSFXExt[sfx]));
- } else {
+ } else
+ {
m_CbnMacroCC.EnableWindow(FALSE);
}
- if (sfx_preset == sfx_unused) {
- m_EditSFx.EnableWindow(FALSE);
- } else {
- m_EditSFx.EnableWindow(TRUE);
- }
+ //m_EditSFx.EnableWindow((sfx_preset == sfx_unused) ? FALSE : TRUE);
}
+
////////////////////////////////////////////////////////////////////////////////////////////
// Keyboard Control
@@ -1557,7 +1575,7 @@
for(size_t n = 0; n < num; n++)
{
- FileHistory *hist = &(m_pModDoc->GetFileHistory()->at(n));
+ const FileHistory *hist = &(m_pModDoc->GetFileHistory()->at(n));
totalTime += hist->openTime;
// Date
Modified: trunk/OpenMPT/mptrack/test/test.cpp
===================================================================
--- trunk/OpenMPT/mptrack/test/test.cpp 2011-06-29 23:28:00 UTC (rev 908)
+++ trunk/OpenMPT/mptrack/test/test.cpp 2011-07-01 18:04:04 UTC (rev 909)
@@ -414,19 +414,23 @@
void TestLoadSaveFile()
//---------------------
{
- CString theFile = __FILE__;
- theFile.Replace(".cpp", ".mptm");
+ CString theFile = theApp.GetAppDirPath();
+ // Only run the tests when we're in the project directory structure.
+ if(theFile.Mid(theFile.GetLength() - 6, 5) != "Debug")
+ return;
+ theFile.Delete(theFile.GetLength() - 6, 6);
+ theFile.Append("test/test.");
+
// Test file loading
- CModDoc *pModDoc = (CModDoc *)theApp.OpenDocumentFile(theFile);
+ CModDoc *pModDoc = (CModDoc *)theApp.OpenDocumentFile(theFile + "mptm");
TestLoadFile(pModDoc);
// Test file saving
- theFile.Replace(".mptm", ".saved.mptm");
- pModDoc->DoSave(theFile);
+ pModDoc->DoSave(theFile + "saved.mptm");
pModDoc->OnCloseDocument();
// Reload the saved file and test if everything is still working correctly.
- pModDoc = (CModDoc *)theApp.OpenDocumentFile(theFile);
+ pModDoc = (CModDoc *)theApp.OpenDocumentFile(theFile + "saved.mptm");
TestLoadFile(pModDoc);
pModDoc->OnCloseDocument();
}
Modified: trunk/OpenMPT/soundlib/modsmp_ctrl.cpp
===================================================================
--- trunk/OpenMPT/soundlib/modsmp_ctrl.cpp 2011-06-29 23:28:00 UTC (rev 908)
+++ trunk/OpenMPT/soundlib/modsmp_ctrl.cpp 2011-07-01 18:04:04 UTC (rev 909)
@@ -367,7 +367,18 @@
// step 3: adjust global vol (if available)
if((modtype & (MOD_TYPE_IT | MOD_TYPE_MPT)) && (iStart == 0) && (iEnd == pSmp->nLength * pSmp->GetNumChannels()))
+ {
+ BEGIN_CRITICAL();
pSmp->nGlobalVol = min((WORD)(pSmp->nGlobalVol / dAmplify), 64);
+ for (CHANNELINDEX i = 0; i < MAX_CHANNELS; i++)
+ {
+ if(pSndFile->Chn[i].pSample == pSmp->pSample)
+ {
+ pSndFile->Chn[i].nGlobalVol = pSmp->nGlobalVol;
+ }
+ }
+ END_CRITICAL();
+ }
AdjustEndOfSample(smp, pSndFile);
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <sag...@us...> - 2011-06-29 23:28:06
|
Revision: 908
http://modplug.svn.sourceforge.net/modplug/?rev=908&view=rev
Author: saga-games
Date: 2011-06-29 23:28:00 +0000 (Wed, 29 Jun 2011)
Log Message:
-----------
[Fix] MP3 export should no more result in a heap corruption and thus crash the tracker
[Mod] OpenMPT: Version is now 1.19.02.08
Modified Paths:
--------------
trunk/OpenMPT/mptrack/Mod2wave.cpp
trunk/OpenMPT/mptrack/version.h
Modified: trunk/OpenMPT/mptrack/Mod2wave.cpp
===================================================================
--- trunk/OpenMPT/mptrack/Mod2wave.cpp 2011-06-26 12:09:38 UTC (rev 907)
+++ trunk/OpenMPT/mptrack/Mod2wave.cpp 2011-06-29 23:28:00 UTC (rev 908)
@@ -999,11 +999,13 @@
// Open the ACM Driver
if (theApp.AcmDriverOpen(&had, m_hadid, 0L) != MMSYSERR_NOERROR) goto OnError;
if (theApp.AcmStreamOpen(&has, had, &wfxSrc, m_pwfx, NULL, 0L, 0L, ACM_STREAMOPENF_NONREALTIME) != MMSYSERR_NOERROR) goto OnError;
- if (theApp.AcmStreamSize(has, WAVECONVERTBUFSIZE, &dwDstBufSize, ACM_STREAMSIZEF_SOURCE) != MMSYSERR_NOERROR) goto OnError;
- if (dwDstBufSize > 0x10000) dwDstBufSize = 0x10000;
- pcmBuffer = (LPBYTE)GlobalAllocPtr(GHND, WAVECONVERTBUFSIZE);
- dstBuffer = (LPBYTE)GlobalAllocPtr(GHND, dwDstBufSize);
+ if (theApp.AcmStreamSize(has, WAVECONVERTBUFSIZE, &dwDstBufSize, ACM_STREAMSIZEF_SOURCE | ACM_STREAMSIZEF_DESTINATION) != MMSYSERR_NOERROR) goto OnError;
+ //if (dwDstBufSize > 0x10000) dwDstBufSize = 0x10000;
+ pcmBuffer = new BYTE[WAVECONVERTBUFSIZE];
+ dstBuffer = new BYTE[dwDstBufSize];
if ((!dstBuffer) || (!pcmBuffer)) goto OnError;
+ memset(pcmBuffer, 0, WAVECONVERTBUFSIZE);
+ memset(dstBuffer, 0, dwDstBufSize);
MemsetZero(ash);
ash.cbStruct = sizeof(ash);
ash.pbSrc = pcmBuffer;
@@ -1114,6 +1116,7 @@
}
if (ash.cbDstLengthUsed > 0)
{
+ ASSERT(ash.cbDstLengthUsed <= dwDstBufSize);
UINT lWrite = fwrite(dstBuffer, 1, ash.cbDstLengthUsed, f);
if (!lWrite) break;
wdh.length += lWrite;
@@ -1169,8 +1172,8 @@
if (bPrepared) theApp.AcmStreamUnprepareHeader(has, &ash, 0L);
if (has != NULL) theApp.AcmStreamClose(has, 0L);
if (had != NULL) theApp.AcmDriverClose(had, 0L);
- if (pcmBuffer) GlobalFreePtr(pcmBuffer);
- if (dstBuffer) GlobalFreePtr(dstBuffer);
+ if (pcmBuffer) delete[] pcmBuffer;
+ if (dstBuffer) delete[] dstBuffer;
//rewbs: reduce to normal priority during debug for easier hang debugging
//SetPriorityClass(GetCurrentProcess(), HIGH_PRIORITY_CLASS);
SetPriorityClass(GetCurrentProcess(), NORMAL_PRIORITY_CLASS);
Modified: trunk/OpenMPT/mptrack/version.h
===================================================================
--- trunk/OpenMPT/mptrack/version.h 2011-06-26 12:09:38 UTC (rev 907)
+++ trunk/OpenMPT/mptrack/version.h 2011-06-29 23:28:00 UTC (rev 908)
@@ -15,7 +15,7 @@
#define VER_MAJORMAJOR 1
#define VER_MAJOR 19
#define VER_MINOR 02
-#define VER_MINORMINOR 07
+#define VER_MINORMINOR 08
//Creates version number from version parts that appears in version string.
//For example MAKE_VERSION_NUMERIC(1,17,02,28) gives version number of
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <sag...@us...> - 2011-06-26 12:09:45
|
Revision: 907
http://modplug.svn.sourceforge.net/modplug/?rev=907&view=rev
Author: saga-games
Date: 2011-06-26 12:09:38 +0000 (Sun, 26 Jun 2011)
Log Message:
-----------
[Ref] Renamed sfx_fixed_* to zxx_*, macro test should now work again
Modified Paths:
--------------
trunk/OpenMPT/mptrack/Moddoc.cpp
trunk/OpenMPT/mptrack/Moddoc.h
trunk/OpenMPT/mptrack/Mptrack.cpp
trunk/OpenMPT/mptrack/dlg_misc.cpp
trunk/OpenMPT/mptrack/test/test.cpp
Modified: trunk/OpenMPT/mptrack/Moddoc.cpp
===================================================================
--- trunk/OpenMPT/mptrack/Moddoc.cpp 2011-06-26 09:24:12 UTC (rev 906)
+++ trunk/OpenMPT/mptrack/Moddoc.cpp 2011-06-26 12:09:38 UTC (rev 907)
@@ -3254,7 +3254,7 @@
{
return -1;
}
- for (int macro = 0; macro < NUM_MACROS; macro++)
+ for (size_t macro = 0; macro < NUM_MACROS; macro++)
{
CString macroString = pSndFile->m_MidiCfg.szMidiSFXExt[macro];
if (GetMacroType(macroString) == sfx_plug && MacroToPlugParam(macroString) == param)
@@ -3272,14 +3272,14 @@
//----------------------------------------------------------------------------------
{
// Compare with all possible preset patterns
- for(int i = 1; i < sfx_fixed_max; i++)
+ for(size_t i = 1; i < zxx_max; i++)
{
// Prepare pattern to compare
CHAR szPatterns[128][MACRO_LENGTH];
CreateZxxFromType(szPatterns, static_cast<enmFixedMacroType>(i));
bool bFound = true;
- for(int j = 0; j < 128; j++)
+ for(size_t j = 0; j < 128; j++)
{
if(strncmp(szPatterns[j], szMidiZXXExt[j], MACRO_LENGTH))
{
@@ -3289,7 +3289,7 @@
}
if(bFound) return static_cast<enmFixedMacroType>(i);
}
- return sfx_fixed_custom; // Custom setup
+ return zxx_custom; // Custom setup
}
@@ -3297,32 +3297,32 @@
void CModDoc::CreateZxxFromType(CHAR (&szMidiZXXExt)[128][MACRO_LENGTH], enmFixedMacroType iZxxType)
//--------------------------------------------------------------------------------------------------
{
- for(int i = 0; i < 128; i++)
+ for(size_t i = 0; i < 128; i++)
{
switch(iZxxType)
{
- case sfx_fixed_reso4Bit:
+ case zxx_reso4Bit:
// Type 1 - Z80 - Z8F controls resonance
if (i < 16) wsprintf(szMidiZXXExt[i], "F0F001%02X", i * 8);
else strcpy(szMidiZXXExt[i], "");
break;
- case sfx_fixed_reso7Bit:
+ case zxx_reso7Bit:
// Type 2 - Z80 - ZFF controls resonance
wsprintf(szMidiZXXExt[i], "F0F001%02X", i);
break;
- case sfx_fixed_cutoff:
+ case zxx_cutoff:
// Type 3 - Z80 - ZFF controls cutoff
wsprintf(szMidiZXXExt[i], "F0F000%02X", i);
break;
- case sfx_fixed_mode:
+ case zxx_mode:
// Type 4 - Z80 - ZFF controls filter mode
wsprintf(szMidiZXXExt[i], "F0F002%02X", i);
break;
- case sfx_fixed_resomode:
+ case zxx_resomode:
// Type 5 - Z80 - Z9F controls resonance + filter mode
if (i < 16) wsprintf(szMidiZXXExt[i], "F0F001%02X", i * 8);
else if (i < 32) wsprintf(szMidiZXXExt[i], "F0F002%02X", (i - 16) * 8);
@@ -3352,7 +3352,7 @@
return false;
}
// Z80-Z8F controls resonance
- if(GetZxxType(pSndFile->m_MidiCfg.szMidiZXXExt) != sfx_fixed_reso4Bit)
+ if(GetZxxType(pSndFile->m_MidiCfg.szMidiZXXExt) != zxx_reso4Bit)
{
return false;
}
@@ -3719,7 +3719,8 @@
CString macroText = GetSoundFile()->m_MidiCfg.szMidiSFXExt[checkMacro];
int macroType = GetMacroType(macroText);
- if (macroType==sfx_plug && MacroToPlugParam(macroText)==paramToUse) {
+ if (macroType==sfx_plug && MacroToPlugParam(macroText)==paramToUse)
+ {
CString message;
message.Format("Param %d can already be controlled with macro %X", paramToUse, checkMacro);
CMainFrame::GetMainFrame()->MessageBox(message, "Macro exists for this param",MB_ICONINFORMATION | MB_OK);
@@ -3729,11 +3730,14 @@
//set new macro
CHAR *pMacroToSet = GetSoundFile()->m_MidiCfg.szMidiSFXExt[macroToSet];
- if (paramToUse<128) {
+ if (paramToUse < 128)
+ {
wsprintf(pMacroToSet, "F0F0%Xz",paramToUse+128);
- } else if (paramToUse<384) {
+ } else if (paramToUse < 384)
+ {
wsprintf(pMacroToSet, "F0F1%Xz",paramToUse-128);
- } else {
+ } else
+ {
CString message;
message.Format("Param %d beyond controllable range.", paramToUse);
::MessageBox(NULL,message, "Macro not assigned for this param",MB_ICONINFORMATION | MB_OK);
Modified: trunk/OpenMPT/mptrack/Moddoc.h
===================================================================
--- trunk/OpenMPT/mptrack/Moddoc.h 2011-06-26 09:24:12 UTC (rev 906)
+++ trunk/OpenMPT/mptrack/Moddoc.h 2011-06-26 12:09:38 UTC (rev 907)
@@ -108,14 +108,14 @@
// fixed macro presets:
enum enmFixedMacroType
{
- sfx_fixed_custom = 0,
- sfx_fixed_reso4Bit, // Type 1 - Z80 - Z8F controls resonance
- sfx_fixed_reso7Bit, // Type 2 - Z80 - ZFF controls resonance
- sfx_fixed_cutoff, // Type 3 - Z80 - ZFF controls cutoff
- sfx_fixed_mode, // Type 4 - Z80 - ZFF controls filter mode
- sfx_fixed_resomode, // Type 5 - Z80 - Z9F controls resonance + filter mode
+ zxx_custom = 0,
+ zxx_reso4Bit, // Type 1 - Z80 - Z8F controls resonance
+ zxx_reso7Bit, // Type 2 - Z80 - ZFF controls resonance
+ zxx_cutoff, // Type 3 - Z80 - ZFF controls cutoff
+ zxx_mode, // Type 4 - Z80 - ZFF controls filter mode
+ zxx_resomode, // Type 5 - Z80 - Z9F controls resonance + filter mode
- sfx_fixed_max
+ zxx_max
};
Modified: trunk/OpenMPT/mptrack/Mptrack.cpp
===================================================================
--- trunk/OpenMPT/mptrack/Mptrack.cpp 2011-06-26 09:24:12 UTC (rev 906)
+++ trunk/OpenMPT/mptrack/Mptrack.cpp 2011-06-26 12:09:38 UTC (rev 907)
@@ -615,7 +615,7 @@
strcpy(m_MidiCfg.szMidiGlb[MIDIOUT_NOTEOFF], "9c n 0");
strcpy(m_MidiCfg.szMidiGlb[MIDIOUT_PROGRAM], "Cc p");
strcpy(m_MidiCfg.szMidiSFXExt[0], "F0F000z");
- CModDoc::CreateZxxFromType(m_MidiCfg.szMidiZXXExt, sfx_fixed_reso4Bit);
+ CModDoc::CreateZxxFromType(m_MidiCfg.szMidiZXXExt, zxx_reso4Bit);
}
/////////////////////////////////////////////////////////////////////////////
Modified: trunk/OpenMPT/mptrack/dlg_misc.cpp
===================================================================
--- trunk/OpenMPT/mptrack/dlg_misc.cpp 2011-06-26 09:24:12 UTC (rev 906)
+++ trunk/OpenMPT/mptrack/dlg_misc.cpp 2011-06-26 12:09:38 UTC (rev 907)
@@ -952,7 +952,7 @@
{
enmFixedMacroType zxx_preset = static_cast<enmFixedMacroType>(m_CbnZxxPreset.GetCurSel());
- if (zxx_preset != sfx_fixed_custom && m_pModDoc != nullptr)
+ if (zxx_preset != zxx_custom && m_pModDoc != nullptr)
{
m_pModDoc->CreateZxxFromType(m_MidiCfg.szMidiZXXExt, zxx_preset);
UpdateDialog();
Modified: trunk/OpenMPT/mptrack/test/test.cpp
===================================================================
--- trunk/OpenMPT/mptrack/test/test.cpp 2011-06-26 09:24:12 UTC (rev 906)
+++ trunk/OpenMPT/mptrack/test/test.cpp 2011-06-26 12:09:38 UTC (rev 907)
@@ -240,7 +240,7 @@
// Macros
VERIFY_EQUAL_NONCONT(pModDoc->GetMacroType(pSndFile->m_MidiCfg.szMidiSFXExt[0]), sfx_reso);
VERIFY_EQUAL_NONCONT(pModDoc->GetMacroType(pSndFile->m_MidiCfg.szMidiSFXExt[1]), sfx_drywet);
- //VERIFY_EQUAL_NONCONT(pModDoc->GetZxxType(pSndFile->m_MidiCfg.szMidiZXXExt), zxx_resomode);
+ VERIFY_EQUAL_NONCONT(pModDoc->GetZxxType(pSndFile->m_MidiCfg.szMidiZXXExt), zxx_resomode);
// Channels
VERIFY_EQUAL_NONCONT(pSndFile->GetNumChannels(), 2);
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <rel...@us...> - 2011-06-26 09:24:18
|
Revision: 906
http://modplug.svn.sourceforge.net/modplug/?rev=906&view=rev
Author: relabsoluness
Date: 2011-06-26 09:24:12 +0000 (Sun, 26 Jun 2011)
Log Message:
-----------
[Fix] Sample editor: Fix to UnsignSample (broken in r904).
[Fix] Internal: Build fix, #if-condition in MakeGmTime didn't work as intended.
Modified Paths:
--------------
trunk/OpenMPT/mptrack/misc_util.cpp
trunk/OpenMPT/mptrack/test/test.cpp
trunk/OpenMPT/soundlib/modsmp_ctrl.cpp
Modified: trunk/OpenMPT/mptrack/misc_util.cpp
===================================================================
--- trunk/OpenMPT/mptrack/misc_util.cpp 2011-06-24 13:00:31 UTC (rev 905)
+++ trunk/OpenMPT/mptrack/misc_util.cpp 2011-06-26 09:24:12 UTC (rev 906)
@@ -62,7 +62,7 @@
time_t Util::sdTime::MakeGmTime(tm& timeUtc)
{
-#if MSVC_VER_2003
+#if (_MSC_VER < MSVC_VER_2005)
// VC++ 2003 doesn't have _mkgmtime
// This does not seem to work properly with DST time zones sometimes - if that's of any concern for you, please upgrade your compiler :)
TIME_ZONE_INFORMATION tzi;
Modified: trunk/OpenMPT/mptrack/test/test.cpp
===================================================================
--- trunk/OpenMPT/mptrack/test/test.cpp 2011-06-24 13:00:31 UTC (rev 905)
+++ trunk/OpenMPT/mptrack/test/test.cpp 2011-06-26 09:24:12 UTC (rev 906)
@@ -240,7 +240,7 @@
// Macros
VERIFY_EQUAL_NONCONT(pModDoc->GetMacroType(pSndFile->m_MidiCfg.szMidiSFXExt[0]), sfx_reso);
VERIFY_EQUAL_NONCONT(pModDoc->GetMacroType(pSndFile->m_MidiCfg.szMidiSFXExt[1]), sfx_drywet);
- VERIFY_EQUAL_NONCONT(pModDoc->GetZxxType(pSndFile->m_MidiCfg.szMidiZXXExt), zxx_resomode);
+ //VERIFY_EQUAL_NONCONT(pModDoc->GetZxxType(pSndFile->m_MidiCfg.szMidiZXXExt), zxx_resomode);
// Channels
VERIFY_EQUAL_NONCONT(pSndFile->GetNumChannels(), 2);
Modified: trunk/OpenMPT/soundlib/modsmp_ctrl.cpp
===================================================================
--- trunk/OpenMPT/soundlib/modsmp_ctrl.cpp 2011-06-24 13:00:31 UTC (rev 905)
+++ trunk/OpenMPT/soundlib/modsmp_ctrl.cpp 2011-06-26 09:24:12 UTC (rev 906)
@@ -418,7 +418,7 @@
void UnsignSampleImpl(T* pStart, const SmpLength nLength)
//-------------------------------------------------------
{
- const T offset = (T)std::numeric_limits<T>::min;
+ const T offset = (std::numeric_limits<T>::min)();
for(SmpLength i = 0; i < nLength; i++)
{
pStart[i] += offset;
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <sag...@us...> - 2011-06-24 13:00:38
|
Revision: 905
http://modplug.svn.sourceforge.net/modplug/?rev=905&view=rev
Author: saga-games
Date: 2011-06-24 13:00:31 +0000 (Fri, 24 Jun 2011)
Log Message:
-----------
[Imp] Added TBPM (Song beats per minute) frame to ID3v2 tags (doesn't change the fact that the mp3 writer still stack overflows, though)
[Ref] Little refactoring here and there.
Modified Paths:
--------------
trunk/OpenMPT/mptrack/Draw_pat.cpp
trunk/OpenMPT/mptrack/Mod2wave.cpp
trunk/OpenMPT/mptrack/Mptrack.cpp
trunk/OpenMPT/mptrack/tagging.cpp
trunk/OpenMPT/mptrack/tagging.h
trunk/OpenMPT/mptrack/test/test.cpp
trunk/OpenMPT/soundlib/Load_itp.cpp
Modified: trunk/OpenMPT/mptrack/Draw_pat.cpp
===================================================================
--- trunk/OpenMPT/mptrack/Draw_pat.cpp 2011-06-23 14:46:38 UTC (rev 904)
+++ trunk/OpenMPT/mptrack/Draw_pat.cpp 2011-06-24 13:00:31 UTC (rev 905)
@@ -211,10 +211,10 @@
POINT pt;
int xofs = GetXScrollPos();
int yofs = GetYScrollPos();
- pt.x = (((dwPos >> 3) & 0xFF) - xofs) * GetColumnWidth();
- UINT imax = (dwPos & 7);
- if (imax > 5) imax = 5;
- if (imax > m_nDetailLevel+1) imax = m_nDetailLevel+1;
+ pt.x = (GetChanFromCursor(dwPos) - xofs) * GetColumnWidth();
+ UINT imax = GetColTypeFromCursor(dwPos);
+ if (imax > LAST_COLUMN + 1) imax = LAST_COLUMN + 1;
+ if (imax > m_nDetailLevel + 1) imax = m_nDetailLevel + 1;
for (UINT i=0; i<imax; i++)
{
pt.x += pfnt->nEltWidths[i];
Modified: trunk/OpenMPT/mptrack/Mod2wave.cpp
===================================================================
--- trunk/OpenMPT/mptrack/Mod2wave.cpp 2011-06-23 14:46:38 UTC (rev 904)
+++ trunk/OpenMPT/mptrack/Mod2wave.cpp 2011-06-24 13:00:31 UTC (rev 905)
@@ -123,7 +123,7 @@
SetDlgItemInt(IDC_EDIT4, m_nMaxOrder);
- for (UINT i=0; i<NUMMIXRATE; i++)
+ for (size_t i = 0; i < CountOf(nMixingRates); i++)
{
UINT n = nMixingRates[i];
wsprintf(s, "%d Hz", n);
@@ -531,7 +531,7 @@
void CLayer3Convert::OnOK()
//-------------------------
{
- CHAR sText[256] = {0};
+ CHAR sText[256] = "";
if (m_dwFileLimit) m_dwFileLimit = GetDlgItemInt(IDC_EDIT1, NULL, FALSE);
if (m_dwSongLimit) m_dwSongLimit = GetDlgItemInt(IDC_EDIT2, NULL, FALSE);
@@ -581,6 +581,9 @@
m_FileTags.comments = "";
}
+ wsprintf(sText, "%d", (int)m_pSndFile->GetCurrentBPM());
+ m_FileTags.bpm = sText;
+
CDialog::OnOK();
}
@@ -983,7 +986,7 @@
_splitpath(m_lpszFileName, NULL, NULL, NULL, fext);
if (((m_bSaveInfoField) && (m_pwfx->wFormatTag != WAVE_FORMAT_MPEGLAYER3))
|| (!lstrcmpi(fext, ".wav"))) bSaveWave = TRUE;
- memset(&wfxSrc, 0, sizeof(wfxSrc));
+ MemsetZero(wfxSrc);
wfxSrc.wFormatTag = WAVE_FORMAT_PCM;
wfxSrc.nSamplesPerSec = m_pwfx->nSamplesPerSec;
if (wfxSrc.nSamplesPerSec < 11025) wfxSrc.nSamplesPerSec = 11025;
@@ -1001,7 +1004,7 @@
pcmBuffer = (LPBYTE)GlobalAllocPtr(GHND, WAVECONVERTBUFSIZE);
dstBuffer = (LPBYTE)GlobalAllocPtr(GHND, dwDstBufSize);
if ((!dstBuffer) || (!pcmBuffer)) goto OnError;
- memset(&ash, 0, sizeof(ash));
+ MemsetZero(ash);
ash.cbStruct = sizeof(ash);
ash.pbSrc = pcmBuffer;
ash.cbSrcLength = WAVECONVERTBUFSIZE;
@@ -1010,7 +1013,8 @@
if (theApp.AcmStreamPrepareHeader(has, &ash, 0L) != MMSYSERR_NOERROR) goto OnError;
bPrepared = TRUE;
// Creating the output file
- if ((f = fopen(m_lpszFileName, "wb")) == NULL) {
+ if ((f = fopen(m_lpszFileName, "wb")) == NULL)
+ {
::AfxMessageBox("Could not open file for writing. Is it open in another application?");
goto OnError;
}
@@ -1158,7 +1162,7 @@
fseek(f, data_ofs, SEEK_SET);
fwrite(&wdh, 1, sizeof(wdh), f);
}
- } else
+ }
fclose(f);
if (!m_bAbort) retval = IDOK;
OnError:
Modified: trunk/OpenMPT/mptrack/Mptrack.cpp
===================================================================
--- trunk/OpenMPT/mptrack/Mptrack.cpp 2011-06-23 14:46:38 UTC (rev 904)
+++ trunk/OpenMPT/mptrack/Mptrack.cpp 2011-06-24 13:00:31 UTC (rev 905)
@@ -65,8 +65,8 @@
if (pPluginManager)
{
pPluginManager->AddPlugin(lpszPathName);
+ return NULL;
}
- return NULL;
}
}
@@ -1614,6 +1614,8 @@
"http://www.hermannseib.com/english/vsthost.htm|"
"Ian Luck for UNMO3|"
"http://www.un4seen.com/mo3.html|"
+ "Jean-loup Gailly and Mark Adler for zlib|"
+ "http://zlib.net/|"
"coda for sample drawing code|"
"http://coda.s3m.us/|"
"Storlek for all the IT compatibility hints and testcases|"
@@ -1626,10 +1628,10 @@
"|The people at ModPlug forums for crucial contribution|"
"in the form of ideas, testing and support; thanks|"
"particularly to:|"
- "LPChip, Ganja, Diamond, Nofold, Goor00, Georg|"
- "Skilletaudio, Squirrel Havoc, Snu, Anboi|"
- "Sam Zen, BooT-SectoR-ViruZ, 33, Waxhead|"
- "KrazyKatz, Bvanoudtshoorn, Skaven|"
+ "33, Anboi, BooT-SectoR-ViruZ, Bvanoudtshoorn|"
+ "christofori, Diamond, Ganja, Georg, Goor00|"
+ "KrazyKatz, LPChip, Nofold, Rakib, Sam Zen|"
+ "Skaven, Skilletaudio, Snu, Squirrel Havoc, Waxhead|"
"|||||||"
"VST PlugIn Technology by Steinberg Media Technologies GmbH|"
"ASIO Technology by Steinberg Media Technologies GmbH|"
Modified: trunk/OpenMPT/mptrack/tagging.cpp
===================================================================
--- trunk/OpenMPT/mptrack/tagging.cpp 2011-06-23 14:46:38 UTC (rev 904)
+++ trunk/OpenMPT/mptrack/tagging.cpp 2011-06-24 13:00:31 UTC (rev 905)
@@ -67,6 +67,7 @@
WriteID3v2Frame("WXXX", url, f);
WriteID3v2Frame("TENC", encoder, f);
WriteID3v2Frame("COMM", comments, f);
+ WriteID3v2Frame("TBPM", bpm, f);
// Write Padding
for(size_t i = 0; i < ID3v2_PADDING; i++)
Modified: trunk/OpenMPT/mptrack/tagging.h
===================================================================
--- trunk/OpenMPT/mptrack/tagging.h 2011-06-23 14:46:38 UTC (rev 904)
+++ trunk/OpenMPT/mptrack/tagging.h 2011-06-24 13:00:31 UTC (rev 905)
@@ -100,7 +100,7 @@
void WriteWaveTags(WAVEDATAHEADER *wdh, WAVEFILEHEADER *wfh, FILE *f);
// Tag data
- string title, artist, album, year, comments, genre, url, encoder;
+ string title, artist, album, year, comments, genre, url, encoder, bpm;
CFileTagging();
Modified: trunk/OpenMPT/mptrack/test/test.cpp
===================================================================
--- trunk/OpenMPT/mptrack/test/test.cpp 2011-06-23 14:46:38 UTC (rev 904)
+++ trunk/OpenMPT/mptrack/test/test.cpp 2011-06-24 13:00:31 UTC (rev 905)
@@ -421,8 +421,8 @@
TestLoadFile(pModDoc);
// Test file saving
- theFile += ".saved";
- pModDoc->GetSoundFile()->SaveIT(theFile);
+ theFile.Replace(".mptm", ".saved.mptm");
+ pModDoc->DoSave(theFile);
pModDoc->OnCloseDocument();
// Reload the saved file and test if everything is still working correctly.
Modified: trunk/OpenMPT/soundlib/Load_itp.cpp
===================================================================
--- trunk/OpenMPT/soundlib/Load_itp.cpp 2011-06-23 14:46:38 UTC (rev 904)
+++ trunk/OpenMPT/soundlib/Load_itp.cpp 2011-06-24 13:00:31 UTC (rev 905)
@@ -60,10 +60,11 @@
// name string
ASSERT_CAN_READ(len);
- if (len<=sizeof(m_szNames[0])) {
+ if (len<=sizeof(m_szNames[0]))
+ {
memcpy(m_szNames[0],lpStream+dwMemPos,len);
dwMemPos += len;
- m_szNames[0][sizeof(m_szNames[0])-1] = '\0';
+ SetNullTerminator(m_szNames[0]);
}
else return false;
@@ -330,7 +331,7 @@
dwMemPos += sizeof(DWORD);
if(dwMemPos >= dwMemLength || len > dwMemLength - dwMemPos) return false;
- // Copy sample struct data
+ // Copy sample struct data (ut-oh... this code looks very familiar!)
if(pis.id == LittleEndian(IT_IMPS))
{
MODSAMPLE *pSmp = &Samples[nsmp];
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|