lilypond-0.1.57
[lilypond.git] / lily / audio-item.cc
blob60a6badc8dd6292065a6b965ebde17388eae73de
1 /*
2 audio-item.cc -- implement Audio items.
4 source file of the GNU LilyPond music typesetter
6 (c) 1997 Jan Nieuwenhuizen <jan@digicash.com>
7 */
8 #include "debug.hh"
9 #include "audio-item.hh"
10 #include "midi-item.hh"
11 #include "request.hh"
12 #include "audio-column.hh"
14 Audio_instrument::Audio_instrument (String instrument_str)
15 : Audio_item (0)
17 str_ = instrument_str;
20 Midi_item*
21 Audio_instrument::midi_item_p()
23 return str_.length_i() ? new Midi_instrument(0, str_) : 0;
25 IMPLEMENT_IS_TYPE_B1(Audio_instrument, Audio_item);
27 Audio_item::Audio_item (Request* req_l)
29 audio_column_l_ = 0;
30 req_l_ = req_l;
33 Audio_key::Audio_key (Request* req_l)
34 : Audio_item (req_l)
38 Midi_item*
39 Audio_key::midi_item_p()
41 return new Midi_key (this);
43 IMPLEMENT_IS_TYPE_B1 (Audio_key, Audio_item);
45 Audio_note::Audio_note (Request* req_l)
46 : Audio_item (req_l)
50 Midi_item*
51 Audio_note::midi_item_p()
53 return new Midi_note (this);
56 IMPLEMENT_IS_TYPE_B1(Audio_note, Audio_item);
58 Audio_tempo::Audio_tempo (int per_minute_4_i)
59 : Audio_item (0)
61 per_minute_4_i_ = per_minute_4_i;
64 Midi_item*
65 Audio_tempo::midi_item_p()
67 return new Midi_tempo (this);
70 IMPLEMENT_IS_TYPE_B1(Audio_tempo, Audio_item);
72 Audio_meter::Audio_meter (Request* req_l)
73 : Audio_item (req_l)
77 Midi_item*
78 Audio_meter::midi_item_p()
80 return new Midi_meter (this);
82 IMPLEMENT_IS_TYPE_B1(Audio_meter, Audio_item);
84 Audio_text::Audio_text (Audio_text::Type type, String text_str)
85 : Audio_item (0)
87 text_str_ = text_str;
88 type_ = type;
91 Midi_item*
92 Audio_text::midi_item_p()
94 return text_str_.length_i() ? new Midi_text(this) : 0;
97 IMPLEMENT_IS_TYPE_B1(Audio_text, Audio_item);
99 IMPLEMENT_IS_TYPE_B1(Audio_item, Audio_element);
101 void
102 Audio_item::do_print () const
104 #ifndef NPRINT
105 if (audio_column_l_)
107 DOUT << "at: "<< audio_column_l_->at_mom ();
109 if (req_l_)
111 DOUT << "from: ";
112 req_l_->print ();
114 #endif