X-Git-Url: https://git.donarmstrong.com/?a=blobdiff_plain;f=lily%2Fscore-performer.cc;h=4d231ff63a34fe2a72e2a82d32261a94f88a9cb3;hb=664070d837cc4855091455892cb942cdcedeef0c;hp=9c1e55f3c23365a6fecfd2af8a5f586a60f66cc6;hpb=02f736306b34d878f2e25ec7c1ab1fd980bb69f5;p=lilypond.git diff --git a/lily/score-performer.cc b/lily/score-performer.cc index 9c1e55f3c2..4d231ff63a 100644 --- a/lily/score-performer.cc +++ b/lily/score-performer.cc @@ -7,7 +7,6 @@ */ #include "score-performer.hh" -#include "midi-def.hh" #include "audio-column.hh" #include "audio-item.hh" #include "performance.hh" @@ -15,10 +14,11 @@ #include "string-convert.hh" #include "warn.hh" #include "context-def.hh" +#include "output-def.hh" -ENTER_DESCRIPTION(Score_performer, +ENTER_DESCRIPTION (Score_performer, /* descr */ "", /* creats*/ "", /* accepts */ "", @@ -51,54 +51,36 @@ void Score_performer::announce_element (Audio_element_info info) { announce_infos_.push (info); - - - /* - huh? - copied from score-engraver, but - this way staff gets in list twice - if (Audio_item* i = dynamic_cast (info.elem_)) - performance_->add_element (i); - */ } void Score_performer::prepare (Moment m) { - Global_translator::prepare (m); audio_column_ = new Audio_column (m); play_element (audio_column_); - start_translation_timestep (); + recurse_over_translators (context (), &Translator::start_translation_timestep, UP); } - -void -Score_performer::one_time_step () +void +Score_performer::finish () { - process_music (); - do_announces (); - stop_translation_timestep (); - check_removal (); + recurse_over_translators (context (), &Translator::finalize, UP); } - -void -Score_performer::start () + +void +Score_performer::one_time_step () { + recurse_over_translators (context (), &Performer::process_music, UP); + recurse_over_translators (context (), &Performer::do_announces, UP); + recurse_over_translators (context (), &Translator::stop_translation_timestep, UP); } - int Score_performer::get_tempo () const { - return performance_->midi_->get_tempo (Moment (Rational (1, 4))); + return ::get_tempo (performance_->midi_, Moment (Rational (1, 4))); } -void -Score_performer::finish () -{ - check_removal (); - finalize (); -} Music_output * Score_performer::get_output () @@ -111,9 +93,8 @@ Score_performer::get_output () void Score_performer::initialize () { - unsmob_context_def (definition_)->apply_default_property_operations (this); performance_ = new Performance; - performance_->midi_ = dynamic_cast (get_output_def ()); + performance_->midi_ = get_output_def (); Translator_group::initialize (); }