Java 类javax.sound.midi.spi.SoundbankReader 实例源码

项目:OpenJSharp    文件:JDK13Services.java   
/**
 * Obtains a List containing installed instances of the providers for the
 * requested service. The returned List is immutable.
 *
 * @param serviceClass The type of providers requested. This should be one
 *                     of AudioFileReader.class, AudioFileWriter.class,
 *                     FormatConversionProvider.class, MixerProvider.class,
 *                     MidiDeviceProvider.class, MidiFileReader.class,
 *                     MidiFileWriter.class or SoundbankReader.class.
 *
 * @return A List of providers of the requested type. This List is
 *         immutable.
 */
public static List<?> getProviders(final Class<?> serviceClass) {
    final List<?> providers;
    if (!MixerProvider.class.equals(serviceClass)
            && !FormatConversionProvider.class.equals(serviceClass)
            && !AudioFileReader.class.equals(serviceClass)
            && !AudioFileWriter.class.equals(serviceClass)
            && !MidiDeviceProvider.class.equals(serviceClass)
            && !SoundbankReader.class.equals(serviceClass)
            && !MidiFileWriter.class.equals(serviceClass)
            && !MidiFileReader.class.equals(serviceClass)) {
        providers = new ArrayList<>(0);
    } else {
        providers = JSSecurityManager.getProviders(serviceClass);
    }
    return Collections.unmodifiableList(providers);
}
项目:jdk8u-jdk    文件:JDK13Services.java   
/**
 * Obtains a List containing installed instances of the providers for the
 * requested service. The returned List is immutable.
 *
 * @param serviceClass The type of providers requested. This should be one
 *                     of AudioFileReader.class, AudioFileWriter.class,
 *                     FormatConversionProvider.class, MixerProvider.class,
 *                     MidiDeviceProvider.class, MidiFileReader.class,
 *                     MidiFileWriter.class or SoundbankReader.class.
 *
 * @return A List of providers of the requested type. This List is
 *         immutable.
 */
public static List<?> getProviders(final Class<?> serviceClass) {
    final List<?> providers;
    if (!MixerProvider.class.equals(serviceClass)
            && !FormatConversionProvider.class.equals(serviceClass)
            && !AudioFileReader.class.equals(serviceClass)
            && !AudioFileWriter.class.equals(serviceClass)
            && !MidiDeviceProvider.class.equals(serviceClass)
            && !SoundbankReader.class.equals(serviceClass)
            && !MidiFileWriter.class.equals(serviceClass)
            && !MidiFileReader.class.equals(serviceClass)) {
        providers = new ArrayList<>(0);
    } else {
        providers = JSSecurityManager.getProviders(serviceClass);
    }
    return Collections.unmodifiableList(providers);
}
项目:openjdk-jdk10    文件:JDK13Services.java   
/**
 * Obtains a List containing installed instances of the providers for the
 * requested service. The returned List is immutable.
 *
 * @param serviceClass The type of providers requested. This should be one
 *                     of AudioFileReader.class, AudioFileWriter.class,
 *                     FormatConversionProvider.class, MixerProvider.class,
 *                     MidiDeviceProvider.class, MidiFileReader.class,
 *                     MidiFileWriter.class or SoundbankReader.class.
 *
 * @return A List of providers of the requested type. This List is
 *         immutable.
 */
public static List<?> getProviders(final Class<?> serviceClass) {
    final List<?> providers;
    if (!MixerProvider.class.equals(serviceClass)
            && !FormatConversionProvider.class.equals(serviceClass)
            && !AudioFileReader.class.equals(serviceClass)
            && !AudioFileWriter.class.equals(serviceClass)
            && !MidiDeviceProvider.class.equals(serviceClass)
            && !SoundbankReader.class.equals(serviceClass)
            && !MidiFileWriter.class.equals(serviceClass)
            && !MidiFileReader.class.equals(serviceClass)) {
        providers = new ArrayList<>(0);
    } else {
        providers = JSSecurityManager.getProviders(serviceClass);
    }
    return Collections.unmodifiableList(providers);
}
项目:openjdk-jdk10    文件:MidiSystem.java   
/**
 * Constructs a MIDI sound bank by reading it from the specified stream. The
 * stream must point to a valid MIDI soundbank file. In general, MIDI
 * soundbank providers may need to read some data from the stream before
 * determining whether they support it. These parsers must be able to mark
 * the stream, read enough data to determine whether they support the
 * stream, and, if not, reset the stream's read pointer to its original
 * position. If the input stream does not support this, this method may fail
 * with an {@code IOException}.
 *
 * @param  stream the source of the sound bank data
 * @return the sound bank
 * @throws InvalidMidiDataException if the stream does not point to valid
 *         MIDI soundbank data recognized by the system
 * @throws IOException if an I/O error occurred when loading the soundbank
 * @throws NullPointerException if {@code stream} is {@code null}
 * @see InputStream#markSupported
 * @see InputStream#mark
 */
