LEFT | RIGHT |
1 /* | 1 /* |
2 measure-grouping-engraver.cc -- implement Measure_grouping_engraver | 2 measure-grouping-engraver.cc -- implement Measure_grouping_engraver |
3 | 3 |
4 source file of the GNU LilyPond music typesetter | 4 source file of the GNU LilyPond music typesetter |
5 | 5 |
6 (c) 2002--2009 Han-Wen Nienhuys <hanwen@xs4all.nl> | 6 (c) 2002--2009 Han-Wen Nienhuys <hanwen@xs4all.nl> |
7 */ | 7 */ |
8 | 8 |
9 #include "warn.hh" | 9 #include "warn.hh" |
10 #include "side-position-interface.hh" | 10 #include "side-position-interface.hh" |
11 #include "global-context.hh" | 11 #include "global-context.hh" |
12 #include "engraver.hh" | 12 #include "engraver.hh" |
13 #include "spanner.hh" | 13 #include "spanner.hh" |
| 14 #include "beam-settings.hh" |
14 | 15 |
15 #include "translator.icc" | 16 #include "translator.icc" |
16 | 17 |
17 class Measure_grouping_engraver : public Engraver | 18 class Measure_grouping_engraver : public Engraver |
18 { | 19 { |
19 public: | 20 public: |
20 TRANSLATOR_DECLARATIONS (Measure_grouping_engraver); | 21 TRANSLATOR_DECLARATIONS (Measure_grouping_engraver); |
21 | 22 |
22 protected: | 23 protected: |
23 Spanner *grouping_; | 24 Spanner *grouping_; |
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
55 grouping_->set_bound (RIGHT, | 56 grouping_->set_bound (RIGHT, |
56 unsmob_grob (get_property ("currentMusicalColumn")))
; | 57 unsmob_grob (get_property ("currentMusicalColumn")))
; |
57 | 58 |
58 grouping_ = 0; | 59 grouping_ = 0; |
59 } | 60 } |
60 | 61 |
61 if (now.grace_part_) | 62 if (now.grace_part_) |
62 return; | 63 return; |
63 | 64 |
64 SCM settings = get_property ("beamSettings"); | 65 SCM settings = get_property ("beamSettings"); |
65 SCM time_signature_fraction = get_property("timeSignatureFraction"); | 66 SCM grouping = SCM_EOL; |
66 SCM grouping = SCM_UNDEFINED; | |
67 if (scm_is_pair (settings)) | 67 if (scm_is_pair (settings)) |
68 { | 68 { |
69 | 69 SCM time_signature_fraction = get_property ("timeSignatureFraction"); |
70 SCM grouping_rules =· | 70 grouping = ly_beam_grouping (settings, |
71 ly_assoc_get ( | 71 time_signature_fraction, |
72 scm_list_2 (time_signature_fraction, | 72 ly_symbol2scm ("end"), |
73 scm_string_to_symbol ( | 73 ly_symbol2scm ("*")); |
74 scm_from_locale_string ("end"))), | |
75 settings, SCM_EOL); | |
76 grouping = ly_assoc_get (scm_string_to_symbol ( | |
77 scm_from_locale_string ("*")), | |
78 grouping_rules, SCM_EOL); | |
79 } | 74 } |
80 if (scm_is_pair (grouping)) | 75 if (scm_is_pair (grouping)) |
81 { | 76 { |
82 Moment *measpos = unsmob_moment (get_property ("measurePosition")); | 77 Moment *measpos = unsmob_moment (get_property ("measurePosition")); |
83 Rational mp = measpos->main_part_; | 78 Rational mp = measpos->main_part_; |
84 | 79 |
85 Moment *beatlen_mom = unsmob_moment (get_property ("beatLength")); | 80 Moment *beatlen_mom = unsmob_moment (get_property ("beatLength")); |
86 Rational beat_length = beatlen_mom->main_part_; | 81 Rational beat_length = beatlen_mom->main_part_; |
87 | 82 |
88 Rational where (0); | 83 Rational where (0); |
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
133 | 128 |
134 /* read */ | 129 /* read */ |
135 "beatLength " | 130 "beatLength " |
136 "currentMusicalColumn " | 131 "currentMusicalColumn " |
137 "measurePosition " | 132 "measurePosition " |
138 "beamSettings ", | 133 "beamSettings ", |
139 | 134 |
140 /* write */ | 135 /* write */ |
141 "" | 136 "" |
142 ); | 137 ); |
LEFT | RIGHT |