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

Don't return in JogWheelBasic on deck absent in option #13425

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

christophehenry
Copy link
Contributor

This allows late binding of JogWheelBasic using ComponentContainer.reconnectComponents and Deck.setCurrentDeck.

Copy link
Member

@Swiftb0y Swiftb0y left a comment

Choose a reason for hiding this comment

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

can you show me some sample code where this late binding is useful/needed?

isPress: Button.prototype.isPress,
inValueScale: function(value) {
// default implementation for converting signed ints
return value < 0x40 ? value : value - (this.max + 1);
},
inputWheel: function(_channel, _control, value, _status, _group) {
if (!this.hasDeckNumber) {
console.warn("bad deck number; ignoring inputWheel()");
Copy link
Member

Choose a reason for hiding this comment

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

now this should actually return now, imo. same below.

Comment on lines 766 to 768
get hasDeckNumber() {
return Number.isInteger(this.deck) && this.deck > 0;
},
Copy link
Member

Choose a reason for hiding this comment

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

we haven't used js getters until now. have you made sure this works? I'm not confident the Object merging logic handles getters and setters correctly.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

You're right. I had to use Object.defineProperties instead.

@christophehenry christophehenry force-pushed the dont-return-on-no-deck-JogWheelBasic branch from ff36f45 to 2356bb8 Compare June 30, 2024 20:22
@christophehenry
Copy link
Contributor Author

can you show me some sample code where this late binding is useful/needed?

The current DN-S3700 controller I use retrieves its deck number from the deck's settings with a sysex message.

Maybe there's another way but this is how it works right now. Plus, no other component requires an options parameter during instanciation. They just check these are set so there's an inconsistancy here.

Comment on lines 763 to 765
get group() {
return self._deck;
},
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
get group() {
return self._deck;
},
get group() {
return self._group;
},

@Swiftb0y
Copy link
Member

Swiftb0y commented Jul 1, 2024

The current DN-S3700 controller I use retrieves its deck number from the deck's settings with a sysex message.

Thats a very valid argument. Thanks.

Component.prototype.connect.call(this);
this.deck = parseInt(script.channelRegEx.exec(this.group)[1]);
}
reset() {},
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 method is just there to allow cleaning when the deck has changed (for instance, stop a motorized jog).

@christophehenry
Copy link
Contributor Author

christophehenry commented Jul 8, 2024

So ControllerScriptEngineLegacyTest.commonScriptHasNoErrors has errors but there's a problem here: this should not segfault. I also met this problem yesterday on Mixxx 2.4.0 while working on my controller. Is it a known bug?

@christophehenry christophehenry force-pushed the dont-return-on-no-deck-JogWheelBasic branch 3 times, most recently from e94a366 to 38bbfc7 Compare July 8, 2024 08:47
@christophehenry christophehenry force-pushed the dont-return-on-no-deck-JogWheelBasic branch from 38bbfc7 to 7f739ac Compare July 8, 2024 08:56
@Swiftb0y
Copy link
Member

Swiftb0y commented Jul 8, 2024

I don't think so. The segfault is definitely weird. Can you collect a backtrace?

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