X-Git-Url: https://git.donarmstrong.com/?a=blobdiff_plain;f=lily%2Fglissando-engraver.cc;h=4bb180ef167e3da13f9cf0b80e203998760fbb6e;hb=75eebcb49e52d296b1da3e1074e0825d2c780db4;hp=34a0f07ae8466a111e29248262eaef3f86b34ea1;hpb=243db47a88df9240a66bde37356b43aaeb41260d;p=lilypond.git diff --git a/lily/glissando-engraver.cc b/lily/glissando-engraver.cc index 34a0f07ae8..4bb180ef16 100644 --- a/lily/glissando-engraver.cc +++ b/lily/glissando-engraver.cc @@ -1,13 +1,12 @@ -/* +/* note-head-line-engraver.cc -- implement Note_head_line_engraver - + source file of the GNU LilyPond music typesetter - - (c) 2000--2003 Jan Nieuwenhuizen - */ + + (c) 2000--2006 Jan Nieuwenhuizen +*/ #include "warn.hh" -#include "event.hh" #include "spanner.hh" #include "rhythmic-head.hh" #include "engraver.hh" @@ -19,18 +18,18 @@ class Glissando_engraver : public Engraver { public: - TRANSLATOR_DECLARATIONS(Glissando_engraver); + TRANSLATOR_DECLARATIONS (Glissando_engraver); protected: - virtual void acknowledge_grob (Grob_info); + DECLARE_ACKNOWLEDGER (rhythmic_head); virtual void finalize (); - virtual void stop_translation_timestep (); + void stop_translation_timestep (); virtual bool try_music (Music *); - virtual void process_music (); + void process_music (); private: - Spanner *line_; - Spanner *last_line_; - Music* event_; + Spanner *line_; + Spanner *last_line_; + Music *event_; }; Glissando_engraver::Glissando_engraver () @@ -40,7 +39,7 @@ Glissando_engraver::Glissando_engraver () } bool -Glissando_engraver::try_music (Music* m) +Glissando_engraver::try_music (Music *m) { if (!event_) { @@ -54,40 +53,29 @@ void Glissando_engraver::process_music () { if (event_) - { - line_ = make_spanner ("Glissando"); - announce_grob (line_, event_->self_scm ()); - } + line_ = make_spanner ("Glissando", event_->self_scm ()); } - void -Glissando_engraver::acknowledge_grob (Grob_info info) +Glissando_engraver::acknowledge_rhythmic_head (Grob_info info) { - if (Rhythmic_head::has_interface (info.grob_)) - { - Grob * g = info.grob_; - if (line_) - line_->set_bound (LEFT, g); + Grob *g = info.grob (); + if (line_) + line_->set_bound (LEFT, g); - if (last_line_) - last_line_->set_bound (RIGHT, g); - } + if (last_line_) + last_line_->set_bound (RIGHT, g); } - void Glissando_engraver::stop_translation_timestep () { if (last_line_ && last_line_->get_bound (RIGHT)) - { - typeset_grob (last_line_); - last_line_ =0; - } + last_line_ = 0; if (line_) { - if ( last_line_) - programming_error ("Overwriting glissando."); + if (last_line_) + programming_error ("overwriting glissando"); last_line_ = line_; } line_ = 0; @@ -99,24 +87,24 @@ Glissando_engraver::finalize () { if (line_) { - String msg = _("Unterminated glissando."); - + String msg = _ ("unterminated glissando"); + if (event_) event_->origin ()->warning (msg); else warning (msg); - + line_->suicide (); - line_ =0; + line_ = 0; } } +#include "translator.icc" - -ENTER_DESCRIPTION(Glissando_engraver, -/* descr */ "Engrave a glissandi", -/* creats*/ "Glissando", -/* accepts */ "glissando-event", -/* acks */ "rhythmic-head-interface", -/* reads */ "followVoice", -/* write */ ""); +ADD_ACKNOWLEDGER (Glissando_engraver, rhythmic_head); +ADD_TRANSLATOR (Glissando_engraver, + /* doc */ "Engrave a glissandi", + /* create */ "Glissando", + /* accept */ "glissando-event", + /* read */ "followVoice", + /* write */ "");