-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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 > Mixer: apply & save settings only in slotApply(), fix bugs, improve UX #11527
Merged
Merged
Changes from all commits
Commits
Show all changes
53 commits
Select commit
Hold shift + click to select a range
f888df7
Pref Mixer, ui: set xfader button group in ui file
ronso0 c400306
Pref Mixer, ui: fix widget tab focus order
ronso0 ca18756
Pref Mixer, xFader: update settings only when touching xfader widgets
ronso0 f230382
Pref Mixer, xfader: don't store pointer to curve scene
ronso0 14f6811
Pref Mixer: read config only in slotUpdate() pt I
ronso0 555b02d
Pref Mixer, bypass EQ: add bool for checkbox state, apply 'only in sl…
ronso0 9554e84
Pref Mixer, deck EQ & QuickEffects: prevent unneeded reload during init
ronso0 f731e9d
Pref Mixer: improve function names, remove b prefix from bools, comments
ronso0 96929a0
Pref Mixer: apply settings only in slotApply(), except Main EQ
ronso0 770c643
Pref Mixer, main EQ: rework loading, updating & saving
ronso0 6b248d5
Pref Mixer, main EQ: add checkbox to apply parameter changes instantly
ronso0 2fdaee3
Pref Mixer, main EQ: tweak parameter slider steps and value labels
ronso0 b4c880b
Pref Mixer, EQ shelves: add checkbox to apply shelves instantly
ronso0 21d5f5e
Pref Mixer, EQ shelves: fix update, improve precision, avoid round tr…
ronso0 f6c4435
Pref Mixer, deck EQ & QuickEffects: rework update & save
ronso0 c4e4fe1
Pref Mixer, deck EQ & QuickEffects: disable non-EQ items if 'EQs only…
ronso0 f1e1a6a
Pref Mixer: add tooltips for deck & main EQ effects
ronso0 2f5fd9e
Pref Mixer: fix UX when checking 'Same EQ for all decks'
ronso0 0d2f732
Pref Mixer: migrate bool options from yes|no to 1|0
ronso0 82b3fc0
Pref Mixer: remove obsolete includes, some comments
ronso0 e82d50b
Pref Mixer: p prefix for widget pointers
ronso0 d3d18cb
Pref Mixer: use PollingControlProxy for EQ shelve controls
ronso0 41c4938
Pref Mixer, EQ shelves: instant apply on change, write to config in s…
ronso0 0a3c57f
Pref Mixer, main EQ: apply instantly, store to config in slotApply()
ronso0 37bddab
Pref Mixer: fix main EQ parameter precision
ronso0 742ca3d
Pref Mixer: fix EQ shelves display precision
ronso0 88a7f37
move EQ corner ConfigKey strings to effects/defs.h, adjust Pref Mixer
ronso0 21667b6
Pref Mixer: constants for ConfigKeys
ronso0 2f8534f
Pref Mixer: get default QuickEffect name from its effect manifest
ronso0 26b952c
use PollingControlProxy for EQ corner frequency controls
ronso0 c8d98b2
EQ utils: add TODO to update tr string after 2.4 release
ronso0 89acb4e
Merge remote-tracking branch 'mixxx/2.4' into pref-mixer-apply
ronso0 0aea69e
Merge remote-tracking branch 'mixxx/2.4' into pref-mixer-apply
ronso0 579792f
Merge remote-tracking branch 'mixxx/2.4' into pref-mixer-apply
ronso0 930e42a
Pref Mixer: polish comments, remove obsolete TODOs, add DEBUG_ASESERT
ronso0 ce925d9
EffectsManager: add getQuickEffectChain() helper
ronso0 d3ca182
Pref Mixer: use EffectsManager::getQuickEffectChain()
ronso0 0437f34
Pref Mixer: a few DEBUG_ASSERT instead of VERIFY_OR_...
ronso0 5298b85
EQ effects tooltip: point to new Mixer page for adjusting the EQ shelves
ronso0 f2abc89
Merge remote-tracking branch 'mixxx/2.4' into pref-mixer-apply
ronso0 0ca9701
Pref Mixer: constants for xfader ConfigKeys
ronso0 c439051
EQ effects: remove empty destructors
ronso0 e07c3c2
Pref Mixer: use parented_ptr for xfader QGraphicsScene, reuse scene
ronso0 20bd4fa
Pref Mixer: polish xfader graph, smooth lines, style it like it's 202…
ronso0 6f20086
Merge remote-tracking branch 'mixxx/2.4' into pref-mixer-apply
ronso0 17422ed
Pref Mixer: don't use indexOf(QComboBox*) in for loops
ronso0 5aa6b32
Pref Mixer: use parented_ptr for all widgets created on request
ronso0 84ddc77
Pref Mixer: contruct combobox tooltips with string args
ronso0 4c1e867
Pref Mixer: qAsConst -> std::as_const
ronso0 c222ed4
Pref Mixer: auto* + simpler combobox item deactivation
ronso0 8e571ee
Pref Mixer: more efficient EQ list splitting EQs / non-EQs
ronso0 2132b97
Pref Mixer: show effects' display name, separate EQs / non-EQs
ronso0 268e278
Merge remote-tracking branch 'mixxx/2.4' into pref-mixer-apply
ronso0 File filter
Filter by extension
Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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 current solution is perfectly OK, but has a performance implications.
Putting a const QString into a header (internal namespace) will construct (malloc) the QString again in every cpp file that includes the header.
The memory allocation "may" take place when the QString is used the first time.
This is in our case when moved to ConfigObject
mixxx/src/preferences/configobject.h
Line 20 in dfde28d
It would be possible to share the strings across the translation units by moving this to the global (external) namespace by adding this to a defs.cpp as
extern const QString kMixerProfile = QStringLiteral("[Mixer Profile]");
and make this:
extern const QString kMixerProfile;
This way the memory allocation is only done a single time and than shared in whole mixxx binary
Maybe we can sourround it with a defs namespace or such.
We have more of these shared const QString in Mixxx, so I am not sure if it worth to target the issue here?
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, thanks for the info. So, like in library prefs.h/cpp (where we could enclose the defs in namespaces
mixxx
,library
&prefs
to haveconst ConfigKey kSyncTrackMetadataConfigKey
instead ofconst ConfigKey mixxx::library::prefs::kSyncTrackMetadataConfigKey
)Out of curiosity, how does this compare to
#define
like in src/defs_urls.h?I wouldn't do it for these 3 strings here, and I didn't find noteworthy occurences of more than one
const QString k*
in header files. File a reminder if you know of more places where this could be improved?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 tried
defs.h
new defs.ccp
but get linker errors.
When omitting
extern
it buildsand works well.edit: no, it doesn't work..@daschuer I have no clue how to proceed, could you give some advice?
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.
recreating the same thing in compiler explorer works with
std::string
(CE's Qt + Cmake integration is broken unfortunately so I can't easily investigate why this breaks forQString
s).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 thought the entire point of the QStringLiteral macro was that there was no allocation taking place?!? Yes, there is allocation when the string gets modified due to CoW, but thats already the place. I don't how putting this in the header would result in performance degradation. And even if, the number of allocations which would create would be tiny compared the amount of unnecessary allocations we have everywhere 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.
Oh right, my bad. We have no heap allocation here.
The uinicode string along with 20 bytes of control data is used directly from the text segment and of every compilation unit that includes and uses the string. This is almost like a constexpr with reference counting disabled.
An addition there is a pointer to that data in the bss initalized with that location.
So there is no performance benefit, but a negligible memory impact.
Sorry for he noise.
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.
Right, moreover, what about initialization order? The initialization order of TU's is undefined. If you declare something as extern const, you need to take care that no other global variable is being initialized based on it. This reeks of a potential source of bugs. And even if the string is
QStringLiteral
, the constructor for that variable still needs to run in order for the variable to be usable, even if the constructor doesn't do much, right?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. In this case it is no issue, because the constructor boils down to a pointer initializer. No other dependencys.
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.
Aaahm, nope. I also tried namespace(s) to no avail.
The pattern you suggest works well with ConfigKey (like in library_prefs.h/cpp) but appearantly not with QString.
Btw I stopped investigating what's wrong.
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, let's move on, not worth to discuss it in the scope of an unrelated PR.