source file of the GNU LilyPond music typesetter
- (c) 1998 Jan Nieuwenhuizen <janneke@gnu.org>
+ (c) 1998--1999 Jan Nieuwenhuizen <janneke@gnu.org>
*/
#include "staff-margin-engraver.hh"
#include "bar.hh"
#include "time-description.hh"
-#include "g-text-item.hh"
-#include "g-staff-side.hh"
+#include "text-item.hh"
+#include "staff-side.hh"
ADD_THIS_TRANSLATOR (Staff_margin_engraver);
{
axis_ = X_AXIS;
type_ = "margin";
- visibility_lambda_
- = gh_eval_str ("postbreak_only_visibility");
+ visibility_lambda_ = ly_ch_C_eval_scm ("postbreak_only_visibility");
}
-
/*
TODO
- fix alignment/support
- should be able to set whole paragraph (multiple lines, centre) to
+ should be able to set whole paragraph (multiple lines, center) to
left (right?) of staff, e.g.:
______
|_______
|______________
*/
void
-Staff_margin_engraver::acknowledge_element (Score_element_info i)
+Staff_margin_engraver::acknowledge_element (Score_element_info inf)
{
- Bar * b =dynamic_cast<Bar *> (i.elem_l_);
- if (!b)
- return ;
-
- if (i.origin_grav_l_arr_.size() != 1)
+ Item *i = cast_to_interesting_item (inf.elem_l_);
+ if (!i || inf.origin_trans_l_arr_.size() != 1)
return;
String long_str = get_property ("instrument", 0);
- String str = get_property ("instr", 0);
- if (now_mom () > Moment (0) && str.length_i ())
- long_str = str;
+ String short_str = get_property ("instr", 0);
+ if (now_mom () > Moment (0))
+ long_str = short_str;
if (long_str.empty_b ())
return;
create_items (0);
text_p_->text_str_ = long_str;
staff_side_p_->dir_ = LEFT;
- Bar_script_engraver::acknowledge_element(i);
+ Bar_script_engraver::do_acknowledge_element (i);
+
+ /*
+ UGH. ignores font size settings.
+ */
+ Interval iv(text_p_->extent (Y_AXIS));
+ text_p_->translate_axis (- iv.center (), Y_AXIS);
}