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"
10 #include "audio-column.hh"
11 #include "audio-item.hh"
12 #include "performance.hh"
13 #include "midi-stream.hh"
14 #include "string-convert.hh"
16 #include "context-def.hh"
17 #include "output-def.hh"
21 ENTER_DESCRIPTION (Score_performer,
30 Score_performer::Score_performer ()
36 Score_performer::~Score_performer ()
41 Score_performer::play_element (Audio_element * p)
43 if (Audio_item * i=dynamic_cast<Audio_item *> (p))
45 audio_column_->add_audio_item (i);
47 performance_->add_element (p);
51 Score_performer::announce_element (Audio_element_info info)
53 announce_infos_.push (info);
57 Score_performer::prepare (Moment m)
59 audio_column_ = new Audio_column (m);
60 play_element (audio_column_);
61 recurse_over_translators (context (), &Translator::start_translation_timestep, UP);
65 Score_performer::finish ()
67 recurse_over_translators (context (), &Translator::finalize, UP);
71 Score_performer::one_time_step ()
73 recurse_over_translators (context (), &Performer::process_music, UP);
74 recurse_over_translators (context (), &Performer::do_announces, UP);
75 recurse_over_translators (context (), &Translator::stop_translation_timestep, UP);
79 Score_performer::get_tempo () const
81 return ::get_tempo (performance_->midi_, Moment (Rational (1, 4)));
86 Score_performer::get_output ()
88 Music_output * o = performance_;
94 Score_performer::initialize ()
96 performance_ = new Performance;
97 performance_->midi_ = get_output_def ();
99 Translator_group::initialize ();