int lookup (K s, unsigned int initial_hash)
{
int sz =dict_arr_.size ();
- int i = initial_hash % sz;
+ initial_hash = initial_hash % sz;
+ int i;
int j = 0;
while (j <= sz/2) {
+ i = (initial_hash + j*j) % sz;
+
if (dict_arr_[i].free_b_)
return i;
return i;
j++;
- i = (i + j*j) % sz;
}
#include "dimension-cache.hh"
void
-Align_element::do_post_processing()
+Align_element::after_line_breaking()
{
if (axis () == Y_AXIS)
do_side_processing ();
}
void
-Align_element::do_pre_processing ()
+Align_element::before_line_breaking ()
{
if (axis () == X_AXIS)
do_side_processing ();
}
void
-Auto_beam_engraver::do_process_requests ()
+Auto_beam_engraver::do_process_music ()
{
consider_end_and_begin (shortest_mom_);
}
#if 0
/*
urg. Why did I implement this? And did I implement this so
- clumsily? */
+ clumsily?
+
+ input/test/just-friends.ly
+ Maybe a staffgroup of just one staff would be a better solution.
+ */
SCM prop = get_property ("barAtLineStart");
if (to_boolean (prop))
{
}
void
-Bar_engraver::do_process_requests()
+Bar_engraver::do_process_music()
{
Translator * t = daddy_grav_l ()->get_simple_translator ("Timing_engraver");
void
-Bar_number_engraver::do_process_requests ()
+Bar_number_engraver::do_process_music ()
{
Translator *tr = daddy_grav_l ()->get_simple_translator ("Timing_engraver");
Timing_translator *time = dynamic_cast<Timing_translator*>(tr);
(c) 1997--2000 Han-Wen Nienhuys <hanwen@cs.uu.nl>
*/
+#include <math.h>
+#include "main.hh"
+#include "dimensions.hh"
#include "dimension-cache.hh"
#include "bar.hh"
#include "string.hh"
#include "paper-def.hh"
#include "lookup.hh"
#include "debug.hh"
-
+#include "all-font-metrics.hh"
Bar::Bar ()
{
Molecule
Bar::do_brew_molecule () const
{
- String s = ly_scm2string (get_elt_property ("glyph"));
- return lookup_l ()->bar (s, get_bar_size (), paper_l ());
+ SCM s = get_elt_property ("glyph");
+ if (gh_string_p (s))
+ {
+ String str =ly_scm2string (s);
+ if (str == "bracket")
+ return staff_bracket (get_bar_size ());
+ else if (str == "brace")
+ return staff_brace (get_bar_size ());
+ else
+ return compound_barline (str, get_bar_size ());
+ }
+ return Molecule ();
+}
+
+
+Molecule
+Bar::staff_bracket (Real height) const
+{
+ Paper_def* p= paper_l ();
+ SCM at = gh_list (ly_symbol2scm ("bracket"),
+ gh_double2scm (p->get_var("bracket_arch_angle")),
+ gh_double2scm (p->get_var("bracket_arch_width")),
+ gh_double2scm (p->get_var("bracket_arch_height")),
+ gh_double2scm (p->get_var("bracket_width")),
+ gh_double2scm (height),
+ gh_double2scm (p->get_var("bracket_arch_thick")),
+ gh_double2scm (p->get_var("bracket_thick")),
+ SCM_UNDEFINED);
+
+ Real staff_space = p->get_var ("interline");
+ Box b (Interval (0, 1.5 * staff_space), Interval (-height/2,height/2));
+ Molecule mol (b, at);
+
+ mol.translate_axis (- mol.dim_[X_AXIS].length () / 2, X_AXIS);
+ return mol;
}
+Molecule
+Bar::compound_barline (String str, Real h) const
+{
+ Real kern = paper_l()->get_var ("bar_kern");
+ Real thinkern = paper_l()->get_var ("bar_thinkern");
+
+ Molecule thin = simple_barline (paper_l()->get_var ("barthick_thin"), h);
+ Molecule thick = simple_barline (paper_l()->get_var ("barthick_thick"), h);
+ Molecule colon = lookup_l ()->afm_find ("dots-repeatcolon");
+
+ Molecule m;
+
+ if (str == "")
+ {
+ return lookup_l ()->blank (Box (Interval(0, 0), Interval (-h/2, h/2)));
+ }
+ if (str == "scorepostbreak")
+ {
+ return simple_barline (paper_l ()->get_var ("barthick_score"), h);
+ }
+ else if (str == "|")
+ {
+ return thin;
+ }
+ else if (str == "|.")
+ {
+ m.add_at_edge (X_AXIS, LEFT, thick, 0);
+ m.add_at_edge (X_AXIS, LEFT, thin, kern);
+ }
+ else if (str == ".|")
+ {
+ m.add_at_edge (X_AXIS, RIGHT, thick, 0);
+ m.add_at_edge (X_AXIS, RIGHT, thin, kern);
+ }
+ else if (str == ":|")
+ {
+ m.add_at_edge (X_AXIS, LEFT, thick, 0);
+ m.add_at_edge (X_AXIS, LEFT, thin, kern);
+ m.add_at_edge (X_AXIS, LEFT, colon, kern);
+ }
+ else if (str == "|:")
+ {
+ m.add_at_edge (X_AXIS, RIGHT, thick, 0);
+ m.add_at_edge (X_AXIS, RIGHT, thin, kern);
+ m.add_at_edge (X_AXIS, RIGHT, colon, kern);
+ }
+ else if (str == ":|:")
+ {
+ m.add_at_edge (X_AXIS, LEFT, thick, thinkern);
+ m.add_at_edge (X_AXIS, LEFT, colon, kern);
+ m.add_at_edge (X_AXIS, RIGHT, thick, kern);
+ m.add_at_edge (X_AXIS, RIGHT, colon, kern);
+ }
+ else if (str == ".|.")
+ {
+ m.add_at_edge (X_AXIS, LEFT, thick, thinkern);
+ m.add_at_edge (X_AXIS, RIGHT, thick, kern);
+ }
+ else if (str == "||")
+ {
+ m.add_at_edge (X_AXIS, RIGHT, thin, 0);
+ m.add_at_edge (X_AXIS, RIGHT, thin, thinkern);
+ }
+
+ return m;
+}
+
+/*
+ ugh. Suck me plenty.
+ */
+Molecule
+Bar::staff_brace (Real y) const
+{
+ Real staffht = paper_l ()->get_var ("staffheight");
+ int staff_size = int (rint (staffht ));
+
+ // URG
+ Real step = 1.0;
+ int minht = 2 * staff_size;
+ int maxht = 7 * minht;
+ int idx = int (((maxht - step) <? y - minht) / step);
+ idx = idx >? 0;
+
+ SCM l = ly_eval_str ("(style-to-cmr \"brace\")");
+ String nm = "feta-braces";
+ if (l != SCM_BOOL_F)
+ nm = ly_scm2string (gh_cdr (l));
+ nm += to_str (staff_size);
+ SCM e =gh_list (ly_symbol2scm ("char"), gh_int2scm (idx), SCM_UNDEFINED);
+ SCM at = (e);
+
+ at = fontify_atom (all_fonts_global_p->find_font (nm), at);
+
+ Box b ( Interval (-y/2,y/2),
+ Interval (0,0));
+ return Molecule(b, at);
+}
+
+
+Molecule
+Bar::simple_barline (Real w, Real h) const
+{
+ return lookup_l ()->filledbox (Box (Interval(0,w), Interval(-h/2, h/2)));
+}
void
-Bar::do_pre_processing ()
+Bar::before_line_breaking ()
{
SCM g = get_elt_property ("glyph");
Direction bsd = break_status_dir ();
if (d == STOP && !beam_p_)
{
- m->warning (_ ("no beam to end"));
+ m->warning (_ ("can't find start of beam"));
return false;
}
reqs_drul_[d ] = c;
void
-Beam_engraver::do_process_requests ()
+Beam_engraver::do_process_music ()
{
if (reqs_drul_[STOP])
{
if (!beam_p_)
- reqs_drul_[STOP]->warning (_("no beam to end"));
+ reqs_drul_[STOP]->warning (_("can't find start of beam"));
prev_start_req_ =0;
finished_beam_p_ = beam_p_;
finished_beam_info_p_ = beam_info_p_;
{
if (beam_p_)
{
- reqs_drul_[START]->warning (_ ("Already have a beam"));
+ reqs_drul_[START]->warning (_ ("already have a beam"));
return;
}
typeset_beam ();
if (beam_p_)
{
- prev_start_req_->warning (_ ("unfinished beam"));
+ prev_start_req_->warning (_ ("unterminated beam"));
finished_beam_p_ = beam_p_;
finished_beam_info_p_ = beam_info_p_;
typeset_beam ();
Rhythmic_req *rhythmic_req = dynamic_cast <Rhythmic_req *> (info.req_l_);
if (!rhythmic_req)
{
- String s = _ ("Stem must have Rhythmic structure");
+ String s = _ ("stem must have Rhythmic structure");
if (info.req_l_)
info.req_l_->warning (s);
else
if (rhythmic_req->duration_.durlog_i_<= 2)
{
- rhythmic_req->warning (_ ("Stem doesn't fit in beam"));
- prev_start_req_->warning (_ ("Beam was started here"));
+ rhythmic_req->warning (_ ("stem doesn't fit in beam"));
+ prev_start_req_->warning (_ ("beam was started here"));
/*
don't return, since
assert (!s->beam_l ());
s->set_elt_property ("beam", self_scm_);
- if (!spanned_drul_[LEFT])
- set_bounds (LEFT,s);
+ if (!get_bound (LEFT))
+ set_bound (LEFT,s);
else
- set_bounds (RIGHT,s);
+ set_bound (RIGHT,s);
}
int
their beam, during 'final-pre-processing'.]
*/
void
-Beam::do_pre_processing ()
+Beam::before_line_breaking ()
{
// Why?
if (visible_stem_count () < 2)
Adjust stem lengths to reach beam.
*/
void
-Beam::do_post_processing ()
+Beam::after_line_breaking ()
{
/* first, calculate y, dy */
Real y, dy;
mol.add_molecule (sb);
}
mol.translate_axis (x0
- - spanned_drul_[LEFT]->relative_coordinate (0, X_AXIS), X_AXIS);
+ - get_bound (LEFT)->relative_coordinate (0, X_AXIS), X_AXIS);
return mol;
}
*/
void
-Break_align_item::do_pre_processing()
+Break_align_item::before_line_breaking ()
{
Direction ad = (break_status_dir() == LEFT) ? RIGHT : LEFT;
Real interline= paper_l ()->get_var ("interline");
scm_set_car_x (first_pair, gh_double2scm (-dists[0]));
elems[0]->set_elt_property ("minimum-space", first_pair);
- Axis_align_item::do_pre_processing();
+ Axis_align_item::before_line_breaking ();
Real pre_space = elems[0]->relative_coordinate (column_l (), X_AXIS);
}
void
-Breathing_sign_engraver::do_process_requests()
+Breathing_sign_engraver::do_process_music()
{
if(breathing_sign_req_l_)
{
}
void
-Breathing_sign::do_post_processing()
+Breathing_sign::after_line_breaking ()
{
Real space = staff_symbol_referencer (this).staff_space();
Direction d = directional_element (this). get ();
}
void
-Chord_name_engraver::do_process_requests ()
+Chord_name_engraver::do_process_music ()
{
if (chord_name_p_)
return;
*/
#include "timing-translator.hh"
-#include "chord-tremolo-engraver.hh"
#include "stem.hh"
#include "beam.hh"
#include "musical-request.hh"
#include "misc.hh"
#include "warn.hh"
#include "score-engraver.hh"
+#include "engraver.hh"
+#include "drul-array.hh"
+#include "timing-engraver.hh"
+#include "beaming.hh"
+
+/**
+ Generate a beam tremolo. Eat stems.
+
+ UGH. Derive me from Beam_engraver.
+
+ */
+class Chord_tremolo_engraver : public Engraver
+{
+public:
+ VIRTUAL_COPY_CONS(Translator);
+
+
+ Chord_tremolo_engraver();
+
+protected:
+ virtual void do_removal_processing();
+ virtual void do_process_music();
+ virtual bool do_try_music (Music*);
+ virtual void acknowledge_element (Score_element_info);
+ virtual void do_pre_move_processing();
+ virtual void do_post_move_processing();
+
+private:
+ void typeset_beam ();
+ Drul_array<Chord_tremolo_req*> reqs_drul_;
+ Chord_tremolo_req* prev_start_req_;
+ Beam* beam_p_;
+ Beam* finished_beam_p_;
+
+ /// location within measure where beam started.
+ Moment beam_start_location_;
+
+ /// moment (global time) where beam started.
+ Moment beam_start_mom_;
+ Beaming_info_list * beam_info_p_;
+ Beaming_info_list * finished_beam_info_p_;
+};
ADD_THIS_TRANSLATOR (Chord_tremolo_engraver);
Chord_tremolo_engraver::Chord_tremolo_engraver ()
{
reqs_drul_[LEFT] = reqs_drul_[RIGHT] = 0;
- abeam_p_ = 0;
- finished_abeam_p_ = 0;
+ beam_p_ = 0;
+ finished_beam_p_ = 0;
prev_start_req_ = 0;
+ finished_beam_info_p_=0;
+ beam_info_p_ =0;
}
bool
if (reqs_drul_[d] && !reqs_drul_[d]->equal_b (b))
return false;
- if ((d == STOP) && !abeam_p_)
+ if ((d == STOP) && !beam_p_)
{
- m->warning (_ ("no tremolo beam to end"));
+ m->warning (_ ("can't find start of chord tremolo"));
return false;
}
}
void
-Chord_tremolo_engraver::do_process_requests ()
+Chord_tremolo_engraver::do_process_music ()
{
if (reqs_drul_[STOP])
{
- if (!abeam_p_)
- reqs_drul_[STOP]->warning (_ ("no tremolo beam to end"));
+ if (!beam_p_)
+ reqs_drul_[STOP]->warning (_ ("can't find start of chord tremolo"));
+
prev_start_req_ = 0;
- finished_abeam_p_ = abeam_p_;
- abeam_p_ = 0;
+
+ finished_beam_p_ = beam_p_;
+ beam_p_ = 0;
+
+ finished_beam_info_p_ = beam_info_p_;
+ beam_info_p_ = 0;
}
- if (abeam_p_)
+ if (beam_p_)
{
Score_engraver * e = 0;
Translator * t = daddy_grav_l ();
if (reqs_drul_[START])
{
- if (abeam_p_)
+ if (beam_p_)
{
- reqs_drul_[START]->warning (_ ("Already have a tremolo beam"));
+ reqs_drul_[START]->warning (_ ("already have a chord tremolo"));
return;
}
prev_start_req_ = reqs_drul_[START];
- abeam_p_ = new Beam;
- abeam_p_->set_elt_property ("chord-tremolo", SCM_BOOL_T);
+ beam_p_ = new Beam;
+ beam_p_->set_elt_property ("chord-tremolo", SCM_BOOL_T);
+ Translator * t = daddy_grav_l ()->get_simple_translator ("Timing_engraver");
+ Timing_engraver *timer = dynamic_cast<Timing_engraver*> (t);
+ beam_start_location_ = (t) ? timer->measure_position () : Moment (0);
+ beam_start_mom_ = now_mom();
+ beam_info_p_ = new Beaming_info_list;
- announce_element (Score_element_info (abeam_p_, reqs_drul_[LEFT]));
+ announce_element (Score_element_info (beam_p_, reqs_drul_[LEFT]));
}
}
reqs_drul_ [START] = 0;
}
+
void
Chord_tremolo_engraver::do_pre_move_processing ()
{
void
Chord_tremolo_engraver::typeset_beam ()
{
- if (finished_abeam_p_)
+ if (finished_beam_p_)
{
- typeset_element (finished_abeam_p_);
- finished_abeam_p_ = 0;
+ finished_beam_info_p_->beamify ();
+ finished_beam_p_->set_beaming (finished_beam_info_p_);
+ typeset_element (finished_beam_p_);
+ finished_beam_p_ = 0;
+ delete finished_beam_info_p_;
+ finished_beam_info_p_ =0;
reqs_drul_[STOP] = 0;
}
Chord_tremolo_engraver::do_removal_processing ()
{
typeset_beam ();
- if (abeam_p_)
+ if (beam_p_)
{
- prev_start_req_->warning (_ ("unfinished tremolo beam"));
- finished_abeam_p_ = abeam_p_;
+ prev_start_req_->warning (_ ("unterminated chord tremolo"));
+ finished_beam_p_ = beam_p_;
+ finished_beam_info_p_ = beam_info_p_;
typeset_beam ();
}
}
void
-Chord_tremolo_engraver::acknowledge_element (Score_element_info i)
+Chord_tremolo_engraver::acknowledge_element (Score_element_info info)
{
- if (abeam_p_)
+ if (beam_p_)
{
- if (Stem* s = dynamic_cast<Stem *> (i.elem_l_))
+ if (Stem* s = dynamic_cast<Stem *> (info.elem_l_))
{
int type_i = prev_start_req_->type_i_;
s->set_elt_property ("duration-log", gh_int2scm (intlog2 (type_i) - 2));
s->set_beaming (s->flag_i (), LEFT);
s->set_beaming ( s->flag_i (), RIGHT);
-
-#if 0
+ /*
+ URG: this sets the direction of the Stem s.
+ It's amazing Mike:
+
+ Stem:: type_i () ->first_head ()->get_direction () ->
+ directional_element (me).set (d);
+
+ */
+ SCM d = s->get_elt_property ("direction");
if (s->type_i () != 1)
{
int gap_i =s->flag_i () - ((s->type_i () >? 2) - 2);
- s->set_elt_property ("beam-gap", gh_int2scm(gap_i));
+ beam_p_->set_elt_property ("beam-gap", gh_int2scm(gap_i));
}
-#else
- if (s->type_i () != 1)
+ s->set_elt_property ("direction", d);
+
+ if (Rhythmic_req* r = dynamic_cast <Rhythmic_req *> (info.req_l_))
{
- int gap_i =s->flag_i () - ((s->type_i () >? 2) - 2);
- abeam_p_->set_elt_property ("beam-gap", gh_int2scm(gap_i));
+ beam_p_->add_stem (s);
+ Moment stem_location = now_mom () -
+ beam_start_mom_ + beam_start_location_;
+ beam_info_p_->add_stem (stem_location,
+ (r->duration_.durlog_i_ - 2) >? 1);
+ }
+ else
+ {
+ String s = _ ("stem must have Rhythmic structure");
+ if (info.req_l_)
+ info.req_l_->warning (s);
+ else
+ ::warning (s);
}
-#endif
-
- abeam_p_->add_stem (s);
}
}
}
void create_clef();
bool set_type (String);
protected:
- virtual void do_process_requests();
+ virtual void do_process_music();
virtual void do_pre_move_processing();
virtual void do_creation_processing();
virtual void do_post_move_processing();
void
-Clef_engraver::do_process_requests()
+Clef_engraver::do_process_music()
{
if (clef_req_l_)
{
#include "warn.hh"
void
-Clef_item::do_pre_processing()
+Clef_item::before_line_breaking ()
{
SCM style_sym =get_elt_property ("style");
String style;
*/
void
-Collision::do_pre_processing()
+Collision::before_line_breaking ()
{
Array<Shift_tup> autos (automatic_shift ());
Array<Shift_tup> hand (forced_shift ());
Should be smarter.
*/
void
-Dot_column::do_post_processing ()
+Dot_column::after_line_breaking ()
{
Link_array<Dots> dots = Group_interface__extract_elements (this, (Dots*)0 , "dots");
dots.sort (Dot_column::compare);
}
void
-Dots::do_post_processing ()
+Dots::after_line_breaking ()
{
SCM d= get_elt_property ("dot-count");
if (!gh_number_p (d) || !gh_scm2int (d))
Molecule
Dots::do_brew_molecule () const
{
- Molecule mol (lookup_l ()->fill (Box (Interval (0,0),
+ Molecule mol (lookup_l ()->blank (Box (Interval (0,0),
Interval (0,0))));
Molecule d = lookup_l ()->afm_find (String ("dots-dot"));
#include "staff-symbol-referencer.hh"
#include "translator-group.hh"
-/*
- Wat mij betreft wel DYN_LINE
- */
-#define DYN_LINE
-
-
-#ifdef DYN_LINE
class Dynamic_line_spanner : public Spanner
{
public:
Dynamic_line_spanner ();
-
- void add_column (Note_column*);
+ VIRTUAL_COPY_CONS(Score_element);
+ void add_column (Item*);
Direction get_default_dir () const;
-protected:
- virtual void do_post_processing ();
};
Dynamic_line_spanner::Dynamic_line_spanner ()
}
void
-Dynamic_line_spanner::add_column (Note_column* n)
+Dynamic_line_spanner::add_column (Item* n)
{
- if (!spanned_drul_[LEFT])
- set_bounds (LEFT, n);
- set_bounds (RIGHT, n);
+ if (!get_bound (LEFT))
+ set_bound (LEFT, n);
+ else
+ set_bound (RIGHT, n);
add_dependency (n);
}
return DOWN;
}
-void
-Dynamic_line_spanner::do_post_processing ()
-{
- Spanner::do_post_processing ();
- Direction dir = directional_element (this).get ();
- if (!dir)
- dir = get_default_dir ();
-
- /*
- Hier is ook vast iets voor?
- */
- Staff_symbol_referencer_interface si (this);
- Real above_staff = si.line_count () + 2;
-
-#if 0
- // Aargh, nu snap ik waarom ik het niet snap
- // zie Staff_symbol_referencer_interface::set_position
-
- if (si.position_f () * dir < above_staff)
- si.set_position (above_staff * (int)dir);
-
- SCM s = get_elt_property ("padding");
- if (gh_number_p (s))
- {
- si.set_position (si.position_f () + gh_scm2double (s) * (int) dir);
- }
-#else
- Real dy = 0;
- Real pos = si.position_f () * dir;
- if (pos * dir < above_staff)
- dy = above_staff;
-
- SCM s = get_elt_property ("padding");
- if (gh_number_p (s))
- dy += gh_scm2double (s);
-
- Real half_space = si.staff_space () / 2;
- translate_axis (dy*half_space*dir, Y_AXIS);
-#endif
-
-}
-
-#endif
-/*
- TODO:
- Baseline alignment / character metrics of dynamic symbols.
- */
-
/**
print text & hairpin dynamics.
*/
Span_req * span_start_req_l_;
Drul_array<Span_req*> span_req_l_drul_;
-#ifdef DYN_LINE
Dynamic_line_spanner* line_spanner_;
-#else
- Spanner* line_spanner_;
-#endif
Moment last_request_mom_;
void typeset_all ();
virtual void do_removal_processing ();
virtual void acknowledge_element (Score_element_info);
virtual bool do_try_music (Music *req_l);
- virtual void do_process_requests ();
+ virtual void do_process_music ();
virtual void do_pre_move_processing ();
virtual void do_post_move_processing ();
};
text_req_l_ = 0;
span_req_l_drul_[START] = 0;
span_req_l_drul_[STOP] = 0;
+
+ /* ugr; we must attach the Dynamic_line_spanner to something
+ to be sure that the linebreaker will not be confused
+ */
+ // if (line_spanner_)
+ // line_spanner_->add_column (LEFT, get_staff_info ().command_pcol_l ());
}
bool
}
void
-Dynamic_engraver::do_process_requests ()
+Dynamic_engraver::do_process_music ()
{
if ((span_req_l_drul_[START] || text_req_l_) && !line_spanner_)
{
-#ifdef DYN_LINE
line_spanner_ = new Dynamic_line_spanner;
-#else
- line_spanner_ = new Spanner;
- line_spanner_->set_elt_property ("transparent", SCM_BOOL_T);
side_position (line_spanner_).set_axis (Y_AXIS);
-#endif
announce_element (Score_element_info
(line_spanner_,
text_req_l_ ? text_req_l_ : span_req_l_drul_[START]));
if (span_req_l_drul_[START] || text_req_l_)
last_request_mom_ = now_mom ();
-#ifndef DYN_LINE
- if (line_spanner_)
- {
- /*
- Generic property will handle this for a Dynamic_line_spanner
- */
- Direction dir = DOWN;
- SCM s = get_property ("dynamicDirection");
- if (!isdir_b (s))
- {
- s = get_property ("verticalDirection");
- }
-
- if (isdir_b (s) && to_dir (s))
- dir = to_dir (s);
-
- line_spanner_->set_elt_property ("direction", gh_int2scm ((int)dir));
-
- s = get_property ("dynamicPadding");
- Real padding;
- if (gh_number_p (s))
- padding = gh_scm2double (s);
- else
- padding = 2;
- line_spanner_->set_elt_property ("padding", gh_double2scm (padding));
- }
-#endif
-
if (text_req_l_)
{
String loud = text_req_l_->text_str_;
else
{
assert (!finished_cresc_p_);
- cresc_p_->set_bounds(RIGHT, get_staff_info ().musical_pcol_l ());
+ cresc_p_->set_bound(RIGHT, get_staff_info ().musical_pcol_l ());
+ // cresc_p_->add_dependency (get_staff_info ().musical_pcol_l ());
finished_cresc_p_ = cresc_p_;
cresc_p_ = 0;
span_start_req_l_ = 0;
+ "Spanner", SCM_UNDEFINED);
}
- cresc_p_->set_bounds(LEFT, get_staff_info ().musical_pcol_l ());
- cresc_p_->set_bounds(RIGHT, get_staff_info ().musical_pcol_l ());
+ cresc_p_->set_bound(LEFT, get_staff_info ().musical_pcol_l ());
+
+
+ // cresc_p_->add_dependency (get_staff_info ().musical_pcol_l ());
+
+ /*
+ We know how wide the text is, if we can be sure that the
+ text already has relevant pointers into the paperdef,
+ and it has its font-size property set.
- // arrragh, brr, urg: we know how wide text is, no?
+ Since font-size may be set by a context higher up, we
+ can not be sure of the size.
+ */
+
+
if (text_p_)
{
index_set_cell (cresc_p_->get_elt_property ("dynamic-drul"),
assert (line_spanner_);
cresc_p_->set_parent (line_spanner_, Y_AXIS);
+ // cresc_p_->add_dependency (line_spanner_);
announce_element (Score_element_info (cresc_p_, span_req_l_drul_[START]));
}
}
typeset_all ();
}
+
void
Dynamic_engraver::do_removal_processing ()
{
typeset_all ();
if (line_spanner_)
{
-#ifndef DYN_LINE
- Direction dir = directional_element (line_spanner_).get ();
- Real staff_space = Staff_symbol_referencer_interface (line_spanner_).staff_space ();
- SCM s = line_spanner_->get_elt_property ("padding");
- line_spanner_->translate_axis (gh_scm2double (s) * staff_space * (int)dir, Y_AXIS);
-#endif
typeset_element (line_spanner_);
line_spanner_ = 0;
}
{
if (finished_cresc_p_)
{
- finished_cresc_p_->set_bounds (RIGHT, get_staff_info ().musical_pcol_l ());
typeset_element (finished_cresc_p_);
finished_cresc_p_ =0;
}
TODO: This should be optionised:
* break when group of dynamic requests ends
* break now
- * continue through piece
- */
+ * continue through piece */
if (line_spanner_ && last_request_mom_ < now_mom ())
{
-#ifndef DYN_LINE
- Direction dir = directional_element (line_spanner_).get ();
- Real staff_space = Staff_symbol_referencer_interface (line_spanner_).staff_space ();
- SCM s = line_spanner_->get_elt_property ("padding");
- line_spanner_->translate_axis (gh_scm2double (s) * staff_space * (int)dir, Y_AXIS);
-#endif
+
+ side_position (line_spanner_).add_staff_support ();
+
typeset_element (line_spanner_);
line_spanner_ = 0;
}
if (Note_column* n = dynamic_cast<Note_column*> (i.elem_l_))
{
side_position (line_spanner_).add_support (n);
-#ifdef DYN_LINE
line_spanner_->add_column (n);
-#else
- if (!line_spanner_->spanned_drul_[LEFT])
- line_spanner_->set_bounds (LEFT, n);
- line_spanner_->set_bounds (RIGHT, n);
-
- line_spanner_->add_dependency (n);
-#endif
}
}
}
{
current_lyric_l_ = t;
if (extender_spanner_p_
- && !extender_spanner_p_->spanned_drul_[RIGHT]
+ && !extender_spanner_p_->get_bound (RIGHT)
)
{
extender_spanner_p_->set_textitem (RIGHT, t);
if (extender_spanner_p_)
{
req_l_->warning (_ ("unterminated extender"));
- extender_spanner_p_->set_bounds(RIGHT, get_staff_info ().command_pcol_l ());
+ extender_spanner_p_->set_bound(RIGHT, get_staff_info ().command_pcol_l ());
}
}
void
-Extender_engraver::do_process_requests ()
+Extender_engraver::do_process_music ()
{
if (req_l_)
{
void
-Extender_spanner::do_post_processing ()
+Extender_spanner::after_line_breaking ()
{
// UGH
Real gap = paper_l ()->get_var ("interline");
Direction d = LEFT;
do
{
- Item* t = spanned_drul_[d]
- ? spanned_drul_[d] : spanned_drul_[(Direction)-d];
+ Item* t = get_bound (d)
+ ? get_bound (d) : get_bound ((Direction)-d);
if (d == LEFT)
dx_f_drul_[d] += t->extent (X_AXIS).length ();
else
void
Extender_spanner::set_textitem (Direction d, Item* textitem_l)
{
- set_bounds (d, textitem_l);
+ set_bound (d, textitem_l);
add_dependency (textitem_l);
}
}
void
-Grace_align_item::do_pre_processing ()
+Grace_align_item::before_line_breaking ()
{
Real nhw = // lookup_l ()->notehead (2, "").dim_[X_AXIS].length();
paper_l ()->get_var ("quartwidth");
column_l ()->set_elt_property ("contains-grace", SCM_BOOL_T);
- Axis_align_item::do_pre_processing ();
+ Axis_align_item::before_line_breaking ();
// translate_axis (-0.5* nhw, X_AXIS); // ugh.
}
}
void
-Hara_kiri_group_spanner::do_post_processing ()
+Hara_kiri_group_spanner::after_line_breaking ()
{
SCM worth = get_elt_property ("items-worth-living");
if (gh_pair_p (worth))
{
current_lyric_l_ = t;
if (hyphen_spanner_p_
- && !hyphen_spanner_p_->spanned_drul_[RIGHT]
+ && !hyphen_spanner_p_->get_bound (RIGHT)
)
{
hyphen_spanner_p_->set_textitem (RIGHT, t);
if (hyphen_spanner_p_)
{
req_l_->warning (_ ("unterminated hyphen"));
- hyphen_spanner_p_->set_bounds(RIGHT, get_staff_info ().command_pcol_l ());
+ hyphen_spanner_p_->set_bound(RIGHT, get_staff_info ().command_pcol_l ());
}
}
void
-Hyphen_engraver::do_process_requests ()
+Hyphen_engraver::do_process_music ()
{
if (req_l_)
{
void
-Hyphen_spanner::do_post_processing ()
+Hyphen_spanner::after_line_breaking ()
{
// UGH
Real gap = paper_l ()->get_var ("interline");
Direction d = LEFT;
do
{
- Item* t = spanned_drul_[d]
- ? spanned_drul_[d] : spanned_drul_[(Direction)-d];
+ Item* t = get_bound (d)
+ ? get_bound (d) : get_bound ((Direction)-d);
if (d == LEFT)
dx_f_drul_[d] += t->extent (X_AXIS).length ();
else
void
Hyphen_spanner::set_textitem (Direction d, Item* textitem_l)
{
- set_bounds (d, textitem_l);
+ set_bound (d, textitem_l);
add_dependency (textitem_l);
}
void set_axis (Axis);
int get_count (Score_element*)const;
protected:
- virtual void do_post_processing() ;
- virtual void do_pre_processing ();
+ virtual void after_line_breaking () ;
+ virtual void before_line_breaking ();
virtual void do_side_processing ();
};
#endif // VERTICAL_ALIGN_ITEM_HH
virtual void do_post_move_processing ();
virtual void do_removal_processing ();
virtual void acknowledge_element (Score_element_info);
- virtual void do_process_requests ();
+ virtual void do_process_music ();
virtual void process_acknowledged ();
virtual void do_creation_processing ();
private:
protected:
virtual void do_creation_processing ();
virtual void do_removal_processing ();
- virtual void do_process_requests();
+ virtual void do_process_music();
virtual void do_pre_move_processing();
class Bar_number_engraver : public Bar_script_engraver {
protected:
- void do_process_requests ();
+ void do_process_music ();
public:
VIRTUAL_COPY_CONS(Translator);
Bar_number_engraver();
public:
VIRTUAL_COPY_CONS(Score_element);
Bar();
+
+ Molecule staff_bracket (Real height) const;
+ Molecule staff_brace (Real height) const;
+ Molecule compound_barline (String, Real height) const;
+ Molecule simple_barline (Real wid, Real height) const;
+
protected:
- virtual void do_pre_processing ();
+ virtual void before_line_breaking ();
virtual Molecule do_brew_molecule () const;
virtual Real get_bar_size () const;
};
virtual void do_removal_processing ();
virtual void acknowledge_element (Score_element_info);
virtual bool do_try_music (Music*);
- virtual void do_process_requests ();
+ virtual void do_process_music ();
public:
Beam_engraver ();
VIRTUAL_COPY_CONS (Translator);
protected:
- virtual void do_pre_processing ();
- virtual void do_post_processing ();
+ virtual void before_line_breaking ();
+ virtual void after_line_breaking ();
virtual Molecule do_brew_molecule () const;
Molecule stem_beams (Stem *here, Stem *next, Stem *prev) const;
protected:
- virtual void do_pre_processing();
+ virtual void before_line_breaking ();
public:
Break_align_item ();
VIRTUAL_COPY_CONS(Score_element);
protected:
virtual bool do_try_music (Music *req_l);
- virtual void do_process_requests();
+ virtual void do_process_music();
virtual void do_pre_move_processing();
virtual void do_post_move_processing();
VIRTUAL_COPY_CONS(Score_element);
Breathing_sign ();
protected:
- virtual void do_post_processing ();
+ virtual void after_line_breaking ();
virtual Molecule do_brew_molecule () const;
};
protected:
virtual void do_pre_move_processing ();
virtual void acknowledge_element (Score_element_info i);
- virtual void do_process_requests ();
+ virtual void do_process_music ();
virtual bool do_try_music (Music* m);
private:
class Clef_item : public Item
{
protected:
- virtual void do_pre_processing();
+ virtual void before_line_breaking ();
virtual void do_add_processing ();
public:
VIRTUAL_COPY_CONS(Score_element);
Array<Shift_tup> automatic_shift ();
Array<Shift_tup> forced_shift ();
- virtual void do_pre_processing();
+ virtual void before_line_breaking ();
public:
void add_column (Note_column*ncol_l);
Dot_column ();
protected:
- virtual void do_post_processing ();
+ virtual void after_line_breaking ();
};
#endif // DOT_COLUMN_HH
{
protected:
virtual Molecule do_brew_molecule () const;
- virtual void do_post_processing ();
+ virtual void after_line_breaking ();
public:
Dots ();
protected:
virtual void acknowledge_element (Score_element_info);
virtual void do_removal_processing();
- virtual void do_process_requests();
+ virtual void do_process_music();
virtual bool do_try_music (Music*);
virtual void do_pre_move_processing();
virtual void do_post_move_processing ();
protected:
virtual Molecule do_brew_molecule () const;
- void do_post_processing ();
+ void after_line_breaking ();
VIRTUAL_COPY_CONS (Score_element);
Protected_scm size_;
protected:
virtual void acknowledge_element (Score_element_info);
- virtual void do_process_requests ();
+ virtual void do_process_music ();
public:
Font_size_engraver ();
Grace_align_item ();
protected:
virtual void do_add_processing ();
- virtual void do_pre_processing ();
+ virtual void before_line_breaking ();
};
#endif /* GRACE_ALIGN_ITEM_HH */
{
public:
Hara_kiri_group_spanner ();
- virtual void do_post_processing ();
+ virtual void after_line_breaking ();
void add_interesting_item (Item* n);
protected:
VIRTUAL_COPY_CONS(Score_element);
protected:
virtual void acknowledge_element (Score_element_info);
virtual void do_removal_processing();
- virtual void do_process_requests();
+ virtual void do_process_music();
virtual bool do_try_music (Music*);
virtual void do_pre_move_processing();
virtual void do_post_move_processing ();
virtual Molecule do_brew_molecule () const;
Interval do_height () const;
- void do_post_processing ();
+ void after_line_breaking ();
VIRTUAL_COPY_CONS (Score_element);
protected:
virtual bool do_try_music (Music *req_l);
- virtual void do_process_requests();
+ virtual void do_process_music();
virtual void do_pre_move_processing();
virtual void do_post_move_processing();
virtual void acknowledge_element (Score_element_info);
protected:
void do_print() const;
virtual bool do_try_music (Music* req_l);
- virtual void do_process_requests ();
+ virtual void do_process_music ();
virtual void do_pre_move_processing ();
private:
void add_pitch (Musical_pitch, bool cautionary, bool natural);
protected:
- virtual void do_pre_processing();
+ virtual void before_line_breaking ();
virtual Molecule do_brew_molecule() const;
};
#endif // LOCALKEYITEM_HH
protected:
virtual void do_pre_move_processing();
virtual bool do_try_music (Music*);
- virtual void do_process_requests();
+ virtual void do_process_music();
virtual void do_post_move_processing ();
public:
Lyric_engraver ();
protected:
void do_print() const;
virtual bool do_try_music (Music* req_l);
- virtual void do_process_requests();
+ virtual void do_process_music();
virtual void do_pre_move_processing ();
private:
VIRTUAL_COPY_CONS (Score_element);
virtual void do_add_processing ();
- virtual void do_post_processing ();
+ virtual void after_line_breaking ();
virtual Array<Rod> get_rods () const;
};
(chord) and scripts) as a single entity. */
class Note_column : public Axis_group_item {
protected:
- virtual void do_post_processing () ;
+ virtual void after_line_breaking () ;
public:
static int shift_compare (Note_column *const &, Note_column*const&);
Molecule ledger_line (Interval) const;
protected:
- virtual void do_pre_processing();
+ virtual void before_line_breaking ();
virtual Molecule do_brew_molecule() const;
};
#endif // NOTEHEAD_HH
protected:
virtual bool do_try_music (Music *req_l) ;
- virtual void do_process_requests();
+ virtual void do_process_music();
virtual void do_pre_move_processing();
};
Note_performer();
protected:
- virtual void do_process_requests ();
+ virtual void do_process_music ();
virtual bool do_try_music (Music *req_l) ;
virtual void do_print () const;
virtual void do_pre_move_processing ();
virtual void acknowledge_element (Score_element_info i);
virtual void do_removal_processing ();
virtual bool do_try_music (Music *req_l);
- virtual void do_process_requests();
+ virtual void do_process_music();
virtual void do_pre_move_processing();
virtual void do_post_move_processing ();
void queue_events ();
Rest_collision();
protected:
- virtual void do_pre_processing();
+ virtual void before_line_breaking ();
};
#endif // REST_COLLISION_HH
virtual bool do_try_music (Music *);
virtual void do_pre_move_processing ();
virtual void do_post_move_processing ();
- virtual void do_process_requests ();
+ virtual void do_process_music ();
public:
VIRTUAL_COPY_CONS(Translator);
class Rest : public Rhythmic_head
{
protected:
- virtual void do_post_processing ();
+ virtual void after_line_breaking ();
virtual Molecule do_brew_molecule () const;
};
#endif // REST_HH
Dots * dots_l () const;
int dot_count () const;
protected:
- virtual void do_post_processing ();
+ virtual void after_line_breaking ();
};
#endif // RHYTHMIC_HEAD_HH
///executed directly after the item is added to the Paper_score
virtual void do_add_processing ();
/// do calculations before determining horizontal spacing
- virtual void do_pre_processing ();
+ virtual void before_line_breaking ();
/// generate rods & springs
virtual void do_space_processing ();
virtual void do_breakable_col_processing ();
/// do calculations after determining horizontal spacing
- virtual void do_post_processing ();
+ virtual void after_line_breaking ();
virtual Link_array<Score_element> get_extra_dependencies () const;
Script_column();
void add_staff_sided (Item*);
protected:
- virtual void do_pre_processing ();
+ virtual void before_line_breaking ();
};
public:
protected:
- virtual void do_pre_processing ();
- virtual void do_post_processing ();
+ virtual void before_line_breaking ();
+ virtual void after_line_breaking ();
Molecule do_brew_molecule () const;
};
void set_melisma (bool);
protected:
virtual bool do_try_music (Music*);
- virtual void do_process_requests();
+ virtual void do_process_music();
virtual void acknowledge_element (Score_element_info);
virtual void do_pre_move_processing();
virtual void do_post_move_processing();
Drul_array<Real> dx_f_drul_;
virtual Direction get_default_dir () const;
- virtual void do_post_processing ();
+ virtual void after_line_breaking ();
virtual void do_add_processing ();
Array<Rod> get_rods () const;
static Interval width_callback(Dimension_cache const*) ;
static Interval height_callback(Dimension_cache const*) ;
- virtual void do_pre_processing();
- virtual void do_post_processing();
- virtual Molecule do_brew_molecule() const;
+ virtual Real get_bar_size () const;
+ virtual void before_line_breaking ();
+ virtual void after_line_breaking ();
};
#endif // SPAN_BAR_HH
virtual void play_element (Audio_element* p);
virtual void do_removal_processing ();
virtual void do_creation_processing ();
- virtual void do_process_requests ();
+ virtual void do_process_music ();
virtual void do_pre_move_processing ();
private:
protected:
Molecule flag () const;
- virtual void do_pre_processing();
+ virtual void before_line_breaking();
static Interval dim_callback (Dimension_cache const*);
virtual Molecule do_brew_molecule() const;
protected:
void do_print() const;
virtual bool do_try_music (Music* req_l);
- virtual void do_process_requests();
+ virtual void do_process_music();
virtual void do_pre_move_processing ();
private:
void add_tie (Tie*);
Tie_column ();
protected:
- virtual void do_post_processing ();
+ virtual void after_line_breaking ();
void set_directions ();
};
virtual void do_pre_move_processing ();
virtual void acknowledge_element (Audio_element_info);
virtual bool do_try_music (Music*);
- virtual void do_process_requests ();
+ virtual void do_process_music ();
virtual void process_acknowledged ();
};
Drul_array<Real> dx_f_drul_;
virtual void do_add_processing ();
- virtual void do_post_processing ();
+ virtual void after_line_breaking ();
virtual Array<Rod> get_rods () const;
*/
class Time_signature_engraver : public Engraver {
protected:
- virtual void do_process_requests();
+ virtual void do_process_music();
virtual void do_pre_move_processing();
public:
VIRTUAL_COPY_CONS(Translator);
protected:
void do_print() const;
virtual bool do_try_music (Music* req_l);
- virtual void do_process_requests();
+ virtual void do_process_music();
virtual void do_pre_move_processing ();
private:
protected:
virtual void do_creation_processing ();
virtual bool do_try_music (Music *req_l);
- virtual void do_process_requests();
+ virtual void do_process_music();
virtual void do_pre_move_processing();
virtual void do_post_move_processing();
bool try_music_on_nongroup_children (Music *m);
virtual void do_print () const;
- virtual void do_process_requests ();
+ virtual void do_process_music ();
virtual void do_add_processing ();
virtual bool do_try_music (Music* req_l);
virtual void do_pre_move_processing();
virtual void do_print () const;
virtual void do_pre_move_processing();
virtual void do_post_move_processing();
- virtual void do_process_requests () ;
+ virtual void do_process_music () ;
virtual void do_creation_processing() ;
virtual void do_removal_processing();
};
virtual Molecule do_brew_molecule () const;
VIRTUAL_COPY_CONS(Score_element);
virtual void do_add_processing ();
- virtual void do_post_processing ();
+ virtual void after_line_breaking ();
virtual Direction get_default_dir () const;
};
virtual void do_add_processing ();
static Interval dim_callback (Dimension_cache const*);
- virtual void do_post_processing ();
+ virtual void after_line_breaking ();
};
#endif // VOLTA_SPANNER_HH
}
void
-Key_engraver::do_process_requests ()
+Key_engraver::do_process_music ()
{
if (keyreq_l_)
{
}
void
-Key_performer::do_process_requests ()
+Key_performer::do_process_music ()
{
if (key_req_l_)
{
Local_key_item *key_item_p_;
protected:
VIRTUAL_COPY_CONS(Translator);
- virtual void do_process_requests();
+ virtual void do_process_music();
virtual void acknowledge_element (Score_element_info);
virtual void do_pre_move_processing();
virtual void do_creation_processing ();
}
void
-Local_key_engraver::do_process_requests()
+Local_key_engraver::do_process_music()
{
if (time_trans_l_ && !time_trans_l_->measure_position ())
{
void
-Local_key_item::do_pre_processing()
+Local_key_item::before_line_breaking ()
{
accidental_arr_.sort (Local_key_cautionary_tuple::compare);
}
Box b(Interval (0, gh_scm2double (pads[d]) * note_distance),
Interval (0,0));
- Molecule m (lookup_l ()->fill (b));
+ Molecule m (lookup_l ()->blank (b));
mol.add_at_edge (X_AXIS, d, m, 0);
} while ( flip (&d)!= LEFT);
}
}
void
-Lyric_engraver::do_process_requests()
+Lyric_engraver::do_process_music()
{
if (req_l_)
{
}
void
-Lyric_performer::do_process_requests ()
+Lyric_performer::do_process_music ()
{
if (lreq_arr_.size () && lreq_arr_[0]->text_str_.length_i ())
{
VIRTUAL_COPY_CONS(Translator);
protected:
virtual bool do_try_music (Music *req_l);
- virtual void do_process_requests ();
+ virtual void do_process_music ();
virtual void do_post_move_processing ();
private:
Mark_req * mark_req_l_;
}
void
-Mark_engraver::do_process_requests ()
+Mark_engraver::do_process_music ()
{
if (mark_req_l_)
{
protected:
virtual void acknowledge_element (Score_element_info i);
- virtual void do_process_requests ();
+ virtual void do_process_music ();
virtual bool do_try_music (Music*);
virtual void do_pre_move_processing ();
virtual void do_post_move_processing ();
void
-Multi_measure_rest_engraver::do_process_requests ()
+Multi_measure_rest_engraver::do_process_music ()
{
if (new_req_l_ && stop_req_l_)
stop_req_l_ = 0;
Direction d = LEFT;
do
{
- Item * col = spanned_drul_[d]->column_l ();
+ Item * col = get_bound (d)->column_l ();
Interval coldim = col->extent (X_AXIS)
+ col->relative_coordinate (0, X_AXIS);
Molecule mol;
Real x_off = 0.0;
- Real rx = spanned_drul_[LEFT]->relative_coordinate (0, X_AXIS);
+ Real rx = get_bound (LEFT)->relative_coordinate (0, X_AXIS);
/*
we gotta stay clear of sp_iv, so move a bit to the right if
needed.
{
Link_array<Item> column_arr (Group_interface__extract_elements (this, (Item*)0, "columns"));
- set_bounds (LEFT, column_arr[0 >? column_arr.size () - 2]);
- set_bounds (RIGHT, column_arr.top ());
+ set_bound (LEFT, column_arr[0 >? column_arr.size () - 2]);
+ set_bound (RIGHT, column_arr.top ());
}
// set columns to SCM_EOL?
}
void
-Multi_measure_rest::do_post_processing ()
+Multi_measure_rest::after_line_breaking ()
{
if (!gh_pair_p (get_elt_property ("columns")))
set_elt_property ("transparent", SCM_BOOL_T);
{
Array<Rod> a;
- if (!(spanned_drul_[LEFT] && spanned_drul_[RIGHT]))
+ if (!(get_bound (LEFT) && get_bound (RIGHT)))
{
programming_error ("Multi_measure_rest::get_rods (): I am not spanned!");
return a;
}
- Item * l = spanned_drul_[LEFT]->column_l ();
- Item * r = spanned_drul_[RIGHT]->column_l ();
+ Item * l = get_bound (LEFT)->column_l ();
+ Item * r = get_bound (RIGHT)->column_l ();
Item * lb = l->find_broken_piece (RIGHT);
Item * rb = r->find_broken_piece (LEFT);
*/
void
-Note_column::do_post_processing ()
+Note_column::after_line_breaking ()
{
if (!stem_l () || !rest_b ())
return;
void
-Note_head::do_pre_processing ()
+Note_head::before_line_breaking ()
{
// 8 ball looks the same as 4 ball:
String type;
}
void
-Note_heads_engraver::do_process_requests()
+Note_heads_engraver::do_process_music()
{
if (note_p_arr_.size ())
return ;
Link_array<Note_req> req_l_arr_;
Link_array<Text_item> texts_;
virtual bool do_try_music (Music*m);
- virtual void do_process_requests ();
+ virtual void do_process_music ();
virtual void do_pre_move_processing ();
};
void
-Note_name_engraver::do_process_requests ()
+Note_name_engraver::do_process_music ()
{
String s ;
for (int i=0; i < req_l_arr_.size (); i++)
}
void
-Note_performer::do_process_requests ()
+Note_performer::do_process_music ()
{
if (note_req_l_arr_.size ())
{
}
void
-Repeat_engraver::do_process_requests ()
+Repeat_engraver::do_process_music ()
{
if (repeated_music_l_ && !done_this_one_b_)
{
}
void
-Rest_collision::do_pre_processing()
+Rest_collision::before_line_breaking ()
{
Link_array<Note_column> rest_l_arr =
Group_interface__extract_elements (this, (Note_column*) 0, "rests");
}
void
-Rest_engraver::do_process_requests ()
+Rest_engraver::do_process_music ()
{
if (rest_req_l_ && !rest_p_)
{
void
-Rest::do_post_processing ()
+Rest::after_line_breaking ()
{
if (balltype_i () == 0)
{
}
void
-Rhythmic_head::do_post_processing ()
+Rhythmic_head::after_line_breaking ()
{
if (Dots *d = dots_l ())
{
}
void
-Score_element::do_post_processing()
+Score_element::after_line_breaking ()
{
}
}
void
-Score_element::do_pre_processing()
+Score_element::before_line_breaking ()
{
}
}
else
{
- Interval emp;
- emp.set_empty ();
- return lookup_l ()->fill (Box (emp,emp));
+ Molecule m ;
+ m.set_empty (true);
+ return m;
}
}
for (int a = X_AXIS; a < NO_AXES; a ++)
{
Axis ax = (Axis)a;
- Score_element * par = parent_l (ax);
+ Score_element * parent = parent_l (ax);
- if (!par)
+ if (!parent)
continue;
- if (par->line_l () != line_l ())
+ if (parent->line_l () != line_l ())
{
- Score_element * newpar = par->find_broken_piece (line_l ());
- set_parent (newpar, ax);
+ Score_element * newparent = parent->find_broken_piece (line_l ());
+ set_parent (newparent, ax);
}
if (Item * i = dynamic_cast<Item*> (this))
{
- Item *pari = dynamic_cast<Item*> (par);
+ Item *parenti = dynamic_cast<Item*> (parent);
- if (pari && i)
+ if (parenti && i)
{
Direction my_dir = i->break_status_dir () ;
- if (my_dir!= pari->break_status_dir())
+ if (my_dir!= parenti->break_status_dir())
{
- Item *newpar = pari->find_broken_piece (my_dir);
- set_parent (newpar, ax);
+ Item *newparent = parenti->find_broken_piece (my_dir);
+ set_parent (newparent, ax);
}
}
}
}
void
-Script_column::do_pre_processing ()
+Script_column::before_line_breaking ()
{
Drul_array<Link_array<Item> > arrs;
Link_array<Item> staff_sided
Script_engraver();
protected:
virtual bool do_try_music (Music*);
- virtual void do_process_requests ();
+ virtual void do_process_music ();
virtual void do_pre_move_processing ();
virtual void do_post_move_processing ();
virtual void acknowledge_element (Score_element_info);
}
void
-Script_engraver::do_process_requests()
+Script_engraver::do_process_music()
{
for (int i=0; i < script_req_l_arr_.size(); i++)
{
void
-Script::do_pre_processing ()
+Script::before_line_breaking ()
{
/*
center my self on the note head.
}
void
-Script::do_post_processing ()
+Script::after_line_breaking ()
{
Side_position_interface i (this);
Direction d = i.get_direction ();
}
void
-Slur_engraver::do_process_requests()
+Slur_engraver::do_process_music()
{
Array<Slur*> start_slur_l_arr_;
for (int i=0; i< new_slur_req_l_arr_.size(); i++)
Real default_height)
{
Real length = curve_.control_[3][X_AXIS];
- Real bbc = paper_l->get_var ("bezier_beautiful");
- Real beautiful = length * default_height / bbc;
+ Real sb = paper_l->get_var ("slur_beautiful");
+ Real beautiful = length * default_height * sb;
DEBUG_OUT << to_str ("Beautiful: %f\n", beautiful);
DEBUG_OUT << to_str ("Length: %f\n", length);
if (encompass_arr.size ())
{
- set_bounds (LEFT, encompass_arr[0]);
+ set_bound (LEFT, encompass_arr[0]);
if (encompass_arr.size () > 1)
- set_bounds (RIGHT, encompass_arr.top ());
+ set_bound (RIGHT, encompass_arr.top ());
}
}
}
void
-Slur::do_post_processing ()
+Slur::after_line_breaking ()
{
set_extremities ();
set_control_points ();
dx_f_drul_[d] = 0;
dy_f_drul_[d] = 0;
- if ((note_column_drul[d] == spanned_drul_[d])
+ if ((note_column_drul[d] == get_bound (d))
&& note_column_drul[d]->first_head ()
&& (note_column_drul[d]->stem_l ()))
{
&& !((my_dir == stem_l->get_direction ())
&& stem_l->beam_l () && (stem_l->beam_count (-d) >= 1)))
{
- dx_f_drul_[d] = spanned_drul_[d]->extent (X_AXIS).length () / 2;
+ dx_f_drul_[d] = get_bound (d)->extent (X_AXIS).length () / 2;
dx_f_drul_[d] -= d * x_gap_f;
if (stem_l->get_direction () != my_dir)
else
{
dx_f_drul_[d] = stem_l->hpos_f ()
- - spanned_drul_[d]->relative_coordinate (0, X_AXIS);
+ - get_bound (d)->relative_coordinate (0, X_AXIS);
/*
side attached to beamed stem
*/
if (fix_broken_b)
{
- Direction d = (encompass_arr.top () != spanned_drul_[RIGHT]) ?
+ Direction d = (encompass_arr.top () != get_bound (RIGHT)) ?
RIGHT : LEFT;
dy_f_drul_[d] = info_drul[d][Y_AXIS];
if (!interstaff_b)
int cross_count = cross_staff_count ();
bool cross_b = cross_count && cross_count < encompass_arr.size ();
- if (encompass_arr[0] != spanned_drul_[LEFT])
+ if (encompass_arr[0] != get_bound (LEFT))
{
first--;
Real is = calc_interstaff_dist (encompass_arr[0], this);
/*
right is broken edge
*/
- if (encompass_arr.top () != spanned_drul_[RIGHT])
+ if (encompass_arr.top () != get_bound (RIGHT))
{
last++;
}
{
Array<Rod> a;
Rod r;
- r.item_l_drul_ = spanned_drul_;
+ r.item_l_drul_[LEFT] = get_bound (LEFT);
+ r.item_l_drul_[RIGHT] = get_bound (RIGHT);
+
r.distance_f_ = paper_l ()->get_var ("slur_x_minimum");
a.push (r);
-#if 0
-SCM
-ugly_scm (Bezier b)
-{
- b.translate (-b.control_[0]);
- Real alpha = b.control_[3].arg ();
-
- b.rotate ( -alpha);
- if (b.control_[1][Y_AXIS] < 0)
- {
- b.control_[1][Y_AXIS] *= -1;
- b.control_[2][Y_AXIS] *= -1;
- }
-
- Real len = b.control_[3][X_AXIS];
- Real indent = 10 *b.control_[1][X_AXIS] / len ;
- Real ht = 10 *b.control_[1][Y_AXIS] / len ;
-
- SCM res = scm_eval (scm_listify (ly_symbol2scm ("slur-ugly"), gh_double2scm (indent), gh_double2scm (ht), SCM_UNDEFINED ));
-
- return res;
-}
-#endif
-
-
/*
Ugh should have dash-length + dash-period
*/
else
a = lookup_l ()->slur (one, directional_element (this).get () * thick, thick);
-#if 0
- SCM u = ugly_scm (one);
- if (gh_pair_p (u))
- {
- Molecule mark = lookup_l ()-> text ( "roman",
- to_str (gh_scm2double (gh_car (u)), "%0.2f") + "," +
- to_str(gh_scm2double (gh_cdr (u)), "%0.2f"),
- paper_l ());
-
- mark.translate_axis (20 , Y_AXIS);
- a.add_molecule (mark);
- }
-#endif
return a;
}
{
Span_bar* s= dynamic_cast<Span_bar*> (c->element_l ());
String gl = ly_scm2string (s->get_elt_property ("glyph"));
-
- Molecule m = s->lookup_l ()->bar (gl, 40 PT, s->paper_l ());
+
+ /*urg.
+ */
+ Molecule m = s->compound_barline (gl, 40 PT);
return m.extent (X_AXIS);
}
void
-Span_bar::do_pre_processing ()
+Span_bar::before_line_breaking ()
{
- Bar::do_pre_processing ();
+ Bar::before_line_breaking ();
evaluate_empty ();
}
void
-Span_bar::do_post_processing ()
+Span_bar::after_line_breaking ()
{
- Bar::do_post_processing ();
+ Bar::after_line_breaking ();
Interval i(get_spanned_interval ());
translate_axis (i.center (), Y_AXIS);
type_str= ".|.";
}
}
+
+ /*
+ uhh. should do something with type_str ?!!
+ */
}
Interval
y_int.unite (y + iv);
}
}
+
return y_int;
}
return s->get_spanned_interval ();
}
-Molecule
-Span_bar::do_brew_molecule () const
+Real
+Span_bar::get_bar_size () const
{
- Interval iv (get_spanned_interval ());
- Molecule output;
- SCM s = get_elt_property ("glyph");
- if (gh_string_p (s) && !iv.empty_b())
- {
- output.add_molecule (lookup_l ()->bar (ly_scm2string (s),
- iv.length (),
- paper_l ()));
- }
- else
- {
- programming_error("Huh? My children deflated (FIXME)");
- }
- return output;
+ Interval iv (get_spanned_interval ());
+ if (iv.empty_b ())
+ {
+ programming_error("Huh? My children deflated (FIXME)");
+ iv = Interval (0,0);
+ }
+ return iv.length ();
}
-
-
Span_bar::Span_bar ()
{
+ group (this).set_interface ();
dim_cache_[X_AXIS]->set_callback (width_callback);
dim_cache_[Y_AXIS]->set_callback (height_callback);
}
}
void
-Staff_performer::do_process_requests ()
+Staff_performer::do_process_music ()
{
String str = new_instrument_str ();
if (str.length_i ())
instrument_p_ = new Audio_instrument (str);
announce_element (Audio_element_info (instrument_p_, 0));
}
- Performer_group_performer::do_process_requests ();
+ Performer_group_performer::do_process_music ();
}
void
{
Stem * me = (Stem*) this;
d = get_default_dir ();
+ // urg, AAARGH!
directional_element (me).set (d);
}
return d ;
}
void
-Stem::do_pre_processing ()
+Stem::before_line_breaking ()
{
stem_end_position (); // ugh. Trigger direction calc.
position_noteheads ();
void
Super_element::pre_processing ()
{
- calculate_dependencies (PRECALCED, PRECALCING, &Score_element::do_pre_processing);
+ calculate_dependencies (PRECALCED, PRECALCING, &Score_element::before_line_breaking);
}
void
// calculate_dependencies (PREBROKEN_SECOND, PREBROKEN_SECOND, &Score_element::handle_prebroken_dependents);
}
-void
-Super_element::break_processing ()
-{
- calculate_dependencies (BROKEN, BROKEN, &Score_element::do_break_processing);
-}
void
Super_element::post_processing ()
{
// calculate_dependencies (BROKEN_SECOND, BROKEN_SECOND,
// &Score_element::handle_broken_dependents);
- calculate_dependencies (POSTCALCED, POSTCALCING, &Score_element::do_post_processing);
+ calculate_dependencies (POSTCALCED, POSTCALCING, &Score_element::after_line_breaking);
}
void
}
void
-Tempo_performer::do_process_requests ()
+Tempo_performer::do_process_music ()
{
if (tempo_req_l_)
{
virtual bool do_try_music (Music* m);
virtual void do_pre_move_processing ();
virtual void do_post_move_processing ();
- virtual void do_process_requests ();
+ virtual void do_process_music ();
virtual void acknowledge_element (Score_element_info);
};
}
void
-Text_engraver::do_process_requests ()
+Text_engraver::do_process_music ()
{
for (int i=0; i < reqs_.size (); i++)
{
Group_interface g (this, "ties");
if (!g.count ())
{
- set_bounds (LEFT, s->head (LEFT));
- set_bounds (RIGHT, s->head (RIGHT));
+ set_bound (LEFT, s->head (LEFT));
+ set_bound (RIGHT, s->head (RIGHT));
}
group (this, "ties").add_element (s);
}
void
-Tie_column::do_post_processing ()
+Tie_column::after_line_breaking ()
{
set_directions ();
}
virtual void do_pre_move_processing ();
virtual void acknowledge_element (Score_element_info);
virtual bool do_try_music (Music*);
- virtual void do_process_requests ();
+ virtual void do_process_music ();
virtual void process_acknowledged ();
public:
}
void
-Tie_engraver::do_process_requests ()
+Tie_engraver::do_process_music ()
{
if (req_l_)
{
}
void
-Tie_performer::do_process_requests ()
+Tie_performer::do_process_music ()
{
if (req_l_)
{
assert (!head (d));
index_set_cell (get_elt_property ("heads"), d, head_l->self_scm_);
- set_bounds (d, head_l);
+ set_bound (d, head_l);
add_dependency (head_l);
}
}
void
-Tie::do_post_processing()
+Tie::after_line_breaking ()
{
if (!head (LEFT) && !head (RIGHT))
{
{
Array<Rod> a;
Rod r;
- r.item_l_drul_ = spanned_drul_;
+
+ r.item_l_drul_ [LEFT]=get_bound (LEFT);
+ r.item_l_drul_ [RIGHT]=get_bound (RIGHT);
+
r.distance_f_ = paper_l ()->get_var ("tie_x_minimum");
a.push (r);
return a;
}
void
-Time_signature_engraver::do_process_requests()
+Time_signature_engraver::do_process_music()
{
Translator * result =
daddy_grav_l()->get_simple_translator ("Timing_engraver"); // ugh
}
void
-Time_signature_performer::do_process_requests ()
+Time_signature_performer::do_process_music ()
{
if (time_signature_req_l_)
{
}
void
-Timing_translator::do_process_requests()
+Timing_translator::do_process_music()
{
for (int i=0; i < timing_req_l_arr_.size (); i++)
{
}
void
-Translator_group::do_process_requests ()
+Translator_group::do_process_music ()
{
each (&Translator::process_requests);
}
return;
status = PROCESSED_REQS;
- do_process_requests ();
+ do_process_music ();
}
void
void
Translator::do_post_move_processing(){}
void
-Translator::do_process_requests () {}
+Translator::do_process_music () {}
void
Translator::do_creation_processing() {}
void
virtual void do_removal_processing ();
virtual void acknowledge_element (Score_element_info);
virtual bool do_try_music (Music*r);
- virtual void do_process_requests ();
+ virtual void do_process_music ();
virtual void do_post_move_processing ();
};
}
void
-Tuplet_engraver::do_process_requests ()
+Tuplet_engraver::do_process_music ()
{
SCM v = get_property ("tupletInvisible");
if (to_boolean (v))
Link_array<Note_column> column_arr=
Group_interface__extract_elements (this, (Note_column*)0, "columns");
- set_bounds (LEFT, column_arr[0]);
- set_bounds (RIGHT, column_arr.top ());
+ set_bound (LEFT, column_arr[0]);
+ set_bound (RIGHT, column_arr.top ());
}
}
}
void
-Tuplet_spanner::do_post_processing ()
+Tuplet_spanner::after_line_breaking ()
{
Link_array<Note_column> column_arr=
Group_interface__extract_elements (this, (Note_column*)0, "columns");
Score_element *b = unsmob_element (gh_car (bs));
Beam * beam_l = dynamic_cast<Beam*> (b);
if (!broken_b ()
- && spanned_drul_[LEFT]->column_l () == beam_l->spanned_drul_[LEFT]->column_l ()
- && spanned_drul_[RIGHT]->column_l () == beam_l->spanned_drul_[RIGHT]->column_l ())
+ && get_bound (LEFT)->column_l () == beam_l->get_bound (LEFT)->column_l ()
+ && get_bound (RIGHT)->column_l () == beam_l->get_bound (RIGHT)->column_l ())
set_elt_property ("parallel-beam", SCM_BOOL_T);
}
}
if (bar_arr.size ())
{
- set_bounds (LEFT, bar_arr[0]);
- set_bounds (RIGHT, bar_arr.top ());
+ set_bound (LEFT, bar_arr[0]);
+ set_bound (RIGHT, bar_arr.top ());
}
}
}
void
-Volta_spanner::do_post_processing ()
+Volta_spanner::after_line_breaking ()
{
Link_array<Bar> bar_arr
= Group_interface__extract_elements (this, (Bar*)0, "bars");