Fixes Issue 1504, allowing feather beam line breaking.
[lilypond/patrick.git] / lily / breathing-sign-engraver.cc
blob4e583881c0dd0dccfc941cee563d33606ffa5724
1 /*
2 This file is part of LilyPond, the GNU music typesetter.
4 Copyright (C) 1999--2011 Michael Krause
6 written for the GNU LilyPond music typesetter
8 TODO:
10 . Spacing is not yet completely pretty
12 LilyPond is free software: you can redistribute it and/or modify
13 it under the terms of the GNU General Public License as published by
14 the Free Software Foundation, either version 3 of the License, or
15 (at your option) any later version.
17 LilyPond is distributed in the hope that it will be useful,
18 but WITHOUT ANY WARRANTY; without even the implied warranty of
19 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
20 GNU General Public License for more details.
22 You should have received a copy of the GNU General Public License
23 along with LilyPond. If not, see <http://www.gnu.org/licenses/>.
26 #include "breathing-sign.hh"
27 #include "engraver.hh"
28 #include "item.hh"
29 #include "stream-event.hh"
31 #include "translator.icc"
33 class Breathing_sign_engraver : public Engraver
35 public:
36 TRANSLATOR_DECLARATIONS (Breathing_sign_engraver);
38 protected:
39 void process_music ();
40 void stop_translation_timestep ();
42 DECLARE_TRANSLATOR_LISTENER (breathing);
43 private:
44 Stream_event *breathing_sign_event_;
45 Grob *breathing_sign_;
48 Breathing_sign_engraver::Breathing_sign_engraver ()
50 breathing_sign_ = 0;
51 breathing_sign_event_ = 0;
54 IMPLEMENT_TRANSLATOR_LISTENER (Breathing_sign_engraver, breathing);
55 void
56 Breathing_sign_engraver::listen_breathing (Stream_event *ev)
58 ASSIGN_EVENT_ONCE (breathing_sign_event_, ev);
61 void
62 Breathing_sign_engraver::process_music ()
64 if (breathing_sign_event_)
66 breathing_sign_ = make_item ("BreathingSign", breathing_sign_event_->self_scm ());
70 void
71 Breathing_sign_engraver::stop_translation_timestep ()
73 breathing_sign_ = 0;
74 breathing_sign_event_ = 0;
77 ADD_TRANSLATOR (Breathing_sign_engraver,
78 /* doc */
79 "Create a breathing sign.",
81 /* create */
82 "BreathingSign ",
84 /* read */
85 "",
87 /* write */