X-Git-Url: https://git.donarmstrong.com/?a=blobdiff_plain;f=lily%2Fottava-engraver.cc;h=fd59b33b8e83a7e158d1420ff149342c58fad534;hb=1dbfe58548c0dbea3a09c94eb03113aaaaa73c75;hp=556a34903b44e6a0cb196badc57a723a42cbdaf5;hpb=db2d03691f2b1114b1b822c3ed0aa6f803045815;p=lilypond.git diff --git a/lily/ottava-engraver.cc b/lily/ottava-engraver.cc index 556a34903b..fd59b33b8e 100644 --- a/lily/ottava-engraver.cc +++ b/lily/ottava-engraver.cc @@ -1,17 +1,30 @@ /* - ottova-engraver.cc -- implement Ottava_spanner_engraver + This file is part of LilyPond, the GNU music typesetter. - source file of the GNU LilyPond music typesetter + Copyright (C) 2000--2011 Han-Wen Nienhuys - (c) 2000--2006 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 + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + LilyPond is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with LilyPond. If not, see . */ -#include "protected-scm.hh" +#include "engraver.hh" +#include "item.hh" #include "note-column.hh" +#include "protected-scm.hh" #include "side-position-interface.hh" -#include "engraver.hh" #include "spanner.hh" -#include "item.hh" +#include "text-interface.hh" + class Ottava_spanner_engraver : public Engraver { @@ -55,14 +68,13 @@ Ottava_spanner_engraver::process_music () { finished_ = span_; span_ = 0; - if (scm_is_string (ott)) + if (Text_interface::is_markup (ott)) { span_ = make_spanner ("OttavaBracket", SCM_EOL); span_->set_property ("text", ott); - SCM c0 (get_property ("middleCPosition")); - SCM oc0 (get_property ("originalCentralCPosition")); - if (scm_less_p (oc0, c0) == SCM_BOOL_T) + SCM offset (get_property ("middleCOffset")); + if (robust_scm2double (offset, 0) > 0) span_->set_property ("direction", scm_from_int (DOWN)); } } @@ -130,7 +142,17 @@ Ottava_spanner_engraver::finalize () ADD_ACKNOWLEDGER (Ottava_spanner_engraver, note_column); ADD_TRANSLATOR (Ottava_spanner_engraver, - /* doc */ "Create a text spanner when the ottavation property changes..", - /* create */ "OttavaBracket", - /* read */ "ottavation", - /* write */ ""); + /* doc */ + "Create a text spanner when the ottavation property changes.", + + /* create */ + "OttavaBracket ", + + /* read */ + "middleCOffset " + "ottavation " + "currentMusicalColumn ", + + /* write */ + "" + );