From 69d6926cc800285a88cb1d6beed46d77b9a58f41 Mon Sep 17 00:00:00 2001 From: Han-Wen Nienhuys Date: Wed, 3 Jan 2007 21:10:32 +0100 Subject: [PATCH] Coverage fixes. --- input/regression/bar-line-dotted.ly | 18 +++++++++++++++++ input/regression/chord-tremolo-single.ly | 13 ++++++++++++ lily/all-font-metrics.cc | 25 ------------------------ lily/ambitus.cc | 2 +- lily/beam.cc | 3 +++ lily/break-alignment-interface.cc | 16 --------------- lily/chord-tremolo-iterator.cc | 4 +++- scm/music-functions.scm | 9 +++++++-- 8 files changed, 45 insertions(+), 45 deletions(-) create mode 100644 input/regression/bar-line-dotted.ly create mode 100644 input/regression/chord-tremolo-single.ly diff --git a/input/regression/bar-line-dotted.ly b/input/regression/bar-line-dotted.ly new file mode 100644 index 0000000000..622ca7556b --- /dev/null +++ b/input/regression/bar-line-dotted.ly @@ -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 index 0000000000..f4c03abcf5 --- /dev/null +++ b/input/regression/chord-tremolo-single.ly @@ -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 +} + diff --git a/lily/all-font-metrics.cc b/lily/all-font-metrics.cc index 61b0a60e6f..c5caf100ad 100644 --- a/lily/all-font-metrics.cc +++ b/lily/all-font-metrics.cc @@ -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) diff --git a/lily/ambitus.cc b/lily/ambitus.cc index 1e6da083bc..b733ef615e 100644 --- a/lily/ambitus.cc +++ b/lily/ambitus.cc @@ -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) diff --git a/lily/beam.cc b/lily/beam.cc index a2e7a3cb92..a1beb8009a 100644 --- a/lily/beam.cc +++ b/lily/beam.cc @@ -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)) { diff --git a/lily/break-alignment-interface.cc b/lily/break-alignment-interface.cc index 37eae38297..893653041e 100644 --- a/lily/break-alignment-interface.cc +++ b/lily/break-alignment-interface.cc @@ -21,22 +21,6 @@ #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 (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 diff --git a/lily/chord-tremolo-iterator.cc b/lily/chord-tremolo-iterator.cc index 45ddbc443d..1a785b9c4d 100644 --- a/lily/chord-tremolo-iterator.cc +++ b/lily/chord-tremolo-iterator.cc @@ -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) diff --git a/scm/music-functions.scm b/scm/music-functions.scm index 189f960ff6..08324e1077 100644 --- a/scm/music-functions.scm +++ b/scm/music-functions.scm @@ -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))) -- 2.39.5