]> git.donarmstrong.com Git - lilypond.git/blob - src/lyriccolumn.cc
release: 0.0.26
[lilypond.git] / src / lyriccolumn.cc
1 #include "request.hh"
2 #include "voice.hh"
3 #include "staffwalker.hh"
4 #include "debug.hh"
5 #include "staff.hh"
6 //#include "command.hh"
7 #include "lyricstaff.hh"
8 #include "lyriccolumn.hh"
9 #include "sccol.hh" 
10 #include "pscore.hh"
11 //#include "paper.hh"
12
13
14 Lyric_column::Lyric_column(Score_column*s, Lyric_staff* lstaff_l)
15     : Staff_column(s)
16 {
17     lstaff_l_ = lstaff_l;
18 }
19
20 void
21 Lyric_column::setup_requests()
22 {
23     for (int i = 0 ; i < v_elts.size(); i ++) {
24         for (iter_top(v_elts[i]->reqs,j); j.ok(); j++) {
25             Request* req_l = j;
26             if (req_l->barcheck()) {
27                 if (tdescription_->whole_in_measure) {
28                     error("Barcheck failed, " + tdescription_->str());
29                 }
30             }
31             if (req_l->lreq_l()) {
32                 winfo_array_.push(req_l->lreq_l());
33             }
34         }
35     }
36 }
37
38 Interval itemlist_width(const Array<Item*> &its);
39
40 void
41 Lyric_column::typeset_item(Item *i, int breakst)
42 {
43     assert(i);
44     
45     lstaff_l_->pscore_l_->typeset_item(i, score_column_l_->pcol_l_,
46                                   lstaff_l_->line_pstaff_p_,breakst);
47     
48     if (breakst == BREAK_PRE - BREAK_PRE) {
49         
50         Array<Item*> to_move(
51             lstaff_l_->pscore_l_->select_items(lstaff_l_->line_pstaff_p_,
52                                           score_column_l_->pcol_l_->prebreak_p_));
53         Interval column_wid = itemlist_width(to_move);
54         assert(!column_wid.empty());
55
56         for (int j=0; j < to_move.size(); j++) {
57             to_move[j]->translate(Offset(-column_wid.right, 0));
58         }
59     }
60 }    
61
62 Word_info::Word_info()
63 {
64     lreq_l_ = 0;
65 }
66
67 Word_info::Word_info(Lyric_req* lreq_l) 
68 {
69     lreq_l_ = lreq_l;
70 }