From: fred Date: Tue, 10 Dec 1996 14:22:35 +0000 (+0000) Subject: lilypond-0.0.15 X-Git-Tag: release/1.5.59~6630 X-Git-Url: https://git.donarmstrong.com/?a=commitdiff_plain;h=f29a2a9d8f2e6dd0dcba5e5e4e0189778dca19de;p=lilypond.git lilypond-0.0.15 --- diff --git a/hdr/paper.hh b/hdr/paper.hh index b2ba370b57..b03d1f7621 100644 --- a/hdr/paper.hh +++ b/hdr/paper.hh @@ -6,6 +6,7 @@ struct Paperdef { Lookup *lookup_; String outfile; + Real linewidth; /// how much space does a whole note take (ideally?) @@ -15,8 +16,9 @@ struct Paperdef { Real geometric_; /****************/ - void parse(); - Paperdef(); + void reinit(); + Paperdef(Lookup*); + void set(Lookup*); ~Paperdef(); Real interline()const; Real internote()const; diff --git a/src/inputscore.cc b/src/inputscore.cc index 89ec2bd4e9..5043354f0c 100644 --- a/src/inputscore.cc +++ b/src/inputscore.cc @@ -47,7 +47,7 @@ Input_score::~Input_score() Input_score::Input_score() { - paper_=new Paperdef; + paper_= 0; } void diff --git a/src/paper.cc b/src/paper.cc index 5f31611f8e..29fcd240e4 100644 --- a/src/paper.cc +++ b/src/paper.cc @@ -1,15 +1,11 @@ #include - +#include "misc.hh" #include "paper.hh" #include "debug.hh" #include "lookup.hh" #include "dimen.hh" #include "textdb.hh" -double log2(double x) { - return log(x) /log(2.0); -} - // golden ratio const Real PHI = (1+sqrt(5))/2; @@ -20,38 +16,33 @@ Paperdef::duration_to_dist(Real d) { return whole_width * pow(geometric_, log2(d)); } + Real Paperdef::rule_thickness()const { return convert_dimen(0.4, "pt"); } -Paperdef::Paperdef() + +Paperdef::Paperdef(Lookup *l) { - lookup_ = new Lookup(); - parse(); + lookup_ = l; + linewidth = convert_dimen(15,"cm"); // in cm for now - whole_width= 8*note_width(); -// geometric_ = PHI; - geometric_ = sqrt(2); + whole_width = 8 * note_width(); + geometric_ = sqrt(2); } -void -Paperdef::parse() +Paperdef::~Paperdef() { - Text_db symini("symbol.ini"); - - - while (!symini.eof()) { - Text_record r( symini++); - - if (r[0] == "symboltables") - lookup_->parse(symini); - } + delete lookup_; } -Paperdef::~Paperdef() +void +Paperdef::set(Lookup*l) { + assert(l != lookup_); delete lookup_; + lookup_ = l; } Real diff --git a/src/score.cc b/src/score.cc index 57336936b5..2be27345d3 100644 --- a/src/score.cc +++ b/src/score.cc @@ -12,8 +12,7 @@ Score::process() { *mlog << "Processing ... "; - if (!paper_) - paper_ = new Paperdef; + assert (paper_); /// distribute commands to disciples pscore_ = new PScore(paper_);