/*
* Copyright (c) 1999, 2004, Oracle and/or its affiliates. All rights reserved.
* ORACLE PROPRIETARY/CONFIDENTIAL. Use is subject to license terms.
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*/
package javax.sound.midi;
import java.util.Vector;
import com.sun.media.sound.MidiUtils;
/**
* A Sequence
is a data structure containing musical
* information (often an entire song or composition) that can be played
* back by a {@link Sequencer}
object. Specifically, the
* Sequence
contains timing
* information and one or more tracks. Each {@link Track track}
consists of a
* series of MIDI events (such as note-ons, note-offs, program changes, and meta-events).
* The sequence's timing information specifies the type of unit that is used
* to time-stamp the events in the sequence.
*
* A Sequence
can be created from a MIDI file by reading the file
* into an input stream and invoking one of the getSequence
methods of
* {@link MidiSystem}. A sequence can also be built from scratch by adding new
* Tracks
to an empty Sequence
, and adding
* {@link MidiEvent}
objects to these Tracks
.
*
* @see Sequencer#setSequence(java.io.InputStream stream)
* @see Sequencer#setSequence(Sequence sequence)
* @see Track#add(MidiEvent)
* @see MidiFileFormat
*
* @author Kara Kytle
*/
public class Sequence {
// Timing types
/**
* The tempo-based timing type, for which the resolution is expressed in pulses (ticks) per quarter note.
* @see #Sequence(float, int)
*/
public static final float PPQ = 0.0f;
/**
* The SMPTE-based timing type with 24 frames per second (resolution is expressed in ticks per frame).
* @see #Sequence(float, int)
*/
public static final float SMPTE_24 = 24.0f;
/**
* The SMPTE-based timing type with 25 frames per second (resolution is expressed in ticks per frame).
* @see #Sequence(float, int)
*/
public static final float SMPTE_25 = 25.0f;
/**
* The SMPTE-based timing type with 29.97 frames per second (resolution is expressed in ticks per frame).
* @see #Sequence(float, int)
*/
public static final float SMPTE_30DROP = 29.97f;
/**
* The SMPTE-based timing type with 30 frames per second (resolution is expressed in ticks per frame).
* @see #Sequence(float, int)
*/
public static final float SMPTE_30 = 30.0f;
// Variables
/**
* The timing division type of the sequence.
* @see #PPQ
* @see #SMPTE_24
* @see #SMPTE_25
* @see #SMPTE_30DROP
* @see #SMPTE_30
* @see #getDivisionType
*/
protected float divisionType;
/**
* The timing resolution of the sequence.
* @see #getResolution
*/
protected int resolution;
/**
* The MIDI tracks in this sequence.
* @see #getTracks
*/
protected Vector