@ircam/comote-helpers 1.0.1 → 1.0.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +9 -0
- package/package.json +4 -1
- package/.babelrc +0 -5
- package/.github/workflows/main.yml +0 -45
- package/.history/.gitignore_20250415160643 +0 -6
- package/.history/.gitignore_20250415160723 +0 -6
- package/.history/examples/simple-webview/package-lock_20250415130242.json +0 -5109
- package/.history/examples/simple-webview/package-lock_20250416103557.json +0 -5109
- package/.history/examples/simple-webview/package_20250415130704.json +0 -26
- package/.history/examples/simple-webview/package_20250415184837.json +0 -26
- package/.history/examples/simple-webview/package_20250415190300.json +0 -23
- package/.history/examples/simple-webview/src/server_20250415105733.js +0 -20
- package/.history/examples/simple-webview/src/server_20250415184604.js +0 -20
- package/.history/examples/soundworks/package_20250415132431.json +0 -35
- package/.history/examples/soundworks/package_20250416105956.json +0 -35
- package/.history/max/CoMote/examples/simple-webview/package_20250415184836.json +0 -26
- package/.history/max/CoMote/examples/simple-webview/package_20250415185949.json +0 -23
- package/.history/max/CoMote/examples/simple-webview/package_20250415185950.json +0 -23
- package/.history/max/CoMote/package-info_20241018173608.json +0 -41
- package/.history/max/CoMote/package-info_20250416105743.json +0 -27
- package/.history/max/CoMote/package-info_20250416105826.json +0 -27
- package/.history/max/CoMote/source/comote-connect/package_20250415132759.json +0 -19
- package/.history/max/CoMote/source/comote-connect/package_20250416110158.json +0 -19
- package/.history/max/CoMote/source/comote-connect/server_20250414175059.js +0 -193
- package/.history/max/CoMote/source/comote-connect/server_20250415180549.js +0 -193
- package/.history/package_20250415143437.json +0 -26
- package/.history/package_20250416105907.json +0 -26
- package/examples/simple-webview/README.md +0 -10
- package/examples/simple-webview/build/comote-simple-webview-server.js +0 -44
- package/examples/simple-webview/package-lock.json +0 -5109
- package/examples/simple-webview/package.json +0 -23
- package/examples/simple-webview/public/favicon.ico +0 -0
- package/examples/simple-webview/public/index.html +0 -13
- package/examples/simple-webview/public/index.mjs +0 -3623
- package/examples/simple-webview/public/styles.css +0 -99
- package/examples/simple-webview/src/client.js +0 -35
- package/examples/simple-webview/src/server.js +0 -20
- package/examples/soundworks/.build/clients/components/sw-audit.js +0 -64
- package/examples/soundworks/.build/clients/components/sw-audit.js.map +0 -1
- package/examples/soundworks/.build/clients/components/sw-credits.js +0 -73
- package/examples/soundworks/.build/clients/components/sw-credits.js.map +0 -1
- package/examples/soundworks/.build/clients/player/.editorbackup/PlayerExperience.js~ +0 -131
- package/examples/soundworks/.build/clients/player/index.js +0 -116
- package/examples/soundworks/.build/clients/player/index.js.map +0 -1
- package/examples/soundworks/.build/clients/styles/app.scss +0 -79
- package/examples/soundworks/.build/clients/styles/normalize.scss +0 -359
- package/examples/soundworks/.build/clients/webview/index.js +0 -72
- package/examples/soundworks/.build/clients/webview/index.js.map +0 -1
- package/examples/soundworks/.build/public/css/app.css +0 -76
- package/examples/soundworks/.build/public/css/app.css.map +0 -1
- package/examples/soundworks/.build/public/css/normalize.css +0 -321
- package/examples/soundworks/.build/public/css/normalize.css.map +0 -1
- package/examples/soundworks/.build/public/player.js +0 -98098
- package/examples/soundworks/.build/public/player.js.map +0 -1
- package/examples/soundworks/.build/public/webview.js +0 -50725
- package/examples/soundworks/.build/public/webview.js.map +0 -1
- package/examples/soundworks/.build/server/index.js +0 -57
- package/examples/soundworks/.build/server/index.js.map +0 -1
- package/examples/soundworks/.build/server/schemas/.gitkeep +0 -1
- package/examples/soundworks/.build/server/schemas/global.js +0 -19
- package/examples/soundworks/.build/server/schemas/global.js.map +0 -1
- package/examples/soundworks/.build/server/tmpl/default.tmpl +0 -27
- package/examples/soundworks/.build/utils/catch-unhandled-errors.js +0 -9
- package/examples/soundworks/.build/utils/catch-unhandled-errors.js.map +0 -1
- package/examples/soundworks/.editorconfig +0 -12
- package/examples/soundworks/.eslintrc +0 -3
- package/examples/soundworks/.soundworks +0 -7
- package/examples/soundworks/.vendors/public/webcomponentsjs/CHANGELOG.md +0 -76
- package/examples/soundworks/.vendors/public/webcomponentsjs/LICENSE.md +0 -19
- package/examples/soundworks/.vendors/public/webcomponentsjs/README.md +0 -259
- package/examples/soundworks/.vendors/public/webcomponentsjs/bundles/webcomponents-ce.js +0 -63
- package/examples/soundworks/.vendors/public/webcomponentsjs/bundles/webcomponents-ce.js.map +0 -1
- package/examples/soundworks/.vendors/public/webcomponentsjs/bundles/webcomponents-pf_dom.js +0 -62
- package/examples/soundworks/.vendors/public/webcomponentsjs/bundles/webcomponents-pf_dom.js.map +0 -1
- package/examples/soundworks/.vendors/public/webcomponentsjs/bundles/webcomponents-pf_js.js +0 -95
- package/examples/soundworks/.vendors/public/webcomponentsjs/bundles/webcomponents-pf_js.js.map +0 -1
- package/examples/soundworks/.vendors/public/webcomponentsjs/bundles/webcomponents-sd-ce-pf.js +0 -374
- package/examples/soundworks/.vendors/public/webcomponentsjs/bundles/webcomponents-sd-ce-pf.js.map +0 -1
- package/examples/soundworks/.vendors/public/webcomponentsjs/bundles/webcomponents-sd-ce.js +0 -240
- package/examples/soundworks/.vendors/public/webcomponentsjs/bundles/webcomponents-sd-ce.js.map +0 -1
- package/examples/soundworks/.vendors/public/webcomponentsjs/bundles/webcomponents-sd.js +0 -196
- package/examples/soundworks/.vendors/public/webcomponentsjs/bundles/webcomponents-sd.js.map +0 -1
- package/examples/soundworks/.vendors/public/webcomponentsjs/custom-elements-es5-adapter.js +0 -15
- package/examples/soundworks/.vendors/public/webcomponentsjs/package.json +0 -51
- package/examples/soundworks/.vendors/public/webcomponentsjs/src/entrypoints/custom-elements-es5-adapter-index.js +0 -16
- package/examples/soundworks/.vendors/public/webcomponentsjs/src/entrypoints/webcomponents-bundle-index.js +0 -55
- package/examples/soundworks/.vendors/public/webcomponentsjs/src/entrypoints/webcomponents-ce-index.js +0 -17
- package/examples/soundworks/.vendors/public/webcomponentsjs/src/entrypoints/webcomponents-pf_dom-index.js +0 -19
- package/examples/soundworks/.vendors/public/webcomponentsjs/src/entrypoints/webcomponents-pf_js-index.js +0 -13
- package/examples/soundworks/.vendors/public/webcomponentsjs/src/entrypoints/webcomponents-sd-ce-index.js +0 -19
- package/examples/soundworks/.vendors/public/webcomponentsjs/src/entrypoints/webcomponents-sd-ce-pf-index.js +0 -25
- package/examples/soundworks/.vendors/public/webcomponentsjs/src/entrypoints/webcomponents-sd-index.js +0 -18
- package/examples/soundworks/.vendors/public/webcomponentsjs/src/flag-parser.js +0 -69
- package/examples/soundworks/.vendors/public/webcomponentsjs/src/platform/baseuri.js +0 -28
- package/examples/soundworks/.vendors/public/webcomponentsjs/src/platform/child-node/after.js +0 -47
- package/examples/soundworks/.vendors/public/webcomponentsjs/src/platform/child-node/before.js +0 -40
- package/examples/soundworks/.vendors/public/webcomponentsjs/src/platform/child-node/index.js +0 -14
- package/examples/soundworks/.vendors/public/webcomponentsjs/src/platform/child-node/remove.js +0 -37
- package/examples/soundworks/.vendors/public/webcomponentsjs/src/platform/child-node/replace-with.js +0 -42
- package/examples/soundworks/.vendors/public/webcomponentsjs/src/platform/custom-event.js +0 -79
- package/examples/soundworks/.vendors/public/webcomponentsjs/src/platform/es6-misc.js +0 -38
- package/examples/soundworks/.vendors/public/webcomponentsjs/src/platform/event-listener-options.js +0 -122
- package/examples/soundworks/.vendors/public/webcomponentsjs/src/platform/get-attribute-names.js +0 -27
- package/examples/soundworks/.vendors/public/webcomponentsjs/src/platform/matches.js +0 -21
- package/examples/soundworks/.vendors/public/webcomponentsjs/src/platform/parent-node/append.js +0 -31
- package/examples/soundworks/.vendors/public/webcomponentsjs/src/platform/parent-node/index.js +0 -13
- package/examples/soundworks/.vendors/public/webcomponentsjs/src/platform/parent-node/prepend.js +0 -42
- package/examples/soundworks/.vendors/public/webcomponentsjs/src/platform/parent-node/replace-children.js +0 -45
- package/examples/soundworks/.vendors/public/webcomponentsjs/src/platform/promise.js +0 -50
- package/examples/soundworks/.vendors/public/webcomponentsjs/src/platform/svg-element-class-list.js +0 -28
- package/examples/soundworks/.vendors/public/webcomponentsjs/src/platform/symbol.js +0 -64
- package/examples/soundworks/.vendors/public/webcomponentsjs/src/platform/toggle-attribute.js +0 -39
- package/examples/soundworks/.vendors/public/webcomponentsjs/src/unresolved.js +0 -32
- package/examples/soundworks/.vendors/public/webcomponentsjs/webcomponents-bundle.d.ts +0 -175
- package/examples/soundworks/.vendors/public/webcomponentsjs/webcomponents-bundle.js +0 -384
- package/examples/soundworks/.vendors/public/webcomponentsjs/webcomponents-bundle.js.map +0 -1
- package/examples/soundworks/.vendors/public/webcomponentsjs/webcomponents-loader.js +0 -238
- package/examples/soundworks/LICENSE +0 -28
- package/examples/soundworks/README.md +0 -26
- package/examples/soundworks/config/application.yaml +0 -8
- package/examples/soundworks/config/env-default.yaml +0 -12
- package/examples/soundworks/package.json +0 -35
- package/examples/soundworks/public/favicon.ico +0 -0
- package/examples/soundworks/public/images/loader.gif +0 -0
- package/examples/soundworks/src/clients/components/sw-audit.js +0 -78
- package/examples/soundworks/src/clients/components/sw-credits.js +0 -80
- package/examples/soundworks/src/clients/player/.editorbackup/PlayerExperience.js~ +0 -131
- package/examples/soundworks/src/clients/player/index.js +0 -118
- package/examples/soundworks/src/clients/styles/app.scss +0 -79
- package/examples/soundworks/src/clients/styles/normalize.scss +0 -359
- package/examples/soundworks/src/clients/webview/index.js +0 -78
- package/examples/soundworks/src/server/index.js +0 -62
- package/examples/soundworks/src/server/schemas/.gitkeep +0 -1
- package/examples/soundworks/src/server/schemas/global.js +0 -18
- package/examples/soundworks/src/server/tmpl/default.tmpl +0 -27
- package/examples/soundworks/src/utils/catch-unhandled-errors.js +0 -9
- package/index.html +0 -51
- package/max/CoMote/docs/sw.shared-state.maxref.xml +0 -95
- package/max/CoMote/examples/simple-webview/README.md +0 -10
- package/max/CoMote/examples/simple-webview/build/comote-simple-webview-server.js +0 -44
- package/max/CoMote/examples/simple-webview/comote-simple-webview-server.maxpat +0 -186
- package/max/CoMote/examples/simple-webview/package-lock.json +0 -5109
- package/max/CoMote/examples/simple-webview/package.json +0 -23
- package/max/CoMote/examples/simple-webview/public/favicon.ico +0 -0
- package/max/CoMote/examples/simple-webview/public/index.html +0 -13
- package/max/CoMote/examples/simple-webview/public/index.mjs +0 -3623
- package/max/CoMote/examples/simple-webview/public/styles.css +0 -99
- package/max/CoMote/examples/simple-webview/src/client.js +0 -35
- package/max/CoMote/examples/simple-webview/src/server.js +0 -20
- package/max/CoMote/examples/soundworks/.editorconfig +0 -12
- package/max/CoMote/examples/soundworks/.eslintrc +0 -3
- package/max/CoMote/examples/soundworks/.soundworks +0 -7
- package/max/CoMote/examples/soundworks/LICENSE +0 -28
- package/max/CoMote/examples/soundworks/README.md +0 -26
- package/max/CoMote/examples/soundworks/config/application.yaml +0 -8
- package/max/CoMote/examples/soundworks/config/env-default.yaml +0 -12
- package/max/CoMote/examples/soundworks/package.json +0 -35
- package/max/CoMote/examples/soundworks/public/favicon.ico +0 -0
- package/max/CoMote/examples/soundworks/public/images/loader.gif +0 -0
- package/max/CoMote/examples/soundworks/src/clients/components/sw-audit.js +0 -78
- package/max/CoMote/examples/soundworks/src/clients/components/sw-credits.js +0 -80
- package/max/CoMote/examples/soundworks/src/clients/player/.editorbackup/PlayerExperience.js~ +0 -131
- package/max/CoMote/examples/soundworks/src/clients/player/index.js +0 -118
- package/max/CoMote/examples/soundworks/src/clients/styles/app.scss +0 -79
- package/max/CoMote/examples/soundworks/src/clients/styles/normalize.scss +0 -359
- package/max/CoMote/examples/soundworks/src/clients/webview/index.js +0 -78
- package/max/CoMote/examples/soundworks/src/server/index.js +0 -62
- package/max/CoMote/examples/soundworks/src/server/schemas/.gitkeep +0 -1
- package/max/CoMote/examples/soundworks/src/server/schemas/global.js +0 -18
- package/max/CoMote/examples/soundworks/src/server/tmpl/default.tmpl +0 -27
- package/max/CoMote/examples/soundworks/src/utils/catch-unhandled-errors.js +0 -9
- package/max/CoMote/extras/CoMote.maxpat +0 -1994
- package/max/CoMote/help/comote_osc_receive.maxhelp +0 -946
- package/max/CoMote/icon.png +0 -0
- package/max/CoMote/init/objectmappings.txt +0 -2
- package/max/CoMote/media/comote-screenshot.png +0 -0
- package/max/CoMote/package-info.json +0 -27
- package/max/CoMote/patchers/comote-connect/comote-connect-public/comote-connect-client.mjs +0 -2821
- package/max/CoMote/patchers/comote-connect/comote-connect-public/favicon.ico +0 -0
- package/max/CoMote/patchers/comote-connect/comote-connect-public/index.html +0 -22
- package/max/CoMote/patchers/comote-connect/comote-connect-server.js +0 -24775
- package/max/CoMote/patchers/comote-connect/comote-connect.maxpat +0 -1048
- package/max/CoMote/patchers/comote-connect/package.json +0 -4
- package/max/CoMote/patchers/comote_format_from_comote_v2.maxpat +0 -613
- package/max/CoMote/patchers/comote_format_from_v3.maxpat +0 -443
- package/max/CoMote/patchers/comote_format_gyro_v2_to_v3.maxpat +0 -240
- package/max/CoMote/patchers/comote_format_gyro_v3_to_v2.maxpat +0 -240
- package/max/CoMote/patchers/comote_format_heading_v2_to_v3.maxpat +0 -171
- package/max/CoMote/patchers/comote_osc_receive.maxpat +0 -440
- package/max/CoMote/patchers/comote_osc_to_list.maxpat +0 -161
- package/max/CoMote/readme.md +0 -22
- package/max/CoMote/source/comote-connect/client.js +0 -104
- package/max/CoMote/source/comote-connect/package-lock.json +0 -591
- package/max/CoMote/source/comote-connect/package.json +0 -19
- package/max/CoMote/source/comote-connect/server.js +0 -193
- package/max-update.bash +0 -44
|
@@ -1,193 +0,0 @@
|
|
|
1
|
-
import http from 'node:http';
|
|
2
|
-
import fs from 'node:fs';
|
|
3
|
-
import url from 'node:url';
|
|
4
|
-
import path from 'node:path';
|
|
5
|
-
|
|
6
|
-
import Max from 'max-api';
|
|
7
|
-
import { WebSocketServer } from 'ws';
|
|
8
|
-
import portfinder from 'portfinder';
|
|
9
|
-
|
|
10
|
-
import { getWifiInfos } from '@ircam/comote-helpers/wifi-infos.js';
|
|
11
|
-
import { getNetworkInterfacesInfos } from '@ircam/comote-helpers/network-infos.js';
|
|
12
|
-
|
|
13
|
-
const comoteConfig = {
|
|
14
|
-
id: 0,
|
|
15
|
-
interval: 16, // period in ms
|
|
16
|
-
ws: null,
|
|
17
|
-
osc: {
|
|
18
|
-
port: 8001,
|
|
19
|
-
hostname: '',
|
|
20
|
-
autostart: true,
|
|
21
|
-
},
|
|
22
|
-
webview: '',
|
|
23
|
-
};
|
|
24
|
-
|
|
25
|
-
const server = http.createServer((req, res) => {
|
|
26
|
-
const parsedUrl = url.parse(req.url);
|
|
27
|
-
let pathname = `./comote-connect-public${parsedUrl.pathname}`;
|
|
28
|
-
const ext = path.parse(pathname).ext || '.html';
|
|
29
|
-
// maps file extension to MIME typere
|
|
30
|
-
const map = {
|
|
31
|
-
'.ico': 'image/x-icon',
|
|
32
|
-
'.html': 'text/html',
|
|
33
|
-
'.js': 'text/javascript',
|
|
34
|
-
'.json': 'application/json',
|
|
35
|
-
'.css': 'text/css',
|
|
36
|
-
};
|
|
37
|
-
|
|
38
|
-
if (fs.existsSync(pathname)) {
|
|
39
|
-
// if is a directory search for index file matching the extension
|
|
40
|
-
if (fs.statSync(pathname).isDirectory()) {
|
|
41
|
-
pathname += 'index.html';
|
|
42
|
-
}
|
|
43
|
-
|
|
44
|
-
// read file from file system
|
|
45
|
-
fs.readFile(pathname, (err, data) => {
|
|
46
|
-
if (err) {
|
|
47
|
-
res.statusCode = 500;
|
|
48
|
-
res.end(`Error getting the file: ${err}.`);
|
|
49
|
-
} else {
|
|
50
|
-
// if the file is found, set Content-type and send data
|
|
51
|
-
res.setHeader('Content-type', map[ext] || 'text/plain' );
|
|
52
|
-
res.end(data);
|
|
53
|
-
}
|
|
54
|
-
});
|
|
55
|
-
} else {
|
|
56
|
-
// file is not found, return 404
|
|
57
|
-
res.statusCode = 404;
|
|
58
|
-
res.end(`File ${pathname} not found!`);
|
|
59
|
-
}
|
|
60
|
-
});;
|
|
61
|
-
|
|
62
|
-
console.log('server started');
|
|
63
|
-
|
|
64
|
-
const wss = new WebSocketServer({ server });
|
|
65
|
-
const sockets = new Set();
|
|
66
|
-
|
|
67
|
-
wss.on('connection', async function connection(ws) {
|
|
68
|
-
const wifiInfos = await getWifiInfos();
|
|
69
|
-
const networkInterfacesInfos = await getNetworkInterfacesInfos();
|
|
70
|
-
|
|
71
|
-
const networkInfos = networkInterfacesInfos
|
|
72
|
-
.sort( (a, b) => {
|
|
73
|
-
if (a.default) {
|
|
74
|
-
// default is before
|
|
75
|
-
return -1;
|
|
76
|
-
} else if (b.default) {
|
|
77
|
-
// other is before
|
|
78
|
-
return 1;
|
|
79
|
-
} else {
|
|
80
|
-
// finally, sort by interface name
|
|
81
|
-
return a.ifaceName < b.ifaceName;
|
|
82
|
-
}
|
|
83
|
-
|
|
84
|
-
});
|
|
85
|
-
ws.send(JSON.stringify({ type: 'networkInfos', payload: networkInfos }));
|
|
86
|
-
|
|
87
|
-
// use first network interface, it should be the default one
|
|
88
|
-
if (networkInfos && networkInfos[0]) {
|
|
89
|
-
comoteConfig.osc.hostname = networkInfos[0].ip4;
|
|
90
|
-
}
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
ws.send(JSON.stringify({ type: 'wifiInfos', payload: wifiInfos }));
|
|
94
|
-
ws.send(JSON.stringify({ type: 'comoteConfig', payload: comoteConfig }));
|
|
95
|
-
|
|
96
|
-
sockets.add(ws);
|
|
97
|
-
|
|
98
|
-
ws.on('message', async (data, isBinary) => {
|
|
99
|
-
// isBinary is not always set
|
|
100
|
-
const message = (isBinary || typeof data !== 'string')
|
|
101
|
-
? data.toString()
|
|
102
|
-
: data;
|
|
103
|
-
|
|
104
|
-
const { type, payload } = JSON.parse(message);
|
|
105
|
-
|
|
106
|
-
switch (type) {
|
|
107
|
-
case 'comoteConfig':
|
|
108
|
-
Object.assign(comoteConfig, payload);
|
|
109
|
-
ws.send(JSON.stringify({ type: 'comoteConfig', payload: comoteConfig }));
|
|
110
|
-
|
|
111
|
-
await Max.outlet('id', comoteConfig.id);
|
|
112
|
-
await Max.outlet('interval', comoteConfig.interval);
|
|
113
|
-
await Max.outlet('osc_hostname', comoteConfig.osc.hostname);
|
|
114
|
-
await Max.outlet('osc_port', comoteConfig.osc.port);
|
|
115
|
-
await Max.outlet('osc_autostart', comoteConfig.osc.autostart);
|
|
116
|
-
await Max.outlet('webview_url', comoteConfig.webview);
|
|
117
|
-
break;
|
|
118
|
-
|
|
119
|
-
default:
|
|
120
|
-
console.warn('received unknown message', {type, payload});
|
|
121
|
-
break;
|
|
122
|
-
}
|
|
123
|
-
});
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
ws.on('close', () => {
|
|
127
|
-
sockets.delete(ws);
|
|
128
|
-
});
|
|
129
|
-
});
|
|
130
|
-
|
|
131
|
-
const handlers = {
|
|
132
|
-
id: id => {
|
|
133
|
-
comoteConfig.id = id;
|
|
134
|
-
sockets.forEach(ws => {
|
|
135
|
-
ws.send(JSON.stringify({ type: 'comoteConfig', payload: comoteConfig }));
|
|
136
|
-
});
|
|
137
|
-
Max.outlet('id', id);
|
|
138
|
-
},
|
|
139
|
-
interval: interval => {
|
|
140
|
-
comoteConfig.interval = interval;
|
|
141
|
-
sockets.forEach(ws => {
|
|
142
|
-
ws.send(JSON.stringify({ type: 'comoteConfig', payload: comoteConfig }));
|
|
143
|
-
});
|
|
144
|
-
Max.outlet('interval', interval);
|
|
145
|
-
},
|
|
146
|
-
osc_hostname: hostname => {
|
|
147
|
-
comoteConfig.osc.hostname = hostname;
|
|
148
|
-
sockets.forEach(ws => {
|
|
149
|
-
ws.send(JSON.stringify({ type: 'comoteConfig', payload: comoteConfig }));
|
|
150
|
-
});
|
|
151
|
-
Max.outlet('osc_hostname', hostname);
|
|
152
|
-
},
|
|
153
|
-
osc_port: port => {
|
|
154
|
-
comoteConfig.osc.port = port;
|
|
155
|
-
sockets.forEach(ws => {
|
|
156
|
-
ws.send(JSON.stringify({ type: 'comoteConfig', payload: comoteConfig }));
|
|
157
|
-
});
|
|
158
|
-
Max.outlet('osc_port', port);
|
|
159
|
-
},
|
|
160
|
-
osc_autostart: autostart => {
|
|
161
|
-
comoteConfig.osc.autostart = !!autostart;
|
|
162
|
-
sockets.forEach(ws => {
|
|
163
|
-
ws.send(JSON.stringify({ type: 'comoteConfig', payload: comoteConfig }));
|
|
164
|
-
});
|
|
165
|
-
Max.outlet('osc_autostart', autostart);
|
|
166
|
-
},
|
|
167
|
-
webview_url: url => {
|
|
168
|
-
comoteConfig.webview = url;
|
|
169
|
-
sockets.forEach(ws => {
|
|
170
|
-
ws.send(JSON.stringify({ type: 'comoteConfig', payload: comoteConfig }));
|
|
171
|
-
});
|
|
172
|
-
Max.outlet('webview_url', url);
|
|
173
|
-
},
|
|
174
|
-
bang: async () => {
|
|
175
|
-
await Max.outlet('id', comoteConfig.id);
|
|
176
|
-
await Max.outlet('interval', comoteConfig.interval);
|
|
177
|
-
await Max.outlet('osc_hostname', comoteConfig.osc.hostname);
|
|
178
|
-
await Max.outlet('osc_port', comoteConfig.osc.port);
|
|
179
|
-
await Max.outlet('osc_autostart', comoteConfig.osc.autostart);
|
|
180
|
-
await Max.outlet('webview_url', comoteConfig.webview);
|
|
181
|
-
}
|
|
182
|
-
};
|
|
183
|
-
|
|
184
|
-
Max.addHandlers(handlers);
|
|
185
|
-
|
|
186
|
-
portfinder.basePort = 8888;
|
|
187
|
-
portfinder.getPort((err, port) => {
|
|
188
|
-
server.listen(port, () => {
|
|
189
|
-
const url = `http://127.0.0.1:${port}`;
|
|
190
|
-
console.log(`server listening on ${url}`);
|
|
191
|
-
Max.outlet('url', url);
|
|
192
|
-
});
|
|
193
|
-
});
|
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "@ircam/comote-helpers",
|
|
3
|
-
"version": "0.3.4",
|
|
4
|
-
"description": "Server component & utilities for the CoMote application",
|
|
5
|
-
"authors": [
|
|
6
|
-
"Benjamin.Matuszewski@ircam.fr",
|
|
7
|
-
"Jean-Philippe.Lambert@ircam.fr"
|
|
8
|
-
],
|
|
9
|
-
"license": "BSD-3-Clause",
|
|
10
|
-
"type": "module",
|
|
11
|
-
"repository": {
|
|
12
|
-
"type": "git",
|
|
13
|
-
"url": "https://github.com/ircam-ismm/comote-helpers"
|
|
14
|
-
},
|
|
15
|
-
"publishConfig": {
|
|
16
|
-
"access": "public"
|
|
17
|
-
},
|
|
18
|
-
"exports": {
|
|
19
|
-
"./*.js": "./src/*.js"
|
|
20
|
-
},
|
|
21
|
-
"workspaces": [
|
|
22
|
-
".",
|
|
23
|
-
"examples/*",
|
|
24
|
-
"max/CoMote/sources/*"
|
|
25
|
-
]
|
|
26
|
-
}
|
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "@ircam/comote-helpers",
|
|
3
|
-
"version": "1.0.0",
|
|
4
|
-
"description": "Server component & utilities for the CoMote application",
|
|
5
|
-
"authors": [
|
|
6
|
-
"Benjamin.Matuszewski@ircam.fr",
|
|
7
|
-
"Jean-Philippe.Lambert@ircam.fr"
|
|
8
|
-
],
|
|
9
|
-
"license": "BSD-3-Clause",
|
|
10
|
-
"type": "module",
|
|
11
|
-
"repository": {
|
|
12
|
-
"type": "git",
|
|
13
|
-
"url": "https://github.com/ircam-ismm/comote-helpers"
|
|
14
|
-
},
|
|
15
|
-
"publishConfig": {
|
|
16
|
-
"access": "public"
|
|
17
|
-
},
|
|
18
|
-
"exports": {
|
|
19
|
-
"./*.js": "./src/*.js"
|
|
20
|
-
},
|
|
21
|
-
"workspaces": [
|
|
22
|
-
".",
|
|
23
|
-
"examples/*",
|
|
24
|
-
"max/CoMote/sources/*"
|
|
25
|
-
]
|
|
26
|
-
}
|