diff options
author | Florrie <towerofnix@gmail.com> | 2019-03-22 21:19:51 -0300 |
---|---|---|
committer | Florrie <towerofnix@gmail.com> | 2019-03-22 21:19:51 -0300 |
commit | f21f158661dd66225adcd319c66f3504541e966a (patch) | |
tree | 72625f5fbb193c4dcdf572d0a0376efd398503f1 /native-app | |
parent | 951499dba4ea173ba4c1f08b956e5d558999da45 (diff) |
Make volume transition nicer
Diffstat (limited to 'native-app')
-rwxr-xr-x | native-app/index.js | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/native-app/index.js b/native-app/index.js index 52dd47b..500eebf 100755 --- a/native-app/index.js +++ b/native-app/index.js @@ -92,13 +92,11 @@ setTimeout(() => { for (const [key, track] of Object.entries(tracks)) { const mode = targetMode.find(m => m.track === key) || {volume: 0}; - track.setVolume(track.volume + 0.1 * (mode.volume - track.volume)); + track.setVolume(track.volume + 0.02 * (mode.volume - track.volume)); } - }, 100); + }, 20); process.stdin.on('data', data => { - log('STDIN: ' + data); - const probablyJSON = data.toString().slice(data.indexOf('[')).trim(); try { @@ -111,7 +109,7 @@ setTimeout(() => { log('Go!'); process.on('SIGTERM', () => { - log('Exiting [sigterm]'); + log('Exiting'); for (const track of Object.values(tracks)) { track.process.kill(); } |