X-Git-Url: https://git.donarmstrong.com/?a=blobdiff_plain;f=lily%2Fottava-engraver.cc;h=c1afcfed3c7dee3588a244a62e469530e05da739;hb=b8514b0fc731eb5a53b83d23cbb175e294c38bee;hp=1975eb0ca7ae469bc40c2734647b78224e3254a9;hpb=58bcc84c9480dae1b21bc24d8396b91fe19e0131;p=lilypond.git diff --git a/lily/ottava-engraver.cc b/lily/ottava-engraver.cc index 1975eb0ca7..c1afcfed3c 100644 --- a/lily/ottava-engraver.cc +++ b/lily/ottava-engraver.cc @@ -1,15 +1,17 @@ /* - text-spanner-engraver.cc -- implement Ottava_spanner_engraver + ottova-engraver.cc -- implement Ottava_spanner_engraver source file of the GNU LilyPond music typesetter - (c) 2000--2005 Han-Wen Nienhuys + (c) 2000--2007 Han-Wen Nienhuys */ #include "protected-scm.hh" #include "note-column.hh" #include "side-position-interface.hh" #include "engraver.hh" +#include "spanner.hh" +#include "item.hh" class Ottava_spanner_engraver : public Engraver { @@ -17,9 +19,11 @@ public: TRANSLATOR_DECLARATIONS (Ottava_spanner_engraver); protected: virtual void finalize (); - virtual void acknowledge_grob (Grob_info); - virtual void process_music (); - virtual void stop_translation_timestep (); + + DECLARE_ACKNOWLEDGER (note_column); + + void process_music (); + void stop_translation_timestep (); virtual void derived_mark () const; private: Spanner *span_; @@ -57,19 +61,19 @@ Ottava_spanner_engraver::process_music () span_->set_property ("text", ott); SCM c0 (get_property ("middleCPosition")); - SCM oc0 (get_property ("originalCentralCPosition")); + SCM oc0 (get_property ("originalMiddleCPosition")); if (scm_less_p (oc0, c0) == SCM_BOOL_T) - span_->set_property ("direction", scm_int2num (DOWN)); + span_->set_property ("direction", scm_from_int (DOWN)); } } last_ottavation_ = ott; } void -Ottava_spanner_engraver::acknowledge_grob (Grob_info info) +Ottava_spanner_engraver::acknowledge_note_column (Grob_info info) { - Item *it = dynamic_cast (info.grob_); - if (span_ && it && Note_column::has_interface (info.grob_)) + Item *it = info.item (); + if (span_ && it) { Side_position_interface::add_support (span_, it); @@ -121,10 +125,17 @@ Ottava_spanner_engraver::finalize () last_ottavation_ = SCM_EOL; } +#include "translator.icc" + +ADD_ACKNOWLEDGER (Ottava_spanner_engraver, note_column); + ADD_TRANSLATOR (Ottava_spanner_engraver, - /* descr */ "Create a text spanner when the ottavation property changes..", - /* creats*/ "OttavaBracket", - /* accepts */ "", - /* acks */ "note-column-interface", - /* reads */ "ottavation", + /* doc */ "Create a text spanner when the ottavation property changes..", + /* create */ "OttavaBracket", + /* read */ "ottavation " + "originalMiddleCPosition " + "currentMusicalColumn " + + , + /* write */ "");