Skip to content

Commit

Permalink
Added placeholders for CC resets.
Browse files Browse the repository at this point in the history
  • Loading branch information
PoneyClairDeLune committed Oct 7, 2024
1 parent d7a57ba commit 96409ec
Showing 1 changed file with 21 additions and 9 deletions.
30 changes: 21 additions & 9 deletions src/state/index.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -1340,20 +1340,21 @@ let OctaviaDevice = class extends CustomEventSource {
}; */
return result;
};
setCcCh(part, cc, value, emitEvent = false) {
setCcCh(part = 0, cc, value) {
let upThis = this;
if (ccAccepted.indexOf(cc) < 0) {
throw(new Error("CC number not accepted"));
};
let data = value & 255;
upThis.#cc[ccOffTable[channel] + ccToPos[cc]] = data;
if (emitEvent) {
upThis.dispatchEvent("cc", {
part,
cc: targetCc,
data
});
if (value?.constructor != Number) {
throw(new TypeError("Expected numbers for value"));
};
let data = value & 255;
upThis.#cc[ccOffTable[part] + ccToPos[cc]] = data;
upThis.dispatchEvent("cc", {
part,
cc: targetCc,
data
});
};
getCcAll() {
// Return all CC registers
Expand All @@ -1369,6 +1370,17 @@ let OctaviaDevice = class extends CustomEventSource {
}; */
return arr;
};
resetCc(part) {
// Placeholder until CC write state is ready
};
resetCcCh(part, cc) {
return;
// Placeholder until CC write state is ready
};
resetCcAll() {
return;
// Placeholder until CC write state is ready
};
getChSource() {
return this.#chReceive;
};
Expand Down

0 comments on commit 96409ec

Please sign in to comment.