📄 sequencer.html
字号:
</DL><HR><A NAME="stopRecording()"><!-- --></A><H3>stopRecording</H3><PRE>public void <B>stopRecording</B>()</PRE><DL><DD>Stops recording, if active. Playback of the current sequence continues.<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#isRecording()"><CODE>isRecording()</CODE></A></DL></DD></DL><HR><A NAME="isRecording()"><!-- --></A><H3>isRecording</H3><PRE>public boolean <B>isRecording</B>()</PRE><DL><DD>Indicates whether the Sequencer is currently recording. The default is <code>false</code>. The Sequencer begins recording when <code><A HREF="../../../javax/sound/midi/Sequencer.html#startRecording()"><CODE>startRecording()</CODE></A></code> is called, and then returns <code>true</code> until <code><A HREF="../../../javax/sound/midi/Sequencer.html#stop()"><CODE>stop()</CODE></A></code> or <code><A HREF="../../../javax/sound/midi/Sequencer.html#stopRecording()"><CODE>stopRecording()</CODE></A></code> is called.<DD><DL></DL></DD><DD><DL><DT><B>Returns:</B><DD><code>true</code> if the Sequencer is recording, otherwise <code>false</code></DL></DD></DL><HR><A NAME="recordEnable(javax.sound.midi.Track, int)"><!-- --></A><H3>recordEnable</H3><PRE>public void <B>recordEnable</B>(<A HREF="../../../javax/sound/midi/Track.html">Track</A> track, int channel)</PRE><DL><DD>Prepares the specified track for recording events received on a particular channel. Once enabled, a track will receive events when recording is active.<DD><DL></DL></DD><DD><DL><DT><B>Parameters:</B><DD><CODE>track</CODE> - the track to which events will be recorded<DD><CODE>channel</CODE> - the channel on which events will be received. If -1 is specified for the channel value, the track will receive data from all channels.<DT><B>Throws:</B><DD><CODE><A HREF="../../../java/lang/IllegalArgumentException.html">IllegalArgumentException</A></CODE> - thrown if the track is not part of the current sequence.</DL></DD></DL><HR><A NAME="recordDisable(javax.sound.midi.Track)"><!-- --></A><H3>recordDisable</H3><PRE>public void <B>recordDisable</B>(<A HREF="../../../javax/sound/midi/Track.html">Track</A> track)</PRE><DL><DD>Disables recording to the specified track. Events will no longer be recorded into this track.<DD><DL></DL></DD><DD><DL><DT><B>Parameters:</B><DD><CODE>track</CODE> - the track to disable for recording, or <code>null</code> to disable recording for all tracks.</DL></DD></DL><HR><A NAME="getTempoInBPM()"><!-- --></A><H3>getTempoInBPM</H3><PRE>public float <B>getTempoInBPM</B>()</PRE><DL><DD>Obtains the current tempo, expressed in beats per minute. The actual tempo of playback is the product of the returned value and the tempo factor.<DD><DL></DL></DD><DD><DL><DT><B>Returns:</B><DD>the current tempo in beats per minute<DT><B>See Also: </B><DD><A HREF="../../../javax/sound/midi/Sequencer.html#getTempoFactor()"><CODE>getTempoFactor()</CODE></A>, <A HREF="../../../javax/sound/midi/Sequencer.html#setTempoInBPM(float)"><CODE>setTempoInBPM(float)</CODE></A>, <A HREF="../../../javax/sound/midi/Sequencer.html#getTempoInMPQ()"><CODE>getTempoInMPQ()</CODE></A></DL></DD></DL><HR><A NAME="setTempoInBPM(float)"><!-- --></A><H3>setTempoInBPM</H3><PRE>public void <B>setTempoInBPM</B>(float bpm)</PRE><DL><DD>Sets the tempo in beats per minute. The actual tempo of playback is the product of the specified value and the tempo factor.<DD><DL></DL></DD><DD><DL><DT><B>Parameters:</B><DD><CODE>bpm</CODE> - desired new tempo in beats per minute<DT><B>See Also: </B><DD><A HREF="../../../javax/sound/midi/Sequencer.html#getTempoFactor()"><CODE>getTempoFactor()</CODE></A>, <A HREF="../../../javax/sound/midi/Sequencer.html#setTempoInMPQ(float)"><CODE>setTempoInMPQ(float)</CODE></A>, <A HREF="../../../javax/sound/midi/Sequencer.html#getTempoInBPM()"><CODE>getTempoInBPM()</CODE></A></DL></DD></DL><HR><A NAME="getTempoInMPQ()"><!-- --></A><H3>getTempoInMPQ</H3><PRE>public float <B>getTempoInMPQ</B>()</PRE><DL><DD>Obtains the current tempo, expressed in microseconds per quarter note. The actual tempo of playback is the product of the returned value and the tempo factor.<DD><DL></DL></DD><DD><DL><DT><B>Returns:</B><DD>the current tempo in microseconds per quarter note<DT><B>See Also: </B><DD><A HREF="../../../javax/sound/midi/Sequencer.html#getTempoFactor()"><CODE>getTempoFactor()</CODE></A>, <A HREF="../../../javax/sound/midi/Sequencer.html#setTempoInMPQ(float)"><CODE>setTempoInMPQ(float)</CODE></A>, <A HREF="../../../javax/sound/midi/Sequencer.html#getTempoInBPM()"><CODE>getTempoInBPM()</CODE></A></DL></DD></DL><HR><A NAME="setTempoInMPQ(float)"><!-- --></A><H3>setTempoInMPQ</H3><PRE>public void <B>setTempoInMPQ</B>(float mpq)</PRE><DL><DD>Sets the tempo in microseconds per quarter note. The actual tempo of playback is the product of the specified value and the tempo factor.<DD><DL></DL></DD><DD><DL><DT><B>Parameters:</B><DD><CODE>mpq</CODE> - desired new tempo in microseconds per quarter note.<DT><B>See Also: </B><DD><A HREF="../../../javax/sound/midi/Sequencer.html#getTempoFactor()"><CODE>getTempoFactor()</CODE></A>, <A HREF="../../../javax/sound/midi/Sequencer.html#setTempoInBPM(float)"><CODE>setTempoInBPM(float)</CODE></A>, <A HREF="../../../javax/sound/midi/Sequencer.html#getTempoInMPQ()"><CODE>getTempoInMPQ()</CODE></A></DL></DD></DL><HR><A NAME="setTempoFactor(float)"><!-- --></A><H3>setTempoFactor</H3><PRE>public void <B>setTempoFactor</B>(float factor)</PRE><DL><DD>Scales the sequencer's actual playback tempo by the factor provided. The default is 1.0. A value of 1.0 represents the natural rate (the tempo specified in the sequence), 2.0 means twice as fast, etc. The tempo factor does not affect the values returned by <code><A HREF="../../../javax/sound/midi/Sequencer.html#getTempoInMPQ()"><CODE>getTempoInMPQ()</CODE></A></code> and <code><A HREF="../../../javax/sound/midi/Sequencer.html#getTempoInBPM()"><CODE>getTempoInBPM()</CODE></A></code>. Those values indicate the tempo prior to scaling. <p> Note that the tempo factor cannot be adjusted when external synchronization is used. In that situation, <code>setTempoFactor</code> always sets the tempo factor to 1.0.<DD><DL></DL></DD><DD><DL><DT><B>Parameters:</B><DD><CODE>factor</CODE> - the requested tempo scalar<DT><B>See Also: </B><DD><A HREF="../../../javax/sound/midi/Sequencer.html#getTempoFactor()"><CODE>getTempoFactor()</CODE></A></DL></DD></DL><HR><A NAME="getTempoFactor()"><!-- --></A><H3>getTempoFactor</H3><PRE>public float <B>getTempoFactor</B>()</PRE><DL><DD>Returns the current tempo factor for the sequencer. The default is 1.0.<DD><DL></DL></DD><DD><DL><DT><B>Returns:</B><DD>tempo factor.<DT><B>See Also: </B><DD><A HREF="../../../javax/sound/midi/Sequencer.html#setTempoFactor(float)"><CODE>setTempoFactor(float)</CODE></A></DL></DD></DL><HR><A NAME="getTickLength()"><!-- --></A><H3>getTickLength</H3><PRE>public long <B>getTickLength</B>()</PRE><DL><DD>Obtains the length of the current sequence, expressed in MIDI ticks.<DD><DL></DL></DD><DD><DL><DT><B>Returns:</B><DD>length of the sequence in ticks</DL></DD></DL><HR><A NAME="getTickPosition()"><!-- --></A><H3>getTickPosition</H3><PRE>public long <B>getTickPosition</B>()</PRE><DL><DD>Obtains the current position in the sequence, expressed in MIDI ticks. (The duration of a tick in seconds is determined both by the tempo and by the timing resolution stored in the <code><A HREF="../../../javax/sound/midi/Sequence.html"><CODE>Sequence</CODE></A></code>.)<DD><DL></DL></DD><DD><DL><DT><B>Returns:</B><DD>current tick<DT><B>See Also: </B><DD><A HREF="../../../javax/sound/midi/Sequencer.html#setTickPosition(long)"><CODE>setTickPosition(long)</CODE></A></DL></DD></DL><HR><A NAME="setTickPosition(long)"><!-- --></A><H3>setTickPosition</H3><PRE>public void <B>setTickPosition</B>(long tick)</PRE><DL><DD>Sets the current sequencer position in MIDI ticks<DD><DL></DL></DD><DD><DL><DT><B>Parameters:</B><DD><CODE>tick</CODE> - the desired tick position<DT><B>See Also: </B><DD><A HREF="../../../javax/sound/midi/Sequencer.html#getTickPosition()"><CODE>getTickPosition()</CODE></A></DL></DD></DL><HR><A NAME="getMicrosecondLength()"><!-- --></A><H3>getMicrosecondLength</H3><PRE>public long <B>getMicrosecondLength</B>()</PRE><DL><DD>Obtains the length of the current sequence, expressed in microseconds.<DD><DL></DL></DD><DD><DL><DT><B>Returns:</B><DD>length of the sequence in microseconds</DL></DD></DL><HR><A NAME="getMicrosecondPosition()"><!-- --></A><H3>getMicrosecondPosition</H3><PRE>public long <B>getMicrosecondPosition</B>()</PRE><DL><DD>Obtains the current position in the sequence, expressed in microseconds.<DD><DL><DT><B>Specified by: </B><DD><CODE><A HREF="../../../javax/sound/midi/MidiDevice.html#getMicrosecondPosition()">getMicrosecondPosition</A></CODE> in interface <CODE><A HREF="../../../javax/sound/midi/MidiDevice.html">MidiDevice</A></CODE></DL></DD><DD><DL><DT><B>Returns:</B><DD>the current position in microseconds<DT><B>See Also: </B><DD><A HREF="../../../javax/sound/midi/Sequencer.html#setMicrosecondPosition(long)"><CODE>setMicrosecondPosition(long)</CODE></A></DL></DD></DL><HR><A NAME="setMicrosecondPosition(long)"><!-- --></A><H3>setMicrosecondPosition</H3><PRE>public void <B>setMicrosecondPosition</B>(long microseconds)</PRE><DL><DD>Sets the current position in the sequence, expressed in microseconds<DD><DL></DL></DD><DD><DL><DT><B>Parameters:</B><DD><CODE>microseconds</CODE> - desired position in microseconds<DT><B>See Also: </B><DD><A HREF="../../../javax/sound/midi/Sequencer.html#getMicrosecondPosition()"><CODE>getMicrosecondPosition()</CODE></A></DL></DD></DL><HR><A NAME="setMasterSyncMode(javax.sound.midi.Sequencer.SyncMode)"><!-- --></A><H3>setMasterSyncMode</H3><PRE>public void <B>setMasterSyncMode</B>(<A HREF="../../../javax/sound/midi/Sequencer.SyncMode.html">Sequencer.SyncMode</A> sync)</PRE><DL><DD>Sets the source of timing information used by this sequencer. The sequencer synchronizes to the master, which is the internal clock, MIDI clock, or MIDI time code, depending on the value of <code>sync</code>. The <code>sync</code> argument must be one of the supported modes, as returned by <code><A HREF="../../../javax/sound/midi/Sequencer.html#getMasterSyncModes()"><CODE>getMasterSyncModes()</CODE></A></code>.<DD><DL></DL></DD><DD><DL><DT><B>Parameters:</B><DD><CODE>sync</CODE> - the desired master synchronization mode<DT><B>See Also: </B><DD><A HREF="../../../javax/sound/midi/Sequencer.SyncMode.html#INTERNAL_CLOCK"><CODE>Sequencer.SyncMode.INTERNAL_CLOCK</CODE></A>, <A HREF="../../../javax/sound/midi/Sequencer.SyncMode.html#MIDI_SYNC"><CODE>Sequencer.SyncMode.MIDI_SYNC</CODE></A>, <A HREF="../../../javax/sound/midi/Sequencer.SyncMode.html#MIDI_TIME_CODE"><CODE>Sequencer.SyncMode.MIDI_TIME_CODE</CODE></A>, <A HREF="../../../javax/sound/midi/Sequencer.html#getMasterSyncMode()"><CODE>getMasterSyncMode()</CODE></A></DL></DD></DL><HR><A NAME="getMasterSyncMode()"><!-- --></A><H3>getMasterSyncMode</H3><PRE>public <A HREF="../../../javax/sound/midi/Sequencer.SyncMode.html">Sequencer.SyncMode</A> <B>getMasterSyncMode</B>()</PRE><DL><DD>Obtains the current master synchronization mode for this sequencer.<DD><DL></DL></DD><DD><DL><DT><B>Returns:</B><DD>the current master synchronization mode<DT><B>See Also: </B><DD><A HREF="../../../javax/sound/midi/Sequencer.html#setMasterSyncMode(javax.sound.midi.Sequencer.SyncMode)"><CODE>setMasterSyncMode(Sequencer.SyncMode)</CODE></A>, <A HREF="../../../javax/sound/midi/Sequencer.html#getMasterSyncModes()"><CODE>getMasterSyncModes()</CODE></A></DL></DD></DL><HR>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -