*** empty log message ***
[lilypond.git] / lily / slur-performer.cc
blob4a154d567397e758dee11b315ad58b3b5e0a8fba
1 /*
2 slur-performer.cc -- implement Slur_performer
4 source file of the GNU LilyPond music typesetter
6 (c) 1996--2004 Jan Nieuwenhuizen <janneke@gnu.org>
7 */
9 #include "performer.hh"
10 #include "event.hh"
11 #include "audio-item.hh"
12 #include "audio-column.hh"
13 #include "global-context.hh"
14 #include "warn.hh"
17 this is C&P from beam_performer.
20 class Slur_performer : public Performer {
21 public:
22 TRANSLATOR_DECLARATIONS (Slur_performer);
24 protected:
25 virtual bool try_music (Music *ev) ;
26 virtual void start_translation_timestep ();
27 virtual void process_music ();
28 void set_melisma (bool);
29 private:
30 Music *start_ev_;
31 Music *now_stop_ev_;
32 bool slur_;
35 void
36 Slur_performer::process_music ()
38 if (now_stop_ev_)
40 slur_ = false;
43 if (start_ev_)
45 slur_ = true;
46 set_melisma (true);
51 void
52 Slur_performer::set_melisma (bool ml)
54 daddy_context_->set_property ("slurMelismaBusy", ml ? SCM_BOOL_T :SCM_BOOL_F);
57 void
58 Slur_performer::start_translation_timestep ()
60 if (slur_)
62 set_melisma (true);
65 start_ev_ = 0;
66 now_stop_ev_ = 0;
69 bool
70 Slur_performer::try_music (Music *m)
72 if (m->is_mus_type ("slur-event"))
74 Direction d = to_dir (m->get_property ("span-direction"));
76 if (d == START)
78 start_ev_ = m;
80 else if (d==STOP)
82 now_stop_ev_ = m;
84 return true;
86 return false;
89 ENTER_DESCRIPTION (Slur_performer,"","",
90 "slur-event","","","");
92 Slur_performer::Slur_performer ()
94 slur_ = false;