changeset 2191:dd5a8556235c

Calibration sliders update on mouse move trigger
author Nicholas Jillings <nickjillings@users.noreply.github.com>
date Tue, 29 Mar 2016 14:37:07 +0100
parents 96988cb46d18
children ed5a54029157
files core.css core.js
diffstat 2 files changed, 11 insertions(+), 9 deletions(-) [+]
line wrap: on
line diff
--- a/core.css	Tue Mar 29 14:24:05 2016 +0100
+++ b/core.css	Tue Mar 29 14:37:07 2016 +0100
@@ -201,5 +201,5 @@
     -webkit-appearance: slider-vertical; /* WebKit */
     width: 8px;
     padding: 0 5px;
-    color: rgb(255, 144, 144);
+    height: 290px;
 }
\ No newline at end of file
--- a/core.js	Tue Mar 29 14:24:05 2016 +0100
+++ b/core.js	Tue Mar 29 14:37:07 2016 +0100
@@ -3107,13 +3107,6 @@
                     f: f0,
                     parent: this,
                     handleEvent: function(event) {
-                        var value = Math.pow(10,this.input.value/20);
-                        if (this.f == 1000) {
-                            audioEngineContext.outputGain.gain.value = value;
-                            interfaceContext.volume.slider.value = this.input.value;
-                        } else {
-                            this.gain.gain.value = value
-                        }
                         switch(event.type) {
                             case "mouseenter":
                                 this.oscillator.start(0);
@@ -3124,6 +3117,15 @@
                                 this.oscillator.connect(this.gain);
                                 this.oscillator.frequency.value = this.f;
                                 break;
+                            case "mousemove":
+                                var value = Math.pow(10,this.input.value/20);
+                                if (this.f == 1000) {
+                                    audioEngineContext.outputGain.gain.value = value;
+                                    interfaceContext.volume.slider.value = this.input.value;
+                                } else {
+                                    this.gain.gain.value = value
+                                }
+                                break;
                         }
                     },
                     disconnect: function() {
@@ -3147,7 +3149,7 @@
                     obj.input.value = 0;
                     obj.root.style.backgroundColor="rgb(255,125,125)";
                 }
-                obj.input.addEventListener("change",obj);
+                obj.input.addEventListener("mousemove",obj);
                 obj.input.addEventListener("mouseenter",obj);
                 obj.input.addEventListener("mouseleave",obj);
                 obj.gain.gain.value = Math.pow(10,obj.input.value/20);