Skip to content

Commit

Permalink
feat(ndi): adds NDI support via electron-builder (#522)
Browse files Browse the repository at this point in the history
* feat(ndi): adds NDI support via electron-builder

Adds back NDI support with electron-builder 22.9.1. Fixes texture control. Increases discovery
timeout. Adds strictVerify: false for macOS builds.

fixes #413

* fix(ndi): Enforce electron-builder in 22.9.1 also for vue-cli

* feat(ndi): adds countdown and correct buttons to NDI UI

* fix(ndi): fixes timer overlap when sources are found early

Co-authored-by: Tim Pietrusky <timpietrusky@gmail.com>
  • Loading branch information
2xAA and TimPietrusky authored Jan 9, 2021
1 parent 8d10241 commit 6defe08
Show file tree
Hide file tree
Showing 8 changed files with 226 additions and 297 deletions.
6 changes: 5 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@
"fluent-ffmpeg": "^2.1.2",
"font-list": "^1.2.11",
"fuse.js": "^6.2.1",
"grandiose": "github:vcync/grandiose#feat/workerCompatibility",
"golden-layout": "^1.5.9",
"interactive-shader-format": "github:vcync/interactive-shader-format-js#feat/ImageBitmap",
"lfo-for-modv": "0.0.1",
Expand Down Expand Up @@ -71,7 +72,7 @@
"@vue/eslint-config-prettier": "^4.0.1",
"babel-eslint": "^10.0.3",
"electron": "^7.1.2",
"electron-builder": "^22.7.0",
"electron-builder": "^22.9.1",
"electron-notarize": "^1.0.0",
"eslint": "^5.16.0",
"eslint-plugin-no-for-each": "^0.1.14",
Expand All @@ -94,5 +95,8 @@
"vue-cli-service lint",
"git add"
]
},
"resolutions": {
"electron-builder": "22.9.1"
}
}
8 changes: 4 additions & 4 deletions src/App.vue
Original file line number Diff line number Diff line change
Expand Up @@ -62,9 +62,9 @@
<gl-component title="BPM" :closable="false">
<BPMConfig />
</gl-component>
<!-- <gl-component title="NDI" :closable="false">
<gl-component title="NDI" :closable="false">
<NDIConfig />
</gl-component> -->
</gl-component>
</gl-stack>
</gl-stack>

