]> git.donarmstrong.com Git - lilypond.git/blob - lily/gregorian-ligature.cc
Run `make grand-replace'.
[lilypond.git] / lily / gregorian-ligature.cc
1 /*
2   gregorian-ligature.cc -- implement Gregorian_ligature
3
4   source file of the GNU LilyPond music typesetter
5
6   (c) 2003--2008 Han-Wen Nienhuys <hanwen@xs4all.nl>
7 */
8
9 #include "gregorian-ligature.hh"
10
11 #include "grob.hh"
12
13 void check_prefix (string name, int mask, int prefix_set, string *str)
14 {
15   if (prefix_set & mask)
16     {
17       if (!str->empty ())
18         *str += ", ";
19       *str += name;
20     }
21 }
22
23 string
24 Gregorian_ligature::prefixes_to_str (Grob *primitive)
25 {
26   string str;
27   int prefix_set
28     = scm_to_int (primitive->get_property ("prefix-set"));
29   check_prefix ("virga", VIRGA, prefix_set, &str);
30   check_prefix ("stropha", STROPHA, prefix_set, &str);
31   check_prefix ("inclinatum", INCLINATUM, prefix_set, &str);
32   check_prefix ("auctum", AUCTUM, prefix_set, &str);
33   check_prefix ("descendens", DESCENDENS, prefix_set, &str);
34   check_prefix ("ascendens", ASCENDENS, prefix_set, &str);
35   check_prefix ("oriscus", ORISCUS, prefix_set, &str);
36   check_prefix ("quilisma", QUILISMA, prefix_set, &str);
37   check_prefix ("deminutum", DEMINUTUM, prefix_set, &str);
38   check_prefix ("cavum", CAVUM, prefix_set, &str);
39   check_prefix ("linea", LINEA, prefix_set, &str);
40   return str;
41 }
42
43 /*
44   CHECK ME -- does prefix-set come from here ?
45
46   In a way, yes.  Actually, prefix-set is a property that is written
47   by code of GregorianLigatureEngraver that is virtually invoked by a
48   subclass like VaticanaLigatureEngraver.  The property is lateron
49   read by the associated item class, such as VaticanaLigature.--jr
50 */
51 ADD_INTERFACE (Gregorian_ligature,
52                "A gregorian ligature.",
53
54                /* properties */
55                "virga "
56                "stropha "
57                "inclinatum "
58                "auctum "
59                "descendens "
60                "ascendens "
61                "oriscus "
62                "quilisma "
63                "deminutum "
64                "cavum "
65                "linea "
66                "pes-or-flexa "
67                "context-info "
68                "prefix-set "
69                );