Skip to content

Commit

Permalink
Make sure all LEDs on SMC-Mixer go off on shutdown
Browse files Browse the repository at this point in the history
Signed-off-by: Sam Whited <[email protected]>
  • Loading branch information
SamWhited committed Mar 9, 2025
1 parent 6a856ec commit 24338b5
Showing 1 changed file with 14 additions and 12 deletions.
26 changes: 14 additions & 12 deletions res/controllers/MVave-SMC-Mixer-scripts.js
Original file line number Diff line number Diff line change
Expand Up @@ -130,40 +130,42 @@ var SMCMixer;
}
}

class EqRack {
class EqRack extends components.ComponentContainer {
constructor(index) {
super(undefined);
const channel = mapIndexToChannel(index);
this.knob = new Encoder({
group: `[Channel${channel}]`,
midi: [0xB0, 0x10 + index],
inKey: "pregain",
});

const _this = this;
const btnInToggle = () => {
const knob = this.knob;
const origGroup = this.knob.group;
const origInKey = this.knob.inKey;
const knob = _this.knob;
const origGroup = _this.knob.group;
const origInKey = _this.knob.inKey;
return function() {
if (this.isLongPressed) {
if (knob.inKey === this.inKey.replace("button_", "") || (this.inKey === "enabled" && this.knob.inKey === "super1")) {
if (_this.isLongPressed) {
if (knob.inKey === _this.inKey.replace("button_", "") || (_this.inKey === "enabled" && _this.knob.inKey === "super1")) {
knob.group = origGroup;
knob.inKey = origInKey;
} else {
knob.group = this.group;
knob.group = _this.group;
let newKey = "";
if (this.key === "enabled") {
if (_this.key === "enabled") {
newKey = "super1";
} else {
newKey = this.inKey.replace("button_", "");
newKey = _this.inKey.replace("button_", "");
}
knob.inKey = newKey;
}
} else {
const val = this.inGetParameter();
const val = _this.inGetParameter();
if (val > 0) {
this.inSetValue(0);
_this.inSetValue(0);
} else {
this.inSetValue(0x1F);
_this.inSetValue(0x1F);
}
}
};
Expand Down

0 comments on commit 24338b5

Please sign in to comment.