source file of the GNU LilyPond music typesetter
- (c) 1997--1998 Han-Wen Nienhuys <hanwen@cs.uu.nl>
+ (c) 1997--1999 Han-Wen Nienhuys <hanwen@cs.uu.nl>
*/
#include "misc.hh"
Interval
Note_head::do_width () const
{
- Atom a = lookup_l ()->ball (balltype_i_);
+ Molecule a = lookup_l ()->ball (balltype_i_);
Interval i = a.dim_[X_AXIS];
i+= x_dir_ * i.length ();
return i;
? 0
: (abs(position_i_) - staff_size_i_/2) /2;
- Atom s = lookup_l()->ball (balltype_i_);
- out = new Molecule (Atom (s));
- out->translate_axis (x_dir_ * s.dim_[X_AXIS].length (), X_AXIS);
+ Molecule head;
+
+ if (note_head_type_str_.length_i ()) {
+ if (note_head_type_str_ == "normal") // UGH
+ note_head_type_str_ = "";
+ head = lookup_l()->special_ball (balltype_i_, note_head_type_str_);
+ }
+ else
+ head = lookup_l()->ball (balltype_i_);
+
+ out = new Molecule (Molecule (head));
+ out->translate_axis (x_dir_ * head.dim_[X_AXIS].length (), X_AXIS);
+
+
if (streepjes_i)
{
- int dir = sign (position_i_);
- Atom streepje = lookup_l ()->streepje (balltype_i_);
+ Direction dir = sign (position_i_);
+ Interval hd = head.dim_[X_AXIS];
+ Real hw = hd.length ()/4;
+
+ Molecule ledger
+ = lookup_l ()->ledger_line (Interval (hd[LEFT] - hw,
+ hd[RIGHT] + hw));
- int parity = (position_i_ % 2) ? 1 : 0;
-
+ int parity = abs(position_i_) % 2;
for (int i=0; i < streepjes_i; i++)
{
- Atom s = streepje;
+ Molecule s (ledger);
s.translate_axis (-dir * inter_f * (i*2 + parity),
Y_AXIS);
- out->add_atom (s);
+ out->add_molecule (s);
}
}