From: fred Date: Sun, 24 Mar 2002 19:44:17 +0000 (+0000) Subject: lilypond-0.0.65 X-Git-Tag: release/1.5.59~4673 X-Git-Url: https://git.donarmstrong.com/?a=commitdiff_plain;h=21f47d764bd7314ca48fa70b6388204de77ce935;p=lilypond.git lilypond-0.0.65 --- diff --git a/lily/head-reg.cc b/lily/head-reg.cc index 562dbea654..b704f1803e 100644 --- a/lily/head-reg.cc +++ b/lily/head-reg.cc @@ -1,23 +1,23 @@ /* - headreg.cc -- part of LilyPond + headreg.cc -- part of GNU LilyPond (c) 1997 Han-Wen Nienhuys */ -#include "notehead.hh" +#include "note-head.hh" #include "head-reg.hh" #include "paper-def.hh" #include "complex-walker.hh" #include "musical-request.hh" -Notehead_register::Notehead_register() +Note_head_register::Note_head_register() { note_p_ = 0; post_move_processing(); } bool -Notehead_register::try_request(Request *req_l) +Note_head_register::try_request(Request *req_l) { if (req_l->note() || req_l->rest()) note_req_l_=req_l->rhythmic(); @@ -28,12 +28,12 @@ Notehead_register::try_request(Request *req_l) } void -Notehead_register::process_requests() +Note_head_register::process_requests() { if (!note_req_l_) return; - Notehead*n_p = new Notehead(8); // ugh + Note_head*n_p = new Note_head(8); // ugh note_p_ = n_p; n_p->set_rhythmic(note_req_l_->rhythmic()); @@ -45,7 +45,7 @@ Notehead_register::process_requests() if (note_req_l_->rhythmic()->duration_.type_i_ <= 2) note_p_->translate( Offset(0, - 6 * paper()->internote())); + 6 * paper()->internote_f())); } Score_elem_info itinf(note_p_,note_req_l_); @@ -53,7 +53,7 @@ Notehead_register::process_requests() } void -Notehead_register::pre_move_processing() +Note_head_register::pre_move_processing() { if (note_p_) { typeset_element(note_p_); @@ -61,10 +61,10 @@ Notehead_register::pre_move_processing() } } void -Notehead_register::post_move_processing() +Note_head_register::post_move_processing() { note_req_l_ = 0; } -IMPLEMENT_STATIC_NAME(Notehead_register); -ADD_THIS_REGISTER(Notehead_register); +IMPLEMENT_STATIC_NAME(Note_head_register); +ADD_THIS_REGISTER(Note_head_register); diff --git a/lily/include/head-reg.hh b/lily/include/head-reg.hh index 09941a0554..5e47743db1 100644 --- a/lily/include/head-reg.hh +++ b/lily/include/head-reg.hh @@ -1,5 +1,5 @@ /* - headreg.hh -- part of LilyPond + headreg.hh -- part of GNU LilyPond (c) 1997 Han-Wen Nienhuys */ @@ -9,17 +9,17 @@ #define HEADREG_HH #include "register.hh" -struct Notehead_register : Request_register { - Notehead* note_p_; +struct Note_head_register : Request_register { + Note_head* note_p_; Rhythmic_req * note_req_l_; /* *************** */ - Notehead_register(); + Note_head_register(); virtual bool try_request(Request *req_l) ; virtual void process_requests(); virtual void pre_move_processing(); virtual void post_move_processing(); - NAME_MEMBERS(Notehead_register); + NAME_MEMBERS(Note_head_register); }; diff --git a/lily/include/note-head.hh b/lily/include/note-head.hh new file mode 100644 index 0000000000..4a1bf349eb --- /dev/null +++ b/lily/include/note-head.hh @@ -0,0 +1,51 @@ +/* + note-head.hh -- part of GNU LilyPond + + (c) 1996,97 Han-Wen Nienhuys +*/ + +#ifndef NOTEHEAD_HH +#define NOTEHEAD_HH + +#include "item.hh" + +/** ball at the end of the stem takes care of: + + * help lines + * proper placing of dots + + It also is the item for a Rest + + */ + +class Note_head : public Item { +public: + NAME_MEMBERS(Note_head); + + bool rest_b_; + int position_i_; + + /// -1 = lowest, 0 = inside, 1 = top + int extremal_i_; + + /// needed for the help-lines + int staff_size_i_; + int dots_i_; + int balltype_i_; + int x_dir_i_; + + /* *************** */ + + void set_rhythmic(Rhythmic_req *); + + /** + position of top line (5 linestaff: 8) + */ + Note_head(int staff_size); + static int compare(Note_head * const &a, Note_head *const &b) ; +protected: + virtual void do_print()const; + virtual Molecule* brew_molecule_p()const; +}; +#endif // NOTEHEAD_HH + diff --git a/lily/include/tie.hh b/lily/include/tie.hh index 7f03564866..81c356dd7f 100644 --- a/lily/include/tie.hh +++ b/lily/include/tie.hh @@ -1,7 +1,7 @@ /* tie.hh -- declare Tie - source file of the LilyPond music typesetter + source file of the GNU LilyPond music typesetter (c) 1997 Han-Wen Nienhuys */ @@ -12,17 +12,23 @@ #include "bow.hh" +/** + Connect two noteheads. + */ class Tie : public Bow { - virtual Spanner* do_break_at(PCol*,PCol*)const; virtual void do_add_processing(); virtual void do_post_processing(); virtual void set_default_dir(); + virtual void do_substitute_dependency(Score_elem*,Score_elem*); + public: bool same_pitch_b_; - Notehead * left_head_l_; - Notehead * right_head_l_; - void set_head(int, Notehead*head_l); + Note_head * left_head_l_; + Note_head * right_head_l_; + void set_head(int, Note_head*head_l); + Tie(); - + NAME_MEMBERS(Tie); + SPANNER_CLONE(Tie) }; #endif // TIE_HH diff --git a/lily/local-key-reg.cc b/lily/local-key-reg.cc index 9e014e7c75..9569ab10a4 100644 --- a/lily/local-key-reg.cc +++ b/lily/local-key-reg.cc @@ -13,7 +13,7 @@ #include "debug.hh" #include "key-item.hh" #include "tie.hh" -#include "notehead.hh" +#include "note-head.hh" Local_key_register::Local_key_register() { diff --git a/lily/note-column-reg.cc b/lily/note-column-reg.cc index feee0c66b5..8ea7cc2d68 100644 --- a/lily/note-column-reg.cc +++ b/lily/note-column-reg.cc @@ -1,13 +1,13 @@ /* note-column-reg.cc -- implement Note_column_register - source file of the LilyPond music typesetter + source file of the GNU LilyPond music typesetter (c) 1997 Han-Wen Nienhuys */ #include "note-column-reg.hh" -#include "notehead.hh" +#include "note-head.hh" #include "stem.hh" #include "note-column.hh" #include "script.hh" @@ -17,7 +17,7 @@ bool Note_column_register::acceptable_elem_b(Score_elem const*elem_C)const { char const*nC = elem_C->name(); - return (nC == Script::static_name() || nC == Notehead::static_name() + return (nC == Script::static_name() || nC == Note_head::static_name() || nC == Stem::static_name()); } Note_column* @@ -51,8 +51,8 @@ Note_column_register::acknowledge_element(Score_elem_info i) if (nC == Script::static_name()) { script_l_arr_.push((Script*)i.elem_l_->item()); - } else if (nC == Notehead::static_name()) { - Notehead * h_l = (Notehead*)i.elem_l_->item(); + } else if (nC == Note_head::static_name()) { + Note_head * h_l = (Note_head*)i.elem_l_->item(); if (h_l->rest_b_) rest_col_l()->add(h_l); else @@ -104,7 +104,7 @@ Note_column_register::set_feature(Feature i) if (i.type_ == "vdir") dir_i_ = i.value_; if (i.type_ == "hshift") - h_shift_b_ = i.value_; + h_shift_b_ = (bool)(int)i.value_; } Note_column_register::Note_column_register() diff --git a/lily/notehead.cc b/lily/notehead.cc index 6e6ca348d9..ccfffcc2b5 100644 --- a/lily/notehead.cc +++ b/lily/notehead.cc @@ -1,5 +1,5 @@ #include "misc.hh" -#include "notehead.hh" +#include "note-head.hh" #include "dimen.hh" #include "debug.hh" #include "paper-def.hh" @@ -9,7 +9,7 @@ -Notehead::Notehead(int ss) +Note_head::Note_head(int ss) { x_dir_i_ = 0; staff_size_i_=ss; @@ -21,16 +21,18 @@ Notehead::Notehead(int ss) } void -Notehead::set_rhythmic(Rhythmic_req*r_req_l) +Note_head::set_rhythmic(Rhythmic_req*r_req_l) { balltype_i_ = r_req_l->duration_.type_i_; + if (balltype_i_ > 4) + balltype_i_ = 4; dots_i_ = r_req_l->duration_.dots_i_; } -IMPLEMENT_STATIC_NAME(Notehead); +IMPLEMENT_STATIC_NAME(Note_head); void -Notehead::do_print()const +Note_head::do_print()const { #ifndef NPRINT if (rest_b_) @@ -42,18 +44,18 @@ Notehead::do_print()const int -Notehead::compare(Notehead *const &a, Notehead * const &b) +Note_head::compare(Note_head *const &a, Note_head * const &b) { return a->position_i_ - b->position_i_; } Molecule* -Notehead::brew_molecule_p() const +Note_head::brew_molecule_p() const { Molecule*out = 0; Paper_def *p = paper(); - Real dy = p->internote(); + Real dy = p->internote_f(); Symbol s; if (!rest_b_) s = p->lookup_l()->ball(balltype_i_); diff --git a/lily/register.cc b/lily/register.cc index 7710ddf87d..7a846bd6a5 100644 --- a/lily/register.cc +++ b/lily/register.cc @@ -1,7 +1,7 @@ /* register.cc -- implement Request_register - Sourcefile of LilyPond musictypesetter + Sourcefile of GNU LilyPond musictypesetter (c) 1997 Han-Wen Nienhuys */ @@ -9,10 +9,9 @@ #include "voice.hh" #include "musical-request.hh" #include "register.hh" -#include "notehead.hh" +#include "note-head.hh" #include "complex-walker.hh" #include "local-key-item.hh" -#include "complex-staff.hh" #include "register-group.hh" #include "debug.hh" diff --git a/lily/stem-beam-reg.cc b/lily/stem-beam-reg.cc index 6304020500..9fed099da2 100644 --- a/lily/stem-beam-reg.cc +++ b/lily/stem-beam-reg.cc @@ -1,5 +1,5 @@ /* - stem-beam-reg.cc -- part of LilyPond + stem-beam-reg.cc -- part of GNU LilyPond (c) 1997 Han-Wen Nienhuys */ @@ -11,10 +11,9 @@ #include "grouping.hh" #include "text-spanner.hh" #include "complex-walker.hh" -#include "complex-staff.hh" #include "debug.hh" #include "grouping.hh" -#include "notehead.hh" +#include "note-head.hh" Stem_beam_register::Stem_beam_register() { @@ -79,7 +78,7 @@ Stem_beam_register::process_requests() } if (stem_req_l_) { - stem_p_ = new Stem(10); + stem_p_ = new Stem(8); if (current_grouping) current_grouping->add_child( get_staff_info().time_C_->whole_in_measure_, @@ -107,9 +106,9 @@ Stem_beam_register::acknowledge_element(Score_elem_info info) if (!stem_p_) return; - if (info.elem_l_->name() == Notehead::static_name() && + if (info.elem_l_->name() == Note_head::static_name() && stem_req_l_->duration() == info.req_l_->rhythmic()->duration()){ - Notehead * n_l= (Notehead*)info.elem_l_->item(); + Note_head * n_l= (Note_head*)info.elem_l_->item(); stem_p_->add(n_l); } } diff --git a/lily/tie-reg.cc b/lily/tie-reg.cc index 3d75818870..2b8fe5d642 100644 --- a/lily/tie-reg.cc +++ b/lily/tie-reg.cc @@ -1,14 +1,14 @@ /* tie-reg.cc -- implement Tie_register - source file of the LilyPond music typesetter + source file of the GNU LilyPond music typesetter (c) 1997 Han-Wen Nienhuys */ #include "tie-reg.hh" #include "tie.hh" -#include "notehead.hh" +#include "note-head.hh" #include "musical-request.hh" #include "voice-element.hh" @@ -73,14 +73,14 @@ Tie_register::process_requests() void Tie_register::acknowledge_element(Score_elem_info i) { - if (i.elem_l_->name() == Notehead::static_name()) { + if (i.elem_l_->name() == Note_head::static_name()) { if (tie_p_) { - tie_p_->set_head(-1, (Notehead*)i.elem_l_->item()); + tie_p_->set_head(-1, (Note_head*)i.elem_l_->item()); melodic_req_l_ = i.req_l_->musical()->melodic(); } if (end_tie_p_) { - end_tie_p_->set_head(1, (Notehead*)i.elem_l_->item()); + end_tie_p_->set_head(1, (Note_head*)i.elem_l_->item()); if (!Melodic_req::compare ( *end_melodic_req_l_, *melodic_req_l_)) end_tie_p_->same_pitch_b_ = true; announce_element(Score_elem_info(end_tie_p_,end_req_l_)); diff --git a/mi2mu/include/mi2mu-proto.hh b/mi2mu/include/mi2mu-proto.hh new file mode 100644 index 0000000000..af0d543033 --- /dev/null +++ b/mi2mu/include/mi2mu-proto.hh @@ -0,0 +1,28 @@ +/* + mi2mu-proto.hh -- declare type names in mi2mu + + source file of mi2mu, part of the GNU LilyPond package, + + (c) 1997 Han-Wen Nienhuys +*/ + + +#ifndef MI2MU_PROTO_HH +#define MI2MU_PROTO_HH + + +struct Lily_stream ; +class Midi_event ; +class Midi_key ; +class Midi_note ; +class Midi_tempo ; +class Midi_text ; +class Midi_time ; +class Midi_score ; +class Midi_track ; +class Midi_voice ; +class My_midi_lexer ; +class My_midi_parser ; +class Track_column ; + +#endif // MI2MU_PROTO_HH diff --git a/mi2mu/include/mi2mu.hh b/mi2mu/include/mi2mu.hh index 5d381cedd0..a7e877f301 100644 --- a/mi2mu/include/mi2mu.hh +++ b/mi2mu/include/mi2mu.hh @@ -19,6 +19,7 @@ #include #include +#include "mi2mu-proto.hh" #include "proto.hh" #include "plist.hh" #include "warn.hh"