You can subscribe to this list here.
2006 |
Jan
|
Feb
|
Mar
(1) |
Apr
(1) |
May
|
Jun
(1) |
Jul
|
Aug
(10) |
Sep
|
Oct
|
Nov
|
Dec
(3) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2007 |
Jan
(1) |
Feb
(2) |
Mar
(3) |
Apr
(2) |
May
(10) |
Jun
(2) |
Jul
(1) |
Aug
|
Sep
|
Oct
|
Nov
(3) |
Dec
|
2008 |
Jan
(6) |
Feb
(4) |
Mar
(5) |
Apr
(2) |
May
(1) |
Jun
(1) |
Jul
(4) |
Aug
(6) |
Sep
(2) |
Oct
(9) |
Nov
(1) |
Dec
(4) |
2009 |
Jan
(9) |
Feb
(2) |
Mar
(2) |
Apr
(2) |
May
(6) |
Jun
(18) |
Jul
(33) |
Aug
(39) |
Sep
(33) |
Oct
(24) |
Nov
(23) |
Dec
(22) |
2010 |
Jan
(29) |
Feb
(32) |
Mar
(51) |
Apr
(17) |
May
(31) |
Jun
(21) |
Jul
(32) |
Aug
(28) |
Sep
(35) |
Oct
(27) |
Nov
(11) |
Dec
(13) |
2011 |
Jan
(14) |
Feb
(13) |
Mar
(27) |
Apr
(27) |
May
(28) |
Jun
(20) |
Jul
(43) |
Aug
(52) |
Sep
(66) |
Oct
(61) |
Nov
(11) |
Dec
(8) |
2012 |
Jan
(20) |
Feb
(30) |
Mar
(38) |
Apr
(21) |
May
(33) |
Jun
(21) |
Jul
(25) |
Aug
(9) |
Sep
(24) |
Oct
(42) |
Nov
(27) |
Dec
(41) |
2013 |
Jan
(20) |
Feb
(35) |
Mar
(156) |
Apr
(298) |
May
(258) |
Jun
(201) |
Jul
(105) |
Aug
(60) |
Sep
(193) |
Oct
(245) |
Nov
(280) |
Dec
(194) |
2014 |
Jan
(63) |
Feb
(202) |
Mar
(200) |
Apr
(23) |
May
(53) |
Jun
(105) |
Jul
(18) |
Aug
(26) |
Sep
(110) |
Oct
(187) |
Nov
(97) |
Dec
(74) |
2015 |
Jan
(45) |
Feb
(55) |
Mar
(116) |
Apr
(116) |
May
(193) |
Jun
(164) |
Jul
(50) |
Aug
(111) |
Sep
(98) |
Oct
(71) |
Nov
(103) |
Dec
(63) |
2016 |
Jan
(33) |
Feb
(101) |
Mar
(182) |
Apr
(139) |
May
(140) |
Jun
(103) |
Jul
(165) |
Aug
(286) |
Sep
(208) |
Oct
(127) |
Nov
(97) |
Dec
(54) |
2017 |
Jan
(64) |
Feb
(335) |
Mar
(202) |
Apr
(212) |
May
(139) |
Jun
(127) |
Jul
(294) |
Aug
(154) |
Sep
(170) |
Oct
(152) |
Nov
(156) |
Dec
(62) |
2018 |
Jan
(168) |
Feb
(237) |
Mar
(196) |
Apr
(174) |
May
(174) |
Jun
(161) |
Jul
(127) |
Aug
(88) |
Sep
(149) |
Oct
(66) |
Nov
(52) |
Dec
(135) |
2019 |
Jan
(146) |
Feb
(126) |
Mar
(104) |
Apr
(58) |
May
(60) |
Jun
(28) |
Jul
(197) |
Aug
(129) |
Sep
(141) |
Oct
(148) |
Nov
(63) |
Dec
(100) |
2020 |
Jan
(74) |
Feb
(37) |
Mar
(59) |
Apr
(154) |
May
(194) |
Jun
(133) |
Jul
(313) |
Aug
(197) |
Sep
(49) |
Oct
(162) |
Nov
(143) |
Dec
(57) |
2021 |
Jan
(120) |
Feb
(107) |
Mar
(314) |
Apr
(157) |
May
(524) |
Jun
(169) |
Jul
(72) |
Aug
(133) |
Sep
(135) |
Oct
(146) |
Nov
(198) |
Dec
(325) |
2022 |
Jan
(409) |
Feb
(249) |
Mar
(138) |
Apr
(95) |
May
(102) |
Jun
(221) |
Jul
(66) |
Aug
(120) |
Sep
(192) |
Oct
(131) |
Nov
(53) |
Dec
(171) |
2023 |
Jan
(357) |
Feb
(82) |
Mar
(168) |
Apr
(218) |
May
(196) |
Jun
(86) |
Jul
(115) |
Aug
(49) |
Sep
(190) |
Oct
(102) |
Nov
(45) |
Dec
(76) |
2024 |
Jan
(86) |
Feb
(50) |
Mar
(324) |
Apr
(209) |
May
(197) |
Jun
(232) |
Jul
(194) |
Aug
(247) |
Sep
(219) |
Oct
(266) |
Nov
(328) |
Dec
(304) |
2025 |
Jan
(191) |
Feb
(115) |
Mar
(137) |
Apr
(32) |
May
(126) |
Jun
(403) |
Jul
(213) |
Aug
(111) |
Sep
|
Oct
|
Nov
|
Dec
|
From: <sv...@op...> - 2024-09-21 10:09:45
|
Author: manx Date: Sat Sep 21 12:09:32 2024 New Revision: 21654 URL: https://source.openmpt.org/browse/openmpt/?op=revision&rev=21654 Log: [Fix] download_externals: Update outdated download URLs. Modified: branches/OpenMPT-1.26/build/download_externals.cmd Modified: branches/OpenMPT-1.26/build/download_externals.cmd ============================================================================== --- branches/OpenMPT-1.26/build/download_externals.cmd Sat Sep 21 10:00:44 2024 (r21653) +++ branches/OpenMPT-1.26/build/download_externals.cmd Sat Sep 21 12:09:32 2024 (r21654) @@ -61,8 +61,8 @@ call :download_and_unpack "winamp" "http://download.nullsoft.com/winamp/plugin-dev/WA5.55_SDK.exe" "WA5.55_SDK.exe" "." "-" || goto error call :download_and_unpack "xmplay" "https://www.un4seen.com/files/xmp-sdk.zip" "xmp-sdk.zip" "." "-" || goto error -call :download_and_unpack "ASIOSDK2" "https://www.steinberg.net/sdk_downloads/asiosdk2.3.zip" "asiosdk2.3.zip" "ASIOSDK2.3" "-" || goto error -call :download_and_unpack "vstsdk2.4" "https://www.steinberg.net/sdk_downloads/vstsdk365_12_11_2015_build_67.zip" "vstsdk365_12_11_2015_build_67.zip" "VST3 SDK" "-" || goto error +call :download_and_unpack "ASIOSDK2" "https://web.archive.org/web/20191011060157if_/https://www.steinberg.net/sdk_downloads/asiosdk2.3.zip" "asiosdk2.3.zip" "ASIOSDK2.3" "-" || goto error +call :download_and_unpack "vstsdk2.4" "https://web.archive.org/web/20200502121256if_/https://www.steinberg.net/sdk_downloads/vstsdk365_12_11_2015_build_67.zip" "vstsdk365_12_11_2015_build_67.zip" "VST3 SDK" "-" || goto error rem call :download_and_unpack "minimp3" "http://keyj.emphy.de/files/projects/minimp3.tar.gz" "minimp3.tar.gz" "minimp3" "minimp3.tar" || goto error goto ok |
From: <sv...@op...> - 2024-09-21 08:00:51
|
Author: manx Date: Sat Sep 21 10:00:44 2024 New Revision: 21653 URL: https://source.openmpt.org/browse/openmpt/?op=revision&rev=21653 Log: [Doc] libopenmpt: Whitespace cleanup in 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 Fri Sep 20 13:54:03 2024 (r21652) +++ branches/OpenMPT-1.31/doc/libopenmpt/changelog.md Sat Sep 21 10:00:44 2024 (r21653) @@ -7,8 +7,8 @@ ### libopenmpt 0.7.10-pre - * [**Change**] FST was added to the list of supported file extension. - AMP uses this extension for multichannel MODs. + * [**Change**] FST was added to the list of supported file extension. AMP uses + this extension for multichannel MODs. * [**Bug**] The Android NDK build system did not enable C++20 when available. @@ -32,7 +32,7 @@ * minimp3: Update to fork <https://github.com/manxorist/minimp3/releases/tag/openmpt-2024-08-15-v4> commit 2116754771b79347ad2f39127abace2a093c383e (2024-08-15). - + ### libopenmpt 0.7.9 (2024-07-21) * [**Sec**] Potential division by 0 when seeking in the module with |
From: <sv...@op...> - 2024-09-20 11:54:12
|
Author: sagamusix Date: Fri Sep 20 13:54:03 2024 New Revision: 21652 URL: https://source.openmpt.org/browse/openmpt/?op=revision&rev=21652 Log: [Ref] Reuse GetModifierMask() result. Modified: trunk/OpenMPT/mptrack/InputHandler.cpp Modified: trunk/OpenMPT/mptrack/InputHandler.cpp ============================================================================== --- trunk/OpenMPT/mptrack/InputHandler.cpp Fri Sep 20 13:35:30 2024 (r21651) +++ trunk/OpenMPT/mptrack/InputHandler.cpp Fri Sep 20 13:54:03 2024 (r21652) @@ -559,20 +559,21 @@ return false; // Alpha-numerics (only shift or no modifier): - if(!GetModifierMask().test_any_except(ModShift)) + const auto modifierMask = GetModifierMask(); + if(!modifierMask.test_any_except(ModShift)) { if((key >= 'A' && key <= 'Z') || (key >= '0' && key <= '9') || (key >= VK_MULTIPLY && key <= VK_DIVIDE) || key == VK_SPACE || key == VK_CAPITAL || (key >= VK_OEM_1 && key <= VK_OEM_3) || (key >= VK_OEM_4 && key <= VK_OEM_8)) return true; - if((key >= VK_NUMPAD0 && key <= VK_NUMPAD9) && GetModifierMask() == ModNone) + if((key >= VK_NUMPAD0 && key <= VK_NUMPAD9) && modifierMask == ModNone) return true; if(key == VK_RETURN && (GetWindowLong(hWnd, GWL_STYLE) & ES_MULTILINE)) return true; } // Navigation (any modifier except Alt without any other modifiers): - if(GetModifierMask() != ModAlt) + if(modifierMask != ModAlt) { if(key == VK_LEFT || key == VK_RIGHT || key == VK_UP || key == VK_DOWN || key == VK_HOME || key == VK_END || key == VK_DELETE || key == VK_INSERT || key == VK_BACK) @@ -580,7 +581,7 @@ } // Copy paste etc.. - if(GetModifierMask() == ModCtrl) + if(modifierMask == ModCtrl) { if(key == 'Y' || key == 'Z' || key == 'X' || key == 'C' || key == 'V' || key == 'A') return true; |
From: <sv...@op...> - 2024-09-20 11:35:38
|
Author: sagamusix Date: Fri Sep 20 13:35:30 2024 New Revision: 21651 URL: https://source.openmpt.org/browse/openmpt/?op=revision&rev=21651 Log: [Mod/Fix] Remove the last traces of the global keyboard hook. Modifier states are no longer cached, which should resolve the last remaining problems of "stuck" modifier keys. [Reg] Special key interception (Win/CapsLock/ScrollLock/NumLock) is no longer active in dialogs where there is no input handling (e.g. file dialogs, message boxes). Modified: trunk/OpenMPT/mptrack/Ctrl_com.cpp trunk/OpenMPT/mptrack/Ctrl_gen.cpp trunk/OpenMPT/mptrack/Ctrl_ins.cpp trunk/OpenMPT/mptrack/Ctrl_pat.cpp trunk/OpenMPT/mptrack/Ctrl_smp.cpp trunk/OpenMPT/mptrack/InputHandler.cpp trunk/OpenMPT/mptrack/InputHandler.h trunk/OpenMPT/mptrack/KeyConfigDlg.cpp trunk/OpenMPT/mptrack/MainFrm.cpp trunk/OpenMPT/mptrack/Mainfrm.h trunk/OpenMPT/mptrack/View_gen.cpp trunk/OpenMPT/mptrack/View_ins.cpp trunk/OpenMPT/mptrack/View_pat.cpp trunk/OpenMPT/mptrack/View_smp.cpp trunk/OpenMPT/mptrack/View_tre.cpp Modified: trunk/OpenMPT/mptrack/Ctrl_com.cpp ============================================================================== --- trunk/OpenMPT/mptrack/Ctrl_com.cpp Fri Sep 20 08:45:57 2024 (r21650) +++ trunk/OpenMPT/mptrack/Ctrl_com.cpp Fri Sep 20 13:35:30 2024 (r21651) @@ -333,7 +333,7 @@ // Ctrl-A is not handled by multiline edit boxes if(::GetFocus() == m_EditComments.m_hWnd) m_EditComments.SetSel(0, -1); - } else if(pMsg->message == WM_KEYDOWN && pMsg->wParam == VK_TAB && CMainFrame::GetMainFrame()->GetInputHandler()->GetModifierMask() == ModNone) + } else if(pMsg->message == WM_KEYDOWN && pMsg->wParam == VK_TAB && CInputHandler::GetModifierMask() == ModNone) { int selStart, selEnd; m_EditComments.GetSel(selStart, selEnd); Modified: trunk/OpenMPT/mptrack/Ctrl_gen.cpp ============================================================================== --- trunk/OpenMPT/mptrack/Ctrl_gen.cpp Fri Sep 20 08:45:57 2024 (r21650) +++ trunk/OpenMPT/mptrack/Ctrl_gen.cpp Fri Sep 20 13:35:30 2024 (r21651) @@ -465,9 +465,9 @@ pos32 *= TEMPO::fractFact; if(m_sndFile.GetModSpecifications().hasFractionalTempo) { - if(CMainFrame::GetMainFrame()->GetInputHandler()->CtrlPressed()) + if(CInputHandler::CtrlPressed()) pos32 /= 100; - else if(CMainFrame::GetMainFrame()->GetInputHandler()->ShiftPressed()) + else if(CInputHandler::ShiftPressed()) pos32 /= 10; } TEMPO newTempo; Modified: trunk/OpenMPT/mptrack/Ctrl_ins.cpp ============================================================================== --- trunk/OpenMPT/mptrack/Ctrl_ins.cpp Fri Sep 20 08:45:57 2024 (r21650) +++ trunk/OpenMPT/mptrack/Ctrl_ins.cpp Fri Sep 20 13:35:30 2024 (r21651) @@ -1953,7 +1953,7 @@ void CCtrlInstruments::OnInstrumentNew() { - InsertInstrument(m_sndFile.GetNumInstruments() > 0 && CMainFrame::GetInputHandler()->ShiftPressed()); + InsertInstrument(m_sndFile.GetNumInstruments() > 0 && CInputHandler::ShiftPressed()); SwitchToView(); } @@ -2025,7 +2025,7 @@ void CCtrlInstruments::OnInstrumentSave() { - SaveInstrument(CMainFrame::GetInputHandler()->ShiftPressed()); + SaveInstrument(CInputHandler::ShiftPressed()); } @@ -2833,7 +2833,7 @@ { if(m_nInstrument) { - m_modDoc.TogglePluginEditor(m_CbnMixPlug.GetSelection().value_or(PLUGINDEX_INVALID), CMainFrame::GetInputHandler()->ShiftPressed()); + m_modDoc.TogglePluginEditor(m_CbnMixPlug.GetSelection().value_or(PLUGINDEX_INVALID), CInputHandler::ShiftPressed()); } } @@ -3020,7 +3020,7 @@ if(IsLocked() || !m_nInstrument) return; INSTRUMENTINDEX firstIns = m_nInstrument, lastIns = m_nInstrument; - if(CMainFrame::GetInputHandler()->ShiftPressed()) + if(CInputHandler::ShiftPressed()) { firstIns = 1; lastIns = m_sndFile.GetNumInstruments(); Modified: trunk/OpenMPT/mptrack/Ctrl_pat.cpp ============================================================================== --- trunk/OpenMPT/mptrack/Ctrl_pat.cpp Fri Sep 20 08:45:57 2024 (r21650) +++ trunk/OpenMPT/mptrack/Ctrl_pat.cpp Fri Sep 20 13:35:30 2024 (r21651) @@ -1260,7 +1260,7 @@ { if(m_sndFile.GetInstrumentPlugin(m_nInstrument) != nullptr) { - m_modDoc.TogglePluginEditor(m_sndFile.Instruments[m_nInstrument]->nMixPlug - 1, CMainFrame::GetInputHandler()->ShiftPressed()); + m_modDoc.TogglePluginEditor(m_sndFile.Instruments[m_nInstrument]->nMixPlug - 1, CInputHandler::ShiftPressed()); } } Modified: trunk/OpenMPT/mptrack/Ctrl_smp.cpp ============================================================================== --- trunk/OpenMPT/mptrack/Ctrl_smp.cpp Fri Sep 20 08:45:57 2024 (r21650) +++ trunk/OpenMPT/mptrack/Ctrl_smp.cpp Fri Sep 20 13:35:30 2024 (r21651) @@ -1171,7 +1171,7 @@ void CCtrlSamples::OnSampleNew() { - InsertSample(CMainFrame::GetInputHandler()->ShiftPressed()); + InsertSample(CInputHandler::ShiftPressed()); SwitchToView(); } @@ -1359,7 +1359,7 @@ void CCtrlSamples::OnSampleSave() { - SaveSample(CMainFrame::GetInputHandler()->ShiftPressed()); + SaveSample(CInputHandler::ShiftPressed()); } @@ -1628,7 +1628,7 @@ void CCtrlSamples::OnNormalize() { - Normalize(CMainFrame::GetInputHandler()->ShiftPressed()); + Normalize(CInputHandler::ShiftPressed()); } @@ -1709,7 +1709,7 @@ void CCtrlSamples::OnRemoveDCOffset() { - RemoveDCOffset(CMainFrame::GetInputHandler()->ShiftPressed()); + RemoveDCOffset(CInputHandler::ShiftPressed()); } @@ -1785,7 +1785,7 @@ return; SAMPLEINDEX first = m_nSample, last = m_nSample; - if(CMainFrame::GetInputHandler()->ShiftPressed()) + if(CInputHandler::ShiftPressed()) { first = 1; last = m_sndFile.GetNumSamples(); @@ -3032,7 +3032,7 @@ void CCtrlSamples::OnKeepSampleOnDisk() { SAMPLEINDEX first = m_nSample, last = m_nSample; - if(CMainFrame::GetInputHandler()->ShiftPressed()) + if(CInputHandler::ShiftPressed()) { first = 1; last = m_sndFile.GetNumSamples(); Modified: trunk/OpenMPT/mptrack/InputHandler.cpp ============================================================================== --- trunk/OpenMPT/mptrack/InputHandler.cpp Fri Sep 20 08:45:57 2024 (r21650) +++ trunk/OpenMPT/mptrack/InputHandler.cpp Fri Sep 20 13:35:30 2024 (r21651) @@ -92,40 +92,14 @@ } -void CInputHandler::HandleModifierChanges(WPARAM wParam, LPARAM lParam) -{ - KeyMapRange cmd = { m_keyMap.end(), m_keyMap.end() }; - KeyEventType keyEventType; - - // Get the KeyEventType (key up, key down, key repeat) - DWORD scancode = static_cast<LONG>(lParam) >> 16; - if((scancode & 0xC000) == 0xC000) - keyEventType = kKeyEventUp; - else if((scancode & 0xC000) == 0x0000) - keyEventType = kKeyEventDown; - else - keyEventType = kKeyEventRepeat; - - // Catch modifier change (ctrl, alt, shift) - Only check on keyDown or keyUp. - // NB: we want to catch modifiers even when the input handler is locked - if(keyEventType == kKeyEventUp || keyEventType == kKeyEventDown) - { - scancode = (static_cast<LONG>(lParam) >> 16) & 0x1FF; - CatchModifierChange(wParam, keyEventType, scancode); - } - - if(!IsBypassed()) - InterceptSpecialKeys(static_cast<UINT>(wParam), static_cast<LONG>(lParam), true); -} - - CommandID CInputHandler::KeyEvent(const InputTargetContext context, const KeyboardEvent &event, CWnd *pSourceWnd) { if(InterceptSpecialKeys(event.key, event.flags, false)) return kcDummyShortcut; if(IsKeyPressHandledByTextBox(event.key, ::GetFocus())) return kcNull; - KeyMapRange cmd = m_keyMap.equal_range(KeyCombination(context, m_modifierMask, event.key, event.keyEventType)); + + KeyMapRange cmd = m_keyMap.equal_range(KeyCombination(context, GetModifierMask(), event.key, event.keyEventType)); if(pSourceWnd == nullptr) pSourceWnd = m_pMainFrm; // By default, send command message to main frame. @@ -202,50 +176,6 @@ }; -//Deal with Modifier keypresses. Private surouting used above. -bool CInputHandler::CatchModifierChange(WPARAM wParam, KeyEventType keyEventType, int scancode) -{ - FlagSet<Modifiers> modifierMask = ModNone; - // Scancode for right modifier keys should have bit 8 set, but Right Shift is actually 0x36. - const bool isRight = ((scancode & 0x100) || scancode == 0x36) && TrackerSettings::Instance().MiscDistinguishModifiers; - switch(wParam) - { - case VK_CONTROL: - modifierMask.set(isRight ? ModRCtrl : ModCtrl); - break; - case VK_SHIFT: - modifierMask.set(isRight ? ModRShift : ModShift); - break; - case VK_MENU: - modifierMask.set(isRight ? ModRAlt : ModAlt); - break; - case VK_LWIN: case VK_RWIN: // Feature: use Windows keys as modifier keys - modifierMask.set(ModWin); - break; - } - - if (modifierMask) // This keypress just changed the modifier mask - { - if (keyEventType == kKeyEventDown) - { - m_modifierMask.set(modifierMask); - // Right Alt is registered as Ctrl+Alt. - // Left Ctrl + Right Alt seems like a pretty difficult to use key combination anyway, so just ignore Ctrl. - if(scancode == 0x138) - m_modifierMask.reset(ModCtrl); -#ifdef _DEBUG - LogModifiers(); -#endif - } else if (keyEventType == kKeyEventUp) - m_modifierMask.reset(modifierMask); - - return true; - } - - return false; -} - - // Translate MIDI messages to shortcut commands CommandID CInputHandler::HandleMIDIMessage(InputTargetContext context, uint32 message) { @@ -293,19 +223,6 @@ } -//----------------------- Misc - - -void CInputHandler::LogModifiers() -{ - MPT_LOG_GLOBAL(LogDebug, "InputHandler", U_("----------------------------------\n")); - MPT_LOG_GLOBAL(LogDebug, "InputHandler", m_modifierMask[ModCtrl] ? U_("Ctrl On") : U_("Ctrl --")); - MPT_LOG_GLOBAL(LogDebug, "InputHandler", m_modifierMask[ModShift] ? U_("\tShft On") : U_("\tShft --")); - MPT_LOG_GLOBAL(LogDebug, "InputHandler", m_modifierMask[ModAlt] ? U_("\tAlt On") : U_("\tAlt --")); - MPT_LOG_GLOBAL(LogDebug, "InputHandler", m_modifierMask[ModWin] ? U_("\tWin On\n") : U_("\tWin --\n")); -} - - CInputHandler::KeyboardEvent CInputHandler::Translate(const MSG &msg) { MPT_ASSERT(msg.message == WM_KEYDOWN || msg.message == WM_SYSKEYDOWN || msg.message == WM_KEYUP || msg.message == WM_SYSKEYUP); @@ -364,33 +281,32 @@ int nSelectionKeys = m_activeCommandSet->GetKeyListSize(kcSelect); KeyCombination key; + const auto modifierMask = GetModifierMask(); for (int k=0; k<nSelectionKeys; k++) { key = m_activeCommandSet->GetKey(kcSelect, k); - if (m_modifierMask & key.Modifier()) - { + if(modifierMask & key.Modifier()) return true; - } } return false; } -bool CInputHandler::ShiftPressed() const +bool CInputHandler::ShiftPressed() { - return m_modifierMask[ModShift | ModRShift]; + return (GetAsyncKeyState(VK_SHIFT) & 0x8000) != 0; } -bool CInputHandler::CtrlPressed() const +bool CInputHandler::CtrlPressed() { - return m_modifierMask[ModCtrl | ModRCtrl]; + return (GetAsyncKeyState(VK_CONTROL) & 0x8000) != 0; } -bool CInputHandler::AltPressed() const +bool CInputHandler::AltPressed() { - return m_modifierMask[ModAlt | ModRAlt]; + return (GetAsyncKeyState(VK_MENU) & 0x8000) != 0; } @@ -425,15 +341,31 @@ } -FlagSet<Modifiers> CInputHandler::GetModifierMask() const +FlagSet<Modifiers> CInputHandler::GetModifierMask() { - return m_modifierMask; -} - + BYTE keyStates[256]; + FlagSet<Modifiers> modifierMask = ModNone; + if(!GetKeyboardState(keyStates)) + return modifierMask; -void CInputHandler::SetModifierMask(FlagSet<Modifiers> mask) -{ - m_modifierMask = mask; + const bool distinguishModifiers = TrackerSettings::Instance().MiscDistinguishModifiers; + if(keyStates[VK_LCONTROL] & 0x80) + modifierMask.set(ModCtrl); + if(keyStates[VK_RCONTROL] & 0x80) + modifierMask.set(distinguishModifiers ? ModRCtrl : ModCtrl); + if(keyStates[VK_LSHIFT] & 0x80) + modifierMask.set(ModShift); + if(keyStates[VK_RSHIFT] & 0x80) + modifierMask.set(distinguishModifiers ? ModRShift : ModShift); + if(keyStates[VK_LMENU] & 0x80) + modifierMask.set(ModAlt); + if(keyStates[VK_RMENU] & 0x80) + modifierMask.set(distinguishModifiers ? ModRAlt : ModAlt); + if(keyStates[VK_LWIN] & 0x80) + modifierMask.set(ModWin); + if(keyStates[VK_RWIN] & 0x80) + modifierMask.set(ModWin); + return modifierMask; } Modified: trunk/OpenMPT/mptrack/InputHandler.h ============================================================================== --- trunk/OpenMPT/mptrack/InputHandler.h Fri Sep 20 08:45:57 2024 (r21650) +++ trunk/OpenMPT/mptrack/InputHandler.h Fri Sep 20 13:35:30 2024 (r21651) @@ -23,7 +23,6 @@ protected: CWnd *m_pMainFrm; KeyMap m_keyMap; - FlagSet<Modifiers> m_modifierMask = ModNone; int m_bypassCount = 0; bool m_bInterceptWindowsKeys : 1, m_bInterceptNumLock : 1, m_bInterceptCapsLock : 1, m_bInterceptScrollLock : 1; @@ -43,7 +42,6 @@ public: CInputHandler(CWnd *mainframe); - void HandleModifierChanges(WPARAM wParam, LPARAM lParam); CommandID KeyEvent(const InputTargetContext context, const KeyboardEvent &event, CWnd *pSourceWnd = nullptr); static KeyboardEvent Translate(const MSG &msg); static KeyEventType GetKeyEventType(const MSG &msg); @@ -54,22 +52,19 @@ int GetKeyListSize(CommandID cmd) const; protected: - void LogModifiers(); - bool CatchModifierChange(WPARAM wParam, KeyEventType keyEventType, int scancode); bool InterceptSpecialKeys(UINT nChar, UINT nFlags, bool generateMsg); void SetupSpecialKeyInterception(); CommandID SendCommands(CWnd *wnd, const KeyMapRange &cmd); public: - bool ShiftPressed() const; bool SelectionPressed() const; - bool CtrlPressed() const; - bool AltPressed() const; + static bool ShiftPressed(); + static bool CtrlPressed(); + static bool AltPressed(); OrderTransitionMode ModifierKeysToTransitionMode(); bool IsBypassed() const; void Bypass(bool); - FlagSet<Modifiers> GetModifierMask() const; - void SetModifierMask(FlagSet<Modifiers> mask); + static FlagSet<Modifiers> GetModifierMask(); CString GetKeyTextFromCommand(CommandID c, const TCHAR *prependText = nullptr) const; CString GetMenuText(UINT id) const; void UpdateMainMenu(); Modified: trunk/OpenMPT/mptrack/KeyConfigDlg.cpp ============================================================================== --- trunk/OpenMPT/mptrack/KeyConfigDlg.cpp Fri Sep 20 08:45:57 2024 (r21650) +++ trunk/OpenMPT/mptrack/KeyConfigDlg.cpp Fri Sep 20 13:35:30 2024 (r21651) @@ -77,7 +77,7 @@ { if(pMsg->message == WM_KEYDOWN || pMsg->message == WM_SYSKEYDOWN) { - SetKey(CMainFrame::GetInputHandler()->GetModifierMask(), static_cast<UINT>(pMsg->wParam)); + SetKey(CInputHandler::GetModifierMask(), static_cast<UINT>(pMsg->wParam)); return -1; // Keypress handled, don't pass on message. } else if(pMsg->message == WM_KEYUP || pMsg->message == WM_SYSKEYUP) { Modified: trunk/OpenMPT/mptrack/MainFrm.cpp ============================================================================== --- trunk/OpenMPT/mptrack/MainFrm.cpp Fri Sep 20 08:45:57 2024 (r21650) +++ trunk/OpenMPT/mptrack/MainFrm.cpp Fri Sep 20 13:35:30 2024 (r21651) @@ -140,8 +140,6 @@ ON_COMMAND_RANGE(ID_MRU_LIST_FIRST, ID_MRU_LIST_LAST, &CMainFrame::OnOpenMRUItem) ON_UPDATE_COMMAND_UI(ID_MRU_LIST_FIRST, &CMainFrame::OnUpdateMRUItem) //}}AFX_MSG_MAP - ON_WM_INITMENU() - ON_WM_KILLFOCUS() ON_WM_MOUSEWHEEL() ON_WM_SHOWWINDOW() ON_WM_ACTIVATEAPP() @@ -149,7 +147,6 @@ // Globals OptionsPage CMainFrame::m_nLastOptionsPage = OPTIONS_PAGE_DEFAULT; -HHOOK CMainFrame::ghKbdHook = nullptr; HHOOK CMainFrame::g_focusHook = nullptr; // GDI @@ -234,7 +231,6 @@ m_nTimer = SetTimer(TIMERID_GUI, MPTTIMER_PERIOD, NULL); // Setup Keyboard Hook - ghKbdHook = SetWindowsHookEx(WH_KEYBOARD, KeyboardProc, AfxGetInstanceHandle(), GetCurrentThreadId()); g_focusHook = SetWindowsHookEx(WH_CBT, FocusChangeProc, AfxGetInstanceHandle(), GetCurrentThreadId()); // Update the tree @@ -351,12 +347,6 @@ #pragma warning(pop) #endif - // Uninstall Keyboard Hook - if(ghKbdHook) - { - UnhookWindowsHookEx(ghKbdHook); - ghKbdHook = nullptr; - } if(g_focusHook) { UnhookWindowsHookEx(g_focusHook); @@ -466,7 +456,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(m_InputHandler->CtrlPressed() && m_InputHandler->AltPressed() && m_InputHandler->ShiftPressed() && mpt::native_fs{}.is_directory(file)) + if(CInputHandler::GetModifierMask().test_all(ModCtrl | ModShift | ModAlt) && mpt::native_fs{}.is_directory(file)) { FolderScanner scanner(file, FolderScanner::kOnlyFiles | FolderScanner::kFindInSubDirectories); mpt::PathString scanName; @@ -500,21 +490,10 @@ { if(active) IPCWindow::UpdateLastUsed(); - else - m_InputHandler->SetModifierMask(ModNone); // Ensure modifiers are reset when we leave the window (e.g. Alt-Tab) CMDIFrameWnd::OnActivateApp(active, threadID); } -LRESULT CALLBACK CMainFrame::KeyboardProc(int code, WPARAM wParam, LPARAM lParam) -{ - if(code == HC_ACTION) - m_InputHandler->HandleModifierChanges(wParam, lParam); - - return CallNextHookEx(ghKbdHook, code, wParam, lParam); -} - - LRESULT CALLBACK CMainFrame::FocusChangeProc(int code, WPARAM wParam, LPARAM lParam) { // Hook to keep track of last focussed GUI item. This solves various focus issues when switching between @@ -2642,14 +2621,6 @@ } -void CMainFrame::OnInitMenu(CMenu* pMenu) -{ - m_InputHandler->SetModifierMask(ModNone); - CMDIFrameWnd::OnInitMenu(pMenu); - -} - - void CMainFrame::InitRenderer(CSoundFile *pSndFile) { CriticalSection cs; @@ -2678,15 +2649,6 @@ } -void CMainFrame::OnKillFocus(CWnd* pNewWnd) -{ - CMDIFrameWnd::OnKillFocus(pNewWnd); - - //rewbs: ensure modifiers are reset when we leave the window (e.g. alt-tab) - m_InputHandler->SetModifierMask(ModNone); -} - - void CMainFrame::OnShowWindow(BOOL bShow, UINT /*nStatus*/) { static bool firstShow = true; @@ -3381,7 +3343,6 @@ if(mainFrm != nullptr) { mainFrm->UpdateEffectKeys(mainFrm->GetActiveDoc()); - mainFrm->m_InputHandler->SetModifierMask(ModNone); } return ResultFromScode(S_OK); } Modified: trunk/OpenMPT/mptrack/Mainfrm.h ============================================================================== --- trunk/OpenMPT/mptrack/Mainfrm.h Fri Sep 20 08:45:57 2024 (r21650) +++ trunk/OpenMPT/mptrack/Mainfrm.h Fri Sep 20 13:35:30 2024 (r21651) @@ -144,7 +144,7 @@ // Globals static OptionsPage m_nLastOptionsPage; - static HHOOK ghKbdHook, g_focusHook; + static HHOOK g_focusHook; // GDI static HICON m_hIcon; @@ -446,9 +446,7 @@ //}}AFX_MSG DECLARE_MESSAGE_MAP() public: - afx_msg void OnInitMenu(CMenu *pMenu); bool UpdateEffectKeys(const CModDoc *modDoc); - afx_msg void OnKillFocus(CWnd* pNewWnd); afx_msg void OnShowWindow(BOOL bShow, UINT nStatus); // Defines maximum number of items in example modules menu. Modified: trunk/OpenMPT/mptrack/View_gen.cpp ============================================================================== --- trunk/OpenMPT/mptrack/View_gen.cpp Fri Sep 20 08:45:57 2024 (r21650) +++ trunk/OpenMPT/mptrack/View_gen.cpp Fri Sep 20 13:35:30 2024 (r21651) @@ -1,5 +1,5 @@ /* - * view_gen.cpp + * View_gen.cpp * ------------ * Purpose: General tab, lower panel. * Notes : (currently none) @@ -1264,8 +1264,8 @@ auto &mixPlugs = pModDoc->GetSoundFile().m_MixPlugins; auto ¤tPlug = pModDoc->GetSoundFile().m_MixPlugins[m_nCurrentPlugin]; bool bypass = IsDlgButtonChecked(IDC_CHECK10) != BST_UNCHECKED; - const bool bypassOthers = CMainFrame::GetInputHandler()->ShiftPressed(); - const bool bypassOnlyMasterPlugs = CMainFrame::GetInputHandler()->CtrlPressed(); + const bool bypassOthers = CInputHandler::ShiftPressed(); + const bool bypassOnlyMasterPlugs = CInputHandler::CtrlPressed(); if(bypassOthers || bypassOnlyMasterPlugs) { CheckDlgButton(IDC_CHECK10, currentPlug.IsBypassed() ? BST_CHECKED : BST_UNCHECKED); @@ -1354,7 +1354,7 @@ { CModDoc *pModDoc = GetDocument(); if ((m_nCurrentPlugin >= MAX_MIXPLUGINS) || (!pModDoc)) return; - pModDoc->TogglePluginEditor(m_nCurrentPlugin, CMainFrame::GetInputHandler()->ShiftPressed()); + pModDoc->TogglePluginEditor(m_nCurrentPlugin, CInputHandler::ShiftPressed()); return; } Modified: trunk/OpenMPT/mptrack/View_ins.cpp ============================================================================== --- trunk/OpenMPT/mptrack/View_ins.cpp Fri Sep 20 08:45:57 2024 (r21650) +++ trunk/OpenMPT/mptrack/View_ins.cpp Fri Sep 20 13:35:30 2024 (r21651) @@ -1481,7 +1481,7 @@ if(IsDragItemEnvPoint()) { // Ctrl pressed -> move tail of envelope - changed = EnvSetValue(m_nDragItem - 1, nTick, nVal, CMainFrame::GetInputHandler()->CtrlPressed()); + changed = EnvSetValue(m_nDragItem - 1, nTick, nVal, CInputHandler::CtrlPressed()); } else { int nPoint = ScreenToPoint(pt.x, pt.y); @@ -1711,7 +1711,7 @@ } else { // Shift-Click: Insert envelope point here - if(CMainFrame::GetInputHandler()->ShiftPressed()) + if(CInputHandler::ShiftPressed()) { if(InsertAtPoint(pt) == 0 && oldDragItem != 0) { @@ -2115,7 +2115,7 @@ break; } - bool insertNew = CMainFrame::GetInputHandler()->ShiftPressed() && sndFile.GetNumInstruments() > 0; + bool insertNew = CInputHandler::ShiftPressed() && sndFile.GetNumInstruments() > 0; if(dropInfo->insertType != DRAGONDROP::InsertType::Unspecified) insertNew = dropInfo->insertType == DRAGONDROP::InsertType::InsertNew && sndFile.GetNumInstruments() > 0; Modified: trunk/OpenMPT/mptrack/View_pat.cpp ============================================================================== --- trunk/OpenMPT/mptrack/View_pat.cpp Fri Sep 20 08:45:57 2024 (r21650) +++ trunk/OpenMPT/mptrack/View_pat.cpp Fri Sep 20 13:35:30 2024 (r21651) @@ -1298,7 +1298,7 @@ // Toggle record state modDoc->ToggleChannelRecordGroup(sourceChn, RecordGroup::Group1); InvalidateChannelsHeaders(sourceChn); - } else if(CMainFrame::GetInputHandler()->AltPressed()) + } else if(CInputHandler::AltPressed()) { // Solo / Unsolo OnSoloChannel(sourceChn, sourceChn); Modified: trunk/OpenMPT/mptrack/View_smp.cpp ============================================================================== --- trunk/OpenMPT/mptrack/View_smp.cpp Fri Sep 20 08:45:57 2024 (r21650) +++ trunk/OpenMPT/mptrack/View_smp.cpp Fri Sep 20 13:35:30 2024 (r21651) @@ -3125,7 +3125,7 @@ break; } - bool insertNew = CMainFrame::GetInputHandler()->ShiftPressed(); + bool insertNew = CInputHandler::ShiftPressed(); if(dropInfo->insertType != DRAGONDROP::InsertType::Unspecified) insertNew = dropInfo->insertType == DRAGONDROP::InsertType::InsertNew; Modified: trunk/OpenMPT/mptrack/View_tre.cpp ============================================================================== --- trunk/OpenMPT/mptrack/View_tre.cpp Fri Sep 20 08:45:57 2024 (r21650) +++ trunk/OpenMPT/mptrack/View_tre.cpp Fri Sep 20 13:35:30 2024 (r21651) @@ -3588,7 +3588,7 @@ void CModTree::OnDeleteTreeItem() { - DeleteTreeItem(GetSelectedItem(), CMainFrame::GetInputHandler()->ShiftPressed()); + DeleteTreeItem(GetSelectedItem(), CInputHandler::ShiftPressed()); } |
From: <sv...@op...> - 2024-09-20 06:46:09
|
Author: manx Date: Fri Sep 20 08:45:57 2024 New Revision: 21650 URL: https://source.openmpt.org/browse/openmpt/?op=revision&rev=21650 Log: [Ref] Add missing override. Modified: trunk/OpenMPT/mptrack/Globals.h Modified: trunk/OpenMPT/mptrack/Globals.h ============================================================================== --- trunk/OpenMPT/mptrack/Globals.h Fri Sep 20 08:42:43 2024 (r21649) +++ trunk/OpenMPT/mptrack/Globals.h Fri Sep 20 08:45:57 2024 (r21650) @@ -220,7 +220,7 @@ virtual LRESULT OnModViewMsg(WPARAM wParam, LPARAM lParam); virtual BOOL OnDragonDrop(BOOL, const DRAGONDROP *) { return FALSE; } virtual LRESULT OnPlayerNotify(Notification *) { return 0; } - BOOL PreTranslateMessage(MSG *pMsg); + BOOL PreTranslateMessage(MSG *pMsg) override; //}}AFX_VIRTUAL CModControlDlg *GetControlDlg() { return static_cast<CModControlView *>(CWnd::FromHandle(m_hWndCtrl))->GetCurrentControlDlg(); } |
From: <sv...@op...> - 2024-09-20 06:42:55
|
Author: manx Date: Fri Sep 20 08:42:43 2024 New Revision: 21649 URL: https://source.openmpt.org/browse/openmpt/?op=revision&rev=21649 Log: Merged revision(s) 21648 from trunk/OpenMPT: [Fix] build: CI: GitHub: macOS: XCode 16 is now just called '16'. ........ Modified: branches/OpenMPT-1.31/ (props changed) branches/OpenMPT-1.31/.github/workflows/macOS-Makefile.yml Modified: branches/OpenMPT-1.31/.github/workflows/macOS-Makefile.yml ============================================================================== --- branches/OpenMPT-1.31/.github/workflows/macOS-Makefile.yml Fri Sep 20 08:42:18 2024 (r21648) +++ branches/OpenMPT-1.31/.github/workflows/macOS-Makefile.yml Fri Sep 20 08:42:43 2024 (r21649) @@ -27,7 +27,7 @@ - { host: macos-14, compiler: '16.1', arch: x86_64, target: '10.15', deps: local, check: true , ancient: false } - { host: macos-14, compiler: '16.1', arch: x86_64, target: '10.14', deps: local, check: true , ancient: false } - { host: macos-14, compiler: '16.1', arch: x86_64, target: '10.13', deps: local, check: true , ancient: false } - - { host: macos-14, compiler: '16' ', arch: '' , target: '' , deps: sys , check: true , ancient: false } + - { host: macos-14, compiler: '16' , arch: '' , target: '' , deps: sys , check: true , ancient: false } - { host: macos-14, compiler: '16' , arch: arm64 , target: '' , deps: local, check: true , ancient: false } - { host: macos-14, compiler: '16' , arch: x86_64, target: '' , deps: local, check: true , ancient: false } - { host: macos-14, compiler: '16' , arch: arm64 , target: '' , deps: small, check: true , ancient: false } |
From: <sv...@op...> - 2024-09-20 06:42:30
|
Author: manx Date: Fri Sep 20 08:42:18 2024 New Revision: 21648 URL: https://source.openmpt.org/browse/openmpt/?op=revision&rev=21648 Log: [Fix] build: CI: GitHub: macOS: XCode 16 is now just called '16'. Modified: trunk/OpenMPT/.github/workflows/macOS-Makefile.yml Modified: trunk/OpenMPT/.github/workflows/macOS-Makefile.yml ============================================================================== --- trunk/OpenMPT/.github/workflows/macOS-Makefile.yml Fri Sep 20 08:26:54 2024 (r21647) +++ trunk/OpenMPT/.github/workflows/macOS-Makefile.yml Fri Sep 20 08:42:18 2024 (r21648) @@ -29,7 +29,7 @@ - { host: macos-14, compiler: '16.1', arch: x86_64, target: '10.15', deps: local, check: true , ancient: false } - { host: macos-14, compiler: '16.1', arch: x86_64, target: '10.14', deps: local, check: true , ancient: false } - { host: macos-14, compiler: '16.1', arch: x86_64, target: '10.13', deps: local, check: true , ancient: false } - - { host: macos-14, compiler: '16' ', arch: '' , target: '' , deps: sys , check: true , ancient: false } + - { host: macos-14, compiler: '16' , arch: '' , target: '' , deps: sys , check: true , ancient: false } - { host: macos-14, compiler: '16' , arch: arm64 , target: '' , deps: local, check: true , ancient: false } - { host: macos-14, compiler: '16' , arch: x86_64, target: '' , deps: local, check: true , ancient: false } - { host: macos-14, compiler: '16' , arch: arm64 , target: '' , deps: small, check: true , ancient: false } |
From: <sv...@op...> - 2024-09-20 06:27:06
|
Author: manx Date: Fri Sep 20 08:26:54 2024 New Revision: 21647 URL: https://source.openmpt.org/browse/openmpt/?op=revision&rev=21647 Log: Merged revision(s) 21646 from trunk/OpenMPT: [Fix] build: CI: GitHub: macOS: XCode 16 is now just called '16'. ........ Modified: branches/OpenMPT-1.31/ (props changed) branches/OpenMPT-1.31/.github/workflows/macOS-Autotools.yml branches/OpenMPT-1.31/.github/workflows/macOS-Makefile.yml Modified: branches/OpenMPT-1.31/.github/workflows/macOS-Autotools.yml ============================================================================== --- branches/OpenMPT-1.31/.github/workflows/macOS-Autotools.yml Fri Sep 20 08:26:30 2024 (r21646) +++ branches/OpenMPT-1.31/.github/workflows/macOS-Autotools.yml Fri Sep 20 08:26:54 2024 (r21647) @@ -11,7 +11,7 @@ matrix: include: - { host: macos-14, compiler: '16.1' } - - { host: macos-14, compiler: '16_Release_Candidate' } + - { host: macos-14, compiler: '16' } - { host: macos-14, compiler: '15.4' } - { host: macos-14, compiler: '15.3' } - { host: macos-13, compiler: '15.2' } Modified: branches/OpenMPT-1.31/.github/workflows/macOS-Makefile.yml ============================================================================== --- branches/OpenMPT-1.31/.github/workflows/macOS-Makefile.yml Fri Sep 20 08:26:30 2024 (r21646) +++ branches/OpenMPT-1.31/.github/workflows/macOS-Makefile.yml Fri Sep 20 08:26:54 2024 (r21647) @@ -27,22 +27,22 @@ - { host: macos-14, compiler: '16.1', arch: x86_64, target: '10.15', deps: local, check: true , ancient: false } - { host: macos-14, compiler: '16.1', arch: x86_64, target: '10.14', deps: local, check: true , ancient: false } - { host: macos-14, compiler: '16.1', arch: x86_64, target: '10.13', deps: local, check: true , ancient: false } - - { host: macos-14, compiler: '16_Release_Candidate', arch: '' , target: '' , deps: sys , check: true , ancient: false } - - { host: macos-14, compiler: '16_Release_Candidate', arch: arm64 , target: '' , deps: local, check: true , ancient: false } - - { host: macos-14, compiler: '16_Release_Candidate', arch: x86_64, target: '' , deps: local, check: true , ancient: false } - - { host: macos-14, compiler: '16_Release_Candidate', arch: arm64 , target: '' , deps: small, check: true , ancient: false } - - { host: macos-14, compiler: '16_Release_Candidate', arch: x86_64, target: '' , deps: small, check: true , ancient: false } - - { host: macos-14, compiler: '16_Release_Candidate', arch: arm64 , target: '14' , deps: local, check: true , ancient: false } - - { host: macos-14, compiler: '16_Release_Candidate', arch: x86_64, target: '14' , deps: local, check: true , ancient: false } - - { host: macos-14, compiler: '16_Release_Candidate', arch: arm64 , target: '13' , deps: local, check: true , ancient: false } - - { host: macos-14, compiler: '16_Release_Candidate', arch: x86_64, target: '13' , deps: local, check: true , ancient: false } - - { host: macos-14, compiler: '16_Release_Candidate', arch: arm64 , target: '12' , deps: local, check: true , ancient: false } - - { host: macos-14, compiler: '16_Release_Candidate', arch: x86_64, target: '12' , deps: local, check: true , ancient: false } - - { host: macos-14, compiler: '16_Release_Candidate', arch: arm64 , target: '11' , deps: local, check: true , ancient: false } - - { host: macos-14, compiler: '16_Release_Candidate', arch: x86_64, target: '11' , deps: local, check: true , ancient: false } - - { host: macos-14, compiler: '16_Release_Candidate', arch: x86_64, target: '10.15', deps: local, check: true , ancient: false } - - { host: macos-14, compiler: '16_Release_Candidate', arch: x86_64, target: '10.14', deps: local, check: true , ancient: false } - - { host: macos-14, compiler: '16_Release_Candidate', arch: x86_64, target: '10.13', deps: local, check: true , ancient: false } + - { host: macos-14, compiler: '16' ', arch: '' , target: '' , deps: sys , check: true , ancient: false } + - { host: macos-14, compiler: '16' , arch: arm64 , target: '' , deps: local, check: true , ancient: false } + - { host: macos-14, compiler: '16' , arch: x86_64, target: '' , deps: local, check: true , ancient: false } + - { host: macos-14, compiler: '16' , arch: arm64 , target: '' , deps: small, check: true , ancient: false } + - { host: macos-14, compiler: '16' , arch: x86_64, target: '' , deps: small, check: true , ancient: false } + - { host: macos-14, compiler: '16' , arch: arm64 , target: '14' , deps: local, check: true , ancient: false } + - { host: macos-14, compiler: '16' , arch: x86_64, target: '14' , deps: local, check: true , ancient: false } + - { host: macos-14, compiler: '16' , arch: arm64 , target: '13' , deps: local, check: true , ancient: false } + - { host: macos-14, compiler: '16' , arch: x86_64, target: '13' , deps: local, check: true , ancient: false } + - { host: macos-14, compiler: '16' , arch: arm64 , target: '12' , deps: local, check: true , ancient: false } + - { host: macos-14, compiler: '16' , arch: x86_64, target: '12' , deps: local, check: true , ancient: false } + - { host: macos-14, compiler: '16' , arch: arm64 , target: '11' , deps: local, check: true , ancient: false } + - { host: macos-14, compiler: '16' , arch: x86_64, target: '11' , deps: local, check: true , ancient: false } + - { host: macos-14, compiler: '16' , arch: x86_64, target: '10.15', deps: local, check: true , ancient: false } + - { host: macos-14, compiler: '16' , arch: x86_64, target: '10.14', deps: local, check: true , ancient: false } + - { host: macos-14, compiler: '16' , arch: x86_64, target: '10.13', deps: local, check: true , ancient: false } - { host: macos-14, compiler: '15.4', arch: '' , target: '' , deps: sys , check: true , ancient: false } - { host: macos-14, compiler: '15.4', arch: arm64 , target: '' , deps: local, check: true , ancient: false } - { host: macos-14, compiler: '15.4', arch: x86_64, target: '' , deps: local, check: true , ancient: false } |
From: <sv...@op...> - 2024-09-20 06:26:42
|
Author: manx Date: Fri Sep 20 08:26:30 2024 New Revision: 21646 URL: https://source.openmpt.org/browse/openmpt/?op=revision&rev=21646 Log: [Fix] build: CI: GitHub: macOS: XCode 16 is now just called '16'. Modified: trunk/OpenMPT/.github/workflows/macOS-Autotools.yml trunk/OpenMPT/.github/workflows/macOS-Makefile.yml Modified: trunk/OpenMPT/.github/workflows/macOS-Autotools.yml ============================================================================== --- trunk/OpenMPT/.github/workflows/macOS-Autotools.yml Thu Sep 19 22:34:46 2024 (r21645) +++ trunk/OpenMPT/.github/workflows/macOS-Autotools.yml Fri Sep 20 08:26:30 2024 (r21646) @@ -13,7 +13,7 @@ matrix: include: - { host: macos-14, compiler: '16.1' } - - { host: macos-14, compiler: '16_Release_Candidate' } + - { host: macos-14, compiler: '16' } - { host: macos-14, compiler: '15.4' } - { host: macos-14, compiler: '15.3' } - { host: macos-13, compiler: '15.2' } Modified: trunk/OpenMPT/.github/workflows/macOS-Makefile.yml ============================================================================== --- trunk/OpenMPT/.github/workflows/macOS-Makefile.yml Thu Sep 19 22:34:46 2024 (r21645) +++ trunk/OpenMPT/.github/workflows/macOS-Makefile.yml Fri Sep 20 08:26:30 2024 (r21646) @@ -29,22 +29,22 @@ - { host: macos-14, compiler: '16.1', arch: x86_64, target: '10.15', deps: local, check: true , ancient: false } - { host: macos-14, compiler: '16.1', arch: x86_64, target: '10.14', deps: local, check: true , ancient: false } - { host: macos-14, compiler: '16.1', arch: x86_64, target: '10.13', deps: local, check: true , ancient: false } - - { host: macos-14, compiler: '16_Release_Candidate', arch: '' , target: '' , deps: sys , check: true , ancient: false } - - { host: macos-14, compiler: '16_Release_Candidate', arch: arm64 , target: '' , deps: local, check: true , ancient: false } - - { host: macos-14, compiler: '16_Release_Candidate', arch: x86_64, target: '' , deps: local, check: true , ancient: false } - - { host: macos-14, compiler: '16_Release_Candidate', arch: arm64 , target: '' , deps: small, check: true , ancient: false } - - { host: macos-14, compiler: '16_Release_Candidate', arch: x86_64, target: '' , deps: small, check: true , ancient: false } - - { host: macos-14, compiler: '16_Release_Candidate', arch: arm64 , target: '14' , deps: local, check: true , ancient: false } - - { host: macos-14, compiler: '16_Release_Candidate', arch: x86_64, target: '14' , deps: local, check: true , ancient: false } - - { host: macos-14, compiler: '16_Release_Candidate', arch: arm64 , target: '13' , deps: local, check: true , ancient: false } - - { host: macos-14, compiler: '16_Release_Candidate', arch: x86_64, target: '13' , deps: local, check: true , ancient: false } - - { host: macos-14, compiler: '16_Release_Candidate', arch: arm64 , target: '12' , deps: local, check: true , ancient: false } - - { host: macos-14, compiler: '16_Release_Candidate', arch: x86_64, target: '12' , deps: local, check: true , ancient: false } - - { host: macos-14, compiler: '16_Release_Candidate', arch: arm64 , target: '11' , deps: local, check: true , ancient: false } - - { host: macos-14, compiler: '16_Release_Candidate', arch: x86_64, target: '11' , deps: local, check: true , ancient: false } - - { host: macos-14, compiler: '16_Release_Candidate', arch: x86_64, target: '10.15', deps: local, check: true , ancient: false } - - { host: macos-14, compiler: '16_Release_Candidate', arch: x86_64, target: '10.14', deps: local, check: true , ancient: false } - - { host: macos-14, compiler: '16_Release_Candidate', arch: x86_64, target: '10.13', deps: local, check: true , ancient: false } + - { host: macos-14, compiler: '16' ', arch: '' , target: '' , deps: sys , check: true , ancient: false } + - { host: macos-14, compiler: '16' , arch: arm64 , target: '' , deps: local, check: true , ancient: false } + - { host: macos-14, compiler: '16' , arch: x86_64, target: '' , deps: local, check: true , ancient: false } + - { host: macos-14, compiler: '16' , arch: arm64 , target: '' , deps: small, check: true , ancient: false } + - { host: macos-14, compiler: '16' , arch: x86_64, target: '' , deps: small, check: true , ancient: false } + - { host: macos-14, compiler: '16' , arch: arm64 , target: '14' , deps: local, check: true , ancient: false } + - { host: macos-14, compiler: '16' , arch: x86_64, target: '14' , deps: local, check: true , ancient: false } + - { host: macos-14, compiler: '16' , arch: arm64 , target: '13' , deps: local, check: true , ancient: false } + - { host: macos-14, compiler: '16' , arch: x86_64, target: '13' , deps: local, check: true , ancient: false } + - { host: macos-14, compiler: '16' , arch: arm64 , target: '12' , deps: local, check: true , ancient: false } + - { host: macos-14, compiler: '16' , arch: x86_64, target: '12' , deps: local, check: true , ancient: false } + - { host: macos-14, compiler: '16' , arch: arm64 , target: '11' , deps: local, check: true , ancient: false } + - { host: macos-14, compiler: '16' , arch: x86_64, target: '11' , deps: local, check: true , ancient: false } + - { host: macos-14, compiler: '16' , arch: x86_64, target: '10.15', deps: local, check: true , ancient: false } + - { host: macos-14, compiler: '16' , arch: x86_64, target: '10.14', deps: local, check: true , ancient: false } + - { host: macos-14, compiler: '16' , arch: x86_64, target: '10.13', deps: local, check: true , ancient: false } - { host: macos-14, compiler: '15.4', arch: '' , target: '' , deps: sys , check: true , ancient: false } - { host: macos-14, compiler: '15.4', arch: arm64 , target: '' , deps: local, check: true , ancient: false } - { host: macos-14, compiler: '15.4', arch: x86_64, target: '' , deps: local, check: true , ancient: false } |
From: <sv...@op...> - 2024-09-19 20:34:57
|
Author: sagamusix Date: Thu Sep 19 22:34:46 2024 New Revision: 21645 URL: https://source.openmpt.org/browse/openmpt/?op=revision&rev=21645 Log: [Fix] MOD: Avoid junk in pattern data when reading truncated files. Modified: trunk/OpenMPT/soundlib/MODTools.h Modified: trunk/OpenMPT/soundlib/MODTools.h ============================================================================== --- trunk/OpenMPT/soundlib/MODTools.h Thu Sep 19 20:03:17 2024 (r21644) +++ trunk/OpenMPT/soundlib/MODTools.h Thu Sep 19 22:34:46 2024 (r21645) @@ -89,7 +89,7 @@ template<typename T, typename TFileReader> inline T ReadAndSwap(TFileReader &file, const bool swapBytes) { - T value; + T value{}; if(file.Read(value) && swapBytes) { static_assert(sizeof(value) % 2u == 0); |
From: <sv...@op...> - 2024-09-19 18:03:28
|
Author: manx Date: Thu Sep 19 20:03:17 2024 New Revision: 21644 URL: https://source.openmpt.org/browse/openmpt/?op=revision&rev=21644 Log: [Fix] Fix typo in r21615. Modified: trunk/OpenMPT/Makefile Modified: trunk/OpenMPT/Makefile ============================================================================== --- trunk/OpenMPT/Makefile Thu Sep 19 19:27:48 2024 (r21643) +++ trunk/OpenMPT/Makefile Thu Sep 19 20:03:17 2024 (r21644) @@ -1949,7 +1949,7 @@ #svn export ./src/mpt/uuid_namespace bin/$(FLAVOUR_DIR)dist-zip/libopenmpt-$(DIST_LIBOPENMPT_VERSION)/src/mpt/uuid_namespace --native-eol CRLF svn export ./src/openmpt/all bin/$(FLAVOUR_DIR)dist-zip/libopenmpt-$(DIST_LIBOPENMPT_VERSION)/src/openmpt/all --native-eol CRLF svn export ./src/openmpt/base bin/$(FLAVOUR_DIR)dist-zip/libopenmpt-$(DIST_LIBOPENMPT_VERSION)/src/openmpt/base --native-eol CRLF - svn export ./src/openmpt/fileformat_ base bin/$(FLAVOUR_DIR)dist-zip/libopenmpt-$(DIST_LIBOPENMPT_VERSION)/src/openmpt/fileformat_base --native-eol CRLF + svn export ./src/openmpt/fileformat_base bin/$(FLAVOUR_DIR)dist-zip/libopenmpt-$(DIST_LIBOPENMPT_VERSION)/src/openmpt/fileformat_base --native-eol CRLF svn export ./src/openmpt/logging bin/$(FLAVOUR_DIR)dist-zip/libopenmpt-$(DIST_LIBOPENMPT_VERSION)/src/openmpt/logging --native-eol CRLF svn export ./src/openmpt/random bin/$(FLAVOUR_DIR)dist-zip/libopenmpt-$(DIST_LIBOPENMPT_VERSION)/src/openmpt/random --native-eol CRLF svn export ./src/openmpt/soundbase bin/$(FLAVOUR_DIR)dist-zip/libopenmpt-$(DIST_LIBOPENMPT_VERSION)/src/openmpt/soundbase --native-eol CRLF |
From: <sv...@op...> - 2024-09-19 17:28:00
|
Author: sagamusix Date: Thu Sep 19 19:27:48 2024 New Revision: 21643 URL: https://source.openmpt.org/browse/openmpt/?op=revision&rev=21643 Log: [Mod] When browsing for folders, use modern browser style when available. Old style can be enforced by hidden setting Display.UseOldStyleFolderBrowser (https://bugs.openmpt.org/view.php?id=1687). Modified: trunk/OpenMPT/mptrack/FileDialog.cpp trunk/OpenMPT/mptrack/TrackerSettings.cpp trunk/OpenMPT/mptrack/TrackerSettings.h Modified: trunk/OpenMPT/mptrack/FileDialog.cpp ============================================================================== --- trunk/OpenMPT/mptrack/FileDialog.cpp Thu Sep 19 18:51:42 2024 (r21642) +++ trunk/OpenMPT/mptrack/FileDialog.cpp Thu Sep 19 19:27:48 2024 (r21643) @@ -19,10 +19,17 @@ OPENMPT_NAMESPACE_BEGIN +enum class FileDialogType +{ + OpenFile, + SaveFile, + BrowseForFolder, +}; + class CFileDialogEx : public CFileDialog { public: - CFileDialogEx(bool bOpenFileDialog, + CFileDialogEx(FileDialogType type, LPCTSTR lpszDefExt, LPCTSTR lpszFileName, DWORD dwFlags, @@ -31,16 +38,36 @@ DWORD dwSize, BOOL bVistaStyle, bool preview) - : CFileDialog(bOpenFileDialog ? TRUE : FALSE, lpszDefExt, lpszFileName, dwFlags, lpszFilter, pParentWnd, dwSize, bVistaStyle) + : CFileDialog((type != FileDialogType::SaveFile) ? TRUE : FALSE, lpszDefExt, lpszFileName, dwFlags, lpszFilter, pParentWnd, dwSize, bVistaStyle) , m_fileNameBuf(65536) , doPreview(preview) - , played(false) { // MFC's filename buffer is way too small for multi-selections of a large number of files. _tcsncpy(m_fileNameBuf.data(), lpszFileName, m_fileNameBuf.size()); m_fileNameBuf.back() = '\0'; m_ofn.lpstrFile = m_fileNameBuf.data(); m_ofn.nMaxFile = mpt::saturate_cast<DWORD>(m_fileNameBuf.size()); + + if(type == FileDialogType::BrowseForFolder) + { + m_bPickFoldersMode = TRUE; + m_bPickNonFileSysFoldersMode = FALSE; + } + +#if MPT_WINNT_AT_LEAST(MPT_WIN_VISTA) + const auto places = + { + &TrackerSettings::Instance().PathPluginPresets, + &TrackerSettings::Instance().PathPlugins, + &TrackerSettings::Instance().PathSamples, + &TrackerSettings::Instance().PathInstruments, + &TrackerSettings::Instance().PathSongs, + }; + for(const auto place : places) + { + AddPlace(place->GetDefaultDir()); + } +#endif } ~CFileDialogEx() @@ -68,10 +95,16 @@ } #endif + static bool CanUseModernStyle() + { + return !mpt::OS::Windows::IsWine() && mpt::osinfo::windows::Version::Current().IsAtLeast(mpt::osinfo::windows::Version::WinVista); + } + protected: std::vector<TCHAR> m_fileNameBuf; CString oldName; - bool doPreview, played; + const bool doPreview; + bool played = false; void OnFileNameChange() override { @@ -98,14 +131,14 @@ m_filenames.clear(); // First, set up the dialog... - CFileDialogEx dlg(m_load, + CFileDialogEx dlg(m_load ? FileDialogType::OpenFile : FileDialogType::SaveFile, m_defaultExtension.empty() ? nullptr : m_defaultExtension.c_str(), m_defaultFilename.c_str(), OFN_EXPLORER | OFN_NOCHANGEDIR | OFN_HIDEREADONLY | OFN_ENABLESIZING | OFN_PATHMUSTEXIST | OFN_FILEMUSTEXIST | (m_multiSelect ? OFN_ALLOWMULTISELECT : 0) | (m_load ? 0 : (OFN_OVERWRITEPROMPT | OFN_NOREADONLYRETURN)), m_extFilter.c_str(), parent != nullptr ? parent : CMainFrame::GetMainFrame(), 0, - (mpt::OS::Windows::IsWine() || mpt::osinfo::windows::Version::Current().IsBefore(mpt::osinfo::windows::Version::WinVista)) ? FALSE : TRUE, + CFileDialogEx::CanUseModernStyle() ? TRUE : FALSE, m_preview && TrackerSettings::Instance().previewInFileDialogs); OPENFILENAME &ofn = dlg.GetOFN(); ofn.nFilterIndex = m_filterIndex != nullptr ? *m_filterIndex : 0; @@ -114,18 +147,6 @@ ofn.lpstrInitialDir = m_workingDirectory.c_str(); } #if MPT_WINNT_AT_LEAST(MPT_WIN_VISTA) - const auto places = - { - &TrackerSettings::Instance().PathPluginPresets, - &TrackerSettings::Instance().PathPlugins, - &TrackerSettings::Instance().PathSamples, - &TrackerSettings::Instance().PathInstruments, - &TrackerSettings::Instance().PathSongs, - }; - for(const auto place : places) - { - dlg.AddPlace(place->GetDefaultDir()); - } for(const auto &place : m_places) { dlg.AddPlace(place); @@ -211,13 +232,24 @@ // Display the folder dialog. bool BrowseForFolder::Show(CWnd *parent) { - // Note: MFC's CFolderPickerDialog won't work on pre-Vista systems, as it tries to use OPENFILENAME. BypassInputHandler bih; + + // Note: MFC's CFolderPickerDialog won't work on pre-Vista systems, as it tries to use OPENFILENAME unconditionally. + if(CFileDialogEx::CanUseModernStyle() && !TrackerSettings::Instance().useOldStyleFolderBrowser) + { + CFileDialogEx dlg{FileDialogType::BrowseForFolder, nullptr, m_workingDirectory.AsNative().c_str(), 0, nullptr, parent, 0, TRUE, false}; + dlg.m_ofn.lpstrTitle = m_caption; + if(dlg.DoModal() != IDOK) + return false; + m_workingDirectory = mpt::PathString::FromCString(dlg.GetFolderPath()); + return true; + } + TCHAR path[MAX_PATH]; - BROWSEINFO bi; - MemsetZero(bi); + BROWSEINFO bi{}; bi.hwndOwner = (parent != nullptr ? parent : theApp.m_pMainWnd)->m_hWnd; - if(!m_caption.IsEmpty()) bi.lpszTitle = m_caption; + if(!m_caption.IsEmpty()) + bi.lpszTitle = m_caption; bi.pszDisplayName = path; bi.ulFlags = BIF_RETURNONLYFSDIRS | BIF_USENEWUI; bi.lpfn = BrowseCallbackProc; Modified: trunk/OpenMPT/mptrack/TrackerSettings.cpp ============================================================================== --- trunk/OpenMPT/mptrack/TrackerSettings.cpp Thu Sep 19 18:51:42 2024 (r21642) +++ trunk/OpenMPT/mptrack/TrackerSettings.cpp Thu Sep 19 19:27:48 2024 (r21643) @@ -196,6 +196,7 @@ , accidentalFlats(conf, U_("Display"), U_("AccidentalFlats"), false) , rememberSongWindows(conf, U_("Display"), U_("RememberSongWindows"), true) , showDirsInSampleBrowser(conf, U_("Display"), U_("ShowDirsInSampleBrowser"), false) + , useOldStyleFolderBrowser(conf, U_("Display"), U_("UseOldStyleFolderBrowser"), false) , defaultRainbowChannelColors(conf, U_("Display"), U_("DefaultChannelColors"), DefaultChannelColors::Random) , commentsFont(conf, U_("Display"), U_("Comments Font"), FontSetting(U_("Courier New"), 120)) // Misc Modified: trunk/OpenMPT/mptrack/TrackerSettings.h ============================================================================== --- trunk/OpenMPT/mptrack/TrackerSettings.h Thu Sep 19 18:51:42 2024 (r21642) +++ trunk/OpenMPT/mptrack/TrackerSettings.h Thu Sep 19 19:27:48 2024 (r21643) @@ -693,6 +693,7 @@ CachedSetting<bool> accidentalFlats; Setting<bool> rememberSongWindows; Setting<bool> showDirsInSampleBrowser; + Setting<bool> useOldStyleFolderBrowser; Setting<DefaultChannelColors> defaultRainbowChannelColors; Setting<FontSetting> commentsFont; |
From: <sv...@op...> - 2024-09-19 16:51:54
|
Author: sagamusix Date: Thu Sep 19 18:51:42 2024 New Revision: 21642 URL: https://source.openmpt.org/browse/openmpt/?op=revision&rev=21642 Log: [Imp] MOD: Add simple workaround for Groo's "The Ultimate Beeper". It's not 100% accurate (EFx shouldn't do anything without the instrument number next to it, but with our approach it does) but good enough for making this module work and hopefully not break any other. Modified: trunk/OpenMPT/soundlib/Load_mod.cpp trunk/OpenMPT/soundlib/ModChannel.cpp Modified: trunk/OpenMPT/soundlib/Load_mod.cpp ============================================================================== --- trunk/OpenMPT/soundlib/Load_mod.cpp Thu Sep 19 17:34:44 2024 (r21641) +++ trunk/OpenMPT/soundlib/Load_mod.cpp Thu Sep 19 18:51:42 2024 (r21642) @@ -829,6 +829,18 @@ } } + // For "the ultimate beeper.mod" + { + ModSample &sample = Samples[0]; + sample.Initialize(MOD_TYPE_MOD); + sample.nLength = 2; + sample.nLoopStart = 0; + sample.nLoopEnd = 2; + sample.nVolume = 0; + sample.uFlags.set(CHN_LOOP); + sample.AllocateSample(); + } + // Fix VBlank MODs. Arbitrary threshold: 8 minutes (enough for "frame of mind" by Dascon...). // Basically, this just converts all tempo commands into speed commands // for MODs which are supposed to have VBlank timing (instead of CIA timing). Modified: trunk/OpenMPT/soundlib/ModChannel.cpp ============================================================================== --- trunk/OpenMPT/soundlib/ModChannel.cpp Thu Sep 19 17:34:44 2024 (r21641) +++ trunk/OpenMPT/soundlib/ModChannel.cpp Thu Sep 19 18:51:42 2024 (r21642) @@ -18,6 +18,8 @@ void ModChannel::Reset(ResetFlags resetMask, const CSoundFile &sndFile, CHANNELINDEX sourceChannel, ChannelFlags muteFlag) { + // For "the ultimate beeper.mod" + const ModSample *defaultSample = (sndFile.GetType() == MOD_TYPE_MOD && sndFile.GetSample(0).HasSampleData()) ? &sndFile.GetSample(0) : nullptr; if(resetMask & resetSetPosBasic) { // IT compatibility: Initial "last note memory" of channel is C-0 (so a lonely instrument number without note will play that note). @@ -25,7 +27,7 @@ nNote = nNewNote = (sndFile.m_playBehaviour[kITInitialNoteMemory] ? NOTE_MIN : NOTE_NONE); nArpeggioLastNote = lastMidiNoteWithoutArp = NOTE_NONE; nNewIns = nOldIns = 0; - pModSample = nullptr; + pModSample = defaultSample; pModInstrument = nullptr; nPortamentoDest = 0; nCommand = CMD_NONE; @@ -35,6 +37,7 @@ dwFlags.set(CHN_KEYOFF | CHN_NOTEFADE); dwOldFlags.reset(); autoSlide.Reset(); + nInsVol = 64; nnaGeneration = 0; //IT compatibility 15. Retrigger if(sndFile.m_playBehaviour[kITRetrigger]) @@ -65,7 +68,7 @@ nLoopStart = 0; nLoopEnd = 0; nROfs = nLOfs = 0; - pModSample = nullptr; + pModSample = defaultSample; pModInstrument = nullptr; nCutOff = 0x7F; nResonance = 0; |
From: <sv...@op...> - 2024-09-19 15:34:51
|
Author: manx Date: Thu Sep 19 17:34:44 2024 New Revision: 21641 URL: https://source.openmpt.org/browse/openmpt/?op=revision&rev=21641 Log: Merged revision(s) 21640 from trunk/OpenMPT: [Doc] libopenmpt: Tiny changelog formatting cleanup. ........ Modified: branches/OpenMPT-1.31/ (props changed) 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 Thu Sep 19 17:34:10 2024 (r21640) +++ branches/OpenMPT-1.31/doc/libopenmpt/changelog.md Thu Sep 19 17:34:44 2024 (r21641) @@ -262,7 +262,8 @@ * [**New**] Can now read a variant of the DSMI AMF format called DMF, as found in various DOS games distributed by Webfoot (Tronic, H2O, PowBall, etc.). * [**New**] `DSM` files from Dynamic Studio are now supported. - * [**New**] `XMF` files from the DOS game Imperium Galactica are now supported. + * [**New**] `XMF` files from the DOS game Imperium Galactica are now + supported. * [**New**] Can now read the hacked MOD format (`DMF`) from the game "Apocalypse Abyss". * [**New**] libopenmpt: New APIs for getting the current tempo as a floating @@ -395,7 +396,8 @@ as IMF/ PTM note slides. Tone portamento is now synchronized correctly when seeking in DBM, 669 and MED with fast slides (first tick of portamento was previously not executed). - * The filter cutoff frequency is no longer rounded to integer frequency values. + * The filter cutoff frequency is no longer rounded to integer frequency + values. * MED: Tempos higher than 255 BPM can now be imported in pattern data. * MED: MMD1 files with more than 16 channels are now supported. * ULT: Import 8-bit volume commands with full precision. @@ -404,7 +406,8 @@ * S3M: Better approximation of old "stereo control" SAx command used in Purple Motion's PANIC.S3M. * S3M: In ScreamTracker 3.03 and later, OPL notes with tone portamento next to - them are delayed until the next row and then the new pitch is used instantly. + them are delayed until the next row and then the new pitch is used + instantly. * MO3: Envelope sustain was not imported correctly if the source file was an XM. * MOD: Lone instrument number with retrigger effect swap sample immediately. |
From: <sv...@op...> - 2024-09-19 15:34:22
|
Author: manx Date: Thu Sep 19 17:34:10 2024 New Revision: 21640 URL: https://source.openmpt.org/browse/openmpt/?op=revision&rev=21640 Log: [Doc] libopenmpt: Tiny changelog formatting cleanup. Modified: trunk/OpenMPT/doc/libopenmpt/changelog.md Modified: trunk/OpenMPT/doc/libopenmpt/changelog.md ============================================================================== --- trunk/OpenMPT/doc/libopenmpt/changelog.md Thu Sep 19 17:07:21 2024 (r21639) +++ trunk/OpenMPT/doc/libopenmpt/changelog.md Thu Sep 19 17:34:10 2024 (r21640) @@ -35,7 +35,8 @@ * [**New**] Can now read a variant of the DSMI AMF format called DMF, as found in various DOS games distributed by Webfoot (Tronic, H2O, PowBall, etc.). * [**New**] `DSM` files from Dynamic Studio are now supported. - * [**New**] `XMF` files from the DOS game Imperium Galactica are now supported. + * [**New**] `XMF` files from the DOS game Imperium Galactica are now + supported. * [**New**] Can now read the hacked MOD format (`DMF`) from the game "Apocalypse Abyss". * [**New**] libopenmpt: New APIs for getting the current tempo as a floating @@ -168,7 +169,8 @@ as IMF/ PTM note slides. Tone portamento is now synchronized correctly when seeking in DBM, 669 and MED with fast slides (first tick of portamento was previously not executed). - * The filter cutoff frequency is no longer rounded to integer frequency values. + * The filter cutoff frequency is no longer rounded to integer frequency + values. * MED: Tempos higher than 255 BPM can now be imported in pattern data. * MED: MMD1 files with more than 16 channels are now supported. * ULT: Import 8-bit volume commands with full precision. @@ -177,7 +179,8 @@ * S3M: Better approximation of old "stereo control" SAx command used in Purple Motion's PANIC.S3M. * S3M: In ScreamTracker 3.03 and later, OPL notes with tone portamento next to - them are delayed until the next row and then the new pitch is used instantly. + them are delayed until the next row and then the new pitch is used + instantly. * MO3: Envelope sustain was not imported correctly if the source file was an XM. * MOD: Lone instrument number with retrigger effect swap sample immediately. |
From: <sv...@op...> - 2024-09-19 15:07:36
|
Author: sagamusix Date: Thu Sep 19 17:07:21 2024 New Revision: 21639 URL: https://source.openmpt.org/browse/openmpt/?op=revision&rev=21639 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 Thu Sep 19 17:07:08 2024 (r21638) +++ branches/OpenMPT-1.28/libopenmpt/dox/changelog.md Thu Sep 19 17:07:21 2024 (r21639) @@ -7,6 +7,9 @@ ### libopenmpt 0.4.45-pre + * Fixed inconsistency in length calculation and actual playback length with + tempo commands below 32 BPM in various formats (MDL among others). + * mpg123: Update to v1.32.7 (2024-08-07). ### libopenmpt 0.4.44 (2024-07-21) |
From: <sv...@op...> - 2024-09-19 15:07:19
|
Author: sagamusix Date: Thu Sep 19 17:07:08 2024 New Revision: 21638 URL: https://source.openmpt.org/browse/openmpt/?op=revision&rev=21638 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 Thu Sep 19 17:06:59 2024 (r21637) +++ branches/OpenMPT-1.29/libopenmpt/dox/changelog.md Thu Sep 19 17:07:08 2024 (r21638) @@ -7,6 +7,12 @@ ### libopenmpt 0.5.33-pre + * Fixed inconsistency in length calculation and actual playback length with + tempo commands below 32 BPM in various formats (MDL, MED among others). + * MED: Command 09 (set speed) was limited to 20 ticks per row instead of 32 + ticks per row. + * MED: Allow tempo parameters < 32 BPM. + * mpg123: Update to v1.32.7 (2024-08-07). ### libopenmpt 0.5.32 (2024-07-21) |
From: <sv...@op...> - 2024-09-19 15:07:06
|
Author: sagamusix Date: Thu Sep 19 17:06:59 2024 New Revision: 21637 URL: https://source.openmpt.org/browse/openmpt/?op=revision&rev=21637 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 Thu Sep 19 17:06:50 2024 (r21636) +++ branches/OpenMPT-1.30/libopenmpt/dox/changelog.md Thu Sep 19 17:06:59 2024 (r21637) @@ -7,6 +7,19 @@ ### libopenmpt 0.6.19-pre + * [**Sec**] Possible out-of-bounds read with malformed IT / MPTM / XM files + using the SymMOD Echo plugin when modern tempo mode with an invalid rows per + beat setting of 0 was used (r21607). + + * Fixed inconsistency in length calculation and actual playback length with + tempo commands below 32 BPM in various formats (MDL, MED among others). + * MED: Command 09 (set speed) was limited to 20 ticks per row instead of 32 + ticks per row. + * MED: Allow tempo parameters < 32 BPM. + * SFX: Ignore unused data at end of oneshot samples which sometimes caused + clicky noises. + * SFX: More accurate implementation of arpeggio effect. + * mpg123: Update to v1.32.7 (2024-08-07). ### libopenmpt 0.6.18 (2024-07-21) |
From: <sv...@op...> - 2024-09-19 15:07:03
|
Author: sagamusix Date: Thu Sep 19 17:06:50 2024 New Revision: 21636 URL: https://source.openmpt.org/browse/openmpt/?op=revision&rev=21636 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 Thu Sep 19 16:31:01 2024 (r21635) +++ branches/OpenMPT-1.31/doc/libopenmpt/changelog.md Thu Sep 19 17:06:50 2024 (r21636) @@ -7,8 +7,27 @@ ### libopenmpt 0.7.10-pre + * [**Change**] FST was added to the list of supported file extension. + AMP uses this extension for multichannel MODs. + * [**Bug**] The Android NDK build system did not enable C++20 when available. + * Fixed inconsistency in length calculation and actual playback length with + tempo commands below 32 BPM in various formats (MDL, MED among others). + * MED: Command 09 (set speed) was limited to 20 ticks per row instead of 32 + ticks per row. + * MED: Allow tempo parameters < 32 BPM. + * MED: Disallow free panning if hardware mixing is enabled. + * For MOD-style vibrato, a speed parameter of 0 was not treated as effect + memory. Vibrato speed is now correct for both vibrato commands. + * MED: Fix pattern index exhaustion in modules with multiple subsongs. + * OKT: Don't drop global commands when setting paired channel volume, and try + to write channel volume on the next row in this situation. + * PTM: Use square root pan law, like in XM files. + * SFX: Ignore unused data at end of oneshot samples which sometimes caused + clicky noises. + * SFX: More accurate implementation of arpeggio effect. + * mpg123: Update to v1.32.7 (2024-08-07). * minimp3: Update to fork <https://github.com/manxorist/minimp3/releases/tag/openmpt-2024-08-15-v4> |
From: <sv...@op...> - 2024-09-19 14:31:13
|
Author: sagamusix Date: Thu Sep 19 16:31:01 2024 New Revision: 21635 URL: https://source.openmpt.org/browse/openmpt/?op=revision&rev=21635 Log: Merged revision(s) 21634 from trunk/OpenMPT: [Fix] PTM: Revert fix of assumed PolyTracker panning bug. I keep forgetting that there's still no official DOSBox build with the fix for this bug in their GUS emulation... ........ Modified: branches/OpenMPT-1.31/ (props changed) branches/OpenMPT-1.31/soundlib/Sndmix.cpp Modified: branches/OpenMPT-1.31/soundlib/Sndmix.cpp ============================================================================== --- branches/OpenMPT-1.31/soundlib/Sndmix.cpp Thu Sep 19 16:30:32 2024 (r21634) +++ branches/OpenMPT-1.31/soundlib/Sndmix.cpp Thu Sep 19 16:31:01 2024 (r21635) @@ -2502,18 +2502,10 @@ // Test case: FT2PanLaw.xm LimitMax(pan, 255); - // PolyTracker also uses square root panning, but there's a bug where the leftmost and rightmost pan positions play the sample centered, without any attenuation. - if(GetType() == MOD_TYPE_PTM && (pan == 0 || pan == 255)) - { - chn.newLeftVol = realvol; - chn.newRightVol = realvol; - } else - { - const int panL = pan > 0 ? XMPanningTable[256 - pan] : 65536; - const int panR = XMPanningTable[pan]; - chn.newLeftVol = (realvol * panL) / 65536; - chn.newRightVol = (realvol * panR) / 65536; - } + const int panL = pan > 0 ? XMPanningTable[256 - pan] : 65536; + const int panR = XMPanningTable[pan]; + chn.newLeftVol = (realvol * panL) / 65536; + chn.newRightVol = (realvol * panR) / 65536; } else { chn.newLeftVol = (realvol * (256 - pan)) / 256; |
From: <sv...@op...> - 2024-09-19 14:30:41
|
Author: sagamusix Date: Thu Sep 19 16:30:32 2024 New Revision: 21634 URL: https://source.openmpt.org/browse/openmpt/?op=revision&rev=21634 Log: [Fix] PTM: Revert fix of assumed PolyTracker panning bug. I keep forgetting that there's still no official DOSBox build with the fix for this bug in their GUS emulation... Modified: trunk/OpenMPT/soundlib/Sndmix.cpp Modified: trunk/OpenMPT/soundlib/Sndmix.cpp ============================================================================== --- trunk/OpenMPT/soundlib/Sndmix.cpp Thu Sep 19 16:22:44 2024 (r21633) +++ trunk/OpenMPT/soundlib/Sndmix.cpp Thu Sep 19 16:30:32 2024 (r21634) @@ -2509,18 +2509,10 @@ // Test case: FT2PanLaw.xm LimitMax(pan, 255); - // PolyTracker also uses square root panning, but there's a bug where the leftmost and rightmost pan positions play the sample centered, without any attenuation. - if(GetType() == MOD_TYPE_PTM && (pan == 0 || pan == 255)) - { - chn.newLeftVol = realvol; - chn.newRightVol = realvol; - } else - { - const int panL = pan > 0 ? XMPanningTable[256 - pan] : 65536; - const int panR = XMPanningTable[pan]; - chn.newLeftVol = (realvol * panL) / 65536; - chn.newRightVol = (realvol * panR) / 65536; - } + const int panL = pan > 0 ? XMPanningTable[256 - pan] : 65536; + const int panR = XMPanningTable[pan]; + chn.newLeftVol = (realvol * panL) / 65536; + chn.newRightVol = (realvol * panR) / 65536; } else { chn.newLeftVol = (realvol * (256 - pan)) / 256; |
From: <sv...@op...> - 2024-09-19 14:22:56
|
Author: sagamusix Date: Thu Sep 19 16:22:44 2024 New Revision: 21633 URL: https://source.openmpt.org/browse/openmpt/?op=revision&rev=21633 Log: Merged revision(s) 21596, 21612 from trunk/OpenMPT: [Fix] Song Cleanup: Allow plugins only referenced by to-be-removed channels to be removed as well. ........ [Fix] MID: Loading samples when using MIDI + accompanying soundfont file was broken since r21370 (https://bugs.openmpt.org/view.php?id=1817). ........ Modified: branches/OpenMPT-1.31/ (props changed) branches/OpenMPT-1.31/mptrack/CleanupSong.cpp branches/OpenMPT-1.31/soundlib/Load_mid.cpp Modified: branches/OpenMPT-1.31/mptrack/CleanupSong.cpp ============================================================================== --- branches/OpenMPT-1.31/mptrack/CleanupSong.cpp Thu Sep 19 16:21:42 2024 (r21632) +++ branches/OpenMPT-1.31/mptrack/CleanupSong.cpp Thu Sep 19 16:22:44 2024 (r21633) @@ -163,16 +163,16 @@ if(m_CheckBoxes[kRearrangeSamples]) modified |= RearrangeSamples(); } - // Plugins - if(m_CheckBoxes[kRemoveAllPlugins]) modified |= RemoveAllPlugins(); - if(m_CheckBoxes[kCleanupPlugins]) modified |= RemoveUnusedPlugins(); - // Create samplepack if(m_CheckBoxes[kResetVariables]) modified |= ResetVariables(); // Remove unused channels if(m_CheckBoxes[kCleanupChannels]) modified |= RemoveUnusedChannels(); + // Plugins (done last because they can be referenced by both instruments and channels) + if(m_CheckBoxes[kRemoveAllPlugins]) modified |= RemoveAllPlugins(); + if(m_CheckBoxes[kCleanupPlugins]) modified |= RemoveUnusedPlugins(); + if(modified) modDoc.SetModified(); modDoc.UpdateAllViews(nullptr, UpdateHint().ModType()); logcapturer.ShowLog(true); Modified: branches/OpenMPT-1.31/soundlib/Load_mid.cpp ============================================================================== --- branches/OpenMPT-1.31/soundlib/Load_mid.cpp Thu Sep 19 16:21:42 2024 (r21632) +++ branches/OpenMPT-1.31/soundlib/Load_mid.cpp Thu Sep 19 16:22:44 2024 (r21633) @@ -1320,12 +1320,14 @@ } std::unique_ptr<CDLSBank> cachedBank, embeddedBank; + FileReader *bankFile = nullptr; if(CDLSBank::IsDLSBank(file)) { // Soundfont embedded in MIDI file embeddedBank = std::make_unique<CDLSBank>(); embeddedBank->Open(file); + bankFile = &file; } else { // Soundfont with same name as MIDI file @@ -1353,7 +1355,7 @@ else if(pIns->nMidiProgram) midiCode = (pIns->nMidiProgram - 1) & 0x7F; - if(embeddedBank && embeddedBank->FindAndExtract(*this, ins, midiCode >= 0x80, &file)) + if(embeddedBank && embeddedBank->FindAndExtract(*this, ins, midiCode >= 0x80, bankFile)) { continue; } |
From: <sv...@op...> - 2024-09-19 14:21:54
|
Author: sagamusix Date: Thu Sep 19 16:21:42 2024 New Revision: 21632 URL: https://source.openmpt.org/browse/openmpt/?op=revision&rev=21632 Log: Merged revision(s) 21581 from trunk/OpenMPT: [Ref] Silence warning. ........ Modified: branches/OpenMPT-1.31/ (props changed) branches/OpenMPT-1.31/soundlib/Load_okt.cpp Modified: branches/OpenMPT-1.31/soundlib/Load_okt.cpp ============================================================================== --- branches/OpenMPT-1.31/soundlib/Load_okt.cpp Thu Sep 19 16:20:57 2024 (r21631) +++ branches/OpenMPT-1.31/soundlib/Load_okt.cpp Thu Sep 19 16:21:42 2024 (r21632) @@ -263,7 +263,7 @@ } else if(row < rows - 1) { // Retry on next row - sndFile.Patterns[pat].GetpModCommand(row + 1, chn + pairedChn[chn])->SetEffectCommand(m); + sndFile.Patterns[pat].GetpModCommand(row + 1, static_cast<CHANNELINDEX>(chn + pairedChn[chn]))->SetEffectCommand(m); } } break; |
From: <sv...@op...> - 2024-09-19 14:21:05
|
Author: sagamusix Date: Thu Sep 19 16:20:57 2024 New Revision: 21631 URL: https://source.openmpt.org/browse/openmpt/?op=revision&rev=21631 Log: Merged revision(s) 21580 from trunk/OpenMPT: [Imp] OKT: Don't drop global commands when setting paired channel volume, and try to write channel volume on the next row in this situation. Fixes tempo at start of Orbit.okt, https://www.un4seen.com/forum/?topic=15448.msg143684#msg143684 ........ Modified: branches/OpenMPT-1.31/ (props changed) branches/OpenMPT-1.31/soundlib/Load_okt.cpp Modified: branches/OpenMPT-1.31/soundlib/Load_okt.cpp ============================================================================== --- branches/OpenMPT-1.31/soundlib/Load_okt.cpp Thu Sep 19 16:18:54 2024 (r21630) +++ branches/OpenMPT-1.31/soundlib/Load_okt.cpp Thu Sep 19 16:20:57 2024 (r21631) @@ -131,8 +131,7 @@ // Default volume only works on raw Paula channels if(pairedChn[chn] && sample.nVolume < 256) { - m.volcmd = VOLCMD_VOLUME; - m.vol = 64; + m.SetVolumeCommand(VOLCMD_VOLUME, 64); } // If channel and sample type don't match, stop this channel (add 100 to the instrument number to make it understandable what happened during import) if((sample.cues[0] == 1 && pairedChn[chn] != 0) || (sample.cues[0] == 0 && pairedChn[chn] == 0)) @@ -150,105 +149,72 @@ case 1: // 1 Portamento Down (Period) if(param) { - m.command = CMD_PORTAMENTOUP; - m.param = param; + m.SetEffectCommand(CMD_PORTAMENTOUP, param); } break; case 2: // 2 Portamento Up (Period) if(param) - { - m.command = CMD_PORTAMENTODOWN; - m.param = param; - } + m.SetEffectCommand(CMD_PORTAMENTODOWN, param); break; case 10: // A Arpeggio 1 (down, orig, up) if(param) - { - m.command = CMD_ARPEGGIO; - m.param = (param & 0x0F) | (InvertArpeggioParam(param >> 4) << 4); - } + m.SetEffectCommand(CMD_ARPEGGIO, (param & 0x0F) | (InvertArpeggioParam(param >> 4) << 4)); break; case 11: // B Arpeggio 2 (orig, up, orig, down) if(param) - { - m.command = CMD_ARPEGGIO; - m.param = (param & 0xF0) | InvertArpeggioParam(param & 0x0F); - } + m.SetEffectCommand(CMD_ARPEGGIO, (param & 0xF0) | InvertArpeggioParam(param & 0x0F)); break; // This one is close enough to "standard" arpeggio -- I think! case 12: // C Arpeggio 3 (up, up, orig) if(param) - { - m.command = CMD_ARPEGGIO; - m.param = param; - } + m.SetEffectCommand(CMD_ARPEGGIO, param); break; case 13: // D Slide Down (Notes) if(param) - { - m.command = CMD_NOTESLIDEDOWN; - m.param = 0x10 | std::min(uint8(0x0F), param); - } + m.SetEffectCommand(CMD_NOTESLIDEDOWN, 0x10 | std::min(uint8(0x0F), param)); break; case 30: // U Slide Up (Notes) if(param) - { - m.command = CMD_NOTESLIDEUP; - m.param = 0x10 | std::min(uint8(0x0F), param); - } + m.SetEffectCommand(CMD_NOTESLIDEUP, 0x10 | std::min(uint8(0x0F), param)); break; // Fine Slides are only implemented for libopenmpt. For OpenMPT, // sliding every 5 (non-note) ticks kind of works (at least at // speed 6), but implementing separate (format-agnostic) fine slide commands would of course be better. case 21: // L Slide Down Once (Notes) if(param) - { - m.command = CMD_NOTESLIDEDOWN; - m.param = 0x50 | std::min(uint8(0x0F), param); - } + m.SetEffectCommand(CMD_NOTESLIDEDOWN, 0x50 | std::min(uint8(0x0F), param)); break; case 17: // H Slide Up Once (Notes) if(param) - { - m.command = CMD_NOTESLIDEUP; - m.param = 0x50 | std::min(uint8(0x0F), param); - } + m.SetEffectCommand(CMD_NOTESLIDEUP, 0x50 | std::min(uint8(0x0F), param)); break; case 15: // F Set Filter <>00:ON - m.command = CMD_MODCMDEX; - m.param = !!param; + m.SetEffectCommand(CMD_MODCMDEX, !!param); break; case 25: // P Pos Jump - m.command = CMD_POSITIONJUMP; - m.param = param; + m.SetEffectCommand(CMD_POSITIONJUMP, param); break; case 27: // R Release sample (apparently not listed in the help!) - m.Clear(); m.note = NOTE_KEYOFF; + m.instr = 0; break; case 28: // S Speed if(param < 0x20) - { - m.command = CMD_SPEED; - m.param = param; - } + m.SetEffectCommand(CMD_SPEED, param); break; case 31: // V Volume // Volume on mixed channels is permanent, on hardware channels it behaves like in regular MODs if(param & 0x0F) - { - m.command = pairedChn[chn] ? CMD_CHANNELVOLSLIDE : CMD_VOLUMESLIDE; - m.param = param & 0x0F; - } + m.SetEffectCommand(pairedChn[chn] ? CMD_CHANNELVOLSLIDE : CMD_VOLUMESLIDE, param & 0x0F); switch(param >> 4) { @@ -260,13 +226,11 @@ case 0: case 1: case 2: case 3: if(pairedChn[chn]) { - m.command = CMD_CHANNELVOLUME; - m.param = param; + m.SetEffectCommand(CMD_CHANNELVOLUME, param); } else { - m.volcmd = VOLCMD_VOLUME; - m.vol = param; - m.command = CMD_NONE; + m.SetVolumeCommand(VOLCMD_VOLUME, param); + m.SetEffectCommand(oldCmd, oldParam); } break; case 5: // Normal slide up @@ -280,7 +244,7 @@ break; default: // Junk. - m.command = CMD_NONE; + m.SetEffectCommand(oldCmd, oldParam); break; } @@ -293,7 +257,14 @@ { other.SetVolumeCommand(volCmd); } - other.SetEffectCommand(m); + if(ModCommand::GetEffectWeight(other.command) < ModCommand::GetEffectWeight(m.command)) + { + other.SetEffectCommand(m); + } else if(row < rows - 1) + { + // Retry on next row + sndFile.Patterns[pat].GetpModCommand(row + 1, chn + pairedChn[chn])->SetEffectCommand(m); + } } break; |
From: <sv...@op...> - 2024-09-19 14:19:01
|
Author: sagamusix Date: Thu Sep 19 16:18:54 2024 New Revision: 21630 URL: https://source.openmpt.org/browse/openmpt/?op=revision&rev=21630 Log: Merged revision(s) 21577 from trunk/OpenMPT: [Fix] PTM: PolyTracker uses square root panning like FT2, and has a bug where the leftmost and rightmost positions play the sample without any attenuation on the left and right channels. Fixes bass balance in "BugFixed (The Song)" by Vic (https://www.un4seen.com/forum/?topic=15448.msg143684#msg143684). ........ Modified: branches/OpenMPT-1.31/ (props changed) branches/OpenMPT-1.31/soundlib/Load_ptm.cpp branches/OpenMPT-1.31/soundlib/Sndmix.cpp Modified: branches/OpenMPT-1.31/soundlib/Load_ptm.cpp ============================================================================== --- branches/OpenMPT-1.31/soundlib/Load_ptm.cpp Thu Sep 19 16:17:27 2024 (r21629) +++ branches/OpenMPT-1.31/soundlib/Load_ptm.cpp Thu Sep 19 16:18:54 2024 (r21630) @@ -175,6 +175,7 @@ m_modFormat.madeWithTracker = MPT_UFORMAT("PolyTracker {}.{}")(fileHeader.versionHi.get(), mpt::ufmt::hex0<2>(fileHeader.versionLo.get())); m_modFormat.charset = mpt::Charset::CP437; + SetMixLevels(MixLevels::CompatibleFT2); m_SongFlags = SONG_ITCOMPATGXX | SONG_ITOLDEFFECTS; m_nChannels = fileHeader.numChannels; m_nSamples = std::min(static_cast<SAMPLEINDEX>(fileHeader.numSamples), static_cast<SAMPLEINDEX>(MAX_SAMPLES - 1)); @@ -267,8 +268,7 @@ { case CMD_PANNING8: // Don't be surprised about the strange formula, this is directly translated from original disassembly... - m.command = CMD_S3MCMDEX; - m.param = 0x80 | ((std::max<uint8>(m.param >> 3, 1u) - 1u) & 0x0F); + m.SetEffectCommand(CMD_S3MCMDEX, static_cast<ModCommand::PARAM>(0x80 | ((std::max<uint8>(m.param >> 3, 1u) - 1u) & 0x0F))); break; case CMD_GLOBALVOLUME: m.param = std::min(m.param, uint8(0x40)) * 2u; @@ -279,8 +279,7 @@ } if(b & 0x80) { - m.volcmd = VOLCMD_VOLUME; - m.vol = file.ReadUint8(); + m.SetVolumeCommand(VOLCMD_VOLUME, file.ReadUint8()); } } } Modified: branches/OpenMPT-1.31/soundlib/Sndmix.cpp ============================================================================== --- branches/OpenMPT-1.31/soundlib/Sndmix.cpp Thu Sep 19 16:17:27 2024 (r21629) +++ branches/OpenMPT-1.31/soundlib/Sndmix.cpp Thu Sep 19 16:18:54 2024 (r21630) @@ -2477,15 +2477,10 @@ { int32 pan = (m_MixerSettings.gnChannels >= 2) ? Clamp(chn.nRealPan, 0, 256) : 128; - int32 realvol; - if(m_PlayConfig.getUseGlobalPreAmp()) - { - realvol = (chn.nRealVolume * kChnMasterVol) / 128; - } else - { - // Extra attenuation required here if we're bypassing pre-amp. - realvol = (chn.nRealVolume * kChnMasterVol) / 256; - } + int32 realvol = (chn.nRealVolume * kChnMasterVol) / 128; + // Extra attenuation required here if we're bypassing pre-amp. + if(!m_PlayConfig.getUseGlobalPreAmp()) + realvol /= 2; const PanningMode panningMode = m_PlayConfig.getPanningMode(); if(panningMode == PanningMode::SoftPanning || (panningMode == PanningMode::Undetermined && (m_MixerSettings.MixerFlags & SNDMIX_SOFTPANNING))) @@ -2506,10 +2501,19 @@ // you can never truly achieve 100% right panning in FT2, only 100% left. // Test case: FT2PanLaw.xm LimitMax(pan, 255); - const int panL = pan > 0 ? XMPanningTable[256 - pan] : 65536; - const int panR = XMPanningTable[pan]; - chn.newLeftVol = (realvol * panL) / 65536; - chn.newRightVol = (realvol * panR) / 65536; + + // PolyTracker also uses square root panning, but there's a bug where the leftmost and rightmost pan positions play the sample centered, without any attenuation. + if(GetType() == MOD_TYPE_PTM && (pan == 0 || pan == 255)) + { + chn.newLeftVol = realvol; + chn.newRightVol = realvol; + } else + { + const int panL = pan > 0 ? XMPanningTable[256 - pan] : 65536; + const int panR = XMPanningTable[pan]; + chn.newLeftVol = (realvol * panL) / 65536; + chn.newRightVol = (realvol * panR) / 65536; + } } else { chn.newLeftVol = (realvol * (256 - pan)) / 256; |