From fcb43d8b6af815a71477ac3a29d89788f6f729ad Mon Sep 17 00:00:00 2001 From: fred Date: Sat, 9 Nov 1996 10:38:04 +0000 Subject: [PATCH] lilypond-0.0.9 --- src/notehead.cc | 65 +++++++++++++++++++++++++++++++++++++++++++++++++ src/rest.cc | 47 +++++++++++++++++++++++++++++++++++ 2 files changed, 112 insertions(+) create mode 100644 src/notehead.cc create mode 100644 src/rest.cc diff --git a/src/notehead.cc b/src/notehead.cc new file mode 100644 index 0000000000..a103e69b3d --- /dev/null +++ b/src/notehead.cc @@ -0,0 +1,65 @@ +#include "notehead.hh" +#include "dimen.hh" +#include "debug.hh" +#include "paper.hh" +#include "lookup.hh" +#include "molecule.hh" + + +Notehead::Notehead(int ss) +{ + staff_size=ss; + position = 0; + balltype = 0; + dots = 0; +} + +void +Notehead::print()const +{ + mtor << "Head "<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/src/rest.cc b/src/rest.cc new file mode 100644 index 0000000000..e448df37bd --- /dev/null +++ b/src/rest.cc @@ -0,0 +1,47 @@ +#include "rest.hh" +#include "dimen.hh" +#include "debug.hh" +#include "paper.hh" +#include "lookup.hh" +#include "molecule.hh" + + +Rest::Rest(int t, int d) +{ + balltype = t; + dots = d; +} + +void +Rest::print()const +{ + mtor << "Rest "<lookup_->rest(balltype); + + Molecule *m = new Molecule(Atom(s)); + if (dots) { + Symbol d =p->lookup_->dots(dots); + Molecule dm; + dm.add(Atom(d)); + m->add_right(dm); + } + output = m; +} + -- 2.39.5