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

Side by Side Diff: lily/tuplet-iterator.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/tuplet-engraver.cc ('k') | lily/tuplet-number.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) 1998--2020 Han-Wen Nienhuys <hanwen@xs4all.nl>, 4 Copyright (C) 1998--2020 Han-Wen Nienhuys <hanwen@xs4all.nl>,
5 Erik Sandberg <mandolaerik@gmail.com> 5 Erik Sandberg <mandolaerik@gmail.com>
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.
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after
65 { 65 {
66 SCM ev_scm = Lily::make_span_event (ly_symbol2scm ("TupletSpanEvent"), 66 SCM ev_scm = Lily::make_span_event (ly_symbol2scm ("TupletSpanEvent"),
67 scm_from_int (d)); 67 scm_from_int (d));
68 68
69 Music *mus = get_music (); 69 Music *mus = get_music ();
70 70
71 Music *ev = unsmob<Music> (ev_scm); 71 Music *ev = unsmob<Music> (ev_scm);
72 ev->set_spot (*mus->origin ()); 72 ev->set_spot (*mus->origin ());
73 if (d == START) 73 if (d == START)
74 { 74 {
75 ev->set_property ("numerator", mus->get_property ("numerator")); 75 set_property (ev, "numerator", get_property (mus, "numerator"));
76 ev->set_property ("denominator", mus->get_property ("denominator")); 76 set_property (ev, "denominator", get_property (mus, "denominator"));
77 ev->set_property ("tweaks", mus->get_property ("tweaks")); 77 set_property (ev, "tweaks", get_property (mus, "tweaks"));
78 ev->set_property ("length", spanner_duration_.smobbed_copy ()); 78 set_property (ev, "length", spanner_duration_.smobbed_copy ());
79 } 79 }
80 80
81 synthesized_events_ = scm_cons (ev_scm, synthesized_events_); 81 synthesized_events_ = scm_cons (ev_scm, synthesized_events_);
82 return ev; 82 return ev;
83 } 83 }
84 84
85 Tuplet_iterator::Tuplet_iterator () 85 Tuplet_iterator::Tuplet_iterator ()
86 { 86 {
87 spanner_duration_ = next_split_mom_ = 0; 87 spanner_duration_ = next_split_mom_ = 0;
88 synthesized_events_ = SCM_EOL; 88 synthesized_events_ = SCM_EOL;
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after
121 } 121 }
122 Music_wrapper_iterator::process (m); 122 Music_wrapper_iterator::process (m);
123 if (child_iter_ && child_iter_->ok ()) 123 if (child_iter_ && child_iter_->ok ())
124 descend_to_child (child_iter_->get_outlet ()); 124 descend_to_child (child_iter_->get_outlet ());
125 125
126 } 126 }
127 127
128 void 128 void
129 Tuplet_iterator::construct_children () 129 Tuplet_iterator::construct_children ()
130 { 130 {
131 if (Duration *d = unsmob<Duration> (get_music ()->get_property ("duration"))) 131 if (Duration *d = unsmob<Duration> (get_property (get_music (), "duration")))
132 spanner_duration_ = d->get_length (); 132 spanner_duration_ = d->get_length ();
133 else if (Moment * mp 133 else if (Moment * mp
134 = unsmob<Moment> (get_outlet ()->get_property ("tupletSpannerDuration "))) 134 = unsmob<Moment> (get_property (get_outlet (), "tupletSpannerDuration ")))
135 spanner_duration_ = mp->main_part_; 135 spanner_duration_ = mp->main_part_;
136 else 136 else
137 spanner_duration_.set_infinite (1); 137 spanner_duration_.set_infinite (1);
138 138
139 Music_wrapper_iterator::construct_children (); 139 Music_wrapper_iterator::construct_children ();
140 140
141 if (child_iter_ && child_iter_->ok ()) 141 if (child_iter_ && child_iter_->ok ())
142 descend_to_child (child_iter_->get_outlet ()); 142 descend_to_child (child_iter_->get_outlet ());
143 } 143 }
144 144
145 void 145 void
146 Tuplet_iterator::derived_mark () const 146 Tuplet_iterator::derived_mark () const
147 { 147 {
148 scm_gc_mark (synthesized_events_); 148 scm_gc_mark (synthesized_events_);
149 Music_wrapper_iterator::derived_mark (); 149 Music_wrapper_iterator::derived_mark ();
150 } 150 }
151 151
152 IMPLEMENT_CTOR_CALLBACK (Tuplet_iterator); 152 IMPLEMENT_CTOR_CALLBACK (Tuplet_iterator);
OLDNEW
« no previous file with comments | « lily/tuplet-engraver.cc ('k') | lily/tuplet-number.cc » ('j') | no next file with comments »

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