Left: | ||
Right: |
OLD | NEW |
---|---|
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) 2005--2010 Han-Wen Nienhuys <hanwen@xs4all.nl> | 4 Copyright (C) 2005--2010 Han-Wen Nienhuys <hanwen@xs4all.nl> |
5 | 5 |
6 | 6 |
7 LilyPond is free software: you can redistribute it and/or modify | 7 LilyPond is free software: you can redistribute it and/or modify |
8 it under the terms of the GNU General Public License as published by | 8 it under the terms of the GNU General Public License as published by |
9 the Free Software Foundation, either version 3 of the License, or | 9 the Free Software Foundation, either version 3 of the License, or |
10 (at your option) any later version. | 10 (at your option) any later version. |
11 | 11 |
12 LilyPond is distributed in the hope that it will be useful, | 12 LilyPond is distributed in the hope that it will be useful, |
13 but WITHOUT ANY WARRANTY; without even the implied warranty of | 13 but WITHOUT ANY WARRANTY; without even the implied warranty of |
14 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | 14 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
15 GNU General Public License for more details. | 15 GNU General Public License for more details. |
16 | 16 |
17 You should have received a copy of the GNU General Public License | 17 You should have received a copy of the GNU General Public License |
18 along with LilyPond. If not, see <http://www.gnu.org/licenses/>. | 18 along with LilyPond. If not, see <http://www.gnu.org/licenses/>. |
19 */ | 19 */ |
20 | 20 |
21 #include "engraver.hh" | 21 #include "engraver.hh" |
22 | 22 |
23 #include "grob.hh" | |
23 #include "item.hh" | 24 #include "item.hh" |
24 #include "pointer-group-interface.hh" | 25 #include "pointer-group-interface.hh" |
25 #include "simple-closure.hh" | 26 #include "simple-closure.hh" |
26 #include "stream-event.hh" | 27 #include "stream-event.hh" |
27 #include "warn.hh" | 28 #include "warn.hh" |
28 | 29 |
29 #include "translator.icc" | 30 #include "translator.icc" |
30 | 31 |
31 class Tab_harmonic_engraver : public Engraver | 32 class Tab_harmonic_engraver : public Engraver |
32 { | 33 { |
33 TRANSLATOR_DECLARATIONS (Tab_harmonic_engraver); | 34 TRANSLATOR_DECLARATIONS (Tab_harmonic_engraver); |
34 | 35 |
35 protected: | 36 protected: |
36 DECLARE_ACKNOWLEDGER (note_head); | 37 DECLARE_ACKNOWLEDGER (note_head); |
37 }; | 38 }; |
38 | 39 |
39 Tab_harmonic_engraver::Tab_harmonic_engraver () | 40 Tab_harmonic_engraver::Tab_harmonic_engraver () |
40 { | 41 { |
41 } | 42 } |
42 | 43 |
43 void | 44 void |
44 Tab_harmonic_engraver::acknowledge_note_head (Grob_info info) | 45 Tab_harmonic_engraver::acknowledge_note_head (Grob_info info) |
45 { | 46 { |
46 if (Stream_event *note = info.event_cause ()) | 47 if (Stream_event *note = info.event_cause ()) |
47 { | 48 { |
48 for (SCM s = note->get_property ("articulations"); | 49 for (SCM s = note->get_property ("articulations"); |
49 scm_is_pair (s); s = scm_cdr (s)) | 50 scm_is_pair (s); s = scm_cdr (s)) |
50 { | 51 { |
51 Stream_event *ev = unsmob_stream_event (scm_car (s)); | 52 Stream_event *ev = unsmob_stream_event (scm_car (s)); |
52 » | 53 |
53 if (!ev) | 54 if (!ev) |
54 continue; | 55 continue; |
55 | 56 |
56 ·········· | |
57 if (ev->in_event_class ("harmonic-event")) | 57 if (ev->in_event_class ("harmonic-event")) |
58 » { | 58 » if (Grob *victim = info.grob ()) |
59 » if (Item *victim = info.item ()) | 59 » victim->set_property ("style", ly_symbol2scm ("harmonic")); |
Neil Puttock
2010/11/28 22:24:05
This makes it difficult for users to tweak the app
Carl
2010/12/03 16:32:07
I junked the engraver and added properties to the
| |
60 » » { | |
61 » » Engraver *eng = dynamic_cast<Engraver*> (info.origin_translato r ()); | |
62 » » Item *paren = eng->make_item ("HarmonicParenthesesItem", victi m->self_scm ()); | |
63 » » Pointer_group_interface::add_grob (paren, ly_symbol2scm ("elem ents"), victim); | |
64 | |
65 » » paren->set_parent (victim, Y_AXIS); | |
66 »············· | |
67 » » Real size = robust_scm2double (paren->get_property ("font-size "), 0.0) | |
68 » » + robust_scm2double (victim->get_property ("font-size"), 0.0 ); | |
69 » » paren->set_property ("font-size", scm_from_double (size)); | |
70 » » } | |
71 » } | |
72 } | 60 } |
73 } | 61 } |
74 } | 62 } |
75 | 63 |
76 ADD_ACKNOWLEDGER (Tab_harmonic_engraver, note_head); | 64 ADD_ACKNOWLEDGER (Tab_harmonic_engraver, note_head); |
77 ADD_TRANSLATOR (Tab_harmonic_engraver, | 65 ADD_TRANSLATOR (Tab_harmonic_engraver, |
78 /* doc */ | 66 /* doc */ |
79 "In a tablature, parenthesize objects whose music cause has" | 67 "In a tablature, parenthesize objects whose music cause has" |
80 " the @code{parenthesize} property.", | 68 " the @code{parenthesize} property.", |
81 » » | 69 |
82 /* create */ | 70 /* create */ |
83 "HarmonicParenthesesItem ", | 71 "HarmonicParenthesesItem ", |
Neil Puttock
2010/11/28 22:24:05
This is never created, even for \tabFullNotation.
Carl
2010/12/03 16:32:07
Deleting the engraver solved this issue
| |
84 | 72 |
85 /* read */ | 73 /* read */ |
86 "", | 74 "", |
87 | 75 |
88 /* write */ | 76 /* write */ |
89 "" | 77 "" |
90 ); | 78 ); |
OLD | NEW |