]> git.donarmstrong.com Git - lilypond.git/blobdiff - lily/performance.cc
release: 1.1.24
[lilypond.git] / lily / performance.cc
index 8d05ec325dd45efa914ca5b81767110463a687f4..49dc2f308b9d4867436b0fc65b34ec7b56b5fa25 100644 (file)
@@ -1,9 +1,9 @@
 /*
-  audio-score.cc -- implement Performance
+  performance.cc -- implement Performance
 
   source file of the GNU LilyPond music typesetter
 
-  (c) 1997 Jan Nieuwenhuizen <jan@digicash.com>
+  (c)  1997--1998 Jan Nieuwenhuizen <janneke@gnu.org>
 */
 
 #include <time.h>
@@ -18,6 +18,8 @@
 #include "audio-staff.hh"
 #include "performance.hh"
 #include "score.hh"
+#include "file-results.hh"
+#include "lily-version.hh"
 
 Performance::Performance ()
 {
@@ -25,7 +27,7 @@ Performance::Performance ()
 }
 
 void
-Performance::add (Audio_column* p)
+Performance::add_column (Audio_column* p)
 {
   p->performance_l_ = this;
   audio_column_p_list_.bottom().add (p);
@@ -49,24 +51,32 @@ Performance::output_header_track (Midi_stream& midi_stream_r)
 {
   Midi_track midi_track;
 
-  time_t t = time (0);
-
   // perhaps multiple text events?
-  String str = String (_("Creator: ")) + get_version_str() + "\n";
+  String str = String (_("Creator: "));
+  if (no_timestamps_global_b)
+    str += gnu_lilypond_str ();
+  else
+    str += gnu_lilypond_version_str();
+  str += "\n";
 
   Midi_text creator (Midi_text::TEXT, str);
   midi_track.add (Moment (0), &creator);
 
-  str = _("Automatically generated at ");
-  str += ctime (&t);
-  str = str.left_str (str.length_i() - 1);
-  str += "\n";
+  str = _("Automatically generated");
+  if (no_timestamps_global_b)
+    str += ".\n";
+  else
+    {
+      str += _(", at ");
+      time_t t (time (0));
+      str += ctime (&t);
+      str = str.left_str (str.length_i() - 1);
+    }
   Midi_text generate (Midi_text::TEXT, str);
   midi_track.add (Moment (0), &generate);
 
-  str = _("from musical definition: ");
+  str = _f ("from musical definition: %s", origin_str_);
 
-  str += origin_str_;
   Midi_text from (Midi_text::TEXT, str);
   midi_track.add (Moment (0), &from);
 
@@ -87,7 +97,7 @@ Performance::add_staff (Audio_staff* l)
 }
 
 void
-Performance::add (Audio_element *p)
+Performance::add_element (Audio_element *p)
 {
   audio_elem_p_list_.bottom().add (p);
 }
@@ -113,12 +123,25 @@ Performance::process()
 {
   print ();
 
-  String out=midi_l_->outfile_str_;
+  String out = midi_l_->get_default_output ();
   if (out.empty_b ())
-    out = default_out_str_ + ".midi";
-
+    {
+      
+      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";
+    }
+  
   Midi_stream midi_stream (out);
-  *mlog << _("MIDI output to ") << out<< " ..." << endl;
+  *mlog << _f ("MIDI output to %s...", out) << endl;
+  target_str_global_array.push (out);
 
   output (midi_stream);
   *mlog << endl;