2 note-head-line-engraver.cc -- implement Note_head_line_engraver
4 source file of the GNU LilyPond music typesetter
6 (c) 2000--2007 Jan Nieuwenhuizen <janneke@gnu.org>
11 #include "international.hh"
12 #include "rhythmic-head.hh"
14 #include "stream-event.hh"
18 #include "translator.icc"
21 Create line-spanner grobs for glissandi lines that connect note
24 class Glissando_engraver : public Engraver
27 TRANSLATOR_DECLARATIONS (Glissando_engraver);
30 DECLARE_TRANSLATOR_LISTENER (glissando);
31 DECLARE_ACKNOWLEDGER (rhythmic_head);
32 virtual void finalize ();
34 void stop_translation_timestep ();
35 void process_music ();
42 Glissando_engraver::Glissando_engraver ()
44 last_line_ = line_ = 0;
48 IMPLEMENT_TRANSLATOR_LISTENER (Glissando_engraver, glissando);
50 Glissando_engraver::listen_glissando (Stream_event *ev)
52 ASSIGN_EVENT_ONCE (event_, ev);
56 Glissando_engraver::process_music ()
59 line_ = make_spanner ("Glissando", event_->self_scm ());
63 Glissando_engraver::acknowledge_rhythmic_head (Grob_info info)
65 Grob *g = info.grob ();
67 line_->set_bound (LEFT, g);
71 last_line_->set_bound (RIGHT, g);
72 announce_end_grob (last_line_, g->self_scm ());
77 Glissando_engraver::stop_translation_timestep ()
79 if (last_line_ && last_line_->get_bound (RIGHT))
86 programming_error ("overwriting glissando");
94 Glissando_engraver::finalize ()
98 string msg = _ ("unterminated glissando");
101 event_->origin ()->warning (msg);
110 ADD_ACKNOWLEDGER (Glissando_engraver, rhythmic_head);
111 ADD_TRANSLATOR (Glissando_engraver,
112 /* doc */ "Engrave a glissandi",
113 /* create */ "Glissando",
114 /* read */ "followVoice",