]> git.donarmstrong.com Git - lilypond.git/commitdiff
* scm/engraver-documentation-lib.scm
authorHan-Wen Nienhuys <hanwen@xs4all.nl>
Sat, 28 Sep 2002 12:54:28 +0000 (12:54 +0000)
committerHan-Wen Nienhuys <hanwen@xs4all.nl>
Sat, 28 Sep 2002 12:54:28 +0000 (12:54 +0000)
(engraver-accepts-music-types?): add links from music to engraver,
from music-type to engraver.

* lily/include/command-request.hh: removed
lily/include/musical-request.hh: removed. Removed all _req classes
except Key_change_req. Changes throughout.

100 files changed:
ChangeLog
lily/accidental-engraver.cc
lily/ambitus-engraver.cc
lily/arpeggio-engraver.cc
lily/auto-beam-engraver.cc
lily/auto-change-iterator.cc
lily/bar-check-iterator.cc
lily/bar-engraver.cc
lily/beam-engraver.cc
lily/break-algorithm.cc
lily/breathing-sign-engraver.cc
lily/chord-name-engraver.cc
lily/chord-tremolo-engraver.cc
lily/chord.cc
lily/command-request.cc
lily/completion-note-heads-engraver.cc
lily/custos-engraver.cc
lily/dynamic-engraver.cc
lily/dynamic-performer.cc
lily/extender-engraver.cc
lily/figured-bass-engraver.cc
lily/fingering-engraver.cc
lily/grob-pitch-tuple.cc
lily/hyphen-engraver.cc
lily/include/command-request.hh [deleted file]
lily/include/lily-proto.hh
lily/include/music-list.hh
lily/include/musical-request.hh [deleted file]
lily/include/request.hh
lily/include/tuplet-bracket.hh
lily/key-engraver.cc
lily/key-performer.cc
lily/lexer.ll
lily/lyric-combine-music-iterator.cc
lily/lyric-engraver.cc
lily/lyric-performer.cc
lily/mark-engraver.cc
lily/melisma-engraver.cc
lily/mensural-ligature-engraver.cc
lily/multi-measure-rest-engraver.cc
lily/music.cc
lily/musical-request.cc
lily/new-accidental-engraver.cc
lily/note-head-line-engraver.cc
lily/note-head.cc
lily/note-heads-engraver.cc
lily/note-name-engraver.cc
lily/note-performer.cc
lily/output-property-engraver.cc
lily/parser.yy
lily/part-combine-music-iterator.cc
lily/percent-repeat-engraver.cc
lily/phrasing-slur-engraver.cc
lily/piano-pedal-engraver.cc
lily/piano-pedal-performer.cc
lily/pitch-squash-engraver.cc
lily/porrectus-engraver.cc
lily/repeat-acknowledge-engraver.cc
lily/request-chord.cc
lily/request.cc
lily/rest-collision-engraver.cc
lily/rest-engraver.cc
lily/rhythmic-column-engraver.cc
lily/score-engraver.cc
lily/score-performer.cc
lily/script-column-engraver.cc
lily/script-engraver.cc
lily/separating-line-group-engraver.cc
lily/slur-engraver.cc
lily/spacing-engraver.cc
lily/span-arpeggio-engraver.cc
lily/span-bar-engraver.cc
lily/span-dynamic-performer.cc
lily/staff-collecting-engraver.cc
lily/staff-performer.cc
lily/staff-symbol-engraver.cc
lily/stanza-number-engraver.cc
lily/stem-engraver.cc
lily/system-start-delimiter-engraver.cc
lily/tab-note-heads-engraver.cc
lily/tempo-performer.cc
lily/text-engraver.cc
lily/text-spanner-engraver.cc
lily/thread-devnull-engraver.cc
lily/tie-engraver.cc
lily/tie-performer.cc
lily/time-scaled-music-iterator.cc
lily/time-signature-engraver.cc
lily/time-signature-performer.cc
lily/timing-engraver.cc
lily/timing-translator.cc
lily/tuplet-engraver.cc
lily/type-swallow-translator.cc
lily/vertical-align-engraver.cc
lily/voice-devnull-engraver.cc
lily/volta-engraver.cc
scm/backend-documentation-lib.scm
scm/engraver-documentation-lib.scm
scm/music-documentation-lib.scm
scm/music-types.scm

index 9c99565c10aa0f28436c6d39be0f5210c63105eb..64a4fd9a938e549d75960d9ae65d8ee297d4b5eb 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,13 @@
+2002-09-28  Han-Wen Nienhuys  <hanwen@cs.uu.nl>
+
+       * scm/engraver-documentation-lib.scm
+       (engraver-accepts-music-types?): add links from music to engraver,
+       from music-type to engraver.
+
+       * lily/include/command-request.hh: removed
+       lily/include/musical-request.hh: removed. Removed all _req classes
+       except Key_change_req. Changes throughout.
+
 2002-09-28  Jan Nieuwenhuizen  <janneke@gnu.org>
 
        * lily/tuplet-engraver.cc (try_music): Compile kludge.
index 49d0a20577182ec3c415fb0e423c63b3c11c2dea..803fa1a5248ab04fe13e4c22991ad6a40e0f5172 100644 (file)
@@ -5,8 +5,8 @@
   Modified 2001-2002 by Rune Zedeler <rz@daimi.au.dk>
 */
 
-#include "musical-request.hh"
-#include "command-request.hh"
+#include "request.hh"
+
 #include "item.hh"
 #include "tie.hh"
 #include "rhythmic-head.hh"
index 9d5468cb924f158c9576280fd2f1c2c75449dd5a..5a664a8cc2bfab73fec6d1f41240d1473171fb5d 100644 (file)
@@ -10,7 +10,7 @@
 #include "item.hh"
 #include "note-head.hh"
 #include "staff-symbol-referencer.hh"
-#include "musical-request.hh"
+#include "request.hh"
 #include "pitch.hh"
 
 /*
index 93767fc0dd7fbef0c3bf7de585b95d25d3232ced..008b8a00573cb9996c1207354473f45ffbde31aa 100644 (file)
@@ -9,7 +9,7 @@
 #include "engraver.hh"
 #include "group-interface.hh"
 #include "item.hh"
-#include "musical-request.hh"
+#include "request.hh"
 #include "arpeggio.hh"
 #include "stem.hh"
 #include "rhythmic-head.hh"
index 932cadc95e9aacfb2882b326e5ad3510e606da55..2d16ffcf0bdb8ae7035ece50001da7751b5d1eb3 100644 (file)
@@ -8,7 +8,7 @@
  */
 
 #include "beaming.hh"
-#include "musical-request.hh"
+#include "request.hh"
 #include "beam.hh"
 #include "stem.hh"
 #include "warn.hh"
@@ -18,6 +18,7 @@
 #include "engraver.hh"
 #include "item.hh"
 #include "spanner.hh"
+#include "duration.hh"
 
 /*
   TODO: figure what to do in grace?
index a2ab5be5e5af8f3f2f1cd3627ce3a6a0232aa0b7..64f67ca43a90cb1e8b7cb097ef4b3f553d779470 100644 (file)
@@ -10,7 +10,7 @@
 #include "music.hh"
 #include "auto-change-iterator.hh"
 #include "translator-group.hh"
-#include "musical-request.hh"
+#include "request.hh"
 
 
 
index 3de1771365e9e267f431e790ceff60f3a435afba..5dd0266768454543ef12cafc1a70229b03db4e3b 100644 (file)
@@ -9,7 +9,7 @@
  */
 
 #include "simple-music-iterator.hh"
-#include "command-request.hh"
+#include "request.hh"
 #include "translator-group.hh"
 
 /*
index 926654e4a9f967b5d07434544df60f57a5f4b43a..8b4cc844e7f0eca36c6b95cedf8065d9931cf740 100644 (file)
@@ -9,7 +9,7 @@
 
 #include "bar-line.hh"
 #include "score-engraver.hh"
-#include "musical-request.hh"
+#include "request.hh"
 #include "engraver-group-engraver.hh"
 #include "warn.hh"
 #include "item.hh"
index bb9ac59bc3ac34ca440e6dfd1187fde603671136..a4ad77040023d4e22510f90744f6c3ef102ee83d 100644 (file)
@@ -8,7 +8,7 @@
  */
 #include "engraver-group-engraver.hh"
 #include "engraver.hh"
-#include "musical-request.hh"
+#include "request.hh"
 #include "beam.hh"
 #include "stem.hh"
 #include "warn.hh"
index 65cd2825d3184bc589b1d6b3dcb9b8027d4ce25b..bfacc859f3ed2b9c1855e845bf407ca8cd55be93 100644 (file)
@@ -13,7 +13,7 @@
 #include "paper-score.hh"
 #include "paper-column.hh"
 #include "cpu-timer.hh"
-#include "command-request.hh"
+
 #include "simple-spacer.hh"
 #include "group-interface.hh"
 
index 4ea98cf97040f2f7068d005440b9bc0c7db76737..97c6cb4ecf41d5b76a9bdf4bce5f5cf67436f85d 100644 (file)
@@ -15,12 +15,12 @@ TODO:
 
 #include "staff-symbol-referencer.hh"
 #include "breathing-sign.hh"
-#include "musical-request.hh"
-#include "command-request.hh"
+#include "request.hh"
+
 #include "engraver-group-engraver.hh"
 #include "item.hh"
 #include "engraver.hh"
-#include "command-request.hh"
+
 
 class Breathing_sign_engraver : public Engraver {
 public:
index 79ad18fc2b4e5108a1b97f567274da28ccb2b238..3985c2467b9a1fe6051c86e4aa036848f964118c 100644 (file)
@@ -9,7 +9,7 @@
 #include "engraver.hh"
 #include "chord-name.hh"
 #include "chord.hh"
-#include "musical-request.hh"
+#include "request.hh"
 #include "paper-def.hh"
 #include "font-interface.hh"
 #include "paper-def.hh"
index 9781fa377d20434a1a2040b9cff2f1dfbf76630e..d94d752553627cce2076728e64b91af15d24e4dc 100644 (file)
@@ -13,7 +13,7 @@
 #include "stem.hh"
 #include "rhythmic-head.hh"
 #include "engraver-group-engraver.hh"
-#include "musical-request.hh"
+#include "request.hh"
 #include "warn.hh"
 #include "misc.hh"
 #include "note-head.hh"
index 196cf0e0f42450de90698c21e3f3e7d6583c1f43..adc23150485899d194d8f2635d07001e8e4ef244 100644 (file)
@@ -7,11 +7,11 @@
 */
 
 #include "chord.hh"
-#include "musical-request.hh"
+#include "request.hh"
 #include "warn.hh"
 
 #include "music-list.hh"
-#include "musical-request.hh"
+#include "request.hh"
 
 
 SCM
index 5d15bc66dcc11ef21bb9a0fabf89773d26fc831b..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 100644 (file)
@@ -1,101 +0,0 @@
-/*
-  command-request.cc -- implement non-musical reqs
-
-  source file of the GNU LilyPond music typesetter
-
-  (c)  1997--2002 Han-Wen Nienhuys <hanwen@cs.uu.nl>
-*/
-
-#include "command-request.hh"
-
-#include "musical-request.hh"
-
-
-
-LY_DEFINE(transpose_key_alist,"transpose-key-alist",
-         2, 0,0, (SCM l, SCM pitch),
-         "Make a new key alist of @var{l} transposed by pitch @var{pitch}")
-{
-  SCM newlist = SCM_EOL;
-  Pitch *p = unsmob_pitch (pitch);
-  
-  for (SCM s = l; gh_pair_p (s); s = ly_cdr (s))
-    {
-      SCM key = ly_caar (s);
-      SCM alter = ly_cdar (s);
-      if (gh_pair_p (key))
-       {
-         Pitch orig (gh_scm2int (ly_car (key)),
-                             gh_scm2int (ly_cdr (key)),
-                             gh_scm2int (alter));
-
-         orig.transpose (*p);
-
-         SCM key = gh_cons (scm_int2num (orig.get_octave ()),
-                            scm_int2num (orig.notename_));
-
-         newlist = gh_cons (gh_cons (key, scm_int2num (orig.alteration_)),
-                            newlist);
-       }
-      else if (gh_number_p (key))
-       {
-         Pitch orig (0, gh_scm2int (key), gh_scm2int (alter));
-         orig.transpose (*p);
-
-         key =scm_int2num (orig.notename_);
-         alter = scm_int2num (orig.alteration_);
-         newlist = gh_cons (gh_cons (key, alter), newlist);
-       }
-    }
-  return scm_reverse_x (newlist, SCM_EOL);
-}
-
-void
-Key_change_req::transpose (Pitch p)
-{
-  SCM pa = get_mus_property ("pitch-alist");
-
-  set_mus_property ("pitch-alist", transpose_key_alist (pa, p.smobbed_copy()));
-}
-
-
-bool
-alist_equal_p (SCM a, SCM b)
-{
-  for (SCM s = a;
-       gh_pair_p (s); s = ly_cdr (s))
-    {
-      SCM key = ly_caar (s);
-      SCM val = ly_cdar (s);
-      SCM l = scm_assoc (key, b);
-
-      if (l == SCM_BOOL_F
-         || !gh_equal_p ( ly_cdr (l), val))
-
-       return false;
-    }
-  return true;
-}
-
-bool
-Key_change_req::do_equal_b (Request const * m )const
-{
-  Key_change_req const * kc =dynamic_cast<Key_change_req const*> (m);
-
-  if(!kc)
-    return false;
-  return alist_equal_p (get_mus_property ("pitch-alist"),
-                       kc->get_mus_property ("pitch-alist"));
-}
-
-
-
-ADD_MUSIC (Articulation_req);
-ADD_MUSIC (Key_change_req);
-ADD_MUSIC (Lyric_req);
-ADD_MUSIC (Porrectus_req);
-ADD_MUSIC (Rhythmic_req);
-ADD_MUSIC (Script_req);
-ADD_MUSIC (Span_req);
-ADD_MUSIC (Text_script_req);
-ADD_MUSIC (Tremolo_req);
index 8b8257cc0b643a596134998dfeeab1b09ca4314e..a9caf8a7ac8cc52a9db09b49ff27a7dfb50db9aa 100644 (file)
@@ -8,7 +8,7 @@
 
 #include "rhythmic-head.hh"
 #include "paper-def.hh"
-#include "musical-request.hh"
+#include "request.hh"
 #include "dots.hh"
 #include "dot-column.hh"
 #include "staff-symbol-referencer.hh"
index eb70aada0ee9144ba0e8f73d7fd6fe1edc19f3b7..504b31567fd4ac6277527922ecc19ee398dd330b 100644 (file)
@@ -15,7 +15,7 @@
 #include "note-head.hh"
 #include "staff-symbol-referencer.hh"
 #include "warn.hh"
-#include "musical-request.hh"
+#include "request.hh"
 
 /*
   This class implements an engraver for custos symbols.
index 301628e2c61c454c85c3d823308429f1dc841ea1..95eea397feefb99c04b5d9bb93dcdf86c8b941af 100644 (file)
@@ -8,7 +8,7 @@
 #include "warn.hh"
 #include "dimensions.hh"
 #include "hairpin.hh"
-#include "musical-request.hh"
+#include "request.hh"
 #include "paper-column.hh"
 #include "note-column.hh"
 #include "item.hh"
@@ -43,7 +43,7 @@ class Dynamic_engraver : public Engraver
   Spanner * finished_cresc_;
   Spanner * cresc_;
 
-  Text_script_req* script_req_;
+  Music* script_req_;
   
   Music * current_cresc_req_;
   Drul_array<Music*> accepted_spanreqs_drul_;
@@ -95,10 +95,12 @@ Dynamic_engraver::start_translation_timestep ()
 bool
 Dynamic_engraver::try_music (Music * m)
 {
-  if (dynamic_cast <Text_script_req*> (m)
-      && m->get_mus_property ("text-type") == ly_symbol2scm ("dynamic"))
+  if (m->is_mus_type ("dynamic-event"))
     {
-      script_req_ = dynamic_cast<Text_script_req*> (m);
+  /*
+    TODO: probably broken.
+   */
+      script_req_ = m;
       return true;
     }
   else if (m->is_mus_type ("abort-event"))
