]> git.donarmstrong.com Git - lilypond.git/blobdiff - lily/lily-guile.cc
Caches full score pure minimum translations in align-interface implementing grobs.
[lilypond.git] / lily / lily-guile.cc
index 933bf271701959739cd5c9fcabbc8212e0a1ac0d..6aa40f78048eb12c71012e39efdae3f46019bf95 100644 (file)
@@ -527,6 +527,28 @@ robust_scm2double (SCM k, double x)
   return x;
 }
 
+vector<Real>
+ly_scm2floatvector (SCM l)
+{
+  vector<Real> floats;
+  for (SCM s = l; scm_is_pair (s); s = scm_cdr (s))
+    floats.push_back (robust_scm2double (scm_car (s), 0.0));
+  return floats;
+}
+
+SCM
+ly_floatvector2scm (vector<Real> v)
+{
+  SCM l = SCM_EOL;
+  SCM *tail = &l;
+  for (vsize i = 0; i < v.size (); i++)
+    {
+      *tail = scm_cons (scm_from_double (v[i]), SCM_EOL);
+      tail = SCM_CDRLOC (*tail);
+    }
+  return l;
+}
+
 string
 robust_scm2string (SCM k, string s)
 {