diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..1377554 --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +*.swp diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..1377554 --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +*.swp diff --git a/plugin/xsplit_control.html b/plugin/xsplit_control.html new file mode 100644 index 0000000..2c4b91b --- /dev/null +++ b/plugin/xsplit_control.html @@ -0,0 +1,7 @@ + + +
+ + + + diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..1377554 --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +*.swp diff --git a/plugin/xsplit_control.html b/plugin/xsplit_control.html new file mode 100644 index 0000000..2c4b91b --- /dev/null +++ b/plugin/xsplit_control.html @@ -0,0 +1,7 @@ + + +
+ + + + diff --git a/plugin/xsplit_control.js b/plugin/xsplit_control.js new file mode 100644 index 0000000..9227d4e --- /dev/null +++ b/plugin/xsplit_control.js @@ -0,0 +1,49 @@ +xjs = require('xjs'); + +function log(str) +{ + document.getElementById("log").insertAdjacentHTML('beforeend', escapeHTML(str) + "
\n"); +} +function range(to) { return Array(to).fill().map((_, i) => i); } +function escapeHTML(str) +{ + return str.replace(/[&<>'"]/g, + tag => ({ + '&': '&', + '<': '<', + '>': '>', + "'": ''', + '"': '"' + }[tag])); +} + +async function go() +{ + log("Starting"); + await xjs.ready(); + log("Ready"); + + const ws = new WebSocket('ws://localhost:8080'); + + ws.onmessage = msg => + { + const data = JSON.parse(msg.data); + log(JSON.stringify(data)); + } + ws.onopen = async () => + { + log("Socket open"); + + const sceneCount = await xjs.Scene.getSceneCount(); + log(`Scenes: ${sceneCount}`); + + const scenes = await Promise.all(range(sceneCount).map(i => xjs.Scene.getBySceneIndex(i))); + const sceneNames = await Promise.all(scenes.map(s => s.getName())); + + log(sceneNames); + + ws.send(JSON.stringify({scenes: sceneNames})); + } +} + +go(); diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..1377554 --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +*.swp diff --git a/plugin/xsplit_control.html b/plugin/xsplit_control.html new file mode 100644 index 0000000..2c4b91b --- /dev/null +++ b/plugin/xsplit_control.html @@ -0,0 +1,7 @@ + + +
+ + + + diff --git a/plugin/xsplit_control.js b/plugin/xsplit_control.js new file mode 100644 index 0000000..9227d4e --- /dev/null +++ b/plugin/xsplit_control.js @@ -0,0 +1,49 @@ +xjs = require('xjs'); + +function log(str) +{ + document.getElementById("log").insertAdjacentHTML('beforeend', escapeHTML(str) + "
\n"); +} +function range(to) { return Array(to).fill().map((_, i) => i); } +function escapeHTML(str) +{ + return str.replace(/[&<>'"]/g, + tag => ({ + '&': '&', + '<': '<', + '>': '>', + "'": ''', + '"': '"' + }[tag])); +} + +async function go() +{ + log("Starting"); + await xjs.ready(); + log("Ready"); + + const ws = new WebSocket('ws://localhost:8080'); + + ws.onmessage = msg => + { + const data = JSON.parse(msg.data); + log(JSON.stringify(data)); + } + ws.onopen = async () => + { + log("Socket open"); + + const sceneCount = await xjs.Scene.getSceneCount(); + log(`Scenes: ${sceneCount}`); + + const scenes = await Promise.all(range(sceneCount).map(i => xjs.Scene.getBySceneIndex(i))); + const sceneNames = await Promise.all(scenes.map(s => s.getName())); + + log(sceneNames); + + ws.send(JSON.stringify({scenes: sceneNames})); + } +} + +go(); diff --git a/plugin/xsplit_control.xml b/plugin/xsplit_control.xml new file mode 100755 index 0000000..265156f --- /dev/null +++ b/plugin/xsplit_control.xml @@ -0,0 +1 @@ +xsplit_controlxsplit_controlfalsetruetrue1.0.0.0falsefalsetruetruefalsefalsefalsefalse \ No newline at end of file diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..1377554 --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +*.swp diff --git a/plugin/xsplit_control.html b/plugin/xsplit_control.html new file mode 100644 index 0000000..2c4b91b --- /dev/null +++ b/plugin/xsplit_control.html @@ -0,0 +1,7 @@ + + +
+ + + + diff --git a/plugin/xsplit_control.js b/plugin/xsplit_control.js new file mode 100644 index 0000000..9227d4e --- /dev/null +++ b/plugin/xsplit_control.js @@ -0,0 +1,49 @@ +xjs = require('xjs'); + +function log(str) +{ + document.getElementById("log").insertAdjacentHTML('beforeend', escapeHTML(str) + "
\n"); +} +function range(to) { return Array(to).fill().map((_, i) => i); } +function escapeHTML(str) +{ + return str.replace(/[&<>'"]/g, + tag => ({ + '&': '&', + '<': '<', + '>': '>', + "'": ''', + '"': '"' + }[tag])); +} + +async function go() +{ + log("Starting"); + await xjs.ready(); + log("Ready"); + + const ws = new WebSocket('ws://localhost:8080'); + + ws.onmessage = msg => + { + const data = JSON.parse(msg.data); + log(JSON.stringify(data)); + } + ws.onopen = async () => + { + log("Socket open"); + + const sceneCount = await xjs.Scene.getSceneCount(); + log(`Scenes: ${sceneCount}`); + + const scenes = await Promise.all(range(sceneCount).map(i => xjs.Scene.getBySceneIndex(i))); + const sceneNames = await Promise.all(scenes.map(s => s.getName())); + + log(sceneNames); + + ws.send(JSON.stringify({scenes: sceneNames})); + } +} + +go(); diff --git a/plugin/xsplit_control.xml b/plugin/xsplit_control.xml new file mode 100755 index 0000000..265156f --- /dev/null +++ b/plugin/xsplit_control.xml @@ -0,0 +1 @@ +xsplit_controlxsplit_controlfalsetruetrue1.0.0.0falsefalsetruetruefalsefalsefalsefalse \ No newline at end of file diff --git a/server/.gitignore b/server/.gitignore new file mode 100644 index 0000000..3c3629e --- /dev/null +++ b/server/.gitignore @@ -0,0 +1 @@ +node_modules diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..1377554 --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +*.swp diff --git a/plugin/xsplit_control.html b/plugin/xsplit_control.html new file mode 100644 index 0000000..2c4b91b --- /dev/null +++ b/plugin/xsplit_control.html @@ -0,0 +1,7 @@ + + +
+ + + + diff --git a/plugin/xsplit_control.js b/plugin/xsplit_control.js new file mode 100644 index 0000000..9227d4e --- /dev/null +++ b/plugin/xsplit_control.js @@ -0,0 +1,49 @@ +xjs = require('xjs'); + +function log(str) +{ + document.getElementById("log").insertAdjacentHTML('beforeend', escapeHTML(str) + "
\n"); +} +function range(to) { return Array(to).fill().map((_, i) => i); } +function escapeHTML(str) +{ + return str.replace(/[&<>'"]/g, + tag => ({ + '&': '&', + '<': '<', + '>': '>', + "'": ''', + '"': '"' + }[tag])); +} + +async function go() +{ + log("Starting"); + await xjs.ready(); + log("Ready"); + + const ws = new WebSocket('ws://localhost:8080'); + + ws.onmessage = msg => + { + const data = JSON.parse(msg.data); + log(JSON.stringify(data)); + } + ws.onopen = async () => + { + log("Socket open"); + + const sceneCount = await xjs.Scene.getSceneCount(); + log(`Scenes: ${sceneCount}`); + + const scenes = await Promise.all(range(sceneCount).map(i => xjs.Scene.getBySceneIndex(i))); + const sceneNames = await Promise.all(scenes.map(s => s.getName())); + + log(sceneNames); + + ws.send(JSON.stringify({scenes: sceneNames})); + } +} + +go(); diff --git a/plugin/xsplit_control.xml b/plugin/xsplit_control.xml new file mode 100755 index 0000000..265156f --- /dev/null +++ b/plugin/xsplit_control.xml @@ -0,0 +1 @@ +xsplit_controlxsplit_controlfalsetruetrue1.0.0.0falsefalsetruetruefalsefalsefalsefalse \ No newline at end of file diff --git a/server/.gitignore b/server/.gitignore new file mode 100644 index 0000000..3c3629e --- /dev/null +++ b/server/.gitignore @@ -0,0 +1 @@ +node_modules diff --git a/server/index.js b/server/index.js new file mode 100644 index 0000000..66cf531 --- /dev/null +++ b/server/index.js @@ -0,0 +1,9 @@ +const { WebSocketServer } = require('ws'); + +const wss = new WebSocketServer({ port: 8080 }); + +wss.on('connection', ws => + { + ws.send('msg'); + } +); diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..1377554 --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +*.swp diff --git a/plugin/xsplit_control.html b/plugin/xsplit_control.html new file mode 100644 index 0000000..2c4b91b --- /dev/null +++ b/plugin/xsplit_control.html @@ -0,0 +1,7 @@ + + +
+ + + + diff --git a/plugin/xsplit_control.js b/plugin/xsplit_control.js new file mode 100644 index 0000000..9227d4e --- /dev/null +++ b/plugin/xsplit_control.js @@ -0,0 +1,49 @@ +xjs = require('xjs'); + +function log(str) +{ + document.getElementById("log").insertAdjacentHTML('beforeend', escapeHTML(str) + "
\n"); +} +function range(to) { return Array(to).fill().map((_, i) => i); } +function escapeHTML(str) +{ + return str.replace(/[&<>'"]/g, + tag => ({ + '&': '&', + '<': '<', + '>': '>', + "'": ''', + '"': '"' + }[tag])); +} + +async function go() +{ + log("Starting"); + await xjs.ready(); + log("Ready"); + + const ws = new WebSocket('ws://localhost:8080'); + + ws.onmessage = msg => + { + const data = JSON.parse(msg.data); + log(JSON.stringify(data)); + } + ws.onopen = async () => + { + log("Socket open"); + + const sceneCount = await xjs.Scene.getSceneCount(); + log(`Scenes: ${sceneCount}`); + + const scenes = await Promise.all(range(sceneCount).map(i => xjs.Scene.getBySceneIndex(i))); + const sceneNames = await Promise.all(scenes.map(s => s.getName())); + + log(sceneNames); + + ws.send(JSON.stringify({scenes: sceneNames})); + } +} + +go(); diff --git a/plugin/xsplit_control.xml b/plugin/xsplit_control.xml new file mode 100755 index 0000000..265156f --- /dev/null +++ b/plugin/xsplit_control.xml @@ -0,0 +1 @@ +xsplit_controlxsplit_controlfalsetruetrue1.0.0.0falsefalsetruetruefalsefalsefalsefalse \ No newline at end of file diff --git a/server/.gitignore b/server/.gitignore new file mode 100644 index 0000000..3c3629e --- /dev/null +++ b/server/.gitignore @@ -0,0 +1 @@ +node_modules diff --git a/server/index.js b/server/index.js new file mode 100644 index 0000000..66cf531 --- /dev/null +++ b/server/index.js @@ -0,0 +1,9 @@ +const { WebSocketServer } = require('ws'); + +const wss = new WebSocketServer({ port: 8080 }); + +wss.on('connection', ws => + { + ws.send('msg'); + } +); diff --git a/server/package-lock.json b/server/package-lock.json new file mode 100644 index 0000000..858d322 --- /dev/null +++ b/server/package-lock.json @@ -0,0 +1,43 @@ +{ + "name": "server", + "version": "1.0.0", + "lockfileVersion": 2, + "requires": true, + "packages": { + "": { + "version": "1.0.0", + "license": "ISC", + "dependencies": { + "ws": "^8.2.3" + } + }, + "node_modules/ws": { + "version": "8.2.3", + "resolved": "https://registry.npmjs.org/ws/-/ws-8.2.3.tgz", + "integrity": "sha512-wBuoj1BDpC6ZQ1B7DWQBYVLphPWkm8i9Y0/3YdHjHKHiohOJ1ws+3OccDWtH+PoC9DZD5WOTrJvNbWvjS6JWaA==", + "engines": { + "node": ">=10.0.0" + }, + "peerDependencies": { + "bufferutil": "^4.0.1", + "utf-8-validate": "^5.0.2" + }, + "peerDependenciesMeta": { + "bufferutil": { + "optional": true + }, + "utf-8-validate": { + "optional": true + } + } + } + }, + "dependencies": { + "ws": { + "version": "8.2.3", + "resolved": "https://registry.npmjs.org/ws/-/ws-8.2.3.tgz", + "integrity": "sha512-wBuoj1BDpC6ZQ1B7DWQBYVLphPWkm8i9Y0/3YdHjHKHiohOJ1ws+3OccDWtH+PoC9DZD5WOTrJvNbWvjS6JWaA==", + "requires": {} + } + } +} diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..1377554 --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +*.swp diff --git a/plugin/xsplit_control.html b/plugin/xsplit_control.html new file mode 100644 index 0000000..2c4b91b --- /dev/null +++ b/plugin/xsplit_control.html @@ -0,0 +1,7 @@ + + +
+ + + + diff --git a/plugin/xsplit_control.js b/plugin/xsplit_control.js new file mode 100644 index 0000000..9227d4e --- /dev/null +++ b/plugin/xsplit_control.js @@ -0,0 +1,49 @@ +xjs = require('xjs'); + +function log(str) +{ + document.getElementById("log").insertAdjacentHTML('beforeend', escapeHTML(str) + "
\n"); +} +function range(to) { return Array(to).fill().map((_, i) => i); } +function escapeHTML(str) +{ + return str.replace(/[&<>'"]/g, + tag => ({ + '&': '&', + '<': '<', + '>': '>', + "'": ''', + '"': '"' + }[tag])); +} + +async function go() +{ + log("Starting"); + await xjs.ready(); + log("Ready"); + + const ws = new WebSocket('ws://localhost:8080'); + + ws.onmessage = msg => + { + const data = JSON.parse(msg.data); + log(JSON.stringify(data)); + } + ws.onopen = async () => + { + log("Socket open"); + + const sceneCount = await xjs.Scene.getSceneCount(); + log(`Scenes: ${sceneCount}`); + + const scenes = await Promise.all(range(sceneCount).map(i => xjs.Scene.getBySceneIndex(i))); + const sceneNames = await Promise.all(scenes.map(s => s.getName())); + + log(sceneNames); + + ws.send(JSON.stringify({scenes: sceneNames})); + } +} + +go(); diff --git a/plugin/xsplit_control.xml b/plugin/xsplit_control.xml new file mode 100755 index 0000000..265156f --- /dev/null +++ b/plugin/xsplit_control.xml @@ -0,0 +1 @@ +xsplit_controlxsplit_controlfalsetruetrue1.0.0.0falsefalsetruetruefalsefalsefalsefalse \ No newline at end of file diff --git a/server/.gitignore b/server/.gitignore new file mode 100644 index 0000000..3c3629e --- /dev/null +++ b/server/.gitignore @@ -0,0 +1 @@ +node_modules diff --git a/server/index.js b/server/index.js new file mode 100644 index 0000000..66cf531 --- /dev/null +++ b/server/index.js @@ -0,0 +1,9 @@ +const { WebSocketServer } = require('ws'); + +const wss = new WebSocketServer({ port: 8080 }); + +wss.on('connection', ws => + { + ws.send('msg'); + } +); diff --git a/server/package-lock.json b/server/package-lock.json new file mode 100644 index 0000000..858d322 --- /dev/null +++ b/server/package-lock.json @@ -0,0 +1,43 @@ +{ + "name": "server", + "version": "1.0.0", + "lockfileVersion": 2, + "requires": true, + "packages": { + "": { + "version": "1.0.0", + "license": "ISC", + "dependencies": { + "ws": "^8.2.3" + } + }, + "node_modules/ws": { + "version": "8.2.3", + "resolved": "https://registry.npmjs.org/ws/-/ws-8.2.3.tgz", + "integrity": "sha512-wBuoj1BDpC6ZQ1B7DWQBYVLphPWkm8i9Y0/3YdHjHKHiohOJ1ws+3OccDWtH+PoC9DZD5WOTrJvNbWvjS6JWaA==", + "engines": { + "node": ">=10.0.0" + }, + "peerDependencies": { + "bufferutil": "^4.0.1", + "utf-8-validate": "^5.0.2" + }, + "peerDependenciesMeta": { + "bufferutil": { + "optional": true + }, + "utf-8-validate": { + "optional": true + } + } + } + }, + "dependencies": { + "ws": { + "version": "8.2.3", + "resolved": "https://registry.npmjs.org/ws/-/ws-8.2.3.tgz", + "integrity": "sha512-wBuoj1BDpC6ZQ1B7DWQBYVLphPWkm8i9Y0/3YdHjHKHiohOJ1ws+3OccDWtH+PoC9DZD5WOTrJvNbWvjS6JWaA==", + "requires": {} + } + } +} diff --git a/server/package.json b/server/package.json new file mode 100644 index 0000000..145019e --- /dev/null +++ b/server/package.json @@ -0,0 +1,14 @@ +{ + "name": "server", + "version": "1.0.0", + "description": "", + "main": "index.js", + "scripts": { + "test": "echo \"Error: no test specified\" && exit 1" + }, + "author": "", + "license": "ISC", + "dependencies": { + "ws": "^8.2.3" + } +}