]> git.donarmstrong.com Git - lilypond.git/blob - lily/include/tie-configuration.hh
Run grand-replace (issue 3765)
[lilypond.git] / lily / include / tie-configuration.hh
1 /*
2   This file is part of LilyPond, the GNU music typesetter.
3
4   Copyright (C) 2005--2014 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 #ifndef TIE_CONFIGURATION_HH
21 #define TIE_CONFIGURATION_HH
22
23 #include "direction.hh"
24 #include "interval.hh"
25 #include "std-vector.hh"
26 #include "main.hh" // DEBUG_SLUR_SCORING
27
28 class Tie_configuration
29 {
30 #if DEBUG_SLUR_SCORING
31   string score_card_;
32 #endif
33   Real score_;
34   bool scored_;
35   friend class Tie_formatting_problem;
36
37 public:
38   Real score () const { return score_; }
39   string card () const { return score_card_; }
40
41   int position_;
42   Direction dir_;
43   Real delta_y_;
44   Drul_array<int> column_ranks_;
45
46   /* computed. */
47   Interval attachment_x_;
48
49   void add_score (Real, const string&);
50   Tie_configuration ();
51   void center_tie_vertically (Tie_details const &);
52   Bezier get_transformed_bezier (Tie_details const &) const;
53   Bezier get_untransformed_bezier (Tie_details const &) const;
54   Real height (Tie_details const &) const;
55   int column_span_length () const;
56
57   static int compare (Tie_configuration const &a,
58                       Tie_configuration const &b);
59   static Real distance (Tie_configuration const &a,
60                         Tie_configuration const &b);
61 };
62
63 INSTANTIATE_COMPARE (Tie_configuration, Tie_configuration::compare);
64
65 class Ties_configuration : public vector<Tie_configuration>
66 {
67   Real score_;
68   string score_card_;
69   bool scored_;
70   vector<string> tie_score_cards_;
71
72   friend class Tie_formatting_problem;
73 public:
74   Ties_configuration ();
75   void add_score (Real amount, const string &description);
76   void add_tie_score (Real amount, int i, const string &description);
77   Real score () const;
78   void reset_score ();
79   string card () const;
80   string tie_card (int i) const { return tie_score_cards_[i]; }
81   string complete_tie_card (vsize i) const;
82   string complete_score_card () const;
83 };
84
85 #endif /* TIE_CONFIGURATION_HH */
86