2 score-performer.cc -- implement Score_performer
4 source file of the GNU LilyPond music typesetter
6 (c) 1996--2001 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"
19 ADD_THIS_TRANSLATOR (Score_performer);
22 Score_performer::Score_performer ()
28 Score_performer::~Score_performer ()
33 Score_performer::play_element (Audio_element * p)
35 if (Audio_item * i=dynamic_cast<Audio_item *> (p))
37 audio_column_l_->add_audio_item (i);
39 performance_p_->add_element (p);
43 Score_performer::announce_element (Audio_element_info info)
45 announce_info_arr_.push (info);
50 copied from score-engraver, but
51 this way staff gets in list twice
52 if (Audio_item* i = dynamic_cast<Audio_item*> (info.elem_l_))
53 performance_p_->add_element (i);
58 Score_performer::prepare (Moment m)
60 Global_translator::prepare (m);
61 audio_column_l_ = new Audio_column (m);
62 play_element (audio_column_l_);
63 post_move_processing ();
68 Score_performer::one_time_step ()
70 // fixme: put this back.
73 pre_move_processing ();
78 Score_performer::start ()
84 Score_performer::get_tempo_i () const
86 return performance_p_->midi_l_->get_tempo_i (Moment (1, 4));
90 Score_performer::finish ()
93 removal_processing ();
97 Score_performer::get_output_p ()
99 Music_output * o = performance_p_;
105 Score_performer::initialize ()
107 unsmob_translator_def (definition_)->apply_property_operations (this);
108 assert (dynamic_cast<Midi_def *> (output_def_l_));
109 performance_p_ = new Performance;
110 performance_p_->midi_l_ = dynamic_cast<Midi_def*> (output_def_l_);
112 Translator_group::initialize ();