LEFT | RIGHT |
(no file at all) | |
1 /* | 1 /* |
2 This file is part of LilyPond, the GNU music typesetter. | 2 This file is part of LilyPond, the GNU music typesetter. |
3 | 3 |
4 Copyright (C) 1997--2011 Han-Wen Nienhuys <hanwen@xs4all.nl> | 4 Copyright (C) 1997--2011 Han-Wen Nienhuys <hanwen@xs4all.nl> |
5 | 5 |
6 LilyPond is free software: you can redistribute it and/or modify | 6 LilyPond is free software: you can redistribute it and/or modify |
7 it under the terms of the GNU General Public License as published by | 7 it under the terms of the GNU General Public License as published by |
8 the Free Software Foundation, either version 3 of the License, or | 8 the Free Software Foundation, either version 3 of the License, or |
9 (at your option) any later version. | 9 (at your option) any later version. |
10 | 10 |
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
48 appear and disappear at will, leaving lots of loose ends (the note | 48 appear and disappear at will, leaving lots of loose ends (the note |
49 spacing engraver don't know where to connect the last note of the | 49 spacing engraver don't know where to connect the last note of the |
50 voice on the right with), but we don't complain about those, and let | 50 voice on the right with), but we don't complain about those, and let |
51 the default spacing do its work. | 51 the default spacing do its work. |
52 */ | 52 */ |
53 | 53 |
54 class Rhythmic_column_engraver : public Engraver | 54 class Rhythmic_column_engraver : public Engraver |
55 { | 55 { |
56 vector<Grob *> rheads_; | 56 vector<Grob *> rheads_; |
57 Grob *stem_; | 57 Grob *stem_; |
| 58 Grob *flag_; |
58 Grob *note_column_; | 59 Grob *note_column_; |
59 Grob *arpeggio_; | 60 Grob *arpeggio_; |
60 | 61 |
61 TRANSLATOR_DECLARATIONS (Rhythmic_column_engraver); | 62 TRANSLATOR_DECLARATIONS (Rhythmic_column_engraver); |
62 protected: | 63 protected: |
63 | 64 |
64 DECLARE_ACKNOWLEDGER (stem); | 65 DECLARE_ACKNOWLEDGER (stem); |
| 66 DECLARE_ACKNOWLEDGER (flag); |
65 DECLARE_ACKNOWLEDGER (rhythmic_head); | 67 DECLARE_ACKNOWLEDGER (rhythmic_head); |
66 DECLARE_ACKNOWLEDGER (arpeggio); | 68 DECLARE_ACKNOWLEDGER (arpeggio); |
67 void process_acknowledged (); | 69 void process_acknowledged (); |
68 void stop_translation_timestep (); | 70 void stop_translation_timestep (); |
69 }; | 71 }; |
70 | 72 |
71 Rhythmic_column_engraver::Rhythmic_column_engraver () | 73 Rhythmic_column_engraver::Rhythmic_column_engraver () |
72 { | 74 { |
73 | 75 |
74 stem_ = 0; | 76 stem_ = 0; |
| 77 flag_ = 0; |
75 note_column_ = 0; | 78 note_column_ = 0; |
76 arpeggio_ = 0; | 79 arpeggio_ = 0; |
77 } | 80 } |
78 | 81 |
79 void | 82 void |
80 Rhythmic_column_engraver::process_acknowledged () | 83 Rhythmic_column_engraver::process_acknowledged () |
81 { | 84 { |
82 if (rheads_.size ()) | 85 if (rheads_.size ()) |
83 { | 86 { |
84 if (!note_column_) | 87 if (!note_column_) |
(...skipping 13 matching lines...) Expand all Loading... |
98 { | 101 { |
99 Note_column::set_stem (note_column_, stem_); | 102 Note_column::set_stem (note_column_, stem_); |
100 stem_ = 0; | 103 stem_ = 0; |
101 } | 104 } |
102 | 105 |
103 if (arpeggio_) | 106 if (arpeggio_) |
104 { | 107 { |
105 Pointer_group_interface::add_grob (note_column_, ly_symbol2scm ("eleme
nts"), arpeggio_); | 108 Pointer_group_interface::add_grob (note_column_, ly_symbol2scm ("eleme
nts"), arpeggio_); |
106 note_column_->set_object ("arpeggio", arpeggio_->self_scm ()); | 109 note_column_->set_object ("arpeggio", arpeggio_->self_scm ()); |
107 } | 110 } |
| 111 if (flag_) |
| 112 Pointer_group_interface::add_grob (note_column_, ly_symbol2scm ("element
s"), flag_); |
108 } | 113 } |
109 } | 114 } |
110 | 115 |
111 void | 116 void |
112 Rhythmic_column_engraver::acknowledge_stem (Grob_info i) | 117 Rhythmic_column_engraver::acknowledge_stem (Grob_info i) |
113 { | 118 { |
114 stem_ = i.grob (); | 119 stem_ = i.grob (); |
| 120 } |
| 121 |
| 122 void |
| 123 Rhythmic_column_engraver::acknowledge_flag (Grob_info i) |
| 124 { |
| 125 flag_ = i.grob (); |
115 } | 126 } |
116 | 127 |
117 void | 128 void |
118 Rhythmic_column_engraver::acknowledge_rhythmic_head (Grob_info i) | 129 Rhythmic_column_engraver::acknowledge_rhythmic_head (Grob_info i) |
119 { | 130 { |
120 rheads_.push_back (i.grob ()); | 131 rheads_.push_back (i.grob ()); |
121 } | 132 } |
122 | 133 |
123 void | 134 void |
124 Rhythmic_column_engraver::acknowledge_arpeggio (Grob_info i) | 135 Rhythmic_column_engraver::acknowledge_arpeggio (Grob_info i) |
125 { | 136 { |
126 arpeggio_ = i.grob (); | 137 arpeggio_ = i.grob (); |
127 } | 138 } |
128 | 139 |
129 void | 140 void |
130 Rhythmic_column_engraver::stop_translation_timestep () | 141 Rhythmic_column_engraver::stop_translation_timestep () |
131 { | 142 { |
132 note_column_ = 0; | 143 note_column_ = 0; |
133 stem_ = 0; | 144 stem_ = 0; |
134 arpeggio_ = 0; | 145 arpeggio_ = 0; |
| 146 flag_ = 0; |
135 } | 147 } |
136 | 148 |
137 ADD_ACKNOWLEDGER (Rhythmic_column_engraver, stem); | 149 ADD_ACKNOWLEDGER (Rhythmic_column_engraver, stem); |
| 150 ADD_ACKNOWLEDGER (Rhythmic_column_engraver, flag); |
138 ADD_ACKNOWLEDGER (Rhythmic_column_engraver, rhythmic_head); | 151 ADD_ACKNOWLEDGER (Rhythmic_column_engraver, rhythmic_head); |
139 ADD_ACKNOWLEDGER (Rhythmic_column_engraver, arpeggio); | 152 ADD_ACKNOWLEDGER (Rhythmic_column_engraver, arpeggio); |
140 | 153 |
141 ADD_TRANSLATOR (Rhythmic_column_engraver, | 154 ADD_TRANSLATOR (Rhythmic_column_engraver, |
142 /* doc */ | 155 /* doc */ |
143 "Generate @code{NoteColumn}, an object that groups stems," | 156 "Generate @code{NoteColumn}, an object that groups stems," |
144 " note heads, and rests.", | 157 " note heads, and rests.", |
145 | 158 |
146 /* create */ | 159 /* create */ |
147 "NoteColumn ", | 160 "NoteColumn ", |
148 | 161 |
149 /* read */ | 162 /* read */ |
150 "", | 163 "", |
151 | 164 |
152 /* write */ | 165 /* write */ |
153 "" | 166 "" |
154 ); | 167 ); |
LEFT | RIGHT |