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
(202) |
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
From: <sv...@op...> - 2024-11-18 21:41:00
|
Author: sagamusix Date: Mon Nov 18 22:40:48 2024 New Revision: 22231 URL: https://source.openmpt.org/browse/openmpt/?op=revision&rev=22231 Log: [FIx] I3DL2Reverb: Avoid undefined behaviour in integer overflows when calculating delay lines before their structures have been fully initialized. Modified: trunk/OpenMPT/soundlib/plugins/dmo/I3DL2Reverb.h Modified: trunk/OpenMPT/soundlib/plugins/dmo/I3DL2Reverb.h ============================================================================== --- trunk/OpenMPT/soundlib/plugins/dmo/I3DL2Reverb.h Mon Nov 18 22:35:52 2024 (r22230) +++ trunk/OpenMPT/soundlib/plugins/dmo/I3DL2Reverb.h Mon Nov 18 22:40:48 2024 (r22231) @@ -50,9 +50,9 @@ class DelayLine : private std::vector<float> { - int32 m_length; - int32 m_position; - int32 m_delayPosition; + int32 m_length = 0; + int32 m_position = 0; + int32 m_delayPosition = 0; public: void Init(int32 ms, int32 padding, uint32 sampleRate, int32 delayTap = 0); |
From: <sv...@op...> - 2024-11-18 21:36:04
|
Author: sagamusix Date: Mon Nov 18 22:35:52 2024 New Revision: 22230 URL: https://source.openmpt.org/browse/openmpt/?op=revision&rev=22230 Log: [Fix] Avoid integer wraparound when period + fractional period exceeds 32-bit integer limits. Found with afl++ + ubsan. Modified: trunk/OpenMPT/soundlib/Sndmix.cpp Modified: trunk/OpenMPT/soundlib/Sndmix.cpp ============================================================================== --- trunk/OpenMPT/soundlib/Sndmix.cpp Mon Nov 18 22:27:12 2024 (r22229) +++ trunk/OpenMPT/soundlib/Sndmix.cpp Mon Nov 18 22:35:52 2024 (r22230) @@ -1839,8 +1839,15 @@ vdelta += Util::muldiv(period, fineUpTable[l & 0x03], 0x10000) - period; } } - period = (period + vdelta) / 256; - nPeriodFrac = vdelta & 0xFF; + if(Util::MaxValueOfType(period) - period >= vdelta) + { + period = (period + vdelta) / 256; + nPeriodFrac = vdelta & 0xFF; + } else + { + period = Util::MaxValueOfType(period) / 256; + nPeriodFrac = 0; + } } else { // MPT's autovibrato code |
From: <sv...@op...> - 2024-11-18 21:27:25
|
Author: sagamusix Date: Mon Nov 18 22:27:12 2024 New Revision: 22229 URL: https://source.openmpt.org/browse/openmpt/?op=revision&rev=22229 Log: [Fix] IMF: It was still possible that we were shifting by 64 bits. Modified: trunk/OpenMPT/soundlib/Load_imf.cpp Modified: trunk/OpenMPT/soundlib/Load_imf.cpp ============================================================================== --- trunk/OpenMPT/soundlib/Load_imf.cpp Mon Nov 18 21:27:01 2024 (r22228) +++ trunk/OpenMPT/soundlib/Load_imf.cpp Mon Nov 18 22:27:12 2024 (r22229) @@ -437,7 +437,7 @@ // Read channel configuration std::bitset<32> ignoreChannels; // bit set for each channel that's completely disabled - uint64 channelMuteStatus = static_cast<uint64>(0xAAAA'AAAA) << (GetNumChannels() * 2); + uint64 channelMuteStatus = 0; for(CHANNELINDEX chn = 0; chn < GetNumChannels(); chn++) { ChnSettings[chn].nPan = static_cast<uint16>(fileHeader.channels[chn].panning * 256 / 255); @@ -459,7 +459,7 @@ } // BEHIND.IMF: All channels but the first are muted // mikmod refers to this as an Orpheus bug, but I haven't seen any other files like this, so maybe it's just an incorrectly saved file? - if(channelMuteStatus == 0xAAAA'AAAA'5555'5554) + if(GetNumChannels() == 16 && channelMuteStatus == 0x5555'5554) { for(CHANNELINDEX chn = 1; chn < GetNumChannels(); chn++) ChnSettings[chn].dwFlags.reset(CHN_MUTE); |
From: <sv...@op...> - 2024-11-18 20:27:16
|
Author: sagamusix Date: Mon Nov 18 21:27:01 2024 New Revision: 22228 URL: https://source.openmpt.org/browse/openmpt/?op=revision&rev=22228 Log: [Imp] Also allow dropping a selection of files for debug scanning in addition to whole directories. Modified: trunk/OpenMPT/mptrack/MainFrm.cpp Modified: trunk/OpenMPT/mptrack/MainFrm.cpp ============================================================================== --- trunk/OpenMPT/mptrack/MainFrm.cpp Mon Nov 18 21:23:25 2024 (r22227) +++ trunk/OpenMPT/mptrack/MainFrm.cpp Mon Nov 18 21:27:01 2024 (r22228) @@ -502,6 +502,9 @@ { const UINT nFiles = ::DragQueryFileW(hDropInfo, (UINT)-1, NULL, 0); CMainFrame::GetMainFrame()->SetForegroundWindow(); +#ifdef MPT_BUILD_DEBUG + const bool scanAll = CInputHandler::GetModifierMask().test_all(ModCtrl | ModShift | ModAlt); +#endif for(UINT f = 0; f < nFiles; f++) { UINT size = ::DragQueryFile(hDropInfo, f, nullptr, 0) + 1; @@ -511,7 +514,7 @@ const mpt::PathString file = mpt::PathString::FromNative(fileName.data()); #ifdef MPT_BUILD_DEBUG // Debug Hack: Quickly scan a folder containing module files (without running out of window handles ;) - if(CInputHandler::GetModifierMask().test_all(ModCtrl | ModShift | ModAlt) && mpt::native_fs{}.is_directory(file)) + if(scanAll && mpt::native_fs{}.is_directory(file)) { FolderScanner scanner(file, FolderScanner::kOnlyFiles | FolderScanner::kFindInSubDirectories); mpt::PathString scanName; @@ -521,6 +524,7 @@ mpt::IO::InputFile inputFile(scanName, TrackerSettings::Instance().MiscCacheCompleteFileBeforeLoading); if(!inputFile.IsValid()) continue; + SetHelpText(scanName.GetFilename().ToCString()); auto sndFile = std::make_unique<CSoundFile>(); MPT_LOG_GLOBAL(LogDebug, "info", U_("Loading ") + scanName.ToUnicode()); if(!sndFile->Create(GetFileReader(inputFile), CSoundFile::loadCompleteModule, nullptr)) @@ -530,8 +534,21 @@ } total++; } + SetHelpText(_T("")); Reporting::Information(MPT_UFORMAT("Scanned {} files, {} failed")(total, failed)); - break; + continue; + } else if(scanAll) + { + mpt::IO::InputFile inputFile(file, TrackerSettings::Instance().MiscCacheCompleteFileBeforeLoading); + if(!inputFile.IsValid()) + continue; + auto sndFile = std::make_unique<CSoundFile>(); + SetHelpText(file.GetFilename().ToCString()); + MPT_LOG_GLOBAL(LogDebug, "info", U_("Loading ") + file.ToUnicode()); + if(!sndFile->Create(GetFileReader(inputFile), CSoundFile::loadCompleteModule, nullptr)) + MPT_LOG_GLOBAL(LogDebug, "info", U_("FAILED: ") + file.ToUnicode()); + SetHelpText(_T("")); + continue; } #endif theApp.OpenDocumentFile(file.ToCString()); |
From: <sv...@op...> - 2024-11-18 20:23:31
|
Author: sagamusix Date: Mon Nov 18 21:23:25 2024 New Revision: 22227 URL: https://source.openmpt.org/browse/openmpt/?op=revision&rev=22227 Log: [Fix] MMCMP: Avoid undefined shift behaviour when trying to read an arbitrary number of bits. Reject such malformed files like Ancient does. Modified: trunk/OpenMPT/soundlib/ContainerMMCMP.cpp Modified: trunk/OpenMPT/soundlib/ContainerMMCMP.cpp ============================================================================== --- trunk/OpenMPT/soundlib/ContainerMMCMP.cpp Mon Nov 18 21:01:34 2024 (r22226) +++ trunk/OpenMPT/soundlib/ContainerMMCMP.cpp Mon Nov 18 21:23:25 2024 (r22227) @@ -231,6 +231,7 @@ #ifdef MMCMP_LOG MPT_LOG_GLOBAL(LogDebug, "MMCMP", MPT_UFORMAT(" 16-bit block: pos={} size={} {} {}")(psubblk->position, psubblk->size, (blk.flags & MMCMP_DELTA) ? U_("DELTA ") : U_(""), (blk.flags & MMCMP_ABS16) ? U_("ABS16 ") : U_(""))); #endif + if(numbits > 15) return false; if(!file.Seek(memPos + blk.tt_entries)) return false; if(!file.CanRead(blk.pk_size - blk.tt_entries)) return false; BitReader bitFile{ file.GetChunk(blk.pk_size - blk.tt_entries) }; @@ -316,6 +317,7 @@ uint32 numbits = blk.num_bits; uint32 oldval = 0; if(blk.tt_entries > sizeof(ptable) + || numbits > 7 || !file.Seek(memPos) || file.ReadRaw(mpt::span(ptable, blk.tt_entries)).size() < blk.tt_entries) return false; |
From: <sv...@op...> - 2024-11-18 20:01:41
|
Author: sagamusix Date: Mon Nov 18 21:01:34 2024 New Revision: 22226 URL: https://source.openmpt.org/browse/openmpt/?op=revision&rev=22226 Log: [Fix] Tuning: Apply a (hopefully small enough) epsilon to tuning ratio setting to avoid NaN and inf results in tuning frequency calculation. Found with afl++ + ubsan. Modified: trunk/OpenMPT/soundlib/tuning.h Modified: trunk/OpenMPT/soundlib/tuning.h ============================================================================== --- trunk/OpenMPT/soundlib/tuning.h Mon Nov 18 20:57:24 2024 (r22225) +++ trunk/OpenMPT/soundlib/tuning.h Mon Nov 18 21:01:34 2024 (r22226) @@ -224,7 +224,8 @@ static bool IsValidRatio(RATIOTYPE ratio) { - return (ratio > static_cast<RATIOTYPE>(0.0)); + // Arbitrary epsilon > 0 to avoid NaNs and infinite values in ratio calculation + return (ratio > static_cast<RATIOTYPE>(0.02f)); } private: |
From: <sv...@op...> - 2024-11-18 19:57:31
|
Author: sagamusix Date: Mon Nov 18 20:57:24 2024 New Revision: 22225 URL: https://source.openmpt.org/browse/openmpt/?op=revision&rev=22225 Log: [Fix] When an instrument refers to an invalid sample slot, don't try to address it during playback. The playback routines have no issue with this (due to all possible sample slots being pre-allocated), but some code in the tracker that tries to infer the sample slot from pModSample pointer and assumes that it's always valid could crash due to this (e.g. unused sample scanner). Instead, refer to sample slot 0 when such a note mapping is encountered. Modified: trunk/OpenMPT/soundlib/Snd_fx.cpp Modified: trunk/OpenMPT/soundlib/Snd_fx.cpp ============================================================================== --- trunk/OpenMPT/soundlib/Snd_fx.cpp Mon Nov 18 20:19:48 2024 (r22224) +++ trunk/OpenMPT/soundlib/Snd_fx.cpp Mon Nov 18 20:57:24 2024 (r22225) @@ -1475,7 +1475,7 @@ if(pIns->NoteMap[note - NOTE_MIN] > NOTE_MAX) return; uint32 n = pIns->Keyboard[note - NOTE_MIN]; - pSmp = ((n) && (n < MAX_SAMPLES)) ? &Samples[n] : nullptr; + pSmp = (n <= GetNumSamples()) ? &Samples[n] : &Samples[0]; } else if(GetNumInstruments()) { // No valid instrument, or not a valid note. @@ -1843,9 +1843,9 @@ if((pIns) && (note - NOTE_MIN < (int)std::size(pIns->Keyboard))) { uint32 n = pIns->Keyboard[note - NOTE_MIN]; - if((n) && (n < MAX_SAMPLES)) + if(n > 0) { - pSmp = &Samples[n]; + pSmp = &Samples[(n <= GetNumSamples()) ? n : 0]; } else if(m_playBehaviour[kITEmptyNoteMapSlot] && !chn.HasMIDIOutput()) { // Impulse Tracker ignores empty slots. @@ -2327,9 +2327,9 @@ // Test case: dct_smp_note_test.it if(!m_playBehaviour[kITDCTBehaviour] || !m_playBehaviour[kITRealNoteMapping]) dnaNote = pIns->NoteMap[note - NOTE_MIN]; - if(smp > 0 && smp < MAX_SAMPLES) + if(smp > 0) { - pSample = &Samples[smp]; + pSample = &Samples[(smp <= GetNumSamples()) ? smp : 0]; } else if(m_playBehaviour[kITEmptyNoteMapSlot] && !pIns->HasValidMIDIChannel()) { // Impulse Tracker ignores empty slots. |
From: <sv...@op...> - 2024-11-18 19:19:59
|
Author: sagamusix Date: Mon Nov 18 20:19:48 2024 New Revision: 22224 URL: https://source.openmpt.org/browse/openmpt/?op=revision&rev=22224 Log: [Fix] Avoid extremely loud sample and synth amplification outside of supported GUI parameters. Found with afl++ + ubsan. Modified: trunk/OpenMPT/soundlib/Load_it.cpp Modified: trunk/OpenMPT/soundlib/Load_it.cpp ============================================================================== --- trunk/OpenMPT/soundlib/Load_it.cpp Mon Nov 18 19:52:52 2024 (r22223) +++ trunk/OpenMPT/soundlib/Load_it.cpp Mon Nov 18 20:19:48 2024 (r22224) @@ -2664,12 +2664,9 @@ m_nMixLevels = MixLevels::Original; //m_dwCreatedWithVersion //m_dwLastSavedWithVersion - //m_nSamplePreAmp - //m_nVSTiVolume - //m_nDefaultGlobalVolume + LimitMax(m_nSamplePreAmp, 2000u); + LimitMax(m_nVSTiVolume, 2000u); LimitMax(m_nDefaultGlobalVolume, MAX_GLOBAL_VOLUME); - //m_nRestartPos - //m_ModFlags LimitMax(m_nDefaultRowsPerBeat, MAX_ROWS_PER_BEAT); LimitMax(m_nDefaultRowsPerMeasure, MAX_ROWS_PER_BEAT); |
From: <sv...@op...> - 2024-11-18 18:52:59
|
Author: sagamusix Date: Mon Nov 18 19:52:52 2024 New Revision: 22223 URL: https://source.openmpt.org/browse/openmpt/?op=revision&rev=22223 Log: [Fix] IMF: Muted channel bug detection was broken due to missing integer promotion. Broken since r20949. Modified: trunk/OpenMPT/soundlib/Load_imf.cpp Modified: trunk/OpenMPT/soundlib/Load_imf.cpp ============================================================================== --- trunk/OpenMPT/soundlib/Load_imf.cpp Mon Nov 18 19:47:12 2024 (r22222) +++ trunk/OpenMPT/soundlib/Load_imf.cpp Mon Nov 18 19:52:52 2024 (r22223) @@ -437,12 +437,12 @@ // Read channel configuration std::bitset<32> ignoreChannels; // bit set for each channel that's completely disabled - uint64 channelMuteStatus = 0xAAAA'AAAA << (GetNumChannels() * 2); + uint64 channelMuteStatus = static_cast<uint64>(0xAAAA'AAAA) << (GetNumChannels() * 2); for(CHANNELINDEX chn = 0; chn < GetNumChannels(); chn++) { ChnSettings[chn].nPan = static_cast<uint16>(fileHeader.channels[chn].panning * 256 / 255); ChnSettings[chn].szName = mpt::String::ReadBuf(mpt::String::nullTerminated, fileHeader.channels[chn].name); - channelMuteStatus |= fileHeader.channels[chn].status << (chn * 2); + channelMuteStatus |= static_cast<uint64>(fileHeader.channels[chn].status) << (chn * 2); // TODO: reverb/chorus? switch(fileHeader.channels[chn].status) { |
From: <sv...@op...> - 2024-11-18 18:47:18
|
Author: sagamusix Date: Mon Nov 18 19:47:12 2024 New Revision: 22222 URL: https://source.openmpt.org/browse/openmpt/?op=revision&rev=22222 Log: [Fix] FC: Fix crash when trying to load more than 255 instruments (found with afl++ + ubsan). Modified: trunk/OpenMPT/soundlib/Load_fc.cpp Modified: trunk/OpenMPT/soundlib/Load_fc.cpp ============================================================================== --- trunk/OpenMPT/soundlib/Load_fc.cpp Mon Nov 18 19:44:10 2024 (r22221) +++ trunk/OpenMPT/soundlib/Load_fc.cpp Mon Nov 18 19:47:12 2024 (r22222) @@ -311,7 +311,7 @@ SetupMODPanning(true); m_SongFlags.set(SONG_IMPORTED | SONG_ISAMIGA); m_nSamples = isFC14 ? 90 : 57; - m_nInstruments = static_cast<INSTRUMENTINDEX>(fileHeader.volSequenceSize / 64u + 1); + m_nInstruments = std::min(static_cast<INSTRUMENTINDEX>(fileHeader.volSequenceSize / 64u + 1), static_cast<SAMPLEINDEX>(MAX_INSTRUMENTS - 1)); m_playBehaviour.set(kMODSampleSwap); m_playBehaviour.set(kApplyUpperPeriodLimit); m_nMinPeriod = 113 * 4; |
From: <sv...@op...> - 2024-11-18 18:44:22
|
Author: sagamusix Date: Mon Nov 18 19:44:10 2024 New Revision: 22221 URL: https://source.openmpt.org/browse/openmpt/?op=revision&rev=22221 Log: [Fix] MED: Avoid undefined behaviour with out-of-range echo depth parameter (found with afl++ + ubsan). Modified: trunk/OpenMPT/soundlib/Load_med.cpp Modified: trunk/OpenMPT/soundlib/Load_med.cpp ============================================================================== --- trunk/OpenMPT/soundlib/Load_med.cpp Mon Nov 18 19:25:19 2024 (r22220) +++ trunk/OpenMPT/soundlib/Load_med.cpp Mon Nov 18 19:44:10 2024 (r22221) @@ -1388,9 +1388,9 @@ if((header.mixEchoType == 1 || header.mixEchoType == 2) && numPlugins < MAX_MIXPLUGINS) { // Emulating MED echo using the DMO echo requires to compensate for the differences in initial feedback in the latter. - const float feedback = 1.0f / (1 << std::max(header.mixEchoDepth, uint8(1))); // The feedback we want - const float initialFeedback = std::sqrt(1.0f - (feedback * feedback)); // Actual strength of first delay's feedback - const float wetFactor = feedback / initialFeedback; // Factor to compensate for this + const float feedback = 1.0f / (1 << std::clamp(header.mixEchoDepth, uint8(1), uint8(9))); // The feedback we want + const float initialFeedback = std::sqrt(1.0f - (feedback * feedback)); // Actual strength of first delay's feedback + const float wetFactor = feedback / initialFeedback; // Factor to compensate for this const float delay = (std::max(header.mixEchoLength.get(), uint16(1)) - 1) / 1999.0f; SNDMIXPLUGIN &mixPlug = m_MixPlugins[numPlugins]; mpt::reconstruct(mixPlug); |
From: <sv...@op...> - 2024-11-18 18:25:31
|
Author: sagamusix Date: Mon Nov 18 19:25:19 2024 New Revision: 22220 URL: https://source.openmpt.org/browse/openmpt/?op=revision&rev=22220 Log: [Ref] Mainbar: Small cleanup. Modified: trunk/OpenMPT/mptrack/Mainbar.cpp trunk/OpenMPT/mptrack/Mainbar.h Modified: trunk/OpenMPT/mptrack/Mainbar.cpp ============================================================================== --- trunk/OpenMPT/mptrack/Mainbar.cpp Mon Nov 18 19:10:59 2024 (r22219) +++ trunk/OpenMPT/mptrack/Mainbar.cpp Mon Nov 18 19:25:19 2024 (r22220) @@ -33,11 +33,11 @@ void COctaveEdit::OnChar(UINT nChar, UINT /*nRepCnt*/, UINT /*nFlags*/) { - if(nChar >= '0' + MIN_BASEOCTAVE && nChar <= '0' + MAX_BASEOCTAVE) - m_owner.SetBaseOctave(nChar - '0'); - else if(nChar == '+' && m_owner.GetBaseOctave() < MAX_BASEOCTAVE) + if(nChar >= _T('0') + MIN_BASEOCTAVE && nChar <= _T('0') + MAX_BASEOCTAVE) + m_owner.SetBaseOctave(nChar - _T('0')); + else if(nChar == _T('+') && m_owner.GetBaseOctave() < MAX_BASEOCTAVE) m_owner.SetBaseOctave(m_owner.GetBaseOctave() + 1); - else if(nChar == '-' && m_owner.GetBaseOctave() > MIN_BASEOCTAVE) + else if(nChar == _T('-') && m_owner.GetBaseOctave() > MIN_BASEOCTAVE) m_owner.SetBaseOctave(m_owner.GetBaseOctave() - 1); } @@ -483,19 +483,16 @@ } -BOOL CMainToolBar::SetBaseOctave(UINT nOctave) +void CMainToolBar::SetBaseOctave(UINT octave) { - TCHAR s[64]; + if(octave == static_cast<UINT>(m_currentOctave) || octave < MIN_BASEOCTAVE || octave > MAX_BASEOCTAVE) + return; - if((nOctave < MIN_BASEOCTAVE) || (nOctave > MAX_BASEOCTAVE)) return FALSE; - if(nOctave != (UINT)m_currentOctave) - { - m_currentOctave = nOctave; - wsprintf(s, _T("Octave %d"), nOctave); - m_EditOctave.SetWindowText(s); - m_SpinOctave.SetPos(nOctave); - } - return TRUE; + m_currentOctave = octave; + TCHAR s[32]; + wsprintf(s, _T("Octave %d"), octave); + m_EditOctave.SetWindowText(s); + m_SpinOctave.SetPos(octave); } @@ -533,6 +530,7 @@ static void EnableEdit(CEdit &edit, CSpinButtonCtrl &spin, bool enable) { + // Avoid flicker when enabling / disabling controls edit.SetRedraw(FALSE); if(!enable) edit.SetWindowText(_T("---")); Modified: trunk/OpenMPT/mptrack/Mainbar.h ============================================================================== --- trunk/OpenMPT/mptrack/Mainbar.h Mon Nov 18 19:10:59 2024 (r22219) +++ trunk/OpenMPT/mptrack/Mainbar.h Mon Nov 18 19:25:19 2024 (r22220) @@ -133,7 +133,7 @@ #endif // MPT_COMPILER_CLANG void Init(CMainFrame *); UINT GetBaseOctave() const; - BOOL SetBaseOctave(UINT nOctave); + void SetBaseOctave(UINT nOctave); void SetCurrentSong(CSoundFile *pModDoc); bool ShowUpdateInfo(const CString &newVersion, const CString &infoURL, bool showHighLight); |
From: <sv...@op...> - 2024-11-18 18:11:06
|
Author: sagamusix Date: Mon Nov 18 19:10:59 2024 New Revision: 22219 URL: https://source.openmpt.org/browse/openmpt/?op=revision&rev=22219 Log: Merged revision(s) 22217-22218 from trunk/OpenMPT: [Fix] MED: Avoid importing effect memory for some commands (https://www.un4seen.com/forum/?topic=15448.msg144131#msg144131). ........ [Fix] MOD: In PT mode, retriggered notes should keep using the 9xx offset. [Fix] MED: OctaMED also uses the previous offset for retriggered notes (like MOD), but doesn't have the ProTracker offset adding bug (so more like S3M). Fixes Kris Hadalot.med (https://www.un4seen.com/forum/?topic=15448.msg144130#msg144130). ........ Modified: branches/OpenMPT-1.31/ (props changed) branches/OpenMPT-1.31/soundlib/Load_med.cpp branches/OpenMPT-1.31/soundlib/Snd_fx.cpp Modified: branches/OpenMPT-1.31/soundlib/Load_med.cpp ============================================================================== --- branches/OpenMPT-1.31/soundlib/Load_med.cpp Mon Nov 18 19:06:35 2024 (r22218) +++ branches/OpenMPT-1.31/soundlib/Load_med.cpp Mon Nov 18 19:10:59 2024 (r22219) @@ -415,9 +415,29 @@ const uint8 nibbleLo = std::min(param, uint8(0x0F)); switch(command) { + case 0x01: // Portamento Up (avoid effect memory when importing as XM) + if(param) + m.SetEffectCommand(CMD_PORTAMENTOUP, param); + break; + case 0x02: // Portamento Down (avoid effect memory when importing as XM) + if(param) + m.SetEffectCommand(CMD_PORTAMENTODOWN, param); + break; case 0x04: // Vibrato (twice as deep as in ProTracker) m.SetEffectCommand(CMD_VIBRATO, (param & 0xF0) | std::min<uint8>((param & 0x0F) * 2, 0x0F)); break; + case 0x05: // Tone Porta + Volume Slide (avoid effect memory when importing as XM) + if(param) + m.SetEffectCommand(CMD_TONEPORTAVOL, param); + else + m.SetEffectCommand(CMD_TONEPORTAMENTO, 0); + break; + case 0x06: // Vibrato + Volume Slide (avoid effect memory when importing as XM) + if(param) + m.SetEffectCommand(CMD_VIBRATOVOL, param); + else + m.SetEffectCommand(CMD_VIBRATO, 0); + break; case 0x08: // Hold and decay break; case 0x09: // Set secondary speed @@ -433,7 +453,8 @@ m.SetEffectCommand(CMD_VOLUME, static_cast<ModCommand::PARAM>(((param & 0x7F) + 1) / 2)); break; case 0x0D: - m.SetEffectCommand(CMD_VOLUMESLIDE, param); + if(param) + m.SetEffectCommand(CMD_VOLUMESLIDE, param); break; case 0x0E: // Synth jump m.command = CMD_NONE; @@ -1283,6 +1304,7 @@ // For MED, this affects both volume and pitch slides m_SongFlags.set(SONG_FASTVOLSLIDES, !(songHeader.flags & MMDSong::FLAG_STSLIDE)); + m_playBehaviour.set(kST3OffsetWithoutInstrument); if(expData.songNameOffset && file.Seek(expData.songNameOffset)) { Modified: branches/OpenMPT-1.31/soundlib/Snd_fx.cpp ============================================================================== --- branches/OpenMPT-1.31/soundlib/Snd_fx.cpp Mon Nov 18 19:06:35 2024 (r22218) +++ branches/OpenMPT-1.31/soundlib/Snd_fx.cpp Mon Nov 18 19:10:59 2024 (r22219) @@ -1958,7 +1958,7 @@ chn.nLoopEnd = pSmp->nLength; chn.nLoopStart = 0; chn.position.Set(0); - if((m_SongFlags[SONG_PT_MODE] || m_playBehaviour[kST3OffsetWithoutInstrument]) && !chn.rowCommand.instr) + if((m_SongFlags[SONG_PT_MODE] || m_playBehaviour[kST3OffsetWithoutInstrument] || GetType() == MOD_TYPE_MED) && !chn.rowCommand.instr) { chn.position.SetInt(std::min(chn.prevNoteOffset, chn.nLength - SmpLength(1))); } else @@ -5438,7 +5438,7 @@ { // ST3 compatibility: Instrument-less note recalls previous note's offset // Test case: OxxMemory.s3m - if(m_playBehaviour[kST3OffsetWithoutInstrument]) + if(m_playBehaviour[kST3OffsetWithoutInstrument] || GetType() == MOD_TYPE_MED) chn.prevNoteOffset = 0; chn.prevNoteOffset += param; @@ -5717,7 +5717,10 @@ const bool fading = chn.dwFlags[CHN_NOTEFADE]; const auto oldPrevNoteOffset = chn.prevNoteOffset; - chn.prevNoteOffset = 0; // Retriggered notes should not use previous offset (test case: OxxMemoryWithRetrig.s3m) + // Retriggered notes should not use previous offset in S3M + // Test cases: OxxMemoryWithRetrig.s3m, PTOffsetRetrigger.mod + if(GetType() == MOD_TYPE_S3M) + chn.prevNoteOffset = 0; // IT compatibility: Really weird combination of envelopes and retrigger (see Storlek's q.it testcase) // Test cases: retrig.it, RetrigSlide.s3m const bool itS3Mstyle = m_playBehaviour[kITRetrigger] || (GetType() == MOD_TYPE_S3M && chn.nLength && !oplRealRetrig); |
From: <sv...@op...> - 2024-11-18 18:06:42
|
Author: sagamusix Date: Mon Nov 18 19:06:35 2024 New Revision: 22218 URL: https://source.openmpt.org/browse/openmpt/?op=revision&rev=22218 Log: [Fix] MOD: In PT mode, retriggered notes should keep using the 9xx offset. [Fix] MED: OctaMED also uses the previous offset for retriggered notes (like MOD), but doesn't have the ProTracker offset adding bug (so more like S3M). Fixes Kris Hadalot.med (https://www.un4seen.com/forum/?topic=15448.msg144130#msg144130). [Fix] MED: Execute the initial sequence speed setter immediately. Fixes Kris Hadalot.med (https://www.un4seen.com/forum/?topic=15448.msg144130#msg144130). Modified: trunk/OpenMPT/soundlib/Load_med.cpp trunk/OpenMPT/soundlib/Snd_fx.cpp Modified: trunk/OpenMPT/soundlib/Load_med.cpp ============================================================================== --- trunk/OpenMPT/soundlib/Load_med.cpp Sun Nov 17 23:43:57 2024 (r22217) +++ trunk/OpenMPT/soundlib/Load_med.cpp Mon Nov 18 19:06:35 2024 (r22218) @@ -688,7 +688,7 @@ static void TranslateMEDSynthScript(std::array<uint8, 128> &arr, size_t numEntries, uint8 speed, uint8 hold, uint8 decay, InstrumentSynth::Events &events, bool isVolume) { - events.push_back(InstrumentSynth::Event::SetStepSpeed(speed, false)); + events.push_back(InstrumentSynth::Event::SetStepSpeed(speed, true)); if(hold && isVolume) events.push_back(InstrumentSynth::Event::MED_HoldDecay(hold, decay)); @@ -1494,6 +1494,7 @@ m_SongFlags.set(SONG_FASTVOLSLIDES, !(songHeader.flags & MMDSong::FLAG_STSLIDE)); m_SongFlags.set(SONG_FASTPORTAS, !(songHeader.flags& MMDSong::FLAG_STSLIDE)); + m_playBehaviour.set(kST3OffsetWithoutInstrument); if(expData.songNameOffset && file.Seek(expData.songNameOffset)) { Modified: trunk/OpenMPT/soundlib/Snd_fx.cpp ============================================================================== --- trunk/OpenMPT/soundlib/Snd_fx.cpp Sun Nov 17 23:43:57 2024 (r22217) +++ trunk/OpenMPT/soundlib/Snd_fx.cpp Mon Nov 18 19:06:35 2024 (r22218) @@ -2050,7 +2050,7 @@ chn.nLoopEnd = pSmp->nLength; chn.nLoopStart = 0; chn.position.Set(0); - if((m_SongFlags[SONG_PT_MODE] || m_playBehaviour[kST3OffsetWithoutInstrument]) && !chn.rowCommand.instr) + if((m_SongFlags[SONG_PT_MODE] || m_playBehaviour[kST3OffsetWithoutInstrument] || GetType() == MOD_TYPE_MED) && !chn.rowCommand.instr) { chn.position.SetInt(std::min(chn.prevNoteOffset, chn.nLength - SmpLength(1))); } else @@ -5878,7 +5878,7 @@ { // ST3 compatibility: Instrument-less note recalls previous note's offset // Test case: OxxMemory.s3m - if(m_playBehaviour[kST3OffsetWithoutInstrument]) + if(m_playBehaviour[kST3OffsetWithoutInstrument] || GetType() == MOD_TYPE_MED) chn.prevNoteOffset = 0; chn.prevNoteOffset += param; @@ -6160,7 +6160,10 @@ const bool fading = chn.dwFlags[CHN_NOTEFADE]; const auto oldPrevNoteOffset = chn.prevNoteOffset; - chn.prevNoteOffset = 0; // Retriggered notes should not use previous offset (test case: OxxMemoryWithRetrig.s3m) + // Retriggered notes should not use previous offset in S3M + // Test cases: OxxMemoryWithRetrig.s3m, PTOffsetRetrigger.mod + if(GetType() == MOD_TYPE_S3M) + chn.prevNoteOffset = 0; // IT compatibility: Really weird combination of envelopes and retrigger (see Storlek's q.it testcase) // Test cases: retrig.it, RetrigSlide.s3m const bool itS3Mstyle = m_playBehaviour[kITRetrigger] || (GetType() == MOD_TYPE_S3M && chn.nLength && !oplRealRetrig); |
From: <sv...@op...> - 2024-11-17 22:44:11
|
Author: sagamusix Date: Sun Nov 17 23:43:57 2024 New Revision: 22217 URL: https://source.openmpt.org/browse/openmpt/?op=revision&rev=22217 Log: [Fix] MED: Avoid importing effect memory for some commands (https://www.un4seen.com/forum/?topic=15448.msg144131#msg144131). Modified: trunk/OpenMPT/soundlib/Load_med.cpp Modified: trunk/OpenMPT/soundlib/Load_med.cpp ============================================================================== --- trunk/OpenMPT/soundlib/Load_med.cpp Sun Nov 17 23:27:39 2024 (r22216) +++ trunk/OpenMPT/soundlib/Load_med.cpp Sun Nov 17 23:43:57 2024 (r22217) @@ -438,9 +438,29 @@ const uint8 nibbleLo = std::min(param, uint8(0x0F)); switch(command) { + case 0x01: // Portamento Up (avoid effect memory when importing as XM) + if(param) + m.SetEffectCommand(CMD_PORTAMENTOUP, param); + break; + case 0x02: // Portamento Down (avoid effect memory when importing as XM) + if(param) + m.SetEffectCommand(CMD_PORTAMENTODOWN, param); + break; case 0x04: // Vibrato (twice as deep as in ProTracker) m.SetEffectCommand(CMD_VIBRATO, (param & 0xF0) | std::min<uint8>((param & 0x0F) * 2, 0x0F)); break; + case 0x05: // Tone Porta + Volume Slide (avoid effect memory when importing as XM) + if(param) + m.SetEffectCommand(CMD_TONEPORTAVOL, param); + else + m.SetEffectCommand(CMD_TONEPORTAMENTO, 0); + break; + case 0x06: // Vibrato + Volume Slide (avoid effect memory when importing as XM) + if(param) + m.SetEffectCommand(CMD_VIBRATOVOL, param); + else + m.SetEffectCommand(CMD_VIBRATO, 0); + break; case 0x08: // Hold and decay break; case 0x09: // Set secondary speed @@ -456,7 +476,8 @@ m.SetEffectCommand(CMD_VOLUME, static_cast<ModCommand::PARAM>(((param & 0x7F) + 1) / 2)); break; case 0x0D: - m.SetEffectCommand(CMD_VOLUMESLIDE, param); + if(param) + m.SetEffectCommand(CMD_VOLUMESLIDE, param); break; case 0x0E: // Synth jump / MIDI panning m.SetEffectCommand(CMD_MED_SYNTH_JUMP, param); |
From: <sv...@op...> - 2024-11-17 22:27:46
|
Author: sagamusix Date: Sun Nov 17 23:27:39 2024 New Revision: 22216 URL: https://source.openmpt.org/browse/openmpt/?op=revision&rev=22216 Log: [Var] Add clarification comment for previous commit. Modified: trunk/OpenMPT/soundlib/Load_stm.cpp Modified: trunk/OpenMPT/soundlib/Load_stm.cpp ============================================================================== --- trunk/OpenMPT/soundlib/Load_stm.cpp Sun Nov 17 23:27:09 2024 (r22215) +++ trunk/OpenMPT/soundlib/Load_stm.cpp Sun Nov 17 23:27:39 2024 (r22216) @@ -49,7 +49,7 @@ && mptSmp.nLoopEnd != 0xFFFF) { mptSmp.uFlags = CHN_LOOP; - mptSmp.nLength = std::max(mptSmp.nLoopEnd, mptSmp.nLength); + mptSmp.nLength = std::max(mptSmp.nLoopEnd, mptSmp.nLength); // ST2 does not sanitize loop end, allow it to overflow into the next sample's data } } }; |
From: <sv...@op...> - 2024-11-17 22:27:29
|
Author: sagamusix Date: Sun Nov 17 23:27:09 2024 New Revision: 22215 URL: https://source.openmpt.org/browse/openmpt/?op=revision&rev=22215 Log: Merged revision(s) 22211 from trunk/OpenMPT: [Fix] STM: Scream Tracker 2 does not sanitize loop ends, so a sample can continue reading into the next sample's data. Fixes lessons in love.stm (https://www.un4seen.com/forum/?topic=15448.msg144130#msg144130). ........ Modified: branches/OpenMPT-1.28/ (props changed) branches/OpenMPT-1.28/soundlib/Load_stm.cpp Modified: branches/OpenMPT-1.28/soundlib/Load_stm.cpp ============================================================================== --- branches/OpenMPT-1.28/soundlib/Load_stm.cpp Sun Nov 17 23:26:56 2024 (r22214) +++ branches/OpenMPT-1.28/soundlib/Load_stm.cpp Sun Nov 17 23:27:09 2024 (r22215) @@ -48,7 +48,7 @@ && mptSmp.nLoopEnd != 0xFFFF) { mptSmp.uFlags = CHN_LOOP; - mptSmp.nLoopEnd = std::min(mptSmp.nLoopEnd, mptSmp.nLength); + mptSmp.nLength = std::max(mptSmp.nLoopEnd, mptSmp.nLength); } } }; |
From: <sv...@op...> - 2024-11-17 22:27:07
|
Author: sagamusix Date: Sun Nov 17 23:26:56 2024 New Revision: 22214 URL: https://source.openmpt.org/browse/openmpt/?op=revision&rev=22214 Log: Merged revision(s) 22211 from trunk/OpenMPT: [Fix] STM: Scream Tracker 2 does not sanitize loop ends, so a sample can continue reading into the next sample's data. Fixes lessons in love.stm (https://www.un4seen.com/forum/?topic=15448.msg144130#msg144130). ........ Modified: branches/OpenMPT-1.29/ (props changed) branches/OpenMPT-1.29/soundlib/Load_stm.cpp Modified: branches/OpenMPT-1.29/soundlib/Load_stm.cpp ============================================================================== --- branches/OpenMPT-1.29/soundlib/Load_stm.cpp Sun Nov 17 23:26:41 2024 (r22213) +++ branches/OpenMPT-1.29/soundlib/Load_stm.cpp Sun Nov 17 23:26:56 2024 (r22214) @@ -48,7 +48,7 @@ && mptSmp.nLoopEnd != 0xFFFF) { mptSmp.uFlags = CHN_LOOP; - mptSmp.nLoopEnd = std::min(mptSmp.nLoopEnd, mptSmp.nLength); + mptSmp.nLength = std::max(mptSmp.nLoopEnd, mptSmp.nLength); } } }; |
From: <sv...@op...> - 2024-11-17 22:26:52
|
Author: sagamusix Date: Sun Nov 17 23:26:41 2024 New Revision: 22213 URL: https://source.openmpt.org/browse/openmpt/?op=revision&rev=22213 Log: Merged revision(s) 22211 from trunk/OpenMPT: [Fix] STM: Scream Tracker 2 does not sanitize loop ends, so a sample can continue reading into the next sample's data. Fixes lessons in love.stm (https://www.un4seen.com/forum/?topic=15448.msg144130#msg144130). ........ Modified: branches/OpenMPT-1.30/ (props changed) branches/OpenMPT-1.30/soundlib/Load_stm.cpp Modified: branches/OpenMPT-1.30/soundlib/Load_stm.cpp ============================================================================== --- branches/OpenMPT-1.30/soundlib/Load_stm.cpp Sun Nov 17 23:26:15 2024 (r22212) +++ branches/OpenMPT-1.30/soundlib/Load_stm.cpp Sun Nov 17 23:26:41 2024 (r22213) @@ -49,7 +49,7 @@ && mptSmp.nLoopEnd != 0xFFFF) { mptSmp.uFlags = CHN_LOOP; - mptSmp.nLoopEnd = std::min(mptSmp.nLoopEnd, mptSmp.nLength); + mptSmp.nLength = std::max(mptSmp.nLoopEnd, mptSmp.nLength); } } }; |
From: <sv...@op...> - 2024-11-17 22:26:22
|
Author: sagamusix Date: Sun Nov 17 23:26:15 2024 New Revision: 22212 URL: https://source.openmpt.org/browse/openmpt/?op=revision&rev=22212 Log: Merged revision(s) 22211 from trunk/OpenMPT: [Fix] STM: Scream Tracker 2 does not sanitize loop ends, so a sample can continue reading into the next sample's data. Fixes lessons in love.stm (https://www.un4seen.com/forum/?topic=15448.msg144130#msg144130). ........ Modified: branches/OpenMPT-1.31/ (props changed) branches/OpenMPT-1.31/soundlib/Load_stm.cpp Modified: branches/OpenMPT-1.31/soundlib/Load_stm.cpp ============================================================================== --- branches/OpenMPT-1.31/soundlib/Load_stm.cpp Sun Nov 17 23:25:58 2024 (r22211) +++ branches/OpenMPT-1.31/soundlib/Load_stm.cpp Sun Nov 17 23:26:15 2024 (r22212) @@ -49,7 +49,7 @@ && mptSmp.nLoopEnd != 0xFFFF) { mptSmp.uFlags = CHN_LOOP; - mptSmp.nLoopEnd = std::min(mptSmp.nLoopEnd, mptSmp.nLength); + mptSmp.nLength = std::max(mptSmp.nLoopEnd, mptSmp.nLength); } } }; |
From: <sv...@op...> - 2024-11-17 22:26:11
|
Author: sagamusix Date: Sun Nov 17 23:25:58 2024 New Revision: 22211 URL: https://source.openmpt.org/browse/openmpt/?op=revision&rev=22211 Log: [Fix] STM: Scream Tracker 2 does not sanitize loop ends, so a sample can continue reading into the next sample's data. Fixes lessons in love.stm (https://www.un4seen.com/forum/?topic=15448.msg144130#msg144130). Modified: trunk/OpenMPT/soundlib/Load_stm.cpp Modified: trunk/OpenMPT/soundlib/Load_stm.cpp ============================================================================== --- trunk/OpenMPT/soundlib/Load_stm.cpp Sun Nov 17 21:49:30 2024 (r22210) +++ trunk/OpenMPT/soundlib/Load_stm.cpp Sun Nov 17 23:25:58 2024 (r22211) @@ -49,7 +49,7 @@ && mptSmp.nLoopEnd != 0xFFFF) { mptSmp.uFlags = CHN_LOOP; - mptSmp.nLoopEnd = std::min(mptSmp.nLoopEnd, mptSmp.nLength); + mptSmp.nLength = std::max(mptSmp.nLoopEnd, mptSmp.nLength); } } }; |
From: <sv...@op...> - 2024-11-17 20:49:43
|
Author: sagamusix Date: Sun Nov 17 21:49:30 2024 New Revision: 22210 URL: https://source.openmpt.org/browse/openmpt/?op=revision&rev=22210 Log: [Imp] Main toolbar: Allow changing the base octave by entering digits 0 to 8 or + and - into the (read-only) octave edit field. Modified: trunk/OpenMPT/mptrack/Mainbar.cpp trunk/OpenMPT/mptrack/Mainbar.h Modified: trunk/OpenMPT/mptrack/Mainbar.cpp ============================================================================== --- trunk/OpenMPT/mptrack/Mainbar.cpp Sat Nov 16 23:03:25 2024 (r22209) +++ trunk/OpenMPT/mptrack/Mainbar.cpp Sun Nov 17 21:49:30 2024 (r22210) @@ -27,6 +27,20 @@ OPENMPT_NAMESPACE_BEGIN +BEGIN_MESSAGE_MAP(COctaveEdit, CEdit) + ON_WM_CHAR() +END_MESSAGE_MAP() + +void COctaveEdit::OnChar(UINT nChar, UINT /*nRepCnt*/, UINT /*nFlags*/) +{ + if(nChar >= '0' + MIN_BASEOCTAVE && nChar <= '0' + MAX_BASEOCTAVE) + m_owner.SetBaseOctave(nChar - '0'); + else if(nChar == '+' && m_owner.GetBaseOctave() < MAX_BASEOCTAVE) + m_owner.SetBaseOctave(m_owner.GetBaseOctave() + 1); + else if(nChar == '-' && m_owner.GetBaseOctave() > MIN_BASEOCTAVE) + m_owner.SetBaseOctave(m_owner.GetBaseOctave() - 1); +} + ///////////////////////////////////////////////////////////////////// // CToolBarEx: custom toolbar base class Modified: trunk/OpenMPT/mptrack/Mainbar.h ============================================================================== --- trunk/OpenMPT/mptrack/Mainbar.h Sat Nov 16 23:03:25 2024 (r22209) +++ trunk/OpenMPT/mptrack/Mainbar.h Sun Nov 17 21:49:30 2024 (r22210) @@ -20,6 +20,7 @@ OPENMPT_NAMESPACE_BEGIN enum class MainToolBarItem : uint8; +class CMainToolBar; class CStereoVU: public CStatic { @@ -47,6 +48,19 @@ DECLARE_MESSAGE_MAP(); }; +class COctaveEdit : public CEdit +{ +public: + COctaveEdit(CMainToolBar &owner) : m_owner{owner} { } + +protected: + afx_msg void OnChar(UINT nChar, UINT nRepCnt, UINT nFlags); + + DECLARE_MESSAGE_MAP() + + CMainToolBar &m_owner; +}; + #define MIN_BASEOCTAVE 0 #define MAX_BASEOCTAVE 8 @@ -85,8 +99,9 @@ UpdateToolTip m_tooltip; CImageListEx m_ImageList, m_ImageListDisabled; CFont m_font; + COctaveEdit m_EditOctave; CNumberEdit m_EditTempo; - CEdit m_EditSpeed, m_EditOctave, m_EditRowsPerBeat, m_EditGlobalVolume; + CEdit m_EditSpeed, m_EditRowsPerBeat, m_EditGlobalVolume; CStatic m_StaticTempo, m_StaticSpeed, m_StaticRowsPerBeat, m_StaticGlobalVolume; CSpinButtonCtrl m_SpinTempo, m_SpinSpeed, m_SpinOctave, m_SpinRowsPerBeat, m_SpinGlobalVolume; int m_currentSpeed = 0, m_currentOctave = -1, m_currentRowsPerBeat = 0, m_currentGlobalVolume = 0; @@ -96,7 +111,7 @@ CStereoVU m_VuMeter; public: - CMainToolBar() = default; + CMainToolBar() : m_EditOctave{*this} { } protected: void SetRowsPerBeat(ROWINDEX nNewRPB); |
From: <sv...@op...> - 2024-11-16 22:03:43
|
Author: sagamusix Date: Sat Nov 16 23:03:25 2024 New Revision: 22209 URL: https://source.openmpt.org/browse/openmpt/?op=revision&rev=22209 Log: [New] Add experimental hexadecimal volume column mode. Has to be enabled via hidden setting "Pattern.VolumeColumnInHex" and then manually assign the corresponding keys for A-F (and reassign effect keys to something else; https://bugs.openmpt.org/view.php?id=1798) Modified: trunk/OpenMPT/mptrack/CommandSet.cpp trunk/OpenMPT/mptrack/CommandSet.h trunk/OpenMPT/mptrack/Draw_pat.cpp trunk/OpenMPT/mptrack/TrackerSettings.cpp trunk/OpenMPT/mptrack/TrackerSettings.h trunk/OpenMPT/mptrack/View_pat.cpp trunk/OpenMPT/mptrack/View_pat.h Modified: trunk/OpenMPT/mptrack/CommandSet.cpp ============================================================================== --- trunk/OpenMPT/mptrack/CommandSet.cpp Sat Nov 16 21:18:38 2024 (r22208) +++ trunk/OpenMPT/mptrack/CommandSet.cpp Sat Nov 16 23:03:25 2024 (r22209) @@ -1562,6 +1562,12 @@ {2104, kcToggleVisibilityVolumeColumn, _T("Toggle Volume Column Visibility")}, {2105, kcToggleVisibilityEffectColumn, _T("Toggle Effect Column Visibility")}, {2106, kcFileOpenTemplate, _T("File/Open Template")}, + {2107, kcSetVolumeA, _T("Set volume digit A")}, + {2108, kcSetVolumeB, _T("Set volume digit B")}, + {2109, kcSetVolumeC, _T("Set volume digit C")}, + {2110, kcSetVolumeD, _T("Set volume digit D")}, + {2111, kcSetVolumeE, _T("Set volume digit E")}, + {2112, kcSetVolumeF, _T("Set volume digit F")}, }; // clang-format on Modified: trunk/OpenMPT/mptrack/CommandSet.h ============================================================================== --- trunk/OpenMPT/mptrack/CommandSet.h Sat Nov 16 21:18:38 2024 (r22208) +++ trunk/OpenMPT/mptrack/CommandSet.h Sat Nov 16 23:03:25 2024 (r22209) @@ -743,7 +743,13 @@ kcSetVolume7, kcSetVolume8, kcSetVolume9, - kcEndVolumeDigits = kcSetVolume9, + kcSetVolumeA, + kcSetVolumeB, + kcSetVolumeC, + kcSetVolumeD, + kcSetVolumeE, + kcSetVolumeF, + kcEndVolumeDigits = kcSetVolumeF, kcStartVolumeCommands, kcSetVolumeVol = kcStartVolumeCommands, //v kcSetVolumePan, //p Modified: trunk/OpenMPT/mptrack/Draw_pat.cpp ============================================================================== --- trunk/OpenMPT/mptrack/Draw_pat.cpp Sat Nov 16 21:18:38 2024 (r22208) +++ trunk/OpenMPT/mptrack/Draw_pat.cpp Sat Nov 16 23:03:25 2024 (r22209) @@ -476,7 +476,7 @@ } -void CViewPattern::DrawVolumeCommand(int x, int y, const ModCommand &mc, bool drawDefaultVolume) +void CViewPattern::DrawVolumeCommand(int x, int y, const ModCommand &mc, bool drawDefaultVolume, bool hex) { const PATTERNFONT *pfnt = PatternFont::currentFont; @@ -508,10 +508,12 @@ { m_Dib.TextBlt(x, y, pfnt->nVolCmdWidth, pfnt->spacingY, pfnt->nVolX, pfnt->nVolY + volcmd * pfnt->spacingY, pfnt->dib); + const int digit1 = vol / (hex ? 16 : 10); + const int digit2 = vol % (hex ? 16 : 10); m_Dib.TextBlt(x+pfnt->nVolCmdWidth, y, pfnt->nVolHiWidth, pfnt->spacingY, - pfnt->nNumX, pfnt->nNumY + (vol / 10) * pfnt->spacingY, pfnt->dib); + pfnt->nNumX, pfnt->nNumY + digit1 * pfnt->spacingY, pfnt->dib); m_Dib.TextBlt(x+pfnt->nVolCmdWidth + pfnt->nVolHiWidth, y, pfnt->nEltWidths[2] - (pfnt->nVolCmdWidth + pfnt->nVolHiWidth), pfnt->spacingY, - pfnt->nNumX, pfnt->nNumY + (vol % 10) * pfnt->spacingY, pfnt->dib); + pfnt->nNumX, pfnt->nNumY + digit2 * pfnt->spacingY, pfnt->dib); } else { int srcx = pfnt->nEltWidths[0]; @@ -828,6 +830,7 @@ return; const CPattern &pattern = sndFile.Patterns[nPattern]; const auto patternSetupFlags = TrackerSettings::Instance().m_dwPatternSetup.Get(); + const bool volumeColumnIsHex = TrackerSettings::Instance().patternVolColHex; const PATTERNFONT *pfnt = PatternFont::currentFont; CRect rect; @@ -1121,7 +1124,7 @@ } // Drawing Volume m_Dib.SetTextColor(tx_col, bk_col); - DrawVolumeCommand(xbmp + x, 0, *m, drawDefaultVolume); + DrawVolumeCommand(xbmp + x, 0, *m, drawDefaultVolume, volumeColumnIsHex); } x += pfnt->nEltWidths[2]; } Modified: trunk/OpenMPT/mptrack/TrackerSettings.cpp ============================================================================== --- trunk/OpenMPT/mptrack/TrackerSettings.cpp Sat Nov 16 21:18:38 2024 (r22208) +++ trunk/OpenMPT/mptrack/TrackerSettings.cpp Sat Nov 16 23:03:25 2024 (r22209) @@ -273,6 +273,7 @@ , gbPatternRecord(conf, UL_("Pattern Editor"), UL_("Record"), true) , patternNoEditPopup(conf, UL_("Pattern Editor"), UL_("NoEditPopup"), false) , patternStepCommands(conf, UL_("Pattern Editor"), UL_("EditStepAppliesToCommands"), false) + , patternVolColHex(conf, UL_("Pattern Editor"), UL_("VolumeColumnInHex"), false) , m_dwPatternSetup(conf, UL_("Pattern Editor"), UL_("PatternSetup"), GetDefaultPatternSetup()) , m_nRowHighlightMeasures(conf, UL_("Pattern Editor"), UL_("RowSpacing"), 16) , m_nRowHighlightBeats(conf, UL_("Pattern Editor"), UL_("RowSpacing2"), 4) Modified: trunk/OpenMPT/mptrack/TrackerSettings.h ============================================================================== --- trunk/OpenMPT/mptrack/TrackerSettings.h Sat Nov 16 21:18:38 2024 (r22208) +++ trunk/OpenMPT/mptrack/TrackerSettings.h Sat Nov 16 23:03:25 2024 (r22209) @@ -810,6 +810,7 @@ CachedSetting<bool> gbPatternRecord; CachedSetting<bool> patternNoEditPopup; CachedSetting<bool> patternStepCommands; + CachedSetting<bool> patternVolColHex; CachedSetting<uint32> m_dwPatternSetup; CachedSetting<uint32> m_nRowHighlightMeasures; // primary (measures) and secondary (beats) highlight CachedSetting<uint32> m_nRowHighlightBeats; // primary (measures) and secondary (beats) highlight Modified: trunk/OpenMPT/mptrack/View_pat.cpp ============================================================================== --- trunk/OpenMPT/mptrack/View_pat.cpp Sat Nov 16 21:18:38 2024 (r22208) +++ trunk/OpenMPT/mptrack/View_pat.cpp Sat Nov 16 23:03:25 2024 (r22209) @@ -4956,7 +4956,8 @@ ModCommand &target = GetCursorCommand(); ModCommand m = target; // This is the command we are about to overwrite - const bool isDigit = (v >= 0) && (v <= 9); + const bool isHex = TrackerSettings::Instance().patternVolColHex; + const bool isDigit = (v >= 0x00) && (v <= 0x0F); if(m.IsPcNote()) { @@ -4968,7 +4969,10 @@ uint16 vol = m.vol; if(isDigit) { - vol = ((vol * 10) + v) % 100; + if(isHex) + vol = ((vol * 16) + v) % 256; + else + vol = ((vol * 10) + v) % 100; if(!volcmd) volcmd = VOLCMD_VOLUME; } else @@ -5009,7 +5013,10 @@ } if(vol > max) - vol %= 10; + { + vol %= (isHex ? 16 : 10); + LimitMax(vol, max); + } if(pSndFile->GetModSpecifications().HasVolCommand(volcmd)) { m_cmdOld.volcmd = m.volcmd = volcmd; Modified: trunk/OpenMPT/mptrack/View_pat.h ============================================================================== --- trunk/OpenMPT/mptrack/View_pat.h Sat Nov 16 21:18:38 2024 (r22208) +++ trunk/OpenMPT/mptrack/View_pat.h Sat Nov 16 23:03:25 2024 (r22209) @@ -295,7 +295,7 @@ #endif void DrawNote(int x, int y, UINT note, CTuning *pTuning = nullptr); void DrawInstrument(int x, int y, UINT instr); - void DrawVolumeCommand(int x, int y, const ModCommand &mc, bool drawDefaultVolume); + void DrawVolumeCommand(int x, int y, const ModCommand &mc, bool drawDefaultVolume, bool hex); void DrawChannelVUMeter(HDC hdc, int x, int y, UINT nChn); void UpdateAllVUMeters(Notification *pnotify); void DrawDragSel(HDC hdc); |
From: <sv...@op...> - 2024-11-16 20:18:45
|
Author: sagamusix Date: Sat Nov 16 21:18:38 2024 New Revision: 22208 URL: https://source.openmpt.org/browse/openmpt/?op=revision&rev=22208 Log: [Fix] Compile fix. Modified: branches/OpenMPT-1.31/mptrack/AdvancedConfigDlg.cpp Modified: branches/OpenMPT-1.31/mptrack/AdvancedConfigDlg.cpp ============================================================================== --- branches/OpenMPT-1.31/mptrack/AdvancedConfigDlg.cpp Sat Nov 16 20:40:38 2024 (r22207) +++ branches/OpenMPT-1.31/mptrack/AdvancedConfigDlg.cpp Sat Nov 16 21:18:38 2024 (r22208) @@ -105,7 +105,7 @@ if(m_listGrouped) { ListView_RemoveAllGroups(m_List.m_hWnd); - m_List.EnableGroupView(); + ListView_EnableGroupView(m_List.m_hWnd, TRUE); } m_List.SetItemCount(static_cast<int>(theApp.GetSettings().size())); |
From: <sv...@op...> - 2024-11-16 19:40:45
|
Author: sagamusix Date: Sat Nov 16 20:40:38 2024 New Revision: 22207 URL: https://source.openmpt.org/browse/openmpt/?op=revision&rev=22207 Log: Merged revision(s) 22206 from trunk/OpenMPT: [Fix] On Windows XP, removing all groups from a list view disables grouping. ........ Modified: branches/OpenMPT-1.31/ (props changed) branches/OpenMPT-1.31/mptrack/AdvancedConfigDlg.cpp Modified: branches/OpenMPT-1.31/mptrack/AdvancedConfigDlg.cpp ============================================================================== --- branches/OpenMPT-1.31/mptrack/AdvancedConfigDlg.cpp Sat Nov 16 20:39:17 2024 (r22206) +++ branches/OpenMPT-1.31/mptrack/AdvancedConfigDlg.cpp Sat Nov 16 20:40:38 2024 (r22207) @@ -105,6 +105,7 @@ if(m_listGrouped) { ListView_RemoveAllGroups(m_List.m_hWnd); + m_List.EnableGroupView(); } m_List.SetItemCount(static_cast<int>(theApp.GetSettings().size())); |