]> git.donarmstrong.com Git - lilypond.git/blob - lily/scoreline.cc
release: 0.0.62
[lilypond.git] / lily / scoreline.cc
1 /*
2   scoreline.cc -- implement Line_of_score
3
4   source file of the LilyPond music typesetter
5
6   (c) 1996, 1997 Han-Wen Nienhuys <hanwen@stack.nl>
7 */
8
9 #include "scoreline.hh"
10 #include "staffline.hh"
11 #include "dimen.hh"
12 #include "spanner.hh"
13 #include "symbol.hh"
14 #include "paper-def.hh"
15 #include "p-col.hh"
16 #include "p-score.hh"
17
18
19 String
20 Line_of_score::TeXstring() const
21 {
22      String s("\\vbox{%<- line of score\n");
23      if (error_mark_b_)
24          s+= "\\scorelineerrormark";
25      for (iter_top(staffs,sc); sc.ok(); sc++){
26          s += sc->TeXstring();
27          if ((sc+1).ok())
28              s+= "\\interstaffline\n";
29      }
30      s += "}";
31      return s;
32 }
33
34
35 Line_of_score::Line_of_score(Array<PCol *> sv,
36                              PScore *ps)
37 {
38     error_mark_b_ = 0;
39     pscore_l_ = ps;
40     for (int i=0; i< sv.size(); i++) {
41         PCol *p=(PCol *) sv[i];
42         cols.bottom().add(p);
43         p->line_l_=this;
44     }
45
46     for (iter_top(pscore_l_->staffs,sc); sc.ok(); sc++)
47         staffs.bottom().add(new Line_of_staff(this, sc));    
48 }
49 /* construct a line with the named columns. Make the line field
50     in each column point to this
51     
52     #sv# isn't really const!!
53     */
54
55
56 void
57 Line_of_score::process()
58 {
59     for (iter_top(staffs,i); i.ok(); i++)
60         i->process();
61 }
62