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 SCM grouping_rules = | 69 SCM time_signature_fraction = get_property ("timeSignatureFraction"); |
70 ly_assoc_get ( | 70 grouping = ly_beam_grouping (settings, |
71 scm_list_2 (time_signature_fraction, | 71 time_signature_fraction, |
72 scm_string_to_symbol ( | 72 ly_symbol2scm ("end"), |
73 ly_symbol2scm ("end"))), | 73 ly_symbol2scm ("*")); |
74 settings, SCM_EOL); | |
75 grouping = ly_assoc_get (scm_string_to_symbol ( | |
76 ly_symbol2scm ("*")), | |
77 grouping_rules, SCM_EOL); | |
78 } | 74 } |
79 if (scm_is_pair (grouping)) | 75 if (scm_is_pair (grouping)) |
80 { | 76 { |
81 Moment *measpos = unsmob_moment (get_property ("measurePosition")); | 77 Moment *measpos = unsmob_moment (get_property ("measurePosition")); |
82 Rational mp = measpos->main_part_; | 78 Rational mp = measpos->main_part_; |
83 | 79 |
84 Moment *beatlen_mom = unsmob_moment (get_property ("beatLength")); | 80 Moment *beatlen_mom = unsmob_moment (get_property ("beatLength")); |
85 Rational beat_length = beatlen_mom->main_part_; | 81 Rational beat_length = beatlen_mom->main_part_; |
86 | 82 |
87 Rational where (0); | 83 Rational where (0); |
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
132 | 128 |
133 /* read */ | 129 /* read */ |
134 "beatLength " | 130 "beatLength " |
135 "currentMusicalColumn " | 131 "currentMusicalColumn " |
136 "measurePosition " | 132 "measurePosition " |
137 "beamSettings ", | 133 "beamSettings ", |
138 | 134 |
139 /* write */ | 135 /* write */ |
140 "" | 136 "" |
141 ); | 137 ); |
LEFT | RIGHT |