public static Soundbank getSoundbank(final InputStream stream)
        throws InvalidMidiDataException, IOException {
    Objects.requireNonNull(stream);

    SoundbankReader sp = null;
    Soundbank s = null;

    List<SoundbankReader> providers = getSoundbankReaders();

    for(int i = 0; i < providers.size(); i++) {
        sp = providers.get(i);
        s = sp.getSoundbank(stream);

        if( s!= null) {
            return s;
        }
    }
    throw new InvalidMidiDataException("cannot get soundbank from stream");

}
项目:openjdk-jdk10    文件:MidiSystem.java   
/**
 * Constructs a {@code Soundbank} by reading it from the specified URL. The
 * URL must point to a valid MIDI soundbank file.
 *
 * @param  url the source of the sound bank data
 * @return the sound bank
 * @throws InvalidMidiDataException if the URL does not point to valid MIDI
 *         soundbank data recognized by the system
 * @throws IOException if an I/O error occurred when loading the soundbank
 * @throws NullPointerException if {@code url} is {@code null}
 */
public static Soundbank getSoundbank(final URL url)
        throws InvalidMidiDataException, IOException {
    Objects.requireNonNull(url);

    SoundbankReader sp = null;
    Soundbank s = null;

    List<SoundbankReader> providers = getSoundbankReaders();

    for(int i = 0; i < providers.size(); i++) {
        sp = providers.get(i);
        s = sp.getSoundbank(url);

        if( s!= null) {
            return s;
        }
    }
    throw new InvalidMidiDataException("cannot get soundbank from stream");

}
项目:openjdk-jdk10    文件:MidiSystem.java   
/**
 * Constructs a {@code Soundbank} by reading it from the specified
 * {@code File}. The {@code File} must point to a valid MIDI soundbank file.
 *
 * @param  file the source of the sound bank data
 * @return the sound bank
 * @throws InvalidMidiDataException if the {@code File} does not point to
 *         valid MIDI soundbank data recognized by the system
 * @throws IOException if an I/O error occurred when loading the soundbank
 * @throws NullPointerException if {@code file} is {@code null}
 */
public static Soundbank getSoundbank(final File file)
        throws InvalidMidiDataException, IOException {
    Objects.requireNonNull(file);

    SoundbankReader sp = null;
    Soundbank s = null;

    List<SoundbankReader> providers = getSoundbankReaders();

    for(int i = 0; i < providers.size(); i++) {
        sp = providers.get(i);
        s = sp.getSoundbank(file);

        if( s!= null) {
            return s;
        }
    }
    throw new InvalidMidiDataException("cannot get soundbank from stream");
}
项目:openjdk9    文件:JDK13Services.java   
/**
 * Obtains a List containing installed instances of the providers for the
 * requested service. The returned List is immutable.
 *
 * @param serviceClass The type of providers requested. This should be one
 *                     of AudioFileReader.class, AudioFileWriter.class,
 *                     FormatConversionProvider.class, MixerProvider.class,
 *                     MidiDeviceProvider.class, MidiFileReader.class,
 *                     MidiFileWriter.class or SoundbankReader.class.
 *
 * @return A List of providers of the requested type. This List is
 *         immutable.
 */
public static List<?> getProviders(final Class<?> serviceClass) {
    final List<?> providers;
    if (!MixerProvider.class.equals(serviceClass)
            && !FormatConversionProvider.class.equals(serviceClass)
            && !AudioFileReader.class.equals(serviceClass)
            && !AudioFileWriter.class.equals(serviceClass)
            && !MidiDeviceProvider.class.equals(serviceClass)
            && !SoundbankReader.class.equals(serviceClass)
            && !MidiFileWriter.class.equals(serviceClass)
            && !MidiFileReader.class.equals(serviceClass)) {
        providers = new ArrayList<>(0);
    } else {
        providers = JSSecurityManager.getProviders(serviceClass);
    }
    return Collections.unmodifiableList(providers);
}
项目:openjdk9    文件:MidiSystem.java   
/**
 * Constructs a MIDI sound bank by reading it from the specified stream. The
 * stream must point to a valid MIDI soundbank file. In general, MIDI
 * soundbank providers may need to read some data from the stream before
 * determining whether they support it. These parsers must be able to mark
 * the stream, read enough data to determine whether they support the
 * stream, and, if not, reset the stream's read pointer to its original
 * position. If the input stream does not support this, this method may fail
 * with an {@code IOException}.
 *
 * @param  stream the source of the sound bank data
 * @return the sound bank
 * @throws InvalidMidiDataException if the stream does not point to valid
 *         MIDI soundbank data recognized by the system
 * @throws IOException if an I/O error occurred when loading the soundbank
 * @throws NullPointerException if {@code stream} is {@code null}
 * @see InputStream#markSupported
 * @see InputStream#mark
 */
