-
-
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
DDJ-200 support for 4 decks #3193
Conversation
Does this PR change anything from the user's perspective? If so, please document that with a PR to the manual repo. |
Everything in the manual is still valid. There are some additional features which I will add to the manual soon. In the meantime the files could already be updated.Am 20.10.2020 17:34 schrieb Jan Holthuis <notifications@github.com>:
Does this PR change anything from the user's perspective? If so, please document that with a PR to the manual repo.
—You are receiving this because you authored the thread.Reply to this email directly, view it on GitHub, or unsubscribe.
|
Without the documentation, we can't review this properly. Also, I think the policy should be to only merge changes if the documentation is ready, too. Otherwise contributors might get busy or lose interest after the merge and we end up with even undocumented or not properly documented controller mappings in the mixxx repo :D |
Ok, I have updated the documentation (the PR is still open) and fixed all issues from CodeFactor. |
Can you post a link? I don't see the PR. |
Sorry, it always goes to your repo. Here is the correct one: mixxxdj/manual#237 |
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.
Thank you. Some first comments.
engine.beginTimer(500, "engine.setValue(\"[Library]\", " + | ||
"\"MoveFocus\", 1);", true); |
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.
Please don't use a string here, pass a function expression.
1: this.vDeck1, 2: _.clone(this.vDeck1), | ||
3: _.clone(this.vDeck1), 4: _.clone(this.vDeck1) |
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 really not a fan of lodash. This is very unreadable IMHO.
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.
What alternative do you suggest?
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.
Something like this maybe?
this.vDeck = {}
for (var i = 1; i <= 4; i++) {
this.vDeck[i] = {
syncEnabled: false,
volMSB: 0,
rateMSB: 0,
jogDisabled: false,
}
}
for (var i = 1; i <= 4; i++) { | ||
var vgroup = "[Channel" + i + "]"; | ||
// run onTrackLoad after every track load to e.g. set LEDs accordingly | ||
engine.connectControl(vgroup, "track_loaded", "DDJ200.onTrackLoad"); |
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.
Please use engine.makeConnection
instead and don't use a string, pass the actual function.
var deckNo = script.deckFromGroup(group); | ||
var vDeckNo = DDJ200.vDeckNo[deckNo]; | ||
var vgroup = "[Channel" + vDeckNo +"]"; | ||
engine.setValue(vgroup, "LoadSelectedTrack", true); |
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.
Use script.triggerControl
here.
engine.beginTimer(900, "DDJ200.vDeck[" + vDeckNo + | ||
"][\"jogDisabled\"] = false;", true); |
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.
use a function expression
if (deckNo === 1) { | ||
// toggle virtual deck of controller deck 1 | ||
DDJ200.vDeckNo[1] = 4 - DDJ200.vDeckNo[1]; | ||
if (DDJ200.vDeckNo[1] === 1) LED = 0; |
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.
missing braces
} else { // deckNo === 2 | ||
// toggle virtual deck of controller deck 2 | ||
DDJ200.vDeckNo[2] = 6 - DDJ200.vDeckNo[2]; | ||
if (DDJ200.vDeckNo[2] === 2) LED = 0; |
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.
missing braces
0x7F * engine.getValue(vgroup, "pfl")); | ||
} | ||
|
||
if (vDeckNo % 2) c = 7; else c = 9; |
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.
missing braces
1: this.vDeck1, 2: _.clone(this.vDeck1), | ||
3: _.clone(this.vDeck1), 4: _.clone(this.vDeck1) |
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.
Something like this maybe?
this.vDeck = {}
for (var i = 1; i <= 4; i++) {
this.vDeck[i] = {
syncEnabled: false,
volMSB: 0,
rateMSB: 0,
jogDisabled: false,
}
}
var vgroup = "[Channel" + vDeckNo +"]"; | ||
var pfl = ! engine.getValue(vgroup, "pfl"); | ||
engine.setValue(vgroup, "pfl", pfl); | ||
if (DDJ200.fourDeckMode === false) { |
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.
if (DDJ200.fourDeckMode === false) { | |
if (!DDJ200.fourDeckMode) { |
|
||
DDJ200.switchLEDs = function(vDeckNo) { | ||
// set LEDs of controller deck according to virtual deck | ||
var c = 1; if (vDeckNo % 2) c = 0; |
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.
missing braces and multiple statements on the same line. Also, please use more meaningful variable names, e.g.: channelOffset
or something like 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 have don't the changes you requested
Co-authored-by: Jan Holthuis <holthuis.jan@googlemail.com>
Co-authored-by: Jan Holthuis <holthuis.jan@googlemail.com>
Co-authored-by: Jan Holthuis <holthuis.jan@googlemail.com>
Co-authored-by: Jan Holthuis <holthuis.jan@googlemail.com>
Co-authored-by: Jan Holthuis <holthuis.jan@googlemail.com>
Co-authored-by: Jan Holthuis <holthuis.jan@googlemail.com>
Co-authored-by: Jan Holthuis <holthuis.jan@googlemail.com>
Co-authored-by: Jan Holthuis <holthuis.jan@googlemail.com>
Co-authored-by: Jan Holthuis <holthuis.jan@googlemail.com>
Co-authored-by: Jan Holthuis <holthuis.jan@googlemail.com>
I guess I have to pull the changes from my git repo first and then copy and past the patch in the file (since I don't see a save option). |
Unfortunately after the above: |
Are you sure you're in the correct branch? |
Maybe it's a copy and paste issue. Here's a file you can download and use for |
Maybe. Thank you. |
I am also wondering what is the best way to keep my github repo up to date? |
Why would you need to keep your GitHub repo up-to-date? I just have configured an
When you start a new branch, just fetch the latest changes from the remote and start a new branch from there:
You only need to push your branch, there's no reason to update other branches:
|
Aright. Thanks! |
Unfortunately the indentation doesn't conform to our style rules yet, here's another patch: |
Oh no, what are your style rules called? Is it not Javascript? |
How did you detect these issues? My pre-commit hook did not complain. |
This branch is based on 2.2, but the pre-commit hooks only exist on 2.3 and onwards. I just merged this branch into 2.3 locally and ran the pre-commit hooks there, and used |
Should I write a bug report that the Mixxx style rules do not comply with JS conventions? |
What do you mean? Because we don't use hanging indents? |
Yes, I thought it was a rule, but apparently its not... |
Co-authored-by: Jan Holthuis <holthuis.jan@googlemail.com>
Co-authored-by: Jan Holthuis <holthuis.jan@googlemail.com>
Co-authored-by: Jan Holthuis <holthuis.jan@googlemail.com>
Co-authored-by: Jan Holthuis <holthuis.jan@googlemail.com>
Co-authored-by: Jan Holthuis <holthuis.jan@googlemail.com>
Co-authored-by: Jan Holthuis <holthuis.jan@googlemail.com>
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.
Just a minor comment, otherwise LGTM.
Co-authored-by: Jan Holthuis <holthuis.jan@googlemail.com>
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.
Thank you, LGTM.
Thank you! |
No description provided.