aboutsummaryrefslogtreecommitdiff
path: root/views/script/core_music.js
diff options
context:
space:
mode:
Diffstat (limited to 'views/script/core_music.js')
-rw-r--r--views/script/core_music.js8
1 files changed, 6 insertions, 2 deletions
diff --git a/views/script/core_music.js b/views/script/core_music.js
index d1e8619..adb0ae2 100644
--- a/views/script/core_music.js
+++ b/views/script/core_music.js
@@ -5,6 +5,8 @@ global.cspn = 1;
const musicIpc = require('electron').ipcRenderer;
musicIpc.on('setmusic', (event, args) => {
+ try { csp1.volume = 0; } catch (e) {}
+ try { csp2.volume = 0; } catch (e) {}
song = args;
if (song !== null && song !== "" && csng !== song) {
@@ -13,6 +15,7 @@ musicIpc.on('setmusic', (event, args) => {
csi1 = setInterval(() => {
if (csp1.volume <= 0.05) {
csp1.pause();
+ csp1.volume = 0;
clearInterval(csi1);
return;
}
@@ -37,6 +40,7 @@ musicIpc.on('setmusic', (event, args) => {
csi2 = setInterval(() => {
if (csp2.volume <= 0.05) {
csp2.pause();
+ csp2.volume = 0;
clearInterval(csi2);
return;
}
@@ -64,7 +68,7 @@ musicIpc.on('fademusic', (event) => {
if (cspn === 1) {
if (csp1 !== null) {
csi1 = setInterval(() => {
- if (csp1.volume <= 0.5) {
+ if (csp1.volume <= 0.05) {
clearInterval(csi1);
return;
}
@@ -74,7 +78,7 @@ musicIpc.on('fademusic', (event) => {
} else {
if (csp2 !== null) {
csi2 = setInterval(() => {
- if (csp2.volume <= 0.5) {
+ if (csp2.volume <= 0.05) {
clearInterval(csi2);
return;
}