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
34 changes: 25 additions & 9 deletions .github/workflows/buildcheck.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -97,8 +97,7 @@ jobs:
USERNAME: projectM-visualizer
VCPKG_EXE: ${{ github.workspace }}/vcpkg/vcpkg
FEED_URL: https://nuget.pkg.github.com/projectM-visualizer/index.json
VCPKG_BINARY_SOURCES: "clear;nuget,https://nuget.pkg.github.com/projectM-visualizer/index.json,readwrite"

HAS_VCPKG_PACKAGES_TOKEN: ${{ secrets.VCPKG_PACKAGES_TOKEN }}

steps:
- name: Checkout vcpkg
Expand All @@ -112,7 +111,23 @@ jobs:
shell: pwsh
run: ${{ github.workspace }}/vcpkg/bootstrap-vcpkg.bat

- name: Setup MSVC Developer Command Prompt
uses: ilammy/msvc-dev-cmd@v1
with:
arch: x64

- name: Configure vcpkg binary sources (public fallback)
shell: pwsh
run: |
if ("${{ env.HAS_VCPKG_PACKAGES_TOKEN }}" -ne "") {
"VCPKG_BINARY_SOURCES=clear;nuget,https://nuget.pkg.github.com/projectM-visualizer/index.json,readwrite" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append
} else {
"VCPKG_BINARY_SOURCES=clear;files,${{ github.workspace }}/vcpkg_cache,readwrite" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append
New-Item -ItemType Directory -Force -Path "${{ github.workspace }}/vcpkg_cache" | Out-Null
}

- name: Add NuGet sources
if: ${{ env.HAS_VCPKG_PACKAGES_TOKEN != '' }}
shell: pwsh
run: |
.$(${{ env.VCPKG_EXE }} fetch nuget) `
Expand All @@ -121,9 +136,9 @@ jobs:
-StorePasswordInClearText `
-Name GitHubPackages `
-UserName "${{ env.USERNAME }}" `
-Password "${{ secrets.VCPKG_PACKAGES_TOKEN }}"
-Password "${{ env.HAS_VCPKG_PACKAGES_TOKEN }}"
.$(${{ env.VCPKG_EXE }} fetch nuget) `
setapikey "${{ secrets.VCPKG_PACKAGES_TOKEN }}" `
setapikey "${{ env.HAS_VCPKG_PACKAGES_TOKEN }}" `
-Source "${{ env.FEED_URL }}"

- name: Checkout libprojectM Sources
Expand All @@ -136,9 +151,9 @@ jobs:
- name: Build/Install libprojectM
run: |
mkdir cmake-build-libprojectm
cmake -G "Visual Studio 17 2022" -A "X64" -S "${{ github.workspace }}/projectm" -B "${{ github.workspace }}/cmake-build-libprojectm" -DCMAKE_TOOLCHAIN_FILE="${{ github.workspace }}/vcpkg/scripts/buildsystems/vcpkg.cmake" -DVCPKG_TARGET_TRIPLET=x64-windows-static -DCMAKE_INSTALL_PREFIX="${{ github.workspace }}/install-libprojectm" -DCMAKE_MSVC_RUNTIME_LIBRARY="MultiThreaded$<$<CONFIG:Debug>:Debug>" -DCMAKE_VERBOSE_MAKEFILE=YES -DBUILD_SHARED_LIBS=OFF -DBUILD_TESTING=NO
cmake --build "${{ github.workspace }}/cmake-build-libprojectm" --config Release --parallel
cmake --install "${{ github.workspace }}/cmake-build-libprojectm" --config Release
cmake -G Ninja -S "${{ github.workspace }}/projectm" -B "${{ github.workspace }}/cmake-build-libprojectm" -DCMAKE_C_COMPILER=cl -DCMAKE_CXX_COMPILER=cl -DCMAKE_TOOLCHAIN_FILE="${{ github.workspace }}/vcpkg/scripts/buildsystems/vcpkg.cmake" -DVCPKG_TARGET_TRIPLET=x64-windows-static -DCMAKE_INSTALL_PREFIX="${{ github.workspace }}/install-libprojectm" -DCMAKE_BUILD_TYPE=Release -DCMAKE_MSVC_RUNTIME_LIBRARY="MultiThreaded" -DCMAKE_VERBOSE_MAKEFILE=YES -DBUILD_SHARED_LIBS=OFF -DBUILD_TESTING=NO
cmake --build "${{ github.workspace }}/cmake-build-libprojectm" --parallel
cmake --install "${{ github.workspace }}/cmake-build-libprojectm"

- name: Checkout projectMSDL Sources
uses: actions/checkout@v6
Expand All @@ -149,8 +164,8 @@ jobs:
- name: Build projectMSDL
run: |
mkdir cmake-build-frontend-sdl2
cmake -G "Visual Studio 17 2022" -A "X64" -S "${{ github.workspace }}/frontend-sdl2" -B "${{ github.workspace }}/cmake-build-frontend-sdl2" -DCMAKE_TOOLCHAIN_FILE="${{ github.workspace }}/vcpkg/scripts/buildsystems/vcpkg.cmake" -DVCPKG_TARGET_TRIPLET=x64-windows-static -DCMAKE_PREFIX_PATH="${{ github.workspace }}/install-libprojectm" -DCMAKE_INSTALL_PREFIX="${{ github.workspace }}/install-frontend-sdl2" -DCMAKE_MSVC_RUNTIME_LIBRARY="MultiThreaded$<$<CONFIG:Debug>:Debug>" -DCMAKE_VERBOSE_MAKEFILE=YES -DSDL2_LINKAGE=static -DBUILD_TESTING=YES
cmake --build "${{ github.workspace }}/cmake-build-frontend-sdl2" --parallel --config Release
cmake -G Ninja -S "${{ github.workspace }}/frontend-sdl2" -B "${{ github.workspace }}/cmake-build-frontend-sdl2" -DCMAKE_C_COMPILER=cl -DCMAKE_CXX_COMPILER=cl -DCMAKE_TOOLCHAIN_FILE="${{ github.workspace }}/vcpkg/scripts/buildsystems/vcpkg.cmake" -DVCPKG_TARGET_TRIPLET=x64-windows-static -DCMAKE_PREFIX_PATH="${{ github.workspace }}/install-libprojectm" -DCMAKE_INSTALL_PREFIX="${{ github.workspace }}/install-frontend-sdl2" -DCMAKE_BUILD_TYPE=Release -DCMAKE_MSVC_RUNTIME_LIBRARY="MultiThreaded" -DCMAKE_VERBOSE_MAKEFILE=YES -DSDL2_LINKAGE=static -DBUILD_TESTING=YES
cmake --build "${{ github.workspace }}/cmake-build-frontend-sdl2" --parallel

- name: Package projectMSDL
run: |
Expand Down Expand Up @@ -207,3 +222,4 @@ jobs:
with:
name: projectMSDL-buildcheck-macos
path: cmake-build-frontend-sdl2/*.tar.gz

2 changes: 1 addition & 1 deletion .github/workflows/lockdown-prs.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ jobs:
steps:
- uses: dessant/repo-lockdown@v4
with:
github-token: ${{ secrets.PERSONAL_ACCESS_TOKEN }}
github-token: ${{ github.token }}
issue-comment: >
This repository does not accept bug reports. Please report any issues in the
[main projectM repository](https://github.com/projectM-visualizer/projectm/issues/new/choose).
Expand Down
33 changes: 26 additions & 7 deletions .github/workflows/release-windows.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,7 @@ jobs:
USERNAME: projectM-visualizer
VCPKG_EXE: ${{ github.workspace }}/vcpkg/vcpkg
FEED_URL: https://nuget.pkg.github.com/projectM-visualizer/index.json
VCPKG_BINARY_SOURCES: "clear;nuget,https://nuget.pkg.github.com/projectM-visualizer/index.json,readwrite"

HAS_VCPKG_PACKAGES_TOKEN: ${{ secrets.VCPKG_PACKAGES_TOKEN }}
steps:
- name: Checkout vcpkg
uses: actions/checkout@v6
Expand All @@ -42,7 +41,23 @@ jobs:
shell: pwsh
run: ${{ github.workspace }}/vcpkg/bootstrap-vcpkg.bat

- name: Setup MSVC Developer Command Prompt
uses: ilammy/msvc-dev-cmd@v1
with:
arch: x64

- name: Configure vcpkg binary sources (public fallback)
shell: pwsh
run: |
if ("${{ env.HAS_VCPKG_PACKAGES_TOKEN }}" -ne "") {
"VCPKG_BINARY_SOURCES=clear;nuget,https://nuget.pkg.github.com/projectM-visualizer/index.json,readwrite" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append
} else {
"VCPKG_BINARY_SOURCES=clear;files,${{ github.workspace }}/vcpkg_cache,readwrite" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append
New-Item -ItemType Directory -Force -Path "${{ github.workspace }}/vcpkg_cache" | Out-Null
}

- name: Add NuGet sources
if: ${{ env.HAS_VCPKG_PACKAGES_TOKEN != '' }}
shell: pwsh
run: |
.$(${{ env.VCPKG_EXE }} fetch nuget) `
Expand All @@ -51,9 +66,9 @@ jobs:
-StorePasswordInClearText `
-Name GitHubPackages `
-UserName "${{ env.USERNAME }}" `
-Password "${{ secrets.VCPKG_PACKAGES_TOKEN }}"
-Password "${{ env.HAS_VCPKG_PACKAGES_TOKEN }}"
.$(${{ env.VCPKG_EXE }} fetch nuget) `
setapikey "${{ secrets.VCPKG_PACKAGES_TOKEN }}" `
setapikey "${{ env.HAS_VCPKG_PACKAGES_TOKEN }}" `
-Source "${{ env.FEED_URL }}"

- name: Checkout projectMSDL Sources
Expand All @@ -78,17 +93,20 @@ jobs:
- name: Build projectMSDL
run: |
mkdir cmake-build-frontend-sdl2
cmake -G "Visual Studio 17 2022" -A "X64" `
cmake -G Ninja `
-S "${{ github.workspace }}/frontend-sdl2" `
-B "${{ github.workspace }}/cmake-build-frontend-sdl2" `
-DCMAKE_C_COMPILER=cl `
-DCMAKE_CXX_COMPILER=cl `
-DCMAKE_TOOLCHAIN_FILE="${Env:VCPKG_INSTALLATION_ROOT}/scripts/buildsystems/vcpkg.cmake" `
-DVCPKG_TARGET_TRIPLET=x64-windows `
-DCMAKE_PREFIX_PATH="${{ github.workspace }}/install-libprojectm" `
-DCMAKE_MSVC_RUNTIME_LIBRARY="MultiThreaded$<$<CONFIG:Debug>:Debug>DLL" `
-DCMAKE_BUILD_TYPE=Release `
-DCMAKE_MSVC_RUNTIME_LIBRARY="MultiThreadedDLL" `
-DPRESET_DIRS="${{ github.workspace }}/presets-cream-of-the-crop" `
-DTEXTURE_DIRS="${{ github.workspace }}/presets-milkdrop-texture-pack/textures" `
-DENABLE_INSTALL_BDEPS=ON
cmake --build "${{ github.workspace }}/cmake-build-frontend-sdl2" --parallel --config Release
cmake --build "${{ github.workspace }}/cmake-build-frontend-sdl2" --parallel

- name: Package projectMSDL
run: |
Expand All @@ -101,3 +119,4 @@ jobs:
name: projectMSDL-Windows-Portable-x64
path: |
cmake-build-frontend-sdl2/*.zip

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
5 changes: 5 additions & 0 deletions src/RenderLoop.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -343,6 +343,11 @@ void RenderLoop::KeyEvent(const SDL_KeyboardEvent& event, bool down)
Poco::NotificationCenter::defaultCenter().postNotification(new PlaybackControlNotification(PlaybackControlNotification::Action::TogglePresetLocked));
break;

case SDLK_RETURN:
case SDLK_KP_ENTER:
_projectMGui.OpenPresetSearch();
break;

case SDLK_UP:
// Increase beat sensitivity
_projectMWrapper.ChangeBeatSensitivity(0.01f);
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();
}
}

1 change: 1 addition & 0 deletions src/gui/HelpWindow.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -158,6 +158,7 @@ void HelpWindow::FillKeyboardShortcutsTable()
{"Last Played Preset (Back, smooth)", "Shift+Backspace"},
{"Random Preset (immediate)", "r"},
{"Random Preset (smooth)", "Shift+r"},
{"Preset Search", "Enter"},
{"Lock Current Preset", "Spacebar"},
{"Toggle Shuffle", "y"},
{"Toggle Fullscreen", "Ctrl-f, Right Mouse"},
Expand Down
4 changes: 4 additions & 0 deletions src/gui/MainMenu.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,10 @@ void MainMenu::Draw()
{
_projectMWrapper.PresetFileNameToClipboard();
}
if (ImGui::MenuItem("Preset Search...", "Enter"))
{
_gui.OpenPresetSearch();
}

ImGui::EndMenu();
}
Expand Down
Loading
Loading