]> git.donarmstrong.com Git - lilypond.git/blob - lily/note-column.cc
release: 0.1.11
[lilypond.git] / lily / note-column.cc
1 /*
2   note-column.cc -- implement Note_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 "note-column.hh"
10 #include "script.hh"
11 #include "note-head.hh"
12 #include "stem.hh"
13
14
15 IMPLEMENT_IS_TYPE_B1(Note_column,Head_column);
16
17 Note_column::Note_column()
18 {
19   h_shift_b_ =false;
20 }
21
22 void
23 Note_column::sort()
24 {
25   head_l_arr_.sort (Note_head::compare);
26 }
27   
28 Interval_t<int>
29 Note_column::head_positions_interval() const
30 {
31   ((Note_column*)this)->sort();
32   return Interval_t<int> (head_l_arr_[0]->position_i_, 
33                              head_l_arr_.top()->position_i_);
34
35 }
36
37
38 void
39 Note_column::do_pre_processing()
40 {
41   if (!dir_&& !stem_l_)
42     {
43         dir_ = (head_positions_interval().center () >=  5) ? DOWN:UP;
44     }
45   Head_column::do_pre_processing();
46 }
47
48