LEFT | RIGHT |
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--2011 Han-Wen Nienhuys <hanwen@xs4all.nl> | 4 Copyright (C) 1997--2011 Han-Wen Nienhuys <hanwen@xs4all.nl> |
5 Jan Nieuwenhuizen <janneke@gnu.org> | 5 Jan Nieuwenhuizen <janneke@gnu.org> |
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 142 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
153 for (vsize i = 0; i < stems.size (); i++) | 153 for (vsize i = 0; i < stems.size (); i++) |
154 if (Stem::is_normal_stem (stems[i])) | 154 if (Stem::is_normal_stem (stems[i])) |
155 ga->add (stems[i]); | 155 ga->add (stems[i]); |
156 | 156 |
157 return val; | 157 return val; |
158 } | 158 } |
159 | 159 |
160 MAKE_SCHEME_CALLBACK (Beam, calc_direction, 1); | 160 MAKE_SCHEME_CALLBACK (Beam, calc_direction, 1); |
161 SCM | 161 SCM |
162 Beam::calc_direction (SCM smob) | 162 Beam::calc_direction (SCM smob) |
163 { | 163 {message ("FOO"); |
164 Grob *me = unsmob_grob (smob); | 164 Grob *me = unsmob_grob (smob); |
165 | 165 |
166 /* Beams with less than 2 two stems don't make much sense, but could happen | 166 /* Beams with less than 2 two stems don't make much sense, but could happen |
167 when you do | 167 when you do |
168 | 168 |
169 r8[ c8 r8] | 169 r8[ c8 r8] |
170 | 170 |
171 */ | 171 */ |
172 | 172 |
173 Direction dir = CENTER; | 173 Direction dir = CENTER; |
(...skipping 589 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
763 dir = to_dir (me->get_property ("neutral-direction")); | 763 dir = to_dir (me->get_property ("neutral-direction")); |
764 | 764 |
765 return dir; | 765 return dir; |
766 } | 766 } |
767 | 767 |
768 /* Set all stems with non-forced direction to beam direction. | 768 /* Set all stems with non-forced direction to beam direction. |
769 Urg: non-forced should become `without/with unforced' direction, | 769 Urg: non-forced should become `without/with unforced' direction, |
770 once stem gets cleaned-up. */ | 770 once stem gets cleaned-up. */ |
771 void | 771 void |
772 Beam::set_stem_directions (Grob *me, Direction d) | 772 Beam::set_stem_directions (Grob *me, Direction d) |
773 { | 773 {message ("SETTING"); |
774 extract_grob_set (me, "stems", stems); | 774 extract_grob_set (me, "stems", stems); |
775 | 775 |
776 for (vsize i = 0; i < stems.size (); i++) | 776 for (vsize i = 0; i < stems.size (); i++) |
777 { | 777 { |
778 Grob *s = stems[i]; | 778 Grob *s = stems[i]; |
779 | 779 |
780 SCM forcedir = s->get_property_data ("direction"); | 780 SCM forcedir = s->get_property_data ("direction"); |
781 if (!to_dir (forcedir)) | 781 if (!to_dir (forcedir)) |
782 set_grob_direction (s, d); | 782 set_grob_direction (s, d); |
783 } | 783 } |
(...skipping 728 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1512 | 1512 |
1513 /* trigger callbacks. */ | 1513 /* trigger callbacks. */ |
1514 (void) me->get_property ("direction"); | 1514 (void) me->get_property ("direction"); |
1515 (void) me->get_property ("beaming"); | 1515 (void) me->get_property ("beaming"); |
1516 | 1516 |
1517 SCM posns = me->get_property ("positions"); | 1517 SCM posns = me->get_property ("positions"); |
1518 | 1518 |
1519 extract_grob_set (me, "stems", stems); | 1519 extract_grob_set (me, "stems", stems); |
1520 if (!stems.size ()) | 1520 if (!stems.size ()) |
1521 return posns; | 1521 return posns; |
1522 | |
1523 // Trigger glissando stems. | |
1524 for (vsize i = 0; i < stems.size (); i++) | |
1525 (void) stems[i]->get_property ("glissando-stem"); | |
1526 | 1522 |
1527 Grob *common[2]; | 1523 Grob *common[2]; |
1528 for (int a = 2; a--;) | 1524 for (int a = 2; a--;) |
1529 common[a] = common_refpoint_of_array (stems, me, Axis (a)); | 1525 common[a] = common_refpoint_of_array (stems, me, Axis (a)); |
1530 | 1526 |
1531 Drul_array<Real> pos = ly_scm2realdrul (posns); | 1527 Drul_array<Real> pos = ly_scm2realdrul (posns); |
1532 Real staff_space = Staff_symbol_referencer::staff_space (me); | 1528 Real staff_space = Staff_symbol_referencer::staff_space (me); |
1533 scale_drul (&pos, staff_space); | 1529 scale_drul (&pos, staff_space); |
1534 | 1530 |
1535 bool gap = false; | 1531 bool gap = false; |
(...skipping 338 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1874 "knee " | 1870 "knee " |
1875 "length-fraction " | 1871 "length-fraction " |
1876 "least-squares-dy " | 1872 "least-squares-dy " |
1877 "neutral-direction " | 1873 "neutral-direction " |
1878 "normal-stems " | 1874 "normal-stems " |
1879 "positions " | 1875 "positions " |
1880 "quantized-positions " | 1876 "quantized-positions " |
1881 "shorten " | 1877 "shorten " |
1882 "stems " | 1878 "stems " |
1883 ); | 1879 ); |
LEFT | RIGHT |