2 abbrev.cc -- implement Abbreviation
4 source file of the GNU LilyPond music typesetter
6 (c) 1997--1999 Han-Wen Nienhuys <hanwen@cs.uu.nl>
13 #include "paper-def.hh"
18 Abbreviation::Abbreviation ()
25 Abbreviation::do_print () const
27 DOUT
<< "abbrev_flags_i_ " << abbrev_flags_i_
;
31 Abbreviation::do_brew_molecule_p () const
33 Beam
* b
= stem_l_
->beam_l_
;
37 Stem_info i
= b
->get_stem_info (stem_l_
);
41 Real interbeam_f
= paper_l ()->interbeam_f (mult
);
42 Real w
= 1.5 * lookup_l ()->notehead (2, "").dim_
[X_AXIS
].length ();
43 Real space
= stem_l_
->staff_line_leading_f ();
44 Real internote_f
= space
/2;
46 Real beam_f
= paper_l ()->beam_thickness_f ();
49 Real slope_f
= internote_f
/ 4 / internote_f
; // HUH?
51 if (stem_l_
&& stem_l_
->beam_l_
) {
52 slope_f
= stem_l_
->beam_l_
->slope_f_
;
53 // ugh, rather calc from Abbreviation_req
54 beams_i
= stem_l_
->beams_i_drul_
[RIGHT
] >? stem_l_
->beams_i_drul_
[LEFT
];
56 Real sl
= slope_f
* internote_f
;
58 Molecule
a (lookup_l ()->beam (sl
, w
, beam_f
));
59 a
.translate (Offset (-w
/2, w
/ 2 * slope_f
));
61 Molecule
*beams
= new Molecule
;
62 for (int i
= 0; i
< abbrev_flags_i_
; i
++)
65 b
.translate_axis (interbeam_f
* i
, Y_AXIS
);
66 beams
->add_molecule (b
);
68 beams
->translate_axis (-beams
->extent ()[Y_AXIS
].center (), Y_AXIS
);
74 beams
->translate (Offset(stem_l_
->hpos_f () - hpos_f (),
75 stem_l_
->stem_end_f () * internote_f
-
76 stem_l_
->beam_l_
->dir_
* beams_i
* interbeam_f
));
81 Beams should intersect one beamthickness below staff end
83 Real dy
= - beams
->extent ()[Y_AXIS
].length () / 2 * stem_l_
->dir_
;
85 dy
+= stem_l_
->stem_end_f ();
87 // urg: can't: stem should be stetched first
88 // dy -= paper_l ()->beam_thickness_f () * stem_l_->dir_;
89 beams
->translate (Offset(stem_l_
->hpos_f () - hpos_f (), dy
));
93 there used to be half a page of code that was long commented out.
102 Abbreviation::do_substitute_element_pointer (Score_element
*o
, Score_element
*n
)
105 stem_l_
= dynamic_cast<Stem
*> (n
);
110 Abbreviation::set_stem (Stem
*s
)