public static Soundbank getSoundbank(final InputStream stream)
        throws InvalidMidiDataException, IOException {
    Objects.requireNonNull(stream);

    SoundbankReader sp = null;
    Soundbank s = null;

    List<SoundbankReader> providers = getSoundbankReaders();

    for(int i = 0; i < providers.size(); i++) {
        sp = providers.get(i);
        s = sp.getSoundbank(stream);

        if( s!= null) {
            return s;
        }
    }
    throw new InvalidMidiDataException("cannot get soundbank from stream");

}
项目:openjdk9    文件:MidiSystem.java   
/**
 * Constructs a {@code Soundbank} by reading it from the specified URL. The
 * URL must point to a valid MIDI soundbank file.
 *
 * @param  url the source of the sound bank data
 * @return the sound bank
 * @throws InvalidMidiDataException if the URL does not point to valid MIDI
 *         soundbank data recognized by the system
 * @throws IOException if an I/O error occurred when loading the soundbank
 * @throws NullPointerException if {@code url} is {@code null}
 */
public static Soundbank getSoundbank(final URL url)
        throws InvalidMidiDataException, IOException {
    Objects.requireNonNull(url);

    SoundbankReader sp = null;
    Soundbank s = null;

    List<SoundbankReader> providers = getSoundbankReaders();

    for(int i = 0; i < providers.size(); i++) {
        sp = providers.get(i);
        s = sp.getSoundbank(url);

        if( s!= null) {
            return s;
        }
    }
    throw new InvalidMidiDataException("cannot get soundbank from stream");

}
项目:openjdk9    文件:MidiSystem.java   
/**
 * Constructs a {@code Soundbank} by reading it from the specified
 * {@code File}. The {@code File} must point to a valid MIDI soundbank file.
 *
 * @param  file the source of the sound bank data
 * @return the sound bank
 * @throws InvalidMidiDataException if the {@code File} does not point to
 *         valid MIDI soundbank data recognized by the system
 * @throws IOException if an I/O error occurred when loading the soundbank
 * @throws NullPointerException if {@code file} is {@code null}
 */
public static Soundbank getSoundbank(final File file)
        throws InvalidMidiDataException, IOException {
    Objects.requireNonNull(file);

    SoundbankReader sp = null;
    Soundbank s = null;

    List<SoundbankReader> providers = getSoundbankReaders();

    for(int i = 0; i < providers.size(); i++) {
        sp = providers.get(i);
        s = sp.getSoundbank(file);

        if( s!= null) {
            return s;
        }
    }
    throw new InvalidMidiDataException("cannot get soundbank from stream");
}
项目:jdk8u_jdk    文件:JDK13Services.java   
/**
 * Obtains a List containing installed instances of the providers for the
 * requested service. The returned List is immutable.
 *
 * @param serviceClass The type of providers requested. This should be one
 *                     of AudioFileReader.class, AudioFileWriter.class,
 *                     FormatConversionProvider.class, MixerProvider.class,
 *                     MidiDeviceProvider.class, MidiFileReader.class,
 *                     MidiFileWriter.class or SoundbankReader.class.
 *
 * @return A List of providers of the requested type. This List is
 *         immutable.
 */
public static List<?> getProviders(final Class<?> serviceClass) {
    final List<?> providers;
    if (!MixerProvider.class.equals(serviceClass)
            && !FormatConversionProvider.class.equals(serviceClass)
            && !AudioFileReader.class.equals(serviceClass)
            && !AudioFileWriter.class.equals(serviceClass)
            && !MidiDeviceProvider.class.equals(serviceClass)
            && !SoundbankReader.class.equals(serviceClass)
            && !MidiFileWriter.class.equals(serviceClass)
            && !MidiFileReader.class.equals(serviceClass)) {
        providers = new ArrayList<>(0);
    } else {
        providers = JSSecurityManager.getProviders(serviceClass);
    }
    return Collections.unmodifiableList(providers);
}
项目:lookaside_java-1.8.0-openjdk    文件:JDK13Services.java   
/**
 * Obtains a List containing installed instances of the providers for the
 * requested service. The returned List is immutable.
 *
 * @param serviceClass The type of providers requested. This should be one
 *                     of AudioFileReader.class, AudioFileWriter.class,
 *                     FormatConversionProvider.class, MixerProvider.class,
 *                     MidiDeviceProvider.class, MidiFileReader.class,
 *                     MidiFileWriter.class or SoundbankReader.class.
 *
 * @return A List of providers of the requested type. This List is
 *         immutable.
 */
