-
-
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
Option to keep deck playing on track load #10944
Option to keep deck playing on track load #10944
Conversation
Thank you for working on this! And congratulations for your first contribution : ) Since this is your first contribution we need you to sign the contributor agreement and thereby allows Mixxx to include your changes.
Please install pre-commit as described in CONTRIBUTING.md#git-workflow (I think wiki/Using-Git#set-up-automatic-code-checking is more comprehensive) |
As long as no one started to review this PR you may as well incorporate the pre-commit fixes and sqash everything into one commit and rebase onto mixxx/main. |
I filled out the form. |
7e77f11
to
87c5582
Compare
I installed the pre-commit hooks, squashed, rebased and pushed. It complained about |
I apologize for missing the instructions on installing Git pre-commit hooks the first go-round. |
After the rebase, I noticed and fixed two more issues as separate commits and pushed. I thought the clang-format pre-commit hook would tell me to fix things but it passed for me locally without complaint. Not sure what to expect. |
</property> | ||
<property name="buddy"> | ||
<cstring>checkBoxDisallowLoadToPlayingDeck</cstring> | ||
<cstring>comboBoxLoadWhenDeckPlaying</cstring> |
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'm not sure why you changed this (changing translation texts requires new translation for every language).
Also, I thought the new option would a) load a track into a playing deck and b) play that right away.
Even though b) requires a), a) and b) are unrelated (I might want to load tracks into playing decks, but I don not want auto-play)
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's actually deleting the checkbox entirely and replacing it with a combobox that offers more functionality:
- load track into playing deck and play that right away
- load track into playing deck but stop
- don't allow loading into playing deck
See the discussion at the end of this issue? #10548 (comment)
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.
Of course, I should have taken a closer look, not just skimming through...
If did |
I can rebase this now, but I notice you have started a review. |
Even though I explicitely just added a comment it is marked as "reviewed", this is irritating. |
comboBoxLoadWhenDeckPlaying->addItem(tr("Reject"), static_cast<int>(LoadWhenDeckPlaying::Reject)); | ||
int loadWhenDeckPlaying; | ||
if (m_pConfig->exists(kConfigKeyLoadWhenDeckPlaying)) { | ||
loadWhenDeckPlaying = m_pConfig->getValueString(kConfigKeyLoadWhenDeckPlaying).toInt(); |
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.
Do we need to use the default as well, if the value does not exists?
It would be grate to have a solution that works forward and backward with old an new versions.
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.
Sorry, I don't follow. If it doesn't exist, won't it then get the default from the else-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.
Yes, right.
It is just the issue that "m_pConfig->exists" is a redundant lookup of the value. It is better to use getValue() with a fallback value like purposed above
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.
Well yes but I'm trying to be mindful of not losing behavior previously configured by the user in a previous version. If the user disabled (or enabled) playing track protection I want to import that.
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 realize this is confusing because, in a different part of the code, I didn't use getValue
with default when I should have, but I think in this case it makes sense to probe for existence of the new config variable first and fall back to loading the older config variable.
Did a bunch of the code review driven changes. Didn't rebase since a review actually started after @ronso0 said to rebase away :) Anything else? |
Just a hint: usually code conversations (conversations pinned to a specific spot in the code) are marked as resolved by the reviewer. That makes it easier to check if/how the discussed changes were applied. |
My bad! Will bear that in mind for next time :) |
@ronso0 just to be clear I think this is ready to merge if there are no other blockers (not sure what to do about the code style check; should I run clang-format on my code and push?) |
I only che.cked the UI until now, @daschuer has the final word re code here. Update pre-commit maybe? Idk why it didn't complain about the indentations locally. |
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 have just tested this and it works good. Thank you.
Just one comment for improvement and the pre-commit patch and we can merge this nice addition.
src/util/dnd.cpp
Outdated
} else { | ||
// support older version of this flag | ||
allowLoadTrackIntoPlayingDeck = | ||
pConfig->getValue<bool>(ConfigKey("[Controls]", "AllowTrackLoadToPlayingDeck")); |
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.
Can you also introduce a constant for this?
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.
Done
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.
LGTM, Thank you.
This is a proposed solution as discussed in issue #10548.
This is my first proposed contribution to this project and first to an open source C++ project. I apologize if I missed something important or did something dumb. Thanks for your consideration :)