From: Neil Puttock Date: Tue, 15 Dec 2009 17:34:32 +0000 (+0000) Subject: Remove Swallow_engraver/performer and *_swallow_translators. X-Git-Tag: release/2.13.10-1~176 X-Git-Url: https://git.donarmstrong.com/?a=commitdiff_plain;h=b4459d71ac1a86b73fbae1cb320127a1ed1ed1fb;p=lilypond.git Remove Swallow_engraver/performer and *_swallow_translators. These translators are no longer required, since unlistened events do not generate `event junked' warnings. --- diff --git a/Documentation/snippets/engravers-one-by-one.ly b/Documentation/snippets/engravers-one-by-one.ly index ea29815e2e..e3cec2073d 100644 --- a/Documentation/snippets/engravers-one-by-one.ly +++ b/Documentation/snippets/engravers-one-by-one.ly @@ -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 { diff --git a/Documentation/web/examples/orchestra.ly b/Documentation/web/examples/orchestra.ly index 84463d9e4a..2c9ce28472 100644 --- a/Documentation/web/examples/orchestra.ly +++ b/Documentation/web/examples/orchestra.ly @@ -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'' { diff --git a/input/regression/spacing-to-empty-barline.ly b/input/regression/spacing-to-empty-barline.ly index af26d8e5ca..069b482433 100644 --- a/input/regression/spacing-to-empty-barline.ly +++ b/input/regression/spacing-to-empty-barline.ly @@ -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 diff --git a/lily/include/lily-proto.hh b/lily/include/lily-proto.hh index 078460bccc..138328a26b 100644 --- a/lily/include/lily-proto.hh +++ b/lily/include/lily-proto.hh @@ -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 index 2d63ee4967..0000000000 --- a/lily/include/type-swallow-translator.hh +++ /dev/null @@ -1,55 +0,0 @@ -/* - This file is part of LilyPond, the GNU music typesetter. - - Copyright (C) 1997--2009 Han-Wen Nienhuys - - 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 . -*/ - -#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 index 3ae5469827..0000000000 --- a/lily/string-number-engraver.cc +++ /dev/null @@ -1,63 +0,0 @@ -/* - This file is part of LilyPond, the GNU music typesetter. - - Copyright (C) 2005--2009 Han-Wen Nienhuys - - 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 . -*/ - -#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 index 97592a547d..0000000000 --- a/lily/swallow-engraver.cc +++ /dev/null @@ -1,56 +0,0 @@ -/* - This file is part of LilyPond, the GNU music typesetter. - - Copyright (C) 1997--2009 Han-Wen Nienhuys - - 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 . -*/ - -#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 index 534872e942..0000000000 --- a/lily/swallow-perf.cc +++ /dev/null @@ -1,57 +0,0 @@ -/* - This file is part of LilyPond, the GNU music typesetter. - - Copyright (C) 1997--2009 Han-Wen Nienhuys - - 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 . -*/ - -#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 index 52ebb4bbf9..0000000000 --- a/lily/type-swallow-translator.cc +++ /dev/null @@ -1,103 +0,0 @@ -/* - This file is part of LilyPond, the GNU music typesetter. - - Copyright (C) 1997--2009 Han-Wen Nienhuys - - 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 . -*/ - -#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 */ - "" - ); - diff --git a/ly/engraver-init.ly b/ly/engraver-init.ly index 36f2c4a49c..d9860d9c6c 100644 --- a/ly/engraver-init.ly +++ b/ly/engraver-init.ly @@ -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" @@ -109,7 +106,6 @@ \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 diff --git a/ly/performer-init.ly b/ly/performer-init.ly index 8c5b493259..a929bc9d5d 100644 --- a/ly/performer-init.ly +++ b/ly/performer-init.ly @@ -78,7 +78,6 @@ \context { \type "Performer_group" \name FiguredBass - \consists "Swallow_performer" } \context { @@ -106,8 +105,8 @@ \context { \type "Performer_group" \name "Devnull" - \consists "Swallow_performer" } + \context { \Staff \name TabStaff @@ -156,7 +155,6 @@ \consists "Control_track_performer" \consists "Tempo_performer" \consists "Timing_translator" - \consists "Swallow_performer" \defaultchild "Staff" diff --git a/python/convertrules.py b/python/convertrules.py index 7fb5ef70a2..c6e5b450d9 100644 --- a/python/convertrules.py +++ b/python/convertrules.py @@ -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,