* stepmake/stepmake/metafont-rules.make: backport 1.7 fixes.
[lilypond.git] / lily / breathing-sign-engraver.cc
blobe4fc0551538d8a516a2ad25860e3804bdfe47316
1 /*
2 breathing_sign-engraver.cc -- implement Breathing_sign_engraver
4 Copyright (C) 1999 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
16 #include "staff-symbol-referencer.hh"
17 #include "breathing-sign.hh"
18 #include "musical-request.hh"
19 #include "command-request.hh"
20 #include "engraver-group-engraver.hh"
21 #include "item.hh"
22 #include "engraver.hh"
23 #include "command-request.hh"
25 class Breathing_sign_engraver : public Engraver {
26 public:
27 TRANSLATOR_DECLARATIONS(Breathing_sign_engraver);
29 protected:
30 virtual bool try_music (Music *req);
31 virtual void process_acknowledged_grobs ();
32 virtual void stop_translation_timestep ();
33 virtual void start_translation_timestep ();
35 private:
36 Breathing_sign_req * breathing_sign_req_;
37 Grob * breathing_sign_;
40 Breathing_sign_engraver::Breathing_sign_engraver ()
42 breathing_sign_ = 0;
43 breathing_sign_req_ = 0;
46 bool
47 Breathing_sign_engraver::try_music (Music*r)
49 if (Breathing_sign_req * b= dynamic_cast <Breathing_sign_req *> (r))
51 breathing_sign_req_ = b;
52 return true;
55 return false;
58 void
59 Breathing_sign_engraver::process_acknowledged_grobs ()
61 if (breathing_sign_req_ && ! breathing_sign_)
63 SCM b = get_property ("BreathingSign");
64 breathing_sign_ = new Item (b);
66 announce_grob(breathing_sign_, breathing_sign_req_->self_scm());
67 breathing_sign_req_ = 0;
71 void
72 Breathing_sign_engraver::stop_translation_timestep ()
74 if (breathing_sign_)
76 typeset_grob (breathing_sign_);
77 breathing_sign_ = 0;
81 void
82 Breathing_sign_engraver::start_translation_timestep ()
84 breathing_sign_req_ = 0;
88 ENTER_DESCRIPTION(Breathing_sign_engraver,
89 /* descr */ "",
90 /* creats*/ "BreathingSign",
91 /* acks */ "",
92 /* reads */ "",
93 /* write */ "");