Skip to content

Commit

Permalink
reconnect fas / osc when on server settings change
Browse files Browse the repository at this point in the history
fix fas_relay
  • Loading branch information
grz0zrg committed Mar 26, 2021
1 parent 1a4f63a commit 2303447
Show file tree
Hide file tree
Showing 7 changed files with 48 additions and 14 deletions.
18 changes: 14 additions & 4 deletions client/dist/fs.js
Original file line number Diff line number Diff line change
Expand Up @@ -21323,7 +21323,7 @@ _utter_fail_element.innerHTML = "";
};

if (!(test_canvas.getContext("webgl2", test_opts) || test_canvas.getContext("experimental-webgl2", test_opts))) {
_fail("Web WebGL 2 is not available, please use a web browser / device with WebGL 2 support.", true);
_fail("WebGL 2 is not available, please use a web browser / device with WebGL 2 support.", true);

return;
}
Expand All @@ -21332,7 +21332,7 @@ _utter_fail_element.innerHTML = "";
Fields.
************************************************************/

var _motd = '<div id="fs_notify" class="fs-notify"><div class="fs-status-bar-date">31/12/2020 :</div><div class="fs-status-bar-content"><a class="fs-link" href="https://quiet.fsynth.com/d/19-fragment-2-0">Fragment 2.0 released (click for more details)</a></div></div>',
var _motd = '<div id="fs_notify" class="fs-notify"><div class="fs-status-bar-date">27/03/2021 :</div><div class="fs-status-bar-content"><a class="fs-link" href="https://quiet.fsynth.com/d/19-fragment-2-0">Fragment 2.0 released (click for more details)</a></div></div>',

_webmidi_support_msg = '<center>WebMIDI API is not enabled/supported by this browser, please use a <a class="fs-link" href="https://caniuse.com/#search=midi">compatible browser</a>.</center>',

Expand Down Expand Up @@ -36308,6 +36308,11 @@ var _fasInit = function () {
_fas.address = this.value;

localStorage.setItem("fas-address", _fas.address);

if (_fas.enabled) {
_fasDisable();
_fasEnable();
}
});

