]> git.donarmstrong.com Git - lilypond.git/commitdiff
Coverage fixes.
authorHan-Wen Nienhuys <hanwen@xs4all.nl>
Wed, 3 Jan 2007 20:10:32 +0000 (21:10 +0100)
committerHan-Wen Nienhuys <hanwen@xs4all.nl>
Wed, 3 Jan 2007 20:10:32 +0000 (21:10 +0100)
input/regression/bar-line-dotted.ly [new file with mode: 0644]
input/regression/chord-tremolo-single.ly [new file with mode: 0644]
lily/all-font-metrics.cc
lily/ambitus.cc
lily/beam.cc
lily/break-alignment-interface.cc
lily/chord-tremolo-iterator.cc
scm/music-functions.scm

diff --git a/input/regression/bar-line-dotted.ly b/input/regression/bar-line-dotted.ly
new file mode 100644 (file)
index 0000000..622ca75
--- /dev/null
@@ -0,0 +1,18 @@
+
+\header {
+  texidoc = "The dots in a dotted bar line are in spaces."
+
+}
+
+\version "2.10.0"
+
+\paper {  ragged-right = ##t }
+
+\relative \new StaffGroup <<
+  \new Staff {
+    c4 \bar ":" c }
+  \new Staff {
+    c c
+  }
+>>
+
diff --git a/input/regression/chord-tremolo-single.ly b/input/regression/chord-tremolo-single.ly
new file mode 100644 (file)
index 0000000..f4c03ab
--- /dev/null
@@ -0,0 +1,13 @@
+\version "2.10.0"
+
+\header{
+texidoc="Chord tremolos on a single note."
+}
+
+\context Voice \relative c' {
+  \time 4/4
+  \repeat "tremolo" 32 { d32 }
+
+  c4 c4 c4 c4 c4 
+}
+
index 61b0a60e6f988f741160882a2a2037db7070ed81..c5caf100adf7c7dc09b832d52d7019b596517dc9 100644 (file)
@@ -104,31 +104,6 @@ All_font_metrics::find_pango_font (PangoFontDescription *description,
 
 #endif
 
-string
-kpathsea_find_file (string name, string ext)
-{
-  name += "." + ext;
-  string path = global_path.find (name);
-  if (path.length () > 0)
-    return path;
-
-  static SCM proc;
-  if (!proc)
-    {
-      SCM module = scm_c_resolve_module ("scm kpathsea");
-      proc = scm_c_module_lookup (module, "ly:kpathsea-find-file");
-      proc = scm_variable_ref (proc);
-    }
-
-  if (ly_is_procedure (proc))
-    {
-      SCM kp_result = scm_call_1 (proc, scm_makfrom0str (name.c_str ()));
-      if (scm_is_string (kp_result))
-       return ly_scm2string (kp_result);
-    }
-
-  return "";
-}
 
 Open_type_font *
 All_font_metrics::find_otf (string name)
index 1e6da083bc1d13ae654c0858d5a06aa1cd5b4a3c..b733ef615ecebae0339225a03c2a9ec5b2d4251f 100644 (file)
@@ -24,7 +24,7 @@ Ambitus::print (SCM smob)
   Item *me = (Item *) unsmob_grob (smob);
   Stencil stencil;
 
-  // join heads
+  // FIXME : should be Ambitus_line join heads
   extract_grob_set (me, "note-heads", heads);
   if (to_boolean (me->get_property ("join-heads"))
       && heads.size () > 1)
index a2e7a3cb9214a5ceecd79c0406f790049d50dba6..a1beb8009a6bf0bf13f5c40ec0288aad76e6091a 100644 (file)
@@ -265,6 +265,9 @@ Beam::calc_beaming (SCM smob)
        }
       else
        {
+         /*
+           FIXME: what's this for? 
+          */
          SCM s = scm_cdr (this_beaming);
          for (; scm_is_pair (s); s = scm_cdr (s))
            {
index 37eae382978e3d53ea8dddc6ef7724f6f2ffcce7..893653041e2635ac2360ff2d2b8797b75e6566d2 100644 (file)
 #include "warn.hh"
 
 
-MAKE_SCHEME_CALLBACK (Break_alignment_interface, self_align_callback, 1);
-SCM
-Break_alignment_interface::self_align_callback (SCM smob)
-{
-  Grob *me = unsmob_grob (smob);
-
-  Item *item = dynamic_cast<Item *> (me);
-  Direction bsd = item->break_status_dir ();
-  if (bsd == LEFT)
-    me->set_property ("self-alignment-X", scm_from_int (RIGHT));
-
-  /*
-    Force break alignment itself to be done first, in the case
-  */
-  return Self_alignment_interface::aligned_on_self (me, X_AXIS);
-}
 
 /*
   This is tricky: we cannot modify 'elements, since callers are
index 45ddbc443d65121fc4b1b7fcadf009fb67fef568..1a785b9c4d379508699885b11ac0967cff8f3377 100644 (file)
@@ -29,7 +29,9 @@ Chord_tremolo_iterator::get_music_list () const
 
   int elt_count = body_is_sequential ? scm_ilength (body->get_property ("elements")) : 1;
 
-  if (body_is_sequential && elt_count != 2)
+  if (body_is_sequential &&
+      (elt_count != 2
+       && elt_count != 1))
     mus->origin ()->warning (_f ("expect 2 elements for chord tremolo, found %d", elt_count));
 
   if (elt_count <= 0)
index 189f960ff696a9cc81babab737149e59af3c76be..08324e10776b1eff3cefdfb3c96527bbb62dc94e 100644 (file)
@@ -228,10 +228,15 @@ Returns `obj'.
          (if (memq 'sequential-music (ly:music-property main 'types))
              ;; \repeat "tremolo" { c4 d4 }
              (let ((children (length (ly:music-property main 'elements))))
-               (if (not (= children 2))
+
+               ;; fixme: should be more generic.
+               (if (and (not (= children 2))
+                        (not (= children 1)))
                    (ly:warning (_ "expecting 2 elements for chord tremolo, found ~a") children))
                (ly:music-compress r (ly:make-moment 1 children))
-               (shift-duration-log r (1- shift) dots))
+               (shift-duration-log r
+                                   (if (= children 2)  (1- shift) shift)
+                                   dots))
              ;; \repeat "tremolo" c4
              (shift-duration-log r shift dots)))
        r)))