From ce290a19930c3bda02fc663d7cd6719811d605e2 Mon Sep 17 00:00:00 2001 From: ericrius1 Date: Wed, 6 Apr 2016 10:38:59 -0700 Subject: [PATCH] got rid of illegal character --- examples/example/audio/smallRoom.js | 59 +++++++++++++++++++++++++---- 1 file changed, 52 insertions(+), 7 deletions(-) diff --git a/examples/example/audio/smallRoom.js b/examples/example/audio/smallRoom.js index 4e728278a0..b63adc8bb9 100644 --- a/examples/example/audio/smallRoom.js +++ b/examples/example/audio/smallRoom.js @@ -15,6 +15,7 @@ (function() { var _this = this; Script.include("http://public.highfidelity.io/scripts/utilities/tools/cookies.js"); + print("EBL PRELOADING NEW VERSION ") var audioOptions = new AudioEffectOptions({ bandwidth: 7000, preDelay: 20, @@ -36,17 +37,61 @@ earlyMixRight: 20, lateMixLeft: 90, lateMixRight: 90, - wetDryMix: 70 + wetDryMix: 70, }); - var panel = new Panel(10, 160); - function setter(name) { - return function(value) { - audioOptions[name] = value; - AudioDevice.setReverbOptions(audioOptions); + function setter(name) { + return function(value) { + audioOptions[name] = value; + AudioDevice.setReverbOptions(audioOptions); + } } - } + function getter(name) { + return function() { + return audioOptions[name]; + } + } + function displayer(units) { + return function(value) { + return (value).toFixed(1) + units; + } + } + + function scriptEnding() { + panel.destroy(); + AudioDevice.setReverb(false); + print("Reverb is OFF."); + } + _this.enterEntity = function(entityID) { + print('EBL I am insiude'); + // create a slider for each parameter + for (var i = 0; i < parameters.length; i++) { + var p = parameters[i]; + panel.newSlider(p.name, p.min, p.max, setter(p.name), getter(p.name), displayer(p.units)); + } + Controller.mouseMoveEvent.connect(function panelMouseMoveEvent(event) { + return panel.mouseMoveEvent(event); + }); + Controller.mousePressEvent.connect(function panelMousePressEvent(event) { + return panel.mousePressEvent(event); + }); + Controller.mouseReleaseEvent.connect(function(event) { + return panel.mouseReleaseEvent(event); + }); + AudioDevice.setReverbOptions(audioOptions); + AudioDevice.setReverb(true); + print("Reverb is ON."); + // Messages.sendMessage('PlayBackOnAssignment', 'BowShootingGameWelcome'); + }; + + _this.leaveEntity = function(entityID) { + print('EBL I am outsidee'); + panel.destroy(); + AudioDevice.setReverb(false); + print("Reverb is OFF."); + // Messages.sendMessage('PlayBackOnAssignment', 'BowShootingGameWelcome'); + }; }); \ No newline at end of file