Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# Changelog

## 2.0.1 (2026-05-16)

- Added preset number in the window title when `window.displayPresetNameInTitle=true`.
- Uses numeric suffix from preset names like `MilkDrop2077.0001.milk` when present.
- Falls back to playlist position when preset filename does not contain a numeric suffix.
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ set_property(GLOBAL PROPERTY USE_FOLDERS ON)

project(projectMSDL
LANGUAGES C CXX
VERSION 2.0.0
VERSION 2.0.1
)

list(APPEND CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/cmake")
Expand Down
18 changes: 16 additions & 2 deletions src/SDLRenderingWindow.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@

#include <SDL2/SDL_opengl.h>

#include <regex>

const char* SDLRenderingWindow::name() const
{
return "SDL2 Rendering Window";
Expand Down Expand Up @@ -396,14 +398,25 @@ void SDLRenderingWindow::UpdateWindowTitle()
auto& app = Poco::Util::Application::instance();
auto& projectMWrapper = app.getSubsystem<ProjectMWrapper>();

auto presetName = projectm_playlist_item(projectMWrapper.Playlist(), projectm_playlist_get_position(projectMWrapper.Playlist()));
auto currentPosition = projectm_playlist_get_position(projectMWrapper.Playlist());
auto presetName = projectm_playlist_item(projectMWrapper.Playlist(), currentPosition);

if (presetName)
{
Poco::Path presetFile(presetName);
projectm_playlist_free_string(presetName);

newTitle += " ➫ " + presetFile.getBaseName();
auto presetBaseName = presetFile.getBaseName();
std::string presetNumber = std::to_string(currentPosition + 1);

// If basename is like "MilkDrop2077.0001", use the trailing digits as preset number.
std::smatch match;
if (std::regex_match(presetBaseName, match, std::regex(R"(.*\.(\d+)$)")) && match.size() > 1)
{
presetNumber = match[1].str();
}

newTitle += " [" + presetNumber + "] -> " + presetBaseName;
}

if (projectm_get_preset_locked(projectMWrapper.ProjectM()))
Expand Down Expand Up @@ -461,3 +474,4 @@ void SDLRenderingWindow::OnConfigurationPropertyRemoved(const std::string& key)
UpdateWindowTitle();
}
}

Loading