]> git.donarmstrong.com Git - lilypond.git/blob - lily/note-column.cc
release: 0.0.56
[lilypond.git] / lily / note-column.cc
1 /*
2   note-column.cc -- implement Note_column
3
4   source file of the LilyPond music typesetter
5
6   (c) 1997 Han-Wen Nienhuys <hanwen@stack.nl>
7 */
8
9 #include "note-column.hh"
10 #include "debug.hh"
11 #include "script.hh"
12 #include "notehead.hh"
13 #include "stem.hh"
14
15 IMPLEMENT_STATIC_NAME(Note_column);
16
17
18 void
19 Note_column::add(Stem*stem_l)
20 {
21     add_support(stem_l);
22 }
23
24 void
25 Note_column::add(Notehead* n_l)
26 {
27     assert(!n_l->rest_b_);
28     head_l_arr_.push(n_l);
29     add_support(n_l);
30 }
31
32 Note_column::Note_column()
33 {
34     h_shift_b_ =false;
35     dir_i_ =0;
36 }
37
38 void
39 Note_column::sort()
40 {
41     head_l_arr_.sort( Notehead::compare);
42 }
43     
44 Interval_t<int>
45 Note_column::head_positions_interval()const
46 {
47     (    (Note_column*)this)->sort();
48     return Interval_t<int> ( head_l_arr_[0]->position_i_, 
49                              head_l_arr_.top()->position_i_);
50
51 }