]> git.donarmstrong.com Git - lilypond.git/blob - lily/score-performer.cc
release: 0.1.11
[lilypond.git] / lily / score-performer.cc
1 /*
2   score-performer.cc -- implement Score_performer
3
4   source file of the GNU LilyPond music typesetter
5
6   (c) 1996, 1997 Jan Nieuwenhuizen <jan@digicash.com>
7  */
8
9 #include "score-performer.hh"
10 #include "input-translator.hh"
11 #include "midi-def.hh"
12 #include "audio-column.hh"
13 #include "audio-item.hh"
14 #include "audio-score.hh"
15 #include "midi-stream.hh"
16 #include "string-convert.hh"
17 #include "debug.hh"
18 #include "score.hh"
19 #include "source-file.hh"
20 #include "source.hh"
21 #include "audio-staff.hh"
22
23 IMPLEMENT_IS_TYPE_B1(Score_performer,Performer_group_performer);
24
25 ADD_THIS_PERFORMER(Score_performer);
26
27
28 Score_performer::Score_performer()
29 {
30 }
31
32
33 Score_performer::~Score_performer()
34 {
35 }
36
37
38 Translator* 
39 Score_performer::ancestor_l (int l) 
40
41   return Global_translator::ancestor_l (l);
42 }
43
44
45 int 
46 Score_performer::depth_i() const 
47
48   return Global_translator::depth_i();
49 }
50
51
52
53 void
54 Score_performer::play (Audio_element * p)
55 {
56   if  (p->is_type_b (Audio_item::static_name())) 
57     {
58         audio_column_l_->add ((Audio_item*)p);
59     }
60   else if (p->is_type_b (Audio_staff::static_name())) 
61     {
62       performance_p_->add_staff ((Audio_staff*)p);
63     }
64   performance_p_->add (p);
65 }
66
67
68 void 
69 Score_performer::prepare (Moment m)
70 {
71   now_mom_ = m;
72   audio_column_l_ = new Audio_column (m);
73   performance_p_->add (audio_column_l_);
74 }
75
76
77 void 
78 Score_performer::process()
79 {
80   process_requests();
81 }
82
83
84
85 void
86 Score_performer::start()
87 {
88 }
89
90
91 int
92 Score_performer::get_tempo_i() const
93 {
94   return performance_p_->midi_l_->get_tempo_i (Moment (1, 4));
95 }
96
97 void
98 Score_performer::finish()
99 {
100   Performer_group_performer::do_removal_processing();
101 }
102
103 Music_output *
104 Score_performer::get_output_p ()
105 {
106   Music_output * o = performance_p_;
107   performance_p_ =0;
108   return o;
109 }