Skip to content

Commit

Permalink
Apply volume passed in defaults initialiser
Browse files Browse the repository at this point in the history
  • Loading branch information
mon committed Apr 3, 2021
1 parent a8cb579 commit d533125
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
4 changes: 2 additions & 2 deletions src/js/HuesCore.js
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ class HuesCore {
};

// Bunch-o-initialisers
this.version = 35;
this.version = 36;
this.versionStr = (this.version/10).toFixed(1);
this.versionHex = this.version.toString(16);
this.beatIndex = 0;
Expand Down Expand Up @@ -190,7 +190,7 @@ class HuesCore {
this.visualiser.height = "64";
this.vCtx = this.visualiser.getContext("2d");

this.soundManager = new SoundManager(this);
this.soundManager = new SoundManager(this, this.settings.volume);

this.soundManager.init().then(() => {
if(!this.soundManager.locked && this.settings.skipPreloader == "on") {
Expand Down
6 changes: 3 additions & 3 deletions src/js/SoundManager.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
"use strict";

class SoundManager {
constructor(core) {
constructor(core, initialVolume = 1) {
// Perhaps this will do more later
this.eventListeners = {
/* callback seek()
Expand Down Expand Up @@ -56,7 +56,7 @@ class SoundManager {
// Volume
this.gainNode = null;
this.mute = false;
this.lastVol = 1;
this.lastVol = initialVolume;

// Visualiser
this.vReady = false;
Expand Down Expand Up @@ -680,4 +680,4 @@ for (var i = 0; i < miniOggBin.length; i++) {

window.SoundManager = SoundManager;

})(window, document);
})(window, document);

0 comments on commit d533125

Please sign in to comment.