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_
;
15 vector
<Audio_item
*> texts_
;
17 void add_text (Audio_text::Type
, string
);
18 TRANSLATOR_DECLARATIONS (Control_track_performer
);
21 virtual void initialize ();
22 virtual void acknowledge_audio_element (Audio_element_info info
);
26 Control_track_performer::Control_track_performer ()
32 Control_track_performer::acknowledge_audio_element (Audio_element_info info
)
34 if (Audio_tempo
*tempo
= dynamic_cast<Audio_tempo
*> (info
.elem_
))
36 control_track_
->add_audio_item (tempo
);
38 if (Audio_time_signature
* sig
= dynamic_cast<Audio_time_signature
*> (info
.elem_
))
40 control_track_
->add_audio_item (sig
);
45 Control_track_performer::add_text (Audio_text::Type text_type
, string str
)
47 Audio_item
*text
= new Audio_text (text_type
, str
);
48 control_track_
->add_audio_item (text
);
49 texts_
.push_back (text
);
51 announce_element (Audio_element_info (text
, 0));
56 Control_track_performer::initialize ()
58 control_track_
= new Audio_staff
;
59 announce_element (Audio_element_info (control_track_
, 0));
61 string id_string
= String_convert::pad_to (gnu_lilypond_version_string (), 30);
63 add_text (Audio_text::TRACK_NAME
, "control track");
64 add_text (Audio_text::TEXT
, "creator: ");
65 add_text (Audio_text::TEXT
, id_string
);
68 ADD_TRANSLATOR (Control_track_performer
,