4 #include "audio-item.hh"
5 #include "audio-staff.hh"
6 #include "performer.hh"
7 #include "string-convert.hh"
8 #include "lily-version.hh"
10 #include "translator.icc"
12 class Control_track_performer : public Performer
14 Audio_staff *control_track_;
16 void add_text (Audio_text::Type, const string&);
17 TRANSLATOR_DECLARATIONS (Control_track_performer);
20 virtual void initialize ();
21 virtual void acknowledge_audio_element (Audio_element_info info);
24 Control_track_performer::Control_track_performer ()
30 Control_track_performer::acknowledge_audio_element (Audio_element_info info)
32 if (Audio_tempo *tempo = dynamic_cast<Audio_tempo *> (info.elem_))
34 control_track_->add_audio_item (tempo);
36 if (Audio_time_signature *sig = dynamic_cast<Audio_time_signature *> (info.elem_))
38 control_track_->add_audio_item (sig);
43 Control_track_performer::add_text (Audio_text::Type text_type, const string &str)
45 Audio_item *text = new Audio_text (text_type, str);
46 control_track_->add_audio_item (text);
48 announce_element (Audio_element_info (text, 0));
53 Control_track_performer::initialize ()
55 control_track_ = new Audio_control_track_staff;
56 announce_element (Audio_element_info (control_track_, 0));
58 string id_string = String_convert::pad_to (gnu_lilypond_version_string (), 30);
60 // The first audio element in the control track is a placeholder for the
61 // name of the MIDI sequence. The actual name is stored in the element
62 // later before outputting the track (in Performance::output, see
64 add_text (Audio_text::TRACK_NAME, "control track");
65 add_text (Audio_text::TEXT, "creator: ");
66 add_text (Audio_text::TEXT, id_string);
69 ADD_TRANSLATOR (Control_track_performer,