2 note-head-line-engraver.cc -- implement Note_head_line_engraver
4 source file of the GNU LilyPond music typesetter
6 (c) 2000--2003 Jan Nieuwenhuizen <janneke@gnu.org>
12 #include "rhythmic-head.hh"
13 #include "engraver.hh"
16 Create line-spanner grobs for glissandi lines that connect note
19 class Glissando_engraver
: public Engraver
22 TRANSLATOR_DECLARATIONS(Glissando_engraver
);
25 virtual void acknowledge_grob (Grob_info
);
26 virtual void finalize ();
27 virtual void stop_translation_timestep ();
28 virtual bool try_music (Music
*);
29 virtual void process_music ();
36 Glissando_engraver::Glissando_engraver ()
38 last_line_
= line_
= 0;
43 Glissando_engraver::try_music (Music
* m
)
54 Glissando_engraver::process_music ()
58 line_
= new Spanner (get_property ("Glissando"));
59 announce_grob (line_
, event_
->self_scm ());
65 Glissando_engraver::acknowledge_grob (Grob_info info
)
67 if (Rhythmic_head::has_interface (info
.grob_
))
69 Grob
* g
= info
.grob_
;
71 line_
->set_bound (LEFT
, g
);
74 last_line_
->set_bound (RIGHT
, g
);
80 Glissando_engraver::stop_translation_timestep ()
82 if (last_line_
&& last_line_
->get_bound (RIGHT
))
84 typeset_grob (last_line_
);
90 programming_error ("Overwriting glissando.");
98 Glissando_engraver::finalize ()
102 String msg
= _("Unterminated glissando.");
105 event_
->origin ()->warning (msg
);
116 ENTER_DESCRIPTION(Glissando_engraver
,
117 /* descr */ "Engrave a glissandi",
118 /* creats*/ "Glissando",
119 /* accepts */ "glissando-event",
120 /* acks */ "rhythmic-head-interface",
121 /* reads */ "followVoice",