From: fred Date: Mon, 4 Nov 1996 20:15:07 +0000 (+0000) Subject: lilypond-0.0.7 X-Git-Tag: release/1.5.59~6919 X-Git-Url: https://git.donarmstrong.com/?a=commitdiff_plain;h=ffa596ecfd0a09ed187f9a33cebf4b0b24a02dfa;p=lilypond.git lilypond-0.0.7 --- diff --git a/line.cc b/line.cc index a6e0f7c68a..293214dc30 100644 --- a/line.cc +++ b/line.cc @@ -1,19 +1,27 @@ #include "line.hh" #include "dimen.hh" +#include "spanner.hh" #include "symbol.hh" #include "paper.hh" #include "pcol.hh" #include "pscore.hh" +static String +make_vbox(Interval i) +{ + + String s("\\vbox to "); + s += print_dimen(i.length()); + s += "{\\vskip "+print_dimen(i.max)+" "; + return s; +} + + String Line_of_staff::TeXstring() const { - String s("%line_of_staff\n\\vbox to "); - s += print_dimen(maxheight() ) +"{"; - - //make some room - s += vstrut(base); - + String s("%line_of_staff\n"); + s+=make_vbox(height()); // the staff itself: eg lines, accolades s += "\\hbox{"; { @@ -28,7 +36,8 @@ Line_of_staff::TeXstring() const lastpos = cc->hpos; // moveover - s +=String( "\\kern ") + print_dimen(delta); + if (delta) + s +=String( "\\kern ") + print_dimen(delta); // now output the items. @@ -46,44 +55,8 @@ Line_of_staff::TeXstring() const return s; } -String -Line_of_score::TeXstring() const -{ - String s("\\vbox{"); - for (PCursor sc(staffs); sc.ok(); sc++){ - s += sc->TeXstring(); - if ((sc+1).ok()) - s+= "\\interstaffline\n"; - } - s += "}"; - return s; -} - -/// testing this entry -Line_of_score::Line_of_score(svec sv, - const PScore *ps) -{ - score = ps; - for (int i=0; i< sv.sz(); i++) { - PCol *p=(PCol *) sv[i]; - cols.bottom().add(p); - p->line=this; - } - - for (PCursor sc(score->staffs); sc.ok(); sc++) - staffs.bottom().add(new Line_of_staff(this, sc)); -} -/** construct a line with the named columns. Make the line field - in each column point to this - - #sv# isn't really const!! - */ - Line_of_staff::Line_of_staff(Line_of_score * sc, PStaff*st) { - // [don't know how to calc dimensions yet.] - height = 0.0; - base =0.0; scor=sc; pstaff_=st; @@ -101,8 +74,8 @@ Line_of_staff::Line_of_staff(Line_of_score * sc, PStaff*st) } -Real -Line_of_staff::maxheight() const +Interval +Line_of_staff::height() const { Interval y; { @@ -113,8 +86,6 @@ Line_of_staff::maxheight() const // all items in the current line & staff. for (; cc.ok(); cc++) { - - for (PCursor ic(cc->its); ic.ok(); ic++) { if (ic->pstaff_ == pstaff_) { y.unite(ic->height()); @@ -126,7 +97,41 @@ Line_of_staff::maxheight() const assert(false); } } - return y.max; + return y; +} + + +/****************************************************************/ +String +Line_of_score::TeXstring() const +{ + String s("\\vbox{%<- line of score\n"); + for (PCursor sc(staffs); sc.ok(); sc++){ + s += sc->TeXstring(); + if ((sc+1).ok()) + s+= "\\interstaffline\n"; + } + s += "}"; + return s; } +/// testing this entry +Line_of_score::Line_of_score(svec sv, + const PScore *ps) +{ + score = ps; + for (int i=0; i< sv.sz(); i++) { + PCol *p=(PCol *) sv[i]; + cols.bottom().add(p); + p->line=this; + } + + for (PCursor sc(score->staffs); sc.ok(); sc++) + staffs.bottom().add(new Line_of_staff(this, sc)); +} +/** construct a line with the named columns. Make the line field + in each column point to this + + #sv# isn't really const!! + */ diff --git a/request.cc b/request.cc index 88fdb3349f..fd032fcfd8 100644 --- a/request.cc +++ b/request.cc @@ -1,6 +1,15 @@ #include "request.hh" #include "debug.hh" +#define VIRTUALCONS(T,R) R *T::clone() const { return new T(*this); } struct T +#define RCONS(T) VIRTUALCONS(T, Request) + +RCONS(Rest_req); +RCONS(Rhythmic_req); +RCONS(Stem_req); +RCONS(Note_req); + + void Request::print() const {