]> git.donarmstrong.com Git - lilypond.git/blobdiff - lily/control-track-performer.cc
Issue 5167/6: Changes: show \markup xxx = ... \etc assignments
[lilypond.git] / lily / control-track-performer.cc
index d1e677db63149a0cafca4b20c39483f444bc1a28..3846e3102da6c8c0ce2572480ee49d878b70efd9 100644 (file)
@@ -12,9 +12,8 @@
 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,8 +21,8 @@ protected:
   virtual void acknowledge_audio_element (Audio_element_info info);
 };
 
-
-Control_track_performer::Control_track_performer ()
+Control_track_performer::Control_track_performer (Context *c)
+  : Performer (c)
 {
   control_track_ = 0;
 }
@@ -31,50 +30,59 @@ 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);
 }
 
+void
+Control_track_performer::boot ()
+{
+
+}
+
 ADD_TRANSLATOR (Control_track_performer,
-               /* doc */
-               "",
+                /* doc */
+                "",
 
-               /* create */
-               "",
+                /* create */
+                "",
 
-               /* read */
-               "",
+                /* read */
+                "",
 
-               /* write */
-               ""
-               );
+                /* write */
+                ""
+               );