]> git.donarmstrong.com Git - lilypond.git/blob - lily/include/audio-item.hh
7ddd664aaf183bd89f810ea4085e0b523a666886
[lilypond.git] / lily / include / audio-item.hh
1 /*
2   This file is part of LilyPond, the GNU music typesetter.
3
4   Copyright (C) 1996--2011 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 };
50
51 class Audio_span_dynamic : public Audio_element
52 {
53 public:
54   Direction grow_dir_;
55   vector<Audio_dynamic*> dynamics_;
56
57
58   virtual void render ();
59   void add_absolute (Audio_dynamic*);
60   Audio_span_dynamic ();
61 };
62
63
64 class Audio_key : public Audio_item
65 {
66 public:
67   Audio_key (int acc, bool major);
68
69   int accidentals_;
70   bool major_;
71 };
72
73 class Audio_instrument : public Audio_item
74 {
75 public:
76   Audio_instrument (string instrument_string);
77
78   string str_;
79 };
80
81 class Audio_note : public Audio_item
82 {
83 public:
84   Audio_note (Pitch p, Moment m, bool tie_event, Pitch transposition);
85
86   // with tieWaitForNote, there might be a skip between the tied notes!
87   void tie_to (Audio_note *, Moment skip = 0);
88
89   Pitch pitch_;
90   Moment length_mom_;
91   Pitch transposing_;
92   Real volume_;
93   
94   Audio_note *tied_;
95   bool tie_event_;
96 };
97
98 class Audio_piano_pedal : public Audio_item
99 {
100 public:
101   string type_string_;
102   Direction dir_;
103 };
104
105 class Audio_text : public Audio_item
106 {
107 public:
108   enum Type
109     {
110       TEXT = 1, COPYRIGHT, TRACK_NAME, INSTRUMENT_NAME, LYRIC,
111       MARKER, CUE_POINT
112     };
113
114   Audio_text (Audio_text::Type type, string text_string);
115
116   Type type_;
117   string text_string_;
118 };
119
120 class Audio_tempo : public Audio_item
121 {
122 public:
123   Audio_tempo (int per_minute_4);
124
125   int per_minute_4_;
126 };
127
128 class Audio_time_signature : public Audio_item
129 {
130 public:
131   Audio_time_signature (int beats, int one_beat);
132
133   int beats_;
134   int one_beat_;
135 };
136
137 int moment_to_ticks (Moment);
138 Real moment_to_real (Moment);
139 Moment remap_grace_duration (Moment);
140
141 #endif // AUDIO_ITEM_HH
142