lilypond-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

translators / engravers / performers


From: David Santamauro
Subject: translators / engravers / performers
Date: Fri, 26 Nov 2010 06:26:08 -0500

Greetings,

After browsing the code for a couple weeks, I have a few questions.
First, though, if there is a skeleton Performer, commented thoroughly,
please disregard the rest of this email and point me to it. Otherwise...


What makes up a skeleton performer?

// definition as subclass of "Performer"
class Skeleton_performer : public Performer
{

public:
  // standard declarations common to all translators
  TRANSLATOR_DECLARATIONS (Skeleton_performer);

protected:
  // methods this performer wishes to override
  void start_translation_timestep ();
  void process_music ();
  void stop_translation_timestep ();

  // this was taken from piano-pedal-performer.cc
  // I'm assuming this is what this performer is
  // is interested in "listening" to but what is
  // is being listened to? I don't see where the
  // symbol 'sustain' is defined.
  // DECLARE_TRANSLATOR_LISTENER (sustain);
  // .. and my own
  DECLARE_TRANSLATOR_LISTENER (mySymbol);
  // My best guess is that a command \mySymbol
  // is what is being listened to and acted upon
}

// here is the actual implementation of the
// mySymbol listener
IMPLEMENT_TRANSLATOR_LISTENER (Skeleton_performer, mySymbol);
void
Skeleton_performer::listen_mySymbol(Stream_event *ev)
{
  // do something
}

// register new performer
ADD_TRANSLATOR (Skeleton_performer,
                /* doc */
                "something that does nothing",

                /* create: CREATE WHAT? */
                "",

                /* read: READ WHAT? */
                "",

                /* write: WRITE WHAT? */
                ""
                );

So a few major questions:

1) what are the real steps to register a performer? Does this include
possible initialization / registration in an .ly script or is the class
definition sufficient?

2) what are the overridable methods and what is the order and function
of each in the grand concept of a performer (or engraver).

I guess this is enough to digest for the moment. Any answers to the
above comments / questions will surely provide me more fuel for further
research.

Thanks for your time,

David




reply via email to

[Prev in Thread] Current Thread [Next in Thread]