_hisses in exasperation_

This commit is contained in:
Baud 2024-05-31 00:28:41 +01:00
parent cbb2c64bf6
commit 8c38320062
1 changed files with 21 additions and 15 deletions

View File

@ -90,23 +90,29 @@ function handle_message(message: Partial<WebSocketMessage>) {
hyperdeckId: message.id,
state: transportInfo.status,
})
})
})
}).catch(() => {})
}, 1000)
newHyperdeck.sendCommand(new Commands.DeviceInfoCommand()).then((info) => {
for (let index = 0; index < info.slots; index++) {
setInterval(() => {
newHyperdeck.sendCommand(new Commands.SlotInfoCommand(index)).then((slot) => {
notifyClients({
event: "record_time_remaining",
hyperdeckId: message.id,
slotId: slot.slotId,
remaining: slot.recordingTime
})
})
let connected = false;
while (!connected) {
try {
newHyperdeck.sendCommand(new Commands.DeviceInfoCommand()).then((info) => {
for (let index = 0; index < info.slots; index++) {
setInterval(() => {
newHyperdeck.sendCommand(new Commands.SlotInfoCommand(index)).then((slot) => {
notifyClients({
event: "record_time_remaining",
hyperdeckId: message.id,
slotId: slot.slotId,
remaining: slot.recordingTime
})
}).catch(() => {})
}, 1000)
connected = true;
}
})
}
})
} catch (_err) {}
}
})
newHyperdeck.on('notify.slot', function (slot) {