]> git.donarmstrong.com Git - lilypond.git/commitdiff
patch::: 1.3.111.jcn1
authorJan Nieuwenhuizen <janneke@gnu.org>
Mon, 27 Nov 2000 22:16:32 +0000 (23:16 +0100)
committerJan Nieuwenhuizen <janneke@gnu.org>
Mon, 27 Nov 2000 22:16:32 +0000 (23:16 +0100)
1.3.111.jcn1
============

* Added simple glissando line.

* Bugfix: broken [crescendo] text spanner.

29 files changed:
CHANGES
Documentation/regression-test.tely
VERSION
input/test/crescendi.ly
input/test/glissando.ly [new file with mode: 0644]
input/test/ottava.ly
input/test/text-spanner.ly
lily/chord.cc
lily/duration.cc
lily/dynamic-engraver.cc
lily/font-interface.cc
lily/include/lily-guile.hh
lily/include/lily-proto.hh
lily/include/line-spanner.hh [new file with mode: 0644]
lily/include/music-iterator-ctor.hh
lily/include/musical-request.hh
lily/lily-guile.cc
lily/line-spanner.cc [new file with mode: 0644]
lily/music-output-def.cc
lily/my-lily-lexer.cc
lily/note-head-line-engraver.cc [new file with mode: 0644]
lily/parser.yy
lily/pitch.cc
lily/text-spanner.cc
ly/engraver.ly
scm/backend-property.scm
scm/element-descriptions.scm
scm/generic-property.scm
scm/interface.scm

diff --git a/CHANGES b/CHANGES
index 38c0a8cc6edd74d855b2d6cea274af1b5db586fd..faa70f5fda68ed6393db43d6fc078cbb8bbd1ca6 100644 (file)
--- a/CHANGES
+++ b/CHANGES
@@ -1,3 +1,10 @@
+1.3.111.jcn1
+============
+
+* Added simple glissando line.
+
+* Bugfix: broken [crescendo] text spanner.
+
 1.3.110.hwn1
 ============
 
index a2d0289437172b7ea6f65c89deb5eee6f1fce6a3..8a5d214837e1175cf47d3149c1c9f78b8fd6fed2 100644 (file)
@@ -119,10 +119,14 @@ linked with (de)crescendi, they should be on the same line.
 @lilypondfile{dyn-line.ly}
 
 
-Arpeggios are supported, both cross-staff and one-staff. 
+Arpeggios are supported, both cross-staff and broken single staff. 
 
 @lilypondfile{arpeggio.ly}
 
+Simple glissando lines between notes are supported.
+
+@lilypondfile{glissando.ly}
+
 
 
 @section Chord names
diff --git a/VERSION b/VERSION
index f1ab32c8c2bf02c40891c4eec7eff6e5526d1f2b..49edc7cc150317ed59b0285f22cf411b5367242b 100644 (file)
--- a/VERSION
+++ b/VERSION
@@ -2,7 +2,7 @@ PACKAGE_NAME=LilyPond
 MAJOR_VERSION=1
 MINOR_VERSION=3
 PATCH_LEVEL=111
-MY_PATCH_LEVEL=
+MY_PATCH_LEVEL=jcn1
 
 # use the above to send patches: MY_PATCH_LEVEL is always empty for a
 # released version.
index 5a7e44eba33c4a732fc6194fe4fe9094fc7fe038..7e9287904dcf2634111b61181958a68cf167b5a3 100644 (file)
@@ -3,7 +3,7 @@
 a1\fff\> \!a\pp
 a\< \!a
 \property Voice.crescendoText = "cresc."
-\property Voice.crescendoSpanner = "dashed-line"
+\property Voice.crescendoSpanner = #'dashed-line
 a\mf\< a \!a 
 a\< \!a
 }
