]> git.donarmstrong.com Git - lilypond.git/commitdiff
Define ly:event?
authorDavid Kastrup <dak@gnu.org>
Thu, 22 Sep 2011 00:01:52 +0000 (02:01 +0200)
committerDavid Kastrup <dak@gnu.org>
Thu, 22 Sep 2011 19:21:41 +0000 (21:21 +0200)
lily/music-scheme.cc
scm/lily.scm

index f8eca4a6fe4d80faa004b9bfb7d734efcfbf0807..89c810a5679df344d5ab41ee8f4f70c2b9dbfd81 100644 (file)
@@ -73,6 +73,17 @@ LY_DEFINE (ly_music_p, "ly:music?",
   return scm_from_bool (unsmob_music (obj));
 }
 
+LY_DEFINE (ly_event_p, "ly:event?",
+           1, 0, 0, (SCM obj),
+           "Is @var{obj} an event object?")
+{
+  if (Music *m = unsmob_music (obj))
+    {
+      return scm_from_bool (m->is_mus_type ("event"));
+    }
+  return SCM_BOOL_F;
+}
+
 /* todo: property args */
 LY_DEFINE (ly_music_mutable_properties, "ly:music-mutable-properties",
            1, 0, 0, (SCM mus),
index b82cd08aa2a2630077c06e38950eab438df7aa50..6230940860ab2edb66e4998e8367f1c07acfc832 100644 (file)
@@ -553,6 +553,7 @@ LilyPond safe mode.  The syntax is the same as `define*-public'."
     (,ly:dir? . "direction")
     (,ly:dispatcher? . "dispatcher")
     (,ly:duration? . "duration")
+    (,ly:event? . "event")
     (,ly:font-metric? . "font metric")
     (,ly:grob? . "graphical (layout) object")
     (,ly:grob-array? . "array of grobs")