From a27b6340574053581e4e67cb27224b35c29897f6 Mon Sep 17 00:00:00 2001 From: Raphael Winkelmann Date: Tue, 25 Jun 2019 17:24:20 +0200 Subject: [PATCH] new release (1.0.2) build --- app/NEWS.md | 6 ++++++ app/manifest.json | 2 +- app/scripts/controllers/main.js | 4 ++-- bower.json | 2 +- dist/NEWS.md | 6 ++++++ dist/index.html | 2 +- dist/manifest.appcache | 4 ++-- dist/manifest.json | 2 +- dist/manual/Introduction.md | 6 +++--- dist/scripts/{scripts.9e58ef09.js => scripts.5e32fabf.js} | 8 ++++---- package.json | 2 +- test/spec/controllers/main.spec.js | 2 +- 12 files changed, 29 insertions(+), 17 deletions(-) rename dist/scripts/{scripts.9e58ef09.js => scripts.5e32fabf.js} (82%) diff --git a/app/NEWS.md b/app/NEWS.md index ba0ca728e..b3bdf0539 100644 --- a/app/NEWS.md +++ b/app/NEWS.md @@ -1,5 +1,11 @@ # What's New +## Version 1.0.2 + +### bug fixes + +- revert of "resize now listens to $window.parent not $window" as it causes RStudio not to load the page + ## Version 1.0.1 1.0.0 version bump because it has been in regular stable use for diff --git a/app/manifest.json b/app/manifest.json index 44d6efa63..ba78c5ff5 100644 --- a/app/manifest.json +++ b/app/manifest.json @@ -1,6 +1,6 @@ { "name": "EMU-webApp", - "version": "1.0.1", + "version": "1.0.2", "manifest_version": 2, "minimum_chrome_version": "23", "description": "The EMU-webApp is an online and offline Web-App for labeling, visualizing and correcting speech and derived speech data.", diff --git a/app/scripts/controllers/main.js b/app/scripts/controllers/main.js index 80e3f3728..898b19385 100644 --- a/app/scripts/controllers/main.js +++ b/app/scripts/controllers/main.js @@ -40,9 +40,9 @@ angular.module('emuwebApp') // bindings // bind window resize event - angular.element($window.parent).bind('resize', function () { + angular.element($window).bind('resize', function () { LevelService.deleteEditArea(); - viewState.setWindowWidth($window.parent.outerWidth); + viewState.setWindowWidth($window.outerWidth); if (viewState.hierarchyState.isShown()) { ++viewState.hierarchyState.resize; } diff --git a/bower.json b/bower.json index 3a1bdb921..86233c457 100644 --- a/bower.json +++ b/bower.json @@ -1,6 +1,6 @@ { "name": "emuwebapp", - "version": "1.0.1", + "version": "1.0.2", "dependencies": { "jquery": "^3.1.1", "angular": "^1.5.8", diff --git a/dist/NEWS.md b/dist/NEWS.md index ba0ca728e..b3bdf0539 100644 --- a/dist/NEWS.md +++ b/dist/NEWS.md @@ -1,5 +1,11 @@ # What's New +## Version 1.0.2 + +### bug fixes + +- revert of "resize now listens to $window.parent not $window" as it causes RStudio not to load the page + ## Version 1.0.1 1.0.0 version bump because it has been in regular stable use for diff --git a/dist/index.html b/dist/index.html index 898983e29..d0722e0b2 100644 --- a/dist/index.html +++ b/dist/index.html @@ -14,4 +14,4 @@ _paq.push(['setSiteId', '31']); var d=document, g=d.createElement('script'), s=d.getElementsByTagName('script')[0]; g.type='text/javascript'; g.async=true; g.defer=true; g.src=u+'piwik.js'; s.parentNode.insertBefore(g,s); - })(); + })(); diff --git a/dist/manifest.appcache b/dist/manifest.appcache index 1f90b3369..feef8a73d 100644 --- a/dist/manifest.appcache +++ b/dist/manifest.appcache @@ -1,5 +1,5 @@ CACHE MANIFEST -# rev 1 - 2019-06-24T16:39:34.124Z +# rev 1 - 2019-06-25T15:23:12.577Z CACHE: 404.html @@ -86,7 +86,7 @@ schemaFiles/DBconfigFileSchema.json schemaFiles/designSchema.json schemaFiles/emuwebappConfigSchema.json schemaFiles/globalDBschema.json -scripts/scripts.9e58ef09.js +scripts/scripts.5e32fabf.js scripts/vendor.16046c50.js scripts/workers/espsParserWorkerClass.131a7761.js scripts/workers/serviceWorker.d41d8cd9.js diff --git a/dist/manifest.json b/dist/manifest.json index 44d6efa63..ba78c5ff5 100644 --- a/dist/manifest.json +++ b/dist/manifest.json @@ -1,6 +1,6 @@ { "name": "EMU-webApp", - "version": "1.0.1", + "version": "1.0.2", "manifest_version": 2, "minimum_chrome_version": "23", "description": "The EMU-webApp is an online and offline Web-App for labeling, visualizing and correcting speech and derived speech data.", diff --git a/dist/manual/Introduction.md b/dist/manual/Introduction.md index b2d65f2e1..83199daa5 100644 --- a/dist/manual/Introduction.md +++ b/dist/manual/Introduction.md @@ -7,9 +7,9 @@ author: Raphael Winkelmann ![icon](assets/EMU-webAppIcon-roundCorners.svg) -- **Version: 1.0.1** -- *Build time stamp: Mon Jun 24 2019 18:39:33* -- *Build GIT SHA-1: a154523c0461b69372cb82c7c2f0afd0f7f9b62c - master* +- **Version: 1.0.2** +- *Build time stamp: Tue Jun 25 2019 17:23:11* +- *Build GIT SHA-1: 0aae593a36a3679129f68fcc1ac49fa3b89dbdb5 - master* - *EMU-webApp-websocket-protocol version: 0.0.2* --------------------- diff --git a/dist/scripts/scripts.9e58ef09.js b/dist/scripts/scripts.5e32fabf.js similarity index 82% rename from dist/scripts/scripts.9e58ef09.js rename to dist/scripts/scripts.5e32fabf.js index daa117194..bb067019c 100644 --- a/dist/scripts/scripts.9e58ef09.js +++ b/dist/scripts/scripts.5e32fabf.js @@ -1,5 +1,5 @@ -"use strict";function EspsParserWorker(a){a=a||window.Worker,this.url=this.getWorkerURL(),this.worker=new a(this.url)}function TextGridParserWorker(a){a=a||window.Worker,this.url=this.getWorkerURL(),this.worker=new a(this.url)}function SpectroDrawingWorker(a){a=a||window.Worker,this.url=this.getWorkerURL(),this.worker=new a(this.url)}function SsffParserWorker(a){a=a||window.Worker,this.url=this.getWorkerURL(),this.worker=new a(this.url)}ArrayBuffer.prototype.subarray=function(a,b){for(var c=new ArrayBuffer(b),d=new Int8Array(c),e=new Int8Array(this),f=0;f0&&!n.vals.main.autoConnect)return"Do you really wish to leave/reload the EMU-webApp? All unsaved changes will be lost..."},a.$on("connectionDisrupted",function(){B.resetToInitState()}),a.$on("resetToInitState",function(){a.loadDefaultConfig()}),a.$on("reloadToInitState",function(b,c){a.loadDefaultConfig(),j.url=c.url,j.somethingInProgressTxt="Connecting to server...",j.somethingInProgress=!0,l.wsH.initConnect(c.url).then(function(b){"error"===b.type?D.open("views/error.html","Could not connect to websocket server: "+c.url).then(function(){B.resetToInitState()}):a.handleConnectedToWSserver(c)},function(a){D.open("views/error.html","Could not connect to websocket server: "+JSON.stringify(a,null,4)).then(function(){B.resetToInitState()})})});var F=i.search();F.audioGetUrl&&F.labelGetUrl&&F.labelType&&(n.embeddedVals.audioGetUrl=F.audioGetUrl,n.embeddedVals.labelGetUrl=F.labelGetUrl,n.embeddedVals.labelType=F.labelType,n.embeddedVals.fromUrlParams=!0),a.loadFilesForEmbeddedApp=function(){var a=i.search();if(a.audioGetUrl||a.bndlJsonGetUrl){if(a.audioGetUrl){n.embeddedVals.audioGetUrl=a.audioGetUrl,n.vals.activeButtons.openDemoDB=!1;var b=l.httpGetPath(n.embeddedVals.audioGetUrl,"arraybuffer")}else var b=l.httpGetPath(a.bndlJsonGetUrl,"application/json");b.then(function(b){j.showDropZone=!1;var c=n.embeddedVals.audioGetUrl;z.setCurBndlName(c.substr(0,c.lastIndexOf(".")).substr(c.lastIndexOf("/")+1,c.length)),j.getsubmenuOpen()&&j.toggleSubmenu(n.design.animation.period),j.somethingInProgressTxt="Loading DB config...";var d;d=a.DBconfigGetUrl?a.DBconfigGetUrl:"configFiles/embedded_emuwebappConfig.json",l.httpGetPath(d).then(function(c){j.curPerspectiveIdx=0,n.setVals(c.data.EMUwebAppConfig);var d=x.validateJSO("emuwebappConfigSchema",n.vals);if(!0===d)if(n.embeddedVals.fromUrlParams&&(n.vals.main.catchMouseForKeyBinding=!1),n.curDbConfig=c.data,!0===(d=x.validateJSO("DBconfigFileSchema",n.curDbConfig))){var e=[{session:"File(s)",name:"from URL parameters"}];z.setBundleList(e),z.setCurBndl(e[0]),j.somethingInProgress=!0,j.somethingInProgressTxt="Parsing WAV file...",a.audioGetUrl?u.parseWavAudioBuf(b.data).then(function(b){var c=b;j.curViewPort.sS=0,j.curViewPort.eS=c.length,j.resetSelect(),m.audioBuffer=c;var d;d=(n.embeddedVals.labelType,"text"),a.labelGetUrl?l.httpGetPath(n.embeddedVals.labelGetUrl,d).then(function(b){j.somethingInProgressTxt="Parsing "+n.embeddedVals.labelType+" file...",l.parseLabelFile(b.data,n.embeddedVals.labelGetUrl,"embeddedTextGrid",n.embeddedVals.labelType).then(function(b){var c=b;if(C.setData(c),!a.DBconfigGetUrl){var d=[],e=[];c.levels.forEach(function(a){d.push(a.name),e.push({name:a.name,type:a.type,attributeDefinitions:{name:a.name,type:"string"}})}),n.curDbConfig.levelDefinitions=e,n.vals.perspectives[j.curPerspectiveIdx].levelCanvases.order=d}j.setCurLevelAttrDefs(n.curDbConfig.levelDefinitions),j.somethingInProgressTxt="Done!",j.somethingInProgress=!1,j.setState("labeling")},function(a){D.open("views/error.html","Error parsing wav file: "+a.status.message)})},function(a){D.open("views/error.html","Could not get label file: "+n.embeddedVals.labelGetUrl+" ERROR "+JSON.stringify(a.message,null,4))}):(n.vals.activeButtons.downloadAnnotation=!1,n.vals.activeButtons.downloadTextGrid=!1,n.vals.activeButtons.search=!1,j.somethingInProgressTxt="Done!",j.somethingInProgress=!1,j.setState("labeling"))},function(a){D.open("views/error.html","Error parsing wav file: "+a.status.message)}):A.loadBundle({name:"fromURLparams"},a.bndlJsonGetUrl)}else D.open("views/error.html","Error validating / checking DBconfig: "+JSON.stringify(d,null,4));else D.open("views/error.html","Error validating ConfigProviderService.vals (emuwebappConfig data) after applying changes of newly loaded config (most likely due to wrong entry...): "+JSON.stringify(d,null,4))},function(a){D.open("views/error.html","Could not get embedded_config.json: "+a)})},function(a){D.open("views/error.html","Could not get audio file:"+n.embeddedVals.audioGetUrl+" ERROR: "+JSON.stringify(a,null,4))})}},a.loadDefaultConfig=function(){j.somethingInProgress=!0,j.somethingInProgressTxt="Loading schema files",x.loadSchemas().then(function(b){x.setSchemas(b),l.httpGetDefaultDesign().then(function(b){n.setDesign(b.data),l.httpGetDefaultConfig().then(function(b){j.somethingInProgressTxt="Validating emuwebappConfig";var c=x.validateJSO("emuwebappConfigSchema",b.data);!0===c?(n.setVals(b.data),angular.copy(a.cps.vals,a.cps.initDbConfig),a.handleDefaultConfigLoaded(),a.loadFilesForEmbeddedApp(),a.checkIfToShowWelcomeModal(),j.somethingInProgress=!1):D.open("views/error.html","Error validating / checking emuwebappConfigSchema: "+JSON.stringify(c,null,4)).then(function(){B.resetToInitState()})},function(a){D.open("views/error.html","Could not get defaultConfig for EMU-webApp: status: "+a.status+" headers: "+a.headers+" config "+a.config).then(function(){B.resetToInitState()})})},function(a){D.open("views/error.html","Could not get defaultConfig for EMU-webApp: status: "+a.status+" headers: "+a.headers+" config "+a.config).then(function(){B.resetToInitState()})})},function(a){D.open("views/error.html","Error loading schema file: "+JSON.stringify(a,null,4)).then(function(){B.resetToInitState()})})},a.loadDefaultConfig(),a.checkIfToShowWelcomeModal=function(){var b=localStorage.getItem("haveShownWelcomeModal"),c=i.search();E.isBrowser.PhantomJS()||null!==b||void 0===c.viewer_pane||(localStorage.setItem("haveShownWelcomeModal","true"),a.internalVars.showAboutHint=!0)},a.getCurBndlName=function(){return z.getCurBndlName()},a.handleDefaultConfigLoaded=function(){j.getsubmenuOpen()||j.toggleSubmenu(n.design.animation.period);var b=i.search();(n.vals.main.autoConnect||"true"===b.autoConnect)&&(void 0!==b.serverUrl&&(n.vals.main.serverUrl=b.serverUrl),l.wsH.initConnect(n.vals.main.serverUrl).then(function(b){"error"===b.type?D.open("views/error.html","Could not connect to websocket server: "+n.vals.main.serverUrl).then(function(){B.resetToInitState()}):a.handleConnectedToWSserver({session:null,reload:null})},function(a){D.open("views/error.html","Could not connect to websocket server: "+JSON.stringify(a,null,4)).then(function(){B.resetToInitState()})})),j.setspectroSettings(n.vals.spectrogramSettings.windowSizeInSecs,n.vals.spectrogramSettings.rangeFrom,n.vals.spectrogramSettings.rangeTo,n.vals.spectrogramSettings.dynamicRange,n.vals.spectrogramSettings.window,n.vals.spectrogramSettings.drawHeatMapColors,n.vals.spectrogramSettings.preEmphasisFilterFactor,n.vals.spectrogramSettings.heatMapColorAnchors),j.setTransitionTime(n.design.animation.period)},a.handleConnectedToWSserver=function(b){var c=b.session,d=b.reload;j.showDropZone=!1,n.vals.main.comMode="WS",n.vals.activeButtons.openDemoDB=!1,j.somethingInProgress=!0,j.somethingInProgressTxt="Checking protocol...",l.getProtocol().then(function(b){"EMU-webApp-websocket-protocol"===b.protocol&&"0.0.2"===b.version?(j.somethingInProgressTxt="Checking user management...",l.getDoUserManagement().then(function(b){"NO"===b?a.innerHandleConnectedToWSserver({session:c,reload:d}):D.open("views/loginModal.html").then(function(b){b?a.innerHandleConnectedToWSserver({session:c,reload:d}):B.resetToInitState()})})):D.open("views/error.html","Could not connect to websocket server: "+n.vals.main.serverUrl+'. It does not speak the same protocol as this client. Its protocol answer was: "'+b.protocol+'" with the version: "'+b.version+'"').then(function(){B.resetToInitState()})})},a.innerHandleConnectedToWSserver=function(a){var b=a.session,c=a.reload;j.somethingInProgressTxt="Loading DB config...",l.httpGetDefaultDesign().then(function(a){n.setDesign(a.data),l.getDBconfigFile().then(function(a){j.curPerspectiveIdx=0,n.setVals(a.EMUwebAppConfig);var d=x.validateJSO("emuwebappConfigSchema",n.vals);!0===d?(n.curDbConfig=a,j.setCurLevelAttrDefs(n.curDbConfig.levelDefinitions),d=x.validateJSO("DBconfigFileSchema",a),!0===d?(j.somethingInProgressTxt="Loading bundle list...",l.getBundleList().then(function(a){d=z.setBundleList(a),n.vals.activeButtons.clear=!0,n.vals.activeButtons.specSettings=!0,!0===d?(null===b&&(b=z.getBundleList()[0]),A.loadBundle(b).then(function(){}),c&&z.openCollapseSession(b.session)):D.open("views/error.html","Error validating bundleList: "+JSON.stringify(d,null,4)).then(function(){B.resetToInitState()})})):D.open("views/error.html","Error validating / checking DBconfig: "+JSON.stringify(d,null,4)).then(function(){B.resetToInitState()})):D.open("views/error.html","Error validating ConfigProviderService.vals (emuwebappConfig data) after applying changes of newly loaded config (most likely due to wrong entry...): "+JSON.stringify(d,null,4)).then(function(){B.resetToInitState()})})})},a.toggleCollapseSession=function(b){a.uniqSessionList[b].collapsed=!a.uniqSessionList[b].collapsed},a.getEnlarge=function(a){var b=n.vals.perspectives[j.curPerspectiveIdx].signalCanvases.order.length;return-1===j.getenlarge()?"auto":1===b?"auto":2===b?j.getenlarge()===a?"70%":"27%":j.getenlarge()===a?"50%":45/(b-1)+"%"},a.cursorInTextField=function(){j.setcursorInTextField(!0)},a.cursorOutOfTextField=function(){j.setcursorInTextField(!1)},a.addLevelSegBtnClick=function(){if(j.getPermission("addLevelSegBtnClick")){var a=0;void 0!==C.data.levels&&(a=C.data.levels.length);var b="levelNr"+a,c={items:[],name:b,type:"SEGMENT"};if(void 0===j.getCurAttrDef(b)){var d={name:b,type:"EVENT",attributeDefinitions:{name:b,type:"string"}};j.setCurLevelAttrDefs(d)}q.insertLevel(c,a,j.curPerspectiveIdx),k.addObjToUndoStack({type:"ANNOT",action:"INSERTLEVEL",level:c,id:a,curPerspectiveIdx:j.curPerspectiveIdx}),j.selectLevel(!1,n.vals.perspectives[j.curPerspectiveIdx].levelCanvases.order,q)}},a.addLevelPointBtnClick=function(){if(j.getPermission("addLevelPointBtnClick")){var a=0;void 0!==C.data.levels&&(a=C.data.levels.length);var b="levelNr"+a,c={items:[],name:b,type:"EVENT"};if(void 0===j.getCurAttrDef(b)){var d={name:b,type:"EVENT",attributeDefinitions:{name:b,type:"string"}};j.setCurLevelAttrDefs(d)}q.insertLevel(c,a,j.curPerspectiveIdx),k.addObjToUndoStack({type:"ANNOT",action:"INSERTLEVEL",level:c,id:a,curPerspectiveIdx:j.curPerspectiveIdx}),j.selectLevel(!1,n.vals.perspectives[j.curPerspectiveIdx].levelCanvases.order,q)}},a.renameSelLevelBtnClick=function(){j.getPermission("renameSelLevelBtnClick")&&(void 0!==j.getcurClickLevelName()?D.open("views/renameLevel.html",j.getcurClickLevelName()):D.open("views/error.html","Rename Error : Please choose a Level first !"))},a.downloadTextGridBtnClick=function(){j.getPermission("downloadTextGridBtnClick")&&r.asyncToTextGrid().then(function(a){a=a.replace(/\t/g," "),D.open("views/export.html",z.getCurBndl().name+".TextGrid",a)})},a.downloadAnnotationBtnClick=function(){j.getPermission("downloadAnnotationBtnClick")&&x.validateJSO("emuwebappConfigSchema",C.getData())&&D.open("views/export.html",z.getCurBndl().name+"_annot.json",angular.toJson(C.getData(),!0))},a.spectSettingsBtnClick=function(){j.getPermission("spectSettingsChange")&&D.open("views/spectSettings.html")},a.connectBtnClick=function(){j.getPermission("connectBtnClick")&&D.open("views/connectModal.html").then(function(b){b&&(j.somethingInProgressTxt="Connecting to server...",j.somethingInProgress=!0,j.url=b,l.wsH.initConnect(b).then(function(c){"error"===c.type?D.open("views/error.html","Could not connect to websocket server: "+b).then(function(){B.resetToInitState()}):a.handleConnectedToWSserver({session:null,reload:null})},function(a){D.open("views/error.html","Could not connect to websocket server: "+JSON.stringify(a,null,4)).then(function(){B.resetToInitState()})}))})},a.openDemoDBbtnClick=function(b){j.getPermission("openDemoBtnDBclick")&&(a.dropdown=!1,n.vals.activeButtons.openDemoDB=!1,z.setDemoDbName(b),j.showDropZone=!1,j.somethingInProgress=!0,j.setState("loadingSaving"),n.vals.main.comMode="DEMO",j.somethingInProgressTxt="Loading DB config...",l.httpGetDefaultDesign().then(function(a){n.setDesign(a.data),l.getDBconfigFile(b).then(function(a){var c=a.data;j.curPerspectiveIdx=0,n.setVals(c.EMUwebAppConfig);var d=x.validateJSO("emuwebappConfigSchema",n.vals);!0===d?(n.curDbConfig=c,j.setCurLevelAttrDefs(n.curDbConfig.levelDefinitions),d=x.validateJSO("DBconfigFileSchema",n.curDbConfig),!0===d?(j.somethingInProgressTxt="Loading bundle list...",l.getBundleList(b).then(function(a){var b=a.data;z.setBundleList(b),n.vals.activeButtons.clear=!0,n.vals.activeButtons.specSettings=!0,A.loadBundle(z.getBundleList()[0])},function(a){D.open("views/error.html","Error loading bundle list of "+b+": "+a.data+" STATUS: "+a.status).then(function(){B.resetToInitState()})})):D.open("views/error.html","Error validating / checking DBconfig: "+JSON.stringify(d,null,4)).then(function(){B.resetToInitState()})):D.open("views/error.html","Error validating ConfigProviderService.vals (emuwebappConfig data) after applying changes of newly loaded config (most likely due to wrong entry...): "+JSON.stringify(d,null,4)).then(function(){B.resetToInitState()})},function(a){D.open("views/error.html","Error loading DB config of "+b+": "+a.data+" STATUS: "+a.status).then(function(){B.resetToInitState()})})}))},a.aboutBtnClick=function(){j.getPermission("aboutBtnClick")&&D.open("views/help.html")},a.showHierarchyBtnClick=function(){j.hierarchyState.isShown()||(j.hierarchyState.toggleHierarchy(),D.open("views/showHierarchyModal.html"))},a.showEditDBconfigBtnClick=function(){D.open("views/tabbed.html").then(function(b){!1===b||(x.validateJSO("emuwebappConfigSchema",b)?a.cps.getDelta(b).then(function(b){l.saveConfiguration(angular.toJson(b,!0)).then(function(){0!==k.movesAwayFromLastSave&&"DEMO"!==n.vals.main.comMode?D.open("views/confirmModal.html","Do you wish to clear all loaded data and if connected disconnect from the server? CAUTION: YOU HAVE UNSAVED CHANGES! These will be lost if you confirm.").then(function(a){a&&B.reloadToInitState()}):B.reloadToInitState(a.lmds.getCurBndl())})}):D.open("views/error.html","Sorry, there were errors in your configuration."))})},a.searchBtnClick=function(){j.getPermission("searchBtnClick")&&D.open("views/searchAnnot.html")},a.clearBtnClick=function(){var a;a=0!==k.movesAwayFromLastSave&&"DEMO"!==n.vals.main.comMode?"Do you wish to clear all loaded data and if connected disconnect from the server? CAUTION: YOU HAVE UNSAVED CHANGES! These will be lost if you confirm.":"Do you wish to clear all loaded data and if connected disconnect from the server? You have NO unsaved changes so no changes will be lost.",D.open("views/confirmModal.html",a).then(function(a){a&&B.resetToInitState()})},a.cmdZoomAll=function(){j.getPermission("zoom")&&(q.deleteEditArea(),j.setViewPort(0,m.audioBuffer.length))},a.cmdZoomIn=function(){j.getPermission("zoom")&&(q.deleteEditArea(),j.zoomViewPort(!0))},a.cmdZoomOut=function(){j.getPermission("zoom")&&(q.deleteEditArea(),j.zoomViewPort(!1))},a.cmdZoomLeft=function(){j.getPermission("zoom")&&(q.deleteEditArea(),j.shiftViewPort(!1))},a.cmdZoomRight=function(){j.getPermission("zoom")&&(q.deleteEditArea(),j.shiftViewPort(!0))},a.cmdZoomSel=function(){j.getPermission("zoom")&&(q.deleteEditArea(),j.setViewPort(j.curViewPort.selectS,j.curViewPort.selectE))},a.cmdPlayView=function(){j.getPermission("playaudio")&&(m.playFromTo(j.curViewPort.sS,j.curViewPort.eS),j.animatePlayHead(j.curViewPort.sS,j.curViewPort.eS))},a.cmdPlaySel=function(){j.getPermission("playaudio")&&(m.playFromTo(j.curViewPort.selectS,j.curViewPort.selectE),j.animatePlayHead(j.curViewPort.selectS,j.curViewPort.selectE))},a.cmdPlayAll=function(){j.getPermission("playaudio")&&(m.playFromTo(0,m.audioBuffer.length),j.animatePlayHead(0,m.audioBuffer.length))},a.changePerspective=function(a){for(var b,c=0;c=a.vs.curViewPort.sS&&k.sampleStart<=a.vs.curViewPort.eS||k.sampleStart+k.sampleDur>a.vs.curViewPort.sS&&k.sampleStart+k.sampleDura.vs.curViewPort.eS){var m;if(k.labels.forEach(function(a){a.name===h&&(m=a.value)}),l=a.vs.getPos(j.canvas.width,k.sampleStart),o=a.vs.getPos(j.canvas.width,k.sampleStart+k.sampleDur+1),j.fillStyle=d.design.color.black,j.fillRect(l,0,2,j.canvas.height/2),j.fillStyle=d.design.color.grey,j.fillRect(o,j.canvas.height/2,2,j.canvas.height),j.font=f-2+"px "+b,void 0!==m&&o-l>r*m.length&&(i?g.drawUndistortedText(j,m,e-2,b,l+(o-l)/2,j.canvas.height/2-(f-2)+2,d.design.color.black,!1):g.drawUndistortedText(j,m,e-2,b,l+(o-l)/2,j.canvas.height/2-f+2,d.design.color.black,!1)),a.open&&void 0!==m&&0!==m.length){var n=l+(o-l)/2,p=j.canvas.height/4;j.strokeStyle=d.design.color.black,j.beginPath(),j.moveTo(l,p),j.lineTo(n,p),j.lineTo(n,p+5),j.stroke(),p=j.canvas.height/4*3,j.strokeStyle=d.design.color.grey,j.beginPath(),j.moveTo(o,p),j.lineTo(n,p),j.lineTo(n,p-5),j.stroke()}if(a.open){o-l>s*k.sampleStart.toString().length&&i&&g.drawUndistortedText(j,k.sampleStart,f-2,c,l+3,0,d.design.color.grey,!0);var t="dur: "+k.sampleDur+" ";o-l>s*t.length&&i&&g.drawUndistortedText(j,t,f-2,c,o-j.measureText(t).width*g.scaleX,j.canvas.height/4*3,d.design.color.grey,!0)}}});else if("EVENT"===a.level.type){j.fillStyle=d.design.color.black;var t;a.level.items.forEach(function(c){if(c.samplePoint>a.vs.curViewPort.sS&&c.samplePoint0&&o.forEach(function(c){void 0!==c&&(void 0!==c.sampleStart?(f=Math.round(a.vs.getPos(b.canvas.width,c.sampleStart)),g=Math.round(a.vs.getPos(b.canvas.width,c.sampleStart+c.sampleDur+1))):(f=Math.round(a.vs.getPos(b.canvas.width,c.samplePoint)+h/2),f-=5,g=f+10),b.fillStyle=d.design.color.transparent.yellow,b.fillRect(f,0,g-f,b.canvas.height),b.fillStyle=d.design.color.black)}),j=a.vs.getcurMouseItem(),a.level.items.length>0&&void 0!==j&&void 0!==k&&a.level.name===a.vs.getcurMouseLevelName()&&(b.fillStyle=d.design.color.blue,!0===l?"SEGMENT"===a.vs.getcurMouseLevelType()&&(j=a.level.items[0],f=Math.round(a.vs.getPos(b.canvas.width,j.sampleStart)),b.fillRect(f,0,3,b.canvas.height)):!0===m?"SEGMENT"===a.vs.getcurMouseLevelType()&&(j=a.level.items[a.level.items.length-1],f=Math.round(a.vs.getPos(b.canvas.width,j.sampleStart+j.sampleDur+1)),b.fillRect(f,0,3,b.canvas.height)):"SEGMENT"===a.vs.getcurMouseLevelType()?(f=Math.round(a.vs.getPos(b.canvas.width,j.sampleStart)),b.fillRect(f,0,3,b.canvas.height)):(f=Math.round(a.vs.getPos(b.canvas.width,j.samplePoint)),i=h/2,b.fillRect(f+i,0,3,b.canvas.height)),b.fillStyle=d.design.color.black),e.drawCrossHairX(b,c.curMouseX)},a.drawHierarchyDetails=function(){var b=1*d.design.font.small.size.slice(0,-2),c=a.hls.findPaths(a.level.name),e=c[1],f=n[0].getContext("2d");f.clearRect(0,0,f.canvas.width,f.canvas.height),f.strokeStyle=d.design.color.black,a.hls.findParents(e);for(var h=0;h0){i.primeWorker=new SpectroDrawingWorker;var b=[],c=g.calcClosestPowerOf2Gt(i.shs.audioBuffer.sampleRate*i.vs.spectroSettings.windowSizeInSecs);c<512&&(c=512),b=a.subarray(i.vs.curViewPort.sS,i.vs.curViewPort.eS);var d=[],e=[],f=i.shs.audioBuffer.sampleRate*i.vs.spectroSettings.windowSizeInSecs;i.vs.curViewPort.sS=i.shs.audioBuffer.length||(e=a.subarray(i.vs.curViewPort.eS,i.vs.curViewPort.eS+c/2-1));var h=new Float32Array(d.length+b.length+e.length);h.set(d),h.set(b,d.length),h.set(e,d.length+b.length),b=i.vs.curViewPort.sS>=c/2?a.subarray(i.vs.curViewPort.sS-c/2,i.vs.curViewPort.eS+c):a.subarray(i.vs.curViewPort.sS,i.vs.curViewPort.eS+c),i.setupEvent(),i.primeWorker.tell({windowSizeInSecs:i.vs.spectroSettings.windowSizeInSecs,fftN:c,alpha:i.alpha,upperFreq:i.vs.spectroSettings.rangeTo,lowerFreq:i.vs.spectroSettings.rangeFrom,samplesPerPxl:i.calcSamplesPerPxl(),window:i.vs.spectroSettings.window,imgWidth:i.canvas0.width,imgHeight:i.canvas0.height,dynRangeInDB:i.vs.spectroSettings.dynamicRange,pixelRatio:i.devicePixelRatio,sampleRate:i.shs.audioBuffer.sampleRate,transparency:i.cps.vals.spectrogramSettings.transparency,audioBuffer:h,audioBufferChannels:i.shs.audioBuffer.numberOfChannels,drawHeatMapColors:i.vs.spectroSettings.drawHeatMapColors,preEmphasisFilterFactor:i.vs.spectroSettings.preEmphasisFilterFactor,heatMapColorAnchors:i.vs.spectroSettings.heatMapColorAnchors},[h.buffer])}}}}}]),angular.module("emuwebApp").controller("ExportCtrl",["$scope","modalService","browserDetector","viewState","HistoryService",function(a,b,c,d,e){a.firefox=c.isBrowser.Firefox(),a.getBlob=function(){var c;try{c=new Blob([b.dataExport],{type:"text/plain"})}catch(b){window.BlobBuilder=window.BlobBuilder||window.WebKitBlobBuilder||window.MozBlobBuilder,c=new BlobBuilder,c.append(a.exportData),c=c.getBlob()}return c},a.updateHistoryService=function(){e.movesAwayFromLastSave=0},a.cursorInTextField=function(){d.setEditing(!0),d.setcursorInTextField(!0)},a.cursorOutOfTextField=function(){d.setEditing(!1),d.setcursorInTextField(!1)},a.export=function(){var c;c="object"!=typeof URL&&"undefined"!=typeof webkitURL?webkitURL.createObjectURL(a.getBlob()):URL.createObjectURL(a.getBlob()),a.SaveToDisk(c,b.dataIn),b.close()},a.SaveToDisk=function(b,c){var d=document.createElement("a");d.setAttribute("download",c),d.href=b,d.innerHTML="",d.style.display="none",document.body.appendChild(d),d.click(),a.updateHistoryService()}}]),angular.module("emuwebApp").factory("viewState",["$rootScope","$timeout","$window","Soundhandlerservice","DataService","StandardFuncsService",function(a,b,c,d,e,f){var g={},h={BARTLETT:1,BARTLETTHANN:2,BLACKMAN:3,COSINE:4,GAUSS:5,HAMMING:6,HANN:7,LANCZOS:8,RECTANGULAR:9,TRIANGULAR:10},i={DEMO:1,WS:2,EMBEDDED:3},j={absolute:1,relative:2},k={OSCI:1,SPEC:2},l={DOTS:1,EPG:2};return g.curLevelAttrDefs=[],g.initialize=function(){g.curViewPort={sS:0,eS:0,selectS:-1,selectE:-1,movingS:-1,movingE:-1,dragBarActive:!1,dragBarHeight:-1,windowWidth:void 0},g.spectroSettings={windowSizeInSecs:-1,rangeFrom:-1,rangeTo:-1,dynamicRange:-1,window:-1,drawHeatMapColors:-1,preEmphasisFilterFactor:-1},g.osciSettings={curChannel:0},g.playHeadAnimationInfos={sS:-1,eS:-1,curS:null,endFreezeSample:-1,autoscroll:!1},g.hierarchyState={hierarchyShown:!1,selectedItemID:void 0,selectedLinkFromID:void 0,selectedLinkToID:void 0,editValue:void 0,inputFocus:!1,collapseInfo:{},scaleFactor:1,translate:[0,0],contextMenuID:void 0,newLinkFromID:void 0,path:[],curPathIdx:0,curNrOfPaths:0,rotated:!1,playing:0,resize:0,closeContextMenu:function(){g.hierarchyState.contextMenuID=void 0},getContextMenuID:function(){return g.hierarchyState.contextMenuID},getInputFocus:function(){return g.hierarchyState.inputFocus},getEditValue:function(){return g.hierarchyState.editValue},setEditValue:function(a){g.hierarchyState.editValue=a},reset:function(){g.hierarchyState.selectedItemID=void 0,g.hierarchyState.selectedLinkFromID=void 0,g.hierarchyState.selectedLinkToID=void 0,g.hierarchyState.editValue=void 0,g.hierarchyState.inputFocus=!1,g.hierarchyState.collapseInfo={},g.hierarchyState.scaleFactor=1,g.hierarchyState.translate=[0,0],g.hierarchyState.contextMenuID=void 0,g.hierarchyState.newLinkFromID=void 0},isRotated:function(){return g.hierarchyState.rotated},toggleRotation:function(){g.hierarchyState.rotated=!g.hierarchyState.rotated},toggleHierarchy:function(){g.hierarchyState.hierarchyShown=!g.hierarchyState.hierarchyShown,!1===g.hierarchyState.hierarchyShown&&f.traverseAndClean(e.getData())},isShown:function(){return g.hierarchyState.hierarchyShown},getCollapsed:function(a){return void 0!==g.hierarchyState.collapseInfo[a]&&("boolean"==typeof g.hierarchyState.collapseInfo[a].collapsed&&g.hierarchyState.collapseInfo[a].collapsed)},getCollapsePosition:function(a){return void 0===g.hierarchyState.collapseInfo[a]?void 0:"object"==typeof g.hierarchyState.collapseInfo[a].collapsePosition?g.hierarchyState.collapseInfo[a].collapsePosition:void 0},getNumCollapsedParents:function(a){return void 0===g.hierarchyState.collapseInfo[a]?0:"number"==typeof g.hierarchyState.collapseInfo[a].numCollapsedParents?g.hierarchyState.collapseInfo[a].numCollapsedParents:0},setCollapsed:function(a,b){void 0===g.hierarchyState.collapseInfo[a]&&(g.hierarchyState.collapseInfo[a]={}),g.hierarchyState.collapseInfo[a].collapsed=b},setCollapsePosition:function(a,b){void 0===g.hierarchyState.collapseInfo[a]&&(g.hierarchyState.collapseInfo[a]={}),g.hierarchyState.collapseInfo[a].collapsePosition=b},setNumCollapsedParents:function(a,b){void 0===g.hierarchyState.collapseInfo[a]&&(g.hierarchyState.collapseInfo[a]={}),g.hierarchyState.collapseInfo[a].numCollapsedParents=b}},g.timelineSize=-1,g.somethingInProgress=!1,g.somethingInProgressTxt="",g.historyActionTxt="",g.editing=!1,g.cursorInTextField=!1,g.saving=!0,g.submenuOpen=!1,g.rightSubmenuOpen=!1,g.curClickItems=[],g.curMousePosSample=0,g.curMouseX=0,g.curMouseTrackName=void 0,g.curMouseLevelName=void 0,g.curMouseLevelType=void 0,g.curClickLevelName=void 0,g.curClickLevelType=void 0,g.lastPcm=void 0,g.curPreselColumnSample=2,g.curCorrectionToolNr=void 0,g.curClickLevelIndex=void 0,g.start=null,g.TransitionTime=void 0,g.showDropZone=!0,g.movingBoundary=!1,g.movingBoundarySample=void 0,g.focusInTextField=!1,g.curTaskPercCompl=0,g.curPerspectiveIdx=-1,g.mouseInEmuWebApp=!1,g.focusOnEmuWebApp=!0,g.lastKeyCode=void 0,g.lastUpdate=void 0,g.url=void 0,g.pageSize=500,g.currentPage=void 0,g.curTimeAnchorIdx=-1,g.largeTextFieldInputFieldVisable=!1,g.largeTextFieldInputFieldCurLabel="",g.states=[],g.states.noDBorFilesloaded={permittedActions:["connectBtnClick","openDemoBtnDBclick","aboutBtnClick"]},g.states.loadingSaving={permittedActions:[]},g.states.labeling={permittedActions:["zoom","playaudio","spectSettingsChange","addLevelSegBtnClick","addLevelPointBtnClick","renameSelLevelBtnClick","downloadTextGridBtnClick","downloadAnnotationBtnClick","spectSettingsChange","clearBtnClick","labelAction","toggleSideBars","saveBndlBtnClick","showHierarchyBtnClick","editDBconfigBtnClick","aboutBtnClick","searchBtnClick"]},g.states.modalShowing=g.states.loadingSaving,g.prevState=g.states.noDBorFilesloaded,g.curState=g.states.noDBorFilesloaded,g.curLevelAttrDefs=[]},g.initialize(),g.getPermission=function(a){return g.curState.permittedActions.indexOf(a)>-1},g.setWindowWidth=function(a){this.curViewPort.windowWidth=a},g.setState=function(a){g.prevState=g.curState,g.curState="string"==typeof a?g.states[a]:a},g.updatePlayHead=function(b){d.isPlaying&&c.requestAnimationFrame(g.updatePlayHead),null===g.start&&(g.start=b);var e=Math.floor(b-g.start)/1e3*d.audioBuffer.sampleRate;g.playHeadAnimationInfos.curS=Math.floor(g.playHeadAnimationInfos.sS+e),d.isPlaying&&g.playHeadAnimationInfos.curS<=g.playHeadAnimationInfos.eS?(-1!==g.playHeadAnimationInfos.curS&&(g.curMousePosSample=g.playHeadAnimationInfos.curS),g.playHeadAnimationInfos.autoscroll&&g.playHeadAnimationInfos.curS>=g.curViewPort.eS&&g.setViewPort(g.curViewPort.eS,g.curViewPort.eS+(g.curViewPort.eS-g.curViewPort.sS))):(g.curMousePosSample=g.playHeadAnimationInfos.endFreezeSample,g.playHeadAnimationInfos.sS=-1,g.playHeadAnimationInfos.eS=-1,g.playHeadAnimationInfos.curS=0,g.start=null),a.$apply()},g.animatePlayHead=function(a,b,d){g.playHeadAnimationInfos.sS=a,g.playHeadAnimationInfos.eS=b,g.playHeadAnimationInfos.endFreezeSample=b,g.playHeadAnimationInfos.curS=a,void 0!==d&&(g.playHeadAnimationInfos.autoscroll=d),c.requestAnimationFrame(g.updatePlayHead)},g.select=function(a,b){g.curViewPort.selectS=a,g.curViewPort.selectE=b},g.resetSelect=function(){g.curViewPort.selectS=-1,g.curViewPort.selectE=-1},g.getViewPort=function(){return g.curViewPort},g.setspectroSettings=function(a,b,c,d,e,f,h,i){g.spectroSettings.windowSizeInSecs=a,g.spectroSettings.rangeFrom=parseInt(b,10),g.spectroSettings.rangeTo=parseInt(c,10),g.spectroSettings.dynamicRange=parseInt(d,10),g.setWindowFunction(e),g.spectroSettings.drawHeatMapColors=f,g.spectroSettings.preEmphasisFilterFactor=h,g.spectroSettings.heatMapColorAnchors=i},g.setOsciSettings=function(a){g.osciSettings.curChannel=a},g.getSelect=function(){return[g.curViewPort.selectS,g.curViewPort.selectE]},g.selectDependent=function(a,b){athis.curViewPort.selectE&&(this.curViewPort.selectE=b)},g.selectLevel=function(a,b,c){var d,e=g.getcurClickLevelName();if(void 0===e)return a?(d=c.getLevelDetails(b[b.length-1]),void g.setcurClickLevel(d.name,d.type,b.length-1)):void(null!==(d=c.getLevelDetails(b[0]))&&g.setcurClickLevel(d.name,d.type,0));var f=-1;b.forEach(function(a,b){a===e&&(f=b)}),void 0===f?(d=c.getLevelDetails(b[0]),g.setcurClickLevel(d.name,d.type,0),g.curClickItems=[],g.selectBoundary()):a?f+1=0&&(d=c.getLevelDetails(b[f-1]),g.setcurClickLevel(d.name,d.type,b.idxOfNow-1),g.curClickItems=[],g.selectBoundary())},g.setWindowFunction=function(a){switch(a){case"BARTLETT":g.spectroSettings.window=h.BARTLETT;break;case"BARTLETTHANN":g.spectroSettings.window=h.BARTLETTHANN;break;case"BLACKMAN":g.spectroSettings.window=h.BLACKMAN;break;case"COSINE":g.spectroSettings.window=h.COSINE;break;case"GAUSS":g.spectroSettings.window=h.GAUSS;break;case"HAMMING":g.spectroSettings.window=h.HAMMING;break;case"HANN":g.spectroSettings.window=h.HANN;break;case"LANCZOS":g.spectroSettings.window=h.LANCZOS;break;case"RECTANGULAR":g.spectroSettings.window=h.RECTANGULAR;break;case"TRIANGULAR":g.spectroSettings.window=h.TRIANGULAR;break;default:g.spectroSettings.window=h.BARTLETTHANN}},g.getWindowFunctions=function(){return h},g.getCommunicationModes=function(){return i},g.getTimeModes=function(){return j},g.getSignalTypes=function(){return k},g.getTwoDimTypes=function(){return l},g.getdragBarActive=function(){return this.curViewPort.dragBarActive},g.setdragBarActive=function(a){this.curViewPort.dragBarActive=a},g.getdragBarHeight=function(){return this.curViewPort.dragBarHeight},g.setdragBarHeight=function(a){this.curViewPort.dragBarHeight=a},g.getPos=function(a,b){return a*(b-this.curViewPort.sS)/(this.curViewPort.eS-this.curViewPort.sS+1)},g.getSampleDist=function(a){return this.getPos(a,this.curViewPort.sS+1)-this.getPos(a,this.curViewPort.sS)},g.toggleSubmenu=function(a){this.submenuOpen=!this.submenuOpen,b(function(){var a=new Date;g.lastUpdate=a.getTime()},a)},g.getsubmenuOpen=function(){return this.submenuOpen},g.setsubmenuOpen=function(a){this.submenuOpen=a},g.setenlarge=function(a){this.timelineSize=a},g.getenlarge=function(){return this.timelineSize},g.getTransitionTime=function(){return this.TransitionTime},g.setTransitionTime=function(a){this.TransitionTime=a},g.getRightsubmenuOpen=function(){return this.rightSubmenuOpen},g.setRightsubmenuOpen=function(a){this.rightSubmenuOpen=a},g.setcurClickLevel=function(a,b,c){g.setcurClickLevelName(a,c),g.setcurClickLevelType(b)},g.setcurClickLevelType=function(a){this.curClickLevelType=a},g.getcurClickLevelType=function(){return this.curClickLevelType},g.setcurClickLevelName=function(a,b){this.curClickLevelName=a,this.curClickLevelIndex=b},g.getcurClickLevelName=function(){return this.curClickLevelName},g.getcurClickLevelIndex=function(){return this.curClickLevelIndex},g.getcurClickNeighbours=function(){return this.curClickNeighbours},g.setcurMouseLevelName=function(a){this.curMouseLevelName=a},g.getcurMouseLevelName=function(){return this.curMouseLevelName},g.setcurMouseLevelType=function(a){this.curMouseLevelType=a},g.getcurMouseLevelType=function(){return this.curMouseLevelType},g.setcurMouseItem=function(a,b,c,d,e){this.curMouseItem=a,this.curMouseX=c,this.curMouseNeighbours=b,this.curMouseisFirst=d,this.curMouseisLast=e},g.getcurMouseItem=function(){return this.curMouseItem},g.getcurMouseisFirst=function(){return this.curMouseisFirst},g.getcurMouseisLast=function(){return this.curMouseisLast},g.getcurMouseNeighbours=function(){return this.curMouseNeighbours},g.getItemsInSelection=function(a){var b=[],c=g.curViewPort.selectS,d=g.curViewPort.selectE;return angular.forEach(a,function(a){a.name===g.getcurClickLevelName()&&angular.forEach(a.items,function(a){a.sampleStart>=c&&a.sampleStart+a.sampleDur<=d&&b.push(a),a.samplePoint>=c&&a.samplePoint<=d&&b.push(a)})}),b.sort(g.sortbystart)},g.setcurClickItem=function(a){null!==a&&void 0!==a?(g.curClickItems=[],g.curClickItems.push(a),g.selectBoundary()):g.curClickItems=[]},g.selectBoundary=function(){if(g.curClickItems.length>0){var a,b;a=void 0===g.curClickItems[0].samplePoint?g.curClickItems[0].sampleStart:g.curClickItems[0].samplePoint,b=void 0===g.curClickItems[0].samplePoint?g.curClickItems[g.curClickItems.length-1].sampleStart+g.curClickItems[g.curClickItems.length-1].sampleDur:g.curClickItems[0].samplePoint,g.curClickItems.forEach(function(c){c.sampleStart<=a&&(a=c.sampleStart),c.sampleStart+c.sampleDur>=b&&(b=c.sampleStart+c.sampleDur)}),g.select(a,b+1)}},g.setcurClickItemMultiple=function(a,b){0===g.curClickItems.length||void 0===g.curClickItems||null===g.curClickItems?(g.curClickItems=[],g.curClickItems.push(a)):-1===g.curClickItems.indexOf(a)?(g.curClickItems.indexOf(b)<0&&(g.curClickItems=[]),g.curClickItems.push(a),g.curClickItems.sort(g.sortbystart)):(g.curClickItems=[],g.curClickItems.push(a))},g.sortbystart=function(a,b){return a.sampleStart>b.sampleStart||a.samplePoint>b.samplePoint?1:a.sampleStart1?{start:this.curClickItems[0].sampleStart,end:this.curClickItems[this.curClickItems.length-1].sampleStart+this.curClickItems[this.curClickItems.length-1].sampleDur}:1===this.curClickItems.length?void 0!==this.curClickItems[0].sampleStart?{start:this.curClickItems[0].sampleStart,end:this.curClickItems[0].sampleStart+this.curClickItems[0].sampleDur}:{start:this.curClickItems[0].samplePoint,end:this.curClickItems[0].samplePoint}:{start:-1,end:-1}},g.getcurClickItems=function(){return this.curClickItems},g.getselected=function(){return this.curClickItems},g.isEditing=function(){return this.editing},g.setEditing=function(a){this.editing=a},g.getLasPcm=function(){return this.lastPcm},g.setLastPcm=function(a){this.lastPcm=a},g.getcursorInTextField=function(){return this.cursorInTextField},g.setcursorInTextField=function(a){this.cursorInTextField=a},g.isSavingAllowed=function(){return this.saving},g.setSavingAllowed=function(a){this.saving=a},g.countSelected=function(){return this.curClickItems.length},g.getCurrentSample=function(a){return this.curViewPort.sS+(this.curViewPort.eS-this.curViewPort.sS)*a},g.getCurrentPercent=function(a){return a*(100/(this.curViewPort.eS-this.curViewPort.sS)/100)},g.getSamplesPerPixelVal=function(a){var b=parseFloat(this.curViewPort.sS);return(parseFloat(this.curViewPort.eS)-b)/a.originalEvent.target.width},g.getViewPortStartTime=function(){return this.curViewPort.sS/d.audioBuffer.sampleRate-.5/d.audioBuffer.sampleRate},g.getViewPortEndTime=function(){return this.curViewPort.eS/d.audioBuffer.sampleRate+.5/d.audioBuffer.sampleRate},g.getSelectedStartTime=function(){return this.curViewPort.selectS/d.audioBuffer.sampleRate-.5/d.audioBuffer.sampleRate},g.getSelectedEndTime=function(){return this.curViewPort.selectE/d.audioBuffer.sampleRate+.5/d.audioBuffer.sampleRate},g.calcSampleTime=function(a){return a/d.audioBuffer.sampleRate+.5/d.audioBuffer.sampleRate},g.setViewPort=function(a,b){var c=this.curViewPort.sS,e=this.curViewPort.eS;void 0!==a&&(this.curViewPort.sS=Math.round(a)),void 0!==b&&(this.curViewPort.eS=Math.round(b)),c>this.curViewPort.sS&&e>this.curViewPort.eS&&this.curViewPort.sS<0&&(this.curViewPort.sS=0,this.curViewPort.eS=e+Math.abs(this.curViewPort.sS)),cd.audioBuffer.length&&(this.curViewPort.sS=c,this.curViewPort.eS=d.audioBuffer.length),this.curViewPort.sS<0&&(this.curViewPort.sS=0),this.curViewPort.eS>d.audioBuffer.length&&(this.curViewPort.eS=d.audioBuffer.length),this.curViewPort.eS-this.curViewPort.sS<4&&(this.curViewPort.sS=c,this.curViewPort.eS=e)},g.zoomViewPort=function(a,b){var c,d,e,f=this.getcurMouseItem(),h=this.curViewPort.eS-this.curViewPort.sS,i=!1;if(void 0!==f){this.getcurMouseisFirst()?f=b.getItemDetails(g.getcurMouseLevelName(),0):this.getcurMouseisLast()&&(f=b.getLastItem(g.getcurMouseLevelName()),i=!0),e="SEGMENT"===this.getcurMouseLevelType()?i?f.sampleStart+f.sampleDur:f.sampleStart:f.samplePoint;var j=e-this.curViewPort.sS,k=this.curViewPort.eS-e;a?(c=this.curViewPort.sS+.5*j,d=this.curViewPort.eS-.5*k):(c=this.curViewPort.sS-.5*j,d=this.curViewPort.eS+.5*k)}else a?(c=this.curViewPort.sS+~~(h/4),d=this.curViewPort.eS-~~(h/4)):(c=this.curViewPort.sS-~~(h/4),d=this.curViewPort.eS+~~(h/4));this.setViewPort(c,d)},g.shiftViewPort=function(a){var b,c;a?(b=this.curViewPort.sS+~~((this.curViewPort.eS-this.curViewPort.sS)/4),c=this.curViewPort.eS+~~((this.curViewPort.eS-this.curViewPort.sS)/4)):(b=this.curViewPort.sS-~~((this.curViewPort.eS-this.curViewPort.sS)/4),c=this.curViewPort.eS-~~((this.curViewPort.eS-this.curViewPort.sS)/4)),this.setViewPort(b,c)},g.setCurLevelAttrDefs=function(a){angular.forEach(a,function(a){g.curLevelAttrDefs.push({levelName:a.name,curAttrDefName:a.name})})},g.setCurAttrDef=function(a,b,c){angular.forEach(g.curLevelAttrDefs,function(d){d.levelName===a&&(d.curAttrDefName=b,d.curAttrDefIndex=c)})},g.getCurAttrDef=function(a){var b;return angular.forEach(g.curLevelAttrDefs,function(c){c.levelName===a&&(b=c.curAttrDefName)}),b},g.getCurAttrIndex=function(a){var b;return angular.forEach(g.curLevelAttrDefs,function(c){c.levelName===a&&(b=void 0===c.curAttrDefIndex?0:c.curAttrDefIndex)}),b},g.setlastKeyCode=function(a){this.lastKeyCode=a},g.getX=function(a){return(a.offsetX||a.originalEvent.layerX)*(a.originalEvent.target.width/a.originalEvent.target.clientWidth)},g.getY=function(a){return(a.offsetY||a.originalEvent.layerY)*(a.originalEvent.target.height/a.originalEvent.target.clientHeight)},g.resetToInitState=function(){g.initialize()},g.getColorOfAnchor=function(a,b){return{"background-color":"rgb("+a[b][0]+","+a[b][1]+","+a[b][2]+")",width:"10px",height:"10px"}},g.numberOfPages=function(a){return Math.ceil(a/g.pageSize)},g.switchPerspective=function(a,b){b.length>a&&(g.curPerspectiveIdx=a)},g}]),angular.module("emuwebApp").directive("trackMouseInLevel",["$document","viewState","LevelService","ConfigProviderService","HistoryService","Soundhandlerservice",function(a,b,c,d,e,f){return{restrict:"A",replace:!0,scope:{levelName:"=",levelType:"="},link:function(a,g,h){a.lastEventClick=void 0,a.lastEventMove=void 0,a.lastNeighboursMove=void 0,a.lastPCM=void 0,a.curMouseSampleNrInView=void 0,a.order=h.trackMouseInLevel,g.bind("click",function(b){b.preventDefault(),a.setLastMove(b,!0),a.setLastClick(b)}),g.bind("contextmenu",function(b){b.preventDefault(),a.setLastMove(b,!0),a.setLastRightClick(b)}),g.bind("dblclick",function(b){a.setLastMove(b,!0),d.vals.restrictions.editItemName?a.setLastDblClick(b):a.setLastClick(b)}),g.bind("mousemove",function(g){var h,i;if(b.focusOnEmuWebApp){if(!b.getdragBarActive()){h=!0;var j=b.getSamplesPerPixelVal(g);if(a.curMouseSampleNrInView=b.getX(g)*j,i=a.curMouseSampleNrInView-a.lastPCM,j<=1){var k=c.getClosestItem(a.curMouseSampleNrInView+b.curViewPort.sS,a.levelName,f.audioBuffer.length);if("SEGMENT"===a.levelType)if(!0===k.isFirst&&!1===k.isLast)i=Math.ceil(a.curMouseSampleNrInView+b.curViewPort.sS-c.getItemDetails(a.levelName,0).sampleStart);else if(!1===k.isFirst&&!0===k.isLast){var l=c.getLastItem(a.levelName);i=Math.ceil(a.curMouseSampleNrInView+b.curViewPort.sS-l.sampleStart-l.sampleDur)}else i=Math.ceil(a.curMouseSampleNrInView+b.curViewPort.sS-c.getItemFromLevelById(a.levelName,k.nearest.id).sampleStart);else i=Math.ceil(a.curMouseSampleNrInView+b.curViewPort.sS-c.getItemFromLevelById(a.levelName,k.nearest.id).samplePoint-.5)}else i=Math.round(a.curMouseSampleNrInView-a.lastPCM)}switch(void 0===g.buttons?g.which:g.buttons){case 1:case 2:case 3:break;default:if(!b.getdragBarActive()){var m,n=b.getcurMouseItem();d.vals.restrictions.editItemSize&&g.shiftKey?(c.deleteEditArea(),void 0!==n&&(b.movingBoundary=!0,"SEGMENT"===a.levelType?(b.getcurMouseisFirst()||b.getcurMouseisLast()?b.getcurMouseisFirst()?(m=c.getItemDetails(a.levelName,0),b.movingBoundarySample=m.sampleStart+i):b.getcurMouseisLast()&&(m=c.getLastItem(a.levelName),b.movingBoundarySample=m.sampleStart+m.sampleDur+i):(b.movingBoundarySample=n.sampleStart+i,m=n),c.moveBoundary(a.levelName,m.id,i,b.getcurMouseisFirst(),b.getcurMouseisLast()),e.updateCurChangeObj({type:"ANNOT",action:"MOVEBOUNDARY",name:a.levelName,id:m.id,movedBy:i,isFirst:b.getcurMouseisFirst(),isLast:b.getcurMouseisLast()})):(m=n,b.movingBoundarySample=n.samplePoint+i,c.moveEvent(a.levelName,m.id,i),e.updateCurChangeObj({type:"ANNOT",action:"MOVEEVENT",name:a.levelName,id:m.id,movedBy:i})),a.lastPCM=a.curMouseSampleNrInView,b.setLastPcm(a.lastPCM),b.selectBoundary(),h=!1)):d.vals.restrictions.editItemSize&&g.altKey?(c.deleteEditArea(),"SEGMENT"===a.levelType?(m=b.getcurClickItems(),void 0!==m[0]&&(c.moveSegment(a.levelName,m[0].id,m.length,i),e.updateCurChangeObj({type:"ANNOT",action:"MOVESEGMENT",name:a.levelName,id:m[0].id,length:m.length,movedBy:i})),a.lastPCM=a.curMouseSampleNrInView,b.setLastPcm(a.lastPCM),b.selectBoundary()):"EVENT"===a.levelType&&(m=b.getcurClickItems(),void 0!==m[0]&&angular.forEach(m,function(b){c.moveEvent(a.levelName,b.id,i),e.updateCurChangeObj({type:"ANNOT",action:"MOVEEVENT",name:a.levelName,id:b.id,movedBy:i})}),a.lastPCM=a.curMouseSampleNrInView,b.setLastPcm(a.lastPCM),b.selectBoundary())):b.movingBoundary=!1}}b.getdragBarActive()||a.setLastMove(g,h)}}),g.bind("mousedown",function(c){b.movingBoundary=!0,a.setLastMove(c,!0)}),g.bind("mouseup",function(c){b.movingBoundary=!1,a.setLastMove(c,!0)}),g.bind("mouseout",function(c){b.movingBoundary=!1,a.setLastMove(c,!0)}),a.setLastClick=function(d){a.curMouseSampleNrInView=b.getX(d)*b.getSamplesPerPixelVal(d),c.deleteEditArea(),b.setEditing(!1),a.lastEventClick=c.getClosestItem(a.curMouseSampleNrInView+b.curViewPort.sS,a.levelName,f.audioBuffer.length),b.setcurClickLevel(a.levelName,a.levelType,a.order),void 0!==a.lastEventClick.current&&void 0!==a.lastEventClick.nearest&&(c.setlasteditArea("_"+a.lastEventClick.current.id),c.setlasteditAreaElem(g.parent()),b.setcurClickItem(a.lastEventClick.current),b.selectBoundary()),a.lastPCM=a.curMouseSampleNrInView,b.setLastPcm(a.lastPCM),a.$apply()},a.setLastRightClick=function(d){if(b.getcurClickLevelName()!==a.levelName&&a.setLastClick(d),a.curMouseSampleNrInView=b.getX(d)*b.getSamplesPerPixelVal(d),c.deleteEditArea(),a.lastEventClick=c.getClosestItem(a.curMouseSampleNrInView+b.curViewPort.sS,a.levelName,f.audioBuffer.length),void 0!==a.lastEventClick.current&&void 0!==a.lastEventClick.nearest){var e=c.getItemInTime(b.getcurClickLevelName(),a.lastEventClick.current.id,!0),g=c.getItemInTime(b.getcurClickLevelName(),a.lastEventClick.current.id,!1);b.setcurClickLevel(a.levelName,a.levelType,a.$index),b.setcurClickItemMultiple(a.lastEventClick.current,e,g),b.selectBoundary()}a.lastPCM=a.curMouseSampleNrInView,b.setLastPcm(a.lastPCM),a.$apply()},a.setLastDblClick=function(d){a.curMouseSampleNrInView=b.getX(d)*b.getSamplesPerPixelVal(d),a.lastEventClick=c.getClosestItem(a.curMouseSampleNrInView+b.curViewPort.sS,a.levelName,f.audioBuffer.length),"25px"!==g.parent().css("height")||g.parent().parent().find("div")[3].click(),void 0!==a.lastEventClick.current&&void 0!==a.lastEventClick.nearest&&b.getPermission("labelAction")&&("SEGMENT"===a.levelType?a.lastEventClick.current.sampleStart>=b.curViewPort.sS&&a.lastEventClick.current.sampleStart+a.lastEventClick.current.sampleDur<=b.curViewPort.eS&&(b.setcurClickLevel(a.levelName,a.levelType,a.$index),b.setcurClickItem(a.lastEventClick.current),c.setlasteditArea("_"+a.lastEventClick.current.id),c.setlasteditAreaElem(g.parent()),b.setEditing(!0),c.openEditArea(a.lastEventClick.current,g.parent(),a.levelType)):(b.setcurClickLevel(a.levelName,a.levelType,a.$index),b.setcurClickItem(a.lastEventClick.current),c.setlasteditArea("_"+a.lastEventClick.current.id),c.setlasteditAreaElem(g.parent()),b.setEditing(!0),c.openEditArea(a.lastEventClick.current,g.parent(),a.levelType),b.setEditing(!0))),a.lastPCM=a.curMouseSampleNrInView,b.setLastPcm(a.lastPCM),a.$apply()},a.setLastMove=function(d,e){a.curMouseSampleNrInView=b.getX(d)*b.getSamplesPerPixelVal(d),a.lastEventMove=c.getClosestItem(a.curMouseSampleNrInView+b.curViewPort.sS,a.levelName,f.audioBuffer.length),e&&void 0!==a.lastEventMove.current&&void 0!==a.lastEventMove.nearest&&(a.lastNeighboursMove=c.getItemNeighboursFromLevel(a.levelName,a.lastEventMove.nearest.id,a.lastEventMove.nearest.id), +"use strict";function EspsParserWorker(a){a=a||window.Worker,this.url=this.getWorkerURL(),this.worker=new a(this.url)}function TextGridParserWorker(a){a=a||window.Worker,this.url=this.getWorkerURL(),this.worker=new a(this.url)}function SpectroDrawingWorker(a){a=a||window.Worker,this.url=this.getWorkerURL(),this.worker=new a(this.url)}function SsffParserWorker(a){a=a||window.Worker,this.url=this.getWorkerURL(),this.worker=new a(this.url)}ArrayBuffer.prototype.subarray=function(a,b){for(var c=new ArrayBuffer(b),d=new Int8Array(c),e=new Int8Array(this),f=0;f0&&!n.vals.main.autoConnect)return"Do you really wish to leave/reload the EMU-webApp? All unsaved changes will be lost..."},a.$on("connectionDisrupted",function(){B.resetToInitState()}),a.$on("resetToInitState",function(){a.loadDefaultConfig()}),a.$on("reloadToInitState",function(b,c){a.loadDefaultConfig(),j.url=c.url,j.somethingInProgressTxt="Connecting to server...",j.somethingInProgress=!0,l.wsH.initConnect(c.url).then(function(b){"error"===b.type?D.open("views/error.html","Could not connect to websocket server: "+c.url).then(function(){B.resetToInitState()}):a.handleConnectedToWSserver(c)},function(a){D.open("views/error.html","Could not connect to websocket server: "+JSON.stringify(a,null,4)).then(function(){B.resetToInitState()})})});var F=i.search();F.audioGetUrl&&F.labelGetUrl&&F.labelType&&(n.embeddedVals.audioGetUrl=F.audioGetUrl,n.embeddedVals.labelGetUrl=F.labelGetUrl,n.embeddedVals.labelType=F.labelType,n.embeddedVals.fromUrlParams=!0),a.loadFilesForEmbeddedApp=function(){var a=i.search();if(a.audioGetUrl||a.bndlJsonGetUrl){if(a.audioGetUrl){n.embeddedVals.audioGetUrl=a.audioGetUrl,n.vals.activeButtons.openDemoDB=!1;var b=l.httpGetPath(n.embeddedVals.audioGetUrl,"arraybuffer")}else var b=l.httpGetPath(a.bndlJsonGetUrl,"application/json");b.then(function(b){j.showDropZone=!1;var c=n.embeddedVals.audioGetUrl;z.setCurBndlName(c.substr(0,c.lastIndexOf(".")).substr(c.lastIndexOf("/")+1,c.length)),j.getsubmenuOpen()&&j.toggleSubmenu(n.design.animation.period),j.somethingInProgressTxt="Loading DB config...";var d;d=a.DBconfigGetUrl?a.DBconfigGetUrl:"configFiles/embedded_emuwebappConfig.json",l.httpGetPath(d).then(function(c){j.curPerspectiveIdx=0,n.setVals(c.data.EMUwebAppConfig);var d=x.validateJSO("emuwebappConfigSchema",n.vals);if(!0===d)if(n.embeddedVals.fromUrlParams&&(n.vals.main.catchMouseForKeyBinding=!1),n.curDbConfig=c.data,!0===(d=x.validateJSO("DBconfigFileSchema",n.curDbConfig))){var e=[{session:"File(s)",name:"from URL parameters"}];z.setBundleList(e),z.setCurBndl(e[0]),j.somethingInProgress=!0,j.somethingInProgressTxt="Parsing WAV file...",a.audioGetUrl?u.parseWavAudioBuf(b.data).then(function(b){var c=b;j.curViewPort.sS=0,j.curViewPort.eS=c.length,j.resetSelect(),m.audioBuffer=c;var d;d=(n.embeddedVals.labelType,"text"),a.labelGetUrl?l.httpGetPath(n.embeddedVals.labelGetUrl,d).then(function(b){j.somethingInProgressTxt="Parsing "+n.embeddedVals.labelType+" file...",l.parseLabelFile(b.data,n.embeddedVals.labelGetUrl,"embeddedTextGrid",n.embeddedVals.labelType).then(function(b){var c=b;if(C.setData(c),!a.DBconfigGetUrl){var d=[],e=[];c.levels.forEach(function(a){d.push(a.name),e.push({name:a.name,type:a.type,attributeDefinitions:{name:a.name,type:"string"}})}),n.curDbConfig.levelDefinitions=e,n.vals.perspectives[j.curPerspectiveIdx].levelCanvases.order=d}j.setCurLevelAttrDefs(n.curDbConfig.levelDefinitions),j.somethingInProgressTxt="Done!",j.somethingInProgress=!1,j.setState("labeling")},function(a){D.open("views/error.html","Error parsing wav file: "+a.status.message)})},function(a){D.open("views/error.html","Could not get label file: "+n.embeddedVals.labelGetUrl+" ERROR "+JSON.stringify(a.message,null,4))}):(n.vals.activeButtons.downloadAnnotation=!1,n.vals.activeButtons.downloadTextGrid=!1,n.vals.activeButtons.search=!1,j.somethingInProgressTxt="Done!",j.somethingInProgress=!1,j.setState("labeling"))},function(a){D.open("views/error.html","Error parsing wav file: "+a.status.message)}):A.loadBundle({name:"fromURLparams"},a.bndlJsonGetUrl)}else D.open("views/error.html","Error validating / checking DBconfig: "+JSON.stringify(d,null,4));else D.open("views/error.html","Error validating ConfigProviderService.vals (emuwebappConfig data) after applying changes of newly loaded config (most likely due to wrong entry...): "+JSON.stringify(d,null,4))},function(a){D.open("views/error.html","Could not get embedded_config.json: "+a)})},function(a){D.open("views/error.html","Could not get audio file:"+n.embeddedVals.audioGetUrl+" ERROR: "+JSON.stringify(a,null,4))})}},a.loadDefaultConfig=function(){j.somethingInProgress=!0,j.somethingInProgressTxt="Loading schema files",x.loadSchemas().then(function(b){x.setSchemas(b),l.httpGetDefaultDesign().then(function(b){n.setDesign(b.data),l.httpGetDefaultConfig().then(function(b){j.somethingInProgressTxt="Validating emuwebappConfig";var c=x.validateJSO("emuwebappConfigSchema",b.data);!0===c?(n.setVals(b.data),angular.copy(a.cps.vals,a.cps.initDbConfig),a.handleDefaultConfigLoaded(),a.loadFilesForEmbeddedApp(),a.checkIfToShowWelcomeModal(),j.somethingInProgress=!1):D.open("views/error.html","Error validating / checking emuwebappConfigSchema: "+JSON.stringify(c,null,4)).then(function(){B.resetToInitState()})},function(a){D.open("views/error.html","Could not get defaultConfig for EMU-webApp: status: "+a.status+" headers: "+a.headers+" config "+a.config).then(function(){B.resetToInitState()})})},function(a){D.open("views/error.html","Could not get defaultConfig for EMU-webApp: status: "+a.status+" headers: "+a.headers+" config "+a.config).then(function(){B.resetToInitState()})})},function(a){D.open("views/error.html","Error loading schema file: "+JSON.stringify(a,null,4)).then(function(){B.resetToInitState()})})},a.loadDefaultConfig(),a.checkIfToShowWelcomeModal=function(){var b=localStorage.getItem("haveShownWelcomeModal"),c=i.search();E.isBrowser.PhantomJS()||null!==b||void 0===c.viewer_pane||(localStorage.setItem("haveShownWelcomeModal","true"),a.internalVars.showAboutHint=!0)},a.getCurBndlName=function(){return z.getCurBndlName()},a.handleDefaultConfigLoaded=function(){j.getsubmenuOpen()||j.toggleSubmenu(n.design.animation.period);var b=i.search();(n.vals.main.autoConnect||"true"===b.autoConnect)&&(void 0!==b.serverUrl&&(n.vals.main.serverUrl=b.serverUrl),l.wsH.initConnect(n.vals.main.serverUrl).then(function(b){"error"===b.type?D.open("views/error.html","Could not connect to websocket server: "+n.vals.main.serverUrl).then(function(){B.resetToInitState()}):a.handleConnectedToWSserver({session:null,reload:null})},function(a){D.open("views/error.html","Could not connect to websocket server: "+JSON.stringify(a,null,4)).then(function(){B.resetToInitState()})})),j.setspectroSettings(n.vals.spectrogramSettings.windowSizeInSecs,n.vals.spectrogramSettings.rangeFrom,n.vals.spectrogramSettings.rangeTo,n.vals.spectrogramSettings.dynamicRange,n.vals.spectrogramSettings.window,n.vals.spectrogramSettings.drawHeatMapColors,n.vals.spectrogramSettings.preEmphasisFilterFactor,n.vals.spectrogramSettings.heatMapColorAnchors),j.setTransitionTime(n.design.animation.period)},a.handleConnectedToWSserver=function(b){var c=b.session,d=b.reload;j.showDropZone=!1,n.vals.main.comMode="WS",n.vals.activeButtons.openDemoDB=!1,j.somethingInProgress=!0,j.somethingInProgressTxt="Checking protocol...",l.getProtocol().then(function(b){"EMU-webApp-websocket-protocol"===b.protocol&&"0.0.2"===b.version?(j.somethingInProgressTxt="Checking user management...",l.getDoUserManagement().then(function(b){"NO"===b?a.innerHandleConnectedToWSserver({session:c,reload:d}):D.open("views/loginModal.html").then(function(b){b?a.innerHandleConnectedToWSserver({session:c,reload:d}):B.resetToInitState()})})):D.open("views/error.html","Could not connect to websocket server: "+n.vals.main.serverUrl+'. It does not speak the same protocol as this client. Its protocol answer was: "'+b.protocol+'" with the version: "'+b.version+'"').then(function(){B.resetToInitState()})})},a.innerHandleConnectedToWSserver=function(a){var b=a.session,c=a.reload;j.somethingInProgressTxt="Loading DB config...",l.httpGetDefaultDesign().then(function(a){n.setDesign(a.data),l.getDBconfigFile().then(function(a){j.curPerspectiveIdx=0,n.setVals(a.EMUwebAppConfig);var d=x.validateJSO("emuwebappConfigSchema",n.vals);!0===d?(n.curDbConfig=a,j.setCurLevelAttrDefs(n.curDbConfig.levelDefinitions),d=x.validateJSO("DBconfigFileSchema",a),!0===d?(j.somethingInProgressTxt="Loading bundle list...",l.getBundleList().then(function(a){d=z.setBundleList(a),n.vals.activeButtons.clear=!0,n.vals.activeButtons.specSettings=!0,!0===d?(null===b&&(b=z.getBundleList()[0]),A.loadBundle(b).then(function(){}),c&&z.openCollapseSession(b.session)):D.open("views/error.html","Error validating bundleList: "+JSON.stringify(d,null,4)).then(function(){B.resetToInitState()})})):D.open("views/error.html","Error validating / checking DBconfig: "+JSON.stringify(d,null,4)).then(function(){B.resetToInitState()})):D.open("views/error.html","Error validating ConfigProviderService.vals (emuwebappConfig data) after applying changes of newly loaded config (most likely due to wrong entry...): "+JSON.stringify(d,null,4)).then(function(){B.resetToInitState()})})})},a.toggleCollapseSession=function(b){a.uniqSessionList[b].collapsed=!a.uniqSessionList[b].collapsed},a.getEnlarge=function(a){var b=n.vals.perspectives[j.curPerspectiveIdx].signalCanvases.order.length;return-1===j.getenlarge()?"auto":1===b?"auto":2===b?j.getenlarge()===a?"70%":"27%":j.getenlarge()===a?"50%":45/(b-1)+"%"},a.cursorInTextField=function(){j.setcursorInTextField(!0)},a.cursorOutOfTextField=function(){j.setcursorInTextField(!1)},a.addLevelSegBtnClick=function(){if(j.getPermission("addLevelSegBtnClick")){var a=0;void 0!==C.data.levels&&(a=C.data.levels.length);var b="levelNr"+a,c={items:[],name:b,type:"SEGMENT"};if(void 0===j.getCurAttrDef(b)){var d={name:b,type:"EVENT",attributeDefinitions:{name:b,type:"string"}};j.setCurLevelAttrDefs(d)}q.insertLevel(c,a,j.curPerspectiveIdx),k.addObjToUndoStack({type:"ANNOT",action:"INSERTLEVEL",level:c,id:a,curPerspectiveIdx:j.curPerspectiveIdx}),j.selectLevel(!1,n.vals.perspectives[j.curPerspectiveIdx].levelCanvases.order,q)}},a.addLevelPointBtnClick=function(){if(j.getPermission("addLevelPointBtnClick")){var a=0;void 0!==C.data.levels&&(a=C.data.levels.length);var b="levelNr"+a,c={items:[],name:b,type:"EVENT"};if(void 0===j.getCurAttrDef(b)){var d={name:b,type:"EVENT",attributeDefinitions:{name:b,type:"string"}};j.setCurLevelAttrDefs(d)}q.insertLevel(c,a,j.curPerspectiveIdx),k.addObjToUndoStack({type:"ANNOT",action:"INSERTLEVEL",level:c,id:a,curPerspectiveIdx:j.curPerspectiveIdx}),j.selectLevel(!1,n.vals.perspectives[j.curPerspectiveIdx].levelCanvases.order,q)}},a.renameSelLevelBtnClick=function(){j.getPermission("renameSelLevelBtnClick")&&(void 0!==j.getcurClickLevelName()?D.open("views/renameLevel.html",j.getcurClickLevelName()):D.open("views/error.html","Rename Error : Please choose a Level first !"))},a.downloadTextGridBtnClick=function(){j.getPermission("downloadTextGridBtnClick")&&r.asyncToTextGrid().then(function(a){a=a.replace(/\t/g," "),D.open("views/export.html",z.getCurBndl().name+".TextGrid",a)})},a.downloadAnnotationBtnClick=function(){j.getPermission("downloadAnnotationBtnClick")&&x.validateJSO("emuwebappConfigSchema",C.getData())&&D.open("views/export.html",z.getCurBndl().name+"_annot.json",angular.toJson(C.getData(),!0))},a.spectSettingsBtnClick=function(){j.getPermission("spectSettingsChange")&&D.open("views/spectSettings.html")},a.connectBtnClick=function(){j.getPermission("connectBtnClick")&&D.open("views/connectModal.html").then(function(b){b&&(j.somethingInProgressTxt="Connecting to server...",j.somethingInProgress=!0,j.url=b,l.wsH.initConnect(b).then(function(c){"error"===c.type?D.open("views/error.html","Could not connect to websocket server: "+b).then(function(){B.resetToInitState()}):a.handleConnectedToWSserver({session:null,reload:null})},function(a){D.open("views/error.html","Could not connect to websocket server: "+JSON.stringify(a,null,4)).then(function(){B.resetToInitState()})}))})},a.openDemoDBbtnClick=function(b){j.getPermission("openDemoBtnDBclick")&&(a.dropdown=!1,n.vals.activeButtons.openDemoDB=!1,z.setDemoDbName(b),j.showDropZone=!1,j.somethingInProgress=!0,j.setState("loadingSaving"),n.vals.main.comMode="DEMO",j.somethingInProgressTxt="Loading DB config...",l.httpGetDefaultDesign().then(function(a){n.setDesign(a.data),l.getDBconfigFile(b).then(function(a){var c=a.data;j.curPerspectiveIdx=0,n.setVals(c.EMUwebAppConfig);var d=x.validateJSO("emuwebappConfigSchema",n.vals);!0===d?(n.curDbConfig=c,j.setCurLevelAttrDefs(n.curDbConfig.levelDefinitions),d=x.validateJSO("DBconfigFileSchema",n.curDbConfig),!0===d?(j.somethingInProgressTxt="Loading bundle list...",l.getBundleList(b).then(function(a){var b=a.data;z.setBundleList(b),n.vals.activeButtons.clear=!0,n.vals.activeButtons.specSettings=!0,A.loadBundle(z.getBundleList()[0])},function(a){D.open("views/error.html","Error loading bundle list of "+b+": "+a.data+" STATUS: "+a.status).then(function(){B.resetToInitState()})})):D.open("views/error.html","Error validating / checking DBconfig: "+JSON.stringify(d,null,4)).then(function(){B.resetToInitState()})):D.open("views/error.html","Error validating ConfigProviderService.vals (emuwebappConfig data) after applying changes of newly loaded config (most likely due to wrong entry...): "+JSON.stringify(d,null,4)).then(function(){B.resetToInitState()})},function(a){D.open("views/error.html","Error loading DB config of "+b+": "+a.data+" STATUS: "+a.status).then(function(){B.resetToInitState()})})}))},a.aboutBtnClick=function(){j.getPermission("aboutBtnClick")&&D.open("views/help.html")},a.showHierarchyBtnClick=function(){j.hierarchyState.isShown()||(j.hierarchyState.toggleHierarchy(),D.open("views/showHierarchyModal.html"))},a.showEditDBconfigBtnClick=function(){D.open("views/tabbed.html").then(function(b){!1===b||(x.validateJSO("emuwebappConfigSchema",b)?a.cps.getDelta(b).then(function(b){l.saveConfiguration(angular.toJson(b,!0)).then(function(){0!==k.movesAwayFromLastSave&&"DEMO"!==n.vals.main.comMode?D.open("views/confirmModal.html","Do you wish to clear all loaded data and if connected disconnect from the server? CAUTION: YOU HAVE UNSAVED CHANGES! These will be lost if you confirm.").then(function(a){a&&B.reloadToInitState()}):B.reloadToInitState(a.lmds.getCurBndl())})}):D.open("views/error.html","Sorry, there were errors in your configuration."))})},a.searchBtnClick=function(){j.getPermission("searchBtnClick")&&D.open("views/searchAnnot.html")},a.clearBtnClick=function(){var a;a=0!==k.movesAwayFromLastSave&&"DEMO"!==n.vals.main.comMode?"Do you wish to clear all loaded data and if connected disconnect from the server? CAUTION: YOU HAVE UNSAVED CHANGES! These will be lost if you confirm.":"Do you wish to clear all loaded data and if connected disconnect from the server? You have NO unsaved changes so no changes will be lost.",D.open("views/confirmModal.html",a).then(function(a){a&&B.resetToInitState()})},a.cmdZoomAll=function(){j.getPermission("zoom")&&(q.deleteEditArea(),j.setViewPort(0,m.audioBuffer.length))},a.cmdZoomIn=function(){j.getPermission("zoom")&&(q.deleteEditArea(),j.zoomViewPort(!0))},a.cmdZoomOut=function(){j.getPermission("zoom")&&(q.deleteEditArea(),j.zoomViewPort(!1))},a.cmdZoomLeft=function(){j.getPermission("zoom")&&(q.deleteEditArea(),j.shiftViewPort(!1))},a.cmdZoomRight=function(){j.getPermission("zoom")&&(q.deleteEditArea(),j.shiftViewPort(!0))},a.cmdZoomSel=function(){j.getPermission("zoom")&&(q.deleteEditArea(),j.setViewPort(j.curViewPort.selectS,j.curViewPort.selectE))},a.cmdPlayView=function(){j.getPermission("playaudio")&&(m.playFromTo(j.curViewPort.sS,j.curViewPort.eS),j.animatePlayHead(j.curViewPort.sS,j.curViewPort.eS))},a.cmdPlaySel=function(){j.getPermission("playaudio")&&(m.playFromTo(j.curViewPort.selectS,j.curViewPort.selectE),j.animatePlayHead(j.curViewPort.selectS,j.curViewPort.selectE))},a.cmdPlayAll=function(){j.getPermission("playaudio")&&(m.playFromTo(0,m.audioBuffer.length),j.animatePlayHead(0,m.audioBuffer.length))},a.changePerspective=function(a){for(var b,c=0;c=a.vs.curViewPort.sS&&k.sampleStart<=a.vs.curViewPort.eS||k.sampleStart+k.sampleDur>a.vs.curViewPort.sS&&k.sampleStart+k.sampleDura.vs.curViewPort.eS){var m;if(k.labels.forEach(function(a){a.name===h&&(m=a.value)}),l=a.vs.getPos(j.canvas.width,k.sampleStart),o=a.vs.getPos(j.canvas.width,k.sampleStart+k.sampleDur+1),j.fillStyle=d.design.color.black,j.fillRect(l,0,2,j.canvas.height/2),j.fillStyle=d.design.color.grey,j.fillRect(o,j.canvas.height/2,2,j.canvas.height),j.font=f-2+"px "+b,void 0!==m&&o-l>r*m.length&&(i?g.drawUndistortedText(j,m,e-2,b,l+(o-l)/2,j.canvas.height/2-(f-2)+2,d.design.color.black,!1):g.drawUndistortedText(j,m,e-2,b,l+(o-l)/2,j.canvas.height/2-f+2,d.design.color.black,!1)),a.open&&void 0!==m&&0!==m.length){var n=l+(o-l)/2,p=j.canvas.height/4;j.strokeStyle=d.design.color.black,j.beginPath(),j.moveTo(l,p),j.lineTo(n,p),j.lineTo(n,p+5),j.stroke(),p=j.canvas.height/4*3,j.strokeStyle=d.design.color.grey,j.beginPath(),j.moveTo(o,p),j.lineTo(n,p),j.lineTo(n,p-5),j.stroke()}if(a.open){o-l>s*k.sampleStart.toString().length&&i&&g.drawUndistortedText(j,k.sampleStart,f-2,c,l+3,0,d.design.color.grey,!0);var t="dur: "+k.sampleDur+" ";o-l>s*t.length&&i&&g.drawUndistortedText(j,t,f-2,c,o-j.measureText(t).width*g.scaleX,j.canvas.height/4*3,d.design.color.grey,!0)}}});else if("EVENT"===a.level.type){j.fillStyle=d.design.color.black;var t;a.level.items.forEach(function(c){if(c.samplePoint>a.vs.curViewPort.sS&&c.samplePoint0&&o.forEach(function(c){void 0!==c&&(void 0!==c.sampleStart?(f=Math.round(a.vs.getPos(b.canvas.width,c.sampleStart)),g=Math.round(a.vs.getPos(b.canvas.width,c.sampleStart+c.sampleDur+1))):(f=Math.round(a.vs.getPos(b.canvas.width,c.samplePoint)+h/2),f-=5,g=f+10),b.fillStyle=d.design.color.transparent.yellow,b.fillRect(f,0,g-f,b.canvas.height),b.fillStyle=d.design.color.black)}),j=a.vs.getcurMouseItem(),a.level.items.length>0&&void 0!==j&&void 0!==k&&a.level.name===a.vs.getcurMouseLevelName()&&(b.fillStyle=d.design.color.blue,!0===l?"SEGMENT"===a.vs.getcurMouseLevelType()&&(j=a.level.items[0],f=Math.round(a.vs.getPos(b.canvas.width,j.sampleStart)),b.fillRect(f,0,3,b.canvas.height)):!0===m?"SEGMENT"===a.vs.getcurMouseLevelType()&&(j=a.level.items[a.level.items.length-1],f=Math.round(a.vs.getPos(b.canvas.width,j.sampleStart+j.sampleDur+1)),b.fillRect(f,0,3,b.canvas.height)):"SEGMENT"===a.vs.getcurMouseLevelType()?(f=Math.round(a.vs.getPos(b.canvas.width,j.sampleStart)),b.fillRect(f,0,3,b.canvas.height)):(f=Math.round(a.vs.getPos(b.canvas.width,j.samplePoint)),i=h/2,b.fillRect(f+i,0,3,b.canvas.height)),b.fillStyle=d.design.color.black),e.drawCrossHairX(b,c.curMouseX)},a.drawHierarchyDetails=function(){var b=1*d.design.font.small.size.slice(0,-2),c=a.hls.findPaths(a.level.name),e=c[1],f=n[0].getContext("2d");f.clearRect(0,0,f.canvas.width,f.canvas.height),f.strokeStyle=d.design.color.black,a.hls.findParents(e);for(var h=0;h0){i.primeWorker=new SpectroDrawingWorker;var b=[],c=g.calcClosestPowerOf2Gt(i.shs.audioBuffer.sampleRate*i.vs.spectroSettings.windowSizeInSecs);c<512&&(c=512),b=a.subarray(i.vs.curViewPort.sS,i.vs.curViewPort.eS);var d=[],e=[],f=i.shs.audioBuffer.sampleRate*i.vs.spectroSettings.windowSizeInSecs;i.vs.curViewPort.sS=i.shs.audioBuffer.length||(e=a.subarray(i.vs.curViewPort.eS,i.vs.curViewPort.eS+c/2-1));var h=new Float32Array(d.length+b.length+e.length);h.set(d),h.set(b,d.length),h.set(e,d.length+b.length),b=i.vs.curViewPort.sS>=c/2?a.subarray(i.vs.curViewPort.sS-c/2,i.vs.curViewPort.eS+c):a.subarray(i.vs.curViewPort.sS,i.vs.curViewPort.eS+c),i.setupEvent(),i.primeWorker.tell({windowSizeInSecs:i.vs.spectroSettings.windowSizeInSecs,fftN:c,alpha:i.alpha,upperFreq:i.vs.spectroSettings.rangeTo,lowerFreq:i.vs.spectroSettings.rangeFrom,samplesPerPxl:i.calcSamplesPerPxl(),window:i.vs.spectroSettings.window,imgWidth:i.canvas0.width,imgHeight:i.canvas0.height,dynRangeInDB:i.vs.spectroSettings.dynamicRange,pixelRatio:i.devicePixelRatio,sampleRate:i.shs.audioBuffer.sampleRate,transparency:i.cps.vals.spectrogramSettings.transparency,audioBuffer:h,audioBufferChannels:i.shs.audioBuffer.numberOfChannels,drawHeatMapColors:i.vs.spectroSettings.drawHeatMapColors,preEmphasisFilterFactor:i.vs.spectroSettings.preEmphasisFilterFactor,heatMapColorAnchors:i.vs.spectroSettings.heatMapColorAnchors},[h.buffer])}}}}}]),angular.module("emuwebApp").controller("ExportCtrl",["$scope","modalService","browserDetector","viewState","HistoryService",function(a,b,c,d,e){a.firefox=c.isBrowser.Firefox(),a.getBlob=function(){var c;try{c=new Blob([b.dataExport],{type:"text/plain"})}catch(b){window.BlobBuilder=window.BlobBuilder||window.WebKitBlobBuilder||window.MozBlobBuilder,c=new BlobBuilder,c.append(a.exportData),c=c.getBlob()}return c},a.updateHistoryService=function(){e.movesAwayFromLastSave=0},a.cursorInTextField=function(){d.setEditing(!0),d.setcursorInTextField(!0)},a.cursorOutOfTextField=function(){d.setEditing(!1),d.setcursorInTextField(!1)},a.export=function(){var c;c="object"!=typeof URL&&"undefined"!=typeof webkitURL?webkitURL.createObjectURL(a.getBlob()):URL.createObjectURL(a.getBlob()),a.SaveToDisk(c,b.dataIn),b.close()},a.SaveToDisk=function(b,c){var d=document.createElement("a");d.setAttribute("download",c),d.href=b,d.innerHTML="",d.style.display="none",document.body.appendChild(d),d.click(),a.updateHistoryService()}}]),angular.module("emuwebApp").factory("viewState",["$rootScope","$timeout","$window","Soundhandlerservice","DataService","StandardFuncsService",function(a,b,c,d,e,f){var g={},h={BARTLETT:1,BARTLETTHANN:2,BLACKMAN:3,COSINE:4,GAUSS:5,HAMMING:6,HANN:7,LANCZOS:8,RECTANGULAR:9,TRIANGULAR:10},i={DEMO:1,WS:2,EMBEDDED:3},j={absolute:1,relative:2},k={OSCI:1,SPEC:2},l={DOTS:1,EPG:2};return g.curLevelAttrDefs=[],g.initialize=function(){g.curViewPort={sS:0,eS:0,selectS:-1,selectE:-1,movingS:-1,movingE:-1,dragBarActive:!1,dragBarHeight:-1,windowWidth:void 0},g.spectroSettings={windowSizeInSecs:-1,rangeFrom:-1,rangeTo:-1,dynamicRange:-1,window:-1,drawHeatMapColors:-1,preEmphasisFilterFactor:-1},g.osciSettings={curChannel:0},g.playHeadAnimationInfos={sS:-1,eS:-1,curS:null,endFreezeSample:-1,autoscroll:!1},g.hierarchyState={hierarchyShown:!1,selectedItemID:void 0,selectedLinkFromID:void 0,selectedLinkToID:void 0,editValue:void 0,inputFocus:!1,collapseInfo:{},scaleFactor:1,translate:[0,0],contextMenuID:void 0,newLinkFromID:void 0,path:[],curPathIdx:0,curNrOfPaths:0,rotated:!1,playing:0,resize:0,closeContextMenu:function(){g.hierarchyState.contextMenuID=void 0},getContextMenuID:function(){return g.hierarchyState.contextMenuID},getInputFocus:function(){return g.hierarchyState.inputFocus},getEditValue:function(){return g.hierarchyState.editValue},setEditValue:function(a){g.hierarchyState.editValue=a},reset:function(){g.hierarchyState.selectedItemID=void 0,g.hierarchyState.selectedLinkFromID=void 0,g.hierarchyState.selectedLinkToID=void 0,g.hierarchyState.editValue=void 0,g.hierarchyState.inputFocus=!1,g.hierarchyState.collapseInfo={},g.hierarchyState.scaleFactor=1,g.hierarchyState.translate=[0,0],g.hierarchyState.contextMenuID=void 0,g.hierarchyState.newLinkFromID=void 0},isRotated:function(){return g.hierarchyState.rotated},toggleRotation:function(){g.hierarchyState.rotated=!g.hierarchyState.rotated},toggleHierarchy:function(){g.hierarchyState.hierarchyShown=!g.hierarchyState.hierarchyShown,!1===g.hierarchyState.hierarchyShown&&f.traverseAndClean(e.getData())},isShown:function(){return g.hierarchyState.hierarchyShown},getCollapsed:function(a){return void 0!==g.hierarchyState.collapseInfo[a]&&("boolean"==typeof g.hierarchyState.collapseInfo[a].collapsed&&g.hierarchyState.collapseInfo[a].collapsed)},getCollapsePosition:function(a){return void 0===g.hierarchyState.collapseInfo[a]?void 0:"object"==typeof g.hierarchyState.collapseInfo[a].collapsePosition?g.hierarchyState.collapseInfo[a].collapsePosition:void 0},getNumCollapsedParents:function(a){return void 0===g.hierarchyState.collapseInfo[a]?0:"number"==typeof g.hierarchyState.collapseInfo[a].numCollapsedParents?g.hierarchyState.collapseInfo[a].numCollapsedParents:0},setCollapsed:function(a,b){void 0===g.hierarchyState.collapseInfo[a]&&(g.hierarchyState.collapseInfo[a]={}),g.hierarchyState.collapseInfo[a].collapsed=b},setCollapsePosition:function(a,b){void 0===g.hierarchyState.collapseInfo[a]&&(g.hierarchyState.collapseInfo[a]={}),g.hierarchyState.collapseInfo[a].collapsePosition=b},setNumCollapsedParents:function(a,b){void 0===g.hierarchyState.collapseInfo[a]&&(g.hierarchyState.collapseInfo[a]={}),g.hierarchyState.collapseInfo[a].numCollapsedParents=b}},g.timelineSize=-1,g.somethingInProgress=!1,g.somethingInProgressTxt="",g.historyActionTxt="",g.editing=!1,g.cursorInTextField=!1,g.saving=!0,g.submenuOpen=!1,g.rightSubmenuOpen=!1,g.curClickItems=[],g.curMousePosSample=0,g.curMouseX=0,g.curMouseTrackName=void 0,g.curMouseLevelName=void 0,g.curMouseLevelType=void 0,g.curClickLevelName=void 0,g.curClickLevelType=void 0,g.lastPcm=void 0,g.curPreselColumnSample=2,g.curCorrectionToolNr=void 0,g.curClickLevelIndex=void 0,g.start=null,g.TransitionTime=void 0,g.showDropZone=!0,g.movingBoundary=!1,g.movingBoundarySample=void 0,g.focusInTextField=!1,g.curTaskPercCompl=0,g.curPerspectiveIdx=-1,g.mouseInEmuWebApp=!1,g.focusOnEmuWebApp=!0,g.lastKeyCode=void 0,g.lastUpdate=void 0,g.url=void 0,g.pageSize=500,g.currentPage=void 0,g.curTimeAnchorIdx=-1,g.largeTextFieldInputFieldVisable=!1,g.largeTextFieldInputFieldCurLabel="",g.states=[],g.states.noDBorFilesloaded={permittedActions:["connectBtnClick","openDemoBtnDBclick","aboutBtnClick"]},g.states.loadingSaving={permittedActions:[]},g.states.labeling={permittedActions:["zoom","playaudio","spectSettingsChange","addLevelSegBtnClick","addLevelPointBtnClick","renameSelLevelBtnClick","downloadTextGridBtnClick","downloadAnnotationBtnClick","spectSettingsChange","clearBtnClick","labelAction","toggleSideBars","saveBndlBtnClick","showHierarchyBtnClick","editDBconfigBtnClick","aboutBtnClick","searchBtnClick"]},g.states.modalShowing=g.states.loadingSaving,g.prevState=g.states.noDBorFilesloaded,g.curState=g.states.noDBorFilesloaded,g.curLevelAttrDefs=[]},g.initialize(),g.getPermission=function(a){return g.curState.permittedActions.indexOf(a)>-1},g.setWindowWidth=function(a){this.curViewPort.windowWidth=a},g.setState=function(a){g.prevState=g.curState,g.curState="string"==typeof a?g.states[a]:a},g.updatePlayHead=function(b){d.isPlaying&&c.requestAnimationFrame(g.updatePlayHead),null===g.start&&(g.start=b);var e=Math.floor(b-g.start)/1e3*d.audioBuffer.sampleRate;g.playHeadAnimationInfos.curS=Math.floor(g.playHeadAnimationInfos.sS+e),d.isPlaying&&g.playHeadAnimationInfos.curS<=g.playHeadAnimationInfos.eS?(-1!==g.playHeadAnimationInfos.curS&&(g.curMousePosSample=g.playHeadAnimationInfos.curS),g.playHeadAnimationInfos.autoscroll&&g.playHeadAnimationInfos.curS>=g.curViewPort.eS&&g.setViewPort(g.curViewPort.eS,g.curViewPort.eS+(g.curViewPort.eS-g.curViewPort.sS))):(g.curMousePosSample=g.playHeadAnimationInfos.endFreezeSample,g.playHeadAnimationInfos.sS=-1,g.playHeadAnimationInfos.eS=-1,g.playHeadAnimationInfos.curS=0,g.start=null),a.$apply()},g.animatePlayHead=function(a,b,d){g.playHeadAnimationInfos.sS=a,g.playHeadAnimationInfos.eS=b,g.playHeadAnimationInfos.endFreezeSample=b,g.playHeadAnimationInfos.curS=a,void 0!==d&&(g.playHeadAnimationInfos.autoscroll=d),c.requestAnimationFrame(g.updatePlayHead)},g.select=function(a,b){g.curViewPort.selectS=a,g.curViewPort.selectE=b},g.resetSelect=function(){g.curViewPort.selectS=-1,g.curViewPort.selectE=-1},g.getViewPort=function(){return g.curViewPort},g.setspectroSettings=function(a,b,c,d,e,f,h,i){g.spectroSettings.windowSizeInSecs=a,g.spectroSettings.rangeFrom=parseInt(b,10),g.spectroSettings.rangeTo=parseInt(c,10),g.spectroSettings.dynamicRange=parseInt(d,10),g.setWindowFunction(e),g.spectroSettings.drawHeatMapColors=f,g.spectroSettings.preEmphasisFilterFactor=h,g.spectroSettings.heatMapColorAnchors=i},g.setOsciSettings=function(a){g.osciSettings.curChannel=a},g.getSelect=function(){return[g.curViewPort.selectS,g.curViewPort.selectE]},g.selectDependent=function(a,b){athis.curViewPort.selectE&&(this.curViewPort.selectE=b)},g.selectLevel=function(a,b,c){var d,e=g.getcurClickLevelName();if(void 0===e)return a?(d=c.getLevelDetails(b[b.length-1]),void g.setcurClickLevel(d.name,d.type,b.length-1)):void(null!==(d=c.getLevelDetails(b[0]))&&g.setcurClickLevel(d.name,d.type,0));var f=-1;b.forEach(function(a,b){a===e&&(f=b)}),void 0===f?(d=c.getLevelDetails(b[0]),g.setcurClickLevel(d.name,d.type,0),g.curClickItems=[],g.selectBoundary()):a?f+1=0&&(d=c.getLevelDetails(b[f-1]),g.setcurClickLevel(d.name,d.type,b.idxOfNow-1),g.curClickItems=[],g.selectBoundary())},g.setWindowFunction=function(a){switch(a){case"BARTLETT":g.spectroSettings.window=h.BARTLETT;break;case"BARTLETTHANN":g.spectroSettings.window=h.BARTLETTHANN;break;case"BLACKMAN":g.spectroSettings.window=h.BLACKMAN;break;case"COSINE":g.spectroSettings.window=h.COSINE;break;case"GAUSS":g.spectroSettings.window=h.GAUSS;break;case"HAMMING":g.spectroSettings.window=h.HAMMING;break;case"HANN":g.spectroSettings.window=h.HANN;break;case"LANCZOS":g.spectroSettings.window=h.LANCZOS;break;case"RECTANGULAR":g.spectroSettings.window=h.RECTANGULAR;break;case"TRIANGULAR":g.spectroSettings.window=h.TRIANGULAR;break;default:g.spectroSettings.window=h.BARTLETTHANN}},g.getWindowFunctions=function(){return h},g.getCommunicationModes=function(){return i},g.getTimeModes=function(){return j},g.getSignalTypes=function(){return k},g.getTwoDimTypes=function(){return l},g.getdragBarActive=function(){return this.curViewPort.dragBarActive},g.setdragBarActive=function(a){this.curViewPort.dragBarActive=a},g.getdragBarHeight=function(){return this.curViewPort.dragBarHeight},g.setdragBarHeight=function(a){this.curViewPort.dragBarHeight=a},g.getPos=function(a,b){return a*(b-this.curViewPort.sS)/(this.curViewPort.eS-this.curViewPort.sS+1)},g.getSampleDist=function(a){return this.getPos(a,this.curViewPort.sS+1)-this.getPos(a,this.curViewPort.sS)},g.toggleSubmenu=function(a){this.submenuOpen=!this.submenuOpen,b(function(){var a=new Date;g.lastUpdate=a.getTime()},a)},g.getsubmenuOpen=function(){return this.submenuOpen},g.setsubmenuOpen=function(a){this.submenuOpen=a},g.setenlarge=function(a){this.timelineSize=a},g.getenlarge=function(){return this.timelineSize},g.getTransitionTime=function(){return this.TransitionTime},g.setTransitionTime=function(a){this.TransitionTime=a},g.getRightsubmenuOpen=function(){return this.rightSubmenuOpen},g.setRightsubmenuOpen=function(a){this.rightSubmenuOpen=a},g.setcurClickLevel=function(a,b,c){g.setcurClickLevelName(a,c),g.setcurClickLevelType(b)},g.setcurClickLevelType=function(a){this.curClickLevelType=a},g.getcurClickLevelType=function(){return this.curClickLevelType},g.setcurClickLevelName=function(a,b){this.curClickLevelName=a,this.curClickLevelIndex=b},g.getcurClickLevelName=function(){return this.curClickLevelName},g.getcurClickLevelIndex=function(){return this.curClickLevelIndex},g.getcurClickNeighbours=function(){return this.curClickNeighbours},g.setcurMouseLevelName=function(a){this.curMouseLevelName=a},g.getcurMouseLevelName=function(){return this.curMouseLevelName},g.setcurMouseLevelType=function(a){this.curMouseLevelType=a},g.getcurMouseLevelType=function(){return this.curMouseLevelType},g.setcurMouseItem=function(a,b,c,d,e){this.curMouseItem=a,this.curMouseX=c,this.curMouseNeighbours=b,this.curMouseisFirst=d,this.curMouseisLast=e},g.getcurMouseItem=function(){return this.curMouseItem},g.getcurMouseisFirst=function(){return this.curMouseisFirst},g.getcurMouseisLast=function(){return this.curMouseisLast},g.getcurMouseNeighbours=function(){return this.curMouseNeighbours},g.getItemsInSelection=function(a){var b=[],c=g.curViewPort.selectS,d=g.curViewPort.selectE;return angular.forEach(a,function(a){a.name===g.getcurClickLevelName()&&angular.forEach(a.items,function(a){a.sampleStart>=c&&a.sampleStart+a.sampleDur<=d&&b.push(a),a.samplePoint>=c&&a.samplePoint<=d&&b.push(a)})}),b.sort(g.sortbystart)},g.setcurClickItem=function(a){null!==a&&void 0!==a?(g.curClickItems=[],g.curClickItems.push(a),g.selectBoundary()):g.curClickItems=[]},g.selectBoundary=function(){if(g.curClickItems.length>0){var a,b;a=void 0===g.curClickItems[0].samplePoint?g.curClickItems[0].sampleStart:g.curClickItems[0].samplePoint,b=void 0===g.curClickItems[0].samplePoint?g.curClickItems[g.curClickItems.length-1].sampleStart+g.curClickItems[g.curClickItems.length-1].sampleDur:g.curClickItems[0].samplePoint,g.curClickItems.forEach(function(c){c.sampleStart<=a&&(a=c.sampleStart),c.sampleStart+c.sampleDur>=b&&(b=c.sampleStart+c.sampleDur)}),g.select(a,b+1)}},g.setcurClickItemMultiple=function(a,b){0===g.curClickItems.length||void 0===g.curClickItems||null===g.curClickItems?(g.curClickItems=[],g.curClickItems.push(a)):-1===g.curClickItems.indexOf(a)?(g.curClickItems.indexOf(b)<0&&(g.curClickItems=[]),g.curClickItems.push(a),g.curClickItems.sort(g.sortbystart)):(g.curClickItems=[],g.curClickItems.push(a))},g.sortbystart=function(a,b){return a.sampleStart>b.sampleStart||a.samplePoint>b.samplePoint?1:a.sampleStart1?{start:this.curClickItems[0].sampleStart,end:this.curClickItems[this.curClickItems.length-1].sampleStart+this.curClickItems[this.curClickItems.length-1].sampleDur}:1===this.curClickItems.length?void 0!==this.curClickItems[0].sampleStart?{start:this.curClickItems[0].sampleStart,end:this.curClickItems[0].sampleStart+this.curClickItems[0].sampleDur}:{start:this.curClickItems[0].samplePoint,end:this.curClickItems[0].samplePoint}:{start:-1,end:-1}},g.getcurClickItems=function(){return this.curClickItems},g.getselected=function(){return this.curClickItems},g.isEditing=function(){return this.editing},g.setEditing=function(a){this.editing=a},g.getLasPcm=function(){return this.lastPcm},g.setLastPcm=function(a){this.lastPcm=a},g.getcursorInTextField=function(){return this.cursorInTextField},g.setcursorInTextField=function(a){this.cursorInTextField=a},g.isSavingAllowed=function(){return this.saving},g.setSavingAllowed=function(a){this.saving=a},g.countSelected=function(){return this.curClickItems.length},g.getCurrentSample=function(a){return this.curViewPort.sS+(this.curViewPort.eS-this.curViewPort.sS)*a},g.getCurrentPercent=function(a){return a*(100/(this.curViewPort.eS-this.curViewPort.sS)/100)},g.getSamplesPerPixelVal=function(a){var b=parseFloat(this.curViewPort.sS);return(parseFloat(this.curViewPort.eS)-b)/a.originalEvent.target.width},g.getViewPortStartTime=function(){return this.curViewPort.sS/d.audioBuffer.sampleRate-.5/d.audioBuffer.sampleRate},g.getViewPortEndTime=function(){return this.curViewPort.eS/d.audioBuffer.sampleRate+.5/d.audioBuffer.sampleRate},g.getSelectedStartTime=function(){return this.curViewPort.selectS/d.audioBuffer.sampleRate-.5/d.audioBuffer.sampleRate},g.getSelectedEndTime=function(){return this.curViewPort.selectE/d.audioBuffer.sampleRate+.5/d.audioBuffer.sampleRate},g.calcSampleTime=function(a){return a/d.audioBuffer.sampleRate+.5/d.audioBuffer.sampleRate},g.setViewPort=function(a,b){var c=this.curViewPort.sS,e=this.curViewPort.eS;void 0!==a&&(this.curViewPort.sS=Math.round(a)),void 0!==b&&(this.curViewPort.eS=Math.round(b)),c>this.curViewPort.sS&&e>this.curViewPort.eS&&this.curViewPort.sS<0&&(this.curViewPort.sS=0,this.curViewPort.eS=e+Math.abs(this.curViewPort.sS)),cd.audioBuffer.length&&(this.curViewPort.sS=c,this.curViewPort.eS=d.audioBuffer.length),this.curViewPort.sS<0&&(this.curViewPort.sS=0),this.curViewPort.eS>d.audioBuffer.length&&(this.curViewPort.eS=d.audioBuffer.length),this.curViewPort.eS-this.curViewPort.sS<4&&(this.curViewPort.sS=c,this.curViewPort.eS=e)},g.zoomViewPort=function(a,b){var c,d,e,f=this.getcurMouseItem(),h=this.curViewPort.eS-this.curViewPort.sS,i=!1;if(void 0!==f){this.getcurMouseisFirst()?f=b.getItemDetails(g.getcurMouseLevelName(),0):this.getcurMouseisLast()&&(f=b.getLastItem(g.getcurMouseLevelName()),i=!0),e="SEGMENT"===this.getcurMouseLevelType()?i?f.sampleStart+f.sampleDur:f.sampleStart:f.samplePoint;var j=e-this.curViewPort.sS,k=this.curViewPort.eS-e;a?(c=this.curViewPort.sS+.5*j,d=this.curViewPort.eS-.5*k):(c=this.curViewPort.sS-.5*j,d=this.curViewPort.eS+.5*k)}else a?(c=this.curViewPort.sS+~~(h/4),d=this.curViewPort.eS-~~(h/4)):(c=this.curViewPort.sS-~~(h/4),d=this.curViewPort.eS+~~(h/4));this.setViewPort(c,d)},g.shiftViewPort=function(a){var b,c;a?(b=this.curViewPort.sS+~~((this.curViewPort.eS-this.curViewPort.sS)/4),c=this.curViewPort.eS+~~((this.curViewPort.eS-this.curViewPort.sS)/4)):(b=this.curViewPort.sS-~~((this.curViewPort.eS-this.curViewPort.sS)/4),c=this.curViewPort.eS-~~((this.curViewPort.eS-this.curViewPort.sS)/4)),this.setViewPort(b,c)},g.setCurLevelAttrDefs=function(a){angular.forEach(a,function(a){g.curLevelAttrDefs.push({levelName:a.name,curAttrDefName:a.name})})},g.setCurAttrDef=function(a,b,c){angular.forEach(g.curLevelAttrDefs,function(d){d.levelName===a&&(d.curAttrDefName=b,d.curAttrDefIndex=c)})},g.getCurAttrDef=function(a){var b;return angular.forEach(g.curLevelAttrDefs,function(c){c.levelName===a&&(b=c.curAttrDefName)}),b},g.getCurAttrIndex=function(a){var b;return angular.forEach(g.curLevelAttrDefs,function(c){c.levelName===a&&(b=void 0===c.curAttrDefIndex?0:c.curAttrDefIndex)}),b},g.setlastKeyCode=function(a){this.lastKeyCode=a},g.getX=function(a){return(a.offsetX||a.originalEvent.layerX)*(a.originalEvent.target.width/a.originalEvent.target.clientWidth)},g.getY=function(a){return(a.offsetY||a.originalEvent.layerY)*(a.originalEvent.target.height/a.originalEvent.target.clientHeight)},g.resetToInitState=function(){g.initialize()},g.getColorOfAnchor=function(a,b){return{"background-color":"rgb("+a[b][0]+","+a[b][1]+","+a[b][2]+")",width:"10px",height:"10px"}},g.numberOfPages=function(a){return Math.ceil(a/g.pageSize)},g.switchPerspective=function(a,b){b.length>a&&(g.curPerspectiveIdx=a)},g}]),angular.module("emuwebApp").directive("trackMouseInLevel",["$document","viewState","LevelService","ConfigProviderService","HistoryService","Soundhandlerservice",function(a,b,c,d,e,f){return{restrict:"A",replace:!0,scope:{levelName:"=",levelType:"="},link:function(a,g,h){a.lastEventClick=void 0,a.lastEventMove=void 0,a.lastNeighboursMove=void 0,a.lastPCM=void 0,a.curMouseSampleNrInView=void 0,a.order=h.trackMouseInLevel,g.bind("click",function(b){b.preventDefault(),a.setLastMove(b,!0),a.setLastClick(b)}),g.bind("contextmenu",function(b){b.preventDefault(),a.setLastMove(b,!0),a.setLastRightClick(b)}),g.bind("dblclick",function(b){a.setLastMove(b,!0),d.vals.restrictions.editItemName?a.setLastDblClick(b):a.setLastClick(b)}),g.bind("mousemove",function(g){var h,i;if(b.focusOnEmuWebApp){if(!b.getdragBarActive()){h=!0;var j=b.getSamplesPerPixelVal(g);if(a.curMouseSampleNrInView=b.getX(g)*j,i=a.curMouseSampleNrInView-a.lastPCM,j<=1){var k=c.getClosestItem(a.curMouseSampleNrInView+b.curViewPort.sS,a.levelName,f.audioBuffer.length);if("SEGMENT"===a.levelType)if(!0===k.isFirst&&!1===k.isLast)i=Math.ceil(a.curMouseSampleNrInView+b.curViewPort.sS-c.getItemDetails(a.levelName,0).sampleStart);else if(!1===k.isFirst&&!0===k.isLast){var l=c.getLastItem(a.levelName);i=Math.ceil(a.curMouseSampleNrInView+b.curViewPort.sS-l.sampleStart-l.sampleDur)}else i=Math.ceil(a.curMouseSampleNrInView+b.curViewPort.sS-c.getItemFromLevelById(a.levelName,k.nearest.id).sampleStart);else i=Math.ceil(a.curMouseSampleNrInView+b.curViewPort.sS-c.getItemFromLevelById(a.levelName,k.nearest.id).samplePoint-.5)}else i=Math.round(a.curMouseSampleNrInView-a.lastPCM)}switch(void 0===g.buttons?g.which:g.buttons){case 1:case 2:case 3:break;default:if(!b.getdragBarActive()){var m,n=b.getcurMouseItem();d.vals.restrictions.editItemSize&&g.shiftKey?(c.deleteEditArea(),void 0!==n&&(b.movingBoundary=!0,"SEGMENT"===a.levelType?(b.getcurMouseisFirst()||b.getcurMouseisLast()?b.getcurMouseisFirst()?(m=c.getItemDetails(a.levelName,0),b.movingBoundarySample=m.sampleStart+i):b.getcurMouseisLast()&&(m=c.getLastItem(a.levelName),b.movingBoundarySample=m.sampleStart+m.sampleDur+i):(b.movingBoundarySample=n.sampleStart+i,m=n),c.moveBoundary(a.levelName,m.id,i,b.getcurMouseisFirst(),b.getcurMouseisLast()),e.updateCurChangeObj({type:"ANNOT",action:"MOVEBOUNDARY",name:a.levelName,id:m.id,movedBy:i,isFirst:b.getcurMouseisFirst(),isLast:b.getcurMouseisLast()})):(m=n,b.movingBoundarySample=n.samplePoint+i,c.moveEvent(a.levelName,m.id,i),e.updateCurChangeObj({type:"ANNOT",action:"MOVEEVENT",name:a.levelName,id:m.id,movedBy:i})),a.lastPCM=a.curMouseSampleNrInView,b.setLastPcm(a.lastPCM),b.selectBoundary(),h=!1)):d.vals.restrictions.editItemSize&&g.altKey?(c.deleteEditArea(),"SEGMENT"===a.levelType?(m=b.getcurClickItems(),void 0!==m[0]&&(c.moveSegment(a.levelName,m[0].id,m.length,i),e.updateCurChangeObj({type:"ANNOT",action:"MOVESEGMENT",name:a.levelName,id:m[0].id,length:m.length,movedBy:i})),a.lastPCM=a.curMouseSampleNrInView,b.setLastPcm(a.lastPCM),b.selectBoundary()):"EVENT"===a.levelType&&(m=b.getcurClickItems(),void 0!==m[0]&&angular.forEach(m,function(b){c.moveEvent(a.levelName,b.id,i),e.updateCurChangeObj({type:"ANNOT",action:"MOVEEVENT",name:a.levelName,id:b.id,movedBy:i})}),a.lastPCM=a.curMouseSampleNrInView,b.setLastPcm(a.lastPCM),b.selectBoundary())):b.movingBoundary=!1}}b.getdragBarActive()||a.setLastMove(g,h)}}),g.bind("mousedown",function(c){b.movingBoundary=!0,a.setLastMove(c,!0)}),g.bind("mouseup",function(c){b.movingBoundary=!1,a.setLastMove(c,!0)}),g.bind("mouseout",function(c){b.movingBoundary=!1,a.setLastMove(c,!0)}),a.setLastClick=function(d){a.curMouseSampleNrInView=b.getX(d)*b.getSamplesPerPixelVal(d),c.deleteEditArea(),b.setEditing(!1),a.lastEventClick=c.getClosestItem(a.curMouseSampleNrInView+b.curViewPort.sS,a.levelName,f.audioBuffer.length),b.setcurClickLevel(a.levelName,a.levelType,a.order),void 0!==a.lastEventClick.current&&void 0!==a.lastEventClick.nearest&&(c.setlasteditArea("_"+a.lastEventClick.current.id),c.setlasteditAreaElem(g.parent()),b.setcurClickItem(a.lastEventClick.current),b.selectBoundary()),a.lastPCM=a.curMouseSampleNrInView,b.setLastPcm(a.lastPCM),a.$apply()},a.setLastRightClick=function(d){if(b.getcurClickLevelName()!==a.levelName&&a.setLastClick(d),a.curMouseSampleNrInView=b.getX(d)*b.getSamplesPerPixelVal(d),c.deleteEditArea(),a.lastEventClick=c.getClosestItem(a.curMouseSampleNrInView+b.curViewPort.sS,a.levelName,f.audioBuffer.length),void 0!==a.lastEventClick.current&&void 0!==a.lastEventClick.nearest){var e=c.getItemInTime(b.getcurClickLevelName(),a.lastEventClick.current.id,!0),g=c.getItemInTime(b.getcurClickLevelName(),a.lastEventClick.current.id,!1);b.setcurClickLevel(a.levelName,a.levelType,a.$index),b.setcurClickItemMultiple(a.lastEventClick.current,e,g),b.selectBoundary()}a.lastPCM=a.curMouseSampleNrInView,b.setLastPcm(a.lastPCM),a.$apply()},a.setLastDblClick=function(d){a.curMouseSampleNrInView=b.getX(d)*b.getSamplesPerPixelVal(d),a.lastEventClick=c.getClosestItem(a.curMouseSampleNrInView+b.curViewPort.sS,a.levelName,f.audioBuffer.length),"25px"!==g.parent().css("height")||g.parent().parent().find("div")[3].click(),void 0!==a.lastEventClick.current&&void 0!==a.lastEventClick.nearest&&b.getPermission("labelAction")&&("SEGMENT"===a.levelType?a.lastEventClick.current.sampleStart>=b.curViewPort.sS&&a.lastEventClick.current.sampleStart+a.lastEventClick.current.sampleDur<=b.curViewPort.eS&&(b.setcurClickLevel(a.levelName,a.levelType,a.$index),b.setcurClickItem(a.lastEventClick.current),c.setlasteditArea("_"+a.lastEventClick.current.id),c.setlasteditAreaElem(g.parent()),b.setEditing(!0),c.openEditArea(a.lastEventClick.current,g.parent(),a.levelType)):(b.setcurClickLevel(a.levelName,a.levelType,a.$index),b.setcurClickItem(a.lastEventClick.current),c.setlasteditArea("_"+a.lastEventClick.current.id),c.setlasteditAreaElem(g.parent()),b.setEditing(!0),c.openEditArea(a.lastEventClick.current,g.parent(),a.levelType),b.setEditing(!0))),a.lastPCM=a.curMouseSampleNrInView,b.setLastPcm(a.lastPCM),a.$apply()},a.setLastMove=function(d,e){a.curMouseSampleNrInView=b.getX(d)*b.getSamplesPerPixelVal(d),a.lastEventMove=c.getClosestItem(a.curMouseSampleNrInView+b.curViewPort.sS,a.levelName,f.audioBuffer.length),e&&void 0!==a.lastEventMove.current&&void 0!==a.lastEventMove.nearest&&(a.lastNeighboursMove=c.getItemNeighboursFromLevel(a.levelName,a.lastEventMove.nearest.id,a.lastEventMove.nearest.id), b.setcurMouseItem(a.lastEventMove.nearest,a.lastNeighboursMove,b.getX(d),a.lastEventMove.isFirst,a.lastEventMove.isLast)),b.setcurMouseLevelName(a.levelName),b.setcurMouseLevelType(a.levelType),a.lastPCM=a.curMouseSampleNrInView,b.setLastPcm(a.lastPCM),a.$apply()}}}}]),angular.module("emuwebApp").directive("handleglobalkeystrokes",["$timeout","viewState","modalService","HierarchyManipulationService","Soundhandlerservice","ConfigProviderService","HistoryService","LevelService","DataService","LinkService","AnagestService","dbObjLoadSaveService",function(a,b,c,d,e,f,g,h,i,j,k,l){return{restrict:"A",link:function(a){$(document).bind("keyup",function(c){var d=c.keyCode?c.keyCode:c.which;b.isEditing()&&!b.getcursorInTextField()&&a.applyKeyCodeUp(d,c)}),$(document).bind("keydown",function(b){if(!a.firefox){var c=b.keyCode?b.keyCode:b.which;8!==c&&9!==c&&27!==c&&37!==c&&38!==c&&39!==c&&40!==c&&32!==c||a.applyKeyCode(c,b)}}),$(document).bind("keypress",function(b){var c=b.keyCode?b.keyCode:b.which;a.applyKeyCode(c,b)}),a.applyKeyCodeUp=function(c){a.$apply(function(){if(c!==f.vals.keyMappings.esc&&c!==f.vals.keyMappings.createNewItemAtSelection){var a=$("."+h.getlasteditArea()),d=a.val();b.setSavingAllowed(!0);var e=b.getCurAttrIndex(b.getcurClickLevelName()),g=f.getLevelDefinition(b.getcurClickLevelName()),i={};void 0!==g.attributeDefinitions&&g.attributeDefinitions.length>0&&(i=f.getLevelDefinition(b.getcurClickLevelName()).attributeDefinitions[e]),void 0!==i.legalLabels&&d.length>0&&i.legalLabels.indexOf(d)<0&&b.setSavingAllowed(!1),b.isSavingAllowed()?a.css({"background-color":"rgba(255,255,0,1)"}):a.css({"background-color":"rgba(255,0,0,1)"})}})},a.applyKeyCode=function(d,m){a.$apply(function(){if(!f.vals.main.catchMouseForKeyBinding||b.mouseInEmuWebApp){b.setlastKeyCode(d);var n,o,p,q,r,s,t,u,v,w,x,y,z,A,B;if(b.hierarchyState.isShown()&&void 0!==b.hierarchyState)if(b.hierarchyState.getInputFocus()){if(d===f.vals.keyMappings.hierarchyCommitEdit){var C=b.hierarchyState.getContextMenuID(),D=h.getItemByID(C);q=h.getLevelName(C),n=b.getCurAttrIndex(q);var E=f.getLevelDefinition(q).attributeDefinitions[n].legalLabels;o=b.hierarchyState.getEditValue(),p=void 0!==D.labels[n]?D.labels[n].value:"",void 0!==o&&o!==p?(void 0===E||o.length>0&&E.indexOf(o)>=0)&&(h.renameLabel(q,C,n,o),g.addObjToUndoStack({type:"ANNOT",action:"RENAMELABEL",name:q,id:C,attrIndex:n,oldValue:p,newValue:o}),b.hierarchyState.closeContextMenu()):b.hierarchyState.closeContextMenu()}d===f.vals.keyMappings.hierarchyCancelEdit&&b.hierarchyState.closeContextMenu()}else{if(d===f.vals.keyMappings.hierarchyDeleteLink&&m.preventDefault(),d===f.vals.keyMappings.hierarchyPlayback&&(m.preventDefault(),b.hierarchyState.playing+=1),d===f.vals.keyMappings.hierarchyRotate&&b.hierarchyState.toggleRotation(),d===f.vals.keyMappings.hierarchyDeleteLink){var F=j.deleteLink(b.hierarchyState.selectedLinkFromID,b.hierarchyState.selectedLinkToID);-1!==F&&g.addObjToUndoStack({type:"HIERARCHY",action:"DELETELINK",fromID:b.hierarchyState.selectedLinkFromID,toID:b.hierarchyState.selectedLinkToID,position:F})}if(d===f.vals.keyMappings.hierarchyDeleteItem){var G=h.deleteItemWithLinks(b.hierarchyState.selectedItemID);void 0!==G.item&&g.addObjToUndoStack({type:"HIERARCHY",action:"DELETEITEM",item:G.item,levelName:G.levelName,position:G.position,deletedLinks:G.deletedLinks})}var H;d===f.vals.keyMappings.hierarchyAddItemBefore&&-1!==(H=h.addItem(b.hierarchyState.selectedItemID,!0))&&g.addObjToUndoStack({type:"HIERARCHY",action:"ADDITEM",newID:H,neighborID:b.hierarchyState.selectedItemID,before:!0}),d===f.vals.keyMappings.hierarchyAddItemAfter&&-1!==(H=h.addItem(b.hierarchyState.selectedItemID,!1))&&g.addObjToUndoStack({type:"HIERARCHY",action:"ADDITEM",newID:H,neighborID:b.hierarchyState.selectedItemID,before:!1}),d===f.vals.keyMappings.levelUp&&b.hierarchyState.curPathIdx>=1&&(b.hierarchyState.curPathIdx=b.hierarchyState.curPathIdx-1),d===f.vals.keyMappings.levelDown&&b.hierarchyState.curPathIdx0&&(v=h.getItemNeighboursFromLevel(b.getcurClickLevelName(),b.getcurClickItems()[0].id,b.getcurClickItems()[b.getcurClickItems().length-1].id),w=h.getItemNeighboursFromLevel(b.getcurClickLevelName(),v.left.id,v.left.id),void 0!==v.left&&(void 0!==v.left.sampleStart?v.left.sampleStart>b.curViewPort.sS&&(m.shiftKey?(b.setcurClickItemMultiple(v.left,w.right),h.setlasteditArea("_"+v.left.id)):(b.setcurClickItem(v.left),h.setlasteditArea("_"+v.left.id)),b.selectBoundary()):v.left.samplePoint>b.curViewPort.sS&&(m.shiftKey?(b.setcurClickItemMultiple(v.left,w.right),h.setlasteditArea("_"+v.left.id)):(b.setcurClickItem(v.left),h.setlasteditArea("_"+v.left.id)),b.selectBoundary()))),d===f.vals.keyMappings.selNextItem&&b.getPermission("labelAction")&&b.getcurClickItems().length>0&&(v=h.getItemNeighboursFromLevel(b.getcurClickLevelName(),b.getcurClickItems()[0].id,b.getcurClickItems()[b.getcurClickItems().length-1].id),w=h.getItemNeighboursFromLevel(b.getcurClickLevelName(),v.right.id,v.right.id),void 0!==v.right&&(void 0!==v.right.sampleStart?v.right.sampleStart+v.right.sampleDur0){var O=b.getcurClickItems()[0].id,P=b.getcurClickItems()[b.getcurClickItems().length-1].id;v=h.getItemNeighboursFromLevel(b.getcurClickLevelName(),O,P),m.shiftKey?void 0!==v.left&&(void 0!==v.left.sampleStart?v.left.sampleStart>=b.curViewPort.sS&&(b.setcurClickItem(v.left),h.setlasteditArea("_"+v.left.id)):v.left.samplePoint>=b.curViewPort.sS&&(b.setcurClickItem(v.left,v.left.id),h.setlasteditArea("_"+v.left.id))):void 0!==v.right&&(void 0!==v.right.sampleStart?v.right.sampleStart+v.right.sampleDur<=b.curViewPort.eS&&(b.setcurClickItem(v.right),h.setlasteditArea("_"+v.right.id)):v.right.samplePoint=b.curViewPort.sS&&b.getselectedRange().end<=b.curViewPort.eS&&(b.setEditing(!0),h.openEditArea(b.getcurClickItems()[0],h.getlasteditAreaElem(),b.getcurClickLevelType()),a.cursorInTextField()):c.open("views/error.html","Modify Error: Please select a single Segment.");else if(-1===b.curViewPort.selectE&&-1===b.curViewPort.selectS)c.open("views/error.html","Error : Please select a Segment or Point to modify it's name. Or select a level plus a range in the viewport in order to insert a new Segment.");else if(x=h.getClosestItem(b.curViewPort.selectS,b.getcurClickLevelName(),e.audioBuffer.length).current,"SEGMENT"===b.getcurClickLevelType())void 0===x?(y=h.insertSegment(b.getcurClickLevelName(),b.curViewPort.selectS,b.curViewPort.selectE,f.vals.labelCanvasConfig.newSegmentName),y.ret?g.addObjToUndoStack({type:"ANNOT",action:"INSERTSEGMENTS",name:b.getcurClickLevelName(),start:b.curViewPort.selectS,end:b.curViewPort.selectE,ids:y.ids,segName:f.vals.labelCanvasConfig.newSegmentName}):c.open("views/error.html","Error : You are not allowed to insert a Segment here.")):x.sampleStart===b.curViewPort.selectS&&x.sampleStart+x.sampleDur+1===b.curViewPort.selectE?(h.setlasteditArea("_"+x.id),h.openEditArea(x,h.getlasteditAreaElem(),b.getcurClickLevelType()),b.setEditing(!0)):(y=h.insertSegment(b.getcurClickLevelName(),b.curViewPort.selectS,b.curViewPort.selectE,f.vals.labelCanvasConfig.newSegmentName),y.ret?g.addObjToUndoStack({type:"ANNOT",action:"INSERTSEGMENTS",name:b.getcurClickLevelName(),start:b.curViewPort.selectS,end:b.curViewPort.selectE,ids:y.ids,segName:f.vals.labelCanvasConfig.newSegmentName}):c.open("views/error.html","Error : You are not allowed to insert a Segment here."));else{var Q=f.getLevelDefinition(b.getcurClickLevelName());if(void 0===Q.anagestConfig){var R=h.insertEvent(b.getcurClickLevelName(),b.curViewPort.selectS,f.vals.labelCanvasConfig.newEventName);R.alreadyExists?(h.setlasteditArea("_"+x.id),h.openEditArea(x,h.getlasteditAreaElem(),b.getcurClickLevelType()),b.setEditing(!0)):g.addObjToUndoStack({type:"ANNOT",action:"INSERTEVENT",name:b.getcurClickLevelName(),start:b.curViewPort.selectS,id:R.id,pointName:f.vals.labelCanvasConfig.newEventName})}else k.insertAnagestEvents()}if(d===f.vals.keyMappings.undo&&b.getPermission("labelAction")&&g.undo(),d===f.vals.keyMappings.redo&&b.getPermission("labelAction")&&g.redo(),"Digit1"===m.originalEvent.code&&m.shiftKey&&b.switchPerspective(0,f.vals.perspectives),"Digit2"===m.originalEvent.code&&m.shiftKey&&b.switchPerspective(1,f.vals.perspectives),"Digit3"===m.originalEvent.code&&m.shiftKey&&b.switchPerspective(2,f.vals.perspectives),"Digit4"===m.originalEvent.code&&m.shiftKey&&b.switchPerspective(3,f.vals.perspectives),"Digit5"===m.originalEvent.code&&m.shiftKey&&b.switchPerspective(4,f.vals.perspectives),"Digit6"===m.originalEvent.code&&m.shiftKey&&b.switchPerspective(5,f.vals.perspectives),"Digit7"===m.originalEvent.code&&m.shiftKey&&b.switchPerspective(6,f.vals.perspectives),"Digit8"===m.originalEvent.code&&m.shiftKey&&b.switchPerspective(7,f.vals.perspectives),"Digit9"===m.originalEvent.code&&m.shiftKey&&b.switchPerspective(8,f.vals.perspectives),d===f.vals.keyMappings.deletePreselBoundary&&b.getPermission("labelAction")){m.preventDefault(),x=b.getcurMouseItem();var S=b.getcurClickItems(),T=b.getcurMouseisFirst(),U=b.getcurMouseisLast();q=b.getcurMouseLevelName();var V=b.getcurMouseLevelType();if(m.shiftKey)f.vals.restrictions.deleteItem&&void 0!==S&&S.length>0&&("SEGMENT"===b.getcurClickLevelType()?(A=h.deleteSegments(q,S[0].id,S.length),g.updateCurChangeObj({type:"ANNOT",action:"DELETESEGMENTS",name:q,id:S[0].id,length:S.length,deletedSegment:A}),B=j.deleteLinkSegment(S),g.updateCurChangeObj({type:"ANNOT",action:"DELETELINKSEGMENT",name:q,segments:S,deletedLinks:B}),g.addCurChangeObjToUndoStack(),z=h.getClosestItem(b.getLasPcm()+b.curViewPort.sS,q,e.audioBuffer.length),void 0!==z.current&&void 0!==z.nearest&&(v=h.getItemNeighboursFromLevel(q,z.nearest.id,z.nearest.id),b.setcurMouseItem(z.nearest,v,b.getLasPcm(),z.isFirst,z.isLast)),b.setcurClickItem(A.clickSeg)):c.open("views/error.html","Delete Error: You can not delete Segments on Point Levels."));else if(f.vals.restrictions.deleteItemBoundary&&void 0!==x){var W=h.getItemNeighboursFromLevel(q,x.id,x.id);if("SEGMENT"===V)A=h.deleteBoundary(q,x.id,T,U),g.updateCurChangeObj({type:"ANNOT",action:"DELETEBOUNDARY",name:q,id:x.id,isFirst:T,isLast:U,deletedSegment:A}),void 0!==W.left?(B=j.deleteLinkBoundary(x.id,W.left.id,h),g.updateCurChangeObj({type:"ANNOT",action:"DELETELINKBOUNDARY",name:q,id:x.id,neighbourId:W.left.id,deletedLinks:B})):(B=j.deleteLinkBoundary(x.id,-1,h),g.updateCurChangeObj({type:"ANNOT",action:"DELETELINKBOUNDARY",name:q,id:x.id,neighbourId:-1,deletedLinks:B})),g.addCurChangeObjToUndoStack(),z=h.getClosestItem(b.getLasPcm()+b.curViewPort.sS,q,e.audioBuffer.length),void 0!==z.current&&void 0!==z.nearest&&(v=h.getItemNeighboursFromLevel(q,z.nearest.id,z.nearest.id),b.setcurMouseItem(z.nearest,v,b.getLasPcm(),z.isFirst,z.isLast)),b.setcurClickItem(A.clickSeg);else{var X=h.deleteEvent(q,x.id);!1!==X?(g.updateCurChangeObj({type:"ANNOT",action:"DELETEEVENT",name:q,start:X.samplePoint,id:X.id,pointName:X.labels[0].value}),g.addCurChangeObjToUndoStack(),z=h.getClosestItem(b.getLasPcm()+b.curViewPort.sS,q,e.audioBuffer.length),void 0!==z.current&&void 0!==z.nearest&&(v=h.getItemNeighboursFromLevel(q,z.nearest.id,z.nearest.id),b.setcurMouseItem(z.nearest,v,b.getLasPcm(),z.isFirst,z.isLast))):b.setcurMouseItem(void 0,void 0,void 0,void 0,void 0)}}}m.metaKey||m.ctrlKey||(m.preventDefault(),m.stopPropagation())}}})},a.safeApply=function(a){var b=this.$root.$$phase;"$apply"===b||"$digest"===b?a&&"function"==typeof a&&a():this.$apply(a)},a.$on("$destroy",function(){$(window).off("keydown")})}}}]),angular.module("emuwebApp").directive("delete",["modalService",function(a){return{restrict:"A",link:function(b,c,d){c.bind("click",function(){b.vs.setcurClickLevelName(b.level.name,d.delete),b.vs.setcurClickLevel(b.level.name,b.level.type,b.order),a.open("views/deleteLevel.html",b.level.name)})}}}]),angular.module("emuwebApp").directive("resize",["LevelService","viewState",function(a,b){return{restrict:"A",link:function(c,d){var e=d.parent().parent(),f=0,g=e.find(d.parent().children()[0]),h=e.find(d.parent().children()[2]);d.bind("click",function(){a.deleteEditArea(),b.setEditing(!1),c.open?(c.open=!1,f=e.css("height"),e.css({height:"25px"}),c.cps.vals.activeButtons.deleteSingleLevel&&g.hide(),c.cps.vals.activeButtons.saveSingleLevel&&h.hide()):(c.open=!0,e.css({height:f}),c.cps.vals.activeButtons.deleteSingleLevel&&g.show(),c.cps.vals.activeButtons.saveSingleLevel&&h.show()),c.updateView()})}}}]),angular.module("emuwebApp").directive("enlarge",["$rootScope","viewState","ConfigProviderService",function(a,b,c){return{restrict:"A",link:function(d,e,f){d.$watch("viewState.curPerspectiveIdx",function(){$.isEmptyObject(c.vals.perspectives)||$.isEmptyObject(b.curPerspectiveIdx)||(1===c.vals.perspectives[b.curPerspectiveIdx].signalCanvases.order.length?e.hide():e.show())},!0);var g=!1;e.bind("click",function(){g?(g=!1,b.setenlarge(-1)):(g=!0,b.setenlarge(parseInt(f.enlarge))),a.$apply()})}}}]),angular.module("emuwebApp").directive("save",["modalService","Espsparserservice",function(a,b){return{restrict:"A",link:function(c,d,e){d.bind("click",function(){c.vs.setcurClickLevelName(c.level.name,e.save),b.asyncParseJSO(c.level.name).then(function(b){a.open("views/export.html",name+"_esps.txt",b)})})}}}]),angular.module("emuwebApp").directive("previewtrack",["viewState","Soundhandlerservice",function(a,b){return{restrict:"A",scope:{},link:function(c,d){var e=-1;d.bind("click",function(d){if(!$.isEmptyObject(b.audioBuffer)){var f=a.curViewPort.eS-a.curViewPort.sS;e=a.getX(d)*(b.audioBuffer.length/d.originalEvent.target.width),e-f/2<0?e=Math.ceil(f/2):e+f/2>b.audioBuffer.length&&(e=Math.floor(b.audioBuffer.length-f/2)),a.isEditing()||c.$apply(function(){a.setViewPort(e-f/2,e+f/2)})}}),d.bind("mousedown",function(c){$.isEmptyObject(b.audioBuffer)||(e=a.getX(c)*(b.audioBuffer.length/c.originalEvent.target.width))}),d.bind("mousemove",function(d){switch(void 0===d.buttons?d.which:d.buttons){case 1:if(-1!==e){var f=a.curViewPort.eS-a.curViewPort.sS;e=a.getX(d)*(b.audioBuffer.length/d.originalEvent.target.width),a.isEditing()||c.$apply(function(){a.setViewPort(e-f/2,e+f/2)})}}}),d.bind("mouseup",function(){e=-1}),d.bind("mouseout",function(){e=-1})}}}]),angular.module("emuwebApp").service("Iohandlerservice",["$rootScope","$http","$location","$q","HistoryService","viewState","Soundhandlerservice","Ssffparserservice","Wavparserservice","Textgridparserservice","ConfigProviderService","Espsparserservice","Ssffdataservice","Websockethandler","DragnDropDataService",function(a,b,c,d,e,f,g,h,i,j,k,l,m,n,o){var p={};return p.wsH=n,p.httpGetDefaultConfig=function(){return b.get("configFiles/default_emuwebappConfig.json")},p.httpGetDefaultDesign=function(){return b.get("configFiles/default_emuwebappDesign.json")},p.httpGetPath=function(a,c){return b.get(a,{responseType:c})},p.getProtocol=function(){var a;return"CORS"===k.vals.main.comMode||"WS"===k.vals.main.comMode&&(a=n.getProtocol()),a},p.getDoUserManagement=function(){var a;return"CORS"===k.vals.main.comMode||"WS"===k.vals.main.comMode&&(a=n.getDoUserManagement()),a},p.logOnUser=function(a,b){var c;return"CORS"===k.vals.main.comMode||"WS"===k.vals.main.comMode&&(c=n.logOnUser(a,b)),c},p.getDBconfigFile=function(a){var c;return"CORS"===k.vals.main.comMode||("WS"===k.vals.main.comMode?c=n.getDBconfigFile():"DEMO"===k.vals.main.comMode&&(c=b.get("demoDBs/"+a+"/"+a+"_DBconfig.json"))),c},p.getBundleList=function(a){var c;return"CORS"===k.vals.main.comMode||("WS"===k.vals.main.comMode?c=n.getBundleList():"DEMO"===k.vals.main.comMode&&(c=b.get("demoDBs/"+a+"/"+a+"_bundleList.json"))),c},p.getBundle=function(a,c,d){var e;return"CORS"===k.vals.main.comMode||("EMBEDDED"===k.vals.main.comMode?e=o.getBundle(a,c):"WS"===k.vals.main.comMode?e=n.getBundle(a,c):"DEMO"===k.vals.main.comMode&&(e=b.get("demoDBs/"+d+"/"+a+"_bndl.json"))),e},p.saveBundle=function(a){var b;return"CORS"===k.vals.main.comMode||"WS"===k.vals.main.comMode&&(b=n.saveBundle(a)),b},p.saveConfiguration=function(a){var b;return"CORS"===k.vals.main.comMode?console.error("CORS version of saveBundle not implemented"):"WS"===k.vals.main.comMode&&(b=n.saveConfiguration(a)),b},p.parseLabelFile=function(a,b,c,e){var f;if("ESPS"===e)f=l.asyncParseEsps(a,k.embeddedVals.labelGetUrl,"embeddedESPS");else if("TEXTGRID"===e)f=j.asyncParseTextGrid(a,k.embeddedVals.labelGetUrl,"embeddedTEXTGRID");else if("annotJSON"===e){var g=d.defer();f=g.promise,g.resolve(angular.fromJson(a))}return f},p}]),angular.module("emuwebApp").service("Soundhandlerservice",function(){function a(){try{window.AudioContext=window.AudioContext||window.webkitAudioContext,b=new AudioContext}catch(a){alert("Error loading the AudioContext (could mean your browser does not support the HTML5 webaudio API):"+a)}}var b,c,d={};return d.audioBuffer={},d.isPlaying=!1,d.decodeAndPlay=function(e,f){void 0===b&&a();var g=e/d.audioBuffer.sampleRate,h=f/d.audioBuffer.sampleRate,i=h-g;c=b.createBufferSource(),c.buffer=d.audioBuffer,c.connect(b.destination),c.start(0,g,i),c.onended=function(){d.isPlaying=!1}},d.playFromTo=function(a,b){d.isPlaying?(d.isPlaying=!1,c.stop(0)):(d.isPlaying=!0,d.audioBuffer.length>0&&d.decodeAndPlay(a,b))},d}),angular.module("emuwebApp").directive("drawssff",["$timeout","viewState","ConfigProviderService","Ssffdataservice","HistoryService","fontScaleService","loadedMetaDataService",function(a,b,c,d,e,f,g){return{restrict:"A",scope:{},link:function(h,i,j){h.trackName=j.ssffTrackname,h.assTrackName="",h.lastDraw=Date.now(),h.vs=b,h.hists=e,h.ssffds=d,h.cps=c,h.lmds=g,j.$observe("ssffTrackname",function(a){h.trackName=a}),h.$watch("vs.curViewPort",function(a,b){b.sS===a.sS&&b.eS===a.eS||h.handleUpdate(),b.windowWidth!==a.windowWidth&&h.handleUpdate(),b.dragBarHeight!==a.dragBarHeight&&h.handleUpdate()},!0),h.$watch("vs.curPerspectiveIdx",function(){h.handleUpdate()},!0),h.$watch("vs.curCorrectionToolNr",function(){h.handleUpdate()},!0),h.$watch("hists.movesAwayFromLastSave",function(){h.handleUpdate()},!0),h.$watch("ssffds.data.length",function(){h.handleUpdate()},!0),h.$watch("vs.spectroSettings",function(){h.handleUpdate()},!0),h.$watch("vs.submenuOpen",function(b,d){b!==d&&a(h.handleUpdate,c.design.animation.duration)}),h.$watch("vs.timelineSize",function(b,d){b!==d&&a(h.handleUpdate,c.design.animation.duration/10)}),h.$watch("lmds.getCurBndl()",function(a,b){a.name===b.name&&a.session===b.session||h.handleUpdate()},!0),h.handleUpdate=function(){var a=i[0].getContext("2d");if(a.clearRect(0,0,i[0].width,i[0].height),$.isEmptyObject(d.data))a.clearRect(0,0,i[0].width,i[0].height);else if(0!==d.data.length&&(h.assTrackName="",c.vals.perspectives[b.curPerspectiveIdx].signalCanvases.assign.forEach(function(a){if(a.signalCanvasName===h.trackName){h.assTrackName=a.ssffTrackName;var e=c.getSsffTrackConfig(a.ssffTrackName),f=d.getColumnOfTrack(e.name,e.columnName),g=d.getSampleRateAndStartTimeOfTrack(e.name),j=c.getContourLimsOfTrack(e.name),k=c.getValueLimsOfTrack(e.name);h.drawValues(b,i[0],c,f,g.sampleRate,g.startTime,j,k)}}),h.assTrackName="","OSCI"!==h.trackName&&"SPEC"!==h.trackName)){var e=c.getSsffTrackConfig(h.trackName),f=d.getColumnOfTrack(e.name,e.columnName),g=d.getSampleRateAndStartTimeOfTrack(e.name),j=c.getContourLimsOfTrack(e.name),k=c.getValueLimsOfTrack(e.name);h.drawValues(b,i[0],c,f,g.sampleRate,g.startTime,j,k)}},h.drawValues=function(a,b,d,e,g,i,j,k){var l,m,n=b.getContext("2d");"SPEC"===h.trackName&&"FORMANTS"===h.assTrackName?(l=a.spectroSettings.rangeFrom,m=a.spectroSettings.rangeTo):(l=e._minVal,m=e._maxVal),angular.equals(k,{})||(l=k.minVal,m=k.maxVal);var o=a.getViewPortStartTime(),p=a.getViewPortEndTime(),q=Math.round(o*g+i),r=Math.round(p*g+i),s=r-q,t=e.values.slice(q,q+s),u=c.getHorizontalLinesOfTrack(h.trackName);if(u&&angular.forEach(u.yValues,function(a){n.beginPath(),n.lineWidth="2",n.strokeStyle="blue",n.globalAlpha=.75;var c=b.height-(a-l)/(m-l)*b.height;n.moveTo(0,c),n.lineTo(b.width,c),n.stroke(),n.lineWidth="1",n.globalAlpha=1}),s=2){var v,w,x,y;angular.forEach(t[0],function(d,f){ if($.isEmptyObject(j)||f>=j.minContourIdx&&f<=j.maxContourIdx){if($.isEmptyObject(j))n.strokeStyle="hsl("+f*(360/t[0].length)+",80%, 50%)",n.fillStyle="hsl("+f*(360/t[0].length)+",80%, 50%)";else{var k=j.maxContourIdx-j.minContourIdx+1;n.strokeStyle="hsl("+f*(360/k)+",80%, 50%)",n.fillStyle="hsl("+f*(360/k)+",80%, 50%)"}var s=c.getContourColorsOfTrack(h.assTrackName);if(void 0!==s&&void 0!==s.colors[f]&&(n.strokeStyle=c.vals.perspectives[a.curPerspectiveIdx].signalCanvases.contourColors[0].colors[f],n.fillStyle=c.vals.perspectives[a.curPerspectiveIdx].signalCanvases.contourColors[0].colors[f]),a.curCorrectionToolNr-1===f&&"SPEC"===h.trackName&&"FORMANTS"===h.assTrackName&&(n.strokeStyle=c.design.color.green,n.fillStyle=c.design.color.green),n.beginPath(),q>=1){var u=e.values[q-1],z=u[f];x=q-1,y=1/g*x+i,v=(y-o)/(p-o)*b.width,w=b.height-(z-l)/(m-l)*b.height,n.moveTo(v,w)}if(angular.forEach(t,function(a,c){x=q+c,y=1/g*x+i,v=(y-o)/(p-o)*b.width,w=b.height-(a[f]-l)/(m-l)*b.height,n.arc(v,w-1,2,0,2*Math.PI,!1),n.lineTo(v,w)}),r=a.curViewPort.selectE-d/2&&(a.curViewPort.selectE=c),g.switchMarkupContext(b),g.$apply()}}),h.bind("mousemove",function(d){var f=0;f=void 0===d.buttons?d.which:d.buttons;var i=a.getX(d);switch(a.curMouseX=i,a.curMouseTrackName=n,a.curMousePosSample=Math.round(a.curViewPort.sS+i/h[0].width*(a.curViewPort.eS-a.curViewPort.sS)),f){case 0:if(a.getPermission("labelAction")&&(g.switchMarkupContext(d),!($.isEmptyObject(c.data)||0===c.data.length||a.getdragBarActive()||void 0===a.curCorrectionToolNr||a.getdragBarActive()||$.isEmptyObject(b.getAssignment(n))))){void 0===k&&(k=b.getSsffTrackConfig("FORMANTS")),l=c.getColumnOfTrack(k.name,k.columnName),m=c.getSampleRateAndStartTimeOfTrack(k.name);var j=a.getViewPortStartTime(),o=a.getViewPortEndTime(),r=Math.round(j*m.sampleRate+m.startTime),s=Math.round(o*m.sampleRate+m.startTime),t=s-r,u=l.values.slice(r,r+t),v=j+a.getX(d)/d.originalEvent.target.width*(o-j),w=Math.round((v+m.startTime)*m.sampleRate)-1,x=1/m.sampleRate*w+m.startTime;if(w-r<0||w-r>=u.length)return;a.curPreselColumnSample=w-r;var y=(x-j)/(o-j)*p.width,z=p.height-u[a.curPreselColumnSample][a.curCorrectionToolNr-1]/(a.spectroSettings.rangeTo-a.spectroSettings.rangeFrom)*p.height;if(q.strokeStyle="black",q.fillStyle="black",q.beginPath(),q.arc(y,z-1,2,0,2*Math.PI,!1),q.closePath(),q.stroke(),q.fill(),d.shiftKey){var A=angular.copy(u[a.curPreselColumnSample][a.curCorrectionToolNr-1]),B=a.spectroSettings.rangeTo-a.getY(d)/d.originalEvent.target.height*a.spectroSettings.rangeTo;u[a.curPreselColumnSample][a.curCorrectionToolNr-1]=a.spectroSettings.rangeTo-a.getY(d)/d.originalEvent.target.height*a.spectroSettings.rangeTo;var C=e.updateCurChangeObj({type:"SSFF",trackName:k.name,sampleBlockIdx:r+a.curPreselColumnSample,sampleIdx:a.curCorrectionToolNr-1,oldValue:A,newValue:B});for(var D in C)x=1/m.sampleRate*C[D].sampleBlockIdx+m.startTime,y=(x-j)/(o-j)*p.width,z=p.height-C[D].newValue/(a.spectroSettings.rangeTo-a.spectroSettings.rangeFrom)*p.height,q.strokeStyle="red",q.fillStyle="red",q.beginPath(),q.arc(y,z-1,2,0,2*Math.PI,!1),q.closePath(),q.stroke(),q.fill()}}break;case 1:a.getdragBarActive()||g.setSelectDrag(d)}g.$apply()}),h.bind("mouseleave",function(b){$.isEmptyObject(f)||$.isEmptyObject(f.audioBuffer)||a.getdragBarActive()||a.getPermission("labelAction")&&(g.switchMarkupContext(b,!1),a.curMouseTrackName=void 0)}),g.switchMarkupContext=function(e,f){if(q.clearRect(0,0,p.width,p.height),"OSCI"===i.ssffTrackname)d.drawViewPortTimes(q,!0),d.drawCurViewPortSelected(q,!0);else if("SPEC"===i.ssffTrackname)d.drawCurViewPortSelected(q,!1),d.drawMinMaxAndName(q,"",a.spectroSettings.rangeFrom,a.spectroSettings.rangeTo,2);else{var g=b.getSsffTrackConfig(i.ssffTrackname),h=c.getColumnOfTrack(g.name,g.columnName);d.drawCurViewPortSelected(q,!1),d.drawMinMaxAndName(q,i.ssffTrackname,h._minVal,h._maxVal,2)}!1!==f&&b.vals.restrictions.drawCrossHairs&&d.drawCrossHairs(q,e,a.spectroSettings.rangeFrom,a.spectroSettings.rangeTo,"Hz",i.ssffTrackname),d.drawMovingBoundaryLine(q)},g.setSelectDrag=function(b){j=Math.round(a.getX(b)*a.getSamplesPerPixelVal(b)+a.curViewPort.sS),j>a.curViewPort.movingS?a.curViewPort.movingE=j:a.curViewPort.movingS=j,a.select(a.curViewPort.movingS,a.curViewPort.movingE),g.$apply()}}}}]),angular.module("emuwebApp").service("Drawhelperservice",["viewState","ConfigProviderService","Soundhandlerservice","fontScaleService","Ssffdataservice","mathHelperService",function(a,b,c,d,e,f){function g(a,b,c){return a.measureText(b).width*c}function h(a,b,c,d){return void 0!==b&&b.toString().length>c.toString().length?g(a,b,d):g(a,c,d)}var i={};return i.osciPeaks={},i.calculateOsciPeaks=function(){var a=c.audioBuffer.sampleRate,b=c.audioBuffer.numberOfChannels,d=a/400,e=a/10,f=a/1;i.osciPeaks={numberOfChannels:b,sampleRate:a,winSizes:[d,e,f],channelOsciPeaks:[]};for(var g=0;gs&&(s=h[B]),h[B]w&&(w=h[B]),h[B]A&&(A=h[B]),h[B]q&&(q=s[t]),s[t]o&&(o=q),pl&&(l=i.osciPeaks.channelOsciPeaks[0].maxPeaks[d][m]),i.osciPeaks.channelOsciPeaks[0].minPeaks[d][m]i.osciPeaks.winSizes[j]&&(l=j);var m,n,o,p,q;if(-1!==l){m=i.findMinMaxPeaks(e,f,l);var r=a.calcSampleTime(e),s=i.osciPeaks.sampleRate/i.osciPeaks.winSizes[l],t=r*s;h.strokeStyle=b.design.color.black;var u=Math.round(t);h.beginPath(),n=(m.maxMaxPeak-i.osciPeaks.channelOsciPeaks[0].maxPeaks[l][u])/(m.maxMaxPeak-m.minMinPeak)*d.height,o=(m.maxMaxPeak-i.osciPeaks.channelOsciPeaks[0].minPeaks[l][u])/(m.maxMaxPeak-m.minMinPeak)*d.height,h.moveTo(0,n),p=n,q=o;for(var v,w,x,y=1;y=1){for(h.strokeStyle=b.design.color.black,h.beginPath(),n=(m.maxMaxPeak-m.maxPeaks[0])/(m.maxMaxPeak-m.minMinPeak)*d.height,o=(m.maxMaxPeak-m.minPeaks[0])/(m.maxMaxPeak-m.minMinPeak)*d.height,h.moveTo(0,n),h.lineTo(0,o),p=n,q=o,j=1;j=1?(B=d.height-(0-m.minMinPeak)/(m.maxMaxPeak-m.minMinPeak)*d.height,h.beginPath(),h.moveTo(0,B),h.lineTo(d.width,B),h.stroke(),h.fillText("0",5,B-5,d.width)):(B=d.height-(0-m.minSample)/(m.maxSample-m.minSample)*d.height,h.beginPath(),h.moveTo(0,B),h.lineTo(d.width,B),h.stroke(),h.fill(),h.fillText("0",5,d.height-(0-m.minSample)/(m.maxSample-m.minSample)*d.height-5,d.width))}},i.drawMovingBoundaryLine=function(c){var d,e;if(e=a.getSampleDist(c.canvas.width),d="SEGMENT"===a.getcurMouseLevelType()?0:e/2,a.movingBoundary){c.fillStyle=b.design.color.blue;var f=Math.round(a.getPos(c.canvas.width,a.movingBoundarySample));a.getcurMouseisLast()?c.fillRect(f+e,0,1,c.canvas.height):c.fillRect(f+d,0,1,c.canvas.height)}},i.drawCurViewPortSelected=function(e,i){var j,k,l,m,n=1*b.design.font.small.size.slice(0,-2);k=a.getSampleDist(e.canvas.width),j="seg"===a.getcurMouseLevelType()?0:k/2;var o=a.getPos(e.canvas.width,a.curViewPort.selectS),p=a.getPos(e.canvas.width,a.curViewPort.selectE);if(o===p)e.fillStyle=b.design.color.transparent.black,e.fillRect(o+j,0,2,e.canvas.height),i&&a.curViewPort.sS!==a.curViewPort.selectS&&-1!==a.curViewPort.selectS&&(m=e.canvas.width/e.canvas.offsetWidth,l=h(e,a.curViewPort.selectS,f.roundToNdigitsAfterDecPoint(a.curViewPort.selectS/c.audioBuffer.sampleRate,6),m),d.drawUndistortedTextTwoLines(e,a.curViewPort.selectS,f.roundToNdigitsAfterDecPoint(a.curViewPort.selectS/c.audioBuffer.sampleRate,6),n,b.design.font.small.family,p+5,0,b.design.color.black,!0));else if(e.fillStyle=b.design.color.transparent.grey,e.fillRect(o,0,p-o,e.canvas.height),e.strokeStyle=b.design.color.transparent.black,e.beginPath(),e.moveTo(o,0),e.lineTo(o,e.canvas.height),e.moveTo(p,0),e.lineTo(p,e.canvas.height),e.closePath(),e.stroke(),i&&(m=e.canvas.width/e.canvas.offsetWidth,l=h(e,a.curViewPort.selectS,f.roundToNdigitsAfterDecPoint(a.curViewPort.selectS/c.audioBuffer.sampleRate,6),m),d.drawUndistortedTextTwoLines(e,a.curViewPort.selectS,f.roundToNdigitsAfterDecPoint(a.curViewPort.selectS/c.audioBuffer.sampleRate,6),n,b.design.font.small.family,o-l-5,0,b.design.color.black,!1),d.drawUndistortedTextTwoLines(e,a.curViewPort.selectE,f.roundToNdigitsAfterDecPoint(a.curViewPort.selectE/c.audioBuffer.sampleRate,6),n,b.design.font.small.family,p+5,0,b.design.color.black,!0),l=g(e,f.roundToNdigitsAfterDecPoint((a.curViewPort.selectE-a.curViewPort.selectS)/c.audioBuffer.sampleRate,6),m),p-o>l)){var q=a.curViewPort.selectE-a.curViewPort.selectS-1,r=f.roundToNdigitsAfterDecPoint((a.curViewPort.selectE-a.curViewPort.selectS)/c.audioBuffer.sampleRate,6);l=h(e,q,r,m),d.drawUndistortedTextTwoLines(e,q,r,n,b.design.font.small.family,o+(p-o)/2-l/2,0,b.design.color.black,!1)}},i.drawCrossHairX=function(a,c){a.strokeStyle=b.design.color.transparent.red,a.fillStyle=b.design.color.transparent.red,a.beginPath(),a.moveTo(c,0),a.lineTo(c,a.canvas.height),a.stroke()},i.drawCrossHairs=function(c,g,h,i,j,k){if(b.vals.restrictions.drawCrossHairs){var l=1*b.design.font.small.size.slice(0,-2);c.strokeStyle=b.design.color.transparent.red,c.fillStyle=b.design.color.transparent.red;var m=a.getX(g),n=a.getY(g);c.font=b.design.font.small.size+"px "+b.design.font.small.family;var o,p=f.roundToNdigitsAfterDecPoint(i-n/c.canvas.height*i,2),q=c.measureText(p+j).width*d.scaleX,r=l*d.scaleY,s=Math.round(a.curViewPort.sS+m/c.canvas.width*(a.curViewPort.eS-a.curViewPort.sS)),t=f.roundToNdigitsAfterDecPoint(a.getViewPortStartTime()+m/c.canvas.width*(a.getViewPortEndTime()-a.getViewPortStartTime()),6);if(o=n+r0){var a=angular.copy(l[l.length-1]);m.push(a),j(a,!0),l.pop(),k.movesAwayFromLastSave-=1}},k.redo=function(){if(m.length>0){var a=angular.copy(m[m.length-1]);l.push(a),j(a,!1),m.pop(),k.movesAwayFromLastSave+=1}},k.getNrOfPossibleUndos=function(){return l.length},k.getCurrentStack=function(){return{undo:l,redo:m}},k.setHistoryActionText=function(a,b){var c="UNDO → ";a||(c="REDO ← "),g.historyActionTxt=c+b},k.resetToInitState=function(){l=[],m=[],n={},k.movesAwayFromLastSave=0},k}]),angular.module("emuwebApp").service("Wavparserservice",["$q",function(a){var b,c={};return c.ab2str=function(a){for(var b=[],c=0;c= 44100 and <= 96000 which seem to currently be the only sample rates supported by the webkitOfflineAudioContext (see here https://github.com/WebKit/webkit/blob/29271ffbec500cd9c92050fcc0e613adffd0ce6a/Source/WebCore/Modules/webaudio/AudioContext.cpp#L111)";var h={};return h.status={},h.status.message=JSON.stringify(g,null,4),b=a.defer(),b.reject(h),b.promise}},c}]),angular.module("emuwebApp").service("Textgridparserservice",["$q","DataService","viewState","Soundhandlerservice",function(a,b,c,d){var e,f={},g=new TextGridParserWorker;return g.says(function(a){"SUCCESS"===a.status.type?e.resolve(a.data):e.reject(a)},!1),f.asyncToTextGrid=function(){return e=a.defer(),g.tell({cmd:"toTextGrid",levels:b.getData().levels,sampleRate:d.audioBuffer.sampleRate,buffLength:d.audioBuffer.length}),e.promise},f.asyncParseTextGrid=function(b,c,f){return e=a.defer(),g.tell({cmd:"parseTG",textGrid:b,sampleRate:d.audioBuffer.sampleRate,annotates:c,name:f}),e.promise},f}]),angular.module("emuwebApp").factory("uuid",function(){function a(a){var b=(Math.random().toString(16)+"000000000").substr(2,8);return a?"-"+b.substr(0,4)+"-"+b.substr(4,4):b}var b={};return b.new=function(){return a()+a(!0)+a(!0)+a()},b.newHash=function(){return a()+a(!0)+a(!0)+a()},b.empty=function(){return"00000000-0000-0000-0000-000000000000"},b}),angular.module("emuwebApp").factory("browserDetector",function(){var a={};return a.isMobile={Android:function(){return navigator.userAgent.match(/Android/i)},BlackBerry:function(){return navigator.userAgent.match(/BlackBerry/i)},iOS:function(){return navigator.userAgent.match(/iPhone|iPad|iPod/i)},Opera:function(){return navigator.userAgent.match(/Opera Mini/i)},Windows:function(){return navigator.userAgent.match(/IEMobile/i)},any:function(){return a.isMobile.Android()||a.isMobile.BlackBerry()||a.isMobile.iOS()||a.isMobile.Opera()||a.isMobile.Windows()}},a.isBrowser={Firefox:function(){return navigator.userAgent.match(/Firefox/i)},Chrome:function(){return navigator.userAgent.match(/Chrome/i)},InternetExplorer:function(){return navigator.userAgent.match(/MSIE/i)},Opera:function(){return navigator.userAgent.match(/Opera/i)},PhantomJS:function(){return navigator.userAgent.match(/PhantomJS/i)},Safari:function(){return Object.prototype.toString.call(window.HTMLElement).indexOf("Constructor")>0},any:function(){return a.isBrowser.Firefox()||a.isBrowser.Chrome()||a.isBrowser.InternetExplorer()||a.isBrowser.Opera()||a.isBrowser.Safari()||a.isBrowser.PhantomJS()}},a.isMobileDevice=function(){var b=a.isMobile.any();return null!==b&&b.length>0},a.isDesktopDevice=function(){var b=a.isBrowser.any();return null!==b&&b.length>0},a}),angular.module("emuwebApp").service("fontScaleService",function(){var a={};return a.lastTextWidth=null,a.spaceTop=0,a.scaleY=0,a.scaleX=0,a.drawUndistortedText=function(b,c,d,e,f,g,h,i){if(a.scaleY=b.canvas.height/b.canvas.offsetHeight,a.scaleX=b.canvas.width/b.canvas.offsetWidth,b.save(),b.font=d+"px "+e,b.scale(a.scaleX,a.scaleY),b.fillStyle=h,i)b.fillText(c,f/a.scaleX,(g+d+a.spaceTop)/a.scaleY);else{var j=f/a.scaleX-b.measureText(c).width/2;b.fillText(c,j,(g+d+a.spaceTop)/a.scaleY)}b.scale(1,1),b.restore()},a.drawUndistortedTextTwoLines=function(b,c,d,e,f,g,h,i,j){if(a.scaleY=b.canvas.height/b.canvas.offsetHeight,a.scaleX=b.canvas.width/b.canvas.offsetWidth,b.save(),b.font=e+"px "+f,b.scale(a.scaleX,a.scaleY),b.fillStyle=i,j)b.fillText(c,g/a.scaleX,h+e+a.spaceTop),b.fillText(d,g/a.scaleX,h+2*e+a.spaceTop);else{var k=b.measureText(c).width,l=b.measureText(d).width;k>l?(b.fillText(c,g/a.scaleX,h+e+a.spaceTop),b.fillText(d,(g+(k-l))/a.scaleX,h+2*e+a.spaceTop)):(b.fillText(c,(g+(l-k))/a.scaleX,h+e+a.spaceTop),b.fillText(d,g/a.scaleX,h+2*e+a.spaceTop))}b.scale(1,1),b.restore()},a}),angular.module("emuwebApp").service("Espsparserservice",["$q","LevelService","Soundhandlerservice",function(a,b,c){var d,e={},f=new EspsParserWorker;return f.says(function(a){"SUCCESS"===a.status.type?d.resolve(a.data):d.reject(a.data)},!1),e.asyncParseEsps=function(b,e,g){return d=a.defer(),f.tell({cmd:"parseESPS",esps:b,sampleRate:c.audioBuffer.sampleRate,annotates:e,name:g}),d.promise},e.asyncParseJSO=function(e){return d=a.defer(),f.tell({cmd:"parseJSO",level:b.getLevelDetails(e),sampleRate:c.audioBuffer.sampleRate}),d.promise},e}]),angular.module("emuwebApp").controller("LoginCtrl",["$scope","$rootScope","$http","ConfigProviderService","Iohandlerservice","viewState","modalService",function(a,b,c,d,e,f,g){a.loginData={username:"",password:"",errorMsg:""},a.tryLogin=function(){e.logOnUser(a.loginData.username,a.loginData.password).then(function(b){"LOGGEDON"===b?g.confirm():a.loginData.errorMsg="ERROR: "+b})},a.cursorInTextField=function(){f.setEditing(!0),f.setcursorInTextField(!0)},a.cursorOutOfTextField=function(){f.setEditing(!1),f.setcursorInTextField(!1)},a.cancel=function(){g.close()}}]),angular.module("emuwebApp").service("Ssffdataservice",["viewState","Soundhandlerservice","ConfigProviderService",function(a,b,c){var d={};return d.data=[],d.getFile=function(a){var b;return void 0!==c.curDbConfig.ssffTrackDefinitions&&c.curDbConfig.ssffTrackDefinitions.forEach(function(c){c.name===a&&d.data.forEach(function(a){a.fileExtension===c.fileExtension&&(b=a)})}),b},d.getColumnOfTrack=function(a,b){var c,e=d.getFile(a);if(void 0!==e)return e.Columns.forEach(function(a){a.name===b&&(c=a)}),c},d.getSampleRateAndStartTimeOfTrack=function(a){var b={},c=d.getFile(a);if(void 0!==c)return b.sampleRate=c.sampleRate,b.startTime=c.startTime,b},d.calculateSamplePosInVP=function(a,c,d){var e=a/c+d;return Math.round(e*b.audioBuffer.sampleRate)},d}]),angular.module("emuwebApp").service("DataService",function(){var a={};return a.data={},a.maxItemID=0, a.getData=function(){return a.data},a.setLevelData=function(b){a.data.levels=b},a.getLevelData=function(){return a.data.levels},a.getLevelOrder=function(b){if(void 0!==a.data.levels)return a.data.levels.sort(function(a,c){return b.indexOf(a.name)-b.indexOf(c.name)})},a.getLevelDataAt=function(b){return a.data.levels[b]},a.insertLevelDataAt=function(b,c){a.data.levels.splice(b,0,c)},a.deleteLevelDataAt=function(b){a.data.levels.splice(b,1)},a.getLinkData=function(){return a.data.links},a.setLinkData=function(b){a.data.links=b},a.insertLinkData=function(b){a.data.links.push(b)},a.deleteLinkDataAt=function(b){a.data.links.splice(b,1)},a.insertLinkDataAt=function(b,c){a.data.links.splice(b,0,c)},a.changeLinkDataAt=function(b,c,d){a.data.links[b].fromID=c,a.data.links[b].toID=d},a.setData=function(b){angular.copy(b,a.data),angular.forEach(a.data.levels,function(b){b.items.forEach(function(b){b.id>a.maxItemID&&(a.maxItemID=b.id)})})},a.getNewId=function(){return a.maxItemID+=1,a.maxItemID},a.raiseId=function(b){a.maxItemID+=b},a.lowerId=function(b){a.maxItemID-=b},a}),angular.module("emuwebApp").service("LevelService",["$q","DataService","LinkService","ConfigProviderService","Soundhandlerservice","viewState",function(a,b,c,d,e,f){function g(a,b){var c;return angular.forEach(b,function(b,d){b.name===a&&(c=d)}),c}var h={};return h.lasteditArea=null,h.lasteditAreaElem=null,h.getLevelDetails=function(a){var c=null;return angular.forEach(b.getLevelData(),function(b){b.name===a&&(c=b)}),c},h.getLevelsByType=function(a){var c=[];return angular.forEach(b.getLevelData(),function(b){a.indexOf(b.type)>=0&&c.push(b)}),c},h.getOrderById=function(a,c){var d=null;return angular.forEach(b.getLevelData(),function(b){b.name===a&&b.items.forEach(function(a,b){a.id===c&&(d=b)})}),d},h.getIdByOrder=function(a,c){var d=null;return angular.forEach(b.getLevelData(),function(b){b.name===a&&b.items.forEach(function(a,b){b===c&&(d=a.id)})}),d},h.getItemDetails=function(a,c){var d=null;return angular.forEach(b.getLevelData(),function(b){b.name===a&&(d=b.items[c])}),d},h.getLastItem=function(a){var c=null;return angular.forEach(b.getLevelData(),function(b){b.name===a&&(c=b.items[b.items.length-1])}),c},h.getNextItem=function(a,c){var d=null;return angular.forEach(b.getLevelData(),function(b){b.name===a&&b.items.forEach(function(a,e){a.id===c&&(d=b.items[e+1])})}),d},h.getItemInTime=function(a,c,d){var e=null,f=1/0,g=h.getItemFromLevelById(a,c);if(null!==g){var i=g.sampleStart||g.samplePoint;angular.forEach(b.getLevelData(),function(b){b.name===a&&b.items.forEach(function(a){var b=a.sampleStart||a.samplePoint;d?b>i&&b-i<=f&&(f=b-i,e=a):b=0&&c.push(a.labels[d].value)}),c},h.getLevelName=function(a){var c=null;return angular.forEach(b.getLevelData(),function(b){b.items.map(function(a){return a.id}).indexOf(a)>=0&&(c=b.name)}),c},h.getLevelAndItem=function(a){var b=h.getLevelName(a);return null!==b?{level:h.getLevelDetails(b),item:h.getItemByID(a)}:null},h.getItemByID=function(a){var c;return angular.forEach(b.getLevelData(),function(b){var d=b.items.map(function(a){return a.id}).indexOf(a);d>=0&&(c=b.items[d])}),c},h.getItemsFromLevelByIdAndLength=function(a,b,c){for(var d=[],e=b,f=0;f0&&(s=7*a.labels[m].value.length);var t="";a.labels.length>0&&(t=void 0!==a.labels[m]?a.labels[m].value:""),d.vals.restrictions.useLargeTextInputField?(f.largeTextFieldInputFieldVisable=!0,f.largeTextFieldInputFieldCurLabel=t):("SEGMENT"===c?(e=Math.floor(f.getPos(o,a.sampleStart)+p),i=Math.ceil(f.getPos(o,a.sampleStart+a.sampleDur+1)+p),h.createEditAreaElement(b,e,q,i-e,r,a.labels[m].value,a.id)):(e=f.getPos(o,a.samplePoint)+p-s/2,i=f.getPos(o,a.samplePoint)+p+s/2,j=i-e,j<2*s&&(j=2*s),h.createEditAreaElement(b,e,q,j,r,t,a.id)),h.createSelection(b.find("textarea")[0],0,t.length))},h.createSelection=function(a,b,c){if(a.createTextRange){var d=a.createTextRange();d.collapse(!0),d.moveStart("character",b),d.moveEnd("character",c),d.select()}else a.setSelectionRange?a.setSelectionRange(b,c):a.selectionStart&&(a.selectionStart=b,a.selectionEnd=c);a.focus()},h.createEditAreaElement=function(a,b,c,e,g,h,i){var j="_"+i,k={left:Math.round(b+2)+"px",top:Math.round(c+1)+"px",width:Math.round(e)-2+"px",height:Math.round(g)-20+"px","padding-top":Math.round(g/3+1)+"px"};void 0!==d.vals.perspectives[f.curPerspectiveIdx].levelCanvases.labelFontFamily&&(k["font-family"]=d.vals.perspectives[f.curPerspectiveIdx].levelCanvases.labelFontFamily),a.prepend($("',restrict:"E",replace:!0}}),angular.module("emuwebApp").run(["$templateCache",function(a){a.put("views/bundleListSideBar.html",'
{{filterText}}

    ▷{{key}}
    ▽{{key}}
    {{vs.currentPage+1}}/{{vs.numberOfPages(value.length)}}
    {{bundle.name}} \x3c!----\x3e \x3c!--regulate finished editing display--\x3e \x3c!--display checkbox if current--\x3e
    finished editing:
    \x3c!--display text "true" or "false" depending on model if not current--\x3e
    finished editing: true false

    \x3c!----\x3e \x3c!--regulate comment editing display--\x3e \x3c!--display text input if current--\x3e
    comment:
    comment: {{bundle.comment}}
    \x3c!----\x3e \x3c!--timeAnchors controlls--\x3e
    time anchor idx: {{vs.curTimeAnchorIdx}}
    {{vs.currentPage+1}}/{{vs.numberOfPages(value.length)}}
