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

Delta Between Two Patch Sets: lily/cluster.cc

Issue 573670043: Refactor get/set_property to take the item as first argument
Left Patch Set: Created 4 years, 11 months ago
Right 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:
Right: Side by side diff | Download
« no previous file with change/comment | « lily/clef-modifier.cc ('k') | lily/cluster-engraver.cc » ('j') | no next file with change/comment »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
LEFTRIGHT
(no file at all)
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) 2002--2020 Juergen Reuter <reuter@ipd.uka.de> 4 Copyright (C) 2002--2020 Juergen Reuter <reuter@ipd.uka.de>
5 Han-Wen Nienhuys <hanwen@xs4all.nl> 5 Han-Wen Nienhuys <hanwen@xs4all.nl>
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 22 matching lines...) Expand all
33 using std::vector; 33 using std::vector;
34 34
35 /* 35 /*
36 TODO: Add support for cubic spline segments. 36 TODO: Add support for cubic spline segments.
37 */ 37 */
38 Stencil 38 Stencil
39 brew_cluster_piece (Grob *me, vector<Offset> bottom_points, vector<Offset> top_p oints) 39 brew_cluster_piece (Grob *me, vector<Offset> bottom_points, vector<Offset> top_p oints)
40 { 40 {
41 Real blotdiameter = Staff_symbol_referencer::staff_space (me) / 2; 41 Real blotdiameter = Staff_symbol_referencer::staff_space (me) / 2;
42 42
43 Real padding = robust_scm2double (me->get_property ("padding"), 0.0); 43 Real padding = robust_scm2double (get_property (me, "padding"), 0.0);
44 44
45 Offset vpadding = Offset (0, padding); 45 Offset vpadding = Offset (0, padding);
46 Offset hpadding = Offset (0.5 * blotdiameter, 0); 46 Offset hpadding = Offset (0.5 * blotdiameter, 0);
47 Offset hvpadding = 0.5 * hpadding + vpadding; 47 Offset hvpadding = 0.5 * hpadding + vpadding;
48 48
49 SCM shape_scm = me->get_property ("style"); 49 SCM shape_scm = get_property (me, "style");
50 string shape; 50 string shape;
51 51
52 if (scm_is_symbol (shape_scm)) 52 if (scm_is_symbol (shape_scm))
53 shape = ly_symbol2string (shape_scm); 53 shape = ly_symbol2string (shape_scm);
54 else 54 else
55 { 55 {
56 programming_error ("ClusterSpanner.style should be defined as a symbol."); 56 programming_error ("ClusterSpanner.style should be defined as a symbol.");
57 me->suicide (); 57 me->suicide ();
58 return Stencil (); 58 return Stencil ();
59 } 59 }
(...skipping 176 matching lines...) Expand 10 before | Expand all | Expand 10 after
236 { 236 {
237 public: 237 public:
238 DECLARE_SCHEME_CALLBACK (height, (SCM)); 238 DECLARE_SCHEME_CALLBACK (height, (SCM));
239 }; 239 };
240 240
241 MAKE_SCHEME_CALLBACK (Cluster_beacon, height, 1); 241 MAKE_SCHEME_CALLBACK (Cluster_beacon, height, 1);
242 SCM 242 SCM
243 Cluster_beacon::height (SCM g) 243 Cluster_beacon::height (SCM g)
244 { 244 {
245 Grob *me = unsmob<Grob> (g); 245 Grob *me = unsmob<Grob> (g);
246 Interval v = robust_scm2interval (me->get_property ("positions"), 246 Interval v = robust_scm2interval (get_property (me, "positions"),
247 Interval (0, 0)); 247 Interval (0, 0));
248 return ly_interval2scm (Staff_symbol_referencer::staff_space (me) * 0.5 * v); 248 return ly_interval2scm (Staff_symbol_referencer::staff_space (me) * 0.5 * v);
249 } 249 }
250 250
251 ADD_INTERFACE (Cluster_beacon, 251 ADD_INTERFACE (Cluster_beacon,
252 "A place holder for the cluster spanner to determine the" 252 "A place holder for the cluster spanner to determine the"
253 " vertical extents of a cluster spanner at this" 253 " vertical extents of a cluster spanner at this"
254 " X@tie{}position.", 254 " X@tie{}position.",
255 255
256 /* properties */ 256 /* properties */
257 "positions " 257 "positions "
258 ); 258 );
LEFTRIGHT

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