]> git.donarmstrong.com Git - lilypond.git/blobdiff - lily/control-track-performer.cc
Issue 4550 (1/2) Avoid "using namespace std;" in included files
[lilypond.git] / lily / control-track-performer.cc
index 3275b467d531006f06bec4223b46aa1e9bc3211d..2bf71f30d526b5064a9c74d906c43f6312b69eff 100644 (file)
@@ -9,12 +9,13 @@
 
 #include "translator.icc"
 
+using std::string;
+
 class Control_track_performer : public Performer
 {
   Audio_staff *control_track_;
-  vector<Audio_item*> texts_;
 
-  void add_text (Audio_text::Type, string);
+  void add_text (Audio_text::Type, const string&);
   TRANSLATOR_DECLARATIONS (Control_track_performer);
 protected:
 
@@ -22,7 +23,6 @@ protected:
   virtual void acknowledge_audio_element (Audio_element_info info);
 };
 
-
 Control_track_performer::Control_track_performer ()
 {
   control_track_ = 0;
@@ -31,39 +31,53 @@ Control_track_performer::Control_track_performer ()
 void
 Control_track_performer::acknowledge_audio_element (Audio_element_info info)
 {
-  if (Audio_tempo *tempo = dynamic_cast<Audio_tempo*> (info.elem_))
+  if (Audio_tempo *tempo = dynamic_cast<Audio_tempo *> (info.elem_))
     {
       control_track_->add_audio_item (tempo);
     }
-  if (Audio_time_signature * sig = dynamic_cast<Audio_time_signature *> (info.elem_))
+  if (Audio_time_signature *sig = dynamic_cast<Audio_time_signature *> (info.elem_))
     {
       control_track_->add_audio_item (sig);
     }
 }
 
 void
-Control_track_performer::add_text (Audio_text::Type text_type, string str)
+Control_track_performer::add_text (Audio_text::Type text_type, const string &str)
 {
   Audio_item *text = new Audio_text (text_type, str);
   control_track_->add_audio_item (text);
-  texts_.push_back (text);
 
   announce_element (Audio_element_info (text, 0));
-  
+
 }
 
 void
 Control_track_performer::initialize ()
 {
-  control_track_ = new Audio_staff;
+  control_track_ = new Audio_control_track_staff;
   announce_element (Audio_element_info (control_track_, 0));
 
   string id_string = String_convert::pad_to (gnu_lilypond_version_string (), 30);
-  
+
+  // The first audio element in the control track is a placeholder for the
+  // name of the MIDI sequence.  The actual name is stored in the element
+  // later before outputting the track (in Performance::output, see
+  // performance.cc).
   add_text (Audio_text::TRACK_NAME, "control track");
   add_text (Audio_text::TEXT, "creator: ");
   add_text (Audio_text::TEXT, id_string);
 }
 
-ADD_TRANSLATOR (Control_track_performer, "", "",
-               "", "");
+ADD_TRANSLATOR (Control_track_performer,
+                /* doc */
+                "",
+
+                /* create */
+                "",
+
+                /* read */
+                "",
+
+                /* write */
+                ""
+               );