]> git.donarmstrong.com Git - lilypond.git/blob - lily/slur-engraver.cc
Break slurs between alternative endings in repeats; issue 1698.
[lilypond.git] / lily / slur-engraver.cc
1 /*
2   This file is part of LilyPond, the GNU music typesetter.
3
4   Copyright (C) 1997--2012 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 protected:
39   DECLARE_TRANSLATOR_LISTENER (slur);
40   DECLARE_TRANSLATOR_LISTENER (break_slur);
41
42 public:
43   TRANSLATOR_DECLARATIONS (Slur_engraver);
44 };
45
46 Slur_engraver::Slur_engraver () :
47   Slur_proto_engraver ("doubleSlurs", "Slur", "slur", "slur-event")
48 {
49   break_slur_ = 0;
50 }
51
52 IMPLEMENT_TRANSLATOR_LISTENER (Slur_engraver, slur);
53 void
54 Slur_engraver::listen_slur (Stream_event *ev)
55 {
56   internal_listen_slur (ev);
57 }
58
59 IMPLEMENT_TRANSLATOR_LISTENER (Slur_engraver, break_slur);
60 void
61 Slur_engraver::listen_break_slur (Stream_event *ev)
62 {
63   internal_listen_break_slur (ev);
64 }
65
66 void
67 Slur_engraver::set_melisma (bool m)
68 {
69   context ()->set_property ("slurMelismaBusy", ly_bool2scm (m));
70 }
71
72 ADD_ACKNOWLEDGER (Slur_engraver, inline_accidental);
73 ADD_ACKNOWLEDGER (Slur_engraver, fingering);
74 ADD_ACKNOWLEDGER (Slur_engraver, note_column);
75 ADD_ACKNOWLEDGER (Slur_engraver, script);
76 ADD_ACKNOWLEDGER (Slur_engraver, text_script);
77 ADD_ACKNOWLEDGER (Slur_engraver, dots);
78 ADD_END_ACKNOWLEDGER (Slur_engraver, tie);
79 ADD_ACKNOWLEDGER (Slur_engraver, tuplet_number);
80 ADD_TRANSLATOR (Slur_engraver,
81                 /* doc */
82                 "Build slur grobs from slur events.",
83
84                 /* create */
85                 "Slur ",
86
87                 /* read */
88                 "slurMelismaBusy "
89                 "doubleSlurs ",
90
91                 /* write */
92                 ""
93                );