📄 midisystem.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:49 PDT 2000 --><TITLE>Java 2 Platform SE v1.3: Class MidiSystem</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/MidiSystem.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/MidiMessage.html"><B>PREV CLASS</B></A> <A HREF="../../../javax/sound/midi/Patch.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="MidiSystem.html" TARGET="_top"><B>NO FRAMES</B></A></FONT></TD></TR><TR><TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2"> SUMMARY: INNER | 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>Class MidiSystem</H2><PRE><A HREF="../../../java/lang/Object.html">java.lang.Object</A> | +--<B>javax.sound.midi.MidiSystem</B></PRE><HR><DL><DT>public class <B>MidiSystem</B><DT>extends <A HREF="../../../java/lang/Object.html">Object</A></DL><P>The <code>MidiSystem</code> class provides access to the installed MIDI system resources, including devices such as synthesizers, sequencers, and MIDI input and output ports. A typical simple MIDI application might begin by invoking one or more <code>MidiSystem</code> methods to learn what devices are installed and to obtain the ones needed in that application. <p> The class also has methods for reading files, streams, and URLs that contain standard MIDI file data or soundbanks. You can query the <code>MidiSystem</code> for the format of a specified MIDI file. <p> You cannot instantiate a <code>MidiSystem</code>; all the methods are static.<P><HR><P><!-- ======== INNER CLASS SUMMARY ======== --><!-- =========== 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>static <A HREF="../../../javax/sound/midi/MidiDevice.html">MidiDevice</A></CODE></FONT></TD><TD><CODE><B><A HREF="../../../javax/sound/midi/MidiSystem.html#getMidiDevice(javax.sound.midi.MidiDevice.Info)">getMidiDevice</A></B>(<A HREF="../../../javax/sound/midi/MidiDevice.Info.html">MidiDevice.Info</A> info)</CODE><BR> Obtains the requested MIDI device.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE>static <A HREF="../../../javax/sound/midi/MidiDevice.Info.html">MidiDevice.Info</A>[]</CODE></FONT></TD><TD><CODE><B><A HREF="../../../javax/sound/midi/MidiSystem.html#getMidiDeviceInfo()">getMidiDeviceInfo</A></B>()</CODE><BR> Obtains an array of information objects representing the set of all MIDI devices available on the system.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE>static <A HREF="../../../javax/sound/midi/MidiFileFormat.html">MidiFileFormat</A></CODE></FONT></TD><TD><CODE><B><A HREF="../../../javax/sound/midi/MidiSystem.html#getMidiFileFormat(java.io.File)">getMidiFileFormat</A></B>(<A HREF="../../../java/io/File.html">File</A> file)</CODE><BR> Obtains the MIDI file format of the specified <code>File</code>.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE>static <A HREF="../../../javax/sound/midi/MidiFileFormat.html">MidiFileFormat</A></CODE></FONT></TD><TD><CODE><B><A HREF="../../../javax/sound/midi/MidiSystem.html#getMidiFileFormat(java.io.InputStream)">getMidiFileFormat</A></B>(<A HREF="../../../java/io/InputStream.html">InputStream</A> stream)</CODE><BR> Obtains the MIDI file format of the data in the specified input stream.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE>static <A HREF="../../../javax/sound/midi/MidiFileFormat.html">MidiFileFormat</A></CODE></FONT></TD><TD><CODE><B><A HREF="../../../javax/sound/midi/MidiSystem.html#getMidiFileFormat(java.net.URL)">getMidiFileFormat</A></B>(<A HREF="../../../java/net/URL.html">URL</A> url)</CODE><BR> Obtains the MIDI file format of the data in the specified URL.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE>static int[]</CODE></FONT></TD><TD><CODE><B><A HREF="../../../javax/sound/midi/MidiSystem.html#getMidiFileTypes()">getMidiFileTypes</A></B>()</CODE><BR> Obtains the set of MIDI file types for which file writing support is provided by the system.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE>static int[]</CODE></FONT></TD><TD><CODE><B><A HREF="../../../javax/sound/midi/MidiSystem.html#getMidiFileTypes(javax.sound.midi.Sequence)">getMidiFileTypes</A></B>(<A HREF="../../../javax/sound/midi/Sequence.html">Sequence</A> sequence)</CODE><BR> Obtains the set of MIDI file types that the system can write from the sequence specified.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE>static <A HREF="../../../javax/sound/midi/Receiver.html">Receiver</A></CODE></FONT></TD><TD><CODE><B><A HREF="../../../javax/sound/midi/MidiSystem.html#getReceiver()">getReceiver</A></B>()</CODE><BR> Obtains a MIDI receiver from an external MIDI port or other default source.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE>static <A HREF="../../../javax/sound/midi/Sequence.html">Sequence</A></CODE></FONT></TD><TD><CODE><B><A HREF="../../../javax/sound/midi/MidiSystem.html#getSequence(java.io.File)">getSequence</A></B>(<A HREF="../../../java/io/File.html">File</A> file)</CODE><BR> Obtains a MIDI sequence from the specified <code>File</code>.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE>static <A HREF="../../../javax/sound/midi/Sequence.html">Sequence</A></CODE></FONT></TD><TD><CODE><B><A HREF="../../../javax/sound/midi/MidiSystem.html#getSequence(java.io.InputStream)">getSequence</A></B>(<A HREF="../../../java/io/InputStream.html">InputStream</A> stream)</CODE><BR> Obtains a MIDI sequence from the specified input stream.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE>static <A HREF="../../../javax/sound/midi/Sequence.html">Sequence</A></CODE></FONT></TD><TD><CODE><B><A HREF="../../../javax/sound/midi/MidiSystem.html#getSequence(java.net.URL)">getSequence</A></B>(<A HREF="../../../java/net/URL.html">URL</A> url)</CODE><BR> Obtains a MIDI sequence from the specified URL.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE>static <A HREF="../../../javax/sound/midi/Sequencer.html">Sequencer</A></CODE></FONT></TD><TD><CODE><B><A HREF="../../../javax/sound/midi/MidiSystem.html#getSequencer()">getSequencer</A></B>()</CODE><BR> Obtains the default sequencer.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE>static <A HREF="../../../javax/sound/midi/Soundbank.html">Soundbank</A></CODE></FONT></TD><TD><CODE><B><A HREF="../../../javax/sound/midi/MidiSystem.html#getSoundbank(java.io.File)">getSoundbank</A></B>(<A HREF="../../../java/io/File.html">File</A> file)</CODE><BR> Constructs a <code>Soundbank</code> by reading it from the specified <code>File</code>.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE>static <A HREF="../../../javax/sound/midi/Soundbank.html">Soundbank</A></CODE></FONT></TD><TD><CODE><B><A HREF="../../../javax/sound/midi/MidiSystem.html#getSoundbank(java.io.InputStream)">getSoundbank</A></B>(<A HREF="../../../java/io/InputStream.html">InputStream</A> stream)</CODE><BR> Constructs a MIDI sound bank by reading it from the specified stream.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE>static <A HREF="../../../javax/sound/midi/Soundbank.html">Soundbank</A></CODE></FONT></TD><TD><CODE><B><A HREF="../../../javax/sound/midi/MidiSystem.html#getSoundbank(java.net.URL)">getSoundbank</A></B>(<A HREF="../../../java/net/URL.html">URL</A> url)</CODE><BR> Constructs a <code>Soundbank</code> by reading it from the specified URL.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE>static <A HREF="../../../javax/sound/midi/Synthesizer.html">Synthesizer</A></CODE></FONT></TD><TD><CODE><B><A HREF="../../../javax/sound/midi/MidiSystem.html#getSynthesizer()">getSynthesizer</A></B>()</CODE><BR> Obtains the default synthesizer.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE>static <A HREF="../../../javax/sound/midi/Transmitter.html">Transmitter</A></CODE></FONT></TD><TD><CODE><B><A HREF="../../../javax/sound/midi/MidiSystem.html#getTransmitter()">getTransmitter</A></B>()</CODE><BR> Obtains a MIDI transmitter from an external MIDI port or other default source.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE>static boolean</CODE></FONT></TD><TD><CODE><B><A HREF="../../../javax/sound/midi/MidiSystem.html#isFileTypeSupported(int)">isFileTypeSupported</A></B>(int fileType)</CODE><BR> Indicates whether file writing support for the specified MIDI file type is provided by the system.</TD>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -