A simple, modular music player application built as a hobby project. It supports loading songs from a directory, creating playlists, and basic playback controls. Currently, it's designed and tested only for Windows, with potential for cross-platform expansion in the future.
- Load and display songs from a local folder (MP3 support via backend).
- Create and manage playlists.
- Playback controls: play, pause, volume adjustment.
- ImGui-based UI for intuitive interaction.
- Modular design: Audio playback is decoupled, allowing swaps to other libraries (e.g., SDL_mixer) without major rewrites.
This project leverages modern, lightweight tools for efficient development:
- Odin: The primary programming language, chosen for its simplicity, performance, and ease of use in systems programming. Odin handles the core logic, state management, and integration of all components.
- ImGui: Used for the user interface, providing immediate-mode GUI that's quick to prototype and responsive. Integrated with GLFW and OpenGL for rendering.
- OpenGL: Handles graphics rendering, working in tandem with ImGui for drawing the UI.
- GLFW: Manages window creation, input handling, and the main event loop. It's cross-platform but currently configured for Windows.
- Miniaudio: The default audio backend for playback and management, selected for its single-header simplicity and no external dependencies. The architecture allows easy replacement with alternatives like Raylib or SDL.
- Vendor libraries are managed via Odin's built-in vendor system for seamless imports.
As a hobby project, the focus is on learning and experimentation with these technologies, prioritizing clean architecture over full production features.
- Odin programming language (latest version recommended).
- Vendor libraries (included via Odin's vendor system):
- GLFW
- ImGui (with GLFW/OpenGL backend)
- OpenGL
- Miniaudio (initial audio backend; can be replaced)
- Windows SDK (required for building and running on Windows).
- A music folder with MP3 files for testing.
- Clone the repository or set up the project structure as described in the architecture.
- Vend the required libraries (e.g.,
odin vendor collectif using Odin's vendor tool). - Build with Odin:
odin build main.odin -out:player.exe- For release: Add
-opt:2 -no-bounds-check. - To switch audio backends: Use build defines, e.g.,
-define:AUDIO_BACKEND=SDL(after implementing the backend).
- For release: Add
- Place your music files in a folder (e.g.,
path/to/music/folder– update incore/state.odinif needed). - Run the executable:
<!-- make debug (default) --> make make release - Use the ImGui window to browse songs, create playlists, and control playback.
- app: Manages app state (songs, playlists) in
app/app.odin. - Audio: Abstract interface in
audio/interface.odinwith concrete backends (e.g.,miniaudio.odin). - UI: ImGui rendering in
/imgui_ui.odin. - Main: Ties everything together, handles the main loop and state-audio sync.
For details on swapping audio backends or extending features, see the source code comments.