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