Use scalar instead of embedded_scm for context mod overrides.
[lilypond/mpolesky.git] / lily / breathing-sign-engraver.cc
blobb65131579fb6769dedec81720ebb525abe1b7d84
1 /*
2 breathing_sign-engraver.cc -- implement Breathing_sign_engraver
4 (c) 1999--2009 Michael Krause
6 written for the GNU LilyPond music typesetter
8 TODO:
10 . Cancel any beams running through the breathing sign
11 ([e8 \breathe f e f] should become [e8] \breathe [f e f])
12 . Spacing is not yet completely pretty
15 #include "breathing-sign.hh"
16 #include "engraver.hh"
17 #include "item.hh"
18 #include "stream-event.hh"
20 #include "translator.icc"
22 class Breathing_sign_engraver : public Engraver
24 public:
25 TRANSLATOR_DECLARATIONS (Breathing_sign_engraver);
27 protected:
28 void process_music ();
29 void stop_translation_timestep ();
31 DECLARE_TRANSLATOR_LISTENER (breathing);
32 private:
33 Stream_event *breathing_sign_event_;
34 Grob *breathing_sign_;
37 Breathing_sign_engraver::Breathing_sign_engraver ()
39 breathing_sign_ = 0;
40 breathing_sign_event_ = 0;
43 IMPLEMENT_TRANSLATOR_LISTENER (Breathing_sign_engraver, breathing);
44 void
45 Breathing_sign_engraver::listen_breathing (Stream_event *ev)
47 ASSIGN_EVENT_ONCE (breathing_sign_event_, ev);
50 void
51 Breathing_sign_engraver::process_music ()
53 if (breathing_sign_event_)
55 breathing_sign_ = make_item ("BreathingSign", breathing_sign_event_->self_scm ());
59 void
60 Breathing_sign_engraver::stop_translation_timestep ()
62 breathing_sign_ = 0;
63 breathing_sign_event_ = 0;
66 ADD_TRANSLATOR (Breathing_sign_engraver,
67 /* doc */
68 "Create a breathing sign.",
70 /* create */
71 "BreathingSign ",
73 /* read */
74 "",
76 /* write */