_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, hyperdeckId: message.id,
state: transportInfo.status, state: transportInfo.status,
}) })
}) }).catch(() => {})
}) }, 1000)
newHyperdeck.sendCommand(new Commands.DeviceInfoCommand()).then((info) => { let connected = false;
for (let index = 0; index < info.slots; index++) { while (!connected) {
setInterval(() => { try {
newHyperdeck.sendCommand(new Commands.SlotInfoCommand(index)).then((slot) => { newHyperdeck.sendCommand(new Commands.DeviceInfoCommand()).then((info) => {
notifyClients({ for (let index = 0; index < info.slots; index++) {
event: "record_time_remaining", setInterval(() => {
hyperdeckId: message.id, newHyperdeck.sendCommand(new Commands.SlotInfoCommand(index)).then((slot) => {
slotId: slot.slotId, notifyClients({
remaining: slot.recordingTime 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) { newHyperdeck.on('notify.slot', function (slot) {