_sad cat noises_

This commit is contained in:
Baud 2024-05-31 00:33:09 +01:00
parent 8c38320062
commit 5e020c8862
1 changed files with 14 additions and 20 deletions

View File

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