bool ok = type_check_assignment (sym, val, ly_symbol2scm ("music-type?"));
if (ok)
- {
- sc->internal_set_property (sym, val);
- }
+ sc->internal_set_property (sym, val);
return SCM_UNSPECIFIED;
}
-LY_DEFINE (ly_music_name, "ly:music-name",
- 1, 0, 0, (SCM mus),
- "Return the name of @var{music}.")
-{
- Music *m = unsmob_music (mus);
- SCM_ASSERT_TYPE (m, mus, SCM_ARG1, __FUNCTION__, "music");
-
- char const *nm = classname (m);
- return scm_makfrom0str (nm);
-}
/* todo: property args */
-LY_DEFINE (ly_extended_make_music, "ly:make-bare-music",
- 2, 0, 0, (SCM type, SCM props),
- "Make a C++ music object of type @var{type}, initialize with\n"
+LY_DEFINE (ly_make_music, "ly:make-music",
+ 1, 0, 0, (SCM props),
+ "Make a C++ Music object, initialize with\n"
"@var{props}. \n\n"
""
"This function is for internal use, and is only called by "
"@code{make-music}, which is the preferred interface "
"for creating music objects. ")
{
- SCM_ASSERT_TYPE (scm_is_string (type), type, SCM_ARG1, __FUNCTION__, "string");
- SCM s = make_music (ly_scm2string (type), props)->self_scm ();
- scm_gc_unprotect_object (s);
- return s;
+ Music *ms = new Music (props);
+ return ms->unprotect ();
}
/* todo: property args */
SCM copy = m;
if (unsmob_music (m))
{
- copy = unsmob_music (m)->clone ()->self_scm ();
- scm_gc_unprotect_object (copy);
+ Music *mcopy = unsmob_music (m)->clone ();
+ copy = mcopy->unprotect ();
}
else if (scm_is_pair (m))
copy = scm_cons (ly_music_deep_copy (scm_car (m)),
SCM_ASSERT_TYPE (m, mus, SCM_ARG1, __FUNCTION__, "Music");
Duration *d = unsmob_duration (m->get_property ("duration"));
-
- Moment l;
+ Moment len;
if (d)
- {
- l = d->get_length ();
- }
+ len = d->get_length ();
else
- programming_error ("Music has no duration");
- return l.smobbed_copy ();
+ programming_error ("music has no duration");
+ return len.smobbed_copy ();
}
LY_DEFINE (ly_music_duration_compress, "ly:music-duration-compress", 2, 0, 0,
orig = orig.transposed (*p);
- SCM key = scm_cons (scm_int2num (orig.get_octave ()),
- scm_int2num (orig.get_notename ()));
+ SCM key = scm_cons (scm_from_int (orig.get_octave ()),
+ scm_from_int (orig.get_notename ()));
- newlist = scm_cons (scm_cons (key, scm_int2num (orig.get_alteration ())),
+ newlist = scm_cons (scm_cons (key, scm_from_int (orig.get_alteration ())),
newlist);
}
else if (scm_is_number (key))
Pitch orig (0, scm_to_int (key), scm_to_int (alter));
orig = orig.transposed (*p);
- key = scm_int2num (orig.get_notename ());
- alter = scm_int2num (orig.get_alteration ());
+ key = scm_from_int (orig.get_notename ());
+ alter = scm_from_int (orig.get_alteration ());
newlist = scm_cons (scm_cons (key, alter), newlist);
}
}