]> git.donarmstrong.com Git - lilypond.git/blobdiff - lily/music.cc
* scm/*.scm: make-music-by-name is replaced by make-music, which
[lilypond.git] / lily / music.cc
index fefeda054dbe86d8beeba3a5a3aaa94fab817a57..b5964c87fc64af03aec4f59784edf7b71fe2897a 100644 (file)
 #include "ly-smobs.icc"
 
 
-SCM ly_deep_mus_copy (SCM);
 
 bool
 Music::internal_is_music_type (SCM k)const
 {
-  SCM ifs = get_mus_property ("types");
+  SCM ifs = get_property ("types");
 
   return scm_memq (k, ifs) != SCM_BOOL_F;
 }
@@ -28,7 +27,7 @@ Music::internal_is_music_type (SCM k)const
 String
 Music::name () const
 {
-  SCM nm = get_mus_property ("name");
+  SCM nm = get_property ("name");
   if (gh_symbol_p (nm))
     {
       return ly_symbol2string (nm);
@@ -83,7 +82,7 @@ Music::mark_smob (SCM m)
 Moment
 Music::get_length () const
 {
-  SCM l = get_mus_property ("length");
+  SCM l = get_property ("length");
   if (unsmob_moment (l))
     return *unsmob_moment (l);
   else if (gh_procedure_p (l))
@@ -98,7 +97,7 @@ Music::get_length () const
 Moment
 Music::start_mom () const
 {
-  SCM l = get_mus_property ("start-moment-function");
+  SCM l = get_property ("start-moment-function");
   if (gh_procedure_p (l))
     {
       SCM res = gh_call1 (l, self_scm ());
@@ -130,7 +129,7 @@ Music::print_smob (SCM s, SCM p, scm_print_state*)
   scm_puts ("#<Music ", p);
   Music* m = unsmob_music (s);
 
-  SCM nm = m->get_mus_property ("name");
+  SCM nm = m->get_property ("name");
   if (gh_symbol_p (nm) || gh_string_p (nm))
     {
       scm_display (nm, p);
@@ -153,12 +152,12 @@ Music::print_smob (SCM s, SCM p, scm_print_state*)
 Pitch
 Music::to_relative_octave (Pitch p)
 {
-  SCM elt = get_mus_property ("element");
+  SCM elt = get_property ("element");
 
   if (Music* m = unsmob_music (elt))
     p = m->to_relative_octave (p);
 
-  p = music_list_to_relative (get_mus_property ("elements"),
+  p = music_list_to_relative (get_property ("elements"),
                              p, false);
   return p;
 }
@@ -166,24 +165,24 @@ Music::to_relative_octave (Pitch p)
 void
 Music::compress (Moment factor)
 {
-  SCM elt = get_mus_property ("element");
+  SCM elt = get_property ("element");
 
   if (Music* m = unsmob_music (elt))
     m->compress (factor);
 
-  compress_music_list (get_mus_property ("elements"), factor);
+  compress_music_list (get_property ("elements"), factor);
 }
 
 
 void
 Music::transpose (Pitch delta)
 {
-  SCM elt = get_mus_property ("element");
+  SCM elt = get_property ("element");
 
   if (Music* m = unsmob_music (elt))
     m->transpose (delta);
 
-  transpose_music_list (get_mus_property ("elements"), delta);
+  transpose_music_list (get_property ("elements"), delta);
 }
 
 
@@ -195,7 +194,7 @@ IMPLEMENT_DEFAULT_EQUAL_P (Music);
 /****************************/
 
 SCM
-Music::internal_get_mus_property (SCM sym) const
+Music::internal_get_property (SCM sym) const
 {
   SCM s = scm_sloppy_assq (sym, mutable_property_alist_);
   if (s != SCM_BOOL_F)
@@ -206,7 +205,7 @@ Music::internal_get_mus_property (SCM sym) const
 }
 
 void
