From 2566ee200ce5fb0c09d08f9aa4b2935a54bf04be Mon Sep 17 00:00:00 2001 From: fred Date: Fri, 13 Sep 1996 18:19:55 +0000 Subject: [PATCH] lilypond-0.0.1 --- note.cc | 130 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 130 insertions(+) create mode 100644 note.cc diff --git a/note.cc b/note.cc new file mode 100644 index 0000000000..538f26a28e --- /dev/null +++ b/note.cc @@ -0,0 +1,130 @@ +#include +#include "string.hh" +#include "real.hh" +#include "debug.hh" +#include "request.hh" +#include "voice.hh" +#include "notename.hh" + +int default_duration = 4; + +void +parse_duration(const char *a, int &j, int &intdur, int &dots) +{ + String durstr; + while (isdigit(a[j])) + { + durstr += a[j++]; + } + + dots=0; + + while (a[j] == '.') + { + j++; + dots++; + } + intdur = (durstr.len()) ? + durstr.value():default_duration; + + if (debug_flags & DEBUGTOKEN) + mtor << "dur " << intdur << "dots " << dots<octave = oct; + rq->accidental = acc; + rq->forceacc = forceacc; + rq->balltype = dur; + rq->dots = dots; + + + v->add(rq); + return v; +} + +Voice_element * +get_rest_element(String type, String durstr) +{ + Voice_element*v = new Voice_element; + int i=0; + + int dur, dots; + parse_duration(durstr, i, dur, dots); + i=0; + + Rest_req * rq = new Rest_req(v); + + rq->balltype = dur; + rq->dots = dots; + + v->add(rq); + return v; +} -- 2.39.5