How funorange/osu-trainer works
Project type and purpose
• This is a Windows desktop application (C# WinForms) called “osu-trainer” whose goal is to let users modify the difficulty of osu! beatmaps quickly.
• It features a graphical UI, internal logic for difficulty calculation and song speed adjustment, plus integration with external tools (oppai-ng, soundstretch) and submodules (beatmap parser, global keyboard hook).
File structure
• Top-level:
– osu-trainer.sln (Visual Studio solution)
– osu-trainer/ (main project folder)
– binaries/ (third-party executables)
– submodules/ (FsBeatmapParser, globalKeyboardHook)
– images/, resources/
• In osu-trainer/:
– Controls/ (custom WinForms controls)
– Forms/ (UI screens: MainForm, HotkeyForm, UpdaterForm, etc.)
– Core classes: DifficultyCalculator.cs, BeatmapEditor.cs, SongSpeedChanger.cs, UserProfile.cs, Settings.cs, JunUtils.cs
– Properties/ (resources, settings, datasources)
– packages.config, App.config, version.txt
• Patterns:
– Presentation layer (Forms + Controls)
– Business logic layer (map/difficulty editing, speed changing)
– External integration layer (invoking oppai-ng, soundstretch, hooking keyboard)
– Data layer (user profiles, app settings, output files on disk)
README for additional insights
• Confirms: quick beatmap difficulty modification, profile & hotkey support, disk-cleanup functionality
• Lists used third-party libraries and licenses, hinting at external-tool integration and resource usage
Main components
a. Presentation Layer (WinForms UI)
– MainForm, HotkeyForm, DeleteMp3sForm, UpdaterForm, etc.
– Custom Controls (OsuButton, RatioBar, SongDisplay)
b. Application Core / Business Logic
– BeatmapEditor (parses .osu files via FsBeatmapParser)
– DifficultyCalculator (calculates star rating changes via oppai-ng)
– SongSpeedChanger (calls soundstretch to change mp3 speed)
– UserProfile & Settings (manages user preferences, hotkeys, output folders)
– JunUtils (utility routines)
c. External & Third-Party Integrations
– FsBeatmapParser submodule (reads/writes beatmap files)
– globalKeyboardHook submodule (captures global hotkeys, interacts with target process)
– oppai.exe (star rating calculation)
– soundstretch.exe (audio speed processing)
d. Data & File System
– Output folder for generated beatmaps (mp3 + .osu)
– Disk cleanup module (DeleteMp3sForm)
– Versioning and update checker (UpdaterForm + updater.exe)
Relationships and interactions
• UI → invokes Application Core methods
• Core → calls FsBeatmapParser to load/save beatmaps
• Core → launches oppai.exe and reads its output
• Core → launches soundstretch.exe and waits for completion
• KeyboardHook → raises events consumed by Core/Forms for quick triggering
• Core → reads/writes UserProfile & Settings from local app data
• Disk Cleanup UI → deletes files from output directories
• Updater UI → checks version.txt + invokes updater.exe
Architectural patterns & design principles
• Layered architecture: Presentation / Business / Integration / Data
• Modular components: submodules encapsulate parsing and hooking logic
• Process-based isolation: external tools run as separate processes
• Event-driven input: global hotkeys fire events into the UI/core
Detail without overcompensation
• Custom controls, forms, core classes, submodules, and external tools.
• How hotkey events traverse from the OS hook submodule up into the UI/core.
• Invocation of oppai.exe and soundstretch.exe as separate processes.