From 079888e8e21451f2e4649688e31858d691282df5 Mon Sep 17 00:00:00 2001 From: Filip Hanes Date: Sun, 22 Jul 2018 18:43:15 +0200 Subject: [PATCH] add downstream keys, update npm dependecies --- package.json | 16 +++++++------- public/index.html | 50 ++++++++++++++++++++++++++++++++++++------- server.coffee | 23 ++++++++++++++++++++ src/coffee/app.coffee | 39 +++++++++++++++++++++------------ 4 files changed, 98 insertions(+), 30 deletions(-) diff --git a/package.json b/package.json index 4988d26..4573ae9 100644 --- a/package.json +++ b/package.json @@ -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" } } diff --git a/public/index.html b/public/index.html index 0c11a05..51988dc 100644 --- a/public/index.html +++ b/public/index.html @@ -111,10 +111,10 @@
Cut
Auto
PREV
@@ -127,13 +127,13 @@
MIX
DIP
WIPE
@@ -144,16 +144,50 @@
BKGD
KEY1
ONAIR
+ +
+
+ Downstream Key 1 +
+
+
TIE
+
ONAIR
+
AUTO
+
+
+ +
+
+ Downstream Key 2 +
+
+
TIE
+
ONAIR
+
AUTO
+
+
diff --git a/server.coffee b/server.coffee index b3db840..eb5e595 100644 --- a/server.coffee +++ b/server.coffee @@ -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) diff --git a/src/coffee/app.coffee b/src/coffee/app.coffee index d281339..f09ba03 100644 --- a/src/coffee/app.coffee +++ b/src/coffee/app.coffee @@ -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 @@ -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); )