#include "multi-measure-rest.hh"
#include "paper-column.hh"
#include "engraver-group-engraver.hh"
-#include "bar.hh"
+
#include "staff-symbol-referencer.hh"
#include "engraver.hh"
#include "moment.hh"
/**
The name says it all: make multi measure rests
-FIXME? The MM rest engraver must be able to see bar lines, so it won't
-work at Voice level. Not a problem in practice, but aesthetically pleasing?
-
*/
class Multi_measure_rest_engraver : public Engraver
{
Multi_measure_rest_engraver ();
protected:
- virtual void acknowledge_grob (Grob_info i);
virtual bool try_music (Music*);
virtual void process_music ();
virtual void stop_translation_timestep ();
new_req_l_ = busy_span_req_l_ = stop_req_l_ =0;
}
-void
-Multi_measure_rest_engraver::acknowledge_grob (Grob_info i)
-{
- Item * item = dynamic_cast<Item*> (i.elem_l_);
- if (item && Bar::has_interface (item))
- {
- if (mmrest_p_)
- Multi_measure_rest::add_column (mmrest_p_,item);
- if (lastrest_p_)
- Multi_measure_rest::add_column (lastrest_p_,item);
- }
-}
bool
Multi_measure_rest_engraver::try_music (Music* req_l)
= gh_scm2int (get_property ("currentBarNumber"));
}
-
+ if (gh_string_p (get_property ("whichBar")))
+ {
+ Grob *cmc = unsmob_grob (get_property( "currentCommandColumn"));
+ Item *it = dynamic_cast<Item*> (cmc);
+ if (mmrest_p_)
+ add_bound_item (mmrest_p_, it);
+ if (lastrest_p_)
+ add_bound_item (lastrest_p_,it);
+ }
}
void
if (mmrest_p_ && (now_mom () >= start_moment_)
&& !mp
- && (scm_ilength (mmrest_p_->get_grob_property ("columns")) >= 2))
+ && mmrest_p_->get_bound (LEFT) && mmrest_p_->get_bound (RIGHT))
{
typeset_grob (mmrest_p_);
/*
if (lastrest_p_)
{
/* sanity check */
- if (scm_ilength (lastrest_p_->get_grob_property ("columns")) >= 2
- && lastrest_p_->get_bound (LEFT) && lastrest_p_->get_bound (RIGHT)
+ if (lastrest_p_->get_bound (LEFT) && lastrest_p_->get_bound (RIGHT)
&& lastrest_p_->get_bound (LEFT) != lastrest_p_->get_bound (RIGHT))
typeset_grob (lastrest_p_);
lastrest_p_ = 0;