Compare commits
850 commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
09ac173aab | ||
|
|
d3043c719f | ||
|
|
9986219e74 | ||
|
|
92c63672e5 | ||
|
|
5cb7131fe2 | ||
|
|
985285e2f0 | ||
|
|
9f1c78db57 | ||
|
|
f85a3c5e74 | ||
|
|
f2a1104f17 | ||
|
|
6f325b08ee | ||
|
|
e04605c251 | ||
|
|
32504cea66 | ||
|
|
9e2ba9d714 | ||
|
|
708f261d75 | ||
|
|
dd3726c3bf | ||
|
|
71dc1752a9 | ||
|
|
4cb7fda6aa | ||
|
|
b75114100c | ||
|
|
8dfa652eb5 | ||
|
|
9192f49c9a | ||
|
|
2ca256b7c9 | ||
|
|
5ef5bcc673 | ||
|
|
8d1794de76 | ||
|
|
0b513aecee | ||
|
|
8e590c55c1 | ||
|
|
74ab465150 | ||
|
|
9502ac4dc3 | ||
|
|
751a39cdbf | ||
|
|
204130c7a9 | ||
|
|
f5d838f173 | ||
|
|
41dee25781 | ||
|
|
5b0588568a | ||
|
|
2facf0b1d9 | ||
|
|
cbd5833c8e | ||
|
|
1e459ecc31 | ||
|
|
596217e6e0 | ||
|
|
45030a47b5 | ||
|
|
332a428fc7 | ||
|
|
063d859e58 | ||
|
|
85aa861fd2 | ||
|
|
d0c539b283 | ||
|
|
136faa1f68 | ||
|
|
68bea95944 | ||
|
|
28d2a87461 | ||
|
|
64dde8abf3 | ||
|
|
bff088d135 | ||
|
|
7f159adac2 | ||
|
|
2fde0d4412 | ||
|
|
3ff2afce33 | ||
|
|
53710dfada | ||
|
|
c6411d443e | ||
|
|
49e2545279 | ||
|
|
d9d663eaf5 | ||
|
|
f68d2615d5 | ||
|
|
d762d71b61 | ||
|
|
d10d1e4cd2 | ||
|
|
23669c859e | ||
|
|
999309dd8e | ||
|
|
7170249f99 | ||
|
|
6f94927f80 | ||
|
|
90caaa6d44 | ||
|
|
23551c53ee | ||
|
|
556892f941 | ||
|
|
fc1c72fb58 | ||
|
|
fb3febc4d1 | ||
|
|
db791b6458 | ||
|
|
999ab6e6b8 | ||
|
|
fd73cb2f68 | ||
|
|
9e855d1858 | ||
|
|
ea5b033d04 | ||
|
|
71289f52e3 | ||
|
|
8bbcec7768 | ||
|
|
2505cd8cae | ||
|
|
43eb92f2bf | ||
|
|
28d151b0dc | ||
|
|
4844b35ee0 | ||
|
|
8fb056d657 | ||
|
|
674dc6434e | ||
|
|
d7ae81652d | ||
|
|
4a5a01b64b | ||
|
|
a950c7c83a | ||
|
|
4ab6ec36f1 | ||
|
|
c9f1e40bc2 | ||
|
|
802d44d6a3 | ||
|
|
0a25e21c29 | ||
|
|
4d4b301e8d | ||
|
|
82920829e2 | ||
|
|
64f0cfa0f0 | ||
|
|
18cba88bad | ||
|
|
61e0654f88 | ||
|
|
caf964b6ad | ||
|
|
3e661d3f4e | ||
|
|
3a6d473458 | ||
|
|
00d76db844 | ||
|
|
ed683509d4 | ||
|
|
4728599406 | ||
|
|
f9139f675c | ||
|
|
0015b2fc22 | ||
|
|
75d0e99aa5 | ||
|
|
96d751849d | ||
|
|
4cb8f0db3a | ||
|
|
48ed268968 | ||
|
|
852deded5c | ||
|
|
753f441733 | ||
|
|
b3e8839ee3 | ||
|
|
c28165d282 | ||
|
|
e1195a123c | ||
|
|
efbfa4aa33 | ||
|
|
18762efc66 | ||
|
|
55b98fd621 | ||
|
|
0b7c4ae4e5 | ||
|
|
398fabff75 | ||
|
|
0bcfda04d7 | ||
|
|
6e7a673f5a | ||
|
|
0abff3741c | ||
|
|
d61c9ef506 | ||
|
|
98c05d4e01 | ||
|
|
9f62e1c351 | ||
|
|
06ebc7b48a | ||
|
|
2a7100f655 | ||
|
|
9ebc452cab | ||
|
|
fd7f562d30 | ||
|
|
4f086eb63f | ||
|
|
ae7fce5b06 | ||
|
|
c8cd691c75 | ||
|
|
ad6e6017b9 | ||
|
|
dbe62994d0 | ||
|
|
f9df9519ed | ||
|
|
88a97318f7 | ||
|
|
b47536d2e0 | ||
|
|
e2d12b99e5 | ||
|
|
87091bfb00 | ||
|
|
c9250a2906 | ||
|
|
08dcb99b2e | ||
|
|
bef49d8f12 | ||
|
|
faa9083c36 | ||
|
|
59945f76b6 | ||
|
|
9e6fa15d20 | ||
|
|
fa9b92397f | ||
|
|
98f7e9fe2f | ||
|
|
bcccf7e2b5 | ||
|
|
9c00b50321 | ||
|
|
cba1416533 | ||
|
|
c313bc7e11 | ||
|
|
442846a0f7 | ||
|
|
7d1cd33e7a | ||
|
|
1d4be2fed9 | ||
|
|
dff55492d3 | ||
|
|
195f266c56 | ||
|
|
02a730f82f | ||
|
|
2163f19198 | ||
|
|
0119298480 | ||
|
|
b6e14b3ed5 | ||
|
|
eaa1a233f5 | ||
|
|
d46e46f4c9 | ||
|
|
259e84b757 | ||
|
|
b151acf98f | ||
|
|
cc520c72ea | ||
|
|
b8b3a945bc | ||
|
|
6c0497f1a1 | ||
|
|
edb7da45c5 | ||
|
|
d92cf4cbbd | ||
|
|
908bda5a81 | ||
|
|
faa487c7af | ||
|
|
20ef7a2afe | ||
|
|
e4cc5b8625 | ||
|
|
0701533db7 | ||
|
|
55b8d55c81 | ||
|
|
e9d291614d | ||
|
|
0d1164f1b9 | ||
|
|
1e5926e722 | ||
|
|
be9532fbb8 | ||
|
|
2e653934b6 | ||
|
|
6ce10715f3 | ||
|
|
2fb6228fab | ||
|
|
200d5ba401 | ||
|
|
06204e9b66 | ||
|
|
a88810b1be | ||
|
|
3aa46e5e11 | ||
|
|
ddb781612d | ||
|
|
413a0e70f6 | ||
|
|
1ab8690472 | ||
|
|
0a9f97a35d | ||
|
|
13e86bf07c | ||
|
|
5e94d980ed | ||
|
|
9af5c678af | ||
|
|
16b829cc88 | ||
|
|
f51a012313 | ||
|
|
b1e59f2f8f | ||
|
|
803a82be31 | ||
|
|
1b6db379e0 | ||
|
|
ee119339c8 | ||
|
|
51b4b58fe4 | ||
|
|
862e5ddf27 | ||
|
|
f87b3980ed | ||
|
|
54972eecc0 | ||
|
|
57ebd3b4a0 | ||
|
|
afc82abd6e | ||
|
|
ba1ebf490b | ||
|
|
04fafb15ee | ||
|
|
4ff64ac46d | ||
|
|
9718a3e645 | ||
|
|
8518925dca | ||
|
|
869f824ab4 | ||
|
|
491d20b9d2 | ||
|
|
7c437e07f4 | ||
|
|
daff17ec44 | ||
|
|
9c848f6000 | ||
|
|
568c4cab34 | ||
|
|
b141546afd | ||
|
|
801fa1ea0b | ||
|
|
8c3246db89 | ||
|
|
9404d7b9f5 | ||
|
|
5141aae474 | ||
|
|
43ab5cb4e5 | ||
|
|
a439b08f8f | ||
|
|
7e242e7137 | ||
|
|
3ec893d102 | ||
|
|
46d922a296 | ||
|
|
aa7e335411 | ||
|
|
ca1332f462 | ||
|
|
e79d1306f5 | ||
|
|
91b407cd93 | ||
|
|
91abc1fc8b | ||
|
|
457d9faff0 | ||
|
|
bec71b5c1b | ||
|
|
ea4a21cf2d | ||
|
|
f612793934 | ||
|
|
7a77606886 | ||
|
|
486ac1527e | ||
|
|
99ef38d5ac | ||
|
|
ab98081e67 | ||
|
|
4a1e5cca7a | ||
|
|
4e9193f26a | ||
|
|
22122b5731 | ||
|
|
b69f99dd9a | ||
|
|
6054a03c35 | ||
|
|
64860e04e9 | ||
|
|
28f852edc5 | ||
|
|
1ebc8e4784 | ||
|
|
d9879f3567 | ||
|
|
6d56f96a70 | ||
|
|
9b9a8b45fb | ||
|
|
1e74704021 | ||
|
|
613d7dafc3 | ||
|
|
bd2674be46 | ||
|
|
87c75bda74 | ||
|
|
d14aeb9e8c | ||
|
|
1100c01404 | ||
|
|
072f67e3b1 | ||
|
|
efc715748c | ||
|
|
24f0fb8093 | ||
|
|
dfdac01bf3 | ||
|
|
e41024f5f4 | ||
|
|
eaa59ecadc | ||
|
|
a4eba3fcd9 | ||
|
|
5fa74fae8c | ||
|
|
284a01251b | ||
|
|
d19a9b933b | ||
|
|
b267837de9 | ||
|
|
6cc9fe2ea7 | ||
|
|
77a48d5c8e | ||
|
|
fbad6391cd | ||
|
|
0d0da9d564 | ||
|
|
ee621ec27f | ||
|
|
0cb373498b | ||
|
|
a94ee973c1 | ||
|
|
8aa2735ce1 | ||
|
|
1a86fda8a0 | ||
|
|
05c489f4d0 | ||
|
|
b5cf6958af | ||
|
|
3415e19843 | ||
|
|
c50351131e | ||
|
|
e3b4f7bc1c | ||
|
|
5d1005c941 | ||
|
|
5c29b5614b | ||
|
|
72f8c90332 | ||
|
|
1e7b5449d7 | ||
|
|
80a00fa7d8 | ||
|
|
383d4eb3d9 | ||
|
|
4437361550 | ||
|
|
0d4438b177 | ||
|
|
0e9964682d | ||
|
|
658924a0bb | ||
|
|
bf3e891366 | ||
|
|
fea519c0d7 | ||
|
|
be36306887 | ||
|
|
c536a6cc6a | ||
|
|
7fc2517f7a | ||
|
|
a1bc7daa61 | ||
|
|
772f35de95 | ||
|
|
35b8d59d9c | ||
|
|
d46b8938e6 | ||
|
|
8adbaf5a58 | ||
|
|
b08a6c95c2 | ||
|
|
d5f7657065 | ||
|
|
69e11dfd47 | ||
|
|
d2d3a4ab69 | ||
|
|
4d842c45b2 | ||
|
|
c14248ff30 | ||
|
|
36ee7a7926 | ||
|
|
c91a7b7b81 | ||
|
|
30cefddc4c | ||
|
|
44fe98f9b7 | ||
|
|
5c7a79a17d | ||
|
|
993742d065 | ||
|
|
c705641a71 | ||
|
|
76e51df03d | ||
|
|
4e079a2048 | ||
|
|
590c7fde37 | ||
|
|
2e8b3e330a | ||
|
|
26995c8d42 | ||
|
|
40ca990922 | ||
|
|
f373a93b6b | ||
|
|
4a1837aaf8 | ||
|
|
e18bd058e3 | ||
|
|
679f66db70 | ||
|
|
daa8f5bb89 | ||
|
|
cd6587231a | ||
|
|
adaf97f130 | ||
|
|
267a5f27b8 | ||
|
|
0370fe045a | ||
|
|
a0054f632e | ||
|
|
261b8e343f | ||
|
|
17f4b9a371 | ||
|
|
4332af9038 | ||
|
|
fd000711bd | ||
|
|
4f3af11c45 | ||
|
|
8ecd4abfce | ||
|
|
07362806c7 | ||
|
|
c52c516c87 | ||
|
|
5cb43135ea | ||
|
|
836a7c6e88 | ||
|
|
2c5d779a6f | ||
|
|
bec9d3fdee | ||
|
|
0065dead4b | ||
|
|
0773a05050 | ||
|
|
37beb1f84f | ||
|
|
dfb85bef82 | ||
|
|
84451e90f5 | ||
|
|
90a16e0040 | ||
|
|
c4efbdba00 | ||
|
|
b66d6caccd | ||
|
|
efe72242b4 | ||
|
|
e3a05d742b | ||
|
|
ae7fe700a4 | ||
|
|
dca0dfb28a | ||
|
|
0c745853cd | ||
|
|
8a081d72ff | ||
|
|
7da9be3f15 | ||
|
|
0f7cd4a027 | ||
|
|
e77004a70e | ||
|
|
7e517f4bc2 | ||
|
|
169ece4780 | ||
|
|
877092e644 | ||
|
|
e37cc50ee6 | ||
|
|
c85b59629f | ||
|
|
475998fe63 | ||
|
|
bcbdc5e56a | ||
|
|
930fbbf53c | ||
|
|
2d3ec81e03 | ||
|
|
0638375ae4 | ||
|
|
0dc2c030aa | ||
|
|
f58051d433 | ||
|
|
96499e57a8 | ||
|
|
e4b9d585b9 | ||
|
|
4170830e54 | ||
|
|
743d76c442 | ||
|
|
9579937694 | ||
|
|
a81d470eee | ||
|
|
9e78279226 | ||
|
|
ac5a90b4e1 | ||
|
|
7eb361c668 | ||
|
|
a007f91456 | ||
|
|
1bb54048df | ||
|
|
206beb6a7f | ||
|
|
3c7581a524 | ||
|
|
f72962680d | ||
|
|
1cfd615c85 | ||
|
|
4954295992 | ||
|
|
3092515cd3 | ||
|
|
0561cadf64 | ||
|
|
9574fb9556 | ||
|
|
3d07599a92 | ||
|
|
1a1eddb2d7 | ||
|
|
87c8f17c8c | ||
|
|
2c4deb144c | ||
|
|
ab0b268094 | ||
|
|
02523903c8 | ||
|
|
518763fc9c | ||
|
|
88648c5be6 | ||
|
|
cb54fe0f9c | ||
|
|
07bbcf9b74 | ||
|
|
57b0094e4c | ||
|
|
2d33d48fd9 | ||
|
|
8292aa788d | ||
|
|
a0bf06f8e9 | ||
|
|
c7e78cf6c4 | ||
|
|
62ba46ca03 | ||
|
|
15cde03d95 | ||
|
|
2639bf5677 | ||
|
|
510cdd6a4d | ||
|
|
72cb41dcc1 | ||
|
|
adfe88a37e | ||
|
|
2f651fc9fd | ||
|
|
c5fdab264e | ||
|
|
99a7e4d2ac | ||
|
|
72e724aa85 | ||
|
|
2f7768dc8b | ||
|
|
c668ec2fd3 | ||
|
|
4181765f81 | ||
|
|
02b8772a4f | ||
|
|
fd65e4406a | ||
|
|
ae18c32de2 | ||
|
|
cf68d5c7ab | ||
|
|
23d9ae136f | ||
|
|
0d408824da | ||
|
|
f58c2101c8 | ||
|
|
a9004f4c27 | ||
|
|
04e66c4776 | ||
|
|
2a709a2328 | ||
|
|
56707f279c | ||
|
|
66524d5c8d | ||
|
|
3ed25cdf04 | ||
|
|
c8b503e724 | ||
|
|
69f026a8eb | ||
|
|
a99a24f898 | ||
|
|
2a0a1c26b6 | ||
|
|
cb8fbcc007 | ||
|
|
e97e779829 | ||
|
|
428354474d | ||
|
|
9a1859f45c | ||
|
|
516c335adc | ||
|
|
e47dcf68f5 | ||
|
|
1e77d8aed1 | ||
|
|
02885cebf6 | ||
|
|
3701efc544 | ||
|
|
e12ea4be4a | ||
|
|
e21e1bb8d9 | ||
|
|
b5f871d972 | ||
|
|
be485f1085 | ||
|
|
612c8ba45a | ||
|
|
2b0e3ebe86 | ||
|
|
fbba60403e | ||
|
|
1a02c80496 | ||
|
|
709d0a7f25 | ||
|
|
ba6f1419c3 | ||
|
|
aeef06749d | ||
|
|
ce247b4098 | ||
|
|
2a9d424d63 | ||
|
|
37a7e5802b | ||
|
|
c02fb7036e | ||
|
|
83ee2fd2f3 | ||
|
|
41c0c8b7ab | ||
|
|
1593d3c0ab | ||
|
|
c25050047b | ||
|
|
41639df2a9 | ||
|
|
a07b2fd2e7 | ||
|
|
1c53aea10e | ||
|
|
9f81e0b9cb | ||
|
|
37e92d1046 | ||
|
|
0252530109 | ||
|
|
52317e4499 | ||
|
|
52aec0f9cc | ||
|
|
aba8e3e14c | ||
|
|
8744270335 | ||
|
|
fd1b61e519 | ||
|
|
1e35e72db4 | ||
|
|
dfe9822915 | ||
|
|
25d98287e9 | ||
|
|
4bbee6eb20 | ||
|
|
1e5b4038e3 | ||
|
|
1b7f6f14a8 | ||
|
|
e67c90c611 | ||
|
|
f7cc8b9f85 | ||
|
|
99d218b8ec | ||
|
|
d9e6d64bf3 | ||
|
|
2402a66a83 | ||
|
|
624251f12b | ||
|
|
f3e7b4ba23 | ||
|
|
c89e6e1cbb | ||
|
|
f5ec2ed067 | ||
|
|
3b5411ea42 | ||
|
|
7589326171 | ||
|
|
edd087934e | ||
|
|
d20984a508 | ||
|
|
8ae5c1884e | ||
|
|
12ff42cfd9 | ||
|
|
7e8cc500a6 | ||
|
|
525c3066be | ||
|
|
d5dad476f6 | ||
|
|
4cfa779d5d | ||
|
|
3c8814226b | ||
|
|
d31d1a8d23 | ||
|
|
f33248c872 | ||
|
|
15d9837880 | ||
|
|
40e4a3ff6d | ||
|
|
bc52b2f662 | ||
|
|
f6d0970408 | ||
|
|
2c7d86f407 | ||
|
|
b82e70287c | ||
|
|
329e5fc9be | ||
|
|
a16d8d29dc | ||
|
|
ec966f558c | ||
|
|
f3d6244277 | ||
|
|
220842093f | ||
|
|
bd67bb8214 | ||
|
|
6840dc00d0 | ||
|
|
85d255d5a4 | ||
|
|
5c4852e1af | ||
|
|
d5f3856985 | ||
|
|
4875712965 | ||
|
|
a27dedf764 | ||
|
|
c59d7f12d4 | ||
|
|
4423ecd3e9 | ||
|
|
76759568cc | ||
|
|
f5c6e6ce6a | ||
|
|
8722357350 | ||
|
|
03d5da9339 | ||
|
|
e2be66f597 | ||
|
|
dd4f644b5c | ||
|
|
d22e67a971 | ||
|
|
0248017183 | ||
|
|
b2ba508854 | ||
|
|
fad164ed48 | ||
|
|
fd8a362cb3 | ||
|
|
77b756b3ce | ||
|
|
a3d0075f12 | ||
|
|
6fd8fc6c66 | ||
|
|
6c264f5279 | ||
|
|
270a0526b8 | ||
|
|
18803b7240 | ||
|
|
5278bebb50 | ||
|
|
73bc2e4187 | ||
|
|
874d6f04f9 | ||
|
|
b3b4f69e5b | ||
|
|
66af44a2ce | ||
|
|
99e1413162 | ||
|
|
ba8d2b476d | ||
|
|
453f2b6f0f | ||
|
|
ade59a8be8 | ||
|
|
869eb435e9 | ||
|
|
85a381ec3e | ||
|
|
c6207cacd2 | ||
|
|
8c24f5e1a6 | ||
|
|
3c6da8d5be | ||
|
|
4203ffc462 | ||
|
|
d32a8a3105 | ||
|
|
b6449c5a8f | ||
|
|
0d1180dc25 | ||
|
|
93aeace282 | ||
|
|
d9823c40dc | ||
|
|
f42825314d | ||
|
|
4099dea1cf | ||
|
|
3b394be366 | ||
|
|
c383f588bc | ||
|
|
7e9db4eec3 | ||
|
|
89801c7f1a | ||
|
|
f5a8cabe99 | ||
|
|
eec1901372 | ||
|
|
6b5cba80e1 | ||
|
|
fa0713f079 | ||
|
|
c360cacbce | ||
|
|
c3dc2e21f1 | ||
|
|
074c65a306 | ||
|
|
058dfd4676 | ||
|
|
b14263d5c3 | ||
|
|
1166922f8e | ||
|
|
e7534a6fda | ||
|
|
96f8ffc129 | ||
|
|
c99633a0bb | ||
|
|
67e554c494 | ||
|
|
5c5adebabb | ||
|
|
d00eedc5f8 | ||
|
|
1e7d13c279 | ||
|
|
53b3dddade | ||
|
|
9c04c778e5 | ||
|
|
606723137c | ||
|
|
b165bdd001 | ||
|
|
acc1358849 | ||
|
|
cac62b1142 | ||
|
|
7dbe6ec8d1 | ||
|
|
aa963ba248 | ||
|
|
e3b1d404a5 | ||
|
|
7c94eb2887 | ||
|
|
a80a559eb1 | ||
|
|
5dee11abdc | ||
|
|
319e5e0dd9 | ||
|
|
a45fde2104 | ||
|
|
4f1728b941 | ||
|
|
5460c62711 | ||
|
|
d2d9081a19 | ||
|
|
f2657f6155 | ||
|
|
52579bfce5 | ||
|
|
37f057e010 | ||
|
|
f8aa45f318 | ||
|
|
bc3891b6ae | ||
|
|
3ad1a27168 | ||
|
|
33df54215a | ||
|
|
efd7202bf5 | ||
|
|
a0813568ae | ||
|
|
a2b4bd48b9 | ||
|
|
7d4064486d | ||
|
|
df4b098032 | ||
|
|
45d454d389 | ||
|
|
12534ac102 | ||
|
|
81c2178b7b | ||
|
|
96db4489b5 | ||
|
|
7c594167a0 | ||
|
|
a75300aef9 | ||
|
|
fac6992cd5 | ||
|
|
3d2b2e0586 | ||
|
|
c541f3f35b | ||
|
|
867ccfc2f6 | ||
|
|
00cc41ddc2 | ||
|
|
e227ded1ad | ||
|
|
782dd1f673 | ||
|
|
18390be315 | ||
|
|
b2345e456b | ||
|
|
ee746d4d1c | ||
|
|
8fd3198c46 | ||
|
|
ad40de2ffb | ||
|
|
e851361992 | ||
|
|
1d7d99a9e8 | ||
|
|
8a67f7d861 | ||
|
|
95843e59bd | ||
|
|
2f61b05af1 | ||
|
|
836ddbfcfb | ||
|
|
1eeb38367c | ||
|
|
5e8aea0022 | ||
|
|
e8a5c83b00 | ||
|
|
122bf58057 | ||
|
|
3402efe0a6 | ||
|
|
3a46d25e9c | ||
|
|
7c7bbf7639 | ||
|
|
93c08db3a3 | ||
|
|
d6df5793bb | ||
|
|
dec1c947e0 | ||
|
|
f84696ac31 | ||
|
|
631e83ca67 | ||
|
|
02068e6d4d | ||
|
|
edbfaf1249 | ||
|
|
a274fabb95 | ||
|
|
27b1ede452 | ||
|
|
3d3b7e1568 | ||
|
|
941c5ba847 | ||
|
|
28c4bee396 | ||
|
|
b3ec24e28f | ||
|
|
71d21062cf | ||
|
|
81d07d46bc | ||
|
|
c8d3529523 | ||
|
|
1950a55cf1 | ||
|
|
7bc93922d8 | ||
|
|
2df088d5fc | ||
|
|
4106e33049 | ||
|
|
72ddb4d396 | ||
|
|
bd2e7b16ae | ||
|
|
bd86a5df0e | ||
|
|
bf51aee607 | ||
|
|
31c201fcda | ||
|
|
5b52ff4d41 | ||
|
|
7752ed22cb | ||
|
|
012949dbe5 | ||
|
|
7df37e2afa | ||
|
|
9f3c762926 | ||
|
|
cf43836778 | ||
|
|
4af2729faa | ||
|
|
2abba54d59 | ||
|
|
ff2fdab80c | ||
|
|
0cd1a1a33c | ||
|
|
370bee3cd4 | ||
|
|
9efb0f4b86 | ||
|
|
3f807c6aee | ||
|
|
dfe157f54c | ||
|
|
bf97566730 | ||
|
|
1c2f683468 | ||
|
|
2ff9c52f45 | ||
|
|
6a73a4b1f2 | ||
|
|
d19bc1b38c | ||
|
|
3e720b072e | ||
|
|
46ea30b576 | ||
|
|
55720cea18 | ||
|
|
5a6c1658f9 | ||
|
|
82960592dc | ||
|
|
bab6647815 | ||
|
|
75f50c044c | ||
|
|
f298d73d1d | ||
|
|
6bfd949e34 | ||
|
|
9ef0a508a7 | ||
|
|
dd62bf8b28 | ||
|
|
eb661a0a17 | ||
|
|
410949e6e7 | ||
|
|
090ce0ed70 | ||
|
|
23f2f9151c | ||
|
|
f62c9ded6e | ||
|
|
1c699a7800 | ||
|
|
42f2bd2932 | ||
|
|
54c481751e | ||
|
|
901367677d | ||
|
|
201e4886e3 | ||
|
|
1c8211214b | ||
|
|
b8a723daaf | ||
|
|
076e94a0c3 | ||
|
|
3f4695ec3c | ||
|
|
b9c960f8da | ||
|
|
7d2e7843cd | ||
|
|
15128b05ec | ||
|
|
049a296e61 | ||
|
|
7f61710e24 | ||
|
|
86e3487e0a | ||
|
|
f145839454 | ||
|
|
bd2e6fa102 | ||
|
|
fcabbae8b2 | ||
|
|
c037f734e9 | ||
|
|
f1febf53fb | ||
|
|
6fbf9f87a4 | ||
|
|
3757f9c1c4 | ||
|
|
b7a866634c | ||
|
|
911084c513 | ||
|
|
949ba4a645 | ||
|
|
43fd389e40 | ||
|
|
6283726360 | ||
|
|
e5cfbbc91c | ||
|
|
9d919c7ea7 | ||
|
|
c896b38b43 | ||
|
|
ed2f35d649 | ||
|
|
2fa0f165de | ||
|
|
4b8e6edec9 | ||
|
|
b4d78d87f4 | ||
|
|
6e4a3af441 | ||
|
|
97cacd46ea | ||
|
|
3c83a35c37 | ||
|
|
8c194be517 | ||
|
|
412866e417 | ||
|
|
a4266e2e76 | ||
|
|
ae74946493 | ||
|
|
b96bf4f6f8 | ||
|
|
25d4318e7f | ||
|
|
c9354f3c78 | ||
|
|
c93db8b3c6 | ||
|
|
77b3b6be85 | ||
|
|
aced94adfd | ||
|
|
ead0d0f981 | ||
|
|
80cf05b1d2 | ||
|
|
66ca153a34 | ||
|
|
eff2375a4b | ||
|
|
a6401b63e2 | ||
|
|
667c880745 | ||
|
|
408945e399 | ||
|
|
e4fbb55d09 | ||
|
|
17db9f5d77 | ||
|
|
370c73c7aa | ||
|
|
d86375f536 | ||
|
|
3cf45e9102 | ||
|
|
dff4e252d3 | ||
|
|
ee7d167c53 | ||
|
|
dda61f4641 | ||
|
|
69a4623dfd | ||
|
|
c544a37434 | ||
|
|
040c462ae8 | ||
|
|
f36664718d | ||
|
|
532ba56635 | ||
|
|
d753646118 | ||
|
|
e874cc7f96 | ||
|
|
f9dc4f3d9d | ||
|
|
f2be501509 | ||
|
|
aceb8e175d | ||
|
|
12d134d8a2 | ||
|
|
cfe0fe994f | ||
|
|
677d67f8e3 | ||
|
|
f4cdf11c7f | ||
|
|
d2d3faf43d | ||
|
|
43d6f2df0b | ||
|
|
98e287b9e8 | ||
|
|
e6a6a38865 | ||
|
|
f6fb539e83 | ||
|
|
dca301ae2e | ||
|
|
840be72b2e | ||
|
|
f25346015c | ||
|
|
ef2de79613 | ||
|
|
ca6eb09a48 | ||
|
|
891d1092f5 | ||
|
|
1d221b7613 | ||
|
|
2239c06bbb | ||
|
|
fd1c34928d | ||
|
|
050988b6d1 | ||
|
|
e842044652 | ||
|
|
b4d361f28a | ||
|
|
e733f3e556 | ||
|
|
d66277866a | ||
|
|
8cdf821926 | ||
|
|
caf412f16b | ||
|
|
0c12dfe6fd | ||
|
|
8b0f271419 | ||
|
|
b5c8427011 | ||
|
|
96fd5effdc | ||
|
|
6d0947aea9 | ||
|
|
b3c82251f9 | ||
|
|
8b59296010 | ||
|
|
02c39debf2 | ||
|
|
7b2da56bd1 | ||
|
|
83e338a183 | ||
|
|
993d3c6914 | ||
|
|
bdfe6f6bb9 | ||
|
|
56a05b61be | ||
|
|
87903a484e | ||
|
|
41f77d8ffe | ||
|
|
c24fba0d07 | ||
|
|
0be383c79d | ||
|
|
e2ad561010 | ||
|
|
0986d2ae9d | ||
|
|
c89eb4f84f | ||
|
|
f91b4c1ec3 | ||
|
|
d7ce10c5e2 | ||
|
|
1849f2a6a9 | ||
|
|
a263233bbd | ||
|
|
185d4c6b80 | ||
|
|
c904b941ba | ||
|
|
ce7b6750c9 | ||
|
|
cd05e21d47 | ||
|
|
93fa6b2f72 | ||
|
|
e5a123977f | ||
|
|
d665222d9f | ||
|
|
dea2b19ad5 | ||
|
|
57133f35e1 | ||
|
|
1c3389d736 | ||
|
|
e1e54c038b | ||
|
|
e65d287907 | ||
|
|
c1dc378603 | ||
|
|
a432d52a68 | ||
|
|
6003add49a | ||
|
|
ec1434a651 | ||
|
|
30b55b6652 | ||
|
|
51eb674cd3 | ||
|
|
0aefc2dfab | ||
|
|
6c292e1d49 | ||
|
|
bc3d6db62f | ||
|
|
1d1281e1d8 | ||
|
|
dc01b51128 | ||
|
|
db81e18443 | ||
|
|
d69d20b6e4 | ||
|
|
95ae2f50e8 | ||
|
|
6fb8bf9438 | ||
|
|
9d210294ce | ||
|
|
60fd409b75 | ||
|
|
17cde3a3df | ||
|
|
3279223e75 | ||
|
|
9bf7428108 | ||
|
|
1f75b25996 | ||
|
|
0e078b2c4f |
1
.eslintignore
Normal file
|
|
@ -0,0 +1 @@
|
|||
jquery.*.js
|
||||
67
.eslintrc.json
Normal file
|
|
@ -0,0 +1,67 @@
|
|||
{
|
||||
"env": {
|
||||
"es6": true,
|
||||
"browser": true,
|
||||
"node": true
|
||||
},
|
||||
"extends": "eslint:recommended",
|
||||
"parserOptions": {
|
||||
"sourceType": "module",
|
||||
"ecmaFeatures": {
|
||||
"experimentalObjectRestSpread": true
|
||||
}
|
||||
},
|
||||
"rules": {
|
||||
"no-console": "off",
|
||||
"no-undef": "off",
|
||||
"no-useless-escape": "warn",
|
||||
"no-empty": [
|
||||
"error",
|
||||
{
|
||||
"allowEmptyCatch": true
|
||||
}
|
||||
],
|
||||
"no-unused-vars": [
|
||||
"error",
|
||||
{
|
||||
"args": "none"
|
||||
}
|
||||
],
|
||||
"arrow-spacing": [
|
||||
"error",
|
||||
{
|
||||
"before": false,
|
||||
"after": false
|
||||
}
|
||||
],
|
||||
"space-before-function-paren": [
|
||||
"error",
|
||||
"never"
|
||||
],
|
||||
"indent": [
|
||||
"error",
|
||||
4,
|
||||
{
|
||||
"SwitchCase": 1,
|
||||
"ObjectExpression": 1,
|
||||
"ArrayExpression": 1,
|
||||
"MemberExpression": 1
|
||||
}
|
||||
],
|
||||
"linebreak-style": [
|
||||
"error",
|
||||
"unix"
|
||||
],
|
||||
"quotes": [
|
||||
"error",
|
||||
"single"
|
||||
],
|
||||
"semi": [
|
||||
"error",
|
||||
"never"
|
||||
]
|
||||
},
|
||||
"globals": {
|
||||
"module": true
|
||||
}
|
||||
}
|
||||
5
.gitignore
vendored
|
|
@ -3,4 +3,7 @@ dist
|
|||
app/browser/styles.css
|
||||
app/browser/scripts.js
|
||||
app/browser/scripts.js.map
|
||||
app/browser/favicon.ico
|
||||
app/browser/favicon.png
|
||||
app/browser/logo.png
|
||||
app/launcher/scripts.js
|
||||
package-lock.json
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@ anHsudo: required
|
|||
dist: trusty
|
||||
language: node_js
|
||||
node_js:
|
||||
- "6"
|
||||
- "9"
|
||||
before_install:
|
||||
- sudo dpkg --add-architecture i386
|
||||
- sudo apt-get update -qq
|
||||
|
|
@ -20,7 +20,8 @@ deploy:
|
|||
tags: true
|
||||
before_deploy:
|
||||
- export VERSION=$(sed -nE 's/^\s*"version":\ "(.*?)",$/\1/p' package.json)
|
||||
- npm run build
|
||||
- npm run package
|
||||
- npm run package-rpi
|
||||
- npm run deb32
|
||||
- npm run deb64
|
||||
- npm run debarm
|
||||
|
|
@ -34,13 +35,13 @@ before_deploy:
|
|||
- mv open-stage-control-linux-ia32 open-stage-control-${VERSION}-linux-ia32
|
||||
- mv open-stage-control-linux-x64 open-stage-control-${VERSION}-linux-x64
|
||||
- mv open-stage-control-linux-armv7l open-stage-control-${VERSION}-linux-armv7l
|
||||
- mv open-stage-control-linux-arm64 open-stage-control-${VERSION}-linux-arm64
|
||||
# - mv open-stage-control-linux-arm64 open-stage-control-${VERSION}-linux-arm64
|
||||
- zip -q -r --symlinks packages/open-stage-control-${VERSION}-osx.zip open-stage-control-darwin-x64/open-stage-control.app
|
||||
- zip -q -r packages/open-stage-control-${VERSION}-win32-ia32.zip open-stage-control-${VERSION}-win32-ia32
|
||||
- zip -q -r packages/open-stage-control-${VERSION}-win32-x64.zip open-stage-control-${VERSION}-win32-x64
|
||||
- zip -q -r packages/open-stage-control-${VERSION}-linux-ia32.zip open-stage-control-${VERSION}-linux-ia32
|
||||
- zip -q -r packages/open-stage-control-${VERSION}-linux-x64.zip open-stage-control-${VERSION}-linux-x64
|
||||
- zip -q -r packages/open-stage-control-${VERSION}-linux-armv7l.zip open-stage-control-${VERSION}-linux-armv7l
|
||||
- zip -q -r packages/open-stage-control-${VERSION}-linux-arm64.zip open-stage-control-${VERSION}-linux-arm64
|
||||
# - zip -q -r packages/open-stage-control-${VERSION}-linux-arm64.zip open-stage-control-${VERSION}-linux-arm64
|
||||
- ls packages
|
||||
- cd ..
|
||||
|
|
|
|||
469
CHANGELOG.md
|
|
@ -1,11 +1,478 @@
|
|||
# Changelog
|
||||
|
||||
## 0.36.0
|
||||
|
||||
- bug fixes
|
||||
- `linkId` synchronizations now correctly trigger property updates
|
||||
- widgets with multiple `linkId` are now properly handled
|
||||
- synchronization issue between `visualizer` widgets
|
||||
- widgets
|
||||
- `keys` (**breaking changes**): formulas in `keydown` and `keyup` must be explicitely written using the `#{}` syntax; variable `value` got removed from these formulas context (use `@{this}` instead); removed `widgetId` property, the value emitted by the widget on keypress events can be linked with other widgets via the `linkId` property or the property inheritance syntax;
|
||||
- `visualizer`: update rate set to default canvas framerate
|
||||
- editor
|
||||
- **new** keyboard shortcuts (undo, redo, copy, paste, etc)
|
||||
|
||||
## 0.35.0
|
||||
|
||||
- main
|
||||
- added `--state` option for loading a state file with a session file
|
||||
- state
|
||||
- loading a state file doesn't replace the quick save slot anymore
|
||||
- widgets
|
||||
- **new** `script` widget
|
||||
- misc
|
||||
- reduced session file size (indentation set to 2 instead of 4)
|
||||
|
||||
## 0.34.4
|
||||
|
||||
- bug fixes
|
||||
- widgets: dynamic `address` when `split` is `true`
|
||||
- strip: missing osc properties (`address` and `preArgs`) for remote control
|
||||
- switcher: update linked widgets' osc properties before sending if they depend on the switcher's value
|
||||
|
||||
## 0.34.3
|
||||
|
||||
- bug fixes
|
||||
- launcher: regression breaking the `port` option
|
||||
|
||||
## 0.34.2
|
||||
|
||||
- bug fixes
|
||||
- matrices: spacing issue when wrapped in strips
|
||||
- launcher: regression preventing options to be applied
|
||||
|
||||
## 0.34.1
|
||||
|
||||
- bug fixes
|
||||
- switch: display object-values properly when `showValues` is set to `true`
|
||||
- prevent non-dynamic properties updates from breaking an osc sending event chain
|
||||
- deprecations
|
||||
- `formula` has been removed from the editor's context menu
|
||||
- custom module
|
||||
- expose `app` to the custom module's scope: an event emitter for monitoring the events sent by the different clients
|
||||
- misc
|
||||
- fixed rpi build
|
||||
|
||||
## 0.33.3
|
||||
|
||||
- bug fixes
|
||||
- matrix: recreation loop issue with matrices of clones
|
||||
- multixy: glitch when some letters are used in the points' labels
|
||||
|
||||
## 0.33.2
|
||||
|
||||
- bug fixes
|
||||
- matrix: set initial value at widget's creation; missing border under widget's label
|
||||
- widgets
|
||||
- property math syntax: add `values()` and `keys()` functions
|
||||
|
||||
## 0.33.1
|
||||
|
||||
- bug fixes
|
||||
- widgets: remove unnused properties to avoid having hidden properties laying around when the type changes (especially dangerous when those properties where linked to other widgets)
|
||||
|
||||
## 0.33.0
|
||||
|
||||
- bug fixes
|
||||
- osc receivers: unregister properly when widgets are recreated (memory leak); allow non-string values (eg. objects)
|
||||
- circular property update issues
|
||||
- widgets
|
||||
- **new** generic `matrix` widget
|
||||
- fader: restore right-click focusing the input in compact mode (mouse only)
|
||||
|
||||
## 0.32.6
|
||||
|
||||
- bug fixes
|
||||
- css border-radius not applying correctly for some widgets
|
||||
- themes
|
||||
- multiple adjustments
|
||||
|
||||
## 0.32.5
|
||||
|
||||
- bug fixes
|
||||
- missing feedback support for widgets with typed preArgs
|
||||
- themes
|
||||
- improved `dark` theme
|
||||
- added `flat`
|
||||
|
||||
## 0.32.4
|
||||
|
||||
- bug fixes
|
||||
- regression breaking typed osc args
|
||||
|
||||
|
||||
## 0.32.3
|
||||
|
||||
- bug fixes
|
||||
- regression in editor/resize function
|
||||
|
||||
## 0.32.2
|
||||
|
||||
- bug fixes
|
||||
- sliders colors not displayed correctly on iOS
|
||||
- widgets
|
||||
- xy: tiny knob style change
|
||||
- editor
|
||||
- reallow editing disabled properties
|
||||
|
||||
## 0.32.1
|
||||
|
||||
- bug fixes
|
||||
- error in osc receivers
|
||||
|
||||
## 0.32.0
|
||||
|
||||
- main
|
||||
- add tcp support
|
||||
|
||||
## 0.31.0
|
||||
|
||||
- bug fixes
|
||||
- regression breaking multitouch widgets
|
||||
- widgets
|
||||
- fader/knob/pad: right-click / long tap doesn't give focus to the input anymore
|
||||
|
||||
## 0.30.4
|
||||
|
||||
- bug fixes
|
||||
- regression breaking touch traversing gestures
|
||||
- clone widgets becomming unselectable for edition
|
||||
- `preArgs` property still being coerced to an array
|
||||
|
||||
## 0.30.3
|
||||
|
||||
- bug fixes
|
||||
- big regression breaking many touch gestures
|
||||
|
||||
## 0.30.2
|
||||
|
||||
- bug fixes
|
||||
- broken remote-control /TABS command
|
||||
- disabled `spacing` property in strips
|
||||
- disabled properties in modals
|
||||
- broken arm build
|
||||
|
||||
|
||||
## 0.30.1
|
||||
|
||||
- midi
|
||||
- prevent the main process from exiting when MIDI setup fails
|
||||
|
||||
## 0.30.0
|
||||
|
||||
- widgets
|
||||
- `target` and `preArgs` properties are no longer coerced to arrays and can be written as single string values
|
||||
- `linkId` supports master and slave modes with `>>` and `<<` prefixes
|
||||
- the special `target` token `null` can now be used in conjunction with regular targets, it disables the default global targets set via the `--send` option
|
||||
- editor
|
||||
- disabled widget properties are now greyed out
|
||||
|
||||
## 0.29.2
|
||||
|
||||
- bug fixes
|
||||
- launcher: parsing errors are not fatal anymore
|
||||
- css parsing error on iOS
|
||||
|
||||
## 0.29.1
|
||||
|
||||
- bug fixes
|
||||
- editor: "wrap" deleting the widget just before the one being wrapped
|
||||
- regression breaking traversing gestures and high precision gestures (0.29.0)
|
||||
- server
|
||||
- allow sending osc to broadcast ip addresses
|
||||
- widgets
|
||||
- limited support for property inheritance nesting (`@{id_@{id_2}}`)
|
||||
- support using property inheritance syntax in osc listeners' addresses
|
||||
|
||||
## 0.29.0
|
||||
|
||||
- beaking changes
|
||||
- dropped supported for `.js` sessions (deprecated in 0.20.0)
|
||||
- bug fixes
|
||||
- zeroconf: unpublish when shutting down
|
||||
- ios 9.3 compatibility issue
|
||||
- function mispelling in rgb widget
|
||||
- widgets
|
||||
- modal: added `popupLeft` and `popupTop` properties
|
||||
- faders/meter: add css variable `--gauge-opacity` to allow setting a fixed gauge opacity for meters and compact faders
|
||||
- custom module
|
||||
- messages converted from midi inputs can be filtered
|
||||
|
||||
|
||||
## 0.28.3
|
||||
|
||||
- bug fixes
|
||||
- widgets not correctly drawn when hidden/shown with dynamic css
|
||||
- iOS: file upload failing sometimes
|
||||
- widgets
|
||||
- knob: small design improvements (pips don't take extra space anymore)
|
||||
|
||||
## 0.28.2
|
||||
|
||||
- bug fixes
|
||||
- session list: fix "remove from history" always removing the first item in the list
|
||||
- custom module
|
||||
- expose `setInterval`
|
||||
- expose `clearTimeout` and `clearInterval`
|
||||
- prevent errors when failing to run the module
|
||||
|
||||
|
||||
## 0.28.1
|
||||
|
||||
- bug fixes
|
||||
- regression in nested clones structures handling
|
||||
|
||||
|
||||
## 0.28.0
|
||||
|
||||
- widgets
|
||||
- matrices: support setting `split` property as a string to allow using children's indexes in their address (`$` is replaced with the index number)
|
||||
- text: `wrap` property doesn't break words by default anymore
|
||||
- rgb: added `range` property
|
||||
- launcher
|
||||
- right-click context menu (copy, paste, clear console, toggle console autoscoll, relaunch app)
|
||||
- better font for the console
|
||||
|
||||
## 0.27.2
|
||||
|
||||
- bug fixes
|
||||
- session/state file upload sometimes failing silently
|
||||
- regression breaking the app for iOS
|
||||
|
||||
## 0.27.1
|
||||
|
||||
- bug fixes
|
||||
- error when resizing a widget and its clone(s) at the same time
|
||||
- error with non string css property
|
||||
- session list not reappearing when failing to load
|
||||
- broken state file loading
|
||||
- misc
|
||||
- added a loading indicator when uploading a session file or a state file
|
||||
|
||||
## 0.27.0
|
||||
|
||||
- bug fixes
|
||||
- strip: nested strips were inheriting their parent's `spacing`
|
||||
- modal: prevent error when retrieving a child's property
|
||||
- modal: prevent touch event from affecting elements behind the popup when closing it
|
||||
- clone: some properies in target widget were not applied to the clone
|
||||
- clone: prevent clone from resetting its target value when created
|
||||
- text: vertical centering issues in narrow widgets
|
||||
- dynamic properties: when using a widget's own value to determine its osc settings, these are checked and updated if needed before sending the message
|
||||
- prevent error when loading a session containing invalid property inheritance calls
|
||||
- broken build for iOS 9.3
|
||||
- editor
|
||||
- wrap in: insert wrapper at selected widget's index
|
||||
- wrap in: set label to false by default when wrapping in a strip or a panel
|
||||
- css property `pointer-events:none;` is now ignored when the editor is enabled
|
||||
- preverve pecentages when dragging/resizing a widget that has its position/size written in percents
|
||||
- widgets
|
||||
- **new** `OSC{/address, default_value}` syntax
|
||||
- ui
|
||||
- sidepanel is now resizable
|
||||
- themes
|
||||
- `responsive-fonts`: increase size for big screens
|
||||
- build
|
||||
- dropped support for node < 4.8
|
||||
|
||||
## 0.26.3
|
||||
|
||||
- bug fixes
|
||||
- ios: broken default accent color in clone Widgets
|
||||
- ios/android: closing the sidepanel opened the tab next to the menu button
|
||||
- editor
|
||||
- mac: use `shift` instead of `command` for multi widget selection to match native behaviour and prevent unwanted zoom with trackpads
|
||||
- widgets
|
||||
- strip: `spacing` now accepts percents
|
||||
|
||||
## 0.26.2
|
||||
|
||||
- bug fixes
|
||||
- regression preventing glass effect from using the widget's color
|
||||
- missing last key in keyboard widget
|
||||
- editor: select parent widget after deleting a widget
|
||||
- regression letting user to scroll the main document
|
||||
- editor: wrap/cut/delete multiple widget not working properly
|
||||
- widgets
|
||||
- text: set line-height relative to font size
|
||||
- meter: added `gradient` feature
|
||||
|
||||
## 0.26.1
|
||||
|
||||
- bug fixes
|
||||
- ios: text input fields not editable
|
||||
- editor
|
||||
- mac: use `command` instead of `ctrl` for multi widget selection
|
||||
|
||||
## 0.26.0
|
||||
|
||||
- bug fixes
|
||||
- editor: when selecting another widget while editing a property, changes where applied to the newly selected widget
|
||||
- widgets: css: @media queries parsing
|
||||
- prevent some errors when synchronizing clients
|
||||
- use command key instead of ctrl for zooming on mac
|
||||
- clone: memory leak / freeze
|
||||
- default client
|
||||
- mac: disabled unsupported pinch zoom
|
||||
- themes
|
||||
- alt-buttons: modal font-weight & color fix; push button active state colored border
|
||||
- added "responsive-fonts" theme
|
||||
- editor
|
||||
- allow multi widget resizing/dragging
|
||||
- tweaked ctrl+click/right-click selection behaviors
|
||||
- **new** "Wrap in" context menu
|
||||
|
||||
|
||||
## 0.25.0
|
||||
|
||||
- bug fixes
|
||||
- launcher: parse array options correctly when an item contains spaces,
|
||||
- launcher: the terminal now grows and scrolls to bottom automatically
|
||||
- editor: broken children reordering; children
|
||||
list display bug with long `id`s
|
||||
- main
|
||||
- add `--fullscreen` switch (default gui only, bypasses the sidepanel fullscreen button)
|
||||
- added/updated some themes: `orange`, `light`, `dark`, `alt-buttons` (the latter can be combined with other themes)
|
||||
- widgets
|
||||
- knob: big knobs design tweaks
|
||||
- **new** `default` property that sets a widgets initial/doubleTap/spring value. The `value` property does no longer serve this purpose.
|
||||
- **new** `bypass` property that disable osc messages (except when requested via `/GET` and `/EDIT/GET`)
|
||||
- panel: **removed** `noSync` property (backward compatible fallback to `bypass`)
|
||||
- property inheritance: `@{widget_id.value}`, `@{widget_id}` and `@{widget_id._value}` now all refer to the widget's current value (the latter being kept for backward compatibility); If a property update triggers an osc message, it will now be sent after the other dynamic properties changes are resolved (such as osc `address`, `target`, etc)
|
||||
- text: added `align` and `wrap` properties
|
||||
- input: added `align` property
|
||||
- sliders/xy: `doubleTap` can be an osc address to send a special message instead of resetting the widget's value
|
||||
- editor
|
||||
- allow selecting multiple widgets (`ctrl + click`) if they share the same parent. Context-menu and sidepanel editing actions apply to all selected widgets
|
||||
|
||||
## 0.24.3
|
||||
|
||||
- bug fixes
|
||||
- property maths: variables names declared in a formula were replaced by their associated value if found in the formula's result
|
||||
- missing console logs on windows
|
||||
- ui
|
||||
- add iOS fullscreen support via add-to-home feature
|
||||
- editor
|
||||
- ask for confirmation when closing or refreshing the page if the editor has been enabled at least once
|
||||
- prevent default widget interaction when selecting a widget for edition
|
||||
- widgets
|
||||
- knob: small design tweaks
|
||||
- misc
|
||||
- remove proprietary ffmepg codec from package
|
||||
|
||||
## 0.24.2
|
||||
|
||||
- bug fixes
|
||||
- macOs app menu & shortcuts
|
||||
|
||||
## 0.24.1
|
||||
|
||||
- bug fixes
|
||||
- server/client communication errors
|
||||
- prevent error windows from spawning
|
||||
- main
|
||||
- added some menu items on macOs (including "Quit" !)
|
||||
|
||||
## 0.24.0
|
||||
|
||||
:warning: **BREAKING CHANGES** :warning:
|
||||
|
||||
Read the changelog carefully, old sessions files are likely to need some adjustements to work as they used to. Plots and input widgets had their `widgetId` option removed because it was redundant with the generic `linkId` property.
|
||||
|
||||
- bug fixes
|
||||
- regression preventing dropdown to display no option selected
|
||||
- crossfaders display issue on iOS
|
||||
- restored compatibility options for server-client communications
|
||||
- xy: `doubleTap` option
|
||||
- range: `spring` option
|
||||
- plot: crash when drawing only one point
|
||||
- widget css: fixed @media queries @keyframes parsings
|
||||
- main
|
||||
- theme files changes are automatically applied
|
||||
- server-client communication system rewritten -> HUGE latency reduction and stability improvement especially under stress conditions
|
||||
- engine update (electron@1.8.2)
|
||||
- widgets
|
||||
- **new** svg plot widget
|
||||
- switch: wrap non-array `values` property in an array
|
||||
- dropdown: wrap non-array `values` property in an array; always add a default empty value
|
||||
- property inheritance: added shorthand default to `_value` when no property is specified (`@{widgetId}`); some properties can now be dynamically changed without recreating the widget entirely
|
||||
- property maths: added support for math expressions everywhere via `#{}`
|
||||
- input: add glass effect when `editable` is `false`
|
||||
- `linkId` can now be set as an array of linkIds
|
||||
- plot: added `dots` options; **removed** `points` options (use `value` and property inheritance instead)
|
||||
- eq: **removed** `filters` options (use `value` and property inheritance instead)
|
||||
- plot/meter/led/rgbled/text: **removed** `widgetId` option
|
||||
- input: **removed** `widgetId` option
|
||||
- math: **deprecated** `formula` widget
|
||||
|
||||
## 0.23.1
|
||||
|
||||
- bug fixes
|
||||
- regression breaking modal's position in scrolled tab containers
|
||||
- widget with a `touchAddress` set now send their touch-off message when removed or recreated while being interacted with
|
||||
- broken windows builds (long path issue)
|
||||
|
||||
## 0.23.0
|
||||
|
||||
- bug fixes
|
||||
- plots now send their value to other widget for synchronization as expected
|
||||
- text widgets now apply their target widget's precision
|
||||
- property inheritance accepts targetting a parent widget by its id
|
||||
- multiple icons not displayed correctly
|
||||
- broken `--blank` option
|
||||
- main
|
||||
- added `--disable-gpu` option for disabling hardware acceleration (fixes rendering glitches and reduces input lag on some systems)
|
||||
- widgets
|
||||
- inputs: **new** `keys` widget, for keyboard bindings
|
||||
- property inheritance: new special property name `_value` (retrieve the widget's value, and update when it changes)
|
||||
- switch: added `showValues` to display both values and labels in the buttons; array values can now be selected via osc
|
||||
- range: both handles can be moved by holding `shift` while dragging
|
||||
- rgb: **removed** `touchAddress` option
|
||||
- labels/texts: multiple white spaces are no longer merged
|
||||
- plot: can receive stringified arrays of coordinates or stringified objects for merging coordinates sets; added `bars` option for drawing barcharts;
|
||||
- widgets' `precision` option allows setting a specific data type for numbers (sliders can send doubles !)
|
||||
- misc
|
||||
- event system rewritten
|
||||
- js build size reduced
|
||||
|
||||
## 0.22.0
|
||||
|
||||
- bug fixes
|
||||
- sessions opened from command line with relative paths are now added to the history with their absolute path
|
||||
- sending an empty message to a `text` widget resets it to its initial value and without ignoring its `value` property
|
||||
- sending no value to a widget with `preArgs` is now possible : all the arguments found in incomming osc messages are now taken into account to match the widgets in the session
|
||||
- regression breaking state quicksave from sidepanel
|
||||
- engine
|
||||
- downgraded to the latest *stable* electron release
|
||||
- main
|
||||
- added `zeroconf` / `bonjour` publishing for the app's http and osc input ports
|
||||
- added `--instance-name` option to differenciate mulitple instances in zeroconf networks
|
||||
- widgets
|
||||
- sliders/pads: holding `Ctrl` now enables high precision dragging with the mouse and bypasses the `snap` option
|
||||
- inputs: renamed `input`'s property `horizontal` to `vertical` to match how the widget actually displays
|
||||
- sliders: **new** `range` widget
|
||||
- plots: **new** `image` widget
|
||||
- remote control
|
||||
- **removed** deprecated `/EXEC`
|
||||
- renamed `/EDIT_SOFT` to `/EDIT/MERGE`
|
||||
- added `/EDIT/GET` (get a widget's data)
|
||||
- added `/GET` (get a widget's value)
|
||||
- added `/SET` (set a widget's value as if it was interacted with from the interface)
|
||||
|
||||
|
||||
## 0.21.3
|
||||
|
||||
- bug fixes
|
||||
- session/state: regression (0.21.2) breaking save-to-file function
|
||||
- ui
|
||||
- FontAwesome 5 (icon font) !
|
||||
|
||||
## 0.21.2
|
||||
|
||||
- bug fixes
|
||||
- cli: broken long flag `--no-gui`
|
||||
- headless: when running with `node`, errors don't stop the server; when running with `electron` (default), errors are logged in the console instead of being showed in a dialog window
|
||||
- switcher widgets regression (broken)
|
||||
- switcher widgets regression (broken)
|
||||
- midi
|
||||
- float values are now allowed and automatically rounded
|
||||
- misc
|
||||
|
|
|
|||
33
README.md
|
|
@ -21,31 +21,30 @@
|
|||
|
||||
The documentation is located at [osc.ammd.net](http://osc.ammd.net)
|
||||
|
||||
## Features
|
||||
|
||||
- multiplatform desktop server application with built-in client interface
|
||||
- mouse & multitouch interfaces compatible with **Chrome 50** or later
|
||||
- all the widgets you need !
|
||||
- built-in live editor
|
||||
- clients synchronization
|
||||
- deep customization possibilities such as theming and messages filtering
|
||||
- *true* control over what the widgets send
|
||||
- midi inputs/outputs
|
||||
|
||||
## Supported platforms
|
||||
|
||||
The server can run on all [platforms supported by Electron](https://electron.atom.io/docs/tutorial/supported-platforms/).
|
||||
The only supported client browsers are the one provided with the server and Chrome/Chromium version `50` or later. For iOS devices, the minimal version required is `9.3`.
|
||||
The server can run on all [platforms supported by Electron](https://electron.atom.io/docs/tutorial/supported-platforms/). Clients just need to connect to the server with a compatible browser :
|
||||
|
||||
- any system running Chrome/Chromium version `50` or later (Linux, MacOS, Windows, Android, etc)
|
||||
- iOS version `9.3` or later
|
||||
|
||||
Firefox is *not* supported.
|
||||
|
||||
## License & credits
|
||||
|
||||
Copyleft © Jean-Emmanuel @ [AMMD](http://ammd.net) 2017
|
||||
Copyleft © Jean-Emmanuel Doucet @ [AMMD](http://ammd.net) 2018.
|
||||
This program is a free software released under the [GNU/GPL3](ttps://github.com/jean-emmanuel/open-stage-control/blob/master/LICENSE) license.
|
||||
|
||||
### Dependencies
|
||||
|
||||
This program is a free software released under the GNU/GPL3 license, it relies on the use of several other free softwares, including [Node.js](https://nodejs.org/), [Electron](http://electron.atom.io/), [osc.js](https://github.com/colinbdclark/osc.js), [socket.io](http://socket.io), [browserify](http://browserify.org), [exorcist](https://github.com/thlorenz/exorcist), [express](http://expressjs.com), [node-sass](https://github.com/sass/node-sass), [jQuery](http://jquery.com/), [jQuery-UI](http://jqueryui.com/), [Font Awesome](http://fontawesome.io/), [source-map](https://github.com/mozilla/source-map), [mathjs](http://mathjs.org/)
|
||||
Open Stage Control relies on several other free softwares, including [Node.js](https://nodejs.org/), [Electron](http://electron.atom.io/), [osc.js](https://github.com/colinbdclark/osc.js), [babel](http://babeljs.io/), [browserify](http://browserify.org), [exorcist](https://github.com/thlorenz/exorcist), [express](http://expressjs.com), [node-sass](https://github.com/sass/node-sass), [jQuery](http://jquery.com/), [jQuery-UI](http://jqueryui.com/), [Font Awesome](http://fontawesome.io/), [stacktracejs](stacktracejs.com), [mathjs](http://mathjs.org/). A comprehensive and up-to-date list can be found [here](https://github.com/jean-emmanuel/open-stage-control/network/dependencies).
|
||||
|
||||
### Contributors
|
||||
|
||||
https://github.com/jean-emmanuel/open-stage-control/graphs/contributors
|
||||
|
||||
----
|
||||
|
||||
<a href="http://browserstack.com/"><img alt="BrowserStack" src="http://osc.ammd.net/img/logo-browserstack.svg" width="300" /></a>
|
||||
<a href="http://browserstack.com/"><img alt="BrowserStack" src="http://osc.ammd.net/img/logo-browserstack.png" width="240" /></a>
|
||||
|
||||
BrowserStack helps debugging Open Stage Control by providing a complete suite of browser emulators for Android, iOS and Windows, how awesome is that ? *Quite very much indeed !*
|
||||
BrowserStack supports Open Stage Control by providing a complete suite of browser emulators for Android, iOS and Windows.
|
||||
|
|
|
|||
BIN
app/browser/fonts/fa-solid-900.woff
Normal file
14
app/browser/fonts/fa-solid.css
Normal file
|
|
@ -0,0 +1,14 @@
|
|||
/*!
|
||||
* Font Awesome Free 5.0.8 by @fontawesome - https://fontawesome.com
|
||||
* License - https://fontawesome.com/license (Icons: CC BY 4.0, Fonts: SIL OFL 1.1, Code: MIT License)
|
||||
*/
|
||||
@font-face {
|
||||
font-family: FontAwesome;
|
||||
font-style: normal;
|
||||
font-weight: 900;
|
||||
src: url("./fa-solid-900.woff") format("woff")}
|
||||
|
||||
.fa,
|
||||
.fas {
|
||||
font-family: FontAwesome;
|
||||
font-weight: 900; }
|
||||
4
app/browser/fonts/font-awesome.min.css
vendored
5
app/browser/fonts/fontawesome.min.css
vendored
Normal file
|
|
@ -4,3 +4,10 @@
|
|||
font-weight: 500;
|
||||
src: url('roboto-medium.woff') format('woff');
|
||||
}
|
||||
|
||||
@font-face {
|
||||
font-family: 'RobotoMono';
|
||||
font-style: normal;
|
||||
font-weight: 500;
|
||||
src: url('roboto-mono.woff') format('woff');
|
||||
}
|
||||
|
|
|
|||
BIN
app/browser/fonts/roboto-mono.woff
Normal file
|
|
@ -3,18 +3,22 @@
|
|||
<head>
|
||||
<meta charset="utf-8"/>
|
||||
<meta name="viewport" content="width=device-width, user-scalable=no"/>
|
||||
<link rel="preload" href="fonts/fontawesome-webfont.woff" as="font"/>
|
||||
<link rel="preload" href="fonts/roboto-medium.woff" as="font"/>
|
||||
<link rel="preload" href="scripts.js.map" as="fetch"/>
|
||||
<link rel="stylesheet" type="text/css" href="styles.css" hot-reload/>
|
||||
<link rel="stylesheet" type="text/css" href="theme.css" hot-reload/>
|
||||
<link rel="stylesheet" type="text/css" href="fonts/font-awesome.min.css"/>
|
||||
<link rel="stylesheet" type="text/css" href="fonts/roboto-medium.css"/>
|
||||
<script src="scripts.js"></script>
|
||||
<meta name="mobile-web-app-capable" content="yes">
|
||||
<meta name="apple-mobile-web-app-capable" content="yes">
|
||||
<meta name="apple-mobile-web-app-status-bar-style" content="black">
|
||||
<link rel="apple-touch-icon" href="browser/logo.png" />
|
||||
<link rel="preload" href="browser/fonts/fa-solid-900.woff" as="font"/>
|
||||
<link rel="preload" href="browser/fonts/roboto-medium.woff" as="font"/>
|
||||
<link rel="stylesheet" type="text/css" href="browser/styles.css" hot-reload/>
|
||||
<link rel="stylesheet" type="text/css" href="browser/theme.css" hot-reload/>
|
||||
<link rel="stylesheet" type="text/css" href="browser/fonts/fontawesome.min.css"/>
|
||||
<link rel="stylesheet" type="text/css" href="browser/fonts/fa-solid.css"/>
|
||||
<link rel="stylesheet" type="text/css" href="browser/fonts/roboto-medium.css"/>
|
||||
<script src="browser/scripts.js"></script>
|
||||
<link rel="shortcut icon" href="browser/favicon.png?2"/>
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<div id="lobby"></div>
|
||||
<div id="container"></div>
|
||||
<div id="sidepanel"></div>
|
||||
</body>
|
||||
|
|
|
|||
2
app/browser/themes/.gitignore
vendored
Normal file
|
|
@ -0,0 +1,2 @@
|
|||
*
|
||||
!.gitignore
|
||||
156
app/examples/keys.json
Normal file
|
|
@ -0,0 +1,156 @@
|
|||
[
|
||||
{
|
||||
"type": "root",
|
||||
"tabs": [
|
||||
{
|
||||
"type": "tab",
|
||||
"id": "tab_1",
|
||||
"label": "auto",
|
||||
"color": "auto",
|
||||
"css": "",
|
||||
"layout": "",
|
||||
"spacing": 0,
|
||||
"value": "",
|
||||
"precision": 0,
|
||||
"address": "/tab_1",
|
||||
"preArgs": [],
|
||||
"target": [],
|
||||
"variables": "@{parent.variables}",
|
||||
"widgets": [
|
||||
{
|
||||
"type": "keys",
|
||||
"top": 300,
|
||||
"left": 0,
|
||||
"id": "keys_1",
|
||||
"width": "auto",
|
||||
"height": "auto",
|
||||
"label": "auto",
|
||||
"color": "auto",
|
||||
"css": "",
|
||||
"binding": [
|
||||
"r",
|
||||
"f"
|
||||
],
|
||||
"keydown": "#{\nx = key == \"r\" ? 0.1 : -0.1;\n@{fader_1} + x\n}",
|
||||
"repeat": true,
|
||||
"keyup": "",
|
||||
"linkId": ">> A"
|
||||
},
|
||||
{
|
||||
"type": "fader",
|
||||
"top": 0,
|
||||
"left": 0,
|
||||
"id": "fader_1",
|
||||
"linkId": "<< A",
|
||||
"width": "auto",
|
||||
"height": "auto",
|
||||
"label": "auto",
|
||||
"color": "auto",
|
||||
"css": "",
|
||||
"horizontal": false,
|
||||
"alignRight": false,
|
||||
"pips": true,
|
||||
"input": true,
|
||||
"meter": false,
|
||||
"compact": false,
|
||||
"dashed": false,
|
||||
"snap": false,
|
||||
"spring": false,
|
||||
"doubleTap": false,
|
||||
"range": {
|
||||
"min": 0,
|
||||
"max": 1
|
||||
},
|
||||
"logScale": false,
|
||||
"unit": "",
|
||||
"origin": "auto",
|
||||
"value": "",
|
||||
"precision": 2,
|
||||
"address": "/fader_1",
|
||||
"touchAddress": "",
|
||||
"meterAddress": "",
|
||||
"preArgs": [],
|
||||
"target": [],
|
||||
"default": "",
|
||||
"bypass": false
|
||||
},
|
||||
{
|
||||
"type": "xy",
|
||||
"top": 50,
|
||||
"left": 170,
|
||||
"id": "xy_1",
|
||||
"linkId": "<< B",
|
||||
"width": 210,
|
||||
"height": 220,
|
||||
"label": "auto",
|
||||
"color": "auto",
|
||||
"css": "",
|
||||
"input": true,
|
||||
"pips": true,
|
||||
"pointSize": 20,
|
||||
"snap": false,
|
||||
"spring": false,
|
||||
"doubleTap": false,
|
||||
"rangeX": {
|
||||
"min": 0,
|
||||
"max": 1
|
||||
},
|
||||
"rangeY": {
|
||||
"min": 0,
|
||||
"max": 1
|
||||
},
|
||||
"logScaleX": false,
|
||||
"logScaleY": false,
|
||||
"value": "",
|
||||
"precision": 2,
|
||||
"address": "/xy_1",
|
||||
"touchAddress": "",
|
||||
"preArgs": [],
|
||||
"split": false,
|
||||
"target": [],
|
||||
"default": "",
|
||||
"bypass": false
|
||||
},
|
||||
{
|
||||
"type": "keys",
|
||||
"top": 270,
|
||||
"left": 170,
|
||||
"id": "keys_2",
|
||||
"width": 210,
|
||||
"height": "auto",
|
||||
"label": "auto",
|
||||
"color": "auto",
|
||||
"css": "",
|
||||
"binding": [
|
||||
"g",
|
||||
"t"
|
||||
],
|
||||
"keydown": "#{\nx = key == \"t\" ? 0.1 : -0.1;\n@{xy_1}[0] + x\n@{xy_1}[1] + x\n}",
|
||||
"keyup": "",
|
||||
"repeat": false,
|
||||
"linkId": ">> B"
|
||||
}
|
||||
],
|
||||
"tabs": [],
|
||||
"linkId": "",
|
||||
"default": "",
|
||||
"bypass": false,
|
||||
"scroll": true
|
||||
}
|
||||
],
|
||||
"color": "auto",
|
||||
"css": "",
|
||||
"value": "",
|
||||
"precision": 0,
|
||||
"address": "/root",
|
||||
"preArgs": [],
|
||||
"target": [],
|
||||
"variables": {},
|
||||
"id": "root",
|
||||
"linkId": "",
|
||||
"default": "",
|
||||
"bypass": false,
|
||||
"scroll": true,
|
||||
"label": false
|
||||
}
|
||||
]
|
||||
89
app/examples/svg.json
Normal file
|
|
@ -0,0 +1,89 @@
|
|||
[
|
||||
{
|
||||
"type": "root",
|
||||
"tabs": [
|
||||
{
|
||||
"type": "tab",
|
||||
"id": "tab_1",
|
||||
"linkId": "",
|
||||
"label": "Rgb Levels",
|
||||
"color": "auto",
|
||||
"css": "",
|
||||
"layout": "",
|
||||
"spacing": 0,
|
||||
"default": "",
|
||||
"value": "",
|
||||
"precision": 0,
|
||||
"address": "/tab_1",
|
||||
"preArgs": [],
|
||||
"target": [],
|
||||
"bypass": false,
|
||||
"variables": "@{parent.variables}",
|
||||
"widgets": [
|
||||
{
|
||||
"type": "svg",
|
||||
"top": 150,
|
||||
"left": 0,
|
||||
"id": "rgb_svg",
|
||||
"linkId": "",
|
||||
"width": "100%",
|
||||
"height": 190,
|
||||
"label": "auto",
|
||||
"color": "auto",
|
||||
"css": "path {\n fill:none;\n stroke-width:3rem\n}",
|
||||
"svg": "#{\n\n# build the data array\n# [ [r,g,b], [r,g,b], [r,g,b], etc ]\ndata = @{rgb_matrix};\n\n# extract channels and convert to relative y-axis coordinates\n# assuming the y-range is 0-255\n# 96 - val * 94 for padding and y-axis reversal\n# we add a small offset to make sure the 3 lines are always visible\n\nred = 96 - flatten(data[0:end,0]) / 255 * 94 + 2;\ngreen = 96 - flatten(data[0:end,1]) / 255 * 94;\nblue = 96 - flatten(data[0:end,2]) / 255 * 94 - 2;\n\n# build the x-axis relative coordinates array\n\nlength = size(red)[0]\nxaxis = (0:length) / (length-1) * 100;\n\n\n# convert coords to svg path string\nsvgCoords(color) = map(color, f(c,i)=print(\"L$0%x $1%y\", [xaxis[i], c]));\n\n# svg path first command must be \"M\", not \"L\" \nsvgString(color) = concat(\"M\", unpack(svgCoords(color))[1:end]);\n\n}\n\n\n<path stroke=\"red\" d=\"#{svgString(red)}\" />\n<path stroke=\"lime\" d=\"#{svgString(green)}\" />\n<path stroke=\"blue\" d=\"#{svgString(blue)}\" />",
|
||||
"preArgs": [],
|
||||
"address": "/rgb_svg"
|
||||
},
|
||||
{
|
||||
"type": "matrix",
|
||||
"top": 0,
|
||||
"left": 0,
|
||||
"id": "rgb_matrix",
|
||||
"width": "100.60%",
|
||||
"height": 150,
|
||||
"label": "auto",
|
||||
"color": "auto",
|
||||
"css": "",
|
||||
"widgetType": "rgb",
|
||||
"matrix": [
|
||||
8,
|
||||
1
|
||||
],
|
||||
"start": 0,
|
||||
"spacing": 0,
|
||||
"traversing": false,
|
||||
"borders": false,
|
||||
"props": {
|
||||
"input": false,
|
||||
"label": false
|
||||
},
|
||||
"default": "",
|
||||
"value": "",
|
||||
"precision": 2,
|
||||
"address": "/matrix_1",
|
||||
"preArgs": [],
|
||||
"target": [],
|
||||
"bypass": false
|
||||
}
|
||||
],
|
||||
"tabs": [],
|
||||
"scroll": true
|
||||
}
|
||||
],
|
||||
"id": "root",
|
||||
"linkId": "",
|
||||
"color": "auto",
|
||||
"css": "",
|
||||
"default": "",
|
||||
"value": "",
|
||||
"precision": 0,
|
||||
"address": "/root",
|
||||
"preArgs": [],
|
||||
"target": [],
|
||||
"bypass": false,
|
||||
"variables": {},
|
||||
"scroll": true,
|
||||
"label": false
|
||||
}
|
||||
]
|
||||
1970
app/examples/widgets.json
Normal file
18
app/launcher/index.html
Normal file
|
|
@ -0,0 +1,18 @@
|
|||
<!DOCTYPE html>
|
||||
<html id="launcher">
|
||||
<head>
|
||||
<meta name="viewport" content="width=device-width, user-scalable=no"/>
|
||||
<link rel="preload" href="../browser/fonts/roboto-medium.woff" as="font"/>
|
||||
<link rel="preload" href="../browser/fonts/fa-solid-900.woff" as="font"/>
|
||||
<link rel="stylesheet" type="text/css" href="../browser/styles.css"/>
|
||||
<link rel="stylesheet" type="text/css" href="../browser/fonts/fontawesome.min.css"/>
|
||||
<link rel="stylesheet" type="text/css" href="../browser/fonts/fa-solid.css"/>
|
||||
<link rel="stylesheet" type="text/css" href="../browser/fonts/roboto-medium.css"/>
|
||||
<script src="scripts.js"></script>
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<div id="loading"><div class="spinner"></div></div>
|
||||
</body>
|
||||
|
||||
</html>
|
||||
|
|
@ -1,9 +1,9 @@
|
|||
var vm = require('vm'),
|
||||
path = require('path'),
|
||||
var path = require('path'),
|
||||
fs = require('fs'),
|
||||
settings = require('./settings'),
|
||||
osc = require('./osc'),
|
||||
{ipc, clients} = require('./server'),
|
||||
{ipc} = require('./server'),
|
||||
theme = require('./theme'),
|
||||
chokidar = require('chokidar')
|
||||
|
||||
var openedSessions = {},
|
||||
|
|
@ -24,7 +24,7 @@ module.exports = {
|
|||
return
|
||||
}
|
||||
|
||||
if (settings.read('sessionFile')) this.sessionOpen({path:settings.read('sessionFile')},clientId)
|
||||
if (settings.read('sessionFile')) return this.sessionOpen({path:settings.read('sessionFile')},clientId)
|
||||
|
||||
var recentSessions = settings.read('recentSessions')
|
||||
|
||||
|
|
@ -45,7 +45,7 @@ module.exports = {
|
|||
if (err || !stats.isFile()) return
|
||||
|
||||
// add session to history
|
||||
sessionlist.unshift(data)
|
||||
sessionlist.unshift(path.resolve(data))
|
||||
// remove doubles from history
|
||||
sessionlist = sessionlist.filter(function(elem, index, self) {
|
||||
return index == self.indexOf(elem)
|
||||
|
|
@ -58,22 +58,20 @@ module.exports = {
|
|||
|
||||
sessionRemoveFromHistory: function(data) {
|
||||
var sessionlist = settings.read('recentSessions')
|
||||
sessionlist.splice(data,1)
|
||||
settings.write('recentSessions',sessionlist)
|
||||
if (sessionlist.indexOf(data) > -1) {
|
||||
sessionlist.splice(sessionlist.indexOf(data),1)
|
||||
settings.write('recentSessions',sessionlist)
|
||||
}
|
||||
},
|
||||
|
||||
sessionOpen: function(data,clientId) {
|
||||
|
||||
var file = data.file || (function(){try {return fs.readFileSync(data.path,'utf8')} catch(err) {return false}})(),
|
||||
error = file===false&&data.path?'Session file "' + data.path + '" not found.':false,
|
||||
var file = data.file || (function(){try {return fs.readFileSync(data.path,'utf8')} catch(err) {return false}})(),
|
||||
error = file === false && data.path ? 'Session file "' + data.path + '" not found.' : false,
|
||||
session
|
||||
|
||||
if (data.path && data.path.split('.').pop() == 'js') {
|
||||
console.warn(`Warning: support for .js session files is deprecated, please use the .json extension instead`)
|
||||
}
|
||||
|
||||
try {
|
||||
session = vm.runInNewContext(file)
|
||||
session = JSON.parse(file)
|
||||
} catch(err) {
|
||||
error = err
|
||||
}
|
||||
|
|
@ -129,13 +127,30 @@ module.exports = {
|
|||
|
||||
} else {
|
||||
|
||||
ipc.send('error', `Invalid session file (${error})`)
|
||||
ipc.send('error', `Invalid session file (${error})`)
|
||||
|
||||
}
|
||||
},
|
||||
|
||||
sessionOpened: function(data, clientId) {
|
||||
clients[clientId].broadcast.emit('stateSend')
|
||||
|
||||
if (settings.read('stateFile')) {
|
||||
var send = true
|
||||
for (var id in ipc.clients) {
|
||||
// only make the client send its osc state if there are no other active clients
|
||||
if (id !== clientId && ipc.clients[id].connected()) {
|
||||
send = false
|
||||
}
|
||||
}
|
||||
var state = {
|
||||
state: settings.read('stateFile'),
|
||||
send: send
|
||||
}
|
||||
ipc.send('stateLoad', state, clientId)
|
||||
}
|
||||
|
||||
ipc.send('stateSend', null, null, clientId)
|
||||
|
||||
},
|
||||
|
||||
savingSession: function(data, clientId) {
|
||||
|
|
@ -151,92 +166,96 @@ module.exports = {
|
|||
var value = shortdata.v,
|
||||
data = widgetHashTable[clientId][shortdata.h]
|
||||
|
||||
data.args = data.preArgs.concat(value)
|
||||
|
||||
var cloned
|
||||
data = JSON.parse(JSON.stringify(data))
|
||||
for (var k in shortdata) {
|
||||
if (!cloned) {
|
||||
data = JSON.parse(JSON.stringify(data))
|
||||
cloned = true
|
||||
}
|
||||
if (data[k]) {
|
||||
data[k] = shortdata[k]
|
||||
}
|
||||
data[k] = shortdata[k]
|
||||
}
|
||||
|
||||
clients[clientId].broadcast.emit('receiveOsc', data)
|
||||
data.args = data.preArgs ? data.preArgs.concat(value) : [value]
|
||||
|
||||
if (!data.noSync) ipc.send('receiveOsc', data, null, clientId)
|
||||
|
||||
|
||||
},
|
||||
|
||||
sendOsc: function(shortdata, clientId) {
|
||||
|
||||
if (!(widgetHashTable[clientId] && widgetHashTable[clientId][shortdata.h])) return
|
||||
if (!(widgetHashTable[clientId] && widgetHashTable[clientId][shortdata.h])) return
|
||||
|
||||
var value = shortdata.v,
|
||||
data = widgetHashTable[clientId][shortdata.h]
|
||||
var value = shortdata.v,
|
||||
data = widgetHashTable[clientId][shortdata.h]
|
||||
|
||||
data.args = data.preArgs.concat(value)
|
||||
data = JSON.parse(JSON.stringify(data))
|
||||
for (var k in shortdata) {
|
||||
data[k] = shortdata[k]
|
||||
}
|
||||
|
||||
var cloned
|
||||
for (var k in shortdata) {
|
||||
if (!cloned) {
|
||||
data = JSON.parse(JSON.stringify(data))
|
||||
cloned = true
|
||||
data.args = data.preArgs ? data.preArgs.concat(value) : [value]
|
||||
|
||||
if (data.target) {
|
||||
|
||||
var targets = []
|
||||
|
||||
if (data.target.indexOf(null) === -1 && settings.read('targets') && !shortdata.target) Array.prototype.push.apply(targets, settings.read('targets'))
|
||||
if (data.target) Array.prototype.push.apply(targets, data.target)
|
||||
|
||||
for (var i in targets) {
|
||||
|
||||
if (targets[i] === 'self') {
|
||||
ipc.send('receiveOsc',data,clientId)
|
||||
continue
|
||||
} else if (targets[i] === null) {
|
||||
continue
|
||||
}
|
||||
if (data[k]) {
|
||||
data[k] = shortdata[k]
|
||||
}
|
||||
}
|
||||
|
||||
if (data.target.indexOf(null) == -1) {
|
||||
var host = targets[i].split(':')[0],
|
||||
port = targets[i].split(':')[1]
|
||||
|
||||
var targets = []
|
||||
if (port) {
|
||||
|
||||
if (settings.read('syncTargets')) Array.prototype.push.apply(targets, settings.read('syncTargets'))
|
||||
if (data.target) Array.prototype.push.apply(targets, data.target)
|
||||
|
||||
|
||||
for (var i in targets) {
|
||||
|
||||
if (targets[i] == 'self') {
|
||||
ipc.send('receiveOsc',data,clientId)
|
||||
continue
|
||||
}
|
||||
|
||||
var host = targets[i].split(':')[0],
|
||||
port = targets[i].split(':')[1]
|
||||
|
||||
if (port) {
|
||||
|
||||
if (data.split) {
|
||||
|
||||
for (var j in data.split) {
|
||||
osc.send(host,port,data.split[j],data.args[j],data.precision)
|
||||
}
|
||||
|
||||
} else {
|
||||
|
||||
osc.send(host,port,data.address,data.args,data.precision)
|
||||
if (data.split) {
|
||||
|
||||
for (var j in data.split) {
|
||||
osc.send(host,port,data.split[j],data.args[j],data.precision)
|
||||
}
|
||||
|
||||
} else {
|
||||
|
||||
osc.send(host,port,data.address,data.args,data.precision)
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
clients[clientId].broadcast.emit('receiveOsc', data)
|
||||
}
|
||||
|
||||
if (!data.noSync) ipc.send('receiveOsc', data, null, clientId)
|
||||
|
||||
},
|
||||
|
||||
addWidget(data, clientId) {
|
||||
|
||||
if (!widgetHashTable[clientId]) {
|
||||
widgetHashTable[clientId] = {}
|
||||
widgetHashTable[clientId] = {}
|
||||
}
|
||||
|
||||
if (!widgetHashTable[clientId][data.hash]) {
|
||||
widgetHashTable[clientId][data.hash] = {}
|
||||
}
|
||||
|
||||
var cache = widgetHashTable[clientId][data.hash],
|
||||
widgetData = data.data
|
||||
|
||||
for (var k in widgetData) {
|
||||
if ((k === 'target' || k === 'preArgs')) {
|
||||
cache[k] = Array.isArray(widgetData[k]) ? widgetData[k] : [widgetData[k]]
|
||||
} else {
|
||||
cache[k] = widgetData[k]
|
||||
}
|
||||
}
|
||||
|
||||
widgetHashTable[clientId][data.hash] = data.data
|
||||
},
|
||||
|
||||
removeWidget(data, clientId) {
|
||||
|
|
@ -260,7 +279,7 @@ module.exports = {
|
|||
settings.write('presetPath',file)
|
||||
|
||||
if (file.indexOf('.preset')==-1){file+='.preset'}
|
||||
fs.writeFile(file,data, function (err, data) {
|
||||
fs.writeFile(file,data, function(err, data) {
|
||||
if (err) throw err
|
||||
console.log('The current state was saved in '+file)
|
||||
})
|
||||
|
|
@ -272,7 +291,7 @@ module.exports = {
|
|||
},
|
||||
|
||||
reloadCss:function(){
|
||||
if (settings.read('theme')) settings.reloadTheme()
|
||||
theme.load()
|
||||
ipc.send('reloadCss')
|
||||
},
|
||||
|
||||
|
|
|
|||
|
|
@ -1,17 +1,108 @@
|
|||
var {app, Menu} = require('electron'),
|
||||
var {app, Menu, shell} = require('electron'),
|
||||
settings = require('./settings'),
|
||||
path = require('path')
|
||||
infos = require('../package.json')
|
||||
|
||||
app.commandLine.appendSwitch('--touch-events')
|
||||
|
||||
|
||||
if (settings.read('noVsync') || (!settings.cli && settings.read('argv')['disable-vsync'])) {
|
||||
if (settings.read('noVsync') || (!settings.cli && settings.read('argv')['disable-vsync'])) {
|
||||
app.commandLine.appendSwitch('--disable-gpu-vsync')
|
||||
}
|
||||
|
||||
if (settings.read('noGpu') || (!settings.cli && settings.read('argv')['disable-gpu'])) {
|
||||
app.disableHardwareAcceleration()
|
||||
}
|
||||
|
||||
var template = [{
|
||||
label: 'Edit',
|
||||
submenu: [
|
||||
{role: 'undo', accelerator: 'CmdOrCtrl+Z'},
|
||||
{role: 'redo', accelerator: 'Shift+CmdOrCtrl+Z'},
|
||||
{type: 'separator'},
|
||||
{role: 'cut', accelerator: 'CmdOrCtrl+X'},
|
||||
{role: 'copy', accelerator: 'CmdOrCtrl+C'},
|
||||
{role: 'paste', accelerator: 'CmdOrCtrl+V'}
|
||||
]
|
||||
}]
|
||||
|
||||
if (process.platform === 'darwin') {
|
||||
// Add app menu (OS X)
|
||||
template.unshift({
|
||||
label: settings.read('appName'),
|
||||
submenu: [
|
||||
{
|
||||
label: 'Hide ' + infos.productName,
|
||||
accelerator: 'Command+H',
|
||||
role: 'hide'
|
||||
},
|
||||
{
|
||||
label: 'Hide Others',
|
||||
accelerator: 'Command+Alt+H',
|
||||
role: 'hideothers'
|
||||
},
|
||||
{
|
||||
label: 'Show All',
|
||||
role: 'unhide'
|
||||
},
|
||||
{
|
||||
type: 'separator'
|
||||
},
|
||||
{
|
||||
label: 'Quit',
|
||||
accelerator: 'Command+Q',
|
||||
click: ()=>app.quit()
|
||||
}
|
||||
]
|
||||
})
|
||||
template.push(
|
||||
{
|
||||
label: 'Window',
|
||||
role: 'window',
|
||||
submenu: [
|
||||
{
|
||||
label: 'Minimize',
|
||||
accelerator: 'CmdOrCtrl+M',
|
||||
role: 'minimize'
|
||||
},
|
||||
{
|
||||
type: 'separator'
|
||||
},
|
||||
{
|
||||
label: 'Bring All to Front',
|
||||
role: 'front'
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
label: 'Help',
|
||||
role: 'help',
|
||||
submenu: [
|
||||
{
|
||||
label: 'Documentation',
|
||||
click: ()=>shell.openExternal(infos.homepage)
|
||||
},
|
||||
{
|
||||
type: 'separator'
|
||||
},
|
||||
{
|
||||
label: 'Report an Issue',
|
||||
click: ()=>shell.openExternal(infos.repository.url + '/issues')
|
||||
}
|
||||
]
|
||||
}
|
||||
)
|
||||
}
|
||||
|
||||
app.on('before-quit',()=>{
|
||||
process.exit()
|
||||
})
|
||||
|
||||
app.on('ready',()=>{
|
||||
var menu = Menu.buildFromTemplate(template)
|
||||
Menu.setApplicationMenu(menu)
|
||||
})
|
||||
|
||||
app.on('window-all-closed', function() {
|
||||
if (process.platform != 'darwin') {
|
||||
if (process.platform !== 'darwin') {
|
||||
app.quit()
|
||||
}
|
||||
})
|
||||
|
|
|
|||
|
|
@ -1,31 +1,66 @@
|
|||
var path = require('path'),
|
||||
{BrowserWindow} = require('electron'),
|
||||
{BrowserWindow, dialog} = require('electron'),
|
||||
shortcut = require('electron-localshortcut'),
|
||||
settings = require('./settings')
|
||||
settings = require('./settings'),
|
||||
theme = require('./theme')
|
||||
|
||||
var bgColor = settings.read('theme') && settings.read('theme').indexOf('--color-bg:') != -1 ?
|
||||
settings.read('theme').match(/--color-bg:([^;]*);/)[1].trim()
|
||||
: '#191f2a'
|
||||
|
||||
module.exports = function(options={}) {
|
||||
|
||||
var window
|
||||
|
||||
window = new BrowserWindow({
|
||||
width: options.width || 800,
|
||||
height: options.height || 600,
|
||||
width: options.width || 800,
|
||||
height: options.height || 600,
|
||||
title: options.title || settings.read('appName'),
|
||||
backgroundColor: options.color || bgColor,
|
||||
type:options.type
|
||||
icon: path.resolve(__dirname + '/../browser/logo.png'),
|
||||
backgroundColor: options.color || theme.backgroundColor,
|
||||
type: options.type,
|
||||
fullscreen: options.fullscreen,
|
||||
useContentSize: true,
|
||||
autoHideMenuBar: true,
|
||||
webPreferences: {
|
||||
nodeIntegration: !!options.node
|
||||
}
|
||||
})
|
||||
|
||||
window.loadURL(options.address)
|
||||
window.webContents.on('will-prevent-unload', (event)=>{
|
||||
var choice = dialog.showMessageBox(window, {
|
||||
type: 'question',
|
||||
buttons: ['Yes', 'No'],
|
||||
title: 'Are you sure ?',
|
||||
message: 'Unsaved data will be lost. Are you sure you want to quit?',
|
||||
defaultId: 0,
|
||||
cancelId: 1
|
||||
})
|
||||
if (choice === 0) {
|
||||
event.preventDefault()
|
||||
}
|
||||
})
|
||||
|
||||
window.webContents.on('will-navigate', (event)=>event.preventDefault())
|
||||
window.webContents.on('new-window', (event)=>event.preventDefault())
|
||||
|
||||
if (options.fullscreen) {
|
||||
window.webContents.on('dom-ready', ()=>{
|
||||
window.webContents.executeJavaScript(`
|
||||
window.ELECTRON_FULLSCREEN = true
|
||||
`)
|
||||
})
|
||||
}
|
||||
|
||||
if (options.zoom === false) {
|
||||
window.webContents.setVisualZoomLevelLimits(1, 1)
|
||||
}
|
||||
|
||||
|
||||
window.on('closed', function() {
|
||||
window = null
|
||||
})
|
||||
|
||||
window.setMenuBarVisibility(false)
|
||||
window.setMenu(null)
|
||||
|
||||
window.loadURL(options.address)
|
||||
|
||||
if (options.shortcuts) {
|
||||
|
||||
|
|
|
|||
119
app/main/ipc/client.js
Normal file
|
|
@ -0,0 +1,119 @@
|
|||
var EventEmitter = require('events').EventEmitter
|
||||
|
||||
var hearbeatInterval = 25000,
|
||||
hearbeatTimeout = 5000,
|
||||
dieTimeout = 60000
|
||||
|
||||
class Socket extends EventEmitter {
|
||||
|
||||
constructor(ws, id) {
|
||||
|
||||
super()
|
||||
|
||||
this.id = id
|
||||
this.socket = null
|
||||
|
||||
this.queue = []
|
||||
|
||||
this.hearbeat = undefined
|
||||
this.hearbeatTimeout = undefined
|
||||
this.on('pong', ()=>{
|
||||
this.hearbeatTimeout = clearTimeout(this.hearbeatTimeout)
|
||||
})
|
||||
this.on('ping', ()=>{
|
||||
this.socket.send('["pong"]')
|
||||
})
|
||||
|
||||
this.dieTimeout = undefined
|
||||
|
||||
this.open(ws)
|
||||
|
||||
}
|
||||
|
||||
open(ws) {
|
||||
|
||||
this.socket = ws
|
||||
|
||||
this.socket.onmessage = (e)=>{
|
||||
this.receive(e.data)
|
||||
}
|
||||
|
||||
this.socket.onclose = this.socket.onerror = ()=>{
|
||||
this.close()
|
||||
}
|
||||
|
||||
this.dieTimeout = clearTimeout(this.dieTimeout)
|
||||
|
||||
this.hearbeat = setInterval(()=>{
|
||||
if (!this.connected()) return
|
||||
this.socket.send('["ping"]')
|
||||
this.hearbeatTimeout = setTimeout(()=>{
|
||||
if (this.connected()) this.socket.close()
|
||||
}, hearbeatTimeout)
|
||||
}, hearbeatInterval)
|
||||
|
||||
}
|
||||
|
||||
close() {
|
||||
|
||||
this.hearbeat = clearInterval(this.hearbeat)
|
||||
this.hearbeatTimeout = clearTimeout(this.hearbeatTimeout)
|
||||
this.dieTimeout = clearTimeout(this.dieTimeout)
|
||||
|
||||
this.dieTimeout = setTimeout(()=>{
|
||||
|
||||
this.emit('close')
|
||||
|
||||
}, dieTimeout)
|
||||
|
||||
}
|
||||
|
||||
connected() {
|
||||
|
||||
return this.socket.readyState == this.socket.OPEN
|
||||
|
||||
}
|
||||
|
||||
receive(message) {
|
||||
|
||||
if (typeof message == 'string') {
|
||||
|
||||
var packet = JSON.parse(message)
|
||||
|
||||
if (Array.isArray(packet) && typeof packet[0] == 'string') {
|
||||
|
||||
this.emit(packet[0], packet[1])
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
send(event, data) {
|
||||
|
||||
var packet = JSON.stringify([event, data])
|
||||
|
||||
if (this.connected()) {
|
||||
this.socket.send(packet)
|
||||
} else {
|
||||
this.queue.push(packet)
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
flush(){
|
||||
|
||||
for (var i in this.queue) {
|
||||
|
||||
if (this.connected()) this.socket.send(this.queue[i])
|
||||
|
||||
}
|
||||
|
||||
this.queue = []
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
module.exports = Socket
|
||||
59
app/main/ipc/server.js
Normal file
|
|
@ -0,0 +1,59 @@
|
|||
var EventEmitter = require('events').EventEmitter,
|
||||
WebSocketServer = require('ws').Server,
|
||||
Client = require('./client')
|
||||
|
||||
class Ipc extends EventEmitter {
|
||||
|
||||
constructor(server) {
|
||||
|
||||
super()
|
||||
|
||||
this.clients = {}
|
||||
this.server = null
|
||||
|
||||
this.server = new WebSocketServer({server: server})
|
||||
|
||||
this.server.on('connection', (socket, req)=>{
|
||||
|
||||
var id = req.url.split('/').pop()
|
||||
|
||||
if (!id) return
|
||||
|
||||
if (!this.clients[id]) {
|
||||
|
||||
var client = new Client(socket, id)
|
||||
this.clients[id] = client
|
||||
|
||||
this.emit('connection', client)
|
||||
|
||||
client.on('close', ()=>{
|
||||
delete this.clients[id]
|
||||
})
|
||||
|
||||
} else {
|
||||
|
||||
this.clients[id].open(socket)
|
||||
this.clients[id].flush()
|
||||
|
||||
}
|
||||
|
||||
})
|
||||
|
||||
}
|
||||
|
||||
send(event, data, id, except) {
|
||||
|
||||
var clients = id ? [this.clients[id]] : this.clients
|
||||
|
||||
for (var k in clients) {
|
||||
if (!except || this.clients[k] != this.clients[except]) {
|
||||
if (clients[k]) clients[k].send(event, data)
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
module.exports = Ipc
|
||||
|
|
@ -1,17 +0,0 @@
|
|||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<meta name="viewport" content="width=device-width, user-scalable=no"/>
|
||||
<link rel="preload" href="../../browser/fonts/roboto-medium.woff" as="font"/>
|
||||
<link rel="preload" href="../../browser/fonts/fontawesome-webfont.woff" as="font"/>
|
||||
<link rel="stylesheet" href="../../browser/styles.css"/>
|
||||
<link rel="stylesheet" href="../../browser/fonts/font-awesome.min.css"/>
|
||||
<link rel="stylesheet" href="../../browser/fonts/roboto-medium.css"/>
|
||||
<script src="launcher.js"></script>
|
||||
</head>
|
||||
|
||||
<body id="launcher">
|
||||
<div id="loading"><div class="spinner"></div></div>
|
||||
</body>
|
||||
|
||||
</html>
|
||||
|
|
@ -1,236 +0,0 @@
|
|||
var {remote, ipcRenderer, shell} = require('electron'),
|
||||
{dialog, webContents} = remote.require('electron'),
|
||||
settings = remote.require('./main/settings'),
|
||||
packageInfos = remote.require('./package.json')
|
||||
packageVersion = packageInfos.version,
|
||||
packageUrl = packageInfos.repository.url,
|
||||
argv_remote = settings.read('argv'),
|
||||
argv = {},
|
||||
$ = require('jquery/dist/jquery.slim.min.js')
|
||||
|
||||
for (i in argv_remote) {
|
||||
argv[i] = argv_remote[i]
|
||||
}
|
||||
|
||||
$(document).ready(()=>{
|
||||
|
||||
var form = $(`
|
||||
<form class="form" id="form">
|
||||
<div class="btn header"><span id="title">Open Stage Control</span> <span id="version">(v${packageVersion})</span><span id="new-version"</div>
|
||||
</form>
|
||||
`)
|
||||
|
||||
$.each(settings.options, (i, option)=>{
|
||||
|
||||
if (option.launcher === false) return
|
||||
|
||||
var wrapper = $(`<div class="item-wrapper"></div>`),
|
||||
item = $(`
|
||||
<div class="input-wrapper">
|
||||
<label>${option.alias || i}</label>
|
||||
</div>
|
||||
`).appendTo(wrapper),
|
||||
input,
|
||||
cancel,
|
||||
value = argv[i] == undefined ? '' : argv[i]
|
||||
|
||||
|
||||
input = $(`<input class="input" name="${i}" data-type="${option.type}" value="${value}" placeholder="${option.describe}"/>`)
|
||||
|
||||
if (option.type == 'boolean') {
|
||||
|
||||
var toggle = $(`<span class="checkbox ${value?'on':''}"><i class="fa fa-fw fa-check"></i></span>`)
|
||||
toggle.appendTo(item)
|
||||
|
||||
toggle.click(function(e){
|
||||
e.preventDefault()
|
||||
input.val(!eval(input.val())).trigger('change')
|
||||
toggle.toggleClass('on')
|
||||
})
|
||||
|
||||
}
|
||||
|
||||
if (option.file) {
|
||||
|
||||
var browse = $(`<span class="checkbox">...</span>`)
|
||||
browse.appendTo(item)
|
||||
|
||||
browse.click(function(e){
|
||||
e.preventDefault()
|
||||
dialog.showOpenDialog({filters:[{name:option.file.name,extensions:option.file.extensions}]},function(file){
|
||||
input.val(file).change()
|
||||
})
|
||||
})
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
input.appendTo(item)
|
||||
|
||||
input.on('change',function(e,stop){
|
||||
var v = $(this).val()
|
||||
if (option.type == 'boolean') {
|
||||
v = v == 'true' ? true : ''
|
||||
input.val(v)
|
||||
} else if (v && option.type == 'array'){
|
||||
v = v.trim().split(' ')
|
||||
} else if (v && option.type == 'number'){
|
||||
v = parseFloat(v)
|
||||
}
|
||||
|
||||
if (v != '' && option.check && option.check(v, argv) !== true) {
|
||||
wrapper.addClass('error')
|
||||
wrapper.find('.error-msg').remove()
|
||||
wrapper.append(`<div class="error-msg">${option.check(v, argv )}</div>`)
|
||||
} else {
|
||||
wrapper.removeClass('error')
|
||||
wrapper.find('.error-msg').remove()
|
||||
argv[i] = v
|
||||
}
|
||||
|
||||
if (option.restart && v!=value && !wrapper.hasClass('restart')) {
|
||||
wrapper.addClass('restart')
|
||||
wrapper.append(`<div class="restart-msg">The app must be restarted for this change to take effect.</div>`)
|
||||
} else if (option.restart && wrapper.hasClass('restart')) {
|
||||
wrapper.removeClass('restart')
|
||||
wrapper.find('.restart-msg').remove()
|
||||
}
|
||||
|
||||
if (!stop) $('input').not(input).trigger('change',true)
|
||||
})
|
||||
|
||||
cancel = $(`<div class="btn clear"><i class="fa fa-remove fa-fw"></i></div>`)
|
||||
cancel.click((e)=>{
|
||||
e.preventDefault()
|
||||
if (option.type == 'boolean') {
|
||||
input.val('false')
|
||||
} else {
|
||||
input.val('')
|
||||
}
|
||||
input.trigger('change')
|
||||
})
|
||||
cancel.appendTo(item)
|
||||
|
||||
form.append(wrapper)
|
||||
|
||||
})
|
||||
|
||||
|
||||
var save = $(`<div class="btn start save">Save</div>`).appendTo(form),
|
||||
saveWithCallback = function(callback) {
|
||||
$('input').change()
|
||||
if (form.find('.error').length) return
|
||||
|
||||
setTimeout(()=>{
|
||||
|
||||
for (i in argv) {
|
||||
if (argv[i] === '') {
|
||||
argv[i] = undefined
|
||||
}
|
||||
}
|
||||
try {
|
||||
settings.makeDefaultConfig(argv)
|
||||
settings.write('argv',argv)
|
||||
save.addClass('saved')
|
||||
setTimeout(()=>{
|
||||
save.removeClass('saved')
|
||||
}, 250)
|
||||
if (callback) callback()
|
||||
} catch (err) {
|
||||
|
||||
}
|
||||
|
||||
},1)
|
||||
}
|
||||
|
||||
save.click((e)=>{
|
||||
|
||||
e.preventDefault()
|
||||
saveWithCallback()
|
||||
|
||||
})
|
||||
|
||||
// Starter (oneshot)
|
||||
|
||||
var start = $(`<div class="btn start">Start</div>`).appendTo(form)
|
||||
start.click((e)=>{
|
||||
|
||||
e.preventDefault()
|
||||
saveWithCallback(()=>{
|
||||
start.off('click')
|
||||
save.off('click')
|
||||
$('input').attr('disabled','true')
|
||||
$('.clear').addClass('disabled')
|
||||
$('.checkbox').addClass('disabled')
|
||||
ipcRenderer.send('start')
|
||||
})
|
||||
|
||||
})
|
||||
|
||||
form.appendTo('#launcher')
|
||||
|
||||
|
||||
// server started callback
|
||||
ipcRenderer.on('started',function(){
|
||||
start.remove()
|
||||
save.remove()
|
||||
terminal.show()
|
||||
})
|
||||
|
||||
// Fake console
|
||||
var terminal = $(`<div class="terminal"></div>`).appendTo('#launcher').hide()
|
||||
|
||||
ipcRenderer.on('stdout', function(e, msg){
|
||||
terminal.append(`<div class="log">${msg}</div>`)
|
||||
terminal.scrollTop(terminal.prop('scrollHeight'))
|
||||
})
|
||||
|
||||
ipcRenderer.on('stderr', function(e, msg){
|
||||
terminal.append(`<div class="error">${msg}</div>`)
|
||||
terminal.scrollTop(terminal.prop('scrollHeight'))
|
||||
})
|
||||
|
||||
|
||||
// ready
|
||||
|
||||
$('input').trigger('change')
|
||||
|
||||
|
||||
$('#loading').remove()
|
||||
setTimeout(()=>{
|
||||
form.addClass('loaded')
|
||||
},0)
|
||||
|
||||
|
||||
// open links in system's browser
|
||||
$(document).click((e,url)=>{
|
||||
var url = $(e.target).attr('href')
|
||||
if (url) {
|
||||
e.preventDefault()
|
||||
shell.openExternal(url)
|
||||
}
|
||||
})
|
||||
|
||||
// New version info
|
||||
if (navigator.onLine) {
|
||||
|
||||
var request = new XMLHttpRequest();
|
||||
request.open('GET', 'https://api.github.com/repos/jean-emmanuel/open-stage-control/tags', true);
|
||||
|
||||
request.onload = function() {
|
||||
if (request.status >= 200 && request.status < 400) {
|
||||
var data = JSON.parse(request.responseText);
|
||||
|
||||
if (data[0].name != 'v' + packageVersion) {
|
||||
$('#new-version').html(` [<a href="${packageUrl}/releases" target="_blank">${data[0].name} is available</a>]`)
|
||||
}
|
||||
|
||||
}
|
||||
};
|
||||
|
||||
request.send();
|
||||
|
||||
}
|
||||
|
||||
})
|
||||
|
|
@ -1,20 +1,34 @@
|
|||
var settings = require('./settings')
|
||||
var dev = process.argv[1] === '.',
|
||||
settings = require('./settings')
|
||||
|
||||
var serverStarted
|
||||
|
||||
if (process.title === 'node') {
|
||||
process.on('uncaughtException', (err)=>{
|
||||
console.error('A JavaScript error occurred in the main process:')
|
||||
console.trace(err)
|
||||
})
|
||||
} else {
|
||||
require('electron').dialog.showErrorBox = (title, err)=>{
|
||||
console.error(title + ': ' + err)
|
||||
}
|
||||
}
|
||||
|
||||
var start = function(readyApp) {
|
||||
|
||||
if (!settings.read('guiOnly') && !serverStarted) {
|
||||
|
||||
var server = require('./server'),
|
||||
osc = require('./osc'),
|
||||
callbacks = require('./callbacks')
|
||||
callbacks = require('./callbacks'),
|
||||
zeroconf = require('./zeroconf')
|
||||
|
||||
server.bindCallbacks(callbacks)
|
||||
|
||||
serverStarted = true
|
||||
process.on('exit',()=>{
|
||||
if (osc.midi) osc.midi.stop()
|
||||
zeroconf.unpublishAll()
|
||||
})
|
||||
|
||||
}
|
||||
|
|
@ -24,33 +38,20 @@ var start = function(readyApp) {
|
|||
var app = require('./electron-app')
|
||||
var address = typeof settings.read('guiOnly')=='string'? 'http://' + settings.read('guiOnly') : settings.read('appAddresses')[0]
|
||||
address += settings.read('urlOptions')
|
||||
if (app.isReady()) {
|
||||
var win = require('./electron-window')({address:address, shortcuts:true})
|
||||
app.on('before-quit',()=>{
|
||||
process.exit()
|
||||
})
|
||||
|
||||
var launch = ()=>{
|
||||
var win = require('./electron-window')({address:address, shortcuts:true, zoom:false, fullscreen: settings.read('fullScreen')})
|
||||
return win
|
||||
}
|
||||
if (app.isReady()) {
|
||||
return launch()
|
||||
} else {
|
||||
app.on('ready',function(){
|
||||
var win = require('./electron-window')({address:address, shortcuts:true})
|
||||
app.on('before-quit',()=>{
|
||||
process.exit()
|
||||
})
|
||||
launch()
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
try {
|
||||
require('electron').dialog.showErrorBox = (title, err)=>{
|
||||
console.error(title + ': ' + err)
|
||||
}
|
||||
} catch(e){
|
||||
process.on('uncaughtException', (err)=>{
|
||||
console.error('A JavaScript error occurred in the main process:')
|
||||
console.trace(err)
|
||||
})
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
|
@ -63,14 +64,23 @@ if (settings.cli) {
|
|||
|
||||
var app = require('./electron-app'),
|
||||
path = require('path'),
|
||||
address = 'file://' + path.resolve(__dirname + '/launcher/' + 'index.html'),
|
||||
address = 'file://' + path.resolve(__dirname + '/../launcher/' + 'index.html'),
|
||||
{ipcMain} = require('electron'),
|
||||
launcher
|
||||
|
||||
app.on('ready',function(){
|
||||
launcher = require('./electron-window')({address:address, shortcuts:false, width:680, height:568, color:'#283143'})
|
||||
launcher = require('./electron-window')({address:address, shortcuts:dev, width:680, height:(100 + 8*3 + 29 * Object.keys(settings.options).filter(x=>settings.options[x].launcher !== false).length), node:true, color:'#253040'})
|
||||
})
|
||||
|
||||
if (process.log) {
|
||||
process.log = (function(write) {
|
||||
return function(string, encoding, fd) {
|
||||
write.apply(process, arguments)
|
||||
launcher.webContents.send('stdout', string)
|
||||
}
|
||||
})(process.log)
|
||||
}
|
||||
|
||||
process.stdout.write = (function(write) {
|
||||
return function(string, encoding, fd) {
|
||||
write.apply(process.stdout, arguments)
|
||||
|
|
|
|||
|
|
@ -1,51 +1,64 @@
|
|||
var PythonShell = require('python-shell'),
|
||||
path = require('path'),
|
||||
settings = require('./settings')
|
||||
|
||||
var py = new PythonShell('midi.py', {scriptPath:__dirname, mode:'text', args: [
|
||||
settings.read('debug') ? 'debug' : '',
|
||||
...settings.read('midi')
|
||||
]
|
||||
})
|
||||
class Midi {
|
||||
|
||||
constructor() {
|
||||
|
||||
this.py = new PythonShell('midi.py', {
|
||||
scriptPath:__dirname,
|
||||
mode:'text',
|
||||
args: [
|
||||
settings.read('debug') ? 'debug' : '',
|
||||
...settings.read('midi')
|
||||
]
|
||||
})
|
||||
|
||||
oscToMidi = (data)=>{
|
||||
var args = []
|
||||
for (i in data.args) {
|
||||
args.push(data.args[i].value)
|
||||
}
|
||||
py.send(JSON.stringify([data.port, data.address, ...args]))
|
||||
}
|
||||
|
||||
stop = ()=>{
|
||||
py.childProcess.kill()
|
||||
}
|
||||
send(data) {
|
||||
|
||||
init = (receiveOsc)=>{
|
||||
py.on('message', function (message) {
|
||||
// console.log(message)
|
||||
var name, data
|
||||
try {
|
||||
[name, data] = JSON.parse(message)
|
||||
} catch (err) {
|
||||
// console.log(err)
|
||||
var args = []
|
||||
for (i in data.args) {
|
||||
args.push(data.args[i].value)
|
||||
}
|
||||
if (name == 'log') {
|
||||
console.log(data)
|
||||
} else if (name == 'osc') {
|
||||
receiveOsc(data)
|
||||
} else if (name == 'error') {
|
||||
console.log('ERROR: Midi: ' + data)
|
||||
stop()
|
||||
process.exit()
|
||||
}
|
||||
})
|
||||
|
||||
this.py.send(JSON.stringify([data.port, data.address, ...args]))
|
||||
|
||||
}
|
||||
|
||||
stop() {
|
||||
|
||||
this.py.childProcess.kill()
|
||||
|
||||
}
|
||||
|
||||
init(receiveOsc) {
|
||||
this.py.on('message', function(message) {
|
||||
// console.log(message)
|
||||
var name, data
|
||||
try {
|
||||
[name, data] = JSON.parse(message)
|
||||
} catch (err) {
|
||||
// console.log(err)
|
||||
}
|
||||
if (name == 'log') {
|
||||
if (data.indexOf('ERROR') === 0) {
|
||||
console.error(data)
|
||||
} else {
|
||||
console.log(data)
|
||||
}
|
||||
} else if (name == 'osc') {
|
||||
receiveOsc(data)
|
||||
} else if (name == 'error') {
|
||||
console.error('ERROR: MIDI: ' + data)
|
||||
this.stop()
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
var midi = new Midi()
|
||||
|
||||
|
||||
module.exports = {
|
||||
send: oscToMidi,
|
||||
init: init,
|
||||
stop: stop
|
||||
}
|
||||
module.exports = midi
|
||||
|
|
|
|||
|
|
@ -4,13 +4,16 @@ import traceback
|
|||
import json as JSON
|
||||
import re
|
||||
|
||||
def ipcSend(name, data):
|
||||
print(JSON.dumps([name, data]))
|
||||
stdout.flush()
|
||||
|
||||
try:
|
||||
import rtmidi
|
||||
API = rtmidi.RtMidiIn.UNIX_JACK if 'jack' in argv else rtmidi.RtMidiIn.UNSPECIFIED
|
||||
JACK = API == rtmidi.RtMidiIn.UNIX_JACK
|
||||
in_dev = rtmidi.RtMidiIn(API, 'Midi->OSC probe')
|
||||
out_dev = rtmidi.RtMidiOut(API, 'OSC->Midi probe')
|
||||
in_dev = rtmidi.RtMidiIn(API, 'MIDI->OSC probe')
|
||||
out_dev = rtmidi.RtMidiOut(API, 'OSC->MIDI probe')
|
||||
except:
|
||||
ipcSend('error', 'pyrtmidi not found (or wrong version)')
|
||||
|
||||
|
|
@ -18,10 +21,6 @@ except:
|
|||
if version_info.major == 3:
|
||||
raw_input = input
|
||||
|
||||
def ipcSend(name, data):
|
||||
print(JSON.dumps([name, data]))
|
||||
stdout.flush()
|
||||
|
||||
debug = False
|
||||
if 'debug' in argv:
|
||||
debug = True
|
||||
|
|
|
|||
199
app/main/osc.js
|
|
@ -1,199 +0,0 @@
|
|||
// destroy serialport module
|
||||
// (electron-rebuild breaks it for node-only mode)
|
||||
require('vmodule')('serialport', {}, {global: true})
|
||||
|
||||
var osc = require('osc'),
|
||||
ipc = require('./server').ipc,
|
||||
settings = require('./settings'),
|
||||
oscInPort = settings.read('oscInPort') || settings.read('httpPort'),
|
||||
debug = settings.read('debug'),
|
||||
vm = require('vm'),
|
||||
fs = require('fs'),
|
||||
midi = settings.read('midi') ? require('./midi') : false
|
||||
|
||||
var oscServer = new osc.UDPPort({
|
||||
localAddress: "0.0.0.0",
|
||||
localPort: oscInPort,
|
||||
metadata: true
|
||||
})
|
||||
|
||||
|
||||
var parseType = function(type){
|
||||
var t = type[0].match(/[bhtdscrmifTFNI]/)
|
||||
|
||||
if (t!==null) {
|
||||
return t[0]
|
||||
} else {
|
||||
return 's'
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
var parseArg = function(arg,precision){
|
||||
if (arg==null) return null
|
||||
switch (typeof arg) {
|
||||
case 'number':
|
||||
return {type: precision == 0 ? 'i' : 'f', value: parseFloat(arg.toFixed(precision))}
|
||||
case 'boolean':
|
||||
return {type: arg ? 'T' : 'F', value: arg}
|
||||
case 'object':
|
||||
if (arg.type) {
|
||||
return {type: parseType(arg.type), value: arg.value}
|
||||
} else {
|
||||
return {type: 's', value:JSON.stringify(arg)}
|
||||
}
|
||||
case 'string':
|
||||
return {type: 's', value:arg}
|
||||
default:
|
||||
return {type: 's', value:JSON.stringify(arg)}
|
||||
}
|
||||
}
|
||||
|
||||
var sendOsc = function(data){
|
||||
|
||||
if (!data) return
|
||||
|
||||
if (data.host == 'midi') {
|
||||
|
||||
if (midi) midi.send(data)
|
||||
|
||||
} else {
|
||||
|
||||
oscServer.send({
|
||||
address: data.address,
|
||||
args: data.args
|
||||
}, data.host, data.port)
|
||||
|
||||
if (debug) console.log('OSC sent: ',{address:data.address, args: data.args}, 'To : ' + data.host + ':' + data.port)
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
// var receiveOscQueue = []
|
||||
|
||||
var receiveOsc = function(data, info){
|
||||
|
||||
if (!data) return
|
||||
|
||||
for (i in data.args) {
|
||||
data.args[i] = data.args[i].value
|
||||
}
|
||||
|
||||
if (data.args.length==1) data.args = data.args[0]
|
||||
|
||||
// receiveOscQueue.push(data)
|
||||
|
||||
ipc.send('receiveOsc',data)
|
||||
|
||||
if (debug) console.log('OSC received: ', {address:data.address, args: data.args}, 'From : ' + data.host + ':' + data.port)
|
||||
|
||||
}
|
||||
|
||||
// setInterval(()=>{
|
||||
//
|
||||
// if (receiveOscQueue.length > 0) {
|
||||
// ipc.send('bundle',receiveOscQueue)
|
||||
// receiveOscQueue = []
|
||||
// }
|
||||
//
|
||||
// }, 5)
|
||||
|
||||
|
||||
var customModule = (function(){
|
||||
|
||||
if (!settings.read('customModule')) return false
|
||||
|
||||
var file = (function(){
|
||||
try {
|
||||
return fs.readFileSync(settings.read('customModule'),'utf8')
|
||||
} catch(err) {
|
||||
console.log('CustomModule Error: File not found: ' + settings.read('customModule'))
|
||||
return false
|
||||
}
|
||||
})(),
|
||||
mod,
|
||||
context = {
|
||||
console: console,
|
||||
sendOsc: sendOsc,
|
||||
receiveOsc: receiveOsc,
|
||||
setTimeout: setTimeout,
|
||||
settings: settings
|
||||
}
|
||||
|
||||
try {
|
||||
mod = vm.runInContext(file, vm.createContext(context))
|
||||
} catch(err) {
|
||||
console.log(err)
|
||||
}
|
||||
|
||||
return mod
|
||||
|
||||
})()
|
||||
|
||||
|
||||
var oscInFilter = function(data){
|
||||
if (customModule.oscInFilter) {
|
||||
return customModule.oscInFilter(data)
|
||||
} else {
|
||||
return data
|
||||
}
|
||||
}
|
||||
var oscOutFilter = function(data){
|
||||
if (customModule.oscOutFilter) {
|
||||
return customModule.oscOutFilter(data)
|
||||
} else {
|
||||
return data
|
||||
}
|
||||
}
|
||||
|
||||
var oscInHandler = function(msg, timetag, info){
|
||||
var data = oscInFilter({address: msg.address, args: msg.args, host: info.address, port: info.port})
|
||||
if (!data) return
|
||||
receiveOsc(data)
|
||||
}
|
||||
|
||||
oscServer.on('message', function (msg, timetag, info) {
|
||||
var delay = timetag? Math.max(0,timetag.native - Date.now()) : 0
|
||||
if (delay) {
|
||||
setTimeout(()=>{
|
||||
oscInHandler(msg, timetag, info)
|
||||
}, delay)
|
||||
} else {
|
||||
oscInHandler(msg, timetag, info)
|
||||
}
|
||||
})
|
||||
|
||||
oscServer.on('error', function (error) {
|
||||
console.log(error)
|
||||
})
|
||||
|
||||
oscServer.open()
|
||||
|
||||
if (customModule.init) {
|
||||
customModule.init()
|
||||
}
|
||||
|
||||
if (midi) midi.init(receiveOsc)
|
||||
|
||||
module.exports = {
|
||||
|
||||
send: function(host,port,address,args,precision) {
|
||||
|
||||
var message = []
|
||||
|
||||
if (!Array.isArray(args)) args = [args]
|
||||
if (typeof args=='object' && args!==null) {
|
||||
for (var i in args) {
|
||||
var arg = parseArg(args[i],precision)
|
||||
if (arg!=null) message.push(arg)
|
||||
}
|
||||
}
|
||||
|
||||
var data = oscOutFilter({address:address, args: message, host: host, port: port})
|
||||
|
||||
sendOsc(data)
|
||||
|
||||
},
|
||||
midi:midi
|
||||
}
|
||||
234
app/main/osc/index.js
Normal file
|
|
@ -0,0 +1,234 @@
|
|||
// destroy serialport module
|
||||
// (electron-rebuild breaks it for node-only mode)
|
||||
require('vmodule')('serialport', {}, {global: true})
|
||||
|
||||
var ipc = require('../server').ipc,
|
||||
settings = require('../settings'),
|
||||
tcpInPort = settings.read('tcpInPort'),
|
||||
debug = settings.read('debug'),
|
||||
vm = require('vm'),
|
||||
fs = require('fs'),
|
||||
midi = settings.read('midi') ? require('../midi') : false,
|
||||
oscUDPServer = require('./udp'),
|
||||
oscTCPServer = require('./tcp'),
|
||||
EventEmitter = require('events').EventEmitter
|
||||
|
||||
|
||||
class OscServer {
|
||||
|
||||
constructor(){
|
||||
|
||||
this.customModuleEventEmitter = new EventEmitter()
|
||||
this.customModule = (()=>{
|
||||
|
||||
if (!settings.read('customModule')) return false
|
||||
|
||||
var file = (()=>{
|
||||
try {
|
||||
return fs.readFileSync(settings.read('customModule'),'utf8')
|
||||
} catch(err) {
|
||||
console.log('CustomModule Error: File not found: ' + settings.read('customModule'))
|
||||
return false
|
||||
}
|
||||
})(),
|
||||
mod,
|
||||
context = {
|
||||
console,
|
||||
sendOsc: this.sendOsc.bind(this),
|
||||
receiveOsc: this.receiveOsc.bind(this),
|
||||
app: this.customModuleEventEmitter,
|
||||
setTimeout,
|
||||
clearTimeout,
|
||||
setInterval,
|
||||
clearInterval,
|
||||
settings
|
||||
}
|
||||
|
||||
try {
|
||||
mod = vm.runInContext(file, vm.createContext(context))
|
||||
} catch(err) {
|
||||
console.error(err)
|
||||
return false
|
||||
}
|
||||
|
||||
return mod
|
||||
|
||||
})()
|
||||
|
||||
|
||||
}
|
||||
|
||||
parseType(type){
|
||||
var t = type[0].match(/[bhtdscrmifTFNI]/)
|
||||
|
||||
if (t!==null) {
|
||||
return t[0]
|
||||
} else {
|
||||
return 's'
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
parseArg(arg, precision){
|
||||
if (arg==null) return null
|
||||
switch (typeof arg) {
|
||||
case 'number':
|
||||
var typeTagMatch = typeof precision == 'string' ? precision.match(/[0-9]+([a-zA-Z]{1})/) : null,
|
||||
typeTag = typeTagMatch === null ? precision == 0 ? 'i' : 'f' : typeTagMatch[1],
|
||||
precisionValue = parseFloat(precision) || 0
|
||||
|
||||
return {type: typeTag, value: parseFloat(arg.toFixed(precisionValue))}
|
||||
case 'boolean':
|
||||
return {type: arg ? 'T' : 'F', value: arg}
|
||||
case 'object':
|
||||
if (arg.type) {
|
||||
return {type: this.parseType(arg.type), value: arg.value}
|
||||
} else {
|
||||
return {type: 's', value:JSON.stringify(arg)}
|
||||
}
|
||||
case 'string':
|
||||
return {type: 's', value:arg}
|
||||
default:
|
||||
return {type: 's', value:JSON.stringify(arg)}
|
||||
}
|
||||
}
|
||||
|
||||
sendOsc(data){
|
||||
|
||||
if (!data) return
|
||||
|
||||
if (data.host == 'midi') {
|
||||
|
||||
if (midi) midi.send(data)
|
||||
|
||||
} else {
|
||||
|
||||
if (typeof data.address !== 'string' || data.address[0] !== '/') {
|
||||
console.error('OSC error: malformed address: "' + data.address + '')
|
||||
return
|
||||
}
|
||||
|
||||
oscUDPServer.send({
|
||||
address: data.address,
|
||||
args: data.args
|
||||
}, data.host, data.port)
|
||||
|
||||
if (tcpInPort && oscTCPServer.clients[data.host] && oscTCPServer.clients[data.host][data.port]) {
|
||||
oscTCPServer.clients[data.host][data.port].send({
|
||||
address: data.address,
|
||||
args: data.args
|
||||
})
|
||||
}
|
||||
|
||||
if (debug) console.log('OSC sent: ',{address:data.address, args: data.args}, 'To : ' + data.host + ':' + data.port)
|
||||
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
receiveOsc(data, info){
|
||||
|
||||
if (!data) return
|
||||
|
||||
for (i in data.args) {
|
||||
data.args[i] = data.args[i].value
|
||||
}
|
||||
|
||||
if (data.args.length==1) data.args = data.args[0]
|
||||
|
||||
ipc.send('receiveOsc',data)
|
||||
|
||||
if (debug) console.log('OSC received: ', {address:data.address, args: data.args}, 'From : ' + data.host + ':' + data.port)
|
||||
|
||||
}
|
||||
|
||||
|
||||
oscInFilter(data){
|
||||
if (this.customModule.oscInFilter) {
|
||||
return this.customModule.oscInFilter(data)
|
||||
} else {
|
||||
return data
|
||||
}
|
||||
}
|
||||
oscOutFilter(data){
|
||||
if (this.customModule.oscOutFilter) {
|
||||
return this.customModule.oscOutFilter(data)
|
||||
} else {
|
||||
return data
|
||||
}
|
||||
}
|
||||
|
||||
oscInHandler(msg, timetag, info){
|
||||
var data = this.oscInFilter({address: msg.address, args: msg.args, host: info.address, port: info.port})
|
||||
if (!data) return
|
||||
this.receiveOsc(data)
|
||||
}
|
||||
|
||||
oscInHandlerWrapper(msg, timetag, info) {
|
||||
var delay = timetag? Math.max(0,timetag.native - Date.now()) : 0
|
||||
if (delay) {
|
||||
setTimeout(()=>{
|
||||
this.oscInHandler(msg, timetag, info)
|
||||
}, delay)
|
||||
} else {
|
||||
this.oscInHandler(msg, timetag, info)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
init(){
|
||||
|
||||
if (midi) midi.init((data)=>{
|
||||
|
||||
data = this.oscInFilter({address: data.address, args: data.args, host: data.host, port: data.port})
|
||||
|
||||
if (!data) return
|
||||
|
||||
this.receiveOsc(data)
|
||||
|
||||
})
|
||||
|
||||
oscUDPServer.on('message', this.oscInHandlerWrapper.bind(this))
|
||||
oscUDPServer.open()
|
||||
|
||||
if (settings.read('tcpInPort')) {
|
||||
oscTCPServer.on('message', this.oscInHandlerWrapper.bind(this))
|
||||
oscTCPServer.open()
|
||||
}
|
||||
|
||||
if (this.customModule.init) {
|
||||
this.customModule.init()
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
var oscServer = new OscServer()
|
||||
oscServer.init()
|
||||
|
||||
module.exports = {
|
||||
server: oscServer,
|
||||
send: function(host,port,address,args,precision) {
|
||||
|
||||
var message = []
|
||||
|
||||
if (!Array.isArray(args)) args = [args]
|
||||
if (typeof args=='object' && args!==null) {
|
||||
for (var i in args) {
|
||||
var arg = oscServer.parseArg(args[i],precision)
|
||||
if (arg!=null) message.push(arg)
|
||||
}
|
||||
}
|
||||
|
||||
var data = oscServer.oscOutFilter({address:address, args: message, host: host, port: port})
|
||||
|
||||
oscServer.sendOsc(data)
|
||||
|
||||
},
|
||||
midi:midi
|
||||
}
|
||||
146
app/main/osc/tcp.js
Normal file
|
|
@ -0,0 +1,146 @@
|
|||
var osc = require('osc'),
|
||||
EventEmitter = require('events').EventEmitter,
|
||||
settings = require('../settings'),
|
||||
zeroconf = require('../zeroconf'),
|
||||
tcpInPort = settings.read('tcpInPort'),
|
||||
tcpTargets = settings.read('tcpTargets'),
|
||||
net = require('net')
|
||||
|
||||
class OscTCPClient extends EventEmitter {
|
||||
|
||||
constructor(options) {
|
||||
|
||||
super()
|
||||
|
||||
this.options = options
|
||||
this.remoteAddress = options.address
|
||||
this.remotePort = options.port
|
||||
|
||||
this.open()
|
||||
|
||||
}
|
||||
|
||||
open() {
|
||||
|
||||
this.port = new osc.TCPSocketPort(this.options)
|
||||
|
||||
this.port.on('error', (err)=>{
|
||||
console.error(`TCP: Error: ${err.message}`)
|
||||
})
|
||||
|
||||
this.port.on('close', (hadErr)=>{
|
||||
console.log(`TCP: connection closed (${this.remoteAddress}:${this.remotePort})`)
|
||||
if (!this.options.socket) {
|
||||
console.log(`TCP: attempting reconnection in 5s (${this.remoteAddress}:${this.remotePort})`)
|
||||
this.reconnect()
|
||||
} else {
|
||||
this.emit('die')
|
||||
}
|
||||
})
|
||||
|
||||
this.port.on('message', (msg, timetag)=>{
|
||||
this.emit('message', msg, timetag, {address: this.remoteAddress, port: this.remotePort})
|
||||
})
|
||||
|
||||
this.port.on('ready', ()=>{
|
||||
console.log(`TCP: connection established (${this.remoteAddress}:${this.remotePort})`)
|
||||
})
|
||||
|
||||
if (!this.options.socket) {
|
||||
|
||||
this.port.open()
|
||||
|
||||
} else {
|
||||
|
||||
this.port.emit('ready')
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
reconnect() {
|
||||
|
||||
setTimeout(()=>{
|
||||
this.open()
|
||||
}, 5000)
|
||||
|
||||
}
|
||||
|
||||
send(msg) {
|
||||
|
||||
this.port.send(msg)
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
class OscTCPServer extends EventEmitter {
|
||||
|
||||
constructor() {
|
||||
|
||||
super()
|
||||
|
||||
this.clients = {}
|
||||
|
||||
}
|
||||
|
||||
bindSocket(socket) {
|
||||
|
||||
this.addClient(new OscTCPClient({
|
||||
metadata: true,
|
||||
socket: socket,
|
||||
address: socket.remoteAddress.indexOf('::ffff:') === 0 ? socket.remoteAddress.replace('::ffff:', '') : socket.remoteAddress,
|
||||
port: socket.remotePort
|
||||
}))
|
||||
|
||||
}
|
||||
|
||||
addClient(client) {
|
||||
|
||||
this.clients[client.remoteAddress] = this.clients[client.remoteAddress] || {}
|
||||
this.clients[client.remoteAddress][client.remotePort] = client
|
||||
|
||||
client.on('message', (msg, timetag, info)=>{
|
||||
this.emit('message', msg, timetag, info)
|
||||
})
|
||||
|
||||
client.on('die', (hadError)=>{
|
||||
if (this.clients[client.remoteAddress]) delete this.clients[client.remoteAddress][client.remotePort]
|
||||
})
|
||||
|
||||
}
|
||||
|
||||
|
||||
open() {
|
||||
|
||||
this.server = net.createServer(this.bindSocket.bind(this))
|
||||
this.server.listen({port: tcpInPort})
|
||||
|
||||
for (var i in tcpTargets) {
|
||||
|
||||
this.addClient(new OscTCPClient({
|
||||
metadata: true,
|
||||
address: tcpTargets[i].split(':')[0],
|
||||
port: tcpTargets[i].split(':')[1]
|
||||
}))
|
||||
|
||||
}
|
||||
|
||||
zeroconf.publish({
|
||||
name: settings.read('appName') + (settings.read('instanceName') ? ' (' + settings.read('instanceName') + ')' : ''),
|
||||
protocol: 'tcp',
|
||||
type: 'osc',
|
||||
port: tcpInPort
|
||||
}).on('error', (e)=>{
|
||||
console.error(`Error: Zeroconf: ${e.message}`)
|
||||
})
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
var oscTCPServer = new OscTCPServer()
|
||||
|
||||
module.exports = oscTCPServer
|
||||
26
app/main/osc/udp.js
Normal file
|
|
@ -0,0 +1,26 @@
|
|||
var osc = require('osc'),
|
||||
settings = require('../settings'),
|
||||
zeroconf = require('../zeroconf'),
|
||||
oscInPort = settings.read('oscInPort') || settings.read('httpPort')
|
||||
|
||||
var oscUDPServer = new osc.UDPPort({
|
||||
localAddress: '0.0.0.0',
|
||||
localPort: oscInPort,
|
||||
metadata: true,
|
||||
broadcast: true
|
||||
})
|
||||
|
||||
oscUDPServer.on('error', function(error) {
|
||||
console.error(error)
|
||||
})
|
||||
|
||||
zeroconf.publish({
|
||||
name: settings.read('appName') + (settings.read('instanceName') ? ' (' + settings.read('instanceName') + ')' : ''),
|
||||
protocol: 'udp',
|
||||
type: 'osc',
|
||||
port: oscInPort
|
||||
}).on('error', (e)=>{
|
||||
console.error(`Error: Zeroconf: ${e.message}`)
|
||||
})
|
||||
|
||||
module.exports = oscUDPServer
|
||||
|
|
@ -1,66 +1,76 @@
|
|||
|
||||
var express = require('express')(),
|
||||
path = require('path'),
|
||||
http = require('http'),
|
||||
server = http.createServer(express),
|
||||
io = require('socket.io')(server),
|
||||
ipc = {},
|
||||
settings = require('./settings'),
|
||||
Ipc = require('./ipc/server'),
|
||||
ipc = new Ipc(server),
|
||||
settings = require('./settings'),
|
||||
theme = require('./theme').init(),
|
||||
zeroconf = require('./zeroconf'),
|
||||
appAddresses = settings.read('appAddresses'),
|
||||
osc = {},
|
||||
clients = {}
|
||||
|
||||
express.get('/', function(req, res){
|
||||
res.sendFile(path.resolve(__dirname + '/../browser/index.html'))
|
||||
})
|
||||
|
||||
express.get('*', function(req, res){
|
||||
if (req.path.indexOf('theme.css') != -1) {
|
||||
res.set('Content-Type', 'text/css');
|
||||
if (settings.read('theme')) {
|
||||
res.send(new Buffer(settings.read('theme')))
|
||||
res.set('Content-Type', 'text/css')
|
||||
if (settings.read('theme')) {
|
||||
var str = theme.get(),
|
||||
buf = Buffer.from && Buffer.from !== Uint8Array.from ? Buffer.from(str) : new Buffer(str)
|
||||
res.send(buf)
|
||||
} else {
|
||||
res.send('')
|
||||
}
|
||||
} else if (req.path.indexOf('browser/') != -1){
|
||||
res.sendFile(path.resolve(__dirname + '/..' + req.path))
|
||||
} else {
|
||||
res.sendFile(path.resolve(__dirname + '/../browser' + req.path))
|
||||
res.sendFile(path.resolve(req.path))
|
||||
}
|
||||
})
|
||||
|
||||
server.listen(settings.read('httpPort'))
|
||||
|
||||
ipc.send = function(name,data,clientId) {
|
||||
if (clientId) {
|
||||
io.to(clientId).emit(name,data)
|
||||
} else {
|
||||
io.emit(name,data)
|
||||
}
|
||||
}
|
||||
zeroconf.publish({
|
||||
name: settings.read('appName') + (settings.read('instanceName') ? ' (' + settings.read('instanceName') + ')' : ''),
|
||||
type: 'http',
|
||||
port: settings.read('httpPort')
|
||||
}).on('error', (e)=>{
|
||||
console.error(`Error: Zeroconf: ${e.message}`)
|
||||
})
|
||||
|
||||
var bindCallbacks = function(callbacks) {
|
||||
io.on('connection', function(socket) {
|
||||
|
||||
clients[socket.id] = socket
|
||||
ipc.on('connection', function(client) {
|
||||
|
||||
for (let name in callbacks) {
|
||||
socket.on(name, (data)=>{
|
||||
callbacks[name](data,socket.id)
|
||||
client.on(name, (data)=>{
|
||||
if (osc.customModule) {
|
||||
osc.customModuleEventEmitter.emit(name, data, client.id)
|
||||
}
|
||||
callbacks[name](data, client.id)
|
||||
})
|
||||
}
|
||||
|
||||
socket.on('disconnect', function() {
|
||||
client.on('close', function() {
|
||||
|
||||
callbacks.removeClientWidgets(socket.id)
|
||||
callbacks.removeClientWidgets(client.id)
|
||||
|
||||
})
|
||||
|
||||
})
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
console.log('App available at ' + appAddresses.join(' & '))
|
||||
|
||||
module.exports = {
|
||||
ipc:ipc,
|
||||
bindCallbacks:bindCallbacks,
|
||||
ipc:ipc,
|
||||
bindCallbacks:bindCallbacks,
|
||||
clients:clients
|
||||
}
|
||||
|
||||
osc = require('./osc').server
|
||||
|
|
|
|||
|
|
@ -8,87 +8,106 @@ var baseDir = process.env[(process.platform == 'win32') ? 'USERPROFILE' : 'HOME'
|
|||
|
||||
var options = {
|
||||
's':{alias:'send',type:'array',describe:'default targets for all widgets (ip:port pairs)',
|
||||
check: (s)=>{
|
||||
return (s.join(' ').match('^([^:\s]*:[0-9]{4,5}[\s]*)*$') != null) ?
|
||||
true : 'Targets must be ip:port pairs & port must be >= 1024'
|
||||
}
|
||||
check: (s)=>{
|
||||
return s.some(item=>!item.match('^[^:\s\"\']*:[0-9]{4,5}[\s\"\']*$')) ?
|
||||
'Targets must be ip:port pairs & port must be >= 1024' : true
|
||||
}
|
||||
},
|
||||
'sync':{type:'array',describe:false,launcher:false,
|
||||
check: (s)=>{
|
||||
if (s) console.error('Warning: --sync is deprecated, use --send instead.')
|
||||
return (s.join(' ').match('^([^:\s]*:[0-9]{4,5}[\s]*)*$') != null) ?
|
||||
true : 'Targets must be ip:port pairs & port must be >= 1024'
|
||||
}
|
||||
'sync':{type:'array',describe:false,launcher:false,hidden:true,
|
||||
check: (s)=>{
|
||||
if (s) console.error('Warning: --sync is deprecated, use --send instead.')
|
||||
return s.some(item=>!item.match('^[^:\s\"\']*:[0-9]{4,5}[\s\"\']*$')) ?
|
||||
'Targets must be ip:port pairs & port must be >= 1024' : true
|
||||
}
|
||||
},
|
||||
'l':{alias:'load',type:'string',file:{name:'OSC Session (.json)', extensions: ['json', 'js']},describe:'session file to load'},
|
||||
'state':{type:'string',file:{name:'OSC State (.state)', extensions: ['state']},describe:'state file to load'},
|
||||
'b':{alias:'blank',type:'boolean',describe:'load a blank session and start the editor'},
|
||||
'c':{alias:'custom-module',type:'string',file:{name:'OSC Custom module (.js)', extensions: ['js']},describe:'custom module file to load'},
|
||||
'p':{alias:'port',type:'number',describe:'http port of the server (default to 8080)',
|
||||
check: (p)=>{
|
||||
return (!isNaN(p) && p > 1023 && parseInt(p)===p) ?
|
||||
check: (p)=>{
|
||||
return (!isNaN(p) && p > 1023 && parseInt(p)===p) ?
|
||||
true : 'Port must be an integer >= 1024'
|
||||
}
|
||||
},
|
||||
'o':{alias:'osc-port',type:'number',describe:'osc input port (default to --port)',
|
||||
check: (o)=>{
|
||||
return (!isNaN(o) && o > 1023 && parseInt(o)===o) ?
|
||||
true : 'Port must be an integer >= 1024'
|
||||
}
|
||||
},
|
||||
'm':{alias:'midi',type:'array',describe:'midi router settings (requires python-pyo)'},
|
||||
}
|
||||
},
|
||||
'o':{alias:'osc-port',type:'number',describe:'osc input port (default to --port)',
|
||||
check: (o)=>{
|
||||
return (!isNaN(o) && o > 1023 && parseInt(o)===o) ?
|
||||
true : 'Port must be an integer >= 1024'
|
||||
}
|
||||
},
|
||||
'tcp-port':{type:'number', describe:'TCP server input port',
|
||||
check: (t, argv)=>{
|
||||
var h = argv['port'] || 8080
|
||||
if (t===h) return 'TCP input port must different from --port'
|
||||
return (!isNaN(t) && t > 1023 && parseInt(t)===t) ?
|
||||
true : 'Port must be an integer >= 1024'
|
||||
}
|
||||
},
|
||||
'tcp-targets':{type:'array',describe:'TCP servers to connect to (ip:port pairs), does not susbtitute for --send',
|
||||
check: (s, argv)=>{
|
||||
if (!argv['tcp-port']) return '--tcp-port must be set'
|
||||
return s.some(item=>!item.match('^[^:\s\"\']*:[0-9]{4,5}[\s\"\']*$')) ?
|
||||
'Targets must be ip:port pairs & port must be >= 1024' : true
|
||||
}
|
||||
},
|
||||
'm':{alias:'midi',type:'array',describe:'midi router settings'},
|
||||
'd':{alias:'debug',type:'boolean',describe:'log received osc messages in the console'},
|
||||
'n':{alias:'no-gui',type:'boolean',describe:'disable default gui',
|
||||
check: (n,argv)=>{
|
||||
return (!n || !argv.g) ?
|
||||
check: (n,argv)=>{
|
||||
return (!n || !argv.g) ?
|
||||
true : 'no-gui and gui-only can\'s be enabled simultaneously'
|
||||
}
|
||||
},
|
||||
}
|
||||
},
|
||||
'g':{alias:'gui-only',type:'string',describe:'app server\'s url. If true, local port (--port) is used',
|
||||
check: (g,argv)=>{
|
||||
return (!g || !argv.n) ?
|
||||
check: (g,argv)=>{
|
||||
return (!g || !argv.n) ?
|
||||
true : 'no-gui and gui-only can\'s be enabled simultaneously'
|
||||
}
|
||||
}
|
||||
},
|
||||
't':{alias:'theme',type:'array',describe:'theme name or path (mutliple values allowed)'},
|
||||
'e':{alias:'examples',type:'boolean',describe:'list examples instead of recent sessions',
|
||||
check: (e,argv)=>{
|
||||
return (!e || !argv.l) ?
|
||||
check: (e,argv)=>{
|
||||
return (!e || !argv.l) ?
|
||||
true : 'examples can\'t be listed if --load is set'
|
||||
}
|
||||
}
|
||||
},
|
||||
'url-options':{type:'array',describe:'url options (opt=value pairs)',
|
||||
check: (u, argv)=>{
|
||||
return (!u || !argv.n) ?
|
||||
true : 'url options can\'t be passed in no-gui mode'
|
||||
return (!u || !argv.n) ?
|
||||
true : 'url options can\'t be passed in no-gui mode'
|
||||
}
|
||||
},
|
||||
'disable-vsync':{type:'boolean',describe:'disable gui\'s vertical synchronization', restart: true},
|
||||
'disable-gpu':{type:'boolean',describe:'disable hardware acceleration', restart: true},
|
||||
'read-only':{type:'boolean',describe:'disable session editing and session history changes',
|
||||
check: (r, argv)=>{
|
||||
return (!r || !argv.b) ?
|
||||
check: (r, argv)=>{
|
||||
return (!r || !argv.b) ?
|
||||
true : 'blank session can\'t be started in read-only mode'
|
||||
}
|
||||
}
|
||||
},
|
||||
'instance-name':{type:'string',describe:'used to differenciate multiple instances in a zeroconf network'},
|
||||
'fullscreen':{type:'boolean', describe:'launch the default client gui in fullscreen mode (F11 to exit)'}
|
||||
}
|
||||
|
||||
|
||||
var argv = require('yargs')
|
||||
.help('help').usage(`\nUsage:\n $0 [options]`).alias('h', 'help')
|
||||
.options(options)
|
||||
.check((argv)=>{
|
||||
var err = []
|
||||
for (key in options) {
|
||||
if (options[key].check && argv[key] != undefined) {
|
||||
var c = options[key].check(argv[key],argv)
|
||||
if (c!==true) {
|
||||
err.push(`-${key}: ${c}`)
|
||||
}
|
||||
.help('help').usage('\nUsage:\n $0 [options]').alias('h', 'help')
|
||||
.options(options)
|
||||
.check((argv)=>{
|
||||
var err = []
|
||||
for (key in options) {
|
||||
if (options[key].check && argv[key] != undefined) {
|
||||
var c = options[key].check(argv[key],argv)
|
||||
if (c!==true) {
|
||||
err.push(`-${key}: ${c}`)
|
||||
}
|
||||
}
|
||||
return err.length ? err.join('\n') : true
|
||||
})
|
||||
.strict()
|
||||
.version().alias('v','version')
|
||||
}
|
||||
return err.length ? err.join('\n') : true
|
||||
})
|
||||
.strict()
|
||||
.version().alias('v','version')
|
||||
|
||||
argv = argv.argv
|
||||
|
||||
|
|
@ -101,20 +120,6 @@ var configFile = function(){try {return JSON.parse(fs.readFileSync(configPath,'u
|
|||
config = JSON.parse(JSON.stringify(configFile)),
|
||||
defaultConfig
|
||||
|
||||
var loadTheme = function(t){
|
||||
if (!t) return
|
||||
var style = []
|
||||
for (i in t) {
|
||||
try {style.push(fs.readFileSync(__dirname + '/themes/' + t[i] + '.css','utf-8'))}
|
||||
catch(err) {
|
||||
try {style.push(fs.readFileSync(t[i],'utf-8'))}
|
||||
catch(err) {
|
||||
console.log('Theme "' + t[i] + '" not found.')
|
||||
}
|
||||
}
|
||||
}
|
||||
return style.join('\n')
|
||||
}
|
||||
|
||||
var makeDefaultConfig = function(argv){
|
||||
defaultConfig = {
|
||||
|
|
@ -122,36 +127,49 @@ var makeDefaultConfig = function(argv){
|
|||
presetPath : process.cwd(),
|
||||
sessionPath: process.cwd(),
|
||||
recentSessions: [],
|
||||
|
||||
appName: 'Open Stage Control',
|
||||
syncTargets: argv.s || argv.sync || false,
|
||||
oscInPort: argv.o || 0,
|
||||
httpPort: argv.p || 8080,
|
||||
debug: argv.d || false,
|
||||
sessionFile: argv.l || false,
|
||||
newSession: argv.b || false,
|
||||
customModule: argv.c || false,
|
||||
noGui: argv.n || false,
|
||||
guiOnly: typeof argv.g == 'string' ? argv.g.length ? argv.g : true : false,
|
||||
instanceName: argv['instance-name'] || false,
|
||||
targets: argv['send'] || argv.sync || false,
|
||||
oscInPort: argv['osc-port'] || 0,
|
||||
httpPort: argv['port'] || 8080,
|
||||
tcpInPort: argv['tcp-port'] || false,
|
||||
tcpTargets: argv['tcp-targets'] || [],
|
||||
debug: argv['debug'] || false,
|
||||
sessionFile: argv['load'] || false,
|
||||
newSession: argv['blank'] || false,
|
||||
customModule: argv['custom-module'] || false,
|
||||
fullScreen: argv['fullscreen'] || false,
|
||||
noGui: argv['no-gui'] || false,
|
||||
guiOnly: typeof argv['gui-only'] == 'string' ? argv['gui-only'].length ? argv['gui-only'] : true : false,
|
||||
urlOptions: argv['url-options'] ? '?' + argv['url-options'].join('&') : '',
|
||||
noVsync: argv['disable-vsync'] || false,
|
||||
readOnly: argv['read-only'] || false,
|
||||
midi: argv.m,
|
||||
noVsync: argv['disable-vsync'] || false,
|
||||
noGpu: argv['disable-gpu'] || false,
|
||||
readOnly: argv['read-only'] || false,
|
||||
midi: argv['midi'],
|
||||
stateFile: (function(){
|
||||
if (!argv['state']) return false
|
||||
try {
|
||||
return JSON.parse(fs.readFileSync(argv['state'], 'utf8'))
|
||||
} catch(err) {
|
||||
console.error(err)
|
||||
return false
|
||||
}
|
||||
})(),
|
||||
appAddresses:function(){
|
||||
var appAddresses = []
|
||||
|
||||
Object.keys(ifaces).forEach(function (ifname) {
|
||||
Object.keys(ifaces).forEach(function(ifname) {
|
||||
for (i=0;i<ifaces[ifname].length;i++) {
|
||||
if (ifaces[ifname][i].family == 'IPv4') {
|
||||
appAddresses.push('http://' + ifaces[ifname][i].address + ':' + (argv.p || 8080))
|
||||
appAddresses.push('http://' + ifaces[ifname][i].address + ':' + (argv['port'] || 8080))
|
||||
}
|
||||
}
|
||||
})
|
||||
|
||||
return appAddresses
|
||||
}(),
|
||||
examples: argv.e,
|
||||
theme: loadTheme(argv.t)
|
||||
examples: argv['examples'],
|
||||
theme: argv['theme'] || []
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -169,12 +187,9 @@ module.exports = {
|
|||
config[key] = value
|
||||
if (tmp) return
|
||||
configFile[key] = value
|
||||
fs.writeFile(configPath,JSON.stringify(configFile,null,4), function (err, data) {
|
||||
fs.writeFile(configPath,JSON.stringify(configFile,null,4), function(err, data) {
|
||||
if (err) throw err
|
||||
})
|
||||
},
|
||||
reloadTheme:function(){
|
||||
module.exports.write('theme',loadTheme(argv.t),true)
|
||||
},
|
||||
cli: cli
|
||||
}
|
||||
|
|
|
|||
76
app/main/theme.js
Normal file
|
|
@ -0,0 +1,76 @@
|
|||
var fs = require('fs'),
|
||||
path = require('path'),
|
||||
settings = require('./settings')
|
||||
|
||||
class Theme {
|
||||
|
||||
constructor() {
|
||||
|
||||
this.themes = []
|
||||
this.files = []
|
||||
this.css = []
|
||||
|
||||
this.defaultColor = '#191f2a'
|
||||
this.backgroundColor = this.defaultColor
|
||||
|
||||
}
|
||||
|
||||
init() {
|
||||
|
||||
this.themes = settings.read('theme')
|
||||
this.files = []
|
||||
|
||||
for (let theme of this.themes) {
|
||||
|
||||
if (theme.includes('.css') && fs.existsSync(theme)) {
|
||||
this.files.push(theme)
|
||||
} else if (!theme.includes('.css') && fs.existsSync(path.resolve(__dirname + '/../browser/themes/' + theme + '.css'))) {
|
||||
this.files.push(path.resolve(__dirname + '/../browser/themes/' + theme + '.css'))
|
||||
} else {
|
||||
console.error('Theme error: "' + theme + '" not found.')
|
||||
}
|
||||
}
|
||||
|
||||
this.load()
|
||||
|
||||
return this
|
||||
|
||||
}
|
||||
|
||||
load() {
|
||||
|
||||
this.css = []
|
||||
|
||||
for (let i in this.files) {
|
||||
|
||||
try {
|
||||
this.css.push(fs.readFileSync(this.files[i],'utf-8'))
|
||||
} catch(err) {
|
||||
console.error('Theme error: could not load "' + this.files[i] + '".')
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
var css = this.get()
|
||||
|
||||
if (css.includes('--color-bg:')) {
|
||||
this.backgroundColor = css.match(/--color-bg:([^;]*);/)[1].trim()
|
||||
} else {
|
||||
this.backgroundColor = this.defaultColor
|
||||
}
|
||||
|
||||
return this
|
||||
|
||||
}
|
||||
|
||||
get() {
|
||||
|
||||
return this.css.join('\n')
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
var theme = new Theme()
|
||||
|
||||
module.exports = theme
|
||||
|
|
@ -1,16 +0,0 @@
|
|||
:root {
|
||||
--color-text: rgba(255,255,255,0.7);
|
||||
--color-text-fade: rgba(255,255,255,0.5);
|
||||
|
||||
/*--color-accent:#f58506;*/
|
||||
--color-bg: #000;
|
||||
--color-fg: #111;
|
||||
--color-raised: #1C1C1C;
|
||||
--color-track: #111;
|
||||
--color-light: rgba(255,255,255,0.03);
|
||||
|
||||
}
|
||||
|
||||
.keyboard-container {
|
||||
--color-black: #555;
|
||||
}
|
||||
|
|
@ -1,21 +0,0 @@
|
|||
:root {
|
||||
--color-text: rgba(0,0,0,0.7);
|
||||
--color-text-fade: rgba(0,0,0,0.5);
|
||||
|
||||
--color-accent:rgba(28, 133, 239, 1);
|
||||
--color-grid: rgba(28, 133, 239, .1);
|
||||
|
||||
--color-bg: #bbb;
|
||||
--color-fg: #ddd;
|
||||
--color-raised: #efefef;
|
||||
--color-track: #dadada;
|
||||
--color-light: rgba(255,255,255,0.5);
|
||||
|
||||
--color-white: black;
|
||||
}
|
||||
|
||||
.keyboard-container {
|
||||
--color-black-key: #ccc;
|
||||
--color-white-key: #eee;
|
||||
|
||||
}
|
||||
|
|
@ -1,3 +0,0 @@
|
|||
.widget .input {
|
||||
display: none;
|
||||
}
|
||||
3
app/main/zeroconf.js
Normal file
|
|
@ -0,0 +1,3 @@
|
|||
var zeroconf = require('bonjour')()
|
||||
|
||||
module.exports = zeroconf
|
||||
|
|
@ -1,11 +1,11 @@
|
|||
{
|
||||
"name": "open-stage-control",
|
||||
"productName": "Open Stage Control",
|
||||
"description": "A libre desktop OSC bi-directionnal control surface application.",
|
||||
"version": "0.21.1",
|
||||
"description": "Libre and modular OSC / MIDI controller",
|
||||
"version": "0.36.0",
|
||||
"author": {
|
||||
"name": "Jean-Emmanuel Doucet / AMMD",
|
||||
"email": "jeannot@ammd.net"
|
||||
"name": "Jean-Emmanuel Doucet",
|
||||
"email": "jean-emmanuel@ammd.net"
|
||||
},
|
||||
"keywords": [
|
||||
"osc",
|
||||
|
|
@ -21,15 +21,15 @@
|
|||
"license": "GPL-3.0",
|
||||
"main": "index.js",
|
||||
"dependencies": {
|
||||
"vmodule":"1.0.1",
|
||||
"electron-localshortcut": "2.0.2",
|
||||
"osc": "2.2.0",
|
||||
"yargs": "9.0.1",
|
||||
"socket.io": "2.0.3",
|
||||
"express": "4.16.1",
|
||||
"jquery": "3.2.1",
|
||||
"chokidar": "1.7.0",
|
||||
"python-shell":"0.4.0"
|
||||
"bonjour": "^3.5.0",
|
||||
"chokidar": "2.0.4",
|
||||
"electron-localshortcut": "3.1.0",
|
||||
"express": "4.16.3",
|
||||
"osc": "2.2.3",
|
||||
"python-shell": "0.5.0",
|
||||
"vmodule": "1.0.1",
|
||||
"ws": "^6.0.0",
|
||||
"yargs": "12.0.1"
|
||||
},
|
||||
"scripts": {
|
||||
"start": "electron ."
|
||||
|
|
|
|||
74
package.json
|
|
@ -1,10 +1,10 @@
|
|||
{
|
||||
"name": "open-stage-control-builder",
|
||||
"description": "[Builder package] A libre desktop OSC bi-directionnal control surface application",
|
||||
"version": "0.21.1",
|
||||
"description": "[Builder package] Libre and modular OSC / MIDI controller",
|
||||
"version": "0.36.0",
|
||||
"author": {
|
||||
"name": "Jean-Emmanuel Doucet / AMMD",
|
||||
"email": "jeannot@ammd.net"
|
||||
"name": "Jean-Emmanuel Doucet",
|
||||
"email": "jean-emmanuel@ammd.net"
|
||||
},
|
||||
"keywords": [
|
||||
"osc",
|
||||
|
|
@ -20,47 +20,59 @@
|
|||
"license": "GPL-3.0",
|
||||
"dependencies": {
|
||||
"autolayout": "0.7.0",
|
||||
"babel-core": "^6.26.3",
|
||||
"babel-plugin-transform-object-rest-spread": "6.26.0",
|
||||
"babel-preset-env": "*",
|
||||
"babelify": "7.3.0",
|
||||
"browserify": "14.4.0",
|
||||
"cardinal-spline-js": "2.3.6",
|
||||
"electron": "~1.8.1",
|
||||
"electron-packager": "9.1.0",
|
||||
"exorcist": "1.0.0",
|
||||
"file-saver": "1.3.3",
|
||||
"jquery": "3.2.1",
|
||||
"json5": "0.5.1",
|
||||
"kiwi.js": "1.0.1",
|
||||
"babel-preset-env": "^1.7.0",
|
||||
"babelify": "8.0.0",
|
||||
"browserify": "16.2.2",
|
||||
"cardinal-spline-js": "2.3.9",
|
||||
"deep-diff": "^1.0.2",
|
||||
"deep-extend": "^0.6.0",
|
||||
"electron": "~1.8.7",
|
||||
"electron-packager": "12.1.0",
|
||||
"electron-packager-plugin-non-proprietary-codecs-ffmpeg": "^1.0.1",
|
||||
"exorcist": "1.0.1",
|
||||
"file-saver": "1.3.8",
|
||||
"jquery": "3.3.1",
|
||||
"json5": "1.0.1",
|
||||
"keyboardjs": "github:jean-emmanuel/KeyboardJS",
|
||||
"kiwi.js": "1.0.2",
|
||||
"licensify": "3.1.3",
|
||||
"mathjs": "3.16.4",
|
||||
"node-sass": "4.5.3",
|
||||
"nodemon": "1.12.0",
|
||||
"nosleep.js": "0.7.0",
|
||||
"screenfull": "3.3.1",
|
||||
"shortid": "2.2.8",
|
||||
"socket.io-client": "2.0.3",
|
||||
"uglifyify": "4.0.4"
|
||||
"mathjs": "^5.0.1",
|
||||
"minimatch": "^3.0.4",
|
||||
"nanoid": "^1.1.0",
|
||||
"nanomorph": "^5.1.3",
|
||||
"node-sass": "4.9.2",
|
||||
"nodemon": "1.18.3",
|
||||
"scope-css": "^1.1.0",
|
||||
"screenfull": "3.3.2",
|
||||
"stacktrace-js": "^2.0.0",
|
||||
"through": "^2.3.8",
|
||||
"uglifyify": "5.0.1",
|
||||
"wolfy87-eventemitter": "^5.2.4"
|
||||
},
|
||||
"optionalDependencies": {
|
||||
"electron-installer-debian": "0.6.0"
|
||||
"electron-installer-debian": "0.8.1"
|
||||
},
|
||||
"scripts": {
|
||||
"postinstall": "cp resources/images/logo.ico app/browser/favicon.ico && cd app && npm install && cd .. && npm run build-js && npm run build-css",
|
||||
"postinstall": "cp resources/images/logo-nobadge.png app/browser/favicon.png && cp resources/images/logo.png app/browser/logo.png && cd app && npm install",
|
||||
"start": "cd app && npm start --",
|
||||
"build": "npm run build-js -- --prod && npm run build-css && electron-packager ./app open-stage-control --platform=$PLATFORM --arch=$ARCH --out dist/ --icon=resources/images/logo --overwrite --ignore \"(node_modules/serialport)\"",
|
||||
"build": "npm run build-css && npm run build-js && echo 'JS and CSS assets built. To build the binary package, run \"npm run package\".'",
|
||||
"package": "npm run build-css && npm run build-launcher-js && npm run build-browser-js -- --prod && node scripts/package.js",
|
||||
"package-rpi": "npm run build-css && npm run build-launcher-js && npm run build-browser-js -- --prod && node scripts/package.js --rpi",
|
||||
"deb32": "electron-installer-debian --src dist/open-stage-control-linux-ia32/ --arch i386 --dest dist/open-stage-control-linux-ia32/ --icon resources/images/logo.png",
|
||||
"deb64": "electron-installer-debian --src dist/open-stage-control-linux-x64/ --arch amd64 --dest dist/open-stage-control-linux-x64/ --icon resources/images/logo.png",
|
||||
"debarm": "electron-installer-debian --src dist/open-stage-control-linux-armv7l/ --arch armv7l --dest dist/open-stage-control-linux-armv7l/ --icon resources/images/logo.png",
|
||||
"watch-css": "nodemon --watch src/browser/scss -e scss -x \"npm run build-css && node scripts/reload-css.js\"",
|
||||
"watch-js": "nodemon --watch src/browser/js -e js -x \"npm run build-js\"",
|
||||
"watch-themes": "nodemon --watch app/main/themes -e css -x \"node scripts/reload-css.js\"",
|
||||
"build-css": "node-sass --include-path src/browser/scss src/browser/scss/style.scss app/browser/styles.css --output-style compressed",
|
||||
"build-js": "node scripts/build-js.js > app/browser/scripts.js",
|
||||
"build-css": "node scripts/build-css.js",
|
||||
"build-js": "npm run build-launcher-js && npm run build-browser-js",
|
||||
"build-browser-js": "node scripts/build-browser.js > app/browser/scripts.js",
|
||||
"build-launcher-js": "node scripts/build-launcher.js > app/launcher/scripts.js",
|
||||
"deploy-docs": "cd resources && mkdocs gh-deploy --clean && rm -rf site",
|
||||
"test": "npm run build-js && npm run build-css"
|
||||
"test": "npm run build"
|
||||
},
|
||||
"engines": {
|
||||
"node": "6"
|
||||
"node": ">=6"
|
||||
}
|
||||
}
|
||||
|
|
|
|||
20
resources/docs/credits.md
Normal file
|
|
@ -0,0 +1,20 @@
|
|||
# License
|
||||
|
||||
Copyleft © Jean-Emmanuel Doucet @ [AMMD](http://ammd.net) 2018.
|
||||
This program is a free software released under the [GNU/GPL3](ttps://github.com/jean-emmanuel/open-stage-control/blob/master/LICENSE) license.
|
||||
|
||||
## Dependencies
|
||||
|
||||
Open Stage Control relies on several other free softwares, including [Node.js](https://nodejs.org/), [Electron](http://electron.atom.io/), [osc.js](https://github.com/colinbdclark/osc.js), [babel](http://babeljs.io/), [browserify](http://browserify.org), [exorcist](https://github.com/thlorenz/exorcist), [express](http://expressjs.com), [node-sass](https://github.com/sass/node-sass), [jQuery](http://jquery.com/), [jQuery-UI](http://jqueryui.com/), [Font Awesome](http://fontawesome.io/), [stacktracejs](stacktracejs.com), [mathjs](http://mathjs.org/). A comprehensive and up-to-date list can be found [here](https://github.com/jean-emmanuel/open-stage-control/network/dependencies).
|
||||
|
||||
## Contributors
|
||||
|
||||
https://github.com/jean-emmanuel/open-stage-control/graphs/contributors
|
||||
|
||||
----
|
||||
|
||||
<div style="width:240px">
|
||||
[](http://browserstack.com/)
|
||||
</div>
|
||||
|
||||
BrowserStack supports Open Stage Control by providing a complete suite of browser emulators for Android, iOS and Windows.
|
||||
|
|
@ -1,2 +1,64 @@
|
|||
body {overflow-y: scroll}
|
||||
.md-nav__title.md-nav__title--site {display: none;}
|
||||
|
||||
.md-header, .md-tabs {
|
||||
background:rgb(49, 63, 85)!important;
|
||||
}
|
||||
|
||||
@media only screen and (max-width: 76.1875em) {
|
||||
.md-header, .md-nav__title--site {
|
||||
background:rgb(49, 63, 85)!important;
|
||||
}
|
||||
}
|
||||
|
||||
.md-header-nav__button.md-logo {
|
||||
margin-right:-1rem!important;
|
||||
}
|
||||
|
||||
.md-nav__title--site, .md-header-nav__title {
|
||||
padding-top: 1px;
|
||||
text-transform: uppercase;
|
||||
font-size: 1.4rem!important;
|
||||
/* font-weight:500!important; */
|
||||
letter-spacing:1px;
|
||||
}
|
||||
|
||||
a.button {
|
||||
background:rgb(82, 168, 255);
|
||||
color:white!important;
|
||||
display: inline-block;
|
||||
padding: 5px 10px;
|
||||
border-radius: 3px;
|
||||
transition: opacity .2s;
|
||||
}
|
||||
|
||||
a.button:hover {
|
||||
opacity: 0.90;
|
||||
}
|
||||
|
||||
.align-center {
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
article img {
|
||||
border-radius: 3px;
|
||||
}
|
||||
|
||||
.dynamic-prop-icon {
|
||||
vertical-align:super;
|
||||
font-size: 75%;
|
||||
margin-left: -5px;
|
||||
opacity: 0.65!important;
|
||||
}
|
||||
|
||||
.dynamic-prop-icon:after {
|
||||
content:"flash_on";
|
||||
font-family: Material Icons;
|
||||
font-style: normal;
|
||||
font-variant: normal;
|
||||
font-weight: 400;
|
||||
line-height: 1;
|
||||
text-transform: none;
|
||||
white-space: nowrap;
|
||||
speak: none;
|
||||
word-wrap: normal;
|
||||
direction: ltr;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,8 +1,8 @@
|
|||
# Editing sessions
|
||||
|
||||
The session editor can be enabled from the sidepanel. Once enabled, clicking on a widget will make it the *selected widget*, adding a fancy dashed blue border to it.
|
||||
The session editor can be enabled from the sidepanel. Once enabled, clicking on a widget will make it the *selected widget*.
|
||||
|
||||
## Root panel
|
||||
## Root panel
|
||||
|
||||
The root panel can be selected by clicking on the "Root" button in the sidepanel.
|
||||
|
||||
|
|
@ -10,21 +10,23 @@ The root panel can be selected by clicking on the "Root" button in the sidepanel
|
|||
|
||||
Right clicking / long touch on a widget or on a tab will also display a context menu providing useful utilities :
|
||||
|
||||
- `Edit parent`: selects the widget's parent for edition
|
||||
- `Edit parent`: select widget's parent for edition
|
||||
- `Copy`: copy widget's data
|
||||
- `Cut`: copy widget's data and delete selected widget
|
||||
- `Wrap in`: wrap the widget in a new container
|
||||
- `Paste`: paste copied widget in selected container
|
||||
- `n+1` : increments the id of the copied widget (and all its children) before pasting
|
||||
- `Clone` : paste the exact same widget
|
||||
- `Paste`: paste the widget as is
|
||||
- `ID + 1` : increments the id of the copied widget (and all its children) before pasting
|
||||
- `Clone` : create a clone widget targetting the copied widget
|
||||
- `Add widget`: create a new widget in selected container
|
||||
- `Add tab`: create a new tab in selected container
|
||||
- `Delete`: delete selected tab or widget
|
||||
|
||||
## Save
|
||||
## Save
|
||||
|
||||
Current session can be exported as a `.js` file. When overwriting a session file that's currently is use by other clients, they will reload it automatically.
|
||||
Current session can be exported as a `.json` file. When overwriting a session file that's currently is use by other clients, they will reload it automatically.
|
||||
|
||||
## Load
|
||||
## Load
|
||||
|
||||
Loading a session file doesn't affect other clients.
|
||||
|
||||
|
|
@ -34,11 +36,35 @@ By default, widget resizing / dragging snaps to a 10 pixel wide grid. Its width
|
|||
|
||||
## Properties
|
||||
|
||||
Selected widget's properties are displayed and can be modified in the sidepanel. The [widgets reference](widgets/widgets) section lists the available properties for each widget type. Property fields are all multiline (press `shit + enter` for new line).
|
||||
Selected widget's properties are displayed and can be modified in the sidepanel. The [widgets reference](widgets/widgets) section lists the available properties for each widget type. Property fields are all multiline (press `shift + enter` for new line).
|
||||
|
||||
Properties are written in JSON, with some flexibility brought by the [JSON5](https://github.com/json5/json5) format. For example, doubles quotes around object keys are not mandatory. All input will be converted to standard JSON.
|
||||
|
||||
|
||||
## Widget resizing / dragging
|
||||
|
||||
Selected widget can be resized using its south, south-east and east handles. It can be dragged with its north-west handle.
|
||||
Selected widget can be resized using its south, south-east and east handles. It can be dragged with its north-west handle. Using this feature will convert position and size values to plain number values, thus breaking previously set percent or inherited values.
|
||||
|
||||
## Bulk editing
|
||||
|
||||
When holding the `ctrl` key (or `command` on Mac), multiple widgets can be selected for edition:
|
||||
|
||||
- they must share the same parent widget
|
||||
- context-menu actions and properties changes apply to all selected widgets
|
||||
- resizing / dragging will affect all selected widgets, relatively to the first selected widget
|
||||
|
||||
## Keyboard shortcuts
|
||||
|
||||
| Shortcut | Description |
|
||||
|---|---|
|
||||
| `mod + z` | undo |
|
||||
| `mod + y / mod + shift + z` | redo |
|
||||
| `delete` | delete selected widgets |
|
||||
| `mod + c` | copy selected widgets |
|
||||
| `mod + x` | cut selected widgets |
|
||||
| `mod + v` | paste clipboard in selected widget |
|
||||
| `mod + shift + v` | paste and increment id |
|
||||
| `up, down, left, right` | move selected widgets (1 grid unit, hold `mod` for 5 grid units) |
|
||||
| `alt + [up, down, left, right]` | resize selected widgets (1 grid unit, hold `mod` for 5 grid units) |
|
||||
|
||||
Where `mod` is `ctrl` except on MacOs (`command`)
|
||||
|
|
|
|||
34
resources/docs/examples.md
Normal file
|
|
@ -0,0 +1,34 @@
|
|||
# Community examples
|
||||
|
||||
Feel free to submitt you own by [opening an issue](https://github.com/jean-emmanuel/open-stage-control/issues/new?title=[example]) on github.
|
||||
|
||||
## Ardour
|
||||
|
||||
- [Ardour Control](https://github.com/jean-emmanuel/ardour-control)
|
||||

|
||||
|
||||
## Reaper
|
||||
|
||||
- [Reaper OSC Panels](https://github.com/ThrashJazzAssassin/REAPER-OSC-panels)
|
||||

|
||||
|
||||
## QLab
|
||||
|
||||
- [QLab Cook Book / Open Stage Control](https://qlabcookbook.com/tag/open-stage-control/)
|
||||

|
||||
|
||||
## Bitwig
|
||||
|
||||
- [Open Stage Control Bitwig](https://github.com/kdejaeger/open-stage-control-bitwig)
|
||||

|
||||
|
||||
|
||||
- [OpenStageControl4Bitwig](http://www.mossgrabers.de/Software/Bitwig/Bitwig.html)
|
||||
- https://www.youtube.com/watch?v=u-fgArpsHQQ
|
||||
- https://www.youtube.com/watch?v=RvEMlo72ynQ
|
||||
|
||||
|
||||
## Others
|
||||
|
||||
- [Manaberry's UI](https://vi-control.net/community/threads/open-stage-control-tutorial-an-alternative-to-lemur-and-touchosc.72643/)
|
||||

|
||||
90
resources/docs/extras/advanced-property-syntax.md
Normal file
|
|
@ -0,0 +1,90 @@
|
|||
# Advanced property syntax
|
||||
|
||||
## Inheritance: `@{}`
|
||||
|
||||
Widgets can use each other's property values by using the following syntaxes:
|
||||
|
||||
- `@{this.propertyName}`
|
||||
- `@{parent.propertyName}`
|
||||
- `@{widgetId.propertyName}` (where `widgetId` is the target widget's `id`)
|
||||
|
||||
!!! note
|
||||
Don't use `widgetId` when targetting `this` or `parent`, it won't work.
|
||||
|
||||
`propertyName` can be any of the target widget's properties.
|
||||
|
||||
It can be used to:
|
||||
|
||||
- concatenate strings: `/@{parent.id}/some_suffix`
|
||||
- define object value: `["@{parent.id}"]`
|
||||
|
||||
If the retreived property is an object (`[] / {}`), a subset can be defined by appending a dot and a key (array index or object key) : `@{parent.variables.key}`
|
||||
|
||||
!!! note ""
|
||||
The root panel's `id` is `root`.
|
||||
|
||||
### Using the value
|
||||
|
||||
The special property name `value`<i class="dynamic-prop-icon" title="dynamic"></i> refers to a widget's current value (which can be affected by its `value` *property*).
|
||||
|
||||
When omitted, the property name defaults to `value` : `@{widgetId}` => `@{widgetId.value}`
|
||||
|
||||
### Dynamic properties
|
||||
|
||||
Some properties, when changed, trigger a complete widget recreation that ends any ongoing user interaction. Also, updating these properties continuously (e.g. when linked to a slider's dynamic value) can be very cpu expensive.
|
||||
|
||||
Some properties have much cheaper update routines and can be considered as `dynamic`, as in performance safe. These properties are marked in the documentation with a ` `<i class="dynamic-prop-icon" title="dynamic"></i>.
|
||||
|
||||
|
||||
### Circular references cases
|
||||
|
||||
- container widgets can inherit their children's properties only to define `dynamic` properties
|
||||
- widgets can inherit their own `value`<i class="dynamic-prop-icon" title="dynamic"></i> property only to define `dynamic` properties
|
||||
|
||||
----
|
||||
|
||||
### Nesting
|
||||
|
||||
The inheritance syntax supports nesting with a limitation: nested calls are not updated when the target's property/value updates, they are only resolved once at the host widget's initialization.
|
||||
|
||||
|
||||
## OSC listeners: `OSC{}`
|
||||
|
||||
The following syntax allows listening on an osc address to define a property, with an optionnal default value :
|
||||
|
||||
```
|
||||
OSC{/address, 1}
|
||||
```
|
||||
Will return `1` at first and listen for osc messages on address `/address`. Each time a value is received, the property will be updated.
|
||||
|
||||
----
|
||||
|
||||
## Formulas: `#{}`
|
||||
|
||||
The following syntax allow writing mathematical formulas in widgets' properties:
|
||||
|
||||
```
|
||||
#{FORMULA}
|
||||
```
|
||||
|
||||
Where FORMULA is a valid [MathJS](http://mathjs.org/docs/expressions/syntax.html) expression:
|
||||
|
||||
- [syntax documentation](http://mathjs.org/docs/expressions/syntax.html)
|
||||
- [available functions](http://mathjs.org/docs/reference/functions.html)
|
||||
- [available constants](http://mathjs.org/docs/reference/constants.html)
|
||||
- formulas can be [multiline](http://mathjs.org/docs/expressions/syntax.html#multiline-expressions)
|
||||
- property inheritance calls (`@{...}`) are always resolved before formulas
|
||||
- arrays / matrices indexes are **zero-based** (ie `["a","b"][0]` returns `"a"`)
|
||||
- strings can be multiline when enclosed in backticks instead of double quotes (``` ` ` ```)
|
||||
- inner closing brackets (`}`) must be escaped with a backslash (`\}`) except for `@{}` and `OSC{}` calls which are always resolved before formulas
|
||||
|
||||
Additionnal functions:
|
||||
|
||||
- `unpack(x)`: remove an array's brackets (`unpack([1,2])` returns `"1, 2"`)
|
||||
- `pad(x, padding)`: add leading zeros if the length the integer part of `x` is smaller than `padding` (`pad(1,2)` returns `"01"`)
|
||||
- `length(x)`: returns the length of an array or string
|
||||
- `keys(x)`: returns an array of a given object's property names (from [MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/keys))
|
||||
- `values(x)`: returns an array of a given object's own enumerable property values (from [MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/values))
|
||||
|
||||
!!! tip ""
|
||||
A single widget property can contain multiple formulas. Variables and functions declared in a formula are available to subsequent formulas in the same property definition.
|
||||
99
resources/docs/extras/css-tips.md
Normal file
|
|
@ -0,0 +1,99 @@
|
|||
# CSS Tips
|
||||
|
||||
## Inline syntax
|
||||
|
||||
For simple use cases, the `css` property can be written as a HTML inline styles (without any CSS selector). CSS rules will apply to the widget element.
|
||||
|
||||
```css
|
||||
opacity: 0.5; /* make the widget's transparent */
|
||||
font-size: 120%; /* increase font-size */
|
||||
```
|
||||
|
||||
|
||||
## Selector syntax
|
||||
|
||||
CSS selectors can be used to apply styles to specific elements:
|
||||
|
||||
```css
|
||||
:host {
|
||||
/* style for the widget element
|
||||
& { } also works (deprecated)
|
||||
*/
|
||||
}
|
||||
|
||||
.label {
|
||||
/* style for the .label elements */
|
||||
}
|
||||
|
||||
> .label {
|
||||
/* style for the direct child .label element */
|
||||
}
|
||||
|
||||
```
|
||||
|
||||
!!! tip ""
|
||||
Mixing Inline and Selector syntaxes doesn't work, once you use selectors, you have to use the `:host` selector to target the widget element.
|
||||
|
||||
## Layering: `z-index`
|
||||
|
||||
Z-Axis ordering can be set using the `z-index` rule. Absolutely positionned widgets (when `top` or `left` is different from `auto`) have `z-index:10;` by default.
|
||||
|
||||
## Layering: `pointer-events`
|
||||
|
||||
To make a widget ignore interactions (ie to be able to click through it), add `pointer-events:none;`.
|
||||
|
||||
!!! note ""
|
||||
This is always ignored when the editor is enabled.
|
||||
|
||||
## Responsive sizing
|
||||
|
||||
In most cases, using percentages in `height` and `width` will do. CSS `calc()` function can help in some cases:
|
||||
|
||||
```css
|
||||
:host {
|
||||
|
||||
width: calc(100% - 100rem);
|
||||
|
||||
}
|
||||
```
|
||||
|
||||
Media queries can also be used:
|
||||
|
||||
```css
|
||||
@media screen and (min-width: 768px) {
|
||||
|
||||
:host {
|
||||
|
||||
/* style the widget if the screen is bigger than 768px */
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
```
|
||||
|
||||
|
||||
## Size units
|
||||
|
||||
- use `rem` instead of `px` (`px` values will not scale when zooming)
|
||||
- use `%` for font-size
|
||||
|
||||
|
||||
## CSS Variables
|
||||
|
||||
CSS Variables declared in the [default theme](https://github.com/jean-emmanuel/open-stage-control/blob/master/src/browser/scss/themes/default.scss) can be overriden. Some widgets also use specific CSS variables (mostly to define colors) documented on their respective pages.
|
||||
|
||||
## Other tips
|
||||
|
||||
## Use the inspector
|
||||
|
||||
Hit `F12` to open the developers tools panel. The html/css inspector helps retreiving the class names needed to style specific parts of the widgets.
|
||||
|
||||
### Panel's background-color
|
||||
|
||||
This works for panel, strip and tabs:
|
||||
|
||||
```css
|
||||
> .panel {
|
||||
background-color: red;
|
||||
}
|
||||
```
|
||||
|
|
@ -51,6 +51,11 @@ The module is executed in a restricted context, only a few globals are available
|
|||
- `sendOsc`: `function({address, args, host, port})`
|
||||
- `receiveOsc`: `function({address, args, host, port})`
|
||||
- `setTimeout`: `function(function, delay)`
|
||||
- `clearTimeout`: `function(timeout)`
|
||||
- `setInterval`: `function(function, delay)`
|
||||
- `clearInterval`: `function(interval)`
|
||||
- `settings.read`: `function(name)`, see [settings.js](https://github.com/jean-emmanuel/open-stage-control/blob/master/app/main/settings.js#L125-L162) for available options
|
||||
- `app`: an [event emitter](https://nodejs.org/api/events.html#events_class_eventemitter) for monitoring the events sent by the different clients. Event names can be found in [callbacks.js](https://github.com/jean-emmanuel/open-stage-control/blob/master/app/main/callbacks.js), callbacks are called with 2 arguments: `data` (object) and `clientId` (string)
|
||||
|
||||
|
||||
`sendOsc` and `receiveOsc` expect arguments formatted as follow:
|
||||
|
|
|
|||
|
|
@ -7,14 +7,14 @@ Open Stage Control can send and receive MIDI messages.
|
|||
MIDI support requires additional software to be installed on the server's system:
|
||||
|
||||
- python (2 / 3)
|
||||
- python package [rtmidi](https://pypi.python.org/pypi/rtmidi) (version 2.3.2, compiled with `--jack-midi` flag for JACK MIDI support)
|
||||
- python package [rtmidi](https://pypi.python.org/pypi/rtmidi) (version 2.3.2)
|
||||
|
||||
!!! note "Why an additionnal dependency ?"
|
||||
Providing cross-platform MIDI support is not trivial, as it requires OS-specific compilation that cannot be automated within Open Stage Control's current packaging workflow. Using a python addon seems to be the best compromise so far : the core app remains easy to build, and the extra dependency is easy to install.
|
||||
|
||||
## Setup
|
||||
|
||||
When running the app, the `-m / -midi` switch must be set; it accepts the following options (separated by spaces):
|
||||
When running the app, the `-m / --midi` switch must be set; it accepts the following options (separated by spaces):
|
||||
|
||||
- `list`: prints the available MIDI ports to the console; numbers in the first column may be used for `input`/`output` definition below
|
||||
- `device_name:input,output`: connect to midi ports `input` and `output`; osc messages sent to target `midi:device_name` will be processed as midi events; Multiple devices can be declared
|
||||
|
|
@ -22,7 +22,7 @@ When running the app, the `-m / -midi` switch must be set; it accepts the follow
|
|||
*Linux only:*
|
||||
|
||||
- `device_name:virtual`: creates a virtual midi device with one input port and one output port
|
||||
- `jack`: use JACK MIDI instead of ALSA (add as extra parameter)
|
||||
- `jack`: use JACK MIDI instead of ALSA (add as extra parameter). `rtmidi` must be compiled with `--jack-midi` flag for this to work.
|
||||
|
||||
## Widget settings
|
||||
|
||||
|
|
|
|||
|
|
@ -1,17 +0,0 @@
|
|||
# Property inheritance
|
||||
|
||||
Widgets can use each other's property values by using the following syntaxes:
|
||||
|
||||
- `@{this.propertyName}`
|
||||
- `@{parent.propertyName}`
|
||||
- `@{widgetId.propertyName}` (where `widgetId` is the target widget's `id`)
|
||||
|
||||
It can be used to:
|
||||
|
||||
- concatenate strings: `/@{parent.id}/some_suffix`
|
||||
- define object value: `["@{parent.id}"]`
|
||||
|
||||
If the retreived property is an object (`[] / {}`), it can be used as is or one can retreive a specfic item from it: `@{parent.variables.0}` will try to return the first item of the parent's `variables` property.
|
||||
|
||||
!!! note ""
|
||||
The root panel's `id` is `root`.
|
||||
27
resources/docs/extras/property-maths.md
Normal file
|
|
@ -0,0 +1,27 @@
|
|||
# Property maths
|
||||
|
||||
The following syntax allow writing mathematical formulas in widgets' properties:
|
||||
|
||||
```
|
||||
#{ FORMULA }
|
||||
```
|
||||
|
||||
Where FORMULA is a valid [MathJS](http://mathjs.org/docs/expressions/syntax.html) expression:
|
||||
|
||||
- [syntax documentation](http://mathjs.org/docs/expressions/syntax.html)
|
||||
- [available functions](http://mathjs.org/docs/reference/functions.html)
|
||||
- [available constants](http://mathjs.org/docs/reference/constants.html)
|
||||
- formulas can be [multiline](http://mathjs.org/docs/expressions/syntax.html#multiline-expressions)
|
||||
- property inheritance calls (`@{...}`) are always resolved before formulas
|
||||
- arrays / matrices indexes are **zero-based** (ie `["a","b"][0]` returns `"a"`)
|
||||
- strings can be multiline when enclosed in backticks instead of double quotes (``` ` ` ```)
|
||||
- inner closing brackets (`}`) must be escaped with a backslash (`\}`)
|
||||
|
||||
Additionnal functions:
|
||||
|
||||
- `unpack(x)`: remove an array's brackets (`unpack([1,2])` returns `"1, 2"`)
|
||||
- `pad(x, padding)`: add leading zeros if the length the integer part of `x` is smaller than `padding` (`pad(1,2)` returns `"01"`)
|
||||
- `length(x)`: returns the length of an array or string
|
||||
|
||||
!!! tip ""
|
||||
A single widget property can contain multiple formulas. Variables and functions declared in a formula are available to subsequent formulas in the same property definition.
|
||||
|
|
@ -16,7 +16,7 @@ Apply a set of options to an existing widget by replacing the old ones with the
|
|||
!!! warning ""
|
||||
Editing a widget can be cpu expensive, hence updating the UI continuously is not a good idea
|
||||
|
||||
## `/EDIT_SOFT id options`
|
||||
## `/EDIT/MERGE id options`
|
||||
|
||||
Apply a set of options to an existing widget by merging them to the widget's options.
|
||||
|
||||
|
|
@ -28,6 +28,84 @@ Apply a set of options to an existing widget by merging them to the widget's opt
|
|||
!!! warning ""
|
||||
Editing a widget can be cpu expensive, hence updating the UI continuously is not a good idea
|
||||
|
||||
## `/EDIT/UNDO`
|
||||
|
||||
Undo editing action
|
||||
|
||||
## `/EDIT/REDO`
|
||||
|
||||
Redo editing action
|
||||
|
||||
## `/EDIT/GET target id`
|
||||
|
||||
Sends back a widget's data (JSON stringified object), including its children, to specified target.
|
||||
|
||||
- `target`: `string`, `ip:port` pair
|
||||
- `id`: `string`, widget's `id`
|
||||
|
||||
Returns `/EDIT/GET id data`
|
||||
|
||||
- `id`: `string`
|
||||
- `data`: `string`
|
||||
|
||||
## `/EDIT/GET target address preArg1 preArg2 ...`
|
||||
|
||||
Sends back a widget's data (JSON stringified object), including its children, to specified target.
|
||||
|
||||
- `target`: `string`, `ip:port` pair
|
||||
- `address`: `string`, widget's `address`
|
||||
- `preArg[1...]`: `*`, widget's `preArgs`
|
||||
|
||||
Returns `/EDIT/GET address preArg1 preArg2 ... data`
|
||||
|
||||
- `address`: `string`, widget's `address`
|
||||
- `preArg[1...]`: `*`, widget's `preArgs`
|
||||
- `data`: `string`
|
||||
|
||||
|
||||
## `/GET target id`
|
||||
|
||||
Sends back a widget's value to specified target.
|
||||
|
||||
- `target`: `string`, `ip:port` pair
|
||||
- `id`: `string`, widget's `id`
|
||||
|
||||
Returns `/GET id value`
|
||||
|
||||
- `id`: `string`
|
||||
- `value`: `*`
|
||||
|
||||
## `/GET target address preArg1 preArg2 ...`
|
||||
|
||||
Sends back a widget's value to specified target.
|
||||
|
||||
- `target`: `string`, `ip:port` pair
|
||||
- `address`: `string`, widget's `address`
|
||||
- `preArg[1...]`: `*`, widget's `preArgs`
|
||||
|
||||
Returns `/GET address preArg1 preArg2 ... value`
|
||||
|
||||
- `address`: `string`, widget's `address`
|
||||
- `preArg[1...]`: `*`, widget's `preArgs`
|
||||
- `value`: `*`
|
||||
|
||||
|
||||
## `/SET target id value`
|
||||
|
||||
Set a widget's value as if it was interacted with from the interface. This is likely to make it send its value.
|
||||
|
||||
- `id`: `string`, widget's `id`
|
||||
- `value`: `*`, widget's new value
|
||||
|
||||
## `/SET address preArg1 preArg2 ... value`
|
||||
|
||||
Set a widget's value as if it was interacted with from the interface. This is likely to make it send its value.
|
||||
|
||||
- `address`: `string`, widget's `address`
|
||||
- `preArg[1...]`: `*`, widget's `preArgs`
|
||||
- `value`: `*`, widget's new value
|
||||
|
||||
|
||||
## `/TABS id id etc`
|
||||
|
||||
Open the tabs designated by the `id` parameters. The target tab link must be accesible (opening a tab located in a disabled tab won't work unless you specify the parent tab's `id` before; the safest way to go is to pass the whole tab tree to enable).
|
||||
|
|
|
|||
|
|
@ -1,6 +1,24 @@
|
|||
# Theming
|
||||
|
||||
Theming is as simple as writing a tiny css file that will override the default style variables defined in [_vars.scss](https://github.com/jean-emmanuel/open-stage-control/blob/master/src/browser/scss/_vars.scss) :
|
||||
## Built-in themes
|
||||
|
||||
Themes can be loaded with the `--theme` option. Multiple themes can be combined. Built-in themes can be loaded using their name, custom theme files can be loaded using their path.
|
||||
|
||||
Available themes (full color scheme):
|
||||
|
||||
- `orange`: grey and orange theme
|
||||
- `light`: light and blue
|
||||
- `dark`: blue night theme
|
||||
|
||||
Available extensions (alternative visual settings)
|
||||
|
||||
- `flat`: remove 3d effects
|
||||
- `alt-buttons`: colorful active buttons
|
||||
- `responsive-fonts`: bigger texts for bigger screens
|
||||
|
||||
## Creating a custom theme
|
||||
|
||||
Creating a custom theme is as simple as writing a tiny css file that will override the default css variables defined in [default.scss](https://github.com/jean-emmanuel/open-stage-control/blob/master/src/browser/scss/themes/default.scss) :
|
||||
|
||||
```css
|
||||
:root {
|
||||
|
|
@ -18,12 +36,11 @@ This will change the default accent color to red. Variables can also be overridd
|
|||
|
||||
This will change the default text color to blue for all elements in panel widgets.
|
||||
|
||||
Of course, regular css is also allowed :
|
||||
## Scss / autoreload
|
||||
|
||||
```css
|
||||
.widget .input {
|
||||
display: none;
|
||||
}
|
||||
```
|
||||
When running the app [from sources](../getting-started), custom themes can be written in scss:
|
||||
|
||||
This will hide the widgets' value inputs.
|
||||
- the scss file must be located in `src/browser/scss/themes/`
|
||||
- run `npm run watch-css`
|
||||
|
||||
The theme will be watched and compiled automatically to a css file located in app/browser/themes/ (css files in this directory can be selected from the theme option by their name, without .css suffix). If the app is running on default http port, clients will reload the theme automatically.
|
||||
|
|
|
|||
|
|
@ -9,6 +9,7 @@ Client specific options can be set by adding query parameters to the server's ur
|
|||
| forceHdpi | number | 0 | force canvas scaling (ignore `hdpi`) |
|
||||
| doubletab | number | 375 | sets the double tap/click time thershold in milliseconds |
|
||||
| zoom | number | 1 | sets the initial zoom |
|
||||
| framerate | number | 60 | limit canvas drawing framerate |
|
||||
|
||||
Example:
|
||||
|
||||
|
|
|
|||
|
|
@ -8,72 +8,90 @@
|
|||
|
||||
Below are the available command-line options. Note that when running without any command-line switch (ie from a file browser), a launcher window will spawn to help setting them.
|
||||
|
||||
| Option | Description |
|
||||
|---|---|
|
||||
| -s, --send | default targets for all widgets (ip:port pairs)|
|
||||
| -l, --load | session file to load |
|
||||
| -b, --blank | load a blank session and start the editor |
|
||||
| -c, --custom-module | custom module file to load |
|
||||
| -p, --port | http port of the server (default to 8080) |
|
||||
| -o, --osc-port | osc input port (default to --port) |
|
||||
| -m, --midi | midi router settings (requires python-pyo) |
|
||||
| -d, --debug | log received osc messages in the console |
|
||||
| -n, --no-gui | disable default gui |
|
||||
| -g, --gui-only | app server's url. If true, local port (--port) is used |
|
||||
| -t, --theme | theme name or path (mutliple values allowed) |
|
||||
| -e, --examples | list examples instead of recent sessions |
|
||||
| --url-options | [url options](extras/url-options) (opt=value pairs) |
|
||||
| --disable-vsync | disable gui's vertical synchronization |
|
||||
| --read-only | disable session editing and session history changes |
|
||||
!!! tip ""
|
||||
Preferences are stored in the user's home folder in a file named `.open-stage-control` (hidden under Linux / macOS)
|
||||
|
||||
|| Option | Description |
|
||||
|---||---|
|
||||
| `-s` | `--send` | default targets for all widgets (ip:port pairs)|
|
||||
| `-l` | `--load` | session file to load |
|
||||
| | `--state` | state file to load (osc messages will be sent, unless there are other clients connected) |
|
||||
| `-b` | `--blank` | load a blank session and start the editor |
|
||||
| `-c` | `--custom-module` | custom module file to load |
|
||||
| `-p` | `--port` | http port of the server (default to 8080) |
|
||||
| `-o` | `--osc-port` | osc input port (default to --port) |
|
||||
| | `--tcp-port` | tcp server input port |
|
||||
| | `--tcp-targets` | tcp servers to connect to (ip:port pairs), does not susbtitute for --send |
|
||||
| `-m` | `--midi` | midi router settings |
|
||||
| `-d` | `--debug` | log received osc messages in the console |
|
||||
| `-n` | `--no-gui` | disable default gui |
|
||||
| `-g` | `--gui-only` | app server's url. If true, local port (--port) is used |
|
||||
| `-t` | `--theme` | theme name or path (mutliple values allowed) see [theming](extras/theming/) |
|
||||
| `-e` | `--examples` | list examples instead of recent sessions |
|
||||
| | `--url-options` | [url options](extras/url-options) (opt=value pairs) |
|
||||
| |`--disable-vsync` | disable gui's vertical synchronization |
|
||||
| |`--disable-gpu` | disable hardware acceleration |
|
||||
| |`--read-only` | disable session editing and session history changes |
|
||||
| |`--instance-name` | used to differenciate multiple instances in a zeroconf network |
|
||||
| |`--fullscreen` | launch the default client gui in fullscreen mode (F11 to exit) |
|
||||
|
||||
Command-line only :
|
||||
|
||||
| Option | Description |
|
||||
|---|---|
|
||||
| -h, --help | print available options |
|
||||
| -v, --version | print version number |
|
||||
|| Option | Description |
|
||||
|---||---|
|
||||
| `-h` | `--help` | print available options |
|
||||
| `-v` | `--version` | print version number |
|
||||
|
||||
**Examples**
|
||||
|
||||
```
|
||||
$ open-stage-control --send 127.0.0.1:5555 127.0.0.1:6666 --port 7777
|
||||
```bash
|
||||
open-stage-control --send 127.0.0.1:5555 127.0.0.1:6666 --port 7777
|
||||
```
|
||||
|
||||
This will create an app listening on port 7777 for synchronization messages, and sending its widgets state changes to ports 5555 and 6666.
|
||||
|
||||
```
|
||||
$ open-stage-control --no-gui --load path/to/session.js --port 9999
|
||||
```bash
|
||||
open-stage-control --no-gui --load path/to/session.js --port 9999
|
||||
```
|
||||
|
||||
This will create a headless app available through http on port 9999 with session.js loaded automatically.
|
||||
|
||||
!!! tip "What about HTTPS ?"
|
||||
Security is out of the app's scope. If you are concerned about safety, using a private - protected - network should be enough.
|
||||
|
||||
|
||||
## Run from sources
|
||||
|
||||
Running the app from the sources slightly differs from using built binaries : instead of running a binary, we'll launch the app with npm.
|
||||
Running the app from the sources slightly differs from using built binaries : we'll build and launch the app with npm (node package manager).
|
||||
|
||||
**1. Requirements**
|
||||
|
||||
- [Node.js >= 4](https://nodejs.org/)
|
||||
- [npm](https://www.npmjs.com/)
|
||||
|
||||
```
|
||||
$ sudo apt-get install nodejs npm # install nodejs & npm
|
||||
$ sudo npm install -g npm # update npm
|
||||
```
|
||||
|
||||
- [Node.js >= 4.8](https://nodejs.org/en/#download)
|
||||
- [git](https://git-scm.com/downloads)
|
||||
|
||||
**2. Download sources**
|
||||
|
||||
```bash
|
||||
git clone https://github.com/jean-emmanuel/open-stage-control
|
||||
cd open-stage-control/
|
||||
# uncomment next line if you want the latest release
|
||||
# instead of the current development version
|
||||
# git checkout $(git describe --tags `git rev-list --tags --max-count=1`)
|
||||
npm install
|
||||
npm run build
|
||||
```
|
||||
$ git clone https://github.com/jean-emmanuel/open-stage-control
|
||||
$ cd open-stage-control/
|
||||
$ npm install
|
||||
```
|
||||
|
||||
!!! note "Updating from sources"
|
||||
```bash
|
||||
git pull
|
||||
npm install
|
||||
npm run build
|
||||
```
|
||||
|
||||
**3. Run !**
|
||||
|
||||
```
|
||||
$ npm start [ -- options]
|
||||
```bash
|
||||
npm start [ -- options]
|
||||
```
|
||||
|
||||
!!! note ""
|
||||
|
|
@ -84,35 +102,33 @@ $ npm start [ -- options]
|
|||
|
||||
**1. Requirements**
|
||||
|
||||
- [Node.js >= 4](https://nodejs.org/)
|
||||
- [npm](https://www.npmjs.com/)
|
||||
- [Node.js >= 4.8](https://nodejs.org/en/#download)
|
||||
- [git](https://git-scm.com/downloads)
|
||||
|
||||
```
|
||||
$ sudo apt-get install nodejs npm # install nodejs & npm
|
||||
$ sudo npm install -g npm # update npm
|
||||
```
|
||||
**2. Download sources & build package**
|
||||
|
||||
**2. Build**
|
||||
```bash
|
||||
git clone https://github.com/jean-emmanuel/open-stage-control
|
||||
cd open-stage-control/
|
||||
# uncomment next line if you want the latest release
|
||||
# instead of the current development version
|
||||
# git checkout $(git describe --tags `git rev-list --tags --max-count=1`)
|
||||
npm install
|
||||
|
||||
```
|
||||
$ git clone https://github.com/jean-emmanuel/open-stage-control
|
||||
$ cd open-stage-control
|
||||
$ npm install
|
||||
$ export PLATFORM=TARGET_PLATFORM # TARGET_PLATFORM can be linux, win32 (windows) or darwin (os x)
|
||||
$ export ARCH=TARGET_ARCH # TARGET_ARCH can be ia32, x64 or armv7l
|
||||
$ npm run build
|
||||
# TARGET_PLATFORM can be linux, win32 (windows) or darwin (os x)
|
||||
export PLATFORM=TARGET_PLATFORM
|
||||
# TARGET_ARCH can be ia32, x64 or armv7l
|
||||
export ARCH=TARGET_ARCH
|
||||
|
||||
# Do the following if you want a deb package for debian/ubuntu
|
||||
npm run package
|
||||
|
||||
$ npm run deb32
|
||||
# For raspberry-pi / armv7l, run this instead
|
||||
npm run package-rpi
|
||||
|
||||
# or
|
||||
|
||||
$ npm run deb64
|
||||
|
||||
# or
|
||||
|
||||
$ npm run debarm
|
||||
# Do one of the following if you want a deb package for debian/ubuntu
|
||||
npm run deb32
|
||||
npm run deb64
|
||||
npm run debarm
|
||||
```
|
||||
|
||||
This will build the app in `dist/open-stage-control-PLATFORM-ARCH`.
|
||||
|
|
@ -126,15 +142,15 @@ Electron, Open Stage Control's engine, is based on chromium and can't run out of
|
|||
|
||||
In short: install [xvfb](https://en.wikipedia.org/wiki/Xvfb) and prepend your command with `xvfb-run`:
|
||||
|
||||
```
|
||||
$ xvfb-run open-stage-control -n
|
||||
```bash
|
||||
xvfb-run open-stage-control -n
|
||||
```
|
||||
|
||||
## Running without Electron
|
||||
|
||||
It is possible to run the server in headless mode without Electron using [node](https://nodejs.org) (v6 or higher) :
|
||||
It is possible to run the server in headless mode without Electron using [node](https://nodejs.org/en/download/package-manager/) (v6 or higher) :
|
||||
|
||||
```
|
||||
$ node /path/to/packaged/open-stage-control/resources/app/ -n
|
||||
$ node /path/to/sources/open-stage-control/app/ -n
|
||||
```bash
|
||||
node /path/to/packaged/open-stage-control/resources/app/ -n
|
||||
node /path/to/sources/open-stage-control/app/ -n
|
||||
```
|
||||
|
|
|
|||
1
resources/docs/img/logo-browserstack.png
Symbolic link
|
|
@ -0,0 +1 @@
|
|||
../../images/logo-browserstack.png
|
||||
|
Before Width: | Height: | Size: 950 KiB |
|
|
@ -1 +0,0 @@
|
|||
../../images/logo-material.svg
|
||||
1
resources/docs/img/logo-nobadge.png
Symbolic link
|
|
@ -0,0 +1 @@
|
|||
../../images/logo-nobadge.png
|
||||
1
resources/docs/img/logo-nobadge.svg
Symbolic link
|
|
@ -0,0 +1 @@
|
|||
../../images/logo-nobadge.svg
|
||||
|
|
@ -1 +0,0 @@
|
|||
../../images/logo.png
|
||||
1
resources/docs/img/logo.svg
Symbolic link
|
|
@ -0,0 +1 @@
|
|||
../../images/logo.svg
|
||||
|
|
@ -1,35 +1,63 @@
|
|||
# Open Stage Control
|
||||
|
||||
Open Stage Control is a libre desktop OSC bi-directionnal control surface application. It's built on web technologies and run as an [Electron](http://electron.atom.io/) web server that accepts any number of clients.
|
||||
|
||||
[Try the online demo (Chrome 50+ required)](http://demo.osc.ammd.net)
|
||||
|
||||
[Download the latest release](https://github.com/jean-emmanuel/open-stage-control/releases)
|
||||
|
||||
|
||||
<div style="width:70%; box-shadow: 0 0 5px 0 rgba(0,0,0,.45); border-radius:2px;overflow:hidden">
|
||||
<a href="img/ardour-osc.png" title="Controlling Ardour"><img alt="Controlling Ardour" src="img/ardour-osc.png" style="display:block"/></a>
|
||||
</div>
|
||||
# <img style="margin:0 auto;display:inline-block;width:60px;float:left;margin-right:20px;margin-top:-7px;" src="img/logo.svg"/> Open Stage Control
|
||||
|
||||
*Libre and modular OSC / MIDI controller*
|
||||
|
||||
Open Stage Control is a desktop OSC bi-directionnal control surface application. It's built on web technologies and run as an [Electron](http://electron.atom.io/) web server that accepts any number of clients.
|
||||
|
||||
<a class="button" href="http://demo.osc.ammd.net">Try the online demo (Chrome 50+ required)</a>
|
||||
|
||||
<a class="button" href="https://github.com/jean-emmanuel/open-stage-control/releases">Download the latest release</a>
|
||||
|
||||
|
||||

|
||||
|
||||
## Supported platforms
|
||||
|
||||
The server can run on all [platforms supported by Electron](https://electron.atom.io/docs/tutorial/supported-platforms/).
|
||||
The only supported client browsers are the one provided with the server and Chrome/Chromium version `50` or later. For iOS devices, the minimal version required is `9.3`.
|
||||
The server can run on all [platforms supported by Electron](https://electron.atom.io/docs/tutorial/supported-platforms/). Clients just need to connect to the server with a compatible browser :
|
||||
|
||||
- any system running Chrome/Chromium version `50` or later (Linux, MacOS, Windows, Android, etc)
|
||||
- iOS version `9.3` or later
|
||||
|
||||
Firefox is *not* supported.
|
||||
|
||||
## Need help ? Found a bug ?
|
||||
|
||||
Head over the github [issue tracker](https://github.com/jean-emmanuel/open-stage-control/issues) :)
|
||||
Head over the [issue tracker](https://github.com/jean-emmanuel/open-stage-control/issues) :)
|
||||
|
||||
## License & credits
|
||||
## Free what ?
|
||||
|
||||
Copyleft © Jean-Emmanuel @ [AMMD](http://ammd.net) 2017
|
||||
Open Stage Control is a [free software](https://www.fsf.org/), as in *gratis* and — most importantly — **libre**. It always will be. If you want to support the project financially, consider using liberapay or [flattr](https://flattr.com/@jean-emmanuel) :
|
||||
|
||||
This program is a free software released under the GNU/GPL3 license, it relies on the use of several other free softwares, including [Node.js](https://nodejs.org/), [Electron](http://electron.atom.io/), [osc.js](https://github.com/colinbdclark/osc.js), [socket.io](http://socket.io), [browserify](http://browserify.org), [exorcist](https://github.com/thlorenz/exorcist), [express](http://expressjs.com), [node-sass](https://github.com/sass/node-sass), [jQuery](http://jquery.com/), [jQuery-UI](http://jqueryui.com/), [Font Awesome](http://fontawesome.io/), [source-map](https://github.com/mozilla/source-map), [mathjs](http://mathjs.org/)
|
||||
<script src="https://liberapay.com/jean-emmanuel/widgets/button.js"></script>
|
||||
<noscript><a href="https://liberapay.com/jean-emmanuel/donate"><img alt="Donate using Liberapay" src="https://liberapay.com/assets/widgets/donate.svg"></a></noscript>
|
||||
|
||||
----
|
||||
|
||||
<div style="width:300px">
|
||||
[](http://browserstack.com/)
|
||||
</div>
|
||||
## Table of contents
|
||||
|
||||
BrowserStack helps debugging Open Stage Control by providing a complete suite of browser emulators for Android, iOS and Windows, how awesome is that ? *Quite very much indeed !*
|
||||
- [Getting started](getting-started)
|
||||
- [User interface](interface)
|
||||
- [Editing sessions](editing-sessions)
|
||||
- Widgets reference:
|
||||
- [Widget properties](widgets/widgets)
|
||||
- [Containers](widgets/containers)
|
||||
- [Sliders](widgets/sliders)
|
||||
- [Pads](widgets/pads)
|
||||
- [Buttons](widgets/buttons)
|
||||
- [Switchers](widgets/switchers)
|
||||
- [Plots](widgets/plots)
|
||||
- [Matrices](widgets/matrices)
|
||||
- [Inputs](widgets/inputs)
|
||||
- [Maths](widgets/maths)
|
||||
- Extras:
|
||||
- [Advanced property syntax](extras/advanced-property-syntax)
|
||||
- [CSS Tips](extras/css-tips)
|
||||
- [Theming](extras/theming)
|
||||
- [URL options](extras/url-options)
|
||||
- [Remote control](extras/remote-control)
|
||||
- [Custom module](extras/custom-module)
|
||||
- [Midi](extras/midi)
|
||||
- [Examples](examples)
|
||||
- [Credits](credits)
|
||||
|
|
|
|||
|
|
@ -12,7 +12,7 @@ The sidepanel can be opened by clicking the navigation icon in the upper right c
|
|||
- Export: save the state of all widgets to a `.preset` file
|
||||
- Import: load a state from a `.preset` file
|
||||
|
||||
### Traversing gestures
|
||||
### Traversing gestures
|
||||
|
||||
By default, a dragging gesture can only affect the widget it started on. Enabling traversing gesture does two things:
|
||||
|
||||
|
|
@ -30,4 +30,6 @@ See [Editing sessions](editing-sessions.md).
|
|||
| Click | Tap | Handled at pressing time, not releasing. |
|
||||
| Double Click | Double Tap | Some widgets handle double click / tap events. |
|
||||
| Right-click | Long touch | Widgets that have only one value input will give focus to it when receiving this event. When the editor is enabled, Right-click / Long touch spawns the editor's context menu. |
|
||||
| Drag | | The widgets respond to mouse and touch drag gestures with a 1:1 precision ratio. By using two or more fingers, one can obtain higher precision gestures : each finger that touches the widget without moving will slow down the moving one. |
|
||||
| Drag | Drag | The widgets respond to mouse and touch drag gestures with a 1:1 precision ratio. |
|
||||
| `Ctrl` + Drag | | Holding the `Ctrl` key while dragging with the mouse increases the gesture's precision by 10.|
|
||||
| | Two-fingers drag (single target) | Using two on a single-touch target increases the gesture's precision by 10. |
|
||||
|
|
|
|||
|
|
@ -12,24 +12,24 @@ Buttons are exactly what you think they are.
|
|||
}
|
||||
```
|
||||
|
||||
### `doubleTap`
|
||||
### `doubleTap`
|
||||
- type: `boolean`
|
||||
- default: `false`
|
||||
- usage: set to `true` to make the button require a double tap to be toggled instead of a single tap
|
||||
|
||||
### `led`
|
||||
### `led`
|
||||
- type: `boolean`
|
||||
- default: `false`
|
||||
- usage: set to `true` to display the toggle's state with a led
|
||||
|
||||
### `on`
|
||||
### `on`<i class="dynamic-prop-icon" title="dynamic"></i>
|
||||
- type: `string|number|object`
|
||||
- default: `1`
|
||||
- usage: defines which value is sent on `on` position
|
||||
- set to `null` to send send no argument in the osc message
|
||||
- can be an `object` if the type needs to be specified (see [preArgs](./widgets.md#preargs))
|
||||
|
||||
### `off`
|
||||
### `off`<i class="dynamic-prop-icon" title="dynamic"></i>
|
||||
- type: `string|number|object`
|
||||
- default: `0`
|
||||
- usage: defines which value is sent on `off` position
|
||||
|
|
@ -47,14 +47,14 @@ Buttons are exactly what you think they are.
|
|||
}
|
||||
```
|
||||
|
||||
### `on`
|
||||
### `on`<i class="dynamic-prop-icon" title="dynamic"></i>
|
||||
- type: `string|number|object`
|
||||
- default: `1`
|
||||
- usage: defines which value is sent when pushing the button
|
||||
- set to `null` to send send no argument in the osc message
|
||||
- can be an `object` if the type needs to be specified (see [preArgs](./widgets.md#preargs))
|
||||
|
||||
### `off`
|
||||
### `off`<i class="dynamic-prop-icon" title="dynamic"></i>
|
||||
- type: `string|number|object`
|
||||
- default: `0`
|
||||
- usage: defines which value is sent when releasing the button
|
||||
|
|
@ -72,19 +72,25 @@ Setting the `push`'s value externally (via osc) will toggle it's inner light.
|
|||
|
||||
|
||||
## Switch
|
||||
|
||||
```js
|
||||
{
|
||||
type:'switch',
|
||||
// etc
|
||||
}
|
||||
```
|
||||
|
||||
### `values`
|
||||
### `values`
|
||||
- type: `array|object`
|
||||
- default: `{"Value 1":1,"Value 2":2}`
|
||||
- usage:
|
||||
- `array` of possible values to switch between : `[1,2,3]`
|
||||
- `object` of `"label":value` pairs
|
||||
- `object` of `"label":value` pairs. Numeric labels must be prepended or appended with a white space (or any other non-numeric character) otherwise the order of the values won't be kept.
|
||||
|
||||
### `showValues`
|
||||
- type: `boolean`
|
||||
- default: `false`
|
||||
- usage: if `values` is an `object`, set to `true` to display both values and labels instead of labels only
|
||||
|
||||
|
||||
## Dropdown
|
||||
```js
|
||||
|
|
@ -94,9 +100,10 @@ Setting the `push`'s value externally (via osc) will toggle it's inner light.
|
|||
}
|
||||
```
|
||||
|
||||
### `values`
|
||||
### `values`<i class="dynamic-prop-icon" title="dynamic"></i>
|
||||
- type: `array|object`
|
||||
- default: `{"Value 1":1,"Value 2":2}`
|
||||
- usage:
|
||||
- `array` of possible values to switch between : `[1,2,3]`
|
||||
- `object` of `"label":value` pairs
|
||||
- `object` of `"label":value` pairs. Numeric labels must be prepended or appended with a white space (or any other non-numeric character) otherwise the order of the values won't be kept.
|
||||
- an empty option will always be prepended to `values` (sends an osc message without any value); it can be hidden by adding `option:first-child{display:none}` to the widget's `css`
|
||||
|
|
|
|||
|
|
@ -15,28 +15,28 @@ Panels can contains tabs or widgets. These can be absolutely positioned and can
|
|||
}
|
||||
```
|
||||
|
||||
### `scroll`
|
||||
### `scroll`
|
||||
- type: `boolean`
|
||||
- default: `true`
|
||||
- usage: set to `false` to disable scrollbars
|
||||
|
||||
### `border`
|
||||
### `border`
|
||||
- type: `boolean`
|
||||
- default: `true`
|
||||
- usage: by default, widgets in panels/strip have their border disabled, except for panels and strips. Set to `false` to apply this rule to the panel too.
|
||||
|
||||
### `widgets`
|
||||
### `widgets`
|
||||
- type: `array`
|
||||
- default: `[]`
|
||||
- usage: each element of the `array` must be a widget `object`. A panel cannot contain widgets and tabs simultaneously.
|
||||
|
||||
### `tabs`
|
||||
### `tabs`
|
||||
- type: `array`
|
||||
- default: `[]`
|
||||
- usage: each element of the `array` must be a tab `object`. A panel cannot contain widgets and tabs simultaneously.
|
||||
|
||||
|
||||
### `variables`
|
||||
### `variables`<i class="dynamic-prop-icon" title="dynamic"></i>
|
||||
- type: `*`
|
||||
- default: `@{parent.variables}`
|
||||
- usage: defines one or more arbitrary variables that can be inherited by children widgets.
|
||||
|
|
@ -47,19 +47,22 @@ Panels can contains tabs or widgets. These can be absolutely positioned and can
|
|||
- `@{parent.variables}` useful when nesting containers
|
||||
|
||||
|
||||
### `layout`
|
||||
### `layout`
|
||||
- type: `string`
|
||||
- default: `''`
|
||||
- usage: `layout` must be a valid [Visual Format Language](https://developer.apple.com/library/content/documentation/UserExperience/Conceptual/AutolayoutPG/VisualFormatLanguage.html) expression. It accepts the [Extended Visual Format Language](https://github.com/IjzerenHein/autolayout.js#extended-visual-format-language-evfl) as well. Widgets are targeted using their `id` or their index prefixed with a `$` (`$0, $1, etc`), the latter method being incompatible with the [range spread operator](https://github.com/IjzerenHein/autolayout.js#view-ranges-spread-operator). Expressions can be tested and debugged with the online [Visual Format Editor](https://rawgit.com/IjzerenHein/visualformat-editor/master/dist/index.html).
|
||||
- note: this only applies when the panel contains widgets, not tabs
|
||||
|
||||
### `spacing`
|
||||
### `spacing`
|
||||
- type: `integer|array`
|
||||
- default: `0`
|
||||
- usage: spacing size used in `layout` expression, can be set as a `[vertical,horizontal]` array.
|
||||
- note: this only applies when the panel contains widgets, not tabs
|
||||
|
||||
|
||||
### `css`
|
||||
```css
|
||||
--nav-height: number[rem|%];
|
||||
```
|
||||
|
||||
## Strip
|
||||
|
||||
|
|
@ -72,27 +75,27 @@ Unidirectionnal panel with stretching capability. By default, children widgets t
|
|||
}
|
||||
```
|
||||
|
||||
### `horizontal`
|
||||
### `horizontal`
|
||||
- type: `boolean`
|
||||
- default: `false`
|
||||
- usage: set to `true` to display widgets horizontally
|
||||
|
||||
### `stretch`
|
||||
### `stretch`
|
||||
- type: `boolean`
|
||||
- default: `false`
|
||||
- usage: set to `true` to stretch widgets evenly
|
||||
|
||||
### `spacing`
|
||||
- type: `integer`
|
||||
### `spacing`
|
||||
- type: `integer|percentage`
|
||||
- default: `0`
|
||||
- usage: adds space between widgets
|
||||
- usage: adds space between widgets. Percents are always relative to the strips width.
|
||||
|
||||
### `border`
|
||||
### `border`
|
||||
- type: `boolean`
|
||||
- default: `true`
|
||||
- usage: by default, widgets in panels/strip have their border disabled, except for panels and strips. Set to `false` to apply this rule to the strip too.
|
||||
|
||||
### `widgets`
|
||||
### `widgets`
|
||||
- type: `array`
|
||||
- default: `[]`
|
||||
- usage: each element of the `array` must be a widget `object`
|
||||
|
|
@ -111,22 +114,28 @@ Modals are buttons that turn into a centered popup panels when enabled. They can
|
|||
}
|
||||
```
|
||||
|
||||
### `doubleTap`
|
||||
### `doubleTap`
|
||||
- type: `boolean`
|
||||
- default: `false`
|
||||
- usage: set to `true` to make the modal require a double tap to open instead of a single tap
|
||||
|
||||
### `popupWidth` / `popupHeight`
|
||||
### `popupWidth` / `popupHeight`
|
||||
- type: `number|percentage`
|
||||
- default: `100%`
|
||||
- usage: sets the modal's size once opened
|
||||
|
||||
### `popupLabel`
|
||||
### `popupLeft` / `popupTop`
|
||||
- type: `number|percentage`
|
||||
- default: `auto`
|
||||
- usage: sets the modal's position once opened (centered by default)
|
||||
|
||||
|
||||
### `popupLabel`
|
||||
- type: `string`
|
||||
- default: `empty`
|
||||
- usage: alternative label for the popup
|
||||
|
||||
### `options`
|
||||
### `options`
|
||||
- see panel's [`options`](#panel)
|
||||
|
||||
|
||||
|
|
@ -139,12 +148,12 @@ Modals are buttons that turn into a centered popup panels when enabled. They can
|
|||
}
|
||||
```
|
||||
|
||||
### `widgetId`
|
||||
### `widgetId`
|
||||
- type: `string`
|
||||
- default: `empty`
|
||||
- usage: `id` of the widget to clone
|
||||
|
||||
### `props`
|
||||
### `props`
|
||||
- type: `object`
|
||||
- default: `{}`
|
||||
- usage: cloned widget's properties to override
|
||||
|
|
|
|||
|
|
@ -10,22 +10,93 @@
|
|||
}
|
||||
```
|
||||
|
||||
### `widgetId`
|
||||
- type: `object`
|
||||
- default: `empty`
|
||||
- usage: a widget's `id` whose value will be linked to the input
|
||||
|
||||
### `editable`
|
||||
### `editable`
|
||||
- type: `boolean`
|
||||
- default: `true`
|
||||
- usage: set to `false` to make the input non-editable
|
||||
|
||||
### `horizontal`
|
||||
### `horizontal`
|
||||
- type: `boolean`
|
||||
- default: `false`
|
||||
- usage: set to `true` to display the input horizontally
|
||||
|
||||
### `unit`
|
||||
### `align`
|
||||
- type: `string`
|
||||
- default: `''`
|
||||
- usage: set to `left` or `right` to change text alignment (otherwise `center`)
|
||||
|
||||
### `unit`
|
||||
- type: `string`
|
||||
- default: `empty`
|
||||
- usage: `unit` will be appended to the displayed widget's value (it doesn't affect osc messages)
|
||||
|
||||
|
||||
## Keys
|
||||
|
||||
|
||||
```js
|
||||
{
|
||||
type:'keys',
|
||||
// etc
|
||||
}
|
||||
```
|
||||
|
||||
### `binding`
|
||||
- type: `string|array`
|
||||
- default: `''`
|
||||
- usage: [keyboardjs](https://github.com/RobertWHurst/KeyboardJS) key combo string or array of strings.
|
||||
|
||||
### `keydown`
|
||||
- type: `string`
|
||||
- default: `''`
|
||||
- usage: this property is evaluated each time the key combo is pressed. [Formulas](../extras/advanced-property-syntax/#formulas) are given extras variables in this context:
|
||||
- `key`: pressed key name (usefull for handling multiple keys with a single `keys` widget)
|
||||
- `ctrl`: control key state
|
||||
- `alt`: alt key state
|
||||
- `shift`: shift key state
|
||||
- `super`: command/windows key state
|
||||
|
||||
### `keyup`
|
||||
- type: `string`
|
||||
- default: `''`
|
||||
- usage: same as `keydown`, but evaluated when releasing the key combo.
|
||||
|
||||
### `repeat`
|
||||
- type: `boolean`
|
||||
- default: `true`
|
||||
- usage: set to `false` to prevent `keydown` repeats when holding the key combo pressed.
|
||||
|
||||
|
||||
## Script
|
||||
|
||||
|
||||
```js
|
||||
{
|
||||
type:'script',
|
||||
// etc
|
||||
}
|
||||
```
|
||||
|
||||
### `condition`
|
||||
- type: `string`
|
||||
- default: `''`
|
||||
- usage: when the widget receives a value, if this property return a falsy value, the `script` property won't be evaluated. If it's non-falsy, it will be evaluated normally. [Formulas](../extras/advanced-property-syntax/#formulas) are given 1 extra variable in this context:
|
||||
- `value`: the value received by the widget
|
||||
|
||||
### `script`
|
||||
- type: `string`
|
||||
- default: `''`
|
||||
- usage: this property is evaluated each time the widget receives a value if `condition` is non-falsy. [Formulas](../extras/advanced-property-syntax/#formulas) are given extras variables in this context:
|
||||
- `value`: the value received by the widget
|
||||
- `send`: `function` for sending osc messages
|
||||
- `set`: `function` for setting a widget's value
|
||||
|
||||
#### `send(target, address, arg1, arg2, ...)`
|
||||
- `target` (`string` or `array` or `false`): one or several osc targets. Default targets (`--send` and the script's `target` property) are ignored unless `target` is `false`
|
||||
- `address` (`string`): a valid osc address
|
||||
- `arg`: one or several osc arguments to be sent. The script's `preArgs` property is ignored
|
||||
|
||||
|
||||
#### `set(id, value)`
|
||||
- `id` (`string`): a widget's id
|
||||
- `value`: the widget's new value
|
||||
|
|
|
|||
|
|
@ -2,10 +2,11 @@
|
|||
|
||||
Maths do the maths !
|
||||
|
||||
|
||||
|
||||
## Formula
|
||||
|
||||
!!! warning "Deprecated"
|
||||
Since `v0.24.0`, any widget property can be defined using math expressions. Formula widget is deprecated and will be removed in a future release.
|
||||
|
||||
Formula evaluates mathematical expressions over other widgets' values each one of these widgets changes.
|
||||
|
||||
```js
|
||||
|
|
@ -16,7 +17,7 @@ Formula evaluates mathematical expressions over other widgets' values each one o
|
|||
```
|
||||
|
||||
|
||||
### `formula`
|
||||
### `formula`
|
||||
- type: `string`
|
||||
- default: `''`
|
||||
- usage: a [mathjs](http://mathjs.org/docs/expressions/syntax.html) expression in which
|
||||
|
|
@ -24,19 +25,19 @@ Formula evaluates mathematical expressions over other widgets' values each one o
|
|||
- example: `${fader_1} * 2 + ${fader_2}`
|
||||
- **important note**: contrary to what is stated in *mathjs*' documentation, **matrix indexes are zero-based** here
|
||||
|
||||
### `condition`
|
||||
### `condition`
|
||||
- type: `string`
|
||||
- default: `''`
|
||||
- usage:
|
||||
- a [mathjs](http://mathjs.org/docs/expressions/syntax.html) comparison expression that bypasses widget's osc sending when returning`false`
|
||||
- example: `${fader_1} > 0.5`
|
||||
|
||||
### `unit`
|
||||
### `unit`
|
||||
- type: `string`
|
||||
- default: `empty`
|
||||
- usage: `unit` will be appended to the displayed widget's value (it doesn't affect osc messages)
|
||||
|
||||
### `split`
|
||||
### `split`
|
||||
- type: `object`
|
||||
- default: `[]`
|
||||
- usage: specify a different `address` for each item of the widget's value : `['/a', '/b']`
|
||||
|
|
|
|||
|
|
@ -2,6 +2,49 @@
|
|||
|
||||
Matrices are special containers that only contain one type of widget. All contained widgets will be traversed by single dragging gestures.
|
||||
|
||||
!!! note ""
|
||||
When using the [property inheritance syntax](../extras/advanced-property-syntax) to retreive a matrix' value, the returned value is an array containing all it's children's values.
|
||||
|
||||
## Matrix
|
||||
|
||||
Creates grid of widgets of a given type
|
||||
|
||||
```js
|
||||
{
|
||||
type:'matrix',
|
||||
// etc
|
||||
}
|
||||
```
|
||||
|
||||
### `widgetType`
|
||||
- type: `string`
|
||||
- default: `toggle`
|
||||
- usage: set the type of the widgets in the matrix
|
||||
|
||||
|
||||
### `matrix`
|
||||
- type: `array`
|
||||
- default: `[2,2]`
|
||||
- usage: defines the number of columns and and rows in the matrix
|
||||
|
||||
### `start`
|
||||
- type: `integer`
|
||||
- default: `0`
|
||||
- usage: first widget's index
|
||||
|
||||
### `traversing`
|
||||
- type: `boolean`
|
||||
- default: `true`
|
||||
- usage: set to false to disable traversing gestures
|
||||
|
||||
### `props`<i class="dynamic-prop-icon" title="dynamic"></i>
|
||||
- type: `object`
|
||||
- default: `{}`
|
||||
- usage: define a set of property to override the widgets' defaults. [Formulas](../extras/advanced-property-syntax/#formulas) in this field are resolved with an extra variable `$` representing each widget's index
|
||||
|
||||
|
||||
|
||||
|
||||
## Multifader
|
||||
|
||||
Multifader creates a row of vertical faders that respond to the same gestures.
|
||||
|
|
@ -13,35 +56,39 @@ Multifader creates a row of vertical faders that respond to the same gestures.
|
|||
}
|
||||
```
|
||||
|
||||
### `strips`
|
||||
### `strips`
|
||||
- type: `integer`
|
||||
- default: `2`
|
||||
- usage: number of faders in the row, each fader will inherit its parent's properties and the following ones (where `i` is the fader's index in the row)
|
||||
- `id`: same as the widget's with `/i` appended to it
|
||||
- `label`: `i`
|
||||
- `address`: same as the widget's with `/i` appended to it
|
||||
- `address`: see `split`
|
||||
|
||||
### `start`
|
||||
### `start`
|
||||
- type: `integer`
|
||||
- default: `0`
|
||||
- usage: first faders's index
|
||||
|
||||
### `traversing`
|
||||
### `traversing`
|
||||
- type: `boolean`
|
||||
- default: `true`
|
||||
- usage: enable traversing gestures
|
||||
- usage: set to false to disable traversing gestures
|
||||
|
||||
### `split`
|
||||
### `borders`
|
||||
- type: `boolean`
|
||||
- default: `true`
|
||||
- usage: set to false to disable widgets borders
|
||||
|
||||
|
||||
### `split`
|
||||
- type: `boolean|string`
|
||||
- default: `false`
|
||||
- usage: if `true`, the fader's index will be appended to the widget's osc `address`; if `false` it will be prepended to the widget's `preArgs`
|
||||
- usage:
|
||||
- `true`: the widget's index will be appended to the matrice's osc `address`
|
||||
- `false`: it will be prepended to the widget's `preArgs`
|
||||
- `string`: will be used to define the widgets' addresses, replacing dollar signs (`$`) with their respective index (to insert the actual dollar sign, it must be escaped with a backslash (`\$`)).
|
||||
|
||||
### `color`
|
||||
- type: `string|array`
|
||||
- default: `auto`, inherited accent color
|
||||
- usage: can be an `array` of css color `strings`, which will be sequentially passed to the faders
|
||||
|
||||
### `options`
|
||||
### `options`
|
||||
- see fader's [`options`](sliders/#fader)
|
||||
|
||||
|
||||
|
|
@ -56,42 +103,39 @@ Multifader creates a row of vertical faders that respond to the same gestures.
|
|||
}
|
||||
```
|
||||
|
||||
### `matrix`
|
||||
### `matrix`
|
||||
- type: `array`
|
||||
- default: `[2,2]`
|
||||
- usage: defines the number of columns and and rows. Each cell will contain a toggle button that will inherit its parent's properties and the following ones (where `i` is the fader's index in the row)
|
||||
- `id`: same as the widget's with `/i` appended to it
|
||||
- `label`: `i`
|
||||
- `address`: same as the widget's with `/i` appended to it
|
||||
- `address`: see `split`
|
||||
|
||||
### `start`
|
||||
### `start`
|
||||
- type: `integer`
|
||||
- default: `0`
|
||||
- usage: first toggle's index
|
||||
|
||||
### `spacing`
|
||||
### `spacing`
|
||||
- type: `integer`
|
||||
- default: `0`
|
||||
- usage: adds space between widgets
|
||||
|
||||
### `traversing`
|
||||
### `traversing`
|
||||
- type: `boolean`
|
||||
- default: `true`
|
||||
- usage: enable traversing gestures
|
||||
- usage: set to false to disable traversing gestures
|
||||
|
||||
### `split`
|
||||
- type: `boolean`
|
||||
### `split`
|
||||
- type: `boolean|string`
|
||||
- default: `false`
|
||||
- usage: if `true`, the toggle's index will be appended to the widget's osc `address`; if `false` it will be prepended to the widget's `preArgs`
|
||||
|
||||
### `color`
|
||||
- type: `string|array`
|
||||
- default: `auto`, inherited accent color
|
||||
- usage: can be an `array` of css color `strings`, which will be sequentially passed to the toggles
|
||||
- usage:
|
||||
- `true`: the widget's index will be appended to the matrice's osc `address`
|
||||
- `false`: it will be prepended to the widget's `preArgs`
|
||||
- `string`: will be used to define the widgets' addresses, replacing dollar signs (`$`) with their respective index (to insert the actual dollar sign, it must be escaped with a backslash (`\$`)).
|
||||
|
||||
|
||||
|
||||
### `options`
|
||||
### `options`
|
||||
- see toggle's [`options`](buttons/#toggle)
|
||||
|
||||
|
||||
|
|
@ -104,47 +148,45 @@ Multifader creates a row of vertical faders that respond to the same gestures.
|
|||
}
|
||||
```
|
||||
|
||||
### `matrix`
|
||||
### `matrix`
|
||||
- type: `array`
|
||||
- default: `[2,2]`
|
||||
- usage: defines the number of columns and and rows. Each cell will contain a push button that will inherit its parent's properties and the following ones (where `i` is the fader's index in the row)
|
||||
- `id`: same as the widget's with `/i` appended to it
|
||||
- `label`: `i`
|
||||
- `address`: same as the widget's with `/i` appended to it
|
||||
- `address`: see `split`
|
||||
|
||||
### `start`
|
||||
### `start`
|
||||
- type: `integer`
|
||||
- default: `0`
|
||||
- usage: first push's index
|
||||
|
||||
### `spacing`
|
||||
### `spacing`
|
||||
- type: `integer`
|
||||
- default: `0`
|
||||
- usage: adds space between widgets
|
||||
|
||||
### `traversing`
|
||||
### `traversing`
|
||||
- type: `boolean`
|
||||
- default: `true`
|
||||
- usage: enable traversing gestures
|
||||
- usage: set to false to disable traversing gestures
|
||||
|
||||
### `split`
|
||||
- type: `boolean`
|
||||
### `split`
|
||||
- type: `boolean|string`
|
||||
- default: `false`
|
||||
- usage: if `true`, the push's index will be appended to the widget's osc `address`; if `false` it will be prepended to the widget's `preArgs`
|
||||
- usage:
|
||||
- `true`: the widget's index will be appended to the matrice's osc `address`
|
||||
- `false`: it will be prepended to the widget's `preArgs`
|
||||
- `string`: will be used to define the widgets' addresses, replacing dollar signs (`$`) with their respective index (to insert the actual dollar sign, it must be escaped with a backslash (`\$`)).
|
||||
|
||||
### `color`
|
||||
- type: `string|array`
|
||||
- default: `auto`, inherited accent color
|
||||
- usage: can be an `array` of css color `strings`, which will be sequentially passed to the pushes
|
||||
|
||||
### `options`
|
||||
### `options`
|
||||
- see push's [`options`](buttons/#push)
|
||||
|
||||
|
||||
|
||||
## Keyboard
|
||||
|
||||
This one works pretty much like the multipush, excepts it looks like a piano keyboard ad
|
||||
This one works pretty much like the multipush, excepts it looks like a piano keyboard.
|
||||
|
||||
```js
|
||||
{
|
||||
|
|
@ -153,32 +195,42 @@ This one works pretty much like the multipush, excepts it looks like a piano key
|
|||
}
|
||||
```
|
||||
|
||||
### `keys`
|
||||
### `keys`
|
||||
- type: `integer`
|
||||
- default: `24`
|
||||
- usage: defines the number keys
|
||||
|
||||
### `start`
|
||||
### `start`
|
||||
- type: `integer`
|
||||
- default: `60`
|
||||
- usage: MIDI note number to start with (default is C4)
|
||||
|
||||
!!! note ""
|
||||
Standard keyboards settings are:
|
||||
25 keys - start 48
|
||||
49 keys - start 36
|
||||
61 keys - start 36
|
||||
88 keys - start 21
|
||||
|
||||
### `traversing`
|
||||
|
||||
### `traversing`
|
||||
- type: `boolean`
|
||||
- default: `true`
|
||||
- usage: enable traversing gestures
|
||||
- usage: set to false to disable traversing gestures
|
||||
|
||||
### `split`
|
||||
- type: `boolean`
|
||||
### `split`
|
||||
- type: `boolean|string`
|
||||
- default: `false`
|
||||
- usage: if `true`, the note's midi code will be appended to the widget's osc `address`; if `false` it will be prepended to the widget's `preArgs`
|
||||
- usage:
|
||||
- `true`: the widget's index will be appended to the matrice's osc `address`
|
||||
- `false`: it will be prepended to the widget's `preArgs`
|
||||
- `string`: will be used to define the widgets' addresses, replacing dollar signs (`$`) with their respective index (to insert the actual dollar sign, it must be escaped with a backslash (`\$`)).
|
||||
|
||||
### `options`
|
||||
### `options`
|
||||
- see push's [`options`](buttons/#push)
|
||||
|
||||
### `css`
|
||||
```
|
||||
```css
|
||||
--color-white:color; /* white keys color */
|
||||
--color-black:color; /* black keys color */
|
||||
```
|
||||
|
|
|
|||
|
|
@ -13,35 +13,35 @@ Pads are multidimensional widgets that output multiple values.
|
|||
}
|
||||
```
|
||||
|
||||
### `input`
|
||||
### `input`
|
||||
- type: `boolean`
|
||||
- default: `true`
|
||||
- usage: set to `false` to hide the built-in input
|
||||
|
||||
### `rangeX`
|
||||
### `rangeX`
|
||||
- type: `object`
|
||||
- default:
|
||||
`{"min":0,"max":1}`
|
||||
- usage: defines the `min` and `max` values for the `x` axis. Same as fader's [`range`](sliders/#fader)
|
||||
|
||||
### `rangeY`
|
||||
### `rangeY`
|
||||
- type: `object`
|
||||
- default:
|
||||
`{"min":0,"max":1}`
|
||||
- usage: defines the `min` and `max` values for the `y` axis. Same as fader's [`range`](sliders/#fader)
|
||||
|
||||
|
||||
### `logScaleX`
|
||||
### `logScaleX`
|
||||
- type: `boolean`
|
||||
- default: `false`
|
||||
- usage: set to `true` to use logarithmic scale for the `x` axis (log10)
|
||||
|
||||
### `logScaleY`
|
||||
### `logScaleY`
|
||||
- type: `boolean`
|
||||
- default: `false`
|
||||
- usage: set to `true` to use logarithmic scale for the `y` axis (log10)
|
||||
|
||||
### `snap`
|
||||
### `snap`
|
||||
- type: `boolean`
|
||||
- default: `false`
|
||||
- usage: by default, dragging the widget will modify it's value starting from its last value. Setting this to `true` will make it snap directly to the mouse/touch position.
|
||||
|
|
@ -49,14 +49,15 @@ Pads are multidimensional widgets that output multiple values.
|
|||
### `spring`
|
||||
- type: `boolean`
|
||||
- default: `false`
|
||||
- usage: when set to `true`, the widget will go back to its initial value when released.
|
||||
- usage: when set to `true`, the widget will go back to its `default` value when released.
|
||||
|
||||
### `doubleTap`
|
||||
- type: `boolean`
|
||||
### `doubleTap`
|
||||
- type: `boolean|string`
|
||||
- default: `false`
|
||||
- usage: set to `true` to make the xy reset to its initial value when receiving a double tap
|
||||
- usage: set to `true` to make the fader reset to its `default` value when receiving a double tap. `doubleTap` can also be an osc address, which case the widget will just send an osc message (`/<doubleTap> <preArgs>`),
|
||||
|
||||
### `split`
|
||||
|
||||
### `split`
|
||||
- type: `boolean|object`
|
||||
- default: `false`
|
||||
- usage:
|
||||
|
|
@ -75,7 +76,7 @@ Pads are multidimensional widgets that output multiple values.
|
|||
}
|
||||
```
|
||||
|
||||
### `points`
|
||||
### `points`
|
||||
- type: `integer|array`
|
||||
- default: `2`
|
||||
- usage: defines the number of points on the pad. Can be an `array` of `strings` that will be used as labels for the points (ex: `['A', 'B']`)
|
||||
|
|
@ -85,30 +86,30 @@ Pads are multidimensional widgets that output multiple values.
|
|||
- default: `15`
|
||||
- usage: defines the points's size
|
||||
|
||||
### `rangeX`
|
||||
### `rangeX`
|
||||
- type: `object`
|
||||
- default:
|
||||
`{"min":0,"max":1}`
|
||||
- usage: defines the `min` and `max` values for the `x` axis. Same as fader's [`range`](sliders/#fader)
|
||||
|
||||
### `rangeY`
|
||||
### `rangeY`
|
||||
- type: `object`
|
||||
- default:
|
||||
`{"min":0,"max":1}`
|
||||
- usage: defines the `min` and `max` values for the `y` axis. Same as fader's [`range`](sliders/#fader)
|
||||
|
||||
|
||||
### `logScaleX`
|
||||
### `logScaleX`
|
||||
- type: `boolean`
|
||||
- default: `false`
|
||||
- usage: set to `true` to use logarithmic scale for the `x` axis (log10)
|
||||
|
||||
### `logScaleY`
|
||||
### `logScaleY`
|
||||
- type: `boolean`
|
||||
- default: `false`
|
||||
- usage: set to `true` to use logarithmic scale for the `y` axis (log10)
|
||||
|
||||
### `split`
|
||||
### `split`
|
||||
- type: `boolean|object`
|
||||
- default: `false`
|
||||
- usage:
|
||||
|
|
@ -116,7 +117,7 @@ Pads are multidimensional widgets that output multiple values.
|
|||
- can be set as an object to specify a different `address` : `['/0/x', '/0/y', '/1/x', '/2/y']`
|
||||
- note: the widget will only respond to its original osc address, not to the splitted version
|
||||
|
||||
### `snap`
|
||||
### `snap`
|
||||
- type: `boolean`
|
||||
- default: `false`
|
||||
- usage: by default, the points are dragged from their initial position; if set to `true`, touching anywhere on the widget's surface will make them snap to the touching coordinates (one per touch).
|
||||
|
|
@ -135,22 +136,28 @@ RGB is a variant of XY, it outputs rgb values between 0 and 255.
|
|||
}
|
||||
```
|
||||
|
||||
### `input`
|
||||
### `input`
|
||||
- type: `boolean`
|
||||
- default: `true`
|
||||
- usage: set to `false` to hide the built-in input
|
||||
|
||||
### `precision`
|
||||
### `precision`
|
||||
- default:`0`
|
||||
|
||||
### `snap`
|
||||
### `snap`
|
||||
- type: `boolean`
|
||||
- default: `false`
|
||||
- usage: by default, dragging the widget will modify it's value starting from its last value. Setting this to true will make it snap directly to the mouse/touch position.
|
||||
|
||||
### `split`
|
||||
### `range`
|
||||
- type: `object`
|
||||
- default: `{"min":0,"max":255}`
|
||||
- usage: `range` defines the widget's output scale.
|
||||
|
||||
### `split`
|
||||
- type: `boolean|object`
|
||||
- default: `false`
|
||||
- usage:
|
||||
- set to `true` to send separate osc messages for `r` and `g` & `b`. The `address` will be the same as the widget's with `/r`, `/g` or `/b` appended to it
|
||||
- can be set as an object to specify a different `address` : `['/r', '/b', '/b']`
|
||||
- note: the widget will only respond to its original osc address, not to the splitted version
|
||||
|
|
|
|||
|
|
@ -10,17 +10,12 @@ Plots are tools that display other widgets' state or incomming osc messages. The
|
|||
}
|
||||
```
|
||||
|
||||
### `widgetId`
|
||||
- type: `string`
|
||||
- default: `empty`
|
||||
- usage: a widget's `id` whose value will be mapped to the led's color opacity
|
||||
|
||||
### `range`
|
||||
### `range`
|
||||
- type: `object`
|
||||
- default: `{"min":0,"max":1}`
|
||||
- usage: defines the `min` and `max` value the led's intensity will be mapped to
|
||||
|
||||
### `logScale`
|
||||
### `logScale`
|
||||
- type: `boolean`
|
||||
- default: `false`
|
||||
- usage: set to true to use logarithmic scaling
|
||||
|
|
@ -38,7 +33,12 @@ This one is like the `led` except it takes either three arguments (red, green an
|
|||
|
||||
## Plot
|
||||
|
||||
The plot receives an array of [x,y] coordinates and draws them on a chart with linear or logarithmic interpolation.
|
||||
The plot receives an array of coordinates and draws them on a chart. Coordinates can be :
|
||||
- `y` values evenly spaced on the `x` axis
|
||||
- `[x, y]` coordinates arrays
|
||||
|
||||
!!! info
|
||||
Coordinates also can be sent as a stringified array (`[]`). A stringified object can also be sent to change specific points' coordinates (e.g. `{0:1, 4:0}` will change the 1st and 5th points' coordinates) .
|
||||
|
||||
```js
|
||||
{
|
||||
|
|
@ -47,16 +47,16 @@ The plot receives an array of [x,y] coordinates and draws them on a chart with
|
|||
}
|
||||
```
|
||||
|
||||
### `points`
|
||||
### `value`
|
||||
- type: `array|string`
|
||||
- default: `[]`
|
||||
- default: `['']`
|
||||
- usage:
|
||||
- as a `string`: a widget's `id` whose multiple values will be displayed on the `y` axis, evenly spaced on the `x` axis (only *[matrices](matrices.md)* and *[pads](pads.md)* will work)
|
||||
- as an `array`: each element must be an `array` of `[x,y]` coordinates, where `x` and `y` can either be a:
|
||||
- `number`: constant values
|
||||
- `string`: a widget's `id` whose value will be used
|
||||
- as an `array`: where items can be
|
||||
- `number`
|
||||
- `string` (widget's `id`)
|
||||
- `[x, y]`: array of `number` or `string`
|
||||
|
||||
### `range`
|
||||
### `range`
|
||||
- type: `object`
|
||||
- default:
|
||||
`{
|
||||
|
|
@ -65,20 +65,25 @@ The plot receives an array of [x,y] coordinates and draws them on a chart with
|
|||
}`
|
||||
- usage: defines the `min` and `max` values for the `x` and `y` axis
|
||||
|
||||
### `logScaleX`
|
||||
### `bars`
|
||||
- type: `boolean`
|
||||
- default: `false`
|
||||
- usage: set to `true` to use draw bars instead (disables `logScaleX` and forces `x-axis` even spacing)
|
||||
|
||||
### `logScaleX`
|
||||
- type: `boolean`
|
||||
- default: `false`
|
||||
- usage: set to `true` to use logarithmic scale for the `x` axis (log10)
|
||||
|
||||
### `logScaleY`
|
||||
### `logScaleY`
|
||||
- type: `boolean`
|
||||
- default: `false`
|
||||
- usage: set to `true` to use logarithmic scale for the `y` axis (log10)
|
||||
|
||||
### `smooth`
|
||||
### `smooth`
|
||||
- type: `boolean`
|
||||
- default: `false`
|
||||
- usage: set to true to make the line smooth. Float values are also acceptable (works fine between 0 and 0.5)
|
||||
- usage: set to `true` to make the line smooth. Float values are also acceptable (works fine between 0 and 0.5)
|
||||
|
||||
### `origin`
|
||||
- type: `number`
|
||||
|
|
@ -96,7 +101,7 @@ The Eq receives an array of filter objects and draws their frequency response be
|
|||
}
|
||||
```
|
||||
|
||||
### `filters`
|
||||
### `value`
|
||||
- type: `array`
|
||||
- default: `[]`
|
||||
- usage:
|
||||
|
|
@ -118,18 +123,18 @@ The Eq receives an array of filter objects and draws their frequency response be
|
|||
- default: `128`
|
||||
- usage: defines the number of points used to compute the frequency response
|
||||
|
||||
### `rangeY`
|
||||
### `rangeY`
|
||||
- type: `object`
|
||||
- default:
|
||||
`{"min":-20,"max":20}`
|
||||
- usage: defines the `min` and `max` values for the `y` axis (dB level)
|
||||
|
||||
### `logScaleX`
|
||||
### `logScaleX`
|
||||
- type: `boolean`
|
||||
- default: `false`
|
||||
- usage: set to `true` to use logarithmic scale for the `x` axis (log10)
|
||||
|
||||
### `smooth`
|
||||
### `smooth`
|
||||
- type: `boolean`
|
||||
- default: `false`
|
||||
- usage: set to true to make the line smooth. Float values are also acceptable (works fine between 0 and 0.5)
|
||||
|
|
@ -150,27 +155,22 @@ The visualizer displays the evolution in time of a received value (through osc)
|
|||
}
|
||||
```
|
||||
|
||||
### `widgetId`
|
||||
- type: `string`
|
||||
- default: `empty`
|
||||
- usage: a widget's `id` whose value will be displayed (thus bypassing the incoming osc)
|
||||
|
||||
### `duration`
|
||||
### `duration`
|
||||
- type: `number`
|
||||
- default: `1`
|
||||
- usage: window size in seconds
|
||||
|
||||
### `range`
|
||||
### `range`
|
||||
- type: `object`
|
||||
- default: `{"min":0,"max":1}`
|
||||
- usage: defines the `min` and `max` values for the `y` axis
|
||||
|
||||
### `logScale`
|
||||
### `logScale`
|
||||
- type: `boolean`
|
||||
- default: `false`
|
||||
- usage: set to `true` use logarithmic scaling (log10)
|
||||
|
||||
### `smooth`
|
||||
### `smooth`
|
||||
- type: `boolean`
|
||||
- default: `false`
|
||||
- usage: set to true to make the line smooth. Float values are also acceptable (works fine between 0 and 0.5)
|
||||
|
|
@ -191,16 +191,21 @@ Text displays incoming values (via osc) as text. Sending a message with no argum
|
|||
}
|
||||
```
|
||||
|
||||
### `widgetId`
|
||||
- type: `string`
|
||||
- default: `empty`
|
||||
- usage: a widget's `id` whose value will be displayed
|
||||
|
||||
### `vertical`
|
||||
### `vertical`
|
||||
- type: `boolean`
|
||||
- default: `false`
|
||||
- usage: set to `true` display vertically
|
||||
|
||||
### `wrap`
|
||||
- type: `boolean`
|
||||
- default: `false`
|
||||
- usage: set to `true` to wrap long lines automatically. This will not break overflowing words by default, word-breaking can be enabled by adding `word-break: break-all;` to the `css` property.
|
||||
|
||||
### `align`
|
||||
- type: `string`
|
||||
- default: `''`
|
||||
- usage: set to `left` or `right` to change text alignment (otherwise `center`)
|
||||
|
||||
## Meter
|
||||
|
||||
Meter displays incoming numerical values (via osc) as a gauge level
|
||||
|
|
@ -212,18 +217,94 @@ Meter displays incoming numerical values (via osc) as a gauge level
|
|||
}
|
||||
```
|
||||
|
||||
### `widgetId`
|
||||
- type: `object`
|
||||
- default: `empty`
|
||||
- usage: a widget's `id` whose value will be displayed
|
||||
|
||||
### `horizontal`
|
||||
### `horizontal`
|
||||
- type: `boolean`
|
||||
- default: `false`
|
||||
- usage: set to `true` to display the meter horizontally
|
||||
|
||||
### `range`
|
||||
### `range`
|
||||
- see fader's [`range`](sliders/#fader)
|
||||
|
||||
### `logScale`
|
||||
### `logScale`
|
||||
- see fader's [`logScale`](sliders/#fader)
|
||||
|
||||
### `gradient`
|
||||
- type: `array`
|
||||
- default: `[]`
|
||||
- usage: when set, the meter's gauge will be filled with a linear color gradient : each item must be a color string. Example: `["blue", "red"]`
|
||||
|
||||
### `css`
|
||||
```css
|
||||
--color-gauge:color;
|
||||
--color-knob:color; /* transparent by default */
|
||||
--color-pips:color;
|
||||
--gauge-opacity:number;
|
||||
```
|
||||
|
||||
## Image
|
||||
|
||||
Image displays an image from a file path/url or from a base64 encoded image string. Sending an empty message resets the widget to its initial `value`.
|
||||
|
||||
```js
|
||||
{
|
||||
type:'image',
|
||||
// etc
|
||||
}
|
||||
```
|
||||
|
||||
### `size`
|
||||
- type: `string`
|
||||
- default: `cover`
|
||||
- usage: css [background-size](https://www.w3schools.com/CSSref/css3_pr_background-size.asp)
|
||||
|
||||
|
||||
### `position`
|
||||
- type: `string`
|
||||
- default: `cover`
|
||||
- usage: css [background-position](https://www.w3schools.com/CSSref/pr_background-position.asp)
|
||||
|
||||
|
||||
### `repeat`
|
||||
- type: `string`
|
||||
- default: `no-repeat`
|
||||
- usage: css [background-repeat](https://www.w3schools.com/CSSref/pr_background-repeat.asp)
|
||||
|
||||
|
||||
### `border`
|
||||
- type: `boolean`
|
||||
- default: `false`
|
||||
- usage: set to `true` to disable the image's borders and background-color.
|
||||
|
||||
### `cache`
|
||||
- type: `boolean`
|
||||
- default: `true`
|
||||
- usage: set to `false` to disable image caching (forces file reload when updating or editing the widget). When `true`, sending `'reload'` to the widget reloads its image without changing its value.
|
||||
|
||||
### `value`
|
||||
- type: `string`
|
||||
- default: `''`
|
||||
- usage : initial image
|
||||
- file url or absolute path
|
||||
- [base64 encoded image](https://duckduckgo.com/?q=base64+encode+image&ia=web) : `data:image/...`
|
||||
|
||||
|
||||
## Svg
|
||||
|
||||
```js
|
||||
{
|
||||
type:'svg',
|
||||
// etc
|
||||
}
|
||||
```
|
||||
|
||||
### `svg`
|
||||
- type: `string`
|
||||
- default: `''`
|
||||
- usage : svg xml definition
|
||||
- will be wrapped in a `<svg></svg>` element
|
||||
- `<path>` commands support a special percent notation (`%x` and `%y`)
|
||||
|
||||
|
||||
!!! tip ""
|
||||
An exemple session called `svg.json` is shipped with the app.
|
||||
|
|
|
|||
|
|
@ -12,37 +12,37 @@ Sliders are unidimensional widgets that output one value at a time.
|
|||
}
|
||||
```
|
||||
|
||||
### `horizontal`
|
||||
### `horizontal`
|
||||
- type: `boolean`
|
||||
- default: `false`
|
||||
- usage: set to `true` to display the fader horizontally
|
||||
|
||||
### `alignRight`
|
||||
### `alignRight`
|
||||
- type: `boolean`
|
||||
- default: `false`
|
||||
- usage: set to `true` to invert the pip's and fader's position
|
||||
|
||||
### `pips`
|
||||
### `pips`
|
||||
- type: `boolean`
|
||||
- default: `true`
|
||||
- usage: set to `false` to hide the scale
|
||||
|
||||
### `input`
|
||||
### `input`
|
||||
- type: `boolean`
|
||||
- default: `true`
|
||||
- usage: set to `false` to hide the built-in input
|
||||
|
||||
### `compact`
|
||||
### `compact`
|
||||
- type: `boolean`
|
||||
- default: `false`
|
||||
- usage: set to `true` to display a compact alternative for the widget. Disables default mouse/touch focusing on the value display (right-click/long-touch still triggers it).
|
||||
- usage: set to `true` to display a compact alternative for the widget. Disables default mouse/touch focusing on the value display.
|
||||
|
||||
### `dashed`
|
||||
### `dashed`
|
||||
- type: `boolean`
|
||||
- default: `false`
|
||||
- usage: set to `true` to display a dashed gauge
|
||||
|
||||
### `range`
|
||||
### `range`
|
||||
- type: `object`
|
||||
- default: `{"min":0,"max":1}`
|
||||
- usage: `range` defines the breakpoints of the fader's scale
|
||||
|
|
@ -62,19 +62,19 @@ range: {
|
|||
- default: `auto`
|
||||
- usage: `origin` defines the starting point's value of the fader's gauge
|
||||
|
||||
### `logScale`
|
||||
### `logScale`
|
||||
- type: `boolean`
|
||||
- default: `false`
|
||||
- usage: set to `true` use logarithmic scaling between breakpoints (log10)
|
||||
|
||||
|
||||
### `unit`
|
||||
### `unit`
|
||||
- type: `string`
|
||||
- default: `empty`
|
||||
- usage: `unit` will be appended to the displayed widget's value (it doesn't affect osc messages)
|
||||
|
||||
|
||||
### `snap`
|
||||
### `snap`
|
||||
- type: `boolean`
|
||||
- default: `false`
|
||||
- usage: by default, dragging the widget will modify it's value starting from its last value. Setting this to `true` will make it snap directly to the mouse/touch position.
|
||||
|
|
@ -82,31 +82,32 @@ range: {
|
|||
### `spring`
|
||||
- type: `boolean`
|
||||
- default: `false`
|
||||
- usage: when set to `true`, the widget will go back to its initial value when released.
|
||||
- usage: when set to `true`, the widget will go back to its `default` value when released.
|
||||
|
||||
|
||||
### `doubleTap`
|
||||
- type: `boolean`
|
||||
### `doubleTap`
|
||||
- type: `boolean|string`
|
||||
- default: `false`
|
||||
- usage: set to `true` to make the fader reset to its initial value when receiving a double tap
|
||||
- usage: set to `true` to make the fader reset to its `default` value when receiving a double tap. `doubleTap` can also be an osc address, which case the widget will just send an osc message (`/<doubleTap> <preArgs>`),
|
||||
|
||||
### `meter`
|
||||
### `meter`
|
||||
- type: `boolean`
|
||||
- default: `false`
|
||||
- usage: set to true to display a vu-meter next in the fader
|
||||
- the meter's `id` will be the same as the widget's with `/meter` appended to it
|
||||
- the meter's `address `will be the same as the widget's with `/meter` appended to it
|
||||
|
||||
### `meterAddress`
|
||||
### `meterAddress`
|
||||
- type: `boolean`
|
||||
- default: `empty`
|
||||
- usage: overrides the `meter`'s osc address
|
||||
|
||||
### `css`
|
||||
```
|
||||
```css
|
||||
--color-gauge:color;
|
||||
--color-knob:color;
|
||||
--color-pips:color;
|
||||
--gauge-opacity:number; /* compact mode only */
|
||||
```
|
||||
|
||||
|
||||
|
|
@ -121,27 +122,22 @@ range: {
|
|||
```
|
||||
|
||||
|
||||
### `pips`
|
||||
### `pips`
|
||||
- type: `boolean`
|
||||
- default: `true`
|
||||
- usage: set to `false` to hide the scale
|
||||
|
||||
### `input`
|
||||
### `input`
|
||||
- type: `boolean`
|
||||
- default: `true`
|
||||
- usage: set to `false` to hide the built-in input
|
||||
|
||||
### `compact`
|
||||
- type: `boolean`
|
||||
- default: `false`
|
||||
- usage: set to `true` to display a compact alternative for the widget. Disables default mouse/touch focusing on the value display (right-click/long-touch still triggers it).
|
||||
|
||||
### `angle`
|
||||
- type: `number`
|
||||
- default: `270`
|
||||
- usage: `angle` defines the angle's width of the knob, in degrees
|
||||
|
||||
### `range`
|
||||
### `range`
|
||||
- type: `object`
|
||||
- default: `{"min":0,"max":1}`
|
||||
- usage: `range` defines the breakpoints of the fader's scale
|
||||
|
|
@ -161,19 +157,19 @@ range: {
|
|||
- default: `auto`
|
||||
- usage: `origin` defines the starting point's value of the knob's gauge
|
||||
|
||||
### `logScale`
|
||||
### `logScale`
|
||||
- type: `boolean`
|
||||
- default: `false`
|
||||
- usage: set to `true` use logarithmic scaling between breakpoints
|
||||
|
||||
|
||||
### `unit`
|
||||
### `unit`
|
||||
- type: `string`
|
||||
- default: `empty`
|
||||
- usage: `unit` will be appended to the displayed widget's value (it doesn't affect osc messages)
|
||||
|
||||
|
||||
### `snap`
|
||||
### `snap`
|
||||
- type: `boolean`
|
||||
- default: `false`
|
||||
- usage: by default, dragging the widget *vertically* will modify it's value starting from its last value. Setting this to `true` will make it snap directly to the mouse/touch position.
|
||||
|
|
@ -181,12 +177,12 @@ range: {
|
|||
### `spring`
|
||||
- type: `boolean`
|
||||
- default: `false`
|
||||
- usage: when set to `true`, the widget will go back to its initial value when released.
|
||||
- usage: when set to `true`, the widget will go back to its `default` value when released.
|
||||
|
||||
### `doubleTap`
|
||||
### `doubleTap`
|
||||
- type: `boolean`
|
||||
- default: `false`
|
||||
- usage: set to `true` to make the knob reset to its initial value when receiving a double tap
|
||||
- usage: set to `true` to make the knob reset to its `default` value when receiving a double tap
|
||||
|
||||
### `css`
|
||||
```
|
||||
|
|
@ -231,12 +227,12 @@ An endless knob that only responds to rotative gestures.
|
|||
- can be an `object` if the type needs to be specified (see [preArgs](./widgets.md#preargs))
|
||||
|
||||
|
||||
### `snap`
|
||||
### `snap`
|
||||
- type: `boolean`
|
||||
- default: `false`
|
||||
- usage: by default, dragging the widget will modify it's value starting from its last value. Setting this to `true` will make it snap directly to the mouse/touch position.
|
||||
|
||||
### `doubleTap`
|
||||
### `doubleTap`
|
||||
- type: `boolean`
|
||||
- default: `false`
|
||||
- usage: set to `true` to make the encoder reset to its initial value when receiving a double tap
|
||||
|
|
@ -245,3 +241,32 @@ An endless knob that only responds to rotative gestures.
|
|||
```
|
||||
--color-knob:color;
|
||||
```
|
||||
|
||||
|
||||
## Range
|
||||
|
||||
A range is a fader with two handles. To move the range (both handles at once), hold the `shift` key or use two fingers.
|
||||
|
||||
```js
|
||||
{
|
||||
type:'range',
|
||||
// etc
|
||||
}
|
||||
```
|
||||
|
||||
### `split`
|
||||
- type: `boolean|object`
|
||||
- default: `false`
|
||||
- usage:
|
||||
- set to `true` to send separate osc messages for `low` and `high` handles. The `address` will be the same as the widget's with `/low` or `/high` appended to it
|
||||
- can be set as an object to specify a different `address` : `['/osc_address_low', '/osc_address_high']`
|
||||
- note: the widget will only respond to its original osc address, not to the splitted version
|
||||
|
||||
|
||||
### `css`
|
||||
```css
|
||||
--color-gauge:color;
|
||||
--color-knob:color;
|
||||
--color-pips:color;
|
||||
--gauge-opacity:number; /* compact mode only */
|
||||
```
|
||||
|
|
|
|||
|
|
@ -16,7 +16,7 @@ The switcher looks like the [`switch`](buttons/#switch). Each of its possible va
|
|||
}
|
||||
```
|
||||
|
||||
### `linkedWidgets`
|
||||
### `linkedWidgets`
|
||||
- type: `array|string`
|
||||
- default:
|
||||
`empty`
|
||||
|
|
@ -25,7 +25,7 @@ The switcher looks like the [`switch`](buttons/#switch). Each of its possible va
|
|||
- as an `array`: a list of widget `id` `strings`
|
||||
|
||||
|
||||
### `values`
|
||||
### `values`
|
||||
- type: `array|object`
|
||||
- default: `["A", "B"]`
|
||||
- usage:
|
||||
|
|
|
|||
|
|
@ -4,31 +4,33 @@ All widgets share a set of generic properties described below.
|
|||
|
||||
## Basics
|
||||
|
||||
### `type`
|
||||
### `type`
|
||||
- type: `string`
|
||||
- default: `fader`
|
||||
|
||||
### `id`
|
||||
### `id`
|
||||
- type: `string`
|
||||
- default: generated unique 'widget_n'
|
||||
- usage: widgets sharing the same `id` will act as clones and update each other's value(s) without sending extra osc messages.
|
||||
|
||||
### `linkId`
|
||||
- type: `string`
|
||||
### `linkId`
|
||||
- type: `string|array`
|
||||
- default: `empty`
|
||||
- usage: widgets sharing the same `linkId` update each other's value(s) AND send their respective osc messages.
|
||||
|
||||
- usage:
|
||||
- widgets sharing the same `linkId` update each other's value(s) AND send their respective osc messages.
|
||||
- when prefixed with `>>`, the linkId will make the widget act as a master (sending but not receiving)
|
||||
- when prefixed with `<<`, the linkId will make the widget act as a slave (receiving but not sending)
|
||||
|
||||
## Style
|
||||
|
||||
### `label`
|
||||
### `label`<i class="dynamic-prop-icon" title="dynamic"></i>
|
||||
- type: `string|false`
|
||||
- default: `auto`, which displays `id`
|
||||
- usage:
|
||||
- set to `false` to hide completely
|
||||
- insert icons from [FontAwesome](http://fontawesome.io/icons/) using the prefix `^` followed by the icon's name : `made with ^heart`, etc
|
||||
- insert icons from [FontAwesome](https://fontawesome.com/icons?d=gallery&s=solid&m=free) using the prefix `^` followed by the icon's name : `made with ^heart`, etc
|
||||
|
||||
### `top` / `left`
|
||||
### `top`<i class="dynamic-prop-icon" title="dynamic"></i> / `left`<i class="dynamic-prop-icon" title="dynamic"></i>
|
||||
- type: `number|percentage`
|
||||
- default: `auto`
|
||||
- usage:
|
||||
|
|
@ -36,53 +38,61 @@ All widgets share a set of generic properties described below.
|
|||
- otherwise, the widget will be absolutely positioned
|
||||
|
||||
|
||||
### `width` / `height`
|
||||
### `width`<i class="dynamic-prop-icon" title="dynamic"></i> / `height`<i class="dynamic-prop-icon" title="dynamic"></i>
|
||||
- type: `number|percentage`
|
||||
- default: `auto`
|
||||
|
||||
### `color`
|
||||
### `color`<i class="dynamic-prop-icon" title="dynamic"></i>
|
||||
- type: `string`
|
||||
- default: `auto`, inherited accent color
|
||||
- usage: any valid `css` color code is valid, this will change the default accent color for the widget and all its children
|
||||
|
||||
|
||||
### `css`
|
||||
### `css`<i class="dynamic-prop-icon" title="dynamic"></i>
|
||||
- type: `string`
|
||||
- default: *empty*
|
||||
- usage: the `css` property can be used to override inherited [theming](../extras/theming.md) variables. Also, some widgets expose specific theming variables that allow a finer customization. Standard `css` properties can be applied to the widget's root element through this property, `css` selectors can also be used apply custom styles to the widget's children.
|
||||
- examples:
|
||||
- `border-radius:5rem; .label {font-size: 20rem}` will round the widget's corners and increase its label's font-size and all its children's labels'
|
||||
- `border-radius:5rem; > .label {font-size: 20rem}` will round the widget's corners and increase its label's font-size (the `>` selector targets only the direct children of the widget element)
|
||||
- usage: applies CSS rules to widget. See [css tips](../extras/css-tips.md).
|
||||
|
||||
## Value
|
||||
|
||||
### `default`
|
||||
- type: `*`
|
||||
- default: `empty`
|
||||
- usage: if set, the widget will be initialized with this `value` when the session is loaded. Some widgets use this property under specific conditions (see fader's `doubleTap` for example).
|
||||
|
||||
|
||||
### `value`<i class="dynamic-prop-icon" title="dynamic"></i>
|
||||
- type: `*`
|
||||
- default: `empty`
|
||||
- usage: set `value` to define a widget's value depending on other widget's values / properties using [property inheritance and property maths](../extras/advanced-property-syntax.md). When updated by an osc-sending event (e.g. dragging a slider), the widget will send its own osc message as well.
|
||||
|
||||
!!! note ""
|
||||
`default` and `value` must match the widget's value type (ie a `number` for sliders, an `array` for pads, etc) and restrictions (equal to `on` or `off` for a push/toggle button)
|
||||
|
||||
|
||||
## OSC
|
||||
|
||||
|
||||
### `value`
|
||||
- type: `*`
|
||||
- default: `empty`
|
||||
- usage: if set, the widget will be initialized with this `value`. This won't affect linked widgets and won't send any osc message.
|
||||
- note: its `type` must match the widget's value type (ie a `number` for sliders, an `array` for pads, etc).
|
||||
|
||||
|
||||
### `precision`
|
||||
- type: `integer`
|
||||
### `precision`<i class="dynamic-prop-icon" title="dynamic"></i>
|
||||
- type: `integer|string`
|
||||
- default: `2`
|
||||
- usage: the `precision` property defines the number of decimals to display and to send. Set to `0` to send `integers` only.
|
||||
- usage: the `precision` property defines the number of decimals to display and to send.
|
||||
- set to `0` to send `integers` only.
|
||||
- a specific data type can be specified by appending a valid osc type tag to the precision value, for example : `3d` will make the widget send double precision numbers rounded to three decimals
|
||||
|
||||
### `target`
|
||||
- type: `array`
|
||||
### `target`<i class="dynamic-prop-icon" title="dynamic"></i>
|
||||
- type: `array|string`
|
||||
- default: `[]`
|
||||
- usage:
|
||||
- this defines the targets of the widget's osc messages
|
||||
- each element of the `array` must be a string formatted as follows : `"ip:port"`
|
||||
- multiple targets can be specified : `["ip1:port1","ip2:port2"]`
|
||||
- a single target can be set : `ip:port`
|
||||
- if [`midi`](../extras/midi.md) is enabled, targets can be `"midi:device_name"`
|
||||
- special item `"self"` can be used to refer to the emitting client directly
|
||||
- if no target is set (empty array `[]`), messages can still be sent if the server has defaults targets (`-s / --send`)
|
||||
- to disable osc regardless of the previous point, set `target` to `[null]`
|
||||
- to disable the default global osc targets (set via the app's `--send` option), set one of the array's item as `null` (unquoted).
|
||||
|
||||
### `address`
|
||||
### `address`<i class="dynamic-prop-icon" title="dynamic"></i>
|
||||
- type: `string`
|
||||
- default: `/widgets_id`
|
||||
- usage: this is the `address` of the osc messages sent by the widget, it must start with a `/`
|
||||
|
|
@ -95,12 +105,13 @@ All widgets share a set of generic properties described below.
|
|||
/touch/address [preArgs] 0/1
|
||||
```
|
||||
|
||||
### `preArgs`
|
||||
- type: `array`
|
||||
### `preArgs`<i class="dynamic-prop-icon" title="dynamic"></i>
|
||||
- type: `array|*`
|
||||
- default: `[]`
|
||||
- usage:
|
||||
- each element of the `array` defines a constant value that will be prepended to the osc message
|
||||
- values can be defined as objects if the type needs to be specified (ie different from the default implied by the `precision`)
|
||||
- values can be defined as objects if the osc data type needs to be specified (ie different from the default implied by the `precision` option)
|
||||
- a single non-array value can be set
|
||||
- example:
|
||||
```js
|
||||
preArgs: [
|
||||
|
|
@ -125,3 +136,11 @@ preArgs: [
|
|||
}
|
||||
]
|
||||
```
|
||||
|
||||
### `bypass`<i class="dynamic-prop-icon" title="dynamic"></i>
|
||||
- type: `boolean`
|
||||
- default: `false`
|
||||
- usage: set to `true` to prevent the widget from sending any osc message
|
||||
|
||||
!!! note ""
|
||||
Changing OSC properties dynamically using advanced property syntax is likely to break synchronisation between multiple clients.
|
||||
|
|
|
|||
|
Before Width: | Height: | Size: 78 KiB After Width: | Height: | Size: 62 KiB |
BIN
resources/images/logo-browserstack.png
Normal file
|
After Width: | Height: | Size: 11 KiB |
|
|
@ -1,101 +0,0 @@
|
|||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||
<!-- Created with Inkscape (http://www.inkscape.org/) -->
|
||||
|
||||
<svg
|
||||
xmlns:dc="http://purl.org/dc/elements/1.1/"
|
||||
xmlns:cc="http://creativecommons.org/ns#"
|
||||
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
|
||||
xmlns:svg="http://www.w3.org/2000/svg"
|
||||
xmlns="http://www.w3.org/2000/svg"
|
||||
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
|
||||
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
|
||||
width="146.75555mm"
|
||||
height="146.75555mm"
|
||||
viewBox="0 0 520 519.99999"
|
||||
id="svg2"
|
||||
version="1.1"
|
||||
inkscape:version="0.92.1 r15371"
|
||||
enable-background="new"
|
||||
sodipodi:docname="logo-material.svg"
|
||||
inkscape:export-filename="/home/bordun/Ammd/open-stage-control/resources/images/logo.png"
|
||||
inkscape:export-xdpi="44.307693"
|
||||
inkscape:export-ydpi="44.307693">
|
||||
<defs
|
||||
id="defs4" />
|
||||
<sodipodi:namedview
|
||||
id="base"
|
||||
pagecolor="#000000"
|
||||
bordercolor="#666666"
|
||||
borderopacity="1.0"
|
||||
inkscape:pageopacity="0"
|
||||
inkscape:pageshadow="2"
|
||||
inkscape:zoom="0.60172068"
|
||||
inkscape:cx="365.73236"
|
||||
inkscape:cy="375.30189"
|
||||
inkscape:document-units="px"
|
||||
inkscape:current-layer="layer1"
|
||||
showgrid="false"
|
||||
fit-margin-top="0"
|
||||
fit-margin-left="0"
|
||||
fit-margin-right="0"
|
||||
fit-margin-bottom="0"
|
||||
inkscape:window-width="1024"
|
||||
inkscape:window-height="768"
|
||||
inkscape:window-x="0"
|
||||
inkscape:window-y="0"
|
||||
inkscape:window-maximized="0"
|
||||
showguides="true" />
|
||||
<metadata
|
||||
id="metadata7">
|
||||
<rdf:RDF>
|
||||
<cc:Work
|
||||
rdf:about="">
|
||||
<dc:format>image/svg+xml</dc:format>
|
||||
<dc:type
|
||||
rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
|
||||
<dc:title />
|
||||
</cc:Work>
|
||||
</rdf:RDF>
|
||||
</metadata>
|
||||
<g
|
||||
inkscape:groupmode="layer"
|
||||
id="layer1"
|
||||
inkscape:label="Layer 1">
|
||||
<path
|
||||
style="color:#000000;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:medium;line-height:normal;font-family:sans-serif;font-variant-ligatures:normal;font-variant-position:normal;font-variant-caps:normal;font-variant-numeric:normal;font-variant-alternates:normal;font-feature-settings:normal;text-indent:0;text-align:start;text-decoration:none;text-decoration-line:none;text-decoration-style:solid;text-decoration-color:#000000;letter-spacing:normal;word-spacing:normal;text-transform:none;writing-mode:lr-tb;direction:ltr;text-orientation:mixed;dominant-baseline:auto;baseline-shift:baseline;text-anchor:start;white-space:normal;shape-padding:0;clip-rule:nonzero;display:inline;overflow:visible;visibility:visible;opacity:0.505;isolation:auto;mix-blend-mode:normal;color-interpolation:sRGB;color-interpolation-filters:linearRGB;solid-color:#000000;solid-opacity:1;vector-effect:none;fill:#fffbff;fill-opacity:0.79365081;fill-rule:nonzero;stroke:#ffffff;stroke-width:7.49999965;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;color-rendering:auto;image-rendering:auto;shape-rendering:auto;text-rendering:auto;enable-background:accumulate"
|
||||
d="m 261.27684,38.57666 c -138.98447,0 -252.0208589,113.03638 -252.0208589,252.02086 0,70.16669 28.8215489,133.70969 75.2362029,179.44335 L 108.65112,445.88194 C 68.506687,406.42298 43.635863,351.4771 43.635863,290.59752 c 0,-120.40349 97.237497,-217.640978 217.640977,-217.640979 120.4035,0 217.64098,97.237489 217.64098,217.640979 0,61.10926 -25.05967,116.23905 -65.47118,155.72937 l 24.15894,24.15893 c 46.68197,-45.76612 75.69579,-109.49245 75.69579,-179.8883 0,-138.98448 -113.04005,-252.02086 -252.02453,-252.02086 z"
|
||||
id="circle942"
|
||||
inkscape:connector-curvature="0"
|
||||
inkscape:transform-center-x="1.8122676"
|
||||
inkscape:transform-center-y="-32.620818" />
|
||||
<circle
|
||||
style="opacity:0.819;fill:#fbfbfb;fill-opacity:1;stroke:none;stroke-width:41.35679245;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:0.33160622"
|
||||
id="circle940"
|
||||
cx="261.27762"
|
||||
cy="290.5976"
|
||||
r="168.40112" />
|
||||
<path
|
||||
style="color:#000000;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:medium;line-height:normal;font-family:sans-serif;font-variant-ligatures:normal;font-variant-position:normal;font-variant-caps:normal;font-variant-numeric:normal;font-variant-alternates:normal;font-feature-settings:normal;text-indent:0;text-align:start;text-decoration:none;text-decoration-line:none;text-decoration-style:solid;text-decoration-color:#000000;letter-spacing:normal;word-spacing:normal;text-transform:none;writing-mode:lr-tb;direction:ltr;text-orientation:mixed;dominant-baseline:auto;baseline-shift:baseline;text-anchor:start;white-space:normal;shape-padding:0;clip-rule:nonzero;display:inline;overflow:visible;visibility:visible;opacity:1;isolation:auto;mix-blend-mode:normal;color-interpolation:sRGB;color-interpolation-filters:linearRGB;solid-color:#000000;solid-opacity:1;vector-effect:none;fill:#52a8ff;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:34.38120651;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;color-rendering:auto;image-rendering:auto;shape-rendering:auto;text-rendering:auto;enable-background:accumulate"
|
||||
d="m 261.27571,38.574572 c -138.98447,0 -252.0215348,113.037068 -252.0215348,252.021528 0,69.81688 28.5311308,133.08046 74.5395508,178.76343 L 107.95269,445.20057 C 68.216666,405.79166 43.638798,351.12389 43.638798,290.5961 c 0,-120.40348 97.233432,-217.639483 217.636912,-217.639483 60.52778,0 115.19555,24.580443 154.60444,64.316463 l 24.15896,-24.15896 C 394.35617,67.105818 331.09248,38.574572 261.27571,38.574572 Z"
|
||||
id="circle944"
|
||||
inkscape:connector-curvature="0" />
|
||||
<circle
|
||||
r="169.31087"
|
||||
cy="290.5976"
|
||||
cx="261.27762"
|
||||
id="circle938"
|
||||
style="opacity:1;fill:none;fill-opacity:1;stroke:#fff6ff;stroke-width:5.07821894;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" />
|
||||
<path
|
||||
style="opacity:1;fill:none;stroke:#52a8ff;stroke-width:35.16100311;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
|
||||
d="M 389.38926,163.59698 278.09817,275.90931"
|
||||
id="path956"
|
||||
inkscape:connector-curvature="0" />
|
||||
<path
|
||||
inkscape:transform-center-y="-32.620818"
|
||||
inkscape:transform-center-x="1.8122676"
|
||||
inkscape:connector-curvature="0"
|
||||
id="path4487"
|
||||
d="m 261.27684,38.57666 c -138.98447,0 -252.0208589,113.03638 -252.0208589,252.02086 0,70.16669 28.8215489,133.70969 75.2362029,179.44335 L 108.65112,445.88194 C 68.506687,406.42298 43.635863,351.4771 43.635863,290.59752 c 0,-120.40349 97.237497,-217.640978 217.640977,-217.640979 120.4035,0 217.64098,97.237489 217.64098,217.640979 0,61.10926 -25.05967,116.23905 -65.47118,155.72937 l 24.15894,24.15893 c 46.68197,-45.76612 75.69579,-109.49245 75.69579,-179.8883 0,-138.98448 -113.04005,-252.02086 -252.02453,-252.02086 z"
|
||||
style="color:#000000;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:medium;line-height:normal;font-family:sans-serif;font-variant-ligatures:normal;font-variant-position:normal;font-variant-caps:normal;font-variant-numeric:normal;font-variant-alternates:normal;font-feature-settings:normal;text-indent:0;text-align:start;text-decoration:none;text-decoration-line:none;text-decoration-style:solid;text-decoration-color:#000000;letter-spacing:normal;word-spacing:normal;text-transform:none;writing-mode:lr-tb;direction:ltr;text-orientation:mixed;dominant-baseline:auto;baseline-shift:baseline;text-anchor:start;white-space:normal;shape-padding:0;clip-rule:nonzero;display:inline;overflow:visible;visibility:visible;opacity:0.819;isolation:auto;mix-blend-mode:normal;color-interpolation:sRGB;color-interpolation-filters:linearRGB;solid-color:#000000;solid-opacity:1;vector-effect:none;fill:none;fill-opacity:0.33160622;fill-rule:nonzero;stroke:#989898;stroke-width:7.49999965;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;color-rendering:auto;image-rendering:auto;shape-rendering:auto;text-rendering:auto;enable-background:accumulate" />
|
||||
</g>
|
||||
</svg>
|
||||
|
Before Width: | Height: | Size: 8.2 KiB |
BIN
resources/images/logo-nobadge.png
Normal file
|
After Width: | Height: | Size: 12 KiB |
86
resources/images/logo-nobadge.svg
Normal file
|
|
@ -0,0 +1,86 @@
|
|||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||
<!-- Created with Inkscape (http://www.inkscape.org/) -->
|
||||
|
||||
<svg
|
||||
xmlns:dc="http://purl.org/dc/elements/1.1/"
|
||||
xmlns:cc="http://creativecommons.org/ns#"
|
||||
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
|
||||
xmlns:svg="http://www.w3.org/2000/svg"
|
||||
xmlns="http://www.w3.org/2000/svg"
|
||||
xmlns:xlink="http://www.w3.org/1999/xlink"
|
||||
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
|
||||
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
|
||||
version="1.1"
|
||||
id="svg869"
|
||||
width="152.39748"
|
||||
height="152.39748"
|
||||
viewBox="0 0 152.39747 152.39747"
|
||||
sodipodi:docname="logo-nobadge.svg"
|
||||
inkscape:version="0.92.2 (5c3e80d, 2017-08-06)"
|
||||
inkscape:export-filename="/home/bordun/Dev/open-stage-control/resources/images/logo-nobadge.png"
|
||||
inkscape:export-xdpi="128.47"
|
||||
inkscape:export-ydpi="128.47">
|
||||
<metadata
|
||||
id="metadata875">
|
||||
<rdf:RDF>
|
||||
<cc:Work
|
||||
rdf:about="">
|
||||
<dc:format>image/svg+xml</dc:format>
|
||||
<dc:type
|
||||
rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
|
||||
<dc:title></dc:title>
|
||||
</cc:Work>
|
||||
</rdf:RDF>
|
||||
</metadata>
|
||||
<sodipodi:namedview
|
||||
pagecolor="#ffffff"
|
||||
bordercolor="#666666"
|
||||
borderopacity="1"
|
||||
objecttolerance="10"
|
||||
gridtolerance="10"
|
||||
guidetolerance="10"
|
||||
inkscape:pageopacity="0"
|
||||
inkscape:pageshadow="2"
|
||||
inkscape:window-width="1024"
|
||||
inkscape:window-height="732"
|
||||
id="namedview871"
|
||||
showgrid="false"
|
||||
fit-margin-top="0"
|
||||
fit-margin-left="0"
|
||||
fit-margin-right="0"
|
||||
fit-margin-bottom="0"
|
||||
inkscape:zoom="1.0826988"
|
||||
inkscape:cx="68.419328"
|
||||
inkscape:cy="35.281297"
|
||||
inkscape:window-x="465"
|
||||
inkscape:window-y="174"
|
||||
inkscape:window-maximized="0"
|
||||
inkscape:current-layer="layer2"
|
||||
showguides="true"
|
||||
inkscape:pagecheckerboard="true" />
|
||||
<g
|
||||
inkscape:groupmode="layer"
|
||||
id="layer2"
|
||||
inkscape:label="Layer 2"
|
||||
style="display:inline"
|
||||
transform="translate(-27.577888,-27.577888)">
|
||||
<circle
|
||||
style="opacity:0.25;fill:none;fill-opacity:1;fill-rule:nonzero;stroke:#52a8ff;stroke-width:9.8682642;stroke-linecap:butt;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
|
||||
id="path1248"
|
||||
cx="103.94808"
|
||||
cy="103.94808"
|
||||
r="71.093147" />
|
||||
<path
|
||||
style="color:#000000;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:medium;line-height:normal;font-family:sans-serif;font-variant-ligatures:normal;font-variant-position:normal;font-variant-caps:normal;font-variant-numeric:normal;font-variant-alternates:normal;font-feature-settings:normal;text-indent:0;text-align:start;text-decoration:none;text-decoration-line:none;text-decoration-style:solid;text-decoration-color:#000000;letter-spacing:normal;word-spacing:normal;text-transform:none;writing-mode:lr-tb;direction:ltr;text-orientation:mixed;dominant-baseline:auto;baseline-shift:baseline;text-anchor:start;white-space:normal;shape-padding:0;clip-rule:nonzero;display:inline;overflow:visible;visibility:visible;opacity:1;isolation:auto;mix-blend-mode:normal;color-interpolation:sRGB;color-interpolation-filters:linearRGB;solid-color:#000000;solid-opacity:1;vector-effect:none;fill:#52a8ff;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:9.8682642;stroke-linecap:square;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:3.94730568;stroke-opacity:1;color-rendering:auto;image-rendering:auto;shape-rendering:auto;text-rendering:auto;enable-background:accumulate"
|
||||
d="M 95.689453,19.320312 C 53.570636,19.320161 19.320161,53.570636 19.320312,95.689453 v 0.002 0.002 c 0.0188,20.287517 8.112393,39.739747 22.490235,54.052727 l 3.488281,3.47071 3.480469,-3.47657 c 1.170641,-1.1695 2.479275,-2.4813 3.683594,-3.68554 a 66.450541,66.450541 0 0 1 -8.574219,-8.84375 c -0.778679,-0.96909 -1.532773,-1.95573 -2.253906,-2.96289 a 66.450541,66.450541 0 0 1 -1.396485,-2.0293 c -0.80336,-1.214 -1.558656,-2.45633 -2.279297,-3.7168 A 66.450541,66.450541 0 0 1 37.111328,127 c -0.897256,-1.66796 -1.717662,-3.37537 -2.46875,-5.11133 a 66.450541,66.450541 0 0 1 -0.277344,-0.65625 c -0.806112,-1.91929 -1.517819,-3.87702 -2.140625,-5.86523 a 66.450541,66.450541 0 0 1 -0.0293,-0.0957 C 30.237383,108.98786 29.196062,102.39776 29.18945,95.689463 v -0.002 -0.002 c 0.002,-36.782445 29.713649,-66.494101 66.496094,-66.496094 h 0.0039 c 15.991786,0.01465 31.342816,5.83597 43.363276,16.216797 -4.71457,4.724703 -11.30899,11.327736 -16.77929,16.808594 a 42.789684,42.789684 0 0 1 6.99609,6.96289 c 6.75716,-6.770561 14.8928,-14.917957 20.41992,-20.457031 L 153.16797,45.236328 149.68945,41.75 C 135.38,27.407791 115.95315,19.337687 95.693359,19.320312 h -0.002 z"
|
||||
transform="translate(8.257576,8.257576)"
|
||||
id="circle4863"
|
||||
inkscape:connector-curvature="0" />
|
||||
<circle
|
||||
r="15.22825"
|
||||
cy="103.94808"
|
||||
cx="103.94808"
|
||||
id="circle1241-3"
|
||||
style="display:inline;opacity:1;fill:#52a8ff;fill-opacity:1;stroke:#52a8ff;stroke-width:4.52424622;stroke-linecap:square;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" />
|
||||
</g>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 5.1 KiB |
|
Before Width: | Height: | Size: 264 KiB After Width: | Height: | Size: 264 KiB |
|
Before Width: | Height: | Size: 19 KiB After Width: | Height: | Size: 14 KiB |
|
|
@ -10,231 +10,96 @@
|
|||
xmlns:xlink="http://www.w3.org/1999/xlink"
|
||||
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
|
||||
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
|
||||
width="146.75555mm"
|
||||
height="146.75555mm"
|
||||
viewBox="0 0 520 519.99999"
|
||||
id="svg2"
|
||||
version="1.1"
|
||||
inkscape:version="0.91 r13725"
|
||||
enable-background="new"
|
||||
sodipodi:docname="logo.svg"
|
||||
inkscape:export-filename="/home/bordun/Ammd/open-stage-control/resources/images/logo.png"
|
||||
inkscape:export-xdpi="44.307693"
|
||||
inkscape:export-ydpi="44.307693">
|
||||
<defs
|
||||
id="defs4">
|
||||
<linearGradient
|
||||
inkscape:collect="always"
|
||||
id="linearGradient4297">
|
||||
<stop
|
||||
style="stop-color:#ffffff;stop-opacity:0.10714286"
|
||||
offset="0"
|
||||
id="stop4299" />
|
||||
<stop
|
||||
style="stop-color:#283143;stop-opacity:0;"
|
||||
offset="1"
|
||||
id="stop4301" />
|
||||
</linearGradient>
|
||||
<linearGradient
|
||||
inkscape:collect="always"
|
||||
id="linearGradient4259">
|
||||
<stop
|
||||
style="stop-color:#85c2ff;stop-opacity:0.29761904"
|
||||
offset="0"
|
||||
id="stop4261" />
|
||||
<stop
|
||||
style="stop-color:#85c2ff;stop-opacity:0;"
|
||||
offset="1"
|
||||
id="stop4263" />
|
||||
</linearGradient>
|
||||
<linearGradient
|
||||
inkscape:collect="always"
|
||||
xlink:href="#linearGradient4259"
|
||||
id="linearGradient4265"
|
||||
x1="-193.99495"
|
||||
y1="85.18219"
|
||||
x2="-193.99495"
|
||||
y2="545.25653"
|
||||
gradientUnits="userSpaceOnUse" />
|
||||
<linearGradient
|
||||
inkscape:collect="always"
|
||||
xlink:href="#linearGradient4297"
|
||||
id="linearGradient4305"
|
||||
x1="-193.34166"
|
||||
y1="59.609463"
|
||||
x2="-201.81757"
|
||||
y2="580.39752"
|
||||
gradientUnits="userSpaceOnUse" />
|
||||
</defs>
|
||||
<sodipodi:namedview
|
||||
id="base"
|
||||
pagecolor="#ffffff"
|
||||
bordercolor="#666666"
|
||||
borderopacity="1.0"
|
||||
inkscape:pageopacity="0.0"
|
||||
inkscape:pageshadow="2"
|
||||
inkscape:zoom="0.25865385"
|
||||
inkscape:cx="-205.39515"
|
||||
inkscape:cy="617.86431"
|
||||
inkscape:document-units="px"
|
||||
inkscape:current-layer="g4138"
|
||||
showgrid="false"
|
||||
fit-margin-top="0"
|
||||
fit-margin-left="0"
|
||||
fit-margin-right="0"
|
||||
fit-margin-bottom="0"
|
||||
inkscape:window-width="1022"
|
||||
inkscape:window-height="730"
|
||||
inkscape:window-x="0"
|
||||
inkscape:window-y="37"
|
||||
inkscape:window-maximized="0"
|
||||
showguides="true" />
|
||||
id="svg869"
|
||||
width="191.29887"
|
||||
height="191.29887"
|
||||
viewBox="0 0 191.29887 191.29887"
|
||||
sodipodi:docname="logo-2.svg"
|
||||
inkscape:version="0.92.2 (5c3e80d, 2017-08-06)">
|
||||
<metadata
|
||||
id="metadata7">
|
||||
id="metadata875">
|
||||
<rdf:RDF>
|
||||
<cc:Work
|
||||
rdf:about="">
|
||||
<dc:format>image/svg+xml</dc:format>
|
||||
<dc:type
|
||||
rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
|
||||
<dc:title />
|
||||
<dc:title></dc:title>
|
||||
</cc:Work>
|
||||
</rdf:RDF>
|
||||
</metadata>
|
||||
<g
|
||||
transform="translate(68.571426,-55.21936)"
|
||||
id="g4138"
|
||||
inkscape:groupmode="layer"
|
||||
inkscape:label="ring"
|
||||
style="display:inline;opacity:1">
|
||||
<circle
|
||||
style="opacity:1;fill:#283143;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:15;stroke-linecap:round;stroke-linejoin:bevel;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:10;stroke-opacity:1"
|
||||
id="circle4979"
|
||||
cx="-191.42857"
|
||||
cy="315.21936"
|
||||
r="234.28572"
|
||||
transform="scale(-1,1)" />
|
||||
<circle
|
||||
transform="scale(-1,1)"
|
||||
cy="315.21936"
|
||||
cx="-191.42857"
|
||||
id="circle4180"
|
||||
style="opacity:1;fill:#283143;fill-opacity:1;fill-rule:nonzero;stroke:url(#linearGradient4265);stroke-width:14.55027962;stroke-linecap:round;stroke-linejoin:bevel;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:10;stroke-opacity:1"
|
||||
r="227.26151" />
|
||||
</g>
|
||||
<sodipodi:namedview
|
||||
pagecolor="#ffffff"
|
||||
bordercolor="#666666"
|
||||
borderopacity="1"
|
||||
objecttolerance="10"
|
||||
gridtolerance="10"
|
||||
guidetolerance="10"
|
||||
inkscape:pageopacity="0"
|
||||
inkscape:pageshadow="2"
|
||||
inkscape:window-width="1024"
|
||||
inkscape:window-height="732"
|
||||
id="namedview871"
|
||||
showgrid="false"
|
||||
fit-margin-top="0"
|
||||
fit-margin-left="0"
|
||||
fit-margin-right="0"
|
||||
fit-margin-bottom="0"
|
||||
inkscape:zoom="1.0826988"
|
||||
inkscape:cx="41.558745"
|
||||
inkscape:cy="54.862386"
|
||||
inkscape:window-x="0"
|
||||
inkscape:window-y="36"
|
||||
inkscape:window-maximized="0"
|
||||
inkscape:current-layer="layer2"
|
||||
showguides="true"
|
||||
inkscape:pagecheckerboard="true" />
|
||||
<g
|
||||
inkscape:groupmode="layer"
|
||||
id="layer6"
|
||||
inkscape:label="knob center"
|
||||
id="layer2"
|
||||
inkscape:label="Layer 2"
|
||||
style="display:inline"
|
||||
sodipodi:insensitive="true">
|
||||
transform="translate(-8.257576,-8.257576)">
|
||||
<circle
|
||||
style="opacity:1;fill:#324056;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1;stroke-linecap:square;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:10;stroke-opacity:0.41089107"
|
||||
id="path4179"
|
||||
r="63.481098"
|
||||
cy="258.8757"
|
||||
cx="263.81882" />
|
||||
r="95.649437"
|
||||
cy="103.90701"
|
||||
cx="103.90701"
|
||||
id="circle933"
|
||||
style="display:inline;opacity:1;fill:#313f55;fill-opacity:1;stroke:none;stroke-width:6.05208206;stroke-linecap:square;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" />
|
||||
<circle
|
||||
cx="263.81882"
|
||||
cy="258.8757"
|
||||
r="62.471825"
|
||||
id="circle4190"
|
||||
style="opacity:1;fill:#324056;fill-opacity:1;fill-rule:nonzero;stroke:#85c2ff;stroke-width:1.96820235;stroke-linecap:square;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:10;stroke-opacity:0.09803922" />
|
||||
</g>
|
||||
<g
|
||||
inkscape:groupmode="layer"
|
||||
id="layer7"
|
||||
inkscape:label="knob track"
|
||||
style="display:inline"
|
||||
sodipodi:insensitive="true">
|
||||
<g
|
||||
id="g4203">
|
||||
<circle
|
||||
r="144.47998"
|
||||
cy="-367.7128"
|
||||
cx="0.016809432"
|
||||
style="opacity:0;fill:none;fill-opacity:1;fill-rule:nonzero;stroke:#2d2d2d;stroke-width:14.92252636;stroke-linecap:square;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:10;stroke-opacity:1"
|
||||
id="path4972"
|
||||
transform="matrix(-0.70710678,0.70710678,-0.70710678,-0.70710678,0,0)"
|
||||
inkscape:transform-center-x="-111.67956"
|
||||
inkscape:transform-center-y="-6.3381804" />
|
||||
<path
|
||||
inkscape:transform-center-y="-6.3381804"
|
||||
inkscape:transform-center-x="-111.67956"
|
||||
sodipodi:cx="0.016809432"
|
||||
sodipodi:cy="-367.7128"
|
||||
sodipodi:rx="144.47998"
|
||||
sodipodi:ry="144.47998"
|
||||
sodipodi:end="4.712389"
|
||||
sodipodi:start="3.0194196"
|
||||
sodipodi:open="true"
|
||||
sodipodi:type="arc"
|
||||
d="M -143.38624,-350.10512 A 144.47998,144.47998 0 0 1 -108.1923,-463.44813 144.47998,144.47998 0 0 1 0.01681227,-512.19278"
|
||||
transform="matrix(-0.70710678,0.70710678,-0.70710678,-0.70710678,0,0)"
|
||||
id="path3340"
|
||||
style="opacity:0.52600002;fill:none;fill-opacity:1;fill-rule:nonzero;stroke:#191f2a;stroke-width:8;stroke-linecap:square;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:10;stroke-opacity:1" />
|
||||
<path
|
||||
inkscape:transform-center-y="-21.652282"
|
||||
inkscape:transform-center-x="25.310703"
|
||||
style="opacity:1;fill:none;fill-opacity:1;fill-rule:nonzero;stroke:#52a8ff;stroke-width:8;stroke-linecap:square;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:10;stroke-opacity:1"
|
||||
id="path4383"
|
||||
sodipodi:type="arc"
|
||||
sodipodi:cx="0.016809432"
|
||||
sodipodi:cy="-367.7128"
|
||||
sodipodi:rx="144.47998"
|
||||
sodipodi:ry="144.47998"
|
||||
sodipodi:start="0"
|
||||
sodipodi:end="3.1590459"
|
||||
sodipodi:open="true"
|
||||
d="m 144.49679,-367.7128 a 144.47998,144.47998 0 0 1 -72.969145,125.54149 144.47998,144.47998 0 0 1 -145.201775,-1.26715 144.47998,144.47998 0 0 1 -70.76704,-126.79586"
|
||||
transform="matrix(-0.70710678,0.70710678,-0.70710678,-0.70710678,0,0)" />
|
||||
</g>
|
||||
</g>
|
||||
<g
|
||||
inkscape:groupmode="layer"
|
||||
id="layer8"
|
||||
inkscape:label="knob"
|
||||
style="display:inline"
|
||||
sodipodi:insensitive="true">
|
||||
style="opacity:0.25;fill:none;fill-opacity:1;fill-rule:nonzero;stroke:#52a8ff;stroke-width:9.8682642;stroke-linecap:butt;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
|
||||
id="path1248"
|
||||
cx="103.94808"
|
||||
cy="103.94808"
|
||||
r="71.093147" />
|
||||
<circle
|
||||
style="opacity:1;fill:#52a8ff;fill-opacity:1;fill-rule:nonzero;stroke:#52a8ff;stroke-width:45.92961884;stroke-linecap:square;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:10;stroke-opacity:0.33160622"
|
||||
id="path4150"
|
||||
cx="357.68915"
|
||||
cy="154.52687"
|
||||
r="19.711832"
|
||||
inkscape:transform-center-x="-0.1829093"
|
||||
inkscape:transform-center-y="-0.26599212" />
|
||||
</g>
|
||||
<g
|
||||
inkscape:groupmode="layer"
|
||||
id="layer9"
|
||||
inkscape:label="text">
|
||||
<text
|
||||
xml:space="preserve"
|
||||
style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:65.30352783px;line-height:125%;font-family:'Open Sans';-inkscape-font-specification:'Open Sans';letter-spacing:-4.78892565px;word-spacing:0px;fill:#5c91fe;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
|
||||
x="198.33574"
|
||||
y="411.88702"
|
||||
id="text4998"
|
||||
sodipodi:linespacing="125%"><tspan
|
||||
sodipodi:role="line"
|
||||
id="tspan5000"
|
||||
x="198.33574"
|
||||
y="411.88702"
|
||||
style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-family:'Droid Sans';-inkscape-font-specification:'Droid Sans';fill:#5c91fe;fill-opacity:1">OSC</tspan></text>
|
||||
</g>
|
||||
<g
|
||||
style="display:inline;opacity:1"
|
||||
inkscape:label="Copie de ring"
|
||||
inkscape:groupmode="layer"
|
||||
id="g4283"
|
||||
transform="translate(68.571426,-55.21936)"
|
||||
sodipodi:insensitive="true">
|
||||
cx="103.90701"
|
||||
cy="103.90701"
|
||||
r="95.649437"
|
||||
style="display:inline;opacity:1;fill:none;fill-opacity:1;stroke:none;stroke-width:5;stroke-linecap:square;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
|
||||
id="circle935" />
|
||||
<path
|
||||
style="display:inline;opacity:1;fill:none;fill-opacity:1;stroke:#52a8ff;stroke-width:9.8682642;stroke-linecap:square;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:3.94730568;stroke-opacity:1"
|
||||
d="m 103.94708,32.512665 a 71.434158,71.434158 0 0 0 -71.434415,71.434415 71.434158,71.434158 0 0 0 21.03688,50.55944 C 87.639333,120.45 128.86768,79.135788 154.45512,53.493007 A 71.434158,71.434158 0 0 0 103.94708,32.512665 Z"
|
||||
id="circle4863"
|
||||
inkscape:connector-curvature="0" />
|
||||
<path
|
||||
style="display:inline;opacity:1;fill:#313f55;fill-opacity:1;stroke:none;stroke-width:10.82293892;stroke-linecap:square;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
|
||||
d="m 57.180757,56.782429 a 66.450541,66.450541 0 0 0 -19.682562,47.164651 66.450541,66.450541 0 0 0 66.448885,66.45146 66.450541,66.450541 0 0 0 47.35225,-19.91386 z"
|
||||
id="circle1221"
|
||||
inkscape:connector-curvature="0" />
|
||||
<circle
|
||||
transform="scale(-1,1)"
|
||||
r="234.28572"
|
||||
cy="315.21936"
|
||||
cx="-191.42857"
|
||||
id="circle4285"
|
||||
style="opacity:0.57300002;fill:url(#linearGradient4305);fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:15;stroke-linecap:round;stroke-linejoin:bevel;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:10;stroke-opacity:1" />
|
||||
r="42.789684"
|
||||
cy="103.94808"
|
||||
cx="103.94808"
|
||||
id="circle933-5"
|
||||
style="display:inline;opacity:1;fill:#313f55;fill-opacity:1;stroke:none;stroke-width:6.96924591;stroke-linecap:square;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" />
|
||||
<circle
|
||||
r="15.22825"
|
||||
cy="103.94808"
|
||||
cx="103.94808"
|
||||
id="circle1241-3"
|
||||
style="display:inline;opacity:1;fill:#52a8ff;fill-opacity:1;stroke:#52a8ff;stroke-width:4.52424622;stroke-linecap:square;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" />
|
||||
</g>
|
||||
</svg>
|
||||
|
|
|
|||
|
Before Width: | Height: | Size: 9.1 KiB After Width: | Height: | Size: 4.2 KiB |
BIN
resources/images/mockup.xcf
Normal file
|
|
@ -1,20 +1,30 @@
|
|||
site_name: Open Stage Control
|
||||
repo_name: open-stage-control
|
||||
repo_url: https://github.com/jean-emmanuel/open-stage-control
|
||||
edit_uri: tree/master/resources/docs/
|
||||
copyright: "Open Stage Control is an <a href='http://ammd.net'>AMMD</a> software licensed under the <a href='https://github.com/jean-emmanuel/open-stage-control/blob/master/LICENSE'>GNU/GPLv3</a> License"
|
||||
site_description: "A libre desktop OSC bi-directionnal control surface application."
|
||||
site_description: "Libre and modular OSC / MIDI controller"
|
||||
|
||||
theme_dir: mkdocs-material/material
|
||||
|
||||
site_favicon: img/logo.png
|
||||
|
||||
extra:
|
||||
theme:
|
||||
name: 'material'
|
||||
custom_dir: 'mkdocs-material/material'
|
||||
feature:
|
||||
tabs: false
|
||||
logo: img/logo-material.svg
|
||||
tabs: true
|
||||
favicon: 'img/logo-nobadge.png?1'
|
||||
language: 'en'
|
||||
logo: 'img/logo-nobadge.svg'
|
||||
palette:
|
||||
primary: 'blue grey'
|
||||
accent: 'light blue'
|
||||
font:
|
||||
text: 'Roboto'
|
||||
code: 'Roboto Mono'
|
||||
|
||||
extra_css:
|
||||
- 'css/extra.css'
|
||||
|
||||
pages:
|
||||
- Open Stage Control: index.md
|
||||
- OSC Control Surface: index.md
|
||||
- Getting started: getting-started.md
|
||||
- User interface: interface.md
|
||||
- Editing sessions: editing-sessions.md
|
||||
|
|
@ -27,14 +37,18 @@ pages:
|
|||
- Switchers: widgets/switchers.md
|
||||
- Plots: widgets/plots.md
|
||||
- Matrices: widgets/matrices.md
|
||||
- Inputs: widgets/inputs.md
|
||||
- Maths: widgets/maths.md
|
||||
- Extras:
|
||||
- Property inheritance: extras/property-inheritance.md
|
||||
- Advanced property syntax: extras/advanced-property-syntax.md
|
||||
- CSS Tips: extras/css-tips.md
|
||||
- Theming: extras/theming.md
|
||||
- URL options: extras/url-options.md
|
||||
- Remote control: extras/remote-control.md
|
||||
- Custom module: extras/custom-module.md
|
||||
- Midi: extras/midi.md
|
||||
- Examples: examples.md
|
||||
- Credits: credits.md
|
||||
|
||||
markdown_extensions:
|
||||
- markdown.extensions.admonition
|
||||
|
|
|
|||
44
scripts/build-browser.js
Normal file
|
|
@ -0,0 +1,44 @@
|
|||
var browserify = require('browserify'),
|
||||
uglifyify = require('uglifyify'),
|
||||
through = require('through'),
|
||||
minimatch = require('minimatch').Minimatch,
|
||||
licensify = require('licensify'),
|
||||
exorcist = require('exorcist'),
|
||||
path = require('path'),
|
||||
babelify = require('babelify'),
|
||||
prod = process.argv.indexOf('--prod') != -1,
|
||||
fast = process.argv.indexOf('--fast') != -1,
|
||||
b
|
||||
|
||||
var ignoreList = ['**/mathjs/dist/math.min.js', '**/jquery.slim.min.js', '**/jquery.ui.js', '**/socket.io.slim.js'],
|
||||
ignoreWrapper = function(transform){
|
||||
return function(file, opts){
|
||||
if (
|
||||
ignoreList.some(function(pattern) {
|
||||
var match = minimatch(pattern)
|
||||
return match.match(file)
|
||||
})
|
||||
) {
|
||||
return through()
|
||||
} else {
|
||||
return transform(file, opts)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (prod) console.warn('\x1b[36m%s\x1b[0m', 'Building minified js bundle for production... This may take a while... ');
|
||||
|
||||
b = browserify(path.resolve(__dirname + '/../src/browser/js/index.js'), {debug:!fast, insertGlobals:fast, noParse: ignoreList})
|
||||
|
||||
b = b.transform(ignoreWrapper(babelify), {presets: ["env"]})
|
||||
|
||||
if (prod) b = b.transform(ignoreWrapper(uglifyify), {global: true})
|
||||
|
||||
b.plugin(licensify)
|
||||
|
||||
|
||||
b = b.bundle()
|
||||
|
||||
if (!fast) b = b.pipe(exorcist(path.resolve(__dirname + '/../app/browser/scripts.js.map')))
|
||||
|
||||
b.pipe(process.stdout)
|
||||
26
scripts/build-css.js
Normal file
|
|
@ -0,0 +1,26 @@
|
|||
var sass = require('node-sass'),
|
||||
path = require('path'),
|
||||
fs = require('fs')
|
||||
|
||||
var indir = path.resolve(__dirname + '/../src/browser/scss/'),
|
||||
outdir= path.resolve(__dirname + '/../app/browser/')
|
||||
|
||||
fs.readdirSync(indir + '/themes/').forEach(file => {
|
||||
|
||||
if (file.includes('.scss') && file !== 'default.scss') {
|
||||
let result = sass.renderSync({
|
||||
file: indir + '/themes/' + file,
|
||||
outputStyle: 'compressed'
|
||||
})
|
||||
|
||||
fs.writeFileSync(outdir + '/themes/' + file.split('/').pop().replace('scss', 'css'), result.css)
|
||||
}
|
||||
|
||||
})
|
||||
|
||||
var result = sass.renderSync({
|
||||
file: indir + '/style.scss',
|
||||
outputStyle: 'compressed'
|
||||
})
|
||||
|
||||
fs.writeFileSync(outdir + '/styles.css', result.css)
|
||||
|
|
@ -1,25 +0,0 @@
|
|||
var browserify = require('browserify'),
|
||||
licensify = require('licensify'),
|
||||
exorcist = require('exorcist'),
|
||||
path = require('path'),
|
||||
babelify = require('babelify'),
|
||||
prod = process.argv.indexOf('--prod') != -1,
|
||||
fast = process.argv.indexOf('--fast') != -1,
|
||||
b
|
||||
|
||||
|
||||
if (prod) console.warn('\x1b[36m%s\x1b[0m', 'Building minified js bundle for production... This may take a while... ');
|
||||
|
||||
b = browserify(path.resolve(__dirname + '/../src/browser/js/browser.js'), {debug:!fast})
|
||||
|
||||
b.plugin(licensify)
|
||||
|
||||
b = b.transform(babelify, {presets: ["env"]})
|
||||
|
||||
if (prod) b = b.transform('uglifyify', {global: true})
|
||||
|
||||
b = b.bundle()
|
||||
|
||||
if (!fast) b = b.pipe(exorcist(path.resolve(__dirname + '/../app/browser/scripts.js.map')))
|
||||
|
||||
b.pipe(process.stdout)
|
||||
16
scripts/build-launcher.js
Normal file
|
|
@ -0,0 +1,16 @@
|
|||
var browserify = require('browserify'),
|
||||
licensify = require('licensify'),
|
||||
path = require('path'),
|
||||
ignoreList = ['**/mathjs/dist/math.min.js']
|
||||
|
||||
|
||||
browserify(path.resolve(__dirname + '/../src/launcher/index.js'), {
|
||||
debug: true,
|
||||
ignoreMissing: false ,
|
||||
detectGlobals: false,
|
||||
bare: true,
|
||||
noParse: ignoreList
|
||||
})
|
||||
.plugin(licensify)
|
||||
.bundle()
|
||||
.pipe(process.stdout)
|
||||
20
scripts/package.js
Normal file
|
|
@ -0,0 +1,20 @@
|
|||
const packager = require('electron-packager'),
|
||||
path = require('path'),
|
||||
appData = require('../app/package.json'),
|
||||
safeFFMPEG = require('electron-packager-plugin-non-proprietary-codecs-ffmpeg').default
|
||||
|
||||
var rpi = process.argv.includes('--rpi')
|
||||
|
||||
packager({
|
||||
dir: path.resolve(__dirname + '/../app'),
|
||||
name: appData.name,
|
||||
platform: rpi ? 'linux' : process.env.PLATFORM,
|
||||
arch: rpi ? 'armv7l' : process.env.ARCH,
|
||||
electronVersion: rpi ? '1.7.11' : undefined,
|
||||
overwrite: true,
|
||||
out: path.resolve(__dirname + '/../dist'),
|
||||
icon: path.resolve(__dirname + '/../resources/images/logo'),
|
||||
ignore: /node_modules\/(serialport|uws)/,
|
||||
afterExtract: [safeFFMPEG],
|
||||
prune: false
|
||||
}).then(()=>{})
|
||||
|
|
@ -1,5 +1,9 @@
|
|||
var socket = require('socket.io-client')
|
||||
var WS = require('../app/node_modules/ws')
|
||||
|
||||
var ipc = socket.connect('http://127.0.0.1:8080')
|
||||
ipc.emit('reloadCss')
|
||||
setTimeout(process.exit,500)
|
||||
var ipc = new WS('ws://127.0.0.1:8080/dev')
|
||||
|
||||
ipc.on('error', ()=>{})
|
||||
ipc.on('open', ()=>{
|
||||
ipc.send('["reloadCss"]')
|
||||
process.exit()
|
||||
})
|
||||
|
|
|
|||
107
src/browser/js/app/dom.js
Normal file
|
|
@ -0,0 +1,107 @@
|
|||
var DomParserFragment,
|
||||
readyCallbacks = [],
|
||||
initState = false
|
||||
|
||||
module.exports = {
|
||||
|
||||
init: function() {
|
||||
|
||||
DomParserFragment = document.createRange()
|
||||
DomParserFragment.selectNode(document.body)
|
||||
|
||||
for (var i in readyCallbacks) {
|
||||
readyCallbacks[i]()
|
||||
}
|
||||
|
||||
initState = true
|
||||
|
||||
},
|
||||
|
||||
ready: function(callback) {
|
||||
if (initState) {
|
||||
callback()
|
||||
} else {
|
||||
readyCallbacks.push(callback)
|
||||
}
|
||||
},
|
||||
|
||||
dispatchEvent: function(element, name, data) {
|
||||
|
||||
var event = new CustomEvent(name, {
|
||||
detail: data,
|
||||
bubbles: true,
|
||||
cancelable: true
|
||||
})
|
||||
|
||||
element.dispatchEvent(event)
|
||||
|
||||
},
|
||||
|
||||
addEventListener: function(element, events, listener, capture) {
|
||||
|
||||
var eventsAsObject = typeof events == 'string' ? events.split(' ') : events
|
||||
|
||||
for (var i in eventsAsObject) {
|
||||
|
||||
element.addEventListener(eventsAsObject[i], listener, capture)
|
||||
|
||||
}
|
||||
|
||||
},
|
||||
|
||||
get: function(a, b) {
|
||||
|
||||
var context = b ? a : document,
|
||||
selector = b || a
|
||||
|
||||
if (selector.indexOf('>') == 0) selector = ':scope ' + selector
|
||||
|
||||
var nodes = context.querySelectorAll(selector)
|
||||
return NodeList.prototype.forEach ? nodes : [...nodes]
|
||||
|
||||
},
|
||||
|
||||
create: function(html) {
|
||||
|
||||
return DomParserFragment.createContextualFragment(html.trim()).firstChild
|
||||
|
||||
},
|
||||
|
||||
each: function(context, selector, callback) {
|
||||
|
||||
var nodes = module.exports.get(context, selector)
|
||||
|
||||
nodes.forEach(callback)
|
||||
|
||||
return nodes
|
||||
|
||||
},
|
||||
|
||||
index: function(element) {
|
||||
var parent = element.parentNode
|
||||
return parent ? Array.prototype.indexOf.call(parent.children, element) : -1
|
||||
},
|
||||
|
||||
offset: function(element) {
|
||||
|
||||
var offsetLeft = 0,
|
||||
offsetTop = 0
|
||||
|
||||
if (element) {
|
||||
do {
|
||||
if (!isNaN(element.offsetLeft)) {
|
||||
offsetLeft += element.offsetLeft - element.scrollLeft
|
||||
}
|
||||
if (!isNaN(element.offsetTop)) {
|
||||
offsetTop += element.offsetTop - element.scrollTop
|
||||
}
|
||||
} while ((element = element.offsetParent))
|
||||
}
|
||||
|
||||
return {
|
||||
left: offsetLeft,
|
||||
top: offsetTop
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -1,59 +1,296 @@
|
|||
var correctPosition = function (m, parent){
|
||||
var pos = m.offset(),
|
||||
width = m.outerWidth(),
|
||||
height = m.outerHeight(),
|
||||
totalWidth = $('body').outerWidth(),
|
||||
totalHeight = $('body').outerHeight(),
|
||||
leftAdjust = parent=='body'?0:parent.outerWidth()-2
|
||||
var {updateWidget} = require('./data-workers'),
|
||||
{categories} = require('../widgets/'),
|
||||
widgetManager = require('../managers/widgets'),
|
||||
editor = require('./')
|
||||
|
||||
if (width + pos.left > totalWidth) {
|
||||
m.css({'margin-left':totalWidth-(width + pos.left + leftAdjust)})
|
||||
}
|
||||
if (height + pos.top > totalHeight) {
|
||||
m.css({'margin-top':totalHeight-(height + pos.top)})
|
||||
}
|
||||
}
|
||||
|
||||
var ev = 'fake-click'
|
||||
var mod = (navigator.platform || '').match('Mac') ? 'shiftKey' : 'ctrlKey'
|
||||
|
||||
|
||||
var menu = function(e,actions,parent){
|
||||
class ContextMenu {
|
||||
|
||||
constructor(){
|
||||
|
||||
this.menu = null
|
||||
this.event = 'fast-click'
|
||||
this.root = document.body
|
||||
|
||||
var m = $('<div class="context-menu"></div>')
|
||||
if (parent=='body') {
|
||||
m.css({top:e.pageY+'px',left:e.pageX+'px'})
|
||||
}
|
||||
|
||||
for (let label in actions) {
|
||||
open(e, actions, parent) {
|
||||
|
||||
if (typeof actions[label] == 'object') {
|
||||
var menu = DOM.create('<div class="context-menu"></div>')
|
||||
|
||||
var item = $(`<div class="item has-sub" tabIndex="1">${label}</div>`).appendTo(m).on(ev,function(e){e.stopPropagation()})
|
||||
menu(e,actions[label],item)
|
||||
for (let label in actions) {
|
||||
|
||||
if (typeof actions[label] == 'object') {
|
||||
|
||||
let item = DOM.create(`<div class="item has-sub" tabIndex="1">${label}</div>`)
|
||||
menu.appendChild(item)
|
||||
|
||||
this.open(e,actions[label],item)
|
||||
|
||||
|
||||
} else {
|
||||
} else {
|
||||
|
||||
let item = DOM.create(`<div class="item">${label}</div>`)
|
||||
menu.appendChild(item)
|
||||
item.addEventListener(this.event, (e)=>{
|
||||
e.detail.preventDefault = true
|
||||
actions[label]()
|
||||
this.close()
|
||||
})
|
||||
|
||||
}
|
||||
|
||||
$(`<div class="item">${label}</div>`).on(ev + '.editor',function(){
|
||||
var callback = actions[label]
|
||||
return function(e){
|
||||
callback()
|
||||
$('.context-menu').remove()
|
||||
}
|
||||
}()).appendTo(m)
|
||||
}
|
||||
|
||||
if (parent) parent.appendChild(menu)
|
||||
|
||||
if (!parent) {
|
||||
|
||||
this.menu = menu
|
||||
|
||||
this.root.appendChild(menu)
|
||||
|
||||
DOM.each(menu, '.item', (item)=>{
|
||||
item.addEventListener('mouseenter', ()=>{
|
||||
DOM.each(item.parentNode, '.focus', (focused)=>{
|
||||
focused.classList.remove('focus')
|
||||
})
|
||||
item.classList.add('focus')
|
||||
})
|
||||
item.addEventListener('mouseleave', ()=>{
|
||||
if (!item.classList.contains('has-sub')) item.classList.remove('focus')
|
||||
})
|
||||
})
|
||||
|
||||
menu.style.top = e.pageY + 'px'
|
||||
menu.style.left = e.pageX + 'px'
|
||||
|
||||
this.correctPosition(menu)
|
||||
|
||||
DOM.each(menu, '.context-menu', (m)=>{
|
||||
this.correctPosition(m, m.parentNode)
|
||||
})
|
||||
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
m.appendTo(parent)
|
||||
close() {
|
||||
|
||||
if (this.menu) {
|
||||
|
||||
this.menu.parentNode.removeChild(this.menu)
|
||||
this.menu = null
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
correctPosition(menu, parent) {
|
||||
|
||||
var position = DOM.offset(menu),
|
||||
width = menu.offsetWidth,
|
||||
height = menu.offsetHeight,
|
||||
totalWidth = this.root.offsetWidth,
|
||||
totalHeight = this.root.offsetHeight
|
||||
|
||||
if (width + position.left > totalWidth) {
|
||||
menu.style.right = parent ? '100%' : '0'
|
||||
menu.style.left = 'auto'
|
||||
menu.style.marginRight = '2rem'
|
||||
}
|
||||
|
||||
if (height + position.top > totalHeight) {
|
||||
menu.style.top = 'auto'
|
||||
menu.style.bottom = '2rem'
|
||||
}
|
||||
|
||||
if (parent=='body') {
|
||||
correctPosition(m,parent)
|
||||
} else {
|
||||
parent.hover(function(){correctPosition(m,parent)})
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
module.exports = menu
|
||||
var contextMenu = new ContextMenu()
|
||||
|
||||
var handleClick = function(event) {
|
||||
|
||||
if (!EDITING) return
|
||||
|
||||
if (contextMenu.menu && !contextMenu.menu.contains(event.target)) contextMenu.close()
|
||||
|
||||
if (!event.detail.ctrlKey && event.type !== 'fast-right-click' && (
|
||||
event.target.classList.contains('ui-resizable-handle') ||
|
||||
event.target.classList.contains('ui-draggable-handle')
|
||||
)) { return }
|
||||
|
||||
var eventData = event.detail,
|
||||
widget = widgetManager.getWidgetByElement(eventData.target, ':not(.not-editable)')
|
||||
|
||||
if (!widget) return
|
||||
|
||||
// if the widget is not already selected
|
||||
if (!widget.container.classList.contains('editing')) {
|
||||
// add a flag to the original event to prevent draginit
|
||||
// and prevent any further fast-click (ie input focus)
|
||||
eventData.capturedByEditor = true
|
||||
event.capturedByEditor = true
|
||||
}
|
||||
|
||||
|
||||
if (event.type !== 'fast-right-click') {
|
||||
editor.select(widget, {multi: event.detail[mod]})
|
||||
}
|
||||
|
||||
// right-click menu
|
||||
if (event.type !== 'fast-right-click') return
|
||||
|
||||
if (!event.detail.ctrlKey && editor.selectedWidgets.length <= 1) {
|
||||
editor.select(widget, {multi: event.detail[mod]})
|
||||
}
|
||||
|
||||
if (!editor.selectedWidgets.length) return
|
||||
|
||||
var index = editor.selectedWidgets.map((w)=>DOM.index(w.container)).sort((a,b)=>{return b-a}),
|
||||
data = editor.selectedWidgets.map((w)=>w.props),
|
||||
type = editor.selectedWidgets[0].props.type == 'tab' ? 'tab' : 'widget',
|
||||
parent = editor.selectedWidgets[0].parent
|
||||
|
||||
// case root: only "add tab" option
|
||||
if (parent === widgetManager) {
|
||||
contextMenu.open(eventData,{
|
||||
'<i class="fa fa-plus"></i> Add tab': function(){
|
||||
data[0].tabs.push({})
|
||||
updateWidget(widget)
|
||||
editor.pushHistory()
|
||||
}
|
||||
})
|
||||
|
||||
return
|
||||
}
|
||||
|
||||
// case !root
|
||||
|
||||
var actions = {},
|
||||
clickX = Math.round((eventData.offsetX + eventData.target.scrollLeft) / (GRIDWIDTH * PXSCALE)) * GRIDWIDTH,
|
||||
clickY = Math.round((eventData.offsetY + eventData.target.scrollTop) / (GRIDWIDTH * PXSCALE)) * GRIDWIDTH
|
||||
|
||||
actions['<i class="fa fa-expand"></i> Edit parent'] = ()=>{
|
||||
editor.select(parent)
|
||||
}
|
||||
|
||||
if (type === 'widget') {
|
||||
|
||||
actions['<i class="fa fa-copy"></i> Copy'] = editor.copyWidget.bind(editor)
|
||||
|
||||
actions['<i class="fa fa-cut"></i> Cut'] = editor.cutWidget.bind(editor)
|
||||
|
||||
actions['<i class="fa fa-box"></i> Wrap in'] = {}
|
||||
for (let c of categories.Containers) {
|
||||
if (c === 'clone') continue
|
||||
actions['<i class="fa fa-box"></i> Wrap in'][c] = ()=>{
|
||||
var wrap = {type: c, widgets:[], label: c === 'modal' ? 'auto' : false}
|
||||
|
||||
wrap.widgets = data
|
||||
|
||||
var minTop = Math.min(...data.map(x=>isNaN(x.top) ? x.top == 'auto' ? 0 : Infinity : x.top))
|
||||
var minLeft = Math.min(...data.map(x=>isNaN(x.left) ? x.left == 'auto' ? 0 : Infinity : x.left))
|
||||
|
||||
wrap.top = minTop === Infinity ? data[0].top : minTop
|
||||
wrap.left= minLeft === Infinity ? data[0].left : minLeft
|
||||
|
||||
for (var w of wrap.widgets) {
|
||||
if (!isNaN(w.top)) w.top = Math.max(w.top - minTop, 0)
|
||||
if (!isNaN(w.left)) w.left = Math.max(w.left - minLeft, 0)
|
||||
}
|
||||
|
||||
var i
|
||||
for (i of index) {
|
||||
parent.props.widgets.splice(i,1)
|
||||
}
|
||||
|
||||
parent.props.widgets = parent.props.widgets.slice(0, i).concat(wrap, parent.props.widgets.slice(i, parent.props.widgets.length))
|
||||
|
||||
editor.select(updateWidget(parent, {preventSelect: true}))
|
||||
editor.pushHistory()
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
if (data.length == 1 && (!data[0].tabs || !data[0].tabs.length) && (data[0].widgets)) {
|
||||
|
||||
if (editor.clipboard !== null) {
|
||||
|
||||
actions['<i class="fa fa-paste"></i> Paste'] = {
|
||||
'<i class="fa fa-paste"></i> Paste': ()=>{
|
||||
editor.pasteWidget(clickX, clickY)
|
||||
},
|
||||
'<i class="fa fa-plus-square"></i> ID + 1': ()=>{
|
||||
editor.pasteWidget(clickX, clickY, true)
|
||||
}
|
||||
}
|
||||
|
||||
if (editor.idClipboard && widgetManager.getWidgetById(editor.idClipboard).length) {
|
||||
actions['<i class="fa fa-paste"></i> Paste']['<i class="fa fa-clone"></i> Clone'] = ()=>{
|
||||
editor.pasteWidgetAsClone(clickX, clickY)
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
actions['<i class="fa fa-plus"></i> Add widget'] = {}
|
||||
|
||||
for (let category in categories) {
|
||||
|
||||
actions['<i class="fa fa-plus"></i> Add widget'][category] = {}
|
||||
|
||||
for (let t in categories[category]) {
|
||||
|
||||
let type = categories[category][t]
|
||||
|
||||
actions['<i class="fa fa-plus"></i> Add widget'][category][type] = ()=>{
|
||||
|
||||
var newData = {type: type}
|
||||
|
||||
if (!eventData.target.classList.contains('tablink')) {
|
||||
newData.top = clickY
|
||||
newData.left= clickX
|
||||
}
|
||||
|
||||
data[0].widgets = data[0].widgets || []
|
||||
data[0].widgets.push(newData)
|
||||
updateWidget(editor.selectedWidgets[0])
|
||||
editor.pushHistory()
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
if (data.length == 1 && (!data[0].widgets || !data[0].widgets.length) && (data[0].tabs)) {
|
||||
|
||||
actions['<i class="fa fa-plus"></i> Add tab'] = ()=>{
|
||||
data[0].tabs = data[0].tabs || []
|
||||
data[0].tabs.push({})
|
||||
updateWidget(editor.selectedWidgets[0])
|
||||
editor.pushHistory()
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
actions['<i class="fa fa-trash"></i> Delete'] = editor.deleteWidget.bind(editor)
|
||||
|
||||
contextMenu.open(eventData, actions)
|
||||
|
||||
}
|
||||
|
||||
document.addEventListener('fast-right-click', handleClick, true)
|
||||
document.addEventListener('fast-click', handleClick, true)
|
||||
|
|
|
|||
|
|
@ -1,31 +1,28 @@
|
|||
var editObject = function(){editObject = require('./edit-objects').editObject; editObject(...arguments)},
|
||||
purgeStores = require('./purge'),
|
||||
{iconify} = require('../utils'),
|
||||
widgetManager = require('../managers/widgets'),
|
||||
parser = require('../parser')
|
||||
var widgetManager = require('../managers/widgets'),
|
||||
resize = require('../events/resize'),
|
||||
stateManager = require('../managers/state'),
|
||||
parser = require('../parser'),
|
||||
editor
|
||||
|
||||
var getObjectData = function(obj){
|
||||
var path = []
|
||||
|
||||
if (obj.hasClass('widget')) {
|
||||
return obj[0].abstract.props
|
||||
} else {
|
||||
return obj.closest('.widget')[0].abstract.props
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
var updateDom = function(container,data, remote) {
|
||||
var updateWidget = function(widget, options = {}) {
|
||||
|
||||
// save state
|
||||
var scroll = $('#sidepanel').scrollTop(),
|
||||
oldWidgets = container[0].abstract.hashes || [container[0].abstract.hash],
|
||||
wState = {},
|
||||
var sidepanel = DOM.get('#sidepanel')[0],
|
||||
scroll = sidepanel.scrollTop,
|
||||
oldWidgets = widget.childrenHashes.concat(widget.hash),
|
||||
wasSelected = editor.selectedWidgets.includes(widget),
|
||||
wScroll = {}
|
||||
|
||||
stateManager.incrementQueue()
|
||||
|
||||
for (let h of oldWidgets) {
|
||||
if (widgetManager.widgets[h] && widgetManager.widgets[h].getValue) {
|
||||
wState[widgetManager.widgets[h].getProp('id')] = widgetManager.widgets[h].getValue()
|
||||
if (widgetManager.widgets[h]) {
|
||||
let id = widgetManager.widgets[h].getProp('id'),
|
||||
value = widgetManager.widgets[h].getValue(),
|
||||
valueProp = widgetManager.widgets[h].getProp('value')
|
||||
|
||||
stateManager.pushValueState(id, value)
|
||||
if (valueProp !== '' && valueProp !== undefined) stateManager.pushValueOldProp(id, valueProp)
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -36,29 +33,23 @@ var updateDom = function(container,data, remote) {
|
|||
}
|
||||
}
|
||||
|
||||
widgetManager.removeWidgets(oldWidgets)
|
||||
|
||||
// widget
|
||||
var newContainer = parser.parse([data], container[0].abstract.parentNode, container[0].abstract.parent)
|
||||
container.replaceWith(newContainer)
|
||||
var newWidget = parser.parse([widget.props], widget.parentNode, widget.parent, false, options.reCreateOptions)
|
||||
|
||||
if (data.type == 'tab') newContainer.trigger('tab-created')
|
||||
widget.container.parentNode.replaceChild(newWidget.container, widget.container)
|
||||
|
||||
if (container[0].abstract.parent && container[0].abstract.parent.registerHashes) {
|
||||
container[0].abstract.parent.registerHashes(true)
|
||||
}
|
||||
if (newWidget.getProp('type') == 'tab') newWidget.parent.trigger('tab-created', [{widget: widget}])
|
||||
if (newWidget.getProp('id') == 'root') DOM.get('.editor-root')[0].setAttribute('data-widget', newWidget.hash)
|
||||
|
||||
$('.editor-root').attr('data-widget', $('.root-container').attr('data-widget'))
|
||||
|
||||
newContainer.trigger('resize')
|
||||
|
||||
purgeStores(oldWidgets)
|
||||
resize.check(newWidget.container)
|
||||
|
||||
|
||||
// restore state
|
||||
for (let id in wState) {
|
||||
for (let w of widgetManager.getWidgetById(id)) {
|
||||
if (w.setValue) w.setValue(wState[id])
|
||||
}
|
||||
}
|
||||
stateManager.decrementQueue()
|
||||
|
||||
|
||||
// restore scroll states
|
||||
for (let id in wScroll) {
|
||||
|
|
@ -67,19 +58,19 @@ var updateDom = function(container,data, remote) {
|
|||
}
|
||||
}
|
||||
|
||||
if (!remote) {
|
||||
editObject(newContainer,data,true)
|
||||
if (wasSelected && !options.preventSelect) {
|
||||
editor.select(newWidget)
|
||||
}
|
||||
|
||||
$('#sidepanel').scrollTop(scroll)
|
||||
sidepanel.scrollTop = scroll
|
||||
|
||||
|
||||
// return updated node
|
||||
return newContainer
|
||||
return newWidget
|
||||
|
||||
}
|
||||
|
||||
var fakeStore = {}
|
||||
var fakeStore = {}
|
||||
|
||||
var incrementWidget = function(data, root){
|
||||
|
||||
|
|
@ -92,15 +83,9 @@ var incrementWidget = function(data, root){
|
|||
}
|
||||
}
|
||||
|
||||
delete data.linkId
|
||||
|
||||
var id = data.id,
|
||||
label = data.label,
|
||||
address = data.address
|
||||
|
||||
if (id && id==label) {
|
||||
data.label = 'auto'
|
||||
}
|
||||
if (id && address == '/'+id) {
|
||||
|
||||
data.address = 'auto'
|
||||
|
|
@ -154,7 +139,8 @@ var incrementWidget = function(data, root){
|
|||
}
|
||||
|
||||
module.exports = {
|
||||
updateDom:updateDom,
|
||||
getObjectData:getObjectData,
|
||||
updateWidget:updateWidget,
|
||||
incrementWidget:incrementWidget
|
||||
}
|
||||
|
||||
editor = require('./')
|
||||
|
|
|
|||
184
src/browser/js/app/editor/edit-field.js
Normal file
|
|
@ -0,0 +1,184 @@
|
|||
var widgetCategories = require('../widgets/').categories,
|
||||
{updateWidget} = require('./data-workers'),
|
||||
widgetManager = require('../managers/widgets'),
|
||||
{icon} = require('../ui/utils')
|
||||
|
||||
module.exports = function editField(editor, widget, propName, defaultValue){
|
||||
|
||||
let dynamic = widget.constructor.dynamicProps.includes(propName),
|
||||
disabled = widget.disabledProps.indexOf(propName) > -1
|
||||
|
||||
let field = DOM.create(`
|
||||
<div class="input-wrapper ${widget.errors[propName] ? 'error' : ''} ${disabled ? 'disabled' : ''}">
|
||||
<label ${dynamic ? 'class="dynamic"': ''} title="${widget.errors[propName] || (dynamic ? 'dynamic' : '')}">${propName}</label>
|
||||
</div>
|
||||
`)
|
||||
|
||||
let input
|
||||
|
||||
if (propName !== 'widgets' && propName !== 'tabs') {
|
||||
|
||||
if (propName == 'type') {
|
||||
|
||||
if (widget.props.type == 'tab' || widget.props.type == 'root') return
|
||||
|
||||
input = DOM.create(`<select class="input no-keybinding" title="${propName}"/>`)
|
||||
|
||||
for (let category in widgetCategories) {
|
||||
input.innerHTML += `<optgroup label="> ${category}">`
|
||||
for (let type of widgetCategories[category]) {
|
||||
input.innerHTML += `<option ${type == widget.props.type ? 'selected' : ''} value="${type}">${type}</option>`
|
||||
}
|
||||
input.innerHTML += '</optgroup>'
|
||||
}
|
||||
|
||||
var wrapper = DOM.create('<div class="select-wrapper"></div>')
|
||||
wrapper.appendChild(input)
|
||||
field.appendChild(wrapper)
|
||||
|
||||
|
||||
} else {
|
||||
|
||||
var value = typeof widget.props[propName] !== 'string' ?
|
||||
JSON.stringify(widget.props[propName], null, ' ').replace(/\n\s\s\s\s/g, ' ').replace(/\n\s\s(\}|\])/g, ' $1') : widget.props[propName]
|
||||
|
||||
input = DOM.create(`<textarea class="input no-keybinding" title="${propName}" rows="${value.split('\n').length}">${value}</textarea>`)
|
||||
|
||||
DOM.addEventListener(input, ['input', 'focus'], ()=>{
|
||||
input.setAttribute('rows',0)
|
||||
input.setAttribute('rows', input.value.split('\n').length)
|
||||
})
|
||||
|
||||
input.addEventListener('keydown', (e)=>{
|
||||
if (e.keyCode == 13 && !e.shiftKey) {
|
||||
e.preventDefault()
|
||||
DOM.dispatchEvent(input, 'change')
|
||||
}
|
||||
})
|
||||
|
||||
if (typeof defaultValue === 'boolean') {
|
||||
|
||||
var toggle = DOM.create(`
|
||||
<span class="checkbox ${widget.props[propName] ? 'on' : ''}">
|
||||
${icon('check')}
|
||||
</span>
|
||||
`)
|
||||
|
||||
toggle.addEventListener('click', ()=>{
|
||||
input.value = !widget.getProp(propName)
|
||||
DOM.dispatchEvent(input, 'change')
|
||||
})
|
||||
|
||||
field.appendChild(toggle)
|
||||
|
||||
}
|
||||
|
||||
field.appendChild(input)
|
||||
|
||||
}
|
||||
|
||||
var onChange = ()=>{
|
||||
|
||||
input.removeEventListener('change', onChange)
|
||||
|
||||
var v
|
||||
|
||||
try {
|
||||
v = JSON.parseFlex(input.value)
|
||||
} catch(err) {
|
||||
v = input.value
|
||||
}
|
||||
|
||||
var newWidgets = []
|
||||
for (var w of editor.selectedWidgets) {
|
||||
w.props[propName] = v !== '' ? v : JSON.parse(JSON.stringify(defaultValue))
|
||||
newWidgets.push(updateWidget(w, {preventSelect: editor.selectedWidgets.length > 1}))
|
||||
}
|
||||
editor.pushHistory()
|
||||
if (newWidgets.length > 1) editor.select(newWidgets)
|
||||
|
||||
}
|
||||
|
||||
input.addEventListener('change', onChange)
|
||||
|
||||
|
||||
} else if (
|
||||
(propName === 'widgets' && (!widget.props.tabs ||! widget.props.tabs.length)) ||
|
||||
(propName === 'tabs' && (!widget.props.widgets ||! widget.props.widgets.length))
|
||||
) {
|
||||
|
||||
if (editor.selectedWidgets.length > 1) return
|
||||
|
||||
var list = DOM.create('<ul></ul>')
|
||||
|
||||
for (var i in widget.props[propName]) {
|
||||
|
||||
list.appendChild(DOM.create(`
|
||||
<li class="sortables" data-index="${i}">
|
||||
<a class="btn small" data-action="select">${widget.props[propName][i].id}</a>
|
||||
<span data-action="remove"><i class="fa fa-times"></i></span>
|
||||
</li>
|
||||
`))
|
||||
|
||||
}
|
||||
|
||||
list.appendChild(DOM.create(`
|
||||
<li><a class="btn small" data-action="add">${icon('plus')}</a></li>
|
||||
`))
|
||||
|
||||
|
||||
list.addEventListener('click', (e)=>{
|
||||
// e.stopPropagation()
|
||||
var change
|
||||
switch (e.target.getAttribute('data-action')) {
|
||||
|
||||
case 'select':
|
||||
editor.select(widgetManager.getWidgetByElement(DOM.get(propName === 'widgets' ? widget.widget : widget.wrapper, '> .widget')[DOM.index(e.target.closest('li'))]))
|
||||
break
|
||||
|
||||
case 'remove':
|
||||
widget.props[propName].splice(DOM.index(e.target.closest('li')),1)
|
||||
change = true
|
||||
break
|
||||
|
||||
case 'add':
|
||||
widget.props[propName] = widget.props[propName] || []
|
||||
widget.props[propName].push({})
|
||||
change = true
|
||||
break
|
||||
|
||||
}
|
||||
|
||||
if (change) {
|
||||
updateWidget(widget)
|
||||
editor.pushHistory()
|
||||
}
|
||||
|
||||
})
|
||||
|
||||
var $list = $(list)
|
||||
$list.sortable({
|
||||
items: '.sortables',
|
||||
placeholder: 'sortable-placeholder btn small',
|
||||
start:function(){$(this).sortable( 'refreshPositions' )},
|
||||
update: function(e,ui){
|
||||
var oldindex = $(ui.item).attr('data-index')
|
||||
var index = $(ui.item).index()
|
||||
|
||||
widget.props[propName].splice(index, 0, widget.props[propName].splice(oldindex, 1)[0])
|
||||
updateWidget(widget)
|
||||
editor.pushHistory()
|
||||
}
|
||||
})
|
||||
|
||||
input = DOM.create('<div class="input column"></div>')
|
||||
input.appendChild(list)
|
||||
field.appendChild(input)
|
||||
|
||||
}
|
||||
|
||||
if (input) {
|
||||
return field
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -1,287 +0,0 @@
|
|||
var updateDom = require('./data-workers').updateDom,
|
||||
{widgets, categories} = require('../widgets/'),
|
||||
{icon} = require('../utils'),
|
||||
defaults = {}
|
||||
|
||||
for (var k in widgets) {
|
||||
defaults[k] = widgets[k].defaults()
|
||||
}
|
||||
|
||||
var ev = 'fake-click'
|
||||
|
||||
var editClean = function(){
|
||||
$('.editing').removeClass('editing')
|
||||
$('.widget.ui-resizable').resizable('destroy')
|
||||
$('.widget.ui-draggable').draggable('destroy').find('.ui-draggable-handle').remove()
|
||||
$('.editor-container').remove()
|
||||
}
|
||||
|
||||
|
||||
var editObject = function(container, data, refresh){
|
||||
|
||||
if (!refresh && (container.hasClass('editing') || $(`a[data-tab="#${container.attr('id')}"]`).hasClass('editing'))) return
|
||||
|
||||
editClean()
|
||||
|
||||
$(`[data-widget="${container.attr('data-widget')}"]`).addClass('editing')
|
||||
|
||||
$('#editor').append('<div class="editor-container"></div>')
|
||||
|
||||
var form = $('<div class="form"></div>')
|
||||
|
||||
var params = defaults[data.type]
|
||||
|
||||
$(`<div class="separator"><span>${data.type == 'tab' ? 'Tab' : data.type == 'root' ? 'Root' : 'Widget'}</span></div>`).appendTo(form)
|
||||
|
||||
for (var i in params) {
|
||||
|
||||
if (i.indexOf('_')==0) {
|
||||
$(`<div class="separator"><span>${params[i]}</span></div>`).appendTo(form)
|
||||
continue
|
||||
} else if (data[i]===undefined) {
|
||||
continue
|
||||
}
|
||||
|
||||
// Common options edit
|
||||
if (i!='widgets' && i!='tabs') {
|
||||
|
||||
if (i=='type' && (data.type == 'tab' || data.type == 'root')) continue
|
||||
|
||||
let type = typeof data[i],
|
||||
value = type != 'string'?JSON.stringify(data[i], null, ' ').replace(/\n\s\s\s\s/g, ' ').replace(/\n\s\s(\}|\])/g, ' $1'):data[i],
|
||||
wrapper = $('<div class="input-wrapper"></div>').appendTo(form),
|
||||
label = $(`<label>${i}</label>`).appendTo(wrapper),
|
||||
input
|
||||
|
||||
if (i=='type') {
|
||||
|
||||
input = $(`<select class="input" data-type="${type}" title="${i}"/>`)
|
||||
|
||||
for (let c in categories) {
|
||||
input.append(`<optgroup label="> ${c}">`)
|
||||
for (let t of categories[c]) {
|
||||
input.append(`<option ${t==value?'selected=':''} value="${t}">${t}</option>`)
|
||||
}
|
||||
input.append(`</optgroup>`)
|
||||
}
|
||||
let select = $('<div class="select-wrapper"></div>').append(input)
|
||||
select.appendTo(wrapper)
|
||||
|
||||
} else {
|
||||
|
||||
input = $(`<textarea class="input" data-type="${type}" title="${i}" rows="${value.split('\n').length}">${value}</textarea>`)
|
||||
input.on('input focus', function(){
|
||||
this.setAttribute('rows',0)
|
||||
this.setAttribute('rows',input.val().split('\n').length)
|
||||
})
|
||||
input.on('keydown', (e)=>{
|
||||
if (e.keyCode == 13 && !e.shiftKey) {
|
||||
e.preventDefault()
|
||||
input.trigger('change')
|
||||
}
|
||||
})
|
||||
input.appendTo(wrapper)
|
||||
|
||||
}
|
||||
|
||||
if (typeof params[i]=='boolean') {
|
||||
|
||||
var toggle = $(`<span class="checkbox ${data[i]?'on':''}">${icon('check')}</span>`)
|
||||
toggle.appendTo(wrapper)
|
||||
|
||||
toggle.click(function(){
|
||||
input.val(!eval(input.val())).trigger('change')
|
||||
})
|
||||
|
||||
}
|
||||
|
||||
input.on('change',function(){
|
||||
|
||||
var title = input.attr('title'),
|
||||
v
|
||||
|
||||
try {
|
||||
v = JSON.parseFlex(input.val())
|
||||
} catch(err) {
|
||||
v = input.val()
|
||||
}
|
||||
|
||||
data[title] = v
|
||||
|
||||
if (v==='') delete data[title]
|
||||
|
||||
try {
|
||||
var w = updateDom(container,data)
|
||||
if (title == 'value' && v != '') {
|
||||
w[0].abstract.setValue(v, {sync:true})
|
||||
}
|
||||
wrapper.removeClass('error')
|
||||
} catch (err) {
|
||||
wrapper.addClass('error')
|
||||
throw err
|
||||
}
|
||||
})
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
// widget list edit
|
||||
if ((params.widgets || (container.hasClass('tab'))) && (!data.tabs||!data.tabs.length)) {
|
||||
|
||||
$(`<div class="separator"><span>Widgets</span></div>`).appendTo(form)
|
||||
|
||||
var list = $('<ul class="input"></ul>'),
|
||||
wrapper = $('<div class="input-wrapper column"></div>').appendTo(form)
|
||||
|
||||
var editItem = function(i) {
|
||||
return function(){
|
||||
container.find('.widget').first().siblings().addBack().eq(i).trigger(ev)
|
||||
}
|
||||
}
|
||||
|
||||
for (var i in data.widgets) {
|
||||
|
||||
|
||||
var item = $(`<li data-index="${i}" class="sortables" data-id="${data.widgets[i].id}"><a class="btn small">${data.widgets[i].id||data.widgets[i].label}</a></li>`)
|
||||
.appendTo(list)
|
||||
.click(editItem(i))
|
||||
|
||||
var remove = $('<span><i class="fa fa-remove"></i></span>')
|
||||
.appendTo(item)
|
||||
.click(function(e){
|
||||
e.stopPropagation()
|
||||
data.widgets.splice($(this).parent().attr('data-index'),1)
|
||||
updateDom(container,data)
|
||||
})
|
||||
}
|
||||
|
||||
list.sortable({
|
||||
items: '.sortables',
|
||||
placeholder: "sortable-placeholder btn small",
|
||||
start:function(){$(this).sortable( "refreshPositions" )},
|
||||
update: function(e,ui){
|
||||
var prevIndex = $(ui.item).attr('data-index')
|
||||
var newIndex = $(ui.item).index()
|
||||
|
||||
data.widgets.splice(newIndex, 0, data.widgets.splice(prevIndex, 1)[0])
|
||||
|
||||
updateDom(container,data)
|
||||
}
|
||||
})
|
||||
|
||||
var add = $(`<li><a class="btn small">${icon('plus')}</a></li>`).appendTo(list).click(function(){
|
||||
data.widgets = data.widgets || []
|
||||
data.widgets.push({})
|
||||
|
||||
updateDom(container,data)
|
||||
})
|
||||
|
||||
list.appendTo(wrapper)
|
||||
|
||||
}
|
||||
|
||||
// tab list edit
|
||||
if ((params.tabs || (container.hasClass('tab'))) && (!data.widgets||!data.widgets.length)) {
|
||||
|
||||
$(`<div class="separator"><span>Tabs</span></div>`).appendTo(form)
|
||||
|
||||
//tabs
|
||||
var list = $('<ul class="input"></ul>'),
|
||||
wrapper = $('<div class="input-wrapper column"></div>').appendTo(form)
|
||||
|
||||
|
||||
var editItem = function(i) {
|
||||
return function(){
|
||||
container.find('.tablist li').first().siblings().addBack().eq(i).trigger(ev)
|
||||
}
|
||||
}
|
||||
|
||||
for (var i in data.tabs) {
|
||||
var item = $(`<li data-index="${i}" class="sortables"><a class="btn small">${data.tabs[i].id}</a></li>`)
|
||||
.appendTo(list)
|
||||
.click(editItem(i))
|
||||
|
||||
var remove = $('<span><i class="fa fa-remove"></i></span>')
|
||||
.appendTo(item)
|
||||
.click(function(e){
|
||||
e.stopPropagation()
|
||||
data.tabs.splice($(this).parent().attr('data-index'),1)
|
||||
updateDom(container,data)
|
||||
})
|
||||
}
|
||||
|
||||
list.sortable({
|
||||
items: '.sortables',
|
||||
placeholder: "sortable-placeholder btn small",
|
||||
start:function(){$(this).sortable( "refreshPositions" )},
|
||||
update: function(e,ui){
|
||||
var prevIndex = $(ui.item).attr('data-index')
|
||||
var newIndex = $(ui.item).index()
|
||||
|
||||
data.tabs.splice(newIndex, 0, data.tabs.splice(prevIndex, 1)[0])
|
||||
|
||||
updateDom(container,data)
|
||||
}
|
||||
})
|
||||
|
||||
var add = $(`<li><a class="btn small">${icon('plus')}</a></li>`).appendTo(list).click(function(){
|
||||
data.tabs = data.tabs || []
|
||||
data.tabs.push({})
|
||||
|
||||
updateDom(container,data)
|
||||
})
|
||||
|
||||
list.appendTo(wrapper)
|
||||
}
|
||||
|
||||
if (data.hasOwnProperty('width') || data.hasOwnProperty('height')) {
|
||||
var handleTarget
|
||||
container.resizable({
|
||||
handles: 's, e, se',
|
||||
helper: "ui-helper",
|
||||
start: function(event, ui){
|
||||
handleTarget = $(event.originalEvent.target)
|
||||
},
|
||||
resize: function(event, ui) {
|
||||
ui.size.height = Math.round(ui.size.height / (GRIDWIDTH * PXSCALE)) * GRIDWIDTH * PXSCALE
|
||||
ui.size.width = Math.round(ui.size.width / (GRIDWIDTH * PXSCALE)) * GRIDWIDTH * PXSCALE
|
||||
},
|
||||
stop: function( event, ui ) {
|
||||
if (handleTarget.hasClass('ui-resizable-se') || handleTarget.hasClass('ui-resizable-s')) data.height = Math.round((Math.max(ui.size.height,1)) / (GRIDWIDTH * PXSCALE)) * GRIDWIDTH
|
||||
if (handleTarget.hasClass('ui-resizable-se') || handleTarget.hasClass('ui-resizable-e')) data.width = Math.round(ui.size.width / (GRIDWIDTH * PXSCALE)) * GRIDWIDTH
|
||||
updateDom(container,data)
|
||||
},
|
||||
grid: [GRIDWIDTH * PXSCALE, GRIDWIDTH * PXSCALE]
|
||||
})
|
||||
}
|
||||
|
||||
if (data.hasOwnProperty('top')) {
|
||||
container.draggable({
|
||||
cursor:'-webkit-grabbing',
|
||||
drag: function(event, ui) {
|
||||
ui.position.top = Math.round(ui.position.top / (GRIDWIDTH * PXSCALE)) * GRIDWIDTH * PXSCALE
|
||||
ui.position.left = Math.round(ui.position.left / (GRIDWIDTH * PXSCALE)) * GRIDWIDTH * PXSCALE
|
||||
},
|
||||
stop: function( event, ui ) {
|
||||
event.preventDefault()
|
||||
data.top = (ui.helper.position().top + container.parent().scrollTop())/PXSCALE
|
||||
data.left = (ui.helper.position().left + container.parent().scrollLeft())/PXSCALE
|
||||
ui.helper.remove()
|
||||
updateDom(container,data)
|
||||
},
|
||||
handle:'.ui-draggable-handle, > .label',
|
||||
grid: [GRIDWIDTH * PXSCALE, GRIDWIDTH * PXSCALE],
|
||||
helper:function(){return $('<div class="ui-helper"></div>').css({height:container.outerHeight(),width:container.outerWidth()})}
|
||||
}).append('<div class="ui-draggable-handle"></div>')
|
||||
}
|
||||
|
||||
form.appendTo('.editor-container')
|
||||
|
||||
}
|
||||
|
||||
|
||||
module.exports = {
|
||||
editObject:editObject,
|
||||
editClean:editClean
|
||||
}
|
||||
|
|
@ -1,12 +1,107 @@
|
|||
var init = require('./init')
|
||||
var {widgets} = require('../widgets/'),
|
||||
{Popup} = require('../ui/utils'),
|
||||
editField = require('./edit-field'),
|
||||
{updateWidget, incrementWidget} = require('./data-workers'),
|
||||
keyboardJS = require('keyboardjs'),
|
||||
diff = require('deep-diff'),
|
||||
widgetManager = require('../managers/widgets'),
|
||||
{deepCopy} = require('../utils'),
|
||||
sessionManager
|
||||
|
||||
const HISTORY_SIZE = 50
|
||||
|
||||
var Editor = class Editor {
|
||||
|
||||
constructor() {
|
||||
|
||||
$(document).ready(()=>{
|
||||
this.wrapper = DOM.create(`
|
||||
<div class="editor-container">
|
||||
<div class="form" id="editor-form">
|
||||
</div>
|
||||
</div>
|
||||
`)
|
||||
this.form = DOM.get(this.wrapper, '#editor-form')[0]
|
||||
|
||||
this.defaults = {}
|
||||
for (var k in widgets) {
|
||||
this.defaults[k] = widgets[k].defaults()
|
||||
}
|
||||
|
||||
this.selectedWidgets = []
|
||||
|
||||
this.clipboard = null
|
||||
this.idClipboard = null
|
||||
|
||||
this.enabled = false
|
||||
this.enabledOnce = false
|
||||
window.onbeforeunload = ()=>{
|
||||
if (this.enabledOnce) return true
|
||||
}
|
||||
|
||||
|
||||
this.history = []
|
||||
this.historyState = -1
|
||||
this.historySession = null
|
||||
|
||||
this.mousePosition = {x:0, y:0}
|
||||
this.mouveMoveHandler = this.mouseMove.bind(this)
|
||||
|
||||
keyboardJS.withContext('editing', ()=>{
|
||||
keyboardJS.bind('mod + z', (e)=>{
|
||||
if (e.target.classList.contains('no-keybinding')) return
|
||||
this.undo()
|
||||
})
|
||||
keyboardJS.bind(['mod + y', 'mod + shift + z'], (e)=>{
|
||||
if (e.target.classList.contains('no-keybinding')) return
|
||||
this.redo()
|
||||
})
|
||||
keyboardJS.bind('mod + c', (e)=>{
|
||||
if (e.target.classList.contains('no-keybinding')) return
|
||||
this.copyWidget()
|
||||
})
|
||||
keyboardJS.bind('mod + x', (e)=>{
|
||||
if (e.target.classList.contains('no-keybinding')) return
|
||||
this.cutWidget()
|
||||
})
|
||||
keyboardJS.bind('mod + v', (e)=>{
|
||||
if (e.target.classList.contains('no-keybinding')) return
|
||||
this.pasteWidget(this.mousePosition.x, this.mousePosition.y, false)
|
||||
})
|
||||
keyboardJS.bind('mod + shift + v', (e)=>{
|
||||
if (e.target.classList.contains('no-keybinding')) return
|
||||
this.pasteWidget(this.mousePosition.x, this.mousePosition.y, true)
|
||||
})
|
||||
keyboardJS.bind('delete', (e)=>{
|
||||
if (e.target.classList.contains('no-keybinding')) return
|
||||
this.deleteWidget()
|
||||
})
|
||||
keyboardJS.bind(['alt + up', 'alt + down', 'alt + right', 'alt + left'], (e)=>{
|
||||
if (e.target.classList.contains('no-keybinding')) return
|
||||
|
||||
var deltaW = e.key === 'ArrowLeft' ? -GRIDWIDTH : e.key === 'ArrowRight' ? GRIDWIDTH : 0,
|
||||
deltaH = e.key === 'ArrowUp' ? -GRIDWIDTH : e.key === 'ArrowDown' ? GRIDWIDTH : 0
|
||||
|
||||
if (e.shiftKey) {
|
||||
deltaW *= 5
|
||||
deltaH *= 5
|
||||
}
|
||||
|
||||
this.resizeWidget(deltaW, deltaH)
|
||||
})
|
||||
keyboardJS.bind(['up', 'down', 'right', 'left'], (e)=>{
|
||||
if (e.target.classList.contains('no-keybinding')) return
|
||||
|
||||
var deltaX = e.key === 'ArrowLeft' ? -GRIDWIDTH : e.key === 'ArrowRight' ? GRIDWIDTH : 0,
|
||||
deltaY = e.key === 'ArrowUp' ? -GRIDWIDTH : e.key === 'ArrowDown' ? GRIDWIDTH : 0
|
||||
|
||||
if (e.shiftKey) {
|
||||
deltaX *= 5
|
||||
deltaY *= 5
|
||||
}
|
||||
|
||||
this.moveWidget(deltaX, deltaY)
|
||||
})
|
||||
|
||||
init()
|
||||
|
||||
})
|
||||
|
||||
|
|
@ -14,60 +109,628 @@ var Editor = class Editor {
|
|||
|
||||
enable() {
|
||||
|
||||
GRIDWIDTH = getComputedStyle(document.documentElement).getPropertyValue("--grid-width")
|
||||
|
||||
$('.editor-root').attr('data-widget', $('.root-container').attr('data-widget')).removeClass('disabled')
|
||||
$('.enable-editor').addClass('on')
|
||||
$('.disable-editor').removeClass('on')
|
||||
$('body').addClass('editor-enabled')
|
||||
.toggleClass('no-grid', GRIDWIDTH==1)
|
||||
|
||||
EDITING = true
|
||||
this.enabled = true
|
||||
|
||||
var f = $('<div class="form" id="grid-width-input"></div>'),
|
||||
h = $('<div class="separator"><span>Grid</span></div>').appendTo(f),
|
||||
w = $('<div class="input-wrapper"><label>Width</label></div>').appendTo(f),
|
||||
i = $('<input class="input" type="number" step="1" min="1" max="100"></div>').appendTo(w)
|
||||
this.enabledOnce = true
|
||||
|
||||
i.val(GRIDWIDTH)
|
||||
i.on('keyup mouseup change mousewheel',()=>{
|
||||
setTimeout(()=>{
|
||||
var v = Math.max(Math.min(parseInt(i.val()),100),1)
|
||||
if (isNaN(v)) return
|
||||
i.val(v)
|
||||
GRIDWIDTH = v
|
||||
$('body').toggleClass('no-grid', GRIDWIDTH==1)
|
||||
document.documentElement.style.setProperty("--grid-width",GRIDWIDTH)
|
||||
DOM.get('.editor-root')[0].setAttribute('data-widget', DOM.get('.root-container')[0].getAttribute('data-widget'))
|
||||
DOM.get('.editor-root')[0].classList.remove('disabled')
|
||||
DOM.get('.disable-editor')[0].classList.remove('on')
|
||||
DOM.get('.enable-editor')[0].classList.add('on')
|
||||
document.body.classList.add('editor-enabled')
|
||||
document.body.classList.toggle('no-grid', GRIDWIDTH == 1)
|
||||
|
||||
|
||||
GRIDWIDTH = parseFloat(getComputedStyle(document.documentElement).getPropertyValue('--grid-width'))
|
||||
|
||||
var gridForm = DOM.create(`
|
||||
<div class="form" id="grid-width-form">
|
||||
<div class="separator"><span>Grid</span></div>
|
||||
<div class="input-wrapper">
|
||||
<label>Width</label>
|
||||
<input class="input" type="number" id="grid-width-input" step="1" min="1" max="100" value="${GRIDWIDTH}"/>
|
||||
</div>
|
||||
</div>
|
||||
`)
|
||||
|
||||
DOM.each(gridForm, '#grid-width-input', (input)=>{
|
||||
DOM.addEventListener(input, 'keyup mouseup change mousewheel', (e)=>{
|
||||
setTimeout(()=>{
|
||||
var v = Math.max(Math.min(parseInt(input.value), 100), 1)
|
||||
if (isNaN(v)) return
|
||||
input.value = v
|
||||
GRIDWIDTH = v
|
||||
document.body.classList.toggle('no-grid', GRIDWIDTH == 1)
|
||||
document.documentElement.style.setProperty('--grid-width', GRIDWIDTH)
|
||||
})
|
||||
})
|
||||
})
|
||||
$('.editor-menu').append(f)
|
||||
|
||||
DOM.get(document, '.editor-menu')[0].appendChild(gridForm)
|
||||
|
||||
keyboardJS.setContext('editing')
|
||||
|
||||
document.body.addEventListener('mousemove', this.mouveMoveHandler)
|
||||
|
||||
}
|
||||
|
||||
disable() {
|
||||
|
||||
$('.widget.ui-resizable').resizable('destroy')
|
||||
$('.widget.ui-draggable').draggable('destroy').find('.ui-draggable-handle').remove()
|
||||
$('.editing').removeClass('editing')
|
||||
$('.editor-root').addClass('disabled')
|
||||
$('.editor-container').remove()
|
||||
$('.disable-editor').addClass('on')
|
||||
$('.enable-editor').removeClass('on')
|
||||
$('body').removeClass('editor-enabled')
|
||||
$('#grid-width-input').remove()
|
||||
|
||||
EDITING = false
|
||||
this.enabled = false
|
||||
|
||||
if (READ_ONLY) {
|
||||
this.enable = ()=>{}
|
||||
$('.editor-menu .btn').remove()
|
||||
$('.editor-menu .title').html($('.editor-menu .title').html() + ' (disabled)').addClass('disabled')
|
||||
return
|
||||
}
|
||||
|
||||
this.unselect()
|
||||
this.selectedWidgets = []
|
||||
DOM.get('.editor-root')[0].classList.add('disabled')
|
||||
DOM.get('.disable-editor')[0].classList.add('on')
|
||||
DOM.get('.enable-editor')[0].classList.remove('on')
|
||||
document.body.classList.remove('editor-enabled')
|
||||
|
||||
var gridForm = DOM.get('#grid-width-form')[0]
|
||||
if (gridForm) gridForm.parentNode.removeChild(gridForm)
|
||||
|
||||
keyboardJS.setContext('global')
|
||||
|
||||
document.body.removeEventListener('mousemove', this.mouveMoveHandler)
|
||||
|
||||
}
|
||||
|
||||
unselect() {
|
||||
|
||||
DOM.get('#editor')[0].innerHTML = ''
|
||||
|
||||
this.form.innerHTML = ''
|
||||
|
||||
DOM.each(document, '.editing', (element)=>{
|
||||
element.classList.remove('editing')
|
||||
})
|
||||
|
||||
$('.widget.ui-resizable').resizable('destroy')
|
||||
$('.widget.ui-draggable').draggable('destroy').find('.ui-draggable-handle').remove()
|
||||
|
||||
}
|
||||
|
||||
select(widget, options={}){
|
||||
|
||||
this.unselect()
|
||||
|
||||
if (Array.isArray(widget)) {
|
||||
|
||||
this.selectedWidgets = widget
|
||||
|
||||
} else if (options.multi) {
|
||||
|
||||
if (!this.selectedWidgets.includes(widget)) {
|
||||
|
||||
var sameLevel = true
|
||||
for (var w of this.selectedWidgets) {
|
||||
if (w.parent !== widget.parent) sameLevel = false
|
||||
}
|
||||
|
||||
|
||||
if (sameLevel) this.selectedWidgets.push(widget)
|
||||
|
||||
} else {
|
||||
|
||||
this.selectedWidgets.splice(this.selectedWidgets.indexOf(widget), 1)
|
||||
|
||||
}
|
||||
|
||||
} else {
|
||||
|
||||
if (!options.refresh && (widget.container.classList.contains('editing'))) return
|
||||
|
||||
this.selectedWidgets = [widget]
|
||||
|
||||
|
||||
}
|
||||
|
||||
if (this.selectedWidgets.length > 0) {
|
||||
|
||||
this.createEditForm()
|
||||
this.createSelectionBlock()
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
createEditForm(){
|
||||
|
||||
var widget = this.selectedWidgets[0],
|
||||
props = this.defaults[widget.props.type]
|
||||
|
||||
this.form.appendChild(DOM.create(`
|
||||
<div class="separator">
|
||||
${this.selectedWidgets.length > 1 ?
|
||||
'<span class="accent">Multiple Widgets</span>' :
|
||||
'<span>Widget</span>'
|
||||
}
|
||||
</div>
|
||||
`))
|
||||
|
||||
for (let propName in props) {
|
||||
|
||||
let field,
|
||||
shared = true
|
||||
|
||||
for (var w of this.selectedWidgets) {
|
||||
if (this.defaults[w.props.type][propName] === undefined) {
|
||||
shared = false
|
||||
}
|
||||
}
|
||||
|
||||
if (!shared) continue
|
||||
|
||||
if (propName.indexOf('_') == 0) {
|
||||
|
||||
field = DOM.create(`<div class="separator"><span>${props[propName]}</span></div>`)
|
||||
|
||||
} else if (widget.props[propName] === undefined) {
|
||||
|
||||
continue
|
||||
|
||||
} else {
|
||||
|
||||
field = editField(this, widget, propName, props[propName])
|
||||
if (!field) continue
|
||||
|
||||
}
|
||||
|
||||
this.form.appendChild(field)
|
||||
|
||||
}
|
||||
|
||||
this.wrapper.appendChild(this.form)
|
||||
DOM.get('#editor')[0].appendChild(this.wrapper)
|
||||
|
||||
}
|
||||
|
||||
createSelectionBlock(){
|
||||
|
||||
DOM.each(document, '.editing', (element)=>{
|
||||
element.classList.remove('editing')
|
||||
})
|
||||
|
||||
for (let widget of this.selectedWidgets) {
|
||||
DOM.each(document, `[data-widget="${widget.hash}"]`, (item)=>{
|
||||
item.classList.add('editing')
|
||||
})
|
||||
}
|
||||
|
||||
var widget = this.selectedWidgets[0]
|
||||
|
||||
if (widget.props.height !== undefined || widget.props.width !== undefined) {
|
||||
|
||||
let $container = $(widget.container)
|
||||
$container.resizable({
|
||||
handles: 's, e, se',
|
||||
helper: 'ui-helper',
|
||||
resize: (event, ui)=>{
|
||||
ui.size.height = Math.round(ui.size.height / (GRIDWIDTH * PXSCALE)) * GRIDWIDTH * PXSCALE
|
||||
ui.size.width = Math.round(ui.size.width / (GRIDWIDTH * PXSCALE)) * GRIDWIDTH * PXSCALE
|
||||
},
|
||||
stop: (event, ui)=>{
|
||||
|
||||
var deltaH = ui.size.height - ui.originalSize.height,
|
||||
deltaW = ui.size.width - ui.originalSize.width
|
||||
|
||||
this.resizeWidget(deltaW, deltaH, ui)
|
||||
|
||||
},
|
||||
grid: [GRIDWIDTH * PXSCALE, GRIDWIDTH * PXSCALE]
|
||||
})
|
||||
|
||||
}
|
||||
|
||||
if (widget.props.top !== undefined) {
|
||||
let $container = $(widget.container)
|
||||
$container.draggable({
|
||||
cursor:'-webkit-grabbing',
|
||||
drag: (event, ui)=>{
|
||||
ui.position.top = Math.round(ui.position.top / (GRIDWIDTH * PXSCALE)) * GRIDWIDTH * PXSCALE
|
||||
ui.position.left = Math.round(ui.position.left / (GRIDWIDTH * PXSCALE)) * GRIDWIDTH * PXSCALE
|
||||
},
|
||||
stop: (event, ui)=>{
|
||||
event.preventDefault()
|
||||
|
||||
var deltaX = (ui.helper.position().left + $container.parent().scrollLeft()) / PXSCALE - widget.container.offsetLeft / PXSCALE,
|
||||
deltaY = (ui.helper.position().top + $container.parent().scrollTop()) / PXSCALE - widget.container.offsetTop / PXSCALE
|
||||
|
||||
this.moveWidget(deltaX, deltaY)
|
||||
|
||||
ui.helper.remove()
|
||||
},
|
||||
handle:'.ui-draggable-handle, > .label',
|
||||
grid: [GRIDWIDTH * PXSCALE, GRIDWIDTH * PXSCALE],
|
||||
helper:()=>{
|
||||
return $('<div class="ui-helper"></div>').css({height:$container.outerHeight(),width:$container.outerWidth()})
|
||||
}
|
||||
}).append('<div class="ui-draggable-handle"></div>')
|
||||
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
mouseMove(e) {
|
||||
|
||||
this.mousePosition.x = Math.round((e.offsetX + e.target.scrollLeft) / (GRIDWIDTH * PXSCALE)) * GRIDWIDTH,
|
||||
this.mousePosition.y = Math.round((e.offsetY + e.target.scrollTop) / (GRIDWIDTH * PXSCALE)) * GRIDWIDTH
|
||||
|
||||
}
|
||||
|
||||
copyWidget() {
|
||||
|
||||
var data = this.selectedWidgets.map((w)=>w.props),
|
||||
type = this.selectedWidgets[0].props.type == 'tab' ? 'tab' : 'widget'
|
||||
|
||||
|
||||
if (type !== 'widget') return
|
||||
|
||||
this.clipboard = JSON.stringify(data)
|
||||
|
||||
if (data.length == 1) {
|
||||
this.idClipboard = this.selectedWidgets[0].getProp('id')
|
||||
} else {
|
||||
this.idClipboard =null
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
cutWidget() {
|
||||
|
||||
var index = this.selectedWidgets.map((w)=>DOM.index(w.container)).sort((a,b)=>{return b-a}),
|
||||
data = this.selectedWidgets.map((w)=>w.props),
|
||||
type = this.selectedWidgets[0].props.type == 'tab' ? 'tab' : 'widget',
|
||||
parent = editor.selectedWidgets[0].parent
|
||||
|
||||
if (type !== 'widget') return
|
||||
|
||||
this.clipboard = JSON.stringify(data)
|
||||
|
||||
if (data.length == 1) {
|
||||
this.idClipboard = this.selectedWidgets[0].getProp('id')
|
||||
} else {
|
||||
this.idClipboard =null
|
||||
}
|
||||
|
||||
for (var i of index) {
|
||||
parent.props.widgets.splice(i,1)
|
||||
}
|
||||
|
||||
this.select(updateWidget(parent, {preventSelect: true}))
|
||||
this.pushHistory()
|
||||
|
||||
}
|
||||
|
||||
pasteWidget(x, y, increment) {
|
||||
|
||||
if (this.clipboard === null) return
|
||||
|
||||
var data = this.selectedWidgets.map((w)=>w.props)
|
||||
|
||||
var pastedData = JSON.parse(editor.clipboard),
|
||||
minTop = Infinity,
|
||||
minLeft = Infinity
|
||||
|
||||
for (var i in pastedData) {
|
||||
if (increment) pastedData[i] = incrementWidget(pastedData[i])
|
||||
if (!isNaN(pastedData[i]).top && pastedData[i].top < minTop) {
|
||||
minTop = pastedData[i].top
|
||||
}
|
||||
if (!isNaN(pastedData[i]).left && pastedData[i].left < minLeft) {
|
||||
minLeft = pastedData[i].left
|
||||
}
|
||||
}
|
||||
|
||||
for (let i in pastedData) {
|
||||
|
||||
if (!isNaN(pastedData[i].left)) pastedData[i].left = pastedData[i].left - minLeft + x
|
||||
if (!isNaN(pastedData[i].top)) pastedData[i].top = pastedData[i].top - minTop + y
|
||||
|
||||
}
|
||||
|
||||
data[0].widgets = data[0].widgets || []
|
||||
data[0].widgets = data[0].widgets.concat(pastedData)
|
||||
|
||||
updateWidget(this.selectedWidgets[0])
|
||||
this.pushHistory()
|
||||
|
||||
}
|
||||
|
||||
pasteWidgetAsClone(x, y) {
|
||||
|
||||
if (this.clipboard === null || !(this.idClipboard && widgetManager.getWidgetById(this.idClipboard).length)) return
|
||||
|
||||
var data = this.selectedWidgets.map((w)=>w.props)
|
||||
|
||||
var clone = {type: 'clone', widgetId: this.idClipboard},
|
||||
pastedData = JSON.parse(this.clipboard)
|
||||
|
||||
clone.width = pastedData.width
|
||||
clone.height = pastedData.width
|
||||
clone.css = pastedData.css
|
||||
|
||||
|
||||
clone.left = x
|
||||
clone.top = y
|
||||
|
||||
data[0].widgets = data[0].widgets || []
|
||||
data[0].widgets.push(clone)
|
||||
|
||||
updateWidget(this.selectedWidgets[0])
|
||||
this.pushHistory()
|
||||
|
||||
}
|
||||
|
||||
|
||||
deleteWidget() {
|
||||
|
||||
var index = this.selectedWidgets.map((w)=>DOM.index(w.container)).sort((a,b)=>{return b-a}),
|
||||
type = this.selectedWidgets[0].props.type == 'tab' ? 'tab' : 'widget',
|
||||
parent = this.selectedWidgets[0].parent
|
||||
|
||||
var popup = new Popup({
|
||||
title: 'Are you sure ?',
|
||||
content:`
|
||||
<div class="actions">
|
||||
<a class="btn warning confirm-delete">DELETE</a>
|
||||
<a class="btn cancel-delete">CANCEL</a>
|
||||
</div>`,
|
||||
closable: false,
|
||||
escKey: true,
|
||||
enterKey: function(){DOM.get(this.html, '.confirm-delete')[0].click()}
|
||||
})
|
||||
|
||||
DOM.get(popup.html, '.confirm-delete')[0].addEventListener('click', ()=>{
|
||||
|
||||
popup.close()
|
||||
|
||||
if (type === 'widget') {
|
||||
for (let i of index) {
|
||||
parent.props.widgets.splice(i,1)
|
||||
}
|
||||
} else {
|
||||
for (let i of index) {
|
||||
parent.props.tabs.splice(i,1)
|
||||
}
|
||||
}
|
||||
|
||||
this.select(updateWidget(parent, {preventSelect: true}))
|
||||
this.pushHistory()
|
||||
|
||||
})
|
||||
|
||||
DOM.get(popup.html, '.cancel-delete')[0].addEventListener('click', function(){
|
||||
popup.close()
|
||||
})
|
||||
|
||||
}
|
||||
|
||||
resizeWidget(deltaW, deltaH, ui) {
|
||||
|
||||
var newWidgets = []
|
||||
|
||||
for (var i = 0; i < this.selectedWidgets.length; i++) {
|
||||
|
||||
let w = this.selectedWidgets[i],
|
||||
nW, nH
|
||||
|
||||
if (i === 0 && ui) {
|
||||
nW = ui.originalSize.width + deltaW
|
||||
nH = ui.originalSize.height + deltaH
|
||||
|
||||
} else {
|
||||
nW = w.container.offsetWidth + deltaW
|
||||
nH = w.container.offsetHeight + deltaH
|
||||
}
|
||||
|
||||
if (w.props.width !== undefined) {
|
||||
var newWidth = Math.max(nW, GRIDWIDTH) / PXSCALE
|
||||
if (typeof w.props.width === 'string' && w.props.width.indexOf('%') > -1) {
|
||||
w.props.width = (100 * PXSCALE * newWidth / w.container.parentNode.offsetWidth).toFixed(2) + '%'
|
||||
} else {
|
||||
w.props.width = newWidth
|
||||
}
|
||||
}
|
||||
|
||||
if (w.props.height !== undefined) {
|
||||
var newHeight = Math.max(nH, GRIDWIDTH) / PXSCALE
|
||||
if (typeof w.props.height === 'string' && w.props.height.indexOf('%') > -1) {
|
||||
w.props.height = (100 * PXSCALE * newHeight / w.container.parentNode.offsetHeight).toFixed(2) + '%'
|
||||
} else {
|
||||
w.props.height = newHeight
|
||||
}
|
||||
}
|
||||
|
||||
if (w.props.width !== undefined || w.props.height !== undefined) newWidgets.push(updateWidget(w, {preventSelect: this.selectedWidgets.length > 1}))
|
||||
|
||||
}
|
||||
|
||||
this.pushHistory()
|
||||
|
||||
if (newWidgets.length > 1) this.select(newWidgets, {preventSelect: this.selectedWidgets.length > 1})
|
||||
|
||||
}
|
||||
|
||||
moveWidget(deltaX, deltaY) {
|
||||
|
||||
var newWidgets = []
|
||||
|
||||
for (var w of this.selectedWidgets) {
|
||||
|
||||
var newTop = w.container.offsetTop / PXSCALE + deltaY
|
||||
if (typeof w.props.top === 'string' && w.props.top.indexOf('%') > -1) {
|
||||
w.props.top = (100 * PXSCALE * newTop / w.container.parentNode.offsetHeight).toFixed(2) + '%'
|
||||
} else {
|
||||
w.props.top = newTop
|
||||
}
|
||||
var newLeft = w.container.offsetLeft / PXSCALE + deltaX
|
||||
if (typeof w.props.left === 'string' && w.props.left.indexOf('%') > -1) {
|
||||
w.props.left = (100 * PXSCALE * newLeft / w.container.parentNode.offsetWidth).toFixed(2) + '%'
|
||||
} else {
|
||||
w.props.left = newLeft
|
||||
}
|
||||
|
||||
newWidgets.push(updateWidget(w, {preventSelect: this.selectedWidgets.length > 1}))
|
||||
|
||||
}
|
||||
|
||||
this.pushHistory()
|
||||
|
||||
if (newWidgets.length > 1) this.select(newWidgets)
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
pushHistory() {
|
||||
|
||||
if (this.historyState > -1) {
|
||||
this.history.splice(0, this.historyState + 1)
|
||||
this.historyState = -1
|
||||
}
|
||||
|
||||
var d = diff.diff(this.historySession, sessionManager.session)
|
||||
|
||||
if (d) {
|
||||
for (var c of deepCopy(d)) {
|
||||
diff.applyChange(this.historySession, null, c)
|
||||
}
|
||||
this.history.unshift(deepCopy(d))
|
||||
if (this.history.length > HISTORY_SIZE) this.history.pop()
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
clearHistory() {
|
||||
|
||||
this.history = []
|
||||
this.historyState = -1
|
||||
this.historySession = deepCopy(sessionManager.session)
|
||||
|
||||
}
|
||||
|
||||
undo() {
|
||||
|
||||
if (this.historyState === this.history.length - 1) return
|
||||
|
||||
this.historyState += 1
|
||||
|
||||
var d1 = deepCopy(this.history[this.historyState]),
|
||||
d2 = deepCopy(this.history[this.historyState]),
|
||||
path
|
||||
|
||||
for (var i = d1.length - 1; i > -1; i--) {
|
||||
diff.revertChange(this.historySession, true, d1[i])
|
||||
diff.revertChange(sessionManager.session, true, d2[i])
|
||||
if (!path || path.length > d1[i].path.length) path = d1[i].path
|
||||
}
|
||||
|
||||
if (d1.length > 1) {
|
||||
// path intersection
|
||||
var stop, j, k, n
|
||||
for (j = 0; j < path.length; j++) {
|
||||
for (k = 0; k < d1.length; k++) {
|
||||
if (d1[k].path[j] !== path[j]) {
|
||||
stop = true
|
||||
break
|
||||
}
|
||||
}
|
||||
if (stop) break
|
||||
}
|
||||
n = stop ? j : j - 1
|
||||
path.splice(n, path.length - n)
|
||||
}
|
||||
|
||||
|
||||
this.updateWidgetByPath(path)
|
||||
|
||||
}
|
||||
|
||||
redo() {
|
||||
|
||||
if (this.historyState === -1) return
|
||||
|
||||
var d1 = deepCopy(this.history[this.historyState]),
|
||||
d2 = deepCopy(this.history[this.historyState]),
|
||||
path
|
||||
|
||||
for (var i = 0; i < d1.length; i++) {
|
||||
diff.applyChange(this.historySession, true, d1[i])
|
||||
diff.applyChange(sessionManager.session, true, d2[i])
|
||||
if (!path || path.length > d1[i].path.length) path = d1[i].path
|
||||
}
|
||||
|
||||
if (d1.length > 1) {
|
||||
// path intersection
|
||||
var stop, j, k, n
|
||||
for (j = 0; j < path.length; j++) {
|
||||
for (k = 0; k < d1.length; k++) {
|
||||
if (d1[k].path[j] !== path[j]) {
|
||||
stop = true
|
||||
break
|
||||
}
|
||||
}
|
||||
if (stop) break
|
||||
}
|
||||
n = stop ? j : j - 1
|
||||
path.splice(n, path.length - n)
|
||||
}
|
||||
|
||||
this.updateWidgetByPath(path)
|
||||
|
||||
this.historyState -= 1
|
||||
|
||||
}
|
||||
|
||||
updateWidgetByPath(path) {
|
||||
|
||||
var req = '.root-container'
|
||||
for (var j = 1; j < path.length; j++) {
|
||||
var item = path[j]
|
||||
if (item === 'widgets' && j + 1 < path.length) {
|
||||
req += ' > .panel'
|
||||
} else if (item === 'tabs' && j + 1 < path.length) {
|
||||
req += ' > .panel > .tabs-wrapper'
|
||||
} else if (!isNaN(item)) {
|
||||
req += ' > .widget:nth-child(' + (item + 1) + ')'
|
||||
} else {
|
||||
break
|
||||
}
|
||||
}
|
||||
|
||||
var e = DOM.get(req),
|
||||
w
|
||||
|
||||
if (e.length) {
|
||||
w = widgetManager.getWidgetByElement(e[0])
|
||||
} else {
|
||||
// in case the elements are in a hidden tab (detached dom)
|
||||
w = widgetManager.getWidgetById('root')[0]
|
||||
}
|
||||
|
||||
updateWidget(w)
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
var editor = new Editor()
|
||||
|
||||
module.exports = editor
|
||||
|
||||
require('./context-menu')
|
||||
sessionManager = require('../managers/session')
|
||||
|
|
|
|||