]> git.donarmstrong.com Git - lilypond.git/blobdiff - lily/quote-iterator.cc
Uniformize, internalize.
[lilypond.git] / lily / quote-iterator.cc
index 4998d735f811f851b4d120e492968bbc991b65da..71fd74024ea92ff98a4dcf000cd5337d840d8583 100644 (file)
@@ -3,7 +3,7 @@
 
   source file of the GNU LilyPond music typesetter
 
-  (c) 2004 Han-Wen Nienhuys <hanwen@xs4all.nl>
+  (c) 2004--2005 Han-Wen Nienhuys <hanwen@xs4all.nl>
 
 */
 
 #include "music-sequence.hh"
 #include "lily-guile.hh"
 #include "music-wrapper-iterator.hh"
-#include "music.hh"
-#include "input.hh"
 #include "warn.hh"
-#include "interpretation-context-handle.hh"
 
 class Quote_iterator : public Music_wrapper_iterator
 {
@@ -74,17 +71,17 @@ Quote_iterator::Quote_iterator ()
 
 
 int
-binsearch_scm_vector (SCM vec, SCM key, bool (*is_less)(SCM a,SCM b))
+binsearch_scm_vector (SCM vec, SCM key, bool (*is_less)(SCM a, SCM b))
 {
   int lo = 0;
-  int hi = SCM_VECTOR_LENGTH (vec);
+  int hi = scm_c_vector_length (vec);
 
   /* binary search */
   do
   {
     int cmp = (lo + hi) / 2;
 
-      SCM when = scm_caar (SCM_VECTOR_REF (vec, cmp));
+      SCM when = scm_caar (scm_c_vector_ref (vec, cmp));
       bool result =  (*is_less) (key, when);
       if (result)
           hi = cmp;
@@ -141,7 +138,7 @@ bool
 Quote_iterator::quote_ok () const
 {
   return (event_idx_ >= 0
-         && ly_c_vector_p (event_vector_)
+         && scm_is_vector (event_vector_)
          && event_idx_ <= end_idx_
 
          /*
@@ -174,7 +171,7 @@ Quote_iterator::pending_moment () const
 Moment
 Quote_iterator::vector_moment (int idx) const
 {
-  SCM entry = SCM_VECTOR_REF (event_vector_, idx);
+  SCM entry = scm_c_vector_ref (event_vector_, idx);
   return *unsmob_moment (scm_caar (entry));
 }
 
@@ -184,7 +181,7 @@ Quote_iterator::process (Moment m)
   if (Music_wrapper_iterator::ok())
     Music_wrapper_iterator::process (m);
 
-  if (!ly_c_vector_p (event_vector_))
+  if (!scm_is_vector (event_vector_))
     return ;
   
   if (event_idx_ < 0)
@@ -215,7 +212,7 @@ Quote_iterator::process (Moment m)
 
   if (quote_ok ())
     {
-      SCM entry = SCM_VECTOR_REF (event_vector_, event_idx_);
+      SCM entry = scm_c_vector_ref (event_vector_, event_idx_);
       Pitch * quote_pitch = unsmob_pitch (scm_cdar (entry));
 
       /*
@@ -242,7 +239,7 @@ Quote_iterator::process (Moment m)
 
                  Pitch diff = pitch_interval (qp, mp);
 
-                 SCM copy = ly_deep_mus_copy (mus->self_scm ());
+                 SCM copy = ly_music_deep_copy (mus->self_scm ());
                  mus = unsmob_music (copy);
                  
                  transposed_musics_ = scm_cons (copy, transposed_musics_);