]> git.donarmstrong.com Git - lilypond.git/blob - lily/include/tie.hh
* input/regression/tie-chord.ly (testLong): add a chord in 4ths
[lilypond.git] / lily / include / tie.hh
1 /*
2   tie.hh -- declare Tie
3
4   source file of the GNU LilyPond music typesetter
5
6   (c) 1997--2005 Han-Wen Nienhuys <hanwen@cs.uu.nl>
7 */
8
9 #ifndef TIE_HH
10 #define TIE_HH
11
12 #include "lily-guile.hh"
13 #include "lily-proto.hh"
14 #include "skyline.hh"
15
16
17
18 Interval
19 get_skyline_attachment (Drul_array< Array < Skyline_entry > > const &skylines,
20                         Real y1);
21
22 struct Tie_details
23 {
24   Real height_limit_;
25   Real ratio_;
26   Real staff_space_;
27   
28   Tie_details ();
29   void init (Grob *);
30 };
31   
32 struct Tie_configuration
33 {
34   Real position_;
35   Direction dir_;
36   Interval attachment_x_;
37   Real delta_y_;
38   
39   Tie_configuration ();
40   void center_tie_vertically (Tie_details const &);
41   Bezier get_bezier (Tie_details const &) const;
42   Real height (Tie_details const&) const;
43   
44   static int compare (Tie_configuration const &a,
45                       Tie_configuration const &b);
46   static Real distance (Tie_configuration const &a,
47                        Tie_configuration const &b);
48 };
49
50 INSTANTIATE_COMPARE (Tie_configuration, Tie_configuration::compare);
51
52 class Tie
53 {
54 public:
55   static void set_head (Grob *, Direction, Grob *head);
56   static bool has_interface (Grob *);
57   static void set_direction (Grob *);
58   static Grob *head (Grob *, Direction);
59   static int get_column_rank (Grob *, Direction);
60   static int get_position (Grob *);
61   static Direction get_default_dir (Grob *);
62   static void get_configuration (Grob *, Grob *, Tie_configuration *,
63                                  Drul_array< Array<Skyline_entry> > const *,
64                                  Tie_details const & 
65                                  );
66   static void set_control_points (Grob *, Grob *,Tie_configuration const&,
67                                   Tie_details const&
68                                   );
69   static void set_default_control_points (Grob *);
70   DECLARE_SCHEME_CALLBACK (print, (SCM));
71   DECLARE_SCHEME_CALLBACK (set_spacing_rods, (SCM));
72   static int compare (Grob *const &s1,
73                       Grob *const &s2);
74
75   static
76   Interval get_default_attachments (Spanner *me, Grob *common, Real gap,
77                                     int *staff_position, bool *in_between);
78   
79 };
80
81
82 #endif // TIE_HH