/*
* Copyright (c) 1999, 2016, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation. Oracle designates this
* particular file as subject to the "Classpath" exception as provided
* by Oracle in the LICENSE file that accompanied this code.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
package javax.sound.midi;
import java.util.Vector;
/**
* A {@code 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 {@code 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 {@code Sequence} can be created from a MIDI file by reading the file into
* an input stream and invoking one of the {@code getSequence} methods of
* {@link MidiSystem}. A sequence can also be built from scratch by adding new
* {@code Tracks} to an empty {@code Sequence}, and adding {@link MidiEvent}
* objects to these {@code Tracks}.
*
* @author Kara Kytle
* @see Sequencer#setSequence(java.io.InputStream stream)
* @see Sequencer#setSequence(Sequence sequence)
* @see Track#add(MidiEvent)
* @see MidiFileFormat
*/
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