📄 sequencer.html
字号:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Frameset//EN""http://www.w3.org/TR/REC-html40/frameset.dtd"><!--NewPage--><HTML><HEAD><!-- Generated by javadoc on Thu Apr 27 23:37:47 PDT 2000 --><TITLE>Java 2 Platform SE v1.3: Interface Sequencer</TITLE><LINK REL ="stylesheet" TYPE="text/css" HREF="../../../stylesheet.css" TITLE="Style"></HEAD><BODY BGCOLOR="white"><!-- ========== START OF NAVBAR ========== --><A NAME="navbar_top"><!-- --></A><TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0"><TR><TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1"><A NAME="navbar_top_firstrow"><!-- --></A><TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3"> <TR ALIGN="center" VALIGN="top"> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../overview-summary.html"><FONT CLASS="NavBarFont1"><B>Overview</B></FONT></A> </TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A> </TD> <TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> <FONT CLASS="NavBarFont1Rev"><B>Class</B></FONT> </TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="class-use/Sequencer.html"><FONT CLASS="NavBarFont1"><B>Use</B></FONT></A> </TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A> </TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A> </TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../index-files/index-1.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A> </TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A> </TD> </TR></TABLE></TD><TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM><b>Java<sup><font size=-2>TM</font></sup> 2 Platform<br>Std. Ed. v1.3</b></EM></TD></TR><TR><TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> <A HREF="../../../javax/sound/midi/Receiver.html"><B>PREV CLASS</B></A> <A HREF="../../../javax/sound/midi/Soundbank.html"><B>NEXT CLASS</B></A></FONT></TD><TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> <A HREF="../../../index.html" TARGET="_top"><B>FRAMES</B></A> <A HREF="Sequencer.html" TARGET="_top"><B>NO FRAMES</B></A></FONT></TD></TR><TR><TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2"> SUMMARY: <A HREF="#inner_class_summary">INNER</A> | FIELD | CONSTR | <A HREF="#method_summary">METHOD</A></FONT></TD><TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">DETAIL: FIELD | CONSTR | <A HREF="#method_detail">METHOD</A></FONT></TD></TR></TABLE><!-- =========== END OF NAVBAR =========== --><HR><!-- ======== START OF CLASS DATA ======== --><H2><FONT SIZE="-1">javax.sound.midi</FONT><BR>Interface Sequencer</H2><DL><DT><B>All Superinterfaces:</B> <DD><A HREF="../../../javax/sound/midi/MidiDevice.html">MidiDevice</A></DD></DL><HR><DL><DT>public interface <B>Sequencer</B><DT>extends <A HREF="../../../javax/sound/midi/MidiDevice.html">MidiDevice</A></DL><P>A hardware or software device that plays back a MIDI <code><A HREF="../../../javax/sound/midi/Sequence.html"><CODE>sequence</CODE></A></code> is known as a <em>sequencer</em>. A MIDI sequence contains lists of time-stamped MIDI data, such as might be read from a standard MIDI file. Most sequencers also provide functions for creating and editing sequences. <p> The <code>Sequencer</code> interface includes methods for the following basic MIDI sequencer operations: <ul> <li>obtaining a sequence from MIDI file data</li> <li>starting and stopping playback</li> <li>moving to an arbitrary position in the sequence</li> <li>changing the tempo (speed) of playback</li> <li>synchronizing playback to an internal clock or to received MIDI messages</li> <li>controlling the timing of another device</li> </ul> In addition, the following operations are supported, either directly, or indirectly through objects that the <code>Sequencer</code> has access to: <ul> <li>editing the data by adding or deleting individual MIDI events or entire tracks</li> <li>muting or soloing individual tracks in the sequence</li> <li>notifying listener objects about any meta-events or control-change events encountered while playing back the sequence.</li> </ul><P><DL><DT><B>See Also: </B><DD><A HREF="../../../javax/sound/midi/Sequencer.SyncMode.html"><CODE>Sequencer.SyncMode</CODE></A>, <A HREF="../../../javax/sound/midi/Sequencer.html#addMetaEventListener(javax.sound.midi.MetaEventListener)"><CODE>addMetaEventListener(javax.sound.midi.MetaEventListener)</CODE></A>, <A HREF="../../../javax/sound/midi/ControllerEventListener.html"><CODE>ControllerEventListener</CODE></A>, <A HREF="../../../javax/sound/midi/Receiver.html"><CODE>Receiver</CODE></A>, <A HREF="../../../javax/sound/midi/Transmitter.html"><CODE>Transmitter</CODE></A>, <A HREF="../../../javax/sound/midi/MidiDevice.html"><CODE>MidiDevice</CODE></A></DL><HR><P><!-- ======== INNER CLASS SUMMARY ======== --><A NAME="inner_class_summary"><!-- --></A><TABLE BORDER="1" CELLPADDING="3" CELLSPACING="0" WIDTH="100%"><TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"><TD COLSPAN=2><FONT SIZE="+2"><B>Inner Class Summary</B></FONT></TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE>static class</CODE></FONT></TD><TD><CODE><B><A HREF="../../../javax/sound/midi/Sequencer.SyncMode.html">Sequencer.SyncMode</A></B></CODE><BR> A <code>SyncMode</code> object represents one of the ways in which a MIDI sequencer's notion of time can be synchronized with a master or slave device.</TD></TR></TABLE> <A NAME="inner_classes_inherited_from_class_javax.sound.midi.MidiDevice"><!-- --></A><TABLE BORDER="1" CELLPADDING="3" CELLSPACING="0" WIDTH="100%"><TR BGCOLOR="#EEEEFF" CLASS="TableSubHeadingColor"><TD><B>Inner classes inherited from class javax.sound.midi.<A HREF="../../../javax/sound/midi/MidiDevice.html">MidiDevice</A></B></TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD><CODE><A HREF="../../../javax/sound/midi/MidiDevice.Info.html">MidiDevice.Info</A></CODE></TD></TR></TABLE> <!-- =========== FIELD SUMMARY =========== --><!-- ======== CONSTRUCTOR SUMMARY ======== --><!-- ========== METHOD SUMMARY =========== --><A NAME="method_summary"><!-- --></A><TABLE BORDER="1" CELLPADDING="3" CELLSPACING="0" WIDTH="100%"><TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"><TD COLSPAN=2><FONT SIZE="+2"><B>Method Summary</B></FONT></TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE> int[]</CODE></FONT></TD><TD><CODE><B><A HREF="../../../javax/sound/midi/Sequencer.html#addControllerEventListener(javax.sound.midi.ControllerEventListener, int[])">addControllerEventListener</A></B>(<A HREF="../../../javax/sound/midi/ControllerEventListener.html">ControllerEventListener</A> listener, int[] controllers)</CODE><BR> Registers a controller event listener to receive notification whenever the sequencer processes a control-change event of the requested type or types.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE> boolean</CODE></FONT></TD><TD><CODE><B><A HREF="../../../javax/sound/midi/Sequencer.html#addMetaEventListener(javax.sound.midi.MetaEventListener)">addMetaEventListener</A></B>(<A HREF="../../../javax/sound/midi/MetaEventListener.html">MetaEventListener</A> listener)</CODE><BR> Registers a meta-event listener to receive notification whenever a meta-event is encountered in the sequence and processed by the sequencer.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE> <A HREF="../../../javax/sound/midi/Sequencer.SyncMode.html">Sequencer.SyncMode</A></CODE></FONT></TD><TD><CODE><B><A HREF="../../../javax/sound/midi/Sequencer.html#getMasterSyncMode()">getMasterSyncMode</A></B>()</CODE><BR> Obtains the current master synchronization mode for this sequencer.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE> <A HREF="../../../javax/sound/midi/Sequencer.SyncMode.html">Sequencer.SyncMode</A>[]</CODE></FONT></TD><TD><CODE><B><A HREF="../../../javax/sound/midi/Sequencer.html#getMasterSyncModes()">getMasterSyncModes</A></B>()</CODE><BR> Obtains the set of master synchronization modes supported by this sequencer.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE> long</CODE></FONT></TD><TD><CODE><B><A HREF="../../../javax/sound/midi/Sequencer.html#getMicrosecondLength()">getMicrosecondLength</A></B>()</CODE><BR> Obtains the length of the current sequence, expressed in microseconds.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE> long</CODE></FONT></TD><TD><CODE><B><A HREF="../../../javax/sound/midi/Sequencer.html#getMicrosecondPosition()">getMicrosecondPosition</A></B>()</CODE><BR> Obtains the current position in the sequence, expressed in microseconds.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE> <A HREF="../../../javax/sound/midi/Sequence.html">Sequence</A></CODE></FONT></TD><TD><CODE><B><A HREF="../../../javax/sound/midi/Sequencer.html#getSequence()">getSequence</A></B>()</CODE><BR> Obtains the sequence on which the Sequencer is currently operating.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE> <A HREF="../../../javax/sound/midi/Sequencer.SyncMode.html">Sequencer.SyncMode</A></CODE></FONT></TD><TD><CODE><B><A HREF="../../../javax/sound/midi/Sequencer.html#getSlaveSyncMode()">getSlaveSyncMode</A></B>()</CODE><BR> Obtains the current slave synchronization mode for this sequencer.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE> <A HREF="../../../javax/sound/midi/Sequencer.SyncMode.html">Sequencer.SyncMode</A>[]</CODE></FONT></TD><TD><CODE><B><A HREF="../../../javax/sound/midi/Sequencer.html#getSlaveSyncModes()">getSlaveSyncModes</A></B>()</CODE><BR> Obtains the set of slave synchronization modes supported by the sequencer.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE> float</CODE></FONT></TD><TD><CODE><B><A HREF="../../../javax/sound/midi/Sequencer.html#getTempoFactor()">getTempoFactor</A></B>()</CODE><BR> Returns the current tempo factor for the sequencer.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE> float</CODE></FONT></TD><TD><CODE><B><A HREF="../../../javax/sound/midi/Sequencer.html#getTempoInBPM()">getTempoInBPM</A></B>()</CODE><BR> Obtains the current tempo, expressed in beats per minute.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE> float</CODE></FONT></TD><TD><CODE><B><A HREF="../../../javax/sound/midi/Sequencer.html#getTempoInMPQ()">getTempoInMPQ</A></B>()</CODE><BR> Obtains the current tempo, expressed in microseconds per quarter note.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE> long</CODE></FONT></TD><TD><CODE><B><A HREF="../../../javax/sound/midi/Sequencer.html#getTickLength()">getTickLength</A></B>()</CODE><BR> Obtains the length of the current sequence, expressed in MIDI ticks.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE> long</CODE></FONT></TD><TD><CODE><B><A HREF="../../../javax/sound/midi/Sequencer.html#getTickPosition()">getTickPosition</A></B>()</CODE><BR> Obtains the current position in the sequence, expressed in MIDI ticks.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE> boolean</CODE></FONT></TD><TD><CODE><B><A HREF="../../../javax/sound/midi/Sequencer.html#getTrackMute(int)">getTrackMute</A></B>(int track)</CODE><BR> Obtains the current mute state for a track.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE> boolean</CODE></FONT></TD><TD><CODE><B><A HREF="../../../javax/sound/midi/Sequencer.html#getTrackSolo(int)">getTrackSolo</A></B>(int track)</CODE><BR> Obtains the current solo state for a track.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE> boolean</CODE></FONT></TD><TD><CODE><B><A HREF="../../../javax/sound/midi/Sequencer.html#isRecording()">isRecording</A></B>()</CODE><BR> Indicates whether the Sequencer is currently recording.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE> boolean</CODE></FONT></TD><TD><CODE><B><A HREF="../../../javax/sound/midi/Sequencer.html#isRunning()">isRunning</A></B>()</CODE><BR> Indicates whether the Sequencer is currently running.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -