2 note-head-line-engraver.cc -- implement Note_head_line_engraver
4 source file of the GNU LilyPond music typesetter
6 (c) 2000--2008 Jan Nieuwenhuizen <janneke@gnu.org>
11 #include "international.hh"
12 #include "rhythmic-head.hh"
14 #include "stream-event.hh"
18 #include "translator.icc"
20 class Glissando_engraver
: public Engraver
23 TRANSLATOR_DECLARATIONS (Glissando_engraver
);
26 DECLARE_TRANSLATOR_LISTENER (glissando
);
27 DECLARE_ACKNOWLEDGER (rhythmic_head
);
28 virtual void finalize ();
30 void stop_translation_timestep ();
31 void process_music ();
38 Glissando_engraver::Glissando_engraver ()
40 last_line_
= line_
= 0;
44 IMPLEMENT_TRANSLATOR_LISTENER (Glissando_engraver
, glissando
);
46 Glissando_engraver::listen_glissando (Stream_event
*ev
)
48 ASSIGN_EVENT_ONCE (event_
, ev
);
52 Glissando_engraver::process_music ()
55 line_
= make_spanner ("Glissando", event_
->self_scm ());
59 Glissando_engraver::acknowledge_rhythmic_head (Grob_info info
)
61 Grob
*g
= info
.grob ();
63 line_
->set_bound (LEFT
, g
);
67 last_line_
->set_bound (RIGHT
, g
);
68 announce_end_grob (last_line_
, g
->self_scm ());
73 Glissando_engraver::stop_translation_timestep ()
75 if (last_line_
&& last_line_
->get_bound (RIGHT
))
82 programming_error ("overwriting glissando");
90 Glissando_engraver::finalize ()
94 string msg
= _ ("unterminated glissando");
97 event_
->origin ()->warning (msg
);
106 ADD_ACKNOWLEDGER (Glissando_engraver
, rhythmic_head
);
107 ADD_TRANSLATOR (Glissando_engraver
,
109 "Engrave glissandi.",