From: Jan Nieuwenhuizen Date: Sat, 23 Jan 1999 15:20:13 +0000 (+0100) Subject: patch::: 1.1.23.jcn5: URG? X-Git-Tag: release/1.1.24~6 X-Git-Url: https://git.donarmstrong.com/?a=commitdiff_plain;h=27b7a223db56f4b39f73268d0ee20a3b90c0944b;p=lilypond.git patch::: 1.1.23.jcn5: URG? pl 23.jcn5 - verder hakken aan repeat-engraver URG --- Generated by janneke@gnu.org using package-diff 0.62, >From = lilypond-1.1.23.jcn4, To = lilypond-1.1.23.jcn5 usage cd lilypond-source-dir; patch -E -p1 < lilypond-1.1.23.jcn5.diff Patches do not contain automatically generated files or (urg) empty directories, i.e., you should rerun autoconf, configure and possibly make outdirs. --state 1.1.23.jcn4 1.1.23.jcn5 ++state --- diff --git a/NEWS b/NEWS index ed8d4e1d1d..fc1703b340 100644 --- a/NEWS +++ b/NEWS @@ -1,4 +1,12 @@ ---- ../lilypond-1.1.23.jcn3/NEWS Thu Jan 21 18:57:17 1999 +--- ../lilypond-1.1.23.jcn4/NEWS Fri Jan 22 17:54:13 1999 +++ b/NEWS Sat Jan 23 16:13:25 1999 +@@ -1,3 +1,6 @@ +pl 23.jcn5 + - verder hakken aan repeat-engraver URG + + pl 23.jcn4 + - hakken aan repeat-engaver + --- ../lilypond-1.1.23.jcn3/NEWS Thu Jan 21 18:57:17 1999 ++ b/NEWS Fri Jan 22 17:54:13 1999 @@ -1,3 +1,6 @@ pl 23.jcn4 diff --git a/VERSION b/VERSION index 12248a04ab..34dd45d4d9 100644 --- a/VERSION +++ b/VERSION @@ -2,7 +2,7 @@ PACKAGE_NAME=LilyPond MAJOR_VERSION=1 MINOR_VERSION=1 PATCH_LEVEL=23 -MY_PATCH_LEVEL=jcn4 +MY_PATCH_LEVEL=jcn5 # use the above to send patches: MY_PATCH_LEVEL is always empty for a # released version. diff --git a/input/test/repeat.ly b/input/test/repeat.ly index 914b665f96..7abd8c0b8c 100644 --- a/input/test/repeat.ly +++ b/input/test/repeat.ly @@ -1,18 +1,13 @@ \score{ < \type Staff \notes\relative c'{ - c d e f + c4 d e f \repeat 2 { g a b c } - \alternative { { c b a g } { f e d c } } - } - \type Lyrics \lyrics { - De eer- ste < { maat } { moet } > - \repeat 2 { } - \alternative < - { en dan twee keer } - { een koe- plet _ } - > - en dan nog dit er ach- ter aan +% \alternative { { c b a g } { f e d c } } c c c c + \alternative { { c b a g } { f e d c } { c d e f } } + g g g g + \repeat 2 { c c c c } + \repeat 2 { c c c c } } > } diff --git a/lily/bar-engraver.cc b/lily/bar-engraver.cc index 62b5f70ffd..59ab434cf6 100644 --- a/lily/bar-engraver.cc +++ b/lily/bar-engraver.cc @@ -19,7 +19,6 @@ Bar_engraver::Bar_engraver() { bar_p_ =0; - bar_l_ =0; do_post_move_processing(); } @@ -45,8 +44,8 @@ Bar_engraver::acknowledge_element (Score_element_info i) { if (Bar *b = dynamic_cast (i.elem_l_)) { - bar_l_ = b; - // auto_create_bar_b_ = false; + // only bar-engraver should create bars + assert (0); } } @@ -67,6 +66,30 @@ Bar_engraver::create_bar () } } +void +Bar_engraver::request_bar (String type_str) +{ +#if 0 // will dump core at announce_element (invalid daddy_grav_l_...) + create_bar (); +#else + if (!bar_p_) + { + bar_p_ = new Bar; + bar_p_->break_priority_i_ = 0; + // urg: "" != empty... + String default_type = get_property ("defaultBarType", 0); + if (default_type.length_i ()) + { + bar_p_->type_str_ = default_type; + } + } +#endif + if (((type_str == "|:") && (bar_p_->type_str_ == ":|")) + || ((type_str == ":|") && (bar_p_->type_str_ == "|:"))) + bar_p_->type_str_ = ":|:"; + else + bar_p_->type_str_ = type_str; +} void Bar_engraver::do_creation_processing () @@ -93,9 +116,7 @@ Bar_engraver::do_process_requests() Time_description const *time = get_staff_info().time_C_; if (bar_req_l_) { - if (!bar_p_) - create_bar (); - + create_bar (); bar_p_->type_str_ = bar_req_l_->type_str_; } else @@ -110,16 +131,7 @@ Bar_engraver::do_process_requests() } } - /* - hmm, perhaps it's Better to create empty bars if you want none - displayed, and keep bars for breakpoints ? - */ -#if 0 - if ((time && time->whole_in_measure_) - && !always.to_bool () - && !bar_p_ && !bar_l_) -#endif - if (!bar_p_ && !bar_l_) + if (!bar_p_) { Break_req r; r.penalty_i_ = Break_req::DISALLOW; @@ -131,15 +143,6 @@ Bar_engraver::do_process_requests() void Bar_engraver::do_pre_move_processing() { - if (bar_l_) - { - bar_l_ = 0; - if (bar_p_) - { - bar_p_->unlink (); - bar_p_ = 0; - } - } if (bar_p_) { typeset_element (bar_p_); diff --git a/lily/include/bar-engraver.hh b/lily/include/bar-engraver.hh index 7d52fafe67..a626178f84 100644 --- a/lily/include/bar-engraver.hh +++ b/lily/include/bar-engraver.hh @@ -7,26 +7,22 @@ */ -#ifndef BARGRAV_HH -#define BARGRAV_HH +#ifndef BAR_ENGRAVER_HH +#define BAR_ENGRAVER_HH + #include "engraver.hh" /** generate bars. Either user ("|:"), or default (new measure) */ -class Bar_engraver : public Engraver { - Bar_req * bar_req_l_; - Bar * bar_p_; - Bar * bar_l_; - bool auto_create_bar_b_; - - void create_bar (); +class Bar_engraver : public Engraver +{ public: - VIRTUAL_COPY_CONS(Translator); Bar_engraver(); + VIRTUAL_COPY_CONS(Translator); - - + void request_bar (String type_str); + protected: virtual void acknowledge_element (Score_element_info i); virtual void do_creation_processing (); @@ -35,6 +31,13 @@ protected: virtual void do_process_requests(); virtual void do_pre_move_processing(); virtual void do_post_move_processing(); + +private: + void create_bar (); + + Bar_req * bar_req_l_; + Bar * bar_p_; + bool auto_create_bar_b_; }; -#endif // BARGRAV_HH +#endif // BAR_ENGRAVER_HH diff --git a/lily/include/volta-spanner.hh b/lily/include/volta-spanner.hh index cf8c1b32d5..a64f7ef08a 100644 --- a/lily/include/volta-spanner.hh +++ b/lily/include/volta-spanner.hh @@ -32,6 +32,7 @@ protected: VIRTUAL_COPY_CONS (Score_element); virtual void do_add_processing (); + virtual Interval do_height () const; virtual void do_post_processing (); virtual void do_substitute_dependency (Score_element*,Score_element*); }; diff --git a/lily/repeat-engraver.cc b/lily/repeat-engraver.cc index 472b849b0d..f8d438d258 100644 --- a/lily/repeat-engraver.cc +++ b/lily/repeat-engraver.cc @@ -8,6 +8,7 @@ #include "repeat-engraver.hh" #include "bar.hh" +#include "bar-engraver.hh" #include "musical-request.hh" #include "multi-measure-rest.hh" #include "command-request.hh" @@ -17,6 +18,7 @@ #include "time-description.hh" #include "volta-spanner.hh" #include "note-column.hh" +#include "paper-def.hh" ADD_THIS_TRANSLATOR (Repeat_engraver); @@ -99,26 +101,58 @@ Repeat_engraver::do_removal_processing () typeset_element (volta_p_arr_[i]); } +#define URG + void Repeat_engraver::do_process_requests () { Moment now = now_moment (); + Time_description const *time = get_staff_info().time_C_; + Bar_engraver* bar_engraver_l = dynamic_cast + (paper ()->find_translator_l ("Bar_engraver")); for (int i = bar_p_arr_.size (); i < repeated_music_arr_.size (); i++) { - Bar* bar_p = new Bar; - bar_p-> type_str_ = "|:"; - bar_p_arr_.push (bar_p); - if (now > Moment (0)) - announce_element (Score_element_info (bar_p, repeated_music_arr_[i])); +#ifndef URG + //suck me plenty + // nou hw, ik heb 't geprobeerd, maar ik snap er geen ruk van: + // zodra ik het via gevonden bar-engraver doe, dumpt ze koor + // in create_bar::announce_element, of ze zet helemaal geen ":|". + // het lijkt erop alsof ik een heel andere bar-engraver vind + // dan die ik zoek, ofzo?? + if (bar_engraver_l && (now > Moment (0))) + bar_engraver_l->request_bar (":|"); + else +#endif + if (now > Moment (0)) + { + Bar* bar_p = new Bar; + bar_p-> type_str_ = "|:"; + bar_p_arr_.push (bar_p); +#ifndef URG + announce_element (Score_element_info (bar_p, + repeated_music_arr_[i])); +#endif + } } for (int i = 0; i < bar_p_arr_.size (); i++) { if (!bar_p_arr_[i] && (now >= stop_mom_arr_[i])) { - Bar* bar_p = new Bar; - bar_p-> type_str_ = ":|"; - bar_p_arr_[i] = bar_p; - announce_element (Score_element_info (bar_p, repeated_music_arr_[i])); +#ifndef URG + //suck me plenty + if (bar_engraver_l) + bar_engraver_l->request_bar ("|:"); + else +#endif + { + Bar* bar_p = new Bar; + bar_p-> type_str_ = ":|"; + bar_p_arr_[i] = bar_p; +#ifndef URG + announce_element (Score_element_info (bar_p, + repeated_music_arr_[i])); +#endif + } } } int bees = volta_p_arr_.size (); diff --git a/lily/volta-spanner.cc b/lily/volta-spanner.cc index 2a25bb47b3..b0c5ea4b7d 100644 --- a/lily/volta-spanner.cc +++ b/lily/volta-spanner.cc @@ -86,6 +86,16 @@ Volta_spanner::do_add_processing () dot_p_->style_str_ = "bold"; } +Interval +Volta_spanner::do_height () const +{ + /* + in most cases, it's a lot better not no have height... + */ + Interval i; + return i; +} + void Volta_spanner::do_post_processing () {