Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 8 additions & 8 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,17 +9,17 @@
"author": "",
"license": "ISC",
"dependencies": {
"applest-atem": "^0.1.2",
"body-parser": "^1.13.2",
"express": "^4.13.1"
"applest-atem": "^0.2.4",
"body-parser": "^1.18.2",
"express": "^4.16.1"
},
"devDependencies": {
"coffee-script": "^1.9.3",
"coffeescript": "^1.9.3",
"gulp": "^3.9.0",
"gulp-coffee": "^2.3.1",
"gulp-notify": "^2.2.0",
"gulp-coffee": "^3.0.2",
"gulp-notify": "^3.2.0",
"gulp-plumber": "^1.0.1",
"gulp-sass": "^2.0.4",
"gulp-watch": "^4.3.3"
"gulp-sass": "^4.0.0",
"gulp-watch": "^5.0.0"
}
}
50 changes: 42 additions & 8 deletions public/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -111,10 +111,10 @@
<div class="button float-left"
ng-click="cutTransition()">Cut</div>
<div class="button float-left"
ng-class="{red: state[0].video.transitionPosition != 0}"
ng-class="{red: state[0].video.ME[0].transitionPosition != 0}"
ng-click="autoTransition()">Auto</div>
<div class="button float-left"
ng-class="{red: state[0].video.transitionPreview != 0}"
ng-class="{red: state[0].video.ME[0].transitionPreview != 0}"
ng-click="changeTransitionPreview()">PREV</div>
<div class="sliders float-left" style="margin-left: 50px;">
<div class="slider"></div>
Expand All @@ -127,13 +127,13 @@
</div>
<div class="channels after-clear">
<div class="button float-left"
ng-class="{yellow: state[0].video.transitionStyle == 0}"
ng-class="{yellow: state[0].video.ME[0].transitionStyle == 0}"
ng-click="changeTransitionType(0)">MIX</div>
<div class="button float-left"
ng-class="{yellow: state[0].video.transitionStyle == 1}"
ng-class="{yellow: state[0].video.ME[0].transitionStyle == 1}"
ng-click="changeTransitionType(1)">DIP</div>
<div class="button float-left"
ng-class="{yellow: state[0].video.transitionStyle == 2}"
ng-class="{yellow: state[0].video.ME[0].transitionStyle == 2}"
ng-click="changeTransitionType(2)">WIPE</div>
</div>
</div>
Expand All @@ -144,16 +144,50 @@
</div>
<div class="channels after-clear">
<div class="button float-left"
ng-class="{yellow: state[0].video.upstreamKeyNextBackground}"
ng-class="{yellow: state[0].video.ME[0].upstreamKeyNextBackground}"
ng-click="toggleUpstreamKeyNextBackground()">BKGD</div>
<div class="button float-left"
ng-class="{yellow: state[0].video.upstreamKeyNextState[0]}"
ng-class="{yellow: state[0].video.ME[0].upstreamKeyNextState[0]}"
ng-click="toggleUpstreamKeyNextState(0)">KEY1</div>
<div class="button float-left"
ng-class="{red: state[0].video.upstreamKeyState[0]}"
ng-class="{red: state[0].video.ME[0].upstreamKeyState[0]}"
ng-click="toggleUpstreamKeyState(0)">ONAIR</div>
</div>
</div>

<div class="inline">
<div class="section">
Downstream Key 1
</div>
<div class="channels after-clear">
<div class="button float-left"
ng-class="{yellow: state[0].video.downstreamKeyTie[0]}"
ng-click="toggleDownstreamKeyTie(0)">TIE</div>
<div class="button float-left"
ng-class="{red: state[0].video.downstreamKeyOn[0]}"
ng-click="toggleDownstreamKeyOn(0)">ONAIR</div>
<div class="button float-left"
ng-class="{red: state[0].video.autoDownstreamKey[0]}"
ng-click="autoDownstreamKey(0)">AUTO</div>
</div>
</div>

<div class="inline">
<div class="section">
Downstream Key 2
</div>
<div class="channels after-clear">
<div class="button float-left"
ng-class="{yellow: state[0].video.downstreamKeyTie[1]}"
ng-click="toggleDownstreamKeyTie(1)">TIE</div>
<div class="button float-left"
ng-class="{red: state[0].video.downstreamKeyOn[1]}"
ng-click="toggleDownstreamKeyOn(1)">ONAIR</div>
<div class="button float-left"
ng-class="{red: state[0].video.autoDownstreamKey[1]}"
ng-click="autoDownstreamKey(1)">AUTO</div>
</div>
</div>
</div>
</td>
</tr>
Expand Down
23 changes: 23 additions & 0 deletions server.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -92,4 +92,27 @@ app.post('/api/changeUpstreamKeyNextState', (req, res) ->
res.send('success')
)

app.post('/api/changeDownstreamKeyOn', (req, res) ->
device = req.body.device
number = req.body.number
state = req.body.state
switchers[device].changeDownstreamKeyOn(number, state)
res.send('success')
)

