2 This file is part of LilyPond, the GNU music typesetter.
4 Copyright (C) 2011 Bertrand Bordage
7 LilyPond is free software: you can redistribute it and/or modify
8 it under the terms of the GNU General Public License as published by
9 the Free Software Foundation, either version 3 of the License, or
10 (at your option) any later version.
12 LilyPond is distributed in the hope that it will be useful,
13 but WITHOUT ANY WARRANTY; without even the implied warranty of
14 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 GNU General Public License for more details.
17 You should have received a copy of the GNU General Public License
18 along with LilyPond. If not, see <http://www.gnu.org/licenses/>.
21 #include "engraver.hh"
23 #include "pointer-group-interface.hh"
24 #include "arpeggio.hh"
26 #include "rhythmic-head.hh"
27 #include "side-position-interface.hh"
28 #include "stream-event.hh"
29 #include "note-column.hh"
32 #include "translator.icc"
34 class Brace_engraver : public Engraver
37 TRANSLATOR_DECLARATIONS (Brace_engraver);
39 void acknowledge_stem (Grob_info);
40 void acknowledge_rhythmic_head (Grob_info);
42 void process_music ();
43 void stop_translation_timestep ();
44 DECLARE_TRANSLATOR_LISTENER (brace);
48 Stream_event *brace_event_;
51 Brace_engraver::Brace_engraver ()
57 IMPLEMENT_TRANSLATOR_LISTENER (Brace_engraver, brace);
58 void Brace_engraver::listen_brace (Stream_event *ev)
60 ASSIGN_EVENT_ONCE (brace_event_, ev);
64 Brace_engraver::acknowledge_stem (Grob_info info)
68 if (!brace_->get_parent (Y_AXIS))
69 brace_->set_parent (info.grob (), Y_AXIS);
71 Pointer_group_interface::add_grob (brace_,
72 ly_symbol2scm ("stems"),
77 Brace_engraver::acknowledge_rhythmic_head (Grob_info info)
82 We can't catch local key items (accidentals) from Voice context,
83 see Local_key_engraver
85 Side_position_interface::add_support (brace_, info.grob ());
89 Brace_engraver::process_music ()
92 brace_ = make_item ("Brace", brace_event_->self_scm ());
96 Brace_engraver::stop_translation_timestep ()
102 ADD_ACKNOWLEDGER (Brace_engraver, stem);
103 ADD_ACKNOWLEDGER (Brace_engraver, rhythmic_head);
105 ADD_TRANSLATOR (Brace_engraver,
107 "Generate a Brace symbol.",