📄 sequencer.html
字号:
<CODE> void</CODE></FONT></TD><TD><CODE><B><A HREF="../../../javax/sound/midi/Sequencer.html#recordDisable(javax.sound.midi.Track)">recordDisable</A></B>(<A HREF="../../../javax/sound/midi/Track.html">Track</A> track)</CODE><BR> Disables recording to the specified track.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE> void</CODE></FONT></TD><TD><CODE><B><A HREF="../../../javax/sound/midi/Sequencer.html#recordEnable(javax.sound.midi.Track, int)">recordEnable</A></B>(<A HREF="../../../javax/sound/midi/Track.html">Track</A> track, int channel)</CODE><BR> Prepares the specified track for recording events received on a particular channel.</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#removeControllerEventListener(javax.sound.midi.ControllerEventListener, int[])">removeControllerEventListener</A></B>(<A HREF="../../../javax/sound/midi/ControllerEventListener.html">ControllerEventListener</A> listener, int[] controllers)</CODE><BR> Removes a controller event listener's interest in one or more types of controller event.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE> void</CODE></FONT></TD><TD><CODE><B><A HREF="../../../javax/sound/midi/Sequencer.html#removeMetaEventListener(javax.sound.midi.MetaEventListener)">removeMetaEventListener</A></B>(<A HREF="../../../javax/sound/midi/MetaEventListener.html">MetaEventListener</A> listener)</CODE><BR> Removes the specified meta-event listener from this sequencer's list of registered listeners, if in fact the listener is registered.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE> void</CODE></FONT></TD><TD><CODE><B><A HREF="../../../javax/sound/midi/Sequencer.html#setMasterSyncMode(javax.sound.midi.Sequencer.SyncMode)">setMasterSyncMode</A></B>(<A HREF="../../../javax/sound/midi/Sequencer.SyncMode.html">Sequencer.SyncMode</A> sync)</CODE><BR> Sets the source of timing information used by this sequencer.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE> void</CODE></FONT></TD><TD><CODE><B><A HREF="../../../javax/sound/midi/Sequencer.html#setMicrosecondPosition(long)">setMicrosecondPosition</A></B>(long microseconds)</CODE><BR> Sets 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> void</CODE></FONT></TD><TD><CODE><B><A HREF="../../../javax/sound/midi/Sequencer.html#setSequence(java.io.InputStream)">setSequence</A></B>(<A HREF="../../../java/io/InputStream.html">InputStream</A> stream)</CODE><BR> Sets the current sequence on which the sequencer operates.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE> void</CODE></FONT></TD><TD><CODE><B><A HREF="../../../javax/sound/midi/Sequencer.html#setSequence(javax.sound.midi.Sequence)">setSequence</A></B>(<A HREF="../../../javax/sound/midi/Sequence.html">Sequence</A> sequence)</CODE><BR> Sets the current sequence on which the sequencer operates.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE> void</CODE></FONT></TD><TD><CODE><B><A HREF="../../../javax/sound/midi/Sequencer.html#setSlaveSyncMode(javax.sound.midi.Sequencer.SyncMode)">setSlaveSyncMode</A></B>(<A HREF="../../../javax/sound/midi/Sequencer.SyncMode.html">Sequencer.SyncMode</A> sync)</CODE><BR> Sets the slave synchronization mode for the sequencer.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE> void</CODE></FONT></TD><TD><CODE><B><A HREF="../../../javax/sound/midi/Sequencer.html#setTempoFactor(float)">setTempoFactor</A></B>(float factor)</CODE><BR> Scales the sequencer's actual playback tempo by the factor provided.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE> void</CODE></FONT></TD><TD><CODE><B><A HREF="../../../javax/sound/midi/Sequencer.html#setTempoInBPM(float)">setTempoInBPM</A></B>(float bpm)</CODE><BR> Sets the tempo in beats per minute.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE> void</CODE></FONT></TD><TD><CODE><B><A HREF="../../../javax/sound/midi/Sequencer.html#setTempoInMPQ(float)">setTempoInMPQ</A></B>(float mpq)</CODE><BR> Sets the tempo in microseconds per quarter note.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE> void</CODE></FONT></TD><TD><CODE><B><A HREF="../../../javax/sound/midi/Sequencer.html#setTickPosition(long)">setTickPosition</A></B>(long tick)</CODE><BR> Sets the current sequencer position in MIDI ticks</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE> void</CODE></FONT></TD><TD><CODE><B><A HREF="../../../javax/sound/midi/Sequencer.html#setTrackMute(int, boolean)">setTrackMute</A></B>(int track, boolean mute)</CODE><BR> Sets the mute state for a track.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE> void</CODE></FONT></TD><TD><CODE><B><A HREF="../../../javax/sound/midi/Sequencer.html#setTrackSolo(int, boolean)">setTrackSolo</A></B>(int track, boolean solo)</CODE><BR> Sets the solo state for a track.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE> void</CODE></FONT></TD><TD><CODE><B><A HREF="../../../javax/sound/midi/Sequencer.html#start()">start</A></B>()</CODE><BR> Starts playback of the MIDI data in the currently loaded sequence.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE> void</CODE></FONT></TD><TD><CODE><B><A HREF="../../../javax/sound/midi/Sequencer.html#startRecording()">startRecording</A></B>()</CODE><BR> Starts recording and playback of MIDI data.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE> void</CODE></FONT></TD><TD><CODE><B><A HREF="../../../javax/sound/midi/Sequencer.html#stop()">stop</A></B>()</CODE><BR> Stops recording, if active, and playback of the currently loaded sequence, if any.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE> void</CODE></FONT></TD><TD><CODE><B><A HREF="../../../javax/sound/midi/Sequencer.html#stopRecording()">stopRecording</A></B>()</CODE><BR> Stops recording, if active.</TD></TR></TABLE> <A NAME="methods_inherited_from_class_javax.sound.midi.MidiDevice"><!-- --></A><TABLE BORDER="1" CELLPADDING="3" CELLSPACING="0" WIDTH="100%"><TR BGCOLOR="#EEEEFF" CLASS="TableSubHeadingColor"><TD><B>Methods inherited from interface 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.html#close()">close</A>, <A HREF="../../../javax/sound/midi/MidiDevice.html#getDeviceInfo()">getDeviceInfo</A>, <A HREF="../../../javax/sound/midi/MidiDevice.html#getMaxReceivers()">getMaxReceivers</A>, <A HREF="../../../javax/sound/midi/MidiDevice.html#getMaxTransmitters()">getMaxTransmitters</A>, <A HREF="../../../javax/sound/midi/MidiDevice.html#getReceiver()">getReceiver</A>, <A HREF="../../../javax/sound/midi/MidiDevice.html#getTransmitter()">getTransmitter</A>, <A HREF="../../../javax/sound/midi/MidiDevice.html#isOpen()">isOpen</A>, <A HREF="../../../javax/sound/midi/MidiDevice.html#open()">open</A></CODE></TD></TR></TABLE> <P><!-- ============ FIELD DETAIL =========== --><!-- ========= CONSTRUCTOR DETAIL ======== --><!-- ============ METHOD DETAIL ========== --><A NAME="method_detail"><!-- --></A><TABLE BORDER="1" CELLPADDING="3" CELLSPACING="0" WIDTH="100%"><TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"><TD COLSPAN=1><FONT SIZE="+2"><B>Method Detail</B></FONT></TD></TR></TABLE><A NAME="setSequence(javax.sound.midi.Sequence)"><!-- --></A><H3>setSequence</H3><PRE>public void <B>setSequence</B>(<A HREF="../../../javax/sound/midi/Sequence.html">Sequence</A> sequence) throws <A HREF="../../../javax/sound/midi/InvalidMidiDataException.html">InvalidMidiDataException</A></PRE><DL><DD>Sets the current sequence on which the sequencer operates.<DD><DL></DL></DD><DD><DL><DT><B>Parameters:</B><DD><CODE>sequence</CODE> - the sequence to be loaded.<DT><B>Throws:</B><DD><CODE><A HREF="../../../javax/sound/midi/InvalidMidiDataException.html">InvalidMidiDataException</A></CODE> - if the sequence contains invalid MIDI data, or is not supported.</DL></DD></DL><HR><A NAME="setSequence(java.io.InputStream)"><!-- --></A><H3>setSequence</H3><PRE>public void <B>setSequence</B>(<A HREF="../../../java/io/InputStream.html">InputStream</A> stream) throws <A HREF="../../../java/io/IOException.html">IOException</A>, <A HREF="../../../javax/sound/midi/InvalidMidiDataException.html">InvalidMidiDataException</A></PRE><DL><DD>Sets the current sequence on which the sequencer operates. The stream must point to MIDI file data.<DD><DL></DL></DD><DD><DL><DT><B>Parameters:</B><DD><CODE>stream</CODE> - stream containing MIDI file data.<DT><B>Throws:</B><DD><CODE><A HREF="../../../java/io/IOException.html">IOException</A></CODE> - if an I/O exception occurs during reading of the stream.<DD><CODE><A HREF="../../../javax/sound/midi/InvalidMidiDataException.html">InvalidMidiDataException</A></CODE> - if invalid data is encountered in the stream, or the stream is not supported.</DL></DD></DL><HR><A NAME="getSequence()"><!-- --></A><H3>getSequence</H3><PRE>public <A HREF="../../../javax/sound/midi/Sequence.html">Sequence</A> <B>getSequence</B>()</PRE><DL><DD>Obtains the sequence on which the Sequencer is currently operating.<DD><DL></DL></DD><DD><DL><DT><B>Returns:</B><DD>the current sequence, or <code>null</code> if no sequence is currently set.</DL></DD></DL><HR><A NAME="start()"><!-- --></A><H3>start</H3><PRE>public void <B>start</B>()</PRE><DL><DD>Starts playback of the MIDI data in the currently loaded sequence.<DD><DL></DL></DD><DD><DL><DT><B>See Also: </B><DD><A HREF="../../../javax/sound/midi/Sequencer.html#start()"><CODE>start()</CODE></A>, <A HREF="../../../javax/sound/midi/Sequencer.html#stop()"><CODE>stop()</CODE></A></DL></DD></DL><HR><A NAME="stop()"><!-- --></A><H3>stop</H3><PRE>public void <B>stop</B>()</PRE><DL><DD>Stops recording, if active, and playback of the currently loaded sequence, if any.<DD><DL></DL></DD><DD><DL><DT><B>See Also: </B><DD><A HREF="../../../javax/sound/midi/Sequencer.html#start()"><CODE>start()</CODE></A>, <A HREF="../../../javax/sound/midi/Sequencer.html#isRunning()"><CODE>isRunning()</CODE></A></DL></DD></DL><HR><A NAME="isRunning()"><!-- --></A><H3>isRunning</H3><PRE>public boolean <B>isRunning</B>()</PRE><DL><DD>Indicates whether the Sequencer is currently running. The default is <code>false</code>. The Sequencer starts running when either <code><A HREF="../../../javax/sound/midi/Sequencer.html#start()"><CODE>start()</CODE></A></code> or <code><A HREF="../../../javax/sound/midi/Sequencer.html#startRecording()"><CODE>startRecording()</CODE></A></code> is called. <code>isRunning</code> then returns <code>true</code> until playback of the sequence completes or <code><A HREF="../../../javax/sound/midi/Sequencer.html#stop()"><CODE>stop()</CODE></A></code> is called.<DD><DL></DL></DD><DD><DL><DT><B>Returns:</B><DD><code>true</code> if the Sequencer is running, otherwise <code>false</code></DL></DD></DL><HR><A NAME="startRecording()"><!-- --></A><H3>startRecording</H3><PRE>public void <B>startRecording</B>()</PRE><DL><DD>Starts recording and playback of MIDI data. Data is recorded to all enabled tracks, on the channel(s) for which they were enabled. Recording begins at the current position of the sequencer. Any events already in the track are overwritten for the duration of the recording session. Events from the currently loaded sequence, if any, are delivered to the sequencer's MIDI OUT receiver(s) along with messages received during recording. <p> Note that tracks are not by default enabled for recording. In order to record MIDI data, at least one track must be specifically enabled for recording.<DD><DL></DL></DD><DD><DL><DT><B>See Also: </B><DD><A HREF="../../../javax/sound/midi/Sequencer.html#startRecording()"><CODE>startRecording()</CODE></A>, <A HREF="../../../javax/sound/midi/Sequencer.html#recordEnable(javax.sound.midi.Track, int)"><CODE>recordEnable(javax.sound.midi.Track, int)</CODE></A>, <A HREF="../../../javax/sound/midi/Sequencer.html#recordDisable(javax.sound.midi.Track)"><CODE>recordDisable(javax.sound.midi.Track)</CODE></A></DL></DD>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -