]> git.donarmstrong.com Git - lilypond.git/blob - lily/include/tie-configuration.hh
Merge branch 'cvs-head' of ssh+git://hanwen@repo.or.cz/srv/git/lilypond into master...
[lilypond.git] / lily / include / tie-configuration.hh
1 /*
2   tie-configuration.hh -- declare Tie_configuration
3
4   source file of the GNU LilyPond music typesetter
5
6   (c) 2005--2006 Han-Wen Nienhuys <hanwen@xs4all.nl>
7
8 */
9
10 #ifndef TIE_CONFIGURATION_HH
11 #define TIE_CONFIGURATION_HH
12
13 #include "main.hh"
14 #include "lily-proto.hh"
15 #include "direction.hh"
16 #include "interval.hh"
17 #include "compare.hh"
18 #include "std-vector.hh"
19
20 class Tie_configuration
21 {
22 #if DEBUG_SLUR_SCORING
23   string score_card_;
24 #endif
25   Real score_;
26   bool scored_;
27   friend class Tie_formatting_problem;
28
29 public:
30   Real score () const { return score_; }
31   string card () const { return score_card_; }
32
33   int position_;
34   Direction dir_;
35   Real delta_y_;
36   Drul_array<int> column_ranks_;
37   
38   /* computed. */
39   Interval attachment_x_;
40
41   void add_score (Real, string);
42   Tie_configuration ();
43   void center_tie_vertically (Tie_details const &);
44   Bezier get_transformed_bezier (Tie_details const &) const;
45   Bezier get_untransformed_bezier (Tie_details const &) const;
46   Real height (Tie_details const&) const;
47   int column_span_length () const;
48   
49   static int compare (Tie_configuration const &a,
50                       Tie_configuration const &b);
51   static Real distance (Tie_configuration const &a,
52                        Tie_configuration const &b);
53 };
54
55 INSTANTIATE_COMPARE (Tie_configuration, Tie_configuration::compare);
56
57 class Ties_configuration : public vector<Tie_configuration>
58 {
59   Real score_;
60   string score_card_;
61   bool scored_;
62   vector<string> tie_score_cards_;
63
64   friend class Tie_formatting_problem;
65 public:
66   Ties_configuration ();
67   void add_score (Real amount, string description);
68   void add_tie_score (Real amount, int i, string description);
69   Real score () const;
70   void reset_score ();
71   string card () const; 
72   string tie_card (int i) const { return tie_score_cards_[i]; }
73 };
74
75 #endif /* TIE_CONFIGURATION_HH */
76
77
78