2 score-performer.cc -- implement Score_performer
4 source file of the GNU LilyPond music typesetter
6 (c) 1996--2002 Jan Nieuwenhuizen <janneke@gnu.org>
9 #include "score-performer.hh"
10 #include "midi-def.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 "translator-def.hh"
21 ENTER_DESCRIPTION(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_l_->add_audio_item (i);
46 performance_p_->add_element (p);
50 Score_performer::announce_element (Audio_element_info info)
52 announce_info_arr_.push (info);
57 copied from score-engraver, but
58 this way staff gets in list twice
59 if (Audio_item* i = dynamic_cast<Audio_item*> (info.elem_l_))
60 performance_p_->add_element (i);
65 Score_performer::prepare (Moment m)
67 Global_translator::prepare (m);
68 audio_column_l_ = new Audio_column (m);
69 play_element (audio_column_l_);
70 start_translation_timestep ();
75 Score_performer::one_time_step ()
77 // fixme: put this back.
80 stop_translation_timestep ();
85 Score_performer::start ()
91 Score_performer::get_tempo_i () const
93 return performance_p_->midi_l_->get_tempo_i (Moment (Rational (1, 4)));
97 Score_performer::finish ()
100 removal_processing ();
104 Score_performer::get_output_p ()
106 Music_output * o = performance_p_;
112 Score_performer::initialize ()
114 unsmob_translator_def (definition_)->apply_property_operations (this);
115 assert (dynamic_cast<Midi_def *> (output_def_l_));
116 performance_p_ = new Performance;
117 performance_p_->midi_l_ = dynamic_cast<Midi_def*> (output_def_l_);
119 Translator_group::initialize ();