-Music::internal_set_mus_property (SCM s, SCM v)
+Music::internal_set_property (SCM s, SCM v)
 {
   if (internal_type_checking_global_b)
     if (!type_check_assignment (s, v, ly_symbol2scm ("music-type?")))
@@ -220,13 +219,13 @@ Music::internal_set_mus_property (SCM s, SCM v)
 void
 Music::set_spot (Input ip)
 {
-  set_mus_property ("origin", make_input (ip));
+  set_property ("origin", make_input (ip));
 }
 
 Input*
 Music::origin () const
 {
-  Input *ip = unsmob_input (get_mus_property ("origin"));
+  Input *ip = unsmob_input (get_property ("origin"));
   return ip ? ip : & dummy_input_global; 
 }
 
@@ -245,8 +244,8 @@ LY_DEFINE(ly_music_length,
   return sc->get_length().smobbed_copy();
 }
 
-LY_DEFINE(ly_get_mus_property,
-         "ly:get-mus-property", 2, 0, 0,  (SCM mus, SCM sym),
+LY_DEFINE(ly_music_property,
+         "ly:music-property", 2, 0, 0,  (SCM mus, SCM sym),
          "Get the property @var{sym} of music expression @var{mus}.\n"
          "If @var{sym} is undefined, return @code{'()}.\n" )
 {
@@ -254,11 +253,11 @@ LY_DEFINE(ly_get_mus_property,
   SCM_ASSERT_TYPE(sc, mus, SCM_ARG1, __FUNCTION__, "music");
   SCM_ASSERT_TYPE(gh_symbol_p (sym), sym, SCM_ARG2, __FUNCTION__, "symbol");  
 
-  return sc->internal_get_mus_property (sym);
+  return sc->internal_get_property (sym);
 }
 
-LY_DEFINE(ly_set_mus_property,
-         "ly:set-mus-property!", 3, 0, 0,
+LY_DEFINE(ly_music_set_property,
+         "ly:music-set-property!", 3, 0, 0,
          (SCM mus, SCM sym, SCM val),
          "Set property @var{sym} in music expression @var{mus} to @var{val}.")
 {
@@ -269,7 +268,7 @@ LY_DEFINE(ly_set_mus_property,
   bool ok = type_check_assignment (sym, val, ly_symbol2scm ("music-type?"));
   if (ok)
     {
-      sc->internal_set_mus_property (sym, val);
+      sc->internal_set_property (sym, val);
     }
     
   return SCM_UNSPECIFIED;
@@ -292,15 +291,13 @@ LY_DEFINE(ly_music_name, "ly:music-name", 1, 0, 0,
 // to do  property args 
 LY_DEFINE(ly_extended_make_music,
          "ly:make-bare-music", 2, 0, 0,  (SCM type, SCM props),
-         "Make a music object/expression of type @var{type}, init with\n"
-"@var{props}. Warning: this interface will likely change in the near\n"
-"future.\n"
-"\n"
-"Music is the data type that music expressions are stored in. The data\n"
-"type does not yet offer many manipulations.\n"
-"\n"
-"WARNING: only for internal use. Please use make-music-by-name. \n"
-)
+         "Make a C++ music object of type @var{type}, 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(gh_string_p (type), type, SCM_ARG1, __FUNCTION__, "string");
 
@@ -313,10 +310,10 @@ LY_DEFINE(ly_extended_make_music,
 // to do  property args 
 LY_DEFINE(ly_get_mutable_properties,
          "ly:get-mutable-properties", 1, 0, 0,  (SCM mus),
-"Return an alist signifying the mutable properties of @var{mus}.\n"
-"The immutable properties are not available; they should be initialized\n"
-"by the functions make-music-by-name function.\n"
-)
+         "Return an alist containing the mutable properties of @var{mus}.\n"
+         "The immutable properties are not available; they should be initialized\n"
+         "by the  @code{make-music} function.\n"
+         )
 {
   Music *m = unsmob_music (mus);
   SCM_ASSERT_TYPE(m, mus, SCM_ARG1, __FUNCTION__, "music");
@@ -324,7 +321,7 @@ LY_DEFINE(ly_get_mutable_properties,
   return m->get_property_alist (true);
 }
 
-LY_DEFINE(ly_music_list_p,"music-list?", 1, 0, 0, 
+LY_DEFINE(ly_music_list_p,"ly:music-list?", 1, 0, 0, 
   (SCM l),"Type predicate: return true if @var{l} is a list of music objects.")
 {
   if (scm_list_p (l) != SCM_BOOL_T)
@@ -382,7 +379,7 @@ Music*
 make_music_by_name (SCM sym)
 {
   if (!make_music_proc)
-    make_music_proc = scm_primitive_eval (ly_symbol2scm ("make-music-by-name"));
+    make_music_proc = scm_primitive_eval (ly_symbol2scm ("make-music"));
        
   SCM rv = scm_call_1 (make_music_proc, sym);