lilypond-1.3.69
[lilypond.git] / lily / head-column.cc
blobb8707965a65003ffb1d0c0823ef208f6cf52a220
1 /*
2 head-column.cc -- implement Head_column
4 source file of the GNU LilyPond music typesetter
6 (c) 1997 Han-Wen Nienhuys <hanwen@stack.nl>
7 */
9 #include "debug.hh"
10 #include "head-column.hh"
11 #include "note-head.hh"
12 #include "stem.hh"
13 #include "script.hh"
15 Head_column::Head_column()
17 stem_l_ = 0;
18 dir_ =CENTER;
21 void
22 Head_column::do_substitute_dependency (Score_elem*o,
23 Score_elem*n)
25 Script_column::do_substitute_dependency (o,n);
26 if (o->name() == Note_head::static_name ())
28 head_l_arr_.substitute ((Note_head*)o->item(),
29 (n)? (Note_head*)n->item() : 0);
31 if (stem_l_ == o)
33 stem_l_ = n ? (Stem*)n->item():0;
38 void
39 Head_column::set (Stem*stem_l)
41 stem_l_ = stem_l;
42 Score_elem::add_dependency (stem_l);
43 for (int i=0; i < script_l_arr_.size(); i++)
44 script_l_arr_[i]->set_stem (stem_l);
47 void
48 Head_column::add (Script *script_l)
50 Script_column::add (script_l) ;
51 if (stem_l_)
52 script_l->set_stem (stem_l_);
54 void
55 Head_column::add (Note_head *n_l)
57 add_support (n_l);
58 head_l_arr_.push (n_l);
63 IMPLEMENT_IS_TYPE_B1(Head_column,Script_column);
65 void
66 Head_column::do_print() const
68 #ifndef NPRINT
69 DOUT << "heads: " << head_l_arr_.size();
70 #endif
73 void
74 Head_column::do_pre_processing()
76 if (!dir_)
78 if (stem_l_)
79 dir_ = stem_l_->dir_;
81 Script_column::do_pre_processing();