Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adding file/folder drop support & MacOS build fixes #90

Closed
wants to merge 4 commits into from

Conversation

jmelovich
Copy link

@jmelovich jmelovich commented Feb 9, 2025

I wanted a good first issue to acquaint myself with this project, and since one of the frustrating parts of the build/install process was figuring out how to load presets, I figured adding good drag & drop support would be useful (as per issue #84).

SDL provides the drop event, so the implementation was fairly straightforward. The user can either drag & drop a preset file (or collection of preset files), or a folder containing presets. Preset files are files that end with '.milk' or '.prjm' (haven't seen or used prjm files but they are listed as supported in the projectM code). Dragging a file will immediately enqueue it on the next spot in the playlist, and dragging a folder will enqueue all presets in the folder (searched recursively).

I also added two configuration options to give more control to the user (split into a separate commit, as I had to add an additional include on the RenderLoop to access the configuration settings). There are now two additional UI/CLI settings:

  • skipToDropped (default: true)
    • When enabled, any dropped presets will be immediately skipped to. (They are always enqueued next after the current preset at the moment, but when this is true it will automatically skip to this next preset. This also accounts for shuffle being enabled, and will always make sure that the preset you dropped is immediately switched to.)
  • droppedFolderOverride (default: false)
    • When enabled, and a folder is dropped onto the window, the current playlist will be cleared and replaced with the contents of the folder. So if you have a playlist going and you drop a folder onto the window, the visualizer will switch and only iterate through the presets in that folder (recursively).

Resolves #84

Additionally, as I have been developing on MacOS 15, I have made some fixes to get this software building correctly. I updated the GLSL version to from 130 to 150 to fix the issue with the GUI not displaying on MacOS, added some build logic for finding & including the projectM libraries within the resulting .app file, and a (hopefully universal) fix for utf8proc being not found during the build process. I also updated the C++ version from 14 to 17 to fix issues with Poco as poco v1.13+ requires C++ 17 (this may be controversial, but this can be overwritten easily back to C++ 14 if necessary, although I would update the readme to include this information).

EDIT:
I realized it was not a great idea to group these two changes together, so I'm closing this PR and opening two separate ones instead.

- dragging a preset file loads that preset into your current playlist and skips to it
- dragging a directory of presets will load all of them into the current playlist and skip to the first
- added two new settings: 'skipToDropped' & 'droppedFolderOverride' to provide more user control over the drag & drop functionality.
@jmelovich jmelovich changed the title Adding file/folder drop support Adding file/folder drop support & MacOS build fixes Feb 10, 2025
MacOS build fix

- updated from C++ 14 to C++ 17 to work with the currently available versions of POCO (v1.13.0 and above require C++ 17)
- added MacOS specific build logic for including the projectM libraries in the application file
- added 'Findutf8proc.cmake' for finding the utf8proc installation to resolve build issue (Mac specific issue for some reason, so only runs if MacOS)

changed GLSL version to fix UI on MacOS
@jmelovich jmelovich marked this pull request as draft February 12, 2025 18:21
@jmelovich jmelovich closed this Feb 12, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[FEATURE] Add file drop support
1 participant