@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.
Files changed (196) hide show
  1. package/README.md +9 -0
  2. package/package.json +4 -1
  3. package/.babelrc +0 -5
  4. package/.github/workflows/main.yml +0 -45
  5. package/.history/.gitignore_20250415160643 +0 -6
  6. package/.history/.gitignore_20250415160723 +0 -6
  7. package/.history/examples/simple-webview/package-lock_20250415130242.json +0 -5109
  8. package/.history/examples/simple-webview/package-lock_20250416103557.json +0 -5109
  9. package/.history/examples/simple-webview/package_20250415130704.json +0 -26
  10. package/.history/examples/simple-webview/package_20250415184837.json +0 -26
  11. package/.history/examples/simple-webview/package_20250415190300.json +0 -23
  12. package/.history/examples/simple-webview/src/server_20250415105733.js +0 -20
  13. package/.history/examples/simple-webview/src/server_20250415184604.js +0 -20
  14. package/.history/examples/soundworks/package_20250415132431.json +0 -35
  15. package/.history/examples/soundworks/package_20250416105956.json +0 -35
  16. package/.history/max/CoMote/examples/simple-webview/package_20250415184836.json +0 -26
  17. package/.history/max/CoMote/examples/simple-webview/package_20250415185949.json +0 -23
  18. package/.history/max/CoMote/examples/simple-webview/package_20250415185950.json +0 -23
  19. package/.history/max/CoMote/package-info_20241018173608.json +0 -41
  20. package/.history/max/CoMote/package-info_20250416105743.json +0 -27
  21. package/.history/max/CoMote/package-info_20250416105826.json +0 -27
  22. package/.history/max/CoMote/source/comote-connect/package_20250415132759.json +0 -19
  23. package/.history/max/CoMote/source/comote-connect/package_20250416110158.json +0 -19
  24. package/.history/max/CoMote/source/comote-connect/server_20250414175059.js +0 -193
  25. package/.history/max/CoMote/source/comote-connect/server_20250415180549.js +0 -193
  26. package/.history/package_20250415143437.json +0 -26
  27. package/.history/package_20250416105907.json +0 -26
  28. package/examples/simple-webview/README.md +0 -10
  29. package/examples/simple-webview/build/comote-simple-webview-server.js +0 -44
  30. package/examples/simple-webview/package-lock.json +0 -5109
  31. package/examples/simple-webview/package.json +0 -23
  32. package/examples/simple-webview/public/favicon.ico +0 -0
  33. package/examples/simple-webview/public/index.html +0 -13
  34. package/examples/simple-webview/public/index.mjs +0 -3623
  35. package/examples/simple-webview/public/styles.css +0 -99
  36. package/examples/simple-webview/src/client.js +0 -35
  37. package/examples/simple-webview/src/server.js +0 -20
  38. package/examples/soundworks/.build/clients/components/sw-audit.js +0 -64
  39. package/examples/soundworks/.build/clients/components/sw-audit.js.map +0 -1
  40. package/examples/soundworks/.build/clients/components/sw-credits.js +0 -73
  41. package/examples/soundworks/.build/clients/components/sw-credits.js.map +0 -1
  42. package/examples/soundworks/.build/clients/player/.editorbackup/PlayerExperience.js~ +0 -131
  43. package/examples/soundworks/.build/clients/player/index.js +0 -116
  44. package/examples/soundworks/.build/clients/player/index.js.map +0 -1
  45. package/examples/soundworks/.build/clients/styles/app.scss +0 -79
  46. package/examples/soundworks/.build/clients/styles/normalize.scss +0 -359
  47. package/examples/soundworks/.build/clients/webview/index.js +0 -72
  48. package/examples/soundworks/.build/clients/webview/index.js.map +0 -1
  49. package/examples/soundworks/.build/public/css/app.css +0 -76
  50. package/examples/soundworks/.build/public/css/app.css.map +0 -1
  51. package/examples/soundworks/.build/public/css/normalize.css +0 -321
  52. package/examples/soundworks/.build/public/css/normalize.css.map +0 -1
  53. package/examples/soundworks/.build/public/player.js +0 -98098
  54. package/examples/soundworks/.build/public/player.js.map +0 -1
  55. package/examples/soundworks/.build/public/webview.js +0 -50725
  56. package/examples/soundworks/.build/public/webview.js.map +0 -1
  57. package/examples/soundworks/.build/server/index.js +0 -57
  58. package/examples/soundworks/.build/server/index.js.map +0 -1
  59. package/examples/soundworks/.build/server/schemas/.gitkeep +0 -1
  60. package/examples/soundworks/.build/server/schemas/global.js +0 -19
  61. package/examples/soundworks/.build/server/schemas/global.js.map +0 -1
  62. package/examples/soundworks/.build/server/tmpl/default.tmpl +0 -27
  63. package/examples/soundworks/.build/utils/catch-unhandled-errors.js +0 -9
  64. package/examples/soundworks/.build/utils/catch-unhandled-errors.js.map +0 -1
  65. package/examples/soundworks/.editorconfig +0 -12
  66. package/examples/soundworks/.eslintrc +0 -3
  67. package/examples/soundworks/.soundworks +0 -7
  68. package/examples/soundworks/.vendors/public/webcomponentsjs/CHANGELOG.md +0 -76
  69. package/examples/soundworks/.vendors/public/webcomponentsjs/LICENSE.md +0 -19
  70. package/examples/soundworks/.vendors/public/webcomponentsjs/README.md +0 -259
  71. package/examples/soundworks/.vendors/public/webcomponentsjs/bundles/webcomponents-ce.js +0 -63
  72. package/examples/soundworks/.vendors/public/webcomponentsjs/bundles/webcomponents-ce.js.map +0 -1
  73. package/examples/soundworks/.vendors/public/webcomponentsjs/bundles/webcomponents-pf_dom.js +0 -62
  74. package/examples/soundworks/.vendors/public/webcomponentsjs/bundles/webcomponents-pf_dom.js.map +0 -1
  75. package/examples/soundworks/.vendors/public/webcomponentsjs/bundles/webcomponents-pf_js.js +0 -95
  76. package/examples/soundworks/.vendors/public/webcomponentsjs/bundles/webcomponents-pf_js.js.map +0 -1
  77. package/examples/soundworks/.vendors/public/webcomponentsjs/bundles/webcomponents-sd-ce-pf.js +0 -374
  78. package/examples/soundworks/.vendors/public/webcomponentsjs/bundles/webcomponents-sd-ce-pf.js.map +0 -1
  79. package/examples/soundworks/.vendors/public/webcomponentsjs/bundles/webcomponents-sd-ce.js +0 -240
  80. package/examples/soundworks/.vendors/public/webcomponentsjs/bundles/webcomponents-sd-ce.js.map +0 -1
  81. package/examples/soundworks/.vendors/public/webcomponentsjs/bundles/webcomponents-sd.js +0 -196
  82. package/examples/soundworks/.vendors/public/webcomponentsjs/bundles/webcomponents-sd.js.map +0 -1
  83. package/examples/soundworks/.vendors/public/webcomponentsjs/custom-elements-es5-adapter.js +0 -15
  84. package/examples/soundworks/.vendors/public/webcomponentsjs/package.json +0 -51
  85. package/examples/soundworks/.vendors/public/webcomponentsjs/src/entrypoints/custom-elements-es5-adapter-index.js +0 -16
  86. package/examples/soundworks/.vendors/public/webcomponentsjs/src/entrypoints/webcomponents-bundle-index.js +0 -55
  87. package/examples/soundworks/.vendors/public/webcomponentsjs/src/entrypoints/webcomponents-ce-index.js +0 -17
  88. package/examples/soundworks/.vendors/public/webcomponentsjs/src/entrypoints/webcomponents-pf_dom-index.js +0 -19
  89. package/examples/soundworks/.vendors/public/webcomponentsjs/src/entrypoints/webcomponents-pf_js-index.js +0 -13
  90. package/examples/soundworks/.vendors/public/webcomponentsjs/src/entrypoints/webcomponents-sd-ce-index.js +0 -19
  91. package/examples/soundworks/.vendors/public/webcomponentsjs/src/entrypoints/webcomponents-sd-ce-pf-index.js +0 -25
  92. package/examples/soundworks/.vendors/public/webcomponentsjs/src/entrypoints/webcomponents-sd-index.js +0 -18
  93. package/examples/soundworks/.vendors/public/webcomponentsjs/src/flag-parser.js +0 -69
  94. package/examples/soundworks/.vendors/public/webcomponentsjs/src/platform/baseuri.js +0 -28
  95. package/examples/soundworks/.vendors/public/webcomponentsjs/src/platform/child-node/after.js +0 -47
  96. package/examples/soundworks/.vendors/public/webcomponentsjs/src/platform/child-node/before.js +0 -40
  97. package/examples/soundworks/.vendors/public/webcomponentsjs/src/platform/child-node/index.js +0 -14
  98. package/examples/soundworks/.vendors/public/webcomponentsjs/src/platform/child-node/remove.js +0 -37
  99. package/examples/soundworks/.vendors/public/webcomponentsjs/src/platform/child-node/replace-with.js +0 -42
  100. package/examples/soundworks/.vendors/public/webcomponentsjs/src/platform/custom-event.js +0 -79
  101. package/examples/soundworks/.vendors/public/webcomponentsjs/src/platform/es6-misc.js +0 -38
  102. package/examples/soundworks/.vendors/public/webcomponentsjs/src/platform/event-listener-options.js +0 -122
  103. package/examples/soundworks/.vendors/public/webcomponentsjs/src/platform/get-attribute-names.js +0 -27
  104. package/examples/soundworks/.vendors/public/webcomponentsjs/src/platform/matches.js +0 -21
  105. package/examples/soundworks/.vendors/public/webcomponentsjs/src/platform/parent-node/append.js +0 -31
  106. package/examples/soundworks/.vendors/public/webcomponentsjs/src/platform/parent-node/index.js +0 -13
  107. package/examples/soundworks/.vendors/public/webcomponentsjs/src/platform/parent-node/prepend.js +0 -42
  108. package/examples/soundworks/.vendors/public/webcomponentsjs/src/platform/parent-node/replace-children.js +0 -45
  109. package/examples/soundworks/.vendors/public/webcomponentsjs/src/platform/promise.js +0 -50
  110. package/examples/soundworks/.vendors/public/webcomponentsjs/src/platform/svg-element-class-list.js +0 -28
  111. package/examples/soundworks/.vendors/public/webcomponentsjs/src/platform/symbol.js +0 -64
  112. package/examples/soundworks/.vendors/public/webcomponentsjs/src/platform/toggle-attribute.js +0 -39
  113. package/examples/soundworks/.vendors/public/webcomponentsjs/src/unresolved.js +0 -32
  114. package/examples/soundworks/.vendors/public/webcomponentsjs/webcomponents-bundle.d.ts +0 -175
  115. package/examples/soundworks/.vendors/public/webcomponentsjs/webcomponents-bundle.js +0 -384
  116. package/examples/soundworks/.vendors/public/webcomponentsjs/webcomponents-bundle.js.map +0 -1
  117. package/examples/soundworks/.vendors/public/webcomponentsjs/webcomponents-loader.js +0 -238
  118. package/examples/soundworks/LICENSE +0 -28
  119. package/examples/soundworks/README.md +0 -26
  120. package/examples/soundworks/config/application.yaml +0 -8
  121. package/examples/soundworks/config/env-default.yaml +0 -12
  122. package/examples/soundworks/package.json +0 -35
  123. package/examples/soundworks/public/favicon.ico +0 -0
  124. package/examples/soundworks/public/images/loader.gif +0 -0
  125. package/examples/soundworks/src/clients/components/sw-audit.js +0 -78
  126. package/examples/soundworks/src/clients/components/sw-credits.js +0 -80
  127. package/examples/soundworks/src/clients/player/.editorbackup/PlayerExperience.js~ +0 -131
  128. package/examples/soundworks/src/clients/player/index.js +0 -118
  129. package/examples/soundworks/src/clients/styles/app.scss +0 -79
  130. package/examples/soundworks/src/clients/styles/normalize.scss +0 -359
  131. package/examples/soundworks/src/clients/webview/index.js +0 -78
  132. package/examples/soundworks/src/server/index.js +0 -62
  133. package/examples/soundworks/src/server/schemas/.gitkeep +0 -1
  134. package/examples/soundworks/src/server/schemas/global.js +0 -18
  135. package/examples/soundworks/src/server/tmpl/default.tmpl +0 -27
  136. package/examples/soundworks/src/utils/catch-unhandled-errors.js +0 -9
  137. package/index.html +0 -51
  138. package/max/CoMote/docs/sw.shared-state.maxref.xml +0 -95
  139. package/max/CoMote/examples/simple-webview/README.md +0 -10
  140. package/max/CoMote/examples/simple-webview/build/comote-simple-webview-server.js +0 -44
  141. package/max/CoMote/examples/simple-webview/comote-simple-webview-server.maxpat +0 -186
  142. package/max/CoMote/examples/simple-webview/package-lock.json +0 -5109
  143. package/max/CoMote/examples/simple-webview/package.json +0 -23
  144. package/max/CoMote/examples/simple-webview/public/favicon.ico +0 -0
  145. package/max/CoMote/examples/simple-webview/public/index.html +0 -13
  146. package/max/CoMote/examples/simple-webview/public/index.mjs +0 -3623
  147. package/max/CoMote/examples/simple-webview/public/styles.css +0 -99
  148. package/max/CoMote/examples/simple-webview/src/client.js +0 -35
  149. package/max/CoMote/examples/simple-webview/src/server.js +0 -20
  150. package/max/CoMote/examples/soundworks/.editorconfig +0 -12
  151. package/max/CoMote/examples/soundworks/.eslintrc +0 -3
  152. package/max/CoMote/examples/soundworks/.soundworks +0 -7
  153. package/max/CoMote/examples/soundworks/LICENSE +0 -28
  154. package/max/CoMote/examples/soundworks/README.md +0 -26
  155. package/max/CoMote/examples/soundworks/config/application.yaml +0 -8
  156. package/max/CoMote/examples/soundworks/config/env-default.yaml +0 -12
  157. package/max/CoMote/examples/soundworks/package.json +0 -35
  158. package/max/CoMote/examples/soundworks/public/favicon.ico +0 -0
  159. package/max/CoMote/examples/soundworks/public/images/loader.gif +0 -0
  160. package/max/CoMote/examples/soundworks/src/clients/components/sw-audit.js +0 -78
  161. package/max/CoMote/examples/soundworks/src/clients/components/sw-credits.js +0 -80
  162. package/max/CoMote/examples/soundworks/src/clients/player/.editorbackup/PlayerExperience.js~ +0 -131
  163. package/max/CoMote/examples/soundworks/src/clients/player/index.js +0 -118
  164. package/max/CoMote/examples/soundworks/src/clients/styles/app.scss +0 -79
  165. package/max/CoMote/examples/soundworks/src/clients/styles/normalize.scss +0 -359
  166. package/max/CoMote/examples/soundworks/src/clients/webview/index.js +0 -78
  167. package/max/CoMote/examples/soundworks/src/server/index.js +0 -62
  168. package/max/CoMote/examples/soundworks/src/server/schemas/.gitkeep +0 -1
  169. package/max/CoMote/examples/soundworks/src/server/schemas/global.js +0 -18
  170. package/max/CoMote/examples/soundworks/src/server/tmpl/default.tmpl +0 -27
  171. package/max/CoMote/examples/soundworks/src/utils/catch-unhandled-errors.js +0 -9
  172. package/max/CoMote/extras/CoMote.maxpat +0 -1994
  173. package/max/CoMote/help/comote_osc_receive.maxhelp +0 -946
  174. package/max/CoMote/icon.png +0 -0
  175. package/max/CoMote/init/objectmappings.txt +0 -2
  176. package/max/CoMote/media/comote-screenshot.png +0 -0
  177. package/max/CoMote/package-info.json +0 -27
  178. package/max/CoMote/patchers/comote-connect/comote-connect-public/comote-connect-client.mjs +0 -2821
  179. package/max/CoMote/patchers/comote-connect/comote-connect-public/favicon.ico +0 -0
  180. package/max/CoMote/patchers/comote-connect/comote-connect-public/index.html +0 -22
  181. package/max/CoMote/patchers/comote-connect/comote-connect-server.js +0 -24775
  182. package/max/CoMote/patchers/comote-connect/comote-connect.maxpat +0 -1048
  183. package/max/CoMote/patchers/comote-connect/package.json +0 -4
  184. package/max/CoMote/patchers/comote_format_from_comote_v2.maxpat +0 -613
  185. package/max/CoMote/patchers/comote_format_from_v3.maxpat +0 -443
  186. package/max/CoMote/patchers/comote_format_gyro_v2_to_v3.maxpat +0 -240
  187. package/max/CoMote/patchers/comote_format_gyro_v3_to_v2.maxpat +0 -240
  188. package/max/CoMote/patchers/comote_format_heading_v2_to_v3.maxpat +0 -171
  189. package/max/CoMote/patchers/comote_osc_receive.maxpat +0 -440
  190. package/max/CoMote/patchers/comote_osc_to_list.maxpat +0 -161
  191. package/max/CoMote/readme.md +0 -22
  192. package/max/CoMote/source/comote-connect/client.js +0 -104
  193. package/max/CoMote/source/comote-connect/package-lock.json +0 -591
  194. package/max/CoMote/source/comote-connect/package.json +0 -19
  195. package/max/CoMote/source/comote-connect/server.js +0 -193
  196. 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,12 +0,0 @@
1
- root = true
2
-
3
- [*]
4
- indent_style = space
5
- indent_size = 2
6
- end_of_line = LF
7
- charset = utf-8
8
- trim_trailing_whitespace = true
9
- insert_final_newline = true
10
-
11
- [*.md]
12
- trim_trailing_whitespace = false
@@ -1,3 +0,0 @@
1
- {
2
- "extends": "@ircam",
3
- }
@@ -1,7 +0,0 @@
1
- {
2
- "createVersion": "1.0.0-alpha.23",
3
- "name": "example-new",
4
- "eslint": true,
5
- "language": "js",
6
- "configFormat": "yaml"
7
- }
@@ -1,28 +0,0 @@
1
- Copyright (c) 2014-present IRCAM – Centre Pompidou (France, Paris)
2
-
3
- All rights reserved.
4
-
5
- Redistribution and use in source and binary forms, with or without modification,
6
- are permitted provided that the following conditions are met:
7
-
8
- * Redistributions of source code must retain the above copyright notice, this
9
- list of conditions and the following disclaimer.
10
-
11
- * Redistributions in binary form must reproduce the above copyright notice, this
12
- list of conditions and the following disclaimer in the documentation and/or
13
- other materials provided with the distribution.
14
-
15
- * Neither the name of the IRCAM nor the names of its
16
- contributors may be used to endorse or promote products derived from
17
- this software without specific prior written permission.
18
-
19
- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
20
- ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
21
- WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
22
- DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR
23
- ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
24
- (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
25
- LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
26
- ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
27
- (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
28
- SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
@@ -1,26 +0,0 @@
1
- # CoMote example app
2
-
3
- This application showcases the usage of the `comote-helpers` SDK for the CoMote application.
4
-
5
- ## Usage
6
-
7
- 1. Install Node.js LTS
8
- 2. Install and launch the Web application
9
-
10
- ```
11
- cd path/to/comote-helpers/example
12
- npm install
13
- npm run dev
14
- ```
15
-
16
- A web page will be accessible at `http://127.0.0.1:8000` on the computer running the server.
17
-
18
- 3. Connect your mobile phone on the same WiFi as the computer running the server
19
- 4. Launch the CoMote application on your mobile phone
20
- 5. Scan the QRCode on the web page from the CoMote application
21
-
22
- ...and enjoy the sensors and controls streamed to the Web page through WebSockets
23
-
24
- ## License
25
-
26
- [BSF-3-Clause](../LICENSE)
@@ -1,8 +0,0 @@
1
- name: "CoMote Example"
2
- author: ""
3
- clients:
4
- player:
5
- target: browser
6
- default: true
7
- webview:
8
- target: browser
@@ -1,12 +0,0 @@
1
- type: development
2
- port: 8000
3
- subpath: ""
4
- serverAddress: ""
5
- useHttps: false
6
- httpsInfos:
7
- cert: null
8
- key: null
9
- auth:
10
- clients: []
11
- login: ""
12
- password: ""
@@ -1,35 +0,0 @@
1
- {
2
- "name": "@ircam/comote-example-soundworks",
3
- "description": "comote soundworks example application",
4
- "authors": [],
5
- "license": "BSD-3-Clause",
6
- "version": "0.0.0",
7
- "type": "module",
8
- "private": true,
9
- "scripts": {
10
- "build": "npm run clean && sass src/clients/styles:.build/public/css && soundworks-build -b",
11
- "clean": "soundworks-build -D",
12
- "dev": "npm run build && (concurrently -i -p \"none\" \"npm run watch:inspect server\" \"soundworks-build -b -w\" \"npm run watch:sass\")",
13
- "start": "node .build/server/index.js",
14
- "watch": "soundworks-build -p",
15
- "watch:inspect": "soundworks-build -i -p",
16
- "watch:sass": "sass --watch src/clients/styles:.build/public/css",
17
- "lint": "eslint ."
18
- },
19
- "dependencies": {
20
- "@ircam/comote-helpers": "^1.0.0",
21
- "@ircam/sc-components": "^3.0.0-alpha.60",
22
- "@soundworks/core": "^4.0.0-alpha.21",
23
- "@soundworks/helpers": "^1.0.0-alpha.12",
24
- "json5": "^2.2.3",
25
- "lit": "^3.1.3"
26
- },
27
- "devDependencies": {
28
- "@ircam/eslint-config": "^1.2.1",
29
- "@soundworks/build": "^1.0.0-alpha.6",
30
- "@soundworks/create": "^1.0.0-alpha.23",
31
- "concurrently": "^8.2.2",
32
- "eslint": "^9.6.0",
33
- "sass": "^1.77.1"
34
- }
35
- }
@@ -1,78 +0,0 @@
1
- import { LitElement, html, css, nothing } from 'lit';
2
- import { unsafeHTML } from 'lit/directives/unsafe-html.js';
3
-
4
- function padLeft(value, size) {
5
- let str = value + ''; // cast to string
6
-
7
- while (str.length <= size) {
8
- str = `&nbsp;${str}`;
9
- }
10
-
11
- return str;
12
- }
13
-
14
- /**
15
- * Component for the soundworks internal audit state
16
- */
17
- class SwAudit extends LitElement {
18
- static styles = css`
19
- :host > div {
20
- background-color: var(--sw-light-background-color);
21
- height: 100%;
22
- padding: 0 20px;
23
- overflow: hidden;
24
- }
25
- `;
26
-
27
- constructor() {
28
- super();
29
-
30
- this.client = null;
31
- this._auditState = null;
32
- this._numClientsString = '';
33
- }
34
-
35
- async connectedCallback() {
36
- super.connectedCallback();
37
-
38
- this._auditState = await this.client.getAuditState();
39
- this._auditState.onUpdate(updates => {
40
- if ('numClients' in updates) {
41
- const numClientsStrings = [];
42
- const numClients = this._auditState.get('numClients');
43
-
44
- for (let role in numClients) {
45
- const str = `${role}: ${padLeft(numClients[role], 2)}`;
46
- numClientsStrings.push(str);
47
- }
48
-
49
- this._numClientsString = numClientsStrings.join(' - ');
50
- }
51
-
52
- this.requestUpdate();
53
- }, true);
54
- }
55
-
56
- disconnectedCallback() {
57
- super.disconnectedCallback();
58
-
59
- this._auditState.detach();
60
- }
61
-
62
- render() {
63
- if (this._auditState === null) {
64
- return nothing;
65
- }
66
-
67
- const avgLatency = this._auditState.get('averageNetworkLatency');
68
- const avgLatencyString = padLeft((avgLatency * 1e3).toFixed(2), 6);
69
-
70
- return html`
71
- <div>
72
- ${unsafeHTML(this._numClientsString)} | avg latency: ${unsafeHTML(avgLatencyString)} ms
73
- </div>
74
- `;
75
- }
76
- }
77
-
78
- customElements.define('sw-audit', SwAudit);
@@ -1,80 +0,0 @@
1
- import { LitElement, html, css, nothing } from 'lit';
2
-
3
- import '@ircam/sc-components/sc-icon.js';
4
-
5
- class SwCredits extends LitElement {
6
- static properties = {
7
- _show: {
8
- type: Boolean,
9
- state: true,
10
- },
11
- };
12
-
13
- static styles = css`
14
- :host {
15
- width: 100%;
16
- position: fixed;
17
- bottom: 0;
18
- left: 0;
19
- z-index: 1000;
20
- }
21
-
22
- :host > footer {
23
- display: block;
24
- line-height: 1.6rem;
25
- padding: 20px;
26
- background-color: var(--sw-light-background-color);
27
- box-sizing: border-box;
28
- }
29
-
30
- footer span {
31
- font-style: italic;
32
- color: var(--sw-light-font-color);
33
- font-weight: bold;
34
- }
35
-
36
- footer a {
37
- color: var(--sw-light-font-color);
38
- }
39
-
40
- sc-icon {
41
- position: absolute;
42
- bottom: 20px;
43
- right: 20px;
44
- z-index: 1001;
45
- border: none;
46
- background-color: transparent;
47
- opacity: 0.6;
48
- }
49
- `;
50
-
51
- constructor() {
52
- super();
53
-
54
- this._show = false;
55
- this.infos = {};
56
- }
57
-
58
- render() {
59
- const $footer = html`
60
- <footer>
61
- <p>
62
- <span>${this.infos.name}</span>
63
- ${this.infos.author ? html`by <span>${this.infos.author}</span>` : ``}
64
- has been developped using the <a href="https://soundworks.dev" target="_blank">soundworks</a>
65
- framework developped by the ISMM team at Ircam.
66
- </p>
67
- <p>
68
- Copyright (c) 2014-present IRCAM – Centre Pompidou (France, Paris)
69
- </p>
70
- </footer>
71
- `;
72
-
73
- return html`
74
- ${this._show ? $footer : nothing}
75
- <sc-icon type="question" @release=${e => this._show = !this._show}></sc-icon>
76
- `
77
- }
78
- }
79
-
80
- customElements.define('sw-credits', SwCredits);
@@ -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;