Expand All @@ -90,7 +90,7 @@ import InputConfig from "@/components/InputConfig";
import AudioVideoDeviceConfig from "@/components/InputDeviceConfig/AudioVideo.vue";
import MIDIDeviceConfig from "@/components/InputDeviceConfig/MIDI.vue";
import BPMConfig from "@/components/InputDeviceConfig/BPM.vue";
// import NDIConfig from "@/components/InputDeviceConfig/NDI.vue";
import NDIConfig from "@/components/InputDeviceConfig/NDI.vue";
import StatusBar from "@/components/StatusBar";
import ModuleInspector from "@/components/ModuleInspector";
import InfoView from "@/components/InfoView";
Expand All @@ -113,7 +113,7 @@ export default {
AudioVideoDeviceConfig,
MIDIDeviceConfig,
BPMConfig,
// NDIConfig,
NDIConfig,
StatusBar,
InfoView,
ModuleInspector,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ __dirname = __dirname.replace("/node_modules/grandiose", "");

const state = {
discovering: false,
timeout: 30 * 1000,

receivers: {
// "receiver-uuidv4": {
Expand Down Expand Up @@ -94,7 +95,10 @@ const actions = {
commit("SET_DISCOVERING", true);

try {
const sources = await grandiose.find(state.discoveryOptions);
const sources = await grandiose.find(
state.discoveryOptions,
state.timeout
);
commit("SET_SOURCES", sources);
} catch (e) {
console.log(e);
Expand Down
14 changes: 9 additions & 5 deletions src/components/Control.vue
Original file line number Diff line number Diff line change
Expand Up @@ -97,11 +97,15 @@ export default {
async queueLoop() {
const { id, prop, queued } = this;
await this.$modV.store.dispatch("modules/updateProp", {
moduleId: id,
prop,
data: queued
});
try {
await this.$modV.store.dispatch("modules/updateProp", {
moduleId: id,
prop,
data: queued
});
} catch (e) {
console.error(e.message);
}
this.queued = null;
this.dirty = false;
Expand Down
4 changes: 4 additions & 0 deletions src/components/Controls/TextureControl.vue
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,10 @@ export default {
}
if (type === "canvas") {
if (!this.modelCanvasId) {
return;
}
textureDefinition.options.id = this.modelCanvasId;
}
Expand Down
44 changes: 35 additions & 9 deletions src/components/InputDeviceConfig/NDI.vue
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,11 @@
<grid columns="4" class="device-config">
<c span="3">Available NDI Sources</c>
<c span="1"
><button @click="discover" :disabled="discovering">
{{ discovering ? "Discovering…" : "Discover Sources" }}
</button></c
><Button class="light" @click="discover" :disabled="discovering">
{{
discovering ? `Discovering… (${timeRemaining})` : "Discover Sources"
}}
</Button></c
>
<c
span="1.."
Expand All @@ -22,7 +24,11 @@
>
<grid columns="4">
<c span="3">{{ source.name }}</c>
<c><button @click="recieve(source)">Recieve source</button></c>
<c
><Button class="light" @click="recieve(source)"
>Recieve source</Button
></c
>
</grid>
</c>
</grid>
Expand All @@ -41,14 +47,14 @@
<grid columns="4">
<c span="2">{{ receiver.receiver.source.name }}</c>
<c
><button @click="toggleReceiver(receiver)">
><Button class="light" @click="toggleReceiver(receiver)">
{{ receiver.enabled ? "Disable" : "Enable" }}
</button></c
</Button></c
>
<c
><button @click="removeReceiver(receiver)">
><Button class="light" @click="removeReceiver(receiver)">
Remove receiver
</button></c
</Button></c
>
</grid>
</c>
Expand All @@ -62,7 +68,10 @@ export default {
return {
iVTitle: "NDI Input Config",
iVBody:
"Configure your NDI inputs here. Click Discover Sources to search for NDI sources available on your network. Click Enable to create an NDI reciever so modV can consume the NDI source. Once a receiver has been created, click Remove Receiver to stop modV consuming the NDI source."
"Configure your NDI inputs here. Click Discover Sources to search for NDI sources available on your network. Click Enable to create an NDI reciever so modV can consume the NDI source. Once a receiver has been created, click Remove Receiver to stop modV consuming the NDI source.",
timeRemaining: 0,
timer: null
};
},
Expand All @@ -83,6 +92,15 @@ export default {
methods: {
discover() {
this.$modV.store.dispatch("ndi/discoverSources");
this.timeRemaining = this.$modV.store.state.ndi.timeout / 1000;
this.timer = setInterval(() => {
this.timeRemaining -= 1;
if (this.timeRemaining < 1) {
clearInterval(this.timer);
}
}, 1000);
},
recieve(source) {
Expand All @@ -106,6 +124,14 @@ export default {
receiverId: receiver.id
});
}
},
watch: {
discovering(value) {
if (!value) {
clearInterval(this.timer);
}
}
}
};
</script>
Expand Down
2 changes: 2 additions & 0 deletions vue.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,8 @@ module.exports = {
mac: {
// See https://developer.apple.com/documentation/security/hardened_runtime
hardenedRuntime: true,
// See https://github.com/vcync/modV/issues/413
strictVerify: false,
gatekeeperAssess: false,
entitlements: "build/entitlements.mac.plist",
entitlementsInherit: "build/entitlements.mac.plist",
Expand Down
Loading

0 comments on commit 6defe08

Please sign in to comment.