From: Han-Wen Nienhuys Date: Tue, 7 Nov 2006 01:32:04 +0000 (+0000) Subject: also barf if file doesn't exist. X-Git-Tag: release/2.10.0-2~26^2~2 X-Git-Url: https://git.donarmstrong.com/?a=commitdiff_plain;h=0cea316d3d14c6f11ea79139574ce848cb5c46f3;p=lilypond.git also barf if file doesn't exist. use Rhythmic_head::duration_log() iso. Note_head::get_balltype(). trim note-head.cc includes. --- diff --git a/ChangeLog b/ChangeLog index 46043f6532..c4407c4a61 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,19 @@ +2006-11-06 Han-Wen Nienhuys + + * lily/note-head.cc: + trim note-head.cc includes. + + * lily/easy-notation.cc: + * lily/mensural-ligature-engraver.cc: + * lily/note-collision.cc: + * lily/note-head.cc: + * scm/define-grobs.scm: + * scm/output-lib.scm: + use Rhythmic_head::duration_log() iso. Note_head::get_balltype(). + + * buildscripts/git-update-changelog.py: + also barf if file doesn't exist. + 2006-11-07 Erlend Aasland * scm/music-function.scm (add-ballon-text): add FIXME comment. diff --git a/buildscripts/git-update-changelog.py b/buildscripts/git-update-changelog.py index 35dd2e6c75..e3bc06384f 100644 --- a/buildscripts/git-update-changelog.py +++ b/buildscripts/git-update-changelog.py @@ -53,6 +53,9 @@ class Commit: if removals == []: return True + + if not os.path.exists (filename): + return False contents = open (filename).read () for r in removals: 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..ecf59808f3 100644 --- a/lily/note-head.cc +++ b/lily/note-head.cc @@ -11,19 +11,12 @@ #include #include #include // min, max + using namespace std; #include "directional-element-interface.hh" -#include "dots.hh" #include "font-interface.hh" #include "international.hh" -#include "lookup.hh" -#include "misc.hh" -#include "music.hh" -#include "output-def.hh" -#include "rhythmic-head.hh" -#include "staff-symbol-referencer.hh" -#include "staff-symbol.hh" #include "warn.hh" static Stencil @@ -147,12 +140,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)))