Mercurial > hg > webaudioevaluationtool
changeset 757:8512c2dbac19
MUSHRA: resizeWindow(event) function introduced.
author | Nicholas Jillings <nicholas.jillings@eecs.qmul.ac.uk> |
---|---|
date | Thu, 17 Dec 2015 15:58:16 +0000 |
parents | 46acb0963059 |
children | 57a3cbf90e01 |
files | mushra.js |
diffstat | 1 files changed, 23 insertions(+), 0 deletions(-) [+] |
line wrap: on
line diff
--- a/mushra.js Thu Dec 17 13:34:23 2015 +0000 +++ b/mushra.js Thu Dec 17 15:58:16 2015 +0000 @@ -218,12 +218,35 @@ return this.slider.value; }; + this.resize = function(event) + { + this.holder.style.height = window.innerHeight-200 + 'px'; + this.slider.style.height = window.innerHeight-250 + 'px'; + } + if (this.parent.state == 1) { this.enable(); } } +function resizeWindow(event) +{ + // Function called when the window has been resized. + // MANDATORY FUNCTION + + // Auto-align + var numObj = audioEngineContext.audioObjects.length; + var totalWidth = (numObj-1)*150+100; + var diff = (window.innerWidth - totalWidth)/2; + document.getElementById('slider').style.height = window.innerHeight - 180 + 'px'; + audioEngineContext.audioObjects[0].interfaceDOM.holder.style.marginLeft = diff + 'px'; + for (var i in audioEngineContext.audioObjects) + { + audioEngineContext.audioObjects[i].interfaceDOM.resize(event); + } +} + function buttonSubmitClick() // TODO: Only when all songs have been played! {