2 score-performer.cc -- implement Score_performer
4 source file of the GNU LilyPond music typesetter
6 (c) 1996--2004 Jan Nieuwenhuizen <janneke@gnu.org>
9 #include "score-performer.hh"
11 #include "audio-column.hh"
12 #include "audio-item.hh"
13 #include "performance.hh"
14 #include "midi-stream.hh"
15 #include "string-convert.hh"
17 #include "context-def.hh"
18 #include "output-def.hh"
20 ADD_TRANSLATOR (Score_performer,
29 Score_performer::Score_performer ()
35 Score_performer::~Score_performer ()
40 Score_performer::play_element (Audio_element * p)
42 if (Audio_item * i = dynamic_cast<Audio_item *> (p))
44 audio_column_->add_audio_item (i);
46 performance_->add_element (p);
50 Score_performer::announce_element (Audio_element_info info)
52 announce_infos_.push (info);
56 Score_performer::prepare (Moment m)
58 audio_column_ = new Audio_column (m);
59 play_element (audio_column_);
60 recurse_over_translators (context (), &Translator::start_translation_timestep, UP);
64 Score_performer::finish ()
66 recurse_over_translators (context (), &Translator::finalize, UP);
70 Score_performer::one_time_step ()
72 recurse_over_translators (context (), &Performer::process_music, UP);
73 recurse_over_translators (context (), &Performer::do_announces, UP);
74 recurse_over_translators (context (), &Translator::stop_translation_timestep, UP);
78 Score_performer::get_tempo () const
80 return ::get_tempo (performance_->midi_, Moment (Rational (1, 4)));
85 Score_performer::get_output ()
87 Music_output * o = performance_;
93 Score_performer::initialize ()
95 performance_ = new Performance;
96 performance_->midi_ = get_output_def ();
98 Translator_group::initialize ();