app.post('/api/changeDownstreamKeyTie', (req, res) ->
device = req.body.device
number = req.body.number
state = req.body.state
switchers[device].changeDownstreamKeyTie(number, state)
res.send('success')
)

app.post('/api/autoDownstreamKey', (req, res) ->
device = req.body.device
number = req.body.number
switchers[device].autoDownstreamKey(number)
res.send('success')
)

app.listen(8080)
39 changes: 25 additions & 14 deletions src/coffee/app.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -14,28 +14,28 @@ angular
return channel if channel.device == device && channel.chainDevice == targetDevice

getParentProgramChannel = ->
findChannel(0, $scope.state[0].video.programInput)
findChannel(0, $scope.state[0].video.ME[0].programInput)

getVirtualProgramChannel = ->
parentProgramChannel = findChannel(0, $scope.state[0].video.programInput)
parentProgramChannel = findChannel(0, $scope.state[0].video.ME[0].programInput)
if parentProgramChannel.chainDevice?
findChannel(parentProgramChannel.chainDevice, $scope.state[parentProgramChannel.chainDevice].video.programInput)
findChannel(parentProgramChannel.chainDevice, $scope.state[parentProgramChannel.chainDevice].video.ME[0].programInput)
else
findChannel(0, $scope.state[0].video.programInput)
findChannel(0, $scope.state[0].video.ME[0].programInput)

getVirtualPreviewChannel = ->
parentProgramChannel = findChannel(0, $scope.state[0].video.programInput)
parentPreviewChannel = findChannel(0, $scope.state[0].video.previewInput)
parentProgramChannel = findChannel(0, $scope.state[0].video.ME[0].programInput)
parentPreviewChannel = findChannel(0, $scope.state[0].video.ME[0].previewInput)
if parentPreviewChannel.chainDevice? && parentProgramChannel.chainDevice == parentPreviewChannel.chainDevice
findChannel(parentPreviewChannel.chainDevice, $scope.state[parentPreviewChannel.chainDevice].video.previewInput)
findChannel(parentPreviewChannel.chainDevice, $scope.state[parentPreviewChannel.chainDevice].video.ME[0].previewInput)
else if parentPreviewChannel.chainDevice?
findChannel(parentPreviewChannel.chainDevice, $scope.state[parentPreviewChannel.chainDevice].video.programInput)
findChannel(parentPreviewChannel.chainDevice, $scope.state[parentPreviewChannel.chainDevice].video.ME[0].programInput)
else
findChannel(0, $scope.state[0].video.previewInput)
findChannel(0, $scope.state[0].video.ME[0].previewInput)

getTransitionDevice = ->
parentProgramChannel = findChannel(0, $scope.state[0].video.programInput)
parentPreviewChannel = findChannel(0, $scope.state[0].video.previewInput)
parentProgramChannel = findChannel(0, $scope.state[0].video.ME[0].programInput)
parentPreviewChannel = findChannel(0, $scope.state[0].video.ME[0].previewInput)
console.log parentProgramChannel, parentPreviewChannel
if parentPreviewChannel.chainDevice? && parentProgramChannel.chainDevice == parentPreviewChannel.chainDevice
parentPreviewChannel.chainDevice
Expand Down Expand Up @@ -84,17 +84,28 @@ angular
$http.post('/api/changeTransitionType', type: type).success(defaultSuccess)

$scope.toggleUpstreamKeyNextBackground = ->
state = !$scope.state[0].video.upstreamKeyNextBackground
state = !$scope.state[0].video.ME[0].upstreamKeyNextBackground
$http.post('/api/changeUpstreamKeyNextBackground', device: 0, state: state).success(defaultSuccess)

$scope.toggleUpstreamKeyNextState = (number) ->
state = !$scope.state[0].video.upstreamKeyNextState[number]
state = !$scope.state[0].video.ME[0].upstreamKeyNextState[number]
$http.post('/api/changeUpstreamKeyNextState', device: 0, number: number, state: state).success(defaultSuccess)

$scope.toggleUpstreamKeyState = (number) ->
state = !$scope.state[0].video.upstreamKeyState[number]
state = !$scope.state[0].video.ME[0].upstreamKeyState[number]
$http.post('/api/changeUpstreamKeyState', device: 0, number: number, state: state).success(defaultSuccess)

$scope.toggleDownstreamKeyTie = (number) ->
state = !$scope.state[0].video.downstreamKeyTie[number]
$http.post('/api/changeDownstreamKeyTie', device: 0, number: number, state: state).success(defaultSuccess)

$scope.toggleDownstreamKeyOn = (number) ->
state = !$scope.state[0].video.downstreamKeyOn[number]
$http.post('/api/changeDownstreamKeyOn', device: 0, number: number, state: state).success(defaultSuccess)

$scope.autoDownstreamKey = (number) ->
$http.post('/api/autoDownstreamKey', device: 0, number: number).success(defaultSuccess)

registerSlider((err, percent) ->
$scope.changeTransitionPosition(percent);
)
Expand Down