From: fred Date: Tue, 22 Oct 1996 20:32:26 +0000 (+0000) Subject: lilypond-0.0.4 X-Git-Tag: release/1.5.59~7040 X-Git-Url: https://git.donarmstrong.com/?a=commitdiff_plain;h=9f2aa37fea4d35779c751fe0f6cbafe9ada16573;p=lilypond.git lilypond-0.0.4 --- diff --git a/calcideal.cc b/calcideal.cc index b1410aefc0..bddd4f2897 100644 --- a/calcideal.cc +++ b/calcideal.cc @@ -2,7 +2,9 @@ #include "score.hh" #include "pscore.hh" #include "staff.hh" +#include "paper.hh" #include "misc.hh" +#include "sccol.hh" #include "debug.hh" @@ -48,7 +50,7 @@ Score::calc_idealspacing() if (sc->musical) for (int i=0; i < sc->durations.sz(); i++) { Mtime d = sc->durations[i]; - Real dist = duration_to_idealspace(d); + Real dist = duration_to_idealspace(d, paper->whole_width); PCol * c2 = find_col(sc->when + d,true)->pcol; connect_nonmus(sc->pcol, c2, dist); c2 = find_col(sc->when + d,false)->pcol; diff --git a/command.cc b/command.cc index ebf993d239..6375c7e6d3 100644 --- a/command.cc +++ b/command.cc @@ -1,7 +1,12 @@ - #include "string.hh" +#include "debug.hh" #include "command.hh" +bool +Command::isbreak()const +{ + return (code >= BREAK_PRE&&code <= BREAK_END); +} Command* get_bar_command(Real w) @@ -13,3 +18,40 @@ get_bar_command(Real w) c->args.add( "|"); return c; } + +Command * +get_meter_command(Real w, int n, int m) +{ + Command*c = new Command; + + c->when = w; + c->code = TYPESET; + c->args.add( "METER"); + c->args.add( n ); + c->args.add( m ); + return c; +} + + + +Command::Command() +{ + code = NOP; + when = -1; +} + + + +Command::Command(Real w) +{ + code = NOP; + when = w; +} +void +Command::print() const +{ + mtor << "command code: " << code << " args: "; + for (int i = 0; i const &cl) } // now integrate break commands with other commands. - // may be do this in derived functions. + // maybe do this in derived functions. } void @@ -146,39 +143,14 @@ Staff::last() const { void Staff::print() const { + #ifndef NPRINT + mtor << "Staff {\n"; for (PCursor vc(voices); vc.ok(); vc++) { vc->print(); } mtor <<"}\n"; + #endif } -/****************************************************************/ - -bool -Staff_column::mus() const -{ - return score_column->musical; -} - -Mtime -Staff_column::when() const -{ - return score_column->when; -} - -void -Staff_column::add(Voice_element*ve) -{ - Mtime d= ve->duration; - if (d){ - score_column->durations.add(d); - } - - v_elts.add(ve); -} - -Staff_column::Staff_column(Score_column*s) { - score_column = s; -} diff --git a/staff.hh b/staff.hh index 49439f373b..cca8c35266 100644 --- a/staff.hh +++ b/staff.hh @@ -5,25 +5,6 @@ #include "voice.hh" #include "command.hh" -struct Staff_column { - Score_column *score_column; - - /// fields to collect data vertically. - svec v_elts; - svec s_commands; - - Staff_column(Score_column*s); - bool mus() const ; - Mtime when() const; - void add(Voice_element*ve); - /**************************************************************** - VIRTUAL - ****************************************************************/ - virtual void process_requests()=0; - virtual void process_commands()=0; - virtual ~Staff_column() { } -}; - /// base class for a collection of voices. struct Staff { diff --git a/template2.cc b/template2.cc index 40cd5b9fbe..08f2eea880 100644 --- a/template2.cc +++ b/template2.cc @@ -3,6 +3,8 @@ #include "voice.hh" #include "staff.hh" +#include "sccol.hh" +#include "stcol.hh" #include "list.cc" #include "cursor.cc" diff --git a/template3.cc b/template3.cc index b647f18598..6f2e92104c 100644 --- a/template3.cc +++ b/template3.cc @@ -3,7 +3,7 @@ #include "molecule.hh" #include "list.cc" #include "cursor.cc" -L_instantiate(Atom); +PL_instantiate(Atom); PL_instantiate(Command); PL_instantiate(Request);