]> git.donarmstrong.com Git - lilypond.git/blob - lily/melisma-engraver.cc
fab89dcd9c4b4a55fc14ddd671cf0c2fabbaf148
[lilypond.git] / lily / melisma-engraver.cc
1 /*   
2   melisma-engraver.cc --  implement Melisma_engraver
3   
4   source file of the GNU LilyPond music typesetter
5   
6   (c) 1999--2001 Han-Wen Nienhuys <hanwen@cs.uu.nl>
7   
8  */
9
10 #include "engraver.hh"
11 #include "musical-request.hh"
12 #include "grob.hh"
13 #include "translator-group.hh"
14
15 /**
16    Signal existence of melismas.
17  */
18 class Melisma_engraver:public Engraver
19 {
20 public:
21   TRANSLATOR_DECLARATIONS(Melisma_engraver);
22   bool try_music (Music *);
23 };
24
25
26
27 bool
28 Melisma_engraver::try_music (Music *m) 
29 {
30   if (dynamic_cast<Melisma_playing_req*> (m))
31     {
32       SCM plain (get_property ("melismaBusy"));
33       SCM slur (get_property ("slurMelismaBusy"));
34       SCM tie (get_property ("tieMelismaBusy"));
35       SCM beam (get_property ("beamMelismaBusy"));
36       
37       if ((to_boolean (plain))
38           || (to_boolean (slur))
39           || (to_boolean (tie))
40           || (to_boolean (beam))) {
41
42         daddy_trans_l_->set_property ("melismaEngraverBusy",SCM_BOOL_T);
43         return true;
44       }
45     }
46   daddy_trans_l_->set_property ("melismaEngraverBusy",SCM_BOOL_F);
47   return false;
48 }
49 Melisma_engraver::Melisma_engraver()
50 {
51 }
52 ENTER_DESCRIPTION(Melisma_engraver,
53 /* descr */       "",
54 /* creats*/       "",
55 /* acks  */       "",
56 /* reads */       "melismaBusy slurMelismaBusy tieMelismaBusy beamMelismaBusy",
57 /* write */       "");