projectM-visualizer / projectm

projectM - Cross-platform Music Visualization Library. Open-source and Milkdrop-compatible.
https://discord.gg/mMrxAqaa3W
GNU Lesser General Public License v2.1
3.36k stars 375 forks source link

Issue with Preset Path/presetURL #334

Closed ajs124 closed 1 year ago

ajs124 commented 4 years ago

I'm currently trying to get projectM into a usable state in nixpkgs and ran into an issue with the Preset Path setting.

projectM(-pulseaudio) seems to copy the Preset Path from the global config, but only once. This is an issue, because the path changes with every rebuild and old paths get garbage collected after a time.

I'm not sure what the right course of action here would be, so I thought I'd ask here. I'm also not entirely clear on what this settings is used for. As in, if it would be a sensible option to always use the setting from the global config.

revmischa commented 4 years ago

What should the behavior be?

ajs124 commented 4 years ago

Good question. I'm not sure. What does the value in the config actually get used for?

Always copying from the global config probably isn't sensible, if you want to set your own folder. Only copying once breaks setups where the install location changes, though.

Maybe something like checking if the folder exists and if not fall back to the global config might be reasonable?

kblaschke commented 3 years ago

Currently, the SDL UI doesn't copy the default config if there's no use-specific one. It'll use the user config first, then the default one. Also, the SDL UI scans the preset path and subdirectories to add presets.

The Qt UI behaves differently. It writes a copy of the config with all values to the user directory at least on shutdown. The Qt UI also sans only the preset dir in the config, without subdirectories if no playlist file is stored in the config. If there's a XML playlist in the config file, the Qt app will use this instead and ignore the preset path completely.

Basically there's projectM's internal behaviour reflected by the SDL app to populate the preset list. But any integration can clear the playlist and provide its own, which is what the Qt application does. Other integrations might implement other behaviors, e.g. not using the config.inp file at all.

A default fallback in the case the folder doesn't exist definitely sounds like a good idea. We could also streamline the config file handling between the reference applications, or even use different config files for each frontend as they have different settings. In this case, we could also add more values like key bindings for the SDL app.

kblaschke commented 1 year ago

The new SDL app handles configurations way better now. It ships with a default config, but also loads a user-defined configuration file on top from the home dir which will override any of the default settings if set explicitly.

The library itself doesn't bother with preset paths and config files anymore. The now outsourced playlist library supports adding any number of paths to search for presets.

The Qt frontend is still down the road to be fixed, but there are many issues that need addressing like audio capturing, rendering issues and general modernization. Not high prio right now, any help is greatly appreciated though.

For the core lib and SDL frontend, it's all sorted out now, so closing the issue.