Save This Page
Home » openjdk-7 » javax.sound » midi » spi » [javadoc | source]
    1   /*
    2    * Copyright 1999-2003 Sun Microsystems, Inc.  All Rights Reserved.
    3    * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
    4    *
    5    * This code is free software; you can redistribute it and/or modify it
    6    * under the terms of the GNU General Public License version 2 only, as
    7    * published by the Free Software Foundation.  Sun designates this
    8    * particular file as subject to the "Classpath" exception as provided
    9    * by Sun in the LICENSE file that accompanied this code.
   10    *
   11    * This code is distributed in the hope that it will be useful, but WITHOUT
   12    * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
   13    * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
   14    * version 2 for more details (a copy is included in the LICENSE file that
   15    * accompanied this code).
   16    *
   17    * You should have received a copy of the GNU General Public License version
   18    * 2 along with this work; if not, write to the Free Software Foundation,
   19    * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
   20    *
   21    * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
   22    * CA 95054 USA or visit www.sun.com if you need additional information or
   23    * have any questions.
   24    */
   25   
   26   package javax.sound.midi.spi;
   27   
   28   import java.io.InputStream;
   29   import java.io.IOException;
   30   import java.io.File;
   31   
   32   import java.net.URL;
   33   
   34   import javax.sound.midi.Soundbank;
   35   import javax.sound.midi.InvalidMidiDataException;
   36   
   37   
   38   /**
   39    * A <code>SoundbankReader</code> supplies soundbank file-reading services.
   40    * Concrete subclasses of <code>SoundbankReader</code> parse a given
   41    * soundbank file, producing a {@link javax.sound.midi.Soundbank}
   42    * object that can be loaded into a {@link javax.sound.midi.Synthesizer}.
   43    *
   44    * @since 1.3
   45    * @author Kara Kytle
   46    */
   47   public abstract class SoundbankReader {
   48   
   49   
   50       /**
   51        * Obtains a soundbank object from the URL provided.
   52        * @param url URL representing the soundbank.
   53        * @return soundbank object
   54        * @throws InvalidMidiDataException if the URL does not point to
   55        * valid MIDI soundbank data recognized by this soundbank reader
   56        * @throws IOException if an I/O error occurs
   57        */
   58       public abstract Soundbank getSoundbank(URL url) throws InvalidMidiDataException, IOException;
   59   
   60   
   61       /**
   62        * Obtains a soundbank object from the <code>InputStream</code> provided.
   63        * @param stream <code>InputStream</code> representing the soundbank
   64        * @return soundbank object
   65        * @throws InvalidMidiDataException if the stream does not point to
   66        * valid MIDI soundbank data recognized by this soundbank reader
   67        * @throws IOException if an I/O error occurs
   68        */
   69       public abstract Soundbank getSoundbank(InputStream stream) throws InvalidMidiDataException, IOException;
   70   
   71   
   72       /**
   73        * Obtains a soundbank object from the <code>File</code> provided.
   74        * @param file the <code>File</code> representing the soundbank
   75        * @return soundbank object
   76        * @throws InvalidMidiDataException if the file does not point to
   77        * valid MIDI soundbank data recognized by this soundbank reader
   78        * @throws IOException if an I/O error occurs
   79        */
   80       public abstract Soundbank getSoundbank(File file) throws InvalidMidiDataException, IOException;
   81   
   82   
   83   
   84   }

Save This Page
Home » openjdk-7 » javax.sound » midi » spi » [javadoc | source]