2 This file is part of LilyPond, the GNU music typesetter.
4 Copyright (C) 2000--2011 Jan Nieuwenhuizen <janneke@gnu.org>
6 LilyPond is free software: you can redistribute it and/or modify
7 it under the terms of the GNU General Public License as published by
8 the Free Software Foundation, either version 3 of the License, or
9 (at your option) any later version.
11 LilyPond is distributed in the hope that it will be useful,
12 but WITHOUT ANY WARRANTY; without even the implied warranty of
13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 GNU General Public License for more details.
16 You should have received a copy of the GNU General Public License
17 along with LilyPond. If not, see <http://www.gnu.org/licenses/>.
20 #include "engraver.hh"
22 #include "international.hh"
23 #include "rhythmic-head.hh"
25 #include "stream-event.hh"
29 #include "translator.icc"
31 class Glissando_engraver
: public Engraver
34 TRANSLATOR_DECLARATIONS (Glissando_engraver
);
37 DECLARE_TRANSLATOR_LISTENER (glissando
);
38 DECLARE_ACKNOWLEDGER (rhythmic_head
);
39 virtual void finalize ();
41 void stop_translation_timestep ();
42 void process_music ();
49 Glissando_engraver::Glissando_engraver ()
51 last_line_
= line_
= 0;
55 IMPLEMENT_TRANSLATOR_LISTENER (Glissando_engraver
, glissando
);
57 Glissando_engraver::listen_glissando (Stream_event
*ev
)
59 ASSIGN_EVENT_ONCE (event_
, ev
);
63 Glissando_engraver::process_music ()
66 line_
= make_spanner ("Glissando", event_
->self_scm ());
70 Glissando_engraver::acknowledge_rhythmic_head (Grob_info info
)
72 Grob
*g
= info
.grob ();
74 line_
->set_bound (LEFT
, g
);
78 last_line_
->set_bound (RIGHT
, g
);
79 announce_end_grob (last_line_
, g
->self_scm ());
84 Glissando_engraver::stop_translation_timestep ()
86 if (last_line_
&& last_line_
->get_bound (RIGHT
))
93 programming_error ("overwriting glissando");
101 Glissando_engraver::finalize ()
105 string msg
= _ ("unterminated glissando");
108 event_
->origin ()->warning (msg
);
117 ADD_ACKNOWLEDGER (Glissando_engraver
, rhythmic_head
);
118 ADD_TRANSLATOR (Glissando_engraver
,
120 "Engrave glissandi.",