X-Git-Url: https://git.donarmstrong.com/?a=blobdiff_plain;ds=sidebyside;f=lily%2Faudio-item.cc;h=6b5f43dce72be194962b9ff814d0d266cf813781;hb=3fc91138b05cfdd6b8446608eb1764cad85202f8;hp=409c4196b39ebe567735ac21368d4e6283fea8b5;hpb=615a9212789c2cb2994748c023d0e19f3a83a0fd;p=lilypond.git diff --git a/lily/audio-item.cc b/lily/audio-item.cc index 409c4196b3..6b5f43dce7 100644 --- a/lily/audio-item.cc +++ b/lily/audio-item.cc @@ -3,115 +3,86 @@ source file of the GNU LilyPond music typesetter - (c) 1997--1998 Jan Nieuwenhuizen + (c) 1997--2002 Jan Nieuwenhuizen */ #include "debug.hh" #include "audio-item.hh" #include "midi-item.hh" -#include "request.hh" #include "audio-column.hh" Audio_instrument::Audio_instrument (String instrument_str) - : Audio_item (0) { str_ = instrument_str; } -Midi_item* -Audio_instrument::midi_item_p() -{ - return str_.length_i() ? new Midi_instrument(0, str_) : 0; -} - - -Audio_item::Audio_item (Request* req_l) +Audio_item::Audio_item () { audio_column_l_ = 0; - req_l_ = req_l; } -Audio_key::Audio_key (Request* req_l) - : Audio_item (req_l) +Audio_note::Audio_note (Pitch p, Moment m, int transposing_i) { + pitch_ = p; + length_mom_ = m; + tied_ = 0; + transposing_i_ = transposing_i; } -Midi_item* -Audio_key::midi_item_p() +void +Audio_note::tie_to (Audio_note* t) { - return new Midi_key (this); + tied_ = t; + Audio_note* first = t; + while (first->tied_) + first = first->tied_; + first->length_mom_ += length_mom_; + length_mom_ = 0; } - -Audio_note::Audio_note (Request* req_l, int transposing_i) - : Audio_item (req_l) + +Audio_key::Audio_key (int acc, bool major) { - transposing_i_ = transposing_i; + accidentals_=acc; + major_=major; } -Midi_item* -Audio_note::midi_item_p() +Audio_dynamic::Audio_dynamic (Real volume) { - return new Midi_note (this); + volume_ = volume; } - - Audio_tempo::Audio_tempo (int per_minute_4_i) - : Audio_item (0) { per_minute_4_i_ = per_minute_4_i; } -Midi_item* -Audio_tempo::midi_item_p() -{ - return new Midi_tempo (this); -} - - - -Audio_time_signature::Audio_time_signature (Request* req_l) - : Audio_item (req_l) +Audio_time_signature::Audio_time_signature (int beats, int one_beat) { + beats_i_ = beats; + one_beat_i_ = one_beat; } -Midi_item* -Audio_time_signature::midi_item_p() -{ - return new Midi_time_signature (this); -} - - - Audio_text::Audio_text (Audio_text::Type type, String text_str) - : Audio_item (0) { text_str_ = text_str; type_ = type; } -Midi_item* -Audio_text::midi_item_p() +Audio_tie::Audio_tie () { - return text_str_.length_i() ? new Midi_text(this) : 0; + note_l_drul_[RIGHT] = 0; + note_l_drul_[LEFT] = 0; } - - - void -Audio_item::do_print () const +Audio_tie::set_note (Direction d, Audio_note* note_l) { -#ifndef NPRINT - if (audio_column_l_) - { - DOUT << "at: "<< audio_column_l_->at_mom (); - } - if (req_l_) - { - DOUT << "from: "; - req_l_->print (); - } -#endif + assert (!note_l_drul_[d]); + note_l_drul_[d] = note_l; + //set_bound (d, head_l); + + // add_dependency (head_l); } + +