X-Git-Url: https://git.donarmstrong.com/?a=blobdiff_plain;f=lily%2Frest-collision.cc;h=f5be97061c97cfda84d0da7690e0965a5fe141b3;hb=42c6cca28cdfb8f06e65429e28deb198df915e16;hp=2dd7aa890b6219a6530fe4ca384875664a88455c;hpb=ad7defd5f5a3d0151a711555c2d680c56ef559c7;p=lilypond.git diff --git a/lily/rest-collision.cc b/lily/rest-collision.cc index 2dd7aa890b..f5be97061c 100644 --- a/lily/rest-collision.cc +++ b/lily/rest-collision.cc @@ -24,7 +24,7 @@ void Rest_collision::add_column (Note_column *nc_l) { add_dependency (nc_l); - Group_interface gi (this); + Pointer_group_interface gi (this); if (nc_l->rest_b ()) gi.name_ = "rests"; else @@ -48,10 +48,13 @@ rhythmic_head2mom (Rhythmic_head* r) return to_duration (r->balltype_i (), r->dot_count ()).length_mom (); } +/* + ugh + */ static Rhythmic_head* col2rhythmic_head (Note_column* c) { - SCM s = c->get_elt_property ("rests"); + SCM s = c->get_elt_pointer ("rests"); assert (gh_pair_p (s)); Score_element* e = unsmob_element (gh_car (s)); return dynamic_cast (e); @@ -61,9 +64,9 @@ void Rest_collision::before_line_breaking () { Link_array rest_l_arr = - Group_interface__extract_elements (this, (Note_column*) 0, "rests"); + Pointer_group_interface__extract_elements (this, (Note_column*) 0, "rests"); Link_array ncol_l_arr = - Group_interface__extract_elements (this, (Note_column*) 0, "notes"); + Pointer_group_interface__extract_elements (this, (Note_column*) 0, "notes"); /* @@ -86,14 +89,6 @@ Rest_collision::before_line_breaking () // meisjes met meisjes if (!ncol_l_arr.size()) { - - /* - Oeps, nu zie ik 't pas: colommen met noten. - Het commentaar, dat ik ooit geschreven had: meisjes met meisjes, - is achterhaald: urg. - - */ - Moment m = rhythmic_head2mom (col2rhythmic_head (rest_l_arr[0])); int i = 1; for (; i < rest_l_arr.size (); i++) @@ -112,20 +107,12 @@ Rest_collision::before_line_breaking () int display_count; SCM s = get_elt_property ("maximum-rest-count"); if (i == rest_l_arr.size () - && gh_number_p (s) && gh_int2scm (s) < rest_l_arr.size ()) + && gh_number_p (s) && gh_scm2int (s) < rest_l_arr.size ()) { - display_count = gh_int2scm (s); -#if 0 - /* - Setting surplus rests to transparent. - Only really necessary for maximum-rest-count == 0, - because rests wil be set at exact the same position - and thus overlap. - */ - for (i--;i > display_count; i--) + display_count = gh_scm2int (s); + for (; i > display_count; i--) col2rhythmic_head (rest_l_arr[i-1]) - ->set_elt_property ("transparent", SCM_BOOL_T); -#endif + ->set_elt_property ("molecule-callback", SCM_BOOL_T); } else display_count = rest_l_arr.size (); @@ -204,12 +191,12 @@ Rest_collision::before_line_breaking () } -Rest_collision::Rest_collision() +Rest_collision::Rest_collision(SCM s) + : Item (s) { - set_elt_property ("rests", SCM_EOL); - set_elt_property ("notes", SCM_EOL); - set_elt_property ("transparent", SCM_BOOL_T); - set_empty (X_AXIS); - set_empty (Y_AXIS); + set_elt_pointer ("rests", SCM_EOL); + set_elt_pointer ("notes", SCM_EOL); + set_extent_callback (0, X_AXIS); + set_extent_callback (0, Y_AXIS); }