@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,99 +0,0 @@
|
|
|
1
|
-
:root {
|
|
2
|
-
--background-color: #181817;
|
|
3
|
-
--font-color: #ffffff;
|
|
4
|
-
--font-family: Consolas, monaco, monospace;
|
|
5
|
-
--font-size: 62.5%;
|
|
6
|
-
--interface-margin: 20px;
|
|
7
|
-
}
|
|
8
|
-
|
|
9
|
-
* {
|
|
10
|
-
box-sizing: border-box;
|
|
11
|
-
font-family: var(--font-family);
|
|
12
|
-
}
|
|
13
|
-
|
|
14
|
-
html, body {
|
|
15
|
-
width: 100%;
|
|
16
|
-
min-height: 100vh;
|
|
17
|
-
background-color: var(--background-color);
|
|
18
|
-
color: var(--font-color);
|
|
19
|
-
}
|
|
20
|
-
|
|
21
|
-
html {
|
|
22
|
-
font-size: var(--font-size);
|
|
23
|
-
}
|
|
24
|
-
|
|
25
|
-
body {
|
|
26
|
-
padding: 20px;
|
|
27
|
-
margin: 0;
|
|
28
|
-
display: flex;
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
.screen {
|
|
32
|
-
display: flex;
|
|
33
|
-
flex-direction: column;
|
|
34
|
-
justify-content: space-between;
|
|
35
|
-
flex: 1;
|
|
36
|
-
background-color: #181817;
|
|
37
|
-
color: var(--font-color);
|
|
38
|
-
align-items: center;
|
|
39
|
-
}
|
|
40
|
-
|
|
41
|
-
.screen h1 {
|
|
42
|
-
margin: 0px 0px 20px 0px;
|
|
43
|
-
}
|
|
44
|
-
|
|
45
|
-
.interface {
|
|
46
|
-
height: 100%;
|
|
47
|
-
width: 100%;
|
|
48
|
-
display: flex;
|
|
49
|
-
justify-content: center;
|
|
50
|
-
align-items: stretch;
|
|
51
|
-
}
|
|
52
|
-
|
|
53
|
-
.interface sc-slider {
|
|
54
|
-
width: 100%;
|
|
55
|
-
height: 100%;
|
|
56
|
-
margin-right: var(--interface-margin);
|
|
57
|
-
}
|
|
58
|
-
|
|
59
|
-
.interface-right {
|
|
60
|
-
width: 100%;
|
|
61
|
-
display: flex;
|
|
62
|
-
align-items: center;
|
|
63
|
-
flex-direction: column;
|
|
64
|
-
}
|
|
65
|
-
|
|
66
|
-
.interface-right sc-button {
|
|
67
|
-
width: 100%;
|
|
68
|
-
height: 100%;
|
|
69
|
-
font-size: 20px;
|
|
70
|
-
}
|
|
71
|
-
|
|
72
|
-
.interface-right sc-button + sc-button {
|
|
73
|
-
margin-top: var(--interface-margin);
|
|
74
|
-
}
|
|
75
|
-
|
|
76
|
-
.footer {
|
|
77
|
-
width: 100%;
|
|
78
|
-
height: 35px;
|
|
79
|
-
margin-top: 20px;
|
|
80
|
-
display: flex;
|
|
81
|
-
align-items: center;
|
|
82
|
-
}
|
|
83
|
-
|
|
84
|
-
.footer p {
|
|
85
|
-
width: 100%;
|
|
86
|
-
margin: 0px var(--interface-margin) 0px 0px;
|
|
87
|
-
text-align: center;
|
|
88
|
-
font-size: 15px;
|
|
89
|
-
}
|
|
90
|
-
|
|
91
|
-
.footer a {
|
|
92
|
-
color: var(--font-color);
|
|
93
|
-
}
|
|
94
|
-
|
|
95
|
-
.footer sc-button {
|
|
96
|
-
width: 100%;
|
|
97
|
-
height: 100%;
|
|
98
|
-
font-size: 15px;
|
|
99
|
-
}
|
|
@@ -1,35 +0,0 @@
|
|
|
1
|
-
import { html, render } from 'lit';
|
|
2
|
-
import '@ircam/sc-components';
|
|
3
|
-
|
|
4
|
-
render(html`
|
|
5
|
-
<div class="screen">
|
|
6
|
-
|
|
7
|
-
<h1> Basic CoMote Webview </h1>
|
|
8
|
-
|
|
9
|
-
<div class="interface">
|
|
10
|
-
<sc-slider
|
|
11
|
-
min="0"
|
|
12
|
-
max="1"
|
|
13
|
-
step="0.01"
|
|
14
|
-
value="0.5"
|
|
15
|
-
orientation="vertical"
|
|
16
|
-
@input=${e => sendEvent(`slider`, e.detail.value)}
|
|
17
|
-
></sc-slider>
|
|
18
|
-
<div class=interface-right>
|
|
19
|
-
<sc-button
|
|
20
|
-
@press=${e => sendEvent(`button1`, 1)}
|
|
21
|
-
@release=${e => sendEvent(`button1`, 0)}
|
|
22
|
-
>1</sc-button>
|
|
23
|
-
<sc-button
|
|
24
|
-
@press=${e => sendEvent(`button2`, 1)}
|
|
25
|
-
@release=${e => sendEvent(`button2`, 0)}
|
|
26
|
-
>2</sc-button>
|
|
27
|
-
</div>
|
|
28
|
-
</div>
|
|
29
|
-
|
|
30
|
-
<div class="footer">
|
|
31
|
-
<p>Built with <br><a target="_blank" href="https://ircam-ismm.github.io/sc-components/">sc-components</a></p>
|
|
32
|
-
<sc-button @press=${e => toggleModal()}>fullscreen</sc-button>
|
|
33
|
-
</div>
|
|
34
|
-
</div>
|
|
35
|
-
`, document.body);
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
const handler = require('serve-handler');
|
|
2
|
-
const http = require('node:http');
|
|
3
|
-
const path = require('node:path');
|
|
4
|
-
|
|
5
|
-
const port = 8001;
|
|
6
|
-
const publicPath = '../public'; // relative to this file
|
|
7
|
-
|
|
8
|
-
const server = http.createServer((request, response) => {
|
|
9
|
-
const localPath = __dirname;
|
|
10
|
-
|
|
11
|
-
// You pass two more arguments for config and middleware
|
|
12
|
-
// More details here: https://github.com/vercel/serve-handler#options
|
|
13
|
-
return handler(request, response, {
|
|
14
|
-
public: path.resolve(localPath, publicPath),
|
|
15
|
-
});
|
|
16
|
-
});
|
|
17
|
-
|
|
18
|
-
server.listen(port, () => {
|
|
19
|
-
console.log(`Running at http://localhost:${port}`);
|
|
20
|
-
});
|
|
@@ -1,64 +0,0 @@
|
|
|
1
|
-
import { LitElement, html, css, nothing } from 'lit';
|
|
2
|
-
import { unsafeHTML } from 'lit/directives/unsafe-html.js';
|
|
3
|
-
function padLeft(value, size) {
|
|
4
|
-
let str = value + ''; // cast to string
|
|
5
|
-
|
|
6
|
-
while (str.length <= size) {
|
|
7
|
-
str = ` ${str}`;
|
|
8
|
-
}
|
|
9
|
-
return str;
|
|
10
|
-
}
|
|
11
|
-
|
|
12
|
-
/**
|
|
13
|
-
* Component for the soundworks internal audit state
|
|
14
|
-
*/
|
|
15
|
-
class SwAudit extends LitElement {
|
|
16
|
-
static styles = css`
|
|
17
|
-
:host > div {
|
|
18
|
-
background-color: var(--sw-light-background-color);
|
|
19
|
-
height: 100%;
|
|
20
|
-
padding: 0 20px;
|
|
21
|
-
overflow: hidden;
|
|
22
|
-
}
|
|
23
|
-
`;
|
|
24
|
-
constructor() {
|
|
25
|
-
super();
|
|
26
|
-
this.client = null;
|
|
27
|
-
this._auditState = null;
|
|
28
|
-
this._numClientsString = '';
|
|
29
|
-
}
|
|
30
|
-
async connectedCallback() {
|
|
31
|
-
super.connectedCallback();
|
|
32
|
-
this._auditState = await this.client.getAuditState();
|
|
33
|
-
this._auditState.onUpdate(updates => {
|
|
34
|
-
if ('numClients' in updates) {
|
|
35
|
-
const numClientsStrings = [];
|
|
36
|
-
const numClients = this._auditState.get('numClients');
|
|
37
|
-
for (let role in numClients) {
|
|
38
|
-
const str = `${role}: ${padLeft(numClients[role], 2)}`;
|
|
39
|
-
numClientsStrings.push(str);
|
|
40
|
-
}
|
|
41
|
-
this._numClientsString = numClientsStrings.join(' - ');
|
|
42
|
-
}
|
|
43
|
-
this.requestUpdate();
|
|
44
|
-
}, true);
|
|
45
|
-
}
|
|
46
|
-
disconnectedCallback() {
|
|
47
|
-
super.disconnectedCallback();
|
|
48
|
-
this._auditState.detach();
|
|
49
|
-
}
|
|
50
|
-
render() {
|
|
51
|
-
if (this._auditState === null) {
|
|
52
|
-
return nothing;
|
|
53
|
-
}
|
|
54
|
-
const avgLatency = this._auditState.get('averageNetworkLatency');
|
|
55
|
-
const avgLatencyString = padLeft((avgLatency * 1e3).toFixed(2), 6);
|
|
56
|
-
return html`
|
|
57
|
-
<div>
|
|
58
|
-
${unsafeHTML(this._numClientsString)} | avg latency: ${unsafeHTML(avgLatencyString)} ms
|
|
59
|
-
</div>
|
|
60
|
-
`;
|
|
61
|
-
}
|
|
62
|
-
}
|
|
63
|
-
customElements.define('sw-audit', SwAudit);
|
|
64
|
-
//# sourceMappingURL=./sw-audit.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"names":["LitElement","html","css","nothing","unsafeHTML","padLeft","value","size","str","length","SwAudit","styles","constructor","client","_auditState","_numClientsString","connectedCallback","getAuditState","onUpdate","updates","numClientsStrings","numClients","get","role","push","join","requestUpdate","disconnectedCallback","detach","render","avgLatency","avgLatencyString","toFixed","customElements","define"],"sources":["../../../src/clients/components/sw-audit.js"],"sourcesContent":["import { LitElement, html, css, nothing } from 'lit';\nimport { unsafeHTML } from 'lit/directives/unsafe-html.js';\n\nfunction padLeft(value, size) {\n let str = value + ''; // cast to string\n\n while (str.length <= size) {\n str = ` ${str}`;\n }\n\n return str;\n}\n\n/**\n * Component for the soundworks internal audit state\n */\nclass SwAudit extends LitElement {\n static styles = css`\n :host > div {\n background-color: var(--sw-light-background-color);\n height: 100%;\n padding: 0 20px;\n overflow: hidden;\n }\n `;\n\n constructor() {\n super();\n\n this.client = null;\n this._auditState = null;\n this._numClientsString = '';\n }\n\n async connectedCallback() {\n super.connectedCallback();\n\n this._auditState = await this.client.getAuditState();\n this._auditState.onUpdate(updates => {\n if ('numClients' in updates) {\n const numClientsStrings = [];\n const numClients = this._auditState.get('numClients');\n\n for (let role in numClients) {\n const str = `${role}: ${padLeft(numClients[role], 2)}`;\n numClientsStrings.push(str);\n }\n\n this._numClientsString = numClientsStrings.join(' - ');\n }\n\n this.requestUpdate();\n }, true);\n }\n\n disconnectedCallback() {\n super.disconnectedCallback();\n\n this._auditState.detach();\n }\n\n render() {\n if (this._auditState === null) {\n return nothing;\n }\n\n const avgLatency = this._auditState.get('averageNetworkLatency');\n const avgLatencyString = padLeft((avgLatency * 1e3).toFixed(2), 6);\n\n return html`\n <div>\n ${unsafeHTML(this._numClientsString)} | avg latency: ${unsafeHTML(avgLatencyString)} ms\n </div>\n `;\n }\n}\n\ncustomElements.define('sw-audit', SwAudit);\n"],"mappings":"AAAA,SAASA,UAAU,EAAEC,IAAI,EAAEC,GAAG,EAAEC,OAAO,QAAQ,KAAK;AACpD,SAASC,UAAU,QAAQ,+BAA+B;AAE1D,SAASC,OAAOA,CAACC,KAAK,EAAEC,IAAI,EAAE;EAC5B,IAAIC,GAAG,GAAGF,KAAK,GAAG,EAAE,CAAC,CAAC;;EAEtB,OAAOE,GAAG,CAACC,MAAM,IAAIF,IAAI,EAAE;IACzBC,GAAG,GAAG,SAASA,GAAG,EAAE;EACtB;EAEA,OAAOA,GAAG;AACZ;;AAEA;AACA;AACA;AACA,MAAME,OAAO,SAASV,UAAU,CAAC;EAC/B,OAAOW,MAAM,GAAGT,GAAG;AACrB;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;EAEDU,WAAWA,CAAA,EAAG;IACZ,KAAK,CAAC,CAAC;IAEP,IAAI,CAACC,MAAM,GAAG,IAAI;IAClB,IAAI,CAACC,WAAW,GAAG,IAAI;IACvB,IAAI,CAACC,iBAAiB,GAAG,EAAE;EAC7B;EAEA,MAAMC,iBAAiBA,CAAA,EAAG;IACxB,KAAK,CAACA,iBAAiB,CAAC,CAAC;IAEzB,IAAI,CAACF,WAAW,GAAG,MAAM,IAAI,CAACD,MAAM,CAACI,aAAa,CAAC,CAAC;IACpD,IAAI,CAACH,WAAW,CAACI,QAAQ,CAACC,OAAO,IAAI;MACnC,IAAI,YAAY,IAAIA,OAAO,EAAE;QAC3B,MAAMC,iBAAiB,GAAG,EAAE;QAC5B,MAAMC,UAAU,GAAG,IAAI,CAACP,WAAW,CAACQ,GAAG,CAAC,YAAY,CAAC;QAErD,KAAK,IAAIC,IAAI,IAAIF,UAAU,EAAE;UAC3B,MAAMb,GAAG,GAAG,GAAGe,IAAI,KAAKlB,OAAO,CAACgB,UAAU,CAACE,IAAI,CAAC,EAAE,CAAC,CAAC,EAAE;UACtDH,iBAAiB,CAACI,IAAI,CAAChB,GAAG,CAAC;QAC7B;QAEA,IAAI,CAACO,iBAAiB,GAAGK,iBAAiB,CAACK,IAAI,CAAC,KAAK,CAAC;MACxD;MAEA,IAAI,CAACC,aAAa,CAAC,CAAC;IACtB,CAAC,EAAE,IAAI,CAAC;EACV;EAEAC,oBAAoBA,CAAA,EAAG;IACrB,KAAK,CAACA,oBAAoB,CAAC,CAAC;IAE5B,IAAI,CAACb,WAAW,CAACc,MAAM,CAAC,CAAC;EAC3B;EAEAC,MAAMA,CAAA,EAAG;IACP,IAAI,IAAI,CAACf,WAAW,KAAK,IAAI,EAAE;MAC7B,OAAOX,OAAO;IAChB;IAEA,MAAM2B,UAAU,GAAG,IAAI,CAAChB,WAAW,CAACQ,GAAG,CAAC,uBAAuB,CAAC;IAChE,MAAMS,gBAAgB,GAAG1B,OAAO,CAAC,CAACyB,UAAU,GAAG,GAAG,EAAEE,OAAO,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC;IAElE,OAAO/B,IAAI;AACf;AACA,UAAUG,UAAU,CAAC,IAAI,CAACW,iBAAiB,CAAC,mBAAmBX,UAAU,CAAC2B,gBAAgB,CAAC;AAC3F;AACA,KAAK;EACH;AACF;AAEAE,cAAc,CAACC,MAAM,CAAC,UAAU,EAAExB,OAAO,CAAC","ignoreList":[]}
|
|
@@ -1,73 +0,0 @@
|
|
|
1
|
-
import { LitElement, html, css, nothing } from 'lit';
|
|
2
|
-
import '@ircam/sc-components/sc-icon.js';
|
|
3
|
-
class SwCredits extends LitElement {
|
|
4
|
-
static properties = {
|
|
5
|
-
_show: {
|
|
6
|
-
type: Boolean,
|
|
7
|
-
state: true
|
|
8
|
-
}
|
|
9
|
-
};
|
|
10
|
-
static styles = css`
|
|
11
|
-
:host {
|
|
12
|
-
width: 100%;
|
|
13
|
-
position: fixed;
|
|
14
|
-
bottom: 0;
|
|
15
|
-
left: 0;
|
|
16
|
-
z-index: 1000;
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
:host > footer {
|
|
20
|
-
display: block;
|
|
21
|
-
line-height: 1.6rem;
|
|
22
|
-
padding: 20px;
|
|
23
|
-
background-color: var(--sw-light-background-color);
|
|
24
|
-
box-sizing: border-box;
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
footer span {
|
|
28
|
-
font-style: italic;
|
|
29
|
-
color: var(--sw-light-font-color);
|
|
30
|
-
font-weight: bold;
|
|
31
|
-
}
|
|
32
|
-
|
|
33
|
-
footer a {
|
|
34
|
-
color: var(--sw-light-font-color);
|
|
35
|
-
}
|
|
36
|
-
|
|
37
|
-
sc-icon {
|
|
38
|
-
position: absolute;
|
|
39
|
-
bottom: 20px;
|
|
40
|
-
right: 20px;
|
|
41
|
-
z-index: 1001;
|
|
42
|
-
border: none;
|
|
43
|
-
background-color: transparent;
|
|
44
|
-
opacity: 0.6;
|
|
45
|
-
}
|
|
46
|
-
`;
|
|
47
|
-
constructor() {
|
|
48
|
-
super();
|
|
49
|
-
this._show = false;
|
|
50
|
-
this.infos = {};
|
|
51
|
-
}
|
|
52
|
-
render() {
|
|
53
|
-
const $footer = html`
|
|
54
|
-
<footer>
|
|
55
|
-
<p>
|
|
56
|
-
<span>${this.infos.name}</span>
|
|
57
|
-
${this.infos.author ? html`by <span>${this.infos.author}</span>` : ``}
|
|
58
|
-
has been developped using the <a href="https://soundworks.dev" target="_blank">soundworks</a>
|
|
59
|
-
framework developped by the ISMM team at Ircam.
|
|
60
|
-
</p>
|
|
61
|
-
<p>
|
|
62
|
-
Copyright (c) 2014-present IRCAM – Centre Pompidou (France, Paris)
|
|
63
|
-
</p>
|
|
64
|
-
</footer>
|
|
65
|
-
`;
|
|
66
|
-
return html`
|
|
67
|
-
${this._show ? $footer : nothing}
|
|
68
|
-
<sc-icon type="question" @release=${e => this._show = !this._show}></sc-icon>
|
|
69
|
-
`;
|
|
70
|
-
}
|
|
71
|
-
}
|
|
72
|
-
customElements.define('sw-credits', SwCredits);
|
|
73
|
-
//# sourceMappingURL=./sw-credits.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"names":["LitElement","html","css","nothing","SwCredits","properties","_show","type","Boolean","state","styles","constructor","infos","render","$footer","name","author","e","customElements","define"],"sources":["../../../src/clients/components/sw-credits.js"],"sourcesContent":["import { LitElement, html, css, nothing } from 'lit';\n\nimport '@ircam/sc-components/sc-icon.js';\n\nclass SwCredits extends LitElement {\n static properties = {\n _show: {\n type: Boolean,\n state: true,\n },\n };\n\n static styles = css`\n :host {\n width: 100%;\n position: fixed;\n bottom: 0;\n left: 0;\n z-index: 1000;\n }\n\n :host > footer {\n display: block;\n line-height: 1.6rem;\n padding: 20px;\n background-color: var(--sw-light-background-color);\n box-sizing: border-box;\n }\n\n footer span {\n font-style: italic;\n color: var(--sw-light-font-color);\n font-weight: bold;\n }\n\n footer a {\n color: var(--sw-light-font-color);\n }\n\n sc-icon {\n position: absolute;\n bottom: 20px;\n right: 20px;\n z-index: 1001;\n border: none;\n background-color: transparent;\n opacity: 0.6;\n }\n `;\n\n constructor() {\n super();\n\n this._show = false;\n this.infos = {};\n }\n\n render() {\n const $footer = html`\n <footer>\n <p>\n <span>${this.infos.name}</span>\n ${this.infos.author ? html`by <span>${this.infos.author}</span>` : ``}\n has been developped using the <a href=\"https://soundworks.dev\" target=\"_blank\">soundworks</a>\n framework developped by the ISMM team at Ircam.\n </p>\n <p>\n Copyright (c) 2014-present IRCAM – Centre Pompidou (France, Paris)\n </p>\n </footer>\n `;\n\n return html`\n ${this._show ? $footer : nothing}\n <sc-icon type=\"question\" @release=${e => this._show = !this._show}></sc-icon>\n `\n }\n}\n\ncustomElements.define('sw-credits', SwCredits);\n"],"mappings":"AAAA,SAASA,UAAU,EAAEC,IAAI,EAAEC,GAAG,EAAEC,OAAO,QAAQ,KAAK;AAEpD,OAAO,iCAAiC;AAExC,MAAMC,SAAS,SAASJ,UAAU,CAAC;EACjC,OAAOK,UAAU,GAAG;IAClBC,KAAK,EAAE;MACLC,IAAI,EAAEC,OAAO;MACbC,KAAK,EAAE;IACT;EACF,CAAC;EAED,OAAOC,MAAM,GAAGR,GAAG;AACrB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;EAEDS,WAAWA,CAAA,EAAG;IACZ,KAAK,CAAC,CAAC;IAEP,IAAI,CAACL,KAAK,GAAG,KAAK;IAClB,IAAI,CAACM,KAAK,GAAG,CAAC,CAAC;EACjB;EAEAC,MAAMA,CAAA,EAAG;IACP,MAAMC,OAAO,GAAGb,IAAI;AACxB;AACA;AACA,mBAAmB,IAAI,CAACW,KAAK,CAACG,IAAI;AAClC,YAAY,IAAI,CAACH,KAAK,CAACI,MAAM,GAAGf,IAAI,YAAY,IAAI,CAACW,KAAK,CAACI,MAAM,SAAS,GAAG,EAAE;AAC/E;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;IAED,OAAOf,IAAI;AACf,QAAQ,IAAI,CAACK,KAAK,GAAGQ,OAAO,GAAGX,OAAO;AACtC,0CAA0Cc,CAAC,IAAI,IAAI,CAACX,KAAK,GAAG,CAAC,IAAI,CAACA,KAAK;AACvE,KAAK;EACH;AACF;AAEAY,cAAc,CAACC,MAAM,CAAC,YAAY,EAAEf,SAAS,CAAC","ignoreList":[]}
|
|
@@ -1,131 +0,0 @@
|
|
|
1
|
-
import { AbstractExperience } from '@soundworks/core/client';
|
|
2
|
-
import { render, html, nothing } from 'lit/html.js';
|
|
3
|
-
import renderInitializationScreens from '@soundworks/template-helpers/client/render-initialization-screens.js';
|
|
4
|
-
import * as CoMoteQRCode from '@ircam/comote-helpers/qrcode.js';
|
|
5
|
-
|
|
6
|
-
import '@ircam/simple-components/sc-editor.js';
|
|
7
|
-
import '@ircam/simple-components/sc-text.js';
|
|
8
|
-
import '@ircam/simple-components/sc-toggle.js';
|
|
9
|
-
|
|
10
|
-
const SOCKET_PORT = 8901;
|
|
11
|
-
|
|
12
|
-
class PlayerExperience extends AbstractExperience {
|
|
13
|
-
constructor(client, config, $container) {
|
|
14
|
-
super(client);
|
|
15
|
-
|
|
16
|
-
this.config = config;
|
|
17
|
-
this.$container = $container;
|
|
18
|
-
this.rafId = null;
|
|
19
|
-
|
|
20
|
-
renderInitializationScreens(client, config, $container);
|
|
21
|
-
}
|
|
22
|
-
|
|
23
|
-
async start() {
|
|
24
|
-
super.start();
|
|
25
|
-
|
|
26
|
-
window.addEventListener('resize', () => this.render());
|
|
27
|
-
|
|
28
|
-
this.infos = await this.client.stateManager.attach('infos');
|
|
29
|
-
this.infos.subscribe(() => this.render());
|
|
30
|
-
|
|
31
|
-
this.infos.subscribe(async updates => {
|
|
32
|
-
if (updates.comoteConfig) {
|
|
33
|
-
this.qrCode = await CoMoteQRCode.dataURL(this.infos.get('comoteConfig'));
|
|
34
|
-
}
|
|
35
|
-
|
|
36
|
-
if (updates.buttonA) {
|
|
37
|
-
console.log(updates.buttonA);
|
|
38
|
-
}
|
|
39
|
-
|
|
40
|
-
this.render();
|
|
41
|
-
}, true);
|
|
42
|
-
|
|
43
|
-
this.render();
|
|
44
|
-
}
|
|
45
|
-
|
|
46
|
-
render() {
|
|
47
|
-
// debounce with requestAnimationFrame
|
|
48
|
-
window.cancelAnimationFrame(this.rafId);
|
|
49
|
-
|
|
50
|
-
this.rafId = window.requestAnimationFrame(() => {
|
|
51
|
-
const values =
|
|
52
|
-
|
|
53
|
-
render(html`
|
|
54
|
-
<div style="padding: 20px">
|
|
55
|
-
<h1 style="margin: 20px 0">CoMo.te dashboard</h1>
|
|
56
|
-
|
|
57
|
-
<div style="margin-bottom: 10px;">
|
|
58
|
-
<sc-text
|
|
59
|
-
value="WiFi infos"
|
|
60
|
-
width="310"
|
|
61
|
-
readonly
|
|
62
|
-
></sc-text>
|
|
63
|
-
<sc-text
|
|
64
|
-
value="${JSON.stringify(this.infos.get('wifiInfos'), null, 2)}"
|
|
65
|
-
readonly
|
|
66
|
-
height="80"
|
|
67
|
-
width="300"
|
|
68
|
-
></sc-text>
|
|
69
|
-
</div>
|
|
70
|
-
<div style="margin-bottom: 10px;">
|
|
71
|
-
<sc-text
|
|
72
|
-
value="Settings"
|
|
73
|
-
width="310"
|
|
74
|
-
readonly
|
|
75
|
-
></sc-text>
|
|
76
|
-
<sc-editor
|
|
77
|
-
value="${JSON.stringify(this.infos.get('comoteConfig'), null, 2)}"
|
|
78
|
-
@change="${e => this.infos.set({ comoteConfig: JSON.parse(e.detail.value) })}"
|
|
79
|
-
></sc-editor>
|
|
80
|
-
</div>
|
|
81
|
-
|
|
82
|
-
${this.qrCode ?
|
|
83
|
-
html`
|
|
84
|
-
<div style="display: inline-block; vertical-align: top; margin-right: 12px">
|
|
85
|
-
<sc-text
|
|
86
|
-
style="display: block; margin-bottom: 4px;"
|
|
87
|
-
width="300"
|
|
88
|
-
value="Flash QR to retrieve settings in CoMo.te"
|
|
89
|
-
readonly
|
|
90
|
-
></sc-text>
|
|
91
|
-
<img src="${this.qrCode}" width="300" height="300" />
|
|
92
|
-
</div>
|
|
93
|
-
`
|
|
94
|
-
: nothing}
|
|
95
|
-
|
|
96
|
-
<div style="display: inline-block; vertical-align: top; margin-right: 12px">
|
|
97
|
-
<sc-text
|
|
98
|
-
value="${JSON.stringify(this.infos.get('data'), null, 2)}"
|
|
99
|
-
readonly
|
|
100
|
-
height="334"
|
|
101
|
-
width="300"
|
|
102
|
-
></sc-text>
|
|
103
|
-
</div>
|
|
104
|
-
|
|
105
|
-
<div style="display: inline-block; vertical-align: top; margin-right: 12px">
|
|
106
|
-
<div style="margin-bottom: 6px">
|
|
107
|
-
<sc-text
|
|
108
|
-
value="buttonA"
|
|
109
|
-
readonly
|
|
110
|
-
></sc-text>
|
|
111
|
-
<sc-toggle
|
|
112
|
-
.active=${this.infos.get('buttonA')}
|
|
113
|
-
></sc-toggle>
|
|
114
|
-
</div>
|
|
115
|
-
<div style="margin-bottom: 6px">
|
|
116
|
-
<sc-text
|
|
117
|
-
value="buttonB"
|
|
118
|
-
readonly
|
|
119
|
-
></sc-text>
|
|
120
|
-
<sc-toggle
|
|
121
|
-
.active=${this.infos.get('buttonB')}
|
|
122
|
-
></sc-toggle>
|
|
123
|
-
</div>
|
|
124
|
-
</div>
|
|
125
|
-
</div>
|
|
126
|
-
`, this.$container);
|
|
127
|
-
});
|
|
128
|
-
}
|
|
129
|
-
}
|
|
130
|
-
|
|
131
|
-
export default PlayerExperience;
|
|
@@ -1,116 +0,0 @@
|
|
|
1
|
-
import '@soundworks/helpers/polyfills.js';
|
|
2
|
-
import { Client } from '@soundworks/core/client.js';
|
|
3
|
-
import { loadConfig, launcher } from '@soundworks/helpers/browser.js';
|
|
4
|
-
import { html, render } from 'lit';
|
|
5
|
-
import '../components/sw-credits.js';
|
|
6
|
-
import * as CoMoteQRCode from '@ircam/comote-helpers/qrcode.js';
|
|
7
|
-
import '@ircam/sc-components/sc-text.js';
|
|
8
|
-
import '@ircam/sc-components/sc-toggle.js';
|
|
9
|
-
import '@ircam/sc-components/sc-editor.js';
|
|
10
|
-
import '@ircam/sc-components/sc-tab.js';
|
|
11
|
-
|
|
12
|
-
// - General documentation: https://soundworks.dev/
|
|
13
|
-
// - API documentation: https://soundworks.dev/api
|
|
14
|
-
// - Issue Tracker: https://github.com/collective-soundworks/soundworks/issues
|
|
15
|
-
// - Wizard & Tools: `npx soundworks`
|
|
16
|
-
|
|
17
|
-
async function main($container) {
|
|
18
|
-
/**
|
|
19
|
-
* Load configuration from config files and create the soundworks client
|
|
20
|
-
*/
|
|
21
|
-
const config = loadConfig();
|
|
22
|
-
const client = new Client(config);
|
|
23
|
-
launcher.register(client, {
|
|
24
|
-
initScreensContainer: $container
|
|
25
|
-
});
|
|
26
|
-
await client.start();
|
|
27
|
-
const global = await client.stateManager.attach('global');
|
|
28
|
-
let qrCode;
|
|
29
|
-
let data = {};
|
|
30
|
-
let buttonA = false;
|
|
31
|
-
let buttonB = false;
|
|
32
|
-
let control = {};
|
|
33
|
-
global.onUpdate(async updates => {
|
|
34
|
-
if ('comoteConfig' in updates) {
|
|
35
|
-
qrCode = await CoMoteQRCode.dataURL(updates.comoteConfig);
|
|
36
|
-
}
|
|
37
|
-
if ('data' in updates) {
|
|
38
|
-
({
|
|
39
|
-
data
|
|
40
|
-
} = updates);
|
|
41
|
-
if ('control' in updates.data) {
|
|
42
|
-
control = updates.data.control;
|
|
43
|
-
if ('buttonA' in updates.data.control) {
|
|
44
|
-
buttonA = !!updates.data.control.buttonA;
|
|
45
|
-
} else if ('buttonB' in updates.data.control) {
|
|
46
|
-
buttonB = !!updates.data.control.buttonB;
|
|
47
|
-
}
|
|
48
|
-
}
|
|
49
|
-
}
|
|
50
|
-
renderApp();
|
|
51
|
-
}, true);
|
|
52
|
-
function renderApp() {
|
|
53
|
-
render(html`
|
|
54
|
-
<div style="padding: 20px">
|
|
55
|
-
<h1 style="margin: 20px 0">CoMote dashboard</h1>
|
|
56
|
-
|
|
57
|
-
<div style="margin-bottom: 10px;">
|
|
58
|
-
<sc-text>WiFi infos</sc-text>
|
|
59
|
-
<sc-text style="height: 80px;">${JSON.stringify(global.get('wifiInfos'), null, 2)}</sc-text>
|
|
60
|
-
</div>
|
|
61
|
-
<div style="margin-bottom: 10px;">
|
|
62
|
-
<sc-text>Settings</sc-text>
|
|
63
|
-
<sc-editor
|
|
64
|
-
value=${JSON.stringify(global.get('comoteConfig'), null, 2)}
|
|
65
|
-
@change=${e => global.set({
|
|
66
|
-
comoteConfig: JSON.parse(e.detail.value)
|
|
67
|
-
})}
|
|
68
|
-
></sc-editor>
|
|
69
|
-
</div>
|
|
70
|
-
|
|
71
|
-
<div style="display: inline-block; vertical-align: top; margin-right: 12px">
|
|
72
|
-
<sc-text style="display: block; margin-bottom: 4px;">Flash QR to retrieve settings in CoMote</sc-text>
|
|
73
|
-
<img src=${qrCode} width="300" height="300" style="image-rendering: pixelated;"/>
|
|
74
|
-
</div>
|
|
75
|
-
|
|
76
|
-
<div style="display: inline-block; vertical-align: top; margin-right: 12px">
|
|
77
|
-
<sc-text style="width: 300px; height: 350px">${JSON.stringify(data, null, 2)}</sc-text>
|
|
78
|
-
</div>
|
|
79
|
-
|
|
80
|
-
<div style="display: inline-block; vertical-align: top; margin-right: 12px">
|
|
81
|
-
<div style="margin-bottom: 6px">
|
|
82
|
-
<sc-text>buttonA</sc-text>
|
|
83
|
-
<sc-toggle .active=${buttonA}></sc-toggle>
|
|
84
|
-
</div>
|
|
85
|
-
<div style="margin-bottom: 6px">
|
|
86
|
-
<sc-text>buttonB</sc-text>
|
|
87
|
-
<sc-toggle .active=${buttonB}></sc-toggle>
|
|
88
|
-
</div>
|
|
89
|
-
<div style="margin-bottom: 6px">
|
|
90
|
-
<sc-text>Arbitrary control (webview)</sc-text>
|
|
91
|
-
<sc-text>${JSON.stringify(control)}</sc-text>
|
|
92
|
-
</div>
|
|
93
|
-
</div>
|
|
94
|
-
|
|
95
|
-
<div style="margin-top: 12px">
|
|
96
|
-
<sc-text>webview page</sc-text>
|
|
97
|
-
<sc-tab
|
|
98
|
-
.options=${['1', '2']}
|
|
99
|
-
value=${global.get('webviewPage')}
|
|
100
|
-
@change=${e => global.set({
|
|
101
|
-
webviewPage: e.detail.value
|
|
102
|
-
})}
|
|
103
|
-
></sc-tab>
|
|
104
|
-
</div>
|
|
105
|
-
</div>
|
|
106
|
-
`, $container);
|
|
107
|
-
}
|
|
108
|
-
}
|
|
109
|
-
|
|
110
|
-
// The launcher enables instanciation of multiple clients in the same page to
|
|
111
|
-
// facilitate development and testing.
|
|
112
|
-
// e.g. `http://127.0.0.1:8000?emulate=10` to run 10 clients side-by-side
|
|
113
|
-
launcher.execute(main, {
|
|
114
|
-
numClients: parseInt(new URLSearchParams(window.location.search).get('emulate')) || 1
|
|
115
|
-
});
|
|
116
|
-
//# sourceMappingURL=./index.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"names":["Client","loadConfig","launcher","html","render","CoMoteQRCode","main","$container","config","client","register","initScreensContainer","start","global","stateManager","attach","qrCode","data","buttonA","buttonB","control","onUpdate","updates","dataURL","comoteConfig","renderApp","JSON","stringify","get","e","set","parse","detail","value","webviewPage","execute","numClients","parseInt","URLSearchParams","window","location","search"],"sources":["../../../src/clients/player/index.js"],"sourcesContent":["import '@soundworks/helpers/polyfills.js';\nimport { Client } from '@soundworks/core/client.js';\nimport { loadConfig, launcher } from '@soundworks/helpers/browser.js';\nimport { html, render } from 'lit';\n\nimport '../components/sw-credits.js';\nimport * as CoMoteQRCode from '@ircam/comote-helpers/qrcode.js';\n\nimport '@ircam/sc-components/sc-text.js';\nimport '@ircam/sc-components/sc-toggle.js';\nimport '@ircam/sc-components/sc-editor.js';\nimport '@ircam/sc-components/sc-tab.js';\n\n// - General documentation: https://soundworks.dev/\n// - API documentation: https://soundworks.dev/api\n// - Issue Tracker: https://github.com/collective-soundworks/soundworks/issues\n// - Wizard & Tools: `npx soundworks`\n\nasync function main($container) {\n /**\n * Load configuration from config files and create the soundworks client\n */\n const config = loadConfig();\n const client = new Client(config);\n launcher.register(client, { initScreensContainer: $container });\n\n await client.start();\n\n const global = await client.stateManager.attach('global');\n\n let qrCode;\n let data = {};\n let buttonA = false;\n let buttonB = false;\n let control = {};\n\n global.onUpdate(async updates => {\n if ('comoteConfig' in updates) {\n qrCode = await CoMoteQRCode.dataURL(updates.comoteConfig);\n }\n\n if ('data' in updates) {\n ({data} = updates);\n\n if ('control' in updates.data) {\n control = updates.data.control;\n\n if ('buttonA' in updates.data.control) {\n buttonA = !!updates.data.control.buttonA;\n } else if ('buttonB' in updates.data.control) {\n buttonB = !!updates.data.control.buttonB;\n }\n }\n }\n\n renderApp();\n }, true);\n\n function renderApp() {\n render(html`\n <div style=\"padding: 20px\">\n <h1 style=\"margin: 20px 0\">CoMote dashboard</h1>\n\n <div style=\"margin-bottom: 10px;\">\n <sc-text>WiFi infos</sc-text>\n <sc-text style=\"height: 80px;\">${JSON.stringify(global.get('wifiInfos'), null, 2)}</sc-text>\n </div>\n <div style=\"margin-bottom: 10px;\">\n <sc-text>Settings</sc-text>\n <sc-editor\n value=${JSON.stringify(global.get('comoteConfig'), null, 2)}\n @change=${e => global.set({ comoteConfig: JSON.parse(e.detail.value) })}\n ></sc-editor>\n </div>\n\n <div style=\"display: inline-block; vertical-align: top; margin-right: 12px\">\n <sc-text style=\"display: block; margin-bottom: 4px;\">Flash QR to retrieve settings in CoMote</sc-text>\n <img src=${qrCode} width=\"300\" height=\"300\" style=\"image-rendering: pixelated;\"/>\n </div>\n\n <div style=\"display: inline-block; vertical-align: top; margin-right: 12px\">\n <sc-text style=\"width: 300px; height: 350px\">${JSON.stringify(data, null, 2)}</sc-text>\n </div>\n\n <div style=\"display: inline-block; vertical-align: top; margin-right: 12px\">\n <div style=\"margin-bottom: 6px\">\n <sc-text>buttonA</sc-text>\n <sc-toggle .active=${buttonA}></sc-toggle>\n </div>\n <div style=\"margin-bottom: 6px\">\n <sc-text>buttonB</sc-text>\n <sc-toggle .active=${buttonB}></sc-toggle>\n </div>\n <div style=\"margin-bottom: 6px\">\n <sc-text>Arbitrary control (webview)</sc-text>\n <sc-text>${JSON.stringify(control)}</sc-text>\n </div>\n </div>\n\n <div style=\"margin-top: 12px\">\n <sc-text>webview page</sc-text>\n <sc-tab\n .options=${['1', '2']}\n value=${global.get('webviewPage')}\n @change=${e => global.set({ webviewPage: e.detail.value })}\n ></sc-tab>\n </div>\n </div>\n `, $container);\n }\n}\n\n// The launcher enables instanciation of multiple clients in the same page to\n// facilitate development and testing.\n// e.g. `http://127.0.0.1:8000?emulate=10` to run 10 clients side-by-side\nlauncher.execute(main, {\n numClients: parseInt(new URLSearchParams(window.location.search).get('emulate')) || 1,\n});\n"],"mappings":"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","ignoreList":[]}
|
|
@@ -1,79 +0,0 @@
|
|
|
1
|
-
:root {
|
|
2
|
-
--sw-background-color: #000000;
|
|
3
|
-
--sw-medium-background-color: #121212;
|
|
4
|
-
--sw-light-background-color: #242424;
|
|
5
|
-
--sw-lighter-background-color: #363636;
|
|
6
|
-
--sw-font-color: #ffffff;
|
|
7
|
-
--sw-light-font-color: #cccccc;
|
|
8
|
-
--sw-font-color-error: #a94442;
|
|
9
|
-
--sw-font-family: Consolas, monaco, monospace;
|
|
10
|
-
--sw-font-size: 62.5%; // such that 1rem == 10px
|
|
11
|
-
}
|
|
12
|
-
|
|
13
|
-
html, body {
|
|
14
|
-
width: 100%;
|
|
15
|
-
min-height: 100vh;
|
|
16
|
-
background-color: var(--sw-background-color);
|
|
17
|
-
color: var(--sw-font-color);
|
|
18
|
-
}
|
|
19
|
-
|
|
20
|
-
html {
|
|
21
|
-
font-size: var(--sw-font-size);
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
body {
|
|
25
|
-
display: flex;
|
|
26
|
-
flex-wrap: wrap;
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
* {
|
|
30
|
-
box-sizing: border-box;
|
|
31
|
-
font-family: var(--sw-font-family);
|
|
32
|
-
}
|
|
33
|
-
|
|
34
|
-
body.loading {
|
|
35
|
-
background-image: url(../../images/loader.gif);
|
|
36
|
-
background-position: 50% 50%;
|
|
37
|
-
background-repeat: no-repeat;
|
|
38
|
-
}
|
|
39
|
-
|
|
40
|
-
.simple-layout {
|
|
41
|
-
display: block;
|
|
42
|
-
flex-grow: 1;
|
|
43
|
-
padding: 20px;
|
|
44
|
-
position: relative;
|
|
45
|
-
}
|
|
46
|
-
|
|
47
|
-
// default styles for controller layout
|
|
48
|
-
.controller-layout {
|
|
49
|
-
display: block;
|
|
50
|
-
flex-grow: 1;
|
|
51
|
-
position: relative;
|
|
52
|
-
|
|
53
|
-
& > header {
|
|
54
|
-
display: block;
|
|
55
|
-
height: 38px;
|
|
56
|
-
line-height: 38px;
|
|
57
|
-
background-color: var(--sw-medium-background-color);
|
|
58
|
-
display: flex;
|
|
59
|
-
flex-direction: row;
|
|
60
|
-
justify-content: space-between;
|
|
61
|
-
border-bottom: 1px solid var(--sw-lighter-background-color);
|
|
62
|
-
|
|
63
|
-
h1 {
|
|
64
|
-
font-size: 12px;
|
|
65
|
-
margin: 0;
|
|
66
|
-
padding-left: 20px;
|
|
67
|
-
max-width: 50%;
|
|
68
|
-
overflow: hidden;
|
|
69
|
-
}
|
|
70
|
-
|
|
71
|
-
sc-audit {
|
|
72
|
-
max-width: 50%;
|
|
73
|
-
}
|
|
74
|
-
}
|
|
75
|
-
|
|
76
|
-
& > section {
|
|
77
|
-
padding: 20px;
|
|
78
|
-
}
|
|
79
|
-
}
|