- if (text_)
- return ;
-
- SCM txt = get_property ("instrument");
-
- if (now_mom () > Moment (0))
- txt = get_property ("instr");
- /*
- UGH.
- */
- if (txt == SCM_EOL)
- return ;
-
-
- text_ = make_item ("InstrumentName", SCM_EOL);
-
- if (text_->get_property ("text") != txt)
- text_->set_property ("text", txt);
-
- }
-
-void
-Instrument_name_engraver::acknowledge_grob (Grob_info i)
-{
- if (Bar_line::has_interface (i.grob_))
- {
- create_text ();
- }
-
- if (dynamic_cast<Spanner*> (i.grob_)
- && i.grob_->internal_has_interface (ly_symbol2scm ("dynamic-interface")))
- return;
-
- /*
- Hang the instrument names on the staves, but not on the alignment
- groups enclosing that staff. The alignment has no real location,
- but is only a vehicle for the placement routine it contains, and
- therefore the location of its refpoint won't be very useful.
-
- We could also just use stavesFound, but lets keep this working
- without staffs as well.
- */
- if (dynamic_cast<Spanner*> (i.grob_)
- && ((Axis_group_interface::has_interface (i.grob_)
- && Axis_group_interface::has_axis (i.grob_, Y_AXIS)))
- && !Align_interface::has_interface (i.grob_))
+ if (text_spanner_
+ && dynamic_cast<Spanner *> (info.grob ())
+ && Axis_group_interface::has_axis (info.grob (), Y_AXIS)
+ && (!Align_interface::has_interface (info.grob ())))