]> git.donarmstrong.com Git - lilypond.git/blob - lily/head-column.cc
d08519a8913e06b81a8880794556262b68630323
[lilypond.git] / lily / head-column.cc
1 /*
2   head-column.cc -- implement Head_column
3
4   source file of the GNU LilyPond music typesetter
5
6   (c) 1997 Han-Wen Nienhuys <hanwen@stack.nl>
7 */
8
9 #include "debug.hh"
10 #include "head-column.hh"
11 #include "note-head.hh"
12 #include "stem.hh"
13
14 Head_column::Head_column()
15 {
16     stem_l_ = 0;
17     dir_i_ =0;
18 }
19
20 void
21 Head_column::do_substitute_dependency(Score_elem*o,
22                                       Score_elem*n)
23 {
24     Script_column::do_substitute_dependency(o,n);
25     if (o->name() == Note_head::static_name()) {
26         head_l_arr_.substitute( (Note_head*)o->item(), 
27                                 (n)? (Note_head*)n->item() : 0);
28     }
29     if (stem_l_ == o) {
30         stem_l_ = n ? (Stem*)n->item():0;
31     }
32 }
33
34
35 void
36 Head_column::set(Stem*stem_l)
37 {
38     stem_l_ = stem_l;
39     add_dependency(stem_l);
40 }
41
42 void
43 Head_column::add(Note_head *n_l)
44 {
45     add_support(n_l);
46     head_l_arr_.push(n_l);
47 }
48
49
50
51 IMPLEMENT_IS_TYPE_B1(Head_column,Script_column);
52
53 void
54 Head_column::do_print() const
55 {
56 #ifndef NPRINT
57     mtor << "heads: " << head_l_arr_.size();
58 #endif
59 }
60
61 void
62 Head_column::do_pre_processing()
63 {
64     if (!dir_i_){
65         if (stem_l_)
66             dir_i_ = stem_l_->dir_i_;
67     }
68     Script_column::do_pre_processing();
69 }