'),a.put("views/config/expert.html",'\x3c!-- main default configuration --\x3e

Expert Settings

{{key}}

 

Restrictions

{{key}}

 

Buttons

{{key}}

 

Label Settings

{{key}}


'), -a.put("views/config/perspectives.html",'\x3c!-- perspectives configuration --\x3e

Perspectives Settings

Signal Canvases
  • {{ $index + 1 }} : {{ item }}
add a new
 
Error : {{ warning }}

 
add new perspective


'),a.put("views/config/spectro.html",'\x3c!-- Spectrogram default configuration --\x3e

Spectrogram Settings

{{key}} first
r: g: b:
second
r: g: b:
third
r: g: b:

'),a.put("views/confirmModal.html",'

Confirm

{{dataIn}}
'),a.put("views/connectModal.html",'

Connect to Server

Please enter URL:
 

 

{{connectionError}}
'),a.put("views/deleteLevel.html",'

Delete Level

Really delete level "{{dataIn}}" ?

'),a.put("views/emuwebapp.html",'\x3c!-- container EMU-webApp start --\x3e
\x3c!-- start: modal --\x3e \x3c!-- end: modal --\x3e \x3c!-- start: hint --\x3e \x3c!-- end: hint --\x3e \x3c!-- start: left side menu bar --\x3e \x3c!-- end: left side menu bar --\x3e \x3c!-- start: main window --\x3e
EMU-webApp : {{lmds.getCurBndlName()}}
\x3c!-- start: top menu bar --\x3e
    • {{curDB}}
