]> git.donarmstrong.com Git - lilypond.git/blobdiff - lily/midi-stream.cc
patch::: 0.1.31.jcn1: minder ugh
[lilypond.git] / lily / midi-stream.cc
index 05d942138893b9d54c0424e23f7a69ca4ad46db8..6d2cb2699a61097f4313e8e69d45c3542446a6ba 100644 (file)
@@ -24,6 +24,12 @@ Midi_stream::Midi_stream (String filename_str)
 
 Midi_stream::~Midi_stream()
 {
+  *os_p_ << flush;             // ugh. Share with tex_stream.
+  if (!*os_p_)
+    {
+      warning(_("error syncing file (disk full?)"));
+      exit_status_i_ = 1;
+    }
   delete os_p_;
 }
 
@@ -32,7 +38,7 @@ Midi_stream::operator <<(String str)
 {
   if (check_debug && !monitor->silence("Midistrings"))
     str = String_convert::bin2hex_str (str);
-  
+
   *os_p_ << str;
 
   if (check_debug && !monitor->silence("Midistrings"))
@@ -64,5 +70,5 @@ Midi_stream::open()
 {
   os_p_ = new ofstream (filename_str_.ch_C ());
   if (!*os_p_)
-    error ("can't open `" + filename_str_ + "\'");
+    error (_("can't open `") + filename_str_ + "\'");
 }