2 mark-engraver.cc -- implement Mark_engraver
4 source file of the GNU LilyPond music typesetter
6 (c) 1998 Jan Nieuwenhuizen <janneke@gnu.org>
9 #include "mark-engraver.hh"
10 #include "text-def.hh"
12 #include "paper-def.hh"
13 #include "command-request.hh"
14 #include "time-description.hh"
15 #include "engraver-group.hh"
17 IMPLEMENT_IS_TYPE_B1 (Mark_engraver, Engraver);
18 ADD_THIS_TRANSLATOR (Mark_engraver);
20 Mark_engraver::Mark_engraver ()
27 Mark_engraver::do_try_request (Request* r_l)
29 Command_req* c_l = dynamic_cast <Command_req *> (r_l);
30 if (!c_l || !dynamic_cast <Mark_req *> (c_l) || mark_req_l_)
33 mark_req_l_ = dynamic_cast <Mark_req *> (c_l);
39 Mark_engraver::do_process_requests ()
41 if (!mark_req_l_ || script_p_)
44 script_p_ = new Script;
45 script_p_->breakable_b_ = true;
47 Text_def *td_p = new Text_def;
49 td_p->text_str_ = mark_req_l_->str_;
50 td_p->align_dir_ = CENTER;
52 td_p->style_str_ = td_p->text_str_.index_any_i ("0123456789") >= 0
55 script_p_->dir_ = LEFT;
56 script_p_->specs_p_ = td_p->clone ();
57 script_p_->postbreak_only_b_ = true;
59 Scalar padding = get_property ("markScriptPadding");
60 if (padding.length_i() && padding.isnum_b ())
62 script_p_->padding_f_ = Real(padding);
64 Scalar break_priority = get_property ("markBreakPriority");
65 if (break_priority.length_i() && break_priority.isnum_b ())
67 script_p_->break_priority_i_ = int(break_priority);
71 announce_element (Score_element_info (script_p_, mark_req_l_));
75 Mark_engraver::do_pre_move_processing ()
79 typeset_element (script_p_);