package vermilion;

/**
 * An interface class dynamic classes can implement in order to register
 * themselves as the composer for the program. The composer's responsibilty is
 * to send events to the machines in the audio chain and to regulate audio
 * production between these events by knowing how many samples remain
 * until the next event.
 * 
 * This means in grand terms that this class is where things like a play and
 * stop button are actually implemented.
 *
 * There is an unavoidable coupling between the event and audio providers,
 * since the audio provider holds the actual instances of the machines in the
 * audio chain, and the event provider will provide events in a format that
 * feed the audio chain. Most of the work can be done through the document
 * so it is only during playback that this coupling occurs.
 */
public interface EventProvider
{
    /**
     * This is called by the audio thread when it is checking to see if there
     * are any events or if they will occur sooner than the next buffer end.
     * @return An EventCollection, a structure containing events and information
     * on when the next event occurs.
     */
    public EventCollection processEvents();
}
