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