X-Git-Url: https://git.donarmstrong.com/?a=blobdiff_plain;f=lily%2Faudio-item.cc;h=d72adbcc7d9011031e3a73f3fd0244e7b2d85338;hb=f459e523e2df1d26a854b4ff1e1d2f18189a7287;hp=36e11807b097e0d64bce4377eb443f81f28600c0;hpb=8aad615ea7bb31f49a0c2afc21eea5ff5de20437;p=lilypond.git diff --git a/lily/audio-item.cc b/lily/audio-item.cc index 36e11807b0..d72adbcc7d 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--1999 Jan Nieuwenhuizen + (c) 1997--2004 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() +Audio_instrument::Audio_instrument (String instrument_string) { - return str_.length_i() ? new Midi_instrument(0, str_) : 0; + str_ = instrument_string; } - -Audio_item::Audio_item (Request* req_l) +Audio_item::Audio_item () { - audio_column_l_ = 0; - req_l_ = req_l; + audio_column_ = 0; } -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_ = 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; + per_minute_4_ = per_minute_4_i; } -Midi_item* -Audio_tempo::midi_item_p() +Audio_time_signature::Audio_time_signature (int beats, int one_beat) { - return new Midi_tempo (this); + beats_ = beats; + one_beat_ = one_beat; } - - -Audio_time_signature::Audio_time_signature (Request* req_l) - : Audio_item (req_l) +Audio_text::Audio_text (Audio_text::Type type, String text_string) { + text_string_ = text_string; + type_ = type; } -Midi_item* -Audio_time_signature::midi_item_p() +Audio_tie::Audio_tie () { - return new Midi_time_signature (this); + note_drul_[RIGHT] = 0; + note_drul_[LEFT] = 0; } - - -Audio_text::Audio_text (Audio_text::Type type, String text_str) - : Audio_item (0) +void +Audio_tie::set_note (Direction d, Audio_note* note) { - text_str_ = text_str; - type_ = type; -} + assert (!note_drul_[d]); + note_drul_[d] = note; + //set_bound (d, head); -Midi_item* -Audio_text::midi_item_p() -{ - return text_str_.length_i() ? new Midi_text(this) : 0; + // add_dependency (head); } - -void -Audio_item::do_print () const -{ -#ifndef NPRINT - if (audio_column_l_) - { - DOUT << "at: "<< audio_column_l_->at_mom (); - } - if (req_l_) - { - DOUT << "from: "; - req_l_->print (); - } -#endif -} -