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) 2006--2020 Han-Wen Nienhuys <hanwen@lilypond.org> | 4 Copyright (C) 2006--2020 Han-Wen Nienhuys <hanwen@lilypond.org> |
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 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
53 | 53 |
54 Balloon_engraver::Balloon_engraver (Context *c) | 54 Balloon_engraver::Balloon_engraver (Context *c) |
55 : Engraver (c) | 55 : Engraver (c) |
56 { | 56 { |
57 } | 57 } |
58 | 58 |
59 void | 59 void |
60 Balloon_engraver::balloonify (Grob *g, Stream_event *event) | 60 Balloon_engraver::balloonify (Grob *g, Stream_event *event) |
61 { | 61 { |
62 Grob *b = make_item ("BalloonTextItem", event->self_scm ()); | 62 Grob *b = make_item ("BalloonTextItem", event->self_scm ()); |
63 b->set_property ("text", event->get_property ("text")); | 63 set_property (b, "text", get_property (event, "text")); |
64 b->set_parent (g, Y_AXIS); | 64 b->set_parent (g, Y_AXIS); |
65 b->set_parent (g, X_AXIS); | 65 b->set_parent (g, X_AXIS); |
66 } | 66 } |
67 | 67 |
68 void | 68 void |
69 Balloon_engraver::acknowledge_grob (Grob_info info) | 69 Balloon_engraver::acknowledge_grob (Grob_info info) |
70 { | 70 { |
71 Stream_event *cause = info.event_cause (); | 71 Stream_event *cause = info.event_cause (); |
72 | 72 |
73 SCM arts = cause ? cause->get_property ("articulations") : SCM_EOL; | 73 SCM arts = cause ? get_property (cause, "articulations") : SCM_EOL; |
74 for (SCM s = arts; scm_is_pair (s); s = scm_cdr (s)) | 74 for (SCM s = arts; scm_is_pair (s); s = scm_cdr (s)) |
75 { | 75 { |
76 Stream_event *e = unsmob<Stream_event> (scm_car (s)); | 76 Stream_event *e = unsmob<Stream_event> (scm_car (s)); |
77 if (e->in_event_class ("annotate-output-event")) | 77 if (e->in_event_class ("annotate-output-event")) |
78 { | 78 { |
79 balloonify (info.grob (), e); | 79 balloonify (info.grob (), e); |
80 } | 80 } |
81 } | 81 } |
82 | 82 |
83 for (vsize i = 0; i < events_.size (); i++) | 83 for (vsize i = 0; i < events_.size (); i++) |
84 { | 84 { |
85 if (info.grob ()->name () == ly_symbol2string (events_[i]->get_property ("
symbol"))) | 85 if (info.grob ()->name () == ly_symbol2string (get_property (events_[i], "
symbol"))) |
86 balloonify (info.grob (), events_[i]); | 86 balloonify (info.grob (), events_[i]); |
87 } | 87 } |
88 } | 88 } |
89 | 89 |
90 void | 90 void |
91 Balloon_engraver::boot () | 91 Balloon_engraver::boot () |
92 { | 92 { |
93 ADD_LISTENER (Balloon_engraver, annotate_output); | 93 ADD_LISTENER (Balloon_engraver, annotate_output); |
94 ADD_ACKNOWLEDGER (Balloon_engraver, grob); | 94 ADD_ACKNOWLEDGER (Balloon_engraver, grob); |
95 } | 95 } |
96 | 96 |
97 ADD_TRANSLATOR (Balloon_engraver, | 97 ADD_TRANSLATOR (Balloon_engraver, |
98 /* doc */ | 98 /* doc */ |
99 "Create balloon texts.", | 99 "Create balloon texts.", |
100 | 100 |
101 /* create */ | 101 /* create */ |
102 "BalloonTextItem ", | 102 "BalloonTextItem ", |
103 | 103 |
104 /*read*/ | 104 /*read*/ |
105 "", | 105 "", |
106 | 106 |
107 /*write*/ | 107 /*write*/ |
108 "" | 108 "" |
109 ); | 109 ); |
OLD | NEW |