]> git.donarmstrong.com Git - lilypond.git/blobdiff - lily/duration-scheme.cc
move trill line into line-interface. Allows angled trill lines.
[lilypond.git] / lily / duration-scheme.cc
index e683b22454e93aa79b6ec853a6f0f2685e6ba90d..4b8c4605c0e19e40c984c4b1e4fe424a7b112d0c 100644 (file)
@@ -3,7 +3,7 @@
 
   source file of the LilyPond music typesetter
 
-  (c) 1997--2005 Jan Nieuwenhuizen <janneke@gnu.org>
+  (c) 1997--2007 Jan Nieuwenhuizen <janneke@gnu.org>
   Han-Wen Nienhuys <hanwen@xs4all.nl>
 */
 
@@ -53,13 +53,13 @@ LY_DEFINE (ly_make_duration, "ly:make-duration",
           "(whole, half, quarter, etc.) and a number of augmentation\n"
           "dots. \n")
 {
-  SCM_ASSERT_TYPE (scm_integer_p (length) == SCM_BOOL_T,
+  SCM_ASSERT_TYPE (scm_is_integer (length),
                   length, SCM_ARG1, __FUNCTION__, "integer");
 
   int dots = 0;
   if (dotcount != SCM_UNDEFINED)
     {
-      SCM_ASSERT_TYPE (scm_integer_p (dotcount) == SCM_BOOL_T,
+      SCM_ASSERT_TYPE (scm_is_integer (dotcount),
                       dotcount, SCM_ARG2, __FUNCTION__, "integer");
       dots = scm_to_int (dotcount);
     }
@@ -113,6 +113,22 @@ LY_DEFINE (ly_intlog2, "ly:intlog2",
   return scm_from_int (log);
 }
 
+LY_DEFINE (ly_duration_length, "ly:duration-length",
+          1, 0, 0, (SCM dur),
+          "The length of the duration as a Moment.")
+{
+  SCM_ASSERT_TYPE (unsmob_duration (dur), dur, SCM_ARG1, __FUNCTION__, "duration");
+  return Moment (unsmob_duration (dur)->get_length ()).smobbed_copy ();
+}
+
+LY_DEFINE (ly_duration2string, "ly:duration->string",
+          1, 0, 0, (SCM dur),
+          "Convert @var{dur} to string.")
+{
+  SCM_ASSERT_TYPE (unsmob_duration (dur), dur, SCM_ARG1, __FUNCTION__, "duration");
+  return ly_string2scm (unsmob_duration (dur)->to_string ());
+}
+
 LY_DEFINE (ly_duration_factor, "ly:duration-factor",
           1, 0, 0, (SCM dur),
           "Extract the compression factor from @var{dur}. Return as a pair.")