Skip to content

Commit

Permalink
initOnReset for every demo screen.
Browse files Browse the repository at this point in the history
  • Loading branch information
PoneyClairDeLune committed Sep 25, 2023
1 parent f3d6865 commit 607c045
Show file tree
Hide file tree
Showing 10 changed files with 112 additions and 92 deletions.
13 changes: 7 additions & 6 deletions dist/basic.mjs

Large diffs are not rendered by default.

42 changes: 22 additions & 20 deletions dist/cambiare.mjs

Large diffs are not rendered by default.

38 changes: 19 additions & 19 deletions dist/state.mjs

Large diffs are not rendered by default.

16 changes: 8 additions & 8 deletions dist/state_skim.mjs

Large diffs are not rendered by default.

41 changes: 21 additions & 20 deletions dist/xp_basic.mjs

Large diffs are not rendered by default.

38 changes: 19 additions & 19 deletions dist/xp_state.mjs

Large diffs are not rendered by default.

4 changes: 4 additions & 0 deletions src/fakeMu/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,7 @@ getBlobFrom(`list.tsv`).then(async (response) => {
stDemo.forEach(function (e, i, a) {
e.addEventListener("click", async function () {
audioPlayer.pause();
visualizer.device.initOnReset = false;
if (!demoBlobs[e.title]?.midi) {
demoBlobs[e.title] = {};
audioPlayer.src = "about:blank";
Expand Down Expand Up @@ -159,6 +160,7 @@ propsAud = JSON.parse('{"mimeTypes":["audio/*"],"startIn":"music","id":"audioOpe
$e("#openMidi").addEventListener("click", async function () {
useMidiBus = false;
midwIndicator.classList.off("active");
visualizer.device.initOnReset = false;
let file = await fileOpen(propsMid);
let fileSplit = file.name.lastIndexOf("."), ext = "";
if (fileSplit > -1) {
Expand Down Expand Up @@ -187,6 +189,7 @@ $e("#openMidi").addEventListener("click", async function () {
$e("#openAudio").addEventListener("click", async function () {
useMidiBus = false;
midwIndicator.classList.off("active");
visualizer.device.initOnReset = false;
if (audioBlob) {
URL.revokeObjectURL(audioBlob);
};
Expand All @@ -195,6 +198,7 @@ $e("#openAudio").addEventListener("click", async function () {
});
midwIndicator.addEventListener("click", function () {
stDemo.to(-1);
visualizer.device.initOnReset = true;
if (audioBlob) {
URL.revokeObjectURL(audioBlob);
};
Expand Down
4 changes: 4 additions & 0 deletions src/fakeNs5r/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,7 @@ getBlobFrom(`list.tsv`).then(async (response) => {
stDemo.forEach(function (e, i, a) {
e.addEventListener("click", async function () {
audioPlayer.pause();
visualizer.device.initOnReset = false;
visualizer.device.setLetterDisplay(codepointArray(`\x8a${demoPool.data[i].artist.slice(0, 15).padEnd(15, " ")}\x8b${demoPool.data[i].title.slice(0, 15)}`));
if (!demoBlobs[e.title]?.midi) {
demoBlobs[e.title] = {};
Expand Down Expand Up @@ -130,6 +131,7 @@ propsAud = JSON.parse('{"mimeTypes":["audio/*"],"startIn":"music","id":"audioOpe
$e("#openMidi").addEventListener("click", async function () {
useMidiBus = false;
midwIndicator.classList.off("active");
visualizer.device.initOnReset = false;
let file = await fileOpen(propsMid);
let fileSplit = file.name.lastIndexOf("."), ext = "";
if (fileSplit > -1) {
Expand Down Expand Up @@ -158,6 +160,7 @@ $e("#openMidi").addEventListener("click", async function () {
$e("#openAudio").addEventListener("click", async function () {
useMidiBus = false;
midwIndicator.classList.off("active");
visualizer.device.initOnReset = false;
if (audioBlob) {
URL.revokeObjectURL(audioBlob);
};
Expand All @@ -169,6 +172,7 @@ midwIndicator.addEventListener("click", function () {
if (audioBlob) {
URL.revokeObjectURL(audioBlob);
};
visualizer.device.initOnReset = true;
audioBlob = null;
audioPlayer.src = "";
visualizer.reset();
Expand Down
4 changes: 4 additions & 0 deletions src/fakePsr/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,7 @@ getBlobFrom(`list.tsv`).then(async (response) => {
stDemo.forEach(function (e, i, a) {
e.addEventListener("click", async function () {
audioPlayer.pause();
visualizer.device.initOnReset = false;
if (!demoBlobs[e.title]?.midi) {
demoBlobs[e.title] = {};
audioPlayer.src = "about:blank";
Expand Down Expand Up @@ -217,6 +218,7 @@ propsAud = JSON.parse('{"mimeTypes":["audio/*"],"startIn":"music","id":"audioOpe
$e("#openMidi").addEventListener("click", async function () {
useMidiBus = false;
midwIndicator.classList.off("active");
visualizer.device.initOnReset = false;
let file = await fileOpen(propsMid);
let fileSplit = file.name.lastIndexOf("."), ext = "";
if (fileSplit > -1) {
Expand Down Expand Up @@ -245,6 +247,7 @@ $e("#openMidi").addEventListener("click", async function () {
$e("#openAudio").addEventListener("click", async function () {
useMidiBus = false;
midwIndicator.classList.off("active");
visualizer.device.initOnReset = false;
if (audioBlob) {
URL.revokeObjectURL(audioBlob);
};
Expand All @@ -253,6 +256,7 @@ $e("#openAudio").addEventListener("click", async function () {
});
midwIndicator.addEventListener("click", function () {
stDemo.to(-1);
visualizer.device.initOnReset = true;
if (audioBlob) {
URL.revokeObjectURL(audioBlob);
};
Expand Down
4 changes: 4 additions & 0 deletions src/fakeQy/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,7 @@ getBlobFrom(`list.tsv`).then(async (response) => {
stDemo.forEach(function (e, i, a) {
e.addEventListener("click", async function () {
audioPlayer.pause();
visualizer.device.initOnReset = false;
visualizer.device.setLetterDisplay(codepointArray(`\x8a${demoPool.data[i].artist.slice(0, 15).padEnd(15, " ")}\x8b${demoPool.data[i].title.slice(0, 15)}`));
if (!demoBlobs[e.title]?.midi) {
demoBlobs[e.title] = {};
Expand Down Expand Up @@ -131,6 +132,7 @@ propsAud = JSON.parse('{"mimeTypes":["audio/*"],"startIn":"music","id":"audioOpe
$e("#openMidi").addEventListener("click", async function () {
useMidiBus = false;
midwIndicator.classList.off("active");
visualizer.device.initOnReset = false;
let file = await fileOpen(propsMid);
let fileSplit = file.name.lastIndexOf("."), ext = "";
if (fileSplit > -1) {
Expand Down Expand Up @@ -159,6 +161,7 @@ $e("#openMidi").addEventListener("click", async function () {
$e("#openAudio").addEventListener("click", async function () {
useMidiBus = false;
midwIndicator.classList.off("active");
visualizer.device.initOnReset = false;
if (audioBlob) {
URL.revokeObjectURL(audioBlob);
};
Expand All @@ -167,6 +170,7 @@ $e("#openAudio").addEventListener("click", async function () {
});
midwIndicator.addEventListener("click", function () {
stDemo.to(-1);
visualizer.device.initOnReset = true;
if (audioBlob) {
URL.revokeObjectURL(audioBlob);
};
Expand Down

0 comments on commit 607c045

Please sign in to comment.