From ea2770c4aca48f0a9a7ebdeef54a3581935c65c1 Mon Sep 17 00:00:00 2001 From: fred Date: Tue, 26 Mar 2002 23:23:47 +0000 Subject: [PATCH] lilypond-1.3.65 --- lily/beam.cc | 46 +++++++++++++------------- lily/grace-align-item.cc | 4 --- lily/include/dynamic-line-interface.hh | 0 lily/include/grace-align-item.hh | 2 +- lily/include/spanner.hh | 5 +++ lily/multi-measure-rest.cc | 4 ++- lily/tie.cc | 18 ++++++---- lily/tuplet-spanner.cc | 14 +++++--- 8 files changed, 52 insertions(+), 41 deletions(-) create mode 100644 lily/include/dynamic-line-interface.hh diff --git a/lily/beam.cc b/lily/beam.cc index 08173a742f..322655fe74 100644 --- a/lily/beam.cc +++ b/lily/beam.cc @@ -53,10 +53,7 @@ Beam::add_stem (Stem*s) assert (!s->beam_l ()); s->set_elt_pointer ("beam", self_scm_); - if (!get_bound (LEFT)) - set_bound (LEFT,s); - else - set_bound (RIGHT,s); + add_bound_item (this, s); } int @@ -92,8 +89,8 @@ Beam::member_before_line_breaking () } - if (!directional_element (this).get ()) - directional_element (this).set (get_default_dir ()); + if (!Directional_element_interface (this).get ()) + Directional_element_interface (this).set (get_default_dir ()); auto_knees (); set_stem_directions (); @@ -117,7 +114,7 @@ Beam::get_default_dir () const for (int i=0; i get_center_distance ((Direction)-d); @@ -155,13 +152,13 @@ Beam::get_default_dir () const void Beam::set_stem_directions () { - Direction d = directional_element (this).get (); + Direction d = Directional_element_interface (this).get (); for (int i=0; i remove_elt_property ("dir-forced"); if (!gh_boolean_p (force) || !gh_scm2bool (force)) - directional_element (s).set (d); + Directional_element_interface (s).set (d); } } @@ -185,7 +182,7 @@ Beam::auto_knee (String gap_str, bool interstaff_b) bool knee_b = false; int knee_y = 0; SCM gap = get_elt_property (gap_str); - Direction d = directional_element (this).get (); + Direction d = Directional_element_interface (this).get (); if (gh_number_p (gap)) { @@ -212,10 +209,13 @@ Beam::auto_knee (String gap_str, bool interstaff_b) { for (int i=0; i < stem_count (); i++) { + Item *s = stem(i); int y = (int)(stem (i)->head_positions()[d]) - + (int)calc_interstaff_dist (stem (i), this); - directional_element (stem (i)).set (y < knee_y ? UP : DOWN); - stem (i)->set_elt_property ("dir-forced", SCM_BOOL_T); + + (int)calc_interstaff_dist (s, this); + + + Directional_element_interface (s).set (y < knee_y ? UP : DOWN); + s->set_elt_property ("dir-forced", SCM_BOOL_T); } } return knee_b; @@ -291,8 +291,8 @@ Beam::member_after_line_breaking () /* until here, we used only stem_info, which acts as if dir=up */ - y *= directional_element (this).get (); - dy *= directional_element (this).get (); + y *= Directional_element_interface (this).get (); + dy *= Directional_element_interface (this).get (); Staff_symbol_referencer_interface st (this); Real half_space = st.staff_space () / 2; @@ -330,7 +330,7 @@ Beam::member_after_line_breaking () */ int quant_dir = 0; if (abs (y_shift) > half_space / 2) - quant_dir = sign (y_shift) * directional_element (this).get (); + quant_dir = sign (y_shift) * Directional_element_interface (this).get (); y = quantise_y_f (y, dy, quant_dir); } } @@ -441,8 +441,8 @@ Beam::calc_stem_y_f (Stem* s, Real y, Real dy) const Real stem_y = (dy && dx ? (s->relative_coordinate (0, X_AXIS) - x0) / dx * dy : 0) + y; /* knee */ - Direction dir = directional_element(this).get (); - Direction sdir = directional_element (s).get (); + Direction dir = Directional_element_interface(this).get (); + Direction sdir = Directional_element_interface (s).get (); /* knee */ if (dir!= sdir) @@ -456,7 +456,7 @@ Beam::calc_stem_y_f (Stem* s, Real y, Real dy) const // huh, why not for first visible? if (//(s != first_visible_stem ()) && me.staff_symbol_l () != last.staff_symbol_l ()) - stem_y += directional_element (this).get () + stem_y += Directional_element_interface (this).get () * (beam_multiplicity - stem_multiplicity) * interbeam_f; } return stem_y; @@ -467,7 +467,7 @@ Beam::check_stem_length_f (Real y, Real dy) const { Real shorten = 0; Real lengthen = 0; - Direction dir = directional_element (this).get (); + Direction dir = Directional_element_interface (this).get (); for (int i=0; i < stem_count (); i++) { @@ -571,7 +571,7 @@ Beam::quantise_y_f (Real y, Real dy, int quant_dir) if (a.size () <= 1) return y; - Real up_y = directional_element (this).get () * y; + Real up_y = Directional_element_interface (this).get () * y; Interval iv = quantise_iv (a, up_y/staff_space) * staff_space; Real q = up_y - iv[SMALLER] <= iv[BIGGER] - up_y @@ -579,7 +579,7 @@ Beam::quantise_y_f (Real y, Real dy, int quant_dir) if (quant_dir) q = iv[(Direction)quant_dir]; - return q * directional_element (this).get (); + return q * Directional_element_interface (this).get (); } void @@ -644,7 +644,7 @@ Beam::stem_beams (Stem *here, Stem *next, Stem *prev) const nw_f = paper_l ()->get_var ("quartwidth"); - Direction dir = directional_element (this).get (); + Direction dir = Directional_element_interface (this).get (); /* half beams extending to the left. */ if (prev) diff --git a/lily/grace-align-item.cc b/lily/grace-align-item.cc index e4467a9e3f..6a6f432ccf 100644 --- a/lily/grace-align-item.cc +++ b/lily/grace-align-item.cc @@ -41,8 +41,4 @@ Grace_align_item::member_before_line_breaking () } -void -Grace_align_item::do_add_processing () -{ -} diff --git a/lily/include/dynamic-line-interface.hh b/lily/include/dynamic-line-interface.hh new file mode 100644 index 0000000000..e69de29bb2 diff --git a/lily/include/grace-align-item.hh b/lily/include/grace-align-item.hh index 301178afd3..25764b2256 100644 --- a/lily/include/grace-align-item.hh +++ b/lily/include/grace-align-item.hh @@ -19,7 +19,7 @@ public: VIRTUAL_COPY_CONS (Score_element); Grace_align_item (SCM); - virtual void do_add_processing (); + SCM member_before_line_breaking (); static SCM before_line_breaking (SCM); }; diff --git a/lily/include/spanner.hh b/lily/include/spanner.hh index 9fb7f0bed6..3241e27908 100644 --- a/lily/include/spanner.hh +++ b/lily/include/spanner.hh @@ -60,4 +60,9 @@ protected: virtual void do_break_processing (); virtual Line_of_score*line_l () const; }; + + +void add_bound_item (Spanner*, Item* n); + + #endif diff --git a/lily/multi-measure-rest.cc b/lily/multi-measure-rest.cc index bf8a009f45..27dfeebf5c 100644 --- a/lily/multi-measure-rest.cc +++ b/lily/multi-measure-rest.cc @@ -143,6 +143,7 @@ Multi_measure_rest::member_brew_molecule () const void Multi_measure_rest::do_add_processing () { +#if 0 if (gh_pair_p (get_elt_pointer ("columns"))) { Link_array column_arr (Pointer_group_interface__extract_elements (this, (Item*)0, "columns")); @@ -150,7 +151,7 @@ Multi_measure_rest::do_add_processing () set_bound (LEFT, column_arr[0 >? column_arr.size () - 2]); set_bound (RIGHT, column_arr.top ()); } - +#endif // set columns to SCM_EOL? } @@ -174,6 +175,7 @@ Multi_measure_rest::add_column (Item* c) Pointer_group_interface gi (this, "columns"); gi.add_element (c); + add_bound_item (this, c); add_dependency (c); } diff --git a/lily/tie.cc b/lily/tie.cc index ed3d2be69b..02dd922b2d 100644 --- a/lily/tie.cc +++ b/lily/tie.cc @@ -66,13 +66,17 @@ Tie::get_default_dir () const Stem * sl = head(LEFT) ? head (LEFT)->stem_l () :0; Stem * sr = head(RIGHT) ? head (RIGHT)->stem_l () :0; - if (sl && directional_element (sl).get () == UP - && sr && directional_element (sr).get () == UP) + if (sl && Directional_element_interface (sl).get () == UP + && sr && Directional_element_interface (sr).get () == UP) return DOWN; else return UP; } +/* + fixme must use spanned drul from heads elt property + */ + void Tie::do_add_processing() { @@ -103,8 +107,8 @@ Tie::member_after_line_breaking () return SCM_UNDEFINED; } - if (!directional_element (this).get ()) - directional_element (this).set (get_default_dir ()); + if (!Directional_element_interface (this).get ()) + Directional_element_interface (this).set (get_default_dir ()); Real staff_space = staff_symbol_referencer (this).staff_space (); Real half_space = staff_space / 2; @@ -154,7 +158,7 @@ Tie::member_after_line_breaking () int ypos_i = int (ypos); Real dx_f = extent (X_AXIS).length () + dx_f_drul_[RIGHT] - dx_f_drul_[LEFT]; - Direction dir = directional_element (this).get(); + Direction dir = Directional_element_interface (this).get(); if (dx_f < paper_l ()->get_var ("tie_staffspace_length")) { if (abs (ypos_i) % 2) @@ -203,7 +207,7 @@ Tie::member_brew_molecule () const if (gh_number_p (d)) a = lookup_l ()->dashed_slur (one, thick, gh_scm2int (d)); else - a = lookup_l ()->slur (one, directional_element (this).get () * thick, thick); + a = lookup_l ()->slur (one, Directional_element_interface (this).get () * thick, thick); return a.create_scheme(); } @@ -213,7 +217,7 @@ Tie::member_brew_molecule () const Bezier Tie::get_curve () const { - Direction d (directional_element (this).get ()); + Direction d (Directional_element_interface (this).get ()); Bezier_bow b (get_encompass_offset_arr (), d); Real staff_space = staff_symbol_referencer (this).staff_space (); diff --git a/lily/tuplet-spanner.cc b/lily/tuplet-spanner.cc index 5779209b15..0f9badfc34 100644 --- a/lily/tuplet-spanner.cc +++ b/lily/tuplet-spanner.cc @@ -73,7 +73,7 @@ Tuplet_spanner::member_brew_molecule () const Real staff_space = paper_l ()->get_var ("interline"); - Direction dir = directional_element (this).get (); + Direction dir = Directional_element_interface (this).get (); Real dy = gh_scm2double (get_elt_property ("delta-y")); SCM number = get_elt_property ("text"); if (gh_string_p (number) && number_visibility) @@ -118,6 +118,7 @@ Tuplet_spanner::member_brew_molecule () const void Tuplet_spanner::do_add_processing () { +#if 0 if (gh_pair_p (get_elt_pointer ("columns"))) { Link_array column_arr= @@ -126,6 +127,7 @@ Tuplet_spanner::do_add_processing () set_bound (LEFT, column_arr[0]); set_bound (RIGHT, column_arr.top ()); } +#endif } @@ -142,7 +144,7 @@ Tuplet_spanner::calc_position_and_height (Real *offset, Real * dy) const Score_element * common = common_refpoint (get_elt_pointer ("columns"), Y_AXIS); - Direction d = directional_element (this).get (); + Direction d = Directional_element_interface (this).get (); /* Use outer non-rest columns to determine slope @@ -197,7 +199,7 @@ Tuplet_spanner::calc_dy (Real * dy) const Pointer_group_interface__extract_elements (this, (Note_column*)0, "columns"); - Direction d = directional_element (this).get (); + Direction d = Directional_element_interface (this).get (); *dy = column_arr.top ()->extent (Y_AXIS) [d] - column_arr[0]->extent (Y_AXIS) [d]; } @@ -215,11 +217,11 @@ Tuplet_spanner::member_after_line_breaking () return SCM_UNDEFINED; } - Direction d = directional_element (this).get (); + Direction d = Directional_element_interface (this).get (); if (!d) { d = get_default_dir (); - directional_element (this).set (d); + Directional_element_interface (this).set (d); } Real dy, offset; @@ -286,6 +288,8 @@ Tuplet_spanner::add_column (Note_column*n) gi.add_element (n); add_dependency (n); + + add_bound_item (this, n); } -- 2.39.5