From 8b8b0f0f498a1a7faa9d1052f02484ee3e2f274c Mon Sep 17 00:00:00 2001 From: fred Date: Mon, 18 Nov 1996 20:49:27 +0000 Subject: [PATCH] lilypond-0.0.10 --- src/simpleprint.cc | 80 +++++++++++++++++++++++++++++++++++++--------- 1 file changed, 65 insertions(+), 15 deletions(-) diff --git a/src/simpleprint.cc b/src/simpleprint.cc index 395396e22b..eb8c80759c 100644 --- a/src/simpleprint.cc +++ b/src/simpleprint.cc @@ -1,13 +1,9 @@ -#include "lookup.hh" +#include "clefitem.hh" #include "request.hh" -#include "beam.hh" #include "pscore.hh" #include "paper.hh" #include "simplestaff.hh" -#include "molecule.hh" #include "sccol.hh" -#include "stem.hh" -#include "notehead.hh" #include "rest.hh" #include "debug.hh" #include "bar.hh" @@ -16,26 +12,73 @@ Item * Simple_staff::get_TYPESET_item(Command *com) { - Item *s; - if (com -> args[0] == "BAR" ) { + Item *s=0; + svec arg( com->args); + String type =arg[0]; + arg.del(0); + if (type == "BAR" ) { s = new Bar(com->args[1]); - } else if (com->args[0] == "METER") { - svec arg( com->args); - arg.del(0); + } else if (type == "METER") { s = new Meter(arg); - } else - assert(false); - + } else if (type == "CLEF") { + s = new Clef_item; + }else{ + WARN << "ignoring TYPESET command for " << type << '\n'; + + } return s; } + +Interval +itemlist_width(const svec &its) +{ + Interval iv; + for (int j =0; j < its.sz(); j++) + iv.unite(its[j]->width()); + return iv; +} + void Simple_column::typeset_item(Item *i, int breakst) { assert(i); - // ugh - staff_->pscore_->typeset_item(i, score_column->pcol, + + staff_->pscore_->typeset_item(i, score_column->pcol_, staff_->theline,breakst); + + if (breakst == BREAK_PRE - BREAK_PRE) { + + svec to_move( + staff_->pscore_->select_items(staff_->theline, + score_column->pcol_->prebreak)); + Interval column_wid = itemlist_width(to_move); + assert(!column_wid.empty()); + + for (int j=0; j < to_move.sz(); j++) { + to_move[j]->translate(Offset(-column_wid.max, 0)); + } + } +} + +void +Simple_column::typeset_item_directional(Item *i, int dir, int breakst) +{ + assert(i); + PCol * c=score_column->pcol_; + if (breakst == 0) + c = c->prebreak; + else if (breakst == 2) + c = c->postbreak; + + svec to_move(staff_->pscore_->select_items(staff_->theline, + c)); + typeset_item(i, breakst); + + Interval column_wid = itemlist_width(to_move); + if (column_wid.empty()) + column_wid = Interval(0,0); + i->translate(Offset(column_wid[dir] - i->width()[-dir], 0)); } void @@ -53,3 +96,10 @@ Simple_staff::get_rest(Rest_req*rq) int d = rq->rhythmic()->dots; return new Rest(b, d); } + +Local_key_item* +Simple_staff::get_local_key_item() +{ + return 0; +} + -- 2.39.5