]> git.donarmstrong.com Git - lilypond.git/blob - lily/include/musical-request.hh
release: 1.1.43
[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 Abbreviation_req : public Request {
41   VIRTUAL_COPY_CONS (Abbreviation_req);
42   Abbreviation_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 void do_print () const;
77 };
78
79
80 /// request which has some kind of pitch
81 struct Melodic_req :virtual Request
82 {
83   Musical_pitch pitch_;
84
85   static int compare (Melodic_req const&,Melodic_req const&);
86   
87 protected:
88   /// transpose. #delta# is relative to central c.
89   virtual void transpose (Musical_pitch delta);
90   virtual bool do_equal_b (Request*) const;
91   virtual void do_print () const;
92   VIRTUAL_COPY_CONS(Music);
93 };
94
95 /// specify tonic of a chord
96 struct Tonic_req : public Melodic_req
97 {
98   VIRTUAL_COPY_CONS(Music);
99 };
100
101 /// Put a note of specified type, height, and with accidental on the staff.
102 class Note_req  : public Rhythmic_req, virtual public Melodic_req  {
103 public:
104     
105   /// force/supress printing of accidental.
106   bool forceacc_b_;
107   /// Cautionary, i.e. parenthesized accidental.
108   bool cautionary_b_;
109   Note_req();
110 protected:
111   virtual void do_print () const;
112   bool do_equal_b (Request*) const;
113   VIRTUAL_COPY_CONS(Music);
114 };
115
116 /**
117 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.
118 */
119 class Rest_req : public Rhythmic_req {
120 public:
121   VIRTUAL_COPY_CONS(Music);
122 };
123
124 /**
125  Part: typeset a measure with the number of measures rest
126  Score: typeset all individual measures ass full rests
127  */
128 class Multi_measure_rest_req : public Rhythmic_req  {
129 public:
130   VIRTUAL_COPY_CONS(Music);
131 };
132
133 /// an extender line
134 class Extender_req : public Request  {
135 public:
136   VIRTUAL_COPY_CONS(Music);
137 };
138
139 #endif // MUSICALREQUESTS_HH