X-Git-Url: https://git.donarmstrong.com/?a=blobdiff_plain;f=lily%2Frhythmic-head.cc;h=f771c75edc910e727b5d44eaa220d0608b3caaff;hb=4c6280c2ba6b0485aae7da731def216c2524bd0b;hp=72807c77cc5f950d11d59896b137408e4fd249af;hpb=7d2ec0f1c47d211f243cf5646b35ef5298d8c82a;p=lilypond.git diff --git a/lily/rhythmic-head.cc b/lily/rhythmic-head.cc index 72807c77cc..f771c75edc 100644 --- a/lily/rhythmic-head.cc +++ b/lily/rhythmic-head.cc @@ -3,68 +3,59 @@ source file of the GNU LilyPond music typesetter - (c) 1997--1999 Han-Wen Nienhuys + (c) 1997--2006 Han-Wen Nienhuys */ #include "rhythmic-head.hh" -#include "debug.hh" -#include "molecule.hh" -#include "paper-def.hh" -#include "lookup.hh" + +#include "warn.hh" #include "rest.hh" -#include "dots.hh" -#include "axis-group-element.hh" -#include "paper-score.hh" #include "stem.hh" #include "staff-symbol-referencer.hh" +#include "item.hh" +Item * +Rhythmic_head::get_dots (Grob *me) +{ + SCM s = me->get_object ("dot"); + return unsmob_item (s); +} -Dots* -Rhythmic_head::dots_l () const +Item * +Rhythmic_head::get_stem (Grob *me) { - SCM s = get_elt_property ("dot"); - return dynamic_cast (unsmob_element (s)); + SCM s = me->get_object ("stem"); + return unsmob_item (s); } int -Rhythmic_head::balltype_i () const +Rhythmic_head::dot_count (Grob *me) { - SCM s = get_elt_property ("duration-log"); - - return gh_number_p (s) ? gh_scm2int (s) : 0; + return get_dots (me) + ? scm_to_int (get_dots (me)->get_property ("dot-count")) : 0; } -Stem* -Rhythmic_head::stem_l () const +void +Rhythmic_head::set_dots (Grob *me, Item *dot) { - SCM s = get_elt_property ("stem"); - return dynamic_cast (unsmob_element (s)); + me->set_object ("dot", dot->self_scm ()); } int -Rhythmic_head::dot_count () const -{ - return dots_l () - ? gh_scm2int (dots_l ()->get_elt_property ("dot-count")) : 0; -} - -void -Rhythmic_head::do_post_processing () +Rhythmic_head::duration_log (Grob *me) { - if (Dots *d = dots_l ()) - { - Staff_symbol_referencer_interface si (d); - Staff_symbol_referencer_interface me (d); - si.set_position(int (me.position_f ())); - } + SCM s = me->get_property ("duration-log"); + return scm_is_number (s) ? scm_to_int (s) : 0; } +ADD_INTERFACE (Rhythmic_head, -void -Rhythmic_head::add_dots (Dots *dot_l) -{ - set_elt_property ("dot", dot_l->self_scm_); - dot_l->add_dependency (this); -} + "rhythmic-head-interface", + "Note head or rest", + + "dot " + "duration-log " + "stem " + );