public static List<?> getProviders(final Class<?> serviceClass) {
    final List<?> providers;
    if (!MixerProvider.class.equals(serviceClass)
            && !FormatConversionProvider.class.equals(serviceClass)
            && !AudioFileReader.class.equals(serviceClass)
            && !AudioFileWriter.class.equals(serviceClass)
            && !MidiDeviceProvider.class.equals(serviceClass)
            && !SoundbankReader.class.equals(serviceClass)
            && !MidiFileWriter.class.equals(serviceClass)
            && !MidiFileReader.class.equals(serviceClass)) {
        providers = new ArrayList<>(0);
    } else {
        providers = JSSecurityManager.getProviders(serviceClass);
    }
    return Collections.unmodifiableList(providers);
}
项目:infobip-open-jdk-8    文件:JDK13Services.java   
/**
 * Obtains a List containing installed instances of the providers for the
 * requested service. The returned List is immutable.
 *
 * @param serviceClass The type of providers requested. This should be one
 *                     of AudioFileReader.class, AudioFileWriter.class,
 *                     FormatConversionProvider.class, MixerProvider.class,
 *                     MidiDeviceProvider.class, MidiFileReader.class,
 *                     MidiFileWriter.class or SoundbankReader.class.
 *
 * @return A List of providers of the requested type. This List is
 *         immutable.
 */
public static List<?> getProviders(final Class<?> serviceClass) {
    final List<?> providers;
    if (!MixerProvider.class.equals(serviceClass)
            && !FormatConversionProvider.class.equals(serviceClass)
            && !AudioFileReader.class.equals(serviceClass)
            && !AudioFileWriter.class.equals(serviceClass)
            && !MidiDeviceProvider.class.equals(serviceClass)
            && !SoundbankReader.class.equals(serviceClass)
            && !MidiFileWriter.class.equals(serviceClass)
            && !MidiFileReader.class.equals(serviceClass)) {
        providers = new ArrayList<>(0);
    } else {
        providers = JSSecurityManager.getProviders(serviceClass);
    }
    return Collections.unmodifiableList(providers);
}
项目:jdk8u-dev-jdk    文件:JDK13Services.java   
/**
 * Obtains a List containing installed instances of the providers for the
 * requested service. The returned List is immutable.
 *
 * @param serviceClass The type of providers requested. This should be one
 *                     of AudioFileReader.class, AudioFileWriter.class,
 *                     FormatConversionProvider.class, MixerProvider.class,
 *                     MidiDeviceProvider.class, MidiFileReader.class,
 *                     MidiFileWriter.class or SoundbankReader.class.
 *
 * @return A List of providers of the requested type. This List is
 *         immutable.
 */
