use cps instead of bpm

This commit is contained in:
Jade Rowland
2023-09-30 22:18:31 -04:00
parent fe8c4e2bcd
commit d5c6cb85ea
2 changed files with 27 additions and 16 deletions
+7 -7
View File
@@ -13,12 +13,12 @@ export class CyclistBridge extends Cyclist {
if (payload == null) {
return;
}
const { play, bpm, timestamp } = payload;
const { started, cps, timestamp } = payload;
// (if bpm !== prev_bpm) {
//update the clock
// }
if (this.started !== play && play != null) {
if (play) {
if (this.started !== started && started != null) {
if (started) {
this.start_timer = window.setTimeout(() => {
logger('[cyclist] start');
this.clock.start();
@@ -39,8 +39,8 @@ export class CyclistBridge extends Cyclist {
}
const linkmsg = {
bpm: 110,
play: true,
cps: 0.5,
started: true,
timestamp: Date.now(),
};
Invoke('sendabelinkmsg', { linkmsg });
@@ -52,8 +52,8 @@ export class CyclistBridge extends Cyclist {
this.lastEnd = 0;
this.setStarted(false);
const linkmsg = {
bpm: 110,
play: false,
cps: 0.5,
started: false,
timestamp: Date.now(),
};
Invoke('sendabelinkmsg', { linkmsg });