Skip to content
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

Pref EQ: apply & save settings only in slotApply() #4667

Closed
wants to merge 9 commits into from

Conversation

ronso0
Copy link
Member

@ronso0 ronso0 commented Feb 7, 2022

before, "Use the same EQ for all decks" was reset to true, overriding the config value.

Noticed here https://mixxx.discourse.group/t/mixx-strongly-began-to-heavily-load-the-system-linux/24068/29

@github-actions github-actions bot added the ui label Feb 7, 2022
@@ -45,6 +45,9 @@ DlgPrefEQ::DlgPrefEQ(QWidget* pParent, EffectsManager* pEffectsManager, UserSett
m_pOutputEffectRack = m_pEffectsManager->getOutputsEffectRack();

setupUi(this);

loadSettings();
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Leave a comment why the settings must be loaded here and not later?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not really. It's fixed in main already.
Also the comment would actually belong to/into slotNumDecksChanged which is doing the reset.

@ronso0 ronso0 marked this pull request as draft February 7, 2022 23:47
@ronso0
Copy link
Member Author

ronso0 commented Feb 7, 2022

more to come, after start the EQ boxes are still accessible even though "Bypass EQs" is checked (toggling it off and on again does de/activate comboboxes)

@Be-ing
Copy link
Contributor

Be-ing commented Feb 7, 2022

Note that there were a lot of changes to this code between 2.3 and main so someone is likely to have to deal with merge conflicts which might get messy.

@ronso0
Copy link
Member Author

ronso0 commented Feb 7, 2022

I know, I'm already looking into the differences 2.3/main.
Until now it's only moving lines around in the initialisation, so conflicts seem manageable.

@ronso0
Copy link
Member Author

ronso0 commented Feb 8, 2022

Unfortunately, this pref page is a bit of a mess, fixing one bug introduced another regression and so on.
There are places where config vaules are set based on checkbox states not initialized from config but the default states determined by the ui file, other functions write to config too early (before slotApply is invoked) so that clicking Cancel does not wipe unapplied settings but smply closes the dialog, reset to defaults loads settings from config?

Sooo, I could "fix" the actual bug with a few workarounds and additional repetetive widget updates calls, and overhaul the entire page after merging this to main. Thus leaving 2.3 in a rather sub-optimal bu "somehow working" state.
Or I do the overhaul now and deal with the conflicts...

Btw it seems to make sense to apply every Master EQ slider change immediately (so it's audible without having to press Apply every time). I'd leave that as is if no one has objections.

@Be-ing
Copy link
Contributor

Be-ing commented Feb 8, 2022

I agree this preference page is a mess to maintain. I think it was a mistake to introduce the nearly useless feature of allowing to configure different EQs for different decks; it adds a lot of complexity to this preferences code that I doubt anyone uses in practice. I think this bug is very minor and it's fine to leave it as is.

@uklotzde
Copy link
Contributor

uklotzde commented Feb 8, 2022

Do not spend any time on these dialogs. Only fix minor bugs (if you really can't hold yourself back) and don't touch anything else.

@ronso0
Copy link
Member Author

ronso0 commented Feb 8, 2022

Well, after all we'll still have to deal with those dialogs for some time.
I already touched it and poked around to find out what's wrong -- that time would be wasted if I drop it now.

My aspiration is to -at least- make sure

  • settings are loaded from config, not from .ui file defaults
  • the GUI reliably shows the current config
  • nice to have: only Apply writes values to config (except Master EQ)

I'll pack bitesize commits for minimal review time.

@ywwg
Copy link
Member

ywwg commented Feb 10, 2022

different EQs for different decks

how hard would it be to rip that out? (not for this PR). I would like to lose some cruft if we agree it's not needed

I agree that it's best to take a "do as little as possible" approach to the prefs code. Fixes are always appreciated, just don't get sucked too far in :)

@Be-ing
Copy link
Contributor

Be-ing commented Feb 10, 2022

how hard would it be to rip that out?

Not sure, but probably not all that hard. No changes would be required in the effects system, only DlgPrefEq.

@ronso0
Copy link
Member Author

ronso0 commented Feb 10, 2022

just don't get sucked too far in :)

Too late. Though I'm not refactoring but consolidating all apply code in, well, slotApplyso that Cancel does.. cancel as it supposed to. That went unexpectedly quick, only packing small commits took a while.
Also, the parts I touched are almost identical in main, so I'm confident the conflicts are minimal (will resolves those of course).
IMO review should focus not focus on the code quality (as I just moved stuff around) but manual testing if and when changes are applied, since that is what this is all about. Cancel should cancel, Apply should apply (set COs and set config values).

I will not touch the code that allows 4 individual EQs / QuickEffects. Shouldn't be too hard though.

Also, I noticed a bug in the EQ shelve 'validation' / slider/value calculation: if you set low & high shelves above average the values would be lowered with each start until they settle at certain values. Won't fix that here either.

@ronso0
Copy link
Member Author

ronso0 commented Feb 10, 2022

While testing the changes I noticed another, additional bug in main:
"Bypass EQ" ON is not taken into account after start -- until it's toggled Off and On again in the preferences.

I think it makes much sense to fix this stuff now, regardless of a future preferences interface.

@Be-ing
Copy link
Contributor

Be-ing commented Feb 10, 2022

How about getting rid of the redundant bypass EQ option? It does the same thing as picking None in the combobox.

@ronso0
Copy link
Member Author

ronso0 commented Feb 10, 2022

"None" unloads the EQ effect (and hides the respective mixer controls).
"Bypass" is more like a (temporary?) switch that keeps the EQ config.
Idk, it's not a bug and not urgent IMO, removal can happen in main.

Btw: I'd move the Bypass checkbox up above Master EQ.
The current position at the bottom does not communicate that it only affects deck EQs.
Though that is more a UI inconvenience rather than a bug.

@ronso0 ronso0 force-pushed the pref-eq-reset branch 3 times, most recently from eb79d46 to 4c46cc0 Compare February 16, 2022 00:32
@ronso0
Copy link
Member Author

ronso0 commented Feb 16, 2022

Okay, done:
now all settings are applied and saved to config only when hitting Apply (except Main Equalizer, as before).

IMO review should focus not focus on the code quality (as I just moved stuff around) but on manual testing and when changes are applied, since that is what this is all about. Cancel should cancel, Apply should apply (set COs and set config values).

When testing this, take care not to use your config from main. I had situations where EQs were not processed due to some weird CO being set to 0 (also in [MixerProfile], equivalent to [EqualizerRack1_[ChannelN]_Effect1], enabled) when switching between main and 2.3 Maybe I can figure out what that was.

Note:
I'll not be able to work on this or fix conflicts with main after Thursday, so either someone reviews this soonish and I'll merge to main ASAP -- or this has to wait for 3 weeks.

In main we can then discuss

  • if we want to remove the option to have deck-specific EQs
  • if Bypass EQs is still needed
  • if the main EQ should also be applied only when clicking Apply

@ronso0
Copy link
Member Author

ronso0 commented Feb 16, 2022

Please don't panic, instead look at the single commits first.
You'll see most of what I did is moving all writing to config, setting COs and loading effects to slotApply() where it belongs, hence the lines diff.
You'll also see that this consolidation allowed to remove most of what you consider brittle / more complex than necessary: the entanglement of combobox stateChanged slots and slotPopulateDeckSelectors, restoring previous, with 'EQs effects only' unavailable EQ selections etc.
I think it's pretty straight-forward now: adjust settings, hit Apply or Cancel. No signal/slot auto-adjust magic anymore.
Please take a closer look and tell me what exactly you think could go wrong. You can put a6d99fc on top to have debug output for tracing when slots are called.

What I consider the actual bug here is that reading selections was inconsistent (from both .ui file defaults and config?) and saving/applying was done instantly all over the place.
I propose to fix exactly that in the stable 2.3 branch.

Without even considering the conflicts with main

Of course I'm not going to fix the conflicts chunk by chunk, that would be insane.
I'll git checkout --ours src/preferences/dialog/dlgprefeq* and re-apply the commits manually. That's faster and safer, since I'm into it atm.

@ronso0 ronso0 marked this pull request as ready for review February 16, 2022 18:33
@ronso0 ronso0 changed the title Pref EQ: load settings earlier to not use single EQ default Pref EQ: apply & save settings on in slotApply() Feb 17, 2022
@ronso0
Copy link
Member Author

ronso0 commented Feb 17, 2022

I notice I will probably not have time to respond to reviews and merge to main before I'm travelling.
Marking as draft again, and finishing it when I'm back.

@ronso0 ronso0 marked this pull request as draft February 17, 2022 10:39
@Holzhaus
Copy link
Member

I notice I will probably not have time to respond to reviews and merge to main before I'm travelling.
Marking as draft again, and finishing it when I'm back.

I don't understand, is this ready to review or not? If it is, I suggest to not mark it das draft so that people can review it until you are back.

@ronso0
Copy link
Member Author

ronso0 commented Feb 17, 2022

Yes, ready for review. Though, there'll be non-trivial conflicts with main, and I want to avoid this being merged 'by accident', so "Finishing it" refers to me taking care of conflict resolution / re-implementation in main.

So, any reviewer aware of this may unmark this on his own, please. Thank you.

@Be-ing
Copy link
Contributor

Be-ing commented Feb 22, 2022

To clarify my previous comments: if someone else thinks it is a good idea to merge this to 2.3 and is motivated to thoroughly review & test the changes, go ahead. I don't think the risk is worth the minor benefits for a stable branch. I think it would be a better idea to rebase this on main and leave well enough alone on the stable branch.

@ronso0
Copy link
Member Author

ronso0 commented Mar 24, 2022

All EQ settings are applied instantly, that itself is a bug because the EQ page is not working as expected.
Though, we can discuss if the shelf paramters should be applied instantly to simplify testing.

I can only recommend to review the entire EQ page in an IDE.Tthat needs to be done anyway, regardless if the changes go to 2.3 or main.
I did extensive manual tests with both QuickEffects and EQs. There are only improvements, no regression, and the EQ checkbox bug is fixed. The entire page is clearer and consistent now in terms of UX and signal-wise (except unchanged Master EQ behaviour).

@ronso0 ronso0 changed the title Pref EQ: apply & save settings on in slotApply() Pref EQ: apply & save settings only in slotApply() Apr 8, 2022
@ronso0 ronso0 marked this pull request as ready for review April 11, 2022 20:16
@ronso0
Copy link
Member Author

ronso0 commented Apr 11, 2022

Officially ready for review.
My offer to port the changes to main still stands.
Though, if I'm not available and someone needs to merge 2.3 into main in a hurry, simply resolve conflicts with git checkout --ours src/preferences/dialog/dlgprefeq*

@github-actions
Copy link

This PR is marked as stale because it has been open 90 days with no activity.

@github-actions github-actions bot added the stale Stale issues that haven't been updated for a long time. label Jul 11, 2022
@daschuer daschuer added needs review and removed stale Stale issues that haven't been updated for a long time. labels Aug 9, 2022
Copy link
Member

@daschuer daschuer left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have reviewed an tested it and the code locks good and works like expected.

Before merge, I like to clarify the general approach/use case for this:

  • Due to this PR the frequency corners are no longer applied immediately.
  • They where original applied immediately to test them instantly:
    • Kill Low pass
    • Move the slider until it sound good
  • I understand that this does not fit to the overall concept of the preferences and might be surprising,
  • The main EQ is still applied directly even if you change the center frequency with the parametric EQ which is the same like the corner frequencies.
  • I do consider no longer "applying the frequency corners instantly" not as a 2.3 bugfix
  • Tweaking the frequency corners is only a on-time issue
  • Tweaking the main EQ will be done on each venue

This means we have here the issue between "tewaking EQ" vs "manage preferences". This PR shifts the issue a bit but does not solve it.

I am open to merge this anyway as long it fits to future plans.
What are they?

We may consider following changes:

  • Revert the to instant adoption of frequency corners, to keep the impact of this PR small
  • Add a label that describes the behaviour
  • Add a checkbox "[x] Apply changes immediately"
  • Move EQ slider to a separate pop-up window ....

What do you think?

@ronso0
Copy link
Member Author

ronso0 commented Aug 10, 2022

Indeed, applying the slider values immediatly is probably desired as that is more practical. So the actual bug IMO is not that the parameters are applied immediatly but that they are written to the config immediatly.

Right now, I'd rather close this, and try to fix

before, "Use the same EQ for all decks" was reset to true, overriding the config value.
Noticed here https://mixxx.discourse.group/t/mixx-strongly-began-to-heavily-load-the-system-linux/24068/29

(in a rather hackish way) in 2.3.

Then rework this page for main so that all values are written to config only in slotApply(), so that Cancel (revert to previous state) is useful again.

@ronso0 ronso0 marked this pull request as draft August 10, 2022 10:41
@daschuer
Copy link
Member

Ok, thank you.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

6 participants