You can subscribe to this list here.
| 2006 |
Jan
|
Feb
|
Mar
(1) |
Apr
(1) |
May
|
Jun
(1) |
Jul
|
Aug
(10) |
Sep
|
Oct
|
Nov
|
Dec
(3) |
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 2007 |
Jan
(1) |
Feb
(2) |
Mar
(3) |
Apr
(2) |
May
(10) |
Jun
(2) |
Jul
(1) |
Aug
|
Sep
|
Oct
|
Nov
(3) |
Dec
|
| 2008 |
Jan
(6) |
Feb
(4) |
Mar
(5) |
Apr
(2) |
May
(1) |
Jun
(1) |
Jul
(4) |
Aug
(6) |
Sep
(2) |
Oct
(9) |
Nov
(1) |
Dec
(4) |
| 2009 |
Jan
(9) |
Feb
(2) |
Mar
(2) |
Apr
(2) |
May
(6) |
Jun
(18) |
Jul
(33) |
Aug
(39) |
Sep
(33) |
Oct
(24) |
Nov
(23) |
Dec
(22) |
| 2010 |
Jan
(29) |
Feb
(32) |
Mar
(51) |
Apr
(17) |
May
(31) |
Jun
(21) |
Jul
(32) |
Aug
(28) |
Sep
(35) |
Oct
(27) |
Nov
(11) |
Dec
(13) |
| 2011 |
Jan
(14) |
Feb
(13) |
Mar
(27) |
Apr
(27) |
May
(28) |
Jun
(20) |
Jul
(43) |
Aug
(52) |
Sep
(66) |
Oct
(61) |
Nov
(11) |
Dec
(8) |
| 2012 |
Jan
(20) |
Feb
(30) |
Mar
(38) |
Apr
(21) |
May
(33) |
Jun
(21) |
Jul
(25) |
Aug
(9) |
Sep
(24) |
Oct
(42) |
Nov
(27) |
Dec
(41) |
| 2013 |
Jan
(20) |
Feb
(35) |
Mar
(156) |
Apr
(298) |
May
(258) |
Jun
(201) |
Jul
(105) |
Aug
(60) |
Sep
(193) |
Oct
(245) |
Nov
(280) |
Dec
(194) |
| 2014 |
Jan
(63) |
Feb
(202) |
Mar
(200) |
Apr
(23) |
May
(53) |
Jun
(105) |
Jul
(18) |
Aug
(26) |
Sep
(110) |
Oct
(187) |
Nov
(97) |
Dec
(74) |
| 2015 |
Jan
(45) |
Feb
(55) |
Mar
(116) |
Apr
(116) |
May
(193) |
Jun
(164) |
Jul
(50) |
Aug
(111) |
Sep
(98) |
Oct
(71) |
Nov
(103) |
Dec
(63) |
| 2016 |
Jan
(33) |
Feb
(101) |
Mar
(182) |
Apr
(139) |
May
(140) |
Jun
(103) |
Jul
(165) |
Aug
(286) |
Sep
(208) |
Oct
(127) |
Nov
(97) |
Dec
(54) |
| 2017 |
Jan
(64) |
Feb
(335) |
Mar
(202) |
Apr
(212) |
May
(139) |
Jun
(127) |
Jul
(294) |
Aug
(154) |
Sep
(170) |
Oct
(152) |
Nov
(156) |
Dec
(62) |
| 2018 |
Jan
(168) |
Feb
(237) |
Mar
(196) |
Apr
(174) |
May
(174) |
Jun
(161) |
Jul
(127) |
Aug
(88) |
Sep
(149) |
Oct
(66) |
Nov
(52) |
Dec
(135) |
| 2019 |
Jan
(146) |
Feb
(126) |
Mar
(104) |
Apr
(58) |
May
(60) |
Jun
(28) |
Jul
(197) |
Aug
(129) |
Sep
(141) |
Oct
(148) |
Nov
(63) |
Dec
(100) |
| 2020 |
Jan
(74) |
Feb
(37) |
Mar
(59) |
Apr
(154) |
May
(194) |
Jun
(133) |
Jul
(313) |
Aug
(197) |
Sep
(49) |
Oct
(162) |
Nov
(143) |
Dec
(57) |
| 2021 |
Jan
(120) |
Feb
(107) |
Mar
(314) |
Apr
(157) |
May
(524) |
Jun
(169) |
Jul
(72) |
Aug
(133) |
Sep
(135) |
Oct
(146) |
Nov
(198) |
Dec
(325) |
| 2022 |
Jan
(409) |
Feb
(249) |
Mar
(138) |
Apr
(95) |
May
(102) |
Jun
(221) |
Jul
(66) |
Aug
(120) |
Sep
(192) |
Oct
(131) |
Nov
(53) |
Dec
(171) |
| 2023 |
Jan
(357) |
Feb
(82) |
Mar
(168) |
Apr
(218) |
May
(196) |
Jun
(86) |
Jul
(115) |
Aug
(49) |
Sep
(190) |
Oct
(102) |
Nov
(45) |
Dec
(76) |
| 2024 |
Jan
(86) |
Feb
(50) |
Mar
(324) |
Apr
(209) |
May
(197) |
Jun
(232) |
Jul
(194) |
Aug
(247) |
Sep
(219) |
Oct
(266) |
Nov
(328) |
Dec
(304) |
| 2025 |
Jan
(191) |
Feb
(115) |
Mar
(137) |
Apr
(32) |
May
(126) |
Jun
(403) |
Jul
(213) |
Aug
(203) |
Sep
(148) |
Oct
(109) |
Nov
(191) |
Dec
(209) |
| 2026 |
Jan
(127) |
Feb
(123) |
Mar
(160) |
Apr
(141) |
May
(45) |
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
|
From: <sag...@us...> - 2010-09-28 20:07:50
|
Revision: 726
http://modplug.svn.sourceforge.net/modplug/?rev=726&view=rev
Author: saga-games
Date: 2010-09-28 20:07:44 +0000 (Tue, 28 Sep 2010)
Log Message:
-----------
[Imp] IT Loader: Applying new knowledge about the "special" flags to properly read the row highlight.
Modified Paths:
--------------
trunk/OpenMPT/soundlib/Load_it.cpp
Modified: trunk/OpenMPT/soundlib/Load_it.cpp
===================================================================
--- trunk/OpenMPT/soundlib/Load_it.cpp 2010-09-27 23:41:36 UTC (rev 725)
+++ trunk/OpenMPT/soundlib/Load_it.cpp 2010-09-28 20:07:44 UTC (rev 726)
@@ -513,7 +513,9 @@
} else if(pifh->cmwt == 0x888 || pifh->cwtv == 0x888)
{
// OpenMPT 1.17 and 1.18 (raped IT format)
+ // Exact version number will be determined later.
interpretModPlugMade = true;
+ m_dwLastSavedWithVersion = MAKE_VERSION_NUMERIC(1, 17, 00, 00);
} else if(pifh->cwtv == 0x0217 && pifh->cmwt == 0x0200 && pifh->reserved == 0)
{
// ModPlug Tracker 1.16 (semi-raped IT format)
@@ -551,14 +553,22 @@
if(GetType() == MOD_TYPE_IT) mptStartPos = dwMemLength;
// Read row highlights
- if(pifh->cwtv >= 0x0213)
+ if((pifh->special & 0x04))
{
- // MPT 1.09, 1.07 and most likely other old MPT versions as well as some other programs (converters) leave this blank
- if(pifh->highlight_minor + pifh->highlight_major != 0)
+ // MPT 1.09, 1.07 and most likely other old MPT versions leave this blank (0/0), but have the "special" flag set.
+ // Newer versions of MPT and OpenMPT 1.17 *always* write 4/16 here.
+ // Thus, we will just ignore those old versions.
+ if(m_dwLastSavedWithVersion == 0 || m_dwLastSavedWithVersion >= MAKE_VERSION_NUMERIC(1, 17, 03, 02))
{
m_nDefaultRowsPerBeat = pifh->highlight_minor;
m_nDefaultRowsPerMeasure = pifh->highlight_major;
}
+#ifdef DEBUG
+ if((pifh->highlight_minor & pifh->highlight_major) == 0)
+ {
+ Log("IT Header: Row highlight is 0");
+ }
+#endif
}
if (pifh->flags & 0x08) m_dwSongFlags |= SONG_LINEARSLIDES;
@@ -1274,8 +1284,8 @@
header.id = LittleEndian(IT_IMPM);
lstrcpyn(header.songname, m_szNames[0], 26);
- header.highlight_minor = (BYTE)(m_nDefaultRowsPerBeat & 0xFF);
- header.highlight_major = (BYTE)(m_nDefaultRowsPerMeasure & 0xFF);
+ header.highlight_minor = (BYTE)min(m_nDefaultRowsPerBeat, 0xFF);
+ header.highlight_major = (BYTE)min(m_nDefaultRowsPerMeasure, 0xFF);
if(GetType() == MOD_TYPE_MPT)
{
@@ -1325,7 +1335,7 @@
}
header.flags = 0x0001;
- header.special = 0x02 | 0x04; // 0x02: embed file edit history
+ header.special = 0x02 | 0x04 ; // 0x02: embed file edit history, 0x04: store row highlight in the header
if (m_nInstruments) header.flags |= 0x04;
if (m_dwSongFlags & SONG_LINEARSLIDES) header.flags |= 0x08;
if (m_dwSongFlags & SONG_ITOLDEFFECTS) header.flags |= 0x10;
@@ -1912,8 +1922,8 @@
header.id = LittleEndian(IT_IMPM);
lstrcpyn(header.songname, m_szNames[0], 26);
- header.highlight_minor = (BYTE)(m_nDefaultRowsPerBeat & 0xFF);
- header.highlight_major = (BYTE)(m_nDefaultRowsPerMeasure & 0xFF);
+ header.highlight_minor = (BYTE)min(m_nDefaultRowsPerBeat, 0xFF);
+ header.highlight_major = (BYTE)min(m_nDefaultRowsPerMeasure, 0xFF);
// An additional "---" pattern is appended so Impulse Tracker won't ignore the last order item.
// Interestingly, this can exceed IT's 256 order limit. Also, IT will always save at least two orders.
@@ -1942,7 +1952,7 @@
}
header.flags = 0x0001;
- header.special = 0x02 | 0x04; // 0x02: embed file edit history
+ header.special = 0x02 | 0x04 ; // 0x02: embed file edit history, 0x04: store row highlight in the header
if (m_nInstruments) header.flags |= 0x04;
if (m_dwSongFlags & SONG_LINEARSLIDES) header.flags |= 0x08;
if (m_dwSongFlags & SONG_ITOLDEFFECTS) header.flags |= 0x10;
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <sag...@us...> - 2010-09-27 23:41:42
|
Revision: 725
http://modplug.svn.sourceforge.net/modplug/?rev=725&view=rev
Author: saga-games
Date: 2010-09-27 23:41:36 +0000 (Mon, 27 Sep 2010)
Log Message:
-----------
[Fix] time_t was not accurate enough to hold the edit time value (the edit time values were changing after re-saving a file a couple of times), so now the seconds are stored in IT's native resolution.
[Fix] Edit history imported was broken (day of month was incorrectly clamped to 12 instead of 31)
[Fix] Edit history was incorrectly imported when loading IT made with early versions of Schism Tracker, as those versions set the edit history flag, but didn't actually write the edit count to the file.
[Ref] Simplified history handling. One little drawback is that the session information of the current session is not displayed in the edit history and that at least one history item is now stored in the file.
Modified Paths:
--------------
trunk/OpenMPT/mptrack/Moddoc.cpp
trunk/OpenMPT/mptrack/Moddoc.h
trunk/OpenMPT/mptrack/dlg_misc.cpp
trunk/OpenMPT/soundlib/Load_it.cpp
trunk/OpenMPT/soundlib/Sndfile.cpp
Modified: trunk/OpenMPT/mptrack/Moddoc.cpp
===================================================================
--- trunk/OpenMPT/mptrack/Moddoc.cpp 2010-09-27 12:04:26 UTC (rev 724)
+++ trunk/OpenMPT/mptrack/Moddoc.cpp 2010-09-27 23:41:36 UTC (rev 725)
@@ -109,6 +109,8 @@
m_SplitKeyboardSettings.octaveModifier = 0;
m_SplitKeyboardSettings.octaveLink = false;
+ // Set the creation date of this file (or the load time if we're loading an existing file)
+ time(&m_creationTime);
m_FileHistory.clear();
#ifdef _DEBUG
Modified: trunk/OpenMPT/mptrack/Moddoc.h
===================================================================
--- trunk/OpenMPT/mptrack/Moddoc.h 2010-09-27 12:04:26 UTC (rev 724)
+++ trunk/OpenMPT/mptrack/Moddoc.h 2010-09-27 23:41:36 UTC (rev 725)
@@ -117,15 +117,17 @@
/////////////////////////////////////////////////////////////////////////
// File edit history
+
+#define HISTORY_TIMER_PRECISION 18.2f
+
+//================
struct FileHistory
+//================
{
// Date when the file was loaded in the the tracker or created.
- tm load_date;
- // Time the file was open in the editor (in seconds).
- // For previous editing sessions, this stores the absolute time in seconds the editor was open.
- // For the current editing session, this stores the time when editing was started (using the result of time()).
- // To get the desired value in this case, use difftime(time(nullptr), open_time).
- time_t open_time;
+ tm loadDate;
+ // Time the file was open in the editor, in 1/18.2th seconds (frequency of a standard DOS timer, to keep compatibility with Impulse Tracker easy).
+ uint32 openTime;
};
/////////////////////////////////////////////////////////////////////////
@@ -172,6 +174,7 @@
CSampleUndo m_SampleUndo;
SplitKeyboardSettings m_SplitKeyboardSettings; // this is maybe not the best place to keep them, but it should do the job
vector<FileHistory> m_FileHistory; // File edit history
+ time_t m_creationTime;
protected: // create from serialization only
CModDoc();
@@ -230,7 +233,9 @@
CPatternUndo *GetPatternUndo() { return &m_PatternUndo; }
CSampleUndo *GetSampleUndo() { return &m_SampleUndo; }
SplitKeyboardSettings *GetSplitKeyboardSettings() { return &m_SplitKeyboardSettings; }
+
vector<FileHistory> *GetFileHistory() { return &m_FileHistory; }
+ time_t GetCreationTime() const { return m_creationTime; }
// operations
public:
Modified: trunk/OpenMPT/mptrack/dlg_misc.cpp
===================================================================
--- trunk/OpenMPT/mptrack/dlg_misc.cpp 2010-09-27 12:04:26 UTC (rev 724)
+++ trunk/OpenMPT/mptrack/dlg_misc.cpp 2010-09-27 23:41:36 UTC (rev 725)
@@ -3114,34 +3114,38 @@
return TRUE;
CString s;
- time_t total_time = 0;
+ uint64 totalTime = 0;
const size_t num = m_pModDoc->GetFileHistory()->size();
+
for(size_t n = 0; n < num; n++)
{
CString temp;
FileHistory *hist = &(m_pModDoc->GetFileHistory()->at(n));
- time_t duration = hist->open_time;
- // Current item
- if(n == num - 1)
- {
- duration = difftime(time(nullptr), duration);
- }
- total_time += duration;
+ totalTime += hist->openTime;
+
+ // Date
TCHAR szDate[32];
- _tcsftime(szDate, sizeof(szDate), _T("%d %b %Y, %H:%M:%S"), &hist->load_date);
-
- temp.Format(_T("Loaded %s, open in the editor for %lluh %02llum %02llus\r\n"),
+ _tcsftime(szDate, sizeof(szDate), _T("%d %b %Y, %H:%M:%S"), &hist->loadDate);
+ // Time + stuff
+ uint32 duration = (uint32)((double)(hist->openTime) / HISTORY_TIMER_PRECISION);
+ temp.Format(_T("Loaded %s, open in the editor for %luh %02lum %02lus\r\n"),
szDate, duration / 3600, (duration / 60) % 60, duration % 60);
s += temp;
}
+ if(num == 0)
+ {
+ s = _T("No information available about the previous edit history of this module.");
+ }
SetDlgItemText(IDC_EDIT_HISTORY, s);
- s.Format(_T("Total edit time: %lluh %02llum %02llus"), total_time / 3600, (total_time / 60) % 60, total_time % 60);
+ // Total edit time
+ totalTime = (uint64)((double)(totalTime) / HISTORY_TIMER_PRECISION);
+ s.Format(_T("Total edit time: %lluh %02llum %02llus"), totalTime / 3600, (totalTime / 60) % 60, totalTime % 60);
SetDlgItemText(IDC_TOTAL_EDIT_TIME, s);
-
+ // Window title
s.Format(_T("Edit history for %s"), m_pModDoc->GetTitle());
SetWindowText(s);
-
+ // Enable or disable Clear button
GetDlgItem(IDC_BTN_CLEAR)->EnableWindow((m_pModDoc->GetFileHistory()->empty()) ? FALSE : TRUE);
return TRUE;
Modified: trunk/OpenMPT/soundlib/Load_it.cpp
===================================================================
--- trunk/OpenMPT/soundlib/Load_it.cpp 2010-09-27 12:04:26 UTC (rev 724)
+++ trunk/OpenMPT/soundlib/Load_it.cpp 2010-09-27 23:41:36 UTC (rev 725)
@@ -636,6 +636,7 @@
inspossize <<= 2;
memcpy(inspos, lpStream+dwMemPos, inspossize);
dwMemPos += pifh->insnum * 4;
+
// Reading Samples Offsets
memset(smppos, 0, sizeof(smppos));
UINT smppossize = pifh->smpnum;
@@ -643,6 +644,7 @@
smppossize <<= 2;
memcpy(smppos, lpStream+dwMemPos, smppossize);
dwMemPos += pifh->smpnum * 4;
+
// Reading Patterns Offsets
UINT patpossize = pifh->patnum;
if(patpossize > GetModSpecifications().patternsMax)
@@ -665,41 +667,46 @@
return false;
if(patpossize > 0)
memcpy(&patpos[0], lpStream+dwMemPos, patpossize);
-
-
dwMemPos += pifh->patnum * 4;
+
// Reading IT Edit History Info
- if (dwMemPos + 2 < dwMemLength && (pifh->special & 0x02))
+ // This is only supposed to be present if bit 1 of the special flags is set.
+ // However, old versions of Schism and probably other trackers always set this
+ // even if they don't write the edit history count. So we have to filter this out...
+ // (for now we will just ignore those Schism versions, as Schism seems to be the only tracker that did this)
+ const bool oldSchism = ((pifh->cwtv & 0xF000) == 0x1000 && pifh->cwtv < 0x1050) ? true : false;
+ if (dwMemPos + 2 < dwMemLength && (pifh->special & 0x02) && !oldSchism)
{
size_t nflt = LittleEndianW(*((uint16*)(lpStream + dwMemPos)));
dwMemPos += 2;
- GetpModDoc()->GetFileHistory()->clear();
if (nflt * 8 <= dwMemLength - dwMemPos)
{
+ GetpModDoc()->GetFileHistory()->clear();
for(size_t n = 0; n < nflt; n++)
{
#ifdef MODPLUG_TRACKER
- ITHISTORYSTRUCT it_history = *((ITHISTORYSTRUCT *)(lpStream + dwMemPos));
- it_history.fatdate = LittleEndianW(it_history.fatdate);
- it_history.fattime = LittleEndianW(it_history.fattime);
- it_history.runtime = LittleEndian(it_history.runtime);
+ ITHISTORYSTRUCT itHistory = *((ITHISTORYSTRUCT *)(lpStream + dwMemPos));
+ itHistory.fatdate = LittleEndianW(itHistory.fatdate);
+ itHistory.fattime = LittleEndianW(itHistory.fattime);
+ itHistory.runtime = LittleEndian(itHistory.runtime);
- FileHistory mpt_history;
- MemsetZero(mpt_history);
- mpt_history.load_date.tm_year = ((it_history.fatdate >> 9) & 0x7F) + 80;
- mpt_history.load_date.tm_mon = CLAMP((it_history.fatdate >> 5) & 0x0F, 1, 12) - 1;
- mpt_history.load_date.tm_mday = CLAMP(it_history.fatdate & 0x1F, 1, 12);
- mpt_history.load_date.tm_hour = CLAMP((it_history.fattime >> 11) & 0x1F, 0, 23);
- mpt_history.load_date.tm_min = CLAMP((it_history.fattime >> 5) & 0x3F, 0, 59);
- mpt_history.load_date.tm_sec = CLAMP((it_history.fattime & 0x1F) * 2, 0, 59);
- mpt_history.open_time = (time_t)((float)(it_history.runtime) / 18.2f);
- GetpModDoc()->GetFileHistory()->push_back(mpt_history);
+ FileHistory mptHistory;
+ MemsetZero(mptHistory);
+ // Decode FAT date and time
+ mptHistory.loadDate.tm_year = ((itHistory.fatdate >> 9) & 0x7F) + 80;
+ mptHistory.loadDate.tm_mon = CLAMP((itHistory.fatdate >> 5) & 0x0F, 1, 12) - 1;
+ mptHistory.loadDate.tm_mday = CLAMP(itHistory.fatdate & 0x1F, 1, 31);
+ mptHistory.loadDate.tm_hour = CLAMP((itHistory.fattime >> 11) & 0x1F, 0, 23);
+ mptHistory.loadDate.tm_min = CLAMP((itHistory.fattime >> 5) & 0x3F, 0, 59);
+ mptHistory.loadDate.tm_sec = CLAMP((itHistory.fattime & 0x1F) * 2, 0, 59);
+ mptHistory.openTime = itHistory.runtime * (HISTORY_TIMER_PRECISION / 18.2f);
+ GetpModDoc()->GetFileHistory()->push_back(mptHistory);
#ifdef DEBUG
- const uint32 seconds = (uint32)(((float)it_history.runtime) / 18.2f);
+ const uint32 seconds = (uint32)(((double)itHistory.runtime) / 18.2f);
CHAR stime[128];
- wsprintf(stime, "IT Edit History: Loaded %04u-%02u-%02u %02u:%02u:%02u, open in the editor for %u:%02u:%02u (%u ticks)\n", ((it_history.fatdate >> 9) & 0x7F) + 1980, (it_history.fatdate >> 5) & 0x0F, it_history.fatdate & 0x1F, (it_history.fattime >> 11) & 0x1F, (it_history.fattime >> 5) & 0x3F, (it_history.fattime & 0x1F) * 2, seconds / 3600, (seconds / 60) % 60, seconds % 60, it_history.runtime);
+ wsprintf(stime, "IT Edit History: Loaded %04u-%02u-%02u %02u:%02u:%02u, open for %u:%02u:%02u (%u ticks)\n", ((itHistory.fatdate >> 9) & 0x7F) + 1980, (itHistory.fatdate >> 5) & 0x0F, itHistory.fatdate & 0x1F, (itHistory.fattime >> 11) & 0x1F, (itHistory.fattime >> 5) & 0x3F, (itHistory.fattime & 0x1F) * 2, seconds / 3600, (seconds / 60) % 60, seconds % 60, itHistory.runtime);
Log(stime);
#endif // DEBUG
@@ -708,7 +715,7 @@
}
}
}
- // Reading Midi Output & Macros
+ // Reading MIDI Output & Macros
if (m_dwSongFlags & SONG_EMBEDMIDICFG)
{
if (dwMemPos + sizeof(MODMIDICFG) < dwMemLength)
@@ -1168,37 +1175,64 @@
#ifndef MODPLUG_NO_FILESAVE
-// Save edit history
-void SaveITEditHistory(const CSoundFile *pSndFile, FILE *f)
-//---------------------------------------------------------
+// Save edit history. Pass a null pointer for *f to retrieve the number of bytes that would be written.
+DWORD SaveITEditHistory(const CSoundFile *pSndFile, FILE *f)
+//----------------------------------------------------------
{
- const size_t num = pSndFile->GetpModDoc()->GetFileHistory()->size();
- uint16 fnum = min(num, uint16_max);
+#ifdef MODPLUG_TRACKER
+ CModDoc *pModDoc = pSndFile->GetpModDoc();
+ const size_t num = (pModDoc != nullptr) ? pModDoc->GetFileHistory()->size() + 1 : 0; // + 1 for this session
+#else
+ const size_t num = 0;
+#endif // MODPLUG_TRACKER
+
+ uint16 fnum = min(num, uint16_max); // Number of entries that are actually going to be written
+ const size_t bytes_written = 2 + fnum * 8; // Number of bytes that are actually going to be written
+
+ if(f == nullptr)
+ return bytes_written;
+
+ // Write number of history entries
fnum = LittleEndianW(fnum);
fwrite(&fnum, 2, 1, f);
+#ifdef MODPLUG_TRACKER
+ // Write history data
const size_t start = (num > uint16_max) ? num - uint16_max : 0;
for(size_t n = start; n < num; n++)
{
- const FileHistory *mpt_history = &(pSndFile->GetpModDoc()->GetFileHistory()->at(n));
- ITHISTORYSTRUCT it_history;
- // Create FAT file dates
- it_history.fatdate = mpt_history->load_date.tm_mday | ((mpt_history->load_date.tm_mon + 1) << 5) | ((mpt_history->load_date.tm_year - 80) << 9);
- it_history.fattime = (mpt_history->load_date.tm_sec / 2) | (mpt_history->load_date.tm_min << 5) | (mpt_history->load_date.tm_hour << 11);
- if(n == num - 1)
+ tm loadDate;
+ uint32 openTime;
+
+ if(n < num - 1)
{
- // The current timestamp has to be converted first.
- it_history.runtime = difftime(time(nullptr), mpt_history->open_time) * 18;
+ // Previous timestamps
+ const FileHistory *mptHistory = &(pModDoc->GetFileHistory()->at(n));
+ loadDate = mptHistory->loadDate;
+ openTime = mptHistory->openTime * (18.2f / HISTORY_TIMER_PRECISION);
} else
{
- // Previous timestamps are left alone
- it_history.runtime = mpt_history->open_time * 18;
+ // Current ("new") timestamp
+ const time_t creationTime = pModDoc->GetCreationTime();
+ localtime_s(&loadDate, &creationTime);
+ openTime = (uint32)((double)difftime(time(nullptr), creationTime) * 18.2f);
}
- it_history.fatdate = LittleEndianW(it_history.fatdate);
- it_history.fattime = LittleEndianW(it_history.fattime);
- it_history.runtime = LittleEndian(it_history.runtime);
- fwrite(&it_history, 1, sizeof(it_history), f);
+
+ ITHISTORYSTRUCT itHistory;
+ // Create FAT file dates
+ itHistory.fatdate = loadDate.tm_mday | ((loadDate.tm_mon + 1) << 5) | ((loadDate.tm_year - 80) << 9);
+ itHistory.fattime = (loadDate.tm_sec / 2) | (loadDate.tm_min << 5) | (loadDate.tm_hour << 11);
+ itHistory.runtime = openTime;
+
+ itHistory.fatdate = LittleEndianW(itHistory.fatdate);
+ itHistory.fattime = LittleEndianW(itHistory.fattime);
+ itHistory.runtime = LittleEndian(itHistory.runtime);
+
+ fwrite(&itHistory, 1, sizeof(itHistory), f);
}
+#endif // MODPLUG_TRACKER
+
+ return bytes_written;
}
#pragma warning(disable:4100)
@@ -1215,7 +1249,7 @@
DWORD inspos[MAX_INSTRUMENTS];
vector<DWORD> patpos;
DWORD smppos[MAX_SAMPLES];
- DWORD dwPos = 0, dwHdrPos = 0, dwExtra = 2 + min(GetpModDoc()->GetFileHistory()->size(), uint16_max) * 8;
+ DWORD dwPos = 0, dwHdrPos = 0, dwExtra = 0;
WORD patinfo[4];
// -> CODE#0006
// -> DESC="misc quantity changes"
@@ -1339,6 +1373,7 @@
}
// Mix Plugins
dwExtra += SaveMixPlugins(NULL, TRUE);
+ dwExtra += SaveITEditHistory(this, nullptr); // Just calculate the size of this extra block for now.
// Comments
if (m_lpszSongComments)
{
@@ -1854,7 +1889,7 @@
DWORD inspos[MAX_INSTRUMENTS];
DWORD patpos[MAX_PATTERNS];
DWORD smppos[MAX_SAMPLES];
- DWORD dwPos = 0, dwHdrPos = 0, dwExtra = 2 + min(GetpModDoc()->GetFileHistory()->size(), uint16_max) * 8;
+ DWORD dwPos = 0, dwHdrPos = 0, dwExtra = 0;
WORD patinfo[4];
// -> CODE#0006
// -> DESC="misc quantity changes"
@@ -1952,6 +1987,7 @@
}
*/ // Mix Plugins
//dwExtra += SaveMixPlugins(NULL, TRUE);
+ dwExtra += SaveITEditHistory(this, nullptr); // Just calculate the size of this extra block for now.
// Comments
if (m_lpszSongComments)
{
Modified: trunk/OpenMPT/soundlib/Sndfile.cpp
===================================================================
--- trunk/OpenMPT/soundlib/Sndfile.cpp 2010-09-27 12:04:26 UTC (rev 724)
+++ trunk/OpenMPT/soundlib/Sndfile.cpp 2010-09-27 23:41:36 UTC (rev 725)
@@ -766,19 +766,6 @@
if ((m_nRestartPos >= Order.size()) || (Order[m_nRestartPos] >= Patterns.Size())) m_nRestartPos = 0;
-#ifdef MODPLUG_TRACKER
- // Set the creation date of this file (or the load time if we're loading an existing file)
- {
- FileHistory history;
- MemsetZero(history);
- time_t systime;
- time(&systime);
- localtime_s(&history.load_date, &systime);
- history.open_time = systime; // Editing is starting right NOW!
- pModDoc->GetFileHistory()->push_back(history);
- }
-#endif // MODPLUG_TRACKER
-
// plugin loader
string sNotFound;
std::list<PLUGINDEX> notFoundIDs;
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <sag...@us...> - 2010-09-27 12:04:32
|
Revision: 724
http://modplug.svn.sourceforge.net/modplug/?rev=724&view=rev
Author: saga-games
Date: 2010-09-27 12:04:26 +0000 (Mon, 27 Sep 2010)
Log Message:
-----------
[Mod] Improved portamento import precision for the module loaders that make use of Schism Tracker's mod command import (patch from Schism Tracker)
Modified Paths:
--------------
trunk/OpenMPT/soundlib/modcommand.cpp
Modified: trunk/OpenMPT/soundlib/modcommand.cpp
===================================================================
--- trunk/OpenMPT/soundlib/modcommand.cpp 2010-09-27 12:03:18 UTC (rev 723)
+++ trunk/OpenMPT/soundlib/modcommand.cpp 2010-09-27 12:04:26 UTC (rev 724)
@@ -814,17 +814,17 @@
*p = min(*p, 64);
break;
case CMD_PORTAMENTOUP:
- if (bForce)
- *p = min(*p, 9);
- else if (*p > 9)
+ // if not force, reject when dividing causes loss of data in LSB, or if the final value is too
+ // large to fit. (volume column Ex/Fx are four times stronger than effect column)
+ if (!bForce && ((*p & 3) || *p > 9 * 4 + 3))
return false;
+ *p = min(*p / 4, 9);
*e = VOLCMD_PORTAUP;
break;
case CMD_PORTAMENTODOWN:
- if (bForce)
- *p = min(*p, 9);
- else if (*p > 9)
+ if (!bForce && ((*p & 3) || *p > 9 * 4 + 3))
return false;
+ *p = min(*p / 4, 9);
*e = VOLCMD_PORTADOWN;
break;
case CMD_TONEPORTAMENTO:
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <sag...@us...> - 2010-09-27 12:03:26
|
Revision: 723
http://modplug.svn.sourceforge.net/modplug/?rev=723&view=rev
Author: saga-games
Date: 2010-09-27 12:03:18 +0000 (Mon, 27 Sep 2010)
Log Message:
-----------
[Fix] IT Loader: Edit dates are now fixed because f.e. an invalid month could crash _tcsftime()
[Fix] IT Compatibility: The extended sample map is not saved anymore in the instruments
Modified Paths:
--------------
trunk/OpenMPT/soundlib/Load_it.cpp
Modified: trunk/OpenMPT/soundlib/Load_it.cpp
===================================================================
--- trunk/OpenMPT/soundlib/Load_it.cpp 2010-09-27 12:01:36 UTC (rev 722)
+++ trunk/OpenMPT/soundlib/Load_it.cpp 2010-09-27 12:03:18 UTC (rev 723)
@@ -688,11 +688,11 @@
FileHistory mpt_history;
MemsetZero(mpt_history);
mpt_history.load_date.tm_year = ((it_history.fatdate >> 9) & 0x7F) + 80;
- mpt_history.load_date.tm_mon = ((it_history.fatdate >> 5) & 0x0F) - 1;
- mpt_history.load_date.tm_mday = it_history.fatdate & 0x1F;
- mpt_history.load_date.tm_hour = (it_history.fattime >> 11) & 0x1F;
- mpt_history.load_date.tm_min = (it_history.fattime >> 5) & 0x3F;
- mpt_history.load_date.tm_sec = (it_history.fattime & 0x1F) * 2;
+ mpt_history.load_date.tm_mon = CLAMP((it_history.fatdate >> 5) & 0x0F, 1, 12) - 1;
+ mpt_history.load_date.tm_mday = CLAMP(it_history.fatdate & 0x1F, 1, 12);
+ mpt_history.load_date.tm_hour = CLAMP((it_history.fattime >> 11) & 0x1F, 0, 23);
+ mpt_history.load_date.tm_min = CLAMP((it_history.fattime >> 5) & 0x3F, 0, 59);
+ mpt_history.load_date.tm_sec = CLAMP((it_history.fattime & 0x1F) * 2, 0, 59);
mpt_history.open_time = (time_t)((float)(it_history.runtime) / 18.2f);
GetpModDoc()->GetFileHistory()->push_back(mpt_history);
@@ -1391,7 +1391,7 @@
// Writing instruments
for (UINT nins=1; nins<=header.insnum; nins++)
{
- BOOL bKbdEx = FALSE;
+ bool bKbdEx = false; // extended sample map (for samples > 255)
BYTE keyboardex[NOTE_MAX];
memset(&iti, 0, sizeof(iti));
@@ -1440,7 +1440,7 @@
}
iti.keyboard[i*2] = pIns->NoteMap[i] - 1;
iti.keyboard[i*2+1] = smp;
- if (smp > 0xff) bKbdEx = TRUE;
+ if (smp > 0xff) bKbdEx = true;
keyboardex[i] = (smp>>8);
} else keyboardex[i] = 0;
// Writing Volume envelope
@@ -2004,7 +2004,7 @@
// Writing instruments
for (UINT nins=1; nins<=header.insnum; nins++)
{
- BOOL bKbdEx = FALSE;
+ bool bKbdEx = false; // extended sample map (for samples > 255)
BYTE keyboardex[NOTE_MAX];
memset(&iti, 0, sizeof(iti));
@@ -2044,7 +2044,7 @@
}
iti.keyboard[i*2] = pIns->NoteMap[i] - 1;
iti.keyboard[i*2+1] = smp;
- if (smp > 0xff) bKbdEx = TRUE;
+ //if (smp > 0xFF) bKbdEx = true; // no extended sample map in compat mode
keyboardex[i] = (smp>>8);
} else keyboardex[i] = 0;
// Writing Volume envelope
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <sag...@us...> - 2010-09-27 12:01:42
|
Revision: 722
http://modplug.svn.sourceforge.net/modplug/?rev=722&view=rev
Author: saga-games
Date: 2010-09-27 12:01:36 +0000 (Mon, 27 Sep 2010)
Log Message:
-----------
[Imp] It's now possible to create MOD files with more than 64 patterns. Just like in ProTracker, such MOD files are identified by the "M!K!" signature (instead of M.K.)
Modified Paths:
--------------
trunk/OpenMPT/soundlib/Load_mod.cpp
trunk/OpenMPT/soundlib/mod_specifications.h
Modified: trunk/OpenMPT/soundlib/Load_mod.cpp
===================================================================
--- trunk/OpenMPT/soundlib/Load_mod.cpp 2010-09-27 00:15:39 UTC (rev 721)
+++ trunk/OpenMPT/soundlib/Load_mod.cpp 2010-09-27 12:01:36 UTC (rev 722)
@@ -617,7 +617,7 @@
norders = iord;
break;
}
- if ((Order[iord] < 0x80) && (nbp<=Order[iord])) nbp = Order[iord]+1;
+ if ((Order[iord] < 0x80) && (nbp <= Order[iord])) nbp = Order[iord] + 1;
}
bTab[0] = norders;
bTab[1] = m_nRestartPos;
@@ -628,9 +628,15 @@
fwrite(ord, 128, 1, f);
// Writing signature
if (m_nChannels == 4)
- lstrcpy((LPSTR)&bTab, "M.K.");
- else
- wsprintf((LPSTR)&bTab, "%luCHN", m_nChannels);
+ {
+ if(nbp < 64)
+ lstrcpy((LPSTR)&bTab, "M.K.");
+ else // more than 64 patterns
+ lstrcpy((LPSTR)&bTab, "M!K!");
+ } else
+ {
+ sprintf((LPSTR)&bTab, "%luCHN", m_nChannels);
+ }
fwrite(bTab, 4, 1, f);
// Writing patterns
for (UINT ipat=0; ipat<nbp; ipat++) { //for all patterns
Modified: trunk/OpenMPT/soundlib/mod_specifications.h
===================================================================
--- trunk/OpenMPT/soundlib/mod_specifications.h 2010-09-27 00:15:39 UTC (rev 721)
+++ trunk/OpenMPT/soundlib/mod_specifications.h 2010-09-27 12:01:36 UTC (rev 722)
@@ -111,7 +111,7 @@
false, // No notecut.
false, // No noteoff.
false, // No notefade.
- 64, // Pattern max.
+ 128, // Pattern max.
128, // Order max.
4, // Channel min
32, // Channel max
@@ -151,7 +151,7 @@
false, // No notecut.
false, // No noteoff.
false, // No notefade.
- 64, // Pattern max.
+ 128, // Pattern max.
128, // Order max.
4, // Channel min
32, // Channel max
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <sag...@us...> - 2010-09-27 00:15:48
|
Revision: 721
http://modplug.svn.sourceforge.net/modplug/?rev=721&view=rev
Author: saga-games
Date: 2010-09-27 00:15:39 +0000 (Mon, 27 Sep 2010)
Log Message:
-----------
[Mod] Edit History: It's now possible to clear the history completely
[Mod] OpenMPT: Version is now 1.19.00.05 (since the last commit, actually)
Modified Paths:
--------------
trunk/OpenMPT/mptrack/dlg_misc.cpp
Modified: trunk/OpenMPT/mptrack/dlg_misc.cpp
===================================================================
--- trunk/OpenMPT/mptrack/dlg_misc.cpp 2010-09-26 23:47:33 UTC (rev 720)
+++ trunk/OpenMPT/mptrack/dlg_misc.cpp 2010-09-27 00:15:39 UTC (rev 721)
@@ -3142,7 +3142,7 @@
s.Format(_T("Edit history for %s"), m_pModDoc->GetTitle());
SetWindowText(s);
- GetDlgItem(IDC_BTN_CLEAR)->EnableWindow((m_pModDoc->GetFileHistory()->size() > 1) ? TRUE : FALSE);
+ GetDlgItem(IDC_BTN_CLEAR)->EnableWindow((m_pModDoc->GetFileHistory()->empty()) ? FALSE : TRUE);
return TRUE;
@@ -3152,19 +3152,12 @@
void CEditHistoryDlg::OnClearHistory()
//------------------------------------
{
- if(m_pModDoc == nullptr)
- return;
-
- if(m_pModDoc->GetFileHistory()->size() > 1)
+ if(m_pModDoc != nullptr && !m_pModDoc->GetFileHistory()->empty())
{
- while(m_pModDoc->GetFileHistory()->size() > 1)
- {
- m_pModDoc->GetFileHistory()->erase(m_pModDoc->GetFileHistory()->begin());
- }
+ m_pModDoc->GetFileHistory()->clear();
m_pModDoc->SetModified();
+ OnInitDialog();
}
-
- OnInitDialog();
}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <sag...@us...> - 2010-09-26 23:47:41
|
Revision: 720
http://modplug.svn.sourceforge.net/modplug/?rev=720&view=rev
Author: saga-games
Date: 2010-09-26 23:47:33 +0000 (Sun, 26 Sep 2010)
Log Message:
-----------
[New] The edit history can now also be viewed through a dialog. There's also a new shortcut for this dialog.
Modified Paths:
--------------
trunk/OpenMPT/mptrack/CommandSet.cpp
trunk/OpenMPT/mptrack/CommandSet.h
trunk/OpenMPT/mptrack/InputHandler.cpp
trunk/OpenMPT/mptrack/MainFrm.cpp
trunk/OpenMPT/mptrack/Mainfrm.h
trunk/OpenMPT/mptrack/Moddoc.cpp
trunk/OpenMPT/mptrack/Moddoc.h
trunk/OpenMPT/mptrack/dlg_misc.cpp
trunk/OpenMPT/mptrack/dlg_misc.h
trunk/OpenMPT/mptrack/mptrack.rc
trunk/OpenMPT/mptrack/resource.h
trunk/OpenMPT/mptrack/version.h
trunk/OpenMPT/soundlib/Load_it.cpp
trunk/OpenMPT/soundlib/Sndfile.cpp
Modified: trunk/OpenMPT/mptrack/CommandSet.cpp
===================================================================
--- trunk/OpenMPT/mptrack/CommandSet.cpp 2010-09-26 22:16:07 UTC (rev 719)
+++ trunk/OpenMPT/mptrack/CommandSet.cpp 2010-09-26 23:47:33 UTC (rev 720)
@@ -601,6 +601,7 @@
DefineKeyCommand(kcPanic, 1852, kcVisible, kcNoDummy, _T("Panic"));
DefineKeyCommand(kcOrderlistPatIgnore, 1853, kcVisible, kcNoDummy, _T("Ignore (+++) Index"));
DefineKeyCommand(kcOrderlistPatInvalid, 1854, kcVisible, kcNoDummy, _T("Invalid (---) Index"));
+ DefineKeyCommand(kcViewEditHistory, 1855, kcVisible, kcNoDummy, _T("View Edit History"));
// Add new key commands here.
#ifdef _DEBUG
Modified: trunk/OpenMPT/mptrack/CommandSet.h
===================================================================
--- trunk/OpenMPT/mptrack/CommandSet.h 2010-09-26 22:16:07 UTC (rev 719)
+++ trunk/OpenMPT/mptrack/CommandSet.h 2010-09-26 23:47:33 UTC (rev 720)
@@ -114,6 +114,7 @@
kcViewAddPlugin,
kcViewSongProperties,
kcViewMIDImapping,
+ kcViewEditHistory,
kcHelp,
kcEndView=kcHelp,
Modified: trunk/OpenMPT/mptrack/InputHandler.cpp
===================================================================
--- trunk/OpenMPT/mptrack/InputHandler.cpp 2010-09-26 22:16:07 UTC (rev 719)
+++ trunk/OpenMPT/mptrack/InputHandler.cpp 2010-09-26 23:47:33 UTC (rev 720)
@@ -463,7 +463,8 @@
case ID_PLUGIN_SETUP: s="Pl&ugin Manager...\t"; c=kcViewAddPlugin; break;
case ID_CHANNEL_MANAGER: s="Ch&annel Manager...\t"; c=kcViewChannelManager; break;
case ID_VIEW_SONGPROPERTIES:s="Song P&roperties...\t"; c=kcViewSongProperties; break; //rewbs.graph
- case ID_VIEW_MIDIMAPPING: s="&MIDI mapping...\t"; c = kcViewMIDImapping; break;
+ case ID_VIEW_MIDIMAPPING: s="&MIDI Mapping...\t"; c = kcViewMIDImapping; break;
+ case ID_VIEW_EDITHISTORY: s="Edit &History...\t"; c = kcViewEditHistory; break;
/*
case ID_WINDOW_NEW: s="&New Window\t"; c=kcWindowNew; break;
Modified: trunk/OpenMPT/mptrack/MainFrm.cpp
===================================================================
--- trunk/OpenMPT/mptrack/MainFrm.cpp 2010-09-26 22:16:07 UTC (rev 719)
+++ trunk/OpenMPT/mptrack/MainFrm.cpp 2010-09-26 23:47:33 UTC (rev 720)
@@ -2832,6 +2832,7 @@
case kcViewAddPlugin: OnPluginManager(); break;
case kcViewChannelManager: OnChannelManager(); break;
case kcViewMIDImapping: OnViewMIDIMapping(); break;
+ case kcViewEditHistory: OnViewEditHistory(); break;
case kcNextDocument: MDINext(); break;
case kcPrevDocument: MDIPrev(); break;
@@ -3002,7 +3003,7 @@
//----------------------------------
{
CModDoc* pModDoc = GetActiveDoc();
- CSoundFile* pSndFile = (pModDoc) ? pModDoc->GetSoundFile() : 0;
+ CSoundFile* pSndFile = (pModDoc) ? pModDoc->GetSoundFile() : nullptr;
if(!pSndFile) return;
const HWND oldMIDIRecondWnd = GetMidiRecordWnd();
@@ -3012,7 +3013,17 @@
}
+void CMainFrame::OnViewEditHistory()
+//----------------------------------
+{
+ CModDoc* pModDoc = GetActiveDoc();
+ if(pModDoc != nullptr)
+ {
+ pModDoc->OnViewEditHistory();
+ }
+}
+
/////////////////////////////////////////////
//Misc helper functions
/////////////////////////////////////////////
Modified: trunk/OpenMPT/mptrack/Mainfrm.h
===================================================================
--- trunk/OpenMPT/mptrack/Mainfrm.h 2010-09-26 22:16:07 UTC (rev 719)
+++ trunk/OpenMPT/mptrack/Mainfrm.h 2010-09-26 23:47:33 UTC (rev 720)
@@ -692,6 +692,7 @@
afx_msg LRESULT OnSpecialKey(WPARAM, LPARAM);
afx_msg LRESULT OnCustomKeyMsg(WPARAM, LPARAM);
afx_msg void OnViewMIDIMapping();
+ afx_msg void OnViewEditHistory();
//}}AFX_MSG
DECLARE_MESSAGE_MAP()
public:
Modified: trunk/OpenMPT/mptrack/Moddoc.cpp
===================================================================
--- trunk/OpenMPT/mptrack/Moddoc.cpp 2010-09-26 22:16:07 UTC (rev 719)
+++ trunk/OpenMPT/mptrack/Moddoc.cpp 2010-09-26 23:47:33 UTC (rev 720)
@@ -52,6 +52,7 @@
ON_COMMAND(ID_VIEW_INSTRUMENTS, OnEditInstruments)
ON_COMMAND(ID_VIEW_COMMENTS, OnEditComments)
ON_COMMAND(ID_VIEW_GRAPH, OnEditGraph) //rewbs.graph
+ ON_COMMAND(ID_VIEW_EDITHISTORY, OnViewEditHistory)
ON_COMMAND(ID_INSERT_PATTERN, OnInsertPattern)
ON_COMMAND(ID_INSERT_SAMPLE, OnInsertSample)
ON_COMMAND(ID_INSERT_INSTRUMENT, OnInsertInstrument)
@@ -67,6 +68,7 @@
ON_UPDATE_COMMAND_UI(ID_VIEW_COMMENTS, OnUpdateXMITMPTOnly)
ON_UPDATE_COMMAND_UI(ID_VIEW_MIDIMAPPING, OnUpdateHasMIDIMappings)
ON_UPDATE_COMMAND_UI(ID_FILE_SAVEASMP3, OnUpdateMP3Encode)
+ ON_UPDATE_COMMAND_UI(ID_VIEW_EDITHISTORY, OnUpdateITMPTOnly)
//}}AFX_MSG_MAP
END_MESSAGE_MAP()
@@ -107,6 +109,8 @@
m_SplitKeyboardSettings.octaveModifier = 0;
m_SplitKeyboardSettings.octaveLink = false;
+ m_FileHistory.clear();
+
#ifdef _DEBUG
MODCHANNEL *p = m_SndFile.Chn;
if (((DWORD)p) & 7) Log("MODCHANNEL is not aligned (0x%08X)\n", p);
@@ -1986,6 +1990,14 @@
}
+void CModDoc::OnUpdateITMPTOnly(CCmdUI *p)
+//---------------------------------------
+{
+ if (p)
+ p->Enable((m_SndFile.GetType() & (MOD_TYPE_IT|MOD_TYPE_MPT)) ? TRUE : FALSE);
+}
+
+
void CModDoc::OnUpdateMP3Encode(CCmdUI *p)
//----------------------------------------
{
@@ -3419,15 +3431,25 @@
// set playback timer in the status bar
SetElapsedTime(nOrd, nRow, true);
- if (pModPlaying != this) {
+ if (pModPlaying != this)
+ {
pMainFrm->PlayMod(this, followSonghWnd, m_dwNotifyType|MPTNOTIFY_POSITION|MPTNOTIFY_VUMETERS); //rewbs.fix2977
}
}
//SwitchToView();
}
+
+void CModDoc::OnViewEditHistory()
+//-------------------------------
+{
+ CEditHistoryDlg dlg(CMainFrame::GetMainFrame(), this);
+ dlg.DoModal();
+}
+
+
LRESULT CModDoc::OnCustomKeyMsg(WPARAM wParam, LPARAM /*lParam*/)
-//------------------------------------------------------------
+//---------------------------------------------------------------
{
if (wParam == kcNull)
return NULL;
Modified: trunk/OpenMPT/mptrack/Moddoc.h
===================================================================
--- trunk/OpenMPT/mptrack/Moddoc.h 2010-09-26 22:16:07 UTC (rev 719)
+++ trunk/OpenMPT/mptrack/Moddoc.h 2010-09-26 23:47:33 UTC (rev 720)
@@ -124,7 +124,7 @@
// Time the file was open in the editor (in seconds).
// For previous editing sessions, this stores the absolute time in seconds the editor was open.
// For the current editing session, this stores the time when editing was started (using the result of time()).
- // To get the desired value in this case, use time(nullptr) - open_time.
+ // To get the desired value in this case, use difftime(time(nullptr), open_time).
time_t open_time;
};
@@ -385,11 +385,13 @@
afx_msg void OnEstimateSongLength();
afx_msg void OnApproximateBPM();
afx_msg void OnUpdateXMITMPTOnly(CCmdUI *p);
+ afx_msg void OnUpdateITMPTOnly(CCmdUI *p);
afx_msg void OnUpdateHasMIDIMappings(CCmdUI *p);
afx_msg void OnUpdateMP3Encode(CCmdUI *pCmdUI);
afx_msg void OnPatternRestart(); //rewbs.customKeys
afx_msg void OnPatternPlay(); //rewbs.customKeys
afx_msg void OnPatternPlayNoLoop(); //rewbs.customKeys
+ afx_msg void OnViewEditHistory();
//}}AFX_MSG
DECLARE_MESSAGE_MAP()
private:
Modified: trunk/OpenMPT/mptrack/dlg_misc.cpp
===================================================================
--- trunk/OpenMPT/mptrack/dlg_misc.cpp 2010-09-26 22:16:07 UTC (rev 719)
+++ trunk/OpenMPT/mptrack/dlg_misc.cpp 2010-09-26 23:47:33 UTC (rev 720)
@@ -3096,6 +3096,86 @@
CDialog::OnCancel();
}
+
+////////////////////////////////////////////////////////////////////////////////////////////
+// Edit history dialog
+
+BEGIN_MESSAGE_MAP(CEditHistoryDlg, CDialog)
+ ON_COMMAND(IDC_BTN_CLEAR, OnClearHistory)
+END_MESSAGE_MAP()
+
+
+BOOL CEditHistoryDlg::OnInitDialog()
+//----------------------------------
+{
+ CDialog::OnInitDialog();
+
+ if(m_pModDoc == nullptr)
+ return TRUE;
+
+ CString s;
+ time_t total_time = 0;
+ const size_t num = m_pModDoc->GetFileHistory()->size();
+ for(size_t n = 0; n < num; n++)
+ {
+ CString temp;
+ FileHistory *hist = &(m_pModDoc->GetFileHistory()->at(n));
+ time_t duration = hist->open_time;
+ // Current item
+ if(n == num - 1)
+ {
+ duration = difftime(time(nullptr), duration);
+ }
+ total_time += duration;
+ TCHAR szDate[32];
+ _tcsftime(szDate, sizeof(szDate), _T("%d %b %Y, %H:%M:%S"), &hist->load_date);
+
+ temp.Format(_T("Loaded %s, open in the editor for %lluh %02llum %02llus\r\n"),
+ szDate, duration / 3600, (duration / 60) % 60, duration % 60);
+ s += temp;
+ }
+ SetDlgItemText(IDC_EDIT_HISTORY, s);
+
+ s.Format(_T("Total edit time: %lluh %02llum %02llus"), total_time / 3600, (total_time / 60) % 60, total_time % 60);
+ SetDlgItemText(IDC_TOTAL_EDIT_TIME, s);
+
+ s.Format(_T("Edit history for %s"), m_pModDoc->GetTitle());
+ SetWindowText(s);
+
+ GetDlgItem(IDC_BTN_CLEAR)->EnableWindow((m_pModDoc->GetFileHistory()->size() > 1) ? TRUE : FALSE);
+
+ return TRUE;
+
+}
+
+
+void CEditHistoryDlg::OnClearHistory()
+//------------------------------------
+{
+ if(m_pModDoc == nullptr)
+ return;
+
+ if(m_pModDoc->GetFileHistory()->size() > 1)
+ {
+ while(m_pModDoc->GetFileHistory()->size() > 1)
+ {
+ m_pModDoc->GetFileHistory()->erase(m_pModDoc->GetFileHistory()->begin());
+ }
+ m_pModDoc->SetModified();
+ }
+
+ OnInitDialog();
+}
+
+
+void CEditHistoryDlg::OnOK()
+//--------------------------
+{
+ CDialog::OnOK();
+}
+
+
+
///////////////////////////////////////////////////////////////////////////////////////
// Messagebox with 'don't show again'-option.
Modified: trunk/OpenMPT/mptrack/dlg_misc.h
===================================================================
--- trunk/OpenMPT/mptrack/dlg_misc.h 2010-09-26 22:16:07 UTC (rev 719)
+++ trunk/OpenMPT/mptrack/dlg_misc.h 2010-09-26 23:47:33 UTC (rev 720)
@@ -624,6 +624,29 @@
/////////////////////////////////////////////////////////////////////////
+// Edit history dialog
+
+//===================================
+class CEditHistoryDlg: public CDialog
+//===================================
+{
+
+protected:
+ CModDoc *m_pModDoc;
+
+public:
+ CEditHistoryDlg(CWnd *parent, CModDoc *pModDoc) : CDialog(IDD_EDITHISTORY, parent) { m_pModDoc = pModDoc; }
+ UINT ShowLog(LPCSTR pszLog, LPCSTR lpszTitle=NULL);
+
+protected:
+ virtual BOOL OnInitDialog();
+ virtual VOID OnOK();
+ afx_msg void OnClearHistory();
+ DECLARE_MESSAGE_MAP()
+};
+
+
+/////////////////////////////////////////////////////////////////////////
// Messagebox with 'don't show again'-option.
// Enums for message entries. See dlg_misc.cpp for the array of entries.
Modified: trunk/OpenMPT/mptrack/mptrack.rc
===================================================================
--- trunk/OpenMPT/mptrack/mptrack.rc 2010-09-26 22:16:07 UTC (rev 719)
+++ trunk/OpenMPT/mptrack/mptrack.rc 2010-09-26 23:47:33 UTC (rev 720)
@@ -149,6 +149,18 @@
END
+IDD_EDITHISTORY DIALOGEX 0, 0, 316, 185
+STYLE DS_SETFONT | DS_MODALFRAME | DS_FIXEDSYS | WS_POPUP | WS_CAPTION | WS_SYSMENU
+CAPTION "Module edit history"
+FONT 8, "MS Shell Dlg", 400, 0, 0x1
+BEGIN
+ DEFPUSHBUTTON "OK",IDOK,258,162,50,14
+ PUSHBUTTON "Clear",IDC_BTN_CLEAR,6,162,50,14
+ EDITTEXT IDC_EDIT_HISTORY,6,6,300,150,ES_MULTILINE | ES_AUTOHSCROLL | ES_READONLY | WS_VSCROLL
+ LTEXT "",IDC_TOTAL_EDIT_TIME,60,165,192,15
+END
+
+
/////////////////////////////////////////////////////////////////////////////
//
// DESIGNINFO
@@ -204,6 +216,14 @@
TOPMARGIN, 7
BOTTOMMARGIN, 94
END
+
+ IDD_EDITHISTORY, DIALOG
+ BEGIN
+ LEFTMARGIN, 7
+ RIGHTMARGIN, 309
+ TOPMARGIN, 7
+ BOTTOMMARGIN, 178
+ END
END
#endif // APSTUDIO_INVOKED
@@ -1947,7 +1967,8 @@
MENUITEM "Add &Plugin...", ID_PLUGIN_SETUP
MENUITEM "Channel &Manager...", ID_CHANNEL_MANAGER
MENUITEM "Song Properties...", ID_VIEW_SONGPROPERTIES
- MENUITEM "MIDI mapping...", ID_VIEW_MIDIMAPPING
+ MENUITEM "&MIDI Mapping...", ID_VIEW_MIDIMAPPING
+ MENUITEM "Edit &History...", ID_VIEW_EDITHISTORY
END
POPUP "&Window"
BEGIN
@@ -2391,8 +2412,25 @@
STRINGTABLE
BEGIN
ID_PANIC "Kill all VSTi and sample voices\nStop all hanging VSTi and sample voices"
+ ID_VIEW_EDITHISTORY "View the edit history of this module"
END
+STRINGTABLE
+BEGIN
+ ID_VIEW_MIDIMAPPING "Configure the MIDI Mapping"
+END
+
+STRINGTABLE
+BEGIN
+ ID_CHANNEL_MANAGER "Add, remove, mute and manage channels"
+ ID_PLUGIN_SETUP "Register plugins and add them to the current module"
+END
+
+STRINGTABLE
+BEGIN
+ ID_VIEW_SONGPROPERTIES "Edit global song properties or convert the module to another format"
+END
+
#endif // Englisch (USA) resources
/////////////////////////////////////////////////////////////////////////////
Modified: trunk/OpenMPT/mptrack/resource.h
===================================================================
--- trunk/OpenMPT/mptrack/resource.h 2010-09-26 22:16:07 UTC (rev 719)
+++ trunk/OpenMPT/mptrack/resource.h 2010-09-26 23:47:33 UTC (rev 720)
@@ -135,6 +135,7 @@
#define IDD_KEYBOARD_SPLIT 523
#define IDD_SAMPLE_GENERATOR 524
#define IDD_SAMPLE_GENERATOR_PRESETS 525
+#define IDD_EDITHISTORY 526
#define IDC_BUTTON1 1001
#define IDC_BUTTON2 1002
#define IDC_BUTTON3 1003
@@ -953,6 +954,9 @@
#define IDC_CHK_REMEMBERSETTINGS 2427
#define IDC_EDIT_ROWSPERBEAT 2428
#define IDC_EDIT_ROWSPERMEASURE 2429
+#define IDC_BTN_CLEAR 2430
+#define IDC_TOTAL_EDIT_TIME 2431
+#define IDC_EDIT_HISTORY 2432
#define ID_FILE_NEWMOD 32771
#define ID_FILE_NEWXM 32772
#define ID_FILE_NEWS3M 32773
@@ -1211,15 +1215,16 @@
#define ID_ENVELOPE_ZOOM_IN 60449
#define ID_ENVELOPE_ZOOM_OUT 60450
#define ID_PANIC 60451
+#define ID_VIEW_EDITHISTORY 60452
// Next default values for new objects
//
#ifdef APSTUDIO_INVOKED
#ifndef APSTUDIO_READONLY_SYMBOLS
#define _APS_3D_CONTROLS 1
-#define _APS_NEXT_RESOURCE_VALUE 526
-#define _APS_NEXT_COMMAND_VALUE 60452
-#define _APS_NEXT_CONTROL_VALUE 2430
+#define _APS_NEXT_RESOURCE_VALUE 527
+#define _APS_NEXT_COMMAND_VALUE 60453
+#define _APS_NEXT_CONTROL_VALUE 2433
#define _APS_NEXT_SYMED_VALUE 901
#endif
#endif
Modified: trunk/OpenMPT/mptrack/version.h
===================================================================
--- trunk/OpenMPT/mptrack/version.h 2010-09-26 22:16:07 UTC (rev 719)
+++ trunk/OpenMPT/mptrack/version.h 2010-09-26 23:47:33 UTC (rev 720)
@@ -15,7 +15,7 @@
#define VER_MAJORMAJOR 1
#define VER_MAJOR 19
#define VER_MINOR 00
-#define VER_MINORMINOR 04
+#define VER_MINORMINOR 05
//Creates version number from version parts that appears in version string.
//For example MAKE_VERSION_NUMERIC(1,17,02,28) gives version number of
Modified: trunk/OpenMPT/soundlib/Load_it.cpp
===================================================================
--- trunk/OpenMPT/soundlib/Load_it.cpp 2010-09-26 22:16:07 UTC (rev 719)
+++ trunk/OpenMPT/soundlib/Load_it.cpp 2010-09-26 23:47:33 UTC (rev 720)
@@ -686,13 +686,14 @@
it_history.runtime = LittleEndian(it_history.runtime);
FileHistory mpt_history;
+ MemsetZero(mpt_history);
mpt_history.load_date.tm_year = ((it_history.fatdate >> 9) & 0x7F) + 80;
mpt_history.load_date.tm_mon = ((it_history.fatdate >> 5) & 0x0F) - 1;
mpt_history.load_date.tm_mday = it_history.fatdate & 0x1F;
mpt_history.load_date.tm_hour = (it_history.fattime >> 11) & 0x1F;
mpt_history.load_date.tm_min = (it_history.fattime >> 5) & 0x3F;
mpt_history.load_date.tm_sec = (it_history.fattime & 0x1F) * 2;
- mpt_history.open_time = (uint64)((float)(it_history.runtime) / 18.2f);
+ mpt_history.open_time = (time_t)((float)(it_history.runtime) / 18.2f);
GetpModDoc()->GetFileHistory()->push_back(mpt_history);
#ifdef DEBUG
@@ -1187,15 +1188,15 @@
if(n == num - 1)
{
// The current timestamp has to be converted first.
- it_history.runtime = time(nullptr) - mpt_history->open_time;
+ it_history.runtime = difftime(time(nullptr), mpt_history->open_time) * 18;
} else
{
// Previous timestamps are left alone
- it_history.runtime = mpt_history->open_time;
+ it_history.runtime = mpt_history->open_time * 18;
}
it_history.fatdate = LittleEndianW(it_history.fatdate);
it_history.fattime = LittleEndianW(it_history.fattime);
- it_history.runtime = LittleEndian(it_history.runtime * 18);
+ it_history.runtime = LittleEndian(it_history.runtime);
fwrite(&it_history, 1, sizeof(it_history), f);
}
}
@@ -1351,7 +1352,7 @@
if (header.insnum) fwrite(inspos, 4, header.insnum, f);
if (header.smpnum) fwrite(smppos, 4, header.smpnum, f);
if (header.patnum) fwrite(&patpos[0], 4, header.patnum, f);
- // Writing editor history information
+ // Writing edit history information
SaveITEditHistory(this, f);
// Writing midi cfg
if (header.flags & 0x80)
@@ -1964,7 +1965,7 @@
if (header.insnum) fwrite(inspos, 4, header.insnum, f);
if (header.smpnum) fwrite(smppos, 4, header.smpnum, f);
if (header.patnum) fwrite(patpos, 4, header.patnum, f);
- // Writing editor history information
+ // Writing edit history information
SaveITEditHistory(this, f);
// Writing midi cfg
if (header.flags & 0x80)
Modified: trunk/OpenMPT/soundlib/Sndfile.cpp
===================================================================
--- trunk/OpenMPT/soundlib/Sndfile.cpp 2010-09-26 22:16:07 UTC (rev 719)
+++ trunk/OpenMPT/soundlib/Sndfile.cpp 2010-09-26 23:47:33 UTC (rev 720)
@@ -770,6 +770,7 @@
// Set the creation date of this file (or the load time if we're loading an existing file)
{
FileHistory history;
+ MemsetZero(history);
time_t systime;
time(&systime);
localtime_s(&history.load_date, &systime);
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <sag...@us...> - 2010-09-26 22:16:14
|
Revision: 719
http://modplug.svn.sourceforge.net/modplug/?rev=719&view=rev
Author: saga-games
Date: 2010-09-26 22:16:07 +0000 (Sun, 26 Sep 2010)
Log Message:
-----------
[New] Edit history information can now be read from IT files and saved to IT / MPTM files. This is based on an undocumented feature in Impulse Tracker. Note: There's no way to access this data from the tracker yet.
Modified Paths:
--------------
trunk/OpenMPT/mptrack/Moddoc.h
trunk/OpenMPT/soundlib/IT_DEFS.H
trunk/OpenMPT/soundlib/Load_it.cpp
trunk/OpenMPT/soundlib/Sndfile.cpp
Modified: trunk/OpenMPT/mptrack/Moddoc.h
===================================================================
--- trunk/OpenMPT/mptrack/Moddoc.h 2010-09-23 22:50:13 UTC (rev 718)
+++ trunk/OpenMPT/mptrack/Moddoc.h 2010-09-26 22:16:07 UTC (rev 719)
@@ -12,6 +12,7 @@
#include "sndfile.h"
#include "misc_util.h"
#include "Undo.h"
+#include <time.h>
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
@@ -115,6 +116,19 @@
/////////////////////////////////////////////////////////////////////////
+// File edit history
+struct FileHistory
+{
+ // Date when the file was loaded in the the tracker or created.
+ tm load_date;
+ // Time the file was open in the editor (in seconds).
+ // For previous editing sessions, this stores the absolute time in seconds the editor was open.
+ // For the current editing session, this stores the time when editing was started (using the result of time()).
+ // To get the desired value in this case, use time(nullptr) - open_time.
+ time_t open_time;
+};
+
+/////////////////////////////////////////////////////////////////////////
// Split Keyboard Settings (pattern editor)
#define SPLIT_OCTAVE_RANGE 9
@@ -157,6 +171,7 @@
CPatternUndo m_PatternUndo;
CSampleUndo m_SampleUndo;
SplitKeyboardSettings m_SplitKeyboardSettings; // this is maybe not the best place to keep them, but it should do the job
+ vector<FileHistory> m_FileHistory; // File edit history
protected: // create from serialization only
CModDoc();
@@ -215,6 +230,7 @@
CPatternUndo *GetPatternUndo() { return &m_PatternUndo; }
CSampleUndo *GetSampleUndo() { return &m_SampleUndo; }
SplitKeyboardSettings *GetSplitKeyboardSettings() { return &m_SplitKeyboardSettings; }
+ vector<FileHistory> *GetFileHistory() { return &m_FileHistory; }
// operations
public:
Modified: trunk/OpenMPT/soundlib/IT_DEFS.H
===================================================================
--- trunk/OpenMPT/soundlib/IT_DEFS.H 2010-09-23 22:50:13 UTC (rev 718)
+++ trunk/OpenMPT/soundlib/IT_DEFS.H 2010-09-26 22:16:07 UTC (rev 719)
@@ -111,7 +111,7 @@
// IT Sample Format
-typedef struct ITSAMPLESTRUCT
+typedef struct tagITSAMPLESTRUCT
{
DWORD id; // 0x53504D49
CHAR filename[12];
@@ -135,6 +135,15 @@
BYTE vit;
} ITSAMPLESTRUCT;
+
+// IT Header extension: Save history
+typedef struct tagITHISTORYSTRUCT
+{
+ uint16 fatdate; // DOS/FAT date when the file was opened / created in the editor. For details, read http://msdn.microsoft.com/en-us/library/ms724247(VS.85).aspx
+ uint16 fattime; // DOS/FAT time when the file was opened / created in the editor.
+ uint32 runtime; // The time how long the file was open in the editor, in 1/18.2th seconds. (= ticks of the DOS timer)
+} ITHISTORYSTRUCT;
+
#pragma pack()
extern BYTE autovibit2xm[8];
Modified: trunk/OpenMPT/soundlib/Load_it.cpp
===================================================================
--- trunk/OpenMPT/soundlib/Load_it.cpp 2010-09-23 22:50:13 UTC (rev 718)
+++ trunk/OpenMPT/soundlib/Load_it.cpp 2010-09-26 22:16:07 UTC (rev 719)
@@ -668,12 +668,44 @@
dwMemPos += pifh->patnum * 4;
- // Reading IT Extra Info
- if (dwMemPos + 2 < dwMemLength)
+ // Reading IT Edit History Info
+ if (dwMemPos + 2 < dwMemLength && (pifh->special & 0x02))
{
- UINT nflt = *((WORD *)(lpStream + dwMemPos));
+ size_t nflt = LittleEndianW(*((uint16*)(lpStream + dwMemPos)));
dwMemPos += 2;
- if (nflt * 8 < dwMemLength - dwMemPos) dwMemPos += nflt * 8;
+
+ GetpModDoc()->GetFileHistory()->clear();
+ if (nflt * 8 <= dwMemLength - dwMemPos)
+ {
+ for(size_t n = 0; n < nflt; n++)
+ {
+#ifdef MODPLUG_TRACKER
+ ITHISTORYSTRUCT it_history = *((ITHISTORYSTRUCT *)(lpStream + dwMemPos));
+ it_history.fatdate = LittleEndianW(it_history.fatdate);
+ it_history.fattime = LittleEndianW(it_history.fattime);
+ it_history.runtime = LittleEndian(it_history.runtime);
+
+ FileHistory mpt_history;
+ mpt_history.load_date.tm_year = ((it_history.fatdate >> 9) & 0x7F) + 80;
+ mpt_history.load_date.tm_mon = ((it_history.fatdate >> 5) & 0x0F) - 1;
+ mpt_history.load_date.tm_mday = it_history.fatdate & 0x1F;
+ mpt_history.load_date.tm_hour = (it_history.fattime >> 11) & 0x1F;
+ mpt_history.load_date.tm_min = (it_history.fattime >> 5) & 0x3F;
+ mpt_history.load_date.tm_sec = (it_history.fattime & 0x1F) * 2;
+ mpt_history.open_time = (uint64)((float)(it_history.runtime) / 18.2f);
+ GetpModDoc()->GetFileHistory()->push_back(mpt_history);
+
+#ifdef DEBUG
+ const uint32 seconds = (uint32)(((float)it_history.runtime) / 18.2f);
+ CHAR stime[128];
+ wsprintf(stime, "IT Edit History: Loaded %04u-%02u-%02u %02u:%02u:%02u, open in the editor for %u:%02u:%02u (%u ticks)\n", ((it_history.fatdate >> 9) & 0x7F) + 1980, (it_history.fatdate >> 5) & 0x0F, it_history.fatdate & 0x1F, (it_history.fattime >> 11) & 0x1F, (it_history.fattime >> 5) & 0x3F, (it_history.fattime & 0x1F) * 2, seconds / 3600, (seconds / 60) % 60, seconds % 60, it_history.runtime);
+ Log(stime);
+#endif // DEBUG
+
+#endif // MODPLUG_TRACKER
+ dwMemPos += 8;
+ }
+ }
}
// Reading Midi Output & Macros
if (m_dwSongFlags & SONG_EMBEDMIDICFG)
@@ -1034,7 +1066,8 @@
// 193-202: Portamento To
if ((vol >= 193) && (vol <= 202)) { m[ch].volcmd = VOLCMD_TONEPORTAMENTO; m[ch].vol = vol - 193; } else
// 203-212: Vibrato depth
- if ((vol >= 203) && (vol <= 212)) {
+ if ((vol >= 203) && (vol <= 212))
+ {
m[ch].volcmd = VOLCMD_VIBRATODEPTH; m[ch].vol = vol - 203;
// Old versions of ModPlug saved this as vibrato speed instead, so let's fix that
if(m_dwLastSavedWithVersion <= MAKE_VERSION_NUMERIC(1, 17, 02, 54) && interpretModPlugMade)
@@ -1133,12 +1166,45 @@
//end plastiq: code readability improvements
#ifndef MODPLUG_NO_FILESAVE
-//#define SAVEITTIMESTAMP
+
+// Save edit history
+void SaveITEditHistory(const CSoundFile *pSndFile, FILE *f)
+//---------------------------------------------------------
+{
+ const size_t num = pSndFile->GetpModDoc()->GetFileHistory()->size();
+ uint16 fnum = min(num, uint16_max);
+ fnum = LittleEndianW(fnum);
+ fwrite(&fnum, 2, 1, f);
+
+ const size_t start = (num > uint16_max) ? num - uint16_max : 0;
+ for(size_t n = start; n < num; n++)
+ {
+ const FileHistory *mpt_history = &(pSndFile->GetpModDoc()->GetFileHistory()->at(n));
+ ITHISTORYSTRUCT it_history;
+ // Create FAT file dates
+ it_history.fatdate = mpt_history->load_date.tm_mday | ((mpt_history->load_date.tm_mon + 1) << 5) | ((mpt_history->load_date.tm_year - 80) << 9);
+ it_history.fattime = (mpt_history->load_date.tm_sec / 2) | (mpt_history->load_date.tm_min << 5) | (mpt_history->load_date.tm_hour << 11);
+ if(n == num - 1)
+ {
+ // The current timestamp has to be converted first.
+ it_history.runtime = time(nullptr) - mpt_history->open_time;
+ } else
+ {
+ // Previous timestamps are left alone
+ it_history.runtime = mpt_history->open_time;
+ }
+ it_history.fatdate = LittleEndianW(it_history.fatdate);
+ it_history.fattime = LittleEndianW(it_history.fattime);
+ it_history.runtime = LittleEndian(it_history.runtime * 18);
+ fwrite(&it_history, 1, sizeof(it_history), f);
+ }
+}
+
#pragma warning(disable:4100)
bool CSoundFile::SaveIT(LPCSTR lpszFileName, UINT nPacking)
-//-------------------------------------------------------------
+//---------------------------------------------------------
{
DWORD dwPatNamLen, dwChnNamLen;
ITFILEHEADER header;
@@ -1148,7 +1214,7 @@
DWORD inspos[MAX_INSTRUMENTS];
vector<DWORD> patpos;
DWORD smppos[MAX_SAMPLES];
- DWORD dwPos = 0, dwHdrPos = 0, dwExtra = 2;
+ DWORD dwPos = 0, dwHdrPos = 0, dwExtra = 2 + min(GetpModDoc()->GetFileHistory()->size(), uint16_max) * 8;
WORD patinfo[4];
// -> CODE#0006
// -> DESC="misc quantity changes"
@@ -1224,7 +1290,7 @@
}
header.flags = 0x0001;
- header.special = 0x0006;
+ header.special = 0x02 | 0x04; // 0x02: embed file edit history
if (m_nInstruments) header.flags |= 0x04;
if (m_dwSongFlags & SONG_LINEARSLIDES) header.flags |= 0x08;
if (m_dwSongFlags & SONG_ITOLDEFFECTS) header.flags |= 0x10;
@@ -1255,9 +1321,7 @@
}
}
if (dwChnNamLen) dwExtra += dwChnNamLen + 8;
-#ifdef SAVEITTIMESTAMP
- dwExtra += 8; // Time Stamp
-#endif
+
if (m_dwSongFlags & SONG_EMBEDMIDICFG)
{
header.flags |= 0x80;
@@ -1288,23 +1352,7 @@
if (header.smpnum) fwrite(smppos, 4, header.smpnum, f);
if (header.patnum) fwrite(&patpos[0], 4, header.patnum, f);
// Writing editor history information
- {
-#ifdef SAVEITTIMESTAMP
- SYSTEMTIME systime;
- FILETIME filetime;
- WORD timestamp[4];
- WORD nInfoEx = 1;
- memset(timestamp, 0, sizeof(timestamp));
- fwrite(&nInfoEx, 1, 2, f);
- GetSystemTime(&systime);
- SystemTimeToFileTime(&systime, &filetime);
- FileTimeToDosDateTime(&filetime, ×tamp[0], ×tamp[1]);
- fwrite(timestamp, 1, 8, f);
-#else
- WORD nInfoEx = 0;
- fwrite(&nInfoEx, 1, 2, f);
-#endif
- }
+ SaveITEditHistory(this, f);
// Writing midi cfg
if (header.flags & 0x80)
{
@@ -1805,7 +1853,7 @@
DWORD inspos[MAX_INSTRUMENTS];
DWORD patpos[MAX_PATTERNS];
DWORD smppos[MAX_SAMPLES];
- DWORD dwPos = 0, dwHdrPos = 0, dwExtra = 2;
+ DWORD dwPos = 0, dwHdrPos = 0, dwExtra = 2 + min(GetpModDoc()->GetFileHistory()->size(), uint16_max) * 8;
WORD patinfo[4];
// -> CODE#0006
// -> DESC="misc quantity changes"
@@ -1858,7 +1906,7 @@
}
header.flags = 0x0001;
- header.special = 0x0006;
+ header.special = 0x02 | 0x04; // 0x02: embed file edit history
if (m_nInstruments) header.flags |= 0x04;
if (m_dwSongFlags & SONG_LINEARSLIDES) header.flags |= 0x08;
if (m_dwSongFlags & SONG_ITOLDEFFECTS) header.flags |= 0x10;
@@ -1886,10 +1934,7 @@
*/
}
// if (dwChnNamLen) dwExtra += dwChnNamLen + 8;
-/*#ifdef SAVEITTIMESTAMP
- dwExtra += 8; // Time Stamp
-#endif
-*/
+
if (m_dwSongFlags & SONG_EMBEDMIDICFG)
{
header.flags |= 0x80;
@@ -1920,23 +1965,7 @@
if (header.smpnum) fwrite(smppos, 4, header.smpnum, f);
if (header.patnum) fwrite(patpos, 4, header.patnum, f);
// Writing editor history information
- {
-/*#ifdef SAVEITTIMESTAMP
- SYSTEMTIME systime;
- FILETIME filetime;
- WORD timestamp[4];
- WORD nInfoEx = 1;
- memset(timestamp, 0, sizeof(timestamp));
- fwrite(&nInfoEx, 1, 2, f);
- GetSystemTime(&systime);
- SystemTimeToFileTime(&systime, &filetime);
- FileTimeToDosDateTime(&filetime, ×tamp[0], ×tamp[1]);
- fwrite(timestamp, 1, 8, f);
-#else
-*/ WORD nInfoEx = 0;
- fwrite(&nInfoEx, 1, 2, f);
-//#endif
- }
+ SaveITEditHistory(this, f);
// Writing midi cfg
if (header.flags & 0x80)
{
Modified: trunk/OpenMPT/soundlib/Sndfile.cpp
===================================================================
--- trunk/OpenMPT/soundlib/Sndfile.cpp 2010-09-23 22:50:13 UTC (rev 718)
+++ trunk/OpenMPT/soundlib/Sndfile.cpp 2010-09-26 22:16:07 UTC (rev 719)
@@ -562,6 +562,7 @@
memset(m_MixPlugins, 0, sizeof(m_MixPlugins));
memset(&m_SongEQ, 0, sizeof(m_SongEQ));
ResetMidiCfg();
+
//for (UINT npt=0; npt<Patterns.Size(); npt++) Patterns[npt].GetNumRows() = 64;
for (CHANNELINDEX nChn = 0; nChn < MAX_BASECHANNELS; nChn++)
{
@@ -765,6 +766,18 @@
if ((m_nRestartPos >= Order.size()) || (Order[m_nRestartPos] >= Patterns.Size())) m_nRestartPos = 0;
+#ifdef MODPLUG_TRACKER
+ // Set the creation date of this file (or the load time if we're loading an existing file)
+ {
+ FileHistory history;
+ time_t systime;
+ time(&systime);
+ localtime_s(&history.load_date, &systime);
+ history.open_time = systime; // Editing is starting right NOW!
+ pModDoc->GetFileHistory()->push_back(history);
+ }
+#endif // MODPLUG_TRACKER
+
// plugin loader
string sNotFound;
std::list<PLUGINDEX> notFoundIDs;
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <sag...@us...> - 2010-09-23 22:50:19
|
Revision: 718
http://modplug.svn.sourceforge.net/modplug/?rev=718&view=rev
Author: saga-games
Date: 2010-09-23 22:50:13 +0000 (Thu, 23 Sep 2010)
Log Message:
-----------
This experiment wasn't supposed to sneak in... Although it eventually maybe will.
Modified Paths:
--------------
trunk/OpenMPT/soundlib/Load_mod.cpp
Modified: trunk/OpenMPT/soundlib/Load_mod.cpp
===================================================================
--- trunk/OpenMPT/soundlib/Load_mod.cpp 2010-09-23 22:40:09 UTC (rev 717)
+++ trunk/OpenMPT/soundlib/Load_mod.cpp 2010-09-23 22:50:13 UTC (rev 718)
@@ -627,10 +627,8 @@
fwrite(ord, 128, 1, f);
// Writing signature
- if (m_nChannels == 4 && nbp < 64)
+ if (m_nChannels == 4)
lstrcpy((LPSTR)&bTab, "M.K.");
- else if (m_nChannels == 4 && nbp >= 64)
- lstrcpy((LPSTR)&bTab, "M!K!");
else
wsprintf((LPSTR)&bTab, "%luCHN", m_nChannels);
fwrite(bTab, 4, 1, f);
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <sag...@us...> - 2010-09-23 22:40:16
|
Revision: 717
http://modplug.svn.sourceforge.net/modplug/?rev=717&view=rev
Author: saga-games
Date: 2010-09-23 22:40:09 +0000 (Thu, 23 Sep 2010)
Log Message:
-----------
[New] Order list: Two new shortcuts for setting an ignore (+++) / invalid (---) pattern index.
[Mod] Updated DE_jojo.mkb (two new shortcuts for the orderlist, KeyHold for Pattern Duplicate)
Modified Paths:
--------------
trunk/OpenMPT/mptrack/CommandSet.cpp
trunk/OpenMPT/mptrack/CommandSet.h
trunk/OpenMPT/mptrack/Ctrl_seq.cpp
trunk/OpenMPT/packageTemplate/extraKeymaps/DE_jojo.mkb
Modified: trunk/OpenMPT/mptrack/CommandSet.cpp
===================================================================
--- trunk/OpenMPT/mptrack/CommandSet.cpp 2010-09-23 22:37:31 UTC (rev 716)
+++ trunk/OpenMPT/mptrack/CommandSet.cpp 2010-09-23 22:40:09 UTC (rev 717)
@@ -599,6 +599,8 @@
DefineKeyCommand(kcInsNoteMapEditSampleMap, 1850, kcVisible, kcNoDummy, _T("Edit sample map"));
DefineKeyCommand(kcInstrumentCtrlDuplicate, 1851, kcVisible, kcNoDummy, _T("Duplicate instrument"));
DefineKeyCommand(kcPanic, 1852, kcVisible, kcNoDummy, _T("Panic"));
+ DefineKeyCommand(kcOrderlistPatIgnore, 1853, kcVisible, kcNoDummy, _T("Ignore (+++) Index"));
+ DefineKeyCommand(kcOrderlistPatInvalid, 1854, kcVisible, kcNoDummy, _T("Invalid (---) Index"));
// Add new key commands here.
#ifdef _DEBUG
Modified: trunk/OpenMPT/mptrack/CommandSet.h
===================================================================
--- trunk/OpenMPT/mptrack/CommandSet.h 2010-09-23 22:37:31 UTC (rev 716)
+++ trunk/OpenMPT/mptrack/CommandSet.h 2010-09-23 22:40:09 UTC (rev 717)
@@ -1035,7 +1035,9 @@
kcOrderlistPat9,
kcOrderlistPatPlus,
kcOrderlistPatMinus,
- kcEndOrderlistNum=kcOrderlistPatMinus,
+ kcOrderlistPatIgnore,
+ kcOrderlistPatInvalid,
+ kcEndOrderlistNum=kcOrderlistPatInvalid,
kcEndOrderlistCommands=kcEndOrderlistNum,
kcNumCommands,
Modified: trunk/OpenMPT/mptrack/Ctrl_seq.cpp
===================================================================
--- trunk/OpenMPT/mptrack/Ctrl_seq.cpp 2010-09-23 22:37:31 UTC (rev 716)
+++ trunk/OpenMPT/mptrack/Ctrl_seq.cpp 2010-09-23 22:40:09 UTC (rev 717)
@@ -441,6 +441,10 @@
EnterPatternNum(10); return wParam;
case kcOrderlistPatPlus:
EnterPatternNum(11); return wParam;
+ case kcOrderlistPatIgnore:
+ EnterPatternNum(12); return wParam;
+ case kcOrderlistPatInvalid:
+ EnterPatternNum(13); return wParam;
// kCtxViewPatternsNote messages
case kcSwitchToOrderList:
@@ -487,6 +491,16 @@
if ((nCurNdx >= 1000) && (nCurNdx > nMaxNdx)) nCurNdx %= 1000;
if ((nCurNdx >= 100) && (nCurNdx > nMaxNdx)) nCurNdx %= 100;
if ((nCurNdx >= 10) && (nCurNdx > nMaxNdx)) nCurNdx %= 10;
+ } else if (enterNum == 10) // decrease pattern index
+ {
+ const PATTERNINDEX nFirstInvalid = pSndFile->GetModSpecifications().hasIgnoreIndex ? pSndFile->Order.GetIgnoreIndex() : pSndFile->Order.GetInvalidPatIndex();
+ if (nCurNdx == 0)
+ nCurNdx = pSndFile->Order.GetInvalidPatIndex();
+ else
+ {
+ nCurNdx--;
+ if ((nCurNdx > nMaxNdx) && (nCurNdx < nFirstInvalid)) nCurNdx = nMaxNdx;
+ }
} else if (enterNum == 11) // increase pattern index
{
if(nCurNdx >= pSndFile->Order.GetInvalidPatIndex())
@@ -500,16 +514,15 @@
if(nCurNdx > nMaxNdx && nCurNdx < nFirstInvalid)
nCurNdx = nFirstInvalid;
}
- } else if (enterNum == 10) // decrease pattern index
+ } else if (enterNum == 12) // ignore index (+++)
{
- const PATTERNINDEX nFirstInvalid = pSndFile->GetModSpecifications().hasIgnoreIndex ? pSndFile->Order.GetIgnoreIndex() : pSndFile->Order.GetInvalidPatIndex();
- if (nCurNdx == 0)
- nCurNdx = pSndFile->Order.GetInvalidPatIndex();
- else
+ if (pSndFile->GetModSpecifications().hasIgnoreIndex)
{
- nCurNdx--;
- if ((nCurNdx > nMaxNdx) && (nCurNdx < nFirstInvalid)) nCurNdx = nMaxNdx;
+ nCurNdx = pSndFile->Order.GetIgnoreIndex();
}
+ } else if (enterNum == 13) // invalid index (---)
+ {
+ nCurNdx = pSndFile->Order.GetInvalidPatIndex();
}
// apply
if (nCurNdx != pSndFile->Order[m_nScrollPos])
Modified: trunk/OpenMPT/packageTemplate/extraKeymaps/DE_jojo.mkb
===================================================================
--- trunk/OpenMPT/packageTemplate/extraKeymaps/DE_jojo.mkb 2010-09-23 22:37:31 UTC (rev 716)
+++ trunk/OpenMPT/packageTemplate/extraKeymaps/DE_jojo.mkb 2010-09-23 22:40:09 UTC (rev 717)
@@ -84,7 +84,7 @@
2:1002:2:13:5 //Play row: Ctrl+EINGABE (KeyDown|KeyHold)
2:1317:4:18:1 //Set row jump on note entry: Alt (KeyDown)
2:1685:2:9:1 //Switch to order list: Ctrl+TABULATOR (KeyDown)
-2:1806:2:68:1 //Duplicate pattern: Ctrl+D (KeyDown)
+2:1806:2:68:5 //Duplicate pattern: Ctrl+D (KeyDown|KeyHold)
2:1836:2:191:1 //Edit plugin assigned to PC note: Ctrl+# (KeyDown)
2:1662:6:80:1 //Toggle channel's plugin editor: Ctrl+Alt+P (KeyDown)
2:1062:0:93:1 //Show note properties: ANWENDUNG (KeyDown)
@@ -372,3 +372,5 @@
19:1817:0:187:5 //Increase pattern index : + (KeyDown|KeyHold)
19:1818:0:109:1 //Decrease pattern index: - (ZEHNERTASTATUR) (KeyDown)
19:1818:0:189:1 //Decrease pattern index: - (KeyDown)
+19:1853:0:73:1 //Ignore (+++) Index: I (KeyDown)
+19:1854:0:32:1 //Invalid (---) Index: LEER (KeyDown)
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <sag...@us...> - 2010-09-23 22:37:37
|
Revision: 716
http://modplug.svn.sourceforge.net/modplug/?rev=716&view=rev
Author: saga-games
Date: 2010-09-23 22:37:31 +0000 (Thu, 23 Sep 2010)
Log Message:
-----------
[Fix] MOD Loader: The previously introduced heuristic checks for 7-bit panning broke MODs that only had 880 panning commands.
Modified Paths:
--------------
trunk/OpenMPT/soundlib/Load_mod.cpp
Modified: trunk/OpenMPT/soundlib/Load_mod.cpp
===================================================================
--- trunk/OpenMPT/soundlib/Load_mod.cpp 2010-09-23 19:24:56 UTC (rev 715)
+++ trunk/OpenMPT/soundlib/Load_mod.cpp 2010-09-23 22:37:31 UTC (rev 716)
@@ -419,7 +419,7 @@
const CHANNELINDEX nMaxChn = (bFLT8) ? 4 : m_nChannels; // 4 channels per pattern in FLT8 format.
if(bFLT8) nbp++; // as one logical pattern consists of two real patterns in FLT8 format, the highest pattern number has to be increased by one.
bool bHasTempoCommands = false; // for detecting VBlank MODs
- bool bHasExtendedPanning = false; // for detecting 800-8FF panning
+ bool bLeftPanning = false, bExtendedPanning = false; // for detecting 800-880 panning
// Reading patterns
for (PATTERNINDEX ipat = 0; ipat < nbp; ipat++)
@@ -467,8 +467,10 @@
if (m->command == CMD_TEMPO && m->param < 100)
bHasTempoCommands = true;
+ if (m->command == CMD_PANNING8 && m->param < 0x80)
+ bLeftPanning = true;
if (m->command == CMD_PANNING8 && m->param > 0x80 && m->param != 0xA4)
- bHasExtendedPanning = true;
+ bExtendedPanning = true;
if (m->note == NOTE_NONE && m->instr > 0 && !bFLT8)
{
if(lastInstrument[nChn] > 0 && lastInstrument[nChn] != m->instr)
@@ -526,9 +528,10 @@
// modules are checked.
// The same check is also applied to original Ultimate Soundtracker 15 sample mods.
const bool bVBlank = ((bMdKd && bHasTempoCommands && GetSongTime() >= 10 * 60) || m_nSamples == 15) ? true : false;
- if(bVBlank || !bHasExtendedPanning)
+ const bool b7BitPanning = bLeftPanning && !bExtendedPanning;
+ if(bVBlank || b7BitPanning)
{
- Patterns.ForEachModCommand(FixMODPatterns(bVBlank, !bHasExtendedPanning));
+ Patterns.ForEachModCommand(FixMODPatterns(bVBlank, b7BitPanning));
}
#ifdef MODPLUG_TRACKER
@@ -624,8 +627,10 @@
fwrite(ord, 128, 1, f);
// Writing signature
- if (m_nChannels == 4)
+ if (m_nChannels == 4 && nbp < 64)
lstrcpy((LPSTR)&bTab, "M.K.");
+ else if (m_nChannels == 4 && nbp >= 64)
+ lstrcpy((LPSTR)&bTab, "M!K!");
else
wsprintf((LPSTR)&bTab, "%luCHN", m_nChannels);
fwrite(bTab, 4, 1, f);
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <sag...@us...> - 2010-09-23 19:25:02
|
Revision: 715
http://modplug.svn.sourceforge.net/modplug/?rev=715&view=rev
Author: saga-games
Date: 2010-09-23 19:24:56 +0000 (Thu, 23 Sep 2010)
Log Message:
-----------
[Mod] ITP Saver/Loader: Song flags that only concern playback are not dumped into ITP files anymore (f.e. SONG_FIRSTTICK, SONG_STEP, etc.).
[Mod] OpenMPT: Version is now 1.19.00.04
Modified Paths:
--------------
trunk/OpenMPT/mptrack/version.h
trunk/OpenMPT/soundlib/Load_itp.cpp
trunk/OpenMPT/soundlib/Snd_defs.h
Modified: trunk/OpenMPT/mptrack/version.h
===================================================================
--- trunk/OpenMPT/mptrack/version.h 2010-09-23 19:22:15 UTC (rev 714)
+++ trunk/OpenMPT/mptrack/version.h 2010-09-23 19:24:56 UTC (rev 715)
@@ -15,7 +15,7 @@
#define VER_MAJORMAJOR 1
#define VER_MAJOR 19
#define VER_MINOR 00
-#define VER_MINORMINOR 03
+#define VER_MINORMINOR 04
//Creates version number from version parts that appears in version string.
//For example MAKE_VERSION_NUMERIC(1,17,02,28) gives version number of
Modified: trunk/OpenMPT/soundlib/Load_itp.cpp
===================================================================
--- trunk/OpenMPT/soundlib/Load_itp.cpp 2010-09-23 19:22:15 UTC (rev 714)
+++ trunk/OpenMPT/soundlib/Load_itp.cpp 2010-09-23 19:24:56 UTC (rev 715)
@@ -82,7 +82,7 @@
// m_dwSongFlags
memcpy(&id,lpStream+dwMemPos,sizeof(DWORD));
- m_dwSongFlags = id;
+ m_dwSongFlags = (id & SONG_FILE_FLAGS);
dwMemPos += sizeof(DWORD);
if(!(m_dwSongFlags & SONG_ITPROJECT)) return false;
@@ -505,7 +505,7 @@
// Song global config
- id = m_dwSongFlags;
+ id = (m_dwSongFlags & SONG_FILE_FLAGS);
fwrite(&id, 1, sizeof(id), f);
id = m_nDefaultGlobalVolume;
fwrite(&id, 1, sizeof(id), f);
Modified: trunk/OpenMPT/soundlib/Snd_defs.h
===================================================================
--- trunk/OpenMPT/soundlib/Snd_defs.h 2010-09-23 19:22:15 UTC (rev 714)
+++ trunk/OpenMPT/soundlib/Snd_defs.h 2010-09-23 19:24:56 UTC (rev 715)
@@ -316,6 +316,9 @@
#define SONG_POSJUMP 0x100000 // Position jump encountered (internal flag, do not touch)
#define SONG_PT1XMODE 0x200000 // ProTracker 1.x playback mode
+#define SONG_FILE_FLAGS (SONG_EMBEDMIDICFG|SONG_FASTVOLSLIDES|SONG_ITOLDEFFECTS|SONG_ITCOMPATGXX|SONG_LINEARSLIDES|SONG_EXFILTERRANGE|SONG_AMIGALIMITS|SONG_ITPROJECT|SONG_ITPEMBEDIH|SONG_PT1XMODE)
+#define SONG_PLAY_FLAGS (~SONG_FILE_FLAGS)
+
// Global Options (Renderer)
#define SNDMIX_REVERSESTEREO 0x0001 // swap L/R audio channels
#define SNDMIX_NOISEREDUCTION 0x0002 // reduce hiss (do not use, it's just a simple low-pass filter)
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <sag...@us...> - 2010-09-23 19:22:21
|
Revision: 714
http://modplug.svn.sourceforge.net/modplug/?rev=714&view=rev
Author: saga-games
Date: 2010-09-23 19:22:15 +0000 (Thu, 23 Sep 2010)
Log Message:
-----------
[Mod] Updated ID3v1 genre tags
Modified Paths:
--------------
trunk/OpenMPT/mptrack/tagging.h
Modified: trunk/OpenMPT/mptrack/tagging.h
===================================================================
--- trunk/OpenMPT/mptrack/tagging.h 2010-09-23 19:20:16 UTC (rev 713)
+++ trunk/OpenMPT/mptrack/tagging.h 2010-09-23 19:22:15 UTC (rev 714)
@@ -14,43 +14,43 @@
static LPCSTR gpszGenreNames[NUM_GENRES] =
{
- "Blues", "Classic Rock", "Country", "Dance",
- "Disco", "Funk", "Grunge", "Hip Hop",
- "Jazz", "Metal", "New_Age", "Oldies",
- "Other", "Pop", "Rhythm n Blues", "Rap",
- "Reggae", "Rock", "Techno", "Industrial",
- "Alternative", "Ska", "Death Metal", "Pranks",
- "Soundtrack", "Euro Techno", "Ambient", "Trip_Hop",
- "Vocal", "Jazz Funk", "Fusion", "Trance",
- "Classical", "Instrumental", "Acid", "House",
- "Game", "Sound Clip", "Gospel", "Noise",
- "Alternative Rock", "Bass", "Soul", "Punk",
- "Space", "Meditative", "Instrumental Pop", "Instrumental Rock",
- "Ethnic", "Gothic", "Darkwave", "Techno Industrial",
- "Electronic", "Pop Folk", "Eurodance", "Dream",
- "Southern Rock", "Comedy", "Cult", "Gangsta",
- "Top 40", "Christian Rap", "Pop Funk", "Jungle",
- "Native_American", "Cabaret", "New_Wave", "Psychadelic",
- "Rave", "ShowTunes", "Trailer", "Lo Fi",
- "Tribal", "Acid Punk", "Acid Jazz", "Polka",
- "Retro", "Musical", "Rock n Roll", "Hard_Rock",
- "Folk", "Folk Rock", "National Folk", "Swing",
- "Fast Fusion", "Bebob", "Latin", "Revival",
- "Celtic", "Bluegrass", "Avantgarde", "Gothic Rock",
- "Progressive Rock", "Psychedelic Rock", "Symphonic Rock", "Slow Rock",
- "Big Band", "Chorus", "Easy Listening", "Acoustic",
- "Humour", "Speech", "Chanson", "Opera",
- "Chamber Music", "Sonata", "Symphony", "Booty_Bass",
- "Primus", "Porn Groove", "Satire", "Slow Jam",
- "Club", "Tango", "Samba", "Folklore",
- "Ballad", "Power Ballad", "Rhytmic Soul", "Freestyle",
- "Duet", "Punk Rock", "Drum Solo", "Acapella",
- "Euro House", "Dance Hall", "Goa", "Drum n Bass",
- "Club-House", "Hardcore", "Terror", "Indie",
- "BritPop", "Negerpunk", "Polsk Punk", "Beat",
- "Christian Gangsta", "Heavy Metal", "Black Metal", "Crossover",
- "Contemporary Christian","Christian Rock", "Merengue", "Salsa",
- "Thrash Metal", "Anime", "JPop", "SynthPop",
+ "Blues", "Classic Rock", "Country", "Dance",
+ "Disco", "Funk", "Grunge", "Hip-Hop",
+ "Jazz", "Metal", "New Age", "Oldies",
+ "Other", "Pop", "R&B", "Rap",
+ "Reggae", "Rock", "Techno", "Industrial",
+ "Alternative", "Ska", "Death Metal", "Pranks",
+ "Soundtrack", "Euro-Techno", "Ambient", "Trip-Hop",
+ "Vocal", "Jazz+Funk", "Fusion", "Trance",
+ "Classical", "Instrumental", "Acid", "House",
+ "Game", "Sound Clip", "Gospel", "Noise",
+ "Alt. Rock", "Bass", "Soul", "Punk",
+ "Space", "Meditative", "Instrumental Pop", "Instrumental Rock",
+ "Ethnic", "Gothic", "Darkwave", "Techno-Industrial",
+ "Electronic", "Pop-Folk", "Eurodance", "Dream",
+ "Southern Rock", "Comedy", "Cult", "Gangsta",
+ "Top 40", "Christian Rap", "Pop/Funk", "Jungle",
+ "Native American", "Cabaret", "New Wave", "Psychadelic",
+ "Rave", "Showtunes", "Trailer", "Lo-Fi",
+ "Tribal", "Acid Punk", "Acid Jazz", "Polka",
+ "Retro", "Musical", "Rock & Roll", "Hard Rock",
+ "Folk", "Folk-Rock", "National Folk", "Swing",
+ "Fast Fusion", "Bebob", "Latin", "Revival",
+ "Celtic", "Bluegrass", "Avantgarde", "Gothic Rock",
+ "Progressive Rock", "Psychedelic Rock", "Symphonic Rock", "Slow Rock",
+ "Big Band", "Chorus", "Easy Listening", "Acoustic",
+ "Humour", "Speech", "Chanson", "Opera",
+ "Chamber Music", "Sonata", "Symphony", "Booty Bass",
+ "Primus", "Porn Groove", "Satire", "Slow Jam",
+ "Club", "Tango", "Samba", "Folklore",
+ "Ballad", "Power Ballad", "Rhythmic Soul", "Freestyle",
+ "Duet", "Punk Rock", "Drum Solo", "A Capella",
+ "Euro-House", "Dance Hall", "Goa", "Drum & Bass",
+ "Club House", "Hardcore", "Terror", "Indie",
+ "BritPop", "Negerpunk", "Polsk Punk", "Beat",
+ "Christian Gangsta Rap","Heavy Metal", "Black Metal", "Crossover",
+ "Contemporary Christian", "Christian Rock", "Merengue", "Salsa",
+ "Thrash Metal", "Anime", "JPop", "Synthpop"
};
///////////////////////////////////////////////////////////////////////////////////////////////////
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <sag...@us...> - 2010-09-23 19:20:23
|
Revision: 713
http://modplug.svn.sourceforge.net/modplug/?rev=713&view=rev
Author: saga-games
Date: 2010-09-23 19:20:16 +0000 (Thu, 23 Sep 2010)
Log Message:
-----------
[Fix] MOD Loader: Added heuristic detection for MODs with 7-bit panning (which is then converted to 8-bit panning)
[Imp] MOD Loader: Added heuristic detection for PT 1.x playback mode (if there the pattern data looks like it needs on-the-fly sample swapping, PT 1.x is enabled)
Modified Paths:
--------------
trunk/OpenMPT/soundlib/Load_mod.cpp
Modified: trunk/OpenMPT/soundlib/Load_mod.cpp
===================================================================
--- trunk/OpenMPT/soundlib/Load_mod.cpp 2010-09-17 12:35:39 UTC (rev 712)
+++ trunk/OpenMPT/soundlib/Load_mod.cpp 2010-09-23 19:20:16 UTC (rev 713)
@@ -224,15 +224,38 @@
return ((*(DWORD *)s1) == (*(DWORD *)s2)) ? true : false;
}
-// Functor for fixing VBlank MODs
-struct FixVBlankMODs
-//==================
+// Functor for fixing VBlank MODs and MODs with 7-bit panning
+struct FixMODPatterns
+//===================
{
+ FixMODPatterns(bool bVBlank, bool bPanning)
+ {
+ this->bVBlank = bVBlank;
+ this->bPanning = bPanning;
+ }
+
void operator()(MODCOMMAND& m)
{
- if(m.command == CMD_TEMPO)
+ // Fix VBlank MODs
+ if(m.command == CMD_TEMPO && this->bVBlank)
+ {
m.command = CMD_SPEED;
+ }
+ // Fix MODs with 7-bit + surround panning
+ if(m.command == CMD_PANNING8 && this->bPanning)
+ {
+ if(m.param == 0xA4)
+ {
+ m.command = CMD_S3MCMDEX;
+ m.param = 0x91;
+ } else
+ {
+ m.param = min(m.param * 2, 0xFF);
+ }
+ }
}
+
+ bool bVBlank, bPanning;
};
@@ -396,6 +419,7 @@
const CHANNELINDEX nMaxChn = (bFLT8) ? 4 : m_nChannels; // 4 channels per pattern in FLT8 format.
if(bFLT8) nbp++; // as one logical pattern consists of two real patterns in FLT8 format, the highest pattern number has to be increased by one.
bool bHasTempoCommands = false; // for detecting VBlank MODs
+ bool bHasExtendedPanning = false; // for detecting 800-8FF panning
// Reading patterns
for (PATTERNINDEX ipat = 0; ipat < nbp; ipat++)
@@ -419,7 +443,11 @@
m = Patterns[ipat];
}
+ size_t instrWithoutNoteCount = 0; // For detecting PT1x mode
+ vector<MODCOMMAND::INSTR> lastInstrument(m_nChannels, 0);
+
const BYTE *p = lpStream + dwMemPos;
+
for(ROWINDEX nRow = 0; nRow < 64; nRow++)
{
if(bFLT8)
@@ -437,9 +465,28 @@
m->param = A3;
if ((m->command) || (m->param)) ConvertModCommand(m);
- if (m->command == CMD_TEMPO && m->param < 100) bHasTempoCommands = true;
+ if (m->command == CMD_TEMPO && m->param < 100)
+ bHasTempoCommands = true;
+ if (m->command == CMD_PANNING8 && m->param > 0x80 && m->param != 0xA4)
+ bHasExtendedPanning = true;
+ if (m->note == NOTE_NONE && m->instr > 0 && !bFLT8)
+ {
+ if(lastInstrument[nChn] > 0 && lastInstrument[nChn] != m->instr)
+ {
+ instrWithoutNoteCount++;
+ }
+ }
+ if (m->instr != 0)
+ {
+ lastInstrument[nChn] = m->instr;
+ }
}
}
+ // Arbitrary thershold for going into PT1x mode: 16 "sample swaps" in one pattern.
+ if(instrWithoutNoteCount > 16)
+ {
+ m_dwSongFlags |= SONG_PT1XMODE;
+ }
}
dwMemPos += nMaxChn * 256;
}
@@ -478,9 +525,10 @@
// below 100 BPM are taken into account. Furthermore, only M.K. (ProTracker)
// modules are checked.
// The same check is also applied to original Ultimate Soundtracker 15 sample mods.
- if((bMdKd && bHasTempoCommands && GetSongTime() >= 10 * 60) || m_nSamples == 15)
+ const bool bVBlank = ((bMdKd && bHasTempoCommands && GetSongTime() >= 10 * 60) || m_nSamples == 15) ? true : false;
+ if(bVBlank || !bHasExtendedPanning)
{
- Patterns.ForEachModCommand(FixVBlankMODs());
+ Patterns.ForEachModCommand(FixMODPatterns(bVBlank, !bHasExtendedPanning));
}
#ifdef MODPLUG_TRACKER
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <sag...@us...> - 2010-09-17 12:35:45
|
Revision: 712
http://modplug.svn.sourceforge.net/modplug/?rev=712&view=rev
Author: saga-games
Date: 2010-09-17 12:35:39 +0000 (Fri, 17 Sep 2010)
Log Message:
-----------
[Fix] Mod Conversion: Q0x means "no volume change" in S3M/IT, but R0x means "continue volume change" in FT2, and converting from IT/S3M to XM didn't consider this. Q0x is now converted to R8x.
[Fix] Note Properties: The meaning of Q0x was wrong for S3M/IT
Modified Paths:
--------------
trunk/OpenMPT/mptrack/Moddoc.cpp
trunk/OpenMPT/soundlib/modcommand.cpp
Modified: trunk/OpenMPT/mptrack/Moddoc.cpp
===================================================================
--- trunk/OpenMPT/mptrack/Moddoc.cpp 2010-09-13 23:31:58 UTC (rev 711)
+++ trunk/OpenMPT/mptrack/Moddoc.cpp 2010-09-17 12:35:39 UTC (rev 712)
@@ -2620,8 +2620,14 @@
break;
case CMD_RETRIG:
- switch(param >> 4) {
- case 0: strcpy(s, "continue"); break;
+ switch(param >> 4)
+ {
+ case 0:
+ if(m_SndFile.GetType() & MOD_TYPE_XM)
+ strcpy(s, "continue");
+ else
+ strcpy(s, "vol *1");
+ break;
case 1: strcpy(s, "vol -1"); break;
case 2: strcpy(s, "vol -2"); break;
case 3: strcpy(s, "vol -4"); break;
Modified: trunk/OpenMPT/soundlib/modcommand.cpp
===================================================================
--- trunk/OpenMPT/soundlib/modcommand.cpp 2010-09-13 23:31:58 UTC (rev 711)
+++ trunk/OpenMPT/soundlib/modcommand.cpp 2010-09-17 12:35:39 UTC (rev 712)
@@ -274,6 +274,13 @@
// remove fine slides
if((m->param > 0xF0) || ((m->param & 0x0F) == 0x0F && m->param != 0x0F))
m->command = CMD_NONE;
+ case CMD_RETRIG:
+ // Retrig: Q0y doesn't change volume in IT/S3M, but R0y in XM takes the last x parameter
+ if(m->param != 0 && (m->param & 0xF0) == 0)
+ {
+ m->param |= 0x80;
+ }
+ break;
default:
break;
}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <sag...@us...> - 2010-09-13 23:32:04
|
Revision: 711
http://modplug.svn.sourceforge.net/modplug/?rev=711&view=rev
Author: saga-games
Date: 2010-09-13 23:31:58 +0000 (Mon, 13 Sep 2010)
Log Message:
-----------
[Mod] On first install, choose the default ASIO driver instead of DirectSound if there is one.
Modified Paths:
--------------
trunk/OpenMPT/mptrack/MainFrm.cpp
Modified: trunk/OpenMPT/mptrack/MainFrm.cpp
===================================================================
--- trunk/OpenMPT/mptrack/MainFrm.cpp 2010-09-13 17:21:44 UTC (rev 710)
+++ trunk/OpenMPT/mptrack/MainFrm.cpp 2010-09-13 23:31:58 UTC (rev 711)
@@ -411,7 +411,8 @@
rgbCustomColors[ncol] = GetPrivateProfileDWord("Display", s, rgbCustomColors[ncol], iniFile);
}
- m_nWaveDevice = GetPrivateProfileLong("Sound Settings", "WaveDevice", (SNDDEV_DSOUND<<8), iniFile);
+ LONG defaultDevice = EnumerateSoundDevices(SNDDEV_ASIO, 0, nullptr, 0) ? SNDDEV_ASIO : SNDDEV_DSOUND;
+ m_nWaveDevice = GetPrivateProfileLong("Sound Settings", "WaveDevice", (defaultDevice << 8), 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);
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <sag...@us...> - 2010-09-13 17:21:50
|
Revision: 710
http://modplug.svn.sourceforge.net/modplug/?rev=710&view=rev
Author: saga-games
Date: 2010-09-13 17:21:44 +0000 (Mon, 13 Sep 2010)
Log Message:
-----------
[Fix] Sample Editor: When cutting samples with a loop, the loop end point was not always moved correctly if the cut part started in the loop.
Modified Paths:
--------------
trunk/OpenMPT/mptrack/View_smp.cpp
Modified: trunk/OpenMPT/mptrack/View_smp.cpp
===================================================================
--- trunk/OpenMPT/mptrack/View_smp.cpp 2010-09-13 15:53:16 UTC (rev 709)
+++ trunk/OpenMPT/mptrack/View_smp.cpp 2010-09-13 17:21:44 UTC (rev 710)
@@ -1743,12 +1743,12 @@
pSmp->nLoopStart = m_dwBeginSel;
pSmp->nLoopEnd -= m_dwEndSel - m_dwBeginSel;
}
- else if(m_dwBeginSel > pSmp->nLoopStart && m_dwEndSel < pSmp->nLoopEnd)
+ else if(m_dwBeginSel >= pSmp->nLoopStart && m_dwEndSel < pSmp->nLoopEnd)
{
// cut part is in the loop
pSmp->nLoopEnd -= m_dwEndSel - m_dwBeginSel;
}
- else if(m_dwBeginSel > pSmp->nLoopStart && m_dwBeginSel < pSmp->nLoopEnd && m_dwEndSel > pSmp->nLoopEnd)
+ else if(m_dwBeginSel >= pSmp->nLoopStart && m_dwBeginSel < pSmp->nLoopEnd && m_dwEndSel > pSmp->nLoopEnd)
{
// cut part is partly before loop end
pSmp->nLoopEnd = m_dwBeginSel;
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <sag...@us...> - 2010-09-13 15:53:22
|
Revision: 709
http://modplug.svn.sourceforge.net/modplug/?rev=709&view=rev
Author: saga-games
Date: 2010-09-13 15:53:16 +0000 (Mon, 13 Sep 2010)
Log Message:
-----------
[Fix] Instrument editor: Changing the filter mode didn't set the file as modified.
[Fix] (Just a theoretical fix at the moment, since OpenMPT just runs on little-endian hosts anyway): When converting ints to synchsafe ints, the input variable must match the host's endianness.
Modified Paths:
--------------
trunk/OpenMPT/mptrack/Ctrl_ins.cpp
trunk/OpenMPT/mptrack/tagging.cpp
Modified: trunk/OpenMPT/mptrack/Ctrl_ins.cpp
===================================================================
--- trunk/OpenMPT/mptrack/Ctrl_ins.cpp 2010-09-12 19:55:14 UTC (rev 708)
+++ trunk/OpenMPT/mptrack/Ctrl_ins.cpp 2010-09-13 15:53:16 UTC (rev 709)
@@ -2311,16 +2311,17 @@
if ((!IsLocked()) && (pIns))
{
int instFiltermode = m_CbnFilterMode.GetItemData(m_CbnFilterMode.GetCurSel());
- if (!m_pModDoc) {
+ if (!m_pModDoc)
return;
- }
CSoundFile *pSndFile = m_pModDoc->GetSoundFile();
MODINSTRUMENT *pIns = pSndFile->Instruments[m_nInstrument];
- if (pIns) {
+ if (pIns)
+ {
pIns->nFilterMode = instFiltermode;
+ m_pModDoc->SetModified();
// Translate from mode as stored in instrument to mode as understood by player.
// (The reason for the translation is that the player treats 0 as lowpass,
@@ -2334,11 +2335,12 @@
}*/
//Update channel settings where this instrument is active, if required.
- if (instFiltermode != FLTMODE_UNCHANGED) {
- for (UINT i=0; i<MAX_CHANNELS; i++) {
- if (pSndFile->Chn[i].pModInstrument == pIns) {
+ if(instFiltermode != FLTMODE_UNCHANGED)
+ {
+ for (CHANNELINDEX i = 0; i < MAX_CHANNELS; i++)
+ {
+ if (pSndFile->Chn[i].pModInstrument == pIns)
pSndFile->Chn[i].nFilterMode = instFiltermode;
- }
}
}
Modified: trunk/OpenMPT/mptrack/tagging.cpp
===================================================================
--- trunk/OpenMPT/mptrack/tagging.cpp 2010-09-12 19:55:14 UTC (rev 708)
+++ trunk/OpenMPT/mptrack/tagging.cpp 2010-09-13 15:53:16 UTC (rev 709)
@@ -27,9 +27,9 @@
uint32 CFileTagging::intToSynchsafe(uint32 iIn)
//---------------------------------------------
{
- iIn = LittleEndian(iIn);
uint32 iOut = 0, iSteps = 0;
- do {
+ do
+ {
iOut |= (iIn & 0x7F) << iSteps;
iSteps += 8;
} while(iIn >>= 7);
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <sag...@us...> - 2010-09-12 19:55:20
|
Revision: 708
http://modplug.svn.sourceforge.net/modplug/?rev=708&view=rev
Author: saga-games
Date: 2010-09-12 19:55:14 +0000 (Sun, 12 Sep 2010)
Log Message:
-----------
[Imp] Made tagging functions a bit more stable (apparently nothing was broken, but let's better be safe than sorry)
Modified Paths:
--------------
trunk/OpenMPT/mptrack/tagging.cpp
trunk/OpenMPT/mptrack/tagging.h
Modified: trunk/OpenMPT/mptrack/tagging.cpp
===================================================================
--- trunk/OpenMPT/mptrack/tagging.cpp 2010-09-11 15:42:24 UTC (rev 707)
+++ trunk/OpenMPT/mptrack/tagging.cpp 2010-09-12 19:55:14 UTC (rev 708)
@@ -86,15 +86,15 @@
void CFileTagging::WriteID3v2Frame(char cFrameID[4], string sFramecontent, FILE *f)
//---------------------------------------------------------------------------------
{
- if(!strcmp(cFrameID, "") || sFramecontent.empty() || !f) return;
+ if(!cFrameID[0] || sFramecontent.empty() || !f) return;
- if(!strcmp(cFrameID, "COMM"))
+ if(!memcmp(cFrameID, "COMM", 4))
{
// English language for comments - no description following (hence the text ending nullchar(s))
// For language IDs, see http://en.wikipedia.org/wiki/ISO-639-2
sFramecontent = "eng" + (ID3v2_TEXTENDING + sFramecontent);
}
- if(!strcmp(cFrameID, "WXXX"))
+ if(!memcmp(cFrameID, "WXXX", 4))
{
// User-defined URL field (we have no description for the URL, so we leave it out)
sFramecontent = ID3v2_TEXTENDING + sFramecontent;
Modified: trunk/OpenMPT/mptrack/tagging.h
===================================================================
--- trunk/OpenMPT/mptrack/tagging.h 2010-09-11 15:42:24 UTC (rev 707)
+++ trunk/OpenMPT/mptrack/tagging.h 2010-09-12 19:55:14 UTC (rev 708)
@@ -78,8 +78,8 @@
// charset... choose text ending accordingly.
// $00 = ISO-8859-1. Terminated with $00.
-// $01 = UTF-16. Terminated with $00 00.
-// $02 = UTF-16BE. Terminated with $00 00.
+// $01 = UTF-16 with BOM. Terminated with $00 00.
+// $02 = UTF-16BE without BOM. Terminated with $00 00.
// $03 = UTF-8. Terminated with $00.
#ifdef UNICODE
#define ID3v2_CHARSET '\3'
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <sag...@us...> - 2010-09-11 15:42:31
|
Revision: 707
http://modplug.svn.sourceforge.net/modplug/?rev=707&view=rev
Author: saga-games
Date: 2010-09-11 15:42:24 +0000 (Sat, 11 Sep 2010)
Log Message:
-----------
[Fix] MP3 Export / Tagging: The comments field was not formatted properly in the file.
Modified Paths:
--------------
trunk/OpenMPT/mptrack/tagging.cpp
Modified: trunk/OpenMPT/mptrack/tagging.cpp
===================================================================
--- trunk/OpenMPT/mptrack/tagging.cpp 2010-09-08 23:53:11 UTC (rev 706)
+++ trunk/OpenMPT/mptrack/tagging.cpp 2010-09-11 15:42:24 UTC (rev 707)
@@ -94,6 +94,11 @@
// For language IDs, see http://en.wikipedia.org/wiki/ISO-639-2
sFramecontent = "eng" + (ID3v2_TEXTENDING + sFramecontent);
}
+ if(!strcmp(cFrameID, "WXXX"))
+ {
+ // User-defined URL field (we have no description for the URL, so we leave it out)
+ sFramecontent = ID3v2_TEXTENDING + sFramecontent;
+ }
sFramecontent = ID3v2_CHARSET + sFramecontent;
TAGID3v2FRAME tFrame;
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <sag...@us...> - 2010-09-08 23:53:18
|
Revision: 706
http://modplug.svn.sourceforge.net/modplug/?rev=706&view=rev
Author: saga-games
Date: 2010-09-08 23:53:11 +0000 (Wed, 08 Sep 2010)
Log Message:
-----------
[Ref] Rewrote some of the mod cleanup code.
Modified Paths:
--------------
trunk/OpenMPT/mptrack/CleanupSong.cpp
Modified: trunk/OpenMPT/mptrack/CleanupSong.cpp
===================================================================
--- trunk/OpenMPT/mptrack/CleanupSong.cpp 2010-09-08 23:51:45 UTC (rev 705)
+++ trunk/OpenMPT/mptrack/CleanupSong.cpp 2010-09-08 23:53:11 UTC (rev 706)
@@ -667,18 +667,21 @@
return false;
SAMPLEINDEX nRemap = 0; // remap count
- SAMPLEINDEX nSampleMap[MAX_SAMPLES + 1]; // map old => new
- for(SAMPLEINDEX i = 0; i <= MAX_SAMPLES; i++)
+ std::vector<SAMPLEINDEX> nSampleMap(pSndFile->GetNumSamples() + 1);
+ for(SAMPLEINDEX i = 0; i <= pSndFile->GetNumSamples(); i++)
+ {
nSampleMap[i] = i;
+ }
// First, find out which sample slots are unused and create the new sample map
- for(SAMPLEINDEX i = 1 ; i <= pSndFile->m_nSamples; i++) {
+ for(SAMPLEINDEX i = 1; i <= pSndFile->GetNumSamples(); i++)
+ {
if(!pSndFile->Samples[i].pSample)
{
// Move all following samples
nRemap++;
nSampleMap[i] = 0;
- for(UINT j = i + 1; j <= pSndFile->m_nSamples; j++)
+ for(UINT j = i + 1; j <= pSndFile->GetNumSamples(); j++)
nSampleMap[j]--;
}
}
@@ -687,7 +690,7 @@
return false;
// Now, move everything around
- for(SAMPLEINDEX i = 1; i <= pSndFile->m_nSamples; i++)
+ for(SAMPLEINDEX i = 1; i <= pSndFile->GetNumSamples(); i++)
{
if(nSampleMap[i] != i)
{
@@ -700,12 +703,12 @@
memset(pSndFile->m_szNames[i], 0, sizeof(pSndFile->m_szNames[i]));
// Also update instrument mapping (if module is in instrument mode)
- for(INSTRUMENTINDEX nIns = 1; nIns <= pSndFile->m_nInstruments; nIns++)
+ for(INSTRUMENTINDEX nIns = 1; nIns <= pSndFile->GetNumInstruments(); nIns++)
{
MODINSTRUMENT *pIns = pSndFile->Instruments[nIns];
if(pIns)
{
- for(WORD iNote = 0; iNote < 128; iNote++)
+ for(size_t iNote = 0; iNote < 128; iNote++)
if(pIns->Keyboard[iNote] == i) pIns->Keyboard[iNote] = nSampleMap[i];
}
}
@@ -713,14 +716,14 @@
}
// Go through the patterns and remap samples (if module is in sample mode)
- if(!pSndFile->m_nInstruments)
+ if(!pSndFile->GetNumInstruments())
{
for (PATTERNINDEX nPat = 0; nPat < pSndFile->Patterns.Size(); nPat++) if (pSndFile->Patterns[nPat])
{
MODCOMMAND *m = pSndFile->Patterns[nPat];
for(UINT len = pSndFile->Patterns[nPat].GetNumRows() * pSndFile->GetNumChannels(); len; m++, len--)
{
- if(m->instr <= pSndFile->m_nSamples) m->instr = (BYTE)nSampleMap[m->instr];
+ if(m->instr <= pSndFile->GetNumSamples()) m->instr = (BYTE)nSampleMap[m->instr];
}
}
}
@@ -866,7 +869,8 @@
//Is the plugin assigned to a channel?
for (CHANNELINDEX nChn = 0; nChn < pSndFile->GetNumChannels(); nChn++)
{
- if (pSndFile->ChnSettings[nChn].nMixPlugin == nPlug + 1u) {
+ if (pSndFile->ChnSettings[nChn].nMixPlugin == nPlug + 1)
+ {
usedmap[nPlug] = true;
break;
}
@@ -875,7 +879,7 @@
//Is the plugin used by an instrument?
for (INSTRUMENTINDEX nIns=1; nIns<=pSndFile->GetNumInstruments(); nIns++)
{
- if (pSndFile->Instruments[nIns] && (pSndFile->Instruments[nIns]->nMixPlug == nPlug+1))
+ if (pSndFile->Instruments[nIns] && (pSndFile->Instruments[nIns]->nMixPlug == nPlug + 1))
{
usedmap[nPlug] = true;
break;
@@ -887,7 +891,7 @@
usedmap[nPlug] = true;
//all outputs of used plugins count as used
- if (usedmap[nPlug]!=0)
+ if (usedmap[nPlug] != false)
{
if (pSndFile->m_MixPlugins[nPlug].Info.dwOutputRouting & 0x80)
{
@@ -936,7 +940,7 @@
pSndFile->m_nRestartPos = 0;
// reset instruments (if there are any)
- for(INSTRUMENTINDEX i = 1; i <= pSndFile->m_nInstruments; i++) if(pSndFile->Instruments[i])
+ for(INSTRUMENTINDEX i = 1; i <= pSndFile->GetNumInstruments(); i++) if(pSndFile->Instruments[i])
{
pSndFile->Instruments[i]->nFadeOut = 256;
pSndFile->Instruments[i]->nGlobalVol = 64;
@@ -1057,7 +1061,8 @@
bool CModCleanupDlg::RemoveAllPlugins()
//-------------------------------------
{
- bool keepMask[MAX_MIXPLUGINS]; memset(keepMask, false, sizeof(keepMask));
+ bool keepMask[MAX_MIXPLUGINS];
+ memset(keepMask, false, sizeof(keepMask));
m_pModDoc->RemovePlugs(keepMask);
return true;
}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <sag...@us...> - 2010-09-08 23:51:52
|
Revision: 705
http://modplug.svn.sourceforge.net/modplug/?rev=705&view=rev
Author: saga-games
Date: 2010-09-08 23:51:45 +0000 (Wed, 08 Sep 2010)
Log Message:
-----------
[Ref] Rewrote the mod convert warning code a bit.
Modified Paths:
--------------
trunk/OpenMPT/mptrack/ModConvert.cpp
trunk/OpenMPT/mptrack/ModConvert.h
trunk/OpenMPT/mptrack/Moddoc.h
Modified: trunk/OpenMPT/mptrack/ModConvert.cpp
===================================================================
--- trunk/OpenMPT/mptrack/ModConvert.cpp 2010-09-08 23:45:46 UTC (rev 704)
+++ trunk/OpenMPT/mptrack/ModConvert.cpp 2010-09-08 23:51:45 UTC (rev 705)
@@ -13,7 +13,7 @@
* - Long instrument envelopes
* - Envelope release node (this was previously also usable in the IT format, but is now deprecated in that format)
*
- * Extended features in IT/XM/S3M/MOD(not all listed below are available in all of those formats):
+ * Extended features in IT/XM/S3M/MOD (not all listed below are available in all of those formats):
* - Plugins
* - Extended ranges for
* - Sample count
@@ -42,14 +42,43 @@
#include "ModConvert.h"
-#define CHANGEMODTYPE_WARNING(x) nWarnings |= (1 << x);
-#define CHANGEMODTYPE_CHECK(x, s) if((nWarnings & (1 << x)) != 0) AddToLog(_T(s));
+#define CHANGEMODTYPE_WARNING(x) warnings.set(x);
+#define CHANGEMODTYPE_CHECK(x, s) if(warnings[x]) AddToLog(_T(s));
+// Trim envelopes and remove release nodes.
+void UpdateEnvelopes(INSTRUMENTENVELOPE *mptEnv, CSoundFile *pSndFile, std::bitset<wNumWarnings> &warnings)
+//---------------------------------------------------------------------------------------------------------
+{
+ // shorten instrument envelope if necessary (for mod conversion)
+ const UINT iEnvMax = pSndFile->GetModSpecifications().envelopePointsMax;
+
+ #define TRIMENV(nPat) if(nPat > iEnvMax) { nPat = iEnvMax; CHANGEMODTYPE_WARNING(wTrimmedEnvelopes); }
+
+ TRIMENV(mptEnv->nNodes);
+ TRIMENV(mptEnv->nLoopStart);
+ TRIMENV(mptEnv->nLoopEnd);
+ TRIMENV(mptEnv->nSustainStart);
+ TRIMENV(mptEnv->nSustainEnd);
+ if(mptEnv->nReleaseNode != ENV_RELEASE_NODE_UNSET)
+ {
+ TRIMENV(mptEnv->nReleaseNode);
+ if(!pSndFile->GetModSpecifications().hasReleaseNode)
+ {
+ mptEnv->nReleaseNode = ENV_RELEASE_NODE_UNSET;
+ CHANGEMODTYPE_WARNING(wReleaseNode);
+ }
+ }
+
+ #undef TRIMENV
+}
+
+
bool CModDoc::ChangeModType(MODTYPE nNewType)
//-------------------------------------------
{
- uint64 nWarnings = 0;
+ std::bitset<wNumWarnings> warnings;
+ warnings.reset();
PATTERNINDEX nResizedPatterns = 0;
const MODTYPE nOldType = m_SndFile.GetType();
@@ -402,9 +431,9 @@
for(INSTRUMENTINDEX i = 1; i <= m_SndFile.m_nInstruments; i++) if(m_SndFile.Instruments[i] != nullptr)
{
- UpdateEnvelopes(&(m_SndFile.Instruments[i]->VolEnv), nWarnings);
- UpdateEnvelopes(&(m_SndFile.Instruments[i]->PanEnv), nWarnings);
- UpdateEnvelopes(&(m_SndFile.Instruments[i]->PitchEnv), nWarnings);
+ UpdateEnvelopes(&(m_SndFile.Instruments[i]->VolEnv), &m_SndFile, warnings);
+ UpdateEnvelopes(&(m_SndFile.Instruments[i]->PanEnv), &m_SndFile, warnings);
+ UpdateEnvelopes(&(m_SndFile.Instruments[i]->PitchEnv), &m_SndFile, warnings);
}
CHAR s[64];
@@ -419,7 +448,7 @@
CHANGEMODTYPE_CHECK(wInstrumentSustainLoops, "Sustain loops were converted to sustain points.\n");
CHANGEMODTYPE_CHECK(wInstrumentTuning, "Instrument tunings will be lost.\n");
CHANGEMODTYPE_CHECK(wMODGlobalVars, "Default speed, tempo and global volume will be lost.\n");
- CHANGEMODTYPE_CHECK(wMOD31Samples, "Samples above 31 will be lost when saving as MOD.\n");
+ CHANGEMODTYPE_CHECK(wMOD31Samples, "Samples above 31 will be lost when saving as MOD. Consider rearranging samples if there are unused slots available.\n");
CHANGEMODTYPE_CHECK(wRestartPos, "Restart position is not supported by the new format.\n");
CHANGEMODTYPE_CHECK(wChannelVolSurround, "Channel volume and surround are not supported by the new format.\n");
CHANGEMODTYPE_CHECK(wChannelPanning, "Channel panning is not supported by the new format.\n");
@@ -445,33 +474,6 @@
return true;
}
-// Trim envelopes and remove release nodes.
-void CModDoc::UpdateEnvelopes(INSTRUMENTENVELOPE *mptEnv, uint64 &nWarnings)
-//--------------------------------------------------------------------------
-{
- // shorten instrument envelope if necessary (for mod conversion)
- const UINT iEnvMax = m_SndFile.GetModSpecifications().envelopePointsMax;
- #define TRIMENV(nPat) if(nPat > iEnvMax) { nPat = iEnvMax; CHANGEMODTYPE_WARNING(wTrimmedEnvelopes); }
-
- TRIMENV(mptEnv->nNodes);
- TRIMENV(mptEnv->nLoopStart);
- TRIMENV(mptEnv->nLoopEnd);
- TRIMENV(mptEnv->nSustainStart);
- TRIMENV(mptEnv->nSustainEnd);
- if(mptEnv->nReleaseNode != ENV_RELEASE_NODE_UNSET)
- {
- TRIMENV(mptEnv->nReleaseNode);
- if(!m_SndFile.GetModSpecifications().hasReleaseNode)
- {
- mptEnv->nReleaseNode = ENV_RELEASE_NODE_UNSET;
- CHANGEMODTYPE_WARNING(wReleaseNode);
- }
- }
-
- #undef TRIMENV
-}
-
-
#undef CHANGEMODTYPE_WARNING
#undef CHANGEMODTYPE_CHECK
Modified: trunk/OpenMPT/mptrack/ModConvert.h
===================================================================
--- trunk/OpenMPT/mptrack/ModConvert.h 2010-09-08 23:45:46 UTC (rev 704)
+++ trunk/OpenMPT/mptrack/ModConvert.h 2010-09-08 23:51:45 UTC (rev 705)
@@ -7,6 +7,9 @@
*
*/
+#ifndef MODCONVERT_H
+#define MODCONVERT_H
+#pragma once
// Warning types
enum enmWarnings
@@ -29,4 +32,7 @@
wLinearSlides,
wTrimmedEnvelopes,
wReleaseNode,
+ wNumWarnings
};
+
+#endif // MODCONVERT_H
Modified: trunk/OpenMPT/mptrack/Moddoc.h
===================================================================
--- trunk/OpenMPT/mptrack/Moddoc.h 2010-09-08 23:45:46 UTC (rev 704)
+++ trunk/OpenMPT/mptrack/Moddoc.h 2010-09-08 23:51:45 UTC (rev 705)
@@ -123,7 +123,7 @@
struct SplitKeyboardSettings
//==========================
{
- bool IsSplitActive() {return (octaveLink && (octaveModifier != 0)) || (splitInstrument > 0) || (splitVolume != 0);}
+ bool IsSplitActive() const { return (octaveLink && (octaveModifier != 0)) || (splitInstrument > 0) || (splitVolume != 0); }
MODCOMMAND::NOTE splitNote;
MODCOMMAND::INSTR splitInstrument;
MODCOMMAND::VOL splitVolume;
@@ -168,7 +168,7 @@
CSoundFile *GetSoundFile() { return &m_SndFile; }
void SetPause(BOOL bPause) { m_bPaused = bPause; }
void SetModified(BOOL bModified=TRUE) { SetModifiedFlag(bModified); bModifiedAutosave = (bModified != FALSE); }
- BOOL ModifiedSinceLastAutosave() { bool bRetval = bModifiedAutosave; bModifiedAutosave = false; return bRetval; } // return "IsModified" value and reset it until the next SetModified() (as this is only used for polling)
+ bool ModifiedSinceLastAutosave() { bool bRetval = bModifiedAutosave; bModifiedAutosave = false; return bRetval; } // return "IsModified" value and reset it until the next SetModified() (as this is only used for polling)
void SetShowSaveDialog(bool b) {m_ShowSavedialog = b;}
void PostMessageToAllViews(UINT uMsg, WPARAM wParam=0, LPARAM lParam=0);
void SendMessageToActiveViews(UINT uMsg, WPARAM wParam=0, LPARAM lParam=0);
@@ -335,10 +335,7 @@
virtual void SetModifiedFlag(BOOL bModified=TRUE);
//}}AFX_VIRTUAL
- // for mod conversion
- void UpdateEnvelopes(INSTRUMENTENVELOPE *mptEnv, uint64 &nWarnings);
-
// Implementation
public:
virtual ~CModDoc();
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <sag...@us...> - 2010-09-08 23:45:53
|
Revision: 704
http://modplug.svn.sourceforge.net/modplug/?rev=704&view=rev
Author: saga-games
Date: 2010-09-08 23:45:46 +0000 (Wed, 08 Sep 2010)
Log Message:
-----------
[Fix] MTM Loader: As MTM files were converted to MOD automatically, channel panning was lost. Now they're converted to S3M instead.
Modified Paths:
--------------
trunk/OpenMPT/mptrack/Moddoc.cpp
trunk/OpenMPT/soundlib/Load_mtm.cpp
trunk/OpenMPT/soundlib/Sndfile.cpp
Modified: trunk/OpenMPT/mptrack/Moddoc.cpp
===================================================================
--- trunk/OpenMPT/mptrack/Moddoc.cpp 2010-09-07 17:45:33 UTC (rev 703)
+++ trunk/OpenMPT/mptrack/Moddoc.cpp 2010-09-08 23:45:46 UTC (rev 704)
@@ -342,7 +342,6 @@
bModified = FALSE;
break;
case MOD_TYPE_AMF0:
- case MOD_TYPE_MTM:
case MOD_TYPE_669:
m_SndFile.ChangeModTypeTo(MOD_TYPE_MOD);
break;
@@ -362,6 +361,7 @@
case MOD_TYPE_STM:
case MOD_TYPE_DSM:
case MOD_TYPE_AMF:
+ case MOD_TYPE_MTM:
m_SndFile.ChangeModTypeTo(MOD_TYPE_S3M);
break;
case MOD_TYPE_IMF:
Modified: trunk/OpenMPT/soundlib/Load_mtm.cpp
===================================================================
--- trunk/OpenMPT/soundlib/Load_mtm.cpp 2010-09-07 17:45:33 UTC (rev 703)
+++ trunk/OpenMPT/soundlib/Load_mtm.cpp 2010-09-08 23:45:46 UTC (rev 704)
@@ -94,6 +94,7 @@
Samples[i].nLoopEnd >>= 1;
}
Samples[i].nPan = 128;
+ Samples[i].nC5Speed = TransposeToFrequency(0, Samples[i].nFineTune);
}
dwMemPos += 37;
}
@@ -130,7 +131,11 @@
}
m->command = cmd;
m->param = param;
- if ((cmd) || (param)) ConvertModCommand(m);
+ if ((cmd) || (param))
+ {
+ ConvertModCommand(m);
+ ConvertCommand(m, MOD_TYPE_MOD, MOD_TYPE_S3M);
+ }
}
}
pSeq += 32;
Modified: trunk/OpenMPT/soundlib/Sndfile.cpp
===================================================================
--- trunk/OpenMPT/soundlib/Sndfile.cpp 2010-09-07 17:45:33 UTC (rev 703)
+++ trunk/OpenMPT/soundlib/Sndfile.cpp 2010-09-08 23:45:46 UTC (rev 704)
@@ -1366,9 +1366,9 @@
if (!m_nType) return MOD_TYPE_NONE;
if (m_nType & (MOD_TYPE_MOD/*|MOD_TYPE_OKT*/))
return MOD_TYPE_MOD;
- if (m_nType & (MOD_TYPE_S3M|MOD_TYPE_STM|MOD_TYPE_ULT|MOD_TYPE_FAR|MOD_TYPE_PTM))
+ if (m_nType & (MOD_TYPE_S3M|MOD_TYPE_STM|MOD_TYPE_ULT|MOD_TYPE_FAR|MOD_TYPE_PTM|MOD_TYPE_MTM))
return MOD_TYPE_S3M;
- if (m_nType & (MOD_TYPE_XM|MOD_TYPE_MED|MOD_TYPE_MTM/*|MOD_TYPE_MT2*/))
+ if (m_nType & (MOD_TYPE_XM|MOD_TYPE_MED/*|MOD_TYPE_MT2*/))
return MOD_TYPE_XM;
if(m_nType & MOD_TYPE_MPT)
return MOD_TYPE_MPT;
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <sag...@us...> - 2010-09-07 17:45:39
|
Revision: 703
http://modplug.svn.sourceforge.net/modplug/?rev=703&view=rev
Author: saga-games
Date: 2010-09-07 17:45:33 +0000 (Tue, 07 Sep 2010)
Log Message:
-----------
[Imp] Mod Conversion: Sample sustain loops are now converted to normal loops if needed and possible.
[Imp] Mod Conversion: Bidi loops are disabled when converting to MOD/S3M now.
Modified Paths:
--------------
trunk/OpenMPT/mptrack/ModConvert.cpp
trunk/OpenMPT/mptrack/ModConvert.h
Modified: trunk/OpenMPT/mptrack/ModConvert.cpp
===================================================================
--- trunk/OpenMPT/mptrack/ModConvert.cpp 2010-09-07 16:13:10 UTC (rev 702)
+++ trunk/OpenMPT/mptrack/ModConvert.cpp 2010-09-07 17:45:33 UTC (rev 703)
@@ -2,7 +2,35 @@
* ModConvert.cpp
* --------------
* Purpose: Code for converting between various module formats.
- * Notes : (currently none)
+ * Notes : Incomplete list of MPTm-only features and extensions in the old formats:
+ * Features only available for MPTm:
+ * - User definable tunings.
+ * - Extended pattern range
+ * - Extended sequence
+ * - Multiple sequences ("songs")
+ * - Pattern-specific time signatures
+ * - Pattern effects :xy, S7D, S7E
+ * - Long instrument envelopes
+ * - Envelope release node (this was previously also usable in the IT format, but is now deprecated in that format)
+ *
+ * Extended features in IT/XM/S3M/MOD(not all listed below are available in all of those formats):
+ * - Plugins
+ * - Extended ranges for
+ * - Sample count
+ * - Instrument count
+ * - Pattern count
+ * - Sequence size
+ * - Row count
+ * - Channel count
+ * - Tempo limits
+ * - Extended sample/instrument properties.
+ * - MIDI mapping directives
+ * - Version info
+ * - Channel names
+ * - Pattern names
+ * - Alternative tempomodes
+ * - For more info, see e.g. SaveExtendedSongProperties(), SaveExtendedInstrumentProperties()
+ *
* Authors: OpenMPT Devs
*
*/
@@ -30,7 +58,7 @@
{
// Even if m_nType doesn't change, we might need to change extension in itp<->it case.
// This is because ITP is a HACK and doesn't genuinely change m_nType,
- // but uses flages instead.
+ // but uses flags instead.
ChangeFileExtension(nNewType);
return true;
}
@@ -53,42 +81,11 @@
const CModSpecifications& specs = m_SndFile.GetModSpecifications(nNewType);
- /*
- Incomplete list of MPTm-only features and extensions in the old formats:
-
- Features only available for MPTm:
- -User definable tunings.
- -Extended pattern range
- -Extended sequence
- -Multiple sequences ("songs")
- -Pattern-specific time signatures
- -Pattern effects :xy, S7D, S7E
- -Long instrument envelopes
- -Envelope release node (this was previously also usable in the IT format, but is deprecated in that format)
-
- Extended features in IT/XM/S3M/MOD(not all listed below are available in all of those formats):
- -plugs
- -Extended ranges for
- -sample count
- -instrument count
- -pattern count
- -sequence size
- -Row count
- -channel count
- -tempo limits
- -Extended sample/instrument properties.
- -MIDI mapping directives
- -Versioninfo
- -channel names
- -pattern names
- -Alternative tempomodes
- -For more info, see e.g. SaveExtendedSongProperties(), SaveExtendedInstrumentProperties()
- */
-
// Check if conversion to 64 rows is necessary
- for(PATTERNINDEX ipat=0; ipat<m_SndFile.Patterns.Size(); ipat++)
+ for(PATTERNINDEX nPat = 0; nPat < m_SndFile.Patterns.Size(); nPat++)
{
- if ((m_SndFile.Patterns[ipat]) && (m_SndFile.Patterns[ipat].GetNumRows() != 64)) nResizedPatterns++;
+ if ((m_SndFile.Patterns[nPat]) && (m_SndFile.Patterns[nPat].GetNumRows() != 64))
+ nResizedPatterns++;
}
if(((m_SndFile.m_nInstruments) || (nResizedPatterns)) && (nNewType & (MOD_TYPE_MOD|MOD_TYPE_S3M)))
@@ -206,14 +203,32 @@
// Do some sample conversion
for(SAMPLEINDEX nSmp = 1; nSmp <= m_SndFile.m_nSamples; nSmp++)
{
- // No Sustain loops for MOD/S3M
+ // No Bidi / Sustain loops / Autovibrato for MOD/S3M
if(newTypeIsMOD || newTypeIsS3M)
{
+ // Bidi loops
+ if((m_SndFile.Samples[nSmp].uFlags & CHN_PINGPONGLOOP) != 0)
+ {
+ m_SndFile.Samples[nSmp].uFlags &= ~CHN_PINGPONGLOOP;
+ CHANGEMODTYPE_WARNING(wSampleBidiLoops);
+ }
+
+ // Sustain loops
if(m_SndFile.Samples[nSmp].nSustainStart || m_SndFile.Samples[nSmp].nSustainEnd)
{
+ // We can at least try to convert sustain loops to normal loops
+ if(m_SndFile.Samples[nSmp].nLoopEnd == 0)
+ {
+ m_SndFile.Samples[nSmp].nSustainStart = m_SndFile.Samples[nSmp].nLoopStart;
+ m_SndFile.Samples[nSmp].nSustainEnd = m_SndFile.Samples[nSmp].nLoopEnd;
+ m_SndFile.Samples[nSmp].uFlags |= CHN_LOOP;
+ }
m_SndFile.Samples[nSmp].nSustainStart = m_SndFile.Samples[nSmp].nSustainEnd = 0;
+ m_SndFile.Samples[nSmp].uFlags &= ~(CHN_SUSTAINLOOP|CHN_PINGPONGSUSTAIN);
CHANGEMODTYPE_WARNING(wSampleSustainLoops);
}
+
+ // Autovibrato
if(m_SndFile.Samples[nSmp].nVibDepth || m_SndFile.Samples[nSmp].nVibRate || m_SndFile.Samples[nSmp].nVibSweep)
{
m_SndFile.Samples[nSmp].nVibDepth = m_SndFile.Samples[nSmp].nVibRate = m_SndFile.Samples[nSmp].nVibSweep = m_SndFile.Samples[nSmp].nVibType = 0;
@@ -381,14 +396,6 @@
END_CRITICAL();
ChangeFileExtension(nNewType);
- //rewbs.cutomKeys: update effect key commands
- CInputHandler *ih = CMainFrame::GetMainFrame()->GetInputHandler();
- if (newTypeIsMOD_XM)
- ih->SetXMEffects();
- else
- ih->SetITEffects();
- //end rewbs.cutomKeys
-
// Check mod specifications
m_SndFile.m_nDefaultTempo = CLAMP(m_SndFile.m_nDefaultTempo, specs.tempoMin, specs.tempoMax);
m_SndFile.m_nDefaultSpeed = CLAMP(m_SndFile.m_nDefaultSpeed, specs.speedMin, specs.speedMax);
@@ -404,6 +411,7 @@
CHANGEMODTYPE_CHECK(wInstrumentsToSamples, "All instruments have been converted to samples.\n");
wsprintf(s, "%d patterns have been resized to 64 rows\n", nResizedPatterns);
CHANGEMODTYPE_CHECK(wResizedPatterns, s);
+ CHANGEMODTYPE_CHECK(wSampleBidiLoops, "Sample bidi loops are not supported by the new format.\n");
CHANGEMODTYPE_CHECK(wSampleSustainLoops, "New format doesn't support sample sustain loops.\n");
CHANGEMODTYPE_CHECK(wSampleAutoVibrato, "New format doesn't support sample autovibrato.\n");
CHANGEMODTYPE_CHECK(wMODSampleFrequency, "Sample C-5 frequencies will be lost.\n");
@@ -425,6 +433,15 @@
GetSampleUndo()->ClearUndo();
UpdateAllViews(NULL, HINT_MODTYPE | HINT_MODGENERAL);
EndWaitCursor();
+
+ //rewbs.customKeys: update effect key commands
+ CInputHandler *ih = CMainFrame::GetMainFrame()->GetInputHandler();
+ if (newTypeIsMOD_XM)
+ ih->SetXMEffects();
+ else
+ ih->SetITEffects();
+ //end rewbs.customKeys
+
return true;
}
Modified: trunk/OpenMPT/mptrack/ModConvert.h
===================================================================
--- trunk/OpenMPT/mptrack/ModConvert.h 2010-09-07 16:13:10 UTC (rev 702)
+++ trunk/OpenMPT/mptrack/ModConvert.h 2010-09-07 17:45:33 UTC (rev 703)
@@ -13,6 +13,7 @@
{
wInstrumentsToSamples = 0,
wResizedPatterns,
+ wSampleBidiLoops,
wSampleSustainLoops,
wSampleAutoVibrato,
wMODSampleFrequency,
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <sag...@us...> - 2010-09-07 16:13:16
|
Revision: 702
http://modplug.svn.sourceforge.net/modplug/?rev=702&view=rev
Author: saga-games
Date: 2010-09-07 16:13:10 +0000 (Tue, 07 Sep 2010)
Log Message:
-----------
[Imp] Mod Conversion: When converting patterns from a format with instruments to a format without instruments (or when removing all instruments using the cleanup dialog), the instrument note mapping is now also taken care of.
[Ref] Refactored the instrument->sample pattern conversion code using ForEachModCommand.
Modified Paths:
--------------
trunk/OpenMPT/mptrack/Moddoc.h
trunk/OpenMPT/mptrack/Modedit.cpp
Modified: trunk/OpenMPT/mptrack/Moddoc.h
===================================================================
--- trunk/OpenMPT/mptrack/Moddoc.h 2010-09-07 14:37:26 UTC (rev 701)
+++ trunk/OpenMPT/mptrack/Moddoc.h 2010-09-07 16:13:10 UTC (rev 702)
@@ -221,7 +221,7 @@
bool ChangeModType(MODTYPE wType);
bool ChangeNumChannels(UINT nNewChannels, const bool showCancelInRemoveDlg = true);
- BOOL ConvertInstrumentsToSamples();
+ bool ConvertInstrumentsToSamples();
UINT RemovePlugs(const bool (&keepMask)[MAX_MIXPLUGINS]);
PATTERNINDEX InsertPattern(ORDERINDEX nOrd = ORDERINDEX_INVALID, ROWINDEX nRows = 64);
Modified: trunk/OpenMPT/mptrack/Modedit.cpp
===================================================================
--- trunk/OpenMPT/mptrack/Modedit.cpp 2010-09-07 14:37:26 UTC (rev 701)
+++ trunk/OpenMPT/mptrack/Modedit.cpp 2010-09-07 16:13:10 UTC (rev 702)
@@ -182,29 +182,49 @@
}
-BOOL CModDoc::ConvertInstrumentsToSamples()
-//-----------------------------------------
+// Functor for converting instrument numbers to sample numbers in the patterns
+struct ConvertInstrumentsToSamplesInPatterns
+//==========================================
{
- if (!m_SndFile.m_nInstruments) return FALSE;
- for (UINT i=0; i<m_SndFile.Patterns.Size(); i++) if (m_SndFile.Patterns[i])
+ ConvertInstrumentsToSamplesInPatterns(CSoundFile *pSndFile)
{
- MODCOMMAND *p = m_SndFile.Patterns[i];
- for (UINT j=m_SndFile.m_nChannels*m_SndFile.Patterns[i].GetNumRows(); j; j--, p++) if (p->instr)
+ this->pSndFile = pSndFile;
+ }
+
+ void operator()(MODCOMMAND& m)
+ {
+ if(m.instr)
{
- UINT instr = p->instr;
- UINT note = p->note;
- UINT newins = 0;
- if ((note) && (note < 128)) note--; else note = 5*12;
- if ((instr < MAX_INSTRUMENTS) && (m_SndFile.Instruments[instr]))
+ MODCOMMAND::INSTR instr = m.instr, newinstr = 0;
+ MODCOMMAND::NOTE note = m.note, newnote = note;
+ if((note) && (note <= NOTE_MAX))
+ note--;
+ else
+ note = NOTE_MIDDLEC - 1;
+
+ if((instr < MAX_INSTRUMENTS) && (pSndFile->Instruments[instr]))
{
- MODINSTRUMENT *pIns = m_SndFile.Instruments[instr];
- newins = pIns->Keyboard[note];
- if (newins >= MAX_SAMPLES) newins = 0;
+ const MODINSTRUMENT *pIns = pSndFile->Instruments[instr];
+ newinstr = pIns->Keyboard[note];
+ newnote = pIns->NoteMap[note];
+ if(newinstr >= MAX_SAMPLES) newinstr = 0;
}
- p->instr = newins;
+ m.instr = newinstr;
+ m.note = newnote;
}
}
- return TRUE;
+
+ CSoundFile *pSndFile;
+};
+
+
+bool CModDoc::ConvertInstrumentsToSamples()
+//-----------------------------------------
+{
+ if (!m_SndFile.GetNumInstruments())
+ return false;
+ m_SndFile.Patterns.ForEachModCommand(ConvertInstrumentsToSamplesInPatterns(&m_SndFile));
+ return true;
}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|