X-Git-Url: https://git.donarmstrong.com/?a=blobdiff_plain;f=lily%2Fkey-performer.cc;h=e96c713ca2dc5cfc8a0f67972747f6a2bf8d108b;hb=029ae298e4c56984889a7fe47dbbc58f6c7055f4;hp=f27f0d85f4c3614c9f4b4c51fa488ccf3bb12b54;hpb=2536405e9584f63d559653183971c0fec57ba037;p=lilypond.git diff --git a/lily/key-performer.cc b/lily/key-performer.cc index f27f0d85f4..e96c713ca2 100644 --- a/lily/key-performer.cc +++ b/lily/key-performer.cc @@ -3,16 +3,14 @@ source file of the GNU LilyPond music typesetter - (c) 1997--2004 Jan Nieuwenhuizen + (c) 1997--2005 Jan Nieuwenhuizen */ -#include "lily-guile.hh" - +#include "music-sequence.hh" #include "audio-item.hh" #include "performer.hh" #include "warn.hh" - class Key_performer : public Performer { public: @@ -20,18 +18,18 @@ public: ~Key_performer (); protected: - virtual bool try_music (Music* req); + virtual bool try_music (Music* ev); virtual void create_audio_elements (); virtual void stop_translation_timestep (); private: - Key_change_ev* key_req_; + Event* key_ev_; Audio_key* audio_; }; Key_performer::Key_performer () { - key_req_ = 0; + key_ev_ = 0; audio_ = 0; } @@ -42,22 +40,22 @@ Key_performer::~Key_performer () void Key_performer::create_audio_elements () { - if (key_req_) + if (key_ev_) { - SCM pitchlist = key_req_->get_property ("pitch-alist"); - SCM proc = ly_scheme_function ("alterations-in-key"); + SCM pitchlist = key_ev_->get_property ("pitch-alist"); + SCM proc = ly_lily_module_constant ("alterations-in-key"); SCM acc = scm_call_1 (proc, pitchlist); Pitch key_do (0, - scm_to_int (ly_caar (pitchlist)), - scm_to_int (ly_cdar (pitchlist))); + scm_to_int (scm_caar (pitchlist)), + scm_to_int (scm_cdar (pitchlist))); Pitch c_do (0, 0, 0); SCM c_pitchlist = ly_transpose_key_alist (pitchlist, - interval (key_do, c_do).smobbed_copy ()); + pitch_interval (key_do, c_do).smobbed_copy ()); /* MIDI keys are too limited for lilypond scales. We check for minor scale and assume major otherwise. */ @@ -65,9 +63,9 @@ Key_performer::create_audio_elements () audio_ = new Audio_key (scm_to_int (acc), SCM_BOOL_T != scm_equal_p (minor, c_pitchlist)); - Audio_element_info info (audio_, key_req_); + Audio_element_info info (audio_, key_ev_); announce_element (info); - key_req_ = 0; + key_ev_ = 0; } } @@ -82,21 +80,21 @@ Key_performer::stop_translation_timestep () } bool -Key_performer::try_music (Music* req) +Key_performer::try_music (Music* ev) { - if (Key_change_ev *kc = dynamic_cast (req)) + if (Event *kc = dynamic_cast (ev)) { - if (key_req_) + if (key_ev_) warning (_ ("FIXME: key change merge")); - key_req_ = kc; + key_ev_ = kc; return true; } return false; } -ENTER_DESCRIPTION (Key_performer, - "","", +ADD_TRANSLATOR (Key_performer, + "", "", "key-change-event", - "","",""); + "", "", "");