]> git.donarmstrong.com Git - lilypond.git/commitdiff
lilypond-0.1.7
authorfred <fred>
Sun, 24 Mar 2002 19:53:17 +0000 (19:53 +0000)
committerfred <fred>
Sun, 24 Mar 2002 19:53:17 +0000 (19:53 +0000)
lily/note-performer.cc

index 430e33c7c765ff06dfd5c30616dd366b17d29f2a..5471110e900fc0585a5ee7ced49ca30785a26eda 100644 (file)
@@ -1,6 +1,8 @@
 /*
   note-performer.cc -- implement Note_performer
 
+  source file of the GNU LilyPond music typesetter
+
   (c) 1996, 1997 Jan Nieuwenhuizen <jan@digicash.com>
  */
 
@@ -8,7 +10,7 @@
 #include "translator.hh"
 #include "input-translator.hh"
 #include "musical-request.hh"
-#include "midi-item.hh"
+#include "audio-item.hh"
 #include "debug.hh"
 
 IMPLEMENT_IS_TYPE_B1(Note_performer,Performer);
@@ -18,48 +20,27 @@ ADD_THIS_PERFORMER(Note_performer);
 Note_performer::Note_performer()
 {
     note_req_l_ = 0;
-    off_mom_ = 0;
-}
-
-Note_performer::~Note_performer()
-{
 }
 
 void 
 Note_performer::do_print() const
 {
 #ifndef NPRINT
-    if ( note_req_l_ )
+    if ( note_req_l_ ) {
        note_req_l_->print();
+    }
 #endif
 }
 
 void 
 Note_performer::process_requests() 
 {
-//    if ( when() == off_mom_ )
-//     play_event( Note_event( current_l_->pitch() ) );
-
-//Midi_note( Melodic_req* melreq_l, int channel_i, bool on_bo  )
-
     // this is _really_ braindead, but it generates some output
     if ( !note_req_l_ || !note_req_l_->melodic()  || !note_req_l_->rhythmic() )
        return;
 
-    // ugh, need to know channel (===track===staff) too
-    int channel_i = get_track_i();
-    Moment mom = get_mom();
-    if ( !off_mom_ ) { // start note
-       off_mom_ = mom + note_req_l_->duration();
-       Midi_note n( note_req_l_->melodic(), channel_i, true );
-       play_event( &n );
-    }
-    else if ( mom == off_mom_ ) {
-       Midi_note n( note_req_l_->melodic(), channel_i, false );
-       play_event( &n );
-       note_req_l_ = 0;
-       off_mom_ = 0;
-    }
+    play( new Audio_note( note_req_l_ ) );
+    note_req_l_ = 0;
 }
 
 bool 
@@ -68,15 +49,9 @@ Note_performer::do_try_request( Request* req_l )
     if ( note_req_l_ )
        return false;
     
- // huh?
-//    if (req_l->musical() && (req_l->musical()->note() || req_l->musical()->rest()))
-//     note_req_l_ = req_l->musical()->rhythmic();
-    if ( req_l->musical() && req_l->musical()->note() )
-// huh?
-       note_req_l_ = req_l->musical()->melodic();
-    else
+    if ( !req_l->musical() || !req_l->musical()->note() )
        return false;
 
+    note_req_l_ = req_l->musical()->melodic();
     return true;
 }
-