Skip to content

Commit

Permalink
midi-components-0.1: reorder comparision with constants to be consistent
Browse files Browse the repository at this point in the history
  • Loading branch information
Swiftb0y committed Dec 5, 2021
1 parent 762775b commit bb47432
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions res/controllers/midi-components-0.1.js
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@
}
}
}
// default attributes
// default methods
// You should probably overwrite at least some of these.
inValueScale(value) {
// Hack to get exact center of pots to return 0.5
Expand Down Expand Up @@ -112,9 +112,9 @@
different color depending on the state of different Mixxx COs. Refer to
SamplerButton.connect() and SamplerButton.output() for an example.
**/
if (undefined !== this.group &&
undefined !== this.outKey &&
undefined !== this.output &&
if (this.group !== undefined &&
this.outKey !== undefined &&
this.output !== undefined &&
typeof this.output === "function") {
this.connections[0] = engine.makeConnection(this.group, this.outKey, this.output.bind(this));
}
Expand All @@ -125,6 +125,7 @@
}
}
trigger() {

for (const conn of this.connections) {
conn.trigger();
}
Expand Down Expand Up @@ -338,7 +339,7 @@
}
connect() {
super.connect();
if (undefined !== this.group && this.colorKey !== undefined) {
if (this.group !== undefined && this.colorKey !== undefined) {
// TODO (Swiftb0y): replace with arrow function once https://bugreports.qt.io/browse/QTBUG-95677 got fixed
this.connections[1] = engine.makeConnection(this.group, this.colorKey, function(color) {
if (engine.getValue(this.group, this.outKey)) {
Expand Down

0 comments on commit bb47432

Please sign in to comment.