var $StaticConstructors=[];var $StaticConstructor=function(f){$StaticConstructors.push(f)};if(typeof($Inherit)=='undefined'){var $Inherit=function(ce,ce2){if(typeof(Object.getOwnPropertyNames)=='undefined'){for(var p in ce2.prototype)if(typeof(ce.prototype[p])=='undefined'||ce.prototype[p]==Object.prototype[p])ce.prototype[p]=ce2.prototype[p];for(var p in ce2)if(typeof(ce[p])=='undefined')ce[p]=ce2[p];ce.$baseCtor=ce2}else{var props=Object.getOwnPropertyNames(ce2.prototype);for(var i=0;i=0&&track0){tracks.push(this.Score.Tracks[0])}return tracks.slice(0)},Load:function(data){try{if((data instanceof ArrayBuffer)){this.ScoreLoaded(AlphaTab.Importer.ScoreLoader.LoadScoreFromBytes(new Uint8Array(data)))}else if((data instanceof Uint8Array)){this.ScoreLoaded(AlphaTab.Importer.ScoreLoader.LoadScoreFromBytes(data))}else if(typeof(data)=="string"){AlphaTab.Importer.ScoreLoader.LoadScoreAsync(data,$CreateDelegate(this,this.ScoreLoaded),$CreateAnonymousDelegate(this,function(e){console.error(e)}))}}catch(e){console.error(e)}},Tex:function(contents){try{var parser=new AlphaTab.Importer.AlphaTexImporter();var data=AlphaTab.IO.ByteBuffer.FromBuffer(AlphaTab.Platform.Std.StringToByteArray(contents));parser.Init(data);this.ScoreLoaded(parser.ReadScore())}catch(e){console.error(e)}},SetTracks:function(tracksData,render){var tracks=[];if(typeof(tracksData)=="string"){try{tracksData=JSON.parse(tracksData)}catch($$e1){tracksData=new Int32Array([0])}}if(typeof(tracksData)=="number"){tracks.push(tracksData)}else if(tracksData.length){for(var i=0;i=0){tracks.push(value)}}}this._tracks=tracks.slice(0);if(render){this.Render()}},ScoreLoaded:function(score){this.Score=score;this.TriggerEvent("loaded",score);this.Render()},TriggerEvent:function(name,details){if(this._element!=null){var e=document.createEvent("CustomEvent");e.initCustomEvent(name,false,false,details);this._element.dispatchEvent(e)}},Render:function(){if(this.Renderer!=null){this.Renderer.RenderMultiple(this.get_Tracks())}}};AlphaTab.Platform.JavaScript.JsFileLoader=function(){};AlphaTab.Platform.JavaScript.JsFileLoader.prototype={LoadBinary:function(path){var ie=AlphaTab.Platform.JavaScript.JsFileLoader.GetIEVersion();if(ie>=0&&ie<=9){var vbArr=VbAjaxLoader("GET",path);var fileContents=vbArr.toArray();var data=new Array();var i=0;while(i<(fileContents.length-1)){data.push(String.fromCharCode((fileContents[i])));i++}var reader=AlphaTab.Platform.JavaScript.JsFileLoader.GetBytesFromString(data.join(''));return reader}var xhr=new XMLHttpRequest();xhr.open("GET",path,false);xhr.responseType="arraybuffer";xhr.send();if(xhr.status==200){var reader=new Uint8Array(xhr.response);return reader}if(xhr.status==0){throw $CreateException(new AlphaTab.IO.FileLoadException("You are offline!!\n Please Check Your Network."),new Error());}if(xhr.status==404){throw $CreateException(new AlphaTab.IO.FileLoadException("Requested URL not found."),new Error());}if(xhr.status==500){throw $CreateException(new AlphaTab.IO.FileLoadException("Internel Server Error."),new Error());}if(xhr.statusText=="parsererror"){throw $CreateException(new AlphaTab.IO.FileLoadException("Error.\nParsing JSON Request failed."),new Error());}if(xhr.statusText=="timeout"){throw $CreateException(new AlphaTab.IO.FileLoadException("Request Time out."),new Error());}throw $CreateException(new AlphaTab.IO.FileLoadException("Unknow Error: "+xhr.responseText),new Error());},LoadBinaryAsync:function(path,success,error){var ie=AlphaTab.Platform.JavaScript.JsFileLoader.GetIEVersion();if(ie>=0&&ie<=9){var vbArr=VbAjaxLoader("GET",path);var fileContents=vbArr.toArray();var data=new Array();var i=0;while(i<(fileContents.length-1)){data.push((fileContents[i]));i++}var reader=AlphaTab.Platform.JavaScript.JsFileLoader.GetBytesFromString(data.join(''));success(reader)}else{var xhr=new XMLHttpRequest();xhr.onreadystatechange=$CreateAnonymousDelegate(this,function(e){if(xhr.readyState==4){if(xhr.status==200){var reader=new Uint8Array(xhr.response);success(reader)}else if(xhr.status==0){error(new AlphaTab.IO.FileLoadException("You are offline!!\n Please Check Your Network."))}else if(xhr.status==404){error(new AlphaTab.IO.FileLoadException("Requested URL not found."))}else if(xhr.status==500){error(new AlphaTab.IO.FileLoadException("Internel Server Error."))}else if(xhr.statusText=="parsererror"){error(new AlphaTab.IO.FileLoadException("Error.\nParsing JSON Request failed."))}else if(xhr.statusText=="timeout"){error(new AlphaTab.IO.FileLoadException("Request Time out."))}else{error(new AlphaTab.IO.FileLoadException("Unknow Error: "+xhr.responseText))}}});xhr.open("GET",path,true);xhr.responseType="arraybuffer";xhr.send()}}};AlphaTab.Platform.JavaScript.JsFileLoader.GetIEVersion=function(){var rv=-1;var appName=navigator.appName;var agent=navigator.userAgent;if(appName=="Microsoft Internet Explorer"){var r=new RegExp("MSIE ([0-9]{1,}[\\.0-9]{0,})");var m=r.exec(agent);if(m!=null){rv=AlphaTab.Platform.Std.ParseFloat(m[1])}}return rv};AlphaTab.Platform.JavaScript.JsFileLoader.GetBytesFromString=function(s){var b=new Uint8Array(s.length);for(var i=0;i=128)return(n-256);return n};AlphaTab.Platform.Std.ToString=function(data){var s=new Array();var i=0;while(i128){c2=data[i];gbstring=gb2312text.slice((c-176+15),(c-176+15)+1);gbstring=""+gbstring;gbstring=gbstring.substr((c2-161),1);s.push(gbstring);i++}else if(c<224){s.push(String.fromCharCode(((c&63)<<6)|(data[i++]&127)))}else if(c<240){s.push(String.fromCharCode(((c&31)<<12)|((data[i++]&127)<<6)|(data[i++]&127)))}else{var u=((c&15)<<18)|((data[i++]&127)<<12)|((data[i++]&127)<<6)|(data[i++]&127);s.push(String.fromCharCode((u>>18)+55232));s.push(String.fromCharCode((u&1023)|56320))}}return s.join('')};AlphaTab.Platform.Std.StringToByteArray=function(contents){var byteArray=new Uint8Array(contents.length);for(var i=0;i=48&&c<=57)};AlphaTab.Platform.Std.IsWhiteSpace=function(c){return c==32||c==11||c==13||c==10};AlphaTab.Platform.Std.ToHexString=function(n){var s="";var hexChars="0123456789ABCDEF";do{s=String.fromCharCode(hexChars.charCodeAt((n&15)))+s;n>>=4}while(n>0)return s};AlphaTab.Settings=function(){this.Scale=0;this.Width=0;this.Height=0;this.Engine=null;this.Layout=null;this.Staves=null};AlphaTab.Settings.FromJson=function(json){if((json instanceof AlphaTab.Settings)){return json}var settings=AlphaTab.Settings.get_Defaults();if(!json)return settings;if("scale"in json)settings.Scale=json.scale;if("width"in json)settings.Width=json.width;if("height"in json)settings.Height=json.height;if("engine"in json)settings.Engine=json.engine;if("layout"in json){if(typeof(json.layout)=="string"){settings.Layout.Mode=json.layout}else{if(json.layout.mode)settings.Layout.Mode=json.layout.mode;if(json.layout.additionalSettings){var keys=Object.keys(json.layout.additionalSettings);for(var $i6=0,$l6=keys.length,key=keys[$i6];$i6<$l6;$i6++,key=keys[$i6]){settings.Layout.AdditionalSettings[key]=json.layout.additionalSettings[key]}}}}if("staves"in json){settings.Staves=[];var keys=Object.keys(json.staves);for(var $i7=0,$l7=keys.length,key=keys[$i7];$i7<$l7;$i7++,key=keys[$i7]){var val=json.staves[key];if(typeof(val)=="string"){settings.Staves.push(new AlphaTab.StaveSettings(val))}else{if(val.id){var staveSettings=new AlphaTab.StaveSettings(val.id);if(val.additionalSettings){var keys2=Object.keys(val.additionalSettings);for(var $i8=0,$l8=keys2.length,key2=keys2[$i8];$i8<$l8;$i8++,key2=keys2[$i8]){staveSettings.AdditionalSettings[key2]=val.additionalSettings[key2]}}settings.Staves.push(staveSettings)}}}}return settings};AlphaTab.Settings.get_Defaults=function(){var settings=new AlphaTab.Settings();settings.Scale=1;settings.Width=600;settings.Height=200;settings.Engine="default";settings.Layout=AlphaTab.LayoutSettings.get_Defaults();settings.Staves=[];settings.Staves.push(new AlphaTab.StaveSettings("marker"));settings.Staves.push(new AlphaTab.StaveSettings("tempo"));settings.Staves.push(new AlphaTab.StaveSettings("text"));settings.Staves.push(new AlphaTab.StaveSettings("chords"));settings.Staves.push(new AlphaTab.StaveSettings("trill"));settings.Staves.push(new AlphaTab.StaveSettings("beat-vibrato"));settings.Staves.push(new AlphaTab.StaveSettings("note-vibrato"));settings.Staves.push(new AlphaTab.StaveSettings("alternate-endings"));settings.Staves.push(new AlphaTab.StaveSettings("score"));settings.Staves.push(new AlphaTab.StaveSettings("crescendo"));settings.Staves.push(new AlphaTab.StaveSettings("dynamics"));settings.Staves.push(new AlphaTab.StaveSettings("trill"));settings.Staves.push(new AlphaTab.StaveSettings("beat-vibrato"));settings.Staves.push(new AlphaTab.StaveSettings("note-vibrato"));settings.Staves.push(new AlphaTab.StaveSettings("tap"));settings.Staves.push(new AlphaTab.StaveSettings("fade-in"));settings.Staves.push(new AlphaTab.StaveSettings("let-ring"));settings.Staves.push(new AlphaTab.StaveSettings("palm-mute"));settings.Staves.push(new AlphaTab.StaveSettings("tab"));settings.Staves.push(new AlphaTab.StaveSettings("pick-stroke"));return settings};AlphaTab.Audio=AlphaTab.Audio||{};AlphaTab.Audio.GeneralMidi=function(){};$StaticConstructor(function(){AlphaTab.Audio.GeneralMidi._values=null});AlphaTab.Audio.GeneralMidi.GetValue=function(name){if(AlphaTab.Audio.GeneralMidi._values==null){AlphaTab.Audio.GeneralMidi._values={};AlphaTab.Audio.GeneralMidi._values["acousticgrandpiano"]=0;AlphaTab.Audio.GeneralMidi._values["brightacousticpiano"]=1;AlphaTab.Audio.GeneralMidi._values["electricgrandpiano"]=2;AlphaTab.Audio.GeneralMidi._values["honkytonkpiano"]=3;AlphaTab.Audio.GeneralMidi._values["electricpiano1"]=4;AlphaTab.Audio.GeneralMidi._values["electricpiano2"]=5;AlphaTab.Audio.GeneralMidi._values["harpsichord"]=6;AlphaTab.Audio.GeneralMidi._values["clavinet"]=7;AlphaTab.Audio.GeneralMidi._values["celesta"]=8;AlphaTab.Audio.GeneralMidi._values["glockenspiel"]=9;AlphaTab.Audio.GeneralMidi._values["musicbox"]=10;AlphaTab.Audio.GeneralMidi._values["vibraphone"]=11;AlphaTab.Audio.GeneralMidi._values["marimba"]=12;AlphaTab.Audio.GeneralMidi._values["xylophone"]=13;AlphaTab.Audio.GeneralMidi._values["tubularbells"]=14;AlphaTab.Audio.GeneralMidi._values["dulcimer"]=15;AlphaTab.Audio.GeneralMidi._values["drawbarorgan"]=16;AlphaTab.Audio.GeneralMidi._values["percussiveorgan"]=17;AlphaTab.Audio.GeneralMidi._values["rockorgan"]=18;AlphaTab.Audio.GeneralMidi._values["churchorgan"]=19;AlphaTab.Audio.GeneralMidi._values["reedorgan"]=20;AlphaTab.Audio.GeneralMidi._values["accordion"]=21;AlphaTab.Audio.GeneralMidi._values["harmonica"]=22;AlphaTab.Audio.GeneralMidi._values["tangoaccordion"]=23;AlphaTab.Audio.GeneralMidi._values["acousticguitarnylon"]=24;AlphaTab.Audio.GeneralMidi._values["acousticguitarsteel"]=25;AlphaTab.Audio.GeneralMidi._values["electricguitarjazz"]=26;AlphaTab.Audio.GeneralMidi._values["electricguitarclean"]=27;AlphaTab.Audio.GeneralMidi._values["electricguitarmuted"]=28;AlphaTab.Audio.GeneralMidi._values["overdrivenguitar"]=29;AlphaTab.Audio.GeneralMidi._values["distortionguitar"]=30;AlphaTab.Audio.GeneralMidi._values["guitarharmonics"]=31;AlphaTab.Audio.GeneralMidi._values["acousticbass"]=32;AlphaTab.Audio.GeneralMidi._values["electricbassfinger"]=33;AlphaTab.Audio.GeneralMidi._values["electricbasspick"]=34;AlphaTab.Audio.GeneralMidi._values["fretlessbass"]=35;AlphaTab.Audio.GeneralMidi._values["slapbass1"]=36;AlphaTab.Audio.GeneralMidi._values["slapbass2"]=37;AlphaTab.Audio.GeneralMidi._values["synthbass1"]=38;AlphaTab.Audio.GeneralMidi._values["synthbass2"]=39;AlphaTab.Audio.GeneralMidi._values["violin"]=40;AlphaTab.Audio.GeneralMidi._values["viola"]=41;AlphaTab.Audio.GeneralMidi._values["cello"]=42;AlphaTab.Audio.GeneralMidi._values["contrabass"]=43;AlphaTab.Audio.GeneralMidi._values["tremolostrings"]=44;AlphaTab.Audio.GeneralMidi._values["pizzicatostrings"]=45;AlphaTab.Audio.GeneralMidi._values["orchestralharp"]=46;AlphaTab.Audio.GeneralMidi._values["timpani"]=47;AlphaTab.Audio.GeneralMidi._values["stringensemble1"]=48;AlphaTab.Audio.GeneralMidi._values["stringensemble2"]=49;AlphaTab.Audio.GeneralMidi._values["synthstrings1"]=50;AlphaTab.Audio.GeneralMidi._values["synthstrings2"]=51;AlphaTab.Audio.GeneralMidi._values["choiraahs"]=52;AlphaTab.Audio.GeneralMidi._values["voiceoohs"]=53;AlphaTab.Audio.GeneralMidi._values["synthvoice"]=54;AlphaTab.Audio.GeneralMidi._values["orchestrahit"]=55;AlphaTab.Audio.GeneralMidi._values["trumpet"]=56;AlphaTab.Audio.GeneralMidi._values["trombone"]=57;AlphaTab.Audio.GeneralMidi._values["tuba"]=58;AlphaTab.Audio.GeneralMidi._values["mutedtrumpet"]=59;AlphaTab.Audio.GeneralMidi._values["frenchhorn"]=60;AlphaTab.Audio.GeneralMidi._values["brasssection"]=61;AlphaTab.Audio.GeneralMidi._values["synthbrass1"]=62;AlphaTab.Audio.GeneralMidi._values["synthbrass2"]=63;AlphaTab.Audio.GeneralMidi._values["sopranosax"]=64;AlphaTab.Audio.GeneralMidi._values["altosax"]=65;AlphaTab.Audio.GeneralMidi._values["tenorsax"]=66;AlphaTab.Audio.GeneralMidi._values["baritonesax"]=67;AlphaTab.Audio.GeneralMidi._values["oboe"]=68;AlphaTab.Audio.GeneralMidi._values["englishhorn"]=69;AlphaTab.Audio.GeneralMidi._values["bassoon"]=70;AlphaTab.Audio.GeneralMidi._values["clarinet"]=71;AlphaTab.Audio.GeneralMidi._values["piccolo"]=72;AlphaTab.Audio.GeneralMidi._values["flute"]=73;AlphaTab.Audio.GeneralMidi._values["recorder"]=74;AlphaTab.Audio.GeneralMidi._values["panflute"]=75;AlphaTab.Audio.GeneralMidi._values["blownbottle"]=76;AlphaTab.Audio.GeneralMidi._values["shakuhachi"]=77;AlphaTab.Audio.GeneralMidi._values["whistle"]=78;AlphaTab.Audio.GeneralMidi._values["ocarina"]=79;AlphaTab.Audio.GeneralMidi._values["lead1square"]=80;AlphaTab.Audio.GeneralMidi._values["lead2sawtooth"]=81;AlphaTab.Audio.GeneralMidi._values["lead3calliope"]=82;AlphaTab.Audio.GeneralMidi._values["lead4chiff"]=83;AlphaTab.Audio.GeneralMidi._values["lead5charang"]=84;AlphaTab.Audio.GeneralMidi._values["lead6voice"]=85;AlphaTab.Audio.GeneralMidi._values["lead7fifths"]=86;AlphaTab.Audio.GeneralMidi._values["lead8bassandlead"]=87;AlphaTab.Audio.GeneralMidi._values["pad1newage"]=88;AlphaTab.Audio.GeneralMidi._values["pad2warm"]=89;AlphaTab.Audio.GeneralMidi._values["pad3polysynth"]=90;AlphaTab.Audio.GeneralMidi._values["pad4choir"]=91;AlphaTab.Audio.GeneralMidi._values["pad5bowed"]=92;AlphaTab.Audio.GeneralMidi._values["pad6metallic"]=93;AlphaTab.Audio.GeneralMidi._values["pad7halo"]=94;AlphaTab.Audio.GeneralMidi._values["pad8sweep"]=95;AlphaTab.Audio.GeneralMidi._values["fx1rain"]=96;AlphaTab.Audio.GeneralMidi._values["fx2soundtrack"]=97;AlphaTab.Audio.GeneralMidi._values["fx3crystal"]=98;AlphaTab.Audio.GeneralMidi._values["fx4atmosphere"]=99;AlphaTab.Audio.GeneralMidi._values["fx5brightness"]=100;AlphaTab.Audio.GeneralMidi._values["fx6goblins"]=101;AlphaTab.Audio.GeneralMidi._values["fx7echoes"]=102;AlphaTab.Audio.GeneralMidi._values["fx8scifi"]=103;AlphaTab.Audio.GeneralMidi._values["sitar"]=104;AlphaTab.Audio.GeneralMidi._values["banjo"]=105;AlphaTab.Audio.GeneralMidi._values["shamisen"]=106;AlphaTab.Audio.GeneralMidi._values["koto"]=107;AlphaTab.Audio.GeneralMidi._values["kalimba"]=108;AlphaTab.Audio.GeneralMidi._values["bagpipe"]=109;AlphaTab.Audio.GeneralMidi._values["fiddle"]=110;AlphaTab.Audio.GeneralMidi._values["shanai"]=111;AlphaTab.Audio.GeneralMidi._values["tinklebell"]=112;AlphaTab.Audio.GeneralMidi._values["agogo"]=113;AlphaTab.Audio.GeneralMidi._values["steeldrums"]=114;AlphaTab.Audio.GeneralMidi._values["woodblock"]=115;AlphaTab.Audio.GeneralMidi._values["taikodrum"]=116;AlphaTab.Audio.GeneralMidi._values["melodictom"]=117;AlphaTab.Audio.GeneralMidi._values["synthdrum"]=118;AlphaTab.Audio.GeneralMidi._values["reversecymbal"]=119;AlphaTab.Audio.GeneralMidi._values["guitarfretnoise"]=120;AlphaTab.Audio.GeneralMidi._values["breathnoise"]=121;AlphaTab.Audio.GeneralMidi._values["seashore"]=122;AlphaTab.Audio.GeneralMidi._values["birdtweet"]=123;AlphaTab.Audio.GeneralMidi._values["telephonering"]=124;AlphaTab.Audio.GeneralMidi._values["helicopter"]=125;AlphaTab.Audio.GeneralMidi._values["applause"]=126;AlphaTab.Audio.GeneralMidi._values["gunshot"]=127}name=name.toLowerCase().replace(" ","");return AlphaTab.Audio.GeneralMidi._values.hasOwnProperty(name)?AlphaTab.Audio.GeneralMidi._values[name]:0};AlphaTab.Audio.Generator=AlphaTab.Audio.Generator||{};AlphaTab.Audio.Generator.MidiFileGenerator=function(score,handler,generateMetronome){this._score=null;this._handler=null;this._currentTempo=0;this.GenerateMetronome=false;this._score=score;this._currentTempo=this._score.Tempo;this._handler=handler;this.GenerateMetronome=generateMetronome};AlphaTab.Audio.Generator.MidiFileGenerator.prototype={Generate:function(){for(var i=0,j=this._score.Tracks.length;i=(noteStart+noteDuration)){trillLength=(noteStart+noteDuration)-tick}this._handler.AddNote(track.Index,tick,trillLength,(realKey?trillKey:noteKey),dynamicValue,track.PlaybackInfo.PrimaryChannel);realKey=!realKey;tick+=trillLength}},GenerateTremoloPicking:function(note,noteStart,noteDuration,noteKey,dynamicValue){var track=note.Beat.Voice.Bar.Track;var tpLength=AlphaTab.Audio.MidiUtils.ToTicks(note.Beat.TremoloSpeed);var tick=noteStart;while(tick+10<(noteStart+noteDuration)){if((tick+tpLength)>=(noteStart+noteDuration)){tpLength=(noteStart+noteDuration)-tick}this._handler.AddNote(track.Index,tick,tpLength,noteKey,dynamicValue,track.PlaybackInfo.PrimaryChannel);tick+=tpLength}},GetBrushInfo:function(beat){var brushInfo=new Int32Array(beat.Voice.Bar.Track.Tuning.length);if(beat.BrushType!=AlphaTab.Model.BrushType.None){var stringUsed=0;for(var i=0,j=beat.Notes.length;i0){var brushMove=0;var brushIncrement=this.GetBrushIncrement(beat);for(var i=0,j=beat.Voice.Bar.Track.Tuning.length;i>1))>0){denominatorIndex++}this.AddEvent(this._midiFile.InfoTrack,tick,AlphaTab.Audio.Generator.MidiFileHandler.BuildMetaMessage(88,new Uint8Array([(timeSignatureNumerator&255),(denominatorIndex&255),48,8])))},AddRest:function(track,tick,channel){this.AddEvent(track,tick,AlphaTab.Audio.Generator.MidiFileHandler.BuildSysExMessage(new Uint8Array([0])))},AddNote:function(track,start,length,key,dynamicValue,channel){var velocity=AlphaTab.Audio.MidiUtils.DynamicToVelocity(dynamicValue);this.AddEvent(track,start,new AlphaTab.Audio.Model.MidiMessage(new Uint8Array([this.MakeCommand(144,channel),AlphaTab.Audio.Generator.MidiFileHandler.FixValue(key),AlphaTab.Audio.Generator.MidiFileHandler.FixValue(velocity)])));this.AddEvent(track,start+length,new AlphaTab.Audio.Model.MidiMessage(new Uint8Array([this.MakeCommand(128,channel),AlphaTab.Audio.Generator.MidiFileHandler.FixValue(key),AlphaTab.Audio.Generator.MidiFileHandler.FixValue(velocity)])))},AddControlChange:function(track,tick,channel,controller,value){this.AddEvent(track,tick,new AlphaTab.Audio.Model.MidiMessage(new Uint8Array([this.MakeCommand(176,channel),AlphaTab.Audio.Generator.MidiFileHandler.FixValue(controller),AlphaTab.Audio.Generator.MidiFileHandler.FixValue(value)])))},AddProgramChange:function(track,tick,channel,program){this.AddEvent(track,tick,new AlphaTab.Audio.Model.MidiMessage(new Uint8Array([this.MakeCommand(192,channel),AlphaTab.Audio.Generator.MidiFileHandler.FixValue(program)])))},AddTempo:function(tick,tempo){var tempoInUsq=((60000000/tempo)|0);this.AddEvent(this._midiFile.InfoTrack,tick,AlphaTab.Audio.Generator.MidiFileHandler.BuildMetaMessage(81,new Uint8Array([((tempoInUsq>>16)&255),((tempoInUsq>>8)&255),(tempoInUsq&255)])))},AddBend:function(track,tick,channel,value){this.AddEvent(track,tick,new AlphaTab.Audio.Model.MidiMessage(new Uint8Array([this.MakeCommand(224,channel),0,AlphaTab.Audio.Generator.MidiFileHandler.FixValue(value)])))},AddMetronome:function(start,length){if(this._metronomeTrack==-1){this._midiFile.CreateTrack();this._metronomeTrack=this._midiFile.Tracks.length-1}this.AddNote(this._metronomeTrack,start,length,37,AlphaTab.Model.DynamicValue.F,9)}};$StaticConstructor(function(){AlphaTab.Audio.Generator.MidiFileHandler.DefaultMetronomeKey=37;AlphaTab.Audio.Generator.MidiFileHandler.DefaultDurationDead=30;AlphaTab.Audio.Generator.MidiFileHandler.DefaultDurationPalmMute=80;AlphaTab.Audio.Generator.MidiFileHandler.RestMessage=0});AlphaTab.Audio.Generator.MidiFileHandler.FixValue=function(value){if(value>127)return 127;return value};AlphaTab.Audio.Generator.MidiFileHandler.BuildMetaMessage=function(metaType,data){var meta=AlphaTab.IO.ByteBuffer.Empty();meta.WriteByte(255);meta.WriteByte((metaType&255));AlphaTab.Audio.Generator.MidiFileHandler.WriteVarInt(meta,data.length);meta.Write(data,0,data.length);return new AlphaTab.Audio.Model.MidiMessage(meta.ToArray())};AlphaTab.Audio.Generator.MidiFileHandler.WriteVarInt=function(data,v){var n=0;var array=new Uint8Array(4);do{array[n++]=((v&127)&255);v>>=7}while(v>0)while(n>0){n--;if(n>0)data.WriteByte(((array[n]|128)&255));else data.WriteByte(array[n])}};AlphaTab.Audio.Generator.MidiFileHandler.BuildSysExMessage=function(data){var sysex=AlphaTab.IO.ByteBuffer.Empty();sysex.WriteByte(240);AlphaTab.Audio.Generator.MidiFileHandler.WriteVarInt(sysex,data.length+2);sysex.WriteByte(0);sysex.Write(data,0,data.length);sysex.WriteByte(247);return new AlphaTab.Audio.Model.MidiMessage(sysex.ToArray())};AlphaTab.Audio.Generator.MidiPlaybackController=function(score){this._score=null;this._lastIndex=0;this._repeatAlternative=0;this._repeatStart=0;this._repeatStartIndex=0;this._repeatNumber=0;this._repeatEnd=0;this._repeatOpen=false;this.ShouldPlay=false;this.RepeatMove=0;this.Index=0;this._score=score;this.ShouldPlay=true;this.RepeatMove=0;this.Index=0};AlphaTab.Audio.Generator.MidiPlaybackController.prototype={get_Finished:function(){return this.Index>=this._score.MasterBars.length},Process:function(){var masterBar=this._score.MasterBars[this.Index];if(!masterBar.RepeatGroup.IsClosed&&masterBar.RepeatGroup.Openings[masterBar.RepeatGroup.Openings.length-1]==masterBar){this._repeatStart=0;this._repeatNumber=0;this._repeatEnd=0;this._repeatOpen=false}if(masterBar.IsRepeatStart){this._repeatStartIndex=this.Index;this._repeatStart=masterBar.Start;this._repeatOpen=true;if(this.Index>this._lastIndex){this._repeatNumber=0;this._repeatAlternative=0}}else{if(this._repeatAlternative==0){this._repeatAlternative=masterBar.AlternateEndings}if((this._repeatOpen&&(this._repeatAlternative>0))&&((this._repeatAlternative&(1<0){this._repeatAlternative=0}this.ShouldPlay=false;this.Index++;return}}this._lastIndex=Math.max(this._lastIndex,this.Index);if(this._repeatOpen&&(masterBar.RepeatCount>0)){if((this._repeatNumber0)){this._repeatEnd=masterBar.Start+masterBar.CalculateDuration();this.RepeatMove+=this._repeatEnd-this._repeatStart;this.Index=this._repeatStartIndex-1;this._repeatNumber++}else{this._repeatStart=0;this._repeatNumber=0;this._repeatEnd=0;this._repeatOpen=false}this._repeatAlternative=0}this.Index++}};AlphaTab.Audio.MidiUtils=function(){};$StaticConstructor(function(){AlphaTab.Audio.MidiUtils.QuarterTime=960;AlphaTab.Audio.MidiUtils.PercussionChannel=9;AlphaTab.Audio.MidiUtils.MinVelocity=15;AlphaTab.Audio.MidiUtils.VelocityIncrement=16});AlphaTab.Audio.MidiUtils.ToTicks=function(duration){return AlphaTab.Audio.MidiUtils.ValueToTicks(duration)};AlphaTab.Audio.MidiUtils.ValueToTicks=function(duration){return((960*(4/duration)))|0};AlphaTab.Audio.MidiUtils.ApplyDot=function(ticks,doubleDotted){if(doubleDotted){return ticks+((ticks/4)|0)*3}return ticks+(ticks/2)|0};AlphaTab.Audio.MidiUtils.ApplyTuplet=function(ticks,numerator,denominator){return(ticks*denominator/numerator)|0};AlphaTab.Audio.MidiUtils.DynamicToVelocity=function(dyn){return(15+((dyn)*16))};AlphaTab.Audio.MidiUtils.BuildTickLookup=function(score){var lookup=new AlphaTab.Audio.Model.MidiTickLookup();var controller=new AlphaTab.Audio.Generator.MidiPlaybackController(score);while(!controller.get_Finished()){var index=controller.Index;controller.Process();if(controller.ShouldPlay){var bar=new AlphaTab.Audio.Model.BarTickLookup();bar.Bar=score.MasterBars[index];bar.Start=controller.RepeatMove+bar.Bar.Start;bar.End=bar.Start+bar.Bar.CalculateDuration();lookup.Bars.push(bar)}}return lookup};AlphaTab.Audio.Model=AlphaTab.Audio.Model||{};AlphaTab.Audio.Model.MidiController={AllNotesOff:123,Balance:10,Chorus:93,DataEntryLsb:38,DataEntryMsb:6,Expression:11,Phaser:95,Reverb:91,RpnLsb:100,RpnMsb:101,Tremolo:92,Volume:7};AlphaTab.Audio.Model.MidiEvent=function(tick,message){this.Track=null;this.Tick=0;this.Message=null;this.NextEvent=null;this.PreviousEvent=null;this.Tick=tick;this.Message=message};AlphaTab.Audio.Model.MidiEvent.prototype={get_DeltaTicks:function(){return this.PreviousEvent==null?0:this.Tick-this.PreviousEvent.Tick},WriteTo:function(s){this.WriteVariableInt(s,this.get_DeltaTicks());this.Message.WriteTo(s)},WriteVariableInt:function(s,value){var array=new Uint8Array(4);var n=0;do{array[n++]=((value&127)&255);value>>=7}while(value>0)while(n>0){n--;if(n>0)s.WriteByte((array[n]|128));else s.WriteByte(array[n])}}};AlphaTab.Audio.Model.MidiFile=function(){this.Tracks=null;this.InfoTrack=0;this.Tracks=[]};AlphaTab.Audio.Model.MidiFile.prototype={CreateTrack:function(){var track=new AlphaTab.Audio.Model.MidiTrack();track.Index=this.Tracks.length;track.File=this;this.Tracks.push(track);return track},WriteTo:function(s){var b;b=new Uint8Array([77,84,104,100]);s.Write(b,0,b.length);b=new Uint8Array([0,0,0,6]);s.Write(b,0,b.length);b=new Uint8Array([0,1]);s.Write(b,0,b.length);var v=(this.Tracks.length)|0;b=new Uint8Array([((v>>8)&255),(v&255)]);s.Write(b,0,b.length);v=960;b=new Uint8Array([((v>>8)&255),(v&255)]);s.Write(b,0,b.length);for(var i=0,j=this.Tracks.length;i=this._lastBeat.Start&&tick=this._lastBeat.NextBeat.Start&&tick=bar.Start&&tick<=bar.End){return bar}if(ticke.Tick){e.NextEvent=this.FirstEvent;this.FirstEvent.PreviousEvent=e;this.FirstEvent=e}else{var firstDelta=e.Tick-this.FirstEvent.Tick;var lastDelta=this.LastEvent.Tick-e.Tick;if(firstDeltae.Tick){next=next.PreviousEvent}if(next==null)return;var previous=next.PreviousEvent;next.PreviousEvent=e;e.NextEvent=next;e.PreviousEvent=previous;if(previous!=null){previous.NextEvent=e}else{this.FirstEvent=e}}}}},WriteTo:function(s){var trackData=AlphaTab.IO.ByteBuffer.Empty();var current=this.FirstEvent;var count=0;while(current!=null){current.WriteTo(trackData);current=current.NextEvent;count++}var b=new Uint8Array([77,84,114,107]);s.Write(b,0,b.length);var data=trackData.ToArray();var l=data.length;b=new Uint8Array([((l>>24)&255),((l>>16)&255),((l>>8)&255),((l>>0)&255)]);s.Write(b,0,b.length);s.Write(data,0,data.length)}};AlphaTab.Importer=AlphaTab.Importer||{};AlphaTab.Importer.AlphaTexException=function(position,nonTerm,expected,symbol,symbolData){this.Position=0;this.NonTerm=null;this.Expected=AlphaTab.Importer.AlphaTexSymbols.No;this.Symbol=AlphaTab.Importer.AlphaTexSymbols.No;this.SymbolData=null;this.Position=position;this.NonTerm=nonTerm;this.Expected=expected;this.Symbol=symbol;this.SymbolData=symbolData};AlphaTab.Importer.AlphaTexException.prototype={get_Message:function(){if(this.SymbolData==null){return this.Position+": Error on block "+this.NonTerm+", expected a "+this.Expected+" found a "+this.Symbol}return this.Position+": Error on block "+this.NonTerm+", invalid value: "+this.SymbolData}};AlphaTab.Importer.ScoreImporter=function(){this._data=null};AlphaTab.Importer.ScoreImporter.prototype={Init:function(data){this._data=data}};AlphaTab.Importer.ScoreImporter.BuildImporters=function(){return[new AlphaTab.Importer.Gp3To5Importer(),new AlphaTab.Importer.GpxImporter(),new AlphaTab.Importer.AlphaTexImporter()]};AlphaTab.Importer.AlphaTexImporter=function(){this._score=null;this._track=null;this._ch=0;this._curChPos=0;this._sy=AlphaTab.Importer.AlphaTexSymbols.No;this._syData=null;this._allowNegatives=false;this._currentDuration=AlphaTab.Model.Duration.Whole;AlphaTab.Importer.ScoreImporter.call(this)};AlphaTab.Importer.AlphaTexImporter.prototype={ReadScore:function(){try{this.CreateDefaultScore();this._curChPos=0;this._currentDuration=AlphaTab.Model.Duration.Quarter;this.NextChar();this.NewSy();this.Score();this._score.Finish();return this._score}catch($$e2){throw $CreateException(new AlphaTab.Importer.UnsupportedFormatException(),new Error());}},Error:function(nonterm,expected,symbolError){if(symbolError){throw $CreateException(new AlphaTab.Importer.AlphaTexException(this._curChPos,nonterm,expected,this._sy,null),new Error());}throw $CreateException(new AlphaTab.Importer.AlphaTexException(this._curChPos,nonterm,expected,expected,(this._syData)),new Error());},CreateDefaultScore:function(){this._score=new AlphaTab.Model.Score();this._score.Tempo=120;this._score.TempoLabel="";this._track=new AlphaTab.Model.Track();this._track.PlaybackInfo.Program=25;this._track.PlaybackInfo.PrimaryChannel=AlphaTab.Importer.AlphaTexImporter.TrackChannels[0];this._track.PlaybackInfo.SecondaryChannel=AlphaTab.Importer.AlphaTexImporter.TrackChannels[1];this._track.Tuning=AlphaTab.Model.Tuning.GetDefaultTuningFor(6).Tunings;this._score.AddTrack(this._track)},ParseClef:function(str){switch(str.toLowerCase()){case"g2":case"treble":return AlphaTab.Model.Clef.G2;case"f4":case"bass":return AlphaTab.Model.Clef.F4;case"c3":case"tenor":return AlphaTab.Model.Clef.C3;case"c4":case"alto":return AlphaTab.Model.Clef.C4;default:return AlphaTab.Model.Clef.G2}},ParseKeySignature:function(str){switch(str.toLowerCase()){case"cb":return-7;case"gb":return-6;case"db":return-5;case"ab":return-4;case"eb":return-3;case"bb":return-2;case"f":return-1;case"c":return 0;case"g":return 1;case"d":return 2;case"a":return 3;case"e":return 4;case"b":return 5;case"f#":return 6;case"c#":return 7;default:return 0}},ParseTuning:function(str){var tuning=AlphaTab.Model.TuningParser.GetTuningForText(str);if(tuning<0){this.Error("tuning-value",AlphaTab.Importer.AlphaTexSymbols.String,false)}return tuning},NextChar:function(){var b=this._data.ReadByte();if(b==-1){this._ch=0}else{this._ch=b;this._curChPos++}},NewSy:function(){this._sy=AlphaTab.Importer.AlphaTexSymbols.No;do{if(this._ch==0){this._sy=AlphaTab.Importer.AlphaTexSymbols.Eof}else if(AlphaTab.Platform.Std.IsWhiteSpace(this._ch)){this.NextChar()}else if(this._ch==47){this.NextChar();if(this._ch==47){while(this._ch!=13&&this._ch!=10&&this._ch!=0){this.NextChar()}}else if(this._ch==42){while(this._ch!=0){if(this._ch==42){this.NextChar();if(this._ch==47){this.NextChar();break}}else{this.NextChar()}}}else{this.Error("symbol",AlphaTab.Importer.AlphaTexSymbols.String,false)}}else if(this._ch==34||this._ch==39){this.NextChar();var s=new Array();this._sy=AlphaTab.Importer.AlphaTexSymbols.String;while(this._ch!=34&&this._ch!=39&&this._ch!=0){s.push(String.fromCharCode(this._ch));this.NextChar()}(this._syData)=s;this.NextChar()}else if(this._ch==45){if(this._allowNegatives&&this.IsDigit(this._ch)){var number=this.ReadNumber();this._sy=AlphaTab.Importer.AlphaTexSymbols.Number;(this._syData)=number}else{this._sy=AlphaTab.Importer.AlphaTexSymbols.String;(this._syData)=this.ReadName()}}else if(this._ch==46){this._sy=AlphaTab.Importer.AlphaTexSymbols.Dot;this.NextChar()}else if(this._ch==58){this._sy=AlphaTab.Importer.AlphaTexSymbols.DoubleDot;this.NextChar()}else if(this._ch==40){this._sy=AlphaTab.Importer.AlphaTexSymbols.LParensis;this.NextChar()}else if(this._ch==92){this.NextChar();var name=this.ReadName();this._sy=AlphaTab.Importer.AlphaTexSymbols.MetaCommand;(this._syData)=name}else if(this._ch==41){this._sy=AlphaTab.Importer.AlphaTexSymbols.RParensis;this.NextChar()}else if(this._ch==123){this._sy=AlphaTab.Importer.AlphaTexSymbols.LBrace;this.NextChar()}else if(this._ch==125){this._sy=AlphaTab.Importer.AlphaTexSymbols.RBrace;this.NextChar()}else if(this._ch==122){this._sy=AlphaTab.Importer.AlphaTexSymbols.Pipe;this.NextChar()}else if(this._ch==42){this._sy=AlphaTab.Importer.AlphaTexSymbols.Multiply;this.NextChar()}else if(this.IsDigit(this._ch)){var number=this.ReadNumber();this._sy=AlphaTab.Importer.AlphaTexSymbols.Number;(this._syData)=number}else if(AlphaTab.Importer.AlphaTexImporter.IsLetter(this._ch)){var name=this.ReadName();if(AlphaTab.Model.TuningParser.IsTuning(name)){this._sy=AlphaTab.Importer.AlphaTexSymbols.Tuning;(this._syData)=name.toLowerCase()}else{this._sy=AlphaTab.Importer.AlphaTexSymbols.String;(this._syData)=name}}else{this.Error("symbol",AlphaTab.Importer.AlphaTexSymbols.String,false)}}while(this._sy==AlphaTab.Importer.AlphaTexSymbols.No)},IsDigit:function(code){return(code>=48&&code<=57)||(code==45&&this._allowNegatives)},ReadName:function(){var str=new Array();do{str.push(String.fromCharCode(this._ch));this.NextChar()}while(AlphaTab.Importer.AlphaTexImporter.IsLetter(this._ch)||this.IsDigit(this._ch))return str.join('')},ReadNumber:function(){var str=new Array();do{str.push(String.fromCharCode(this._ch));this.NextChar()}while(this.IsDigit(this._ch))return AlphaTab.Platform.Std.ParseInt(str.join(''))},Score:function(){this.MetaData();this.Bars()},MetaData:function(){var anyMeta=false;while(this._sy==AlphaTab.Importer.AlphaTexSymbols.MetaCommand){if((this._syData)=="title"){this.NewSy();if(this._sy==AlphaTab.Importer.AlphaTexSymbols.String){this._score.Title=(this._syData).toString()}else{this.Error("title",AlphaTab.Importer.AlphaTexSymbols.String,true)}this.NewSy();anyMeta=true}else if((this._syData)=="subtitle"){this.NewSy();if(this._sy==AlphaTab.Importer.AlphaTexSymbols.String){this._score.SubTitle=(this._syData).toString()}else{this.Error("subtitle",AlphaTab.Importer.AlphaTexSymbols.String,true)}this.NewSy();anyMeta=true}else if((this._syData)=="artist"){this.NewSy();if(this._sy==AlphaTab.Importer.AlphaTexSymbols.String){this._score.Artist=(this._syData).toString()}else{this.Error("artist",AlphaTab.Importer.AlphaTexSymbols.String,true)}this.NewSy();anyMeta=true}else if((this._syData)=="album"){this.NewSy();if(this._sy==AlphaTab.Importer.AlphaTexSymbols.String){this._score.Album=(this._syData).toString()}else{this.Error("album",AlphaTab.Importer.AlphaTexSymbols.String,true)}this.NewSy();anyMeta=true}else if((this._syData)=="words"){this.NewSy();if(this._sy==AlphaTab.Importer.AlphaTexSymbols.String){this._score.Words=(this._syData).toString()}else{this.Error("words",AlphaTab.Importer.AlphaTexSymbols.String,true)}this.NewSy();anyMeta=true}else if((this._syData)=="music"){this.NewSy();if(this._sy==AlphaTab.Importer.AlphaTexSymbols.String){this._score.Music=(this._syData).toString()}else{this.Error("music",AlphaTab.Importer.AlphaTexSymbols.String,true)}this.NewSy();anyMeta=true}else if((this._syData)=="copyright"){this.NewSy();if(this._sy==AlphaTab.Importer.AlphaTexSymbols.String){this._score.Copyright=(this._syData).toString()}else{this.Error("copyright",AlphaTab.Importer.AlphaTexSymbols.String,true)}this.NewSy();anyMeta=true}else if((this._syData)=="tempo"){this.NewSy();if(this._sy==AlphaTab.Importer.AlphaTexSymbols.Number){this._score.Tempo=(this._syData)}else{this.Error("tempo",AlphaTab.Importer.AlphaTexSymbols.Number,true)}this.NewSy();anyMeta=true}else if((this._syData)=="capo"){this.NewSy();if(this._sy==AlphaTab.Importer.AlphaTexSymbols.Number){this._track.Capo=(this._syData)}else{this.Error("capo",AlphaTab.Importer.AlphaTexSymbols.Number,true)}this.NewSy();anyMeta=true}else if((this._syData)=="tuning"){this.NewSy();if(this._sy==AlphaTab.Importer.AlphaTexSymbols.Tuning){this._track.Tuning=[];do{this._track.Tuning.push(this.ParseTuning((this._syData).toString()));this.NewSy()}while(this._sy==AlphaTab.Importer.AlphaTexSymbols.Tuning)}else{this.Error("tuning",AlphaTab.Importer.AlphaTexSymbols.Tuning,true)}anyMeta=true}else if((this._syData)=="instrument"){this.NewSy();if(this._sy==AlphaTab.Importer.AlphaTexSymbols.Number){var instrument=(this._syData);if(instrument>=0&&instrument<=128){this._track.PlaybackInfo.Program=(this._syData)}else{this.Error("instrument",AlphaTab.Importer.AlphaTexSymbols.Number,false)}}else if(this._sy==AlphaTab.Importer.AlphaTexSymbols.String){var instrumentName=(this._syData).toString();this._track.PlaybackInfo.Program=AlphaTab.Audio.GeneralMidi.GetValue(instrumentName)}else{this.Error("instrument",AlphaTab.Importer.AlphaTexSymbols.Number,true)}this.NewSy();anyMeta=true}else{this.Error("metaDataTags",AlphaTab.Importer.AlphaTexSymbols.String,false)}}if(anyMeta){if(this._sy!=AlphaTab.Importer.AlphaTexSymbols.Dot){this.Error("song",AlphaTab.Importer.AlphaTexSymbols.Dot,true)}this.NewSy()}},Bars:function(){this.Bar();while(this._sy!=AlphaTab.Importer.AlphaTexSymbols.Eof){if(this._sy!=AlphaTab.Importer.AlphaTexSymbols.Pipe){this.Error("bar",AlphaTab.Importer.AlphaTexSymbols.Pipe,true)}this.NewSy();this.Bar()}},Bar:function(){var master=new AlphaTab.Model.MasterBar();this._score.AddMasterBar(master);var bar=new AlphaTab.Model.Bar();this._track.AddBar(bar);if(master.Index>0){master.KeySignature=master.PreviousMasterBar.KeySignature;master.TimeSignatureDenominator=master.PreviousMasterBar.TimeSignatureDenominator;master.TimeSignatureNumerator=master.PreviousMasterBar.TimeSignatureNumerator;bar.Clef=bar.PreviousBar.Clef}this.BarMeta(bar);var voice=new AlphaTab.Model.Voice();bar.AddVoice(voice);while(this._sy!=AlphaTab.Importer.AlphaTexSymbols.Pipe&&this._sy!=AlphaTab.Importer.AlphaTexSymbols.Eof){this.Beat(voice)}},Beat:function(voice){if(this._sy==AlphaTab.Importer.AlphaTexSymbols.DoubleDot){this.NewSy();if(this._sy!=AlphaTab.Importer.AlphaTexSymbols.Number){this.Error("duration",AlphaTab.Importer.AlphaTexSymbols.Number,true)}var duration=(this._syData);switch(duration){case 1:case 2:case 4:case 8:case 16:case 32:case 64:this._currentDuration=this.ParseDuration((this._syData));break;default:this.Error("duration",AlphaTab.Importer.AlphaTexSymbols.Number,false);break}this.NewSy();return}var beat=new AlphaTab.Model.Beat();voice.AddBeat(beat);if(this._sy==AlphaTab.Importer.AlphaTexSymbols.LParensis){this.NewSy();this.Note(beat);while(this._sy!=AlphaTab.Importer.AlphaTexSymbols.RParensis&&this._sy!=AlphaTab.Importer.AlphaTexSymbols.Eof){this.Note(beat)}if(this._sy!=AlphaTab.Importer.AlphaTexSymbols.RParensis){this.Error("note-list",AlphaTab.Importer.AlphaTexSymbols.RParensis,true)}this.NewSy()}else if(this._sy==AlphaTab.Importer.AlphaTexSymbols.String&&(this._syData).toString().toLowerCase()=="r"){this.NewSy()}else{this.Note(beat)}if(this._sy==AlphaTab.Importer.AlphaTexSymbols.Dot){this.NewSy();if(this._sy!=AlphaTab.Importer.AlphaTexSymbols.Number){this.Error("duration",AlphaTab.Importer.AlphaTexSymbols.Number,true)}var duration=(this._syData);switch(duration){case 1:case 2:case 4:case 8:case 16:case 32:case 64:this._currentDuration=this.ParseDuration((this._syData));break;default:this.Error("duration",AlphaTab.Importer.AlphaTexSymbols.Number,false);break}this.NewSy()}else{beat.Duration=this._currentDuration}var beatRepeat=1;if(this._sy==AlphaTab.Importer.AlphaTexSymbols.Multiply){this.NewSy();if(this._sy!=AlphaTab.Importer.AlphaTexSymbols.Number){this.Error("multiplier",AlphaTab.Importer.AlphaTexSymbols.Number,true)}else{beatRepeat=(this._syData)}this.NewSy()}this.BeatEffects(beat);for(var i=0;i60){beat.WhammyBarPoints.splice(beat.WhammyBarPoints.length-1,1)}var count=beat.WhammyBarPoints.length;var step=((60/count)|0);var i=0;while(ithis._track.Tuning.length){this.Error("note-string",AlphaTab.Importer.AlphaTexSymbols.Number,false)}this.NewSy();var note=new AlphaTab.Model.Note();this.NoteEffects(note);note.String=this._track.Tuning.length-(string-1);note.IsDead=isDead;note.IsTieDestination=isTie;if(!isTie){note.Fret=fret}beat.AddNote(note)},NoteEffects:function(note){if(this._sy!=AlphaTab.Importer.AlphaTexSymbols.LBrace){return}this.NewSy();while(this._sy==AlphaTab.Importer.AlphaTexSymbols.String){var syData=(this._syData).toString().toLowerCase();(this._syData)=syData;if(syData=="b"){this.NewSy();if(this._sy!=AlphaTab.Importer.AlphaTexSymbols.LParensis){this.Error("bend-effect",AlphaTab.Importer.AlphaTexSymbols.LParensis,true)}this.NewSy();while(this._sy!=AlphaTab.Importer.AlphaTexSymbols.RParensis&&this._sy!=AlphaTab.Importer.AlphaTexSymbols.Eof){if(this._sy!=AlphaTab.Importer.AlphaTexSymbols.Number){this.Error("bend-effect-value",AlphaTab.Importer.AlphaTexSymbols.Number,true)}var bendValue=(this._syData);note.BendPoints.push(new AlphaTab.Model.BendPoint(0,(Math.abs(bendValue))));this.NewSy()}while(note.BendPoints.length>60){note.BendPoints.splice(note.BendPoints.length-1,1)}var count=note.BendPoints.length;var step=(60/count)|0;var i=0;while(i=33&&code<=47)||(code>=58&&code<=126)||(code>128))};AlphaTab.Importer.AlphaTexImporter.IsTerminal=function(ch){return ch==46||ch==123||ch==125||ch==91||ch==93||ch==40||ch==41||ch==124||ch==39||ch==34||ch==92};$Inherit(AlphaTab.Importer.AlphaTexImporter,AlphaTab.Importer.ScoreImporter);AlphaTab.Importer.AlphaTexSymbols={No:0,Eof:1,Number:2,DoubleDot:3,Dot:4,String:5,Tuning:6,LParensis:7,RParensis:8,LBrace:9,RBrace:10,Pipe:11,MetaCommand:12,Multiply:13};AlphaTab.Importer.Gp3To5Importer=function(){this._versionNumber=0;this._score=null;this._globalTripletFeel=AlphaTab.Model.TripletFeel.NoTripletFeel;this._lyricsIndex=null;this._lyrics=null;this._barCount=0;this._trackCount=0;this._playbackInfos=null;AlphaTab.Importer.ScoreImporter.call(this)};AlphaTab.Importer.Gp3To5Importer.prototype={ReadScore:function(){this.ReadVersion();this._score=new AlphaTab.Model.Score();this.ReadScoreInformation();if(this._versionNumber<500){this._globalTripletFeel=this.ReadBool()?AlphaTab.Model.TripletFeel.Triplet8th:AlphaTab.Model.TripletFeel.NoTripletFeel}if(this._versionNumber>=400){this.ReadLyrics()}if(this._versionNumber>=510){this._data.Skip(19)}if(this._versionNumber>=500){this.ReadPageSetup();this._score.TempoLabel=this.ReadStringIntByte()}this._score.Tempo=this.ReadInt32();if(this._versionNumber>=510){this.ReadBool()}this.ReadInt32();if(this._versionNumber>=400){this._data.ReadByte()}this.ReadPlaybackInfos();if(this._versionNumber>=500){this._data.Skip(38);this._data.Skip(4)}this._barCount=this.ReadInt32();this._trackCount=this.ReadInt32();this.ReadMasterBars();this.ReadTracks();this.ReadBars();this._score.Finish();return this._score},ReadVersion:function(){var version=this.ReadStringByteLength(30);if(!version.indexOf("FICHIER GUITAR PRO ")==0){throw $CreateException(new AlphaTab.Importer.UnsupportedFormatException(),new Error());}version=version.substr("FICHIER GUITAR PRO ".length+1);var dot=version.indexOf(".");this._versionNumber=(100*AlphaTab.Platform.Std.ParseInt(version.substr(0,dot)))+AlphaTab.Platform.Std.ParseInt(version.substr(dot+1))},ReadScoreInformation:function(){this._score.Title=this.ReadStringIntUnused();this._score.SubTitle=this.ReadStringIntUnused();this._score.Artist=this.ReadStringIntUnused();this._score.Album=this.ReadStringIntUnused();this._score.Words=this.ReadStringIntUnused();this._score.Music=(this._versionNumber>=500)?this.ReadStringIntUnused():this._score.Words;this._score.Copyright=this.ReadStringIntUnused();this._score.Tab=this.ReadStringIntUnused();this._score.Instructions=this.ReadStringIntUnused();var noticeLines=this.ReadInt32();var notice=new Array();for(var i=0;i0)notice.push('\r\n');notice.push(this.ReadStringIntUnused())}this._score.Notices=notice.join('')},ReadLyrics:function(){this._lyrics=[];this._lyricsIndex=[];this.ReadInt32();for(var i=0;i<5;i++){this._lyricsIndex.push(this.ReadInt32()-1);this._lyrics.push(this.ReadStringInt())}},ReadPageSetup:function(){this._data.Skip(30);for(var i=0;i<10;i++){this.ReadStringIntByte()}},ReadPlaybackInfos:function(){this._playbackInfos=[];for(var i=0;i<64;i++){var info=new AlphaTab.Model.PlaybackInformation();info.PrimaryChannel=i;info.SecondaryChannel=i;info.Program=this.ReadInt32();info.Volume=this._data.ReadByte();info.Balance=this._data.ReadByte();this._data.Skip(6);this._playbackInfos.push(info)}},ReadMasterBars:function(){for(var i=0;i0){previousMasterBar=this._score.MasterBars[this._score.MasterBars.length-1]}var newMasterBar=new AlphaTab.Model.MasterBar();var flags=this._data.ReadByte();if((flags&1)!=0){newMasterBar.TimeSignatureNumerator=this._data.ReadByte()}else if(previousMasterBar!=null){newMasterBar.TimeSignatureNumerator=previousMasterBar.TimeSignatureNumerator}if((flags&2)!=0){newMasterBar.TimeSignatureDenominator=this._data.ReadByte()}else if(previousMasterBar!=null){newMasterBar.TimeSignatureDenominator=previousMasterBar.TimeSignatureDenominator}newMasterBar.IsRepeatStart=(flags&4)!=0;if((flags&8)!=0){newMasterBar.RepeatCount=this._versionNumber>=500?this._data.ReadByte():1}if((flags&32)!=0){var section=new AlphaTab.Model.Section();section.Text=this.ReadStringIntByte();section.Marker="";this.ReadColor();newMasterBar.Section=section}if((flags&16)!=0){if(this._versionNumber<500){var currentMasterBar=previousMasterBar;var existentAlternatives=0;while(currentMasterBar!=null){if(currentMasterBar.get_IsRepeatEnd()&¤tMasterBar!=previousMasterBar)break;if(currentMasterBar.IsRepeatStart)break;existentAlternatives|=currentMasterBar.AlternateEndings}var repeatAlternative=0;var repeatMask=this._data.ReadByte();for(var i=0;i<8;i++){var repeating=(1<i&&(existentAlternatives&repeating)==0){repeatAlternative|=repeating}}newMasterBar.AlternateEndings=repeatAlternative}else{newMasterBar.AlternateEndings=this._data.ReadByte()}}if((flags&64)!=0){newMasterBar.KeySignature=AlphaTab.Platform.Std.ReadSignedByte(this._data);this._data.ReadByte()}else if(previousMasterBar!=null){newMasterBar.KeySignature=previousMasterBar.KeySignature}if((this._versionNumber>=500)&&((flags&3)!=0)){this._data.Skip(4)}if((this._versionNumber>=500)&&((flags&16)==0)){newMasterBar.AlternateEndings=this._data.ReadByte()}if(this._versionNumber>=500){var tripletFeel=this._data.ReadByte();switch(tripletFeel){case 1:newMasterBar.TripletFeel=AlphaTab.Model.TripletFeel.Triplet8th;break;case 2:newMasterBar.TripletFeel=AlphaTab.Model.TripletFeel.Triplet16th;break}this._data.ReadByte()}else{newMasterBar.TripletFeel=this._globalTripletFeel}newMasterBar.IsDoubleBar=(flags&128)!=0;this._score.AddMasterBar(newMasterBar)},ReadTracks:function(){for(var i=0;ii){newTrack.Tuning.push(tuning)}}var port=this.ReadInt32();var index=this.ReadInt32()-1;var effectChannel=this.ReadInt32()-1;this._data.Skip(4);if(index>=0&&index=500){this._data.ReadByte();this._data.ReadByte();this._data.Skip(43)}if(this._versionNumber>=510){this._data.Skip(4);this.ReadStringIntByte();this.ReadStringIntByte()}},ReadBars:function(){for(var i=0;i=500){this._data.ReadByte();voiceCount=2}for(var v=0;v=0;i--){if((stringFlags&(1<=500){this._data.ReadByte();var flag=this._data.ReadByte();if((flag&8)!=0){this._data.ReadByte()}}},ReadChord:function(beat){var chord=new AlphaTab.Model.Chord();var chordId=AlphaTab.Platform.Std.NewGuid();if(this._versionNumber>=500){this._data.Skip(17);chord.Name=this.ReadStringByteLength(21);this._data.Skip(4);chord.FirstFret=this.ReadInt32();for(var i=0;i<7;i++){var fret=this.ReadInt32();if(i=400){this._data.Skip(16);chord.Name=(this.ReadStringByteLength(21));this._data.Skip(4);chord.FirstFret=(this.ReadInt32());for(var i=0;i<7;i++){var fret=this.ReadInt32();if(i=406?7:6;chord.Name=this.ReadStringIntByte();chord.FirstFret=this.ReadInt32();if(chord.FirstFret>0){for(var i=0;i=400){flags2=this._data.ReadByte()}beat.FadeIn=(flags&16)!=0;if((flags&1)!=0||(flags&2)!=0){beat.Vibrato=AlphaTab.Model.VibratoType.Slight}beat.HasRasgueado=(flags2&1)!=0;if((flags&32)!=0&&this._versionNumber>=400){var slapPop=AlphaTab.Platform.Std.ReadSignedByte(this._data);switch(slapPop){case 1:beat.Tap=true;break;case 2:beat.Slap=true;break;case 3:beat.Pop=true;break}}else if((flags&32)!=0){var slapPop=AlphaTab.Platform.Std.ReadSignedByte(this._data);switch(slapPop){case 1:beat.Tap=true;break;case 2:beat.Slap=true;break;case 3:beat.Pop=true;break}this._data.Skip(4)}if((flags2&4)!=0){this.ReadTremoloBarEffect(beat)}if((flags&64)!=0){var strokeUp;var strokeDown;if(this._versionNumber<500){strokeDown=this._data.ReadByte();strokeUp=this._data.ReadByte()}else{strokeUp=this._data.ReadByte();strokeDown=this._data.ReadByte()}if(strokeUp>0){beat.BrushType=AlphaTab.Model.BrushType.BrushUp;beat.BrushDuration=AlphaTab.Importer.Gp3To5Importer.ToStrokeValue(strokeUp)}else if(strokeDown>0){beat.BrushType=AlphaTab.Model.BrushType.BrushDown;beat.BrushDuration=AlphaTab.Importer.Gp3To5Importer.ToStrokeValue(strokeDown)}}if((flags2&2)!=0){switch(AlphaTab.Platform.Std.ReadSignedByte(this._data)){case 0:beat.PickStroke=AlphaTab.Model.PickStrokeType.None;break;case 1:beat.PickStroke=AlphaTab.Model.PickStrokeType.Up;break;case 2:beat.PickStroke=AlphaTab.Model.PickStrokeType.Down;break}}},ReadTremoloBarEffect:function(beat){this._data.ReadByte();this.ReadInt32();var pointCount=this.ReadInt32();if(pointCount>0){for(var i=0;i=500){this._data.Skip(16)}tableChange.Volume=AlphaTab.Platform.Std.ReadSignedByte(this._data);tableChange.Balance=AlphaTab.Platform.Std.ReadSignedByte(this._data);var chorus=AlphaTab.Platform.Std.ReadSignedByte(this._data);var reverb=AlphaTab.Platform.Std.ReadSignedByte(this._data);var phaser=AlphaTab.Platform.Std.ReadSignedByte(this._data);var tremolo=AlphaTab.Platform.Std.ReadSignedByte(this._data);if(this._versionNumber>=500){tableChange.TempoName=this.ReadStringIntByte()}tableChange.Tempo=this.ReadInt32();if(tableChange.Volume>=0){this._data.ReadByte()}if(tableChange.Balance>=0){this._data.ReadByte()}if(chorus>=0){this._data.ReadByte()}if(reverb>=0){this._data.ReadByte()}if(phaser>=0){this._data.ReadByte()}if(tremolo>=0){this._data.ReadByte()}if(tableChange.Tempo>=0){tableChange.Duration=AlphaTab.Platform.Std.ReadSignedByte(this._data);if(this._versionNumber>=510){this._data.ReadByte()}}if(this._versionNumber>=400){this._data.ReadByte()}if(this._versionNumber>=500){this._data.ReadByte()}if(this._versionNumber>=510){this.ReadStringIntByte();this.ReadStringIntByte()}if(tableChange.Volume>=0){var volumeAutomation=new AlphaTab.Model.Automation();volumeAutomation.IsLinear=true;volumeAutomation.Type=AlphaTab.Model.AutomationType.Volume;volumeAutomation.Value=tableChange.Volume;beat.Automations.push(volumeAutomation)}if(tableChange.Balance>=0){var balanceAutomation=new AlphaTab.Model.Automation();balanceAutomation.IsLinear=true;balanceAutomation.Type=AlphaTab.Model.AutomationType.Balance;balanceAutomation.Value=tableChange.Balance;beat.Automations.push(balanceAutomation)}if(tableChange.Instrument>=0){var instrumentAutomation=new AlphaTab.Model.Automation();instrumentAutomation.IsLinear=true;instrumentAutomation.Type=AlphaTab.Model.AutomationType.Instrument;instrumentAutomation.Value=tableChange.Instrument;beat.Automations.push(instrumentAutomation)}if(tableChange.Tempo>=0){var tempoAutomation=new AlphaTab.Model.Automation();tempoAutomation.IsLinear=true;tempoAutomation.Type=AlphaTab.Model.AutomationType.Tempo;tempoAutomation.Value=tableChange.Tempo;beat.Automations.push(tempoAutomation);beat.Voice.Bar.get_MasterBar().TempoAutomation=tempoAutomation}},ReadNote:function(track,bar,voice,beat,stringIndex){var newNote=new AlphaTab.Model.Note();newNote.String=track.Tuning.length-stringIndex;var flags=this._data.ReadByte();if((flags&2)!=0){newNote.Accentuated=AlphaTab.Model.AccentuationType.Heavy}else if((flags&64)!=0){newNote.Accentuated=AlphaTab.Model.AccentuationType.Normal}newNote.IsGhost=((flags&4)!=0);if((flags&32)!=0){var noteType=this._data.ReadByte();if(noteType==3){newNote.IsDead=true}else if(noteType==2){newNote.IsTieDestination=true}}if((flags&16)!=0){var dynamicNumber=AlphaTab.Platform.Std.ReadSignedByte(this._data);newNote.Dynamic=this.ToDynamicValue(dynamicNumber);beat.Dynamic=newNote.Dynamic}if((flags&32)!=0){newNote.Fret=AlphaTab.Platform.Std.ReadSignedByte(this._data)}if((flags&128)!=0){newNote.LeftHandFinger=AlphaTab.Platform.Std.ReadSignedByte(this._data);newNote.RightHandFinger=AlphaTab.Platform.Std.ReadSignedByte(this._data);newNote.IsFingering=true}if(this._versionNumber>=500){if((flags&1)!=0){newNote.DurationPercent=this.ReadDouble()}var flags2=this._data.ReadByte();newNote.SwapAccidentals=(flags2&2)!=0}beat.AddNote(newNote);if((flags&8)!=0){this.ReadNoteEffects(track,voice,beat,newNote)}},ToDynamicValue:function(value){switch(value){case 1:return AlphaTab.Model.DynamicValue.PPP;case 2:return AlphaTab.Model.DynamicValue.PP;case 3:return AlphaTab.Model.DynamicValue.P;case 4:return AlphaTab.Model.DynamicValue.MP;case 5:return AlphaTab.Model.DynamicValue.MF;case 6:return AlphaTab.Model.DynamicValue.F;case 7:return AlphaTab.Model.DynamicValue.FF;case 8:return AlphaTab.Model.DynamicValue.FFF;default:return AlphaTab.Model.DynamicValue.F}},ReadNoteEffects:function(track,voice,beat,note){var flags=this._data.ReadByte();var flags2=0;if(this._versionNumber>=400){flags2=this._data.ReadByte()}if((flags&1)!=0){this.ReadBend(note)}if((flags&16)!=0){this.ReadGrace(voice,note)}if((flags2&4)!=0){this.ReadTremoloPicking(beat)}if((flags2&8)!=0){this.ReadSlide(note)}else if(this._versionNumber<400){if((flags&4)!=0){note.SlideType=AlphaTab.Model.SlideType.Shift}}if((flags2&16)!=0){this.ReadArtificialHarmonic(note)}else if(this._versionNumber<400){if((flags&4)!=0){note.HarmonicType=AlphaTab.Model.HarmonicType.Natural;note.HarmonicValue=this.DeltaFretToHarmonicValue(note.Fret)}if((flags&8)!=0){note.HarmonicType=AlphaTab.Model.HarmonicType.Artificial}}if((flags2&32)!=0){this.ReadTrill(note)}note.IsLetRing=(flags&8)!=0;note.IsHammerPullOrigin=(flags&2)!=0;if((flags2&64)!=0){note.Vibrato=AlphaTab.Model.VibratoType.Slight}note.IsPalmMute=(flags2&2)!=0;note.IsStaccato=(flags2&1)!=0},ReadBend:function(note){this._data.ReadByte();this.ReadInt32();var pointCount=this.ReadInt32();if(pointCount>0){for(var i=0;i=500){var type=AlphaTab.Platform.Std.ReadSignedByte(this._data);switch(type){case 1:note.SlideType=AlphaTab.Model.SlideType.Shift;break;case 2:note.SlideType=AlphaTab.Model.SlideType.Legato;break;case 4:note.SlideType=AlphaTab.Model.SlideType.OutDown;break;case 8:note.SlideType=AlphaTab.Model.SlideType.OutUp;break;case 16:note.SlideType=AlphaTab.Model.SlideType.IntoFromBelow;break;case 32:note.SlideType=AlphaTab.Model.SlideType.IntoFromAbove;break;default:note.SlideType=AlphaTab.Model.SlideType.None;break}}else{var type=AlphaTab.Platform.Std.ReadSignedByte(this._data);switch(type){case 1:note.SlideType=AlphaTab.Model.SlideType.Shift;break;case 2:note.SlideType=AlphaTab.Model.SlideType.Legato;break;case 3:note.SlideType=AlphaTab.Model.SlideType.OutDown;break;case 4:note.SlideType=AlphaTab.Model.SlideType.OutUp;break;case-1:note.SlideType=AlphaTab.Model.SlideType.IntoFromBelow;break;case-2:note.SlideType=AlphaTab.Model.SlideType.IntoFromAbove;break;default:note.SlideType=AlphaTab.Model.SlideType.None;break}}},ReadArtificialHarmonic:function(note){var type=this._data.ReadByte();if(this._versionNumber>=500){switch(type){case 1:note.HarmonicType=AlphaTab.Model.HarmonicType.Natural;note.HarmonicValue=this.DeltaFretToHarmonicValue(note.Fret);break;case 2:var harmonicTone=this._data.ReadByte();var harmonicKey=this._data.ReadByte();var harmonicOctaveOffset=this._data.ReadByte();note.HarmonicType=AlphaTab.Model.HarmonicType.Artificial;break;case 3:note.HarmonicType=AlphaTab.Model.HarmonicType.Tap;note.HarmonicValue=this.DeltaFretToHarmonicValue(this._data.ReadByte());break;case 4:note.HarmonicType=AlphaTab.Model.HarmonicType.Pinch;note.HarmonicValue=12;break;case 5:note.HarmonicType=AlphaTab.Model.HarmonicType.Semi;note.HarmonicValue=12;break}}else if(this._versionNumber>=400){switch(type){case 1:note.HarmonicType=AlphaTab.Model.HarmonicType.Natural;break;case 3:note.HarmonicType=AlphaTab.Model.HarmonicType.Tap;break;case 4:note.HarmonicType=AlphaTab.Model.HarmonicType.Pinch;break;case 5:note.HarmonicType=AlphaTab.Model.HarmonicType.Semi;break;case 15:note.HarmonicType=AlphaTab.Model.HarmonicType.Artificial;break;case 17:note.HarmonicType=AlphaTab.Model.HarmonicType.Artificial;break;case 22:note.HarmonicType=AlphaTab.Model.HarmonicType.Artificial;break}}},DeltaFretToHarmonicValue:function(deltaFret){switch(deltaFret){case 2:return 2.4;case 3:return 3.2;case 4:case 5:case 7:case 9:case 12:case 16:case 17:case 19:case 24:return deltaFret;case 8:return 8.2;case 10:return 9.6;case 14:case 15:return 14.7;case 21:case 22:return 21.7;default:return 12}},ReadTrill:function(note){note.TrillValue=this._data.ReadByte()+note.get_StringTuning();switch(this._data.ReadByte()){case 1:note.TrillSpeed=AlphaTab.Model.Duration.Sixteenth;break;case 2:note.TrillSpeed=AlphaTab.Model.Duration.ThirtySecond;break;case 3:note.TrillSpeed=AlphaTab.Model.Duration.SixtyFourth;break}},ReadDouble:function(){var bytes=new Uint8Array(8);this._data.Read(bytes,0,bytes.length);var sign=1-((bytes[0]>>7)<<1);var exp=(((bytes[0]<<4)&2047)|(bytes[1]>>4))-1023;var sig=this.GetDoubleSig(bytes);if(sig==0&&exp==-1023)return 0;return sign*(1+Math.pow(2,-52)*sig)*Math.pow(2,exp)},GetDoubleSig:function(bytes){return(((((bytes[1]&15)<<16)|(bytes[2]<<8)|bytes[3])*4294967296+(bytes[4]>>7)*2147483648+(((bytes[4]&127)<<24)|(bytes[5]<<16)|(bytes[6]<<8)|bytes[7])))|0},ReadColor:function(){var r=this._data.ReadByte();var g=this._data.ReadByte();var b=this._data.ReadByte();this._data.Skip(1);return new AlphaTab.Platform.Model.Color(r,g,b,255)},ReadBool:function(){return this._data.ReadByte()!=0},ReadInt32:function(){var bytes=new Uint8Array(4);this._data.Read(bytes,0,4);return bytes[0]|bytes[1]<<8|bytes[2]<<16|bytes[3]<<24},ReadStringIntUnused:function(){this._data.Skip(4);return this.ReadString(this._data.ReadByte())},ReadStringInt:function(){return this.ReadString(this.ReadInt32())},ReadStringIntByte:function(){var length=this.ReadInt32()-1;this._data.ReadByte();return this.ReadString(length)},ReadString:function(length){var b=new Uint8Array(length);this._data.Read(b,0,b.length);return AlphaTab.Platform.Std.ToString(b)},ReadStringByteLength:function(length){var stringLength=this._data.ReadByte();var s=this.ReadString(stringLength);if(stringLength0){for(var k=0,l=this._automations[barId].length;k=0){bits|=(this.ReadBit()<=8){this._currentByte=this._source.ReadByte();if(this._currentByte==-1)throw $CreateException(new AlphaTab.IO.EndOfReaderException(),new Error());this._position=0}var value=(this._currentByte>>(8-this._position-1))&1;this._position++;return value},ReadAll:function(){var all=AlphaTab.IO.ByteBuffer.Empty();try{while(true){all.WriteByte(this.ReadByte())}}catch($$e4){}return all.ToArray()}};$StaticConstructor(function(){AlphaTab.IO.BitReader.ByteSize=8});AlphaTab.IO.FileLoadException=function(message){};AlphaTab.IO.EndOfReaderException=function(){};AlphaTab.IO.ByteBuffer=function(){this._buffer=null;this._position=0;this._length=0;this._capacity=0};AlphaTab.IO.ByteBuffer.prototype={get_Length:function(){return this._length},GetBuffer:function(){return this._buffer},Reset:function(){this._position=0},Skip:function(offset){this._position+=offset},SetCapacity:function(value){if(value!=this._capacity){if(value>0){var newBuffer=new Uint8Array(value);if(this._length>0)newBuffer.set(this._buffer.subarray(0,0+this._length),0);this._buffer=newBuffer}else{this._buffer=null}this._capacity=value}},ReadByte:function(){var n=this._length-this._position;if(n<=0)return-1;return this._buffer[this._position++]},Read:function(buffer,offset,count){if(!sakutakashiyi){return}var n=this._length-this._position;if(n>count)n=count;if(n<=0)return 0;if(n<=8){var byteCount=n;while(--byteCount>=0)buffer[offset+byteCount]=this._buffer[this._position+byteCount]}else buffer.set(this._buffer.subarray(this._position,this._position+n),offset);this._position+=n;return n},WriteByte:function(value){var buffer=new Uint8Array(1);buffer[0]=value;this.Write(buffer,0,1)},Write:function(buffer,offset,count){var i=this._position+count;if(i>this._length){if(i>this._capacity){this.EnsureCapacity(i)}this._length=i}if((count<=8)&&(buffer!=this._buffer)){var byteCount=count;while(--byteCount>=0)this._buffer[this._position+byteCount]=buffer[offset+byteCount]}else this._buffer.set(buffer.subarray(offset,offset+count),this._position);this._position=i},EnsureCapacity:function(value){if(value>this._capacity){var newCapacity=value;if(newCapacity<256)newCapacity=256;if(newCapacity5)reference=2;var references=new Float32Array([1,0.5,1,1.5,2,3]);var automation=new AlphaTab.Model.Automation();automation.Type=AlphaTab.Model.AutomationType.Tempo;automation.IsLinear=isLinear;automation.RatioPosition=ratioPosition;automation.Value=value*references[reference];return automation};AlphaTab.Model.Automation.CopyTo=function(src,dst){dst.IsLinear=src.IsLinear;dst.RatioPosition=src.RatioPosition;dst.Text=src.Text;dst.Type=src.Type;dst.Value=src.Value};AlphaTab.Model.AutomationType={Tempo:0,Volume:1,Instrument:2,Balance:3};AlphaTab.Model.Bar=function(){this.Index=0;this.NextBar=null;this.PreviousBar=null;this.Clef=AlphaTab.Model.Clef.Neutral;this.Track=null;this.Voices=null;this.MinDuration=null;this.MaxDuration=null;this.Voices=[];this.Clef=AlphaTab.Model.Clef.G2};AlphaTab.Model.Bar.prototype={AddVoice:function(voice){voice.Bar=this;voice.Index=this.Voices.length;this.Voices.push(voice)},get_MasterBar:function(){return this.Track.Score.MasterBars[this.Index]},get_IsEmpty:function(){for(var i=0,j=this.Voices.length;ivoice.MinDuration){this.MinDuration=voice.MinDuration}if(voice.MaxDuration==null||this.MaxDuration==null||this.MaxDuration>voice.MaxDuration){this.MinDuration=voice.MaxDuration}}}};AlphaTab.Model.Bar.CopyTo=function(src,dst){dst.Index=src.Index;dst.Clef=src.Clef};AlphaTab.Model.Beat=function(){this._minNote=null;this._maxNote=null;this.PreviousBeat=null;this.NextBeat=null;this.Index=0;this.Voice=null;this.Notes=null;this.IsEmpty=false;this.Duration=AlphaTab.Model.Duration.Whole;this.Automations=null;this.Dots=0;this.FadeIn=false;this.Lyrics=null;this.Pop=false;this.HasRasgueado=false;this.Slap=false;this.Tap=false;this.Text=null;this.BrushType=AlphaTab.Model.BrushType.None;this.BrushDuration=0;this.TupletDenominator=0;this.TupletNumerator=0;this.WhammyBarPoints=null;this.Vibrato=AlphaTab.Model.VibratoType.None;this.ChordId=null;this.GraceType=AlphaTab.Model.GraceType.None;this.PickStroke=AlphaTab.Model.PickStrokeType.None;this.TremoloSpeed=null;this.Crescendo=AlphaTab.Model.CrescendoType.None;this.Start=0;this.Dynamic=AlphaTab.Model.DynamicValue.PPP;this.WhammyBarPoints=[];this.Notes=[];this.BrushType=AlphaTab.Model.BrushType.None;this.Vibrato=AlphaTab.Model.VibratoType.None;this.GraceType=AlphaTab.Model.GraceType.None;this.PickStroke=AlphaTab.Model.PickStrokeType.None;this.Duration=AlphaTab.Model.Duration.Quarter;this.TremoloSpeed=null;this.Automations=[];this.Dots=0;this.Start=0;this.TupletDenominator=-1;this.TupletNumerator=-1;this.Dynamic=AlphaTab.Model.DynamicValue.F;this.Crescendo=AlphaTab.Model.CrescendoType.None};AlphaTab.Model.Beat.prototype={get_MinNote:function(){if(this._minNote==null){this.RefreshNotes()}return this._minNote},get_MaxNote:function(){if(this._maxNote==null){this.RefreshNotes()}return this._maxNote},get_IsRest:function(){return this.Notes.length==0},get_HasTuplet:function(){return!(this.TupletDenominator==-1&&this.TupletNumerator==-1)&&!(this.TupletDenominator==1&&this.TupletNumerator==1)},get_HasWhammyBar:function(){return this.WhammyBarPoints.length>0},get_HasChord:function(){return this.ChordId!=null},get_Chord:function(){return this.Voice.Bar.Track.Chords[this.ChordId]},get_IsTremolo:function(){return this.TremoloSpeed!=null},Clone:function(){var beat=new AlphaTab.Model.Beat();for(var i=0,j=this.WhammyBarPoints.length;i0&&this.TupletNumerator>=0){ticks=AlphaTab.Audio.MidiUtils.ApplyTuplet(ticks,this.TupletNumerator,this.TupletDenominator)}return ticks},AddNote:function(note){note.Beat=this;this.Notes.push(note)},RefreshNotes:function(){for(var i=0,j=this.Notes.length;ithis._maxNote.get_RealValue()){this._maxNote=note}}},GetAutomation:function(type){for(var i=0,j=this.Automations.length;i0},get_IsSectionStart:function(){return this.Section!=null},CalculateDuration:function(){return this.TimeSignatureNumerator*AlphaTab.Audio.MidiUtils.ValueToTicks(this.TimeSignatureDenominator)}};$StaticConstructor(function(){AlphaTab.Model.MasterBar.MaxAlternateEndings=8});AlphaTab.Model.MasterBar.CopyTo=function(src,dst){dst.AlternateEndings=src.AlternateEndings;dst.Index=src.Index;dst.KeySignature=src.KeySignature;dst.IsDoubleBar=src.IsDoubleBar;dst.IsRepeatStart=src.IsRepeatStart;dst.RepeatCount=src.RepeatCount;dst.TimeSignatureNumerator=src.TimeSignatureNumerator;dst.TimeSignatureDenominator=src.TimeSignatureDenominator;dst.TripletFeel=src.TripletFeel;dst.Start=src.Start};AlphaTab.Model.ModelUtils=function(){};AlphaTab.Model.ModelUtils.GetIndex=function(duration){var index=0;var value=duration;while((value=(value>>1))>0){index++}return index};AlphaTab.Model.ModelUtils.KeySignatureIsFlat=function(ks){return ks<0};AlphaTab.Model.ModelUtils.KeySignatureIsNatural=function(ks){return ks==0};AlphaTab.Model.ModelUtils.KeySignatureIsSharp=function(ks){return ks>0};AlphaTab.Model.Note=function(){this.Accentuated=AlphaTab.Model.AccentuationType.None;this.BendPoints=null;this.Fret=0;this.String=0;this.IsHammerPullOrigin=false;this.HammerPullOrigin=null;this.HammerPullDestination=null;this.HarmonicValue=0;this.HarmonicType=AlphaTab.Model.HarmonicType.None;this.IsGhost=false;this.IsLetRing=false;this.IsPalmMute=false;this.IsDead=false;this.IsStaccato=false;this.SlideType=AlphaTab.Model.SlideType.None;this.SlideTarget=null;this.Vibrato=AlphaTab.Model.VibratoType.None;this.TieOrigin=null;this.TieDestination=null;this.IsTieDestination=false;this.IsTieOrigin=false;this.LeftHandFinger=AlphaTab.Model.Fingers.Thumb;this.RightHandFinger=AlphaTab.Model.Fingers.Thumb;this.IsFingering=false;this.TrillValue=0;this.TrillSpeed=AlphaTab.Model.Duration.Whole;this.DurationPercent=0;this.SwapAccidentals=false;this.Beat=null;this.Dynamic=AlphaTab.Model.DynamicValue.PPP;this.Octave=0;this.Tone=0;this.BendPoints=[];this.Dynamic=AlphaTab.Model.DynamicValue.F;this.Accentuated=AlphaTab.Model.AccentuationType.None;this.Fret=-1;this.HarmonicType=AlphaTab.Model.HarmonicType.None;this.SlideType=AlphaTab.Model.SlideType.None;this.Vibrato=AlphaTab.Model.VibratoType.None;this.LeftHandFinger=AlphaTab.Model.Fingers.NoOrDead;this.RightHandFinger=AlphaTab.Model.Fingers.NoOrDead;this.TrillValue=-1;this.TrillSpeed=AlphaTab.Model.Duration.ThirtySecond;this.DurationPercent=1;this.Octave=-1};AlphaTab.Model.Note.prototype={get_HasBend:function(){return this.BendPoints.length>0},get_TrillFret:function(){return this.TrillValue-this.get_StringTuning()},get_IsTrill:function(){return this.TrillValue>=0},get_StringTuning:function(){if(this.Beat.Voice.Bar.Track.Tuning.length>0)return this.Beat.Voice.Bar.Track.Tuning[this.Beat.Voice.Bar.Track.Tuning.length-(this.String-1)-1];return 0},get_RealValue:function(){if(this.Fret==-1)return this.Octave*12+this.Tone;return this.Fret+this.get_StringTuning()},Clone:function(){var n=new AlphaTab.Model.Note();AlphaTab.Model.Note.CopyTo(this,n);for(var i=0,j=this.BendPoints.length;i=note.Beat.Voice.Bar.Index-3){var noteOnString=previousBeat.GetNoteOnString(note.String);if(noteOnString!=null){return noteOnString}else{previousBeat=previousBeat.PreviousBeat}}return null};AlphaTab.Model.PickStrokeType={None:0,Up:1,Down:2};AlphaTab.Model.PlaybackInformation=function(){this.Volume=0;this.Balance=0;this.Port=0;this.Program=0;this.PrimaryChannel=0;this.SecondaryChannel=0;this.IsMute=false;this.IsSolo=false;this.Volume=15;this.Balance=8;this.Port=1};AlphaTab.Model.PlaybackInformation.CopyTo=function(src,dst){dst.Volume=src.Volume;dst.Balance=src.Balance;dst.Port=src.Port;dst.Program=src.Program;dst.PrimaryChannel=src.PrimaryChannel;dst.SecondaryChannel=src.SecondaryChannel;dst.IsMute=src.IsMute;dst.IsSolo=src.IsSolo};AlphaTab.Model.RepeatGroup=function(){this.MasterBars=null;this.Openings=null;this.Closings=null;this.IsClosed=false;this.MasterBars=[];this.Openings=[];this.Closings=[];this.IsClosed=false};AlphaTab.Model.RepeatGroup.prototype={AddMasterBar:function(masterBar){if(this.Openings.length==0){this.Openings.push(masterBar)}this.MasterBars.push(masterBar);masterBar.RepeatGroup=this;if(masterBar.get_IsRepeatEnd()){this.Closings.push(masterBar);this.IsClosed=true}else if(this.IsClosed){this.IsClosed=false;this.Openings.push(masterBar)}}};AlphaTab.Model.Score=function(){this._currentRepeatGroup=null;this.Album=null;this.Artist=null;this.Copyright=null;this.Instructions=null;this.Music=null;this.Notices=null;this.SubTitle=null;this.Title=null;this.Words=null;this.Tab=null;this.Tempo=0;this.TempoLabel=null;this.MasterBars=null;this.Tracks=null;this.MasterBars=[];this.Tracks=[];this._currentRepeatGroup=new AlphaTab.Model.RepeatGroup()};AlphaTab.Model.Score.prototype={AddMasterBar:function(bar){bar.Score=this;bar.Index=this.MasterBars.length;if(this.MasterBars.length!=0){bar.PreviousMasterBar=this.MasterBars[this.MasterBars.length-1];bar.PreviousMasterBar.NextMasterBar=bar;bar.Start=bar.PreviousMasterBar.Start+bar.PreviousMasterBar.CalculateDuration()}if(bar.IsRepeatStart||(this._currentRepeatGroup.IsClosed&&bar.AlternateEndings<=0)){this._currentRepeatGroup=new AlphaTab.Model.RepeatGroup()}this._currentRepeatGroup.AddMasterBar(bar);this.MasterBars.push(bar)},AddTrack:function(track){track.Score=this;track.Index=this.Tracks.length;this.Tracks.push(track)},Finish:function(){for(var i=0,j=this.Tracks.length;i0){bar.PreviousBar=bars[bars.length-1];bar.PreviousBar.NextBar=bar}bars.push(bar)},Finish:function(){if(((this.ShortName==null)||(this.ShortName.length==0))){this.ShortName=this.Name;if(this.ShortName.length>10)this.ShortName=this.ShortName.substr(0,10)}for(var i=0,j=this.Bars.length;ibeat.Duration){this.MinDuration=beat.Duration}if(this.MaxDuration==null||this.MaxDuration>24)&255)},get_R:function(){return((this.Raw>>16)&255)},get_G:function(){return((this.Raw>>8)&255)},get_B:function(){return(this.Raw&255)},ToRgbaString:function(){return"rgba("+this.get_R()+","+this.get_G()+","+this.get_B()+","+(this.get_A()/255)+")"}};AlphaTab.Platform.Model.FontStyle={Plain:0,Bold:1,Italic:2};AlphaTab.Platform.Model.Font=function(family,size,style){this.Family=null;this.Size=0;this.Style=AlphaTab.Platform.Model.FontStyle.Plain;this.Family=family;this.Size=size;this.Style=style};AlphaTab.Platform.Model.Font.prototype={get_IsBold:function(){return(this.Style&AlphaTab.Platform.Model.FontStyle.Bold)!=AlphaTab.Platform.Model.FontStyle.Plain},get_IsItalic:function(){return(this.Style&AlphaTab.Platform.Model.FontStyle.Italic)!=AlphaTab.Platform.Model.FontStyle.Plain},Clone:function(){return new AlphaTab.Platform.Model.Font(this.Family,this.Size,this.Style)},ToCssString:function(){var buf=new Array();if(this.get_IsBold()){buf.push("bold ")}if(this.get_IsItalic()){buf.push("italic ")}buf.push(this.Size);buf.push("px ");buf.push("\'");buf.push(this.Family);buf.push("\'");return buf.join('')}};AlphaTab.Platform.Model.TextAlign={Left:0,Center:1,Right:2};AlphaTab.Platform.Model.TextBaseline={Default:0,Top:1,Middle:2,Bottom:3};AlphaTab.Platform.Svg=AlphaTab.Platform.Svg||{};AlphaTab.Platform.Svg.FontSizes=function(){};$StaticConstructor(function(){AlphaTab.Platform.Svg.FontSizes.TimesNewRoman=new Uint8Array([3,4,5,6,6,9,9,2,4,4,6,6,3,4,3,3,6,6,6,6,6,6,6,6,6,6,3,3,6,6,6,5,10,8,7,7,8,7,6,7,8,4,4,8,7,10,8,8,7,8,7,5,8,8,7,11,8,8,7,4,3,4,5,6,4,5,5,5,5,5,4,5,6,3,3,6,3,9,6,6,6,5,4,4,4,5,6,7,6,6,5,5,2,5,6,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,3,4,6,6,6,6,2,5,4,8,4,6,6,0,8,6,4,6,3,3,4,5,5,4,4,3,3,6,8,8,8,5,8,8,8,8,8,8,11,7,7,7,7,7,4,4,4,4,8,8,8,8,8,8,8,6,8,8,8,8,8,8,6,5,5,5,5,5,5,5,8,5,5,5,5,5,3,3,3,3,6,6,6,6,6,6,6,6,6,5,5,5,5,6,6]);AlphaTab.Platform.Svg.FontSizes.Arial11Pt=new Uint8Array([3,2,4,6,6,10,7,2,4,4,4,6,3,4,3,3,6,6,6,6,6,6,6,6,6,6,3,3,6,6,6,6,11,8,7,7,7,6,6,8,7,2,5,7,6,8,7,8,6,8,7,7,6,7,8,10,7,8,7,3,3,3,5,6,4,6,6,6,6,6,4,6,6,2,2,5,2,8,6,6,6,6,4,6,3,6,6,10,6,6,6,4,2,4,6,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,3,2,6,6,7,6,2,6,4,8,4,6,6,0,8,6,4,6,4,4,4,6,6,4,4,4,5,6,9,10,10,6,8,8,8,8,8,8,11,7,6,6,6,6,2,2,2,2,8,7,8,8,8,8,8,6,8,7,7,7,7,8,7,7,6,6,6,6,6,6,10,6,6,6,6,6,2,2,2,2,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6]);AlphaTab.Platform.Svg.FontSizes.ControlChars=32});AlphaTab.Platform.Svg.FontSizes.MeasureString=function(s,f,size,style){var data;var dataSize;var factor=1;if((style&AlphaTab.Platform.Model.FontStyle.Italic)!=AlphaTab.Platform.Model.FontStyle.Plain){factor*=1.2}if((style&AlphaTab.Platform.Model.FontStyle.Bold)!=AlphaTab.Platform.Model.FontStyle.Plain){factor*=1.2}if(f==AlphaTab.Platform.Svg.SupportedFonts.TimesNewRoman){data=AlphaTab.Platform.Svg.FontSizes.TimesNewRoman;dataSize=11}else if(f==AlphaTab.Platform.Svg.SupportedFonts.Arial){data=AlphaTab.Platform.Svg.FontSizes.Arial11Pt;dataSize=11}else{data=new Uint8Array([8]);dataSize=11}var stringSize=0;for(var i=0;i=0){stringSize+=((data[code]*size)/dataSize)}}return stringSize*factor};AlphaTab.Platform.Svg.SupportedFonts={TimesNewRoman:0,Arial:1};AlphaTab.Platform.Svg.SvgCanvas=function(){this._buffer=null;this._currentPath=null;this._currentPathIsEmpty=false;this._Width=0;this._Height=0;this._Color=null;this._LineWidth=0;this._Font=null;this._TextAlign=AlphaTab.Platform.Model.TextAlign.Left;this._TextBaseline=AlphaTab.Platform.Model.TextBaseline.Default;this._Resources=null;this._buffer="";this._currentPath="";this._currentPathIsEmpty=true;this.set_Color(new AlphaTab.Platform.Model.Color(255,255,255,255));this.set_LineWidth(1);this.set_Width(0);this.set_Height(0);this.set_Font(new AlphaTab.Platform.Model.Font("Arial",10,AlphaTab.Platform.Model.FontStyle.Plain));this.set_TextAlign(AlphaTab.Platform.Model.TextAlign.Left);this.set_TextBaseline(AlphaTab.Platform.Model.TextBaseline.Default)};AlphaTab.Platform.Svg.SvgCanvas.prototype={get_Width:function(){return this._Width},set_Width:function(value){this._Width=value},get_Height:function(){return this._Height},set_Height:function(value){this._Height=value},get_Color:function(){return this._Color},set_Color:function(value){this._Color=value},get_LineWidth:function(){return this._LineWidth},set_LineWidth:function(value){this._LineWidth=value},get_Font:function(){return this._Font},set_Font:function(value){this._Font=value},get_TextAlign:function(){return this._TextAlign},set_TextAlign:function(value){this._TextAlign=value},get_TextBaseline:function(){return this._TextBaseline},set_TextBaseline:function(value){this._TextBaseline=value},get_Resources:function(){return this._Resources},set_Resources:function(value){this._Resources=value},get_RenderResult:function(){return this.ToSvg(true,"alphaTabSurfaceSvg")},ToSvg:function(includeWrapper,className){var buf=new Array();if(includeWrapper){buf.push("\n")}buf.push(this._buffer);if(includeWrapper){buf.push("")}return buf.join('')},Clear:function(){this._buffer="";this._currentPath="";this._currentPathIsEmpty=true},FillRect:function(x,y,w,h){this._buffer+="\n"},StrokeRect:function(x,y,w,h){this._buffer+="\n"},BeginPath:function(){},ClosePath:function(){this._currentPath+=" z"},MoveTo:function(x,y){this._currentPath+=" M";this._currentPath+=x-0.5;this._currentPath+=",";this._currentPath+=y-0.5},LineTo:function(x,y){this._currentPathIsEmpty=false;this._currentPath+=" L";this._currentPath+=x-0.5;this._currentPath+=",";this._currentPath+=y-0.5},QuadraticCurveTo:function(cpx,cpy,x,y){this._currentPathIsEmpty=false;this._currentPath+=" Q";this._currentPath+=cpx;this._currentPath+=",";this._currentPath+=cpy;this._currentPath+=",";this._currentPath+=x;this._currentPath+=",";this._currentPath+=y},BezierCurveTo:function(cp1x,cp1y,cp2x,cp2y,x,y){this._currentPathIsEmpty=false;this._currentPath+=" C";this._currentPath+=cp1x;this._currentPath+=",";this._currentPath+=cp1y;this._currentPath+=",";this._currentPath+=cp2x;this._currentPath+=",";this._currentPath+=cp2y;this._currentPath+=",";this._currentPath+=x;this._currentPath+=",";this._currentPath+=y},FillCircle:function(x,y,radius){this._currentPathIsEmpty=false;this._currentPath+=" M";this._currentPath+=x-radius;this._currentPath+=",";this._currentPath+=y;this._currentPath+=" A1,1 0 0,0 ";this._currentPath+=x+radius;this._currentPath+=",";this._currentPath+=y;this._currentPath+=" A1,1 0 0,0 ";this._currentPath+=x-radius;this._currentPath+=",";this._currentPath+=y;this._currentPath+=" z";this.Fill()},Fill:function(){if(!this._currentPathIsEmpty){this._buffer+="\n"}this._currentPath="";this._currentPathIsEmpty=true},Stroke:function(){if(!this._currentPathIsEmpty){this._buffer+="\n"}this._currentPath="";this._currentPathIsEmpty=true},FillText:function(text,x,y){this._buffer+="\n";this._buffer+=text;this._buffer+="\n"},GetSvgTextAlignment:function(){switch(this.get_TextAlign()){case AlphaTab.Platform.Model.TextAlign.Left:return"start";case AlphaTab.Platform.Model.TextAlign.Center:return"middle";case AlphaTab.Platform.Model.TextAlign.Right:return"end"}return""},GetSvgBaseLineOffset:function(){switch(this.get_TextBaseline()){case AlphaTab.Platform.Model.TextBaseline.Top:return 0;case AlphaTab.Platform.Model.TextBaseline.Middle:return 0;case AlphaTab.Platform.Model.TextBaseline.Bottom:return 0;default:return this.get_Font().Size}},GetSvgBaseLine:function(){switch(this.get_TextBaseline()){case AlphaTab.Platform.Model.TextBaseline.Top:return"top";case AlphaTab.Platform.Model.TextBaseline.Middle:return"middle";case AlphaTab.Platform.Model.TextBaseline.Bottom:return"bottom";default:return"top"}},MeasureText:function(text){if(((text==null)||(text.length==0)))return 0;var font=AlphaTab.Platform.Svg.SupportedFonts.Arial;if(this.get_Font().Family.indexOf("Times")!=-1){font=AlphaTab.Platform.Svg.SupportedFonts.TimesNewRoman}return AlphaTab.Platform.Svg.FontSizes.MeasureString(text,font,this.get_Font().Size,this.get_Font().Style)},FillMusicFontSymbol:function(x,y,scale,symbol){if(symbol==AlphaTab.Rendering.Glyphs.MusicFontSymbol.None){return}var glyph=new AlphaTab.Rendering.Utils.SvgRenderer(AlphaTab.Rendering.Glyphs.MusicFont.SymbolLookup[symbol],scale,scale);glyph.Paint(x,y,this)}};AlphaTab.Rendering=AlphaTab.Rendering||{};AlphaTab.Rendering.BarRendererBase=function(bar){this.Stave=null;this.X=0;this.Y=0;this.Width=0;this.Height=0;this.Index=0;this.IsEmpty=false;this.TopOverflow=0;this.BottomOverflow=0;this.Bar=null;this.Bar=bar;this.IsEmpty=true};AlphaTab.Rendering.BarRendererBase.prototype={RegisterOverflowTop:function(topOverflow){if(topOverflow>this.TopOverflow)this.TopOverflow=topOverflow},RegisterOverflowBottom:function(bottomOverflow){if(bottomOverflow>this.BottomOverflow)this.BottomOverflow=bottomOverflow},ApplyBarSpacing:function(spacing){},get_Resources:function(){return this.get_Layout().Renderer.RenderingResources},get_Layout:function(){return this.Stave.StaveGroup.Layout},get_Settings:function(){return this.get_Layout().Renderer.Settings},get_Scale:function(){return this.get_Settings().Scale},get_IsFirstOfLine:function(){return this.Index==0},get_IsLastOfLine:function(){return this.Index==this.Stave.BarRenderers.length-1},get_IsLast:function(){return this.Bar.Index==this.Stave.BarRenderers.length-1},RegisterMaxSizes:function(sizes){},ApplySizes:function(sizes){},FinalizeRenderer:function(layout){},get_TopPadding:function(){return 0},get_BottomPadding:function(){return 0},DoLayout:function(){},Paint:function(cx,cy,canvas){},BuildBoundingsLookup:function(lookup,visualTop,visualHeight,realTop,realHeight,x){var barLookup=new AlphaTab.Rendering.Utils.BarBoundings();barLookup.Bar=this.Bar;barLookup.IsFirstOfLine=this.get_IsFirstOfLine();barLookup.IsLastOfLine=this.get_IsLastOfLine();barLookup.VisualBounds=new AlphaTab.Rendering.Utils.Bounds(x+this.Stave.X+this.X,visualTop,this.Width,visualHeight);barLookup.Bounds=new AlphaTab.Rendering.Utils.Bounds(x+this.Stave.X+this.X,realTop,this.Width,realHeight);lookup.Bars.push(barLookup)}};AlphaTab.Rendering.AlternateEndingsBarRenderer=function(bar){this._endings=null;this._endingsString=null;AlphaTab.Rendering.BarRendererBase.call(this,bar);var alternateEndings=this.Bar.get_MasterBar().AlternateEndings;this._endings=[];for(var i=0;i<8;i++){if((alternateEndings&(1<0){var res=this.get_Resources();canvas.set_Font(res.WordsFont);canvas.MoveTo(cx+this.X,cy+this.Y+this.Height);canvas.LineTo(cx+this.X,cy+this.Y);canvas.LineTo(cx+this.X+this.Width,cy+this.Y);canvas.Stroke();canvas.FillText(this._endingsString,cx+this.X+3*this.get_Scale(),cy+this.Y*this.get_Scale())}}};$StaticConstructor(function(){AlphaTab.Rendering.AlternateEndingsBarRenderer.Padding=3});$Inherit(AlphaTab.Rendering.AlternateEndingsBarRenderer,AlphaTab.Rendering.BarRendererBase);AlphaTab.Rendering.BarRendererFactory=function(){this.IsInAccolade=false;this.HideOnMultiTrack=false;this.IsInAccolade=true;this.HideOnMultiTrack=false};AlphaTab.Rendering.BarRendererFactory.prototype={CanCreate:function(track){return true}};AlphaTab.Rendering.AlternateEndingsBarRendererFactory=function(){AlphaTab.Rendering.BarRendererFactory.call(this);this.IsInAccolade=false};AlphaTab.Rendering.AlternateEndingsBarRendererFactory.prototype={Create:function(bar){return new AlphaTab.Rendering.AlternateEndingsBarRenderer(bar)}};$Inherit(AlphaTab.Rendering.AlternateEndingsBarRendererFactory,AlphaTab.Rendering.BarRendererFactory);AlphaTab.Rendering.EffectBarGlyphSizing={SinglePreBeatOnly:0,SinglePreBeatToOnBeat:1,SinglePreBeatToPostBeat:2,SingleOnBeatOnly:3,SingleOnBeatToPostBeat:4,SinglePostBeatOnly:5,GroupedPreBeatOnly:6,GroupedPreBeatToOnBeat:7,GroupedPreBeatToPostBeat:8,GroupedOnBeatOnly:9,GroupedOnBeatToPostBeat:10,GroupedPostBeatOnly:11};AlphaTab.Rendering.GroupedBarRenderer=function(bar){this._preBeatGlyphs=null;this._voiceContainers=null;this._postBeatGlyphs=null;this._biggestVoiceContainer=null;AlphaTab.Rendering.BarRendererBase.call(this,bar);this._preBeatGlyphs=[];this._voiceContainers={};this._postBeatGlyphs=[]};AlphaTab.Rendering.GroupedBarRenderer.prototype={DoLayout:function(){this.CreatePreBeatGlyphs();this.CreateBeatGlyphs();this.CreatePostBeatGlyphs();AlphaTab.Platform.Std.Foreach(AlphaTab.Rendering.Glyphs.VoiceContainerGlyph,this._voiceContainers,$CreateAnonymousDelegate(this,function(c){c.DoLayout()}));this.UpdateWidth()},UpdateWidth:function(){this.Width=this.get_PostBeatGlyphsStart();if(this._postBeatGlyphs.length>0){this.Width+=this._postBeatGlyphs[this._postBeatGlyphs.length-1].X+this._postBeatGlyphs[this._postBeatGlyphs.length-1].Width}AlphaTab.Platform.Std.Foreach(AlphaTab.Rendering.Glyphs.VoiceContainerGlyph,this._voiceContainers,$CreateAnonymousDelegate(this,function(c){if(this._biggestVoiceContainer==null||c.Width>this._biggestVoiceContainer.Width){this._biggestVoiceContainer=c}}))},GetNoteX:function(note,onEnd){return 0},GetNoteY:function(note){return 0},RegisterMaxSizes:function(sizes){var preSize=this.get_BeatGlyphsStart();if(sizes.GetSize("Pre")0){this.AddPreBeatGlyph(new AlphaTab.Rendering.Glyphs.SpacingGlyph(0,0,preSizeDiff,true))}AlphaTab.Platform.Std.Foreach(AlphaTab.Rendering.Glyphs.VoiceContainerGlyph,this._voiceContainers,$CreateAnonymousDelegate(this,function(c){c.ApplySizes(sizes)}));var postSize=sizes.GetSize("Post");var postSizeDiff;if(this._postBeatGlyphs.length==0){postSizeDiff=0}else{postSizeDiff=postSize-(this._postBeatGlyphs[this._postBeatGlyphs.length-1].X+this._postBeatGlyphs[this._postBeatGlyphs.length-1].Width)}if(postSizeDiff>0){this._postBeatGlyphs.splice(0,0,new AlphaTab.Rendering.Glyphs.SpacingGlyph(0,0,postSizeDiff,true));for(var i=0;i=Object.keys(this._voiceContainers).length){c=new AlphaTab.Rendering.Glyphs.VoiceContainerGlyph(0,0,voiceIndex);c.Renderer=this;this._voiceContainers[voiceIndex]=c}else{c=this._voiceContainers[voiceIndex]}return c},GetBeatContainer:function(voice,beat){return this.GetOrCreateVoiceContainer(voice).BeatGlyphs[beat]},GetPreNotesPosition:function(voice,beat){return this.GetBeatContainer(voice,beat).PreNotes},GetOnNotesPosition:function(voice,beat){return this.GetBeatContainer(voice,beat).OnNotes},GetPostNotesPosition:function(voice,beat){return this.GetBeatContainer(voice,beat).PostNotes},AddPostBeatGlyph:function(g){this.AddGlyph(this._postBeatGlyphs,g)},CreatePreBeatGlyphs:function(){},CreateBeatGlyphs:function(){},CreatePostBeatGlyphs:function(){},get_PreBeatGlyphStart:function(){return 0},get_BeatGlyphsStart:function(){var start=this.get_PreBeatGlyphStart();if(this._preBeatGlyphs.length>0){start+=this._preBeatGlyphs[this._preBeatGlyphs.length-1].X+this._preBeatGlyphs[this._preBeatGlyphs.length-1].Width}return start},get_PostBeatGlyphsStart:function(){var start=this.get_BeatGlyphsStart();var offset=0;AlphaTab.Platform.Std.Foreach(AlphaTab.Rendering.Glyphs.VoiceContainerGlyph,this._voiceContainers,$CreateAnonymousDelegate(this,function(c){if(c.Width>offset){offset=c.Width}}));return start+offset},get_PostBeatGlyphsWidth:function(){var width=0;for(var i=0,j=this._postBeatGlyphs.length;iwidth)width=x}return width},ApplyBarSpacing:function(spacing){this.Width+=spacing;AlphaTab.Platform.Std.Foreach(AlphaTab.Rendering.Glyphs.VoiceContainerGlyph,this._voiceContainers,$CreateAnonymousDelegate(this,function(c){var toApply=spacing;if(this._biggestVoiceContainer!=null){toApply+=this._biggestVoiceContainer.Width-c.Width}c.ApplyGlyphSpacing(toApply)}))},FinalizeRenderer:function(layout){AlphaTab.Platform.Std.Foreach(AlphaTab.Rendering.Glyphs.VoiceContainerGlyph,this._voiceContainers,$CreateAnonymousDelegate(this,function(c){c.FinalizeGlyph(layout)}))},Paint:function(cx,cy,canvas){this.PaintBackground(cx,cy,canvas);var glyphStartX=this.get_PreBeatGlyphStart();for(var i=0,j=this._preBeatGlyphs.length;i0){var prevRenderer=this.Stave.BarRenderers[this.Index-1];if(prevRenderer._lastBeat!=null&&prevRenderer._effectGlyphs[0].hasOwnProperty(prevRenderer._lastBeat.Index)){prevGlyph=prevRenderer._effectGlyphs[0][prevRenderer._lastBeat.Index]}}for(var $i43=0,$t43=Object.keys(this._effectGlyphs[0]),$l43=$t43.length,key=$t43[$i43];$i43<$l43;$i43++,key=$t43[$i43]){var beatIndex=AlphaTab.Platform.Std.ParseInt(key);var effect=this._effectGlyphs[0][beatIndex];this.AlignGlyph(this._info.get_SizingMode(),beatIndex,0,prevGlyph);prevGlyph=effect;this.IsEmpty=false}},AlignGlyph:function(sizing,beatIndex,voiceIndex,prevGlyph){var g=this._effectGlyphs[voiceIndex][beatIndex];var pos;var container=this.GetBeatContainer(voiceIndex,beatIndex);switch(sizing){case AlphaTab.Rendering.EffectBarGlyphSizing.SinglePreBeatOnly:pos=container.PreNotes;g.X=pos.X+container.X;g.Width=pos.Width;break;case AlphaTab.Rendering.EffectBarGlyphSizing.SinglePreBeatToOnBeat:pos=container.PreNotes;g.X=pos.X+container.X;pos=container.OnNotes;g.Width=(pos.X+container.X+pos.Width)-g.X;break;case AlphaTab.Rendering.EffectBarGlyphSizing.SinglePreBeatToPostBeat:pos=container.PreNotes;g.X=pos.X+container.X;pos=container.PostNotes;g.Width=(pos.X+container.X+pos.Width)-g.X;break;case AlphaTab.Rendering.EffectBarGlyphSizing.SingleOnBeatOnly:pos=container.OnNotes;g.X=pos.X+container.X;g.Width=pos.Width;break;case AlphaTab.Rendering.EffectBarGlyphSizing.SingleOnBeatToPostBeat:pos=container.OnNotes;g.X=pos.X+container.X;pos=container.PostNotes;g.Width=(pos.X+container.X+pos.Width)-g.X;break;case AlphaTab.Rendering.EffectBarGlyphSizing.SinglePostBeatOnly:pos=container.PostNotes;g.X=pos.X+container.X;g.Width=pos.Width;break;case AlphaTab.Rendering.EffectBarGlyphSizing.GroupedPreBeatOnly:if(g!=prevGlyph){this.AlignGlyph(AlphaTab.Rendering.EffectBarGlyphSizing.SinglePreBeatOnly,beatIndex,voiceIndex,prevGlyph)}else{pos=container.PreNotes;var posR=pos.Renderer;var gR=g.Renderer;g.Width=(posR.X+posR.get_BeatGlyphsStart()+container.X+pos.X+pos.Width)-(gR.X+gR.get_BeatGlyphsStart()+g.X);g.ExpandTo(container.Beat)}break;case AlphaTab.Rendering.EffectBarGlyphSizing.GroupedPreBeatToOnBeat:if(g!=prevGlyph){this.AlignGlyph(AlphaTab.Rendering.EffectBarGlyphSizing.SinglePreBeatToOnBeat,beatIndex,voiceIndex,prevGlyph)}else{pos=container.OnNotes;var posR=pos.Renderer;var gR=g.Renderer;g.Width=(posR.X+posR.get_BeatGlyphsStart()+container.X+pos.X+pos.Width)-(gR.X+gR.get_BeatGlyphsStart()+g.X);g.ExpandTo(container.Beat)}break;case AlphaTab.Rendering.EffectBarGlyphSizing.GroupedPreBeatToPostBeat:if(g!=prevGlyph){this.AlignGlyph(AlphaTab.Rendering.EffectBarGlyphSizing.SinglePreBeatToPostBeat,beatIndex,voiceIndex,prevGlyph)}else{pos=container.PostNotes;var posR=pos.Renderer;var gR=g.Renderer;g.Width=(posR.X+posR.get_BeatGlyphsStart()+container.X+pos.X+pos.Width)-(gR.X+gR.get_BeatGlyphsStart()+g.X);g.ExpandTo(container.Beat)}break;case AlphaTab.Rendering.EffectBarGlyphSizing.GroupedOnBeatOnly:if(g!=prevGlyph){this.AlignGlyph(AlphaTab.Rendering.EffectBarGlyphSizing.SingleOnBeatOnly,beatIndex,voiceIndex,prevGlyph)}else{pos=container.OnNotes;var posR=pos.Renderer;var gR=g.Renderer;g.Width=(posR.X+posR.get_BeatGlyphsStart()+container.X+pos.X+pos.Width)-(gR.X+gR.get_BeatGlyphsStart()+g.X);g.ExpandTo(container.Beat)}break;case AlphaTab.Rendering.EffectBarGlyphSizing.GroupedOnBeatToPostBeat:if(g!=prevGlyph){this.AlignGlyph(AlphaTab.Rendering.EffectBarGlyphSizing.SingleOnBeatToPostBeat,beatIndex,voiceIndex,prevGlyph)}else{pos=container.PostNotes;var posR=pos.Renderer;var gR=g.Renderer;g.Width=(posR.X+posR.get_BeatGlyphsStart()+container.X+pos.X+pos.Width)-(gR.X+gR.get_BeatGlyphsStart()+g.X);g.ExpandTo(container.Beat)}break;case AlphaTab.Rendering.EffectBarGlyphSizing.GroupedPostBeatOnly:if(g!=prevGlyph){this.AlignGlyph(AlphaTab.Rendering.EffectBarGlyphSizing.GroupedPostBeatOnly,beatIndex,voiceIndex,prevGlyph)}else{pos=container.PostNotes;var posR=pos.Renderer;var gR=g.Renderer;g.Width=(posR.X+posR.get_BeatGlyphsStart()+container.X+pos.X+pos.Width)-(gR.X+gR.get_BeatGlyphsStart()+g.X);g.ExpandTo(container.Beat)}break}},CreatePreBeatGlyphs:function(){},CreateBeatGlyphs:function(){this._effectGlyphs.push({});this._uniqueEffectGlyphs.push([]);this.CreateVoiceGlyphs(this.Bar.Voices[0])},CreateVoiceGlyphs:function(v){for(var i=0,j=v.Beats.length;i0||this.Index>0){var prevBeat=b.PreviousBeat;if(this._info.ShouldCreateGlyph(this,prevBeat)){var prevEffect=null;if(b.Index>0&&this._effectGlyphs[b.Voice.Index].hasOwnProperty(prevBeat.Index)){prevEffect=this._effectGlyphs[b.Voice.Index][prevBeat.Index]}else if(this.Index>0){var previousRenderer=(this.Stave.BarRenderers[this.Index-1]);var voiceGlyphs=previousRenderer._effectGlyphs[b.Voice.Index];if(voiceGlyphs.hasOwnProperty(prevBeat.Index)){prevEffect=voiceGlyphs[prevBeat.Index]}}if(prevEffect==null||!this._info.CanExpand(this,prevBeat,b)){this.CreateOrResizeGlyph(AlphaTab.Rendering.EffectBarGlyphSizing.SinglePreBeatOnly,b)}else{this._effectGlyphs[b.Voice.Index][b.Index]=prevEffect}}else{this.CreateOrResizeGlyph(AlphaTab.Rendering.EffectBarGlyphSizing.SinglePreBeatOnly,b)}}else{this.CreateOrResizeGlyph(AlphaTab.Rendering.EffectBarGlyphSizing.SinglePreBeatOnly,b)}break}},CreatePostBeatGlyphs:function(){},get_TopPadding:function(){return 0},get_BottomPadding:function(){return 0},PaintBackground:function(cx,cy,canvas){},Paint:function(cx,cy,canvas){AlphaTab.Rendering.GroupedBarRenderer.prototype.Paint.call(this,cx,cy,canvas);var glyphStart=this.get_BeatGlyphsStart();for(var i=0,j=this._uniqueEffectGlyphs.length;i0},CanExpand:function(renderer,from,to){return true}};AlphaTab.Rendering.Effects.FingeringEffectInfo=function(){this._maxGlyphCount=0;AlphaTab.Rendering.Effects.NoteEffectInfoBase.call(this)};AlphaTab.Rendering.Effects.FingeringEffectInfo.prototype={ShouldCreateGlyph:function(renderer,beat){var result=AlphaTab.Rendering.Effects.NoteEffectInfoBase.prototype.ShouldCreateGlyph.call(this,renderer,beat);if(this.LastCreateInfo.length>=this._maxGlyphCount)this._maxGlyphCount=this.LastCreateInfo.length;return result},ShouldCreateGlyphForNote:function(renderer,note){return(note.LeftHandFinger!=AlphaTab.Model.Fingers.NoOrDead&¬e.LeftHandFinger!=AlphaTab.Model.Fingers.Unknown)||(note.RightHandFinger!=AlphaTab.Model.Fingers.NoOrDead&¬e.RightHandFinger!=AlphaTab.Model.Fingers.Unknown)},GetHeight:function(renderer){return this._maxGlyphCount*(20*renderer.get_Scale())},get_SizingMode:function(){return AlphaTab.Rendering.EffectBarGlyphSizing.SingleOnBeatOnly},CreateNewGlyph:function(renderer,beat){return new AlphaTab.Rendering.Effects.DummyEffectGlyph(0,0,this.LastCreateInfo.length+"fingering")}};$Inherit(AlphaTab.Rendering.Effects.FingeringEffectInfo,AlphaTab.Rendering.Effects.NoteEffectInfoBase);AlphaTab.Rendering.Effects.LetRingEffectInfo=function(){AlphaTab.Rendering.Effects.NoteEffectInfoBase.call(this)};AlphaTab.Rendering.Effects.LetRingEffectInfo.prototype={ShouldCreateGlyphForNote:function(renderer,note){return note.IsLetRing},GetHeight:function(renderer){return 15*renderer.get_Scale()},get_SizingMode:function(){return AlphaTab.Rendering.EffectBarGlyphSizing.GroupedOnBeatToPostBeat},CreateNewGlyph:function(renderer,beat){return new AlphaTab.Rendering.Glyphs.LineRangedGlyph(0,0,"LetRing")}};$Inherit(AlphaTab.Rendering.Effects.LetRingEffectInfo,AlphaTab.Rendering.Effects.NoteEffectInfoBase);AlphaTab.Rendering.Effects.MarkerEffectInfo=function(){};AlphaTab.Rendering.Effects.MarkerEffectInfo.prototype={get_HideOnMultiTrack:function(){return true},ShouldCreateGlyph:function(renderer,beat){return beat.Index==0&&beat.Voice.Bar.get_MasterBar().get_IsSectionStart()},get_SizingMode:function(){return AlphaTab.Rendering.EffectBarGlyphSizing.SinglePreBeatOnly},GetHeight:function(renderer){return 20*renderer.get_Scale()},CreateNewGlyph:function(renderer,beat){return new AlphaTab.Rendering.Glyphs.TextGlyph(0,0,beat.Voice.Bar.get_MasterBar().Section.Text,renderer.get_Resources().MarkerFont)},CanExpand:function(renderer,from,to){return true}};AlphaTab.Rendering.Effects.NoteVibratoEffectInfo=function(){AlphaTab.Rendering.Effects.NoteEffectInfoBase.call(this)};AlphaTab.Rendering.Effects.NoteVibratoEffectInfo.prototype={ShouldCreateGlyphForNote:function(renderer,note){return note.Vibrato!=AlphaTab.Model.VibratoType.None||(note.IsTieDestination&¬e.TieOrigin.Vibrato!=AlphaTab.Model.VibratoType.None)},GetHeight:function(renderer){return 15*renderer.get_Scale()},get_SizingMode:function(){return AlphaTab.Rendering.EffectBarGlyphSizing.GroupedOnBeatToPostBeat},CreateNewGlyph:function(renderer,beat){return new AlphaTab.Rendering.Glyphs.VibratoGlyph(0,5*renderer.get_Scale(),0.9)}};$Inherit(AlphaTab.Rendering.Effects.NoteVibratoEffectInfo,AlphaTab.Rendering.Effects.NoteEffectInfoBase);AlphaTab.Rendering.Effects.PalmMuteEffectInfo=function(){AlphaTab.Rendering.Effects.NoteEffectInfoBase.call(this)};AlphaTab.Rendering.Effects.PalmMuteEffectInfo.prototype={ShouldCreateGlyphForNote:function(renderer,note){return note.IsPalmMute},GetHeight:function(renderer){return 20*renderer.get_Scale()},get_SizingMode:function(){return AlphaTab.Rendering.EffectBarGlyphSizing.GroupedOnBeatToPostBeat},CreateNewGlyph:function(renderer,beat){return new AlphaTab.Rendering.Glyphs.LineRangedGlyph(0,0,"PalmMute")}};$Inherit(AlphaTab.Rendering.Effects.PalmMuteEffectInfo,AlphaTab.Rendering.Effects.NoteEffectInfoBase);AlphaTab.Rendering.Effects.PickStrokeEffectInfo=function(){};AlphaTab.Rendering.Effects.PickStrokeEffectInfo.prototype={get_HideOnMultiTrack:function(){return false},ShouldCreateGlyph:function(renderer,beat){return beat.PickStroke!=AlphaTab.Model.PickStrokeType.None},get_SizingMode:function(){return AlphaTab.Rendering.EffectBarGlyphSizing.SingleOnBeatOnly},GetHeight:function(renderer){return 20*renderer.get_Scale()},CreateNewGlyph:function(renderer,beat){return new AlphaTab.Rendering.Glyphs.PickStrokeGlyph(0,0,beat.PickStroke)},CanExpand:function(renderer,from,to){return true}};AlphaTab.Rendering.Effects.TapEffectInfo=function(){};AlphaTab.Rendering.Effects.TapEffectInfo.prototype={get_HideOnMultiTrack:function(){return false},ShouldCreateGlyph:function(renderer,beat){return(beat.Slap||beat.Pop||beat.Tap)},get_SizingMode:function(){return AlphaTab.Rendering.EffectBarGlyphSizing.SingleOnBeatOnly},GetHeight:function(renderer){return 20*renderer.get_Scale()},CreateNewGlyph:function(renderer,beat){var res=renderer.get_Resources();if(beat.Slap){return new AlphaTab.Rendering.Glyphs.TextGlyph(0,0,"S",res.EffectFont)}if(beat.Pop){return new AlphaTab.Rendering.Glyphs.TextGlyph(0,0,"P",res.EffectFont)}return new AlphaTab.Rendering.Glyphs.TextGlyph(0,0,"T",res.EffectFont)},CanExpand:function(renderer,from,to){return true}};AlphaTab.Rendering.Effects.TempoEffectInfo=function(){};AlphaTab.Rendering.Effects.TempoEffectInfo.prototype={get_HideOnMultiTrack:function(){return true},ShouldCreateGlyph:function(renderer,beat){return beat.Index==0&&(beat.Voice.Bar.get_MasterBar().TempoAutomation!=null||beat.Voice.Bar.Index==0)},get_SizingMode:function(){return AlphaTab.Rendering.EffectBarGlyphSizing.SinglePreBeatOnly},GetHeight:function(renderer){return 25*renderer.get_Scale()},CreateNewGlyph:function(renderer,beat){var tempo;if(beat.Voice.Bar.get_MasterBar().TempoAutomation!=null){tempo=((beat.Voice.Bar.get_MasterBar().TempoAutomation.Value))|0}else{tempo=beat.Voice.Bar.Track.Score.Tempo}return new AlphaTab.Rendering.Glyphs.TempoGlyph(0,0,tempo)},CanExpand:function(renderer,from,to){return true}};AlphaTab.Rendering.Effects.TextEffectInfo=function(){};AlphaTab.Rendering.Effects.TextEffectInfo.prototype={get_HideOnMultiTrack:function(){return false},ShouldCreateGlyph:function(renderer,beat){return!AlphaTab.Platform.Std.IsNullOrWhiteSpace(beat.Text)},get_SizingMode:function(){return AlphaTab.Rendering.EffectBarGlyphSizing.SingleOnBeatOnly},GetHeight:function(renderer){return 20*renderer.get_Scale()},CreateNewGlyph:function(renderer,beat){return new AlphaTab.Rendering.Glyphs.TextGlyph(0,0,beat.Text,renderer.get_Resources().EffectFont)},CanExpand:function(renderer,from,to){return true}};AlphaTab.Rendering.Effects.TrillEffectInfo=function(){AlphaTab.Rendering.Effects.NoteEffectInfoBase.call(this)};AlphaTab.Rendering.Effects.TrillEffectInfo.prototype={ShouldCreateGlyphForNote:function(renderer,note){return note.get_IsTrill()},GetHeight:function(renderer){return 20*renderer.get_Scale()},get_SizingMode:function(){return AlphaTab.Rendering.EffectBarGlyphSizing.SingleOnBeatToPostBeat},CreateNewGlyph:function(renderer,beat){return new AlphaTab.Rendering.Glyphs.TrillGlyph(0,0,0.9)}};$Inherit(AlphaTab.Rendering.Effects.TrillEffectInfo,AlphaTab.Rendering.Effects.NoteEffectInfoBase);AlphaTab.Rendering.Effects.TripletFeelEffectInfo=function(){};AlphaTab.Rendering.Effects.TripletFeelEffectInfo.prototype={get_HideOnMultiTrack:function(){return true},ShouldCreateGlyph:function(renderer,beat){return beat.Index==0&&(beat.Voice.Bar.get_MasterBar().Index==0&&beat.Voice.Bar.get_MasterBar().TripletFeel!=AlphaTab.Model.TripletFeel.NoTripletFeel)||(beat.Voice.Bar.get_MasterBar().Index>0&&beat.Voice.Bar.get_MasterBar().TripletFeel!=beat.Voice.Bar.get_MasterBar().PreviousMasterBar.TripletFeel)},get_SizingMode:function(){return AlphaTab.Rendering.EffectBarGlyphSizing.SingleOnBeatOnly},GetHeight:function(renderer){return 20*renderer.get_Scale()},CreateNewGlyph:function(renderer,beat){return new AlphaTab.Rendering.Effects.DummyEffectGlyph(0,0,"TripletFeel")},CanExpand:function(renderer,from,to){return true}};AlphaTab.Rendering.Glyphs.MusicFontGlyph=function(x,y,scale,symbol){this._scale=0;this._symbol=AlphaTab.Rendering.Glyphs.MusicFontSymbol.None;AlphaTab.Rendering.Glyphs.EffectGlyph.call(this,x,y);this._scale=scale;this._symbol=symbol};AlphaTab.Rendering.Glyphs.MusicFontGlyph.prototype={Paint:function(cx,cy,canvas){canvas.FillMusicFontSymbol(cx+this.X,cy+this.Y,this._scale*this.get_Scale(),this._symbol)}};$Inherit(AlphaTab.Rendering.Glyphs.MusicFontGlyph,AlphaTab.Rendering.Glyphs.EffectGlyph);AlphaTab.Rendering.Glyphs.AccentuationGlyph=function(x,y,accentuation){AlphaTab.Rendering.Glyphs.MusicFontGlyph.call(this,x,y,1,AlphaTab.Rendering.Glyphs.AccentuationGlyph.GetSymbol(accentuation))};AlphaTab.Rendering.Glyphs.AccentuationGlyph.prototype={DoLayout:function(){this.Width=9*this.get_Scale()},get_CanScale:function(){return false}};AlphaTab.Rendering.Glyphs.AccentuationGlyph.GetSymbol=function(accentuation){switch(accentuation){case AlphaTab.Model.AccentuationType.None:return AlphaTab.Rendering.Glyphs.MusicFontSymbol.None;case AlphaTab.Model.AccentuationType.Normal:return AlphaTab.Rendering.Glyphs.MusicFontSymbol.Accentuation;case AlphaTab.Model.AccentuationType.Heavy:return AlphaTab.Rendering.Glyphs.MusicFontSymbol.HeavyAccentuation;default:return AlphaTab.Rendering.Glyphs.MusicFontSymbol.None}};$Inherit(AlphaTab.Rendering.Glyphs.AccentuationGlyph,AlphaTab.Rendering.Glyphs.MusicFontGlyph);AlphaTab.Rendering.Glyphs.GlyphGroup=function(x,y){this.Glyphs=null;AlphaTab.Rendering.Glyphs.Glyph.call(this,x,y)};AlphaTab.Rendering.Glyphs.GlyphGroup.prototype={DoLayout:function(){if(this.Glyphs==null||this.Glyphs.length==0){this.Width=0;return}var w=0;for(var i=0,j=this.Glyphs.length;ig.Y){gColumn++;if(gColumn==columns.length){columns.push(-3000)}}g.X=gColumn;columns[gColumn]=g.Y+accidentalSize}var columnWidth=8*this.get_Scale();if(this.Glyphs.length==0){this.Width=0}else{this.Width=columnWidth*columns.length}for(var i=0,j=this.Glyphs.length;i0)this.PreNotes.ApplyGlyphSpacing(diff);size=sizes.GetOnNoteSize(this.Beat.Start);diff=size-this.OnNotes.Width;this.OnNotes.X=this.PreNotes.X+this.PreNotes.Width;if(diff>0)this.OnNotes.ApplyGlyphSpacing(diff);size=sizes.GetPostNoteSize(this.Beat.Start);diff=size-this.PostNotes.Width;this.PostNotes.X=this.OnNotes.X+this.OnNotes.Width;if(diff>0)this.PostNotes.ApplyGlyphSpacing(diff);this.Width=this.CalculateWidth()},CalculateWidth:function(){return this.PostNotes.X+this.PostNotes.Width},DoLayout:function(){this.PreNotes.X=0;this.PreNotes.Index=0;this.PreNotes.Renderer=this.Renderer;this.PreNotes.Container=this;this.PreNotes.DoLayout();this.OnNotes.X=this.PreNotes.X+this.PreNotes.Width;this.OnNotes.Index=1;this.OnNotes.Renderer=this.Renderer;this.OnNotes.Container=this;this.OnNotes.DoLayout();this.PostNotes.X=this.OnNotes.X+this.OnNotes.Width;this.PostNotes.Index=2;this.PostNotes.Renderer=this.Renderer;this.PostNotes.Container=this;this.PostNotes.DoLayout();var i=this.Beat.Notes.length-1;while(i>=0){this.CreateTies(this.Beat.Notes[i--])}this.Width=this.CalculateWidth()},CreateTies:function(n){},Paint:function(cx,cy,canvas){this.PreNotes.Paint(cx+this.X,cy+this.Y,canvas);this.OnNotes.Paint(cx+this.X,cy+this.Y,canvas);this.PostNotes.Paint(cx+this.X,cy+this.Y,canvas);for(var i=0,j=this.Ties.length;i=0;i--){action(this.Container.Beat.Notes[i])}},get_BeatDurationWidth:function(){switch(this.Container.Beat.Duration){case AlphaTab.Model.Duration.Whole:return 103;case AlphaTab.Model.Duration.Half:return 45;case AlphaTab.Model.Duration.Quarter:return 29;case AlphaTab.Model.Duration.Eighth:return 19;case AlphaTab.Model.Duration.Sixteenth:return 11;case AlphaTab.Model.Duration.ThirtySecond:return 11;case AlphaTab.Model.Duration.SixtyFourth:return 11;default:return 11}},FinalizeGlyph:function(layout){}};$Inherit(AlphaTab.Rendering.Glyphs.BeatGlyphBase,AlphaTab.Rendering.Glyphs.GlyphGroup);AlphaTab.Rendering.Glyphs.BendGlyph=function(n,width,height){this._note=null;this._height=0;AlphaTab.Rendering.Glyphs.Glyph.call(this,0,0);this._note=n;this.Width=width;this._height=height};AlphaTab.Rendering.Glyphs.BendGlyph.prototype={Paint:function(cx,cy,canvas){var r=this.Renderer;var res=this.Renderer.get_Resources();var dX=this.Width/60;var maxValue=0;for(var i=0,j=this._note.BendPoints.length;imaxValue){maxValue=this._note.BendPoints[i].Value}}var dY=maxValue==0?0:this._height/maxValue;var xx=cx+this.X;var yy=cy+this.Y+r.GetNoteY(this._note);canvas.BeginPath();for(var i=0,j=this._note.BendPoints.length-1;ifirstPt.Value){canvas.BeginPath();canvas.MoveTo(x2,y2);canvas.LineTo(x2-arrowSize*0.5,y2+arrowSize);canvas.LineTo(x2+arrowSize*0.5,y2+arrowSize);canvas.ClosePath();canvas.Fill()}else if(secondPt.Value!=firstPt.Value){canvas.BeginPath();canvas.MoveTo(x2,y2);canvas.LineTo(x2-arrowSize*0.5,y2-arrowSize);canvas.LineTo(x2+arrowSize*0.5,y2-arrowSize);canvas.ClosePath();canvas.Fill()}canvas.Stroke();if(secondPt.Value!=0){var dV=(secondPt.Value-firstPt.Value);var up=dV>0;dV=Math.abs(dV);var s="";if(dV==4){s="full";dV-=4}else if(dV>4){s+=(dV/4)|0+" ";dV-=(dV/4)|0}if(dV>0){s+=dV+"/4"}if(s!=""){if(!up){s="-"+s}canvas.set_Font(res.TablatureFont);var size=canvas.MeasureText(s);var y=up?y2-res.TablatureFont.Size-(2*this.get_Scale()):y2+(2*this.get_Scale());var x=x2-size/2;canvas.FillText(s,x,y)}}}}};$Inherit(AlphaTab.Rendering.Glyphs.BendGlyph,AlphaTab.Rendering.Glyphs.Glyph);AlphaTab.Rendering.Glyphs.ChineseCymbalGlyph=function(x,y,isGrace){this._isGrace=false;AlphaTab.Rendering.Glyphs.MusicFontGlyph.call(this,x,y,isGrace?0.7:1,AlphaTab.Rendering.Glyphs.MusicFontSymbol.NoteHarmonic);this._isGrace=isGrace};AlphaTab.Rendering.Glyphs.ChineseCymbalGlyph.prototype={DoLayout:function(){this.Width=9*(this._isGrace?0.7:1)*this.get_Scale()},get_CanScale:function(){return false}};$Inherit(AlphaTab.Rendering.Glyphs.ChineseCymbalGlyph,AlphaTab.Rendering.Glyphs.MusicFontGlyph);AlphaTab.Rendering.Glyphs.CircleGlyph=function(x,y,size){this._size=0;AlphaTab.Rendering.Glyphs.Glyph.call(this,x,y);this._size=size};AlphaTab.Rendering.Glyphs.CircleGlyph.prototype={DoLayout:function(){this.Width=this._size+(3*this.get_Scale())},get_CanScale:function(){return false},Paint:function(cx,cy,canvas){canvas.FillCircle(cx+this.X,cy+this.Y,this._size)}};$Inherit(AlphaTab.Rendering.Glyphs.CircleGlyph,AlphaTab.Rendering.Glyphs.Glyph);AlphaTab.Rendering.Glyphs.ClefGlyph=function(x,y,clef){AlphaTab.Rendering.Glyphs.MusicFontGlyph.call(this,x,y,1,AlphaTab.Rendering.Glyphs.ClefGlyph.GetSymbol(clef))};AlphaTab.Rendering.Glyphs.ClefGlyph.prototype={DoLayout:function(){this.Width=28*this.get_Scale()},get_CanScale:function(){return false}};AlphaTab.Rendering.Glyphs.ClefGlyph.GetSymbol=function(clef){switch(clef){case AlphaTab.Model.Clef.Neutral:return AlphaTab.Rendering.Glyphs.MusicFontSymbol.ClefNeutral;case AlphaTab.Model.Clef.C3:return AlphaTab.Rendering.Glyphs.MusicFontSymbol.ClefC;case AlphaTab.Model.Clef.C4:return AlphaTab.Rendering.Glyphs.MusicFontSymbol.ClefC;case AlphaTab.Model.Clef.F4:return AlphaTab.Rendering.Glyphs.MusicFontSymbol.ClefF;case AlphaTab.Model.Clef.G2:return AlphaTab.Rendering.Glyphs.MusicFontSymbol.ClefG;default:return AlphaTab.Rendering.Glyphs.MusicFontSymbol.None}};$Inherit(AlphaTab.Rendering.Glyphs.ClefGlyph,AlphaTab.Rendering.Glyphs.MusicFontGlyph);AlphaTab.Rendering.Glyphs.CrescendoGlyph=function(x,y,crescendo){this._crescendo=AlphaTab.Model.CrescendoType.None;AlphaTab.Rendering.Glyphs.EffectGlyph.call(this,x,y);this._crescendo=crescendo};AlphaTab.Rendering.Glyphs.CrescendoGlyph.prototype={Paint:function(cx,cy,canvas){var height=17*this.get_Scale();canvas.BeginPath();if(this._crescendo==AlphaTab.Model.CrescendoType.Crescendo){canvas.MoveTo(cx+this.X+this.Width,cy+this.Y);canvas.LineTo(cx+this.X,cy+this.Y+(height/2));canvas.LineTo(cx+this.X+this.Width,cy+this.Y+height)}else{canvas.MoveTo(cx+this.X,cy+this.Y);canvas.LineTo(cx+this.X+this.Width,cy+this.Y+(height/2));canvas.LineTo(cx+this.X,cy+this.Y+height)}canvas.Stroke()}};$StaticConstructor(function(){AlphaTab.Rendering.Glyphs.CrescendoGlyph.Height=17});$Inherit(AlphaTab.Rendering.Glyphs.CrescendoGlyph,AlphaTab.Rendering.Glyphs.EffectGlyph);AlphaTab.Rendering.Glyphs.DeadNoteHeadGlyph=function(x,y,isGrace){this._isGrace=false;AlphaTab.Rendering.Glyphs.MusicFontGlyph.call(this,x,y,isGrace?0.7:1,AlphaTab.Rendering.Glyphs.MusicFontSymbol.NoteDead);this._isGrace=isGrace};AlphaTab.Rendering.Glyphs.DeadNoteHeadGlyph.prototype={DoLayout:function(){this.Width=9*(this._isGrace?0.7:1)*this.get_Scale()},get_CanScale:function(){return false}};$Inherit(AlphaTab.Rendering.Glyphs.DeadNoteHeadGlyph,AlphaTab.Rendering.Glyphs.MusicFontGlyph);AlphaTab.Rendering.Glyphs.DiamondNoteHeadGlyph=function(x,y,isGrace){this._isGrace=false;AlphaTab.Rendering.Glyphs.MusicFontGlyph.call(this,x,y,isGrace?0.7:1,AlphaTab.Rendering.Glyphs.MusicFontSymbol.NoteHarmonic);this._isGrace=isGrace};AlphaTab.Rendering.Glyphs.DiamondNoteHeadGlyph.prototype={DoLayout:function(){this.Width=9*(this._isGrace?0.7:1)*this.get_Scale()},get_CanScale:function(){return false}};$Inherit(AlphaTab.Rendering.Glyphs.DiamondNoteHeadGlyph,AlphaTab.Rendering.Glyphs.MusicFontGlyph);AlphaTab.Rendering.Glyphs.DigitGlyph=function(x,y,digit){this._digit=0;AlphaTab.Rendering.Glyphs.MusicFontGlyph.call(this,x,y,1,AlphaTab.Rendering.Glyphs.DigitGlyph.GetSymbol(digit));this._digit=digit};AlphaTab.Rendering.Glyphs.DigitGlyph.prototype={DoLayout:function(){this.Y+=7*this.get_Scale();this.Width=this.GetDigitWidth(this._digit)*this.get_Scale()},GetDigitWidth:function(digit){switch(digit){case 0:case 2:case 3:case 4:case 5:case 6:case 7:case 8:case 9:return 14;case 1:return 10;default:return 0}},get_CanScale:function(){return false}};AlphaTab.Rendering.Glyphs.DigitGlyph.GetSymbol=function(digit){switch(digit){case 0:return AlphaTab.Rendering.Glyphs.MusicFontSymbol.Num0;case 1:return AlphaTab.Rendering.Glyphs.MusicFontSymbol.Num1;case 2:return AlphaTab.Rendering.Glyphs.MusicFontSymbol.Num2;case 3:return AlphaTab.Rendering.Glyphs.MusicFontSymbol.Num3;case 4:return AlphaTab.Rendering.Glyphs.MusicFontSymbol.Num4;case 5:return AlphaTab.Rendering.Glyphs.MusicFontSymbol.Num5;case 6:return AlphaTab.Rendering.Glyphs.MusicFontSymbol.Num6;case 7:return AlphaTab.Rendering.Glyphs.MusicFontSymbol.Num7;case 8:return AlphaTab.Rendering.Glyphs.MusicFontSymbol.Num8;case 9:return AlphaTab.Rendering.Glyphs.MusicFontSymbol.Num9;default:return AlphaTab.Rendering.Glyphs.MusicFontSymbol.None}};$Inherit(AlphaTab.Rendering.Glyphs.DigitGlyph,AlphaTab.Rendering.Glyphs.MusicFontGlyph);AlphaTab.Rendering.Glyphs.DrumSticksGlyph=function(x,y,isGrace){this._isGrace=false;AlphaTab.Rendering.Glyphs.MusicFontGlyph.call(this,x,y,isGrace?0.7:1,AlphaTab.Rendering.Glyphs.MusicFontSymbol.NoteSideStick);this._isGrace=isGrace};AlphaTab.Rendering.Glyphs.DrumSticksGlyph.prototype={DoLayout:function(){this.Width=9*(this._isGrace?0.7:1)*this.get_Scale()},get_CanScale:function(){return false}};$Inherit(AlphaTab.Rendering.Glyphs.DrumSticksGlyph,AlphaTab.Rendering.Glyphs.MusicFontGlyph);AlphaTab.Rendering.Glyphs.DynamicsGlyph=function(x,y,dynamics){this._dynamics=AlphaTab.Model.DynamicValue.PPP;AlphaTab.Rendering.Glyphs.EffectGlyph.call(this,x,y);this._dynamics=dynamics};AlphaTab.Rendering.Glyphs.DynamicsGlyph.prototype={Paint:function(cx,cy,canvas){var glyphs;switch(this._dynamics){case AlphaTab.Model.DynamicValue.PPP:glyphs=[this.get_P(),this.get_P(),this.get_P()];break;case AlphaTab.Model.DynamicValue.PP:glyphs=[this.get_P(),this.get_P()];break;case AlphaTab.Model.DynamicValue.P:glyphs=[this.get_P()];break;case AlphaTab.Model.DynamicValue.MP:glyphs=[this.get_M(),this.get_P()];break;case AlphaTab.Model.DynamicValue.MF:glyphs=[this.get_M(),this.get_F()];break;case AlphaTab.Model.DynamicValue.F:glyphs=[this.get_F()];break;case AlphaTab.Model.DynamicValue.FF:glyphs=[this.get_F(),this.get_F()];break;case AlphaTab.Model.DynamicValue.FFF:glyphs=[this.get_F(),this.get_F(),this.get_F()];break;default:return}var glyphWidth=0;for(var $i44=0,$l44=glyphs.length,g=glyphs[$i44];$i44<$l44;$i44++,g=glyphs[$i44]){glyphWidth+=g.Width}var startX=(this.Width-glyphWidth)/2;for(var $i45=0,$l45=glyphs.length,g=glyphs[$i45];$i45<$l45;$i45++,g=glyphs[$i45]){g.X=startX;g.Y=0;g.Renderer=this.Renderer;g.Paint(cx+this.X,cy+this.Y,canvas);startX+=g.Width}},get_P:function(){var p=new AlphaTab.Rendering.Glyphs.MusicFontGlyph(0,0,0.8,AlphaTab.Rendering.Glyphs.MusicFontSymbol.DynamicP);p.Width=7*this.get_Scale();return p},get_M:function(){var m=new AlphaTab.Rendering.Glyphs.MusicFontGlyph(0,0,0.8,AlphaTab.Rendering.Glyphs.MusicFontSymbol.DynamicM);m.Width=7*this.get_Scale();return m},get_F:function(){var f=new AlphaTab.Rendering.Glyphs.MusicFontGlyph(0,0,0.8,AlphaTab.Rendering.Glyphs.MusicFontSymbol.DynamicF);f.Width=7*this.get_Scale();return f}};$StaticConstructor(function(){AlphaTab.Rendering.Glyphs.DynamicsGlyph.GlyphScale=0.8});$Inherit(AlphaTab.Rendering.Glyphs.DynamicsGlyph,AlphaTab.Rendering.Glyphs.EffectGlyph);AlphaTab.Rendering.Glyphs.FadeInGlyph=function(x,y){AlphaTab.Rendering.Glyphs.EffectGlyph.call(this,x,y)};AlphaTab.Rendering.Glyphs.FadeInGlyph.prototype={Paint:function(cx,cy,canvas){var size=6*this.get_Scale();canvas.BeginPath();canvas.MoveTo(cx+this.X,cy+this.Y);canvas.QuadraticCurveTo(cx+this.X+(this.Width/2),cy+this.Y,cx+this.X+this.Width,cy+this.Y-size);canvas.MoveTo(cx+this.X,cy+this.Y);canvas.QuadraticCurveTo(cx+this.X+(this.Width/2),cy+this.Y,cx+this.X+this.Width,cy+this.Y+size);canvas.Stroke()}};$Inherit(AlphaTab.Rendering.Glyphs.FadeInGlyph,AlphaTab.Rendering.Glyphs.EffectGlyph);AlphaTab.Rendering.Glyphs.FlatGlyph=function(x,y,isGrace){this._isGrace=false;AlphaTab.Rendering.Glyphs.MusicFontGlyph.call(this,x,y,isGrace?0.7:1,AlphaTab.Rendering.Glyphs.MusicFontSymbol.AccidentalFlat);this._isGrace=isGrace};AlphaTab.Rendering.Glyphs.FlatGlyph.prototype={DoLayout:function(){this.Width=8*(this._isGrace?0.7:1)*this.get_Scale()},get_CanScale:function(){return false}};$Inherit(AlphaTab.Rendering.Glyphs.FlatGlyph,AlphaTab.Rendering.Glyphs.MusicFontGlyph);AlphaTab.Rendering.Glyphs.HiHatGlyph=function(x,y,isGrace){this._isGrace=false;AlphaTab.Rendering.Glyphs.MusicFontGlyph.call(this,x,y,isGrace?0.7:1,AlphaTab.Rendering.Glyphs.MusicFontSymbol.NoteHiHat);this._isGrace=isGrace};AlphaTab.Rendering.Glyphs.HiHatGlyph.prototype={DoLayout:function(){this.Width=9*(this._isGrace?0.7:1)*this.get_Scale()},get_CanScale:function(){return false}};$Inherit(AlphaTab.Rendering.Glyphs.HiHatGlyph,AlphaTab.Rendering.Glyphs.MusicFontGlyph);AlphaTab.Rendering.Glyphs.SvgCommand=function(){this.Cmd=null;this.Numbers=null};AlphaTab.Rendering.Glyphs.LazySvg=function(raw){this._raw=null;this._parsed=null;this._raw=raw};AlphaTab.Rendering.Glyphs.LazySvg.prototype={get_Commands:function(){if(this._parsed==null)this.Parse();return this._parsed},Parse:function(){var parser=new AlphaTab.Rendering.Utils.SvgPathParser(this._raw);parser.Reset();this._parsed=[];while(!parser.get_Eof()){var command=new AlphaTab.Rendering.Glyphs.SvgCommand();this._parsed.push(command);command.Cmd=parser.GetString();switch(command.Cmd){case"M":command.Numbers=[];command.Numbers.push(parser.GetNumber());command.Numbers.push(parser.GetNumber());break;case"m":command.Numbers=[];command.Numbers.push(parser.GetNumber());command.Numbers.push(parser.GetNumber());break;case"Z":case"z":break;case"L":command.Numbers=[];do{command.Numbers.push(parser.GetNumber());command.Numbers.push(parser.GetNumber())}while(parser.get_CurrentTokenIsNumber())break;case"l":command.Numbers=[];do{command.Numbers.push(parser.GetNumber());command.Numbers.push(parser.GetNumber())}while(parser.get_CurrentTokenIsNumber())break;case"V":command.Numbers=[];do{command.Numbers.push(parser.GetNumber())}while(parser.get_CurrentTokenIsNumber())break;case"v":command.Numbers=[];do{command.Numbers.push(parser.GetNumber())}while(parser.get_CurrentTokenIsNumber())break;case"H":command.Numbers=[];do{command.Numbers.push(parser.GetNumber())}while(parser.get_CurrentTokenIsNumber())break;case"h":command.Numbers=[];do{command.Numbers.push(parser.GetNumber())}while(parser.get_CurrentTokenIsNumber())break;case"C":command.Numbers=[];do{command.Numbers.push(parser.GetNumber());command.Numbers.push(parser.GetNumber());command.Numbers.push(parser.GetNumber());command.Numbers.push(parser.GetNumber());command.Numbers.push(parser.GetNumber());command.Numbers.push(parser.GetNumber())}while(parser.get_CurrentTokenIsNumber())break;case"c":command.Numbers=[];do{command.Numbers.push(parser.GetNumber());command.Numbers.push(parser.GetNumber());command.Numbers.push(parser.GetNumber());command.Numbers.push(parser.GetNumber());command.Numbers.push(parser.GetNumber());command.Numbers.push(parser.GetNumber())}while(parser.get_CurrentTokenIsNumber())break;case"S":command.Numbers=[];do{command.Numbers.push(parser.GetNumber());command.Numbers.push(parser.GetNumber());command.Numbers.push(parser.GetNumber());command.Numbers.push(parser.GetNumber())}while(parser.get_CurrentTokenIsNumber())break;case"s":command.Numbers=[];do{command.Numbers.push(parser.GetNumber());command.Numbers.push(parser.GetNumber());command.Numbers.push(parser.GetNumber());command.Numbers.push(parser.GetNumber())}while(parser.get_CurrentTokenIsNumber())break;case"Q":command.Numbers=[];do{command.Numbers.push(parser.GetNumber());command.Numbers.push(parser.GetNumber());command.Numbers.push(parser.GetNumber());command.Numbers.push(parser.GetNumber())}while(parser.get_CurrentTokenIsNumber())break;case"q":command.Numbers=[];do{command.Numbers.push(parser.GetNumber());command.Numbers.push(parser.GetNumber());command.Numbers.push(parser.GetNumber());command.Numbers.push(parser.GetNumber())}while(parser.get_CurrentTokenIsNumber())break;case"T":command.Numbers=[];do{command.Numbers.push(parser.GetNumber());command.Numbers.push(parser.GetNumber())}while(parser.get_CurrentTokenIsNumber())break;case"t":command.Numbers=[];do{command.Numbers.push(parser.GetNumber());command.Numbers.push(parser.GetNumber())}while(parser.get_CurrentTokenIsNumber())break}}this._raw=null}};AlphaTab.Rendering.Glyphs.LineRangedGlyph=function(x,y,label){this._isExpanded=false;this._label=null;AlphaTab.Rendering.Glyphs.EffectGlyph.call(this,x,y);this._label=label};AlphaTab.Rendering.Glyphs.LineRangedGlyph.prototype={ExpandTo:function(beat){this._isExpanded=true},Paint:function(cx,cy,canvas){var res=this.Renderer.get_Resources();canvas.set_Font(res.EffectFont);canvas.set_TextAlign(AlphaTab.Platform.Model.TextAlign.Left);var textWidth=canvas.MeasureText(this._label);canvas.FillText(this._label,cx+this.X,cy+this.Y);if(this._isExpanded){var lineSpacing=3*this.get_Scale();var startX=cx+this.X+textWidth+lineSpacing;var endX=cx+this.X+this.Width-lineSpacing-lineSpacing;var lineY=cy+this.Y+(8*this.get_Scale());var lineSize=8*this.get_Scale();if(endX>startX){var lineX=startX;while(lineX0){var num=i%10;var gl=new AlphaTab.Rendering.Glyphs.DigitGlyph(0,0,num);this.AddGlyph(gl);i=(i/10)|0}this.Glyphs.reverse();var cx=0;for(var j=0,k=this.Glyphs.length;j0){this.AddGlyph(new AlphaTab.Rendering.Glyphs.SpacingGlyph(0,0,5*this.get_Scale(),false));for(var i=0;i0){this.AddGlyph(new AlphaTab.Rendering.Glyphs.SpacingGlyph(0,0,5*this.get_Scale(),false));for(var i=0;i=67||AlphaTab.Rendering.Glyphs.ScoreBeatGlyph.NormalKeys.hasOwnProperty(value)){return new AlphaTab.Rendering.Glyphs.NoteHeadGlyph(0,0,AlphaTab.Model.Duration.Quarter,isGrace)}if(AlphaTab.Rendering.Glyphs.ScoreBeatGlyph.XKeys.hasOwnProperty(value)){return new AlphaTab.Rendering.Glyphs.DrumSticksGlyph(0,0,isGrace)}if(value==46){return new AlphaTab.Rendering.Glyphs.HiHatGlyph(0,0,isGrace)}if(value==49||value==57){return new AlphaTab.Rendering.Glyphs.DiamondNoteHeadGlyph(0,0,isGrace)}if(value==52){return new AlphaTab.Rendering.Glyphs.ChineseCymbalGlyph(0,0,isGrace)}if(value==51||value==53||value==59){return new AlphaTab.Rendering.Glyphs.RideCymbalGlyph(0,0,isGrace)}return new AlphaTab.Rendering.Glyphs.NoteHeadGlyph(0,0,AlphaTab.Model.Duration.Quarter,isGrace)}if(n.IsDead){return new AlphaTab.Rendering.Glyphs.DeadNoteHeadGlyph(0,0,isGrace)}if(n.HarmonicType==AlphaTab.Model.HarmonicType.None){return new AlphaTab.Rendering.Glyphs.NoteHeadGlyph(0,0,n.Beat.Duration,isGrace)}return new AlphaTab.Rendering.Glyphs.DiamondNoteHeadGlyph(0,0,isGrace)},CreateNoteGlyph:function(n){var sr=this.Renderer;var noteHeadGlyph=this.CreateNoteHeadGlyph(n);var line=sr.GetNoteLine(n);noteHeadGlyph.Y=sr.GetScoreY(line,-1);this.NoteHeads.AddNoteGlyph(noteHeadGlyph,n,line);if(n.IsStaccato&&!this.NoteHeads.BeatEffects.hasOwnProperty("Staccato")){this.NoteHeads.BeatEffects["Staccato"]=new AlphaTab.Rendering.Glyphs.CircleGlyph(0,0,1.5)}if(n.Accentuated==AlphaTab.Model.AccentuationType.Normal&&!this.NoteHeads.BeatEffects.hasOwnProperty("Accent")){this.NoteHeads.BeatEffects["Accent"]=new AlphaTab.Rendering.Glyphs.AccentuationGlyph(0,0,AlphaTab.Model.AccentuationType.Normal)}if(n.Accentuated==AlphaTab.Model.AccentuationType.Heavy&&!this.NoteHeads.BeatEffects.hasOwnProperty("HAccent")){this.NoteHeads.BeatEffects["HAccent"]=new AlphaTab.Rendering.Glyphs.AccentuationGlyph(0,0,AlphaTab.Model.AccentuationType.Heavy)}}};$StaticConstructor(function(){AlphaTab.Rendering.Glyphs.ScoreBeatGlyph.NormalKeys=null;AlphaTab.Rendering.Glyphs.ScoreBeatGlyph.XKeys=null;AlphaTab.Rendering.Glyphs.ScoreBeatGlyph.NormalKeys={};var normalKeyNotes=new Int32Array([32,34,35,36,38,39,40,41,43,45,47,48,50,55,56,58,60,61]);for(var i=0;iinfo.Line){this.MinNote=info}if(this.MaxNote==null||this.MaxNote.Line8},DoLayout:function(){this._infos.sort($CreateAnonymousDelegate(this,function(a,b){return(a.Line-b.Line)}));var padding=0;var displacedX=0;var lastDisplaced=false;var lastLine=0;var anyDisplaced=false;var w=0;for(var i=0,j=this._infos.length;i=this.MinNote.Line){var lY=cy+this.Y+scoreRenderer.GetScoreY(l+1,-1);canvas.BeginPath();canvas.MoveTo(cx+this.X-linePadding,lY);canvas.LineTo(cx+this.X+this.Width+linePadding,lY);canvas.Stroke();l-=2}}if(this.get_HasBottomOverflow()){var l=11;while(l<=this.MaxNote.Line){var lY=cy+this.Y+scoreRenderer.GetScoreY(l+1,-1);canvas.BeginPath();canvas.MoveTo(cx+this.X-linePadding,lY);canvas.LineTo(cx+this.X+this.Width+linePadding,lY);canvas.Stroke();l+=2}}canvas.set_Color(this.Renderer.get_Layout().Renderer.RenderingResources.MainGlyphColor);if(this._tremoloPicking!=null)this._tremoloPicking.Paint(cx+this.X,cy+this.Y,canvas);for(var i=0,j=this._infos.length;ix1){var t=x1;x1=x2;x2=t;t=y1;y1=y2;y2=t}var offset=15*scale;var size=4*scale;var normalVectorX=(y2-y1);var normalVectorY=(x2-x1);var length=Math.sqrt((normalVectorX*normalVectorX)+(normalVectorY*normalVectorY));if(down)normalVectorX*=-1;else normalVectorY*=-1;normalVectorX/=length;normalVectorY/=length;var centerX=(x2+x1)/2;var centerY=(y2+y1)/2;var cp1X=centerX+(offset*normalVectorX);var cp1Y=centerY+(offset*normalVectorY);var cp2X=centerX+((offset-size)*normalVectorX);var cp2Y=centerY+((offset-size)*normalVectorY);canvas.BeginPath();canvas.MoveTo(x1,y1);canvas.QuadraticCurveTo(cp1X,cp1Y,x2,y2);canvas.QuadraticCurveTo(cp2X,cp2Y,x1,y1);canvas.ClosePath()};$Inherit(AlphaTab.Rendering.Glyphs.TieGlyph,AlphaTab.Rendering.Glyphs.Glyph);AlphaTab.Rendering.Glyphs.ScoreTieGlyph=function(startNote,endNote,parent,forEnd){AlphaTab.Rendering.Glyphs.TieGlyph.call(this,startNote,endNote,parent,forEnd)};AlphaTab.Rendering.Glyphs.ScoreTieGlyph.prototype={DoLayout:function(){AlphaTab.Rendering.Glyphs.TieGlyph.prototype.DoLayout.call(this);this.YOffset=(4.5)},GetBeamDirection:function(note,noteRenderer){return(noteRenderer).GetBeatDirection(note.Beat)}};$Inherit(AlphaTab.Rendering.Glyphs.ScoreTieGlyph,AlphaTab.Rendering.Glyphs.TieGlyph);AlphaTab.Rendering.Glyphs.SharpGlyph=function(x,y,isGrace){this._isGrace=false;AlphaTab.Rendering.Glyphs.MusicFontGlyph.call(this,x,y,isGrace?0.7:1,AlphaTab.Rendering.Glyphs.MusicFontSymbol.AccidentalSharp);this._isGrace=isGrace};AlphaTab.Rendering.Glyphs.SharpGlyph.prototype={DoLayout:function(){this.Width=8*(this._isGrace?0.7:1)*this.get_Scale()},get_CanScale:function(){return false}};$Inherit(AlphaTab.Rendering.Glyphs.SharpGlyph,AlphaTab.Rendering.Glyphs.MusicFontGlyph);AlphaTab.Rendering.Glyphs.SpacingGlyph=function(x,y,width,scaling){this._scaling=false;AlphaTab.Rendering.Glyphs.Glyph.call(this,x,y);this._scaling=scaling;this.Width=width;this._scaling=scaling};AlphaTab.Rendering.Glyphs.SpacingGlyph.prototype={get_CanScale:function(){return this._scaling}};$Inherit(AlphaTab.Rendering.Glyphs.SpacingGlyph,AlphaTab.Rendering.Glyphs.Glyph);AlphaTab.Rendering.Glyphs.TabBeatContainerGlyph=function(beat){AlphaTab.Rendering.Glyphs.BeatContainerGlyph.call(this,beat)};AlphaTab.Rendering.Glyphs.TabBeatContainerGlyph.prototype={CreateTies:function(n){if(n.IsHammerPullOrigin){var tie=new AlphaTab.Rendering.Glyphs.TabTieGlyph(n,n.HammerPullDestination,this,false);this.Ties.push(tie)}else if(n.SlideType==AlphaTab.Model.SlideType.Legato){var tie=new AlphaTab.Rendering.Glyphs.TabTieGlyph(n,n.SlideTarget,this,false);this.Ties.push(tie)}if(n.SlideType!=AlphaTab.Model.SlideType.None){var l=new AlphaTab.Rendering.Glyphs.TabSlideLineGlyph(n.SlideType,n,this);this.Ties.push(l)}}};$Inherit(AlphaTab.Rendering.Glyphs.TabBeatContainerGlyph,AlphaTab.Rendering.Glyphs.BeatContainerGlyph);AlphaTab.Rendering.Glyphs.TabBeatGlyph=function(){this.NoteNumbers=null;this.BeamingHelper=null;AlphaTab.Rendering.Glyphs.BeatGlyphBase.call(this)};AlphaTab.Rendering.Glyphs.TabBeatGlyph.prototype={DoLayout:function(){if(!this.Container.Beat.get_IsRest()){this.NoteNumbers=new AlphaTab.Rendering.Glyphs.TabNoteChordGlyph(0,0,this.Container.Beat.GraceType!=AlphaTab.Model.GraceType.None);this.NoteNumbers.Beat=this.Container.Beat;this.NoteNumbers.BeamingHelper=this.BeamingHelper;this.NoteLoop($CreateDelegate(this,this.CreateNoteGlyph));this.AddGlyph(this.NoteNumbers);if(this.Container.Beat.get_HasWhammyBar()&&!this.NoteNumbers.BeatEffects.hasOwnProperty("Whammy")){this.NoteNumbers.BeatEffects["Whammy"]=new AlphaTab.Rendering.Glyphs.WhammyBarGlyph(this.Container.Beat,this.Container)}if(this.Container.Beat.get_IsTremolo()&&!this.NoteNumbers.BeatEffects.hasOwnProperty("Tremolo")){this.NoteNumbers.BeatEffects["Tremolo"]=new AlphaTab.Rendering.Glyphs.TremoloPickingGlyph(0,0,this.Container.Beat.TremoloSpeed)}}if(this.Glyphs==null)return;var w=0;for(var i=0,j=this.Glyphs.length;iw){w=g.Width}}var tabHeight=this.Renderer.get_Resources().TablatureFont.Size;var effectY=this.GetNoteY(this._minNote)+tabHeight/2;var effectSpacing=7*this.get_Scale();AlphaTab.Platform.Std.Foreach(AlphaTab.Rendering.Glyphs.Glyph,this.BeatEffects,$CreateAnonymousDelegate(this,function(g){g.Y=effectY;g.X=this.Width/2;g.Renderer=this.Renderer;effectY+=effectSpacing;g.DoLayout()}));this._centerX=0;this.Width=w},AddNoteGlyph:function(noteGlyph,note){this._notes.push(noteGlyph);this._noteLookup[note.String]=noteGlyph;if(this._minNote==null||note.Stringthis._startNote.Fret){startOffsetY=sizeY;endOffsetY=sizeY*-1}else{startOffsetY=sizeY*-1;endOffsetY=sizeY}startX=cx+r.GetNoteX(this._startNote,true);startY=cy+r.GetNoteY(this._startNote)+startOffsetY;if(this._startNote.SlideTarget!=null){endX=cx+r.GetNoteX(this._startNote.SlideTarget,false);endY=cy+r.GetNoteY(this._startNote.SlideTarget)+endOffsetY}else{endX=cx+this._parent.X+this._parent.PostNotes.X+this._parent.PostNotes.Width;endY=startY}break;case AlphaTab.Model.SlideType.IntoFromBelow:endX=cx+r.GetNoteX(this._startNote,false);endY=cy+r.GetNoteY(this._startNote);startX=endX-sizeX;startY=cy+r.GetNoteY(this._startNote)+sizeY;break;case AlphaTab.Model.SlideType.IntoFromAbove:endX=cx+r.GetNoteX(this._startNote,false);endY=cy+r.GetNoteY(this._startNote);startX=endX-sizeX;startY=cy+r.GetNoteY(this._startNote)-sizeY;break;case AlphaTab.Model.SlideType.OutUp:startX=cx+r.GetNoteX(this._startNote,true);startY=cy+r.GetNoteY(this._startNote);endX=startX+sizeX;endY=cy+r.GetNoteY(this._startNote)-sizeY;break;case AlphaTab.Model.SlideType.OutDown:startX=cx+r.GetNoteX(this._startNote,true);startY=cy+r.GetNoteY(this._startNote);endX=startX+sizeX;endY=cy+r.GetNoteY(this._startNote)+sizeY;break;default:return}canvas.BeginPath();canvas.MoveTo(startX,startY);canvas.LineTo(endX,endY);canvas.Stroke()}};$Inherit(AlphaTab.Rendering.Glyphs.TabSlideLineGlyph,AlphaTab.Rendering.Glyphs.Glyph);AlphaTab.Rendering.Glyphs.TabTieGlyph=function(startNote,endNote,parent,forEnd){AlphaTab.Rendering.Glyphs.TieGlyph.call(this,startNote,endNote,parent,forEnd)};AlphaTab.Rendering.Glyphs.TabTieGlyph.prototype={GetBeamDirection:function(note,noteRenderer){return this.StartNote.String>3?AlphaTab.Rendering.Utils.BeamDirection.Down:AlphaTab.Rendering.Utils.BeamDirection.Up}};$Inherit(AlphaTab.Rendering.Glyphs.TabTieGlyph,AlphaTab.Rendering.Glyphs.TieGlyph);AlphaTab.Rendering.Glyphs.TempoGlyph=function(x,y,tempo){this._tempo=0;AlphaTab.Rendering.Glyphs.EffectGlyph.call(this,x,y);this._tempo=tempo};AlphaTab.Rendering.Glyphs.TempoGlyph.prototype={Paint:function(cx,cy,canvas){var res=this.Renderer.get_Resources();canvas.set_Font(res.MarkerFont);canvas.FillMusicFontSymbol(cx+this.X,cy+this.Y,1,AlphaTab.Rendering.Glyphs.MusicFontSymbol.Tempo);canvas.FillText(""+this._tempo,cx+this.X+(30*this.get_Scale()),cy+this.X+(7*this.get_Scale()))}};$Inherit(AlphaTab.Rendering.Glyphs.TempoGlyph,AlphaTab.Rendering.Glyphs.EffectGlyph);AlphaTab.Rendering.Glyphs.TextGlyph=function(x,y,text,font){this._text=null;this._font=null;AlphaTab.Rendering.Glyphs.EffectGlyph.call(this,x,y);this._text=text;this._font=font};AlphaTab.Rendering.Glyphs.TextGlyph.prototype={Paint:function(cx,cy,canvas){canvas.set_Font(this._font);var old=canvas.get_TextAlign();canvas.set_TextAlign(AlphaTab.Platform.Model.TextAlign.Left);canvas.FillText(this._text,cx+this.X,cy+this.Y);canvas.set_TextAlign(old)}};$Inherit(AlphaTab.Rendering.Glyphs.TextGlyph,AlphaTab.Rendering.Glyphs.EffectGlyph);AlphaTab.Rendering.Glyphs.TimeSignatureGlyph=function(x,y,numerator,denominator){this._numerator=0;this._denominator=0;AlphaTab.Rendering.Glyphs.GlyphGroup.call(this,x,y);this._numerator=numerator;this._denominator=denominator};AlphaTab.Rendering.Glyphs.TimeSignatureGlyph.prototype={get_CanScale:function(){return false},DoLayout:function(){var numerator=new AlphaTab.Rendering.Glyphs.NumberGlyph(0,0,this._numerator);var denominator=new AlphaTab.Rendering.Glyphs.NumberGlyph(0,18*this.get_Scale(),this._denominator);this.AddGlyph(numerator);this.AddGlyph(denominator);AlphaTab.Rendering.Glyphs.GlyphGroup.prototype.DoLayout.call(this);for(var i=0,j=this.Glyphs.length;i0){this.Width=this.BeatGlyphs[this.BeatGlyphs.length-1].X+this.BeatGlyphs[this.BeatGlyphs.length-1].Width}},AddGlyph:function(g){g.X=this.BeatGlyphs.length==0?0:this.BeatGlyphs[this.BeatGlyphs.length-1].X+this.BeatGlyphs[this.BeatGlyphs.length-1].Width;g.Index=this.BeatGlyphs.length;g.Renderer=this.Renderer;g.DoLayout();this.BeatGlyphs.push(g);this.Width=g.X+g.Width},DoLayout:function(){},FinalizeGlyph:function(layout){for(var i=0,j=this.BeatGlyphs.length;i=2){var dy=sizeY/24;for(var i=0,j=this._beat.WhammyBarPoints.length;imaxY)maxY=ptY;if(ptY0)tabBarRenderer.RegisterOverflowBottom(Math.abs(absMaxY))},Paint:function(cx,cy,canvas){var tabBarRenderer=this.Renderer;var res=this.Renderer.get_Resources();var startX=cx+this.X+this._parent.OnNotes.Width/2;var endX=this._beat.NextBeat==null||this._beat.Voice!=this._beat.NextBeat.Voice?cx+this.X+this._parent.OnNotes.Width/2+this._parent.PostNotes.Width:cx+tabBarRenderer.GetBeatX(this._beat.NextBeat);var startY=cy+this.X;var textOffset=3*this.get_Scale();var sizeY=60*this.get_Scale();var old=canvas.get_TextAlign();canvas.set_TextAlign(AlphaTab.Platform.Model.TextAlign.Center);if(this._beat.WhammyBarPoints.length>=2){var dx=(endX-startX)/60;var dy=sizeY/24;canvas.BeginPath();for(var i=0,j=this._beat.WhammyBarPoints.length-1;i=0;var s="";if(dv<0)s+="-";if(dv>=1||dv<=-1)s+=Math.abs(dv)+" ";dv-=dv|0;if(dv==0.25)s+="1/4";else if(dv==0.5)s+="1/2";else if(dv==0.75)s+="3/4";canvas.set_Font(res.GraceFont);var sy=up?pt2Y-res.GraceFont.Size-textOffset:pt2Y+textOffset;var sx=pt2X;canvas.FillText(s,sx,sy)}}canvas.Stroke()}canvas.set_TextAlign(old)}};$StaticConstructor(function(){AlphaTab.Rendering.Glyphs.WhammyBarGlyph.WhammyMaxOffset=60});$Inherit(AlphaTab.Rendering.Glyphs.WhammyBarGlyph,AlphaTab.Rendering.Glyphs.Glyph);AlphaTab.Rendering.RenderFinishedEventArgs=function(){this.Width=0;this.Height=0;this.RenderResult=null};AlphaTab.Rendering.Layout=AlphaTab.Rendering.Layout||{};AlphaTab.Rendering.Layout.HeaderFooterElements={None:0,Title:1,SubTitle:2,Artist:4,Album:8,Words:16,Music:32,WordsAndMusic:64,Copyright:128,PageNumber:256,All:511};AlphaTab.Rendering.Layout.ScoreLayout=function(renderer){this._barRendererLookup=null;this.Renderer=null;this.Width=0;this.Height=0;this.Renderer=renderer;this._barRendererLookup={}};AlphaTab.Rendering.Layout.ScoreLayout.prototype={get_Scale:function(){return this.Renderer.Settings.Scale},CreateEmptyStaveGroup:function(){var group=new AlphaTab.Rendering.Staves.StaveGroup();group.Layout=this;var isFirstTrack=true;for(var i=0;i0){while(currentBarIndex<=endBarIndex){var group=this.CreateStaveGroup(currentBarIndex,endBarIndex);this._groups.push(group);group.X=x;group.Y=y;this.FitGroup(group);group.FinalizeGroup(this);y+=group.get_Height()+(20*this.get_Scale());currentBarIndex=group.get_LastBarIndex()+1}}this.Height=y+AlphaTab.Rendering.Layout.PageViewLayout.PagePadding[3]},DoScoreInfoLayout:function(y){var flags=this.Renderer.Settings.Layout.Get("hideInfo",false)?AlphaTab.Rendering.Layout.HeaderFooterElements.None:AlphaTab.Rendering.Layout.HeaderFooterElements.All;var score=this.Renderer.Score;var scale=this.get_Scale();if(!((score.Title==null)||(score.Title.length==0))&&(flags&AlphaTab.Rendering.Layout.HeaderFooterElements.Title)!=AlphaTab.Rendering.Layout.HeaderFooterElements.None){y+=(35*scale)}if(!((score.SubTitle==null)||(score.SubTitle.length==0))&&(flags&AlphaTab.Rendering.Layout.HeaderFooterElements.SubTitle)!=AlphaTab.Rendering.Layout.HeaderFooterElements.None){y+=(20*scale)}if(!((score.Artist==null)||(score.Artist.length==0))&&(flags&AlphaTab.Rendering.Layout.HeaderFooterElements.Artist)!=AlphaTab.Rendering.Layout.HeaderFooterElements.None){y+=(20*scale)}if(!((score.Album==null)||(score.Album.length==0))&&(flags&AlphaTab.Rendering.Layout.HeaderFooterElements.Album)!=AlphaTab.Rendering.Layout.HeaderFooterElements.None){y+=(20*scale)}if(!((score.Music==null)||(score.Music.length==0))&&score.Music==score.Words&&(flags&AlphaTab.Rendering.Layout.HeaderFooterElements.WordsAndMusic)!=AlphaTab.Rendering.Layout.HeaderFooterElements.None){y+=(20*scale)}else{if(!((score.Music==null)||(score.Music.length==0))&&(flags&AlphaTab.Rendering.Layout.HeaderFooterElements.Music)!=AlphaTab.Rendering.Layout.HeaderFooterElements.None){y+=(20*scale)}if(!((score.Words==null)||(score.Words.length==0))&&(flags&AlphaTab.Rendering.Layout.HeaderFooterElements.Words)!=AlphaTab.Rendering.Layout.HeaderFooterElements.None){y+=(20*scale)}}y+=(20*scale);if(this.Renderer.Tracks.length==1&&!this.Renderer.Tracks[0].IsPercussion){var tuning=AlphaTab.Model.Tuning.FindTuning(this.Renderer.Tracks[0].Tuning);if(tuning!=null){y+=(15*scale);if(!tuning.IsStandard){var stringsPerColumn=(Math.ceil(this.Renderer.Tracks[0].Tuning.length/2))|0;y+=(stringsPerColumn*(15*scale))}y+=(15*scale)}}y+=(40*scale);return y},PaintScore:function(){var x=AlphaTab.Rendering.Layout.PageViewLayout.PagePadding[0];var y=AlphaTab.Rendering.Layout.PageViewLayout.PagePadding[1];y=this.PaintScoreInfo(x,y);this.Renderer.Canvas.set_Color(this.Renderer.RenderingResources.MainGlyphColor);this.Renderer.Canvas.set_TextAlign(AlphaTab.Platform.Model.TextAlign.Left);for(var i=0,j=this._groups.length;i0){barSpace=freeSpace/group.MasterBars.length}if(group.IsFull||barSpace<0){group.ApplyBarSpacing(barSpace)}this.Width=Math.max(this.Width,group.Width)},CreateStaveGroup:function(currentBarIndex,endIndex){var group=this.CreateEmptyStaveGroup();group.Index=this._groups.length;var barsPerRow=this.Renderer.Settings.Layout.Get("barsPerRow",-1);var maxWidth=this.get_MaxWidth();var end=endIndex+1;for(var i=currentBarIndex;i=maxWidth&&group.MasterBars.length!=0)){groupIsFull=true}else if(group.MasterBars.length==barsPerRow+1){groupIsFull=true}if(groupIsFull){group.RevertLastBar();group.IsFull=true;return group}group.X=0}return group},get_MaxWidth:function(){var autoSize=this.Renderer.Settings.Layout.Get("autoSize",true);var width=autoSize?this.get_SheetWidth():this.Renderer.Settings.Width;return width-AlphaTab.Rendering.Layout.PageViewLayout.PagePadding[0]-AlphaTab.Rendering.Layout.PageViewLayout.PagePadding[2]},get_SheetWidth:function(){return(950*this.get_Scale())},BuildBoundingsLookup:function(lookup){for(var i=0,j=this._groups.length;i0&&!this.IsFullBarJoin(beat,h.Beats[i-1],barIndex)){barStartX=beatLineX-brokenBarOffset;barEndX=beatLineX;barStartY=barY;barEndY=barY;AlphaTab.Rendering.RhythmBarRenderer.PaintSingleBar(canvas,cx+this.X+barStartX,barStartY,cx+this.X+barEndX,barEndY,barSize)}}}}},PaintFooter:function(cx,cy,canvas,h){var beat=h.Beats[0];if(beat.Duration==AlphaTab.Model.Duration.Whole){return}var beatLineX=h.GetBeatLineX(beat)+this.get_Scale();var topY=0;var bottomY=this.Height;var beamY=this._direction==AlphaTab.Rendering.Utils.BeamDirection.Down?bottomY:topY;canvas.BeginPath();canvas.MoveTo(cx+this.X+beatLineX,cy+this.Y+topY);canvas.LineTo(cx+this.X+beatLineX,cy+this.Y+bottomY);canvas.Stroke();var glyph=new AlphaTab.Rendering.Glyphs.BeamGlyph(beatLineX,beamY,beat.Duration,this._direction,false);glyph.Renderer=this;glyph.DoLayout();glyph.Paint(cx+this.X,cy+this.Y,canvas)},IsFullBarJoin:function(a,b,barIndex){return(AlphaTab.Model.ModelUtils.GetIndex(a.Duration)-2-barIndex>0)&&(AlphaTab.Model.ModelUtils.GetIndex(b.Duration)-2-barIndex>0)}};AlphaTab.Rendering.RhythmBarRenderer.PaintSingleBar=function(canvas,x1,y1,x2,y2,size){canvas.BeginPath();canvas.MoveTo(x1,y1);canvas.LineTo(x2,y2);canvas.LineTo(x2,y2-size);canvas.LineTo(x1,y1-size);canvas.ClosePath();canvas.Fill()};$Inherit(AlphaTab.Rendering.RhythmBarRenderer,AlphaTab.Rendering.GroupedBarRenderer);AlphaTab.Rendering.RhythmBarRendererFactory=function(direction){this._direction=AlphaTab.Rendering.Utils.BeamDirection.Up;AlphaTab.Rendering.BarRendererFactory.call(this);this._direction=direction;this.IsInAccolade=false;this.HideOnMultiTrack=false};AlphaTab.Rendering.RhythmBarRendererFactory.prototype={Create:function(bar){return new AlphaTab.Rendering.RhythmBarRenderer(bar,this._direction)}};$Inherit(AlphaTab.Rendering.RhythmBarRendererFactory,AlphaTab.Rendering.BarRendererFactory);AlphaTab.Rendering.ScoreBarRenderer=function(bar){this._helpers=null;this._startSpacing=false;this.AccidentalHelper=null;AlphaTab.Rendering.GroupedBarRenderer.call(this,bar);this.AccidentalHelper=new AlphaTab.Rendering.Utils.AccidentalHelper()};AlphaTab.Rendering.ScoreBarRenderer.prototype={GetBeatDirection:function(beat){var g=this.GetOnNotesPosition(beat.Voice.Index,beat.Index);if(g!=null){return g.NoteHeads.get_Direction()}return AlphaTab.Rendering.Utils.BeamDirection.Up},GetNoteX:function(note,onEnd){var g=this.GetOnNotesPosition(note.Beat.Voice.Index,note.Beat.Index);if(g!=null){return g.Container.X+g.X+g.NoteHeads.GetNoteX(note,onEnd)}return 0},GetNoteY:function(note){var beat=this.GetOnNotesPosition(note.Beat.Voice.Index,note.Beat.Index);if(beat!=null){return beat.NoteHeads.GetNoteY(note)}return 0},get_TopPadding:function(){return this.get_GlyphOverflow()},get_BottomPadding:function(){return this.get_GlyphOverflow()},get_LineOffset:function(){return((9)*this.get_Scale())},DoLayout:function(){this._helpers=this.Stave.StaveGroup.Helpers.Helpers[this.Bar.Track.Index][this.Bar.Index];AlphaTab.Rendering.GroupedBarRenderer.prototype.DoLayout.call(this);this.Height=(this.get_LineOffset()*4)+this.get_TopPadding()+this.get_BottomPadding();if(this.Index==0){this.Stave.RegisterStaveTop(this.get_GlyphOverflow());this.Stave.RegisterStaveBottom(this.Height-this.get_GlyphOverflow())}var top=this.GetScoreY(0,0);var bottom=this.GetScoreY(8,0);for(var i=0,j=this._helpers.BeamHelpers.length;ibottom){this.RegisterOverflowBottom(Math.abs(minNoteY)-bottom)}}}},Paint:function(cx,cy,canvas){AlphaTab.Rendering.GroupedBarRenderer.prototype.Paint.call(this,cx,cy,canvas);this.PaintBeams(cx,cy,canvas);this.PaintTuplets(cx,cy,canvas)},PaintTuplets:function(cx,cy,canvas){for(var i=0,j=this._helpers.TupletHelpers.length;i0&&!this.IsFullBarJoin(beat,h.Beats[i-1],barIndex)){barStartX=beatLineX-brokenBarOffset;barEndX=beatLineX;barStartY=barY+this.CalculateBeamY(h,barStartX);barEndY=barY+this.CalculateBeamY(h,barEndX);AlphaTab.Rendering.ScoreBarRenderer.PaintSingleBar(canvas,cx+this.X+barStartX,barStartY,cx+this.X+barEndX,barEndY,barSize)}}}},IsFullBarJoin:function(a,b,barIndex){return(AlphaTab.Model.ModelUtils.GetIndex(a.Duration)-2-barIndex>0)&&(AlphaTab.Model.ModelUtils.GetIndex(b.Duration)-2-barIndex>0)},PaintFooter:function(cx,cy,canvas,h){var beat=h.Beats[0];if(beat.Duration==AlphaTab.Model.Duration.Whole){return}var isGrace=beat.GraceType!=AlphaTab.Model.GraceType.None;var scaleMod=isGrace?0.7:1;var stemSize=this.GetStemSize(h.MaxDuration);var correction=((9*scaleMod)/2);var beatLineX=h.GetBeatLineX(beat)+this.get_Scale();var direction=h.get_Direction();var topY=this.GetScoreY(this.GetNoteLine(beat.get_MaxNote()),correction);var bottomY=this.GetScoreY(this.GetNoteLine(beat.get_MinNote()),correction);var beamY;if(direction==AlphaTab.Rendering.Utils.BeamDirection.Down){bottomY+=stemSize*scaleMod;beamY=bottomY}else{topY-=stemSize*scaleMod;beamY=topY}canvas.BeginPath();canvas.MoveTo(cx+this.X+beatLineX,cy+this.Y+topY);canvas.LineTo(cx+this.X+beatLineX,cy+this.Y+bottomY);canvas.Stroke();if(isGrace){var graceSizeY=15*this.get_Scale();var graceSizeX=12*this.get_Scale();canvas.BeginPath();if(direction==AlphaTab.Rendering.Utils.BeamDirection.Down){canvas.MoveTo(cx+this.X+beatLineX-(graceSizeX/2),cy+this.Y+bottomY-graceSizeY);canvas.LineTo(cx+this.X+beatLineX+(graceSizeX/2),cy+this.Y+bottomY)}else{canvas.MoveTo(cx+this.X+beatLineX-(graceSizeX/2),cy+this.Y+topY+graceSizeY);canvas.LineTo(cx+this.X+beatLineX+(graceSizeX/2),cy+this.Y+topY)}canvas.Stroke()}if(beat.Duration>AlphaTab.Model.Duration.Quarter){var glyph=new AlphaTab.Rendering.Glyphs.BeamGlyph(beatLineX,beamY,beat.Duration,direction,isGrace);glyph.Renderer=this;glyph.DoLayout();glyph.Paint(cx+this.X,cy+this.Y,canvas)}},CreatePreBeatGlyphs:function(){if(this.Bar.get_MasterBar().IsRepeatStart){this.AddPreBeatGlyph(new AlphaTab.Rendering.Glyphs.RepeatOpenGlyph(0,0,1.5,3))}if(this.get_IsFirstOfLine()||this.Bar.Clef!=this.Bar.PreviousBar.Clef){var offset=0;switch(this.Bar.Clef){case AlphaTab.Model.Clef.Neutral:offset=4;break;case AlphaTab.Model.Clef.F4:offset=4;break;case AlphaTab.Model.Clef.C3:offset=6;break;case AlphaTab.Model.Clef.C4:offset=4;break;case AlphaTab.Model.Clef.G2:offset=6;break}this.CreateStartSpacing();this.AddPreBeatGlyph(new AlphaTab.Rendering.Glyphs.ClefGlyph(0,this.GetScoreY(offset,0),this.Bar.Clef))}if((this.Bar.PreviousBar==null&&this.Bar.get_MasterBar().KeySignature!=0)||(this.Bar.PreviousBar!=null&&this.Bar.get_MasterBar().KeySignature!=this.Bar.PreviousBar.get_MasterBar().KeySignature)){this.CreateStartSpacing();this.CreateKeySignatureGlyphs()}if((this.Bar.PreviousBar==null)||(this.Bar.PreviousBar!=null&&this.Bar.get_MasterBar().TimeSignatureNumerator!=this.Bar.PreviousBar.get_MasterBar().TimeSignatureNumerator)||(this.Bar.PreviousBar!=null&&this.Bar.get_MasterBar().TimeSignatureDenominator!=this.Bar.PreviousBar.get_MasterBar().TimeSignatureDenominator)){this.CreateStartSpacing();this.CreateTimeSignatureGlyphs()}this.AddPreBeatGlyph(new AlphaTab.Rendering.Glyphs.BarNumberGlyph(0,this.GetScoreY(-1,-3),this.Bar.Index+1,!this.Stave.IsFirstInAccolade));if(this.Bar.get_IsEmpty()){this.AddPreBeatGlyph(new AlphaTab.Rendering.Glyphs.SpacingGlyph(0,0,(30*this.get_Scale()),false))}},CreateBeatGlyphs:function(){this.CreateVoiceGlyphs(this.Bar.Voices[0])},CreatePostBeatGlyphs:function(){if(this.Bar.get_MasterBar().get_IsRepeatEnd()){this.AddPostBeatGlyph(new AlphaTab.Rendering.Glyphs.RepeatCloseGlyph(this.X,0));if(this.Bar.get_MasterBar().RepeatCount>2){var line=this.get_IsLast()||this.get_IsLastOfLine()?-1:-4;this.AddPostBeatGlyph(new AlphaTab.Rendering.Glyphs.RepeatCountGlyph(0,this.GetScoreY(line,-3),this.Bar.get_MasterBar().RepeatCount))}}else if(this.Bar.get_MasterBar().IsDoubleBar){this.AddPostBeatGlyph(new AlphaTab.Rendering.Glyphs.BarSeperatorGlyph(0,0,false));this.AddPostBeatGlyph(new AlphaTab.Rendering.Glyphs.SpacingGlyph(0,0,3*this.get_Scale(),false));this.AddPostBeatGlyph(new AlphaTab.Rendering.Glyphs.BarSeperatorGlyph(0,0,false))}else if(this.Bar.NextBar==null||!this.Bar.NextBar.get_MasterBar().IsRepeatStart){this.AddPostBeatGlyph(new AlphaTab.Rendering.Glyphs.BarSeperatorGlyph(0,0,this.get_IsLast()))}},CreateStartSpacing:function(){if(this._startSpacing)return;this.AddPreBeatGlyph(new AlphaTab.Rendering.Glyphs.SpacingGlyph(0,0,2*this.get_Scale(),true));this._startSpacing=true},CreateKeySignatureGlyphs:function(){var offsetClef=0;var currentKey=this.Bar.get_MasterBar().KeySignature;var previousKey=this.Bar.PreviousBar==null?0:this.Bar.PreviousBar.get_MasterBar().KeySignature;switch(this.Bar.Clef){case AlphaTab.Model.Clef.Neutral:offsetClef=0;break;case AlphaTab.Model.Clef.G2:offsetClef=0;break;case AlphaTab.Model.Clef.F4:offsetClef=2;break;case AlphaTab.Model.Clef.C3:offsetClef=-1;break;case AlphaTab.Model.Clef.C4:offsetClef=1;break}var naturalizeSymbols=Math.abs(previousKey);var previousKeyPositions=AlphaTab.Model.ModelUtils.KeySignatureIsSharp(previousKey)?AlphaTab.Rendering.ScoreBarRenderer.SharpKsSteps:AlphaTab.Rendering.ScoreBarRenderer.FlatKsSteps;for(var i=0;i0)lineY+=this.get_LineOffset();canvas.BeginPath();canvas.MoveTo(cx+this.X,lineY|0);canvas.LineTo(cx+this.X+this.Width,lineY|0);canvas.Stroke()}canvas.set_Color(res.MainGlyphColor)}};$StaticConstructor(function(){AlphaTab.Rendering.ScoreBarRenderer.StepsPerOctave=7;AlphaTab.Rendering.ScoreBarRenderer.OctaveSteps=new Int32Array([38,32,30,26,38]);AlphaTab.Rendering.ScoreBarRenderer.SharpNoteSteps=new Int32Array([0,0,1,1,2,3,3,4,4,5,5,6]);AlphaTab.Rendering.ScoreBarRenderer.FlatNoteSteps=new Int32Array([0,1,1,2,2,3,4,4,5,5,6,6]);AlphaTab.Rendering.ScoreBarRenderer.SharpKsSteps=new Int32Array([1,4,0,3,6,2,5]);AlphaTab.Rendering.ScoreBarRenderer.FlatKsSteps=new Int32Array([5,2,6,3,7,4,8]);AlphaTab.Rendering.ScoreBarRenderer.LineSpacing=8;AlphaTab.Rendering.ScoreBarRenderer.NoteStepCorrection=1});AlphaTab.Rendering.ScoreBarRenderer.PaintSingleBar=function(canvas,x1,y1,x2,y2,size){canvas.BeginPath();canvas.MoveTo(x1,y1);canvas.LineTo(x2,y2);canvas.LineTo(x2,y2+size);canvas.LineTo(x1,y1+size);canvas.ClosePath();canvas.Fill()};$Inherit(AlphaTab.Rendering.ScoreBarRenderer,AlphaTab.Rendering.GroupedBarRenderer);AlphaTab.Rendering.ScoreBarRendererFactory=function(){AlphaTab.Rendering.BarRendererFactory.call(this)};AlphaTab.Rendering.ScoreBarRendererFactory.prototype={Create:function(bar){return new AlphaTab.Rendering.ScoreBarRenderer(bar)}};$Inherit(AlphaTab.Rendering.ScoreBarRendererFactory,AlphaTab.Rendering.BarRendererFactory);AlphaTab.Rendering.ScoreRenderer=function(settings,param){this._currentLayoutMode=null;this.RenderFinished=null;this.PostRenderFinished=null;this.Canvas=null;this.Score=null;this.Tracks=null;this.Layout=null;this.RenderingResources=null;this.Settings=null;this.Settings=settings;this.RenderingResources=new AlphaTab.Rendering.RenderingResources(1);if(settings.Engine==null||!AlphaTab.Environment.RenderEngines.hasOwnProperty(settings.Engine)){this.Canvas=AlphaTab.Environment.RenderEngines["default"](param)}else{this.Canvas=AlphaTab.Environment.RenderEngines[settings.Engine](param)}this.RecreateLayout()};AlphaTab.Rendering.ScoreRenderer.prototype={get_IsSvg:function(){return true},RecreateLayout:function(){if(this._currentLayoutMode!=this.Settings.Layout.Mode){if(this.Settings.Layout==null||!AlphaTab.Environment.LayoutEngines.hasOwnProperty(this.Settings.Layout.Mode)){this.Layout=AlphaTab.Environment.LayoutEngines["default"](this)}else{this.Layout=AlphaTab.Environment.LayoutEngines[this.Settings.Layout.Mode](this)}this._currentLayoutMode=this.Settings.Layout.Mode}},Render:function(track){this.Score=track.Score;this.Tracks=[track];this.Invalidate()},RenderMultiple:function(tracks){if(tracks.length==0){this.Score=null}else{this.Score=tracks[0].Score}this.Tracks=tracks;this.Invalidate()},Invalidate:function(){if(this.Tracks.length==0)return;if(this.RenderingResources.Scale!=this.Settings.Scale){this.RenderingResources.Init(this.Settings.Scale);this.Canvas.set_LineWidth(this.Settings.Scale)}this.Canvas.set_Resources(this.RenderingResources);this.RecreateLayout();this.Canvas.Clear();this.DoLayout();this.PaintScore();this.OnRenderFinished((function(){var $v1=new AlphaTab.Rendering.RenderFinishedEventArgs();$v1.Height=this.Canvas.get_Height();$v1.Width=this.Canvas.get_Width();$v1.RenderResult=this.Canvas.get_RenderResult();return $v1}).call(this));this.OnPostRenderFinished()},DoLayout:function(){this.Layout.DoLayout();this.Canvas.set_Height(this.Layout.Height+(this.RenderingResources.CopyrightFont.Size*2));this.Canvas.set_Width(this.Layout.Width)},PaintScore:function(){this.PaintBackground();this.Layout.PaintScore()},PaintBackground:function(){var msg="彼岸吉他出品-music.52jianpu.com/guitar";this.Canvas.set_Color(new AlphaTab.Platform.Model.Color(62,62,62,255));this.Canvas.set_Font(this.RenderingResources.CopyrightFont);this.Canvas.set_TextAlign(AlphaTab.Platform.Model.TextAlign.Center);var x=this.Canvas.get_Width()/2;this.Canvas.FillText(msg,x,this.Canvas.get_Height()-(this.RenderingResources.CopyrightFont.Size*2))},add_RenderFinished:function(value){this.RenderFinished=$CombineDelegates(this.RenderFinished,value)},remove_RenderFinished:function(value){this.RenderFinished=$RemoveDelegate(this.RenderFinished,value)},OnRenderFinished:function(e){var handler=this.RenderFinished;if(handler!=null)handler(e)},add_PostRenderFinished:function(value){this.PostRenderFinished=$CombineDelegates(this.PostRenderFinished,value)},remove_PostRenderFinished:function(value){this.PostRenderFinished=$RemoveDelegate(this.PostRenderFinished,value)},OnPostRenderFinished:function(){var handler=this.PostRenderFinished;if(handler!=null)handler()},BuildBoundingsLookup:function(){var lookup=new AlphaTab.Rendering.Utils.BoundingsLookup();this.Layout.BuildBoundingsLookup(lookup);return lookup}};AlphaTab.Rendering.Staves=AlphaTab.Rendering.Staves||{};AlphaTab.Rendering.Staves.BarSizeInfo=function(){this.FullWidth=0;this.Sizes=null;this.PreNoteSizes=null;this.OnNoteSizes=null;this.PostNoteSizes=null;this.Sizes={};this.PreNoteSizes={};this.OnNoteSizes={};this.PostNoteSizes={};this.FullWidth=0};AlphaTab.Rendering.Staves.BarSizeInfo.prototype={SetSize:function(key,size){this.Sizes[key]=size},GetSize:function(key){if(this.Sizes.hasOwnProperty(key)){return this.Sizes[key]}return 0},GetPreNoteSize:function(beat){if(this.PreNoteSizes.hasOwnProperty(beat)){return this.PreNoteSizes[beat]}return 0},GetOnNoteSize:function(beat){if(this.OnNoteSizes.hasOwnProperty(beat)){return this.OnNoteSizes[beat]}return 0},GetPostNoteSize:function(beat){if(this.PostNoteSizes.hasOwnProperty(beat)){return this.PostNoteSizes[beat]}return 0},SetPreNoteSize:function(beat,size){this.PreNoteSizes[beat]=size},SetOnNoteSize:function(beat,size){this.OnNoteSizes[beat]=size},SetPostNoteSize:function(beat,size){this.PostNoteSizes[beat]=size}};AlphaTab.Rendering.Staves.Stave=function(staveId,factory,settings){this._factory=null;this._settings=null;this.StaveTrackGroup=null;this.StaveGroup=null;this.BarRenderers=null;this.X=0;this.Y=0;this.Height=0;this.Index=0;this.StaveId=null;this.StaveTop=0;this.TopSpacing=0;this.BottomSpacing=0;this.StaveBottom=0;this.IsFirstInAccolade=false;this.IsLastInAccolade=false;this.BarRenderers=[];this.StaveId=staveId;this._factory=factory;this._settings=settings;this.TopSpacing=10;this.BottomSpacing=10;this.StaveTop=0;this.StaveBottom=0};AlphaTab.Rendering.Staves.Stave.prototype={GetSetting:function(key,def){if(this._settings.hasOwnProperty(key)){return(this._settings[key])}return def},get_IsInAccolade:function(){return this._factory.IsInAccolade},RegisterStaveTop:function(offset){this.StaveTop=offset},RegisterStaveBottom:function(offset){this.StaveBottom=offset},AddBar:function(bar){var renderer=this._factory.Create(bar);renderer.Stave=this;renderer.Index=this.BarRenderers.length;renderer.DoLayout();this.BarRenderers.push(renderer);this.StaveGroup.Layout.RegisterBarRenderer(this.StaveId,bar.Index,renderer)},RevertLastBar:function(){this.BarRenderers.splice(this.BarRenderers.length-1,1)},ApplyBarSpacing:function(spacing){for(var i=0,j=this.BarRenderers.length;im){m=r.TopOverflow}}return m},get_BottomOverflow:function(){var m=0;for(var i=0,j=this.BarRenderers.length;im){m=r.BottomOverflow}}return m},FinalizeStave:function(layout){var x=0;this.Height=0;var topOverflow=this.get_TopOverflow();var bottomOverflow=this.get_BottomOverflow();var isEmpty=true;for(var i=0;irealWidth){realWidth=s.BarRenderers[s.BarRenderers.length-1].Width}}this.Width+=realWidth},GetStaveTrackGroup:function(track){for(var i=0,j=this.Staves.length;i1){this.MasterBars.splice(this.MasterBars.length-1,1);var w=0;for(var i=0,j=this._allStaves.length;i0){if(this._firstStaveInAccolade!=null&&this._lastStaveInAccolade!=null){var firstStart=cy+this.Y+this._firstStaveInAccolade.Y+this._firstStaveInAccolade.StaveTop+this._firstStaveInAccolade.TopSpacing+this._firstStaveInAccolade.get_TopOverflow();var lastEnd=cy+this.Y+this._lastStaveInAccolade.Y+this._lastStaveInAccolade.TopSpacing+this._lastStaveInAccolade.get_TopOverflow()+this._lastStaveInAccolade.StaveBottom;var acooladeX=cx+this.X+this._firstStaveInAccolade.X;canvas.set_Color(res.BarSeperatorColor);canvas.BeginPath();canvas.MoveTo(acooladeX,firstStart);canvas.LineTo(acooladeX,lastEnd);canvas.Stroke()}canvas.set_Font(res.EffectFont);for(var i=0,j=this.Staves.length;i2){var line=this.get_IsLast()||this.get_IsLastOfLine()?-1:-4;this.AddPostBeatGlyph(new AlphaTab.Rendering.Glyphs.RepeatCountGlyph(0,this.GetTabY(line,-3),this.Bar.get_MasterBar().RepeatCount))}}else if(this.Bar.get_MasterBar().IsDoubleBar){this.AddPostBeatGlyph(new AlphaTab.Rendering.Glyphs.BarSeperatorGlyph(0,0,false));this.AddPostBeatGlyph(new AlphaTab.Rendering.Glyphs.SpacingGlyph(0,0,3*this.get_Scale(),false));this.AddPostBeatGlyph(new AlphaTab.Rendering.Glyphs.BarSeperatorGlyph(0,0,false))}else if(this.Bar.NextBar==null||!this.Bar.NextBar.get_MasterBar().IsRepeatStart){this.AddPostBeatGlyph(new AlphaTab.Rendering.Glyphs.BarSeperatorGlyph(0,0,this.get_IsLast()))}},get_TopPadding:function(){return this.get_NumberOverflow()},get_BottomPadding:function(){return this.get_NumberOverflow()},GetTabY:function(line,correction){return(this.get_LineOffset()*line)+(correction*this.get_Scale())},get_NumberOverflow:function(){var res=this.get_Resources();return(res.TablatureFont.Size/2)+(res.TablatureFont.Size*0.2)},PaintBackground:function(cx,cy,canvas){var res=this.get_Resources();canvas.set_Color(res.StaveLineColor);var lineY=cy+this.Y+this.get_NumberOverflow();for(var i=0,j=this.Bar.Track.Tuning.length;i0)lineY+=this.get_LineOffset();canvas.BeginPath();canvas.MoveTo(cx+this.X,lineY|0);canvas.LineTo(cx+this.X+this.Width,lineY|0);canvas.Stroke()}canvas.set_Color(res.MainGlyphColor)}};$StaticConstructor(function(){AlphaTab.Rendering.TabBarRenderer.LineSpacing=10});$Inherit(AlphaTab.Rendering.TabBarRenderer,AlphaTab.Rendering.GroupedBarRenderer);AlphaTab.Rendering.TabBarRendererFactory=function(){AlphaTab.Rendering.BarRendererFactory.call(this)};AlphaTab.Rendering.TabBarRendererFactory.prototype={CanCreate:function(track){return track.Tuning.length>0},Create:function(bar){return new AlphaTab.Rendering.TabBarRenderer(bar)}};$Inherit(AlphaTab.Rendering.TabBarRendererFactory,AlphaTab.Rendering.BarRendererFactory);AlphaTab.Rendering.Utils=AlphaTab.Rendering.Utils||{};AlphaTab.Rendering.Utils.AccidentalHelper=function(){this._registeredAccidentals=null;this._registeredAccidentals={}};AlphaTab.Rendering.Utils.AccidentalHelper.prototype={ApplyAccidental:function(note,noteLine){var noteValue=note.get_RealValue();var ks=note.Beat.Voice.Bar.get_MasterBar().KeySignature;var ksi=(ks+7);var index=(noteValue%12);var accidentalToSet=AlphaTab.Rendering.Utils.AccidentalHelper.AccidentalNotes[ksi][index];var updateAccidental=true;if(this._registeredAccidentals.hasOwnProperty(noteLine)){var registeredAccidental=this._registeredAccidentals[noteLine];if(registeredAccidental==accidentalToSet){accidentalToSet=AlphaTab.Model.AccidentalType.None;updateAccidental=false}else if(accidentalToSet==AlphaTab.Model.AccidentalType.None){accidentalToSet=AlphaTab.Model.AccidentalType.Natural}}if(updateAccidental){if((accidentalToSet==AlphaTab.Model.AccidentalType.None||accidentalToSet==AlphaTab.Model.AccidentalType.Natural)){delete this._registeredAccidentals[noteLine]}else{this._registeredAccidentals[noteLine]=accidentalToSet}}return accidentalToSet}};$StaticConstructor(function(){AlphaTab.Rendering.Utils.AccidentalHelper.AccidentalNotes=[[AlphaTab.Model.AccidentalType.Natural,AlphaTab.Model.AccidentalType.None,AlphaTab.Model.AccidentalType.Natural,AlphaTab.Model.AccidentalType.None,AlphaTab.Model.AccidentalType.Natural,AlphaTab.Model.AccidentalType.Natural,AlphaTab.Model.AccidentalType.None,AlphaTab.Model.AccidentalType.Natural,AlphaTab.Model.AccidentalType.None,AlphaTab.Model.AccidentalType.Natural,AlphaTab.Model.AccidentalType.None,AlphaTab.Model.AccidentalType.Natural],[AlphaTab.Model.AccidentalType.Natural,AlphaTab.Model.AccidentalType.None,AlphaTab.Model.AccidentalType.Natural,AlphaTab.Model.AccidentalType.None,AlphaTab.Model.AccidentalType.Natural,AlphaTab.Model.AccidentalType.None,AlphaTab.Model.AccidentalType.None,AlphaTab.Model.AccidentalType.Natural,AlphaTab.Model.AccidentalType.None,AlphaTab.Model.AccidentalType.Natural,AlphaTab.Model.AccidentalType.None,AlphaTab.Model.AccidentalType.Natural],[AlphaTab.Model.AccidentalType.None,AlphaTab.Model.AccidentalType.None,AlphaTab.Model.AccidentalType.Natural,AlphaTab.Model.AccidentalType.None,AlphaTab.Model.AccidentalType.Natural,AlphaTab.Model.AccidentalType.None,AlphaTab.Model.AccidentalType.None,AlphaTab.Model.AccidentalType.Natural,AlphaTab.Model.AccidentalType.None,AlphaTab.Model.AccidentalType.Natural,AlphaTab.Model.AccidentalType.None,AlphaTab.Model.AccidentalType.Natural],[AlphaTab.Model.AccidentalType.None,AlphaTab.Model.AccidentalType.None,AlphaTab.Model.AccidentalType.Natural,AlphaTab.Model.AccidentalType.None,AlphaTab.Model.AccidentalType.Natural,AlphaTab.Model.AccidentalType.None,AlphaTab.Model.AccidentalType.Flat,AlphaTab.Model.AccidentalType.Natural,AlphaTab.Model.AccidentalType.None,AlphaTab.Model.AccidentalType.Natural,AlphaTab.Model.AccidentalType.None,AlphaTab.Model.AccidentalType.Natural],[AlphaTab.Model.AccidentalType.None,AlphaTab.Model.AccidentalType.Flat,AlphaTab.Model.AccidentalType.Natural,AlphaTab.Model.AccidentalType.None,AlphaTab.Model.AccidentalType.Natural,AlphaTab.Model.AccidentalType.None,AlphaTab.Model.AccidentalType.Flat,AlphaTab.Model.AccidentalType.Natural,AlphaTab.Model.AccidentalType.None,AlphaTab.Model.AccidentalType.Natural,AlphaTab.Model.AccidentalType.None,AlphaTab.Model.AccidentalType.Natural],[AlphaTab.Model.AccidentalType.None,AlphaTab.Model.AccidentalType.Flat,AlphaTab.Model.AccidentalType.Natural,AlphaTab.Model.AccidentalType.None,AlphaTab.Model.AccidentalType.Natural,AlphaTab.Model.AccidentalType.None,AlphaTab.Model.AccidentalType.Flat,AlphaTab.Model.AccidentalType.Natural,AlphaTab.Model.AccidentalType.Flat,AlphaTab.Model.AccidentalType.Natural,AlphaTab.Model.AccidentalType.None,AlphaTab.Model.AccidentalType.Natural],[AlphaTab.Model.AccidentalType.None,AlphaTab.Model.AccidentalType.Flat,AlphaTab.Model.AccidentalType.Natural,AlphaTab.Model.AccidentalType.Flat,AlphaTab.Model.AccidentalType.Natural,AlphaTab.Model.AccidentalType.None,AlphaTab.Model.AccidentalType.Flat,AlphaTab.Model.AccidentalType.Natural,AlphaTab.Model.AccidentalType.Flat,AlphaTab.Model.AccidentalType.Natural,AlphaTab.Model.AccidentalType.None,AlphaTab.Model.AccidentalType.Natural],[AlphaTab.Model.AccidentalType.None,AlphaTab.Model.AccidentalType.Sharp,AlphaTab.Model.AccidentalType.None,AlphaTab.Model.AccidentalType.Sharp,AlphaTab.Model.AccidentalType.None,AlphaTab.Model.AccidentalType.None,AlphaTab.Model.AccidentalType.Sharp,AlphaTab.Model.AccidentalType.None,AlphaTab.Model.AccidentalType.Sharp,AlphaTab.Model.AccidentalType.None,AlphaTab.Model.AccidentalType.Sharp,AlphaTab.Model.AccidentalType.None],[AlphaTab.Model.AccidentalType.None,AlphaTab.Model.AccidentalType.Sharp,AlphaTab.Model.AccidentalType.None,AlphaTab.Model.AccidentalType.Sharp,AlphaTab.Model.AccidentalType.None,AlphaTab.Model.AccidentalType.Natural,AlphaTab.Model.AccidentalType.Sharp,AlphaTab.Model.AccidentalType.None,AlphaTab.Model.AccidentalType.Sharp,AlphaTab.Model.AccidentalType.None,AlphaTab.Model.AccidentalType.Sharp,AlphaTab.Model.AccidentalType.None],[AlphaTab.Model.AccidentalType.Natural,AlphaTab.Model.AccidentalType.Sharp,AlphaTab.Model.AccidentalType.None,AlphaTab.Model.AccidentalType.Sharp,AlphaTab.Model.AccidentalType.None,AlphaTab.Model.AccidentalType.Natural,AlphaTab.Model.AccidentalType.Sharp,AlphaTab.Model.AccidentalType.None,AlphaTab.Model.AccidentalType.Sharp,AlphaTab.Model.AccidentalType.None,AlphaTab.Model.AccidentalType.Sharp,AlphaTab.Model.AccidentalType.None],[AlphaTab.Model.AccidentalType.Natural,AlphaTab.Model.AccidentalType.Sharp,AlphaTab.Model.AccidentalType.None,AlphaTab.Model.AccidentalType.Sharp,AlphaTab.Model.AccidentalType.None,AlphaTab.Model.AccidentalType.Natural,AlphaTab.Model.AccidentalType.Sharp,AlphaTab.Model.AccidentalType.Natural,AlphaTab.Model.AccidentalType.Sharp,AlphaTab.Model.AccidentalType.None,AlphaTab.Model.AccidentalType.Sharp,AlphaTab.Model.AccidentalType.None],[AlphaTab.Model.AccidentalType.Natural,AlphaTab.Model.AccidentalType.Sharp,AlphaTab.Model.AccidentalType.Natural,AlphaTab.Model.AccidentalType.Sharp,AlphaTab.Model.AccidentalType.None,AlphaTab.Model.AccidentalType.Natural,AlphaTab.Model.AccidentalType.Sharp,AlphaTab.Model.AccidentalType.Natural,AlphaTab.Model.AccidentalType.Sharp,AlphaTab.Model.AccidentalType.None,AlphaTab.Model.AccidentalType.Sharp,AlphaTab.Model.AccidentalType.None],[AlphaTab.Model.AccidentalType.Natural,AlphaTab.Model.AccidentalType.Sharp,AlphaTab.Model.AccidentalType.Natural,AlphaTab.Model.AccidentalType.Sharp,AlphaTab.Model.AccidentalType.None,AlphaTab.Model.AccidentalType.Natural,AlphaTab.Model.AccidentalType.Sharp,AlphaTab.Model.AccidentalType.Natural,AlphaTab.Model.AccidentalType.Sharp,AlphaTab.Model.AccidentalType.Natural,AlphaTab.Model.AccidentalType.Sharp,AlphaTab.Model.AccidentalType.None],[AlphaTab.Model.AccidentalType.Natural,AlphaTab.Model.AccidentalType.Sharp,AlphaTab.Model.AccidentalType.Natural,AlphaTab.Model.AccidentalType.Sharp,AlphaTab.Model.AccidentalType.Natural,AlphaTab.Model.AccidentalType.Natural,AlphaTab.Model.AccidentalType.Sharp,AlphaTab.Model.AccidentalType.Natural,AlphaTab.Model.AccidentalType.Sharp,AlphaTab.Model.AccidentalType.Natural,AlphaTab.Model.AccidentalType.Sharp,AlphaTab.Model.AccidentalType.None],[AlphaTab.Model.AccidentalType.Natural,AlphaTab.Model.AccidentalType.Sharp,AlphaTab.Model.AccidentalType.Natural,AlphaTab.Model.AccidentalType.Sharp,AlphaTab.Model.AccidentalType.Natural,AlphaTab.Model.AccidentalType.Natural,AlphaTab.Model.AccidentalType.Sharp,AlphaTab.Model.AccidentalType.Natural,AlphaTab.Model.AccidentalType.Sharp,AlphaTab.Model.AccidentalType.Natural,AlphaTab.Model.AccidentalType.Sharp,AlphaTab.Model.AccidentalType.Natural]]});AlphaTab.Rendering.Utils.BarHelpers=function(bar){this.BeamHelpers=null;this.BeamHelperLookup=null;this.TupletHelpers=null;this.BeamHelpers=[];this.BeamHelperLookup=[];this.TupletHelpers=[];var currentBeamHelper=null;var currentTupletHelper=null;for(var i=0,j=bar.Voices.length;ithis.GetValue(this.FirstMaxNote)){this.FirstMaxNote=note}}if(this.LastMinNote==null||note.Beat.Start>this.LastMinNote.Beat.Start){this.LastMinNote=note}else if(note.Beat.Start==this.LastMinNote.Beat.Start){if(valuethis.LastMaxNote.Beat.Start){this.LastMaxNote=note}else if(note.Beat.Start==this.LastMaxNote.Beat.Start){if(value>this.GetValue(this.LastMaxNote)){this.LastMaxNote=note}}if(this.MaxNote==null||value>this.GetValue(this.MaxNote)){this.MaxNote=note}if(this.MinNote==null||valueendY&&(startY-endY)>maxDistance)endY=(startY-maxDistance);if(direction==AlphaTab.Rendering.Utils.BeamDirection.Down&&endY>startY&&(endY-startY)>maxDistance)startY=(endY-maxDistance);if(direction==AlphaTab.Rendering.Utils.BeamDirection.Up&&startYmaxDistance)endY=(startY+maxDistance);if(direction==AlphaTab.Rendering.Utils.BeamDirection.Up&&endYmaxDistance)startY=(endY+maxDistance);if(startX==endX)return startY;return((endY-startY)/(endX-startX))*(xPosition-startX)+startY}};$StaticConstructor(function(){AlphaTab.Rendering.Utils.BeamingHelper.ScoreMiddleKeys=new Int32Array([48,45,38,59])});AlphaTab.Rendering.Utils.BeamingHelper.CanJoin=function(b1,b2){if(b1==null||b2==null||b1.get_IsRest()||b2.get_IsRest()||b1.GraceType!=AlphaTab.Model.GraceType.None||b2.GraceType!=AlphaTab.Model.GraceType.None){return false}var m1=b1.Voice.Bar;var m2=b1.Voice.Bar;if(m1!=m2)return false;var start1=b1.Start;var start2=b2.Start;if(!AlphaTab.Rendering.Utils.BeamingHelper.CanJoinDuration(b1.Duration)||!AlphaTab.Rendering.Utils.BeamingHelper.CanJoinDuration(b2.Duration)){return start1==start2}var divisionLength=960;switch(m1.get_MasterBar().TimeSignatureDenominator){case 8:if(m1.get_MasterBar().TimeSignatureNumerator%3==0){divisionLength+=480}break}var division1=(((divisionLength+start1)/divisionLength)|0)|0;var division2=(((divisionLength+start2)/divisionLength)|0)|0;return division1==division2};AlphaTab.Rendering.Utils.BeamingHelper.CanJoinDuration=function(d){switch(d){case AlphaTab.Model.Duration.Whole:case AlphaTab.Model.Duration.Half:case AlphaTab.Model.Duration.Quarter:return false;default:return true}};AlphaTab.Rendering.Utils.Bounds=function(x,y,w,h){this.X=0;this.Y=0;this.W=0;this.H=0;this.X=x;this.Y=y;this.W=w;this.H=h};AlphaTab.Rendering.Utils.BeatBoundings=function(){this.Beat=null;this.Bounds=null;this.VisualBounds=null};AlphaTab.Rendering.Utils.BarBoundings=function(){this.IsFirstOfLine=false;this.IsLastOfLine=false;this.Bar=null;this.Bounds=null;this.VisualBounds=null;this.Beats=null;this.Beats=[]};AlphaTab.Rendering.Utils.BarBoundings.prototype={FindBeatAtPos:function(x){var index=0;while(index<(this.Beats.length-1)&&x>(this.Beats[index].Bounds.X+this.Beats[index].Bounds.W)){index++}return this.Beats[index].Beat}};AlphaTab.Rendering.Utils.BoundingsLookup=function(){this.Bars=null;this.Bars=[]};AlphaTab.Rendering.Utils.BoundingsLookup.prototype={GetBeatAtPos:function(x,y){var bottom=0;var top=this.Bars.length-1;var barIndex=-1;while(bottom<=top){var middle=((top+bottom)/2)|0;var bar=this.Bars[middle];if(y>=bar.Bounds.Y&&y<=(bar.Bounds.Y+bar.Bounds.H)){barIndex=middle;break}if(y0&&x(this.Bars[barIndex].Bounds.X+this.Bars[barIndex].Bounds.W)&&!this.Bars[barIndex].IsLastOfLine){barIndex++}}return this.Bars[barIndex].FindBeatAtPos(x)}};AlphaTab.Rendering.Utils.PercussionMapper=function(){};AlphaTab.Rendering.Utils.PercussionMapper.MapValue=function(note){var value=note.get_RealValue();if(value==61||value==66){return 50}else if(value==60||value==65){return 52}else if((value>=35&&value<=36)||value==44){return 53}else if(value==41||value==64){return 55}else if(value==43||value==62){return 57}else if(value==45||value==63){return 59}else if(value==47||value==54){return 62}else if(value==48||value==56){return 64}else if(value==50){return 65}else if(value==42||value==46||(value>=49&&value<=53)||value==57||value==59){return 67}return 60};AlphaTab.Rendering.Utils.SvgPathParser=function(svg){this._currentIndex=0;this.Svg=null;this.LastCommand=null;this.CurrentToken=null;this.Svg=svg};AlphaTab.Rendering.Utils.SvgPathParser.prototype={Reset:function(){this._currentIndex=0;this.NextToken()},get_Eof:function(){return this._currentIndex>=this.Svg.length},GetString:function(){var t=this.CurrentToken;this.NextToken();return t},GetNumber:function(){return AlphaTab.Platform.Std.ParseFloat(this.GetString())},get_CurrentTokenIsNumber:function(){return AlphaTab.Platform.Std.IsStringNumber(this.CurrentToken,true)},NextChar:function(){if(this.get_Eof())return 0;return this.Svg.charCodeAt(this._currentIndex++)},PeekChar:function(){if(this.get_Eof())return 0;return this.Svg.charCodeAt(this._currentIndex)},NextToken:function(){var token=new Array();var c;var skipChar;do{c=this.NextChar();skipChar=AlphaTab.Platform.Std.IsWhiteSpace(c)||c==32}while(!this.get_Eof()&&skipChar)if(!this.get_Eof()||!skipChar){token.push(String.fromCharCode(c));if(AlphaTab.Platform.Std.IsCharNumber(c,true)){c=this.PeekChar();while(!this.get_Eof()&&(AlphaTab.Platform.Std.IsCharNumber(c,false)||c==46)){token.push(String.fromCharCode(this.NextChar()));c=this.PeekChar()}}else{this.LastCommand=token.join('')}}this.CurrentToken=token.join('')}};AlphaTab.Rendering.Utils.SvgRenderer=function(svg,xScale,yScale){this._svg=null;this._lastCmd=null;this._currentX=0;this._currentY=0;this._xScale=0;this._yScale=0;this._xGlyphScale=0;this._yGlyphScale=0;this._lastControlX=0;this._lastControlY=0;this._svg=svg;this._xGlyphScale=xScale*0.0099;this._yGlyphScale=yScale*0.0099};AlphaTab.Rendering.Utils.SvgRenderer.prototype={Paint:function(x,y,canvas){if(this._svg==null)return;this._xScale=this._xGlyphScale;this._yScale=this._yGlyphScale;var startX=x;var startY=y;this._currentX=startX;this._currentY=startY;canvas.BeginPath();for(var i=0,j=this._svg.get_Commands().length;i