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) 1997--2020 Han-Wen Nienhuys <hanwen@xs4all.nl> | 4 Copyright (C) 1997--2020 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 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
60 rest_ = 0; | 60 rest_ = 0; |
61 dot_ = 0; | 61 dot_ = 0; |
62 } | 62 } |
63 | 63 |
64 void | 64 void |
65 Rest_engraver::process_music () | 65 Rest_engraver::process_music () |
66 { | 66 { |
67 if (rest_event_ && !rest_) | 67 if (rest_event_ && !rest_) |
68 { | 68 { |
69 rest_ = make_item ("Rest", rest_event_->self_scm ()); | 69 rest_ = make_item ("Rest", rest_event_->self_scm ()); |
70 Pitch *p = unsmob<Pitch> (rest_event_->get_property ("pitch")); | 70 Pitch *p = unsmob<Pitch> (get_property (rest_event_, "pitch")); |
71 | 71 |
72 if (p) | 72 if (p) |
73 { | 73 { |
74 int pos = p->steps (); | 74 int pos = p->steps (); |
75 SCM c0 = get_property ("middleCPosition"); | 75 SCM c0 = get_property (this, "middleCPosition"); |
76 if (scm_is_number (c0)) | 76 if (scm_is_number (c0)) |
77 pos += scm_to_int (c0); | 77 pos += scm_to_int (c0); |
78 | 78 |
79 rest_->set_property ("staff-position", scm_from_int (pos)); | 79 set_property (rest_, "staff-position", scm_from_int (pos)); |
80 } | 80 } |
81 } | 81 } |
82 } | 82 } |
83 | 83 |
84 void | 84 void |
85 Rest_engraver::listen_rest (Stream_event *ev) | 85 Rest_engraver::listen_rest (Stream_event *ev) |
86 { | 86 { |
87 ASSIGN_EVENT_ONCE (rest_event_, ev); | 87 ASSIGN_EVENT_ONCE (rest_event_, ev); |
88 } | 88 } |
89 | 89 |
90 void | 90 void |
91 Rest_engraver::boot () | 91 Rest_engraver::boot () |
92 { | 92 { |
93 ADD_LISTENER (Rest_engraver, rest); | 93 ADD_LISTENER (Rest_engraver, rest); |
94 } | 94 } |
95 | 95 |
96 ADD_TRANSLATOR (Rest_engraver, | 96 ADD_TRANSLATOR (Rest_engraver, |
97 /* doc */ | 97 /* doc */ |
98 "Engrave rests.", | 98 "Engrave rests.", |
99 | 99 |
100 /* create */ | 100 /* create */ |
101 "Rest ", | 101 "Rest ", |
102 | 102 |
103 /* read */ | 103 /* read */ |
104 "middleCPosition ", | 104 "middleCPosition ", |
105 | 105 |
106 /* write */ | 106 /* write */ |
107 "" | 107 "" |
108 ); | 108 ); |
OLD | NEW |