public static List<?> getProviders(final Class<?> serviceClass) {
    final List<?> providers;
    if (!MixerProvider.class.equals(serviceClass)
            && !FormatConversionProvider.class.equals(serviceClass)
            && !AudioFileReader.class.equals(serviceClass)
            && !AudioFileWriter.class.equals(serviceClass)
            && !MidiDeviceProvider.class.equals(serviceClass)
            && !SoundbankReader.class.equals(serviceClass)
            && !MidiFileWriter.class.equals(serviceClass)
            && !MidiFileReader.class.equals(serviceClass)) {
        providers = new ArrayList<>(0);
    } else {
        providers = JSSecurityManager.getProviders(serviceClass);
    }
    return Collections.unmodifiableList(providers);
}
项目:cn1    文件:MidiSystem.java   
public static Soundbank getSoundbank(File file) throws InvalidMidiDataException,
        IOException {
    /*
     * obtain the list of SoundbankReaderProviders
     */
    List<?> soundbankReaderProviders = ProviderService.getProviders(soundbankReaderPath);
    if (soundbankReaderProviders.size() == 0) {
        //FIXME
        /*
         * I don't understand what type of exception we should throw out if we haven't
         * appropriate providers...
         * Maybe here is should be MidiUnavailableException
         */
        throw new Error(Messages.getString("sound.1D"));
    }
    /*
     * It's not determine what provider for this service I should to use, and so
     * I use the first one
     */
    return ((SoundbankReader) soundbankReaderProviders.get(0)).getSoundbank(file);
}
项目:cn1    文件:MidiSystem.java   
public static Soundbank getSoundbank(InputStream stream) throws InvalidMidiDataException, IOException {
    /*
     * obtain the list of SoundbankReaderProviders
     */
    List<?> soundbankReaderProviders = ProviderService.getProviders(soundbankReaderPath);
    if (soundbankReaderProviders.size() == 0) {
        //FIXME
        /*
         * I don't understand what type of exception we should throw out if we haven't
         * appropriate providers...
         * Maybe here is should be MidiUnavailableException
         */
        throw new Error(Messages.getString("sound.1D"));
    }
    /*
     * It's not determine what provider for this service I should to use, and so
     * I use the first one
     */
    return ((SoundbankReader) soundbankReaderProviders.get(0)).getSoundbank(stream);
}
项目:cn1    文件:MidiSystem.java   
public static Soundbank getSoundbank(URL url) throws InvalidMidiDataException, IOException {
    /*
     * obtain the list of SoundbankReaderProviders
     */
    List<?> soundbankReaderProviders = ProviderService.getProviders(soundbankReaderPath);
    if (soundbankReaderProviders.size() == 0) {
        //FIXME
        /*
         * I don't understand what type of exception we should throw out if we haven't
         * appropriate providers...
         * Maybe here is should be MidiUnavailableException
         */
        throw new Error(Messages.getString("sound.1D"));
    }
    /*
     * It's not determine what provider for this service I should to use, and so
     * I use the first one
     */
    return ((SoundbankReader) soundbankReaderProviders.get(0)).getSoundbank(url);
}
项目:openjdk-jdk7u-jdk    文件:JDK13Services.java   
/**
 * Obtains a List containing installed instances of the providers for the
 * requested service. The returned List is immutable.
 *
 * @param serviceClass The type of providers requested. This should be one
 *                     of AudioFileReader.class, AudioFileWriter.class,
 *                     FormatConversionProvider.class, MixerProvider.class,
 *                     MidiDeviceProvider.class, MidiFileReader.class,
 *                     MidiFileWriter.class or SoundbankReader.class.
 *
 * @return A List of providers of the requested type. This List is
 *         immutable.
 */
public static List<?> getProviders(final Class<?> serviceClass) {
    final List<?> providers;
    if (!MixerProvider.class.equals(serviceClass)
            && !FormatConversionProvider.class.equals(serviceClass)
            && !AudioFileReader.class.equals(serviceClass)
            && !AudioFileWriter.class.equals(serviceClass)
            && !MidiDeviceProvider.class.equals(serviceClass)
            && !SoundbankReader.class.equals(serviceClass)
            && !MidiFileWriter.class.equals(serviceClass)
            && !MidiFileReader.class.equals(serviceClass)) {
        providers = new ArrayList<>(0);
    } else {
        providers = JSSecurityManager.getProviders(serviceClass);
    }
    return Collections.unmodifiableList(providers);
}
项目:classpath    文件:MidiSystem.java   
/**
 * Read a Soundbank object from the given file.
 *
 * @param file the file from which to read the Soundbank
 * @return the Soundbank object
 * @throws InvalidMidiDataException if we were unable to read the soundbank
 * @throws IOException if an I/O error happened while reading
 */
