Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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
(This issue mentions that behavior should be different depending on if the playlist editor is open or not, but unless I'm missing something I couldn't find a GUI playlist editor, so I instead added the configuration options to determine the behavior for now).