Mercurial > hg > webaudioevaluationtool
comparison core.js @ 139:04fcd51441e5
Bug #1258 Fixed. audioObject.metric.startListening now writes to console.
author | Nicholas Jillings <n.g.r.jillings@se14.qmul.ac.uk> |
---|---|
date | Fri, 29 May 2015 16:27:05 +0100 |
parents | c849dcbe71aa |
children | 7168f3616a00 |
comparison
equal
deleted
inserted
replaced
136:c849dcbe71aa | 139:04fcd51441e5 |
---|---|
509 // The main buffer object with common control nodes to the AudioEngine | 509 // The main buffer object with common control nodes to the AudioEngine |
510 | 510 |
511 this.id = id; | 511 this.id = id; |
512 this.state = 0; // 0 - no data, 1 - ready | 512 this.state = 0; // 0 - no data, 1 - ready |
513 this.url = null; // Hold the URL given for the output back to the results. | 513 this.url = null; // Hold the URL given for the output back to the results. |
514 this.metric = new metricTracker(); | 514 this.metric = new metricTracker(this); |
515 | 515 |
516 this.played = false; | 516 this.played = false; |
517 | 517 |
518 // Create a buffer and external gain control to allow internal patching of effects and volume leveling. | 518 // Create a buffer and external gain control to allow internal patching of effects and volume leveling. |
519 this.bufferNode = undefined; | 519 this.bufferNode = undefined; |
652 this.data = -1; | 652 this.data = -1; |
653 }; | 653 }; |
654 this.initialiseTest = function(){}; | 654 this.initialiseTest = function(){}; |
655 } | 655 } |
656 | 656 |
657 function metricTracker() | 657 function metricTracker(caller) |
658 { | 658 { |
659 /* Custom object to track and collect metric data | 659 /* Custom object to track and collect metric data |
660 * Used only inside the audioObjects object. | 660 * Used only inside the audioObjects object. |
661 */ | 661 */ |
662 | 662 |
666 this.initialPosition = -1; | 666 this.initialPosition = -1; |
667 this.movementTracker = []; | 667 this.movementTracker = []; |
668 this.wasListenedTo = false; | 668 this.wasListenedTo = false; |
669 this.wasMoved = false; | 669 this.wasMoved = false; |
670 this.hasComments = false; | 670 this.hasComments = false; |
671 this.parent = caller; | |
671 | 672 |
672 this.initialised = function(position) | 673 this.initialised = function(position) |
673 { | 674 { |
674 if (this.initialPosition == -1) { | 675 if (this.initialPosition == -1) { |
675 this.initialPosition = position; | 676 this.initialPosition = position; |
687 if (this.listenHold == false) | 688 if (this.listenHold == false) |
688 { | 689 { |
689 this.wasListenedTo = true; | 690 this.wasListenedTo = true; |
690 this.listenStart = time; | 691 this.listenStart = time; |
691 this.listenHold = true; | 692 this.listenHold = true; |
692 } | 693 console.log('slider ' + this.parent.id + ' played (' + time + ')'); // DEBUG/SAFETY: show played slider id |
693 } | 694 } |
695 }; | |
694 | 696 |
695 this.stopListening = function(time) | 697 this.stopListening = function(time) |
696 { | 698 { |
697 if (this.listenHold == true) | 699 if (this.listenHold == true) |
698 { | 700 { |