From: Han-Wen Nienhuys Date: Mon, 6 Nov 2006 12:08:28 +0000 (+0100) Subject: use Rhythmic_head::duration_log() iso. Note_head::get_balltype(). X-Git-Tag: release/2.10.0-2~32^2~7 X-Git-Url: https://git.donarmstrong.com/?a=commitdiff_plain;h=6fbc6946de3cdd61f05505acd165e635d98fce9e;p=lilypond.git use Rhythmic_head::duration_log() iso. Note_head::get_balltype(). --- diff --git a/lily/easy-notation.cc b/lily/easy-notation.cc index 6ddc00e1d3..2fb0d72234 100644 --- a/lily/easy-notation.cc +++ b/lily/easy-notation.cc @@ -20,6 +20,7 @@ using namespace std; #include "stem.hh" #include "stream-event.hh" #include "text-interface.hh" +#include "rhythmic-head.hh" /* @@ -31,7 +32,7 @@ SCM Note_head::brew_ez_stencil (SCM smob) { Grob *me = unsmob_grob (smob); - int log = Note_head::get_balltype (me); + int log = Rhythmic_head::duration_log (me); SCM cause = me->get_property ("cause"); SCM spitch = unsmob_stream_event (cause)->get_property ("pitch"); diff --git a/lily/mensural-ligature-engraver.cc b/lily/mensural-ligature-engraver.cc index 45466c10c4..a6a48a8f18 100644 --- a/lily/mensural-ligature-engraver.cc +++ b/lily/mensural-ligature-engraver.cc @@ -99,7 +99,7 @@ Mensural_ligature_engraver::transform_heads (vector primitives) { Grob_info info = primitives[i]; Item *primitive = dynamic_cast (info.grob ()); - int duration_log = Note_head::get_balltype (primitive); + int duration_log = Rhythmic_head::duration_log (primitive); Stream_event *nr = info.event_cause (); diff --git a/lily/note-collision.cc b/lily/note-collision.cc index 7bcfa464ce..bce6d08a60 100644 --- a/lily/note-collision.cc +++ b/lily/note-collision.cc @@ -58,8 +58,8 @@ check_meshing_chords (Grob *me, nd->get_property ("style"))) merge_possible = false; - int upball_type = Note_head::get_balltype (nu); - int dnball_type = Note_head::get_balltype (nd); + int upball_type = Rhythmic_head::duration_log (nu); + int dnball_type = Rhythmic_head::duration_log (nd); /* Do not merge whole notes (or longer, like breve, longa, maxima). */ if (merge_possible && (upball_type <= 0 || dnball_type <= 0)) diff --git a/lily/note-head.cc b/lily/note-head.cc index cb89b5ae17..15624f9179 100644 --- a/lily/note-head.cc +++ b/lily/note-head.cc @@ -147,12 +147,6 @@ Note_head::calc_stem_attachment (SCM smob) return ly_offset2scm (get_stem_attachment (fm, key)); } -int -Note_head::get_balltype (Grob *me) -{ - SCM s = me->get_property ("duration-log"); - return scm_is_number (s) ? min (int (scm_to_int (s)), 2) : 0; -} ADD_INTERFACE (Note_head, "note-head-interface", "Note head", diff --git a/scm/define-grobs.scm b/scm/define-grobs.scm index 3c1988c9c8..920aaafbf6 100644 --- a/scm/define-grobs.scm +++ b/scm/define-grobs.scm @@ -1500,7 +1500,7 @@ (Stem . ( (direction . ,ly:stem::calc-direction) - (duration-log . ,note-head::calc-duration-log) + (duration-log . ,stem::calc-duration-log) (default-direction . ,ly:stem::calc-default-direction) (stem-end-position . ,ly:stem::calc-stem-end-position) diff --git a/scm/output-lib.scm b/scm/output-lib.scm index d918290d21..2978f3b198 100644 --- a/scm/output-lib.scm +++ b/scm/output-lib.scm @@ -99,10 +99,16 @@ ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; note heads -(define-public (note-head::calc-duration-log grob) + +(define-public (stem::calc-duration-log grob) (ly:duration-log (ly:event-property (event-cause grob) 'duration))) +(define-public (note-head::calc-duration-log grob) + (min 2 + (ly:duration-log + (ly:event-property (event-cause grob) 'duration)))) + (define-public (dots::calc-dot-count grob) (ly:duration-dot-count (ly:event-property (event-cause grob) 'duration)))