]> git.donarmstrong.com Git - lilypond.git/blob - lily/lyric-performer.cc
release: 0.0.77.jcn1
[lilypond.git] / lily / lyric-performer.cc
1 /*
2   lyric-performer.cc -- implement Lyric_performer
3
4   source file of the GNU LilyPond music typesetter
5
6   (c) 1997 Jan Nieuwenhuizen <jan@digicash.com>
7 */
8
9 #include "lyric-performer.hh"
10 #include "text-def.hh"
11 #include "musical-request.hh"
12 #include "midi-item.hh"
13
14
15
16 IMPLEMENT_IS_TYPE_B1(Lyric_performer,Performer);
17 ADD_THIS_PERFORMER(Lyric_performer);
18
19 Lyric_performer::Lyric_performer()
20 {
21 }
22
23 Lyric_performer::~Lyric_performer()
24 {
25 }
26
27 void 
28 Lyric_performer::do_print() const
29 {
30 #ifndef NPRINT
31     if ( lreq_arr_.size() )
32         lreq_arr_[ 0 ]->print();
33 #endif
34 }
35
36 void
37 Lyric_performer::process_requests()
38 {
39     if ( lreq_arr_.size() ) {
40         Midi_text t( Midi_text::LYRIC, lreq_arr_[ 0 ]->tdef_p_->text_str_ );
41         play_event( &t );
42     }
43
44     lreq_arr_.clear();
45 }
46
47 bool
48 Lyric_performer::do_try_request( Request* req_l )
49 {
50     Musical_req* m_l = req_l->musical();
51     if ( !m_l || ! m_l->lreq_l() ) 
52         return false;
53     lreq_arr_.push( m_l->lreq_l() );
54
55     return true;
56 }
57