]> git.donarmstrong.com Git - lilypond.git/blob - lily/gregorian-ligature.cc
* flower
[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--2005 Han-Wen Nienhuys <hanwen@cs.uu.nl>
7 */
8
9 #include "gregorian-ligature.hh"
10
11 #include "grob.hh"
12 #include "string.hh"
13
14 void check_prefix (String name, int mask, int prefix_set, String *str)
15 {
16   if (prefix_set & mask)
17     {
18       if (!str->is_empty ())
19         *str += ", ";
20       *str += name;
21     }
22 }
23
24 String
25 Gregorian_ligature::prefixes_to_str (Grob *primitive)
26 {
27   String str;
28   int prefix_set
29     = scm_to_int (primitive->get_property ("prefix-set"));
30   check_prefix ("virga", VIRGA, prefix_set, &str);
31   check_prefix ("stropha", STROPHA, prefix_set, &str);
32   check_prefix ("inclinatum", INCLINATUM, prefix_set, &str);
33   check_prefix ("auctum", AUCTUM, prefix_set, &str);
34   check_prefix ("descendens", DESCENDENS, prefix_set, &str);
35   check_prefix ("ascendens", ASCENDENS, prefix_set, &str);
36   check_prefix ("oriscus", ORISCUS, prefix_set, &str);
37   check_prefix ("quilisma", QUILISMA, prefix_set, &str);
38   check_prefix ("deminutum", DEMINUTUM, prefix_set, &str);
39   check_prefix ("cavum", CAVUM, prefix_set, &str);
40   check_prefix ("linea", LINEA, prefix_set, &str);
41   return str;
42 }
43
44 /*
45   CHECK ME -- does prefix-set come from here ?
46
47   In a way, yes.  Actually, prefix-set is a property that is written
48   by code of GregorianLigatureEngraver that is virtually invoked by a
49   subclass like VaticanaLigatureEngraver.  The property is lateron
50   read by the associated item class, such as VaticanaLigature.--jr
51 */
52 ADD_INTERFACE (Gregorian_ligature, "gregorian-ligature-interface",
53                "A gregorian ligature",
54                "virga stropha inclinatum auctum descendens ascendens "
55                "oriscus quilisma deminutum cavum linea pes-or-flexa "
56                "context-info prefix-set");