public static Soundbank getSoundbank(File file)
  throws InvalidMidiDataException, IOException
{
  Iterator<SoundbankReader> readers =
    ServiceFactory.lookupProviders(SoundbankReader.class);
  while (readers.hasNext())
  {
    SoundbankReader sr = (SoundbankReader) readers.next();
    Soundbank sb = sr.getSoundbank(file);
    if (sb != null)
      return sb;
  }
  throw new InvalidMidiDataException("Cannot read soundbank from file "
                                     + file);
}
项目:freeVM    文件:MidiSystem.java   
public static Soundbank getSoundbank(File file) throws InvalidMidiDataException,
        IOException {
    /*
     * obtain the list of SoundbankReaderProviders
     */
    List<?> soundbankReaderProviders = ProviderService.getProviders(soundbankReaderPath);
    if (soundbankReaderProviders.size() == 0) {
        //FIXME
        /*
         * I don't understand what type of exception we should throw out if we haven't
         * appropriate providers...
         * Maybe here is should be MidiUnavailableException
         */
        throw new Error("There is no SoundbankReaderProviders on your system!!!");
    }
    /*
     * It's not determine what provider for this service I should to use, and so
     * I use the first one
     */
    return ((SoundbankReader) soundbankReaderProviders.get(0)).getSoundbank(file);
}
项目:freeVM    文件:MidiSystem.java   
public static Soundbank getSoundbank(InputStream stream) throws InvalidMidiDataException, IOException {
    /*
     * obtain the list of SoundbankReaderProviders
     */
    List<?> soundbankReaderProviders = ProviderService.getProviders(soundbankReaderPath);
    if (soundbankReaderProviders.size() == 0) {
        //FIXME
        /*
         * I don't understand what type of exception we should throw out if we haven't
         * appropriate providers...
         * Maybe here is should be MidiUnavailableException
         */
        throw new Error("There is no SoundbankReaderProviders on your system!!!");
    }
    /*
     * It's not determine what provider for this service I should to use, and so
     * I use the first one
     */
    return ((SoundbankReader) soundbankReaderProviders.get(0)).getSoundbank(stream);
}
项目:freeVM    文件:MidiSystem.java   
public static Soundbank getSoundbank(URL url) throws InvalidMidiDataException, IOException {
    /*
     * obtain the list of SoundbankReaderProviders
     */
    List<?> soundbankReaderProviders = ProviderService.getProviders(soundbankReaderPath);
    if (soundbankReaderProviders.size() == 0) {
        //FIXME
        /*
         * I don't understand what type of exception we should throw out if we haven't
         * appropriate providers...
         * Maybe here is should be MidiUnavailableException
         */
        throw new Error("There is no SoundbankReaderProviders on your system!!!");
    }
    /*
     * It's not determine what provider for this service I should to use, and so
     * I use the first one
     */
    return ((SoundbankReader) soundbankReaderProviders.get(0)).getSoundbank(url);
}
项目:freeVM    文件:MidiSystem.java   
public static Soundbank getSoundbank(File file) throws InvalidMidiDataException,
        IOException {
    /*
     * obtain the list of SoundbankReaderProviders
     */
    List<?> soundbankReaderProviders = ProviderService.getProviders(soundbankReaderPath);
    if (soundbankReaderProviders.size() == 0) {
        //FIXME
        /*
         * I don't understand what type of exception we should throw out if we haven't
         * appropriate providers...
         * Maybe here is should be MidiUnavailableException
         */
        throw new Error(Messages.getString("sound.1D"));
    }
    /*
     * It's not determine what provider for this service I should to use, and so
     * I use the first one
     */
    return ((SoundbankReader) soundbankReaderProviders.get(0)).getSoundbank(file);
}
项目:freeVM    文件:MidiSystem.java   
public static Soundbank getSoundbank(InputStream stream) throws InvalidMidiDataException, IOException {
    /*
     * obtain the list of SoundbankReaderProviders
     */
    List<?> soundbankReaderProviders = ProviderService.getProviders(soundbankReaderPath);
    if (soundbankReaderProviders.size() == 0) {
        //FIXME
        /*
         * I don't understand what type of exception we should throw out if we haven't
         * appropriate providers...
         * Maybe here is should be MidiUnavailableException
         */
        throw new Error(Messages.getString("sound.1D"));
    }
    /*
     * It's not determine what provider for this service I should to use, and so
     * I use the first one
     */
    return ((SoundbankReader) soundbankReaderProviders.get(0)).getSoundbank(stream);
}
项目:freeVM    文件:MidiSystem.java   
public static Soundbank getSoundbank(URL url) throws InvalidMidiDataException, IOException {
    /*
     * obtain the list of SoundbankReaderProviders
     */
    List<?> soundbankReaderProviders = ProviderService.getProviders(soundbankReaderPath);
    if (soundbankReaderProviders.size() == 0) {
        //FIXME
        /*
         * I don't understand what type of exception we should throw out if we haven't
         * appropriate providers...
         * Maybe here is should be MidiUnavailableException
         */
        throw new Error(Messages.getString("sound.1D"));
    }
    /*
     * It's not determine what provider for this service I should to use, and so
     * I use the first one
     */
    return ((SoundbankReader) soundbankReaderProviders.get(0)).getSoundbank(url);
}
项目:javify    文件:MidiSystem.java   
/**
 * Read a Soundbank object from the given stream.
 *
 * @param stream the stream from which to read the Soundbank
 * @return the Soundbank object
 * @throws InvalidMidiDataException if we were unable to read the soundbank
 * @throws IOException if an I/O error happened while reading
 */
