From: fred Date: Sun, 24 Mar 2002 19:53:17 +0000 (+0000) Subject: lilypond-0.1.7 X-Git-Tag: release/1.5.59~4148 X-Git-Url: https://git.donarmstrong.com/?a=commitdiff_plain;h=42d8fb99ebe096c9468d0e0c636562165a0a4c5d;p=lilypond.git lilypond-0.1.7 --- diff --git a/lily/note-performer.cc b/lily/note-performer.cc index 430e33c7c7..5471110e90 100644 --- a/lily/note-performer.cc +++ b/lily/note-performer.cc @@ -1,6 +1,8 @@ /* note-performer.cc -- implement Note_performer + source file of the GNU LilyPond music typesetter + (c) 1996, 1997 Jan Nieuwenhuizen */ @@ -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; } -