@@ -162,8 +164,9 @@ Dynamic_engraver::process_music ()
       script_ = new Item (get_property ("DynamicText"));
       script_->set_grob_property ("text",
                                   script_req_->get_mus_property ("text"));
+
       
-      if (Direction d = script_req_->get_direction ())
+      if (Direction d = to_dir (script_req_->get_mus_property ("direction")))
        Directional_element_interface::set (line_spanner_, d);
 
       Axis_group_interface::add_element (line_spanner_, script_);
index 08250660137aad944db45562edb16bd58d2d2f69..ed60b2165f844d4cfcae059f23357305b4ea48e5 100644 (file)
@@ -7,8 +7,8 @@
 */
 
 #include "performer.hh"
-#include "command-request.hh"
-#include "musical-request.hh"
+
+#include "request.hh"
 #include "audio-item.hh"
 
 /*
@@ -124,8 +124,7 @@ Dynamic_performer::try_music (Music* r)
 {
   if (!script_req_)
     {
-      if (dynamic_cast <Text_script_req*> (r)
-         && r->get_mus_property ("text-type") == ly_symbol2scm ("dynamic"))
+      if (r->is_mus_type ("dynamic-event")) // fixme.
        {
          script_req_ = r;
          return true;
index e11ec694a6e0d7ed52f98c27cb7a94794955693b..6bde55b284a63c6fc95564dc6a52eca4506585e6 100644 (file)
@@ -7,7 +7,7 @@
 */
 
 #include "flower-proto.hh"
-#include "musical-request.hh"
+#include "request.hh"
 #include "lyric-extender.hh"
 #include "paper-column.hh"
 #include "item.hh"
index a2baf1831c77f9e27e9cc80c5e95c056f1360617..9020cf334e5429f6552c3fa1d20b006d9dd0dd78 100644 (file)
@@ -1,6 +1,6 @@
 #include "engraver.hh"
 #include "text-item.hh"
-#include "musical-request.hh"
+#include "request.hh"
 #include "item.hh"
 
 class Figured_bass_engraver : public Engraver
index 2610f49b8b10241cffc83adfc8daa5c94fda3971..b571126763de148d6efd4292fa5c5e25a7f58bb8 100644 (file)
@@ -11,7 +11,7 @@
 #include "engraver.hh"
 #include "side-position-interface.hh"
 #include "item.hh"
-#include "musical-request.hh"
+#include "request.hh"
 #include "stem.hh"
 #include "rhythmic-head.hh"
 
index fc6e450f990cb1de8322e996ee91f9f1abd2c010..f55c4f4b7f5425e8e048074baf75173cf4fc5625 100644 (file)
@@ -8,7 +8,7 @@ source file of the GNU LilyPond music typesetter
  */
 #include "grob-pitch-tuple.hh"
 #include "pitch.hh"
-#include "musical-request.hh"
+#include "request.hh"
 
 
 int compare (Grob_pitch_tuple const &a, Grob_pitch_tuple const &b)
index c55705528888f87b208d4996640434b795f226e4..0ba903ee8364652a91f4e76bb53851e50ab2f507 100644 (file)
@@ -5,7 +5,7 @@
 */
 
 #include "flower-proto.hh"
-#include "musical-request.hh"
+#include "request.hh"
 #include "hyphen-spanner.hh"
 #include "paper-column.hh"
 #include "item.hh"
diff --git a/lily/include/command-request.hh b/lily/include/command-request.hh
deleted file mode 100644 (file)
index 7345900..0000000
+++ /dev/null
@@ -1,46 +0,0 @@
-/*
-  command-request.hh -- declare non-musical requests
-
-  source file of the GNU LilyPond music typesetter
-
-  (c)  1997--2002 Han-Wen Nienhuys <hanwen@cs.uu.nl>
-*/
-
-
-#ifndef COMMANDREQUEST_HH
-#define COMMANDREQUEST_HH
-
-#include "request.hh"
-#include "array.hh"
-#include "duration.hh"
-#include "pitch.hh"
-
-
-class Break_req : public Request {
-public:
-protected:
-  VIRTUAL_COPY_CONS (Music);
-};
-
-class Porrectus_req : public Request {
-  VIRTUAL_COPY_CONS (Music);
-};
-
-/**
-    Handle key changes.
-*/
-class Key_change_req  : public Request
-{
-public:
-  SCM pitch_alist ();
-  
-protected:
-  VIRTUAL_COPY_CONS (Music);
-  bool do_equal_b (Request const * ) const;
-  void transpose (Pitch  d);
-};
-
-SCM transpose_key_alist (SCM,SCM);
-
-#endif // COMMANDREQUEST_HH
-
index 3dea8a1b68f434ecf407421cba9d8f6873d50b11..194398eecd9bc2437f8e5425d4209846c7eecf72 100644 (file)
@@ -15,7 +15,6 @@
 
 class Adobe_font_metric;
 class All_font_metrics;
-class Articulation_req;
 class Audio_column;
 class Audio_dynamic;
 class Audio_element;
@@ -34,30 +33,23 @@ class Auto_change_music;
 class Axis_group_engraver;
 class Bar_engraver;
 class Bar_req_collect_engraver;
-class Barcheck_req;
 class Base_span_bar_engraver;
 class Beaming_info_list;
 class Bezier;
 class Bezier_bow;
 class Break_algorithm;
-class Break_req;
-class Breathing_sign_req;
-class Busy_playing_req;
 class Change_iterator;
 class Change_translator;
 class Chord_tremolo_iterator;
-
 class Column_x_positions;
 class Context_specced_music;
 class Engraver;
 class Engraver;
 class Engraver_group_engraver;
-class Extender_req;
 class Folded_repeat_iterator;
 class Font_metric;
 class Font_size_engraver;
 class Global_translator;
-class Glissando_req;
 class Gourlay_breaking;
 class Grace_engraver_group;
 class Grace_iterator;
@@ -65,13 +57,10 @@ class Grace_music;
 class Grace_performer_group;
 class Hara_kiri_engraver;
 class Hara_kiri_line_group_engraver;
-class Hyphen_req;
-
 class Includable_lexer;
 class Input_file_results;
 class Input;
 class Item;
-class Key_change_req;
 class Key_performer;
 class Keyword_ent;
 class Keyword_table;
@@ -86,11 +75,6 @@ class Lyric_combine_music_iterator;
 class Lyric_engraver;
 class Lyric_performer;
 class Lyric_phrasing_engraver;
-class Lyric_req;
-class Mark_req;
-class Melisma_playing_req;
-class Melisma_req;
-class Melodic_req;
 class Mensural_ligature_engraver;
 class Midi_chunk;
 class Midi_def;
@@ -120,7 +104,6 @@ class Music_sequence;
 class Music_wrapper;
 class Music_wrapper_iterator;
 class Pitch;
-class Musical_req;
 class My_lily_lexer;
 class Note_performer;
 class Output_property;
@@ -133,9 +116,7 @@ class Performance;
 class Performer;
 class Performer_group_performer;
 class Piano_bar_engraver;
-
 class Pitch_squash_engraver;
-class Porrectus_req;
 class Property_iterator;
 class Rational;
 class Relative_octave_music;
@@ -143,24 +124,19 @@ class Repeated_music;
 class Request;
 class Request_chord;
 class Request_chord_iterator;
-class Rest_req;
-class Rhythmic_req;
 class Scaled_font_metric;
 class Scheme_hash_table;
 class Score;
 class Grob;
 class Score_engraver;
 class Score_performer;
-class Script_req;
 class Sequential_music;
 class Sequential_music_iterator;
 class Simple_music_iterator;
 class Simple_spacer;
 class Simultaneous_music;
 class Simultaneous_music_iterator;
-class Skip_req;
 class Slur_bezier_bow;
-class Span_req;
 class Span_score_bar_engraver;
 class Spanner;
 class Staff_group_bar_engraver;
@@ -168,12 +144,9 @@ class Staff_performer;
 class Swallow_engraver;
 class Swallow_performer;
 class Tempo_performer;
-class Tempo_req;
 class Tex_font_metric;
-class Text_script_req;
 class Tie;
 class Tie_performer;
-class Tie_req;
 class Time_scaled_music;
 class Time_scaled_music_iterator;
 class Time_signature_performer;
@@ -184,7 +157,6 @@ class Translator;
 class Translator_change;
 class Translator_group;
 class Transposed_music;
-class Tremolo_req;
 class Type_swallow_translator;
 class yyFlexLexer;
 #endif // LILY_PROTO_HH;
