2 staff-performer.cc -- implement Staff_performer
4 source file of the GNU LilyPond music typesetter
6 (c) 1997 Jan Nieuwenhuizen <jan@digicash.com>
9 #include "staff-performer.hh"
10 #include "translator-group.hh"
12 #include "audio-column.hh"
13 #include "audio-item.hh"
14 #include "audio-staff.hh"
16 IMPLEMENT_IS_TYPE_B1 (Staff_performer
,Performer_group_performer
);
17 ADD_THIS_TRANSLATOR (Staff_performer
);
19 Staff_performer::Staff_performer ()
24 Staff_performer::~Staff_performer ()
26 delete audio_staff_p_
;
30 Staff_performer::do_creation_processing ()
32 audio_staff_p_
= new Audio_staff
;
34 play (new Audio_text (Audio_text::TRACK_NAME
, id_str_
));
37 String str
= new_instrument_str ();
39 // instrument description
40 play (new Audio_text (Audio_text::INSTRUMENT_NAME
, str
));
44 play (new Audio_tempo (get_tempo_i ()));
49 play (new Audio_instrument (str
));
52 Performer_group_performer::do_creation_processing ();
56 Staff_performer::do_process_requests ()
58 String str
= new_instrument_str ();
61 play (new Audio_text (Audio_text::INSTRUMENT_NAME
, str
));
62 play (new Audio_instrument (str
));
64 Performer_group_performer::do_process_requests ();
69 Staff_performer::do_removal_processing ()
71 Performer_group_performer::do_removal_processing ();
72 Performer::play (audio_staff_p_
);
77 Staff_performer::new_instrument_str ()
79 // mustn't ask Score for instrument: it will return piano!
80 String str
= get_property ("instrument");
81 if (str
== instrument_str_
)
84 instrument_str_
= str
;
86 return instrument_str_
;
89 if (properties_dict_.elt_b ("instrument"))
90 return properties_dict_["instrument"];
96 Staff_performer::play (Audio_element
* p
)
98 if (p
->is_type_b (Audio_item::static_name ()))
100 audio_staff_p_
->add ( (Audio_item
*)p
);