2 staff-margin-engraver.cc -- implement Staff_margin_engraver
4 source file of the GNU LilyPond music typesetter
6 (c) 1998 Jan Nieuwenhuizen <janneke@gnu.org>
9 #include "staff-margin-engraver.hh"
11 #include "text-def.hh"
12 #include "paper-def.hh"
13 #include "command-request.hh"
16 #include "time-description.hh"
18 IMPLEMENT_IS_TYPE_B1 (Staff_margin_engraver, Engraver);
19 ADD_THIS_TRANSLATOR (Staff_margin_engraver);
21 Staff_margin_engraver::Staff_margin_engraver ()
32 should be able to set whole paragraph (multiple lines, centre) to
33 left (right?) of staff, e.g.:
36 2 Clarinetti |________
41 Staff_margin_engraver::acknowledge_element (Score_element_info i)
43 Item * it = dynamic_cast <Item *> (i.elem_l_);
47 || !(dynamic_cast<Bar *> (it))
48 || (i.origin_grav_l_arr_.size() != 1))
51 String string = get_property ("instrument");
52 String str = get_property ("instr");
53 if (now_moment () > Moment (0))
56 if (!string.length_i ())
59 script_p_ = new Script;
60 script_p_->axis_ = X_AXIS;
62 Text_def *td_p =new Text_def;
63 td_p->align_dir_ = LEFT;
64 td_p->text_str_ = string;
66 script_p_->dir_ = RIGHT;
67 script_p_->specs_p_ = td_p;
68 script_p_->breakable_b_ = true;
71 Scalar pri = get_property ("marginBreakPriority");
72 if (pri.length_i () && pri.isnum_b ())
74 script_p_->break_priority_i_ = int (pri);
77 script_p_ ->break_priority_i_ = it->break_priority_i_;
79 announce_element (Score_element_info (script_p_, 0));
83 Staff_margin_engraver::do_pre_move_processing ()
87 typeset_element (script_p_);