// abc2svg - ABC to SVG translator // @source: https://chiselapp.com/user/moinejf/repository/abc2svg // Copyright (C) 2014-2019 Jean-Francois Moine - LGPL3+ //equalbars.js-module to set equal spaced measure bars abc2svg.equalbars={output_music:function(of){this.equalbars_d=0;of()},set_fmt:function(of,cmd,param){if(cmd=="equalbars") this.cfmt().equalbars=this.get_bool(param) else of(cmd,param)},set_sym_glue:function(of,width){var C=abc2svg.C,s,s2,w,i,n,x,g,t,t0,bars=[],tsfirst=this.get_tsfirst();of(width) if(!this.cfmt().equalbars) return for(s2=tsfirst;s2;s2=s2.ts_next){switch(s2.type){default:continue case C.GRACE:case C.MREST:case C.NOTE:case C.REST:case C.SPACE:break} break} if(!s2) return t0=t=s2.time for(s=s2;s.ts_next;s=s.ts_next){if(s.type==C.BAR&&s.seqst){bars.push([s,s.time-t]);t=s.time}} if(!s.invis||s.prev.type!=C.KEY) bars.push([s,s.time-t]) else bars[bars.length-1][0]=s width=s.x t=s.time if(s.dur) t+=s.dur;n=bars.length if(n<=1) return x=s2.type==C.GRACE?s2.extra.x:s2.x;if(this.equalbars_d