X-Git-Url: https://git.donarmstrong.com/?a=blobdiff_plain;f=lily%2Fkey-performer.cc;h=219454115a04dc673f2ce903d04d2be68afded22;hb=05d4dc393a4fa09b354470ab629d67ff1e7e05e8;hp=fa76c883a47989f98e01c5778c386040ea451125;hpb=d2762a4f1add2bb04d6fc34d3c7ae03eeb7d500f;p=lilypond.git diff --git a/lily/key-performer.cc b/lily/key-performer.cc index fa76c883a4..219454115a 100644 --- a/lily/key-performer.cc +++ b/lily/key-performer.cc @@ -22,6 +22,7 @@ #include "performer.hh" #include "stream-event.hh" #include "warn.hh" +#include "lily-imports.hh" #include "translator.icc" @@ -35,7 +36,7 @@ protected: void process_music (); void stop_translation_timestep (); - DECLARE_TRANSLATOR_LISTENER (key_change); + void listen_key_change (Stream_event *); private: Stream_event *key_ev_; Audio_key *audio_; @@ -57,9 +58,8 @@ Key_performer::process_music () if (key_ev_) { SCM pitchlist = key_ev_->get_property ("pitch-alist"); - SCM proc = ly_lily_module_constant ("alterations-in-key"); - SCM acc = scm_call_1 (proc, pitchlist); + SCM acc = Lily::alterations_in_key (pitchlist); Pitch key_do (0, scm_to_int (scm_caar (pitchlist)), @@ -98,7 +98,6 @@ Key_performer::stop_translation_timestep () } } -IMPLEMENT_TRANSLATOR_LISTENER (Key_performer, key_change); void Key_performer::listen_key_change (Stream_event *ev) { @@ -106,6 +105,12 @@ Key_performer::listen_key_change (Stream_event *ev) key_ev_ = ev; } +void +Key_performer::boot () +{ + ADD_LISTENER (Key_performer, key_change); +} + ADD_TRANSLATOR (Key_performer, /* doc */ "",