X-Git-Url: https://git.donarmstrong.com/?a=blobdiff_plain;f=lily%2Fhorizontal-bracket-engraver.cc;h=9d5c00503dca8ce6758e623076678a957bee8606;hb=dcca081b1904b4db09658657631d919f280c06d2;hp=30c3ecad1bc7744d2f353ac475d771accf4fa065;hpb=19bb2e8bc9c42b2ffe8dc680bab084597ce6bf64;p=lilypond.git diff --git a/lily/horizontal-bracket-engraver.cc b/lily/horizontal-bracket-engraver.cc index 30c3ecad1b..9d5c00503d 100644 --- a/lily/horizontal-bracket-engraver.cc +++ b/lily/horizontal-bracket-engraver.cc @@ -1,20 +1,30 @@ /* - horizontal-bracket-engraver.cc -- implement - Horizontal_bracket_engraver + This file is part of LilyPond, the GNU music typesetter. - source file of the GNU LilyPond music typesetter + Copyright (C) 2002--2011 Han-Wen Nienhuys - (c) 2002--2007 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" #include "international.hh" +#include "item.hh" #include "note-column.hh" #include "pointer-group-interface.hh" #include "side-position-interface.hh" -#include "stream-event.hh" #include "spanner.hh" -#include "item.hh" +#include "stream-event.hh" #include "translator.icc" @@ -22,8 +32,8 @@ class Horizontal_bracket_engraver : public Engraver { public: TRANSLATOR_DECLARATIONS (Horizontal_bracket_engraver); - vector bracket_stack_; - vector events_; + vector bracket_stack_; + vector events_; vsize pop_count_; vsize push_count_; @@ -33,22 +43,6 @@ public: DECLARE_TRANSLATOR_LISTENER (note_grouping); }; -ADD_ACKNOWLEDGER (Horizontal_bracket_engraver, note_column); -ADD_TRANSLATOR (Horizontal_bracket_engraver, - /* doc */ - "Create horizontal brackets over notes for musical analysis" - " purposes.", - - /* create */ - "HorizontalBracket ", - - /* read */ - "", - - /* write */ - "" - ); - Horizontal_bracket_engraver::Horizontal_bracket_engraver () { pop_count_ = 0; @@ -107,10 +101,26 @@ Horizontal_bracket_engraver::process_music () void Horizontal_bracket_engraver::stop_translation_timestep () { - for (int i = pop_count_; i--;) + for (vsize i = pop_count_; i--;) if (bracket_stack_.size ()) bracket_stack_.pop_back (); pop_count_ = 0; push_count_ = 0; + events_.clear (); } +ADD_ACKNOWLEDGER (Horizontal_bracket_engraver, note_column); +ADD_TRANSLATOR (Horizontal_bracket_engraver, + /* doc */ + "Create horizontal brackets over notes for musical analysis" + " purposes.", + + /* create */ + "HorizontalBracket ", + + /* read */ + "", + + /* write */ + "" + );