mixxx
mixxx copied to clipboard
Allow loading custom sound config with '--sound-config' argument
first step to resolve https://bugs.launchpad.net/mixxx/+bug/1516035
This allows loading a custom sound config via --sound-config config_file.xml
. For now this is restricted to files inside the settings dir.
If the argument not added or the passed file is not readable, default soundconfig.xml
is used.
Note: the given config file (command line or default) is used for all read/write operations in the current session, i.e. if you change your config those changes will be stored in your custom sound config.
Thus, the workflow currently goes like this: Create sound profile
- connect audio devices and start Mixxx
- adjust sound devices and options as desired
- quit Mixxx
- copy
soundconfig.xml
and rename to something likesoundconfig_DDJ-SB3_NIAudio8.xml
Load sound profile
- connect audio devices and start Mixxx
- start Mixxx with
mixxx --sound-config soundconfig_DDJ-SB3_NIAudio8.xml
I post-poned adding a profile selector to Preferences > Sound Hardware since that is more elaborate than I first thought. It's mainly getting the UX right, but also some flaws in current DlgPrefSound become obvious when dealing with profiles for the entire page (e.g. some settings are applied instantly).
I think this is good enough to be mergd (if a second reviewer doesn't spot issues, of course).
The preferences / startup UI integration is a bit more elaborate and I'm unsure I find time to finish that soonish, so I'll do it another branch.
Cool. I didn't do too many tests myself yet. With an arg config it shouldn't even matter if soundconfig.xml exists or not.
Merge?
Just a suggestion (not blocking merge or something), but if you can't specify full paths anyway, why not just dictate a naming scheme for the sake of shorter command lines?
For example, instead of:
mixxx --sound-config soundconfig_DDJ-SB3_NIAudio8.xml
we could use:
mixxx --sound-config DDJ-SB3_NIAudio8
And mixxx creates the filename from the name automatically?
Sure, that makes sense. Tbh I consider this PR a temporary solution, so I'd rather implement this in #4862. There, only the basenames are visible in the preferences so we'd (re)construct the file paths anyway.
When reworking and simplifying #4862 it turned out that all the file(name) handling should rather happen in SoundManager, thus I suspend this one. Actually, dealing with filenames in general and in particular legacy soundconfig.xml
is the bulk of the work :\
I'm closing this. Sound config via command line is part of #4862 now
Thanks for the review @Swiftb0y