+/*
+ TODO: detect the top staff (stavesFound), and acknowledge staff-group
+ system-start-delims. If we find these, and the top staff is in the
+ staff-group, add padding to the bar number.
+*/
+class Bar_number_engraver : public Engraver
+{
+protected:
+ Item *text_;
+protected:
+ void stop_translation_timestep ();
+ DECLARE_ACKNOWLEDGER (break_aligned);
+ DECLARE_ACKNOWLEDGER (break_alignment);
+ void process_music ();
+ void create_items ();
+ TRANSLATOR_DECLARATIONS (Bar_number_engraver);
+};
+
+void
+Bar_number_engraver::process_music ()
+{
+ // todo include (&&!time->cadenza_b_)
+
+ SCM wb = get_property ("whichBar");
+
+ if (scm_is_string (wb))
+ {
+ Moment mp (robust_scm2moment (get_property ("measurePosition"), Moment (0)));
+ if (mp.main_part_ == Rational (0))
+ {
+ SCM bn = get_property ("currentBarNumber");
+ SCM proc = get_property ("barNumberVisibility");
+ if (scm_is_number (bn) && ly_is_procedure (proc)
+ && to_boolean (scm_call_1 (proc, bn)))
+ {
+ create_items ();
+ // guh.
+ text_->set_property
+ ("text", scm_number_to_string (bn, scm_from_int (10)));
+ }
+ }
+ }
+}
+
+Bar_number_engraver::Bar_number_engraver ()
+{
+ text_ = 0;
+}
+
+
+/*
+ see rehearsal mark comments.
+ */
+void
+Bar_number_engraver::acknowledge_break_aligned (Grob_info inf)