]> git.donarmstrong.com Git - lilypond.git/commitdiff
Remove Swallow_engraver/performer and *_swallow_translators.
authorNeil Puttock <n.puttock@gmail.com>
Tue, 15 Dec 2009 17:34:32 +0000 (17:34 +0000)
committerNeil Puttock <n.puttock@gmail.com>
Tue, 15 Dec 2009 17:34:32 +0000 (17:34 +0000)
These translators are no longer required, since unlistened events do not
generate `event junked' warnings.

12 files changed:
Documentation/snippets/engravers-one-by-one.ly
Documentation/web/examples/orchestra.ly
input/regression/spacing-to-empty-barline.ly
lily/include/lily-proto.hh
lily/include/type-swallow-translator.hh [deleted file]
lily/string-number-engraver.cc [deleted file]
lily/swallow-engraver.cc [deleted file]
lily/swallow-perf.cc [deleted file]
lily/type-swallow-translator.cc [deleted file]
ly/engraver-init.ly
ly/performer-init.ly
python/convertrules.py

index ea29815e2e4f83805ed8588d90c99e6ff51e26b7..e3cec2073d8ea254cb5ba51deeea974064c58fbd 100644 (file)
@@ -68,7 +68,7 @@ context.
 
 
 You may only see the first example in this document; please download
-this snippet and run it from your own computer. 
+this snippet and run it from your own computer.
 
 "
   doctitle = "Engravers one-by-one"
@@ -95,7 +95,7 @@ hoom =  \relative c {
   \key d \major
   \clef bass
   g8-. r
-  r4 
+  r4
   fis8-.
   r8
   r4
@@ -122,13 +122,13 @@ MyStaff =\context {
   \description "Handles clefs, bar lines, keys, accidentals.  It can contain
 @code{Voice} contexts."
 
-  
-  \consists "Output_property_engraver" 
-  
+
+  \consists "Output_property_engraver"
+
   \consists "Font_size_engraver"
 
   \consists "Volta_engraver"
-  \consists "Separating_line_group_engraver"   
+  \consists "Separating_line_group_engraver"
   \consists "Dot_column_engraver"
 
   \consists "Ottava_spanner_engraver"
@@ -144,16 +144,16 @@ MyStaff =\context {
 
   \override VerticalAxisGroup #'minimum-Y-extent = #'(-6 . 6)
   extraVerticalExtent = ##f
-  verticalExtent = ##f 
+  verticalExtent = ##f
   localKeySignature = #'()
 
-                               % explicitly set instrument, so we don't get 
+                               % explicitly set instrument, so we don't get
                                % weird effects when doing instrument names for
                                % piano staves
 
   instrumentName = #'()
   shortInstrumentName = #'()
-  
+
   \accepts "Voice"
 }
 
@@ -172,9 +172,9 @@ MyVoice = \context {
 
   localKeySignature = #'()
   \consists "Font_size_engraver"
-  
+
                                % must come before all
-  \consists "Output_property_engraver" 
+  \consists "Output_property_engraver"
   \consists "Arpeggio_engraver"
   \consists "Multi_measure_rest_engraver"
   \consists "Text_spanner_engraver"
@@ -207,7 +207,6 @@ MyVoice = \context {
   \consists "Note_heads_engraver"
   \consists "Rest_engraver"
 
-  \consists "Skip_event_swallow_translator"
 }
 
 
@@ -305,7 +304,7 @@ MyStaff = \context {
 
 MyStaff = \context {
   \MyStaff
-  \consists "Accidental_engraver"    
+  \consists "Accidental_engraver"
   \consists "Key_engraver"
 }
 \score {
index 84463d9e4a96a3b4fb9cb7c5fc139981a25407dc..2c9ce28472675769a0493092490b8de44088e1a8 100644 (file)
@@ -56,7 +56,6 @@ offCr = {
     \name Dynamics
     \alias Voice
     \consists "Output_property_engraver"
-    \consists "Skip_event_swallow_translator"
     \consists "Axis_group_engraver"
     \consists "Piano_pedal_engraver"
     pedalSustainStrings = #'("Ped." "*Ped." "*")
@@ -179,7 +178,7 @@ modern =
 #`(Staff ,(make-accidental-rule 'same-octave 0)
   ,(make-accidental-rule 'any-octave 0)
   ,(make-accidental-rule 'same-octave 1))
-         
+
 \layout {
   \context {
     \Score
@@ -353,7 +352,7 @@ R2. |
     c2.:32\pp\< ~ | c: ~ |
     c8\!\ff \offCr r r r4 r8 | R2. |
     \time 9/8
-    c2.:32\pp ~ c4.: | 
+    c2.:32\pp ~ c4.: |
   }
 
   harprh = \relative c'' {
index af26d8e5ca450f656b5ee70b3abbd1eacaafe732..069b482433e46252b6573940af43f270c619bf2c 100644 (file)
@@ -17,7 +17,6 @@ The two scores should look approximately the same."
     \type "Engraver_group"
     \consists "Output_property_engraver"
     \consists "Bar_engraver"
-    \consists "Skip_event_swallow_translator"
     \consists "Axis_group_engraver"
 
     \override VerticalAxisGroup #'Y-extent = ##f
index 078460bccc966bae9beab267d9e7a689e0a8f56c..138328a26be31495a20a83292c8a3f4705c93fd2 100644 (file)
@@ -177,8 +177,6 @@ class Staff_group_bar_engraver;
 class Staff_performer;
 class Stencil;
 class Stream_event;
-class Swallow_engraver;
-class Swallow_performer;
 class System;
 class Tempo_performer;
 class Tie;
@@ -196,7 +194,6 @@ class Translator;
 class Translator_change;
 class Translator_group;
 class Transposed_music;
-class Type_swallow_translator;
 class yyFlexLexer;
 
 typedef void (*Engraver_void_function_engraver_grob_info) (Engraver *, Grob_info);
diff --git a/lily/include/type-swallow-translator.hh b/lily/include/type-swallow-translator.hh
deleted file mode 100644 (file)
index 2d63ee4..0000000
+++ /dev/null
@@ -1,55 +0,0 @@
-/*
-  This file is part of LilyPond, the GNU music typesetter.
-
-  Copyright (C) 1997--2009 Han-Wen Nienhuys <hanwen@xs4all.nl>
-
-  LilyPond is free software: you can redistribute it and/or modify
-  it under the terms of the GNU General Public License as published by
-  the Free Software Foundation, either version 3 of the License, or
-  (at your option) any later version.
-
-  LilyPond is distributed in the hope that it will be useful,
-  but WITHOUT ANY WARRANTY; without even the implied warranty of
-  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-  GNU General Public License for more details.
-
-  You should have received a copy of the GNU General Public License
-  along with LilyPond.  If not, see <http://www.gnu.org/licenses/>.
-*/
-
-#ifndef TYPESWALLOW_TRANSLATOR_HH
-#define TYPESWALLOW_TRANSLATOR_HH
-
-#include "translator.hh"
-
-/** eat a certain type of event
-    (Duh, it's good for your skin)
-*/
-class Type_swallow_translator : public Translator
-{
-protected:
-  string swallow_string_;
-  bool try_music (Music *);
-public:
-  VIRTUAL_COPY_CONS (Translator);
-};
-
-#define DECLARE_EVENT_SWALLOWER(TYPE)                                  \
-  struct TYPE ## _swallow_translator : public Type_swallow_translator  \
-  {                                                                    \
-    TRANSLATOR_DECLARATIONS (TYPE ## _swallow_translator);             \
-  };                                                                   \
-  TYPE ## _swallow_translator ::TYPE ## _swallow_translator ()         \
-  {                                                                    \
-    swallow_string_ = #TYPE;                                           \
-  }                                                                    \
-  ADD_TRANSLATOR (TYPE ## _swallow_translator,                         \
-                 "Swallow events of " #TYPE " type.",                  \
-                 "",                                                   \
-                 "general-music",                                      \
-                 "",                                                   \
-                 "",                                                   \
-                 "");
-
-#endif // TYPESWALLOW_TRANSLATOR_HH
-
diff --git a/lily/string-number-engraver.cc b/lily/string-number-engraver.cc
deleted file mode 100644 (file)
index 3ae5469..0000000
+++ /dev/null
@@ -1,63 +0,0 @@
-/*
-  This file is part of LilyPond, the GNU music typesetter.
-
-  Copyright (C) 2005--2009 Han-Wen Nienhuys <hanwen@xs4all.nl>
-
-  LilyPond is free software: you can redistribute it and/or modify
-  it under the terms of the GNU General Public License as published by
-  the Free Software Foundation, either version 3 of the License, or
-  (at your option) any later version.
-
-  LilyPond is distributed in the hope that it will be useful,
-  but WITHOUT ANY WARRANTY; without even the implied warranty of
-  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-  GNU General Public License for more details.
-
-  You should have received a copy of the GNU General Public License
-  along with LilyPond.  If not, see <http://www.gnu.org/licenses/>.
-*/
-
-#include "engraver.hh"
-
-//  Junk String numbers.
-class String_number_engraver : public Engraver
-{
-public:
-  TRANSLATOR_DECLARATIONS (String_number_engraver);
-protected:
-  virtual bool try_music (Music *m);
-};
-
-bool
-String_number_engraver::try_music (Music *)
-{
-  return true;
-}
-
-String_number_engraver::String_number_engraver ()
-{
-}
-
-/*
-  TODO: string numbers are printed right of the note circled. This
-  engraver should provide this functionality.
-*/
-
-#include "translator.icc"
-
-ADD_TRANSLATOR (String_number_engraver,
-               /* doc */
-               "Swallow string number events.  The purpose of this engraver"
-               " is to process tablatures for normal notation.  To provent"
-               " warnings for unprocessed string number events to obscure"
-               " real error messages, this engraver swallows them all.",
-
-               /* create */
-               "",
-
-               /* read */
-               "",
-
-               /* write */
-               ""
-               );
diff --git a/lily/swallow-engraver.cc b/lily/swallow-engraver.cc
deleted file mode 100644 (file)
index 97592a5..0000000
+++ /dev/null
@@ -1,56 +0,0 @@
-/*
-  This file is part of LilyPond, the GNU music typesetter.
-
-  Copyright (C) 1997--2009 Han-Wen Nienhuys <hanwen@xs4all.nl>
-
-  LilyPond is free software: you can redistribute it and/or modify
-  it under the terms of the GNU General Public License as published by
-  the Free Software Foundation, either version 3 of the License, or
-  (at your option) any later version.
-
-  LilyPond is distributed in the hope that it will be useful,
-  but WITHOUT ANY WARRANTY; without even the implied warranty of
-  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-  GNU General Public License for more details.
-
-  You should have received a copy of the GNU General Public License
-  along with LilyPond.  If not, see <http://www.gnu.org/licenses/>.
-*/
-
-#include "engraver.hh"
-
-class Swallow_engraver : public Engraver
-{
-public:
-  TRANSLATOR_DECLARATIONS (Swallow_engraver);
-protected:
-  bool try_music (Music *);
-};
-
-bool
-Swallow_engraver::try_music (Music *)
-{
-  return true;
-}
-
-Swallow_engraver::Swallow_engraver ()
-{
-}
-
-#include "translator.icc"
-
-ADD_TRANSLATOR (Swallow_engraver,
-               /* doc */
-               "This engraver swallows everything given to it silently."
-               "  The purpose of this is to prevent spurious @q{event junked}"
-               " warnings.",
-
-               /* create */
-               "",
-
-               /* read */
-               "",
-
-               /* write */
-               ""
-               );
diff --git a/lily/swallow-perf.cc b/lily/swallow-perf.cc
deleted file mode 100644 (file)
index 534872e..0000000
+++ /dev/null
@@ -1,57 +0,0 @@
-/*
-  This file is part of LilyPond, the GNU music typesetter.
-
-  Copyright (C) 1997--2009 Han-Wen Nienhuys <hanwen@xs4all.nl>
-
-  LilyPond is free software: you can redistribute it and/or modify
-  it under the terms of the GNU General Public License as published by
-  the Free Software Foundation, either version 3 of the License, or
-  (at your option) any later version.
-
-  LilyPond is distributed in the hope that it will be useful,
-  but WITHOUT ANY WARRANTY; without even the implied warranty of
-  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-  GNU General Public License for more details.
-
-  You should have received a copy of the GNU General Public License
-  along with LilyPond.  If not, see <http://www.gnu.org/licenses/>.
-*/
-
-#include "performer.hh"
-#include "music.hh"
-
-class Swallow_performer : public Performer
-{
-public:
-  TRANSLATOR_DECLARATIONS (Swallow_performer);
-protected:
-  virtual bool try_music (Music *);
-};
-
-bool
-Swallow_performer::try_music (Music *m)
-{
-  if (m->is_mus_type ("melisma-playing-event"))
-    return false;
-  else
-    return true;
-}
-
-Swallow_performer::Swallow_performer ()
-{}
-
-#include "translator.icc"
-
-ADD_TRANSLATOR (Swallow_performer,
-               /* doc */
-               "",
-
-               /* create */
-               "",
-
-               /* read */
-               "",
-
-               /* write */
-               ""
-               );
diff --git a/lily/type-swallow-translator.cc b/lily/type-swallow-translator.cc
deleted file mode 100644 (file)
index 52ebb4b..0000000
+++ /dev/null
@@ -1,103 +0,0 @@
-/*
-  This file is part of LilyPond, the GNU music typesetter.
-
-  Copyright (C) 1997--2009 Han-Wen Nienhuys <hanwen@xs4all.nl>
-
-  LilyPond is free software: you can redistribute it and/or modify
-  it under the terms of the GNU General Public License as published by
-  the Free Software Foundation, either version 3 of the License, or
-  (at your option) any later version.
-
-  LilyPond is distributed in the hope that it will be useful,
-  but WITHOUT ANY WARRANTY; without even the implied warranty of
-  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-  GNU General Public License for more details.
-
-  You should have received a copy of the GNU General Public License
-  along with LilyPond.  If not, see <http://www.gnu.org/licenses/>.
-*/
-
-#include "translator.hh"
-#include "music.hh"
-
-#include "translator.icc"
-
-class Skip_event_swallow_translator : public Translator
-{
-protected:
-  virtual bool try_music (Music *) { return true; }
-
-public:
-  TRANSLATOR_DECLARATIONS (Skip_event_swallow_translator);
-};
-
-class Rest_swallow_translator : public Translator
-{
-protected:
-  virtual bool try_music (Music *) { return true; }
-
-public:
-  TRANSLATOR_DECLARATIONS (Rest_swallow_translator);
-};
-
-Skip_event_swallow_translator::Skip_event_swallow_translator ()
-{
-}
-
-ADD_TRANSLATOR (Skip_event_swallow_translator,
-               /* doc */
-               "Swallow @code{\\skip}.",
-
-               /* create */
-               "",
-
-               /* read */
-               "",
-
-               /* write */
-               ""
-               );
-
-Rest_swallow_translator::Rest_swallow_translator (){}
-
-ADD_TRANSLATOR (Rest_swallow_translator,
-               /* doc */
-               "Swallow rest.",
-
-               /* create */
-               "",
-
-               /* read */
-               "",
-
-               /* write */
-               ""
-               );
-
-class Note_swallow_translator : public Translator
-{
-protected:
-  virtual bool try_music (Music *) { return true; }
-
-public:
-  TRANSLATOR_DECLARATIONS (Note_swallow_translator);
-};
-
-Note_swallow_translator::Note_swallow_translator ()
-{
-}
-
-ADD_TRANSLATOR (Note_swallow_translator,
-               /* doc */
-               "Swallow notes.",
-
-               /* create */
-               "",
-
-               /* read */
-               "",
-
-               /* write */
-               ""
-               );
-
index 36f2c4a49cbab50497e1b16bba1f9b6bec08f54e..d9860d9c6c10731f5ba6aeda034c3004fda34e61 100644 (file)
@@ -34,9 +34,7 @@
   \description "A context for displaying fret diagrams."
 
   \consists "Fretboard_engraver"
-  \consists "Rest_swallow_translator"
   \consists "Output_property_engraver"
-  \consists "Skip_event_swallow_translator"
   \consists "Hara_kiri_engraver"
   \consists "Separating_line_group_engraver"
   \consists "Font_size_engraver"
@@ -73,7 +71,6 @@
   \consists "Piano_pedal_engraver"
   \consists "Piano_pedal_align_engraver"
   \consists "Instrument_name_engraver"
-  \consists "String_number_engraver"
   \consists "Axis_group_engraver"
   \consists "Figured_bass_engraver"
   \consists "Figured_bass_position_engraver"
   \remove "Ottava_spanner_engraver"
   \remove "Key_engraver"
   \remove "Piano_pedal_engraver"
-  \remove "String_number_engraver"
 
   \description "Handles typesetting for percussion."
 
@@ -256,7 +252,6 @@ multiple voices on the same staff."
   \consists "Tuplet_engraver"
   \consists "Grace_engraver"
   \consists "Instrument_switch_engraver"
-  \consists "Skip_event_swallow_translator"
 }
 
 \context{
@@ -289,8 +284,6 @@ multiple voices on the same staff."
   \remove "Fingering_engraver"
 
   \remove "Cluster_spanner_engraver"
-
-  \consists "Skip_event_swallow_translator"
 }
 
 \context{
@@ -376,7 +369,6 @@ a collection of staves, with a bracket in front and spanning bar lines."
   \consists "Dynamic_align_engraver"
   \consists "Text_engraver"
   \consists "Text_spanner_engraver"
-  \consists "Skip_event_swallow_translator"
   \consists "Axis_group_engraver"
 
   pedalSustainStrings = #'("Ped." "*Ped." "*")
@@ -406,7 +398,6 @@ printing of a single line of lyrics."
   \consists "Hyphen_engraver"
   \consists "Stanza_number_engraver"
   \consists "Instrument_name_engraver"
-  \consists "Skip_event_swallow_translator"
   \consists "Font_size_engraver"
   \consists "Hara_kiri_engraver"
 
@@ -437,9 +428,6 @@ printing of a single line of lyrics."
   % FIXME: not sure what the default should be here.
   \override VerticalAxisGroup #'staff-affinity = #DOWN
 
-
-  \consists "Rest_swallow_translator"
-  \consists "Skip_event_swallow_translator"
   \consists "Tie_engraver"
   \consists "Note_name_engraver"
   \consists "Separating_line_group_engraver"
@@ -450,11 +438,9 @@ printing of a single line of lyrics."
   \name ChordNames
   \description "Typesets chord names."
 
-  \consists "Rest_swallow_translator"
   \consists "Output_property_engraver"
   \consists "Separating_line_group_engraver"
   \consists "Chord_name_engraver"
-  \consists "Skip_event_swallow_translator"
   \consists "Hara_kiri_engraver"
 %  \consists "Note_spacing_engraver"
   \override VerticalAxisGroup #'remove-first = ##t
@@ -692,8 +678,6 @@ automatically when an output definition (a @code{\score} or
   \description "A context for printing a figured bass line."
 
   \consists "Figured_bass_engraver"
-  \consists "Note_swallow_translator"
-  \consists "Skip_event_swallow_translator"
   \consists "Separating_line_group_engraver"
   \consists "Hara_kiri_engraver"
 
@@ -711,7 +695,6 @@ automatically when an output definition (a @code{\score} or
 %% don't want to route anything out of here:
   \alias "Staff"
   \alias "Voice"
-  \consists "Swallow_engraver"
   \description "Silently discards all musical information given to this
 context."
 }
@@ -809,7 +792,6 @@ contexts and handles the line spacing, the tablature clef etc. properly."
   \remove "Accidental_engraver"
   \remove "Key_engraver"
 
-  \remove "String_number_engraver"
   \remove "Ottava_spanner_engraver"
   %% the clef handler
   \override Clef #'stencil = #clef::print-modern-tab-if-set
index 8c5b4932591edb401414adf453845d75d2ecae7d..a929bc9d5d8bc864468f0ef75270c713b88cf43c 100644 (file)
@@ -78,7 +78,6 @@
 \context {
   \type "Performer_group"
   \name FiguredBass
-  \consists "Swallow_performer"
 }
 
 \context {
 \context {
   \type "Performer_group"
   \name "Devnull"
-  \consists "Swallow_performer"
 }
+
 \context {
   \Staff
   \name TabStaff
   \consists "Control_track_performer"
   \consists "Tempo_performer"
   \consists "Timing_translator"
-  \consists "Swallow_performer"
 
   \defaultchild "Staff"
 
index 7fb5ef70a27bde73516e0ee968ab92ea6d3b5db1..c6e5b450d987f659313f9f36fc83181148deaded 100644 (file)
@@ -2953,6 +2953,16 @@ you must now specify the distances between staves rather than the offset of stav
                   '', str)
     return str
 
+@rule ((2, 13, 10),
+       _ ("Remove obsolete engravers/translators: Note_swallow_translator,\n\
+Rest_swallow_translator, Skip_event_swallow_translator, Swallow_engraver,\n\
+Swallow_performer and String_number_engraver."))
+def conv(str):
+    str = re.sub (r'\\(consists|remove)\s+"*(Swallow_(engraver|performer)|'
+                  '(Note|Rest|Skip_event)_swallow_translator|String_number_engraver)"*',
+                  '', str)
+    return str
+
 # Guidelines to write rules (please keep this at the end of this file)
 #
 # - keep at most one rule per version; if several conversions should be done,