public static Soundbank getSoundbank(InputStream stream)
  throws InvalidMidiDataException, IOException
{
  Iterator readers = ServiceFactory.lookupProviders(SoundbankReader.class);
  while (readers.hasNext())
  {
    SoundbankReader sr = (SoundbankReader) readers.next();
    Soundbank sb = sr.getSoundbank(stream);
    if (sb != null)
      return sb;
  }
  throw new InvalidMidiDataException("Cannot read soundbank from stream");
}
项目:javify    文件:MidiSystem.java   
/**
 * Read a Soundbank object from the given url.
 *
 * @param url the url from which to read the Soundbank
 * @return the Soundbank object
 * @throws InvalidMidiDataException if we were unable to read the soundbank
 * @throws IOException if an I/O error happened while reading
 */
public static Soundbank getSoundbank(URL url)
  throws InvalidMidiDataException, IOException
{
  Iterator readers = ServiceFactory.lookupProviders(SoundbankReader.class);
  while (readers.hasNext())
  {
    SoundbankReader sr = (SoundbankReader) readers.next();
    Soundbank sb = sr.getSoundbank(url);
    if (sb != null)
      return sb;
  }
  throw new InvalidMidiDataException("Cannot read from url " + url);
}
项目:javify    文件:MidiSystem.java   
/**
 * Read a Soundbank object from the given file.
 *
 * @param file the file from which to read the Soundbank
 * @return the Soundbank object
 * @throws InvalidMidiDataException if we were unable to read the soundbank
 * @throws IOException if an I/O error happened while reading
 */
public static Soundbank getSoundbank(File file)
  throws InvalidMidiDataException, IOException
{
  Iterator readers = ServiceFactory.lookupProviders(SoundbankReader.class);
  while (readers.hasNext())
  {
    SoundbankReader sr = (SoundbankReader) readers.next();
    Soundbank sb = sr.getSoundbank(file);
    if (sb != null)
      return sb;
  }
  throw new InvalidMidiDataException("Cannot read soundbank from file "
                                     + file);
}
项目:jvm-stm    文件:MidiSystem.java   
/**
 * Read a Soundbank object from the given stream.
 * 
 * @param stream the stream from which to read the Soundbank
 * @return the Soundbank object
 * @throws InvalidMidiDataException if we were unable to read the soundbank
 * @throws IOException if an I/O error happened while reading
 */
public static Soundbank getSoundbank(InputStream stream)
  throws InvalidMidiDataException, IOException
{
  Iterator readers = ServiceFactory.lookupProviders(SoundbankReader.class);
  while (readers.hasNext())
  {
    SoundbankReader sr = (SoundbankReader) readers.next();
    Soundbank sb = sr.getSoundbank(stream);
    if (sb != null)
      return sb;
  }
  throw new InvalidMidiDataException("Cannot read soundbank from stream");
}
项目:jvm-stm    文件:MidiSystem.java   
/**
 * Read a Soundbank object from the given url.
 * 
 * @param url the url from which to read the Soundbank
 * @return the Soundbank object
 * @throws InvalidMidiDataException if we were unable to read the soundbank
 * @throws IOException if an I/O error happened while reading
 */
public static Soundbank getSoundbank(URL url)
  throws InvalidMidiDataException, IOException
{
  Iterator readers = ServiceFactory.lookupProviders(SoundbankReader.class);
  while (readers.hasNext())
  {
    SoundbankReader sr = (SoundbankReader) readers.next();
    Soundbank sb = sr.getSoundbank(url);
    if (sb != null)
      return sb;
  }
  throw new InvalidMidiDataException("Cannot read from url " + url);
}
项目:jvm-stm    文件:MidiSystem.java   
/**
 * Read a Soundbank object from the given file.
 * 
 * @param file the file from which to read the Soundbank
 * @return the Soundbank object
 * @throws InvalidMidiDataException if we were unable to read the soundbank
 * @throws IOException if an I/O error happened while reading
 */
public static Soundbank getSoundbank(File file)
  throws InvalidMidiDataException, IOException
{
  Iterator readers = ServiceFactory.lookupProviders(SoundbankReader.class);
  while (readers.hasNext())
  {
    SoundbankReader sr = (SoundbankReader) readers.next();
    Soundbank sb = sr.getSoundbank(file);
    if (sb != null)
      return sb;
  }
  throw new InvalidMidiDataException("Cannot read soundbank from file " 
               + file);
}
项目:JamVM-PH    文件:MidiSystem.java   
/**
 * Read a Soundbank object from the given stream.
 * 
 * @param stream the stream from which to read the Soundbank
 * @return the Soundbank object
 * @throws InvalidMidiDataException if we were unable to read the soundbank
 * @throws IOException if an I/O error happened while reading
 */
