From: Jan Nieuwenhuizen Date: Sun, 13 Aug 2000 13:50:59 +0000 (+0200) Subject: patch::: 1.3.77.jcn2 X-Git-Tag: release/1.3.78~4 X-Git-Url: https://git.donarmstrong.com/?a=commitdiff_plain;h=51f16c19ef686979a6a36709226ec6022eb86c0a;p=lilypond.git patch::: 1.3.77.jcn2 * fixed problem with HaraKiri * fixed problem with dynamicDirection * fixed problem with nonEmptyText --- Generated by janneke@gnu.org, From = lilypond-1.3.77.jcn1, To = lilypond-1.3.77.jcn2 usage cd lilypond-source-dir; patch -E -p1 < lilypond-1.3.77.jcn2.diff Patches do not contain automatically generated files or (urg) empty directories, i.e., you should rerun autoconf, configure --- diff --git a/CHANGES b/CHANGES index 8557f84f9a..bc42e868b4 100644 --- a/CHANGES +++ b/CHANGES @@ -1,4 +1,16 @@ ---- ../lilypond-1.3.77/CHANGES Tue Aug 8 16:14:36 2000 +--- ../lilypond-1.3.77.jcn1/CHANGES Wed Aug 9 23:30:23 2000 +++ b/CHANGES Sun Aug 13 15:50:59 2000 +@@ -1,3 +1,10 @@ +* fixed problem with HaraKiri + +* fixed problem with dynamicDirection + +* fixed problem with nonEmptyText + + + 1.3.77.jcn1 + =========== + --- ../lilypond-1.3.77/CHANGES Tue Aug 8 16:14:36 2000 ++ b/CHANGES Wed Aug 9 23:30:23 2000 @@ -1,3 +1,15 @@ 1.3.77.jcn1 diff --git a/VERSION b/VERSION index dbc859e82d..30db784b63 100644 --- a/VERSION +++ b/VERSION @@ -2,7 +2,7 @@ PACKAGE_NAME=LilyPond MAJOR_VERSION=1 MINOR_VERSION=3 PATCH_LEVEL=77 -MY_PATCH_LEVEL=jcn1 +MY_PATCH_LEVEL=jcn2 # use the above to send patches: MY_PATCH_LEVEL is always empty for a # released version. diff --git a/input/bugs/dynamic-dir.ly b/input/bugs/dynamic-dir.ly deleted file mode 100644 index e56db38adf..0000000000 --- a/input/bugs/dynamic-dir.ly +++ /dev/null @@ -1,12 +0,0 @@ -%non of the dynamics properties work anymore - -\score { - \context Voice \notes\relative c { - \property Voice.verticalDirection = #-1 - \property Voice.dynamicVerticalDirection = #-1 - \property Voice.dynamicDirection = #-1 - \property Voice.dynamicPadding = #40 - c \p c \< \! c \ff\> c \!c-\p - - } -} diff --git a/input/bugs/orchestscore.ly b/input/bugs/orchestscore.ly deleted file mode 100644 index 8ad6ae4ffd..0000000000 --- a/input/bugs/orchestscore.ly +++ /dev/null @@ -1,109 +0,0 @@ -% -% Hara-kiri leaves a big gap -% - -\version "1.3.59"; - -m = \notes \relative c''{ - -c1 | c2 c | c c | c c | \break c c | c c | c c | c c | -} - -M = \notes \relative c''{ - -c1 | c2 c | c c | R1*5 -} - -\score{ < - \context StaffGroup = wood < - \context Staff = flauto < - \property Staff.instrument = "Flauto" - \property Staff.instr = "Fl." - \m - > - \context Staff = oboe < - \property Staff.instrument = "Oboe" - \property Staff.instr = "Ob." - \m - > - \context Staff = clarI < - \property Staff.instrument = "Clarinetto I" - \property Staff.instr = "Cl. I" - \m - > - \context Staff = clarII < - \property Staff.instrument = "Clarinetto II" - \property Staff.instr = "Cl. II" - \m - > - \context Staff = fagotto < - \property Staff.instrument = "Fagotto" - \property Staff.instr = "Fg." - \m - > - > - \context StaffGroup = brass < - \context Staff = cor < - \property Staff.instrument = "2 Corni in F" - \property Staff.instr = "Cor." - \context Voice = corI { \stemup \M } - \context Voice = corII { \stemdown \M } - > - \context Staff = trp < - \property Staff.instrument = "2 Trp. in B\\textflat " - \property Staff.instr = "Trp." - \context Voice = trpI { \stemup \M } - \context Voice = trpII { \stemdown \M } - > - > - \context StaffGroup = percussion <\context Staff = timpani < - \property Staff.instrument = "Timpani" - \property Staff.instr = "Timp." - \notes{c''1 R1*8} - > - > - \context StaffGroup = strings < - \context GrandStaff = violins < - \context Staff = viI < - \property Staff.instrument = "Violin I" - \property Staff.instr = "Vi. I" - \m - > - \context Staff = viII < - \property Staff.instrument = "Violin II" - \property Staff.instr = "Vi. II" - \m - > - > - \context Staff = vla < - \property Staff.instrument = "Viola" - \property Staff.instr = "Vla." - \m - > - \context Staff = vlc < - \property Staff.instrument = "Violoncello" - \property Staff.instr = "Vlc" - \m - > - \context Staff = cb < - \property Staff.instrument = "Contrabasso" - \property Staff.instr = "C.B." - \m - > - > -> - \paper { -% \paper_sixteen; - linewidth = 185.\mm; - textheight = 260.\mm; - \translator { - \OrchestralScoreContext - barNumberScriptPadding = 10; - } - \translator { \HaraKiriStaffContext - marginScriptPadding = 15.0; -% StaffMinimumVerticalExtent = #(cons -0.0 0.0) - } - } -} - diff --git a/input/test/dynamic-dir.ly b/input/test/dynamic-dir.ly new file mode 100644 index 0000000000..b7d353b09f --- /dev/null +++ b/input/test/dynamic-dir.ly @@ -0,0 +1,12 @@ +%non of the dynamics properties work anymore + +\score { + \context Voice \notes\relative c { +% \property Voice.verticalDirection = #-1 + + \property Voice.dynamicDirection = #1 + \property Voice.dynamicPadding = #40 + c \p c \< \! c \ff\> c \!c-\p + + } +} diff --git a/lily/axis-group-engraver.cc b/lily/axis-group-engraver.cc index ca6f5fb359..606c93ef8b 100644 --- a/lily/axis-group-engraver.cc +++ b/lily/axis-group-engraver.cc @@ -26,7 +26,9 @@ protected: virtual void acknowledge_element (Score_element_info); virtual void process_acknowledged (); virtual Spanner* get_spanner_p () const; + virtual void add_element (Score_element*) ; public: + VIRTUAL_COPY_CONS(Translator); Axis_group_engraver (); }; @@ -106,11 +108,16 @@ Axis_group_engraver::process_acknowledged () if ((!par || !Axis_group_interface::has_interface (par)) && ! elts_[i]->empty_b (Y_AXIS)) - Axis_group_interface::add_element (staffline_p_, elts_[i]); + add_element (elts_[i]); } elts_.clear (); } +void +Axis_group_engraver::add_element (Score_element*e) +{ + Axis_group_interface::add_element (staffline_p_, e); +} //////////////////////////////////////////////////////// @@ -124,10 +131,18 @@ class Hara_kiri_engraver : public Axis_group_engraver protected: virtual Spanner*get_spanner_p ()const; virtual void acknowledge_element (Score_element_info); + virtual void add_element (Score_element *e); public: VIRTUAL_COPY_CONS(Translator); }; +void +Hara_kiri_engraver::add_element (Score_element*e) +{ + Hara_kiri_group_spanner::add_element (staffline_p_, e); +} + + Spanner* Hara_kiri_engraver::get_spanner_p () const { diff --git a/lily/axis-group-interface.cc b/lily/axis-group-interface.cc index 943c74a7ba..a156379adb 100644 --- a/lily/axis-group-interface.cc +++ b/lily/axis-group-interface.cc @@ -6,7 +6,7 @@ (c) 2000 Han-Wen Nienhuys */ - +#include "hara-kiri-group-spanner.hh" #include "axis-group-interface.hh" #include "score-element.hh" @@ -28,7 +28,13 @@ Axis_group_interface::add_element (Score_element*me,Score_element *e) bool Axis_group_interface::axis_b (Score_element*me,Axis a ) { - return me->has_extent_callback_b (group_extent_callback, a); + /* + urg. FIXME, check for Hara_kiri_group_spanner shouldn't be necessary? + + + */ + return me->has_extent_callback_b (group_extent_callback, a) || + (me->has_extent_callback_b (Hara_kiri_group_spanner::y_extent, a)); } Interval @@ -88,8 +94,11 @@ Axis_group_interface::set_axes (Score_element*me,Axis a1, Axis a2) if (a1 != Y_AXIS && a2 != Y_AXIS) me->set_extent_callback (0, Y_AXIS); - me->set_extent_callback (Axis_group_interface::group_extent_callback,a1); - me->set_extent_callback (Axis_group_interface::group_extent_callback,a2); + // if (!me->has_extent_callback_b (a1)) + if (me->has_extent_callback_b (Score_element::molecule_extent, a1)) + me->set_extent_callback (Axis_group_interface::group_extent_callback,a1); + if (me->has_extent_callback_b (Score_element::molecule_extent, a2)) + me->set_extent_callback (Axis_group_interface::group_extent_callback,a2); } Link_array diff --git a/lily/bar.cc b/lily/bar.cc index cb956edf23..7eaa478b7d 100644 --- a/lily/bar.cc +++ b/lily/bar.cc @@ -33,7 +33,11 @@ Bar::brew_molecule (SCM smob) { String str =ly_scm2string (s); SCM siz = gh_call1 (barsiz_proc, me->self_scm ()); - return compound_barline (me, str, gh_scm2double (siz)).create_scheme (); + Real sz = gh_scm2double (siz); + if (sz < 0) + return SCM_EOL; + + return compound_barline (me, str, sz).create_scheme (); } return SCM_EOL; } diff --git a/lily/hara-kiri-group-spanner.cc b/lily/hara-kiri-group-spanner.cc index cd16fab04f..25680db3ef 100644 --- a/lily/hara-kiri-group-spanner.cc +++ b/lily/hara-kiri-group-spanner.cc @@ -19,8 +19,18 @@ Hara_kiri_group_spanner::set_interface (Score_element*me) me->set_elt_property ("items-worth-living", SCM_EOL); me->add_offset_callback (force_hara_kiri_callback, Y_AXIS); me->set_interface (ly_symbol2scm ("hara-kiri-spanner-interface")); + me->set_extent_callback (Hara_kiri_group_spanner::y_extent, Y_AXIS); } +Interval +Hara_kiri_group_spanner::y_extent(Score_element*me, Axis a) +{ + assert (a == Y_AXIS); + consider_suicide (me); + return Axis_group_interface::group_extent_callback (me, a); +} + + bool Hara_kiri_group_spanner::has_interface (Score_element*me) { @@ -66,3 +76,18 @@ Hara_kiri_group_spanner::force_hara_kiri_callback (Score_element *elt, Axis a) return 0.0; } + +Real +Hara_kiri_group_spanner::force_hara_kiri_in_parent_callback (Score_element*daughter, Axis a) +{ + assert (a == Y_AXIS); + force_hara_kiri_callback (daughter->parent_l (a), Y_AXIS); + return 0.0; +} + +void +Hara_kiri_group_spanner::add_element (Score_element * me, Score_element *e) +{ + // e->add_offset_callback (force_hara_kiri_in_parent_callback, Y_AXIS); + Axis_group_interface::add_element (me, e); +} diff --git a/lily/include/hara-kiri-group-spanner.hh b/lily/include/hara-kiri-group-spanner.hh index b2ddc79a08..9f42879107 100644 --- a/lily/include/hara-kiri-group-spanner.hh +++ b/lily/include/hara-kiri-group-spanner.hh @@ -24,11 +24,16 @@ items-worth-living -- list of interesting items. If empty in a particular system, clear this line + + todo: naming */ class Hara_kiri_group_spanner { public: static Real force_hara_kiri_callback (Score_element * , Axis); + static Interval y_extent (Score_element * , Axis); + static Real force_hara_kiri_in_parent_callback (Score_element * , Axis); + static void add_element (Score_element *me, Score_element *e); static void set_interface (Score_element*me); static bool has_interface (Score_element*); static void consider_suicide (Score_element*me); diff --git a/lily/include/score-element.hh b/lily/include/score-element.hh index 85ff5e8774..f1a86dee28 100644 --- a/lily/include/score-element.hh +++ b/lily/include/score-element.hh @@ -187,9 +187,11 @@ public: Score_element*common_refpoint (Score_element const* s, Axis a) const; Score_element*common_refpoint (SCM elt_list, Axis a) const; + // duh. slim down interface here. (todo) bool has_offset_callback_b (Offset_callback, Axis)const; void add_offset_callback (Offset_callback, Axis); bool has_extent_callback_b (Extent_callback, Axis)const; + bool has_extent_callback_b (Axis) const; void set_extent_callback (Extent_callback , Axis); /** diff --git a/lily/property-engraver.cc b/lily/property-engraver.cc index c6e5430263..e7baf2ec25 100644 --- a/lily/property-engraver.cc +++ b/lily/property-engraver.cc @@ -85,7 +85,7 @@ Property_engraver::acknowledge_element (Score_element_info i) void Property_engraver::apply_properties (SCM p, Score_element *e) -{ +{ for (; gh_pair_p (p); p = gh_cdr (p)) { /* diff --git a/lily/score-element.cc b/lily/score-element.cc index c39624b53b..6a294a4301 100644 --- a/lily/score-element.cc +++ b/lily/score-element.cc @@ -45,6 +45,9 @@ remove dynamic_cast and put this code into respective Score_element::Score_element(SCM basicprops) { + /* + fixme: default should be no callback. + */ set_extent_callback (molecule_extent, X_AXIS); set_extent_callback (molecule_extent, Y_AXIS); @@ -520,8 +523,8 @@ Score_element::get_offset (Axis a) const Real r = (*c) (me,a ); if (isinf (r) || isnan (r)) { - r = 0.0; programming_error (INFINITY_MSG); + r = 0.0; } me->dim_cache_[a].offset_ +=r; } @@ -641,6 +644,13 @@ Score_element::has_extent_callback_b (Extent_callback cb, Axis a)const return cb == dim_cache_[a].extent_callback_l_; } + +bool +Score_element::has_extent_callback_b (Axis a) const +{ + return dim_cache_[a].extent_callback_l_; +} + bool Score_element::has_offset_callback_b (Offset_callback cb, Axis a)const { diff --git a/lily/span-bar.cc b/lily/span-bar.cc index e4e790da14..722dd45d77 100644 --- a/lily/span-bar.cc +++ b/lily/span-bar.cc @@ -66,7 +66,13 @@ Span_bar::center_on_spanned_callback (Score_element * me, Axis a) void Span_bar::evaluate_empty (Score_element*me) -{ +{ + /* + TODO: filter all hara-kiried out of ELEMENS list, and then + optionally do suicide. Call this cleanage function from + center_on_spanned_callback() as well. + + */ if (!gh_pair_p (me->get_elt_property ("elements"))) { me->suicide (); @@ -113,8 +119,11 @@ Span_bar::get_bar_size (SCM smob) Interval iv (get_spanned_interval (me)); if (iv.empty_b ()) { - programming_error("Huh? My children deflated (FIXME)"); - iv = Interval (0,0); + /* + This happens if the bars are hara-kiried from under us. + */ + me->suicide (); + return gh_double2scm (-1); } return gh_double2scm (iv.length ()); } diff --git a/lily/text-engraver.cc b/lily/text-engraver.cc index 0fa41ca7cd..b634bf70e6 100644 --- a/lily/text-engraver.cc +++ b/lily/text-engraver.cc @@ -98,25 +98,19 @@ Text_engraver::do_process_music () text->set_elt_property ("style", ly_str02scm (r->style_str_.ch_C())); /* - huh?, this said: - - SCM empty = get_property ("textNonEmpty"); - if (to_boolean (empty)) - no-spacing-rods - Text is empty by default, which means that the only condition for not setting 'no-spacing-rods' should be: boolean && true. Anyway, non-empty text has been broken for some time now. */ SCM nonempty = get_property ("textNonEmpty"); - if (to_boolean (nonempty)) - ; - else - { - text->set_elt_property ("no-spacing-rods" , SCM_BOOL_F); - text->set_extent_callback (0, X_AXIS); - } + if (!to_boolean (nonempty)) + /* + empty text: signal that no rods should be applied. + */ + text->set_elt_property ("no-spacing-rods" , SCM_BOOL_T); + + announce_element (text, r); texts_.push (text); } diff --git a/ly/engraver.ly b/ly/engraver.ly index 2eaadcd336..35e94628b2 100644 --- a/ly/engraver.ly +++ b/ly/engraver.ly @@ -492,12 +492,12 @@ ScoreContext = \translator { (interfaces . (dot-interface)) ) basicDynamicLineSpannerProperties = #`( - (interfaces (dynamic-interface axis-group-interface)) + (interfaces . (dynamic-interface axis-group-interface)) (axes . ( 1)) ) basicDynamicTextProperties = # `( (style . "dynamic") - (interface (dynamic-interface)) + (interfaces . (dynamic-interface)) (molecule-callback . ,Text_item::brew_molecule) (script-priority . 100) (self-alignment-Y . 0) @@ -684,7 +684,9 @@ ScoreContext = \translator { ) basicTextScriptProperties = #`( (molecule-callback . ,Text_item::brew_molecule) - (no-spacing-rods . #t) + +: -- don't set, because property-engraver will not override it. +; (no-spacing-rods . #t) (interfaces . (text-script-interface text-item-interface)) ) basicTieProperties = #`(