From dd1890f646f116c6f25ee7f7ab2d099bc169d01c Mon Sep 17 00:00:00 2001 From: fred Date: Tue, 5 Nov 1996 17:39:44 +0000 Subject: [PATCH] lilypond-0.0.8 --- notehead.cc | 67 +++++++++++++++++++++++++++++++++++++++++++++++++++++ tstream.cc | 5 ++-- 2 files changed, 70 insertions(+), 2 deletions(-) create mode 100644 notehead.cc diff --git a/notehead.cc b/notehead.cc new file mode 100644 index 0000000000..fe026b1036 --- /dev/null +++ b/notehead.cc @@ -0,0 +1,67 @@ +#include "notehead.hh" +#include "dimen.hh" +#include "debug.hh" +#include "pstaff.hh" +#include "pscore.hh" +#include "paper.hh" +#include "lookupsyms.hh" +#include "molecule.hh" + + +Notehead::Notehead(int ss) +{ + staff_size=ss; + position = 0; + balltype = 0; + dots = 0; +} + +void +Notehead::print()const +{ + mtor << "Head "<pscore_->paper_; + + Real dy = p->interline()/2; + Symbol s = p->lookup_->ball(balltype); + + output = new Molecule(Atom(s)); + if (dots) { + Symbol d = p->lookup_->dots(dots); + Molecule dm; + dm.add(Atom(d)); + if (!(position %2)) + dm.translate(Offset(0,dy)); + output->add_right(dm); + } + bool streepjes = (position<-1)||(position > staff_size+1); + if (streepjes) { + int dir = sgn(position); + int s =(position<-1) ? -((-position)/2): (position-staff_size)/2; + Symbol str = p->lookup_->streepjes(s); + Molecule sm; + sm.add(Atom(str)); + if (position % 2) + sm.translate(Offset(0,-dy* dir)); + output->add(sm); + } + + + output->translate(Offset(0,dy*position)); +} + diff --git a/tstream.cc b/tstream.cc index b7c88f1b0b..05e2e9c93e 100644 --- a/tstream.cc +++ b/tstream.cc @@ -32,7 +32,8 @@ Tex_stream::~Tex_stream() // print string. don't forget indent. Tex_stream & Tex_stream::operator<<(String s) -{ +{ + for (const char *cp = s; *cp; cp++) { if (outputting_comment) { *os << *cp; @@ -56,7 +57,7 @@ Tex_stream::operator<<(String s) nest_level--; *os << *cp; assert (nest_level >= 0); - /* FALL THROUGH */ + /* FALTHROUGH */ case '\n': *os << "%\n"; -- 2.39.5