lilypond-0.1.11
[lilypond.git] / lily / staff-performer.cc
blob72b1ef6840339ae3b2aa0a007de0a4e88091ff04
1 /*
2 staff-performer.cc -- implement Staff_performer
4 source file of the GNU LilyPond music typesetter
6 (c) 1997 Jan Nieuwenhuizen <jan@digicash.com>
7 */
9 #include "staff-performer.hh"
10 #include "translator.hh"
11 #include "input-translator.hh"
12 #include "debug.hh"
13 #include "audio-column.hh"
14 #include "audio-item.hh"
15 #include "audio-staff.hh"
17 IMPLEMENT_IS_TYPE_B1(Staff_performer,Performer_group_performer);
18 ADD_THIS_PERFORMER(Staff_performer);
20 Staff_performer::Staff_performer()
22 audio_staff_p_ = 0;
25 Staff_performer::~Staff_performer()
27 delete audio_staff_p_;
30 void
31 Staff_performer::do_creation_processing()
33 audio_staff_p_ = new Audio_staff;
35 if (instrument_str().length_i())
37 // staff name
38 play (new Audio_text (Audio_text::TRACK_NAME, instrument_str ()));
39 // instrument description
40 play (new Audio_text (Audio_text::INSTRUMENT_NAME, instrument_str ()));
43 // tempo
44 play(new Audio_tempo(get_tempo_i()));
46 if (instrument_str ().length_i ())
47 // instrument
48 play (new Audio_instrument (instrument_str ()));
51 void
52 Staff_performer::do_removal_processing()
54 Performer::play (audio_staff_p_);
55 audio_staff_p_ = 0;
58 String
59 Staff_performer::instrument_str()
61 return Translator::id_str_;
64 void
65 Staff_performer::play (Audio_element* p)
67 if (p->is_type_b (Audio_item::static_name()))
69 audio_staff_p_->add ((Audio_item*)p);
71 Performer::play (p);