]> git.donarmstrong.com Git - lilypond.git/blob - lily/include/musical-request.hh
release: 1.1.48
[lilypond.git] / lily / include / musical-request.hh
1 /*
2   musical-request.hh -- declare Musical requests
3
4   source file of the GNU LilyPond music typesetter
5
6   (c)  1997--1999 Han-Wen Nienhuys <hanwen@cs.uu.nl>
7 */
8
9
10 #ifndef MUSICALREQUESTS_HH
11 #define MUSICALREQUESTS_HH
12
13 #include "lily-proto.hh"
14 #include "request.hh"
15 #include "duration.hh"
16 #include "musical-pitch.hh"
17
18
19 /** a request with a duration.
20   This request is used only used as a base class.
21  */
22 class Rhythmic_req  : public virtual Request  {
23 public:
24   Duration duration_;
25   virtual void do_print () const;
26
27   bool do_equal_b (Request*) const;
28   void compress (Moment);
29   virtual Moment length_mom () const;
30   static int compare (Rhythmic_req const&,Rhythmic_req const&);
31   VIRTUAL_COPY_CONS(Music);
32 };
33
34 class Skip_req  : public Rhythmic_req  {
35 public:
36   VIRTUAL_COPY_CONS(Music);
37 };
38
39
40 struct Tremolo_req : public Request {
41   VIRTUAL_COPY_CONS (Music);
42   Tremolo_req ();
43   int type_i_;
44   virtual void do_print () const;
45 };
46
47
48 /** a syllable  or lyric is a string with rhythm.
49   */
50 class Lyric_req  : public  Rhythmic_req  {
51 public:
52   virtual void do_print () const;
53   String text_str_;
54   VIRTUAL_COPY_CONS(Music);
55 };
56
57
58 class Articulation_req : public G_script_req
59 {
60 public:
61   String articulation_str_;
62 protected:
63   virtual bool do_equal_b (Request*) const;
64   virtual void do_print () const;
65   VIRTUAL_COPY_CONS(Music);
66 };
67
68 class Text_script_req : public G_script_req {
69 public:
70   String text_str_;
71
72   // should be generic property of some kind.. 
73   String style_str_;
74 protected:
75   VIRTUAL_COPY_CONS(Music);
76   virtual bool do_equal_b (Request*)const;
77   virtual void do_print () const;
78 };
79
80
81 /// request which has some kind of pitch
82 struct Melodic_req :virtual Request
83 {
84   Musical_pitch pitch_;
85
86   static int compare (Melodic_req const&,Melodic_req const&);
87   
88 protected:
89   /// transpose. #delta# is relative to central c.
90   virtual void transpose (Musical_pitch delta);
91   virtual bool do_equal_b (Request*) const;
92   virtual void do_print () const;
93   VIRTUAL_COPY_CONS(Music);
94 };
95
96 /// specify tonic of a chord
97 struct Tonic_req : public Melodic_req
98 {
99   VIRTUAL_COPY_CONS(Music);
100 };
101
102 /// Put a note of specified type, height, and with accidental on the staff.
103 class Note_req  : public Rhythmic_req, virtual public Melodic_req  {
104 public:
105     
106   /// force/supress printing of accidental.
107   bool forceacc_b_;
108   /// Cautionary, i.e. parenthesized accidental.
109   bool cautionary_b_;
110   Note_req();
111 protected:
112   virtual void do_print () const;
113   bool do_equal_b (Request*) const;
114   VIRTUAL_COPY_CONS(Music);
115 };
116
117 /**
118 Put a rest on the staff. Why a request? It might be a good idea to not typeset the rest, if the paper is too crowded.
119 */
120 class Rest_req : public Rhythmic_req {
121 public:
122   VIRTUAL_COPY_CONS(Music);
123 };
124
125 /**
126  Part: typeset a measure with the number of measures rest
127  Score: typeset all individual measures ass full rests
128  */
129 class Multi_measure_rest_req : public Rhythmic_req  {
130 public:
131   VIRTUAL_COPY_CONS(Music);
132 };
133
134 /// an extender line
135 class Extender_req : public Request  {
136 public:
137   VIRTUAL_COPY_CONS(Music);
138 };
139
140 #endif // MUSICALREQUESTS_HH