#include "paper-def.hh"
#include "side-position-interface.hh"
#include "staff-symbol.hh"
-#include "text-item.hh"
+#include "item.hh"
#include "moment.hh"
#include "engraver.hh"
#include "protected-scm.hh"
class Bar_number_engraver : public Engraver
{
protected:
- Text_item* text_p_;
- Protected_scm visibility_lambda_;
+ Item* text_p_;
+
Protected_scm staffs_;
protected:
- virtual void do_creation_processing ();
virtual void do_pre_move_processing ();
virtual void acknowledge_element (Score_element_info);
void create_items();
staffs_ = SCM_EOL;
}
-void
-Bar_number_engraver::do_creation_processing ()
-{
- String t = "barNumberVisibilityFunction";
- SCM proc = get_property (t);
-
- if (gh_procedure_p (proc))
- visibility_lambda_ = proc;
-}
Bar_number_engraver::acknowledge_element (Score_element_info inf)
{
Score_element * s = inf.elem_l_;
- if (dynamic_cast<Staff_symbol*> (s))
+ if (Staff_symbol::has_interface (s))
{
- staffs_ = gh_cons (inf.elem_l_->self_scm_, staffs_);
+ staffs_ = gh_cons (inf.elem_l_->self_scm (), staffs_);
}
else if (text_p_
&& dynamic_cast<Item*> (s)
{
if (text_p_)
{
- text_p_->set_elt_pointer ("side-support", staffs_);
+ text_p_->set_elt_property ("side-support-elements", staffs_);
typeset_element (text_p_);
text_p_ =0;
}
{
if (text_p_)
return;
-
- text_p_ = new Text_item;
- text_p_->set_elt_property ("breakable", SCM_BOOL_T); // ugh
- Side_position_interface staffside(text_p_);
- staffside.set_axis (Y_AXIS);
+
+ SCM b = get_property ("basicBarNumberProperties");
+ text_p_ = new Item (b);
+ Side_position::set_axis(text_p_,Y_AXIS);
SCM prop = get_property ("barNumberDirection");
if (!isdir_b (prop))
gh_double2scm(paper_l ()->get_var ("interline")));
}
- if (gh_procedure_p (visibility_lambda_))
- text_p_->set_elt_property ("visibility-lambda",
- visibility_lambda_);
- announce_element (Score_element_info (text_p_, 0));
+ announce_element (text_p_, 0);
}