]> git.donarmstrong.com Git - lilypond.git/blob - lily/slur-engraver.cc
Merge branch 'master' of /home/jcharles/GIT/Lily/. into translation
[lilypond.git] / lily / slur-engraver.cc
1 /*
2   This file is part of LilyPond, the GNU music typesetter.
3
4   Copyright (C) 1997--2015 Han-Wen Nienhuys <hanwen@xs4all.nl>
5
6   LilyPond is free software: you can redistribute it and/or modify
7   it under the terms of the GNU General Public License as published by
8   the Free Software Foundation, either version 3 of the License, or
9   (at your option) any later version.
10
11   LilyPond is distributed in the hope that it will be useful,
12   but WITHOUT ANY WARRANTY; without even the implied warranty of
13   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14   GNU General Public License for more details.
15
16   You should have received a copy of the GNU General Public License
17   along with LilyPond.  If not, see <http://www.gnu.org/licenses/>.
18 */
19
20 #include "engraver.hh"
21
22 #include "context.hh"
23 #include "directional-element-interface.hh"
24 #include "international.hh"
25 #include "note-column.hh"
26 #include "slur.hh"
27 #include "slur-proto-engraver.hh"
28 #include "spanner.hh"
29 #include "stream-event.hh"
30 #include "warn.hh"
31
32 #include "translator.icc"
33
34 class Slur_engraver : public Slur_proto_engraver
35 {
36   virtual void set_melisma (bool);
37
38 public:
39   SCM event_symbol ();
40   TRANSLATOR_DECLARATIONS (Slur_engraver);
41   TRANSLATOR_INHERIT (Slur_proto_engraver);
42 };
43
44 Slur_engraver::Slur_engraver () :
45   Slur_proto_engraver ("doubleSlurs", "Slur", "slur", "slur-event")
46 {
47 }
48
49 SCM
50 Slur_engraver::event_symbol ()
51 {
52   // Need a string constant for memoization
53   return ly_symbol2scm ("slur-event");
54 }
55
56 void
57 Slur_engraver::set_melisma (bool m)
58 {
59   context ()->set_property ("slurMelismaBusy", ly_bool2scm (m));
60 }
61
62 void
63 Slur_engraver::boot ()
64 {
65   ADD_LISTENER (Slur_proto_engraver, slur);
66   ADD_LISTENER (Slur_proto_engraver, note);
67   ADD_ACKNOWLEDGER (Slur_proto_engraver, inline_accidental);
68   ADD_ACKNOWLEDGER (Slur_proto_engraver, fingering);
69   ADD_ACKNOWLEDGER (Slur_proto_engraver, note_column);
70   ADD_ACKNOWLEDGER (Slur_proto_engraver, script);
71   ADD_ACKNOWLEDGER (Slur_proto_engraver, text_script);
72   ADD_ACKNOWLEDGER (Slur_proto_engraver, dots);
73   ADD_END_ACKNOWLEDGER (Slur_proto_engraver, tie);
74   ADD_ACKNOWLEDGER (Slur_proto_engraver, tuplet_number);
75 }
76
77 ADD_TRANSLATOR (Slur_engraver,
78                 /* doc */
79                 "Build slur grobs from slur events.",
80
81                 /* create */
82                 "Slur ",
83
84                 /* read */
85                 "slurMelismaBusy "
86                 "doubleSlurs ",
87
88                 /* write */
89                 ""
90                );