+#include "translator.icc"
+
+class Beam_engraver : public Engraver
+{
+public:
+ DECLARE_ACKNOWLEDGER (stem);
+ DECLARE_ACKNOWLEDGER (rest);
+
+protected:
+ Stream_event *start_ev_;
+
+ Spanner *finished_beam_;
+ Spanner *beam_;
+ Stream_event *prev_start_ev_;
+
+ Stream_event *stop_ev_;
+
+ Beaming_pattern *beam_info_;
+ Beaming_pattern *finished_beam_info_;
+
+ /// location within measure where beam started.
+ Moment beam_start_location_;
+
+ /// moment (global time) where beam started.
+ Moment beam_start_mom_;
+
+ Beaming_options beaming_options_;
+ Beaming_options finished_beaming_options_;
+
+ void typeset_beam ();
+ void set_melisma (bool);
+
+ Moment last_stem_added_at_;
+ void stop_translation_timestep ();
+ void start_translation_timestep ();
+ virtual void finalize ();
+
+ void process_music ();
+
+ virtual bool valid_start_point ();
+ virtual bool valid_end_point ();
+
+ DECLARE_TRANSLATOR_LISTENER (beam);
+public:
+ TRANSLATOR_DECLARATIONS (Beam_engraver);
+};
+
+/*
+ Hmm. this isn't necessary, since grace beams and normal beams are
+ always nested.
+*/
+bool
+Beam_engraver::valid_start_point ()