[Scummvm-git-logs] scummvm master -> 80a357034469823c6c5442cd6f8859ea8e8978f6

bluegr noreply at scummvm.org
Sat Oct 31 08:21:26 UTC 2026


This automated email contains information about 3 new commits which have been
pushed to the 'scummvm' repo located at https://api.github.com/repos/scummvm/scummvm .

Summary:
28bc20f218 BACKENDS: MIDI: Warm up WinMM on Win32  backend startup
ce2f54dd3a BACKENDS: MIDI: Show warm-up progress dialog only when GUI is active
80a3570344 BACKENDS: MIDI: Rename Windows backend source files


Commit: 28bc20f218a5b87ad23eba259b39480aeb470b18
    https://github.com/scummvm/scummvm/commit/28bc20f218a5b87ad23eba259b39480aeb470b18
Author: Hajin Jang (jb6804 at naver.com)
Date: 2026-10-31T10:21:19+02:00

Commit Message:
BACKENDS: MIDI: Warm up WinMM on Win32  backend startup

On Win32 backend startup, warm up WinMM by calling a dummy `midiOutGetNumDevs()` in a worker thread.

On Windows 11 25H2 or later, WinMM becomes a wrapper for Windows MIDI Services.
It caused first WinMM API calls to hang for about 10 seconds, making the ScummVM process unresponsible by OS.
To avoid this, introduce warm-up thread on Win32 backend.
If any WinMM API calls are requested before the warm-up is finished, show a dialog to keep processsing UI events.

The warm up architecture was modeled after macOS work: e844981c

Assisted-by: Codex:gpt-6.1

Changed paths:
  A backends/midi/windows.h
    backends/midi/windows.cpp
    backends/platform/sdl/win32/win32.cpp
    backends/platform/sdl/win32/win32.h
    gui/message.cpp
    gui/message.h


diff --git a/backends/midi/windows.cpp b/backends/midi/windows.cpp
index bfe88acd4b7..50512ba9796 100644
--- a/backends/midi/windows.cpp
+++ b/backends/midi/windows.cpp
@@ -27,10 +27,12 @@
 #if defined(WIN32)
 
 #define WIN32_LEAN_AND_MEAN
+#include <process.h>
 #include <windows.h>
 
 #include "audio/musicplugin.h"
 #include "audio/mpu401.h"
+#include "backends/midi/windows.h"
 #include "backends/platform/sdl/win32/win32_wrapper.h"
 #include "common/config-manager.h"
 #include "common/translation.h"
@@ -162,22 +164,79 @@ void MidiDriver_WIN::check_error(MMRESULT result) {
 
 // Plugin interface
 
-class WindowsMusicPlugin : public MusicPluginObject {
-public:
-	const char *getName() const override {
-		return _s("Windows MIDI");
-	}
+HANDLE WindowsMusicPlugin::_midiWarmUpThreadHandle = nullptr;
+WindowsMusicPlugin::MidiWarmUpWaitCallback WindowsMusicPlugin::_midiWarmUpWaitCallback = nullptr;
+
+WindowsMusicPlugin::WindowsMusicPlugin()
+	: _uiThreadId(GetCurrentThreadId()) {
+}
 
-	const char *getId() const override {
-		return "windows";
+const char *WindowsMusicPlugin::getName() const {
+	return _s("Windows MIDI");
+}
+
+const char *WindowsMusicPlugin::getId() const {
+	return "windows";
+}
+
+void WindowsMusicPlugin::startMidiWarmUpThread() {
+	// HANDLE for _beginthreadex must be initialized with nullptr, not an INVALID_HANDLE_VALUE.
+	if (_midiWarmUpThreadHandle != nullptr)
+		return;
+
+	// Warm up WinMM in the worker thread (outside from the UI thread) while the WinMM initializes.
+	// A failed thread creation leaves no pending warm-up, so enumeration can proceed.
+	_midiWarmUpThreadHandle = reinterpret_cast<HANDLE>(_beginthreadex(nullptr, 0, warmUpMidiThreadMain, nullptr, 0, nullptr));
+}
+
+void WindowsMusicPlugin::cleanupMidiWarmUpThread() {
+	_midiWarmUpWaitCallback = nullptr;
+	if (_midiWarmUpThreadHandle) {
+		// Closing the handle here does not terminate the thread.
+		CloseHandle(_midiWarmUpThreadHandle);
+		_midiWarmUpThreadHandle = nullptr;
 	}
+}
 
-	MusicDevices getDevices() const override;
-	Common::Error createInstance(MidiDriver **mididriver, MidiDriver::DeviceHandle = 0) const override;
-	bool checkDevice(MidiDriver::DeviceHandle hdl, int checkFlags, bool quiet) const override;
-};
+unsigned __stdcall WindowsMusicPlugin::warmUpMidiThreadMain(void *arglist) {
+	(void)arglist;
+	// Warm-up WinMM to make later WinMM requests instantaneous.
+	(void)midiOutGetNumDevs();
+	return 0;
+}
+
+bool WindowsMusicPlugin::isMidiWarmUpFinished() {
+	// Empty thread handle means exceptional states.
+	// But let's return true regardless, as this warm-up check is a best-effort.
+	// Subsequent WinMM calls works even in this case, albeit with a first-time UI thread 10 second hang.
+	if (_midiWarmUpThreadHandle == nullptr)
+		return true;
+
+	// Poll the warm-up thread's state without blocking.
+	// - If the thread is still running, it will return WAIT_TIMEOUT.
+	// - If the thread has been finished, it will return WAIT_OBJECT_0.
+	return WaitForSingleObject(_midiWarmUpThreadHandle, 0) == WAIT_OBJECT_0;
+}
+
+void WindowsMusicPlugin::setMidiWarmUpWaitCallback(MidiWarmUpWaitCallback callback) {
+	_midiWarmUpWaitCallback = callback;
+}
+
+bool WindowsMusicPlugin::waitForMidiWarmUp() const {
+	MidiWarmUpCompletion isComplete;
+	// OSystem_Win32 installs GUI::MidiDeviceScanDialog::waitForCompletion as the wait handler.
+	// While warm-up is pending, this callback shows a modal progress dialog on the UI thread.
+	// That modal dialog prevent process being marked as unresponsive by OS.
+	if (GetCurrentThreadId() == _uiThreadId && _midiWarmUpWaitCallback && !isComplete())
+		return _midiWarmUpWaitCallback(isComplete);
+
+	// Warm-up has been finished. Proceed without showing a modal dialog.
+	return true;
+}
 
 MusicDevices WindowsMusicPlugin::getDevices() const {
+	waitForMidiWarmUp();
+
 	MusicDevices devices;
 	int numDevs = midiOutGetNumDevs();
 	MIDIOUTCAPS tmp;
diff --git a/backends/midi/windows.h b/backends/midi/windows.h
new file mode 100644
index 00000000000..6276291f21c
--- /dev/null
+++ b/backends/midi/windows.h
@@ -0,0 +1,156 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program.  If not, see <http://www.gnu.org/licenses/>.
+ *
+ */
+
+#ifndef BACKENDS_MIDI_WINDOWS_H
+#define BACKENDS_MIDI_WINDOWS_H
+
+#include "audio/musicplugin.h"
+#include "common/func.h"
+
+#include <windows.h>
+
+/**
+ * Enumerate WinMM devices and create Windows MIDI drivers.
+ */
+class WindowsMusicPlugin : public MusicPluginObject {
+public:
+	WindowsMusicPlugin();
+
+	const char *getName() const override;
+	const char *getId() const override;
+
+	/**
+	 * Enumerate available MIDI devices with WinMM.
+	 */
+	MusicDevices getDevices() const override;
+
+	/**
+	 * Create a driver for the selected device, or the default device when no match exists.
+	 */
+	Common::Error createInstance(MidiDriver **mididriver, MidiDriver::DeviceHandle dev = 0) const override;
+
+	/**
+	 * Checks whether a device can actually be used.
+	 * Always return trues on Windows MIDI backend.
+	 */
+	bool checkDevice(MidiDriver::DeviceHandle hdl, int checkFlags, bool quiet) const override;
+
+	/**
+	 * Start background WinMM warm-up thread.
+	 *
+	 * Must be called on backend init after SDL audio init.
+	 * Windows MIDI Services init can block concurrent MME audo init,
+	 * one of the possible audio backend on Windows.
+	 * @see https://github.com/microsoft/MIDI/issues/1076
+	 */
+	static void startMidiWarmUpThread();
+
+	/**
+	 * Clear the warm-up thread result and resources.
+	 *
+	 * Should only be called on platform teardown.
+	 */
+	static void cleanupMidiWarmUpThread();
+
+	/**
+	 * Wait for background MIDI warm-up while keeping the process responsive,
+	 * by spawning a modal dialog.
+	 *
+	 * @param isComplete A functor immediately returns whether the warm-up has been finished.
+	 * @return True if completion was observed.
+	 *         False if quitting ScummVM or returning to the launcher ended the wait first.
+	 *
+	 * @see setMidiWarmUpWaitCallback()
+	 */
+	typedef bool (*MidiWarmUpWaitCallback)(const Common::Functor0<bool> &isComplete);
+
+	/**
+	 * Register the function that displays progress dialog while MIDI warm-up is running.
+	 * The main purpose of that dialog is to prevent UI thread hang by first WinMM API call.
+	 *
+	 * WinMM APIs may be called while the warm-up thread is still running.
+	 * In that case, the plugin invokes this callback on the UI thread to spawn the dialog.
+	 * The dialog polls @p isComplete while processing UI events.
+	 *
+	 * The Windows backend registers GUI::MidiDeviceScanDialog::waitForCompletion() as a callback.
+	 *
+	 * @param callback Function that spawns a progress dialog.
+	 *
+	 * @see MidiWarmUpWaitCallback
+	 */
+	static void setMidiWarmUpWaitCallback(MidiWarmUpWaitCallback callback);
+
+private:
+	/**
+	 * Expose the plugin's private warm-up status query as Common::Functor0<bool>.
+	 *
+	 * The progress handler must poll this predicate on the UI thread while processing events.
+	 * This lets the MIDI plugin use a GUI wait handler without depending on GUI classes.
+	 */
+	class MidiWarmUpCompletion : public Common::Functor0<bool> {
+	public:
+		/**
+		 * Report whether the predicate has a valid query target.
+		 *
+		 * @return Always true, since the query is static and requires no plugin instance.
+		 */
+		bool isValid() const override { return true; }
+
+		/**
+		 * Query warm-up status on the UI thread without waiting.
+		 *
+		 * @return True if the worker has exited or no warm-up handle is retained,
+		 *         otherwise false.
+		 */
+		bool operator()() const override { return isMidiWarmUpFinished(); }
+	};
+
+	/** Query completion on the UI thread without blocking; no worker means no pending warm-up. */
+	static bool isMidiWarmUpFinished();
+
+	/**
+	 * Warm up WinMM in the worker thread.
+	 *
+	 * @remark
+	 * Thread termination also signals completion.
+	 */
+	static unsigned __stdcall warmUpMidiThreadMain(void *arglist);
+
+	/**
+	 * Returns immediately if MIDI backend warm-up has been finished.
+	 * Show a progress dialog if the warm-up is not finished yet.
+	 *
+	 * @return False if the UI handler is interrupted, otherwise enumeration may proceed.
+	 *         Interruption of UI handler can happen on quit event or return-to-launcher event.
+	 */
+	bool waitForMidiWarmUp() const;
+
+	/** UI-thread-owned worker handle, retained until backend cleanup. */
+	static HANDLE _midiWarmUpThreadHandle;
+
+	/** UI-thread-only handler, installed by the backend and cleared before backend destruction. */
+	static MidiWarmUpWaitCallback _midiWarmUpWaitCallback;
+
+	/** Thread that created this plugin and is allowed to invoke the progress handler. */
+	const DWORD _uiThreadId;
+};
+
+#endif
diff --git a/backends/platform/sdl/win32/win32.cpp b/backends/platform/sdl/win32/win32.cpp
index 60b27186e97..2b3b5bd2428 100644
--- a/backends/platform/sdl/win32/win32.cpp
+++ b/backends/platform/sdl/win32/win32.cpp
@@ -39,7 +39,10 @@
 #include "common/error.h"
 #include "common/textconsole.h"
 
+#include "gui/message.h"
+
 #include "backends/audiocd/win32/win32-audiocd.h"
+#include "backends/midi/windows.h"
 #include "backends/platform/sdl/win32/win32.h"
 #include "backends/platform/sdl/win32/win32-window.h"
 #include "backends/platform/sdl/win32/win32_wrapper.h"
@@ -63,6 +66,10 @@ OSystem_Win32::OSystem_Win32() :
 	_isPortable(false) {
 }
 
+OSystem_Win32::~OSystem_Win32() {
+	WindowsMusicPlugin::cleanupMidiWarmUpThread();
+}
+
 void OSystem_Win32::init() {
 	// Initialize File System Factory
 	_fsFactory = new WindowsFilesystemFactory();
@@ -141,6 +148,15 @@ void OSystem_Win32::initBackend() {
 
 	// Invoke parent implementation of this method
 	OSystem_SDL::initBackend();
+
+	// On Windows 11 25H2 and later, the first WinMM device query takes about 10 seconds,
+	// while new MIDI backend (Windows MIDI Services) initializes.
+	// If this happens on the UI thread, this can make Windows report ScummVM as unresponsive.
+	// Warm up the MIDI backend in a background thread during startup to avoid this.
+	WindowsMusicPlugin::startMidiWarmUpThread();
+
+	// Register the progress handler used by getDevices() on the UI thread.
+	WindowsMusicPlugin::setMidiWarmUpWaitCallback(&GUI::MidiDeviceScanDialog::waitForCompletion);
 }
 
 #ifdef USE_OPENGL
diff --git a/backends/platform/sdl/win32/win32.h b/backends/platform/sdl/win32/win32.h
index 89324e6e20c..1c490064148 100644
--- a/backends/platform/sdl/win32/win32.h
+++ b/backends/platform/sdl/win32/win32.h
@@ -28,6 +28,7 @@
 class OSystem_Win32 final : public OSystem_SDL {
 public:
 	OSystem_Win32();
+	~OSystem_Win32() override;
 
 	void init() override;
 	void initBackend() override;
diff --git a/gui/message.cpp b/gui/message.cpp
index a2659e236f7..603aa57b857 100644
--- a/gui/message.cpp
+++ b/gui/message.cpp
@@ -19,6 +19,7 @@
  *
  */
 
+#include "common/func.h"
 #include "common/str.h"
 #include "common/system.h"
 #include "common/translation.h"
@@ -282,5 +283,30 @@ MessageDialogWithURL::MessageDialogWithURL(const Common::String &message, const
 		: MessageDialog(Common::U32String(message), Common::U32String(defaultButton), _("Open URL"), alignment, url) {
 }
 
+MidiDeviceScanDialog::MidiDeviceScanDialog(const Common::Functor0<bool> &isComplete)
+	// I18N: Shown while MIDI output devices are being detected.
+	: MessageDialog(_("Scanning MIDI devices..."), Common::U32String(), Common::U32String()), _isComplete(isComplete) {
+}
+
+bool MidiDeviceScanDialog::waitForCompletion(const Common::Functor0<bool> &isComplete) {
+	if (isComplete())
+		return true;
+
+	MidiDeviceScanDialog dialog(isComplete);
+	return dialog.runModal() == kCompleted;
+}
+
+void MidiDeviceScanDialog::handleTickle() {
+	MessageDialog::handleTickle();
+	if (_isComplete()) {
+		setResult(kCompleted);
+		close();
+	}
+}
+
+void MidiDeviceScanDialog::handleKeyDown(Common::KeyState state) {
+	if (state.keycode != Common::KEYCODE_ESCAPE)
+		MessageDialog::handleKeyDown(state);
+}
 
 } // End of namespace GUI
diff --git a/gui/message.h b/gui/message.h
index 4916ed3196c..70a64984885 100644
--- a/gui/message.h
+++ b/gui/message.h
@@ -26,6 +26,11 @@
 #include "common/str.h"
 #include "common/str-array.h"
 
+namespace Common {
+template<class Res>
+struct Functor0;
+}
+
 namespace GUI {
 
 class CommandSender;
@@ -129,7 +134,67 @@ public:
 	MessageDialogWithURL(const Common::String &message, const char *url, const char *defaultButton, Graphics::TextAlign alignment = Graphics::kTextAlignCenter);
 };
 
+/**
+ * Display a progress message until MIDI device detection finishes.
+ *
+ * @remarks
+ * Some MIDI backends takes long time when scanning the MIDI devices for first time.
+ * e.g., Windows MIDI Services on Windows 11 25H2 or later.
+ *
+ * Those backends will try to warm-up the MIDI backend to avoid this issue,
+ * but the player may request any MIDI APIs before the warm-up is finished.
+ * If it happens, the UI thread may be blocked, inducing OS to mark the process as unresponsive.
+ *
+ * In that case, this dialog would be spawned to:
+ * - Let player know the reason what is happening: MIDI device scan is taking a lot of time.
+ * - Keep UI events processed to prevent process marked as unresponsive.
+ */
+class MidiDeviceScanDialog : public MessageDialog {
+public:
+	/**
+	 * Show a modal progress dialog while the MIDI backend warm-up is pending.
+	 * Return immediately if @p isComplete already reports completion.
+	 * Call this function on the UI thread.
+	 *
+	 * @param isComplete Predicate returning true once MIDI backend warm-up finishes.
+	 *                   Polled on the UI thread and must return promptly without blocking.
+	 * @return True if completion was observed, false if the dialog closed before completion.
+	 */
+	static bool waitForCompletion(const Common::Functor0<bool> &isComplete);
+
+	/**
+	 * Process a dialog tick.
+	 * Close the dialog when the completion predicate returns true.
+	 */
+	void handleTickle() override;
+
+	/**
+	 * Ignore Escape key to prevent dismissing the dialog while warm-up is running.
+	 * Forward other keys to @ref GUI::Dialog::handleKeyDown.
+	 *
+	 * @param state The pressed key and its modifier flags.
+	 */
+	void handleKeyDown(Common::KeyState state) override;
+
+protected:
+	/**
+	 * Construct a progress dialog with a completion predicate.
+	 *
+	 * @param isComplete Predicate returning true once MIDI backend warm-up finishes.
+	 *                   Polled on the UI thread and must return promptly without blocking.
+	 */
+	explicit MidiDeviceScanDialog(const Common::Functor0<bool> &isComplete);
 
+	/** This predicate must be valid for the dialog's lifetime. */
+	const Common::Functor0<bool> &_isComplete;
+
+private:
+	/** Modal results for the warm-up wait. */
+	enum Result {
+		kInterrupted = 0,
+		kCompleted = 1
+	};
+};
 
 } // End of namespace GUI
 


Commit: ce2f54dd3a2a04330dab660e35c8961f4ddfef6a
    https://github.com/scummvm/scummvm/commit/ce2f54dd3a2a04330dab660e35c8961f4ddfef6a
Author: Hajin Jang (jb6804 at naver.com)
Date: 2026-10-31T10:21:19+02:00

Commit Message:
BACKENDS: MIDI: Show warm-up progress dialog only when GUI is active

Avoid spawning a progress dialog when the GUI is not available.

In some scenarios like command-line autostart, a MIDI device scan can be requested before the graphics is initialized. Add GUI instance/active check to avoid this issue.

Changed paths:
    backends/midi/windows.cpp
    backends/midi/windows.h
    gui/message.cpp
    gui/message.h


diff --git a/backends/midi/windows.cpp b/backends/midi/windows.cpp
index 50512ba9796..256d9ae7ef7 100644
--- a/backends/midi/windows.cpp
+++ b/backends/midi/windows.cpp
@@ -230,12 +230,16 @@ bool WindowsMusicPlugin::waitForMidiWarmUp() const {
 	if (GetCurrentThreadId() == _uiThreadId && _midiWarmUpWaitCallback && !isComplete())
 		return _midiWarmUpWaitCallback(isComplete);
 
-	// Warm-up has been finished. Proceed without showing a modal dialog.
+	// Warm-up has been finished, or No GUI wait is available. Proceed with device enumeration.
 	return true;
 }
 
 MusicDevices WindowsMusicPlugin::getDevices() const {
-	waitForMidiWarmUp();
+	if (!waitForMidiWarmUp()) {
+		// Continue with synchronous device enumeration even if the GUI wait has failed or not available.
+		// At worst, the subsequent WinMM calls may block until initialization completes.
+		warning("Windows MIDI warm-up wait skipped or interrupted; continuing with synchronous device enumeration");
+	}
 
 	MusicDevices devices;
 	int numDevs = midiOutGetNumDevs();
diff --git a/backends/midi/windows.h b/backends/midi/windows.h
index 6276291f21c..2844efcd3b6 100644
--- a/backends/midi/windows.h
+++ b/backends/midi/windows.h
@@ -71,12 +71,13 @@ public:
 	static void cleanupMidiWarmUpThread();
 
 	/**
-	 * Wait for background MIDI warm-up while keeping the process responsive,
-	 * by spawning a modal dialog.
+	 * Wait for background MIDI warm-up through a modal dialog when the GUI is active.
+	 * A modal dialog will handle UI events, keeping the process responsive.
 	 *
 	 * @param isComplete A functor immediately returns whether the warm-up has been finished.
 	 * @return True if completion was observed.
-	 *         False if quitting ScummVM or returning to the launcher ended the wait first.
+	 *         False if the wait was skipped because the GUI was unavailable or inactive,
+	 *         or if the dialog closed before completion (e.g. on quit or return to launcher).
 	 *
 	 * @see setMidiWarmUpWaitCallback()
 	 */
@@ -135,11 +136,14 @@ private:
 	static unsigned __stdcall warmUpMidiThreadMain(void *arglist);
 
 	/**
-	 * Returns immediately if MIDI backend warm-up has been finished.
-	 * Show a progress dialog if the warm-up is not finished yet.
+	 * Invoke the UI wait handler on the UI thread if MIDI warm-up is pending.
 	 *
-	 * @return False if the UI handler is interrupted, otherwise enumeration may proceed.
-	 *         Interruption of UI handler can happen on quit event or return-to-launcher event.
+	 * Show a progress dialog if the warm-up is not finished yet, and GUI is available.
+	 * Returns immediately if warm-up has been finished, or GUI is not available.
+	 *
+	 * @return True if no UI wait handler was invoked, or if it observed completion.
+	 *         False if the handler skipped waiting because the GUI was unavailable or
+	 *         inactive, or if the wait was interrupted (e.g. on quit or return to launcher).
 	 */
 	bool waitForMidiWarmUp() const;
 
diff --git a/gui/message.cpp b/gui/message.cpp
index 603aa57b857..999ae37ac58 100644
--- a/gui/message.cpp
+++ b/gui/message.cpp
@@ -292,6 +292,10 @@ bool MidiDeviceScanDialog::waitForCompletion(const Common::Functor0<bool> &isCom
 	if (isComplete())
 		return true;
 
+	// Do not spawn a dialog when the GUI is not available.
+	if (!GuiManager::hasInstance() || !g_gui.isActive())
+		return false;
+
 	MidiDeviceScanDialog dialog(isComplete);
 	return dialog.runModal() == kCompleted;
 }
diff --git a/gui/message.h b/gui/message.h
index 70a64984885..9939e5c4ba5 100644
--- a/gui/message.h
+++ b/gui/message.h
@@ -152,13 +152,14 @@ public:
 class MidiDeviceScanDialog : public MessageDialog {
 public:
 	/**
-	 * Show a modal progress dialog while the MIDI backend warm-up is pending.
+	 * Show a modal progress dialog while the MIDI backend warm-up is pending and the GUI is active.
 	 * Return immediately if @p isComplete already reports completion.
 	 * Call this function on the UI thread.
 	 *
 	 * @param isComplete Predicate returning true once MIDI backend warm-up finishes.
 	 *                   Polled on the UI thread and must return promptly without blocking.
-	 * @return True if completion was observed, false if the dialog closed before completion.
+	 * @return True if completion was observed, false if the GUI is inactive or the dialog
+	 *         closed before completion.
 	 */
 	static bool waitForCompletion(const Common::Functor0<bool> &isComplete);
 


Commit: 80a357034469823c6c5442cd6f8859ea8e8978f6
    https://github.com/scummvm/scummvm/commit/80a357034469823c6c5442cd6f8859ea8e8978f6
Author: Hajin Jang (jb6804 at naver.com)
Date: 2026-10-31T10:21:19+02:00

Commit Message:
BACKENDS: MIDI: Rename Windows backend source files

Renamed Windows MIDI backend impl to winmm.{cpp/h} from windows.{cpp/h}, to avoid name conflict with Windows SDK windows.h.
Using the direct backend name instead of platform name suites well into the precedant of coremidi/coreaudio/alsa impl.

Changed paths:
  A backends/midi/winmm.cpp
  A backends/midi/winmm.h
  R backends/midi/windows.cpp
  R backends/midi/windows.h
    backends/module.mk
    backends/platform/sdl/win32/win32.cpp
    po/POTFILES


diff --git a/backends/midi/windows.cpp b/backends/midi/winmm.cpp
similarity index 99%
rename from backends/midi/windows.cpp
rename to backends/midi/winmm.cpp
index 256d9ae7ef7..f0105994c1f 100644
--- a/backends/midi/windows.cpp
+++ b/backends/midi/winmm.cpp
@@ -32,7 +32,7 @@
 
 #include "audio/musicplugin.h"
 #include "audio/mpu401.h"
-#include "backends/midi/windows.h"
+#include "backends/midi/winmm.h"
 #include "backends/platform/sdl/win32/win32_wrapper.h"
 #include "common/config-manager.h"
 #include "common/translation.h"
diff --git a/backends/midi/windows.h b/backends/midi/winmm.h
similarity index 98%
rename from backends/midi/windows.h
rename to backends/midi/winmm.h
index 2844efcd3b6..266026c4700 100644
--- a/backends/midi/windows.h
+++ b/backends/midi/winmm.h
@@ -19,8 +19,8 @@
  *
  */
 
-#ifndef BACKENDS_MIDI_WINDOWS_H
-#define BACKENDS_MIDI_WINDOWS_H
+#ifndef BACKENDS_MIDI_WINMM_H
+#define BACKENDS_MIDI_WINMM_H
 
 #include "audio/musicplugin.h"
 #include "common/func.h"
diff --git a/backends/module.mk b/backends/module.mk
index 89b39dcb24b..bc12e92df4e 100644
--- a/backends/module.mk
+++ b/backends/module.mk
@@ -334,7 +334,7 @@ MODULE_OBJS += \
 	dialogs/win32/win32-dialogs.o \
 	fs/windows/windows-fs.o \
 	fs/windows/windows-fs-factory.o \
-	midi/windows.o \
+	midi/winmm.o \
 	plugins/win32/win32-provider.o \
 	printing/win32/win32-printman.o \
 	saves/windows/windows-saves.o \
diff --git a/backends/platform/sdl/win32/win32.cpp b/backends/platform/sdl/win32/win32.cpp
index 2b3b5bd2428..8e713a7601a 100644
--- a/backends/platform/sdl/win32/win32.cpp
+++ b/backends/platform/sdl/win32/win32.cpp
@@ -42,7 +42,7 @@
 #include "gui/message.h"
 
 #include "backends/audiocd/win32/win32-audiocd.h"
-#include "backends/midi/windows.h"
+#include "backends/midi/winmm.h"
 #include "backends/platform/sdl/win32/win32.h"
 #include "backends/platform/sdl/win32/win32-window.h"
 #include "backends/platform/sdl/win32/win32_wrapper.h"
diff --git a/po/POTFILES b/po/POTFILES
index 34056a85dde..06e4dd05297 100644
--- a/po/POTFILES
+++ b/po/POTFILES
@@ -95,7 +95,7 @@ backends/graphics/sdl/sdl-graphics.cpp
 backends/keymapper/hardware-input.cpp
 backends/keymapper/remap-widget.cpp
 backends/keymapper/virtual-mouse.cpp
-backends/midi/windows.cpp
+backends/midi/winmm.cpp
 backends/midi/android.cpp
 backends/networking/sdl_net/handlers/createdirectoryhandler.cpp
 backends/networking/sdl_net/handlers/downloadfilehandler.cpp




More information about the Scummvm-git-logs mailing list