#include "p-col.hh"
#include "array.hh"
#include "proto.hh"
-#include "dimension.hh"
+#include "dimensions.hh"
#include "beam.hh"
#include "abbreviation-beam.hh"
#include "misc.hh"
#include "stem-info.hh"
-IMPLEMENT_IS_TYPE_B1 (Beam, Spanner);
+
Beam::Beam ()
{
void
Beam::do_substitute_dependent (Score_element*o,Score_element*n)
{
- if (o->is_type_b (Stem::static_name ()))
- stems_.substitute ((Stem*)o->access_Item (), n? (Stem*) n->access_Item ():0);
+ if (Stem * os = dynamic_cast<Stem*> (o))
+ stems_.substitute (os,
+ dynamic_cast<Stem *> (n));
}
Interval
for (int j=0, i=0; i < b.size () && j <stems_.size (); i+= 2, j++)
{
Stem *s = stems_[j];
- s->beams_left_i_ = b[i];
- s->beams_right_i_ = b[i+1];
+ s->beams_i_drul_[LEFT] = b[i];
+ s->beams_i_drul_[RIGHT] = b[i+1];
multiple_i_ = multiple_i_ >? (b[i] >? b[i+1]);
}
}
Molecule leftbeams;
Molecule rightbeams;
+ // UGH
+ Real nw_f = paper ()->note_width () * 0.8;
+
/* half beams extending to the left. */
if (prev)
{
- int lhalfs= lhalfs = here->beams_left_i_ - prev->beams_right_i_ ;
- int lwholebeams= here->beams_left_i_ <? prev->beams_right_i_ ;
+ int lhalfs= lhalfs = here->beams_i_drul_[LEFT] - prev->beams_i_drul_[RIGHT] ;
+ int lwholebeams= here->beams_i_drul_[LEFT] <? prev->beams_i_drul_[RIGHT] ;
/*
Half beam should be one note-width,
but let's make sure two half-beams never touch
*/
Real w = here->hpos_f () - prev->hpos_f ();
- w = w/2 <? paper ()->note_width ();
+ w = w/2 <? nw_f;
Atom a;
if (lhalfs) // generates warnings if not
a = lookup_l ()->beam (sl, w, beam_f);
if (next)
{
- int rhalfs = here->beams_right_i_ - next->beams_left_i_;
- int rwholebeams = here->beams_right_i_ <? next->beams_left_i_;
+ int rhalfs = here->beams_i_drul_[RIGHT] - next->beams_i_drul_[LEFT];
+ int rwholebeams = here->beams_i_drul_[RIGHT] <? next->beams_i_drul_[LEFT];
Real w = next->hpos_f () - here->hpos_f ();
Atom a = lookup_l ()->beam (sl, w + stemdx, beam_f);
rightbeams.add_atom (b);
}
// TODO: notehead widths differ for different types
- gap_f = paper ()->note_width () / 2;
+ gap_f = nw_f / 2;
w -= 2 * gap_f;
a = lookup_l ()->beam (sl, w + stemdx, beam_f);
}
rightbeams.add_atom (b);
}
- w = w/2 <? paper ()->note_width ();
+ w = w/2 <? nw_f;
if (rhalfs)
a = lookup_l ()->beam (sl, w, beam_f);