]> git.donarmstrong.com Git - lilypond.git/commitdiff
(Generic_prefix_music_scm): add
authorHan-Wen Nienhuys <hanwen@xs4all.nl>
Sat, 6 Nov 2004 20:52:20 +0000 (20:52 +0000)
committerHan-Wen Nienhuys <hanwen@xs4all.nl>
Sat, 6 Nov 2004 20:52:20 +0000 (20:52 +0000)
MUSIC_FUNCTION_SCM_SCM_MUSIC

ChangeLog
lily/include/moment.hh
lily/include/music-wrapper-iterator.hh
lily/moment.cc
lily/music-wrapper-iterator.cc
lily/parser.yy
lily/quote-iterator.cc
ly/music-functions-init.ly
scm/define-music-types.scm

index 4c10f23372b66532b137e0d7c148b502ac3a2b43..41394d7903e451d789609ac7a99223e4d595a91b 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,8 +1,12 @@
 2004-11-06  Han-Wen Nienhuys  <hanwen@xs4all.nl>
 
-       * scm/lily.scm (sanitize-command-option): new function.
+       * lily/parser.yy (Generic_prefix_music_scm): add
+       MUSIC_FUNCTION_SCM_SCM_MUSIC
 
-       * scm/framework-tex.scm (header): sanitize TeX paper size. 
+       * scm/lily.scm (sanitize-command-option): new function. (backportme)
+
+       * scm/framework-tex.scm (header): sanitize TeX paper size.
+       (backportme)
 
 2004-11-06  Jan Nieuwenhuizen  <janneke@gnu.org>
 
index 894c9d70179bc9612cb788937fedcedfcb6f6ab8..7d4f7977bc52f45ff3854dd08077603e20296946 100644 (file)
@@ -66,5 +66,7 @@ Moment robust_scm2moment (SCM, Moment);
 std::ostream & operator << (std::ostream &, Moment const &);
 #endif
 
+bool moment_less (SCM a, SCM b);
+
 #endif /* MOMENT_HH */
 
index 0befe300b0ebdde34d6d730b9bfa74bf8c737d46..8738152e2b137787553fea88c8a6f7952e5b1509 100644 (file)
@@ -25,7 +25,6 @@ public:
   Music_wrapper_iterator ();
 
   virtual void derived_substitute (Context *f, Context *t) ;
-
   virtual void derived_mark () const;
   virtual void construct_children () ;
   virtual Moment pending_moment () const;
index f30f3613675eaed971f50356056f6efa478b22da..51664870b46c917078c3dd282f311bd5827d2615 100644 (file)
@@ -257,3 +257,11 @@ robust_scm2moment (SCM m, Moment d)
   else
     return *p;
 }
+
+
+bool
+moment_less (SCM a, SCM b)
+{
+  return  *unsmob_moment (a) < *unsmob_moment (b);
+}
+
index 428cac5a623a3a0308070a205bc938e41ec9ffa9..7d6f3888b4676b1546d66a6947b7b5aa409e7838 100644 (file)
@@ -12,7 +12,7 @@
 
 Music_wrapper_iterator::Music_wrapper_iterator ()
 {
-  child_iter_ =0;
+  child_iter_ = 0;
 }
 
 void
@@ -31,7 +31,6 @@ Music_wrapper_iterator::derived_mark () const
 void
 Music_wrapper_iterator::derived_substitute (Context *f,Context *t) 
 {
-  
   if (child_iter_)
     child_iter_->substitute_outlet (f,t);
 }
index 1c33a0108270762c88c3199fbd5a005e994d4fc2..0c3b76df01172477d5d2191e2a58cff2a1371b10 100644 (file)
@@ -1016,6 +1016,11 @@ Generic_prefix_music_scm:
        }  embedded_scm embedded_scm {
                $$ = scm_list_4 ($1, make_input (THIS->pop_spot ()), $3, $4);
        }
+       | MUSIC_FUNCTION_SCM_SCM_MUSIC {
+               THIS->push_spot (); 
+       }  embedded_scm embedded_scm Music {
+               $$ = scm_list_5 ($1, make_input (THIS->pop_spot ()), $3, $4, $5->self_scm ());
+       }
        | MUSIC_FUNCTION_MARKUP_MUSIC {
                THIS->push_spot (); 
        }  full_markup Music {
index 3b676a4cd5155f544f60766c6cc20e571be4b31a..9e012104de4cbd1edeeaebfea9d2cfbf5edb0a35 100644 (file)
@@ -70,35 +70,8 @@ Quote_iterator::Quote_iterator ()
   end_idx_ = 0;
 }
 
-bool
-moment_less (SCM a, SCM b)
-{
-  return  *unsmob_moment (a) < *unsmob_moment (b);
-}
-
-
 int
-binsearch_scm_vector (SCM vec, SCM key, bool (*is_less)(SCM a,SCM b))
-{
-  int lo = 0;
-  int hi = SCM_VECTOR_LENGTH (vec);
-
-  /* binary search */
-  do
-  {
-    int cmp = (lo + hi) / 2;
-
-      SCM when = scm_caar (SCM_VECTOR_REF (vec, cmp));
-      bool result =  (*is_less) (key, when);
-      if (result)
-          hi = cmp;
-      else
-          lo = cmp;
-    }
-  while (hi - lo > 1);
-
-  return lo;
-}
+binsearch_scm_vector (SCM vec, SCM key, bool (*is_less)(SCM a,SCM b));
 
 
 void
index d9e60efcfdb110937e9a52f978ee5958cc659c10..81129b7b0d5978eaaae85715eca29a8dbab78ce3 100644 (file)
@@ -72,6 +72,20 @@ keepWithTag =
        (memq tag tags))))
    music))
 
+
+
+quoteDuring =
+#(def-music-function
+  (location what dir music) (string? ly:dir? ly:music?)
+  (let*
+   ((quote-music (make-music 'NewQuoteMusic
+                            'quoted-music-name what
+                            'element music
+                            'origin location)
+             ))
+
+   quote-music))
+
 %{
 
 TODO:
index acb25a30952025aad92fb80d1bbe4144e16c1627..fb7f565067afd558d491f022d0a38c074c8ff55e 100644 (file)
@@ -409,6 +409,13 @@ goes down).")
        (iterator-ctor . ,Quote_iterator::constructor)
        (types . (general-music))
        ))
+    (NewQuoteMusic
+     . (
+       (description . "Quote preprocessed snippets of music. ")
+       (internal-class-name . "Music") ;;  so we get Event::get_length ().
+       (iterator-ctor . ,New_quote_iterator::constructor)
+       (types . (general-music))
+       ))
     
     (RelativeOctaveCheck
      . ((description . "Check if a pitch is in the correct octave.")