]> git.donarmstrong.com Git - lilypond.git/commitdiff
patch::: 1.3.77.jcn2
authorJan Nieuwenhuizen <janneke@gnu.org>
Sun, 13 Aug 2000 13:50:59 +0000 (15:50 +0200)
committerJan Nieuwenhuizen <janneke@gnu.org>
Sun, 13 Aug 2000 13:50:59 +0000 (15:50 +0200)
* 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

16 files changed:
CHANGES
VERSION
input/bugs/dynamic-dir.ly [deleted file]
input/bugs/orchestscore.ly [deleted file]
input/test/dynamic-dir.ly [new file with mode: 0644]
lily/axis-group-engraver.cc
lily/axis-group-interface.cc
lily/bar.cc
lily/hara-kiri-group-spanner.cc
lily/include/hara-kiri-group-spanner.hh
lily/include/score-element.hh
lily/property-engraver.cc
lily/score-element.cc
lily/span-bar.cc
lily/text-engraver.cc
ly/engraver.ly

diff --git a/CHANGES b/CHANGES
index 8557f84f9ab06566b27ee546249cd8241f77d9c1..bc42e868b4a385f3c7ad88e0df5bac8ccc9da296 100644 (file)
--- 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 dbc859e82d5823f3e6e9361326171b338018f17b..30db784b6318b619f9c76374dfadb82ea7de8bbd 100644 (file)
--- 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 (file)
index e56db38..0000000
+++ /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 (file)
index 8ad6ae4..0000000
+++ /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 (file)
index 0000000..b7d353b
--- /dev/null
@@ -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 
+
+  }
+}
index ca6f5fb359fe8c6544102647ce32c4705d97edb8..606c93ef8b910d5e97855d5cafe015653e3dfb90 100644 (file)
@@ -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
 {
index 943c74a7ba2583cbc9238b2bf0a851183318d268..a156379adbdcddf7477d79072af93dbbc4f3d392 100644 (file)
@@ -6,7 +6,7 @@
   (c) 2000 Han-Wen Nienhuys <hanwen@cs.uu.nl>
   
  */
-
+#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<Score_element> 
index cb956edf231d2ae475200eb4598db5f27bfd527f..7eaa478b7dc6bd93aa464a9126425835e5c73b41 100644 (file)
@@ -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;
 }
index cd16fab04f8026b68e36ba69a30cb896f3076879..25680db3ef26eca41d0d08886515c6dfb4bf1530 100644 (file)
@@ -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);
+}
index b2ddc79a08f00615705ccf7cde659c9ed6e7393e..9f4287910728732a94a1a0b486f18130214bc536 100644 (file)
   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);
index 85ff5e8774a90fd61edf77169657bfab7ed06d80..f1a86dee28288426efaac213634820b00f5a60e6 100644 (file)
@@ -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);
 
   /**
index c6e54302637fb1b2523d54014a2cddef262cd8e5..e7baf2ec253d21434c3669b373fc1c21c0d39fb4 100644 (file)
@@ -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))
     {
       /*
index c39624b53b3ff422e43625e387c567a487f3e6f2..6a294a43019696c4cddfb85f48714e4ef9d020d1 100644 (file)
@@ -45,6 +45,9 @@ remove dynamic_cast<Spanner,Item> 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
 {
index e4e790da14d36e626e8fdb89c5713caf89c5fbe8..722dd45d77db41ddeb248d9bad560bb503347cbf 100644 (file)
@@ -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 ());
 }
index 0fa41ca7cd98b2fdec077db2d7967671d23745dc..b634bf70e6a9809afb4a04e2c964c738fb320d09 100644 (file)
@@ -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);
     }
index 2eaadcd3368c3a895a03581bfdc9c37c2653e167..35e94628b26e8a18ebb6c0e5912f916f9d1032e0 100644 (file)
@@ -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 = #`(