source file of the GNU LilyPond music typesetter
- (c) 1997--2005 Jan Nieuwenhuizen <janneke@gnu.org>
+ (c) 1997--2006 Jan Nieuwenhuizen <janneke@gnu.org>
*/
#include "music-sequence.hh"
protected:
virtual bool try_music (Music *ev);
- virtual void create_audio_elements ();
- virtual void stop_translation_timestep ();
+ void process_music ();
+ void stop_translation_timestep ();
private:
- Event *key_ev_;
+ Music *key_ev_;
Audio_key *audio_;
};
}
void
-Key_performer::create_audio_elements ()
+Key_performer::process_music ()
{
if (key_ev_)
{
bool minor = (scm_is_pair (third)
&& scm_is_integer (scm_cdr (third))
&& scm_to_int (scm_cdr (third)) == FLAT);
-
+
audio_ = new Audio_key (scm_to_int (acc),
!minor);
-
+
Audio_element_info info (audio_, key_ev_);
announce_element (info);
key_ev_ = 0;
bool
Key_performer::try_music (Music *ev)
{
- if (Event *kc = dynamic_cast<Event *> (ev))
- {
- if (!key_ev_)
- {
- key_ev_ = kc;
- }
-
- return true;
- }
+ if (!key_ev_)
+ key_ev_ = ev;
- return false;
+ return true;
}
+#include "translator.icc"
+
ADD_TRANSLATOR (Key_performer,
"", "",
"key-change-event",
- "", "", "");
+ "", "");