X-Git-Url: https://git.donarmstrong.com/?a=blobdiff_plain;f=lily%2Fcompletion-note-heads-engraver.cc;h=f590d2a40f014fabadebbae1afd7b818740c62e6;hb=958e95822083954cad00e0a598eb9f12ceba67b9;hp=bddca70abbd3faa3175969eaa769363e067c6ec5;hpb=8848da24e00c75d7de626b2ecc409fb45e87ce4a;p=lilypond.git diff --git a/lily/completion-note-heads-engraver.cc b/lily/completion-note-heads-engraver.cc index bddca70abb..f590d2a40f 100644 --- a/lily/completion-note-heads-engraver.cc +++ b/lily/completion-note-heads-engraver.cc @@ -1,7 +1,7 @@ /* This file is part of LilyPond, the GNU music typesetter. - Copyright (C) 1997--2012 Han-Wen Nienhuys + Copyright (C) 1997--2015 Han-Wen Nienhuys LilyPond is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -109,15 +109,21 @@ Completion_heads_engraver::listen_note (Stream_event *ev) Moment Completion_heads_engraver::next_moment (Rational const ¬e_len) { - Moment *e = unsmob_moment (get_property ("measurePosition")); - Moment *l = unsmob_moment (get_property ("measureLength")); + Moment *e = unsmob (get_property ("measurePosition")); + Moment *l = unsmob (get_property ("measureLength")); if (!e || !l || !to_boolean (get_property ("timing"))) { return Moment (0, 0); } Moment result = *l - *e; - Moment const *unit = unsmob_moment (get_property ("completionUnit")); + if (result < 0) + { + programming_error ("invalid measure position: " + + e->to_string () + " of " + l->to_string ()); + return 0; + } + Moment const *unit = unsmob (get_property ("completionUnit")); if (unit) { @@ -156,7 +162,7 @@ Item * Completion_heads_engraver::make_note_head (Stream_event *ev) { Item *note = make_item ("NoteHead", ev->self_scm ()); - Pitch *pit = unsmob_pitch (ev->get_property ("pitch")); + Pitch *pit = unsmob (ev->get_property ("pitch")); int pos = pit->steps (); SCM c0 = get_property ("middleCPosition"); @@ -192,7 +198,7 @@ Completion_heads_engraver::process_music () } else { - orig = unsmob_duration (note_events_[0]->get_property ("duration")); + orig = unsmob (note_events_[0]->get_property ("duration")); note_dur = *orig; SCM factor = get_property ("completionFactor"); if (ly_is_procedure (factor))