X-Git-Url: https://git.donarmstrong.com/?a=blobdiff_plain;f=lily%2Ftie-formatting-problem.cc;h=905718469cf0b7e696366219b37c6cee5acf4169;hb=8cf69a467ad7650f5ca9da6fe2dfd4c7c088b239;hp=1faa3d94454c4c59ed12ae7e8393c05cae0129dd;hpb=e8d5061834a5a658c5ffd078237e9cd660069a7d;p=lilypond.git diff --git a/lily/tie-formatting-problem.cc b/lily/tie-formatting-problem.cc index 1faa3d9445..905718469c 100644 --- a/lily/tie-formatting-problem.cc +++ b/lily/tie-formatting-problem.cc @@ -29,6 +29,7 @@ #include "misc.hh" #include "note-head.hh" #include "rhythmic-head.hh" +#include "semi-tie.hh" #include "spanner.hh" #include "staff-symbol-referencer.hh" #include "stem.hh" @@ -98,11 +99,11 @@ Tie_formatting_problem::set_column_chord_outline (vector bounds, for (vsize i = 0; i < bounds.size (); i++) { Grob *head = bounds[i]; - if (!Note_head::has_interface (head)) + if (!has_interface (head)) continue; if (!stem) - stem = Grob::unsmob (head->get_object ("stem")); + stem = unsmob (head->get_object ("stem")); Real p = Staff_symbol_referencer::get_position (head); Interval y ((p - 1) * 0.5 * staff_space, @@ -211,7 +212,7 @@ Tie_formatting_problem::set_column_chord_outline (vector bounds, boxes.push_back (Box (x, y)); } - Grob *acc = Grob::unsmob (heads[i]->get_object ("accidental-grob")); + Grob *acc = unsmob (heads[i]->get_object ("accidental-grob")); if (acc) acc->get_property ("after-line-breaking"); /* trigger tie-related suicide */ @@ -342,7 +343,8 @@ Tie_formatting_problem::from_ties (vector const &ties) for (vsize i = 0; i < ties.size (); i++) { - Item *it = dynamic_cast (ties[i])->get_bound (d); + Spanner *tie = dynamic_cast (ties[i]); + Item *it = tie->get_bound (d); if (it->break_status_dir ()) it = it->get_column (); @@ -354,13 +356,14 @@ Tie_formatting_problem::from_ties (vector const &ties) for (vsize i = 0; i < ties.size (); i++) { + Spanner *tie = dynamic_cast (ties[i]); Tie_specification spec; - spec.from_grob (ties[i]); + spec.from_grob (tie); for (LEFT_and_RIGHT (d)) { - spec.note_head_drul_[d] = Tie::head (ties[i], d); - spec.column_ranks_[d] = Tie::get_column_rank (ties[i], d); + spec.note_head_drul_[d] = Tie::head (tie, d); + spec.column_ranks_[d] = Tie::get_column_rank (tie, d); } specifications_.push_back (spec); } @@ -379,8 +382,9 @@ Tie_formatting_problem::from_semi_ties (vector const &semi_ties, Directi int column_rank = -1; for (vsize i = 0; i < semi_ties.size (); i++) { + Item *semi_tie = dynamic_cast (semi_ties[i]); Tie_specification spec; - Item *head = Item::unsmob (semi_ties[i]->get_object ("note-head")); + Item *head = Semi_tie::head (semi_tie); if (!head) programming_error ("LV tie without head?!"); @@ -390,10 +394,10 @@ Tie_formatting_problem::from_semi_ties (vector const &semi_ties, Directi spec.position_ = int (Staff_symbol_referencer::get_position (head)); } - spec.from_grob (semi_ties[i]); + spec.from_grob (semi_tie); spec.note_head_drul_[head_dir] = head; - column_rank = Tie::get_column_rank (semi_ties[i], head_dir); + column_rank = Semi_tie::get_column_rank (semi_tie); spec.column_ranks_ = Drul_array (column_rank, column_rank); heads.push_back (head); specifications_.push_back (spec); @@ -655,7 +659,7 @@ Tie_formatting_problem::score_aptitude (Tie_configuration *conf, if (!spec.note_head_drul_[d]) continue; - Grob *stem = Grob::unsmob (spec.note_head_drul_[d]->get_object ("stem")); + Grob *stem = unsmob (spec.note_head_drul_[d]->get_object ("stem")); if (stem && Stem::is_normal_stem (stem)) stems[d] = stem;