2 staff-performer.cc -- implement Staff_performer
4 source file of the GNU LilyPond music typesetter
6 (c) 1997--1999 Jan Nieuwenhuizen <janneke@gnu.org>
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"
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 ("midi_instrument", 0);
82 str = get_property ("instrument", 0);
83 if (str == instrument_str_)
86 instrument_str_ = str;
88 return instrument_str_;
91 if (properties_dict_.elem_b ("instrument"))
92 return properties_dict_["instrument"];
98 Staff_performer::play (Audio_element* p)
100 if (Audio_item *ai = dynamic_cast<Audio_item *> (p))
102 audio_staff_p_->add_audio_item (ai);