Skip to content
This repository has been archived by the owner on Jan 19, 2022. It is now read-only.

Commit

Permalink
Merge pull request #49 from nrkno/feature/hyperdeck-formatting
Browse files Browse the repository at this point in the history
feat: HyperDeck disk formatting
  • Loading branch information
nytamin authored Aug 22, 2019
2 parents 94a5ae4 + 7fd971f commit 6fa5cef
Showing 1 changed file with 19 additions and 1 deletion.
20 changes: 19 additions & 1 deletion src/coreHandler.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,8 @@ import * as cp from 'child_process'
import {
DeviceType,
CasparCGDevice,
DeviceContainer
DeviceContainer,
HyperdeckDevice
} from 'timeline-state-resolver'

import * as _ from 'underscore'
Expand Down Expand Up @@ -431,6 +432,14 @@ export class CoreHandler {

return device.restartCasparCG()
}
formatHyperdeck (deviceId: string): void {
if (!this._tsrHandler) throw new Error('TSRHandler is not initialized')

let device = this._tsrHandler.tsr.getDevice(deviceId).device as ThreadedClass<HyperdeckDevice>
if (!device) throw new Error(`TSR Device "${deviceId}" not found!`)

device.formatDisks()
}
updateCoreStatus (): Promise<any> {
let statusCode = P.StatusCode.GOOD
let messages: Array<string> = []
Expand Down Expand Up @@ -613,4 +622,13 @@ export class CoreTSRDeviceHandler {
return Promise.reject('device.restartCasparCG not set')
}
}
formatHyperdeck (): Promise<any> {
let device = this._device.device as ThreadedClass<HyperdeckDevice>
if (device.formatDisks) {
device.formatDisks()
return Promise.resolve()
} else {
return Promise.reject('device.formatHyperdeck not set')
}
}
}

0 comments on commit 6fa5cef

Please sign in to comment.