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

feat: add setting definition for Traktor S4 MK3 #12995

Merged
merged 2 commits into from Mar 31, 2024

Conversation

acolombier
Copy link
Contributor

@acolombier acolombier commented Mar 23, 2024

This PR adds the setting definition for Traktor S4 MK3.

Manual PR to come soon

Depends on #11300

image

@acolombier
Copy link
Contributor Author

acolombier commented Mar 23, 2024

Added a second commit to provide backward compatibility with 2.4 as an option. Happy to remove or rebase to target 2.4 instead.

Tests are expected to fail on the first commit otherwise till the dependency is merged.

@acolombier acolombier force-pushed the chore/add-setting-to-traktor-s4mk3 branch from 56e2929 to cb4b03d Compare March 23, 2024 20:04
@ywwg
Copy link
Member

ywwg commented Mar 28, 2024

"chore" is for low-level repository tasks. This is a "feat"

@acolombier acolombier force-pushed the chore/add-setting-to-traktor-s4mk3 branch from cb4b03d to 31d1706 Compare March 28, 2024 21:35
@acolombier acolombier changed the title chore: add setting definition for Traktor S4 MK3 feat: add setting definition for Traktor S4 MK3 Mar 28, 2024
Copy link
Member

@ywwg ywwg left a comment

Choose a reason for hiding this comment

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

Thank you for doing this! It's very fun to see these get used right away. I mostly made some language edits and notes, as well as some naming nits.

res/controllers/Traktor Kontrol S4 MK3.hid.xml Outdated Show resolved Hide resolved
default="true"
label="Keep one-color LED dimmed instead of off when inactive">
<description>
This will always ensure every button has some lighting which may help in dark environment, but may put off the lead color of the deck.
Copy link
Member

Choose a reason for hiding this comment

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

not sure what you mean by "put off the lead color"? That doesn't quite scan for my own grammar.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Just for context here (and for some other comments you've written), when I did this original mapping, it was received with various opinion of how things should look like and work (perfect to leverage these new setting capabilities hey!)
What I tried to say was that by keeping those single color LED backlit (white and green mainly if I recall properly), the colour of the deck may look slightly off (say, you've picked a nice Lime coloring, there is some red and white in the way, which may make it hard to see what is the actual deck color (thus what deck is currently selected)

res/controllers/Traktor Kontrol S4 MK3.hid.xml Outdated Show resolved Hide resolved
res/controllers/Traktor Kontrol S4 MK3.hid.xml Outdated Show resolved Hide resolved
res/controllers/Traktor Kontrol S4 MK3.hid.xml Outdated Show resolved Hide resolved
res/controllers/Traktor Kontrol S4 MK3.hid.xml Outdated Show resolved Hide resolved
res/controllers/Traktor Kontrol S4 MK3.hid.xml Outdated Show resolved Hide resolved
<value label="Times Played">18</value>
<value label="Rating">19</value>
<value label="Key">20</value>
<description>Second column when iterating over sortable library columns using VIEW+Library Encoder press</description>
Copy link
Member

Choose a reason for hiding this comment

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

we don't capitalize any other buttons, should we?

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'm happy either way. What would you prefer? All caps or not?
Since the fields should support rich text, we could also just put some emphasis like View or View

res/controllers/Traktor-Kontrol-S4-MK3.js Outdated Show resolved Hide resolved
res/controllers/Traktor-Kontrol-S4-MK3.js Outdated Show resolved Hide resolved
Copy link
Contributor Author

@acolombier acolombier left a comment

Choose a reason for hiding this comment

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

It's very fun to see these get used right away

That branch has been sitting on my local for almost a year, so it is a relief to finally seeing being useful to other :)
Will do the suggested changed changes in a bit. How hard would it be to help me find all grammar/spelling mistakes? If too hard, I can try an see if ChatGPT can help correcting this in place 🤣

