Part of this plugin is developed using ChatGPT-5.4 and its stability cannot be guaranteed. There is a high probability that the author will not provide further updates for it.
Tracker Player is a lightweight Windows tracker-module playback solution built around a reusable native playback library. The project now consists of three layers:
- TrackerPlayback — a native DLL that exposes a small C playback API
- TrackerPlayer — a minimal Win32 executable for command-line playback and single-instance control
- TrackerPlaybackTest — a WPF test application for interactive validation of the DLL
Audio decoding is handled by libopenmpt, and audio output is handled by PortAudio.
TrackerPlayback is the core playback engine. It is a native DLL written in C and exposes a stable procedural API through TrackerPlayback.h.
Exported capabilities include:
- setting an error callback
- setting a playback status callback
- querying current playback status
- starting playback from an in-memory module buffer
- stopping playback
- pausing playback
- resuming playback
Playback statuses:
TRACKER_PLAYBACK_STATUS_STOPPEDTRACKER_PLAYBACK_STATUS_PLAYINGTRACKER_PLAYBACK_STATUS_PAUSED
Implementation details:
- module data is passed in as a memory buffer rather than a file path
- decoding uses
openmpt_module_create_from_memory2 - playback runs on a worker thread
- synchronization uses Win32 events and a critical section
- audio output targets stereo
float32samples at48000 Hz - the engine first tries non-interleaved output and falls back to interleaved output when needed
- loop behavior is controlled by the caller
TrackerPlayer is a small Win32 frontend that uses TrackerPlayback.dll.
Responsibilities:
- parses the command line
- loads the selected module file into memory
- passes that memory buffer to
TrackerPlayback_Play - shows message boxes for startup and playback failures
- keeps a hidden message window alive during playback
- enforces single-instance behavior through a named mutex
Single-instance behavior:
- if no module path is provided, the app shows an error
- if another instance is already running and no module path is provided, the running instance is asked to stop
- if another instance is already running and a module path is provided, the new instance exits with an error message
TrackerPlaybackTest is a WPF desktop test harness for the DLL.
It provides:
- file browsing for tracker modules
- play / pause / resume / stop controls
- optional loop playback
- current status display
- a log view for callback and operation messages
This project is useful for validating the playback API independently from the native command-line player.
TrackerPlayback/— native playback DLL projectTrackerPlayback.h— public C APITrackerPlayback.c— playback engine implementationTrackerPlaybackInternal.h— internal state and constantsThirdParty/openmpt/— bundledlibopenmptsource tree
TrackerPlayer/— native Win32 player executableMain.c— application entry point and instance-control logic
TrackerPlaybackTest/— WPF validation appTrackerPlayback.cs— P/Invoke wrapper for the DLL APIMainWindow.xaml/MainWindow.xaml.cs— UI and playback interactions
FunkyStars.xm— sample module fileTrackerPlayer.slnx— solution workspace entry
The DLL exposes the following functions:
TrackerPlayback_SetErrorCallbackTrackerPlayback_SetStatusCallbackTrackerPlayback_GetStatusTrackerPlayback_PlayTrackerPlayback_StopTrackerPlayback_PauseTrackerPlayback_ResumeTrackerPlayback_Inno_PlayFileTrackerPlayback_Inno_StopTrackerPlayback_Inno_PauseTrackerPlayback_Inno_ResumeTrackerPlayback_Inno_GetStatusTrackerPlayback_Inno_GetLastErrorCode
TrackerPlayback_Play accepts:
- a pointer to module data in memory
- the size of that buffer
- a loop flag indicating whether playback should repeat forever
The TrackerPlayback_Inno_* exports are intended for installers and other scripting hosts that prefer stdcall entry points and file-path based playback.
Run the executable with a module file path:
TrackerPlayer.exe FunkyStars.xm
Typical flow:
- the player resolves the file path
- the module file is loaded fully into memory
- the memory buffer is passed to
TrackerPlayback.dll - playback continues until stopped, the window receives a stop message, or the module ends
Use TrackerPlaybackTest when you want to:
- verify the exported DLL API
- test pause and resume behavior
- inspect callback notifications
- validate module loading without going through the native single-instance app
Current implementation supports:
- tracker-module playback through
libopenmpt - in-memory module loading
- playback state transitions: stopped, playing, paused
- looped or non-looped playback
- Win32 and x64 builds
- native and managed test frontends
- primary native code is written in C
- the test frontend is written in C# / WPF
- playback depends on
libopenmptandPortAudio - the repository includes Visual Studio project files for the native player, native DLL, and WPF test app
- initialize the bundled OpenMPT dependency before building:
git submodule update --init --recursive
When building the full solution, ensure the DLL is available beside the consuming executable or test application.
If you only need the installer-facing DLL package, use:
scripts\Build-InnoDll.cmd
Do not build TrackerPlayback.vcxproj by itself before the dependency step has run. The DLL links against libraries generated from the bundled OpenMPT tree, and those .lib files are produced by the script first.
Useful variants:
scripts\Build-InnoDll.cmd -Platform x86scripts\Build-InnoDll.cmd -Platform x64scripts\Build-InnoDll.cmd -Platform both
The script will:
- locate Visual Studio through
vswhere - normalize the child-process environment before launching MSBuild
- build
libopenmpt-small - build the
portaudiotarget fromlibopenmpt - build the
TrackerPlaybackDLL with the Innostdcallexports - force the OpenMPT solution tree to use the static MSVC runtime (
/MTor/MTd) - package ready-to-use outputs under
artifacts\inno
Generated packages:
artifacts\inno\x86\TrackerPlayback.dllartifacts\inno\x64\TrackerPlayback.dllartifacts\inno\TrackerPlayback-Inno-x86.zipartifacts\inno\TrackerPlayback-Inno-x64.zip
Each package also includes:
InnoSetupTrackerPlayback.iss.incInnoSetupExample.iss
TrackerPlayback.dll now includes a second, installer-friendly API surface:
TrackerPlayback_Inno_PlayFile(const wchar_t* modulePath, int loopForever)TrackerPlayback_Inno_Stop(void)TrackerPlayback_Inno_Pause(void)TrackerPlayback_Inno_Resume(void)TrackerPlayback_Inno_GetStatus(void)TrackerPlayback_Inno_GetLastErrorCode(void)
These exports are:
stdcall- path-based instead of memory-buffer based
- exported with undecorated names so they can be bound from Inno Setup using their plain identifier
Use InnoSetupTrackerPlayback.iss.inc to import the declarations into your setup script, or start from InnoSetupExample.iss.
This project is licensed under the MIT License. See LICENSE.md for details.