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"
"(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);
}
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.")