res/controllers/Traktor Kontrol S4 MK3.hid.xml Outdated Show resolved Hide resolved
default="true"
label="Keep one-color LED dimmed instead of off when inactive">
<description>
This will always ensure every button has some lighting which may help in dark environment, but may put off the lead color of the deck.
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Just for context here (and for some other comments you've written), when I did this original mapping, it was received with various opinion of how things should look like and work (perfect to leverage these new setting capabilities hey!)
What I tried to say was that by keeping those single color LED backlit (white and green mainly if I recall properly), the colour of the deck may look slightly off (say, you've picked a nice Lime coloring, there is some red and white in the way, which may make it hard to see what is the actual deck color (thus what deck is currently selected)

res/controllers/Traktor Kontrol S4 MK3.hid.xml Outdated Show resolved Hide resolved
</description>
</option>
<option
variable="mixerControlsMixAuxOnShift"
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes, we do.

It happens quite often that I would use the mixer to adjust track volumes (e.g fade out) while pitching down (shift+left encoder) a track.

<value label="Times Played">18</value>
<value label="Rating">19</value>
<value label="Key">20</value>
<description>Second column when iterating over sortable library columns using VIEW+Library Encoder press</description>
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'm happy either way. What would you prefer? All caps or not?
Since the fields should support rich text, we could also just put some emphasis like View or View

type="enum"
label="Sixth column">
<value label="---" default="true">0</value>
<value label="Artist">1</value>
Copy link
Contributor Author

Choose a reason for hiding this comment

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

These values come from here. I would expect it won't be changed (potentially new value may be added tho, but no breaking change)
I don't know how to put test for that, what would you suggest? GTest case?

<option
variable="loopWheelMoveFactor"
type="integer"
min="20"
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'm not sure I understand. Do you mean you would want a bigger max? is 10x of default enough in your opinion?

res/controllers/Traktor-Kontrol-S4-MK3.js Outdated Show resolved Hide resolved
res/controllers/Traktor-Kontrol-S4-MK3.js Outdated Show resolved Hide resolved
@acolombier acolombier force-pushed the chore/add-setting-to-traktor-s4mk3 branch from 16b015a to dd13e00 Compare March 29, 2024 10:56
@acolombier acolombier force-pushed the chore/add-setting-to-traktor-s4mk3 branch from dd13e00 to 53ef29e Compare March 29, 2024 11:04
@acolombier
Copy link
Contributor Author

I have removed 2.4 backward compatibility and tried and rework phrasing and spelling (with a limited success - sorry)

I have also experienced with custom style around button names, similar to how it is done on the manual. What are your thoughts?

image

Copy link
Member

@ywwg ywwg left a comment

Choose a reason for hiding this comment

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

looking good! just a few more questions and then I think we're good to go

</description>
</option>
<option
variable="mixerControlsMixAuxOnShift"
Copy link
Member

Choose a reason for hiding this comment

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

oh is that a typo?

Suggested change
variable="mixerControlsMixAuxOnShift"
variable="mixerControlsMicAuxOnShift"

</description>
</option>
<option
variable="mixerControlsMixAuxOnShift"
Copy link
Member

Choose a reason for hiding this comment

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

I mean, why not make this true by default and not be an option?

type="enum"
label="Sixth column">
<value label="---" default="true">0</value>
<value label="Artist">1</value>
Copy link
Member

Choose a reason for hiding this comment

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

It could be a gross gtest in c++ that loads the xml and compares it to the C++ code. or maybe a better option is we could make this file somehow templated (qtxml?) and generated as part of the build process.

The library changes not very often, but often enough. Without an automated way of detecting the change I'm afraid we will never know that we broke this config.

<option
variable="loopWheelMoveFactor"
type="integer"
min="20"
Copy link
Member

Choose a reason for hiding this comment

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

yeah probably a bigger max. I have seen some videos of djs cranking the CDJ wheel sensitivity way way up and getting some really cool effects. Sure let's try 10x!

res/controllers/Traktor-Kontrol-S4-MK3.js Outdated Show resolved Hide resolved
res/controllers/Traktor-Kontrol-S4-MK3.js Show resolved Hide resolved
@@ -118,7 +120,21 @@ QWidget* LegacyControllerBooleanSetting::buildInputWidget(QWidget* pParent) {
emit changed();
});

return pCheckBox;
auto pLabelWidget = make_parented<QLabel>(pWidget);
Copy link
Member

Choose a reason for hiding this comment

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

what is this change for?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This change was requried as the QCheckBox built-in label doesn't support rich text. Happy to move that to an other PR is we are happy about the way it looks with rich text (that is the emphasis on button )
image

Copy link
Member

@ywwg ywwg left a comment

Choose a reason for hiding this comment

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

thank you for the regression test! This looks good to me

};

QHash<QString, TrackModel::SortColumnId> ControllerS4MK3SettingTest::COLUMN_MAPPING = {
{"Artist", TrackModel::SortColumnId::Artist},
Copy link
Member

Choose a reason for hiding this comment

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

It is unfortunate that we don't have enum-to-string mapping in the actual code. https://github.com/mixxxdj/mixxx/blob/main/src/library/browse/browsetablemodel.cpp#L60

There is an issue with internationalization, we will need a solution for that too eventually. But for now this is good enough, thank you!

Copy link
Member

Choose a reason for hiding this comment

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

Maybe add a comment to this file that if other controllers want to add the same type of feature they can also use this test? Maybe rename the test to columnid_regression_test.cpp or something like 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.

Done!

@acolombier acolombier force-pushed the chore/add-setting-to-traktor-s4mk3 branch 2 times, most recently from 1237dc3 to 3bf2f62 Compare March 30, 2024 17:49
@acolombier acolombier force-pushed the chore/add-setting-to-traktor-s4mk3 branch from 3bf2f62 to a89e141 Compare March 30, 2024 17:49
@ywwg
Copy link
Member

ywwg commented Mar 30, 2024

As is tradition, can you prepare the manual PR? we have to insist on having both ready to enforce that documentation stays up to date <3

@acolombier
Copy link
Contributor Author

As is tradition, can you prepare the manual PR? we have to insist on having both ready to enforce that documentation stays up to date <3

Already done and waiting for your review :D

@ywwg
Copy link
Member

ywwg commented Mar 31, 2024

merging, and then we'll make sure to merge the manual PR in the right place.

@ywwg ywwg merged commit 9f68007 into mixxxdj:main Mar 31, 2024
13 checks passed
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

2 participants