_fas.worker.addEventListener("message", function (m) {
Expand Down Expand Up @@ -36766,6 +36771,11 @@ var _oscInit = function () {
_osc.address = this.value;

localStorage.setItem("osc-address", _osc.address);

if (_oscEnabled) {
_oscDisable();
_oscEnable();
}
});

_osc.worker.addEventListener("message", function (m) {
Expand Down Expand Up @@ -37217,15 +37227,15 @@ var _oscInit = function () {
_loadEditorsMarks();

_allocateFramesData();

_fasInit();

_uiInit();

_pjsInit();

_midiInit();

_fasInit();

_oscInit();

_initNetwork();
Expand Down
18 changes: 14 additions & 4 deletions client/dist/fs.min.js
Original file line number Diff line number Diff line change
Expand Up @@ -21323,7 +21323,7 @@ _utter_fail_element.innerHTML = "";
};

if (!(test_canvas.getContext("webgl2", test_opts) || test_canvas.getContext("experimental-webgl2", test_opts))) {
_fail("Web WebGL 2 is not available, please use a web browser / device with WebGL 2 support.", true);
_fail("WebGL 2 is not available, please use a web browser / device with WebGL 2 support.", true);

return;
}
Expand All @@ -21332,7 +21332,7 @@ _utter_fail_element.innerHTML = "";
Fields.
************************************************************/

var _motd = '<div id="fs_notify" class="fs-notify"><div class="fs-status-bar-date">31/12/2020 :</div><div class="fs-status-bar-content"><a class="fs-link" href="https://quiet.fsynth.com/d/19-fragment-2-0">Fragment 2.0 released (click for more details)</a></div></div>',
var _motd = '<div id="fs_notify" class="fs-notify"><div class="fs-status-bar-date">27/03/2021 :</div><div class="fs-status-bar-content"><a class="fs-link" href="https://quiet.fsynth.com/d/19-fragment-2-0">Fragment 2.0 released (click for more details)</a></div></div>',

_webmidi_support_msg = '<center>WebMIDI API is not enabled/supported by this browser, please use a <a class="fs-link" href="https://caniuse.com/#search=midi">compatible browser</a>.</center>',

Expand Down Expand Up @@ -36308,6 +36308,11 @@ var _fasInit = function () {
_fas.address = this.value;

localStorage.setItem("fas-address", _fas.address);

if (_fas.enabled) {
_fasDisable();
_fasEnable();
}
});

_fas.worker.addEventListener("message", function (m) {
Expand Down Expand Up @@ -36766,6 +36771,11 @@ var _oscInit = function () {
_osc.address = this.value;

localStorage.setItem("osc-address", _osc.address);

if (_oscEnabled) {
_oscDisable();
_oscEnable();
}
});

_osc.worker.addEventListener("message", function (m) {
Expand Down Expand Up @@ -37217,15 +37227,15 @@ var _oscInit = function () {
_loadEditorsMarks();

_allocateFramesData();

_fasInit();

_uiInit();

_pjsInit();

_midiInit();

_fasInit();

_oscInit();

_initNetwork();
Expand Down
8 changes: 4 additions & 4 deletions client/js/app_fs.js
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,7 @@ var FragmentSynth = function (params) {
};

if (!(test_canvas.getContext("webgl2", test_opts) || test_canvas.getContext("experimental-webgl2", test_opts))) {
_fail("Web WebGL 2 is not available, please use a web browser / device with WebGL 2 support.", true);
_fail("WebGL 2 is not available, please use a web browser / device with WebGL 2 support.", true);

return;
}
Expand All @@ -162,7 +162,7 @@ var FragmentSynth = function (params) {
Fields.
************************************************************/

var _motd = '<div id="fs_notify" class="fs-notify"><div class="fs-status-bar-date">31/12/2020 :</div><div class="fs-status-bar-content"><a class="fs-link" href="https://quiet.fsynth.com/d/19-fragment-2-0">Fragment 2.0 released (click for more details)</a></div></div>',
var _motd = '<div id="fs_notify" class="fs-notify"><div class="fs-status-bar-date">27/03/2021 :</div><div class="fs-status-bar-content"><a class="fs-link" href="https://quiet.fsynth.com/d/19-fragment-2-0">Fragment 2.0 released (click for more details)</a></div></div>',

_webmidi_support_msg = '<center>WebMIDI API is not enabled/supported by this browser, please use a <a class="fs-link" href="https://caniuse.com/#search=midi">compatible browser</a>.</center>',

Expand Down Expand Up @@ -995,15 +995,15 @@ var FragmentSynth = function (params) {
_loadEditorsMarks();

_allocateFramesData();

_fasInit();

_uiInit();

_pjsInit();

_midiInit();

_fasInit();

_oscInit();

_initNetwork();
Expand Down
5 changes: 5 additions & 0 deletions client/js/fas.js
Original file line number Diff line number Diff line change
Expand Up @@ -211,6 +211,11 @@ var _fasInit = function () {
_fas.address = this.value;

localStorage.setItem("fas-address", _fas.address);

if (_fas.enabled) {
_fasDisable();
_fasEnable();
}
});

_fas.worker.addEventListener("message", function (m) {
Expand Down
5 changes: 5 additions & 0 deletions client/js/osc_handler.js
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,11 @@ var _oscInit = function () {
_osc.address = this.value;

localStorage.setItem("osc-address", _osc.address);

if (_oscEnabled) {
_oscDisable();
_oscEnable();
}
});

_osc.worker.addEventListener("message", function (m) {
Expand Down
6 changes: 5 additions & 1 deletion fas_relay/fas_relay.js
Original file line number Diff line number Diff line change
Expand Up @@ -445,6 +445,10 @@ function printOverallLoad() {
clearTimeout(fas_load_timeout);
fas_load_timeout = setTimeout(printOverallLoad, 2000);

if (!client_socket) {
return;
}

var i = 0, l = 0, overall_latency = 0;
for (i = 0; i < fas_loads.length; i += 1) {
l += fas_loads[i];
Expand All @@ -466,7 +470,7 @@ function printOverallLoad() {

var stream_infos = new ArrayBuffer(8 + 8),
int32_view = new Int32Array(stream_infos, 0),
float64_view = new Float64Array(stream_infos, 2);
float64_view = new Float64Array(stream_infos, 8);

int32_view[0] = 0;
int32_view[1] = l;
Expand Down
2 changes: 1 addition & 1 deletion www/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -325,7 +325,7 @@ <h5 class="value-heading" style="margin-top: 0;">
<tbody>
<tr>
<td style="text-align: center; border-right: solid 1px #f4f4f4; font-size: 13pt">
<b>20/02/2021</b>
<b>27/03/2021</b>
<br/>
&nbsp;<a href="https://quiet.fsynth.com/d/19-fragment-2-0" rel="noopener">Fragment 2.0 released, massive client & audio server update</a>
</td>
Expand Down

0 comments on commit 2303447

Please sign in to comment.