Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(480)

Side by Side Diff: lily/rest-engraver.cc

Issue 573670043: Refactor get/set_property to take the item as first argument
Patch Set: Manual completion of patch set Created 4 years, 11 months ago
Left:
Right:
Use n/p to move between diff chunks; N/P to move between comments. Please Sign in to add in-line comments.
Jump to:
View unified diff | Download patch
« no previous file with comments | « lily/rest-collision-engraver.cc ('k') | lily/rhythmic-head.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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 );
OLDNEW
« no previous file with comments | « lily/rest-collision-engraver.cc ('k') | lily/rhythmic-head.cc » ('j') | no next file with comments »

Powered by Google App Engine
RSS Feeds Recent Issues | This issue
This is Rietveld f62528b