-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
Fix loading of modplug files #4736
Conversation
I never used modplug, though I wonder how such a bug could have slipped through during review.
The settings are persistent, though they are appearantly not reloaded [Edit in the preferences] until the preferences are opened (calling
below this line
If someone else can confirm the bug, this small fix should go to the 2.3 branch so it goes to 2.3.3 |
Ah cool! I totally forgot how this works :) |
@ronso0 if you are just short on tracker files you could replicate e.g. with the one released here. |
I can not confirm the bug, that file is loaded and played fine. Lines 393 to 399 in 3805948
How come this is not working for you? |
Interesting. I could reproduce on |
I retried this and indeed Please let me know how you'd like to proceed. I'll switch the target branch back to |
Sure. I'm not familiar with coreservices, though. Just give it a try! After this line I guess Line 314 in 6f86760 #ifdef __MODPLUG__
// restore the configuration for the modplug library before trying to load a module
DlgPrefModplug* pModplugPrefs = new DlgPrefModplug(0,
m_pCoreServices->getSettingsManager().get());
pModplugPrefs->loadSettings();
pModplugPrefs->applySettings();
delete pModplugPrefs; // not needed anymore
#endif |
ping @snue |
Sure. I didn't find the time recently and figured it's not that pressing as 2.3 isn't affected. I'll try this out and update in the coming days hopefully. Stay tuned. |
sure, I didn't mean to push you ; ) |
@ronso0 I finally got around to fix this. This is the "just make it work like before" approach. CoreServices should ideally not rely on any UI widget. But I think for now this temporary preferences widget is better than broken Modplug file support. |
Making things final should not do any harm if it still builds. |
src/coreservices.cpp
Outdated
DlgPrefModplug* pModplugPrefs = new DlgPrefModplug(nullptr, pConfig); | ||
pModplugPrefs->loadSettings(); | ||
pModplugPrefs->applySettings(); | ||
delete pModplugPrefs; // not needed anymore |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
does it work if you don't allocate?
DlgPrefModplug* pModplugPrefs = new DlgPrefModplug(nullptr, pConfig); | |
pModplugPrefs->loadSettings(); | |
pModplugPrefs->applySettings(); | |
delete pModplugPrefs; // not needed anymore | |
DlgPrefModplug modplugPrefs{nullptr, pConfig}; | |
modplugPrefs.loadSettings(); | |
modplugPrefs.applySettings(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes that works as well. I switched to just allocate the temporary widget on the stack.
The settings restoration is currently done in the preferences dialog. This was dropped accidentally with the introduction of coreservices in mixxxdj#3446. Strictly speaking it would be cleaner to not rely on a temporary widget here. For now this enures modplug tracker files can be loaded and play correctly after application startup.
This silences a compiler warning about the virtual close() function call from the destructor bypassing the virtual dispatch.
Please fix the code-style issue. then LGTM |
Just spotted and fixed 😉. Thanks. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks. LGTM
Thank you! Unfortunately I can't test atm with the file you shared due to https://bugs.launchpad.net/mixxx/+bug/1979864 |
Oh, that's an interesting bug. But it's not modplug specific, right? Could happen with other sound files as well? Regarding modplug files, https://modarchive.org has a wide collection of compatible tracks for download. Of course lots of cheesy music there as well. This one should not kill your ears 😜 |
Alright, I worked around the bug and the mod track plays fine. |
@snue Do you have interest and time to look into an alternative way to initialize the decoder, independet from DlgPrefModplug? |
At least not immediately. I might come up with something in the future but won't complain if someone else does it first. |
The settings for Modplug decoding are not restored/enforced on Mixxx startup since #3446. With the "default" maximum buffer size initialized to zero, all loading attempts of tracker files are doomed to fail. A round-trip to the settings dialog and hitting the "apply" button on the "Modplug Decoder" page works around the issue currently.
This Pull Request:
SoundSourceModPlug
asfinal
to silence a warning about virtual dispatch not working in the destructor.