]> git.donarmstrong.com Git - lilypond.git/blobdiff - lily/duration-scheme.cc
Merge with git+ssh://jneem@git.sv.gnu.org/srv/git/lilypond.git
[lilypond.git] / lily / duration-scheme.cc
index 10a4bd16b28ff0a63a0eca4aa89063765be58614..fb4bb102632b9946286d07abc048dfb4308b306a 100644 (file)
@@ -3,8 +3,8 @@
 
   source file of the LilyPond music typesetter
 
-  (c) 1997--2005 Jan Nieuwenhuizen <janneke@gnu.org>
-  Han-Wen Nienhuys <hanwen@cs.uu.nl>
+  (c) 1997--2006 Jan Nieuwenhuizen <janneke@gnu.org>
+  Han-Wen Nienhuys <hanwen@xs4all.nl>
 */
 
 #include "duration.hh"
@@ -113,6 +113,14 @@ 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_duration_factor, "ly:duration-factor",
           1, 0, 0, (SCM dur),
           "Extract the compression factor from @var{dur}. Return as a pair.")