source file of the GNU LilyPond music typesetter
- (c) 2000--2006 Jan Nieuwenhuizen <janneke@gnu.org>
+ (c) 2000--2009 Jan Nieuwenhuizen <janneke@gnu.org>
*/
#include "engraver.hh"
+
#include "international.hh"
#include "rhythmic-head.hh"
#include "spanner.hh"
+#include "stream-event.hh"
#include "warn.hh"
+#include "item.hh"
+
+#include "translator.icc"
-/**
- Create line-spanner grobs for glissandi lines that connect note
- heads.
-*/
class Glissando_engraver : public Engraver
{
public:
TRANSLATOR_DECLARATIONS (Glissando_engraver);
protected:
+ DECLARE_TRANSLATOR_LISTENER (glissando);
DECLARE_ACKNOWLEDGER (rhythmic_head);
virtual void finalize ();
- virtual bool try_music (Music *);
void stop_translation_timestep ();
void process_music ();
private:
Spanner *line_;
Spanner *last_line_;
- Music *event_;
+ Stream_event *event_;
};
Glissando_engraver::Glissando_engraver ()
event_ = 0;
}
-bool
-Glissando_engraver::try_music (Music *m)
+IMPLEMENT_TRANSLATOR_LISTENER (Glissando_engraver, glissando);
+void
+Glissando_engraver::listen_glissando (Stream_event *ev)
{
- if (!event_)
- {
- event_ = m;
- return true;
- }
- return false;
+ ASSIGN_EVENT_ONCE (event_, ev);
}
void
line_->set_bound (LEFT, g);
if (last_line_)
- last_line_->set_bound (RIGHT, g);
+ {
+ last_line_->set_bound (RIGHT, g);
+ announce_end_grob (last_line_, g->self_scm ());
+ }
}
void
Glissando_engraver::stop_translation_timestep ()
{
if (last_line_ && last_line_->get_bound (RIGHT))
- last_line_ = 0;
+ {
+ last_line_ = 0;
+ }
if (line_)
{
if (last_line_)
}
}
-#include "translator.icc"
-
ADD_ACKNOWLEDGER (Glissando_engraver, rhythmic_head);
ADD_TRANSLATOR (Glissando_engraver,
- /* doc */ "Engrave a glissandi",
- /* create */ "Glissando",
- /* accept */ "glissando-event",
- /* read */ "followVoice",
- /* write */ "");
+ /* doc */
+ "Engrave glissandi.",
+
+ /* create */
+ "Glissando ",
+
+ /* read */
+ "",
+
+ /* write */
+ ""
+ );