public static Soundbank getSoundbank(InputStream stream)
  throws InvalidMidiDataException, IOException
{
  Iterator readers = ServiceFactory.lookupProviders(SoundbankReader.class);
  while (readers.hasNext())
  {
    SoundbankReader sr = (SoundbankReader) readers.next();
    Soundbank sb = sr.getSoundbank(stream);
    if (sb != null)
      return sb;
  }
  throw new InvalidMidiDataException("Cannot read soundbank from stream");
}
项目:JamVM-PH    文件:MidiSystem.java   
/**
 * Read a Soundbank object from the given url.
 * 
 * @param url the url from which to read the Soundbank
 * @return the Soundbank object
 * @throws InvalidMidiDataException if we were unable to read the soundbank
 * @throws IOException if an I/O error happened while reading
 */
public static Soundbank getSoundbank(URL url)
  throws InvalidMidiDataException, IOException
{
  Iterator readers = ServiceFactory.lookupProviders(SoundbankReader.class);
  while (readers.hasNext())
  {
    SoundbankReader sr = (SoundbankReader) readers.next();
    Soundbank sb = sr.getSoundbank(url);
    if (sb != null)
      return sb;
  }
  throw new InvalidMidiDataException("Cannot read from url " + url);
}
项目:JamVM-PH    文件:MidiSystem.java   
/**
 * Read a Soundbank object from the given file.
 * 
 * @param file the file from which to read the Soundbank
 * @return the Soundbank object
 * @throws InvalidMidiDataException if we were unable to read the soundbank
 * @throws IOException if an I/O error happened while reading
 */
public static Soundbank getSoundbank(File file)
  throws InvalidMidiDataException, IOException
{
  Iterator readers = ServiceFactory.lookupProviders(SoundbankReader.class);
  while (readers.hasNext())
  {
    SoundbankReader sr = (SoundbankReader) readers.next();
    Soundbank sb = sr.getSoundbank(file);
    if (sb != null)
      return sb;
  }
  throw new InvalidMidiDataException("Cannot read soundbank from file " 
               + file);
}
项目:classpath    文件:MidiSystem.java   
/**
 * Read a Soundbank object from the given stream.
 *
 * @param stream the stream from which to read the Soundbank
 * @return the Soundbank object
 * @throws InvalidMidiDataException if we were unable to read the soundbank
 * @throws IOException if an I/O error happened while reading
 */
public static Soundbank getSoundbank(InputStream stream)
  throws InvalidMidiDataException, IOException
{
  Iterator<SoundbankReader> readers =
    ServiceFactory.lookupProviders(SoundbankReader.class);
  while (readers.hasNext())
  {
    SoundbankReader sr = readers.next();
    Soundbank sb = sr.getSoundbank(stream);
    if (sb != null)
      return sb;
  }
  throw new InvalidMidiDataException("Cannot read soundbank from stream");
}
项目:classpath    文件:MidiSystem.java   
/**
 * Read a Soundbank object from the given url.
 *
 * @param url the url from which to read the Soundbank
 * @return the Soundbank object
 * @throws InvalidMidiDataException if we were unable to read the soundbank
 * @throws IOException if an I/O error happened while reading
 */
public static Soundbank getSoundbank(URL url)
  throws InvalidMidiDataException, IOException
{
  Iterator<SoundbankReader> readers =
    ServiceFactory.lookupProviders(SoundbankReader.class);
  while (readers.hasNext())
  {
    SoundbankReader sr = readers.next();
    Soundbank sb = sr.getSoundbank(url);
    if (sb != null)
      return sb;
  }
  throw new InvalidMidiDataException("Cannot read from url " + url);
}
项目:OpenJSharp    文件:MidiSystem.java   
private static List getSoundbankReaders() {
    return getProviders(SoundbankReader.class);
}
项目:jdk8u-jdk    文件:MidiSystem.java   
private static List getSoundbankReaders() {
    return getProviders(SoundbankReader.class);
}
项目:openjdk-jdk10    文件:ExpectedNPEOnNull.java   
public static void main(final String[] args) throws Exception {
    testMS();
    for (final SoundbankReader sbr : load(SoundbankReader.class)) {
        testSBR(sbr);
    }
}
项目:openjdk9    文件:MidiSystem.java   
@SuppressWarnings("unchecked")
private static List<SoundbankReader> getSoundbankReaders() {
    return (List<SoundbankReader>) getProviders(SoundbankReader.class);
}