index 1dcaaeb818517a4923b7eb10f685695349017f3f..3f957eef8b1a6c88f8d31168ac7303cc03805ee9 100644 (file)
@@ -34,7 +34,6 @@ class Request_chord : public Simultaneous_music
 {
 public:
   VIRTUAL_COPY_CONS (Music);
-  virtual Pitch to_relative_octave (Pitch);
   virtual Moment start_mom () const;
 
   Request_chord ();
diff --git a/lily/include/musical-request.hh b/lily/include/musical-request.hh
deleted file mode 100644 (file)
index a90c9dc..0000000
+++ /dev/null
@@ -1,84 +0,0 @@
-/*
-  musical-request.hh -- declare Musical requests
-
-  source file of the GNU LilyPond music typesetter
-
-  (c)  1997--2002 Han-Wen Nienhuys <hanwen@cs.uu.nl>
-*/
-
-
-#ifndef MUSICALREQUESTS_HH
-#define MUSICALREQUESTS_HH
-
-#include "lily-proto.hh"
-#include "request.hh"
-#include "duration.hh"
-#include "pitch.hh"
-#include "array.hh"
-
-/** a request with a duration.
-  This request is used only used as a base class.
- */
-class Rhythmic_req  : public virtual Request  {
-public:
-  void compress (Moment);
-  virtual Moment length_mom () const;
-  static int compare (Rhythmic_req const&,Rhythmic_req const&);
-  VIRTUAL_COPY_CONS (Music);
-};
-
-
-
-struct Tremolo_req : public Request {
-  VIRTUAL_COPY_CONS (Music);
-  Tremolo_req ();
-};
-
-struct Chord_tremolo_notify_req : public Request
-{
-  Rational factor_;
-  VIRTUAL_COPY_CONS(Chord_tremolo_notify_req);
-  Chord_tremolo_notify_req();
-};
-
-
-/**
-   a syllable or lyric is a string with rhythm.
-  */
-class Lyric_req : public Rhythmic_req
-{
-protected:
-  VIRTUAL_COPY_CONS (Music);
-};
-
-
-class Articulation_req : public Script_req
-{
-public:
-  String get_articulation_string ();
-protected:
-  virtual bool do_equal_b (Request const*) const;
-  VIRTUAL_COPY_CONS (Music);
-};
-
-class Text_script_req : public Script_req
-{
-protected:
-  VIRTUAL_COPY_CONS (Music);
-  virtual bool do_equal_b (Request const*) const;
-};
-
-/// request which has some kind of pitch
-struct Melodic_req :virtual Request
-{
-  static int compare (Melodic_req const&,Melodic_req const&);
-  
-protected:
-  virtual bool do_equal_b (Request const*) const;
-
-  VIRTUAL_COPY_CONS (Music);
-};
-
-
-
-#endif // MUSICALREQUESTS_HH
index 34bbf79f6a69ea7ef3c30b31f037ad5f98fe9334..eb8f3f046706c107b163fbd2c2df581c1a78437a 100644 (file)
 #include "virtual-methods.hh"
 #include "input.hh"
 #include "music.hh"
-#include "direction.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.
   
-  Hungarian postfix: req
 
  */
 class Request : public Music {
 public:
   Request ();
   VIRTUAL_COPY_CONS (Music);
-  bool equal_b (Request const*) const;
-protected:
-  virtual bool do_equal_b (Request const*) const;
-
-};
-
-
-
-class Script_req : public virtual Request
-{
-public:
-  void set_direction (Direction d);
-  Direction get_direction () const;
-  VIRTUAL_COPY_CONS (Music);
-  Script_req ();
+  virtual void compress (Moment);
+  virtual void transpose (Pitch);
+  virtual Moment length_mom () const;
+  virtual Pitch to_relative_octave (Pitch);
 };
 
 
 /**
-  Requests to start or stop something.
- This type of request typically results in the creation of a #Spanner#
+    Handle key changes.
 */
-class Span_req  : public virtual Request  {
+class Key_change_req  : public Request
+{
 public:
-  String get_span_type_string () const;
-  void set_span_type_string (String);
-  void set_span_dir (Direction d);
-  Direction get_span_dir () const;  
+  SCM pitch_alist ();
   
-  Span_req ();
 protected:
-  
-  virtual bool do_equal_b (Request const*) const;
-
   VIRTUAL_COPY_CONS (Music);
+  bool do_equal_b (Request const * ) const;
+  void transpose (Pitch  d);
 };
 
-/**
-  Start a tie at this note, end it at the next
- */
-class Tie_req : public Request {
-public:
-  VIRTUAL_COPY_CONS (Music);
-};
+SCM transpose_key_alist (SCM,SCM);
+
+
 
 #endif
index 8dbc2321845aef8f2139bcd110bd12a1b7fa4ec9..e76633b93810ca3dec9b024db8e1ccf9a0b28f28 100644 (file)
@@ -8,6 +8,7 @@
 #define Tuplet_bracket_HH
 
 #include "lily-guile.hh"
+#include "lily-proto.hh"
 
 /*
 
index ba13f999f75bb615af68ef729a41f32235cb10f7..aa6488e72ba16783d5fe50114a973055b27e0777 100644 (file)
@@ -7,8 +7,8 @@
   */
 
 
-#include "command-request.hh"
-#include "musical-request.hh"
+
+#include "request.hh"
 #include "item.hh"
 #include "bar-line.hh"
 #include "staff-symbol-referencer.hh"
@@ -86,13 +86,6 @@ Key_engraver::try_music (Music * req)
 {
   if (Key_change_req *kc = dynamic_cast <Key_change_req *> (req))
     {
-      if (keyreq_ && !keyreq_->equal_b (kc))
-       {
-         kc->origin ()->warning (_ ("Conflicting key signatures found."));
-         keyreq_->origin ()->warning (_ ("This was the other key definition."));         
-         return false;
-       }
-
       if (!keyreq_)
        {
          /*
index c04ea1a59235cf985e9da3a9353980cacf6b2c19..ce8c330ad35ff326100f65678b338a64e231d1c4 100644 (file)
@@ -7,7 +7,7 @@
 */
 
 #include "lily-guile.hh"
-#include "command-request.hh"
+
 #include "audio-item.hh"
 #include "performer.hh"
 #include "warn.hh"
index c058cbc7e3c2c392915c8f4d047f37dea6f85105..a08b3bfab69c55220135c94057464fd06e3d8798 100644 (file)
@@ -40,7 +40,7 @@
 #include "parser.hh"
 #include "warn.hh"
 #include "main.hh"
-#include "musical-request.hh"
+#include "request.hh"
 #include "version.hh"
 #include "lilypond-input-version.hh"
 #include "translator-def.hh"
index 702ed023fb82aea4c5f0c1554135c5f2059911ac..5f3598186cc84fd0e31328479b0c1e3f0f547b35 100644 (file)
@@ -10,7 +10,7 @@
 #include "translator-group.hh"
 #include "lyric-combine-music-iterator.hh"
 #include "lyric-combine-music.hh"
-#include "musical-request.hh"
+#include "request.hh"
 #include "note-head.hh"
 #include "grob.hh"
 
index 1da3c69a4b44bf0595b2deecd26bd1cbde3745a5..3e04babe2a0aa8b9e0db5c3adc1631b58d102f46 100644 (file)
@@ -8,7 +8,7 @@
 */
 
 #include "engraver.hh"
-#include "musical-request.hh"
+#include "request.hh"
 #include "item.hh"
 #include "paper-def.hh"
 #include "font-metric.hh"
@@ -29,7 +29,7 @@ protected:
 public:
   TRANSLATOR_DECLARATIONS(Lyric_engraver);
 private:
-  Lyric_req * req_;
+  Music * req_;
   Item* text_;
 };
 
@@ -45,11 +45,11 @@ Lyric_engraver::Lyric_engraver ()
 bool
 Lyric_engraver::try_music (Music*r)
 {
-  if (Lyric_req* l = dynamic_cast <Lyric_req *> (r))
+  if (r->is_mus_type ("lyric-event"))
     {
       if (req_)
        return false;
-      req_ =l;
+      req_ =r;
       return true;
     }
   return false;
@@ -98,7 +98,7 @@ Lyric_engraver::start_translation_timestep ()
 ENTER_DESCRIPTION(Lyric_engraver,
 /* descr */       "",
 /* creats*/       "",
-/* accepts */     "general-music",
+/* accepts */     "lyric-event",
 /* acks  */      "",
 /* reads */       "",
 /* write */       "");
index 415fc9ce4d0d29a39fdd4e4fd43a55b1c8e37d74..3403be404c0de631eb97562ab98f7959c1875489 100644 (file)
@@ -6,7 +6,7 @@
   (c)  1997--2002 Jan Nieuwenhuizen <janneke@gnu.org>
 */
 
-#include "musical-request.hh"
+#include "request.hh"
 #include "audio-item.hh"
 #include "lily-proto.hh"
 #include "performer.hh"
@@ -22,7 +22,7 @@ protected:
   virtual void create_audio_elements ();
 
 private:
-  Link_array<Lyric_req> lreqs_;
+  Link_array<Music> lreqs_;
   Audio_text* audio_;
 };
 
@@ -65,12 +65,12 @@ Lyric_performer::stop_translation_timestep ()
 bool
 Lyric_performer::try_music (Music* req)
 {
-  if (Lyric_req *lr = dynamic_cast <Lyric_req *> (req))
+  if (req->is_mus_type ("lyric-event"))
     {
-      lreqs_.push (lr);
+      lreqs_.push (req);
       return true;
     }
   return false;
 }
 
-ENTER_DESCRIPTION(Lyric_performer,"","","general-music","","","");
+ENTER_DESCRIPTION(Lyric_performer,"","","lyric-event","","","");
index 335fea8bdae466d83dc202a7c135540b0680ec18..96ca4ffcbaeba118025f2faec8c297b6767f3602 100644 (file)
@@ -8,7 +8,7 @@
 
 #include <ctype.h>
 #include "bar-line.hh"
-#include "command-request.hh"
+
 #include "staff-symbol.hh"
 #include "engraver-group-engraver.hh"
 #include "engraver.hh"
index 4ab16941e2d6e105d03b3643ea0fc17a28e40d28..e01d83a9f8e8f83ee6280150c9c96fe2dd4e275e 100644 (file)
@@ -8,7 +8,7 @@
  */
 
 #include "engraver.hh"
-#include "musical-request.hh"
+#include "request.hh"
 #include "grob.hh"
 #include "translator-group.hh"
 
index 457e9532a93db335d13b5d534dc07b58a27f7824..3c5e9adb926dacd5be249b275907812c46c8da33 100644 (file)
@@ -8,7 +8,7 @@
 
 #include "mensural-ligature.hh"
 #include "ligature-engraver.hh"
-#include "musical-request.hh"
+#include "request.hh"
 #include "warn.hh"
 #include "item.hh"
 #include "spanner.hh"
index 93a33b0a00c892169525957c5f9be403002c24eb..c44c0738e893f49c4872145f17b7a4d1ae4be637 100644 (file)
@@ -5,7 +5,7 @@
        Han-Wen Nienhuys <hanwen@cs.uu.nl>
 */
 
-#include "musical-request.hh"
+#include "request.hh"
 #include "multi-measure-rest.hh"
 #include "paper-column.hh"
 #include "engraver-group-engraver.hh"
@@ -32,9 +32,9 @@ protected:
   virtual void finalize ();
 
 private:
-  Span_req * new_req_;
-  Span_req * busy_span_req_;
-  Span_req * stop_req_;
+  Music * new_req_;
+  Music * busy_span_req_;
+  Music * stop_req_;
   int start_measure_;
   Moment start_moment_;
   
@@ -55,22 +55,18 @@ Multi_measure_rest_engraver::Multi_measure_rest_engraver ()
 bool
 Multi_measure_rest_engraver::try_music (Music* req)
 {
-  if (Span_req * sp = dynamic_cast<Span_req*> (req))
+  if (req->is_mus_type ("multi-measure-rest-event"))
     {
-      
-      if (scm_equal_p (sp->get_mus_property ("span-type"),
-                      scm_makfrom0str ("rest")) == SCM_BOOL_T)
+      Direction d = to_dir (req->get_mus_property ("span-direction"));
+      if (d == STOP)
        {
-         if (sp->get_span_dir () == STOP)
-           {
-             stop_req_ = sp;
-           }
-         else if (sp->get_span_dir () == START && !new_req_)
-           {
-             new_req_ = sp;
-           }
-         return true;
+         stop_req_ = req;
        }
+      else if (d == START&& !new_req_)
+       {
+         new_req_ = req;
+       }
+      return true;
     }
   return false;
 }
@@ -181,7 +177,7 @@ ENTER_DESCRIPTION(Multi_measure_rest_engraver,
 measurePosition and currentBarNumber to determine what number to print over the MultiMeasureRest
 ",
 /* creats*/       "MultiMeasureRest",
-/* accepts */     "general-music",
+/* accepts */     "multi-measure-rest-event",
 /* acks  */      "",
 /* reads */       "currentBarNumber currentCommandColumn measurePosition",
 /* write */       "");
index 159f4310906aefdd90dcfd037ee56e03c15b12f2..d95603ad81cb5f1241dd01820ddc260b479f84cb 100644 (file)
@@ -31,11 +31,6 @@ ly_deep_mus_copy (SCM m)
     return m;
 }
 
-
-
-
-
-
 bool
 Music::internal_is_music_type (SCM k)const
 {
@@ -44,6 +39,17 @@ Music::internal_is_music_type (SCM k)const
   return scm_memq (k, ifs) != SCM_BOOL_F;
 }
 
+void
+Music::transpose (Pitch)
+{
+}
+
+void
+Music::compress (Moment)
+{
+}
+
+
 Music::Music (Music const &m)
 {
   immutable_property_alist_ = m.immutable_property_alist_;
@@ -83,17 +89,6 @@ Music::mark_smob (SCM m)
   return SCM_EOL;
 }
 
-void    
-Music::compress (Moment f)
-{
-  SCM l = get_mus_property ("compress-procedure");
-  if (gh_procedure_p (l))
-    {
-      SCM res = gh_call2 (l, self_scm (), f.smobbed_copy());
-    }
-}
-
-
 Moment
 Music::length_mom () const
 {
@@ -159,25 +154,6 @@ Music::to_relative_octave (Pitch m)
 }
 
 
-void
-Music::transpose (Pitch delta)
-{
-  Pitch *p = unsmob_pitch (get_mus_property ("pitch"));
-  if (!p)
-    return ;
-
-  Pitch np = *p;
-  np.transpose (delta);
-  
-  if (abs (np.alteration_) > 2)
-    {
-       warning (_f ("Transposition by %s makes accidental larger than two",
-         delta.string ()));
-    }
-
-  set_mus_property ("pitch", np.smobbed_copy ());
-}
-
 IMPLEMENT_TYPE_P (Music, "music?");
 
 IMPLEMENT_SMOBS (Music);
index 700e4ceeb83e5c131d67065bbf1741b26058fd8f..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 100644 (file)
@@ -1,109 +0,0 @@
-/*
-  request.cc -- implement all musical requests.
-
-  source file of the GNU LilyPond music typesetter
-
-  (c)  1997--2002 Han-Wen Nienhuys <hanwen@cs.uu.nl>
-*/
-
-#include "musical-request.hh"
-#include "misc.hh"
-#include "warn.hh"
-#include "music-list.hh"
-
-
-Tremolo_req::Tremolo_req ()
-{
-}
-
-LY_DEFINE(music_duration_length, "music-duration-length", 1, 0,0,
-         (SCM mus),
-         "Extract the duration field from @var{mus}, and return the length.")
-{
-  Music* m =   unsmob_music(mus);
-  SCM_ASSERT_TYPE(m, mus, SCM_ARG1, __FUNCTION__, "Music");
-  
-  Duration *d = unsmob_duration (m->get_mus_property ("duration"));
-
-  Moment l ;
-  
-  if (d)
-    {
-      l = d->length_mom ();  
-    }
-  else
-    programming_error("Rhythmic_req has no duration");
-  return l.smobbed_copy();
-  
-}
-
-
-LY_DEFINE(music_duration_compress, "music-duration-compress", 2, 0,0,
-         (SCM mus, SCM factor),
-         "Extract the duration field from @var{mus}, and compress it.")
-{
-  Music* m =   unsmob_music(mus);
-  Moment * f = unsmob_moment (factor);
-  SCM_ASSERT_TYPE(m, mus, SCM_ARG1, __FUNCTION__, "Music");
-  SCM_ASSERT_TYPE(f, factor, SCM_ARG2, __FUNCTION__, "Moment");
-  
-  Duration *d = unsmob_duration (m->get_mus_property ("duration"));
-  if (d)
-    m->set_mus_property ("duration", d->compressed (f->main_part_).smobbed_copy());
-  return SCM_UNSPECIFIED;
-}
-
-  
-Moment
-Rhythmic_req::length_mom () const
-{
-  Duration *d = unsmob_duration (get_mus_property ("duration"));
-  if (!d)
-    {
-      Moment m ;
-      programming_error("Rhythmic_req has no duration");
-      return m;
-    }
-  return d->length_mom ();
-}
-
-void
-Rhythmic_req::compress (Moment m)
-{
-  Duration *d =  unsmob_duration (get_mus_property ("duration"));
-  if (d)
-    set_mus_property ("duration", d ->compressed (m.main_part_).smobbed_copy ());
-}
-
-
-
-bool
-Span_req::do_equal_b (Request const*r) const
-{
-  Span_req const* s = dynamic_cast <Span_req const*> (r);
-  return s && get_span_dir () == s->get_span_dir ();
-}
-
-Span_req::Span_req ()
-{
-}
-
-
-bool
-Text_script_req::do_equal_b (Request const* r) const
-{
-  Text_script_req const* t  = dynamic_cast<Text_script_req const*> (r);
-  return t && gh_equal_p (get_mus_property ("text"),
-                         t->get_mus_property ("text"));
-}
-
-bool
-Articulation_req::do_equal_b (Request const* r) const
-{
-  Articulation_req const* a = dynamic_cast<Articulation_req const*> (r);
-  
-  return a && gh_equal_p (get_mus_property ("articulation-type"),
-                         r->get_mus_property ("articulation-type"))
-    && get_direction () == a->get_direction ();
-}
-
index 1e5fd92accd3140c8722d6ccfd55b1bce579f7eb..f7b108334a0a65c1c6019f1e1534be4212084dfb 100644 (file)
@@ -9,8 +9,8 @@
   
 */
 
-#include "musical-request.hh"
-#include "command-request.hh"
+#include "request.hh"
+
 #include "item.hh"
 #include "tie.hh"
 #include "rhythmic-head.hh"
@@ -555,7 +555,7 @@ events.  Due to interaction with ties (which don't come together
 with note heads), this needs to be in a context higher than Tie_engraver.",
                   
               "Accidental",
-/* accepts */     "general-music",
+/* accepts */     "",
               "rhythmic-head-interface tie-interface arpeggio-interface",
               "localKeySignature localKeySignatureChanges extraNatural autoAccidentals autoCautionaries",
                   "localKeySignature localKeySignatureChanges");
index 065de4cdb8afae7674d0de9cb5c6aead44bbe333..25f4a7b850f59de593efa0d7d9e02b56cb9ef899 100644 (file)
@@ -9,7 +9,7 @@
 #include "engraver.hh"
 #include "group-interface.hh"
 #include "item.hh"
-#include "musical-request.hh"
+#include "request.hh"
 #include "spanner.hh"
 #include "stem.hh"
 #include "rhythmic-head.hh"
index a95827d98d837b0e8d1f0aa470b7dc216726c001..4e60f3c5fc4040ab5a23226f272820c13960cd02 100644 (file)
@@ -14,7 +14,7 @@
 #include "warn.hh"
 #include "font-interface.hh"
 #include "molecule.hh"
-#include "musical-request.hh"
+#include "request.hh"
 #include "rhythmic-head.hh"
 #include "staff-symbol-referencer.hh"
 #include "lookup.hh"
index 7ce9a433de47286248f49960f748ff2b5243e96b..afb341178e3b4ce0d030446fe02183530b19745c 100644 (file)
@@ -7,7 +7,7 @@
 
 #include "rhythmic-head.hh"
 #include "paper-def.hh"
-#include "musical-request.hh"
+#include "request.hh"
 #include "dots.hh"
 #include "dot-column.hh"
 #include "staff-symbol-referencer.hh"
index bfd6fafb497576abd80f3e152b9b0025de00df5f..3d4a1833bf332e40f46019a78ab962cfaac59161 100644 (file)
@@ -8,7 +8,7 @@
  */
 
 #include "engraver.hh"
-#include "musical-request.hh"
+#include "request.hh"
 #include "item.hh"
 
 class Note_name_engraver : public Engraver
@@ -74,7 +74,7 @@ Note_name_engraver::Note_name_engraver()
 ENTER_DESCRIPTION(Note_name_engraver,
 /* descr */       "",
 /* creats*/       "NoteName",
-/* accepts */     "general-music",
+/* accepts */     "note-event",
 /* acks  */      "",
 /* reads */       "",
 /* write */       "");
index 91509a9734c20d7d8861ce74d629802326084ab2..35b93e58bdfba7713ccd4817eacab5b3e39aaed5 100644 (file)
@@ -7,7 +7,7 @@
  */
 
 #include "performer.hh"
-#include "musical-request.hh"
+#include "request.hh"
 #include "audio-item.hh"
 #include "audio-column.hh"
 #include "global-translator.hh"
@@ -125,7 +125,7 @@ Note_performer::try_music (Music* req)
   return false;
 }
 
-ENTER_DESCRIPTION(Note_performer,"","","general-music","","","");
+ENTER_DESCRIPTION(Note_performer,"","","note-event","","","");
 
 Note_performer::Note_performer()
 {
index fc6b297a6e372b7c7b31cbb9a200f0a70cb99cd4..cfdf4f32a2e8f69544de86c0c51837a942aac0d5 100644 (file)
@@ -39,8 +39,7 @@ protected:
 bool
 Output_property_engraver::try_music (Music* m)
 {
-  if (m->get_mus_property ("iterator-ctor") ==
-      Output_property_music_iterator::constructor_proc)
+  if (m->is_mus_type ("layout-instruction"))
     {
       props_.push (m);
       return true;
@@ -84,7 +83,7 @@ ENTER_DESCRIPTION(Output_property_engraver,
 /* descr */       "Interpret Music of Output_property type, and apply a function
 to any Graphic objects that satisfies the predicate.",
 /* creats*/       "",
-/* accepts */     "general-music",
-/* acks  */      "grob-interface",
+/* accepts */     "layout-instruction",
+/* acks  */       "grob-interface",
 /* reads */       "",
 /* write */       "");
index c81ec1612134812ee8bbd0d1e44436519ca37c36..03ad89173278691038daa74b8a5001fcb7f58178 100644 (file)
@@ -37,8 +37,8 @@ this.
 #include "file-path.hh"
 #include "warn.hh"
 #include "dimensions.hh"
-#include "command-request.hh"
-#include "musical-request.hh"
+
+#include "request.hh"
 #include "my-lily-parser.hh"
 #include "context-specced-music.hh"
 #include "score.hh"
@@ -106,6 +106,16 @@ set_property_music (SCM sym, SCM value)
        return p;
 }
 
+Music*
+make_span_req (SCM name)
+{
+  static SCM proc;
+  if (!proc)
+    proc = scm_c_eval_string ("old-span-request->event");
+  SCM m = scm_call_1 (proc, name);
+  scm_gc_protect_object (m);
+  return unsmob_music (m);
+}
 
 // needed for bison.simple's malloc () and free ()
 
@@ -1315,10 +1325,9 @@ shorthand_command_req:
        ;
 
 verbose_command_req:
-       COMMANDSPANREQUEST bare_int STRING { /*TODO: junkme */
-               Music * sp = MY_MAKE_MUSIC("SpanEvent");
+       COMMANDSPANREQUEST bare_int STRING {
+               Music *sp = make_span_req ($3);
                sp->set_mus_property ("span-direction", gh_int2scm (Direction ($2)));
-               sp->set_mus_property ("span-type",$3);
                sp->set_spot (THIS->here_input ());
                $$ = sp;
        }
@@ -1428,9 +1437,9 @@ verbose_request:
                $$ = d;
        }
        | SPANREQUEST bare_int STRING {
-               Music * sp = MY_MAKE_MUSIC("SpanEvent");
+
+               Music * sp = make_span_req ($3);
                sp->set_mus_property ("span-direction", gh_int2scm ( $2));
-               sp->set_mus_property ("span-type", $3);
                sp->set_spot (THIS->here_input ());
                $$ = sp;
        }
@@ -1576,15 +1585,13 @@ close_request:
  
 close_request_parens:
        '('     {
-               Music * s= MY_MAKE_MUSIC("SpanEvent");
+               Music * s= MY_MAKE_MUSIC("SlurEvent");
                $$ = s;
-               s->set_mus_property ("span-type", scm_makfrom0str ( "slur"));
                s->set_spot (THIS->here_input());
        }
        | E_OPEN        {
-               Music * s= MY_MAKE_MUSIC("SpanEvent");
+               Music * s= MY_MAKE_MUSIC("PhrasingSlurEvent");
                $$ = s;
-               s->set_mus_property ("span-type", scm_makfrom0str ( "phrasing-slur"));
                s->set_spot (THIS->here_input());
        }
        | E_SMALLER {
@@ -1616,14 +1623,13 @@ open_request_parens:
                $$ = s;
        }
        | ')'   {
-               Music * s= MY_MAKE_MUSIC("SpanEvent");
+               Music * s= MY_MAKE_MUSIC("SlurEvent");
                $$ = s;
-               s->set_mus_property ("span-type", scm_makfrom0str ( "slur"));
                s->set_spot (THIS->here_input());
 
        }
        | E_CLOSE       {
-               Music * s= MY_MAKE_MUSIC("SpanEvent");
+               Music * s= MY_MAKE_MUSIC("PhrasingSlurEvent");
                $$ = s;
                s->set_mus_property ("span-type", scm_makfrom0str ( "phrasing-slur"));
                s->set_spot (THIS->here_input());
@@ -1934,16 +1940,12 @@ simple_element:
 
                Music * sk = MY_MAKE_MUSIC("SkipEvent");
                sk->set_mus_property ("duration", $2);
-               Music *sp1 = MY_MAKE_MUSIC("SpanEvent");
-               Music *sp2 = MY_MAKE_MUSIC("SpanEvent");
+               Music *sp1 = MY_MAKE_MUSIC("MultiMeasureRestEvent");
+               Music *sp2 = MY_MAKE_MUSIC("MultiMeasureRestEvent");
                sp1-> set_mus_property ("span-direction", gh_int2scm (START))
 ;
                sp2-> set_mus_property ("span-direction", gh_int2scm (STOP))
 ;
-               SCM r = scm_makfrom0str ("rest");
-               sp1->set_mus_property ("span-type", r);
-               sp2->set_mus_property ("span-type", r);
-
                Music *rqc1 = MY_MAKE_MUSIC("RequestChord");
                rqc1->set_mus_property ("elements", scm_list_n (sp1->self_scm (), SCM_UNDEFINED));
                Music *rqc2 = MY_MAKE_MUSIC("RequestChord");
index fcc99f05babc9718492fd710f9534d28f28a6ac5..31959d48d53e800492808057e49ea4308fe86848 100644 (file)
@@ -9,7 +9,7 @@
 #include "part-combine-music.hh"
 #include "part-combine-music-iterator.hh"
 #include "translator-group.hh"
-#include "musical-request.hh"
+#include "request.hh"
 #include "music-sequence.hh"
 #include "lily-guile.hh"
 #include "warn.hh"
@@ -159,7 +159,7 @@ get_music_info (Moment m, Music_iterator* iter, SCM *pitches, SCM *durations)
            {
              SCM d = m->get_mus_property ("duration");
              if (d == SCM_EOL)
-               m->origin ()->warning ("Rhythmic_req has no duration\n");
+               m->origin ()->warning ("Music has no duration\n");
              else
                *durations = gh_cons (d, *durations);
            }
index 1f9023ae723cf9613adacf123ddbd6ba40b99653..2a589e8cd5b10da22f5be0584d09f6fab67f3ca4 100644 (file)
@@ -240,7 +240,7 @@ Percent_repeat_engraver::stop_translation_timestep ()
 ENTER_DESCRIPTION(Percent_repeat_engraver,
 /* descr */       "Make beat, whole bar and double bar repeats.",
 /* creats*/       "PercentRepeat RepeatSlash DoublePercentRepeat",
-/* accepts */     "general-music",
+/* accepts */     "repeated-music",
 /* acks  */      "",
 /* reads */       "measureLength currentCommandColumn",
 /* write */       "");
index 8495817d09591073c68a63b195710b83202e009f..609a707a076f4b402879dfc67efa99baaa412bea 100644 (file)
@@ -4,7 +4,7 @@
   (c)  1997--2002 Han-Wen Nienhuys <hanwen@cs.uu.nl>
 */
 
-#include "musical-request.hh"
+#include "request.hh"
 #include "slur.hh"
 #include "warn.hh"
 #include "note-column.hh"
@@ -14,8 +14,8 @@
 
 class Phrasing_slur_engraver : public Engraver
 {
-  Link_array<Span_req> requestses_;
-  Link_array<Span_req> new_phrasing_slur_reqs_;
+  Link_array<Music> requestses_;
+  Link_array<Music> new_phrasing_slur_reqs_;
   Link_array<Grob> phrasing_slur_l_stack_;
   Link_array<Grob> end_phrasing_slurs_;
   Moment last_start_;
@@ -41,11 +41,8 @@ Phrasing_slur_engraver::Phrasing_slur_engraver ()
 bool
 Phrasing_slur_engraver::try_music (Music *req)
 {
-  if (Span_req *sl = dynamic_cast <Span_req *> (req))
+  if (req->is_mus_type ("abort-event"))
     {
-      String t =  ly_scm2string (sl->get_mus_property ("span-type"));
-      if (t == "abort")
-       {
          for (int i = 0; i < phrasing_slur_l_stack_.size (); i++)
            {
              phrasing_slur_l_stack_[i]->suicide ();
@@ -58,27 +55,29 @@ Phrasing_slur_engraver::try_music (Music *req)
          end_phrasing_slurs_.clear ();
          requestses_.clear ();
          new_phrasing_slur_reqs_.clear ();
-       }
-      else if (t == "phrasing-slur")
+    }
+  else if (req->is_mus_type ("phrasing-slur-event"))
+    {
+      /*
+       Let's not start more than one phrasing slur per moment.
+      */
+      
+    Direction d = to_dir (req->get_mus_property ("span-direction"));
+         
+      if (d == START)
        {
-         /*
-           Let's not start more than one phrasing slur per moment.
-          */
-         if (sl->get_span_dir () == START)
+         if (now_mom () > last_start_)
            {
-             if (now_mom () > last_start_)
-               {
-                 new_phrasing_slur_reqs_.push (sl);
-                 last_start_ = now_mom ();
-                 return true;
-               }
-           }
-         else
-           {
-             new_phrasing_slur_reqs_.push (sl);
+             new_phrasing_slur_reqs_.push (req);
+             last_start_ = now_mom ();
              return true;
            }
        }
+      else
+       {
+         new_phrasing_slur_reqs_.push (req);
+         return true;
+       }
     }
   return false;
 }
@@ -124,9 +123,12 @@ Phrasing_slur_engraver::process_acknowledged_grobs ()
   Link_array<Grob> start_phrasing_slurs;
   for (int i=0; i< new_phrasing_slur_reqs_.size (); i++)
     {
-      Span_req* phrasing_slur_req = new_phrasing_slur_reqs_[i];
+      Music* phrasing_slur_req = new_phrasing_slur_reqs_[i];
       // end phrasing slur: move the phrasing slur to other array
-      if (phrasing_slur_req->get_span_dir () == STOP)
+
+      Direction d = to_dir (phrasing_slur_req->get_mus_property ("span-direction"));
+      
+      if (d == STOP)
        {
          if (phrasing_slur_l_stack_.empty ())
            phrasing_slur_req->origin ()->warning (_f ("can't find start of phrasing slur"));
@@ -137,7 +139,7 @@ Phrasing_slur_engraver::process_acknowledged_grobs ()
              requestses_.pop ();
            }
        }
-      else  if (phrasing_slur_req->get_span_dir () == START)
+      else if (d == START)
        {
          // push a new phrasing_slur onto stack.
          // (use temp. array to wait for all phrasing_slur STOPs)
@@ -174,7 +176,7 @@ Phrasing_slur_engraver::start_translation_timestep ()
 ENTER_DESCRIPTION(Phrasing_slur_engraver,
 /* descr */       "Print phrasing slurs. Similar to Slur_engraver",
 /* creats*/       "PhrasingSlur",
-/* accepts */     "general-music",
-/* acks  */      "note-column-interface",
+/* accepts */     "phrasing-slur-event",
+/* acks  */       "note-column-interface",
 /* reads */       "slurMelismaBusy",
 /* write */       "");
index 4f478bea9bf5fe7dd6951b01ca7aca4f02924379..b68359a4d7fe154963485fab97f34bae4dc7a00f 100644 (file)
@@ -10,7 +10,7 @@
 */
 
 #include "engraver.hh"
-#include "musical-request.hh"
+#include "request.hh"
 #include "grob.hh"
 #include "item.hh"
 #include "lily-guile.hh"
@@ -25,8 +25,8 @@
 struct Pedal_info
 {
   char const * name_;
-  Span_req* start_req_;
-  Drul_array<Span_req*> req_l_drul_;
+  Music* start_req_;
+  Drul_array<Music*> req_l_drul_;
   Item* item_;
   Spanner* bracket_;     // A single portion of a pedal bracket
   Spanner* finished_bracket_;
@@ -36,7 +36,7 @@ struct Pedal_info
    */
   Spanner* line_spanner_;
   Spanner* finished_line_spanner_;
-  Span_req* current_bracket_req_;
+  Music* current_bracket_req_;
 };
 
 
@@ -150,23 +150,28 @@ Piano_pedal_engraver::acknowledge_grob (Grob_info info)
 bool
 Piano_pedal_engraver::try_music (Music *m)
 {
-  if (Span_req * s = dynamic_cast<Span_req*> (m))
+  if (m->is_mus_type ("abort-event"))
     {
       for (Pedal_info*p = info_list_; p->name_; p ++)
        {
-         if (ly_scm2string (s->get_mus_property ("span-type")) == "abort")
-           {
-             p->req_l_drul_[START] = 0;
-             p->req_l_drul_[STOP] = 0;
-             
+         p->req_l_drul_[START] = 0;
+         p->req_l_drul_[STOP] = 0;
+         
              if (p->bracket_)
                p->bracket_->suicide (); /* as in dynamic-engraver.cc */
              p->bracket_ = 0;
-           }  
-         if (scm_equal_p (s->get_mus_property ("span-type"),
-                          scm_makfrom0str (p->name_))==SCM_BOOL_T)
+           }
+    }
+  else if  (m->is_mus_type ("pedal-event"))
+    {
+      for (Pedal_info*p = info_list_; p->name_; p ++)
+       {
+         String nm = p->name_ + String ("Event");
+         if (gh_equal_p (m->get_mus_property ("name") ,
+                         scm_makfrom0str (nm.to_str0())))
            {
-             p->req_l_drul_[s->get_span_dir ()] = s;
+             Direction d = to_dir (m->get_mus_property ("span-direction"));
+             p->req_l_drul_[d] = m;
              return true;
            }
        }
@@ -509,7 +514,7 @@ Piano_pedal_engraver::start_translation_timestep ()
 ENTER_DESCRIPTION (Piano_pedal_engraver,
 /* descr */       "Engrave piano pedal symbols and brackets.",
 /* creats*/       "SostenutoPedal SustainPedal UnaCordaPedal SostenutoPedalLineSpanner SustainPedalLineSpanner UnaCordaPedalLineSpanner",
-/* accepts */     "general-music",
+/* accepts */     "pedal-event abort-event",
 /* acks  */      "note-column-interface",
 /* reads */       "pedalSostenutoStrings pedalSustainStrings pedalUnaCordaStrings",
 /* write */       "");
index 940a14828586809ae25f14c32abbcc75b73a645f..707bac9733fcad374a04baeb00b80afa759e1e31 100644 (file)
@@ -7,8 +7,8 @@
 */
 
 #include "performer.hh"
-#include "command-request.hh"
-#include "musical-request.hh"
+
+#include "request.hh"
 #include "audio-item.hh"
 
 /**
@@ -19,8 +19,8 @@ class Piano_pedal_performer : public Performer
   struct Pedal_info
   {
     char const *name_;
-    Span_req* start_req_;
-    Drul_array<Span_req*> req_l_drul_;
+    Music* start_req_;
+    Drul_array<Music*> req_l_drul_;
   };
 
 public:
@@ -125,14 +125,16 @@ Piano_pedal_performer::start_translation_timestep ()
 bool
 Piano_pedal_performer::try_music (Music* r)
 {
 if (Span_req * s = dynamic_cast<Span_req*> (r))
if  (r->is_mus_type ("pedal-event"))
     {
       for (Pedal_info*p = info_alist_; p->name_; p ++)
        {
-         if (scm_equal_p (s->get_mus_property ("span-type"),
-                          scm_makfrom0str (p->name_)) == SCM_BOOL_T)
+         String nm = p->name_ + String ("Event");
+         if (gh_equal_p (r->get_mus_property ("name") ,
+                         scm_makfrom0str (nm.to_str0())))
            {
-             p->req_l_drul_[s->get_span_dir ()] = s;
+             Direction d = to_dir (r->get_mus_property ("span-direction"));
+             p->req_l_drul_[d] = r;
              return true;
            }
        }
@@ -141,5 +143,5 @@ Piano_pedal_performer::try_music (Music* r)
 }
 
 ENTER_DESCRIPTION (Piano_pedal_performer, "","",
-                  "general-music",
+                  "pedal-event",
                   "","","" );
index 002d28440eadc2ef6211bbf77bf1e36380768425..4961e70f19112469f3787417da59a46e4286c370 100644 (file)
@@ -40,7 +40,7 @@ the locations of accidentals stay the same.
 Set the position field of all note heads to zero. This useful for
 making a single line staff that demonstrates the rhythm of a melody.",
 /* creats*/       "",
-/* accepts */     "general-music",
+/* accepts */     "",
 /* acks  */      "note-head-interface",
 /* reads */       "squashedPosition",
 /* write */       "");
index eb5737d1db39343f971f8c67be952df439ce1c40..b06806eeb5c4a7aaee980209be1b314e2c68fbc9 100644 (file)
@@ -31,8 +31,8 @@
 
 #include "staff-symbol-referencer.hh"
 #include "porrectus.hh"
-#include "musical-request.hh"
-#include "command-request.hh"
+#include "request.hh"
+
 #include "rhythmic-head.hh"
 #include "item.hh"
 #include "engraver.hh"
@@ -55,7 +55,7 @@ protected:
 
 private:
   PQueue<Grob_pitch_tuple> past_notes_pq_;
-  Porrectus_req *porrectus_req_;
+  Music *porrectus_req_;
   Array<Grob_pitch_tuple> left_heads_;
   Array<Grob_pitch_tuple> right_heads_;
   Link_array<Grob> porrectuses_;
@@ -69,9 +69,9 @@ Porrectus_engraver::Porrectus_engraver ()
 bool
 Porrectus_engraver::try_music (Music *m)
 {
-  if (Porrectus_req *req_ = dynamic_cast <Porrectus_req *> (m))
+  if (m->is_mus_type ("porrectus-event"))
     {
-      porrectus_req_ = req_;
+      porrectus_req_ = m;
       return true;
     }
   else
@@ -167,7 +167,7 @@ Porrectus_engraver::start_translation_timestep ()
 ENTER_DESCRIPTION(Porrectus_engraver,
 /* descr */       "Join adjacent notes to a porrectus ligature.",
 /* creats*/       "Porrectus",
-/* accepts */     "general-music",
+/* accepts */     "porrectus-event",
 /* acks  */      "rhythmic-head-interface",
 /* reads */       "",
 /* write */       "");
index 0c6921feca505a05562a5562f0ab332880b21d30..40ad49545223134be562045da6692e3a69c53967 100644 (file)
@@ -114,7 +114,7 @@ ENTER_DESCRIPTION(Repeat_acknowledge_engraver,
 /* descr */       "Acknowledge repeated music, and convert the contents of
 repeatCommands ainto an appropriate setting for whichBar",
 /* creats*/       "",
-/* accepts */     "general-music",
+/* accepts */     "",
 /* acks  */      "",
 /* reads */       "repeatCommands whichBar",
 /* write */       "");
index 2cf46c91cdd71afa7fc670858c39013df8934a5c..619c1bc40638c41703ec51e09575e7ec5fe85790 100644 (file)
@@ -1,37 +1,12 @@
 #include "pitch.hh" 
 #include "request-chord-iterator.hh"
 #include "music-list.hh"
-#include "musical-request.hh"
+#include "request.hh"
 
 Request_chord::Request_chord ()
 {
 }
 
-Pitch
-Request_chord::to_relative_octave (Pitch last)
-{
-  for (SCM s = music_list (); gh_pair_p (s);  s = ly_cdr (s))
-    {
-      Music * mus = unsmob_music (ly_car (s));
-
-      if (mus->is_mus_type ("melodic-event")
-         || mus->is_mus_type ("rest-event"))
-       {
-         Pitch *old_pit = unsmob_pitch (mus->get_mus_property ("pitch"));
-         if (!old_pit)
-           continue;
-         
-         Pitch new_pit = *old_pit;
-         new_pit.to_relative_octave (last);
-         mus->set_mus_property ("pitch", new_pit.smobbed_copy ());
-
-         return new_pit;
-       }
-
-    }
-  return last;
-}
-
 Moment
 Request_chord::start_mom () const
 {
index 152a67aa8884a4fa76cf8a24269ea7e4d692ee35..840f891c4fed51a02fe8cd8fdacc00f03e1fc7f8 100644 (file)
@@ -9,16 +9,61 @@
 #include "request.hh"
 #include "warn.hh"
 
-bool
-Request::equal_b (Request const* r) const
+
+
+  
+Moment
+Request::length_mom () const
 {
-  return r->do_equal_b (this) || this->do_equal_b (r) ;
+  Duration *d = unsmob_duration (get_mus_property ("duration"));
+  if (!d)
+    {
+      Moment m ;
+      return m;
+    }
+  return d->length_mom ();
 }
 
-bool
-Request::do_equal_b (Request const*) const
+void
+Request::compress (Moment m)
 {
-  return true;
+  Duration *d =  unsmob_duration (get_mus_property ("duration"));
+  if (d)
+    set_mus_property ("duration", d ->compressed (m.main_part_).smobbed_copy ());
+}
+
+void
+Request::transpose (Pitch delta)
+{
+  Pitch *p = unsmob_pitch (get_mus_property ("pitch"));
+  if (!p)
+    return ;
+
+  Pitch np = *p;
+  np.transpose (delta);
+  
+  if (abs (np.alteration_) > 2)
+    {
+       warning (_f ("Transposition by %s makes accidental larger than two",
+         delta.string ()));
+    }
+
+  set_mus_property ("pitch", np.smobbed_copy ());
+}
+
+Pitch
+ Request::to_relative_octave (Pitch last)
+{
+  Pitch *old_pit = unsmob_pitch (get_mus_property ("pitch"));
+  if (old_pit)
+    {
+      Pitch new_pit = *old_pit;
+      new_pit.to_relative_octave (last);
+      set_mus_property ("pitch", new_pit.smobbed_copy ());
+  
+      return new_pit;
+    }
+  return last;
 }
   
 Request::Request ()
@@ -26,37 +71,128 @@ Request::Request ()
 {
 }
 
-Script_req::Script_req ()
+ADD_MUSIC(Request);
+LY_DEFINE(music_duration_length, "music-duration-length", 1, 0,0,
+         (SCM mus),
+         "Extract the duration field from @var{mus}, and return the length.")
 {
-  set_direction (CENTER);
+  Music* m =   unsmob_music(mus);
+  SCM_ASSERT_TYPE(m, mus, SCM_ARG1, __FUNCTION__, "Music");
+  
+  Duration *d = unsmob_duration (m->get_mus_property ("duration"));
+
+  Moment l ;
+  
+  if (d)
+    {
+      l = d->length_mom ();  
+    }
+  else
+    programming_error("Music has no duration");
+  return l.smobbed_copy();
+  
 }
 
-void
-Script_req::set_direction (Direction d)
+
+LY_DEFINE(music_duration_compress, "music-duration-compress", 2, 0,0,
+         (SCM mus, SCM factor),
+         "Extract the duration field from @var{mus}, and compress it.")
 {
-  set_mus_property ("direction", gh_int2scm (d));
+  Music* m =   unsmob_music(mus);
+  Moment * f = unsmob_moment (factor);
+  SCM_ASSERT_TYPE(m, mus, SCM_ARG1, __FUNCTION__, "Music");
+  SCM_ASSERT_TYPE(f, factor, SCM_ARG2, __FUNCTION__, "Moment");
+  
+  Duration *d = unsmob_duration (m->get_mus_property ("duration"));
+  if (d)
+    m->set_mus_property ("duration", d->compressed (f->main_part_).smobbed_copy());
+  return SCM_UNSPECIFIED;
 }
 
-Direction
-Script_req::get_direction () const
+
+
+
+
+
+
+#include "request.hh"
+
+
+
+LY_DEFINE(transpose_key_alist,"transpose-key-alist",
+         2, 0,0, (SCM l, SCM pitch),
+         "Make a new key alist of @var{l} transposed by pitch @var{pitch}")
+{
+  SCM newlist = SCM_EOL;
+  Pitch *p = unsmob_pitch (pitch);
+  
+  for (SCM s = l; gh_pair_p (s); s = ly_cdr (s))
+    {
+      SCM key = ly_caar (s);
+      SCM alter = ly_cdar (s);
+      if (gh_pair_p (key))
+       {
+         Pitch orig (gh_scm2int (ly_car (key)),
+                             gh_scm2int (ly_cdr (key)),
+                             gh_scm2int (alter));
+
+         orig.transpose (*p);
+
+         SCM key = gh_cons (scm_int2num (orig.get_octave ()),
+                            scm_int2num (orig.notename_));
+
+         newlist = gh_cons (gh_cons (key, scm_int2num (orig.alteration_)),
+                            newlist);
+       }
+      else if (gh_number_p (key))
+       {
+         Pitch orig (0, gh_scm2int (key), gh_scm2int (alter));
+         orig.transpose (*p);
+
+         key =scm_int2num (orig.notename_);
+         alter = scm_int2num (orig.alteration_);
+         newlist = gh_cons (gh_cons (key, alter), newlist);
+       }
+    }
+  return scm_reverse_x (newlist, SCM_EOL);
+}
+
+void
+Key_change_req::transpose (Pitch p)
 {
-  SCM d = get_mus_property ("direction");
+  SCM pa = get_mus_property ("pitch-alist");
 
-  return (ly_dir_p (d)) ?  to_dir (d) : CENTER;
+  set_mus_property ("pitch-alist", transpose_key_alist (pa, p.smobbed_copy()));
 }
 
-Direction
-Span_req::get_span_dir () const
+
+bool
+alist_equal_p (SCM a, SCM b)
 {
-  SCM d = get_mus_property ("span-direction");
+  for (SCM s = a;
+       gh_pair_p (s); s = ly_cdr (s))
+    {
+      SCM key = ly_caar (s);
+      SCM val = ly_cdar (s);
+      SCM l = scm_assoc (key, b);
 
-  return (ly_dir_p (d)) ?  to_dir (d) : CENTER;
+      if (l == SCM_BOOL_F
+         || !gh_equal_p ( ly_cdr (l), val))
+
+       return false;
+    }
+  return true;
 }
 
-void
-Span_req::set_span_dir (Direction d)
+bool
+Key_change_req::do_equal_b (Request const * m )const
 {
-  set_mus_property ("span-direction", gh_int2scm (d));
+  Key_change_req const * kc =dynamic_cast<Key_change_req const*> (m);
+
+  if(!kc)
+    return false;
+  return alist_equal_p (get_mus_property ("pitch-alist"),
+                       kc->get_mus_property ("pitch-alist"));
 }
 
-ADD_MUSIC(Request);
+ADD_MUSIC (Key_change_req);
index cff3fbff873f0d0795235e67eef8b8daabda737c..b4d76b06d92076f15d473edc94d36a9a9090620a 100644 (file)
@@ -65,7 +65,7 @@ Rest_collision_engraver::stop_translation_timestep ()
 ENTER_DESCRIPTION(Rest_collision_engraver,
 /* descr */       "Handles collisions of rests.",
 /* creats*/       "RestCollision",
-/* accepts */     "general-music",
+/* accepts */     "",
 /* acks  */      "note-column-interface",
 /* reads */       "",
 /* write */       "");
index 3aabd92441a66a39e004179ce892c1378bf2f8fb..8f694da5ef79c5852b7eb91a983e097978d9c92a 100644 (file)
@@ -7,7 +7,7 @@
 */
 #include "item.hh"
 #include "staff-symbol-referencer.hh"
-#include "musical-request.hh"
+#include "request.hh"
 #include "dots.hh"
 #include "rhythmic-head.hh"
 #include "engraver.hh"
index 20c86a3b115206ace4d88fbecd608d1b1d8ecb62..2861bb9cc19925dc764cada4e5c38a1f19bc29a0 100644 (file)
@@ -13,7 +13,7 @@
 #include "stem.hh"
 #include "note-column.hh"
 #include "dot-column.hh"
-#include "musical-request.hh"
+#include "request.hh"
 #include "item.hh"
 #include "group-interface.hh"
 
@@ -182,7 +182,7 @@ Rhythmic_column_engraver::start_translation_timestep ()
 ENTER_DESCRIPTION(Rhythmic_column_engraver,
 /* descr */       "Generates NoteColumn, an objects that groups stems, noteheads and rests.",
 /* creats*/       "NoteColumn NoteSpacing",
-/* accepts */     "general-music",
+/* accepts */     "",
 /* acks  */      "stem-interface rhythmic-head-interface dot-column-interface",
 /* reads */       "",
 /* write */       "");
index 52afa1b0b8c3487d3811dd93330e6741ab5c6e41..6e0ebb75349cd50942e130fac4fd14ccfc061abd 100644 (file)
@@ -15,7 +15,7 @@
 #include "score-engraver.hh"
 #include "paper-score.hh"
 #include "paper-column.hh"
-#include "command-request.hh"
+
 #include "paper-def.hh"
 #include "axis-group-interface.hh"
 #include "translator-def.hh"
index 686574f9d1e7c19780cf65cc8039d78aa569018e..f98395e7e67dc8fdc523236e03169ba1c9fb19f4 100644 (file)
@@ -21,7 +21,7 @@
 ENTER_DESCRIPTION(Score_performer,
 /* descr */       "",
 /* creats*/       "",
-/* accepts */     "general-music",
+/* accepts */     "",
 /* acks  */      "",
 /* reads */       "",
 /* write */       "");
index 7af91365b702659dcaf35c7eba77a9f6b24906b4..f5d70c5f0bfe868989ba41bc199fda815ea90bb0 100644 (file)
@@ -87,7 +87,7 @@ Script_column_engraver::process_acknowledged_grobs ()
 ENTER_DESCRIPTION(Script_column_engraver,
 /* descr */       "",
 /* creats*/       "ScriptColumn",
-/* accepts */     "general-music",
+/* accepts */     "",
 /* acks  */      "side-position-interface",
 /* reads */       "",
 /* write */       "");
index a153242688d73e09f58fee6fdb79b51db83f1b62..e7511c557905ac8883b08e73c953707702fb5181 100644 (file)
@@ -6,7 +6,7 @@
 
 #include "script.hh"
 #include "side-position-interface.hh"
-#include "musical-request.hh"
+#include "request.hh"
 #include "stem.hh"
 #include "rhythmic-head.hh"
 #include "engraver.hh"
@@ -15,7 +15,7 @@
 class Script_engraver : public Engraver
 {
   Link_array<Grob> scripts_;
-  Link_array<Articulation_req> script_reqs_;
+  Link_array<Music> script_reqs_;
 
 public:
   TRANSLATOR_DECLARATIONS(Script_engraver);
@@ -37,14 +37,9 @@ Script_engraver::initialize ()
 bool
 Script_engraver::try_music (Music *r)
 {
-  if (Articulation_req *mr = dynamic_cast <Articulation_req *> (r))
+  if (r->is_mus_type ("articulation-event"))
     {
-      for (int i=0; i < script_reqs_.size (); i++) 
-       {
-         if (script_reqs_[i]->equal_b (mr))
-           return true;
-       }
-      script_reqs_.push (mr);
+      script_reqs_.push (r);
       return true;
     }
   return false;
@@ -55,7 +50,7 @@ Script_engraver::process_music ()
 {
   for (int i=0; i < script_reqs_.size (); i++)
     {
-      Articulation_req* l=script_reqs_[i];
+      Music* l=script_reqs_[i];
 
       SCM alist = get_property ("scriptDefinitions");
       SCM art = scm_assoc (l->get_mus_property ("articulation-type"), alist);
@@ -209,7 +204,7 @@ ENTER_DESCRIPTION(Script_engraver,
 /* descr */       "    Handles note ornaments generated by @code{\\script}.  
 ",
 /* creats*/       "Script",
-/* accepts */     "general-music",
+/* accepts */     "script-event articulation-event",
 /* acks  */      "stem-interface rhythmic-head-interface note-column-interface",
 /* reads */       "scriptDefinitions scriptHorizontal",
 /* write */       "");
index cd1fa23a022118690459bb11b1110534659151f2..c4ed87df919eb4194b87f0868a157f959b9efc2a 100644 (file)
@@ -213,7 +213,7 @@ Separating_line_group_engraver::stop_translation_timestep ()
 ENTER_DESCRIPTION(Separating_line_group_engraver,
 /* descr */       "Generates objects for computing spacing parameters.",
 /* creats*/       "SeparationItem SeparatingGroupSpanner",
-/* accepts */     "general-music",
+/* accepts */     "",
 /* acks  */      "item-interface",
 /* reads */       "",
 /* write */       "");
index b703078f6235eb44da0720244c1384ecda84e1f3..d5e9f673c1681ed55594a950f420672f9a30f5f0 100644 (file)
@@ -4,7 +4,7 @@
   (c)  1997--2002 Han-Wen Nienhuys <hanwen@cs.uu.nl>
 */
 
-#include "musical-request.hh"
+#include "request.hh"
 #include "slur.hh"
 #include "warn.hh"
 #include "note-column.hh"
@@ -17,8 +17,8 @@
  */
 class Slur_engraver : public Engraver
 {
-  Link_array<Span_req> requests_;
-  Link_array<Span_req> new_slur_reqs_;
+  Link_array<Music> requests_;
+  Link_array<Music> new_slur_reqs_;
   Link_array<Grob> slur_stack_;
   Link_array<Grob> end_slurs_;
   Moment last_start_;
@@ -45,56 +45,57 @@ Slur_engraver::Slur_engraver ()
 bool
 Slur_engraver::try_music (Music *req)
 {
-  if (Span_req *sl = dynamic_cast <Span_req *> (req))
+  if (req->is_mus_type ("abort-event"))
     {
-      String t =  ly_scm2string (sl->get_mus_property ("span-type"));
-      if (t == "abort")
+      for (int i = 0; i < slur_stack_.size (); i++)
        {
-         for (int i = 0; i < slur_stack_.size (); i++)
-           {
-             slur_stack_[i]->suicide ();
-           }
-         slur_stack_.clear ();
-         for (int i = 0; i < end_slurs_.size (); i++)
+         slur_stack_[i]->suicide ();
+       }
+      slur_stack_.clear ();
+      for (int i = 0; i < end_slurs_.size (); i++)
+       {
+         end_slurs_[i]->suicide ();
+       }
+      end_slurs_.clear ();
+      requests_.clear ();
+      new_slur_reqs_.clear ();
+    }
+  else if (req->is_mus_type ("slur-event"))
+    {
+      /*
+       Let's not start more than one slur per moment.
+      */
+      Direction d = to_dir (req->get_mus_property ("span-direction"));
+      if (d == START)
+       {
+         if (now_mom () > last_start_)
            {
-             end_slurs_[i]->suicide ();
+             new_slur_reqs_.push (req);
+             last_start_ = now_mom ();
            }
-         end_slurs_.clear ();
-         requests_.clear ();
-         new_slur_reqs_.clear ();
+
+         /*
+           But we swallow other slur requests.
+         */
+             
+         return true;
+
        }
-      else if (t == "slur")
+      else if (d == STOP)
        {
          /*
-           Let's not start more than one slur per moment.
-          */
-         if (sl->get_span_dir () == START)
+           Swallow other requests.
+         */
+         for (int j = new_slur_reqs_.size(); j--;)
            {
-             if (now_mom () > last_start_)
-               {
-                 new_slur_reqs_.push (sl);
-                 last_start_ = now_mom ();
-               }
-
-             /*
-               But we swallow other slur requests.
-             */
+             Direction nd = to_dir (new_slur_reqs_[j]->get_mus_property ("span-direction"));
              
-             return true;
-
+             if (nd == STOP)
+               return true;
            }
-         else if (sl->get_span_dir () == STOP)
-           {
-             /*
-               Swallow other requests.
-              */
-             for (int j = new_slur_reqs_.size(); j--;)
-               if (new_slur_reqs_[j]->get_span_dir() == STOP)
-                 return true;
              
-             new_slur_reqs_.push (sl);
-             return true;
-           }
+         new_slur_reqs_.push (req);
+         return true;
        }
     }
   return false;
@@ -147,9 +148,10 @@ Slur_engraver::process_acknowledged_grobs ()
   Link_array<Grob> start_slurs;
   for (int i=0; i< new_slur_reqs_.size (); i++)
     {
-      Span_req* slur_req = new_slur_reqs_[i];
+      Music* slur_req = new_slur_reqs_[i];
       // end slur: move the slur to other array
-      if (slur_req->get_span_dir () == STOP)
+      Direction d = to_dir (slur_req->get_mus_property ("span-direction"));
+   if (d== STOP)
        {
          if (slur_stack_.empty ())
            /* How to shut up this warning, when Voice_devnull_engraver has
@@ -163,7 +165,7 @@ Slur_engraver::process_acknowledged_grobs ()
              requests_.pop ();
            }
        }
-      else  if (slur_req->get_span_dir () == START)
+      else  if (d == START)
        {
          // push a new slur onto stack.
          // (use temp. array to wait for all slur STOPs)
@@ -205,7 +207,7 @@ Slur_engraver::start_translation_timestep ()
 ENTER_DESCRIPTION (Slur_engraver,
 /* descr */       "Build slurs from Slur_reqs",
 /* creats*/       "Slur",
-/* accepts */     "general-music",
+/* accepts */     "slur-event",
 /* acks  */      "note-column-interface",
 /* reads */       "slurMelismaBusy",
 /* write */       "");
index 9903b10070378a71f3795dd246e43acaa7014260..9fc77d723947edd5afd3d968117efbb01fd5a9cc 100644 (file)
@@ -7,7 +7,7 @@
   
  */
 
-#include "musical-request.hh"
+#include "request.hh"
 #include "paper-column.hh"
 #include "engraver.hh"
 #include "pqueue.hh"
@@ -106,7 +106,8 @@ Spacing_engraver::acknowledge_grob (Grob_info i)
    */
   if (!now_.grace_part_)
     {
-      if (Rhythmic_req * r = dynamic_cast<Rhythmic_req*> (i.music_cause ()))
+      Music *r = i.music_cause ();
+      if (r && r->is_mus_type ("rhythmic-event"))
        {
          Moment len = r->length_mom ();
          Rhythmic_tuple t (i, now_mom () + len);
@@ -171,7 +172,7 @@ Spacing_engraver::start_translation_timestep ()
 ENTER_DESCRIPTION(Spacing_engraver,
 /* descr */       "make a SpacingSpanner and do bookkeeping of shortest starting and playing notes  ",
 /* creats*/       "SpacingSpanner",
-/* accepts */     "general-music",
+/* accepts */     "",
 /* acks  */      "grob-interface",
 /* reads */       "",
 /* write */       "");
index 92f6d0f42bf6f44677997c1c831922845cb21e23..715decd94853097e48a9443f73fbad4cb136ca5e 100644 (file)
@@ -105,7 +105,7 @@ Span_arpeggio_engraver::stop_translation_timestep ()
 ENTER_DESCRIPTION(Span_arpeggio_engraver,
 /* descr */       "",
 /* creats*/       "Arpeggio",
-/* accepts */     "general-music",
+/* accepts */     "",
 /* acks  */      "arpeggio-interface",
 /* reads */       "connectArpeggios",
 /* write */       "");
index 503e563a1d96efca3e4348304fd6239f0f8e9b73..10c6b30e6db03b85f6ffb55abf35d58726984265 100644 (file)
@@ -93,7 +93,7 @@ ENTER_DESCRIPTION(Span_bar_engraver,
 /* descr */       "This engraver makes cross-staff barlines: It catches all normal
 bar lines, and draws a single span-bar across them.",
 /* creats*/       "SpanBar",
-/* accepts */     "general-music",
+/* accepts */     "",
 /* acks  */      "bar-line-interface",
 /* reads */       "",
 /* write */       "");
index 6c5386758487dd65d42ddaaf092be52ed1dae73d..e568cae2e47a3b6802c4bb982b354535bbe3457e 100644 (file)
@@ -7,8 +7,8 @@
 */
 
 #include "performer.hh"
-#include "command-request.hh"
-#include "musical-request.hh"
+
+#include "request.hh"
 #include "audio-item.hh"
 
 struct Audio_dynamic_tuple
@@ -35,8 +35,8 @@ protected:
 private:
   Audio_dynamic* audio_;
   Real last_volume_;
-  Span_req* span_start_req_;
-  Drul_array<Span_req*> span_req_l_drul_;
+  Music* span_start_req_;
+  Drul_array<Music*> span_req_l_drul_;
   Array<Audio_dynamic_tuple> dynamic_tuples_;
   Array<Audio_dynamic_tuple> finished_dynamic_tuples_;
   Direction dir_;
@@ -173,18 +173,15 @@ Span_dynamic_performer::start_translation_timestep ()
 bool
 Span_dynamic_performer::try_music (Music* r)
 {
-  if (Span_req * s = dynamic_cast<Span_req*> (r))
+  if (r->is_mus_type ("dynamic-event"))        // fixme.
     {
-      String t =  ly_scm2string (s->get_mus_property ("span-type"));      
-      if (t == "crescendo" || t == "decrescendo")
-       {
-         span_req_l_drul_[s->get_span_dir ()] = s;
-         return true;
-       }
+      Direction d = to_dir (r->get_mus_property ("span-direction"));
+      span_req_l_drul_[d] = r;
+      return true;
     }
   return false;
 }
 ENTER_DESCRIPTION (Span_dynamic_performer,
                   "", "",
-                  "general-music", 
+                  "dynamic-event", 
                   "", "", "");
index 23792a7332f583b319461bc0434cc363f2bab171..920a06c196073dbacd00d58c2b272ce99ef0b5be 100644 (file)
@@ -40,7 +40,7 @@ ENTER_DESCRIPTION(Staff_collecting_engraver,
 /* descr */       "Maintain the stavesFound variable",
 
 /* creats*/       "",
-/* accepts */     "general-music",
+/* accepts */     "",
 /* acks  */      "staff-symbol-interface",
 /* reads */       "stavesFound",
 /* write */       "stavesFound");
index d666fb6064d6fbbf2e333350c0e291ffa436ef1f..800ccafe11a4661a358e1b769570a98c2a3f37b7 100644 (file)
@@ -42,7 +42,7 @@ private:
 };
 
 ENTER_DESCRIPTION (Staff_performer, "", "",
-                  "general-music",
+                  "",
                   "", "", "");
 
 Staff_performer::Staff_performer ()
index 956f9a0c5bd202b08b300c63450195cb9835ad65..9f601d155109f8f0e7e5eee76e7584fc470f9446 100644 (file)
@@ -74,7 +74,7 @@ ENTER_DESCRIPTION(Staff_symbol_engraver,
 /* descr */       "create the constellation of five (default)
 staff lines.",
 /* creats*/       "StaffSymbol",
-/* accepts */     "general-music",
+/* accepts */     "",
 /* acks  */      "grob-interface",
 /* reads */       "",
 /* write */       "");
index 9e1f3d1fc1675c1a537d580856433a6a8ae71302..46f1ef291be63a878e306eca8ddde93cc7ab70a7 100644 (file)
@@ -94,7 +94,7 @@ Stanza_number_engraver::create_text (SCM txt)
 ENTER_DESCRIPTION(Stanza_number_engraver,
 /* descr */       "",
 /* creats*/       "StanzaNumber",
-/* accepts */     "general-music",
+/* accepts */     "",
 /* acks  */      "",
 /* reads */       "stz stanza",
 /* write */       "");
index 8d08ee0dd8612c6b32bada998085eacffd219188..c9d1ab58ec47e7844c8d748229eb053da10a3e7f 100644 (file)
@@ -9,7 +9,7 @@
 #include "staff-symbol-referencer.hh"
 #include "rhythmic-head.hh"
 #include "stem.hh"
-#include "musical-request.hh"
+#include "request.hh"
 #include "misc.hh"
 #include "stem-tremolo.hh"
 #include "item.hh"
@@ -32,8 +32,8 @@ protected:
 private:
   Grob  *stem_;
   Grob *tremolo_;
-  Rhythmic_req *rhythmic_req_;
-  Tremolo_req* tremolo_req_;
+  Music *rhythmic_req_;
+  Music* tremolo_req_;
 };
 
 Stem_engraver::Stem_engraver ()
@@ -161,9 +161,9 @@ Stem_engraver::stop_translation_timestep ()
 bool
 Stem_engraver::try_music (Music* r)
 {
-  if (Tremolo_req* a = dynamic_cast <Tremolo_req *> (r))
+  if (r->is_mus_type ("tremolo-event"))
     {
-      tremolo_req_ = a;
+      tremolo_req_ = r;
       return true;
     }
   return false;
@@ -173,7 +173,7 @@ ENTER_DESCRIPTION(Stem_engraver,
 /* descr */       "Create stems and single-stem tremolos.  It also works together with
 the beam engraver for overriding beaming.",
 /* creats*/       "Stem StemTremolo",
-/* accepts */     "general-music",
+/* accepts */     "tremolo-event",
 /* acks  */      "rhythmic-head-interface",
 /* reads */       "tremoloFlags stemLeftBeamCount stemRightBeamCount",
 /* write */       "");
index 682cf4f069a18cb0a7c5de9eaf29d13c17073cc0..1bfd7c22abbf38a50dc9fe325c05d3edd1cfe844 100644 (file)
@@ -87,7 +87,7 @@ System_start_delimiter_engraver::finalize ()
 ENTER_DESCRIPTION(System_start_delimiter_engraver,
 /* descr */       "Creates a system start delimiter (ie. SystemStart@{Bar,Brace,Bracket@} spanner",
 /* creats*/       "SystemStartBar SystemStartBrace SystemStartBracket",
-/* accepts */     "general-music",
+/* accepts */     "",
 /* acks  */      "system-start-delimiter-interface staff-symbol-interface",
 /* reads */       "systemStartDelimiter",
 /* write */       "");
index fb2b29101a89618c44a84f3f29e87db88c16e66b..60333dbc751cf27ddc16b81339818664c6f33353 100644 (file)
@@ -8,7 +8,7 @@
 
 #include "rhythmic-head.hh"
 #include "paper-def.hh"
-#include "musical-request.hh"
+#include "request.hh"
 #include "dots.hh"
 #include "dot-column.hh"
 #include "staff-symbol-referencer.hh"
index f457b428985acd45b65929a410ac256d1af27554..96ba3fa880739c7a58a476463e6433a0ed37a549 100644 (file)
@@ -6,7 +6,7 @@
   (c)  1997--2002 Jan Nieuwenhuizen <janneke@gnu.org>
 */
 
-#include "command-request.hh"
+
 #include "audio-item.hh"
 #include "performer.hh"
 
index 505a74505a71ac27242a24d06f1536d66cb6bd99..57acc8c4c792a5c6b61e26b010faa00300a2fac6 100644 (file)
@@ -11,7 +11,7 @@
 #include "engraver.hh"
 #include "side-position-interface.hh"
 #include "item.hh"
-#include "musical-request.hh"
+#include "request.hh"
 #include "stem.hh"
 #include "rhythmic-head.hh"
 
@@ -21,7 +21,7 @@
  */
 class Text_engraver : public Engraver
 {
-  Link_array<Text_script_req> reqs_;
+  Link_array<Music> reqs_;
   Link_array<Item> texts_;
 public:
   TRANSLATOR_DECLARATIONS(Text_engraver);
@@ -36,11 +36,9 @@ protected:
 bool
 Text_engraver::try_music (Music *m)
 {
-  if (dynamic_cast<Text_script_req*> (m)
-      && m->get_mus_property ("text-type") != ly_symbol2scm ("finger")
-      && m->get_mus_property ("text-type") != ly_symbol2scm ("dynamic"))
+  if (m->is_mus_type ("text-script-event"))
     {
-      reqs_.push (dynamic_cast<Text_script_req*> (m));
+      reqs_.push (m);
       return true;
     }
   return false;
@@ -84,7 +82,7 @@ Text_engraver::process_acknowledged_grobs ()
     return;
   for (int i=0; i < reqs_.size (); i++)
     {
-      Text_script_req * r = reqs_[i];
+      Music * r = reqs_[i];
       
       // URG: Text vs TextScript
       String basic = "TextScript";
@@ -110,8 +108,9 @@ Text_engraver::process_acknowledged_grobs ()
       
       text->set_grob_property ("script-priority", gh_int2scm (priority));
 
-      if (r->get_direction ())
-       Side_position_interface::set_direction (text, r->get_direction ());
+      Direction dir = to_dir (r->get_mus_property ("direction"));
+      if (dir)
+       Side_position_interface::set_direction (text, dir);
       
       text->set_grob_property ("text", r->get_mus_property ("text"));
       announce_grob (text, r->self_scm ());
@@ -144,7 +143,7 @@ Text_engraver::Text_engraver(){}
 ENTER_DESCRIPTION(Text_engraver,
 /* descr */       "Create text-scripts",
 /* creats*/       "TextScript",
-/* accepts */     "general-music",
+/* accepts */     "text-script-event",
 /* acks  */      "rhythmic-head-interface stem-interface",
 /* reads */       "scriptHorizontal",
 /* write */       "");
index 0ac0944fa77a7dac17c91fc13864cc1767f5b211..294545aa454a1ca39bf7fcd0b6dd45440a873f78 100644 (file)
@@ -7,7 +7,7 @@
 */
 
 #include "dimensions.hh"
-#include "musical-request.hh"
+#include "request.hh"
 #include "paper-column.hh"
 #include "note-column.hh"
 #include "item.hh"
@@ -34,8 +34,8 @@ protected:
 private:
   Spanner *span_;
   Spanner *finished_;
-  Span_req *current_req_;
-  Drul_array<Span_req*> req_drul_;
+  Music *current_req_;
+  Drul_array<Music*> req_drul_;
   void typeset_all ();
 };
 
@@ -59,23 +59,22 @@ Text_spanner_engraver::start_translation_timestep ()
 bool
 Text_spanner_engraver::try_music (Music *m)
 {
-  if (Span_req *s =  dynamic_cast <Span_req*> (m))
+  if (m->is_mus_type ("text-span-event"))
     {
-      String t =  ly_scm2string (s->get_mus_property ("span-type"));            
-      if (t == "abort")
-       {
-         req_drul_[LEFT] = 0;
-         req_drul_[RIGHT] = 0;
-         if (span_)
-           span_->suicide ();
-         span_ = 0;
-       }
-      else if (t == "text")
-       {
-         req_drul_[s->get_span_dir ()] = s;
-         return true;
-       }
+
+      Direction d = to_dir (m->get_mus_property ("span-direction"));
+      req_drul_[d] = m;
+      return true;
     }
+  else if (m->is_mus_type ("abort-event"))
+    {
+      req_drul_[LEFT] = 0;
+      req_drul_[RIGHT] = 0;
+      if (span_)
+       span_->suicide ();
+      span_ = 0;
+    }
+
   return false;
 }
 
@@ -175,9 +174,9 @@ Text_spanner_engraver::finalize ()
 }
 
 ENTER_DESCRIPTION(Text_spanner_engraver,
-/* descr */       "Create text spanner from a Span_req.",
+/* descr */       "Create text spanner from a Music.",
 /* creats*/       "TextSpanner",
-/* accepts */     "general-music",
+/* accepts */     "text-span-event",
 /* acks  */      "note-column-interface",
 /* reads */       "",
 /* write */       "");
index 569b911a32456f07b60e2b5e0c990a6ff7a647ad..2c1e13716baa09c9d71c11353a4344f7c6946f5b 100644 (file)
@@ -8,7 +8,7 @@
 
 #include "engraver.hh"
 #include "item.hh"
-#include "musical-request.hh"
+#include "request.hh"
 #include "translator-group.hh"
 
 class Thread_devnull_engraver : public Engraver
@@ -58,7 +58,7 @@ identical, it tells the @code{Thread_devnull_engraver} to discard
 everything in the second thread.
 ",
 /* creats*/       "",
-/* accepts */     "general-music",
+/* accepts */     "",
 /* acks  */      "grob-interface",
 /* reads */       "",
 /* write */       "");
index 64d17c63ffa84421325fff861a054e0b46687e71..31ef2079ba229f06a2cb40e488a303c13860e5b6 100644 (file)
@@ -7,8 +7,8 @@
   
  */
 
-#include "command-request.hh"
-#include "musical-request.hh"
+
+#include "request.hh"
 #include "tie.hh"
 #include "translator-group.hh"
 #include "spanner.hh"
index d76b71c4d8ebb06c0368943540e6ee7131b9a586..f1531ea677a166e11fcf5b4d74590838b56598b9 100644 (file)
@@ -7,9 +7,9 @@
   
  */
 
-#include "command-request.hh"
+
 #include "audio-item.hh"
-#include "musical-request.hh"
+#include "request.hh"
 #include "pqueue.hh"
 #include "performer.hh"
 
index cbba1e4f03e449051456cdd6328133982015cc28..35f0eef493967388fa4fb239c944873d60e7bc2b 100644 (file)
@@ -9,9 +9,9 @@
 
 #include "time-scaled-music-iterator.hh"
 #include "time-scaled-music.hh"
-#include "musical-request.hh"
+#include "request.hh"
 #include "translator-group.hh"
-#include "command-request.hh"
+
 
 void
 Time_scaled_music_iterator::process (Moment m)
index d761129066a78f5e57b9f22198a31f8611f4aff5..11bc922e4c8e5008816bbb2d26ba754df60925ad 100644 (file)
@@ -7,7 +7,7 @@
 */
 
 #include "time-signature.hh"
-#include "command-request.hh"
+
 #include "engraver.hh"
 #include "engraver-group-engraver.hh"
 
index e9a556807c497a28903693be1e7d84043de49052..482a9d75071549c32d977ff85b81537ab2d505f6 100644 (file)
@@ -67,4 +67,4 @@ Time_signature_performer::stop_translation_timestep ()
     }
 }
 
-ENTER_DESCRIPTION(Time_signature_performer,"","","general-music","","","");
+ENTER_DESCRIPTION(Time_signature_performer,"","","","","","");
index 741956cbf315114c03b38edd4ed0ae2fb05b4aac..7150ca4699b406fe2b5b21730599fdf9c203231c 100644 (file)
@@ -6,7 +6,7 @@
   (c)  1997--2002 Han-Wen Nienhuys <hanwen@cs.uu.nl>
 */
 #include "translator-group.hh"
-#include "command-request.hh"
+
 #include "grob-info.hh"
 #include "multi-measure-rest.hh"
 #include "timing-translator.hh"
@@ -95,7 +95,7 @@ Normally in @code{Score}.  In order to create polyrhythmic music,
 this engraver should be removed from @code{Score} and placed in
 @code{Staff}.",
 /* creats*/       "",
-/* accepts */     "general-music",
+/* accepts */     "",
 /* acks  */      "",
 /* reads */       "timeSignatureFraction barNonAuto whichBar barAlways defaultBarType skipBars timing oneBeat measureLength measurePosition currentBarNumber",
 /* write */       "");
index 01a67a8effdd152e9eb3fb850f9bd2f4ad002c15..d72039957259c3f62d04496ba5e7e9d1175e09d5 100644 (file)
@@ -9,7 +9,7 @@
 
 #include "warn.hh"
 #include "timing-translator.hh"
-#include "command-request.hh"
+
 #include "translator-group.hh"
 #include "global-translator.hh"
 #include "multi-measure-rest.hh"
@@ -152,4 +152,4 @@ Timing_translator::start_translation_timestep ()
   daddy_trans_->set_property ("measurePosition", measposp.smobbed_copy ());
 }
 
-ENTER_DESCRIPTION(Timing_translator,"","","general-music","","","");
+ENTER_DESCRIPTION(Timing_translator,"","","","","","");
index 68313e84922799f4d387cff66c31b83c1a730b47..891d809f61c74da8ffa24b458780d7bd692cd029 100644 (file)
@@ -8,7 +8,7 @@
  */
 
 
-#include "command-request.hh"
+
 #include "tuplet-bracket.hh"
 #include "note-column.hh"
 #include "time-scaled-music.hh"
@@ -23,7 +23,7 @@ public:
   TRANSLATOR_DECLARATIONS(Tuplet_engraver);
 
 protected:
-  Link_array<Time_scaled_music> time_scaled_musics_;
+  Link_array<Music> time_scaled_musics_;
   /// when does the scaled music stop? Array order is synced with time_scaled_musics_
   Array<Rational> stop_moments_;
   /// when does the current spanner stop? Array order is synced with time_scaled_musics_
@@ -40,18 +40,12 @@ protected:
 };
 
 bool
-Tuplet_engraver::try_music (Music *r)
+Tuplet_engraver::try_music (Music *c)
 {
-#if 1
-  if (Time_scaled_music * c = dynamic_cast<Time_scaled_music *> (r))
-    {
-      Music *el = c->element ();
-#else    
-  if (r->is_mus_type ("time-scaled-music"))
+  if (c->is_mus_type ("time-scaled-music"))
     {
       Music *el = unsmob_music (c->get_mus_property ("element"));
-#endif
-      if (!dynamic_cast<Request_chord*> (el))
+      if (el && !el->is_mus_type ("request-chord"))
        {
          time_scaled_musics_.push (c);
          Rational m = now_mom ().main_part_ + c->length_mom ().main_part_;
index 0c77e982a96c46409871fc8d4d200a6ba7240001..dbdf93f488b916bba2a356ac511103fecfbf9ed8 100644 (file)
@@ -7,7 +7,7 @@
 */
 
 #include "translator.hh"
-#include "musical-request.hh"
+#include "request.hh"
 
 class Skip_req_swallow_translator : public virtual Translator
 {
index a607a32f3c6b8688851e8467cbf17a089bef1161..9c2ac952ca90fa5c824d73990da4c12b4aff0afc 100644 (file)
@@ -69,7 +69,7 @@ Vertical_align_engraver::acknowledge_grob (Grob_info i)
 ENTER_DESCRIPTION(Vertical_align_engraver,
 /* descr */       "Catch Vertical axis groups and stack them.",
 /* creats*/       "VerticalAlignment",
-/* accepts */     "general-music",
+/* accepts */     "",
 /* acks  */      "axis-group-interface",
 /* reads */       "",
 /* write */       "");
index e8a5a3aa1593c44ccb7df45d87e7c1e2665330b0..084d6584470b7519aef2c130007ca22145fc2680 100644 (file)
@@ -8,7 +8,7 @@
 
 #include "engraver.hh"
 #include "item.hh"
-#include "musical-request.hh"
+#include "request.hh"
 #include "translator-group.hh"
 
 class Voice_devnull_engraver : public Engraver
@@ -22,7 +22,14 @@ protected:
 };
 
 
+/*
+
+ARGH .
+
+
+This really sucks.
 
+ */
 static char const *eat_spanners[] = {
   "beam",
   "crescendo",
@@ -49,9 +56,9 @@ Voice_devnull_engraver::try_music (Music *m)
          && (to_boolean (get_property ("unison"))
              || to_boolean (get_property ("unisilence")))))
     {
-      if (Span_req *s = dynamic_cast <Span_req *> (m))
+      if (m->is_mus_type ("span-event"))
        {
-         SCM t = s->get_mus_property ("span-type");
+         SCM t = m->get_mus_property ("span-type");
         
          for (char const **p = eat_spanners; *p; p++)
            {
@@ -123,7 +130,7 @@ Voice_devnull_engraver::Voice_devnull_engraver(){}
 ENTER_DESCRIPTION(Voice_devnull_engraver,
 /* descr */       "Kill off certain items and spanners if we're Voice `two' and unison or unisilence is set.",
 /* creats*/       "",
-/* accepts */     "general-music tie-event",
+/* accepts */     "general-music", /*UGH.*/
 /* acks  */      "grob-interface",
 /* reads */       "",
 /* write */       "");
index fd65be42e0d7748a9c960a81f8f3558d4b52ade6..14acbf424988385df472c7fda26b860d602114b9 100644 (file)
@@ -211,7 +211,7 @@ Volta_engraver::stop_translation_timestep ()
 ENTER_DESCRIPTION(Volta_engraver,
 /* descr */       "Make volta brackets",
 /* creats*/       "VoltaBracket",
-/* accepts */     "general-music",
+/* accepts */     "",
 /* acks  */      "bar-line-interface staff-symbol-interface note-column-interface",
 /* reads */       "repeatCommands voltaSpannerDuration stavesFound",
 /* write */       "");
index 1a4144f3c37972abe4ecbe30e510cd6351db8006..46b042197d2f5881e8471ae2243e9b6df44389c0 100644 (file)
        ))
     ))
 
-(define (engraver-makes-grob? name-symbol grav)
-  (memq name-symbol (assoc 'grobs-created (ly-translator-description grav)))
-  )
-
 (define (all-grobs-doc)
   (make <texi-node>
     #:name "All Graphical objects"
index aac8ed15e21a67abfd9a84fcd9bba4fd5f938c16..a6cd45000e414a4dd80c9cbe09e37dfe50815f44 100644 (file)
@@ -7,10 +7,23 @@
 ;;; Jan Nieuwenhuizen <janneke@gnu.org>
 
 
+(define (engraver-makes-grob? name-symbol grav)
+  (memq name-symbol (assoc 'grobs-created (ly-translator-description grav)))
+  )
 
+(define (engraver-accepts-music-type? name-symbol grav)
+  (memq name-symbol (assoc 'events-accepted (ly-translator-description grav)))
+
+  )
+
+(define (engraver-accepts-music-types? types grav)
+  (if (null? types)
+      #f
+      (or
+       (engraver-accepts-music-type? (car types) grav)
+       (engraver-accepts-music-types? (cdr types) grav)))
+  )
 
-;; First level Engraver description and
-;; second level Context description
 (define (engraver-doc-string engraver)
   (let* (
         (propsr (cdr (assoc 'properties-read (ly-translator-description engraver))))
index 5be708e768b6a7de2ecf8d8ba3cbf63e8f50e0f9..af39ea764182978e3cb510ae7417d087997aaefe 100644 (file)
@@ -1,6 +1,4 @@
 
-
-
 (define (music-props-doc)
   (make <texi-node>
     #:name "Music properties"
@@ -20,7 +18,7 @@
 (map (lambda (entry)
        (let*
           (
-           (types (assoc 'types (cdr entry) ))
+           (types (cdr (assoc 'types (cdr entry) )))
            )
         (map (lambda (type)
                (hashq-set! music-types->names type
@@ -37,7 +35,6 @@
   "Convert table t to list"
   (apply append
         (vector->list t)
-  
   ))
 
 (define (strip-description x)
       (sort
        (map (lambda (x) (ref-ify (symbol->string x)))
             (cdr entry)) string<?))
+
+     "\n\nAccepted by: "
+     (human-listify
+      (map ref-ify
+      (map ly-translator-name
+          (filter-list
+           (lambda (x) (engraver-accepts-music-type? (car entry) x)) all-engravers-list))))
      "\n\n"
      )))
 
          (hash-table->alist music-types->names) alist<?))
     ))
 
-(define (music-object-doc obj)
-  (make <texi-node>
-    #:name (symbol->string (car obj))
-    #:text (string-append
-     (object-property (car obj) 'music-description)
+(define (music-doc-str obj)
+  (let*
+      (
+       (namesym  (car obj))
+       (props (cdr obj))
+       (types (cdr (assoc  'types props)))
+       )
+    
+    (string-append
+     (object-property namesym 'music-description)
+     "\n\nMusic types:\n"
+     (human-listify (map ref-ify (map symbol->string types)))
+     "\n\n"
+     "\n\nAccepted by: "
+     (human-listify
+      (map ref-ify
+      (map ly-translator-name
+          (filter-list
+           (lambda (x) (engraver-accepts-music-types? types x)) all-engravers-list))))
      "\n\nProperties: \n"
      (description-list->texi
       (map
-       (lambda (x) (document-property x 'music (cdr obj)))
-       (map car (cdr obj))))
-     ))
-)
+       (lambda (x) (document-property x 'music props))
+       (map car props)))
+     
+     )
+    ))
+
+(define (music-object-doc obj)
+  (make <texi-node>
+    #:name (symbol->string (car obj))
+    #:text (music-doc-str obj)
+    ))
 
 (define (music-expressions-doc)
   (make <texi-node>
      (map music-object-doc music-descriptions)
   ))
   
-
 (define (music-doc-node)
   (make <texi-node>
     #:name "Music definitions"
index b2392bd2c2d03a5fed2440dd8dfc9f544294fbee..b3d31c8d7acc59f18f58ca431e93d269a450ee27 100644 (file)
@@ -4,7 +4,7 @@
     (AbortEvent
      . (
        (description .  "Abort currently running spanners.")
-       (internal-class-name . "Span_req")
+       (internal-class-name . "Request")
        (span-type . "abort")
        (types . (general-music event abort-event))
        ))
        (internal-class-name .  "Request")
        (types . (general-music arpeggio-event event))
        ))
+
+    ;; todo: use articulation-event for slur as well.
+    ;; separate non articulation scripts  
     (ArticulationEvent
      . (
        (description .  "")
 
-       (internal-class-name . "Articulation_req")
+       (internal-class-name . "Request")
        (types . (general-music event articulation-event script-event))
        )) 
+       (AutoChangeMusic
+     . (
+       (description .  "")
+
+       (internal-class-name . "Music_wrapper")
+       (iterator-ctor . ,Auto_change_iterator::constructor)
+       (types . (general-music music-wrapper-music auto-change-instruction))
+       ))
+     (BarCheck
+      . (
+       (description .  "")
+
+        (internal-class-name . "Music")
+        (types . (general-music bar-check))
+        (iterator-ctor . ,Bar_check_iterator::constructor)
+        ))
     (BassFigureEvent
      . (
        (description .  "")
        (internal-class-name . "Request")
        (types . (general-music event busy-playing-event))
        )) 
-    (ExtenderEvent
+    (ContextSpeccedMusic
+     . (
+       (description .  "")
+
+       (internal-class-name . "Context_specced_music")
+       (types . (context-specification general-music music-wrapper-music))
+       ))
+   (CrescendoEvent
+     . (
+       (description .  "")
+
+       (internal-class-name . "Request")
+       (types . (general-music dynamic-event crescendo-event event))
+       )) 
+    (DecrescendoEvent
+     . (
+       (description .  "")
+
+       (internal-class-name . "Request")
+       (types . (general-music dynamic-event decrescendo-event event))
+       )) 
+   (ExtenderEvent
      . (
        (description .  "")
 
        (internal-class-name . "Key_change_req")
        (types . (general-music key-change-event event))
        )) 
-    (LyricEvent
+      (LyricCombineMusic
      . (
        (description .  "")
 
-       (internal-class-name . "Lyric_req")
-       (types . (general-music rhythmic-event event))
+       (internal-class-name . "Lyric_combine_music")
+       (types . (general-music lyric-combine-music))
+       (iterator-ctor . ,Lyric_combine_music_iterator::constructor)
+       ))
+
+  (LyricEvent
+     . (
+       (description .  "A lyric syllable. Must be entered in lyrics mode, i.e.
+@code{\lyrics @{ twinkle4 twinkle4 @} } .")
+
+       (length . ,music-duration-length) 
+       (compress-procedure . ,music-duration-compress)
+       (internal-class-name . "Request")
+       (types . (general-music rhythmic-event lyric-event event))
        ))
     (LigatureEvent
      . (
        (internal-class-name . "Request")
        (types . (general-music event))
        ))
+    (MultiMeasureRestEvent
+     . (
+       (description . "Rests that may be compressed into Multi rests. Syntax
+@code{R2.*4} for 4 measures in 3/4 time. Note the capital R.")
+       (internal-class-name . "Request")
+       (types . (general-music event multi-measure-rest-event))
+       ))
     (Music
      . (
        (description .  "")
        (compress-procedure . ,music-duration-compress)
        (types . (general-music event note-event rhythmic-event melodic-event))
        ))
-    (PorrectusEvent
+ (OverrideProperty
+      . (
+       (description .  "")
+
+        (internal-class-name . "Music")
+        (types . (general-music layout-instruction))
+        (iterator-ctor . ,     Push_property_iterator::constructor)
+        ))
+
+ (PartCombineMusic
      . (
        (description .  "")
 
-       (internal-class-name . "Porrectus_req")
-       (types . (general-music event))
+       (internal-class-name . "Part_combine_music")
+       (types . (general-music part-combine-music))
+       (iterator-ctor . ,Part_combine_music_iterator::constructor)
+     ))
+      (PhrasingSlurEvent
+     . (
+       (description . "Start or end phrasing slur. Syntax NOTE \(  and \) NOTE")
+       (internal-class-name . "Request")
+       (types . (general-music span-event phrasing-slur-event slur-event))
+       ))
+    (PropertySet
+     . (
+       (description .  "")
+       (internal-class-name . "Music")
+       (types . (layout-instruction general-music))
+       (iterator-ctor . ,Property_iterator::constructor)
+       )
+     )
+     (PropertyUnset
+     . (
+       (description .  "")
+
+       (internal-class-name . "Music")
+       (types . (layout-instruction general-music))
+       (iterator-ctor . ,Property_unset_iterator::constructor)
+       )
+     )
+     (PorrectusEvent
+     . (
+       (description .  "")
+
+       (internal-class-name . "Request")
+       (types . (general-music porrectus-event event))
        ))
     (RepeatedMusic
      . (
 
        (internal-class-name . "Repeated_music")
        (type .  repeated-music)
-       (types . (general-music repeat-music))
+       (types . (general-music repeated-music))
        ))
     (Request
      . (
        (compress-procedure . ,music-duration-compress)
        (types . (general-music event rhythmic-event rest-event))
        )) 
-    (RhythmicEvent
-     . (
-       (description .  "")
-
-       (internal-class-name . "Rhythmic_req")
-       (length . ,music-duration-length) 
-       (compress-procedure . ,music-duration-compress)
-       (types . (general-music rhythmic-event  event))
-       )) 
     (SequentialMusic
      . (
-       (description .  "")
+       (description .  "Music expressions concatenated. Syntax \sequential @{..@} or simply @{..@} .")
 
        (internal-class-name . "Sequential_music")
        (iterator-ctor . ,Sequential_music_iterator::constructor)
        ))
     (SimultaneousMusic
      . (
-       (description .  "")
+       (description .  "Music playing together. Syntax: \simultaneous @{ .. @} or < .. >.")
 
        (internal-class-name . "Simultaneous_music")
        (iterator-ctor . ,Simultaneous_music_iterator::constructor)
        
        (types . (general-music simultaneous-music))
        ))
-    (PropertySet
-     . (
-       (description .  "")
-
-       (internal-class-name . "Music")
-       (types . (layout-instruction general-music))
-       (iterator-ctor . ,Property_iterator::constructor)
-       )
-     )
-     (PropertyUnset
+    (SlurEvent
      . (
-       (description .  "")
-
-       (internal-class-name . "Music")
-       (types . (layout-instruction general-music))
-       (iterator-ctor . ,Property_unset_iterator::constructor)
-       )
-     )
-     (VoiceSeparator
-      . (
-       (description .  "")
-
-        (internal-class-name . "Music")
-        (types . (separator general-music))
-        ))
-     (BarCheck
-      . (
-       (description .  "")
-
-        (internal-class-name . "Music")
-        (types . (general-music bar-check))
-        (iterator-ctor . ,Bar_check_iterator::constructor)
-        ))
-     (OverrideProperty
-      . (
-       (description .  "")
+       (description . "Start or end slur. Syntax NOTE(  and )NOTE")
+       (internal-class-name . "Request")
+       (types . (general-music span-event slur-event))
+       ))
 
-        (internal-class-name . "Music")
-        (types . (general-music layout-instruction))
-        (iterator-ctor . ,     Push_property_iterator::constructor)
-        ))
-     (RevertProperty
+    (RevertProperty
       . (
        (description .  "")
 
        (iterator-ctor . ,Output_property_music_iterator::constructor)
        (types . (general-music layout-instruction))
        ))
-    (ContextSpeccedMusic
+   
+    (TextSpanEvent
      . (
-       (description .  "")
-
-       (internal-class-name . "Context_specced_music")
-       (types . (context-specification general-music music-wrapper-music))
-       ))
-    (AutoChangeMusic
-     . (
-       (description .  "")
-
-       (internal-class-name . "Music_wrapper")
-       (iterator-ctor . ,Auto_change_iterator::constructor)
-       (types . (general-music music-wrapper-music auto-change-instruction))
+       (description . "Start a text spanner like 8va.....|")
+       (internal-class-name . "Request")
+       (types . (general-music span-event text-span-event))
        ))
     (TranslatorChange
      . (
     (TimeScaledMusic
      . (
        (description .  "")
-
        (internal-class-name . "Time_scaled_music")
        (iterator-ctor . ,Time_scaled_music_iterator::constructor)
        (types . (time-scaled-music music-wrapper-music general-music))
        (types . (music-wrapper-music general-music relative-octave-music))
        ))
 
-    (LyricCombineMusic
-     . (
-       (description .  "")
-
-       (internal-class-name . "Lyric_combine_music")
-       (types . (general-music lyric-combine-music))
-       (iterator-ctor . ,Lyric_combine_music_iterator::constructor)
-       ))
-
-    (PartCombineMusic
-     . (
-       (description .  "")
-
-       (internal-class-name . "Part_combine_music")
-       (types . (general-music part-combine-music))
-       (iterator-ctor . ,Part_combine_music_iterator::constructor)
-     ))
+  
     (RequestChord
      . (
        (description .  "")
 
        (internal-class-name . "Request_chord")
        (iterator-ctor . ,Request_chord_iterator::constructor)
-       (types . (general-music simultaneous-music))
+       (types . (general-music request-chord simultaneous-music))
        )
      )
      
      . (
        (description .  "")
 
-       (internal-class-name . "Script_req")
+       (internal-class-name . "Request")
        (types . (general-music event))
        )) 
     (SkipEvent
        (types . (general-music event rhythmic-event skip-event))
        )) 
     (SpanEvent
-     . (
-       (description .  "")
-
-       (internal-class-name . "Span_req")
-       (types . (general-music event))
-       )) 
-    (DecrescendoEvent
-     . (
-       (description .  "")
-
-       (internal-class-name . "Request")
-       (types . (general-music dynamic-event decrescendo-event event))
-       )) 
-    (CrescendoEvent
      . (
        (description .  "")
 
        (internal-class-name . "Request")
-       (types . (general-music dynamic-event crescendo-event event))
+       (types . (general-music event))
        )) 
+    (SustainPedalEvent
+      . (
+        (description . "")
+        (internal-class-name . "Request")
+        (types . (general-music pedal-event sustain-pedal-event))
+        ))
+    (SostenutoEvent
+      . (
+        (description . "")
+        (internal-class-name . "Request")
+        (types . (general-music pedal-event sostenuto-pedal-event))
+        ))
+    (UnaCordaEvent
+      . (
+        (description . "")
+        (internal-class-name . "Request")
+        (types . (general-music pedal-event una-corda-pedal-event))
+        ))
     (StringNumberEvent
      . (
        (description .  "")
     (TextScriptEvent
      . (
        (description .  "")
-       (internal-class-name . "Text_script_req")
+       (internal-class-name . "Request")
        (types . (general-music script-event text-script-event event))
        )) 
     (TieEvent
        (internal-class-name . "Request")
        (types . (general-music tie-event event))
        ))
+    (TremoloEvent
+     . (
+       (description . "Un measured tremolo.")
+       (internal-class-name . "Request")
+       (types . (general-music event tremolo-event))
+       ))
+     (VoiceSeparator
+      . (
+       (description .  "")
+
+        (internal-class-name . "Music")
+        (types . (separator general-music))
+        ))
+    
     ))
 
 (set! music-descriptions
     (ly-make-bare-music name props)
   ))
 
+
+(define-public (old-span-request->event name)
+  (let
+      (
+       (entry   (assoc
+        name
+        '(
+          ("text" . TextSpanEvent)
+          ("decrescendo" . DecrescendoEvent)
+          ("crescendo" . CrescendoEvent)
+          ("Sustain" . SustainPedalEvent)
+          ("UnaCorda" . UnaCordaEvent)
+          ("Sostenuto" . SostenutoEvent)
+          )))
+       )
+    (if (eq? entry #f)
+       (error (format "Could not find span type ~a" name))
+       
+       (make-music-by-name (cdr entry))
+       )
+  ))