]> git.donarmstrong.com Git - lilypond.git/commitdiff
* lily/dynamic-engraver.cc (typeset_all):
authorJan Nieuwenhuizen <janneke@gnu.org>
Tue, 10 Aug 2004 22:42:35 +0000 (22:42 +0000)
committerJan Nieuwenhuizen <janneke@gnu.org>
Tue, 10 Aug 2004 22:42:35 +0000 (22:42 +0000)
* lily/script-engraver.cc (stop_translation_timestep): Handle
collisions with new-slur.

12 files changed:
ChangeLog
elisp/lilypond-mode.el
lily/dynamic-engraver.cc
lily/include/directional-element-interface.hh
lily/include/new-slur.hh
lily/script-engraver.cc
lily/slur-engraver.cc
lily/slur-quanting.cc
ly/engraver-init.ly
scm/define-grob-properties.scm
scm/define-grobs.scm
scm/encoding.scm

index 9e19735766a2242ef89201979ef9533e5767cff7..09d62dc9cdef18637e49b663cf94fa50d031e36e 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,19 @@
+2004-08-11  Jan Nieuwenhuizen  <janneke@gnu.org>
+
+       * lily/dynamic-engraver.cc (typeset_all):
+       * lily/script-engraver.cc (stop_translation_timestep): Handle
+       collisions with new-slur.
+
+2004-08-10  Jan Nieuwenhuizen  <janneke@gnu.org>
+
+       * scm/define-grobs.scm (all-grob-descriptions): Add
+       new-slur-interface.
+
+2004-08-03  Jan Nieuwenhuizen  <janneke@gnu.org>
+
+       * elisp/lilypond-mode.el (LilyPond-command-alist): LilyPond now
+       produces .PS
+
 2004-08-09  Carl Sorensen  <carldsorensen@comcast.net>
 
        * scm/define-grob-properties.scm (all-user-grob-properties): fix
