]> git.donarmstrong.com Git - lilypond.git/blobdiff - lily/midi-def.cc
patch::: 1.3.54.hwn2
[lilypond.git] / lily / midi-def.cc
index 480e0a7969576ac21bd8192e81da1fe48f7f5359..753976a9b605792e25913067387ab92d04c9787d 100644 (file)
@@ -3,7 +3,7 @@
 
   source file of the GNU LilyPond music typesetter
 
-  (c) 1997 Jan Nieuwenhuizen <jan@digicash.com>
+  (c)  1997--2000 Jan Nieuwenhuizen <janneke@gnu.org>
 
 */
 #include <math.h>
@@ -11,7 +11,6 @@
 #include "midi-def.hh"
 #include "translator.hh"
 #include "performance.hh"
-#include "assoc-iter.hh"
 #include "score-performer.hh"
 #include "debug.hh"
 
@@ -32,7 +31,7 @@ Midi_def::~Midi_def()
 }
 
 Real
-Midi_def::duration_to_seconds_f (Moment mom)
+Midi_def::length_mom_to_seconds_f (Moment mom)
 {
   if (!mom)
     return 0;
@@ -53,26 +52,30 @@ void
 Midi_def::set_tempo (Moment one_beat_mom, int beats_per_minute_i)
 {
   Moment beats_per_second = Moment (beats_per_minute_i) / Moment (60);
-  whole_in_seconds_mom_ = 1/(beats_per_second * one_beat_mom);
+  whole_in_seconds_mom_ = Moment(1)/Moment(beats_per_second * one_beat_mom);
 }
 
 void
 Midi_def::print() const
 {
 #ifndef NPRINT
+  DEBUG_OUT << "MIDI {\n";
   Music_output_def::print ();
-  DOUT << "Midi {";
-  DOUT << "4/min: " << Real (60) / (whole_in_seconds_mom_ * 4);
-  DOUT << "}\n";
+  DEBUG_OUT << "4/min: " << Moment (60) / (whole_in_seconds_mom_ * Moment (4));
+  DEBUG_OUT << "}\n";  
 #endif
 }
 
-
-IMPLEMENT_IS_TYPE_B1(Midi_def, Music_output_def);
-
 int Midi_def::default_count_i_=0;
+
 int
 Midi_def::get_next_default_count () const
 {
   return default_count_i_++;
 }
+
+void
+Midi_def::reset_default_count ()
+{
+  default_count_i_ = 0;
+}