\x3c!-- top menu bar end --\x3e \x3c!-- vertical split layout that contains top and bottom pane --\x3e
\x3c!--
\n
\n
1
\n
\n
b1
b2
b3
\n
\n
\n
Two
\n
Three
\n
Four
\n
Five
\n
\n --\x3e
\x3c!-- end: vertical split layout --\x3e \x3c!-- start: bottom menu bar --\x3e
\x3c!-- end: bottom menu bar --\x3e \x3c!-- start: large text input field --\x3e \x3c!----\x3e \x3c!-- start: perspectives menu bar (right) --\x3e \x3c!-- end: perspectives menu bar (right) --\x3e
\x3c!-- end: main window --\x3e
\x3c!-- end: container EMU-webApp --\x3e'),a.put("views/EMUwebAppConfig/label.html",'\x3c!-- label configuration --\x3e
{{key}}

'),a.put("views/EMUwebAppConfig/main.html",'\x3c!-- main configuration --\x3e

Main Settings

\x3c!-- ///////////////////////////////////////////// --\x3e

Main Navigation Shortcuts

>
{{key}}


'),a.put("views/error.html",'

Error

{{dataIn}}
'),a.put("views/export.html",'

Download {{dataIn}}

Do you wish to download "{{dataIn}}" ?
{{modal.dataExport}}
'),a.put("views/help.html",'