nodeskini 1.0.0
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 +31 -0
- package/client/archive/bundle.js +11528 -0
- package/client/archive/golem.html +60 -0
- package/client/archive/golemClient.js +595 -0
- package/client/archive/golembundle.js +11634 -0
- package/client/archive/sequencer.html +43 -0
- package/client/archive/sequenceurClient.js +815 -0
- package/client/archive/stylegolem.css +158 -0
- package/client/archive/stylesequenceur.css +204 -0
- package/client/clientListe/Sortable-master/.circleci/config.yml +33 -0
- package/client/clientListe/Sortable-master/.editorconfig +15 -0
- package/client/clientListe/Sortable-master/.github/ISSUE_TEMPLATE/bug-report.md +73 -0
- package/client/clientListe/Sortable-master/.github/ISSUE_TEMPLATE/custom-template.md +48 -0
- package/client/clientListe/Sortable-master/.github/ISSUE_TEMPLATE/feature-request.md +41 -0
- package/client/clientListe/Sortable-master/.jshintrc +25 -0
- package/client/clientListe/Sortable-master/.testcaferc.json +7 -0
- package/client/clientListe/Sortable-master/CONTRIBUTING.md +26 -0
- package/client/clientListe/Sortable-master/LICENSE +21 -0
- package/client/clientListe/Sortable-master/README.md +813 -0
- package/client/clientListe/Sortable-master/Sortable.js +3709 -0
- package/client/clientListe/Sortable-master/Sortable.min.js +2 -0
- package/client/clientListe/Sortable-master/Sortable.min.old.js +2 -0
- package/client/clientListe/Sortable-master/Sortable.min.old.old.js +2 -0
- package/client/clientListe/Sortable-master/babel.config.js +27 -0
- package/client/clientListe/Sortable-master/bower.json +30 -0
- package/client/clientListe/Sortable-master/entry/entry-complete.js +8 -0
- package/client/clientListe/Sortable-master/entry/entry-core.js +19 -0
- package/client/clientListe/Sortable-master/entry/entry-defaults.js +19 -0
- package/client/clientListe/Sortable-master/index.html +460 -0
- package/client/clientListe/Sortable-master/modular/sortable.complete.esm.js +3701 -0
- package/client/clientListe/Sortable-master/modular/sortable.core.esm.js +3698 -0
- package/client/clientListe/Sortable-master/modular/sortable.esm.js +3699 -0
- package/client/clientListe/Sortable-master/package-lock.json +5704 -0
- package/client/clientListe/Sortable-master/package.json +56 -0
- package/client/clientListe/Sortable-master/plugins/AutoScroll/AutoScroll.js +270 -0
- package/client/clientListe/Sortable-master/plugins/AutoScroll/README.md +80 -0
- package/client/clientListe/Sortable-master/plugins/AutoScroll/index.js +1 -0
- package/client/clientListe/Sortable-master/plugins/MultiDrag/MultiDrag.js +617 -0
- package/client/clientListe/Sortable-master/plugins/MultiDrag/README.md +96 -0
- package/client/clientListe/Sortable-master/plugins/MultiDrag/index.js +1 -0
- package/client/clientListe/Sortable-master/plugins/OnSpill/OnSpill.js +79 -0
- package/client/clientListe/Sortable-master/plugins/OnSpill/README.md +60 -0
- package/client/clientListe/Sortable-master/plugins/OnSpill/index.js +1 -0
- package/client/clientListe/Sortable-master/plugins/README.md +178 -0
- package/client/clientListe/Sortable-master/plugins/Swap/README.md +55 -0
- package/client/clientListe/Sortable-master/plugins/Swap/Swap.js +90 -0
- package/client/clientListe/Sortable-master/plugins/Swap/index.js +1 -0
- package/client/clientListe/Sortable-master/scripts/banner.js +8 -0
- package/client/clientListe/Sortable-master/scripts/build.js +17 -0
- package/client/clientListe/Sortable-master/scripts/esm-build.js +28 -0
- package/client/clientListe/Sortable-master/scripts/minify.js +11 -0
- package/client/clientListe/Sortable-master/scripts/test-compat.js +30 -0
- package/client/clientListe/Sortable-master/scripts/test.js +21 -0
- package/client/clientListe/Sortable-master/scripts/umd-build.js +15 -0
- package/client/clientListe/Sortable-master/src/Animation.js +175 -0
- package/client/clientListe/Sortable-master/src/BrowserInfo.js +12 -0
- package/client/clientListe/Sortable-master/src/EventDispatcher.js +57 -0
- package/client/clientListe/Sortable-master/src/PluginManager.js +87 -0
- package/client/clientListe/Sortable-master/src/Sortable.js +1971 -0
- package/client/clientListe/Sortable-master/src/utils.js +556 -0
- package/client/clientListe/Sortable-master/st/app.js +224 -0
- package/client/clientListe/Sortable-master/st/iframe/frame.html +32 -0
- package/client/clientListe/Sortable-master/st/iframe/index.html +49 -0
- package/client/clientListe/Sortable-master/st/logo.png +0 -0
- package/client/clientListe/Sortable-master/st/og-image.png +0 -0
- package/client/clientListe/Sortable-master/st/prettify/prettify.css +1 -0
- package/client/clientListe/Sortable-master/st/prettify/prettify.js +46 -0
- package/client/clientListe/Sortable-master/st/prettify/run_prettify.js +64 -0
- package/client/clientListe/Sortable-master/st/saucelabs.svg +1 -0
- package/client/clientListe/Sortable-master/st/theme.css +254 -0
- package/client/clientListe/Sortable-master/tests/Sortable.compat.test.js +39 -0
- package/client/clientListe/Sortable-master/tests/Sortable.test.js +386 -0
- package/client/clientListe/Sortable-master/tests/dual-list.html +34 -0
- package/client/clientListe/Sortable-master/tests/empty-list.html +30 -0
- package/client/clientListe/Sortable-master/tests/filter.html +27 -0
- package/client/clientListe/Sortable-master/tests/handles.html +27 -0
- package/client/clientListe/Sortable-master/tests/nested.html +67 -0
- package/client/clientListe/Sortable-master/tests/single-list.html +25 -0
- package/client/clientListe/Sortable-master/tests/style.css +18 -0
- package/client/clientListe/clientListe.html +148 -0
- package/client/clientListe/clientListe.js +1508 -0
- package/client/clientListe/clientListebundle.js +13164 -0
- package/client/clientListe/images/poubelle.png +0 -0
- package/client/clientListe/images/start.png +0 -0
- package/client/clientListe/images/stop.png +0 -0
- package/client/clientListe/images/submit.png +0 -0
- package/client/clientListe/sortable-theme-bootstrap.css +90 -0
- package/client/configurateur/configReact.js +273 -0
- package/client/configurateur/configReactbundle.js +295 -0
- package/client/configurateur/configurateur.css +95 -0
- package/client/configurateur/configurateur.html +48 -0
- package/client/configurateur/lib/jexcel.css +755 -0
- package/client/configurateur/lib/jexcel.js +14970 -0
- package/client/configurateur/lib/jsuites.css +2801 -0
- package/client/configurateur/lib/jsuites.js +11822 -0
- package/client/configurateur/lib/react-dom.production.min.js +239 -0
- package/client/configurateur/lib/react.production.min.js +32 -0
- package/client/configurateur/src/configReact.js +247 -0
- package/client/controleur/clientcontroleur.js +536 -0
- package/client/controleur/clientcontroleur.test.js +282 -0
- package/client/controleur/controleur.html +51 -0
- package/client/controleur/controleurbundle.js +565 -0
- package/client/controleur/stylecontroleur.css +236 -0
- package/client/controleurHH/controleurHH.html +71 -0
- package/client/controleurHH/controleurHH.js +252 -0
- package/client/controleurHH/styles/index.css +320 -0
- package/client/controleurHH/styles/material.css +11552 -0
- package/client/parametrage/paramReact.js +473 -0
- package/client/parametrage/paramReactbundle.js +500 -0
- package/client/parametrage/parametrage.css +111 -0
- package/client/parametrage/parametrage.html +163 -0
- package/client/parametrage/src/paramReact.js +459 -0
- package/client/score/hash.js +83 -0
- package/client/score/p5.min.js +3 -0
- package/client/score/parto1.js +1171 -0
- package/client/score/parto1bundle.js +1181 -0
- package/client/score/processing.min.js +431 -0
- package/client/score/score.html +15 -0
- package/client/score/score.js +34 -0
- package/client/simulateurListe/simulateurFork.js +750 -0
- package/client/simulateurListe/simulateurFork.mjs +681 -0
- package/client/simulateurListe/simulateurForkSansReorg.js +569 -0
- package/client/simulateurListe/simulateurListe.js +628 -0
- package/myReact/archive/Nodeemitvaluedlocal1.hh.js +52 -0
- package/myReact/archive/abort-parNode.js +79 -0
- package/myReact/archive/abroNode.js +169 -0
- package/myReact/archive/abroNode2.js +80 -0
- package/myReact/archive/atom.compile.hh.js +51 -0
- package/myReact/archive/await-countNode.js +67 -0
- package/myReact/archive/await-nowvalNode.js +44 -0
- package/myReact/archive/callHH.js +96 -0
- package/myReact/archive/emit-if2.hh.compiled.js +113 -0
- package/myReact/archive/every1Node.js +35 -0
- package/myReact/archive/if-runNode.js +74 -0
- package/myReact/archive/if1Node.js +43 -0
- package/myReact/archive/makeawait.js +0 -0
- package/myReact/archive/myReact.old.js +684 -0
- package/myReact/archive/orchestration.js +281 -0
- package/myReact/archive/orchestration1.js +132 -0
- package/myReact/archive/orchestration1.xml +465 -0
- package/myReact/archive/orchestration2.js +161 -0
- package/myReact/archive/orchestrationHH.mano.js +280 -0
- package/myReact/archive/orchestrationHHTest.js +428 -0
- package/myReact/archive/orchestrationHHTest.xml +234 -0
- package/myReact/archive/orchestrationHHTestRun.js +104 -0
- package/myReact/archive/orchestrationHHTestRun.xml +34 -0
- package/myReact/archive/orchestrationTest0.js +178 -0
- package/myReact/archive/orchestrationTest1.js +181 -0
- package/myReact/archive/orchestrationTest2.js +281 -0
- package/myReact/archive/run3pointsNode.js +59 -0
- package/myReact/archive/runNode.js +123 -0
- package/myReact/archive/runNode2.js +91 -0
- package/myReact/archive/testAwait1.js +141 -0
- package/myReact/archive/testAwait1.xml +86 -0
- package/myReact/archive/testEvery1.js +122 -0
- package/myReact/archive/testEvery1.xml +79 -0
- package/myReact/archive/testHH1.js +135 -0
- package/myReact/archive/testHH1.xml +86 -0
- package/myReact/archive/testHH1revu.js +104 -0
- package/myReact/archive/testHH2.js +122 -0
- package/myReact/archive/testHH2.xml +79 -0
- package/myReact/archive/testHH3.js +130 -0
- package/myReact/archive/testHH3.xml +86 -0
- package/myReact/archive/testHHabort.js +121 -0
- package/myReact/archive/testHHabort.xml +83 -0
- package/myReact/archive/testMakeawait.js +202 -0
- package/myReact/archive/testRun1.js +168 -0
- package/myReact/archive/testRun1.xml +142 -0
- package/myReact/archive/titi.js +28 -0
- package/myReact/archive/titi.xml +110 -0
- package/myReact/archive/toto.js +73 -0
- package/myReact/archive/toto.xml +198 -0
- package/myReact/archive/trap-await-parallelNode.js +123 -0
- package/myReact/inutiles/hiver2022.xml +804 -0
- package/myReact/inutiles/hopeNode.xml +459 -0
- package/myReact/inutiles/mars2022.xml +871 -0
- package/myReact/inutiles/mystique1.xml +318 -0
- package/myReact/inutiles/mystiqueOSC.xml +277 -0
- package/myReact/inutiles/opus5Node.xml +1271 -0
- package/myReact/inutiles/opus5NodeLinux.xml +1241 -0
- package/myReact/inutiles/orchestrationHH.xml +541 -0
- package/myReact/inutiles/orchestrationHH2.xml +547 -0
- package/myReact/inutiles/testHH.xml +95 -0
- package/myReact/inutiles/trouveLaPercuTenor.xml +349 -0
- package/myReact/myReact.js +744 -0
- package/myReact/myReact.min.js +1 -0
- package/myReact/orchestrationHH.js +311 -0
- package/myReact/orchestrationHH.mjs +436 -0
- package/myReact/orchestrationHH.mjs.map +1 -0
- package/package.json +46 -0
- package/serveur/OSCandMidi.mjs +361 -0
- package/serveur/computeScore.mjs +415 -0
- package/serveur/controleDAW.mjs +1149 -0
- package/serveur/defaultSession.csv +2 -0
- package/serveur/defaultSkiniParametres.js +119 -0
- package/serveur/gameOSC.mjs +96 -0
- package/serveur/groupeClientsSons.mjs +1014 -0
- package/serveur/ipConfig.json +24 -0
- package/serveur/ipConfig127.json +19 -0
- package/serveur/ipConfig75.json +17 -0
- package/serveur/ipConfigBH.json +19 -0
- package/serveur/ipConfigLocal.json +19 -0
- package/serveur/midiConfig.json +26 -0
- package/serveur/midiConfigBH.json +26 -0
- package/serveur/midiConfigVoid.json +3 -0
- package/serveur/midimix.mjs +570 -0
- package/serveur/saveParam.mjs +159 -0
- package/serveur/skiniParametres.good.js +132 -0
- package/serveur/skiniParametres.js +106 -0
- package/serveur/utilsHHSkini.hh.js +64 -0
- package/serveur/utilsSkini.mjs +137 -0
- package/serveur/websocketServer.mjs +2052 -0
- package/serveur/workerInterfaceZ.mjs +327 -0
- package/serveur/workerSynchro.mjs +49 -0
- package/skini.mjs +141 -0
|
@@ -0,0 +1,565 @@
|
|
|
1
|
+
(function(){function r(e,n,t){function o(i,f){if(!n[i]){if(!e[i]){var c="function"==typeof require&&require;if(!f&&c)return c(i,!0);if(u)return u(i,!0);var a=new Error("Cannot find module '"+i+"'");throw a.code="MODULE_NOT_FOUND",a}var p=n[i]={exports:{}};e[i][0].call(p.exports,function(r){var n=e[i][1][r];return o(n||r)},p,p.exports,r,e,n,t)}return n[i].exports}for(var u="function"==typeof require&&require,i=0;i<t.length;i++)o(t[i]);return o}return r})()({1:[function(require,module,exports){
|
|
2
|
+
/**
|
|
3
|
+
* @fileOverview
|
|
4
|
+
* Controle de la matrice des possibles
|
|
5
|
+
* entre groupe de sons et groupe de clients
|
|
6
|
+
*
|
|
7
|
+
* browserify .\clientcontroleur.js -o .\controleurbundle.js
|
|
8
|
+
* sur Mac
|
|
9
|
+
* browserify ./clientcontroleur.js -o ./controleurbundle.js
|
|
10
|
+
*
|
|
11
|
+
* @copyright (C) 2022-2024 Bertrand Petit-Hédelin
|
|
12
|
+
*
|
|
13
|
+
* This program is free software: you can redistribute it and/or modify
|
|
14
|
+
* it under the terms of the GNU General Public License as published by
|
|
15
|
+
* the Free Software Foundation, either version 3 of the License, or
|
|
16
|
+
* any later version.
|
|
17
|
+
*
|
|
18
|
+
* This program is distributed in the hope that it will be useful,
|
|
19
|
+
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
20
|
+
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
21
|
+
* GNU General Public License for more details.
|
|
22
|
+
*
|
|
23
|
+
* You should have received a copy of the GNU General Public License
|
|
24
|
+
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
|
25
|
+
*
|
|
26
|
+
* @version 1.3
|
|
27
|
+
* @author Bertrand Petit-Hédelin <bertrand@hedelin.fr>
|
|
28
|
+
*/
|
|
29
|
+
"use strict"
|
|
30
|
+
|
|
31
|
+
var par;
|
|
32
|
+
var ipConfig = require('../../serveur/ipConfig');
|
|
33
|
+
|
|
34
|
+
var port;
|
|
35
|
+
var ws;
|
|
36
|
+
var id = Math.floor((Math.random() * 1000000) + 1); // Pour identifier le client;
|
|
37
|
+
|
|
38
|
+
var matricePad;
|
|
39
|
+
|
|
40
|
+
var nbeLignesPad;
|
|
41
|
+
var nbeColonesPad;
|
|
42
|
+
var etatScrutateurs = [];
|
|
43
|
+
|
|
44
|
+
var bleu = "#008CBA";
|
|
45
|
+
var rouge = '#CF1919';
|
|
46
|
+
var vert = "#4CAF50";
|
|
47
|
+
var marron = '#666633';
|
|
48
|
+
var violet = '#797bbf';
|
|
49
|
+
var orange = '#b3712d';
|
|
50
|
+
|
|
51
|
+
var debug = false;
|
|
52
|
+
var debug1 = true;
|
|
53
|
+
|
|
54
|
+
var DAWTableEnCours = 0;
|
|
55
|
+
var automateEncours = true;
|
|
56
|
+
var serverHostname;
|
|
57
|
+
// Autres déclarations
|
|
58
|
+
|
|
59
|
+
// On met des valeurs pas defaut, mais ce n'est pas nécessaire.
|
|
60
|
+
const msg = { type: "configuration" };
|
|
61
|
+
|
|
62
|
+
const COLORS = {
|
|
63
|
+
BLEU: "padBoutonBleu",
|
|
64
|
+
DEFAULT: "padBouton",
|
|
65
|
+
};
|
|
66
|
+
|
|
67
|
+
// Cette fonction est activée à la demande de chaque client sequenceur
|
|
68
|
+
// Le client séquenceur peut envoyer cette ordre de deux façon:
|
|
69
|
+
// - clic sur erase par le client sequenceur
|
|
70
|
+
// - réception par le client séquenceur d'un broadcast 'resetSequenceur' émis par websocketServeur lorsqu'il reçoit une demande du controleur:
|
|
71
|
+
// controleur ---- ws "resetSequenceur" ---> websocketserveur ----- broadcast "resetSequenceur" ----> clientsequenceur ---------- ws vers Processing "erasePatern" -----> Processing vide
|
|
72
|
+
// C'est un montage compliqué mais Processing ne reçoit pas les broadcast de hop.
|
|
73
|
+
function resetSequenceur() {
|
|
74
|
+
ws.send(JSON.stringify({ type: "resetSequenceur" }));
|
|
75
|
+
}
|
|
76
|
+
window.resetSequenceur = resetSequenceur;
|
|
77
|
+
|
|
78
|
+
function creationPad() {
|
|
79
|
+
|
|
80
|
+
const place = document.getElementById("listBoutonsLiens");
|
|
81
|
+
let compteurBouton = 0;
|
|
82
|
+
|
|
83
|
+
// On vide le PAD
|
|
84
|
+
place.innerHTML = '';
|
|
85
|
+
|
|
86
|
+
// Première ligne
|
|
87
|
+
var em = document.createElement("a");
|
|
88
|
+
em.setAttribute("class", "texteSon");
|
|
89
|
+
place.appendChild(em);
|
|
90
|
+
em.innerHTML = "-";
|
|
91
|
+
|
|
92
|
+
for (let j = 0; j < nbeColonesPad; j++) {
|
|
93
|
+
var em = document.createElement("button");
|
|
94
|
+
em.dataset.colone = j;
|
|
95
|
+
em.setAttribute("class", "numColone");
|
|
96
|
+
em.addEventListener("click", function (event) { clickColoneBouton(this.dataset.colone); });
|
|
97
|
+
place.appendChild(em);
|
|
98
|
+
em.innerHTML = j;
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
place.appendChild(document.createElement("br"));
|
|
102
|
+
|
|
103
|
+
// Le PAD
|
|
104
|
+
for (let i = 0; i < nbeLignesPad; i++) {
|
|
105
|
+
const em = document.createElement("a");
|
|
106
|
+
em.setAttribute("class", "texteSon");
|
|
107
|
+
place.appendChild(em);
|
|
108
|
+
em.innerHTML = i;
|
|
109
|
+
|
|
110
|
+
for (let j = 0; j < nbeColonesPad; j++) {
|
|
111
|
+
const bouton = document.createElement("button");
|
|
112
|
+
bouton.id = "padBouton" + compteurBouton;
|
|
113
|
+
compteurBouton++;
|
|
114
|
+
bouton.dataset.ligne = i;
|
|
115
|
+
bouton.dataset.colone = j;
|
|
116
|
+
|
|
117
|
+
bouton.setAttribute("class", "padBouton");
|
|
118
|
+
bouton.addEventListener("click", () => clickPadBouton(bouton.id));
|
|
119
|
+
place.appendChild(bouton);
|
|
120
|
+
}
|
|
121
|
+
place.appendChild(document.createElement("br"));
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
// Etat des scrutateurs
|
|
125
|
+
etatScrutateurs = Array(nbeColonesPad).fill(0);
|
|
126
|
+
const scrutHeader = document.createElement("a");
|
|
127
|
+
scrutHeader.className = "texteSon";
|
|
128
|
+
scrutHeader.innerHTML = "-";
|
|
129
|
+
place.appendChild(scrutHeader);
|
|
130
|
+
|
|
131
|
+
for (let j = 0; j < nbeColonesPad; j++) {
|
|
132
|
+
const em = document.createElement("button");
|
|
133
|
+
em.setAttribute("class", "etatScrut");
|
|
134
|
+
em.setAttribute("id", "etatScrut" + j);
|
|
135
|
+
place.appendChild(em);
|
|
136
|
+
em.innerHTML = "-";
|
|
137
|
+
}
|
|
138
|
+
place.appendChild(document.createElement("br"));
|
|
139
|
+
}
|
|
140
|
+
|
|
141
|
+
function setPadButton(son, groupe, status) {
|
|
142
|
+
// Traite une colone complète
|
|
143
|
+
if (groupe === 255) {
|
|
144
|
+
let id = parseInt(son);
|
|
145
|
+
for (let j = 0; j < nbeLignesPad; j++) {
|
|
146
|
+
const button = document.getElementById(`padBouton${id}`);
|
|
147
|
+
if (!button) return console.error("ERR setAllPad: boutton undefined", id);
|
|
148
|
+
button.className = status ? COLORS.BLEU : COLORS.DEFAULT;
|
|
149
|
+
id += nbeColonesPad;
|
|
150
|
+
}
|
|
151
|
+
return;
|
|
152
|
+
}
|
|
153
|
+
|
|
154
|
+
if (groupe >= par.nbeDeGroupesClients || son >= nbeColonesPad) {
|
|
155
|
+
return console.error("ERR: setPadButton out of bounds", { son, groupe });
|
|
156
|
+
}
|
|
157
|
+
|
|
158
|
+
const index = parseInt(son) + groupe * nbeColonesPad;
|
|
159
|
+
const idBouton = "padBouton" + index;
|
|
160
|
+
if (debug) console.log("clientcontroleur:setPadButton:idBouton", idBouton);
|
|
161
|
+
const leBouton = document.getElementById(idBouton);
|
|
162
|
+
leBouton.className = status ? COLORS.BLEU : COLORS.DEFAULT;
|
|
163
|
+
}
|
|
164
|
+
|
|
165
|
+
function clickColoneBouton(colone) {
|
|
166
|
+
let id = parseInt(colone);
|
|
167
|
+
let status;
|
|
168
|
+
|
|
169
|
+
if (debug) console.log("clickColoneBouton: bouton:", id, " nbeColonesPad:", nbeColonesPad);
|
|
170
|
+
|
|
171
|
+
for (let j = 0; j < nbeLignesPad; j++) {
|
|
172
|
+
const bouton = document.getElementById("padBouton" + id.toString());
|
|
173
|
+
|
|
174
|
+
if (bouton == undefined) {
|
|
175
|
+
console.log("ERR setAlclickColoneBouton: bouton undefined", id);
|
|
176
|
+
return;
|
|
177
|
+
}
|
|
178
|
+
|
|
179
|
+
if (bouton.getAttribute("class") == "padBoutonBleu") { // Désactive le lien entre groupes
|
|
180
|
+
bouton.setAttribute("class", "padBouton");
|
|
181
|
+
status = false;
|
|
182
|
+
|
|
183
|
+
} else { // Active le lien
|
|
184
|
+
bouton.setAttribute("class", "padBoutonBleu");
|
|
185
|
+
status = true;
|
|
186
|
+
}
|
|
187
|
+
|
|
188
|
+
ws.send(JSON.stringify({
|
|
189
|
+
type: "putInMatriceDesPossibles",
|
|
190
|
+
clients: j,
|
|
191
|
+
sons: colone,
|
|
192
|
+
status
|
|
193
|
+
}));
|
|
194
|
+
|
|
195
|
+
id += nbeColonesPad;
|
|
196
|
+
}
|
|
197
|
+
}
|
|
198
|
+
window.clickColoneBouton = clickColoneBouton;
|
|
199
|
+
|
|
200
|
+
// Quand on clique un bouton (X,Y)
|
|
201
|
+
function clickPadBouton(padBoutonId) {
|
|
202
|
+
const button = document.getElementById(padBoutonId);
|
|
203
|
+
const isActive = button.className === COLORS.BLEU;
|
|
204
|
+
const status = !isActive;
|
|
205
|
+
button.className = status ? COLORS.BLEU : COLORS.DEFAULT;
|
|
206
|
+
|
|
207
|
+
ws.send(JSON.stringify({
|
|
208
|
+
type: "putInMatriceDesPossibles",
|
|
209
|
+
clients: button.dataset.ligne,
|
|
210
|
+
sons: button.dataset.colone,
|
|
211
|
+
status
|
|
212
|
+
}));
|
|
213
|
+
}
|
|
214
|
+
exports.clickPadBouton = clickPadBouton;
|
|
215
|
+
|
|
216
|
+
function resetAllPad() {
|
|
217
|
+
if (automateEncours) {
|
|
218
|
+
let id = 0;
|
|
219
|
+
for (let j = 0; j < nbeLignesPad; j++) {
|
|
220
|
+
for (let i = 0; i < nbeColonesPad; i++) {
|
|
221
|
+
const bouton = document.getElementById("padBouton" + id.toString());
|
|
222
|
+
if (bouton == undefined) {
|
|
223
|
+
console.log("setAllPad:undefined", colone);
|
|
224
|
+
return;
|
|
225
|
+
}
|
|
226
|
+
bouton.setAttribute("class", "padBouton");
|
|
227
|
+
id++;
|
|
228
|
+
}
|
|
229
|
+
}
|
|
230
|
+
|
|
231
|
+
const msg = {
|
|
232
|
+
type: "ResetMatriceDesPossibles",
|
|
233
|
+
};
|
|
234
|
+
ws.send(JSON.stringify(msg));
|
|
235
|
+
} else {
|
|
236
|
+
alert("WARNING: Nothing to reset")
|
|
237
|
+
}
|
|
238
|
+
}
|
|
239
|
+
window.resetAllPad = resetAllPad;
|
|
240
|
+
|
|
241
|
+
function cleanPad() {
|
|
242
|
+
if (automateEncours) {
|
|
243
|
+
var id = 0;
|
|
244
|
+
for (var j = 0; j < nbeLignesPad; j++) {
|
|
245
|
+
for (var i = 0; i < nbeColonesPad; i++) {
|
|
246
|
+
var bouton = document.getElementById("padBouton" + id.toString());
|
|
247
|
+
if (bouton == undefined) {
|
|
248
|
+
console.log("setAllPad:undefined", colone);
|
|
249
|
+
return;
|
|
250
|
+
}
|
|
251
|
+
bouton.setAttribute("class", "padBouton");
|
|
252
|
+
id++;
|
|
253
|
+
}
|
|
254
|
+
}
|
|
255
|
+
}
|
|
256
|
+
}
|
|
257
|
+
|
|
258
|
+
function setAllPad() {
|
|
259
|
+
if (automateEncours) {
|
|
260
|
+
var id = 0;
|
|
261
|
+
for (var j = 0; j < nbeLignesPad; j++) {
|
|
262
|
+
for (var i = 0; i < nbeColonesPad; i++) {
|
|
263
|
+
var bouton = document.getElementById("padBouton" + id.toString());
|
|
264
|
+
if (bouton == undefined) {
|
|
265
|
+
console.log("setAllPad:undefined", colone);
|
|
266
|
+
return;
|
|
267
|
+
}
|
|
268
|
+
bouton.setAttribute("class", "padBoutonBleu");
|
|
269
|
+
id++;
|
|
270
|
+
}
|
|
271
|
+
}
|
|
272
|
+
var msg = {
|
|
273
|
+
type: "setAllMatriceDesPossibles",
|
|
274
|
+
};
|
|
275
|
+
ws.send(JSON.stringify(msg));
|
|
276
|
+
} else {
|
|
277
|
+
alert("WARNING: Nothing to set ALL")
|
|
278
|
+
}
|
|
279
|
+
}
|
|
280
|
+
window.setAllPad = setAllPad;
|
|
281
|
+
|
|
282
|
+
function cleanQueues() {
|
|
283
|
+
var msg = {
|
|
284
|
+
type: "cleanQueues",
|
|
285
|
+
};
|
|
286
|
+
ws.send(JSON.stringify(msg));
|
|
287
|
+
}
|
|
288
|
+
window.cleanQueues = cleanQueues;
|
|
289
|
+
|
|
290
|
+
//****** Lancement des opérations et fermeture *********
|
|
291
|
+
|
|
292
|
+
function initialisation() {
|
|
293
|
+
|
|
294
|
+
// Attention: si on envoie un message ici sur la websocket immédiatament après la reconnexion.
|
|
295
|
+
// Il se peut que la socket ne soit pas encore prête. Il y a des choses à faire avec readyState.
|
|
296
|
+
|
|
297
|
+
document.getElementById("MessageDuServeur").style.display = "inline";
|
|
298
|
+
|
|
299
|
+
// Attention block et pas inline pour les div
|
|
300
|
+
var el = document.getElementById("listBoutonsLiens");
|
|
301
|
+
el.style.display = "block";
|
|
302
|
+
|
|
303
|
+
initServerListener();
|
|
304
|
+
|
|
305
|
+
setInterval(function () {
|
|
306
|
+
getNbeDeSpectateurs();
|
|
307
|
+
}, 1000);
|
|
308
|
+
}
|
|
309
|
+
exports.initialisation = initialisation;
|
|
310
|
+
|
|
311
|
+
function getNbeDeSpectateurs() {
|
|
312
|
+
var msg = {
|
|
313
|
+
type: "getGroupesClientLength",
|
|
314
|
+
};
|
|
315
|
+
ws.send(JSON.stringify(msg));
|
|
316
|
+
}
|
|
317
|
+
|
|
318
|
+
function initControleur(serverHostname) {
|
|
319
|
+
initWSSocket(serverHostname);
|
|
320
|
+
initialisation();
|
|
321
|
+
}
|
|
322
|
+
window.initControleur = initControleur;
|
|
323
|
+
|
|
324
|
+
// Gestion de la fermeture du browser
|
|
325
|
+
window.onbeforeunload = function () {
|
|
326
|
+
msg.type = "closeSpectateur";
|
|
327
|
+
msg.text = "DISCONNECT_SPECTATEUR";
|
|
328
|
+
ws.send(JSON.stringify(msg));
|
|
329
|
+
ws.close();
|
|
330
|
+
}
|
|
331
|
+
|
|
332
|
+
function checkSession() {
|
|
333
|
+
msg.type = "checkSession";
|
|
334
|
+
ws.send(JSON.stringify(msg));
|
|
335
|
+
}
|
|
336
|
+
window.checkSession = checkSession;
|
|
337
|
+
|
|
338
|
+
/* function loadSession() {
|
|
339
|
+
var reponse = window.prompt("Descriptor file");
|
|
340
|
+
if (reponse === undefined || reponse === '') return;
|
|
341
|
+
|
|
342
|
+
var fileName;
|
|
343
|
+
fileName = par.sequencerFilePath + reponse + '.csv';
|
|
344
|
+
if (debug1) console.log("loadSession:", fileName);
|
|
345
|
+
msg.type = "loadSession";
|
|
346
|
+
msg.fileName = fileName;
|
|
347
|
+
ws.send(JSON.stringify(msg));
|
|
348
|
+
}
|
|
349
|
+
window.loadSession = loadSession; */
|
|
350
|
+
|
|
351
|
+
/* function saveSession() {
|
|
352
|
+
var reponse = window.prompt("Descriptor file");
|
|
353
|
+
if (reponse === undefined || reponse === '') return;
|
|
354
|
+
|
|
355
|
+
var fileName;
|
|
356
|
+
fileName = par.sequencerFilePath + reponse + '.csv';
|
|
357
|
+
if (debug1) console.log("saveSession:", fileName);
|
|
358
|
+
msg.type = "saveSession";
|
|
359
|
+
msg.fileName = fileName;
|
|
360
|
+
ws.send(JSON.stringify(msg));
|
|
361
|
+
}
|
|
362
|
+
window.saveSession = saveSession; */
|
|
363
|
+
|
|
364
|
+
//************ WEBSOCKET et listener BROADCAST ******************************
|
|
365
|
+
function initWSSocket(host) {
|
|
366
|
+
var toggle = true;
|
|
367
|
+
ws = new WebSocket("ws://" + host + ":" + ipConfig.websocketServeurPort);
|
|
368
|
+
|
|
369
|
+
if (debug1) console.log("clientcontroleur.js ws://" + host + ":" + ipConfig.websocketServeurPort);
|
|
370
|
+
ws.onopen = function (event) {
|
|
371
|
+
msg.type = "startSpectateur";
|
|
372
|
+
msg.text = "controleur";
|
|
373
|
+
msg.id = id;
|
|
374
|
+
console.log("ID sent to server:", msg.id);
|
|
375
|
+
ws.send(JSON.stringify(msg));
|
|
376
|
+
};
|
|
377
|
+
|
|
378
|
+
//Traitement de la Réception sur le client
|
|
379
|
+
ws.onmessage = function (event) {
|
|
380
|
+
//console.log( "Client: received [%s]", event.data );
|
|
381
|
+
|
|
382
|
+
var msgRecu = JSON.parse(event.data);
|
|
383
|
+
if (debug) console.log("message reçu: ", msgRecu.type);
|
|
384
|
+
|
|
385
|
+
switch (msgRecu.type) {
|
|
386
|
+
case "DAWTableNotReady": // Si la table n'est pas chargée on garde le bouton start
|
|
387
|
+
alert(msgRecu.text);
|
|
388
|
+
document.getElementById("buttonStartAutomate").style.display = "inline";
|
|
389
|
+
document.getElementById("buttonStopAutomate").style.display = "none";
|
|
390
|
+
break;
|
|
391
|
+
|
|
392
|
+
case "etatDeLaFileAttente":
|
|
393
|
+
if (debug) console.log("etatDeLaFileAttente:", msgRecu);
|
|
394
|
+
|
|
395
|
+
var texteAffiche = ' ';
|
|
396
|
+
|
|
397
|
+
if (msgRecu.value === undefined) {
|
|
398
|
+
console.log("WARN: clientcontroleur: etatDeLaFileAttente undefined");
|
|
399
|
+
break;
|
|
400
|
+
}
|
|
401
|
+
for (var i = 0; i < msgRecu.value.length; i++) {
|
|
402
|
+
if (msgRecu.value[i].length !== 0) {
|
|
403
|
+
texteAffiche += "[" + i + ":" + msgRecu.value[i][1] + "] ";
|
|
404
|
+
} else {
|
|
405
|
+
texteAffiche += " ";
|
|
406
|
+
}
|
|
407
|
+
}
|
|
408
|
+
|
|
409
|
+
document.getElementById("FileAttente").innerHTML = texteAffiche;
|
|
410
|
+
break;
|
|
411
|
+
|
|
412
|
+
case "groupesClientLength":
|
|
413
|
+
if (debug) console.log("groupesClientLength:", msgRecu.longueurs);
|
|
414
|
+
|
|
415
|
+
var groupesDisplay = " ";
|
|
416
|
+
for (var i = 0; i < msgRecu.longueurs.length; i++) {
|
|
417
|
+
groupesDisplay += "[";
|
|
418
|
+
groupesDisplay = groupesDisplay + msgRecu.longueurs[i] + "]";
|
|
419
|
+
}
|
|
420
|
+
document.getElementById("tailleDesGroupes").innerHTML = groupesDisplay;
|
|
421
|
+
break;
|
|
422
|
+
|
|
423
|
+
case "lesFilesDattente":
|
|
424
|
+
break;
|
|
425
|
+
|
|
426
|
+
case "sessionLoaded":
|
|
427
|
+
document.getElementById("MessageDuServeur").innerHTML = "Session loaded :" + msgRecu.fileName;
|
|
428
|
+
break;
|
|
429
|
+
|
|
430
|
+
case "message":
|
|
431
|
+
if (debug) console.log(msgRecu.text);
|
|
432
|
+
break;
|
|
433
|
+
|
|
434
|
+
case "resetMatriceDesPossibles":
|
|
435
|
+
cleanPad();
|
|
436
|
+
break;
|
|
437
|
+
|
|
438
|
+
case "setInMatrix":
|
|
439
|
+
setPadButton(msgRecu.son, msgRecu.groupe, msgRecu.status);
|
|
440
|
+
break;
|
|
441
|
+
|
|
442
|
+
case "setControlerPadSize":
|
|
443
|
+
if (debug1) console.log("setControlerPadSize:", msgRecu.nbeDeGroupesClients, msgRecu.nbeDeGroupesSons);
|
|
444
|
+
nbeLignesPad = msgRecu.nbeDeGroupesClients;
|
|
445
|
+
nbeColonesPad = msgRecu.nbeDeGroupesSons + 1; // Conversion d'un index en nombre de colone
|
|
446
|
+
// Création du pad
|
|
447
|
+
creationPad();
|
|
448
|
+
//resetAllPad();
|
|
449
|
+
break;
|
|
450
|
+
|
|
451
|
+
case "setTickAutomate":
|
|
452
|
+
document.getElementById("MessageDuServeur").innerHTML = "Tick:" + msgRecu.tick;
|
|
453
|
+
break;
|
|
454
|
+
|
|
455
|
+
case "skiniParametres":
|
|
456
|
+
if (debug1) console.log("skiniParametres:", msgRecu.value);
|
|
457
|
+
par = msgRecu.value;
|
|
458
|
+
break;
|
|
459
|
+
|
|
460
|
+
case "synchroSkini":
|
|
461
|
+
if (debug) console.log("Reçu synchro Skini");
|
|
462
|
+
if (toggle) {
|
|
463
|
+
document.getElementById('synchro').style.display = "none";
|
|
464
|
+
toggle = false;
|
|
465
|
+
} else {
|
|
466
|
+
document.getElementById('synchro').style.display = "inline";
|
|
467
|
+
toggle = true;
|
|
468
|
+
}
|
|
469
|
+
break;
|
|
470
|
+
|
|
471
|
+
default: if (debug1) console.log("Le Client reçoit un message inconnu", msgRecu);
|
|
472
|
+
}
|
|
473
|
+
};
|
|
474
|
+
|
|
475
|
+
ws.onerror = function (event) {
|
|
476
|
+
if (debug) console.log("clientcontroleur.js : received error on WS", ws.socket, " ", event);
|
|
477
|
+
}
|
|
478
|
+
|
|
479
|
+
// Mécanisme de reconnexion automatique si le serveur est tombé.
|
|
480
|
+
// Le service Ping permet de vérifier le présence du serveur
|
|
481
|
+
ws.onclose = function (event) {
|
|
482
|
+
if (debug1) console.log("clientcontroleur.js : ON CLOSE");
|
|
483
|
+
}
|
|
484
|
+
}
|
|
485
|
+
|
|
486
|
+
|
|
487
|
+
function initServerListener() {
|
|
488
|
+
|
|
489
|
+
/* server.addEventListener('etatDeLaFileAttente', function( event ) {
|
|
490
|
+
var texteAffiche = ' ';
|
|
491
|
+
//if (debug) console.log("Reçu Broadcast:", event.value );
|
|
492
|
+
for (var i = 0; i < event.value.length ; i++ ) {
|
|
493
|
+
texteAffiche += "[" + event.value[i][0] + ":" + event.value[i][1] + "] " ;
|
|
494
|
+
}
|
|
495
|
+
document.getElementById("FileAttente").innerHTML =texteAffiche;
|
|
496
|
+
});
|
|
497
|
+
|
|
498
|
+
var texteScrutateur = '';
|
|
499
|
+
|
|
500
|
+
server.addEventListener('propositionScrutateur', function( event ) {
|
|
501
|
+
if (debug) console.log("Reçu Broadcast scrutateur:", event.value );
|
|
502
|
+
|
|
503
|
+
texteScrutateur = "[" + event.value.pseudo + ":" + event.value.numero + ":" + event.value.value + "] " + texteScrutateur;
|
|
504
|
+
texteScrutateur = texteScrutateur.slice(0,50);
|
|
505
|
+
document.getElementById("propositionScrutateur").innerHTML = texteScrutateur;
|
|
506
|
+
|
|
507
|
+
// Affichage des compteurs de demandes
|
|
508
|
+
if ( event.value.value == '+') {
|
|
509
|
+
etatScrutateurs[parseInt(event.value.numero)] += 1;
|
|
510
|
+
} else if ( event.value.value == '-') {
|
|
511
|
+
etatScrutateurs[parseInt(event.value.numero)] -= 1;
|
|
512
|
+
}
|
|
513
|
+
document.getElementById("etatScrut" + event.value.numero).innerHTML = etatScrutateurs[event.value.numero];
|
|
514
|
+
document.getElementById("propositionScrutateur").innerHTML = texteScrutateur;
|
|
515
|
+
|
|
516
|
+
// Affichage de l'activation ou désactivation de la matrice des possibles
|
|
517
|
+
// On traite le colones et donc pas la groupes d'utilisateurs
|
|
518
|
+
var groupeON = false;
|
|
519
|
+
if ( event.value.value == '+') groupeON = true;
|
|
520
|
+
|
|
521
|
+
var id = parseInt( event.value.numero);
|
|
522
|
+
|
|
523
|
+
for(var j=0; j < nbeLignesPad ; j++){
|
|
524
|
+
var bouton = document.getElementById("padBouton" + id.toString());
|
|
525
|
+
if ( bouton == undefined ) {
|
|
526
|
+
console.log("ERR listener: propositionScrutateur: bouton undefined", id);
|
|
527
|
+
return;
|
|
528
|
+
}
|
|
529
|
+
if ( !groupeON ) { // Désactive le lien entre groupes
|
|
530
|
+
bouton.setAttribute("class", "padBouton");
|
|
531
|
+
} else { // Active le lien
|
|
532
|
+
bouton.setAttribute("class", "padBoutonBleu");
|
|
533
|
+
}
|
|
534
|
+
id += nbeColonesPad;
|
|
535
|
+
}
|
|
536
|
+
}); */
|
|
537
|
+
}
|
|
538
|
+
|
|
539
|
+
},{"../../serveur/ipConfig":2}],2:[function(require,module,exports){
|
|
540
|
+
module.exports={
|
|
541
|
+
"remoteIPAddressImage": "192.168.1.251",
|
|
542
|
+
"remoteIPAddressSound": "192.168.1.251",
|
|
543
|
+
"remoteIPAddressLumiere": "localhost",
|
|
544
|
+
"remoteIPAddressGame": "192.168.1.223",
|
|
545
|
+
"interfaceZIPaddress": "192.168.1.250",
|
|
546
|
+
"serverIPAddress": "192.168.1.251",
|
|
547
|
+
"webserveurPort": 8080,
|
|
548
|
+
"websocketServeurPort": 8383,
|
|
549
|
+
"InPortOSCMIDIfromDAW": 13000,
|
|
550
|
+
"OutPortOSCMIDItoDAW": 12000,
|
|
551
|
+
"portOSCToGame": 1010,
|
|
552
|
+
"portOSCFromGame": 3010,
|
|
553
|
+
"portOSCFromInterfaceZData": 3005,
|
|
554
|
+
"portOSCFromInterfaceZMidi": 3006,
|
|
555
|
+
"portOSCFromInterfaceZMiniWi": 8888,
|
|
556
|
+
"portOSCToInterfaceZ": 1000,
|
|
557
|
+
"distribSequencerPort": 8899,
|
|
558
|
+
"outportProcessing": 10000,
|
|
559
|
+
"outportLumiere": 7700,
|
|
560
|
+
"inportLumiere": 9000,
|
|
561
|
+
"sessionPath": "./pieces/",
|
|
562
|
+
"piecePath" : "./pieces/"
|
|
563
|
+
}
|
|
564
|
+
|
|
565
|
+
},{}]},{},[1]);
|