From: fred <fred> Date: Thu, 23 Jan 1997 22:16:17 +0000 (+0000) Subject: lilypond-0.0.24 X-Git-Tag: release/1.5.59~6387 X-Git-Url: https://git.donarmstrong.com/?a=commitdiff_plain;h=5bc35262d99fbd3b2528afef90de2bd6d26458ab;p=lilypond.git lilypond-0.0.24 --- diff --git a/src/lyriccolumn.cc b/src/lyriccolumn.cc new file mode 100644 index 0000000000..6420c4b3d9 --- /dev/null +++ b/src/lyriccolumn.cc @@ -0,0 +1,77 @@ +#include "request.hh" +#include "voice.hh" +#include "staffwalker.hh" +#include "debug.hh" +#include "staff.hh" +#include "command.hh" +//#include "simplestaff.hh" +#include "lyricstaff.hh" +#include "lyriccolumn.hh" +#include "sccol.hh" +//#include "simplewalker.hh" +#include "pscore.hh" +#include "paper.hh" + + +Lyric_column::Lyric_column(Score_column*s, Lyric_staff* lstaff_l) + : Staff_column(s) +{ + lstaff_l_ = lstaff_l; +} + +void +Lyric_column::process_requests() +{ + for (int i = 0 ; i < v_elts.size(); i ++) { + for (iter_top(v_elts[i]->reqs,j); j.ok(); j++) { + Request* req_l = j; + if (req_l->barcheck()) { + if (tdescription_->whole_in_measure) { + error("Barcheck failed, " + tdescription_->str()); + } + } +#if 0 + if (req_l->rhythmic()){ + notes.add(rq->rhythmic()); + } +#endif + if (req_l->lreq_l()) { + winfo_array_.add(req_l->lreq_l()); + } + } + } +} + +Interval itemlist_width(const Array<Item*> &its); + +void +Lyric_column::typeset_item(Item *i, int breakst) +{ + assert(i); + + lstaff_l_->pscore_l_->typeset_item(i, score_column_l_->pcol_l_, + lstaff_l_->line_pstaff_p_,breakst); + + if (breakst == BREAK_PRE - BREAK_PRE) { + + Array<Item*> to_move( + lstaff_l_->pscore_l_->select_items(lstaff_l_->line_pstaff_p_, + score_column_l_->pcol_l_->prebreak_p_)); + Interval column_wid = itemlist_width(to_move); + assert(!column_wid.empty()); + + for (int j=0; j < to_move.size(); j++) { + to_move[j]->translate(Offset(-column_wid.right, 0)); + } + } +} + +Word_info::Word_info() +{ + lreq_l_ = 0; +} + +Word_info::Word_info(Lyric_req* lreq_l) +{ + lreq_l_ = lreq_l; +} diff --git a/src/lyricstaff.cc b/src/lyricstaff.cc new file mode 100644 index 0000000000..51b802e077 --- /dev/null +++ b/src/lyricstaff.cc @@ -0,0 +1,47 @@ +#include "request.hh" +#include "voice.hh" +#include "staffwalker.hh" +#include "debug.hh" +#include "staff.hh" +#include "command.hh" +#include "lyricstaff.hh" +#include "lyriccolumn.hh" +#include "linepstaff.hh" +#include "sccol.hh" +#include "lyricwalker.hh" +#include "pscore.hh" + + + +Lyric_staff::Lyric_staff() +{ + line_pstaff_p_ = 0; +} + +Staff_column* +Lyric_staff::create_col(Score_column*s) +{ + return new Lyric_column(s,this); +} + +void +Lyric_staff::set_output(PScore*ps) +{ + line_pstaff_p_ = new Linestaff(0,ps); + pscore_l_ = ps; + pscore_l_->add(line_pstaff_p_); +} + +void +Lyric_staff::walk() +{ + for (Lyric_walker lcols(this); lcols.ok(); lcols++) { + lcols.lcol_l()->process_requests();// TODO + lcols.process(); + } +} +Staff * +get_new_lyricstaff() +{ + return new Lyric_staff; +}