]> git.donarmstrong.com Git - lilypond.git/commitdiff
* lily/include/event.hh: remove file.
authorHan-Wen Nienhuys <hanwen@xs4all.nl>
Wed, 13 Jul 2005 18:22:35 +0000 (18:22 +0000)
committerHan-Wen Nienhuys <hanwen@xs4all.nl>
Wed, 13 Jul 2005 18:22:35 +0000 (18:22 +0000)
* lily/parser.yy (Lily_lexer): check EVENT_IDENTIFIER using 'event
in 'types property.

* lily/music.cc (duration_length_callback): new function.

* lily/event.cc: remove file.

* lily/music-constructor.cc: remove file.

* lily/music-scheme.cc (LY_DEFINE): rename to ly:make-music

* lily/context.cc (get_grob_key): nop if use_object_keys not set.
(get_context_key): idem.

* scm/lily.scm (lambda): new option object-keys (default to #f)

* ps/music-drawing-routines.ps: remove draw_beam.

* lily/lookup.cc (beam): use round_filled_polygon() for beam.

67 files changed:
ChangeLog
lily/accidental-engraver.cc
lily/auto-beam-engraver.cc
lily/auto-change-iterator.cc
lily/bar-check-iterator.cc
lily/beam-engraver.cc
lily/beam-performer.cc
lily/chord-name-engraver.cc
lily/cluster-engraver.cc
lily/coherent-ligature-engraver.cc
lily/completion-note-heads-engraver.cc
lily/context.cc
lily/custos-engraver.cc
lily/drum-note-engraver.cc
lily/drum-note-performer.cc
lily/dynamic-performer.cc
lily/event-chord-iterator.cc
lily/event.cc [deleted file]
lily/fingering-engraver.cc
lily/forbid-break-engraver.cc
lily/global-context.cc
lily/grace-music.cc
lily/gregorian-ligature-engraver.cc
lily/grid-point-engraver.cc
lily/grob-pitch-tuple.cc
lily/grob.cc
lily/include/engraver.hh
lily/include/event-chord-iterator.hh
lily/include/event.hh [deleted file]
lily/include/ligature-engraver.hh
lily/include/main.hh
lily/include/minterval.hh
lily/include/music.hh
lily/include/performer.hh
lily/include/program-option.hh
lily/key-engraver.cc
lily/key-performer.cc
lily/lyric-combine-music-iterator.cc
lily/lyric-combine-music.cc
lily/lyric-performer.cc
lily/mensural-ligature-engraver.cc
lily/music-constructor.cc [deleted file]
lily/music-scheme.cc
lily/music.cc
lily/new-lyric-combine-music-iterator.cc
lily/note-head.cc
lily/note-heads-engraver.cc
lily/note-performer.cc
lily/parser.yy
lily/part-combine-iterator.cc
lily/piano-pedal-performer.cc
lily/program-option.cc
lily/quote-iterator.cc
lily/rest-engraver.cc
lily/slur-performer.cc
lily/span-dynamic-performer.cc
lily/stem-engraver.cc
lily/swallow-perf.cc
lily/tab-note-heads-engraver.cc
lily/tempo-performer.cc
lily/tie-performer.cc
lily/type-swallow-translator.cc
scm/define-music-properties.scm
scm/define-music-types.scm
scm/lily.scm
scm/output-socket.scm
scm/safe-lily.scm

index b5354cf88667f5d6d7fc4df3fa0d052b3098685b..7b5a298b8d0269b73f70660ecb9457f6746f2747 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,25 @@
 2005-07-13  Han-Wen Nienhuys  <hanwen@xs4all.nl>
 
+       * lily/include/event.hh: remove file.
+
+       * lily/include/music-constructor.hh: remove file.
+
+       * lily/parser.yy (Lily_lexer): check EVENT_IDENTIFIER using 'event
+       in 'types property.
+
+       * lily/music.cc (duration_length_callback): new function.
+
+       * lily/event.cc: remove file.
+
+       * lily/music-constructor.cc: remove file.
+
+       * lily/music-scheme.cc (LY_DEFINE): rename to ly:make-music
+
+       * lily/context.cc (get_grob_key): nop if use_object_keys not set.
+       (get_context_key): idem.
+
+       * scm/lily.scm (lambda): new option object-keys (default to #f)
+
        * scm/output-svg.scm (utf-8-string): rename  from utf8-string.
 
        * scm/output-gnome.scm: remove beam routine.
index 93744e5a7b680a5da9c1e320dc4a0b2c21a5cdc2..9dc3010382af821df5c91153e73eff355736ac96 100644 (file)
@@ -16,6 +16,8 @@
 #include "side-position-interface.hh"
 #include "tie.hh"
 #include "warn.hh"
+#include "music.hh"
+#include "pitch.hh"
 
 class Accidental_entry
 {
index 46f0bf36bb6c5f649a192222b5e94f41bb923d84..636caeae8ac952acae0944e1fb6f4e7683e2ad9f 100644 (file)
@@ -16,6 +16,8 @@
 #include "item.hh"
 #include "spanner.hh"
 #include "context.hh"
+#include "duration.hh"
+
 
 class Auto_beam_engraver : public Engraver
 {
index 1d07d6a7de8c076b6b09bc992f4269466f461c52..e88692123a70932c0728a45a4fd4c99112329a9a 100644 (file)
@@ -7,7 +7,6 @@
 */
 
 #include "context.hh"
-#include "event.hh"
 #include "music-wrapper-iterator.hh"
 #include "direction.hh"
 
index 46479892ef67e5e8c1ae52221970db058dc1ccc6..bc617a3d11020ea0c3e2e56ef8b6b39c985d4328 100644 (file)
@@ -7,8 +7,9 @@
 */
 
 #include "simple-music-iterator.hh"
-#include "event.hh"
+#include "music.hh"
 #include "context.hh"
+#include "input.hh"
 
 /*
   Check bar checks. We do this outside the engravers so that you can
index 917d2db3c1193b258892b7d42d4976f85ee153be..8a9bb34b2df08cbb6f5f3d579b1223d414f094cf 100644 (file)
@@ -17,6 +17,7 @@
 #include "item.hh"
 #include "spanner.hh"
 #include "context.hh"
+#include "duration.hh"
 
 class Beam_engraver : public Engraver
 {
index 0b88e90086cc57e8d5627de2d132a2973d8088fa..679bb6b3527d093aa5a62a4753a823e00c8378d7 100644 (file)
@@ -11,6 +11,7 @@
 #include "audio-column.hh"
 #include "global-context.hh"
 #include "warn.hh"
+#include "music.hh"
 
 class Beam_performer : public Performer
 {
index 2eb1f1a695605ac8f86440c9b6f9a8edb56e4442..d3109d4d14a59e7e21591af4df80c45c487bcdbd 100644 (file)
@@ -16,6 +16,7 @@
 #include "protected-scm.hh"
 #include "context.hh"
 #include "warn.hh"
+#include "pitch.hh"
 
 class Chord_name_engraver : public Engraver
 {
index 565754199e79be00ce23f968299d26cd2377ae89..261df08564050de6ed35c34b072e2531deb3e57b 100644 (file)
@@ -11,6 +11,7 @@
 #include "note-head.hh"
 #include "note-column.hh"
 #include "group-interface.hh"
+#include "pitch.hh"
 
 class Cluster_spanner_engraver : public Engraver
 {
index bac7e8af0931ec3053500c12fa0fa810824f7d02..c695b7a76a3e8d83243b995e1b812cfd26192aa4 100644 (file)
@@ -12,6 +12,7 @@
 #include "staff-symbol-referencer.hh"
 #include "spanner.hh"
 #include "paper-column.hh"
+#include "pitch.hh"
 
 /*
  * This abstract class serves as common superclass for all ligature
index 8a9ac0fbef04082cbdc63de762f0ef902e391fb4..88ca639052a112bd4cf57765ffc7ad4d2df9be7c 100644 (file)
@@ -8,7 +8,7 @@
 
 #include "rhythmic-head.hh"
 #include "output-def.hh"
-#include "event.hh"
+#include "music.hh"
 #include "dots.hh"
 #include "dot-column.hh"
 #include "staff-symbol-referencer.hh"
 #include "spanner.hh"
 #include "tie.hh"
 #include "global-context.hh"
+#include "duration.hh"
+#include "pitch.hh"
+
+
 
 /*
   TODO: make matching rest engraver.
index b6ded9ec05e48736b8aacee2115e9a0e4b02c483..e57593e2878d99c46f729362b290f83cfb3c19a9 100644 (file)
@@ -8,6 +8,7 @@
 
 #include "context.hh"
 
+#include "program-option.hh"
 #include "context-def.hh"
 #include "ly-smobs.icc"
 #include "main.hh"
@@ -97,7 +98,9 @@ Context::Context (Object_key const *key)
   smobify_self ();
   properties_scm_ = (new Scheme_hash_table)->self_scm ();
   scm_gc_unprotect_object (properties_scm_);
-  scm_gc_unprotect_object (key_->self_scm ());
+
+  if (key_)
+    scm_gc_unprotect_object (key_->self_scm ());
 }
 
 /* TODO:  this shares code with find_create_context ().  */
@@ -234,6 +237,9 @@ Context::create_context (Context_def *cdef,
 Object_key const *
 Context::get_context_key (String type, String id)
 {
+  if (!use_object_keys)
+    return 0;
+      
   String now_key = type + "@" + id;
 
   int disambiguation_count = 0;
@@ -253,6 +259,9 @@ Context::get_context_key (String type, String id)
 Object_key const *
 Context::get_grob_key (String name)
 {
+  if (!use_object_keys)
+    return 0;
+  
   int disambiguation_count = 0;
   if (grob_counts_.find (name) != grob_counts_.end ())
     {
@@ -494,7 +503,9 @@ SCM
 Context::mark_smob (SCM sm)
 {
   Context *me = (Context *) SCM_CELL_WORD_1 (sm);
-  scm_gc_mark (me->key_->self_scm ());
+  if (me->key_)
+    scm_gc_mark (me->key_->self_scm ());
+  
   scm_gc_mark (me->context_list_);
   scm_gc_mark (me->aliases_);
   scm_gc_mark (me->definition_);
index 2e232ea8ca683f139f64987f1fb83fc50cbe4064..05532c117e05c3ec0a4e98350fd2d69abba47a75 100644 (file)
@@ -13,6 +13,8 @@
 #include "note-head.hh"
 #include "staff-symbol-referencer.hh"
 #include "warn.hh"
+#include "pitch.hh"
+
 
 /*
  * This class implements an engraver for custos symbols.
index 2d19c7d4bf699a5420b9f68488b6d234a58ed81a..8e9386a441774ea98bdd6fb995d609560f3aeddd 100644 (file)
@@ -13,6 +13,7 @@
 #include "script-interface.hh"
 #include "stem.hh"
 #include "note-column.hh"
+#include "duration.hh"
 
 class Drum_notes_engraver : public Engraver
 {
index aa867c44e7cb861d88b108c3345df84662b8cca3..f91331873591cbf6e91520f0cadb4995eca5b259 100644 (file)
@@ -11,6 +11,8 @@
 #include "audio-column.hh"
 #include "global-context.hh"
 #include "warn.hh"
+#include "pitch.hh"
+#include "music.hh"
 
 class Drum_note_performer : public Performer
 {
index 12312c74c8fd641e699df1a274f44f00903c8d59..3fda6d4dbe37959d42d1d54f3b45ef5eb0e0a4dc 100644 (file)
@@ -7,7 +7,9 @@
 */
 
 #include "performer.hh"
+
 #include "audio-item.hh"
+#include "music.hh"
 
 /*
   TODO:
index 212dccc37160ebc48dddcf556f55164e26b66913..01e839b40d8f1c9c3054e710273d67bb02f3c305 100644 (file)
 
 #include "context.hh"
 #include "warn.hh"
-#include "event.hh"
+#include "music.hh"
+#include "input.hh"
+#include "pitch.hh"
+#include "duration.hh"
 
 Event_chord_iterator::Event_chord_iterator ()
 {
@@ -34,12 +37,6 @@ Event_chord_iterator::construct_children ()
   get_bottom_context ();
 }
 
-Event_chord *
-Event_chord_iterator::get_elt () const
-{
-  return (Event_chord *) get_music ();
-}
-
 void
 Event_chord_iterator::process (Moment m)
 {
diff --git a/lily/event.cc b/lily/event.cc
deleted file mode 100644 (file)
index efea416..0000000
+++ /dev/null
@@ -1,37 +0,0 @@
-/*
-  event.cc -- implement Event
-
-  source file of the GNU LilyPond music typesetter
-
-  (c) 1996--2005 Han-Wen Nienhuys <hanwen@cs.uu.nl>
-*/
-
-#include "event.hh"
-#include "warn.hh"
-
-MAKE_SCHEME_CALLBACK (Event, length_callback, 1);
-SCM
-Event::length_callback (SCM m)
-{
-  Music *me = unsmob_music (m);
-  Duration *d = unsmob_duration (me->get_property ("duration"));
-
-  Moment mom;
-  if (d)
-    {
-      mom = d->get_length ();
-    }
-  return mom.smobbed_copy ();
-}
-
-Event::Event (SCM i)
-  : Music (i)
-{
-  if (!ly_is_procedure (length_callback_))
-    {
-      length_callback_ = length_callback_proc;
-    }
-}
-
-ADD_MUSIC (Event);
-
index 00e468a7816d0b6c529e0813effbe2ab643f771b..73e78489fe13fd0d33ad3761d9412e5127e62b31 100644 (file)
@@ -11,6 +11,8 @@
 #include "stem.hh"
 #include "rhythmic-head.hh"
 #include "self-alignment-interface.hh"
+#include "pitch.hh"
+
 
 class Fingering_engraver : public Engraver
 {
index fa4138bc48739631c785ea60cbfe94725b350182..474188706081d40ea990535a156416fd0c5d1109 100644 (file)
@@ -8,6 +8,10 @@
 #include "rhythmic-head.hh"
 #include "grob.hh"
 #include "score-engraver.hh"
+#include "input.hh"
+#include "pitch.hh"
+#include "duration.hh"
+#include "moment.hh"
 
 class Forbid_line_break_engraver : public Engraver
 {
index 7f342a182f2bebb4ef1f7edb7a73bb9fbd4cbe10..fe5429c8b9b249001965296d8286af61b5f7da91 100644 (file)
@@ -11,7 +11,7 @@
 #include <cstdio>
 
 #include "warn.hh"
-#include "event.hh"
+#include "music.hh"
 #include "music-iterator.hh"
 #include "score-context.hh"
 #include "context-def.hh"
index b6ae587881241c4e6b4bc12e7413a343aca2a7e6..3ed2d14aafd1768d414df1dbc564cbc799a886a3 100644 (file)
@@ -8,6 +8,8 @@
 
 #include "music.hh"
 #include "music-wrapper.hh"
+#include "moment.hh"
+
 
 class Grace_music
 {
index 7af8430ade27393fc6be2993f0f93383cb4b80d7..4840904b8edf60635c5ce2029e8cea2602c7d29c 100644 (file)
@@ -13,6 +13,7 @@
 #include "staff-symbol-referencer.hh"
 #include "spanner.hh"
 #include "paper-column.hh"
+#include "pitch.hh"
 
 /*
  * This abstract class is the common superclass for all ligature
index f2125a36cdf61c3b1736731ec59b8eb28242630b..d7e019b70bafa18aefebd8bf8a5f108f9fa0efab 100644 (file)
@@ -9,6 +9,7 @@
 
 #include "engraver.hh"
 #include "item.hh"
+#include "moment.hh"
 
 class Grid_point_engraver : public Engraver
 {
index 62ede1af08f6326d01948e7dd95a7501aab03907..452d035e3d82a5535e1526aeb272984c02b6633b 100644 (file)
@@ -8,7 +8,7 @@
 
 #include "grob-pitch-tuple.hh"
 
-#include "event.hh"
+#include "music.hh"
 
 int compare (Grob_pitch_tuple const &a, Grob_pitch_tuple const &b)
 {
index 87e81ebef90525dc01defa6052551623bc008ca4..e0868978e7103f2a296fec1b3aed4ff970ee35cc 100644 (file)
@@ -63,7 +63,8 @@ Grob::Grob (SCM basicprops,
   /*
     We always get a new key object for a new grob.
   */
-  scm_gc_unprotect_object (key_->self_scm ());
+  if (key_)
+    scm_gc_unprotect_object (key_->self_scm ());
   SCM meta = get_property ("meta");
   if (scm_is_pair (meta))
     {
@@ -123,7 +124,7 @@ Grob::Grob (SCM basicprops,
 Grob::Grob (Grob const &s, int copy_index)
   : dim_cache_ (s.dim_cache_)
 {
-  key_ = new Copied_key (s.key_, copy_index);
+  key_ = (use_object_keys) ? new Copied_key (s.key_, copy_index) : 0;
   original_ = (Grob *) & s;
   self_scm_ = SCM_EOL;
 
@@ -645,7 +646,9 @@ Grob::mark_smob (SCM ses)
 {
   Grob *s = (Grob *) SCM_CELL_WORD_1 (ses);
   scm_gc_mark (s->immutable_property_alist_);
-  scm_gc_mark (s->key_->self_scm ());
+
+  if (s->key_)
+    scm_gc_mark (s->key_->self_scm ());
   for (int a = 0; a < 2; a++)
     {
       scm_gc_mark (s->dim_cache_[a].offset_callbacks_);
index 8031efebcb85c0004f0d0b906ba5de1b5caf13af..b3335bab4158335f9f0ee2351e178fbc7f163d7f 100644 (file)
@@ -9,7 +9,7 @@
 #ifndef ENGRAVER_HH
 #define ENGRAVER_HH
 
-#include "event.hh"
+#include "music.hh"
 #include "grob-info.hh"
 #include "translator.hh"
 
index 946e4bebb4bc09c585c7240ce773b05c5ee68366..c65a9dedcc9d50560b17702c00cf3321d33389ee 100644 (file)
@@ -16,7 +16,6 @@
 */
 class Event_chord_iterator : public Simple_music_iterator
 {
-  Event_chord *get_elt () const;
   /**
      Find a bottom notation context to deliver events to.
   */
diff --git a/lily/include/event.hh b/lily/include/event.hh
deleted file mode 100644 (file)
index 41d24d2..0000000
+++ /dev/null
@@ -1,27 +0,0 @@
-/*
-  event.hh -- declare Event baseclasses.
-
-  source file of the GNU LilyPond music typesetter
-
-  (c) 1997--2005 Han-Wen Nienhuys <hanwen@cs.uu.nl>
-*/
-
-#ifndef EVENT_HH
-#define EVENT_HH
-
-#include "input.hh"
-#include "music.hh"
-#include "duration.hh"
-#include "pitch.hh"
-
-/* An atom of musical information.  This is an abstract class for any
-   piece of music that does not contain other Music.  */
-class Event : public Music
-{
-public:
-  Event (SCM);
-  VIRTUAL_COPY_CONSTRUCTOR (Music, Event);
-  DECLARE_SCHEME_CALLBACK (length_callback, (SCM));
-};
-
-#endif
index fe3bcb052d929390dd27c975bdf9206f76074a5c..a7e32816ffb8457285ce2d1a3c7fc1e5191af281 100644 (file)
@@ -9,6 +9,8 @@
 #define LIGATURE_ENGRAVER_HH
 
 #include "engraver.hh"
+#include "moment.hh"
+
 
 /*
  * FIXME: Spanner *create_ligature_spanner () and virtual void
index b8bd188db64e0e95bc58b810cad03c3d3865b885..5e6192d1fb7113730af5732d4cbaf693dedce75e 100644 (file)
@@ -35,6 +35,7 @@ extern bool is_pango_format_global;
 extern bool is_TeX_format_global;
 extern bool point_and_click_global;
 extern String prefix_directory;
+extern bool use_object_keys;
 
 /*
   todo: collect in Output_option struct?
index 5476f10af9d0618f7c384f135ec36c3e0ca14ded..d08c0b498494bf5eb58ce080bf93502b0986cd47 100644 (file)
@@ -1,16 +1,18 @@
 /*
-  minterval.hh -- declare MInterval
+   -- declare MInterval
 
   source file of the GNU LilyPond music typesetter
 
   (c) 1997--2005 Han-Wen Nienhuys <hanwen@cs.uu.nl>
 */
 
-#ifndef MINTERVAL_HH
-#define MINTERVAL_HH
+#ifndef 
+#define 
 
 #include "moment.hh"
 
 typedef Interval_t<Moment> MInterval;
 
-#endif // MINTERVAL_HH
+#endif // 
+
+#error
index f0415ff0d05be2422fa46e1d7f93662fb8aa5886..71e4d00741a4b05abfa12542cfe1dae149e3f8dc 100644 (file)
@@ -10,8 +10,9 @@
 #define MUSIC_HH
 
 #include "virtual-methods.hh"
-#include "minterval.hh"
-#include "music-constructor.hh"
+#include "smobs.hh"
+#include "moment.hh"
+#include "pitch.hh"
 
 #define is_mus_type(x) internal_is_music_type (ly_symbol2scm (x))
 
@@ -44,8 +45,10 @@ public:
   /// Scale the music in time by #factor#.
   void compress (Moment factor);
 
+  DECLARE_SCHEME_CALLBACK (duration_length_callback, (SCM));
 protected:
   DECLARE_SMOBS (Music,);
+
   SCM immutable_property_alist_;
   SCM mutable_property_alist_;
 protected:
index b912cd720c80d5161edd8625a1102d682a59ac73..9d224cc460b1d9a6ac789125f6cebbc6af9b956e 100644 (file)
@@ -9,7 +9,6 @@
 #define PERFORMER_HH
 
 #include "audio-element-info.hh"
-#include "event.hh"
 #include "grob-info.hh"
 #include "translator.hh"
 
index 61ed1038824369ea5678056c5b751a35ce88d848..c4279a971474257333b226a6f0c25f3723697d11 100644 (file)
@@ -16,7 +16,6 @@ extern int testing_level_global;
 extern bool lily_1_8_relative;
 extern bool lily_1_8_compatibility_used;
 
-
 SCM ly_get_option (SCM);
 SCM ly_set_option (SCM, SCM);
 
index f7fd06fc5254049ae2ff07c2fa0bfc10b811d410..acd5aaa68dcf0a9ce2d8d62a09f750a7900b211f 100644 (file)
@@ -13,6 +13,7 @@
 #include "engraver.hh"
 #include "protected-scm.hh"
 #include "clef.hh"
+#include "pitch.hh"
 
 /*
   TODO: The representation  of key sigs is all fucked.
index 9443d33eff0cf2d580cd36a7d413a9bd6c227a63..3f7cc6ac2fe1ffbbd9da30e273c89cdf9ae0d892 100644 (file)
@@ -23,7 +23,7 @@ protected:
   virtual void stop_translation_timestep ();
 
 private:
-  Event *key_ev_;
+  Music *key_ev_;
   Audio_key *audio_;
 };
 
@@ -88,17 +88,12 @@ Key_performer::stop_translation_timestep ()
 bool
 Key_performer::try_music (Music *ev)
 {
-  if (Event *kc = dynamic_cast<Event *> (ev))
+  if (!key_ev_)
     {
-      if (!key_ev_)
-       {
-         key_ev_ = kc;
-       }
-      
-      return true;
+      key_ev_ = ev;
     }
-
-  return false;
+      
+  return true;
 }
 
 ADD_TRANSLATOR (Key_performer,
index ca31364695edcce5113d0cf347000b1b536f7d9a..91ec3ab04f3883b574435461815f7d076400128d 100644 (file)
@@ -7,7 +7,7 @@
 */
 
 #include "context.hh"
-#include "event.hh"
+#include "music.hh"
 #include "note-head.hh"
 #include "grob.hh"
 #include "music-iterator.hh"
index 5b2764d894aa0462010195277f3ca6463f8dffdb..dca904f2e84031e41dbf55678adbe2176185fbfd 100644 (file)
@@ -8,6 +8,7 @@
 
 #include "music.hh"
 #include "pitch.hh"
+#include "moment.hh"
 
 struct Lyric_combine_music
 {
index f9faa7269329258d016d41b969a76d8fb6e58b79..9d747f4e772c3a03a5f970b1770b4a01be6faa8a 100644 (file)
@@ -8,6 +8,7 @@
 
 #include "audio-item.hh"
 #include "performer.hh"
+#include "music.hh"
 
 class Lyric_performer : public Performer
 {
index 59c65531fea618bcf50e6bd0124ccec9ca9a63a4..bca756e2f394c7504f7097014c3f74be009352f5 100644 (file)
@@ -9,7 +9,7 @@
 
 #include "coherent-ligature-engraver.hh"
 #include "mensural-ligature.hh"
-#include "event.hh"
+#include "music.hh"
 #include "warn.hh"
 #include "spanner.hh"
 #include "paper-column.hh"
diff --git a/lily/music-constructor.cc b/lily/music-constructor.cc
deleted file mode 100644 (file)
index 481b9eb..0000000
+++ /dev/null
@@ -1,46 +0,0 @@
-/*
-  music-constructor.cc -- implement Music_constructor
-
-  source file of the GNU LilyPond music typesetter
-
-  (c) 2001--2005  Han-Wen Nienhuys <hanwen@cs.uu.nl>
-*/
-
-#include "music-constructor.hh"
-
-#include <map>                 // UGH.
-#include <cassert>
-
-#include "warn.hh"
-
-static std::map<String, Music_ctor> *ctors_map_;
-
-void
-add_music_ctor (String s, Music_ctor c)
-{
-  if (!ctors_map_)
-    ctors_map_ = new std::map<String, Music_ctor>;
-
-  (*ctors_map_)[s] = c;
-}
-
-Music_ctor
-get_music_ctor (String s)
-{
-  if (ctors_map_->find (s) == ctors_map_->end ())
-    return 0;
-
-  return (*ctors_map_)[s];
-}
-
-Music *
-make_music (String s, SCM init)
-{
-  Music_ctor c = get_music_ctor (s);
-  if (!c)
-    programming_error (String ("No constructor for music: ") + s);
-  assert (c);
-
-  return (*c) (init);
-}
-
index da81ec6381003493eef9217563e381e0ce226ed8..e2e4c73d1f8ea6f4d825dd0738bac8b67403a2d9 100644 (file)
@@ -61,17 +61,17 @@ LY_DEFINE (ly_music_name, "ly:music-name",
 }
 
 /* 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 ();
+  Music *ms = new Music (props);
+  SCM s = ms->self_scm ();
   scm_gc_unprotect_object (s);
   return s;
 }
index c34e970e74fa594e1f65ecdd526971e3473c143b..a3a6deb437e2f0549a73820e3fccd4eca77d75d8 100644 (file)
@@ -53,6 +53,11 @@ Music::Music (SCM init)
   smobify_self ();
 
   length_callback_ = get_property ("length-callback");
+  if (!ly_is_procedure (length_callback_))
+    {
+      length_callback_ = duration_length_callback_proc;
+    }
+  
   start_callback_ = get_property ("start-callback");
 }
 
@@ -76,7 +81,6 @@ Music::~Music ()
 {
 }
 
-ADD_MUSIC (Music);
 
 SCM
 Music::get_property_alist (bool m) const
@@ -297,7 +301,6 @@ Music::origin () const
   return ip ? ip : &dummy_input_global;
 }
 
-
 Music *
 make_music_by_name (SCM sym)
 {
@@ -308,3 +311,19 @@ make_music_by_name (SCM sym)
   scm_gc_protect_object (rv);
   return unsmob_music (rv);
 }
+
+
+MAKE_SCHEME_CALLBACK (Music, duration_length_callback, 1);
+SCM
+Music::duration_length_callback (SCM m)
+{
+  Music *me = unsmob_music (m);
+  Duration *d = unsmob_duration (me->get_property ("duration"));
+
+  Moment mom;
+  if (d)
+    {
+      mom = d->get_length ();
+    }
+  return mom.smobbed_copy ();
+}
index 0144e9e5e1ed7426cb9882fbda687d5465fb7700..49e496ff707991f0587d519652a8cac78ec62b4c 100644 (file)
@@ -7,9 +7,10 @@
 */
 
 #include "context.hh"
-#include "event.hh"
+#include "music.hh"
 #include "grob.hh"
 #include "music-iterator.hh"
+#include "input.hh"
 
 class New_lyric_combine_music_iterator : public Music_iterator
 {
index b3fb07b8fc88092f381ef1400debd42926403fe2..67935a0a2d53ac0da35657a52f139537a107f38e 100644 (file)
@@ -20,7 +20,7 @@ using namespace std;
 #include "dots.hh"
 #include "warn.hh"
 #include "font-interface.hh"
-#include "event.hh"
+#include "music.hh"
 #include "rhythmic-head.hh"
 #include "staff-symbol-referencer.hh"
 #include "lookup.hh"
index 8bcd41237ca11017b3d2e9a9390fc6638aae23fb..b74d9faff170f1138819e3fae13bb690296450d8 100644 (file)
@@ -4,6 +4,8 @@
   (c) 1997--2005 Han-Wen Nienhuys <hanwen@cs.uu.nl>
 */
 
+#include "engraver.hh"
+
 #include <cctype>
 
 #include "rhythmic-head.hh"
@@ -12,8 +14,8 @@
 #include "dot-column.hh"
 #include "staff-symbol-referencer.hh"
 #include "item.hh"
-#include "engraver.hh"
 #include "warn.hh"
+#include "duration.hh"
 
 class Note_heads_engraver : public Engraver
 {
index 3bdbcb0df33d4396c6e86dc0c92ca4d672b8801a..640449cc3a79665e410319fa1d83189c970a7aa6 100644 (file)
@@ -11,6 +11,7 @@
 #include "audio-column.hh"
 #include "global-context.hh"
 #include "warn.hh"
+#include "music.hh"
 
 /**
    Convert evs to audio notes.
index 78d54517a3682916b08ce276dc75a936fa040c69..2b5b6c0caae935773ae88ba89277a6e0604532b1 100644 (file)
@@ -28,7 +28,7 @@ FIXME:
 #include "book.hh"
 #include "context-def.hh"
 #include "dimensions.hh"
-#include "event.hh"
+#include "music.hh"
 #include "file-path.hh"
 #include "input-smob.hh"
 #include "input.hh"
@@ -45,6 +45,7 @@ FIXME:
 #include "score.hh"
 #include "text-interface.hh"
 #include "warn.hh"
+#include "music.hh"
 
 #define MY_MAKE_MUSIC(x)  make_music_by_name (ly_symbol2scm (x))
 
@@ -2693,8 +2694,11 @@ Lily_lexer::try_special_identifiers (SCM *destination, SCM sid)
                *destination = mus->self_scm ();
                unsmob_music (*destination)->
                        set_property ("origin", make_input (last_input_));
-               return dynamic_cast<Event*> (mus)
-                       ? EVENT_IDENTIFIER : MUSIC_IDENTIFIER;
+
+               bool is_event = scm_memq (ly_symbol2scm ("event"), mus->get_property ("types"))
+                       != SCM_BOOL_F;
+
+               return is_event ? EVENT_IDENTIFIER : MUSIC_IDENTIFIER;
        } else if (unsmob_duration (sid)) {
                *destination = unsmob_duration (sid)->smobbed_copy ();
                return DURATION_IDENTIFIER;
index fea8256ca16dda1710d80ebaec31d1a9440edc54..577552579fb3ac4ae04e144bff1936de248e8d13 100644 (file)
@@ -7,7 +7,7 @@
 */
 
 #include "context.hh"
-#include "event.hh"
+#include "music.hh"
 #include "music-sequence.hh"
 #include "lily-guile.hh"
 #include "warn.hh"
index 242a181fcd5a24b77978e8b25e3ad90d54b9d992..dd118981abf6ec0d6f0a276a2d12e43aea2c799a 100644 (file)
@@ -8,6 +8,7 @@
 
 #include "performer.hh"
 #include "audio-item.hh"
+#include "music.hh"
 
 /**
    perform Piano pedals
index 552987904bcddd015d3d2b581dd6b7d6ebd0eb77..19d18acf518a460a7e7878644ff7a582ccd6372f 100644 (file)
@@ -20,6 +20,7 @@
 
 /* Write midi as formatted ascii stream? */
 bool do_midi_debugging_global;
+bool use_object_keys;
 
 /*
   Backwards compatibility.
@@ -65,6 +66,10 @@ void internal_set_option (SCM var, SCM val)
       lily_1_8_compatibility_used = to_boolean (val);
       val = scm_from_bool (to_boolean (val));
     }
+  else if (var == ly_symbol2scm ("object-keys"))
+    {
+      use_object_keys = scm_from_bool (to_boolean (val));
+    }
 }
 
 const int HELP_INDENT = 30; 
index 45e0f066a70d1dd8a1cc51e0aa81712a59f86aec..fd7498d7bef44d9ac7b409b918e790536ac26f8e 100644 (file)
@@ -7,11 +7,12 @@
 */
 
 #include "context.hh"
-#include "event.hh"
+#include "music.hh"
 #include "music-sequence.hh"
 #include "lily-guile.hh"
 #include "music-wrapper-iterator.hh"
 #include "warn.hh"
+#include "input.hh"
 
 class Quote_iterator : public Music_wrapper_iterator
 {
index 009d16f768d0db136ee71c409100cd541ec846cd..0116992b6797fa14121836a91ad383e3a6720b0c 100644 (file)
@@ -6,11 +6,15 @@
   (c) 1997--2005 Han-Wen Nienhuys <hanwen@cs.uu.nl>
 */
 
+#include "engraver.hh"
+
+#include "duration.hh"
 #include "item.hh"
 #include "staff-symbol-referencer.hh"
 #include "dots.hh"
 #include "rhythmic-head.hh"
-#include "engraver.hh"
+#include "music.hh"
+
 
 class Rest_engraver : public Engraver
 {
index 573e2426c1c7811987c3f512d19c3a5a1deb4164..eb879a7f99d1ce4b6fc44ab5793860cf15ae853f 100644 (file)
@@ -11,6 +11,7 @@
 #include "audio-column.hh"
 #include "global-context.hh"
 #include "warn.hh"
+#include "music.hh"
 
 /*
   this is C&P from beam_performer.
index 5754244f61440528ae92693b7e41b23bb8e1f819..bb99c704877c6b8ec292d7891dfc3d35a5fc6162 100644 (file)
@@ -8,6 +8,7 @@
 
 #include "performer.hh"
 #include "audio-item.hh"
+#include "music.hh"
 
 /*
   TODO: fold this into 1 engraver: \< and \> should also stop when
index 71ef4b46f8ebebebcb334d85d22e6a851eccbd15..a469c78cb1a66b70063ab37bd71cc1ea07f97845 100644 (file)
@@ -16,6 +16,7 @@
 #include "staff-symbol-referencer.hh"
 #include "stem-tremolo.hh"
 #include "stem.hh"
+#include "duration.hh"
 
 /**
    Make stems upon receiving noteheads.
index 92c7c4ba9c0bd971732f25a43d82c7fb9bc1806f..3bf237d1015ad8699e13d695f25924214f1ee74f 100644 (file)
@@ -7,6 +7,8 @@
 */
 
 #include "performer.hh"
+#include "music.hh"
+
 
 class Swallow_performer : public Performer
 {
index aff6336ab74467217df52bd00b4005d8dcbdae59..d4210c42fc5edd1cb94dd856367febdc11bb5809 100644 (file)
 
 #include "rhythmic-head.hh"
 #include "output-def.hh"
-#include "event.hh"
+#include "music.hh"
 #include "dots.hh"
 #include "dot-column.hh"
 #include "staff-symbol-referencer.hh"
 #include "item.hh"
 #include "score-engraver.hh"
 #include "warn.hh"
+#include "duration.hh"
+
 
 /**
    make (guitar-like) tablature note
index 540db7dcacdfc6d8d23a75b737744ea9b18e8662..58310da1dc69ca5eb2c484f7e98529fa19602bee 100644 (file)
@@ -6,9 +6,12 @@
   (c) 1997--2005 Jan Nieuwenhuizen <janneke@gnu.org>
 */
 
-#include "audio-item.hh"
 #include "performer.hh"
 
+#include "audio-item.hh"
+#include "music.hh"
+#include "duration.hh"
+
 class Tempo_performer : public Performer
 {
 public:
@@ -41,7 +44,6 @@ Tempo_performer::create_audio_elements ()
 {
   if (tempo_req_)
     {
-
       SCM met = tempo_req_->get_property ("metronome-count");
       Duration *d = unsmob_duration (tempo_req_->get_property ("tempo-unit"));
 
index 652046e0a66f37c53fa4b1602187ac0858edf0c3..7dc078bd95299ab06f70af88b6d43765476e0ec2 100644 (file)
@@ -6,10 +6,13 @@
   (c) 1998--2005 Han-Wen Nienhuys <hanwen@cs.uu.nl>
 */
 
+#include "performer.hh"
+
+#include "music.hh"
 #include "context.hh"
 #include "audio-item.hh"
 #include "pqueue.hh"
-#include "performer.hh"
+
 
 class Tie_performer : public Performer
 {
index 616099fbed5343415cd0246087ae89bdb662d974..47c40fe0eb97ae3881b4930357a33bc69db9d1fd 100644 (file)
@@ -7,7 +7,7 @@
 */
 
 #include "translator.hh"
-#include "event.hh"
+#include "music.hh"
 
 class Skip_event_swallow_translator : public virtual Translator
 {
index 18f9011fc522934325a8a9f3f6b6d7140cba0f28..3cd631bad839382f92f2e292c16fda3412c09ece 100644 (file)
@@ -56,7 +56,6 @@ descend in the context tree.")
      (length ,ly:moment? "The duration of this music")
      (length-callback ,procedure? "How to compute the duration of this music. This property
 can only be defined as initializer in @file{define-music-types.scm}.")
-     (internal-class-name ,string? "C++ class to use for this Music object") 
      (name ,symbol? "Name of this music object")
      (numerator ,integer? "numerator of a time signature")
      (once ,boolean? "Apply this operation only during one time step?")
index f0d555743bb7ed18c01cf4070fd06dd0c6d0866d..24e45dad8a90a910c7f2512b4869922201ec4bad 100644 (file)
@@ -814,7 +814,7 @@ and values. E.g:
   (let ((props (hashq-ref music-name-to-property-table name '())))
     (if (not (pair? props))
        (ly:error (_ "can't find music object: ~S") name))
-    (let ((m (ly:make-bare-music (cdr (assoc 'internal-class-name props)) props)))
+    (let ((m (ly:make-music props)))
       (define (set-props mus-props)
        (if (and (not (null? mus-props))
                 (not (null? (cdr mus-props))))
index 25165c605de5736681c3b6ea802dc1caba1d307e..18a19eeb751e0c9e8adf9a090cfdcc7c05c9434e 100644 (file)
@@ -18,7 +18,8 @@ on errors, and print a stack trace.")
            (old-relative #f
                          "relative for simultaneous music works
 similar to chord syntax")
-
+           (object-keys #f
+                        "experimental mechanism for remembering tweaks") 
            (resolution 101 "resolution for generating bitmaps")
            (anti-alias-factor 1 "render at higher resolution and scale down result\nto prevent jaggies in PNG")
            (preview-include-book-title #t "include book-titles in preview images.")
index 17967425a16aa4874c81ac8055250653b636955a..ddecbd0712f70458a0214de7271c5a2d9a50edd4 100644 (file)
          )))
 
 
+(define (escape-string str)
+  (string-regexp-substitute
+   " " "\\040" 
+   (string-regexp-substitute "\"" "\\\"" str)))
+  
 (define-public (utf-8-string
                descr
                string)
   
-  (format "utf-8 \"~a\" \"~a\"" descr
+  (format "utf-8 \"~a\" \"~a\""
+         (escape-string descr)
 
          ;; don't want unescaped spaces.
-         (string-regexp-substitute " " "\\040" 
-                                   (string-regexp-substitute "\"" "\\\"" string))
+         (escape-string string)
          ))
 
index 2f1e7dec539823171a3ddfcaaa249cfb99c37361..9e43ef1ab8ba231eba7e8a5bc4d16b6dfb78cc2f 100644 (file)
@@ -67,7 +67,7 @@
    ly:item-break-dir
    ly:item?
    ly:iterator?
-   ly:make-bare-music
+   ly:make-music
    ly:make-duration
    ly:make-moment
    ly:make-music-function