#include "staff-symbol-referencer.hh"
#include "cross-staff.hh"
-Beam::Beam ()
+Beam::Beam (SCM s)
+ : Spanner (s)
{
- Group_interface g (this, "stems");
+ Pointer_group_interface g (this, "stems");
g.set_interface ();
set_elt_property ("height", gh_int2scm (0)); // ugh.
void
Beam::add_stem (Stem*s)
{
- Group_interface gi (this, "stems");
+ Pointer_group_interface gi (this, "stems");
gi.add_element (s);
s->add_dependency (this);
assert (!s->beam_l ());
- s->set_elt_property ("beam", self_scm_);
+ s->set_elt_pointer ("beam", self_scm_);
if (!get_bound (LEFT))
set_bound (LEFT,s);
Beam::get_multiplicity () const
{
int m = 0;
- for (SCM s = get_elt_property ("stems"); gh_pair_p (s); s = gh_cdr (s))
+ for (SCM s = get_elt_pointer ("stems"); gh_pair_p (s); s = gh_cdr (s))
{
Score_element * sc = unsmob_element (gh_car (s));
if (visible_stem_count () < 2)
{
warning (_ ("beam has less than two stems"));
- // set_elt_property ("transparent", SCM_BOOL_T);
+
}
if (!directional_element (this).get ())
Beam::calc_stem_y_f (Stem* s, Real y, Real dy) const
{
Real thick = gh_scm2double (get_elt_property ("beam-thickness"));
+ thick *= paper_l ()->get_var ("staffspace");
+
int beam_multiplicity = get_multiplicity ();
int stem_multiplicity = (s->flag_i () - 2) >? 0;
programming_error ("Beams are not left-to-right");
Real staffline_f = paper_l ()->get_var ("stafflinethickness");
- int multiplicity = get_multiplicity ();
+ int multiplicity = get_multiplicity ();
Real interbeam_f = paper_l ()->interbeam_f (multiplicity);
Real thick = gh_scm2double (get_elt_property ("beam-thickness"));
-
+ thick *= paper_l ()->get_var ("staffspace");
+
Real bdy = interbeam_f;
Real stemdx = staffline_f;
return leftbeams;
}
+MAKE_SCHEME_SCORE_ELEMENT_CALLBACKS (Beam);
Molecule
Beam::do_brew_molecule () const
Stem *
Beam::stem (int i) const
{
- return Group_interface__extract_elements ((Beam*) this, (Stem*) 0, "stems")[i];
+ return Pointer_group_interface__extract_elements ((Beam*) this, (Stem*) 0, "stems")[i];
}
int
Beam::stem_count () const
{
- Group_interface gi (this, "stems");
+ Pointer_group_interface gi (this, "stems");
return gi.count ();
}
Stem*
Beam::stem_top () const
{
- SCM s = get_elt_property ("stems");
+ SCM s = get_elt_pointer ("stems");
return gh_pair_p (s) ? dynamic_cast<Stem*> (unsmob_element (gh_car (s))) : 0;
}