From: fred Date: Sun, 24 Mar 2002 19:44:26 +0000 (+0000) Subject: lilypond-0.0.65 X-Git-Tag: release/1.5.59~4664 X-Git-Url: https://git.donarmstrong.com/?a=commitdiff_plain;h=c9c7d6591e0f48ac7c3d917254551f7beb482088;p=lilypond.git lilypond-0.0.65 --- diff --git a/Documentation/lilygut.pod b/Documentation/lilygut.pod index 9bd3013c12..3278492c6b 100644 --- a/Documentation/lilygut.pod +++ b/Documentation/lilygut.pod @@ -62,11 +62,12 @@ natural form for processing music. =item Processing: Requests are processed and used to create elements (like balls, stems, -slurs etc). This is done by a hierarchy of brokers, which swallow -requests, broadcast them and couple different elements. +slurs etc). This is done by a hierarchy of "brokers" (called +Register), which swallow requests, broadcast them and couple different +elements. In this step data-structures for the next steps are created and filled -with data: PScore, PCol, PStaff +with data: PScore, PCol. =item Preprocessing @@ -75,8 +76,15 @@ Some dependencies are resolved, such as the direction of stems, beams, =item Calculation: This step uses structures which have names starting with 'P'. -linebreaks and horizontal positions of PCols are determined. Line_of_* -generated. +linebreaks and horizontal positions of PCols are determined. + +Through some magical interactions with Line_of_score and Super_elem +(check out the source) the "lines" are produced. + +All other spanners can figure across which lines they are spread. If +applicable, they break themselves into pieces. After this, each piece +works (or, if there are no pieces) the spanner throws out any +dependencies which are in the wrong line. =item Postprocesing: @@ -321,9 +329,9 @@ In music symbols depend on each other: the stems of a beam should point in the same direction as the beam itself, so the stems of a beam depend on the beam. In the same way do scripts depend on the direction of the stem. To reflect this, LilyPond has the notion of dependency. -It works in the same fashion that make uses to build programs: before +It works in the same fashion that C uses to build programs: before a stem is calculated, its dependencies (the beam) should be -calculated. Before a slur is calculated, its dependencies (stems) +calculated. Before a slur is calculated, its dependencies (stems, noteheads) should be calculated. =head1 BREAKING diff --git a/lily/include/local-key-item.hh b/lily/include/local-key-item.hh index 2371277bb0..24f48e3115 100644 --- a/lily/include/local-key-item.hh +++ b/lily/include/local-key-item.hh @@ -1,5 +1,5 @@ /* - local-key-item.hh -- part of LilyPond + local-key-item.hh -- part of GNU LilyPond (c) 1996,97 Han-Wen Nienhuys */ @@ -18,11 +18,14 @@ struct Local_acc { /** Accidentals which can be different for each octave. + + TODO: + update item if Items are removed */ struct Local_key_item : Item { NAME_MEMBERS(Local_key_item); Array accs; - Array support_items_; + Link_array support_items_; int c0_position; /* *************** */ @@ -31,8 +34,10 @@ struct Local_key_item : Item { void add(Item*); void add(int oct, int pitch, int acc); void add(Melodic_req*); - void do_pre_processing(); - Molecule* brew_molecule_p()const; +public: + virtual void do_pre_processing(); + virtual void do_substitute_dependency(Score_elem*,Score_elem*); + virtual Molecule* brew_molecule_p()const; }; #endif // LOCALKEYITEM_HH diff --git a/lily/include/rest-column.hh b/lily/include/rest-column.hh index a753c61d93..803e00a294 100644 --- a/lily/include/rest-column.hh +++ b/lily/include/rest-column.hh @@ -1,7 +1,7 @@ /* rest-column.hh -- declare Rest_column - source file of the LilyPond music typesetter + source file of the GNU LilyPond music typesetter (c) 1997 Han-Wen Nienhuys */ @@ -17,13 +17,15 @@ only produce one rest. */ class Rest_column : public Script_column { - Array head_l_arr_; + Link_array head_l_arr_; public: int dir_i_; - void add(Notehead *); + void add(Note_head *); NAME_MEMBERS(Rest_column); void translate_y(Real dy); Rest_column(); +protected: + virtual void do_substitute_dependency(Score_elem*, Score_elem*); }; #endif // REST_COLUMN_HH diff --git a/lily/local-key-item.cc b/lily/local-key-item.cc index f6d8b9ba7f..50aba0bf41 100644 --- a/lily/local-key-item.cc +++ b/lily/local-key-item.cc @@ -1,7 +1,7 @@ /* local-key-item.cc -- implement Local_key_item, Local_acc - source file of the LilyPond music typesetter + source file of the GNU LilyPond music typesetter (c) 1997 Han-Wen Nienhuys */ @@ -12,7 +12,7 @@ #include "lookup.hh" #include "paper-def.hh" #include "musical-request.hh" -#include "notehead.hh" +#include "note-head.hh" #include "misc.hh" @@ -65,7 +65,7 @@ Local_key_item::brew_molecule_p()const // do one octave if (accs[i].octave_i_ != lastoct) { if (octmol){ - Real dy =lastoct*7*paper()->internote(); + Real dy =lastoct*7*paper()->internote_f(); octmol->translate(Offset(0, dy)); output->add(*octmol); delete octmol; @@ -75,14 +75,14 @@ Local_key_item::brew_molecule_p()const lastoct = accs[i].octave_i_; Symbol s =paper()->lookup_l()->accidental(accs[i].accidental_i_); Atom a(s); - Real dy = (accs[i].name_i_ + c0_position) * paper()->internote(); + Real dy = (accs[i].name_i_ + c0_position) * paper()->internote_f(); a.translate(Offset(0,dy)); octmol->add_right(a); } if (octmol){ - Real dy =lastoct*7*paper()->internote(); + Real dy =lastoct*7*paper()->internote_f(); octmol->translate(Offset(0, dy)); output->add(*octmol); delete octmol; @@ -105,3 +105,12 @@ Local_acc::compare(Local_acc&a, Local_acc&b) return a.accidental_i_ - b.accidental_i_; }; IMPLEMENT_STATIC_NAME(Local_key_item); + +void +Local_key_item::do_substitute_dependency(Score_elem*o,Score_elem*n) +{ + Item* o_l = o->item(); + Item* n_l = n?n->item():0; + + support_items_.substitute(o_l, n_l); +}