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
(126) |
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
From: <sv...@op...> - 2024-12-15 22:33:22
|
Author: sagamusix Date: Sun Dec 15 23:33:15 2024 New Revision: 22553 URL: https://source.openmpt.org/browse/openmpt/?op=revision&rev=22553 Log: [Fix] Path Config: If Autosave was disabled when the dialog was created, the retention time edit field was still enabled. Modified: trunk/OpenMPT/mptrack/PathConfigDlg.cpp Modified: trunk/OpenMPT/mptrack/PathConfigDlg.cpp ============================================================================== --- trunk/OpenMPT/mptrack/PathConfigDlg.cpp Sat Dec 14 23:01:16 2024 (r22552) +++ trunk/OpenMPT/mptrack/PathConfigDlg.cpp Sun Dec 15 23:33:15 2024 (r22553) @@ -197,13 +197,12 @@ } OnSettingsChanged(); } - return; } void PathConfigDlg::OnAutosaveRetention() { - const BOOL enabled = IsDlgButtonChecked(IDC_CHECK2) ? TRUE : FALSE; + const BOOL enabled = (IsDlgButtonChecked(IDC_AUTOSAVE_ENABLE) && IsDlgButtonChecked(IDC_CHECK2)) ? TRUE : FALSE; GetDlgItem(IDC_EDIT1)->EnableWindow(enabled); GetDlgItem(IDC_SPIN3)->EnableWindow(enabled); } |
From: <sv...@op...> - 2024-12-14 22:01:28
|
Author: sagamusix Date: Sat Dec 14 23:01:16 2024 New Revision: 22552 URL: https://source.openmpt.org/browse/openmpt/?op=revision&rev=22552 Log: [Fix] IT: Tone Portamento + Volume Slide (Lxx) always executes the "portamento down" branch when no tone portamento has been set up before. Test cases: LxxWith0Portamento-Linear.it, LxxWith0Portamento-Amiga.it [Mod] OpenMPT: Version is now 1.32.00.37 Modified: trunk/OpenMPT/common/versionNumber.h trunk/OpenMPT/soundlib/Snd_fx.cpp Modified: trunk/OpenMPT/common/versionNumber.h ============================================================================== --- trunk/OpenMPT/common/versionNumber.h Sat Dec 14 21:34:09 2024 (r22551) +++ trunk/OpenMPT/common/versionNumber.h Sat Dec 14 23:01:16 2024 (r22552) @@ -16,4 +16,4 @@ #define VER_MAJORMAJOR 1 #define VER_MAJOR 32 #define VER_MINOR 00 -#define VER_MINORMINOR 36 +#define VER_MINORMINOR 37 Modified: trunk/OpenMPT/soundlib/Snd_fx.cpp ============================================================================== --- trunk/OpenMPT/soundlib/Snd_fx.cpp Sat Dec 14 21:34:09 2024 (r22551) +++ trunk/OpenMPT/soundlib/Snd_fx.cpp Sat Dec 14 23:01:16 2024 (r22552) @@ -4587,7 +4587,15 @@ if(chn.nPeriod && chn.nPortamentoDest && doPorta) { const int32 actualDelta = PeriodsAreFrequencies() ? delta : -delta; - if(chn.nPeriod < chn.nPortamentoDest || chn.portaTargetReached) + // IT compatibility: Command Lxx, with no tone portamento set up before, will always execute the "portamento down" branch. + // Test cases: LxxWith0Portamento-Linear.it, LxxWith0Portamento-Amiga.it + if(m_playBehaviour[kITDoublePortamentoSlides] && !delta && chn.rowCommand.command == CMD_TONEPORTAVOL) + { + if(chn.nPeriod > 1 && m_SongFlags[SONG_LINEARSLIDES]) + chn.nPeriod--; + if(chn.nPeriod < chn.nPortamentoDest) + chn.nPeriod = chn.nPortamentoDest; + } else if(chn.nPeriod < chn.nPortamentoDest || chn.portaTargetReached) { DoFreqSlide(chn, chn.nPeriod, actualDelta, true); if(chn.nPeriod > chn.nPortamentoDest) |
From: <sv...@op...> - 2024-12-14 20:34:21
|
Author: sagamusix Date: Sat Dec 14 21:34:09 2024 New Revision: 22551 URL: https://source.openmpt.org/browse/openmpt/?op=revision&rev=22551 Log: [Fix] Lxx parameter was used to initialize portamento since r21807. Modified: trunk/OpenMPT/soundlib/Snd_fx.cpp Modified: trunk/OpenMPT/soundlib/Snd_fx.cpp ============================================================================== --- trunk/OpenMPT/soundlib/Snd_fx.cpp Sat Dec 14 21:32:35 2024 (r22550) +++ trunk/OpenMPT/soundlib/Snd_fx.cpp Sat Dec 14 21:34:09 2024 (r22551) @@ -3171,7 +3171,7 @@ // Test cases: DoubleSlide.it, DoubleSlideCompatGxx.it if(m_playBehaviour[kITDoublePortamentoSlides] && chn.isFirstTick) { - const bool effectColumnTonePorta = (cmd == CMD_TONEPORTAMENTO || cmd == CMD_TONEPORTAVOL); + const bool effectColumnTonePorta = (cmd == CMD_TONEPORTAMENTO); if(effectColumnTonePorta) InitTonePortamento(chn, static_cast<uint16>(param)); if(volcmd == VOLCMD_TONEPORTAMENTO) |
From: <sv...@op...> - 2024-12-14 20:32:42
|
Author: sagamusix Date: Sat Dec 14 21:32:35 2024 New Revision: 22550 URL: https://source.openmpt.org/browse/openmpt/?op=revision&rev=22550 Log: Merged revision(s) 22549 from trunk/OpenMPT: [Fix] r22225 broke instrument global volume -> plugin velocity conversion (tx coda). ........ Modified: branches/OpenMPT-1.31/ (props changed) branches/OpenMPT-1.31/soundlib/Snd_fx.cpp Modified: branches/OpenMPT-1.31/soundlib/Snd_fx.cpp ============================================================================== --- branches/OpenMPT-1.31/soundlib/Snd_fx.cpp Sat Dec 14 21:31:32 2024 (r22549) +++ branches/OpenMPT-1.31/soundlib/Snd_fx.cpp Sat Dec 14 21:32:35 2024 (r22550) @@ -1391,7 +1391,10 @@ if(pIns->NoteMap[note - NOTE_MIN] > NOTE_MAX) return; uint32 n = pIns->Keyboard[note - NOTE_MIN]; - pSmp = (n <= GetNumSamples()) ? &Samples[n] : &Samples[0]; + if(n) + pSmp = (n <= GetNumSamples()) ? &Samples[n] : &Samples[0]; + else + pSmp = nullptr; } else if(GetNumInstruments()) { // No valid instrument, or not a valid note. |
From: <sv...@op...> - 2024-12-14 20:31:39
|
Author: sagamusix Date: Sat Dec 14 21:31:32 2024 New Revision: 22549 URL: https://source.openmpt.org/browse/openmpt/?op=revision&rev=22549 Log: [Fix] r22225 broke instrument global volume -> plugin velocity conversion (tx coda). Modified: trunk/OpenMPT/soundlib/Snd_fx.cpp Modified: trunk/OpenMPT/soundlib/Snd_fx.cpp ============================================================================== --- trunk/OpenMPT/soundlib/Snd_fx.cpp Sat Dec 14 17:14:12 2024 (r22548) +++ trunk/OpenMPT/soundlib/Snd_fx.cpp Sat Dec 14 21:31:32 2024 (r22549) @@ -1479,7 +1479,10 @@ if(pIns->NoteMap[note - NOTE_MIN] > NOTE_MAX) return; uint32 n = pIns->Keyboard[note - NOTE_MIN]; - pSmp = (n <= GetNumSamples()) ? &Samples[n] : &Samples[0]; + if(n) + pSmp = (n <= GetNumSamples()) ? &Samples[n] : &Samples[0]; + else + pSmp = nullptr; } else if(GetNumInstruments()) { // No valid instrument, or not a valid note. |
From: <sv...@op...> - 2024-12-14 16:14:18
|
Author: manx Date: Sat Dec 14 17:14:12 2024 New Revision: 22548 URL: https://source.openmpt.org/browse/openmpt/?op=revision&rev=22548 Log: [Doc] libopenmpt: Update changelog. Modified: branches/OpenMPT-1.28/libopenmpt/dox/changelog.md Modified: branches/OpenMPT-1.28/libopenmpt/dox/changelog.md ============================================================================== --- branches/OpenMPT-1.28/libopenmpt/dox/changelog.md Sat Dec 14 17:13:53 2024 (r22547) +++ branches/OpenMPT-1.28/libopenmpt/dox/changelog.md Sat Dec 14 17:14:12 2024 (r22548) @@ -7,7 +7,7 @@ ### libopenmpt 0.4.48-pre - * mpg123: Update to v1.32.10-dev+r5461 (2024-12-09). + * mpg123: Update to v1.32.10 (2024-12-14). ### libopenmpt 0.4.47 (2024-12-01) |
From: <sv...@op...> - 2024-12-14 16:14:00
|
Author: manx Date: Sat Dec 14 17:13:53 2024 New Revision: 22547 URL: https://source.openmpt.org/browse/openmpt/?op=revision&rev=22547 Log: [Doc] libopenmpt: Update changelog. Modified: branches/OpenMPT-1.29/libopenmpt/dox/changelog.md Modified: branches/OpenMPT-1.29/libopenmpt/dox/changelog.md ============================================================================== --- branches/OpenMPT-1.29/libopenmpt/dox/changelog.md Sat Dec 14 17:13:35 2024 (r22546) +++ branches/OpenMPT-1.29/libopenmpt/dox/changelog.md Sat Dec 14 17:13:53 2024 (r22547) @@ -7,7 +7,7 @@ ### libopenmpt 0.5.36-pre - * mpg123: Update to v1.32.10-dev+r5461 (2024-12-09). + * mpg123: Update to v1.32.10 (2024-12-14). ### libopenmpt 0.5.35 (2024-12-01) |
From: <sv...@op...> - 2024-12-14 16:13:48
|
Author: manx Date: Sat Dec 14 17:13:35 2024 New Revision: 22546 URL: https://source.openmpt.org/browse/openmpt/?op=revision&rev=22546 Log: [Doc] libopenmpt: Update changelog. Modified: branches/OpenMPT-1.30/libopenmpt/dox/changelog.md Modified: branches/OpenMPT-1.30/libopenmpt/dox/changelog.md ============================================================================== --- branches/OpenMPT-1.30/libopenmpt/dox/changelog.md Sat Dec 14 17:13:09 2024 (r22545) +++ branches/OpenMPT-1.30/libopenmpt/dox/changelog.md Sat Dec 14 17:13:35 2024 (r22546) @@ -7,7 +7,7 @@ ### libopenmpt 0.6.22-pre - * mpg123: Update to v1.32.10-dev+r5461 (2024-12-09). + * mpg123: Update to v1.32.10 (2024-12-14). ### libopenmpt 0.6.21 (2024-12-01) |
From: <sv...@op...> - 2024-12-14 16:13:22
|
Author: manx Date: Sat Dec 14 17:13:09 2024 New Revision: 22545 URL: https://source.openmpt.org/browse/openmpt/?op=revision&rev=22545 Log: [Doc] libopenmpt: Update changelog. Modified: branches/OpenMPT-1.31/doc/libopenmpt/changelog.md Modified: branches/OpenMPT-1.31/doc/libopenmpt/changelog.md ============================================================================== --- branches/OpenMPT-1.31/doc/libopenmpt/changelog.md Sat Dec 14 17:12:38 2024 (r22544) +++ branches/OpenMPT-1.31/doc/libopenmpt/changelog.md Sat Dec 14 17:13:09 2024 (r22545) @@ -7,7 +7,7 @@ ### libopenmpt 0.7.13-pre - * mpg123: Update to v1.32.10-dev+r5461 (2024-12-09). + * mpg123: Update to v1.32.10 (2024-12-14). ### libopenmpt 0.7.12 (2024-12-01) |
From: <sv...@op...> - 2024-12-14 16:12:45
|
Author: manx Date: Sat Dec 14 17:12:17 2024 New Revision: 22543 URL: https://source.openmpt.org/browse/openmpt/?op=revision&rev=22543 Log: Merged revision(s) 22540 from trunk/OpenMPT: [Var] mpg123: Update to 1.32.10 (2024-12-14). ........ Modified: branches/OpenMPT-1.29/ (props changed) branches/OpenMPT-1.29/include/mpg123/OpenMPT.txt branches/OpenMPT-1.29/include/mpg123/src/version.h Modified: branches/OpenMPT-1.29/include/mpg123/OpenMPT.txt ============================================================================== --- branches/OpenMPT-1.29/include/mpg123/OpenMPT.txt Sat Dec 14 17:11:56 2024 (r22542) +++ branches/OpenMPT-1.29/include/mpg123/OpenMPT.txt Sat Dec 14 17:12:17 2024 (r22543) @@ -1,4 +1,4 @@ -libmpg123 library version 1.32.10-dev+r5461 (2024-12-09). +libmpg123 library version 1.32.10 (2024-12-14). The following changes have been made: * `ports/makefile/config.h` has been added for plain `Makefile` builds. * `ports/MSVC++/config.h` has been added for MSVC builds. Modified: branches/OpenMPT-1.29/include/mpg123/src/version.h ============================================================================== --- branches/OpenMPT-1.29/include/mpg123/src/version.h Sat Dec 14 17:11:56 2024 (r22542) +++ branches/OpenMPT-1.29/include/mpg123/src/version.h Sat Dec 14 17:12:17 2024 (r22543) @@ -19,7 +19,7 @@ #define MPG123_PATCH 10 // Don't get too wild with that to avoid confusing m4. No brackets. // Also, it should fit well into a sane file name for the tarball. -#define MPG123_SUFFIX "-dev" +#define MPG123_SUFFIX "" #define MPG123_VERSION_CAT_REALLY(a, b, c) #a "." #b "." #c #define MPG123_VERSION_CAT(a, b, c) MPG123_VERSION_CAT_REALLY(a, b, c) |
From: <sv...@op...> - 2024-12-14 16:12:45
|
Author: manx Date: Sat Dec 14 17:12:38 2024 New Revision: 22544 URL: https://source.openmpt.org/browse/openmpt/?op=revision&rev=22544 Log: Merged revision(s) 22540 from trunk/OpenMPT: [Var] mpg123: Update to 1.32.10 (2024-12-14). ........ Modified: branches/OpenMPT-1.28/ (props changed) branches/OpenMPT-1.28/include/mpg123/OpenMPT.txt branches/OpenMPT-1.28/include/mpg123/src/version.h Modified: branches/OpenMPT-1.28/include/mpg123/OpenMPT.txt ============================================================================== --- branches/OpenMPT-1.28/include/mpg123/OpenMPT.txt Sat Dec 14 17:12:17 2024 (r22543) +++ branches/OpenMPT-1.28/include/mpg123/OpenMPT.txt Sat Dec 14 17:12:38 2024 (r22544) @@ -1,4 +1,4 @@ -libmpg123 library version 1.32.10-dev+r5461 (2024-12-09). +libmpg123 library version 1.32.10 (2024-12-14). The following changes have been made: * `ports/MSVC++/config.h` has been added for MSVC builds. * `ports/Xcode/config.h` has been retained from older versions. Modified: branches/OpenMPT-1.28/include/mpg123/src/version.h ============================================================================== --- branches/OpenMPT-1.28/include/mpg123/src/version.h Sat Dec 14 17:12:17 2024 (r22543) +++ branches/OpenMPT-1.28/include/mpg123/src/version.h Sat Dec 14 17:12:38 2024 (r22544) @@ -19,7 +19,7 @@ #define MPG123_PATCH 10 // Don't get too wild with that to avoid confusing m4. No brackets. // Also, it should fit well into a sane file name for the tarball. -#define MPG123_SUFFIX "-dev" +#define MPG123_SUFFIX "" #define MPG123_VERSION_CAT_REALLY(a, b, c) #a "." #b "." #c #define MPG123_VERSION_CAT(a, b, c) MPG123_VERSION_CAT_REALLY(a, b, c) |
From: <sv...@op...> - 2024-12-14 16:12:08
|
Author: manx Date: Sat Dec 14 17:11:56 2024 New Revision: 22542 URL: https://source.openmpt.org/browse/openmpt/?op=revision&rev=22542 Log: Merged revision(s) 22540 from trunk/OpenMPT: [Var] mpg123: Update to 1.32.10 (2024-12-14). ........ Modified: branches/OpenMPT-1.30/ (props changed) branches/OpenMPT-1.30/include/mpg123/OpenMPT.txt branches/OpenMPT-1.30/include/mpg123/src/version.h Modified: branches/OpenMPT-1.30/include/mpg123/OpenMPT.txt ============================================================================== --- branches/OpenMPT-1.30/include/mpg123/OpenMPT.txt Sat Dec 14 17:11:35 2024 (r22541) +++ branches/OpenMPT-1.30/include/mpg123/OpenMPT.txt Sat Dec 14 17:11:56 2024 (r22542) @@ -1,4 +1,4 @@ -libmpg123 library version 1.32.10-dev+r5461 (2024-12-09). +libmpg123 library version 1.32.10 (2024-12-14). The following changes have been made: * `ports/makefile/config.h` has been added for plain `Makefile` builds. * `ports/MSVC++/config.h` has been added for MSVC builds. Modified: branches/OpenMPT-1.30/include/mpg123/src/version.h ============================================================================== --- branches/OpenMPT-1.30/include/mpg123/src/version.h Sat Dec 14 17:11:35 2024 (r22541) +++ branches/OpenMPT-1.30/include/mpg123/src/version.h Sat Dec 14 17:11:56 2024 (r22542) @@ -19,7 +19,7 @@ #define MPG123_PATCH 10 // Don't get too wild with that to avoid confusing m4. No brackets. // Also, it should fit well into a sane file name for the tarball. -#define MPG123_SUFFIX "-dev" +#define MPG123_SUFFIX "" #define MPG123_VERSION_CAT_REALLY(a, b, c) #a "." #b "." #c #define MPG123_VERSION_CAT(a, b, c) MPG123_VERSION_CAT_REALLY(a, b, c) |
From: <sv...@op...> - 2024-12-14 16:11:47
|
Author: manx Date: Sat Dec 14 17:11:35 2024 New Revision: 22541 URL: https://source.openmpt.org/browse/openmpt/?op=revision&rev=22541 Log: Merged revision(s) 22540 from trunk/OpenMPT: [Var] mpg123: Update to 1.32.10 (2024-12-14). ........ Modified: branches/OpenMPT-1.31/ (props changed) branches/OpenMPT-1.31/include/mpg123/OpenMPT.txt branches/OpenMPT-1.31/include/mpg123/src/version.h Modified: branches/OpenMPT-1.31/include/mpg123/OpenMPT.txt ============================================================================== --- branches/OpenMPT-1.31/include/mpg123/OpenMPT.txt Sat Dec 14 17:11:05 2024 (r22540) +++ branches/OpenMPT-1.31/include/mpg123/OpenMPT.txt Sat Dec 14 17:11:35 2024 (r22541) @@ -1,4 +1,4 @@ -libmpg123 library version 1.32.10-dev+r5461 (2024-12-09). +libmpg123 library version 1.32.10 (2024-12-14). The following changes have been made: * `ports/makefile/config.h` has been added for plain `Makefile` builds. * `ports/MSVC++/config.h` has been added for MSVC builds. Modified: branches/OpenMPT-1.31/include/mpg123/src/version.h ============================================================================== --- branches/OpenMPT-1.31/include/mpg123/src/version.h Sat Dec 14 17:11:05 2024 (r22540) +++ branches/OpenMPT-1.31/include/mpg123/src/version.h Sat Dec 14 17:11:35 2024 (r22541) @@ -19,7 +19,7 @@ #define MPG123_PATCH 10 // Don't get too wild with that to avoid confusing m4. No brackets. // Also, it should fit well into a sane file name for the tarball. -#define MPG123_SUFFIX "-dev" +#define MPG123_SUFFIX "" #define MPG123_VERSION_CAT_REALLY(a, b, c) #a "." #b "." #c #define MPG123_VERSION_CAT(a, b, c) MPG123_VERSION_CAT_REALLY(a, b, c) |
From: <sv...@op...> - 2024-12-14 16:11:17
|
Author: manx Date: Sat Dec 14 17:11:05 2024 New Revision: 22540 URL: https://source.openmpt.org/browse/openmpt/?op=revision&rev=22540 Log: [Var] mpg123: Update to 1.32.10 (2024-12-14). Modified: trunk/OpenMPT/include/mpg123/OpenMPT.txt trunk/OpenMPT/include/mpg123/src/version.h Modified: trunk/OpenMPT/include/mpg123/OpenMPT.txt ============================================================================== --- trunk/OpenMPT/include/mpg123/OpenMPT.txt Sat Dec 14 17:08:03 2024 (r22539) +++ trunk/OpenMPT/include/mpg123/OpenMPT.txt Sat Dec 14 17:11:05 2024 (r22540) @@ -1,4 +1,4 @@ -libmpg123 library version 1.32.10-dev+r5461 (2024-12-09). +libmpg123 library version 1.32.10 (2024-12-14). The following changes have been made: * `ports/makefile/config.h` has been added for plain `Makefile` builds. * `ports/MSVC++/config.h` has been added for MSVC builds. Modified: trunk/OpenMPT/include/mpg123/src/version.h ============================================================================== --- trunk/OpenMPT/include/mpg123/src/version.h Sat Dec 14 17:08:03 2024 (r22539) +++ trunk/OpenMPT/include/mpg123/src/version.h Sat Dec 14 17:11:05 2024 (r22540) @@ -19,7 +19,7 @@ #define MPG123_PATCH 10 // Don't get too wild with that to avoid confusing m4. No brackets. // Also, it should fit well into a sane file name for the tarball. -#define MPG123_SUFFIX "-dev" +#define MPG123_SUFFIX "" #define MPG123_VERSION_CAT_REALLY(a, b, c) #a "." #b "." #c #define MPG123_VERSION_CAT(a, b, c) MPG123_VERSION_CAT_REALLY(a, b, c) |
From: <sv...@op...> - 2024-12-14 16:08:16
|
Author: manx Date: Sat Dec 14 17:08:03 2024 New Revision: 22539 URL: https://source.openmpt.org/browse/openmpt/?op=revision&rev=22539 Log: [Ref] build: Makefile: DJGPP: Remove dead code. Modified: trunk/OpenMPT/build/make/config-djgpp.mk Modified: trunk/OpenMPT/build/make/config-djgpp.mk ============================================================================== --- trunk/OpenMPT/build/make/config-djgpp.mk Fri Dec 13 21:55:55 2024 (r22538) +++ trunk/OpenMPT/build/make/config-djgpp.mk Sat Dec 14 17:08:03 2024 (r22539) @@ -92,19 +92,6 @@ -OPT_NONE := -O0 -OPT_SOME := -O1 - -OPT_DEBUG := -Og - -OPT_SPEED := -O2 -OPT_SPEEDX:= -O3 - -OPT_SIZE := -Os -OPT_SIZEX := -Oz - - - ifeq ($(OPTIMIZE),default) OPT_UARCH_EMUL := -Os # interpreter |
From: <sv...@op...> - 2024-12-13 20:56:10
|
Author: sagamusix Date: Fri Dec 13 21:55:55 2024 New Revision: 22538 URL: https://source.openmpt.org/browse/openmpt/?op=revision&rev=22538 Log: [Ref] Rewrite the macro cruft in instrument extensions reading. Modified: trunk/OpenMPT/soundlib/InstrumentExtensions.cpp trunk/OpenMPT/soundlib/SampleFormats.cpp trunk/OpenMPT/soundlib/Sndfile.h Modified: trunk/OpenMPT/soundlib/InstrumentExtensions.cpp ============================================================================== --- trunk/OpenMPT/soundlib/InstrumentExtensions.cpp Fri Dec 13 20:35:28 2024 (r22537) +++ trunk/OpenMPT/soundlib/InstrumentExtensions.cpp Fri Dec 13 21:55:55 2024 (r22538) @@ -32,8 +32,8 @@ - both following functions need to be updated when adding a new member in ModInstrument : -void WriteInstrumentHeaderStructOrField(ModInstrument * input, std::ostream &file, uint32 only_this_code, int16 fixedsize); -bool ReadInstrumentHeaderField(ModInstrument * input, uint32 fcode, int16 fsize, FileReader &file); +void WriteInstrumentHeaderStructOrField(ModInstrument * input, std::ostream &file, uint32 onlyThisCode, int16 fixedsize); +void ReadInstrumentHeaderField(ModInstrument &ins, uint32 fcode, FileReader &file); - see below for body declaration. @@ -128,7 +128,7 @@ Note that many of these extensions were only relevant for ITP files, and thus there is no code for writing them, only reading. Some of them used to be written but were never read ("K[.." sample map - it was only relevant for ITP files, but even there -it was always ignored, because sample indices might change when loading external instruments). +it was always ignored, because sample indices may change when loading external instruments). ----------------------------------------------------------------------------------------------- @@ -157,11 +157,11 @@ { \ mpt::IO::WriteIntLE<uint32>(file, fcode); \ mpt::IO::WriteIntLE<uint16>(file, fsize); \ - } else if(only_this_code == fcode)\ + } else if(onlyThisCode == fcode)\ { \ MPT_ASSERT(fixedsize == fsize); \ } \ - if(only_this_code == fcode || only_this_code == Util::MaxValueOfType(only_this_code)) \ + if(onlyThisCode == fcode || onlyThisCode == Util::MaxValueOfType(onlyThisCode)) \ { \ type tmp = (type)(input-> name ); \ mpt::IO::WriteIntLE(file, tmp); \ @@ -181,7 +181,7 @@ mpt::IO::WriteIntLE<uint16>(file, fsize); \ type tmp = (type)(input-> name ); \ mpt::IO::WriteIntLE(file, tmp); \ - } else if(only_this_code == fcode)\ + } else if(onlyThisCode == fcode)\ { \ /* hackish workaround to resolve mismatched size values: */ \ /* nResampling was a long time declared as uint32 but these macro tables used uint16 and UINT. */ \ @@ -201,34 +201,6 @@ /**/ // ------------------------------------------------------------------------ -// Convenient macro to help WRITE_HEADER declaration for array members ONLY -// ------------------------------------------------------------------------ -#define WRITE_MPTHEADER_array_member(name,type,code,arraysize) \ - static_assert(sizeof(type) == sizeof(input-> name [0])); \ - MPT_ASSERT(sizeof(input->name) >= sizeof(type) * arraysize);\ - fcode = code;\ - fsize = sizeof( type ) * arraysize;\ - if(writeAll) \ - { \ - mpt::IO::WriteIntLE<uint32>(file, fcode); \ - mpt::IO::WriteIntLE<uint16>(file, fsize); \ - } else if(only_this_code == fcode)\ - { \ - /* MPT_ASSERT(fixedsize <= fsize); */ \ - fsize = fixedsize; /* just trust the size we got passed */ \ - } \ - if(only_this_code == fcode || only_this_code == Util::MaxValueOfType(only_this_code)) \ - { \ - for(std::size_t i = 0; i < fsize/sizeof(type); ++i) \ - { \ - type tmp; \ - tmp = input-> name [i]; \ - mpt::IO::WriteIntLE(file, tmp); \ - } \ - } \ -/**/ - -// ------------------------------------------------------------------------ // Convenient macro to help WRITE_HEADER declaration for envelope members ONLY // ------------------------------------------------------------------------ #define WRITE_MPTHEADER_envelope_member(envType,envField,type,code) \ @@ -243,11 +215,11 @@ { \ mpt::IO::WriteIntLE<uint32>(file, fcode); \ mpt::IO::WriteIntLE<uint16>(file, fsize); \ - } else if(only_this_code == fcode)\ + } else if(onlyThisCode == fcode)\ { \ fsize = fixedsize; /* just trust the size we got passed */ \ } \ - if(only_this_code == fcode || only_this_code == Util::MaxValueOfType(only_this_code)) \ + if(onlyThisCode == fcode || onlyThisCode == Util::MaxValueOfType(onlyThisCode)) \ { \ uint32 maxNodes = std::min(static_cast<uint32>(fsize/sizeof(type)), static_cast<uint32>(env.size())); \ for(uint32 i = 0; i < maxNodes; ++i) \ @@ -268,13 +240,13 @@ // Write (in 'file') 'input' ModInstrument with 'code' & 'size' extra field infos for each member -void WriteInstrumentHeaderStructOrField(ModInstrument * input, std::ostream &file, uint32 only_this_code, uint16 fixedsize) +void WriteInstrumentHeaderStructOrField(ModInstrument * input, std::ostream &file, uint32 onlyThisCode, uint16 fixedsize) { uint32 fcode; uint16 fsize; // If true, all extension are written to the file; otherwise only the specified extension is written. // writeAll is true iff we are saving an instrument (or, hypothetically, the legacy ITP format) - const bool writeAll = only_this_code == Util::MaxValueOfType(only_this_code); + const bool writeAll = onlyThisCode == Util::MaxValueOfType(onlyThisCode); if(!writeAll) { @@ -356,9 +328,9 @@ WritePropertyIfNeeded(*this, &ModInstrument::nMidiChannel, MagicBE("MC.."), sizeof(ModInstrument::nMidiChannel), f, numInstruments); WritePropertyIfNeeded(*this, &ModInstrument::nMidiProgram, MagicBE("MP.."), sizeof(ModInstrument::nMidiProgram), f, numInstruments); WritePropertyIfNeeded(*this, &ModInstrument::wMidiBank, MagicBE("MB.."), sizeof(ModInstrument::wMidiBank), f, numInstruments); - WritePropertyIfNeeded(*this, &ModInstrument::resampling, MagicBE("R..."), sizeof(ModInstrument::resampling), f, numInstruments); + WritePropertyIfNeeded(*this, &ModInstrument::resampling, MagicBE("R..."), sizeof(ModInstrument::resampling), f, numInstruments); WritePropertyIfNeeded(*this, &ModInstrument::pluginVelocityHandling, MagicBE("PVEH"), sizeof(ModInstrument::pluginVelocityHandling), f, numInstruments); - WritePropertyIfNeeded(*this, &ModInstrument::pluginVolumeHandling, MagicBE("PVOH"), sizeof(ModInstrument::pluginVolumeHandling), f, numInstruments); + WritePropertyIfNeeded(*this, &ModInstrument::pluginVolumeHandling, MagicBE("PVOH"), sizeof(ModInstrument::pluginVolumeHandling), f, numInstruments); if(!(GetType() & MOD_TYPE_XM)) { @@ -493,249 +465,181 @@ } -// -------------------------------------------------------------------------------------------- -// Convenient macro to help GET_HEADER declaration for single type members ONLY (non-array) -// -------------------------------------------------------------------------------------------- -#define GET_MPTHEADER_sized_member(name,type,code) \ - case code: \ - {\ - if( fsize <= sizeof( type ) ) \ - { \ - /* hackish workaround to resolve mismatched size values: */ \ - /* nResampling was a long time declared as uint32 but these macro tables used uint16 and UINT. */ \ - /* This worked fine on little-endian, on big-endian not so much. Thus support reading size-mismatched fields. */ \ - if(file.CanRead(fsize)) \ - { \ - type tmp; \ - tmp = file.ReadTruncatedIntLE<type>(fsize); \ - static_assert(sizeof(tmp) == sizeof(input-> name )); \ - input-> name = decltype(input-> name )(tmp); \ - result = true; \ - } \ - } \ - } break; - -// -------------------------------------------------------------------------------------------- -// Convenient macro to help GET_HEADER declaration for array members ONLY -// -------------------------------------------------------------------------------------------- -#define GET_MPTHEADER_array_member(name,type,code) \ - case code: \ - {\ - if( fsize <= sizeof( type ) * std::size(input-> name) ) \ - { \ - FileReader arrayChunk = file.ReadChunk(fsize); \ - for(std::size_t i = 0; i < std::size(input-> name); ++i) \ - { \ - input-> name [i] = arrayChunk.ReadIntLE<type>(); \ - } \ - result = true; \ - } \ - } break; - -// -------------------------------------------------------------------------------------------- -// Convenient macro to help GET_HEADER declaration for character buffer members ONLY -// -------------------------------------------------------------------------------------------- -#define GET_MPTHEADER_charbuf_member(name,type,code) \ - case code: \ - {\ - if( fsize <= sizeof( type ) * input-> name .static_length() ) \ - { \ - FileReader arrayChunk = file.ReadChunk(fsize); \ - std::string tmp; \ - for(std::size_t i = 0; i < fsize; ++i) \ - { \ - tmp += arrayChunk.ReadChar(); \ - } \ - input-> name = tmp; \ - result = true; \ - } \ - } break; - -// -------------------------------------------------------------------------------------------- -// Convenient macro to help GET_HEADER declaration for envelope tick/value members -// -------------------------------------------------------------------------------------------- -#define GET_MPTHEADER_envelope_member(envType,envField,type,code) \ - case code: \ - {\ - FileReader arrayChunk = file.ReadChunk(fsize); \ - InstrumentEnvelope &env = input->GetEnvelope(envType); \ - for(uint32 i = 0; i < env.size(); i++) \ - { \ - env[i]. envField = arrayChunk.ReadIntLE<type>(); \ - } \ - result = true; \ - } break; - - -// Return a pointer on the wanted field in 'input' ModInstrument given field code & size -bool ReadInstrumentHeaderField(ModInstrument *input, uint32 fcode, uint16 fsize, FileReader &file) +static void ReadInstrumentHeaderField(ModInstrument &ins, uint32 fcode, FileReader &file) { - if(input == nullptr) return false; + const size_t size = static_cast<size_t>(file.GetLength()); - bool result = false; + // Note: Various int / enum members have changed their size over the past. + // Hence we use ReadSizedIntLE everywhere to allow reading both truncated and oversized values. + constexpr auto ReadInt = [](FileReader &file, auto size, auto &member) + { + using T = std::remove_reference_t<decltype(member)>; + member = file.ReadSizedIntLE<T>(size); + }; + constexpr auto ReadEnum = [](FileReader &file, auto size, auto &member) + { + using T = std::remove_reference_t<decltype(member)>; + static_assert(std::is_enum_v<T>); + member = static_cast<T>(file.ReadSizedIntLE<std::underlying_type_t<T>>(size)); + }; + constexpr auto ReadEnvelopeTicks = [](FileReader &file, auto size, InstrumentEnvelope &env) + { + const uint32 points = std::min(env.size(), static_cast<uint32>(size / 2)); + for(uint32 i = 0; i < points; i++) + { + env[i].tick = file.ReadUint16LE(); + } + }; + constexpr auto ReadEnvelopeValues = [](FileReader &file, auto size, InstrumentEnvelope &env) + { + const uint32 points = std::min(env.size(), static_cast<uint32>(size)); + for(uint32 i = 0; i < points; i++) + { + env[i].value = file.ReadUint8(); + } + }; // Members which can be found in this table but not in the write table are only required in the legacy ITP format. switch(fcode) { - // clang-format off - GET_MPTHEADER_sized_member( nFadeOut , uint32 , MagicBE("FO..") ) - GET_MPTHEADER_sized_member( nGlobalVol , uint32 , MagicBE("GV..") ) - GET_MPTHEADER_sized_member( nPan , uint32 , MagicBE("P...") ) - GET_MPTHEADER_sized_member( VolEnv.nLoopStart , uint8 , MagicBE("VLS.") ) - GET_MPTHEADER_sized_member( VolEnv.nLoopEnd , uint8 , MagicBE("VLE.") ) - GET_MPTHEADER_sized_member( VolEnv.nSustainStart , uint8 , MagicBE("VSB.") ) - GET_MPTHEADER_sized_member( VolEnv.nSustainEnd , uint8 , MagicBE("VSE.") ) - GET_MPTHEADER_sized_member( PanEnv.nLoopStart , uint8 , MagicBE("PLS.") ) - GET_MPTHEADER_sized_member( PanEnv.nLoopEnd , uint8 , MagicBE("PLE.") ) - GET_MPTHEADER_sized_member( PanEnv.nSustainStart , uint8 , MagicBE("PSB.") ) - GET_MPTHEADER_sized_member( PanEnv.nSustainEnd , uint8 , MagicBE("PSE.") ) - GET_MPTHEADER_sized_member( PitchEnv.nLoopStart , uint8 , MagicBE("PiLS") ) - GET_MPTHEADER_sized_member( PitchEnv.nLoopEnd , uint8 , MagicBE("PiLE") ) - GET_MPTHEADER_sized_member( PitchEnv.nSustainStart , uint8 , MagicBE("PiSB") ) - GET_MPTHEADER_sized_member( PitchEnv.nSustainEnd , uint8 , MagicBE("PiSE") ) - GET_MPTHEADER_sized_member( nNNA , uint8 , MagicBE("NNA.") ) - GET_MPTHEADER_sized_member( nDCT , uint8 , MagicBE("DCT.") ) - GET_MPTHEADER_sized_member( nDNA , uint8 , MagicBE("DNA.") ) - GET_MPTHEADER_sized_member( nPanSwing , uint8 , MagicBE("PS..") ) - GET_MPTHEADER_sized_member( nVolSwing , uint8 , MagicBE("VS..") ) - GET_MPTHEADER_sized_member( nIFC , uint8 , MagicBE("IFC.") ) - GET_MPTHEADER_sized_member( nIFR , uint8 , MagicBE("IFR.") ) - GET_MPTHEADER_sized_member( wMidiBank , uint16 , MagicBE("MB..") ) - GET_MPTHEADER_sized_member( nMidiProgram , uint8 , MagicBE("MP..") ) - GET_MPTHEADER_sized_member( nMidiChannel , uint8 , MagicBE("MC..") ) - GET_MPTHEADER_sized_member( nPPS , int8 , MagicBE("PPS.") ) - GET_MPTHEADER_sized_member( nPPC , uint8 , MagicBE("PPC.") ) - GET_MPTHEADER_envelope_member(ENV_VOLUME , tick , uint16 , MagicBE("VP[.") ) - GET_MPTHEADER_envelope_member(ENV_PANNING , tick , uint16 , MagicBE("PP[.") ) - GET_MPTHEADER_envelope_member(ENV_PITCH , tick , uint16 , MagicBE("PiP[") ) - GET_MPTHEADER_envelope_member(ENV_VOLUME , value , uint8 , MagicBE("VE[.") ) - GET_MPTHEADER_envelope_member(ENV_PANNING , value , uint8 , MagicBE("PE[.") ) - GET_MPTHEADER_envelope_member(ENV_PITCH , value , uint8 , MagicBE("PiE[") ) - GET_MPTHEADER_array_member( NoteMap , uint8 , MagicBE("NM[.") ) - GET_MPTHEADER_array_member( Keyboard , uint16 , MagicBE("K[..") ) - GET_MPTHEADER_charbuf_member( name , char , MagicBE("n[..") ) - GET_MPTHEADER_charbuf_member( filename , char , MagicBE("fn[.") ) - GET_MPTHEADER_sized_member( nMixPlug , uint8 , MagicBE("MiP.") ) - GET_MPTHEADER_sized_member( nVolRampUp , uint16 , MagicBE("VR..") ) - GET_MPTHEADER_sized_member( nCutSwing , uint8 , MagicBE("CS..") ) - GET_MPTHEADER_sized_member( nResSwing , uint8 , MagicBE("RS..") ) - GET_MPTHEADER_sized_member( filterMode , uint8 , MagicBE("FM..") ) - GET_MPTHEADER_sized_member( pluginVelocityHandling , uint8 , MagicBE("PVEH") ) - GET_MPTHEADER_sized_member( pluginVolumeHandling , uint8 , MagicBE("PVOH") ) - GET_MPTHEADER_sized_member( PitchEnv.nReleaseNode , uint8 , MagicBE("PERN") ) - GET_MPTHEADER_sized_member( PanEnv.nReleaseNode , uint8 , MagicBE("AERN") ) - GET_MPTHEADER_sized_member( VolEnv.nReleaseNode , uint8 , MagicBE("VERN") ) - GET_MPTHEADER_sized_member( midiPWD , int8 , MagicBE("MPWD") ) - // clang-format on + case MagicBE("FO.."): ReadInt(file, size, ins.nFadeOut); break; + case MagicBE("GV.."): ReadInt(file, size, ins.nGlobalVol); break; + case MagicBE("P..."): ReadInt(file, size, ins.nPan); break; + case MagicBE("VLS."): ReadInt(file, size, ins.VolEnv.nLoopStart); break; + case MagicBE("VLE."): ReadInt(file, size, ins.VolEnv.nLoopEnd); break; + case MagicBE("VSB."): ReadInt(file, size, ins.VolEnv.nSustainStart); break; + case MagicBE("VSE."): ReadInt(file, size, ins.VolEnv.nSustainEnd); break; + case MagicBE("PLS."): ReadInt(file, size, ins.PanEnv.nLoopStart); break; + case MagicBE("PLE."): ReadInt(file, size, ins.PanEnv.nLoopEnd); break; + case MagicBE("PSB."): ReadInt(file, size, ins.PanEnv.nSustainStart); break; + case MagicBE("PSE."): ReadInt(file, size, ins.PanEnv.nSustainEnd); break; + case MagicBE("PiLS"): ReadInt(file, size, ins.PitchEnv.nLoopStart); break; + case MagicBE("PiLE"): ReadInt(file, size, ins.PitchEnv.nLoopEnd); break; + case MagicBE("PiSB"): ReadInt(file, size, ins.PitchEnv.nSustainStart); break; + case MagicBE("PiSE"): ReadInt(file, size, ins.PitchEnv.nSustainEnd); break; + case MagicBE("NNA."): ReadEnum(file, size, ins.nNNA); break; + case MagicBE("DCT."): ReadEnum(file, size, ins.nDCT); break; + case MagicBE("DNA."): ReadEnum(file, size, ins.nDNA); break; + case MagicBE("PS.."): ReadInt(file, size, ins.nPanSwing); break; + case MagicBE("VS.."): ReadInt(file, size, ins.nVolSwing); break; + case MagicBE("IFC."): ReadInt(file, size, ins.nIFC); break; + case MagicBE("IFR."): ReadInt(file, size, ins.nIFR); break; + case MagicBE("MB.."): ReadInt(file, size, ins.wMidiBank); break; + case MagicBE("MP.."): ReadInt(file, size, ins.nMidiProgram); break; + case MagicBE("MC.."): ReadInt(file, size, ins.nMidiChannel); break; + case MagicBE("PPS."): ReadInt(file, size, ins.nPPS); break; + case MagicBE("PPC."): ReadInt(file, size, ins.nPPC); break; + case MagicBE("VP[."): ReadEnvelopeTicks(file, size, ins.VolEnv); break; + case MagicBE("PP[."): ReadEnvelopeTicks(file, size, ins.PanEnv); break; + case MagicBE("PiP["): ReadEnvelopeTicks(file, size, ins.PitchEnv); break; + case MagicBE("VE[."): ReadEnvelopeValues(file, size, ins.VolEnv); break; + case MagicBE("PE[."): ReadEnvelopeValues(file, size, ins.PanEnv); break; + case MagicBE("PiE["): ReadEnvelopeValues(file, size, ins.PitchEnv); break; + case MagicBE("MiP."): ReadInt(file, size, ins.nMixPlug); break; + case MagicBE("VR.."): ReadInt(file, size, ins.nVolRampUp); break; + case MagicBE("CS.."): ReadInt(file, size, ins.nCutSwing); break; + case MagicBE("RS.."): ReadInt(file, size, ins.nResSwing); break; + case MagicBE("FM.."): ReadEnum(file, size, ins.filterMode); break; + case MagicBE("PVEH"): ReadEnum(file, size, ins.pluginVelocityHandling); break; + case MagicBE("PVOH"): ReadEnum(file, size, ins.pluginVolumeHandling); break; + case MagicBE("PERN"): ReadInt(file, size, ins.PitchEnv.nReleaseNode); break; + case MagicBE("AERN"): ReadInt(file, size, ins.PanEnv.nReleaseNode); break; + case MagicBE("VERN"): ReadInt(file, size, ins.VolEnv.nReleaseNode); break; + case MagicBE("MPWD"): ReadInt(file, size, ins.midiPWD); break; case MagicBE("dF.."): - ConvertInstrumentFlags(*input, file.ReadSizedIntLE<uint32>(fsize)); - return true; + ConvertInstrumentFlags(ins, file.ReadSizedIntLE<uint32>(size)); + break; case MagicBE("VFLG"): - ConvertEnvelopeFlags(*input, file.ReadSizedIntLE<uint32>(fsize), ENV_VOLUME); - return true; + ConvertEnvelopeFlags(ins, file.ReadSizedIntLE<uint32>(size), ENV_VOLUME); + break; case MagicBE("AFLG"): - ConvertEnvelopeFlags(*input, file.ReadSizedIntLE<uint32>(fsize), ENV_PANNING); - return true; + ConvertEnvelopeFlags(ins, file.ReadSizedIntLE<uint32>(size), ENV_PANNING); + break; case MagicBE("PFLG"): - ConvertEnvelopeFlags(*input, file.ReadSizedIntLE<uint32>(fsize), ENV_PITCH); - return true; + ConvertEnvelopeFlags(ins, file.ReadSizedIntLE<uint32>(size), ENV_PITCH); + break; + case MagicBE("NM[."): + for(std::size_t i = 0; i < std::min(size, ins.NoteMap.size()); i++) + { + ins.NoteMap[i] = file.ReadUint8(); + } + break; + case MagicBE("n[.."): + { + char name[32] = ""; + file.ReadString<mpt::String::maybeNullTerminated>(name, size); + ins.name = name; + } + break; + case MagicBE("fn[."): + { + char filename[32] = ""; + file.ReadString<mpt::String::maybeNullTerminated>(filename, size); + ins.filename = filename; + } + break; case MagicBE("R..."): - { // Resampling has been written as various sizes including uint16 and uint32 in the past - uint32 tmp = file.ReadSizedIntLE<uint32>(fsize); - if(Resampling::IsKnownMode(tmp)) - input->resampling = static_cast<ResamplingMode>(tmp); - result = true; - } break; + if(uint32 resampling = file.ReadSizedIntLE<uint32>(size); Resampling::IsKnownMode(resampling)) + ins.resampling = static_cast<ResamplingMode>(resampling); + break; case MagicBE("PTTL"): - { // Integer part of pitch/tempo lock - uint16 tmp = file.ReadSizedIntLE<uint16>(fsize); - input->pitchToTempoLock.Set(tmp, input->pitchToTempoLock.GetFract()); - result = true; - } break; + ins.pitchToTempoLock.Set(file.ReadSizedIntLE<uint16>(size), ins.pitchToTempoLock.GetFract()); + break; case MagicLE("PTTF"): - { // Fractional part of pitch/tempo lock - uint16 tmp = file.ReadSizedIntLE<uint16>(fsize); - input->pitchToTempoLock.Set(input->pitchToTempoLock.GetInt(), tmp); - result = true; - } break; + ins.pitchToTempoLock.Set(ins.pitchToTempoLock.GetInt(), file.ReadSizedIntLE<uint16>(size)); + break; case MagicBE("VE.."): - input->VolEnv.resize(std::min(uint32(MAX_ENVPOINTS), file.ReadSizedIntLE<uint32>(fsize))); - result = true; + ins.VolEnv.resize(std::min(uint32(MAX_ENVPOINTS), file.ReadSizedIntLE<uint32>(size))); break; case MagicBE("PE.."): - input->PanEnv.resize(std::min(uint32(MAX_ENVPOINTS), file.ReadSizedIntLE<uint32>(fsize))); - result = true; + ins.PanEnv.resize(std::min(uint32(MAX_ENVPOINTS), file.ReadSizedIntLE<uint32>(size))); break; case MagicBE("PiE."): - input->PitchEnv.resize(std::min(uint32(MAX_ENVPOINTS), file.ReadSizedIntLE<uint32>(fsize))); - result = true; + ins.PitchEnv.resize(std::min(uint32(MAX_ENVPOINTS), file.ReadSizedIntLE<uint32>(size))); break; } - - return result; } -void ReadInstrumentExtensionField(ModInstrument* pIns, const uint32 code, const uint16 size, FileReader &file) -{ - if(code == MagicBE("K[..")) - { - // skip keyboard mapping - file.Skip(size); - return; - } - - bool success = ReadInstrumentHeaderField(pIns, code, size, file); - if(!success) - { - file.Skip(size); - return; - } -} - - -void ReadExtendedInstrumentProperty(ModInstrument* pIns, const uint32 code, FileReader &file) +// For ITP and internal usage +void ReadExtendedInstrumentProperty(ModInstrument *ins, const uint32 code, FileReader &file) { uint16 size = file.ReadUint16LE(); - if(!file.CanRead(size)) - { - return; - } - ReadInstrumentExtensionField(pIns, code, size, file); + FileReader chunk = file.ReadChunk(size); + if(ins && chunk.GetLength() == size) + ReadInstrumentHeaderField(*ins, code, chunk); } -void ReadExtendedInstrumentProperties(ModInstrument* pIns, FileReader &file) +// For ITI / XI +void ReadExtendedInstrumentProperties(ModInstrument &ins, FileReader &file) { - if(!file.ReadMagic("XTPM")) // 'MPTX' - { + if(!file.ReadMagic("XTPM")) // 'MPTX' return; - } while(file.CanRead(7)) { - ReadExtendedInstrumentProperty(pIns, file.ReadUint32LE(), file); + ReadExtendedInstrumentProperty(&ins, file.ReadUint32LE(), file); } } +// For IT / XM / MO3 bool CSoundFile::LoadExtendedInstrumentProperties(FileReader &file) { - if(!file.ReadMagic("XTPM")) // 'MPTX' - { + if(!file.ReadMagic("XTPM")) // 'MPTX' return false; - } while(file.CanRead(6)) { uint32 code = file.ReadUint32LE(); - if(code == MagicBE("MPTS") // Reached song extensions, break out of this loop - || code == MagicLE("228\x04") // Reached MPTM extensions (in case there are no song extensions) - || (code & 0x80808080) || !(code & 0x60606060)) // Non-ASCII chunk ID + if(code == MagicBE("MPTS") // Reached song extensions, break out of this loop + || code == MagicLE("228\x04") // Reached MPTM extensions (in case there are no song extensions) + || (code & 0x80808080) || !(code & 0x60606060)) // Non-ASCII chunk ID { file.SkipBack(4); break; @@ -746,10 +650,9 @@ for(INSTRUMENTINDEX i = 1; i <= GetNumInstruments(); i++) { - if(Instruments[i]) - { - ReadInstrumentExtensionField(Instruments[i], code, size, file); - } + FileReader chunk = file.ReadChunk(size); + if(Instruments[i] && chunk.GetLength() == size) + ReadInstrumentHeaderField(*Instruments[i], code, chunk); } } return true; Modified: trunk/OpenMPT/soundlib/SampleFormats.cpp ============================================================================== --- trunk/OpenMPT/soundlib/SampleFormats.cpp Fri Dec 13 20:35:28 2024 (r22537) +++ trunk/OpenMPT/soundlib/SampleFormats.cpp Fri Dec 13 21:55:55 2024 (r22538) @@ -1341,7 +1341,7 @@ } // Read MPT crap - ReadExtendedInstrumentProperties(pIns, file); + ReadExtendedInstrumentProperties(*pIns, file); pIns->Convert(MOD_TYPE_XM, GetType()); pIns->Sanitize(GetType()); return true; @@ -2405,7 +2405,7 @@ if(file.Seek(extraOffset)) { // Read MPT crap - ReadExtendedInstrumentProperties(pIns, file); + ReadExtendedInstrumentProperties(*pIns, file); } pIns->Convert(MOD_TYPE_IT, GetType()); Modified: trunk/OpenMPT/soundlib/Sndfile.h ============================================================================== --- trunk/OpenMPT/soundlib/Sndfile.h Fri Dec 13 20:35:28 2024 (r22537) +++ trunk/OpenMPT/soundlib/Sndfile.h Fri Dec 13 21:55:55 2024 (r22538) @@ -74,9 +74,10 @@ #ifndef MODPLUG_NO_FILESAVE void WriteInstrumentHeaderStructOrField(ModInstrument * input, std::ostream &file, uint32 only_this_code = -1 /* -1 for all */, uint16 fixedsize = 0); #endif // !MODPLUG_NO_FILESAVE -bool ReadInstrumentHeaderField(ModInstrument * input, uint32 fcode, uint16 fsize, FileReader &file); -// -------------------------------------------------------------------------------------------- -// -------------------------------------------------------------------------------------------- +// ITP: Read instrument property with 'code' from 'file' to instrument 'ins'. +void ReadExtendedInstrumentProperty(ModInstrument *ins, const uint32 code, FileReader &file); +// ITI / XI: Read extended instrument properties from 'file' to instrument 'ins'. +void ReadExtendedInstrumentProperties(ModInstrument &ins, FileReader &file); // Sample decompression routines in format-specific source files @@ -1296,22 +1297,10 @@ #endif // NO_PLUGINS -/////////////////////////////////////////////////////////// -// Low-level Mixing functions - #define FADESONGDELAY 100 MPT_CONSTEXPRINLINE int8 MOD2XMFineTune(int v) { return static_cast<int8>(static_cast<uint8>(v) << 4); } MPT_CONSTEXPRINLINE int8 XM2MODFineTune(int v) { return static_cast<int8>(static_cast<uint8>(v) >> 4); } -// Read instrument property with 'code' and 'size' from 'file' to instrument 'pIns'. -void ReadInstrumentExtensionField(ModInstrument* pIns, const uint32 code, const uint16 size, FileReader &file); - -// Read instrument property with 'code' from 'file' to instrument 'pIns'. -void ReadExtendedInstrumentProperty(ModInstrument* pIns, const uint32 code, FileReader &file); - -// Read extended instrument properties from 'file' to instrument 'pIns'. -void ReadExtendedInstrumentProperties(ModInstrument* pIns, FileReader &file); - OPENMPT_NAMESPACE_END |
From: <sv...@op...> - 2024-12-13 19:35:43
|
Author: sagamusix Date: Fri Dec 13 20:35:28 2024 New Revision: 22537 URL: https://source.openmpt.org/browse/openmpt/?op=revision&rev=22537 Log: Merged revision(s) 22536 from trunk/OpenMPT: [Fix] Since r10709 (1.28.00.30), instrument and envelope flags were no longer read correctly from ITP files, because internal storage was smaller than what was written to files. ........ Modified: branches/OpenMPT-1.31/ (props changed) branches/OpenMPT-1.31/soundlib/InstrumentExtensions.cpp Modified: branches/OpenMPT-1.31/soundlib/InstrumentExtensions.cpp ============================================================================== --- branches/OpenMPT-1.31/soundlib/InstrumentExtensions.cpp Fri Dec 13 20:35:08 2024 (r22536) +++ branches/OpenMPT-1.31/soundlib/InstrumentExtensions.cpp Fri Dec 13 20:35:28 2024 (r22537) @@ -483,6 +483,42 @@ #endif // !MODPLUG_NO_FILESAVE +// Convert instrument flags which were read from 'dF..' extension to proper internal representation. +static void ConvertInstrumentFlags(ModInstrument &ins, uint32 flags) +{ + ins.VolEnv.dwFlags.set(ENV_ENABLED, (flags & 0x0001) != 0); + ins.VolEnv.dwFlags.set(ENV_SUSTAIN, (flags & 0x0002) != 0); + ins.VolEnv.dwFlags.set(ENV_LOOP, (flags & 0x0004) != 0); + ins.VolEnv.dwFlags.set(ENV_CARRY, (flags & 0x0800) != 0); + + ins.PanEnv.dwFlags.set(ENV_ENABLED, (flags & 0x0008) != 0); + ins.PanEnv.dwFlags.set(ENV_SUSTAIN, (flags & 0x0010) != 0); + ins.PanEnv.dwFlags.set(ENV_LOOP, (flags & 0x0020) != 0); + ins.PanEnv.dwFlags.set(ENV_CARRY, (flags & 0x1000) != 0); + + ins.PitchEnv.dwFlags.set(ENV_ENABLED, (flags & 0x0040) != 0); + ins.PitchEnv.dwFlags.set(ENV_SUSTAIN, (flags & 0x0080) != 0); + ins.PitchEnv.dwFlags.set(ENV_LOOP, (flags & 0x0100) != 0); + ins.PitchEnv.dwFlags.set(ENV_CARRY, (flags & 0x2000) != 0); + ins.PitchEnv.dwFlags.set(ENV_FILTER, (flags & 0x0400) != 0); + + ins.dwFlags.set(INS_SETPANNING, (flags & 0x0200) != 0); + ins.dwFlags.set(INS_MUTE, (flags & 0x4000) != 0); +} + + +// Convert VFLG / PFLG / AFLG +static void ConvertEnvelopeFlags(ModInstrument &instr, uint32 flags, EnvelopeType envType) +{ + InstrumentEnvelope &env = instr.GetEnvelope(envType); + env.dwFlags.set(ENV_ENABLED, (flags & 0x01) != 0); + env.dwFlags.set(ENV_LOOP, (flags & 0x02) != 0); + env.dwFlags.set(ENV_SUSTAIN, (flags & 0x04) != 0); + env.dwFlags.set(ENV_CARRY, (flags & 0x08) != 0); + env.dwFlags.set(ENV_FILTER, (envType == ENV_PITCH) && (flags & 0x10) != 0); +} + + // -------------------------------------------------------------------------------------------- // Convenient macro to help GET_HEADER declaration for single type members ONLY (non-array) // -------------------------------------------------------------------------------------------- @@ -569,7 +605,6 @@ { // clang-format off GET_MPTHEADER_sized_member( nFadeOut , uint32 , MagicBE("FO..") ) - GET_MPTHEADER_sized_member( dwFlags , uint8 , MagicBE("dF..") ) GET_MPTHEADER_sized_member( nGlobalVol , uint32 , MagicBE("GV..") ) GET_MPTHEADER_sized_member( nPan , uint32 , MagicBE("P...") ) GET_MPTHEADER_sized_member( VolEnv.nLoopStart , uint8 , MagicBE("VLS.") ) @@ -616,11 +651,20 @@ GET_MPTHEADER_sized_member( PitchEnv.nReleaseNode , uint8 , MagicBE("PERN") ) GET_MPTHEADER_sized_member( PanEnv.nReleaseNode , uint8 , MagicBE("AERN") ) GET_MPTHEADER_sized_member( VolEnv.nReleaseNode , uint8 , MagicBE("VERN") ) - GET_MPTHEADER_sized_member( PitchEnv.dwFlags , uint8 , MagicBE("PFLG") ) - GET_MPTHEADER_sized_member( PanEnv.dwFlags , uint8 , MagicBE("AFLG") ) - GET_MPTHEADER_sized_member( VolEnv.dwFlags , uint8 , MagicBE("VFLG") ) GET_MPTHEADER_sized_member( midiPWD , int8 , MagicBE("MPWD") ) // clang-format on + case MagicBE("dF.."): + ConvertInstrumentFlags(*input, file.ReadSizedIntLE<uint32>(fsize)); + return true; + case MagicBE("VFLG"): + ConvertEnvelopeFlags(*input, file.ReadSizedIntLE<uint32>(fsize), ENV_VOLUME); + return true; + case MagicBE("AFLG"): + ConvertEnvelopeFlags(*input, file.ReadSizedIntLE<uint32>(fsize), ENV_PANNING); + return true; + case MagicBE("PFLG"): + ConvertEnvelopeFlags(*input, file.ReadSizedIntLE<uint32>(fsize), ENV_PITCH); + return true; case MagicBE("R..."): { // Resampling has been written as various sizes including uint16 and uint32 in the past @@ -660,54 +704,6 @@ return result; } - -// Convert instrument flags which were read from 'dF..' extension to proper internal representation. -static void ConvertReadExtendedFlags(ModInstrument *pIns) -{ - // Flags of 'dF..' datafield in extended instrument properties. - enum - { - dFdd_VOLUME = 0x0001, - dFdd_VOLSUSTAIN = 0x0002, - dFdd_VOLLOOP = 0x0004, - dFdd_PANNING = 0x0008, - dFdd_PANSUSTAIN = 0x0010, - dFdd_PANLOOP = 0x0020, - dFdd_PITCH = 0x0040, - dFdd_PITCHSUSTAIN = 0x0080, - dFdd_PITCHLOOP = 0x0100, - dFdd_SETPANNING = 0x0200, - dFdd_FILTER = 0x0400, - dFdd_VOLCARRY = 0x0800, - dFdd_PANCARRY = 0x1000, - dFdd_PITCHCARRY = 0x2000, - dFdd_MUTE = 0x4000, - }; - - const uint32 dwOldFlags = pIns->dwFlags.GetRaw(); - - pIns->VolEnv.dwFlags.set(ENV_ENABLED, (dwOldFlags & dFdd_VOLUME) != 0); - pIns->VolEnv.dwFlags.set(ENV_SUSTAIN, (dwOldFlags & dFdd_VOLSUSTAIN) != 0); - pIns->VolEnv.dwFlags.set(ENV_LOOP, (dwOldFlags & dFdd_VOLLOOP) != 0); - pIns->VolEnv.dwFlags.set(ENV_CARRY, (dwOldFlags & dFdd_VOLCARRY) != 0); - - pIns->PanEnv.dwFlags.set(ENV_ENABLED, (dwOldFlags & dFdd_PANNING) != 0); - pIns->PanEnv.dwFlags.set(ENV_SUSTAIN, (dwOldFlags & dFdd_PANSUSTAIN) != 0); - pIns->PanEnv.dwFlags.set(ENV_LOOP, (dwOldFlags & dFdd_PANLOOP) != 0); - pIns->PanEnv.dwFlags.set(ENV_CARRY, (dwOldFlags & dFdd_PANCARRY) != 0); - - pIns->PitchEnv.dwFlags.set(ENV_ENABLED, (dwOldFlags & dFdd_PITCH) != 0); - pIns->PitchEnv.dwFlags.set(ENV_SUSTAIN, (dwOldFlags & dFdd_PITCHSUSTAIN) != 0); - pIns->PitchEnv.dwFlags.set(ENV_LOOP, (dwOldFlags & dFdd_PITCHLOOP) != 0); - pIns->PitchEnv.dwFlags.set(ENV_CARRY, (dwOldFlags & dFdd_PITCHCARRY) != 0); - pIns->PitchEnv.dwFlags.set(ENV_FILTER, (dwOldFlags & dFdd_FILTER) != 0); - - pIns->dwFlags.reset(); - pIns->dwFlags.set(INS_SETPANNING, (dwOldFlags & dFdd_SETPANNING) != 0); - pIns->dwFlags.set(INS_MUTE, (dwOldFlags & dFdd_MUTE) != 0); -} - - void ReadInstrumentExtensionField(ModInstrument* pIns, const uint32 code, const uint16 size, FileReader &file) { if(code == MagicBE("K[..")) @@ -724,9 +720,6 @@ file.Skip(size); return; } - - if(code == MagicBE("dF..")) // 'dF..' field requires additional processing. - ConvertReadExtendedFlags(pIns); } |
From: <sv...@op...> - 2024-12-13 19:35:21
|
Author: sagamusix Date: Fri Dec 13 20:35:08 2024 New Revision: 22536 URL: https://source.openmpt.org/browse/openmpt/?op=revision&rev=22536 Log: [Fix] Since r10709 (1.28.00.30), instrument and envelope flags were no longer read correctly from ITP files, because internal storage was smaller than what was written to files. Modified: trunk/OpenMPT/soundlib/InstrumentExtensions.cpp Modified: trunk/OpenMPT/soundlib/InstrumentExtensions.cpp ============================================================================== --- trunk/OpenMPT/soundlib/InstrumentExtensions.cpp Fri Dec 13 19:38:01 2024 (r22535) +++ trunk/OpenMPT/soundlib/InstrumentExtensions.cpp Fri Dec 13 20:35:08 2024 (r22536) @@ -457,6 +457,42 @@ #endif // !MODPLUG_NO_FILESAVE +// Convert instrument flags which were read from 'dF..' extension to proper internal representation. +static void ConvertInstrumentFlags(ModInstrument &ins, uint32 flags) +{ + ins.VolEnv.dwFlags.set(ENV_ENABLED, (flags & 0x0001) != 0); + ins.VolEnv.dwFlags.set(ENV_SUSTAIN, (flags & 0x0002) != 0); + ins.VolEnv.dwFlags.set(ENV_LOOP, (flags & 0x0004) != 0); + ins.VolEnv.dwFlags.set(ENV_CARRY, (flags & 0x0800) != 0); + + ins.PanEnv.dwFlags.set(ENV_ENABLED, (flags & 0x0008) != 0); + ins.PanEnv.dwFlags.set(ENV_SUSTAIN, (flags & 0x0010) != 0); + ins.PanEnv.dwFlags.set(ENV_LOOP, (flags & 0x0020) != 0); + ins.PanEnv.dwFlags.set(ENV_CARRY, (flags & 0x1000) != 0); + + ins.PitchEnv.dwFlags.set(ENV_ENABLED, (flags & 0x0040) != 0); + ins.PitchEnv.dwFlags.set(ENV_SUSTAIN, (flags & 0x0080) != 0); + ins.PitchEnv.dwFlags.set(ENV_LOOP, (flags & 0x0100) != 0); + ins.PitchEnv.dwFlags.set(ENV_CARRY, (flags & 0x2000) != 0); + ins.PitchEnv.dwFlags.set(ENV_FILTER, (flags & 0x0400) != 0); + + ins.dwFlags.set(INS_SETPANNING, (flags & 0x0200) != 0); + ins.dwFlags.set(INS_MUTE, (flags & 0x4000) != 0); +} + + +// Convert VFLG / PFLG / AFLG +static void ConvertEnvelopeFlags(ModInstrument &instr, uint32 flags, EnvelopeType envType) +{ + InstrumentEnvelope &env = instr.GetEnvelope(envType); + env.dwFlags.set(ENV_ENABLED, (flags & 0x01) != 0); + env.dwFlags.set(ENV_LOOP, (flags & 0x02) != 0); + env.dwFlags.set(ENV_SUSTAIN, (flags & 0x04) != 0); + env.dwFlags.set(ENV_CARRY, (flags & 0x08) != 0); + env.dwFlags.set(ENV_FILTER, (envType == ENV_PITCH) && (flags & 0x10) != 0); +} + + // -------------------------------------------------------------------------------------------- // Convenient macro to help GET_HEADER declaration for single type members ONLY (non-array) // -------------------------------------------------------------------------------------------- @@ -543,7 +579,6 @@ { // clang-format off GET_MPTHEADER_sized_member( nFadeOut , uint32 , MagicBE("FO..") ) - GET_MPTHEADER_sized_member( dwFlags , uint8 , MagicBE("dF..") ) GET_MPTHEADER_sized_member( nGlobalVol , uint32 , MagicBE("GV..") ) GET_MPTHEADER_sized_member( nPan , uint32 , MagicBE("P...") ) GET_MPTHEADER_sized_member( VolEnv.nLoopStart , uint8 , MagicBE("VLS.") ) @@ -590,11 +625,20 @@ GET_MPTHEADER_sized_member( PitchEnv.nReleaseNode , uint8 , MagicBE("PERN") ) GET_MPTHEADER_sized_member( PanEnv.nReleaseNode , uint8 , MagicBE("AERN") ) GET_MPTHEADER_sized_member( VolEnv.nReleaseNode , uint8 , MagicBE("VERN") ) - GET_MPTHEADER_sized_member( PitchEnv.dwFlags , uint8 , MagicBE("PFLG") ) - GET_MPTHEADER_sized_member( PanEnv.dwFlags , uint8 , MagicBE("AFLG") ) - GET_MPTHEADER_sized_member( VolEnv.dwFlags , uint8 , MagicBE("VFLG") ) GET_MPTHEADER_sized_member( midiPWD , int8 , MagicBE("MPWD") ) // clang-format on + case MagicBE("dF.."): + ConvertInstrumentFlags(*input, file.ReadSizedIntLE<uint32>(fsize)); + return true; + case MagicBE("VFLG"): + ConvertEnvelopeFlags(*input, file.ReadSizedIntLE<uint32>(fsize), ENV_VOLUME); + return true; + case MagicBE("AFLG"): + ConvertEnvelopeFlags(*input, file.ReadSizedIntLE<uint32>(fsize), ENV_PANNING); + return true; + case MagicBE("PFLG"): + ConvertEnvelopeFlags(*input, file.ReadSizedIntLE<uint32>(fsize), ENV_PITCH); + return true; case MagicBE("R..."): { // Resampling has been written as various sizes including uint16 and uint32 in the past @@ -634,54 +678,6 @@ return result; } - -// Convert instrument flags which were read from 'dF..' extension to proper internal representation. -static void ConvertReadExtendedFlags(ModInstrument *pIns) -{ - // Flags of 'dF..' datafield in extended instrument properties. - enum - { - dFdd_VOLUME = 0x0001, - dFdd_VOLSUSTAIN = 0x0002, - dFdd_VOLLOOP = 0x0004, - dFdd_PANNING = 0x0008, - dFdd_PANSUSTAIN = 0x0010, - dFdd_PANLOOP = 0x0020, - dFdd_PITCH = 0x0040, - dFdd_PITCHSUSTAIN = 0x0080, - dFdd_PITCHLOOP = 0x0100, - dFdd_SETPANNING = 0x0200, - dFdd_FILTER = 0x0400, - dFdd_VOLCARRY = 0x0800, - dFdd_PANCARRY = 0x1000, - dFdd_PITCHCARRY = 0x2000, - dFdd_MUTE = 0x4000, - }; - - const uint32 dwOldFlags = pIns->dwFlags.GetRaw(); - - pIns->VolEnv.dwFlags.set(ENV_ENABLED, (dwOldFlags & dFdd_VOLUME) != 0); - pIns->VolEnv.dwFlags.set(ENV_SUSTAIN, (dwOldFlags & dFdd_VOLSUSTAIN) != 0); - pIns->VolEnv.dwFlags.set(ENV_LOOP, (dwOldFlags & dFdd_VOLLOOP) != 0); - pIns->VolEnv.dwFlags.set(ENV_CARRY, (dwOldFlags & dFdd_VOLCARRY) != 0); - - pIns->PanEnv.dwFlags.set(ENV_ENABLED, (dwOldFlags & dFdd_PANNING) != 0); - pIns->PanEnv.dwFlags.set(ENV_SUSTAIN, (dwOldFlags & dFdd_PANSUSTAIN) != 0); - pIns->PanEnv.dwFlags.set(ENV_LOOP, (dwOldFlags & dFdd_PANLOOP) != 0); - pIns->PanEnv.dwFlags.set(ENV_CARRY, (dwOldFlags & dFdd_PANCARRY) != 0); - - pIns->PitchEnv.dwFlags.set(ENV_ENABLED, (dwOldFlags & dFdd_PITCH) != 0); - pIns->PitchEnv.dwFlags.set(ENV_SUSTAIN, (dwOldFlags & dFdd_PITCHSUSTAIN) != 0); - pIns->PitchEnv.dwFlags.set(ENV_LOOP, (dwOldFlags & dFdd_PITCHLOOP) != 0); - pIns->PitchEnv.dwFlags.set(ENV_CARRY, (dwOldFlags & dFdd_PITCHCARRY) != 0); - pIns->PitchEnv.dwFlags.set(ENV_FILTER, (dwOldFlags & dFdd_FILTER) != 0); - - pIns->dwFlags.reset(); - pIns->dwFlags.set(INS_SETPANNING, (dwOldFlags & dFdd_SETPANNING) != 0); - pIns->dwFlags.set(INS_MUTE, (dwOldFlags & dFdd_MUTE) != 0); -} - - void ReadInstrumentExtensionField(ModInstrument* pIns, const uint32 code, const uint16 size, FileReader &file) { if(code == MagicBE("K[..")) @@ -698,9 +694,6 @@ file.Skip(size); return; } - - if(code == MagicBE("dF..")) // 'dF..' field requires additional processing. - ConvertReadExtendedFlags(pIns); } |
From: <sv...@op...> - 2024-12-13 18:38:13
|
Author: sagamusix Date: Fri Dec 13 19:38:01 2024 New Revision: 22535 URL: https://source.openmpt.org/browse/openmpt/?op=revision&rev=22535 Log: [Var] Split out non-instrument chunk IDs from instrument extensions documentation. Modified: trunk/OpenMPT/soundlib/InstrumentExtensions.cpp trunk/OpenMPT/soundlib/Load_it.cpp Modified: trunk/OpenMPT/soundlib/InstrumentExtensions.cpp ============================================================================== --- trunk/OpenMPT/soundlib/InstrumentExtensions.cpp Fri Dec 13 19:28:17 2024 (r22534) +++ trunk/OpenMPT/soundlib/InstrumentExtensions.cpp Fri Dec 13 19:38:01 2024 (r22535) @@ -66,94 +66,71 @@ * In use CODE tag dictionary (alphabetical order): -------------------------------------------------- - !!!!!!!!!!!!!!!!!!!!!!!!!!!!! - !!! SECTION TO BE UPDATED !!! - !!!!!!!!!!!!!!!!!!!!!!!!!!!!! +CS.. nCutSwing +DCT. nDCT +dF.. dwFlags +DNA. nDNA +FM.. filterMode +fn[. filename[12] +FO.. nFadeOut +GV.. nGlobalVol +IFC. nIFC +IFR. nIFR +K[.. Keyboard[128] +MB.. wMidiBank +MC.. nMidiChannel +MDK. nMidiDrumKey +MiP. nMixPlug +MP.. nMidiProgram +n[.. name[32] +NNA. nNNA +NM[. NoteMap[128] +P... nPan +PE.. PanEnv.nNodes +PE[. PanEnv.Values[MAX_ENVPOINTS] +PiE. PitchEnv.nNodes +PiE[ PitchEnv.Values[MAX_ENVPOINTS] +PiLE PitchEnv.nLoopEnd +PiLS PitchEnv.nLoopStart +PiP[ PitchEnv.Ticks[MAX_ENVPOINTS] +PiSB PitchEnv.nSustainStart +PiSE PitchEnv.nSustainEnd +PLE. PanEnv.nLoopEnd +PLS. PanEnv.nLoopStart +PP[. PanEnv.Ticks[MAX_ENVPOINTS] +PPC. nPPC +PPS. nPPS +PS.. nPanSwing +PSB. PanEnv.nSustainStart +PSE. PanEnv.nSustainEnd +PTTL pitchToTempoLock +PTTF pitchToTempoLock (fractional part) +PVEH pluginVelocityHandling +PVOH pluginVolumeHandling +R... Resampling +RS.. nResSwing +VE.. VolEnv.nNodes +VE[. VolEnv.Values[MAX_ENVPOINTS] +VLE. VolEnv.nLoopEnd +VLS. VolEnv.nLoopStart +VP[. VolEnv.Ticks[MAX_ENVPOINTS] +VR.. nVolRampUp +VS.. nVolSwing +VSB. VolEnv.nSustainStart +VSE. VolEnv.nSustainEnd +PERN PitchEnv.nReleaseNode +AERN PanEnv.nReleaseNode +VERN VolEnv.nReleaseNode +PFLG PitchEnv.dwFlag +AFLG PanEnv.dwFlags +VFLG VolEnv.dwFlags +MPWD MIDI Pitch Wheel Depth + +Note that many of these extensions were only relevant for ITP files, and thus there is no code for writing them, only reading. +Some of them used to be written but were never read ("K[.." sample map - it was only relevant for ITP files, but even there +it was always ignored, because sample indices might change when loading external instruments). - [EXT] means external (not related) to ModInstrument content -AUTH [EXT] Song artist -C... [EXT] nChannels -ChnS [EXT] IT/MPTM: Channel settings for channels 65-127 if needed (doesn't fit to IT header). -CS.. nCutSwing -CUES [EXT] Sample cue points -CWV. [EXT] dwCreatedWithVersion -DCT. nDCT; -dF.. dwFlags; -DGV. [EXT] nDefaultGlobalVolume -DT.. [EXT] nDefaultTempo; -DTFR [EXT] Fractional part of default tempo -DNA. nDNA; -EBIH [EXT] embeded instrument header tag (ITP file format) -FM.. filterMode; -fn[. filename[12]; -FO.. nFadeOut; -GV.. nGlobalVol; -IFC. nIFC; -IFR. nIFR; -K[. Keyboard[128]; -LSWV [EXT] Last Saved With Version -MB.. wMidiBank; -MC.. nMidiChannel; -MDK. nMidiDrumKey; -MIMA [EXT] MIdi MApping directives -MiP. nMixPlug; -MP.. nMidiProgram; -MPTS [EXT] Extra song info tag -MPTX [EXT] EXTRA INFO tag -MSF. [EXT] Mod(Specific)Flags -n[.. name[32]; -NNA. nNNA; -NM[. NoteMap[128]; -P... nPan; -PE.. PanEnv.nNodes; -PE[. PanEnv.Values[MAX_ENVPOINTS]; -PiE. PitchEnv.nNodes; -PiE[ PitchEnv.Values[MAX_ENVPOINTS]; -PiLE PitchEnv.nLoopEnd; -PiLS PitchEnv.nLoopStart; -PiP[ PitchEnv.Ticks[MAX_ENVPOINTS]; -PiSB PitchEnv.nSustainStart; -PiSE PitchEnv.nSustainEnd; -PLE. PanEnv.nLoopEnd; -PLS. PanEnv.nLoopStart; -PMM. [EXT] nPlugMixMode; -PP[. PanEnv.Ticks[MAX_ENVPOINTS]; -PPC. nPPC; -PPS. nPPS; -PS.. nPanSwing; -PSB. PanEnv.nSustainStart; -PSE. PanEnv.nSustainEnd; -PTTL pitchToTempoLock; -PTTF pitchToTempoLock (fractional part); -PVEH pluginVelocityHandling; -PVOH pluginVolumeHandling; -R... resampling; -RP.. [EXT] nRestartPos; -RPB. [EXT] nRowsPerBeat; -RPM. [EXT] nRowsPerMeasure; -RS.. nResSwing; -RSMP [EXT] Global resampling -SEP@ [EXT] chunk SEPARATOR tag -SPA. [EXT] m_nSamplePreAmp; -TM.. [EXT] nTempoMode; -VE.. VolEnv.nNodes; -VE[. VolEnv.Values[MAX_ENVPOINTS]; -VLE. VolEnv.nLoopEnd; -VLS. VolEnv.nLoopStart; -VP[. VolEnv.Ticks[MAX_ENVPOINTS]; -VR.. nVolRampUp; -VS.. nVolSwing; -VSB. VolEnv.nSustainStart; -VSE. VolEnv.nSustainEnd; -VSTV [EXT] nVSTiVolume; -PERN PitchEnv.nReleaseNode -AERN PanEnv.nReleaseNode -VERN VolEnv.nReleaseNode -PFLG PitchEnv.dwFlag -AFLG PanEnv.dwFlags -VFLG VolEnv.dwFlags -MPWD MIDI Pitch Wheel Depth ----------------------------------------------------------------------------------------------- ---------------------------------------------------------------------------------------------*/ Modified: trunk/OpenMPT/soundlib/Load_it.cpp ============================================================================== --- trunk/OpenMPT/soundlib/Load_it.cpp Fri Dec 13 19:28:17 2024 (r22534) +++ trunk/OpenMPT/soundlib/Load_it.cpp Fri Dec 13 19:38:01 2024 (r22535) @@ -2499,6 +2499,31 @@ #endif // MODPLUG_NO_FILESAVE +/* +The following song properties can be read and written: +AUTH [all] Song artist +C... [IT / MPTM] Number of channels (for IT / MPTM where there is no explicit channel count and we want to keep the properties of channels beyond the last channel that contains any pattern data) +CCOL [all] Channel colors +ChnS [IT / MPTM] Channel settings for channels 65-127 if needed (doesn't fit to IT header). +CUES [MPTM] Sample cue points +CWV. [all] Created With Version +DGV. [XM] Default Global Volume +DT.. [all] Default Tempo, if it doesn't fit in the header value +DTFR [MPTM] Fractional part of default tempo +LSWV [all] Last Saved With Version +MIMA [all] MIdi MApping directives +MSF. [all] Mod(Specific)Flags +PMM. [all] Mix Mode +RP.. [IT / MPTM] Legacy Restart Position +RPB. [all] Rows Per Beat (if not supported / value doesn't fit in header) +RPM. [all] Per Measure (if not supported / value doesn't fit in header) +RSMP [MPTM] Default resampling +SPA. [all] Sample Pre-Amp (if not supported / value doesn't fit in header) +SWNG [MPTM] Tempo swing factors +TM.. [all] Tempo Mode +VSTV [all] Synth volume +*/ + template<typename T> void ReadField(FileReader &chunk, std::size_t size, T &field) { |
From: <sv...@op...> - 2024-12-13 18:28:23
|
Author: sagamusix Date: Fri Dec 13 19:28:17 2024 New Revision: 22534 URL: https://source.openmpt.org/browse/openmpt/?op=revision&rev=22534 Log: [Mod] Never write instrument envelope flags as extended instrument properties to ITI / XI files. This was only required for ITPs. Modified: trunk/OpenMPT/soundlib/InstrumentExtensions.cpp Modified: trunk/OpenMPT/soundlib/InstrumentExtensions.cpp ============================================================================== --- trunk/OpenMPT/soundlib/InstrumentExtensions.cpp Fri Dec 13 19:21:42 2024 (r22533) +++ trunk/OpenMPT/soundlib/InstrumentExtensions.cpp Fri Dec 13 19:28:17 2024 (r22534) @@ -332,9 +332,6 @@ WRITE_MPTHEADER_sized_member( PitchEnv.nReleaseNode , uint8 , MagicBE("PERN") ) WRITE_MPTHEADER_sized_member( PanEnv.nReleaseNode , uint8 , MagicBE("AERN") ) WRITE_MPTHEADER_sized_member( VolEnv.nReleaseNode , uint8 , MagicBE("VERN") ) - WRITE_MPTHEADER_sized_member( PitchEnv.dwFlags , uint8 , MagicBE("PFLG") ) - WRITE_MPTHEADER_sized_member( PanEnv.dwFlags , uint8 , MagicBE("AFLG") ) - WRITE_MPTHEADER_sized_member( VolEnv.dwFlags , uint8 , MagicBE("VFLG") ) WRITE_MPTHEADER_sized_member( midiPWD , int8 , MagicBE("MPWD") ) // clang-format on |
From: <sv...@op...> - 2024-12-13 18:22:06
|
Author: sagamusix Date: Fri Dec 13 19:21:42 2024 New Revision: 22533 URL: https://source.openmpt.org/browse/openmpt/?op=revision&rev=22533 Log: [Var] Improve comments. Modified: trunk/OpenMPT/soundlib/pattern.h Modified: trunk/OpenMPT/soundlib/pattern.h ============================================================================== --- trunk/OpenMPT/soundlib/pattern.h Fri Dec 13 19:19:53 2024 (r22532) +++ trunk/OpenMPT/soundlib/pattern.h Fri Dec 13 19:21:42 2024 (r22533) @@ -68,7 +68,7 @@ // Deallocate pattern data. void Deallocate(); - // Removes all modcommands from the pattern. + // Empties all ModCommands in the pattern. void ClearCommands() noexcept; // Returns associated soundfile. @@ -131,7 +131,7 @@ protected: std::vector<ModCommand> m_ModCommands; ROWINDEX m_Rows = 0; - ROWINDEX m_RowsPerBeat = 0; // patterns-specific time signature. if != 0, this is implicitely set. + ROWINDEX m_RowsPerBeat = 0; // patterns-specific time signature. if != 0, the time signature is used automatically. ROWINDEX m_RowsPerMeasure = 0; // ditto TempoSwing m_tempoSwing; std::string m_PatternName; @@ -154,9 +154,9 @@ // Row advance mode enum RetryMode : uint8 { - rmIgnore, // If effect can't be written, abort. - rmTryNextRow, // If effect can't be written, try next row. - rmTryPreviousRow, // If effect can't be written, try previous row. + rmIgnore, // If effect can't be written, abort. + rmTryNextRow, // If effect can't be written, try next row. + rmTryPreviousRow, // If effect can't be written, try previous row. }; public: |
From: <sv...@op...> - 2024-12-13 18:20:05
|
Author: sagamusix Date: Fri Dec 13 19:19:53 2024 New Revision: 22532 URL: https://source.openmpt.org/browse/openmpt/?op=revision&rev=22532 Log: Merged revision(s) 22531 from trunk/OpenMPT: [Fix] ITP: Instruments paths were always read as relative paths since r17468 (so since the first official release of OpenMPT 1.31), usually causing them to file to load. ........ Modified: branches/OpenMPT-1.31/ (props changed) branches/OpenMPT-1.31/soundlib/Load_itp.cpp Modified: branches/OpenMPT-1.31/soundlib/Load_itp.cpp ============================================================================== --- branches/OpenMPT-1.31/soundlib/Load_itp.cpp Fri Dec 13 19:19:36 2024 (r22531) +++ branches/OpenMPT-1.31/soundlib/Load_itp.cpp Fri Dec 13 19:19:53 2024 (r22532) @@ -261,7 +261,7 @@ #ifdef MODPLUG_TRACKER if(const auto fileName = file.GetOptionalFileName(); fileName.has_value()) { - instrPaths[ins] = mpt::AbsolutePathToRelative(instrPaths[ins], fileName->GetDirectoryWithDrive()); + instrPaths[ins] = mpt::RelativePathToAbsolute(instrPaths[ins], fileName->GetDirectoryWithDrive()); } else if(GetpModDoc() != nullptr) { instrPaths[ins] = mpt::RelativePathToAbsolute(instrPaths[ins], GetpModDoc()->GetPathNameMpt().GetDirectoryWithDrive()); @@ -309,15 +309,13 @@ // Pattern data size_t numCommands = GetNumChannels() * numRows; - if(patternChunk.CanRead(sizeof(ITPModCommand) * numCommands)) { - ModCommand *target = Patterns[pat].GetpModCommand(0, 0); - while(numCommands-- != 0) + for(ModCommand &m : Patterns[pat]) { ITPModCommand data; patternChunk.ReadStruct(data); - *(target++) = data; + m = data; } } } @@ -330,7 +328,7 @@ // Read number of embedded samples - at most as many as there are real samples in a valid file uint32 embeddedSamples = file.ReadUint32LE(); - if(embeddedSamples > m_nSamples) + if(embeddedSamples > GetNumSamples()) { return false; } |
From: <sv...@op...> - 2024-12-13 18:19:48
|
Author: sagamusix Date: Fri Dec 13 19:19:36 2024 New Revision: 22531 URL: https://source.openmpt.org/browse/openmpt/?op=revision&rev=22531 Log: [Fix] ITP: Instruments paths were always read as relative paths since r17468 (so since the first official release of OpenMPT 1.31), usually causing them to file to load. Modified: trunk/OpenMPT/soundlib/Load_itp.cpp Modified: trunk/OpenMPT/soundlib/Load_itp.cpp ============================================================================== --- trunk/OpenMPT/soundlib/Load_itp.cpp Thu Dec 12 22:27:08 2024 (r22530) +++ trunk/OpenMPT/soundlib/Load_itp.cpp Fri Dec 13 19:19:36 2024 (r22531) @@ -256,7 +256,7 @@ #ifdef MODPLUG_TRACKER if(const auto fileName = file.GetOptionalFileName(); fileName.has_value()) { - instrPaths[ins] = mpt::AbsolutePathToRelative(instrPaths[ins], fileName->GetDirectoryWithDrive()); + instrPaths[ins] = mpt::RelativePathToAbsolute(instrPaths[ins], fileName->GetDirectoryWithDrive()); } else if(GetpModDoc() != nullptr) { instrPaths[ins] = mpt::RelativePathToAbsolute(instrPaths[ins], GetpModDoc()->GetPathNameMpt().GetDirectoryWithDrive()); @@ -304,15 +304,13 @@ // Pattern data size_t numCommands = GetNumChannels() * numRows; - if(patternChunk.CanRead(sizeof(ITPModCommand) * numCommands)) { - ModCommand *target = Patterns[pat].GetpModCommand(0, 0); - while(numCommands-- != 0) + for(ModCommand &m : Patterns[pat]) { ITPModCommand data; patternChunk.ReadStruct(data); - *(target++) = data; + m = data; } } } @@ -325,7 +323,7 @@ // Read number of embedded samples - at most as many as there are real samples in a valid file uint32 embeddedSamples = file.ReadUint32LE(); - if(embeddedSamples > m_nSamples) + if(embeddedSamples > GetNumSamples()) { return false; } |
From: <sv...@op...> - 2024-12-12 21:27:15
|
Author: sagamusix Date: Thu Dec 12 22:27:08 2024 New Revision: 22530 URL: https://source.openmpt.org/browse/openmpt/?op=revision&rev=22530 Log: [Fix] Avoid writing past end of ChnSettings when reading channel colors. [Imp] Modernize Extended Song Properties writing to not use macros. [Mod] Don't write Tempo Mode Extended Song Property when using classic tempo mode. [Mod] Don't write Sample Pre-Amp Extended Song Property when not required. Modified: trunk/OpenMPT/soundlib/Load_it.cpp Modified: trunk/OpenMPT/soundlib/Load_it.cpp ============================================================================== --- trunk/OpenMPT/soundlib/Load_it.cpp Thu Dec 12 22:21:29 2024 (r22529) +++ trunk/OpenMPT/soundlib/Load_it.cpp Thu Dec 12 22:27:08 2024 (r22530) @@ -2310,45 +2310,44 @@ // Extra song data - Yet Another Hack. mpt::IO::WriteIntLE<uint32>(f, MagicBE("MPTS")); -#define WRITEMODULARHEADER(code, fsize) \ - { \ - mpt::IO::WriteIntLE<uint32>(f, code); \ - MPT_ASSERT(mpt::in_range<uint16>(fsize)); \ - const uint16 _size = fsize; \ - mpt::IO::WriteIntLE<uint16>(f, _size); \ - } -#define WRITEMODULAR(code, field) \ - { \ - WRITEMODULARHEADER(code, sizeof(field)) \ - mpt::IO::WriteIntLE(f, field); \ - } + const auto WriteModularHeader = [](std::ostream &f, uint32 code, size_t fsize) + { + mpt::IO::WriteIntLE<uint32>(f, code); + MPT_ASSERT(mpt::in_range<uint16>(fsize)); + mpt::IO::WriteIntLE<uint16>(f, static_cast<uint16>(fsize)); + }; + const auto WriteModular = [&WriteModularHeader](std::ostream &f, uint32 code, auto field) + { + WriteModularHeader(f, code, sizeof(field)); + mpt::IO::WriteIntLE(f, field); + }; if(Order().GetDefaultTempo().GetInt() > 255) { uint32 tempo = Order().GetDefaultTempo().GetInt(); - WRITEMODULAR(MagicBE("DT.."), tempo); + WriteModular(f, MagicBE("DT.."), tempo); } if(Order().GetDefaultTempo().GetFract() != 0 && specs.hasFractionalTempo) { uint32 tempo = Order().GetDefaultTempo().GetFract(); - WRITEMODULAR(MagicLE("DTFR"), tempo); + WriteModular(f, MagicLE("DTFR"), tempo); } if(m_nDefaultRowsPerBeat > 255 || m_nDefaultRowsPerMeasure > 255 || GetType() == MOD_TYPE_XM) { - WRITEMODULAR(MagicBE("RPB."), m_nDefaultRowsPerBeat); - WRITEMODULAR(MagicBE("RPM."), m_nDefaultRowsPerMeasure); + WriteModular(f, MagicBE("RPB."), m_nDefaultRowsPerBeat); + WriteModular(f, MagicBE("RPM."), m_nDefaultRowsPerMeasure); } if(GetType() != MOD_TYPE_XM) { - WRITEMODULAR(MagicBE("C..."), GetNumChannels()); + WriteModular(f, MagicBE("C..."), GetNumChannels()); } if((GetType() & (MOD_TYPE_IT | MOD_TYPE_MPT)) && GetNumChannels() > 64) { // IT header has only room for 64 channels. Save the settings that do not fit to the header here as an extension. - WRITEMODULARHEADER(MagicBE("ChnS"), static_cast<uint16>((GetNumChannels() - 64) * 2)); + WriteModularHeader(f, MagicBE("ChnS"), (GetNumChannels() - 64) * 2); for(CHANNELINDEX chn = 64; chn < GetNumChannels(); chn++) { uint8 panvol[2]; @@ -2360,37 +2359,41 @@ } } + if(m_nTempoMode != TempoMode::Classic) { - WRITEMODULARHEADER(MagicBE("TM.."), 1); + WriteModularHeader(f, MagicBE("TM.."), 1); uint8 mode = static_cast<uint8>(m_nTempoMode); mpt::IO::WriteIntLE(f, mode); } const int32 tmpMixLevels = static_cast<int32>(m_nMixLevels); - WRITEMODULAR(MagicBE("PMM."), tmpMixLevels); + WriteModular(f, MagicBE("PMM."), tmpMixLevels); if(m_dwCreatedWithVersion) { - WRITEMODULAR(MagicBE("CWV."), m_dwCreatedWithVersion.GetRawVersion()); + WriteModular(f, MagicBE("CWV."), m_dwCreatedWithVersion.GetRawVersion()); } - WRITEMODULAR(MagicBE("LSWV"), Version::Current().GetRawVersion()); - WRITEMODULAR(MagicBE("SPA."), m_nSamplePreAmp); - WRITEMODULAR(MagicBE("VSTV"), m_nVSTiVolume); + WriteModular(f, MagicBE("LSWV"), Version::Current().GetRawVersion()); + if(GetType() == MOD_TYPE_XM || m_nSamplePreAmp > 128) + { + WriteModular(f, MagicBE("SPA."), m_nSamplePreAmp); + } + WriteModular(f, MagicBE("VSTV"), m_nVSTiVolume); if(GetType() == MOD_TYPE_XM && m_nDefaultGlobalVolume != MAX_GLOBAL_VOLUME) { - WRITEMODULAR(MagicBE("DGV."), m_nDefaultGlobalVolume); + WriteModular(f, MagicBE("DGV."), m_nDefaultGlobalVolume); } if(GetType() != MOD_TYPE_XM && Order().GetRestartPos() != 0) { - WRITEMODULAR(MagicBE("RP.."), Order().GetRestartPos()); + WriteModular(f, MagicBE("RP.."), Order().GetRestartPos()); } if(m_nResampling != SRCMODE_DEFAULT && specs.hasDefaultResampling) { - WRITEMODULAR(MagicLE("RSMP"), static_cast<uint32>(m_nResampling)); + WriteModular(f, MagicLE("RSMP"), static_cast<uint32>(m_nResampling)); } // Sample cues @@ -2404,7 +2407,7 @@ // Write one chunk for every sample. // Rationale: chunks are limited to 65536 bytes, which can easily be reached // with the amount of samples that OpenMPT supports. - WRITEMODULARHEADER(MagicLE("CUES"), static_cast<uint16>(2 + std::size(sample.cues) * 4)); + WriteModularHeader(f, MagicLE("CUES"), 2 + std::size(sample.cues) * 4); mpt::IO::WriteIntLE<uint16>(f, smp); for(auto cue : sample.cues) { @@ -2421,7 +2424,7 @@ TempoSwing::Serialize(oStrm, m_tempoSwing); std::string data = oStrm.str(); uint16 length = mpt::saturate_cast<uint16>(data.size()); - WRITEMODULARHEADER(MagicLE("SWNG"), length); + WriteModularHeader(f, MagicLE("SWNG"), length); mpt::IO::WriteRaw(f, data.data(), length); } @@ -2440,7 +2443,7 @@ } } uint16 numBytes = static_cast<uint16>(maxBit / 8u); - WRITEMODULARHEADER(MagicBE("MSF."), numBytes); + WriteModularHeader(f, MagicBE("MSF."), numBytes); mpt::IO::WriteRaw(f, bits.data(), numBytes); } @@ -2448,7 +2451,7 @@ { std::string songArtistU8 = mpt::ToCharset(mpt::Charset::UTF8, m_songArtist); uint16 length = mpt::saturate_cast<uint16>(songArtistU8.length()); - WRITEMODULARHEADER(MagicLE("AUTH"), length); + WriteModularHeader(f, MagicLE("AUTH"), length); mpt::IO::WriteRaw(f, songArtistU8.c_str(), length); } @@ -2462,7 +2465,7 @@ AddToLog(LogWarning, U_("Too many MIDI Mapping directives to save; data won't be written.")); } else { - WRITEMODULARHEADER(MagicBE("MIMA"), static_cast<uint16>(objectsize)); + WriteModularHeader(f, MagicBE("MIMA"), objectsize); GetMIDIMapper().Serialize(&f); } } @@ -2479,7 +2482,7 @@ } if(numChannels > 0) { - WRITEMODULARHEADER(MagicLE("CCOL"), numChannels * 4); + WriteModularHeader(f, MagicLE("CCOL"), numChannels * 4); for(CHANNELINDEX i = 0; i < numChannels; i++) { uint32 color = ChnSettings[i].color; @@ -2491,9 +2494,6 @@ } } #endif - -#undef WRITEMODULAR -#undef WRITEMODULARHEADER } #endif // MODPLUG_NO_FILESAVE @@ -2571,7 +2571,10 @@ case MagicLE("CCOL"): // Channel colors { - const CHANNELINDEX numChannels = std::min(MAX_BASECHANNELS, static_cast<CHANNELINDEX>(size / 4u)); + const CHANNELINDEX channelsInFile = static_cast<CHANNELINDEX>(size / 4u); + if(!ignoreChannelCount) + ChnSettings.resize(std::clamp(GetNumChannels(), channelsInFile, MAX_BASECHANNELS)); + const CHANNELINDEX numChannels = std::min(channelsInFile, GetNumChannels()); for(CHANNELINDEX i = 0; i < numChannels; i++) { auto rgb = chunk.ReadArray<uint8, 4>(); @@ -2598,8 +2601,8 @@ const CHANNELINDEX channelsInFile = mpt::saturate_cast<CHANNELINDEX>(64 + size / 2); if(!ignoreChannelCount) ChnSettings.resize(std::clamp(GetNumChannels(), channelsInFile, MAX_BASECHANNELS)); - const CHANNELINDEX loopLimit = std::min(channelsInFile, GetNumChannels()); - for(CHANNELINDEX chn = 64; chn < loopLimit; chn++) + const CHANNELINDEX numChannels = std::min(channelsInFile, GetNumChannels()); + for(CHANNELINDEX chn = 64; chn < numChannels; chn++) { auto [pan, vol] = chunk.ReadArray<uint8, 2>(); if(pan != 0xFF) |
From: <sv...@op...> - 2024-12-12 21:21:40
|
Author: sagamusix Date: Thu Dec 12 22:21:29 2024 New Revision: 22529 URL: https://source.openmpt.org/browse/openmpt/?op=revision&rev=22529 Log: [Fix] Reset tempo mode when initializing module. Since only few formats use a tempo mode other than classic, and their loaders don't return false after the tempo mode has been set, this does not make a difference in practice right now. Modified: trunk/OpenMPT/soundlib/Sndfile.cpp Modified: trunk/OpenMPT/soundlib/Sndfile.cpp ============================================================================== --- trunk/OpenMPT/soundlib/Sndfile.cpp Thu Dec 12 22:16:19 2024 (r22528) +++ trunk/OpenMPT/soundlib/Sndfile.cpp Thu Dec 12 22:21:29 2024 (r22529) @@ -206,6 +206,7 @@ m_nResampling = SRCMODE_DEFAULT; m_dwLastSavedWithVersion = Version(0); m_dwCreatedWithVersion = Version(0); + m_nTempoMode = TempoMode::Classic; SetMixLevels(MixLevels::Compatible); |