Mercurial > hg > webaudioevaluationtool
comparison js/core.js @ 2951:7d1a34b5a4d2
Fix for #250
author | Nicholas Jillings <nicholas.jillings@mail.bcu.ac.uk> |
---|---|
date | Tue, 31 Oct 2017 09:54:55 +0000 |
parents | 3dc059f3b57c |
children | 8fa0f2a59b6d aa1ceca04519 |
comparison
equal
deleted
inserted
replaced
2950:3dc059f3b57c | 2951:7d1a34b5a4d2 |
---|---|
3023 volume.slider.min = -60; | 3023 volume.slider.min = -60; |
3024 volume.slider.max = 12; | 3024 volume.slider.max = 12; |
3025 volume.slider.value = 0; | 3025 volume.slider.value = 0; |
3026 volume.slider.step = 1; | 3026 volume.slider.step = 1; |
3027 volume.handleEvent = function (event) { | 3027 volume.handleEvent = function (event) { |
3028 if (event.type == "mousemove") { | 3028 if (event.type == "mousemove" || event.type == "mouseup") { |
3029 this.valueDB = Number(this.slider.value); | 3029 this.valueDB = Number(this.slider.value); |
3030 this.valueLin = decibelToLinear(this.valueDB); | 3030 this.valueLin = decibelToLinear(this.valueDB); |
3031 this.valueText.textContent = this.valueDB + 'dB'; | 3031 this.valueText.textContent = this.valueDB + 'dB'; |
3032 audioEngineContext.outputGain.gain.value = this.valueLin; | 3032 audioEngineContext.outputGain.gain.value = this.valueLin; |
3033 } else if (event.type == "mouseup") { | 3033 } |
3034 if (event.type == "mouseup") { | |
3034 this.onmouseup(); | 3035 this.onmouseup(); |
3035 } | 3036 } |
3036 this.slider.value = this.valueDB; | 3037 this.slider.value = this.valueDB; |
3037 | 3038 |
3038 if (event.stopPropagation) { | 3039 if (event.stopPropagation) { |