diff --git a/input/test/glissando.ly b/input/test/glissando.ly
new file mode 100644 (file)
index 0000000..cdf6154
--- /dev/null
@@ -0,0 +1,15 @@
+\score{
+    <
+        \context Staff=one \notes\relative c''{
+            a \glissando e'
+           % test: link thread to other staff
+           a, \glissando
+           \translator Staff=two
+           a,,
+       }
+       \context Staff=two { \clef bass; \skip 1; }
+    >
+    \paper{
+        linewidth = 70.\mm;
+    }
+}
\ No newline at end of file
index 21aaeb4aad534679f7b3174fd530c8a3efd7591d..ad3b746fe17b7fd2f5dea01ae701f710669613f7 100644 (file)
@@ -4,7 +4,7 @@
 \score{
     \notes\relative c'''{
         \property Voice.TextSpanner \revert #'type
-        \property Voice.TextSpanner \override #'type = #"dotted-line"
+        \property Voice.TextSpanner \override #'type = #'dotted-line
         \property Voice.TextSpanner \override #'edge-height = #'(0 . 1.5)
         \property Voice.TextSpanner \override #'edge-text = #'("8va " . "")
         \property Staff.centralCPosition = #-13
index 9016c074dd5f7ff7a37e7a5a7a4026a1afbe1dda..53784a734a20b95652ace6076b95a114f952ee16 100644 (file)
@@ -9,13 +9,13 @@
         a \spanrequest \stop "text"
 
         \property Voice.TextSpanner \revert #'type
-        \property Voice.TextSpanner \override #'type = #"dotted-line"
+        \property Voice.TextSpanner \override #'type = #'dotted-line
         a \spanrequest \start "text"
        b c 
         a \spanrequest \stop "text"
 
         \property Voice.TextSpanner \revert #'type
-        \property Voice.TextSpanner \override #'type = #"dashed-line"
+        \property Voice.TextSpanner \override #'type = #'dashed-line
         \property Voice.TextSpanner \override #'edge-height = #'(1 . -2)
         a \spanrequest \start "text"
        b c 
index 3454f47a77d06c9274979e51a86d23897aeafc8e..2aa4b0532eba2cae3b9bd43a6061908d0e4236fe 100644 (file)
@@ -46,12 +46,6 @@ ly_remove_member (SCM s, SCM list)
   return gh_reverse (removed);
 }
 
-SCM
-ly_last (SCM list)
-{
-  return gh_car (scm_last_pair (list));
-}
-
 /* tail add */
 SCM
 ly_snoc (SCM s, SCM list)
index 6b9925ba178a8b748e6f32c63dd53ad6cebae64a..cc44db4def30e2b34e4309be643ca6d4bbd79be5 100644 (file)
@@ -97,7 +97,7 @@ Duration::print_smob (SCM s, SCM port, scm_print_state *)
   Duration  *r = (Duration *) gh_cdr (s);
      
   scm_puts ("#<Duration ", port);
-  scm_display (gh_str02scm ((char*)r->str().ch_C()), port);
+  scm_display (ly_str02scm (r->str().ch_C()), port);
   scm_puts (" >", port);
   
   return 1;
index 7b5b5361137a4c6cda6d40bab43e2268af44ec57..15b6561b1be3a1dc86fac8475b9319e5220e1c9b 100644 (file)
@@ -238,7 +238,7 @@ Dynamic_engraver::create_grobs ()
            ugh. Use push/pop?
           */
          SCM s = get_property ((start_type + "Spanner").ch_C());
-         if (!gh_string_p (s) || ly_scm2string (s) == "hairpin")
+         if (!gh_symbol_p (s) || s == ly_symbol2scm ("hairpin"))
            {
              cresc_p_  = new Spanner (get_property ("Crescendo"));
              cresc_p_->set_grob_property ("grow-direction",
index 1e7b6d34f268d217c56497865295a6026a737a89..d5a15ab2d9a5ed42a908648ab50aa444f8ab6946 100644 (file)
@@ -199,6 +199,6 @@ Font_interface::properties_to_font_name (SCM fonts, SCM alist_chain)
   warning (_("couldn't find any font satisfying ") );
   scm_write (gh_list (name, point_sz, shape, series , family, rel_sz, SCM_UNDEFINED), scm_current_error_port ());
 
-  return gh_str02scm ("cmr10");
+  return ly_str02scm ("cmr10");
   
 }
index 2f50f6d3846bcf067912b78ebf04e1adda1f93df..9e189914902b32f24b7b5d25dbc3ea4337d6d098 100644 (file)
@@ -31,6 +31,8 @@
 
     A ly_B2A (B b);
  */
+
+SCM ly_last (SCM list);
 SCM ly_str02scm (char const*c);
 SCM ly_deep_copy (SCM);
 SCM ly_symbol2scm (char const *);
index b4bcf7d24ff8deaafb56259251ba654c10ffe1ca..094879e9ad584b9aa0103a4c14954ec20f7ef79b 100644 (file)
@@ -57,6 +57,7 @@ class Folded_repeat_iterator;
 class Font_metric;
 class Font_size_engraver;
 class Global_translator;
+class Glissando_req;
 class Gourlay_breaking;
 class Grace_engraver_group;
 class Grace_iterator;
diff --git a/lily/include/line-spanner.hh b/lily/include/line-spanner.hh
new file mode 100644 (file)
index 0000000..3b9ac95
--- /dev/null
@@ -0,0 +1,22 @@
+/*
+  line-spanner.hh -- declare Line_spanner
+
+  source file of the GNU LilyPond music typesetter
+
+  (c) 2000 Jan Nieuwenhuizen <janneke@gnu.org>
+*/
+
+
+#ifndef LINE_SPANNER_HH
+#define LINE_SPANNER_HH
+
+#include "lily-guile.hh"
+
+class Line_spanner
+{
+public:
+  DECLARE_SCHEME_CALLBACK (brew_molecule, (SCM));
+  static SCM line_atom (Grob* me, Real dx, Real dy);
+};
+
+#endif /* LINE_SPANNER_HH */
index 272365ecd4c90b5bcdd6e0554b84a04baabe1e1d..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 100644 (file)
@@ -1,3 +0,0 @@
-
-#error
-
index 4b8eecd87728bc754ef3eb179deb1bfe44b67bda..45cf8e38250115e2f7ef003301bf0f21dc9f7d53 100644 (file)
@@ -158,4 +158,9 @@ public:
   VIRTUAL_COPY_CONS (Music);
 };
 
+class Glissando_req : public Request
+{
+  VIRTUAL_COPY_CONS (Music);
+};
+
 #endif // MUSICALREQUESTS_HH
index 09447caa1911de018b465b03dfb74a4a31d20b55..1b719659518bb71bcc7c88b2cb1870ed576046a2 100644 (file)
 #include "offset.hh"
 #include "interval.hh"
 
+SCM
+ly_last (SCM list)
+{
+  return gh_car (scm_last_pair (list));
+}
+
 SCM
 ly_str02scm (char const*c)
 {
@@ -41,7 +47,7 @@ ly_str02scm (char const*c)
 SCM
 ly_parse_scm (char const* s, int* n)
 {
-  SCM str = gh_str02scm ((char*)s);
+  SCM str = ly_str02scm (s);
   SCM port = scm_mkstrport (SCM_INUM0, str, SCM_OPN | SCM_RDNG,
                             "ly_eval_scm_0str");
   SCM from = scm_ftell (port);
@@ -365,7 +371,7 @@ ly_number2string (SCM s)
       sprintf (str, "%d ", gh_scm2int (s));
     }
 
-  return gh_str02scm (str);
+  return ly_str02scm (str);
 }
 
 /*
diff --git a/lily/line-spanner.cc b/lily/line-spanner.cc
new file mode 100644 (file)
index 0000000..9086802
--- /dev/null
@@ -0,0 +1,116 @@
+/*
+  line-spanner.cc -- implement Line_spanner
+
+  source file of the GNU LilyPond music typesetter
+
+  (c) 2000 Jan Nieuwenhuizen <janneke@gnu.org>
+*/
+
+#include "molecule.hh"
+#include "item.hh"
+#include "spanner.hh"
+#include "line-spanner.hh"
+#include "paper-def.hh"
+#include "paper-column.hh"
+#include "staff-symbol-referencer.hh"
+
+SCM
+Line_spanner::line_atom (Grob* me, Real dx, Real dy)
+{
+  SCM list = SCM_EOL;
+  SCM type = me->get_grob_property ("type");
+  if (gh_symbol_p (type)
+      && (type == ly_symbol2scm ("line")
+         || type == ly_symbol2scm ("dashed-line")
+         || type == ly_symbol2scm ("dotted-line")))
+    {
+      Real staff_space = Staff_symbol_referencer::staff_space (me);
+      Real thick = me->paper_l ()->get_var ("stafflinethickness");  
+
+      SCM s = me->get_grob_property ("line-thickness");
+      if (gh_number_p (s))
+       thick *= gh_scm2double (s);
+  
+      // maybe these should be in line-thickness?
+      Real length = staff_space;
+      s = me->get_grob_property ("dash-length");
+      if (gh_number_p (s))
+       length = gh_scm2double (s) * staff_space;
+
+      Real period = 2 * length + thick;
+      s = me->get_grob_property ("dash-period");
+      if (gh_number_p (s))
+       period = gh_scm2double (s) * staff_space;
+      
+      if (type == ly_symbol2scm ("dotted-line"))
+       length = thick;
+       
+      if (type == ly_symbol2scm ("line"))
+       length = period + thick;
+
+      Real on = length - thick;
+      Real off = period - on;
+
+      list = gh_list (ly_symbol2scm ("dashed-line"),
+                     gh_double2scm (thick),
+                     gh_double2scm (on),
+                     gh_double2scm (off),
+                     gh_double2scm (dx),
+                     gh_double2scm (dy),
+                     SCM_UNDEFINED);
+    }
+  return list;
+}
+
+
+MAKE_SCHEME_CALLBACK (Line_spanner, brew_molecule, 1);
+SCM
+Line_spanner::brew_molecule (SCM smob) 
+{
+  Grob *me= unsmob_grob (smob);
+  Spanner *spanner = dynamic_cast<Spanner*> (me);
+
+  Grob *common[] = { 0, 0 };
+  common[X_AXIS] = spanner->get_bound (LEFT)->common_refpoint (spanner->get_bound (RIGHT), X_AXIS);
+  common[Y_AXIS] = spanner->get_bound (LEFT)->common_refpoint (spanner->get_bound (RIGHT), Y_AXIS);
+
+  if (!common[X_AXIS] || !common[Y_AXIS])
+    return SCM_EOL;
+  
+  Real dx =
+    spanner->get_bound (LEFT)->relative_coordinate (common[X_AXIS], X_AXIS)
+    - spanner->get_bound (RIGHT)->relative_coordinate (common[X_AXIS], X_AXIS)
+    + spanner->get_bound (RIGHT)->extent (spanner->get_bound (RIGHT),
+                                         X_AXIS)[LEFT]
+    - spanner->get_bound (LEFT)->extent (spanner->get_bound (LEFT),
+                                        X_AXIS)[RIGHT];
+  
+  Real dy =
+    spanner->get_bound (LEFT)->relative_coordinate (common[Y_AXIS], Y_AXIS)
+    - spanner->get_bound (RIGHT)->relative_coordinate (common[Y_AXIS], Y_AXIS)
+    + spanner->get_bound (RIGHT)->extent (spanner->get_bound (RIGHT),
+                                         Y_AXIS).center ()
+    - spanner->get_bound (LEFT)->extent (spanner->get_bound (LEFT),
+                                        Y_AXIS).center ();
+  
+  Molecule line;
+  Real gap = gh_scm2double (me->get_grob_property ("gap"));
+  Offset o (dx, dy);
+  o *= (o.length () - 2 * gap) / o.length ();
+  
+  SCM list = Line_spanner::line_atom (me, o[X_AXIS], o[Y_AXIS]);
+    
+  if (list == SCM_EOL)
+    return SCM_EOL;
+  
+  Box b (Interval (0, o[X_AXIS]), Interval (0, o[Y_AXIS]));
+  
+  line = Molecule (b, list);
+  line.translate_axis (spanner->get_bound (LEFT)->extent (spanner->get_bound (LEFT), X_AXIS).length (), X_AXIS);
+  Offset g = o * (gap / o.length ());
+  line.translate (g);
+      
+  return line.smobbed_copy ();
+}
+
+
index 976c41767d85452d4e3667bc64ad4ae0c16ad349..edc315cb7b708a6b87dcf3f79c428a368af1064a 100644 (file)
@@ -67,7 +67,7 @@ Music_output_def::find_translator_l (SCM name) const
 Global_translator *
 Music_output_def::get_global_translator_p () 
 {
-  Translator_def * t = unsmob_translator_def (find_translator_l (gh_str02scm ("Score")));
+  Translator_def * t = unsmob_translator_def (find_translator_l (ly_str02scm ("Score")));
   if (!t)
     error (_f ("can't find `%s' context", "Score"));
 
index bf1cb58de941b4449201ba5e3db69a9a522e917b..9a5661cb99af0f7a86f2fa861cd1c9029290428a 100644 (file)
@@ -48,6 +48,7 @@ static Keyword_ent the_key_tab[]={
   {"elementdescriptions", ELEMENTDESCRIPTIONS},
   {"font", FONT},
   {"grace", GRACE},
+  {"glissando", GLISSANDO},
   {"header", HEADER},
   {"in", IN_T},
   {"lyrics", LYRICS},
diff --git a/lily/note-head-line-engraver.cc b/lily/note-head-line-engraver.cc
new file mode 100644 (file)
index 0000000..3f7d9d3
--- /dev/null
@@ -0,0 +1,109 @@
+/*   
+  note-head-line-engraver.cc -- implement Note_head_line_engraver
+  
+  source file of the GNU LilyPond music typesetter
+  
+  (c) 2000 Jan Nieuwenhuizen <janneke@gnu.org>
+ */
+
+#include "engraver.hh"
+#include "group-interface.hh"
+#include "item.hh"
+#include "musical-request.hh"
+#include "spanner.hh"
+#include "rhythmic-head.hh"
+#include "side-position-interface.hh"
+#include "staff-symbol-referencer.hh"
+#include "protected-scm.hh"
+
+/**
+   Create line-spanner grobs for glissandi (and possibly other) lines
+   that connect note heads.
+ */
+
+class Note_head_line_engraver : public Engraver
+{
+public:
+  VIRTUAL_COPY_CONS (Translator);
+  Note_head_line_engraver ();
+
+protected:
+  virtual void acknowledge_grob (Grob_info);
+  virtual void create_grobs ();
+  virtual void stop_translation_timestep ();
+  virtual bool try_music (Music *);
+
+private:
+  Spanner* line_; 
+  Request* req_;
+  Protected_scm heads_;
+};
+
+Note_head_line_engraver::Note_head_line_engraver ()
+{
+  line_ = 0;
+  req_ = 0;
+  heads_ = SCM_EOL;
+}
+
+bool
+Note_head_line_engraver::try_music (Music* m)
+{
+  if (!req_)
+    {
+      if (Glissando_req *r = dynamic_cast<Glissando_req*> (m))
+       {
+         req_ = r;
+         return true;
+       }
+    }
+  return false;
+}
+
+void
+Note_head_line_engraver::acknowledge_grob (Grob_info info)
+{
+  if (req_)
+    {
+      if (Rhythmic_head::has_interface (info.elem_l_))
+       {
+         heads_ = gh_cons (info.elem_l_->self_scm (), heads_);
+       }
+    }
+}
+
+void
+Note_head_line_engraver::create_grobs ()
+{
+  if (!line_ && scm_ilength (heads_) > 1)
+    {
+      /* type Glissando? */
+      line_ = new Spanner (get_property ("NoteHeadLine"));
+      line_->set_bound (LEFT, unsmob_grob (gh_car (heads_)));
+      line_->set_bound (RIGHT, unsmob_grob (ly_last (heads_)));
+
+      line_->set_parent (unsmob_grob (gh_car (heads_)), X_AXIS);
+      line_->set_parent (unsmob_grob (gh_car (heads_)), Y_AXIS);
+
+      line_->set_parent (unsmob_grob (ly_last (heads_)), X_AXIS);
+      line_->set_parent (unsmob_grob (ly_last (heads_)), Y_AXIS);
+
+      announce_grob (line_, req_);
+      req_ = 0;
+      heads_ = SCM_EOL;
+    }
+}
+
+void
+Note_head_line_engraver::stop_translation_timestep ()
+{
+  if (line_)
+    {
+      typeset_grob (line_);
+      line_ = 0;
+    }
+}
+
+
+ADD_THIS_TRANSLATOR (Note_head_line_engraver);
+
index e290df52a924e6b144a2829516d9222cff688a76..b44508c4b834c7b53598dec1d45ff8436bb3f2fb 100644 (file)
@@ -159,6 +159,7 @@ yylex (YYSTYPE *s,  void * v_l)
 %token DURATION
 %token EXTENDER
 %token FONT
+%token GLISSANDO
 %token GRACE
 %token HEADER
 %token HYPHEN
@@ -1170,6 +1171,11 @@ verbose_request:
                a->set_spot (THIS->here_input ());
                $$ = a;
        }
+       | GLISSANDO {
+               Glissando_req *g = new Glissando_req;
+               g->set_spot /* No pun intended */ (THIS->here_input ());
+               $$ = g;
+       }       
        ;
 
 sup_quotes:
index a6447b5f26a6869dfe74622c0b58de2f7a92fa88..576054389e3b609ef0bbd66539d6bc0d1db5ee70 100644 (file)
@@ -213,7 +213,7 @@ Pitch::print_smob (SCM s, SCM port, scm_print_state *)
   Pitch  *r = (Pitch *) gh_cdr (s);
      
   scm_puts ("#<Pitch ", port);
-  scm_display (gh_str02scm ((char*)r->str().ch_C()), port);
+  scm_display (ly_str02scm (r->str().ch_C()), port);
   scm_puts (" >", port);
   
   return 1;
index e84fee6f47b3dc0ee08a628d902a973c7fe40ee7..c83551e5569856327078f1e18cbd47f8dd15447d 100644 (file)
@@ -9,6 +9,7 @@
 #include "molecule.hh"
 #include "text-item.hh"
 #include "text-spanner.hh"
+#include "line-spanner.hh"
 #include "spanner.hh"
 #include "font-interface.hh"
 #include "dimensions.hh"
@@ -35,26 +36,19 @@ Text_spanner::brew_molecule (SCM smob)
   Spanner *spanner = dynamic_cast<Spanner*> (me);
 
   Real staff_space = Staff_symbol_referencer::staff_space (me);
-  Real thickness = me->paper_l ()->get_var ("stafflinethickness");  
   
-
   Drul_array<bool> broken;
   Direction d = LEFT;
   do
     {
       Paper_column* s = dynamic_cast<Paper_column*>(spanner->get_bound (d)); // UGH
-      broken[d] = (!s->musical_b ());
+      if (s && s->musical_b ())
+       broken[d] = false;
+      else
+       broken[d] = true;
     }
   while (flip (&d) != LEFT);
   
-#if 0
-  SCM s = me->get_grob_property ("text-style");
-
-  String text_style = "italic";
-  if (gh_string_p (s))
-    text_style = ly_scm2string (s);
-#endif
-
   SCM properties = Font_interface::font_alist_chain (me);
 
   SCM edge_text = me->get_grob_property ("edge-text");
@@ -98,83 +92,40 @@ Text_spanner::brew_molecule (SCM smob)
       width = 0;
     }
 
-
-  String type = "dashed-line";
-  s = me->get_grob_property ("type");
-  if (gh_string_p (s))
-    type = ly_scm2string (s);
-
+  /* ugh */
+  Real thick = me->paper_l ()->get_var ("stafflinethickness");  
+  
   Molecule line;
-  Drul_array<Molecule> edge_line;
-  if (type == "line"
-      || type == "dashed-line"
-      || type == "dotted-line")
+  SCM list = Line_spanner::line_atom (me, width, 0);
+  if (list != SCM_EOL)
     {
-      Real thick = thickness;
-      s = me->get_grob_property ("line-thickness");
-      if (gh_number_p (s))
-       thick *= gh_scm2double (s);
-  
-      // maybe these should be in line-thickness?
-      Real length = staff_space;
-      s = me->get_grob_property ("dash-length");
-      if (gh_number_p (s))
-       length = gh_scm2double (s) * staff_space;
-
-      Real period = 2 * length + thick;
-      s = me->get_grob_property ("dash-period");
-      if (gh_number_p (s))
-       period = gh_scm2double (s) * staff_space;
       
-      if (type == "dotted-line")
-       length = thick;
-       
-      if (type == "line")
-       length = period + thick;
-
-      Real on = length - thick;
-      Real off = period - on;
-
-      SCM list = gh_list (ly_symbol2scm ("dashed-line"),
-                         gh_double2scm (thick),
-                         gh_double2scm (on),
-                         gh_double2scm (off),
-                         gh_double2scm (width),
-                         gh_double2scm (0),
-                         SCM_UNDEFINED);
-
       Box b (Interval (0, width), Interval (-thick / 2, thick / 2));
       line = Molecule (b, list);
-
-      s = me->get_grob_property ("edge-height");
-      if (gh_pair_p (s))
+    }
+  
+  Drul_array<Molecule> edge_line;
+  s = me->get_grob_property ("edge-height");
+  if (gh_pair_p (s))
+    {
+      Direction d = LEFT;
+      int dir = to_dir (me->get_grob_property ("direction"));
+      do
        {
-         Direction d = LEFT;
-         int dir = to_dir (me->get_grob_property ("direction"));
-         do
+         Real dy = gh_scm2double (index_cell (s, d)) * - dir;
+         if (dy)
            {
-             Real dy = gh_scm2double (index_cell (s, d)) * - dir;
-             if (dy)
-               {
-                 SCM list = gh_list (ly_symbol2scm ("dashed-line"),
-                                     gh_double2scm (thick),
-                                     gh_double2scm (on),
-                                     gh_double2scm (off),
-                                     gh_double2scm (0),
-                                     gh_double2scm (dy),
-                                     SCM_UNDEFINED);
-                 
-                 Box b (Interval (0, thick),
-                        dy > 0
-                        ? Interval (0, dy)
-                        : Interval (dy, 0));
-                 edge_line[d] = Molecule (b, list);
-               }
+             SCM list = Line_spanner::line_atom (me, 0, dy);
+             Box b (Interval (0, thick),
+                    dy > 0
+                    ? Interval (0, dy)
+                    : Interval (dy, 0));
+             edge_line[d] = Molecule (b, list);
            }
-         while (flip (&d) != LEFT);
        }
+      while (flip (&d) != LEFT);
     }
-
+  
   Molecule m;
   if (!edge[LEFT].empty_b ())
     m = edge[LEFT];
index e6cca6f7ecd31c4e7bf35dd94ff0b2d1d25c551e..d44bd8fbf62ddd8731db2dc048f0f5218c82f479 100644 (file)
@@ -181,6 +181,7 @@ ThreadContext = \translator{
        \type Engraver_group_engraver;
        \consists "Thread_devnull_engraver";
        \consists "Note_heads_engraver";
+       \consists "Note_head_line_engraver";
        \consists "Output_property_engraver";   
        Generic_property_list = #generic-thread-properties
        \consists "Property_engraver";
index d0360c4938100dd009b169f3e98e62927c254650..97a7e0fb702eeaef909a0845654d34642e1f5979 100644 (file)
@@ -299,7 +299,7 @@ bracket. Setting the property to #'if-no-beam will make it
 print only if there is no beam associated with this tuplet bracket.")
 (elt-property-description 'tuplet-number-visibility boolean-or-symbol? "
 Like @code{tuplet-bracket-visibility}, but for the number.")
-(elt-property-description 'type string? "one of: line, dashed-line or dotted-line")
+(elt-property-description 'type symbol? "one of: line, dashed-line or dotted-line")
 (elt-property-description 'vertical-position-quant-function procedure? "
 function of type (beam multiplicity dy staff-line-thickness) -> real.  Default value: default-beam-y-quants, also available: beam-traditional-y-quants.
 ")
index 97c1fac4b0e582d2b74b94cbd466439bff590122..98a6a4450ca70efe6e147f9d8077d525f1abe997 100644 (file)
                        rhythmic-head-interface font-interface 
                        note-head-interface ))
        ))
+       (NoteHeadLine . (
+                        (type . line)
+                        (gap . 0.5)
+                        (molecule-callback . ,Line_spanner::brew_molecule)
+                        (meta . ,(element-description "NoteHeadLine"
+                                                      line-spanner-interface))
+                        ))
 
        (NoteName . (
                (molecule-callback . ,Text_item::brew_molecule)
index 882f083290146a0e9f6b099647ccf04a1039d2cd..f7256676a6346fc9930d7b6f8a9a17b9a0f4f5bf 100644 (file)
 
 (define generic-notename-properties
   (cons 'note-name-interface
-       (list (list 'noteNaemStyle symbol? 'style))))
+       (list (list 'noteNameStyle symbol? 'style))))
 
 
 (define generic-rest-properties
index a989bdbef8749483011bc4d2b441dcc225a450c1..e7f091e4c613fa7c770e7eddfdf8f554a7a0ffa4 100644 (file)
@@ -472,6 +472,18 @@ font-point-size font-relative-size)
 
     )))
 
+(define line-spanner-interface
+  (lily-interface
+   'line-spanner-interface
+   "generic line spanner"
+   '(
+    dash-period 
+    dash-length 
+    line-thickness 
+    type 
+    )
+   ))
+
 (define lyric-hyphen-interface
   (lily-interface
    'lyric-hyphen-interface