com.groovemanager.sampled.providers
Class AudioFileFormatProvider

java.lang.Object
  extended by com.groovemanager.sampled.providers.AudioFileFormatProvider
Direct Known Subclasses:
REXFormatProvider, WavFormatProvider

public abstract class AudioFileFormatProvider
extends java.lang.Object

An AudioFileFormatProvider is something similar to the AudioFileReader SPI, but as the name implies, it can only provide AudioFileFormat objects, not AudioInputStreams. An AudioFileFormatProvider can be propagated to an AudioManager.

Author:
Manu Robledo

Constructor Summary
AudioFileFormatProvider()
           
 
Method Summary
abstract  javax.sound.sampled.AudioFileFormat getAudioFileFormat(java.io.File f)
          Get the AudioFileFormat out of the given file
abstract  javax.sound.sampled.AudioFormat[] getSupportedFormats()
          Get the AudioFormats supported by this provider
abstract  java.lang.String[] getSupportedProperties()
          Get the property keys understood by this provider
abstract  javax.sound.sampled.AudioFileFormat.Type[] getSupportedTypes()
          Get the AudioFileFormat.Types supported by this provider
abstract  boolean isFileSupported(java.io.File f)
          Ask this provider, if it is able to get the AudioFileFormat out of this file
 boolean isFormatSupported(javax.sound.sampled.AudioFormat format)
          Ask this provider, if the given AudioFormat is supported or not
 boolean isPropertySupported(java.lang.String property)
          Ask this provider, if it supports the property specified by the given kay.
 boolean isTypeSupported(javax.sound.sampled.AudioFileFormat.Type type)
          Ask this provider, if it supports the specified audio file type
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AudioFileFormatProvider

public AudioFileFormatProvider()
Method Detail

getAudioFileFormat

public abstract javax.sound.sampled.AudioFileFormat getAudioFileFormat(java.io.File f)
                                                                throws javax.sound.sampled.UnsupportedAudioFileException,
                                                                       java.io.IOException
Get the AudioFileFormat out of the given file

Parameters:
f - The file to be read
Returns:
The AudioFileFormat of the specified file.
Throws:
javax.sound.sampled.UnsupportedAudioFileException - If the format of the file is not known or invalid
java.io.IOException - If an I/O Error occured during reading

getSupportedFormats

public abstract javax.sound.sampled.AudioFormat[] getSupportedFormats()
Get the AudioFormats supported by this provider

Returns:
The audio formats supported by this provider

getSupportedProperties

public abstract java.lang.String[] getSupportedProperties()
Get the property keys understood by this provider

Returns:
The property keys of the properties this provider can provide

getSupportedTypes

public abstract javax.sound.sampled.AudioFileFormat.Type[] getSupportedTypes()
Get the AudioFileFormat.Types supported by this provider

Returns:
The audio file types supported by this provider

isFileSupported

public abstract boolean isFileSupported(java.io.File f)
Ask this provider, if it is able to get the AudioFileFormat out of this file

Parameters:
f - The file to ask for
Returns:
true, if this file is supported, false otherwise

isFormatSupported

public boolean isFormatSupported(javax.sound.sampled.AudioFormat format)
Ask this provider, if the given AudioFormat is supported or not

Parameters:
format - The AudioFormat to ask for
Returns:
true, if the given format is supported, false otherwise.

isPropertySupported

public boolean isPropertySupported(java.lang.String property)
Ask this provider, if it supports the property specified by the given kay.

Parameters:
property - The property key to ask for
Returns:
true, if this property key is understood, false otherwise.

isTypeSupported

public boolean isTypeSupported(javax.sound.sampled.AudioFileFormat.Type type)
Ask this provider, if it supports the specified audio file type

Parameters:
type - The AudioTypeFormat.Type to ask for
Returns:
true, if the given type is supported, false otherwise