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

Option to keep deck playing on track load #10944

Merged
merged 7 commits into from
Oct 19, 2022

Conversation

mbacarella
Copy link
Contributor

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 :)

@github-actions github-actions bot added the ui label Oct 6, 2022
@ronso0
Copy link
Member

ronso0 commented Oct 6, 2022

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 comment here when you filled the form and let us know which name should appear in the contributor list.

I apologize if I missed something important

Please install pre-commit as described in CONTRIBUTING.md#git-workflow (I think wiki/Using-Git#set-up-automatic-code-checking is more comprehensive)

@ronso0
Copy link
Member

ronso0 commented Oct 6, 2022

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.

@mbacarella
Copy link
Contributor Author

Please comment here when you filled the form and let us know which name should appear in the contributor list.

I filled out the form. Michael Bacarella <[email protected]> is fine.

@mbacarella mbacarella force-pushed the keep-deck-playing-on-track-load branch from 7e77f11 to 87c5582 Compare October 6, 2022 21:49
@mbacarella
Copy link
Contributor Author

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 installed the pre-commit hooks, squashed, rebased and pushed. It complained about qmlformat but I couldn't figure out how to install it, so I skipped. I assume the server side may run it and let me know if there are any problems.

@mbacarella
Copy link
Contributor Author

I apologize for missing the instructions on installing Git pre-commit hooks the first go-round.

@mbacarella
Copy link
Contributor Author

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>
Copy link
Member

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)

Copy link
Contributor Author

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:

  1. load track into playing deck and play that right away
  2. load track into playing deck but stop
  3. don't allow loading into playing deck

See the discussion at the end of this issue? #10548 (comment)

Copy link
Member

@ronso0 ronso0 Oct 7, 2022

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...

@ronso0
Copy link
Member

ronso0 commented Oct 6, 2022

If did git rebase -i [mixxx repo]/main Catch up to main (resolve merge conflict)
1c79403 would not be necessary (you didn't touch legacyskinparser).

@mbacarella
Copy link
Contributor Author

If did git rebase -i [mixxx repo]/main Catch up to main (resolve merge conflict) 1c79403 would not be necessary (you didn't touch legacyskinparser).

I can rebase this now, but I notice you have started a review.

@ronso0
Copy link
Member

ronso0 commented Oct 7, 2022

Even though I explicitely just added a comment it is marked as "reviewed", this is irritating.
Feel free to rebase!

comboBoxLoadWhenDeckPlaying->addItem(tr("Reject"), static_cast<int>(LoadWhenDeckPlaying::Reject));
int loadWhenDeckPlaying;
if (m_pConfig->exists(kConfigKeyLoadWhenDeckPlaying)) {
loadWhenDeckPlaying = m_pConfig->getValueString(kConfigKeyLoadWhenDeckPlaying).toInt();
Copy link
Member

@daschuer daschuer Oct 7, 2022

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.

Copy link
Contributor Author

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?

Copy link
Member

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

Copy link
Contributor Author

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.

Copy link
Contributor Author

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.

@mbacarella
Copy link
Contributor Author

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?

@ronso0
Copy link
Member

ronso0 commented Oct 11, 2022

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.

@mbacarella
Copy link
Contributor Author

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 :)

@mbacarella
Copy link
Contributor Author

@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?)

@ronso0
Copy link
Member

ronso0 commented Oct 16, 2022

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.
You may also download the generated patch and apply it manually. Click on Details next to the pre-commit check, on the top left click Summary, scroll down to Artifacts and grab pre-commit.patch

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 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"));
Copy link
Member

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?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done

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.

LGTM, Thank you.

@daschuer daschuer added the changelog This PR should be included in the changelog label Oct 19, 2022
@daschuer daschuer added this to the 2.4.0 milestone Oct 19, 2022
@daschuer daschuer merged commit 8cd8908 into mixxxdj:main Oct 19, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
changelog This PR should be included in the changelog ui
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants