// abc2svg - ABC to SVG translator // @source: https://chiselapp.com/user/moinejf/repository/abc2svg // Copyright (C) 2014-2020 Jean-Francois Moine - LGPL3+ //capo.js-module to add a capo chord line abc2svg.capo={gch_build:function(of,s){var t,i,gch,gch2,i2,abc=this,p_v=abc.get_curvoice(),a_gch=s.a_gch if(p_v.capo&&a_gch){t=p_v.capo i=0 while(1){gch=a_gch[i++] if(!gch) return if(gch.type=='g') break} gch2=Object.create(gch) gch2.capo=false gch2.text=abc.gch_tr1(gch2.text,-abc2svg.ifb40[t%12]) if(!p_v.capo_first){p_v.capo_first=true gch2.text+=" (capo: "+t.toString()+")"} gch2.font=abc.get_font(abc.cfmt().capofont?"capo":"annotation") a_gch.splice(i,0,gch2) gch.capo=true} of(s)},set_fmt:function(of,cmd,param){if(cmd=="capo"){this.set_v_param("capo_",param) return} of(cmd,param)},set_vp:function(of,a){var i,v,p_v=this.get_curvoice() for(i=0;i