index d30f6c725f8b21b50019ae47f62690e6ed5e5423..1c272c171c22a7aa6528615e115d448f5d04f407 100644 (file)
@@ -411,11 +411,11 @@ in LilyPond-include-path."
   ;; Should expand this to include possible keyboard shortcuts which
   ;; could then be mapped to define-key and menu.
   `(
-    ("LilyPond" . ("lilypond-bin %s" "%s" "%l" "LaTeX"))
+    ("LilyPond" . ("lilypond %s" "%s" "%l" "ViewPS"))
     ("TeX" . ("tex '\\nonstopmode\\input %t'" "%t" "%d" "View"))
 
-    ("2Dvi" . ("lilypond %s" "%s" "%d" "View"))
-    ("2PS" . ("lilypond -P %s" "%s" "%p" "ViewPS"))
+    ("2Dvi" . ("lilypond -f tex %s" "%s" "%d" "LaTeX"))
+    ("2PS" . ("lilypond -f ps %s" "%s" "%p" "ViewPS"))
     ("2Midi" . ("lilypond -m %s" "%s" "%m" "Midi"))
 
     ("Book" . ("lilypond-book %x" "%x" "%l" "LaTeX"))
index 7f55c7ba6b0607c6922f78a44ee3ed5b47a1c1c7..16a0a75f5668a1cd9f6d8296c4edbd832579b9f8 100644 (file)
@@ -5,20 +5,23 @@
 
   (c) 1997--2004 Han-Wen Nienhuys <hanwen@cs.uu.nl>
 */
-#include "warn.hh"
+
+#include "axis-group-interface.hh"
+#include "context.hh"
 #include "dimensions.hh"
-#include "hairpin.hh"
-#include "event.hh"
-#include "paper-column.hh"
-#include "note-column.hh"
-#include "item.hh"
-#include "side-position-interface.hh"
+#include "directional-element-interface.hh"
 #include "engraver.hh"
+#include "event.hh"
 #include "group-interface.hh"
-#include "directional-element-interface.hh"
-#include "context.hh"
-#include "axis-group-interface.hh"
+#include "hairpin.hh"
+#include "item.hh"
+#include "new-slur.hh"
+#include "note-column.hh"
+#include "paper-column.hh"
 #include "script-interface.hh"
+#include "side-position-interface.hh"
+#include "staff-symbol-referencer.hh"
+#include "warn.hh"
 
 /*
   TODO:
@@ -39,8 +42,9 @@
  */
 class Dynamic_engraver : public Engraver
 {
-  Item * script_;
+  Item *script_;
   Spanner *line_spanner_;
+  Grob *slur_;
   Spanner *cresc_;
 
   Spanner *finished_line_spanner_;
@@ -72,6 +76,7 @@ protected:
 Dynamic_engraver::Dynamic_engraver ()
 {
   script_ = 0;
+  slur_ = 0;
   finished_cresc_ = 0;
   line_spanner_ = 0;
   finished_line_spanner_ = 0;
@@ -268,9 +273,11 @@ Dynamic_engraver::stop_translation_timestep ()
   typeset_all ();
   if (!current_cresc_ev_)
     {
+      
       finished_line_spanner_ = line_spanner_;
-      line_spanner_ =0;
+      line_spanner_ = 0;
       typeset_all ();
+      slur_ = 0;
     }
 
   script_ev_ = 0;
@@ -305,7 +312,17 @@ Dynamic_engraver::finalize ()
 
 void
 Dynamic_engraver::typeset_all ()
-{  
+{
+  if (finished_line_spanner_ && slur_
+      && get_slur_dir (slur_) == get_grob_direction (finished_line_spanner_))
+    {
+      Real ss = Staff_symbol_referencer::staff_space (finished_line_spanner_);
+      Real pad = robust_scm2double (finished_line_spanner_->get_property ("padding"), 0);
+      /* FIXME: 1ss padding hardcoded */
+      finished_line_spanner_->set_property ("padding",
+                                           scm_make_real (pad + ss));
+    }
+
   if (finished_cresc_)
     {
       if (!finished_cresc_->get_bound (RIGHT))
@@ -313,7 +330,7 @@ Dynamic_engraver::typeset_all ()
          finished_cresc_->set_bound (RIGHT, script_
                                      ? script_
                                      : unsmob_grob (get_property ("currentMusicalColumn")));
-
+         
          if (finished_line_spanner_)
            add_bound_item (finished_line_spanner_,
                            finished_cresc_->get_bound (RIGHT));
@@ -361,8 +378,8 @@ void
 Dynamic_engraver::acknowledge_grob (Grob_info i)
 {
   if (!line_spanner_)
-    return ;
-  
+    return;
+
   if (Note_column::has_interface (i.grob_))
     {
       if (line_spanner_
@@ -379,7 +396,6 @@ Dynamic_engraver::acknowledge_grob (Grob_info i)
          if (ly_c_pair_p (head))
            script_->set_parent (unsmob_grob (ly_car (head)),  X_AXIS);
        }
-      
     }
   else if (Script_interface::has_interface (i.grob_) && script_)
     {
@@ -391,12 +407,12 @@ Dynamic_engraver::acknowledge_grob (Grob_info i)
        DynamicText doesn't really have a script-priority field.
        */
       if (ly_c_number_p (p)
-         && ly_scm2int (p) < ly_scm2int (script_->get_property ("script-priority")))
-       {
-         Side_position_interface::add_support (line_spanner_, i.grob_);
-
-       }
+         && ly_scm2int (p)
+         < ly_scm2int (script_->get_property ("script-priority")))
+       Side_position_interface::add_support (line_spanner_, i.grob_);
     }
+  else if (New_slur::has_interface (i.grob_) && line_spanner_)
+    slur_ = i.grob_;
 }
 
 ENTER_DESCRIPTION (Dynamic_engraver,
@@ -408,6 +424,6 @@ ENTER_DESCRIPTION (Dynamic_engraver,
                  
 /* creats*/       "DynamicLineSpanner DynamicText Hairpin TextSpanner",
 /* accepts */     "absolute-dynamic-event crescendo-event decrescendo-event",
-/* acks  */      "note-column-interface script-interface",
+/* acks  */      "note-column-interface script-interface new-slur-interface",
 /* reads */       "",
 /* write */       "");
index f4e80f75d0e62d181b3102946cce3381ceaebdb5..c0527c042c858fb745665cb59ecf9aab0be3f83c 100644 (file)
@@ -12,6 +12,7 @@
 
 #include "grob.hh"
 
+// what is the advantage not having these two as STATICs of GROB -- jcn
 void set_grob_direction (Grob*, Direction);
 Direction get_grob_direction (Grob*);
 
index f587ab7d2b0222e281623346b211c43799dd88db..b307af970e89f568b8f96f62c7c4fb48f8e1cd00 100644 (file)
@@ -25,11 +25,12 @@ public:
   DECLARE_SCHEME_CALLBACK (height, (SCM,SCM));
 
   static void set_interface (Grob *);
-  static bool  has_interface (Grob *);
+  static bool has_interface (Grob *);
   static Bezier get_curve (Grob*me);
 };
 
-
+// zught
+Direction get_slur_dir (Grob *slur);
 
 #endif /* NEW_SLUR_HH */
 
index 9d75ba8ab2c3ce2b32f2a9f5d6b4fbe26bb165c6..4550fc7a3b208cd14edf823ddabff2180649c845 100644 (file)
@@ -7,12 +7,15 @@
 */
 
 #include "context.hh"
+#include "directional-element-interface.hh"
 #include "engraver.hh"
 #include "event.hh"
+#include "new-slur.hh"
 #include "note-column.hh"
 #include "rhythmic-head.hh"
 #include "script-interface.hh"
 #include "side-position-interface.hh"
+#include "staff-symbol-referencer.hh"
 #include "stem.hh"
 #include "warn.hh"
 
@@ -32,6 +35,7 @@ struct Script_tuple
 class Script_engraver : public Engraver
 {
   Array<Script_tuple> scripts_;
+  Grob *slur_;
 
 protected:
   virtual bool try_music (Music*);
@@ -45,6 +49,7 @@ public:
 
 Script_engraver::Script_engraver ()
 {
+  slur_ = 0;
 }
 
 bool
@@ -190,6 +195,8 @@ Script_engraver::acknowledge_grob (Grob_info inf)
            e->set_parent (inf.grob_, X_AXIS);
        }
     }
+  else if (New_slur::has_interface (inf.grob_) && script_count)
+    slur_ = inf.grob_;
 }
 
 void
@@ -207,7 +214,19 @@ Script_engraver::stop_translation_timestep ()
                                     ::quantised_position_proc, Y_AXIS);
            sc->set_property ("staff-padding", SCM_EOL);
          }
+       SCM priority = sc->get_property ("script-priority");
+       if (robust_scm2int (priority, 0) >= 0
+           && slur_
+           && get_grob_direction (sc) == get_slur_dir (slur_))
+         {
+           Real ss = Staff_symbol_referencer::staff_space (sc);
+           Real pad = robust_scm2double (sc->get_property ("padding"), 0);
+
+           /* FIXME: 1ss padding hardcoded */
+           sc->set_property ("padding", scm_make_real (pad + ss));
+         }
       }
+  slur_ = 0;
   scripts_.clear ();
 }
 
@@ -215,6 +234,7 @@ ENTER_DESCRIPTION (Script_engraver,
 /* descr */       "Handles note scripted articulations.",
 /* creats*/       "Script",
 /* accepts */     "script-event articulation-event",
-/* acks  */      "stem-interface rhythmic-head-interface note-column-interface",
+/* acks  */       "stem-interface rhythmic-head-interface\
+ new-slur-interface note-column-interface",
 /* reads */       "scriptDefinitions",
 /* write */       "");
index 7d7abf2440934e6206ea40f403e576c7cf09f0fd..695bfb505d7b17eb5ce6eff999fe056a0e1ab6cf 100644 (file)
@@ -154,15 +154,13 @@ Slur_engraver::process_music ()
        }
       else  if (d == START)
        {
-         // push a new slur onto stack.
-         // (use temp. array to wait for all slur STOPs)
-         Grobslur = make_spanner ("Slur", slur_ev->self_scm ());
+         /* push a new slur onto stack.
+            (use temp. array to wait for all slur STOPs) */
+         Grob *slur = make_spanner ("Slur", slur_ev->self_scm ());
 
          if (Direction updown = to_dir (slur_ev->get_property ("direction")))
-           {
-             slur->set_property ("direction", scm_int2num (updown));
-           }
-         
+           slur->set_property ("direction", scm_int2num (updown));
+
          start_slurs.push (slur);
          events_.push (slur_ev);
        }
index 9d9a8f858c5229f2aeb02c9dd0ecda78bda8947c..d145f59bbbf7d49afef3cf5d078f60084a356ccb 100644 (file)
@@ -319,6 +319,15 @@ get_default_dir (Grob*me)
   return d;
 }
 
+Direction
+get_slur_dir (Grob *slur)
+{
+  Direction d = get_grob_direction (slur);
+  if (d == CENTER)
+    d = get_default_dir (slur);
+  return d;
+}
+
 MAKE_SCHEME_CALLBACK (New_slur, after_line_breaking,1);
 SCM
 New_slur::after_line_breaking (SCM smob)
index 68fcb16ac95c8d106b48b351007a61c816892e74..79cf5490e65320e32673275617ac5d211d5bfc31 100644 (file)
     \consists "Melisma_translator"
     \consists "Part_combine_engraver"
 
-%{
-    Must come before text_engraver, but after note_column engraver.
-
-%}
     \consists "Text_engraver"
     \consists "Dynamic_engraver"
     \consists "Fingering_engraver"
index e54f65478e11657bfef4711b818244abbea85932..f766b8586e9fd5f2c9a2eaf007e7f87763a41917 100644 (file)
@@ -679,4 +679,3 @@ than a whole rest.")
   (append
    all-internal-grob-properties
    all-user-grob-properties))
-
index db7669729e6865b27fbcf65a4b0112cf1790edaf..26143927d4e4927793e592a091feba3a09640459 100644 (file)
        (Y-extent-callback . ,New_slur::height)
        (height-limit . 2.0)
        (ratio . 0.333)
-       (meta . ((interfaces . (slur-interface spanner-interface))))
+       (meta . ((interfaces . (slur-interface new-slur-interface spanner-interface))))
        ))
 
     (NonMusicalPaperColumn
                                        ; Slur::height)
        (height-limit . 2.0)
        (ratio . 0.25)
-       (meta . ((interfaces . (slur-interface spanner-interface))))
+       (meta . ((interfaces . (slur-interface new-slur-interface spanner-interface))))
        ))
 
     (SpacingSpanner
index a1aa1acd0891bacaa917809cc28872929e42795f..6332a0688475a1c62454450c3a46b9eda6e6ce05 100644 (file)
@@ -88,7 +88,8 @@ vector of symbols."
         ;; aliases
         ("T1" . "tex256.enc")
         ("adobe" . "8a.enc")
-        ("latin1" . "latin1.enc")
+        ;;("latin1" . "latin1.enc")
+        ("latin1" . "cork.enc")
         ("ec" . "EC.enc")
         
         ;; LilyPond.