]> git.donarmstrong.com Git - lilypond.git/blob - lily/include/audio-item.hh
Fixed errors in Catalan translation
[lilypond.git] / lily / include / audio-item.hh
1 /*
2   This file is part of LilyPond, the GNU music typesetter.
3
4   Copyright (C) 1996--2012 Jan Nieuwenhuizen <janneke@gnu.org>
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 AUDIO_ITEM_HH
21 #define AUDIO_ITEM_HH
22
23 #include "audio-element.hh"
24 #include "moment.hh"
25 #include "pitch.hh"
26
27 class Audio_item : public Audio_element
28 {
29 public:
30   Audio_column *audio_column_;
31   int channel_;
32
33   Audio_item ();
34   Audio_column *get_column () const;
35
36   virtual void render ();
37
38 private:
39   Audio_item (Audio_item const &);
40   Audio_item &operator = (Audio_item const &);
41 };
42
43 class Audio_dynamic : public Audio_item
44 {
45 public:
46   Audio_dynamic ();
47
48   Real volume_;
49   bool silent_;
50 };
51
52 class Audio_span_dynamic : public Audio_element
53 {
54 public:
55   Direction grow_dir_;
56   vector<Audio_dynamic *> dynamics_;
57   Real min_volume_;
58   Real max_volume_;
59
60   virtual void render ();
61   void add_absolute (Audio_dynamic *);
62   Audio_span_dynamic (Real min_volume, Real max_volume);
63 };
64
65 class Audio_key : public Audio_item
66 {
67 public:
68   Audio_key (int acc, bool major);
69
70   int accidentals_;
71   bool major_;
72 };
73
74 class Audio_instrument : public Audio_item
75 {
76 public:
77   Audio_instrument (string instrument_string);
78
79   string str_;
80 };
81
82 class Audio_note : public Audio_item
83 {
84 public:
85   Audio_note (Pitch p, Moment m, bool tie_event, Pitch transposition);
86
87   // with tieWaitForNote, there might be a skip between the tied notes!
88   void tie_to (Audio_note *, Moment skip = 0);
89   Audio_note *tie_head ();
90   virtual string to_string () const;
91
92   Pitch pitch_;
93   Moment length_mom_;
94   Pitch transposing_;
95   Audio_dynamic *dynamic_;
96
97   Audio_note *tied_;
98   bool tie_event_;
99 };
100
101 class Audio_piano_pedal : public Audio_item
102 {
103 public:
104   string type_string_;
105   Direction dir_;
106 };
107
108 class Audio_text : public Audio_item
109 {
110 public:
111   enum Type
112   {
113     TEXT = 1, COPYRIGHT, TRACK_NAME, INSTRUMENT_NAME, LYRIC,
114     MARKER, CUE_POINT
115   };
116
117   Audio_text (Audio_text::Type type, const string &text_string);
118
119   Type type_;
120   string text_string_;
121 };
122
123 class Audio_tempo : public Audio_item
124 {
125 public:
126   Audio_tempo (int per_minute_4);
127
128   int per_minute_4_;
129 };
130
131 class Audio_time_signature : public Audio_item
132 {
133 public:
134   Audio_time_signature (int beats, int one_beat);
135
136   int beats_;
137   int one_beat_;
138 };
139
140 class Audio_control_function_value_change : public Audio_item
141 {
142 public:
143   // Supported control functions.
144   enum Control
145   {
146     BALANCE = 0, PAN_POSITION, REVERB_LEVEL, CHORUS_LEVEL,
147     // pseudo value for representing the size of the enum; must be kept last
148     NUM_CONTROLS
149   };
150
151   Audio_control_function_value_change (Control control, Real value);
152
153   // Information about a context property corresponding to a control function
154   // (name, the corresponding enumeration value, and the allowed range for the
155   // value of the context property).
156   struct Context_property
157   {
158     const char *name_;
159     Control control_;
160     Real range_min_;
161     Real range_max_;
162   };
163
164   // Mapping from supported control functions to the corresponding context
165   // properties.
166   static const Context_property context_properties_[];
167
168   Control control_;
169   Real value_;
170 };
171
172 int moment_to_ticks (Moment);
173 Real moment_to_real (Moment);
174 Moment remap_grace_duration (Moment);
175
176 #endif // AUDIO_ITEM_HH
177