-
-
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
Effects: store deck & main EQ in effects.xml #11695
Effects: store deck & main EQ in effects.xml #11695
Conversation
If there are review ressources for #11527 for merging that into 2.4 it makes absolute sense to have this, too, to complement the effect system changes. |
80cb584
to
c17af3d
Compare
I have no clue why so many loop / cue / engine buffer tests fail with this branch, I didn't touch related files 🤷 |
c17af3d
to
22d5dda
Compare
22d5dda
to
786b9df
Compare
c0a46b8
to
20b68e6
Compare
I do now: apparently the output effect chain is not created for tests, thus with null check on the output effect chain pointer all tests pass. |
20b68e6
to
c672756
Compare
Transition from mixxx.cfg works flawlessly. |
c672756
to
ad73a65
Compare
#11527 has been merged, rebased onto 2.4 |
Can you remove the unrelated logo update? |
ad73a65
to
5c12ebd
Compare
Whoops, cleaned it up locally already but push... |
7b23d47
to
3fffc29
Compare
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.
some low-level codestyle comments, didn't manage to analyze the highlevel changes yet.
EffectManifestPointer pDefaultEqEffect = m_pBackendManager->getManifest( | ||
BiquadFullKillEQEffect::getId(), EffectBackendType::BuiltIn); |
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.
isn't the default effect defined somewhere else?
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.
it was set in DlgPrefMixer
VERIFY_OR_DEBUG_ASSERT(!pDefaultEqEffect.isNull()) { | ||
} |
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.
this is a branch without any statement, should this just be DEBUG_ASSERT
or are you missing an early return?
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.
Oh.. Yeah, just DEBUG_ASSERT
will do
mainEqPreset = EffectChainPresetPointer( | ||
new EffectChainPreset(mainEqChainElement)); |
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.
prefer over the same reason to prefer std::make_shared
mainEqPreset = EffectChainPresetPointer( | |
new EffectChainPreset(mainEqChainElement)); | |
mainEqPreset = EffectChainPresetPointer::create(mainEqChainElement); |
QDomElement mainEqElement = XmlParse::selectElement(root, EffectXml::kMainEq); | ||
QDomNodeList mainEqs = mainEqElement.elementsByTagName(EffectXml::kChain); | ||
QDomNode mainEqChainNode = mainEqs.at(0); | ||
EffectChainPresetPointer mainEqPreset; |
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.
functionally equivalent, but this makes it obvious that the pointer is initialized.
EffectChainPresetPointer mainEqPreset; | |
EffectChainPresetPointer mainEqPreset = nullptr; |
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.
Also, shouldn't this also probably be pDefaultEqEffect
instead of nullptr
?
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.
the default for Main is none
src/effects/effectsmanager.cpp
Outdated
for (auto it = m_equalizerEffectChains.begin(); | ||
it != m_equalizerEffectChains.end(); | ||
it++) { |
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.
gotta love Qt's associative containers for the ease-of-use when wanting to iterate over them...
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.
I just copied the style present in this file, could as well be a QHashIterator.
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.
No its fine, I just wish we could use structured-bindings instead, but we can't...
https://stackoverflow.com/questions/13087028/can-i-easily-iterate-over-the-values-of-a-map-using-a-range-based-for-loop
I have an Idea on how to improve this though. Nevermind, not much of an improvement.
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.
Okay.
I already switched to QHashIterator, even if it's just about making it a bit more compact.
Thanks @Swiftb0y for taking a look. I'll consider your proposals and check each of the commits to make sure everything is still as intended. |
Thank you. I just picked this PR by chance during the little free time I had. So I don't know when I'll be able to finish this review. |
I simply adopted the routines of the QuickEffect chains for the Equalizers, and those of the standard effect units for the Main effect unit, maybe that helps 🤷♂️ Nothing I'm particularly proud of, it just had to be done. |
Co-authored-by: Swiftb0y <12380386+Swiftb0y@users.noreply.github.com>
1db748e
to
c5c8895
Compare
ping @Swiftb0y do you see a chance to continue with your review? |
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.
It works already good. Thank you.
I have added some comment for code improvement
src/effects/effectsmanager.cpp
Outdated
QHashIterator<QString, QuickEffectChainPointer> qeIt(m_quickEffectChains); | ||
while (qeIt.hasNext()) { | ||
auto pChainSlot = qeIt.next().value(); |
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.
QHashIterator<QString, QuickEffectChainPointer> qeIt(m_quickEffectChains); | |
while (qeIt.hasNext()) { | |
auto pChainSlot = qeIt.next().value(); | |
for (auto pChainSlot : m_quickEffectChains) { |
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.
I could have sworn I tried that loop earlier...
Thanks!
src/effects/effectsmanager.cpp
Outdated
QHashIterator<QString, EqualizerEffectChainPointer> eqIt(m_equalizerEffectChains); | ||
while (eqIt.hasNext()) { | ||
auto pEqChainSlot = eqIt.next().value(); |
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.
QHashIterator<QString, EqualizerEffectChainPointer> eqIt(m_equalizerEffectChains); | |
while (eqIt.hasNext()) { | |
auto pEqChainSlot = eqIt.next().value(); | |
for (auto pEqChainSlot : m_equalizerEffectChains) { |
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.
👍
src/effects/effectsmanager.cpp
Outdated
QHashIterator<QString, QuickEffectChainPointer> qeIt(m_quickEffectChains); | ||
while (qeIt.hasNext()) { | ||
deckStrings << qeIt.next().key(); | ||
} |
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.
QHashIterator<QString, QuickEffectChainPointer> qeIt(m_quickEffectChains); | |
while (qeIt.hasNext()) { | |
deckStrings << qeIt.next().key(); | |
} | |
deckStrings = m_quickEffectChains.keys(); |
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.
👍
src/effects/effectsmanager.cpp
Outdated
QHashIterator<QString, EqualizerEffectChainPointer> eqIt(m_equalizerEffectChains); | ||
while (eqIt.hasNext()) { | ||
eqIt.next(); | ||
const auto pEffectSlot = eqIt.value().data()->getEffectSlot(0); |
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.
const auto pEffectSlot = eqIt.value().data()->getEffectSlot(0); | |
const auto pEffectSlot = eqIt.value()->getEffectSlot(0); |
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.
👍
@@ -241,10 +292,24 @@ void EffectsManager::saveEffectsXml() { | |||
"schemaVersion", QString::number(EffectXml::kXmlSchemaVersion)); | |||
doc.appendChild(rootElement); | |||
|
|||
QHash<QString, EffectManifestPointer> eqEffectManifests; |
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.
QHash<QString, EffectManifestPointer> eqEffectManifests; | |
QHash<QString, EffectManifestPointer> eqEffectManifests; | |
eqEffectManifests.reserve(m_equalizerEffectChains.size()); |
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.
👍
auto pManifest = pEffectSlot->getManifest(); | ||
eqEffectManifests.insert(eqIt.key(), pManifest); | ||
} | ||
|
||
QHash<QString, EffectChainPresetPointer> quickEffectChainPresets; |
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.
QHash<QString, EffectChainPresetPointer> quickEffectChainPresets; | |
QHash<QString, EffectChainPresetPointer> quickEffectChainPresets; | |
quickEffectChainPresets.reserve(m_quickEffectChains.size()); |
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.
👍
src/effects/effectsmanager.cpp
Outdated
QHashIterator<QString, QuickEffectChainPointer> qeIt(m_quickEffectChains); | ||
while (qeIt.hasNext()) { | ||
qeIt.next(); | ||
auto pPreset = EffectChainPresetPointer::create(qeIt.value().data()); |
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.
I stumbled over this because the ownership was not instantly obvious. Maybe a comment helps or:
auto pPreset = EffectChainPresetPointer::create(qeIt.value().data()); | |
auto* pQuickEffectChain = qeIt.value().data(); | |
auto pPreset = EffectChainPresetPointer::create(pQuickEffectChain); |
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.
👍
// Read id of last loaded EQ effect | ||
QDomElement eqEffectsElement = | ||
XmlParse::selectElement(root, EffectXml::kEqualizerEffects); | ||
QDomNodeList eqEffectNodeList = |
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.
QDomNodeList eqEffectNodeList = | |
const QDomNodeList eqEffectNodeList = |
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.
👍
Did did still consider this +350 -141 PR a 2.4 candidate? I think yes for sake of completeness |
Yes, this should be in 2.4 now that we polished it. The tricky part is the migration in DlgPrefMixer:
|
7134440
to
dfb7c1c
Compare
clazy is complaining:
The rest looks good. Thank you. Please confirm when it is ready for merge. |
dfb7c1c
to
2e9aa1d
Compare
Fixed. |
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.
All Green. Thank you. LGTM.
... to have all effects settings in one place.
The migration from mixxx.cfg is supposed to be done only once, hence the read lines are removed from mixxx.cfg. This means if someone decides to go back to 2.3, the deck EQs and the Main EQ will be reset to default. (IIRC downgrading has more implications and we don't guarantee that's trouble-free anyway)
Since cfg strings are removed during migration the only possibility to loose the main EQ config is if Mixxx crashes before/during shutdown (when the cleaned config is written but not the effects config).
Deck EQ effect uids:
Main EQ effect uid + parameters (stored like the standard effect chains)
Preferences > Mixer is adjusted, though there's now one small step back in terms of UX IMO (compared to #11527, not 2.4):
main EQ changes can not be undone with Cancel --
updateMainEQ()
always reads the state from EffectsManager. Though that's what the 'Reset Parameter' button is for.