]> git.donarmstrong.com Git - lilypond.git/blobdiff - lily/performance.cc
patch::: 1.3.130.jcn2
[lilypond.git] / lily / performance.cc
index b97df6b69cd87f82fd9019636bbea5da24b1d157..53d223c7d20dfdb51d0da3a0ac0972eefceec4ec 100644 (file)
@@ -3,7 +3,7 @@
 
   source file of the GNU LilyPond music typesetter
 
-  (c)  1997--1999 Jan Nieuwenhuizen <janneke@gnu.org>
+  (c)  1997--2000 Jan Nieuwenhuizen <janneke@gnu.org>
 */
 
 #include <time.h>
@@ -20,6 +20,7 @@
 #include "performance.hh"
 #include "score.hh"
 #include "file-results.hh"
+#include "file-path.hh"
 #include "lily-version.hh"
 
 #include "killing-cons.tcc"
@@ -46,15 +47,14 @@ Performance::output (Midi_stream& midi_stream)
 
   midi_stream << Midi_header (1, tracks_i, clocks_per_4_i);
   output_header_track (midi_stream);
-  *mlog << "\n";
-  *mlog << _ ("Track ... ");
+  progress_indication ("\n");
+  progress_indication (_ ("Track ... "));
   int channel = 1;
   for (int i =0; i < audio_staff_l_arr_.size (); i++)
     {
-      *mlog << '[' << flush;
       Audio_staff *s = audio_staff_l_arr_[i];
-
-      *mlog << i << flush;
+      if(verbose_global_b)
+       progress_indication ("[" + to_str (i)) ;
 
       /*
        Aargh, let's hear it for the MIDI standard.
@@ -64,7 +64,8 @@ Performance::output (Midi_stream& midi_stream)
       if (channel == 9)
        channel++;
       s->output (midi_stream, channel++);
-      *mlog << ']' << flush;
+      if(verbose_global_b)
+       progress_indication ("]");
     }
 }
 
@@ -74,11 +75,13 @@ Performance::output_header_track (Midi_stream& midi_stream)
   Midi_track midi_track;
 
   // perhaps multiple text events?
+  String id_str;
   String str = String (_("Creator: "));
   if (no_timestamps_global_b)
-    str += gnu_lilypond_str ();
+    id_str = gnu_lilypond_str ();
   else
-    str += gnu_lilypond_version_str();
+    id_str = gnu_lilypond_version_str();
+  str += id_str;
   str += "\n";
 
   /*
@@ -89,7 +92,8 @@ Performance::output_header_track (Midi_stream& midi_stream)
   Midi_text creator (&creator_a);
   midi_track.add (Moment (0), &creator);
 
-  str = _("Automatically generated");
+  str = _("Generated automatically by: ");
+  str += id_str;
   if (no_timestamps_global_b)
     str += ".\n";
   else
@@ -115,9 +119,10 @@ Performance::output_header_track (Midi_stream& midi_stream)
                        
   midi_track.add (Moment (0), &track_name);
 
-  Audio_tempo tempo_a (midi_l_->get_tempo_i (Moment (1, 4)));
-  Midi_tempo tempo (&tempo_a);
-  midi_track.add (Moment (0), &tempo);
+  // Some sequencers read track 0 last.
+  //  Audio_tempo tempo_a (midi_l_->get_tempo_i (Moment (1, 4)));
+  //  Midi_tempo tempo (&tempo_a);
+  //  midi_track.add (Moment (0), &tempo);
 
   midi_stream << midi_track;
 }
@@ -136,43 +141,25 @@ Performance::add_element (Audio_element *p)
   audio_elem_p_list_ = new Killing_cons<Audio_element> (p, audio_elem_p_list_);
 }
 
-void
-Performance::print() const
-{
-#ifndef NPRINT
-  DOUT << "Performance { ";
-  DOUT << "Items: ";
-  for (Cons<Audio_element>* i =audio_elem_p_list_; i; i = i->next_)
-    i->car_->print ();
-  DOUT << "}";
-#endif
-}
 
 void
 Performance::process()
 {
-  print ();
-
-  String out = midi_l_->get_default_output ();
-  if (out.empty_b ())
+  String out = outname_global;
+  if (out == "-")
+    out = "lelie.midi";
+  int def = midi_l_->get_next_default_count ();
+  if (def)
     {
-      
-      out = default_outname_base_global;
-      if (out == "-")
-        out = "lelie";
-      int def = midi_l_->get_next_default_count ();
-      if (def)
-       {
-         out += "-" + to_str (def);
-       }
-
-      out += ".midi";
+      Path p = split_path (out);
+      p.base += "-" + to_str (def);
+      out = p.path ();
     }
   
   Midi_stream midi_stream (out);
-  *mlog << _f ("MIDI output to %s...", out) << endl;
+  progress_indication ( _f ("MIDI output to %s...", out));
   target_str_global_array.push (out);
 
   output (midi_stream);
-  *mlog << endl;
+  progress_indication("\n");
 }