org.vorbis.tageditor
Class OggFile

java.lang.Object
  extended by org.vorbis.tageditor.OggFile

public class OggFile
extends java.lang.Object


Field Summary
static java.lang.String TAG_ALBUM
          The standard tag name for the "Album" property of a Ogg File
static java.lang.String TAG_ARTIST
          The standard tag name for the "Artist" property of a Ogg File
static java.lang.String TAG_COMMENT
          The standard tag name for the "Comment" property of a Ogg File
static java.lang.String TAG_DATE
          The standard tag name for the "Date" property of a Ogg File
static java.lang.String TAG_GENRE
          The standard tag name for the "Genre" property of a Ogg File
static java.lang.String TAG_TITLE
          The standard tag name for the "Title" property of a Ogg File
static java.lang.String TAG_TRACK
          The standard tag name for the "Track" property of a Ogg File
 
Constructor Summary
OggFile(java.io.File file)
          Construct a new OggFile instance based on a file existing on the filesystem.
 
Method Summary
 void addComment(java.lang.String key, java.lang.String value)
          Let you add a comment to the comments of this ogg file.
 int getBitRateMax()
          Return the maximum bitrate of this file, if included in the metadatas of the file
 int getBitRateMinimum()
          Return the minimum bitrate of this file, if included in the metadatas of the file
 int getBitRateNominal()
          Return the nominal bitrate of this file, if included in the metadatas of the file
 int getChannels()
          Return the number of channels in this stream
 java.util.Properties getComments()
          Get the comments associated to this ogg file as a Properties java object.
 java.io.File getFile()
          Return this ogg file as a java File object.
 int getOggVersion()
          Return the ogg version of this file (usually 0)
 int getSampleRate()
          Return the sample rate of this file
 void setComments(java.util.Properties comments)
          Set the ogg comments of this file throught a Properties object.
 void writeFile()
          Write this OggFile instance on the filesystem, including the modification the user may have done throught the API.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

TAG_ARTIST

public static final java.lang.String TAG_ARTIST
The standard tag name for the "Artist" property of a Ogg File

See Also:
Constant Field Values

TAG_ALBUM

public static final java.lang.String TAG_ALBUM
The standard tag name for the "Album" property of a Ogg File

See Also:
Constant Field Values

TAG_TITLE

public static final java.lang.String TAG_TITLE
The standard tag name for the "Title" property of a Ogg File

See Also:
Constant Field Values

TAG_DATE

public static final java.lang.String TAG_DATE
The standard tag name for the "Date" property of a Ogg File

See Also:
Constant Field Values

TAG_TRACK

public static final java.lang.String TAG_TRACK
The standard tag name for the "Track" property of a Ogg File

See Also:
Constant Field Values

TAG_GENRE

public static final java.lang.String TAG_GENRE
The standard tag name for the "Genre" property of a Ogg File

See Also:
Constant Field Values

TAG_COMMENT

public static final java.lang.String TAG_COMMENT
The standard tag name for the "Comment" property of a Ogg File

See Also:
Constant Field Values
Constructor Detail

OggFile

public OggFile(java.io.File file)
        throws java.io.IOException,
               InvalidOggFileException
Construct a new OggFile instance based on a file existing on the filesystem.

Parameters:
file - The source Ogg file
Throws:
java.io.IOException - If the file cannot be found or cannot be read.
InvalidOggFileException - If the file appears as being an invalid Ogg file.
Method Detail

addComment

public void addComment(java.lang.String key,
                       java.lang.String value)
Let you add a comment to the comments of this ogg file.

Parameters:
key - the key of this tag (example: AUTHOR)
value - the value of the tag (example: Jimmy Hendrix)

getComments

public java.util.Properties getComments()
Get the comments associated to this ogg file as a Properties java object.

Returns:
the comments of this ogg file

writeFile

public void writeFile()
               throws java.io.IOException,
                      InvalidOggFileException
Write this OggFile instance on the filesystem, including the modification the user may have done throught the API.

Throws:
java.io.IOException - If something goes wrong with writing this file on the filesystem.
InvalidOggFileException - If the source file appears as being an invalid Ogg File.

getBitRateMax

public int getBitRateMax()
Return the maximum bitrate of this file, if included in the metadatas of the file

Returns:
The maximum bitrate

getBitRateMinimum

public int getBitRateMinimum()
Return the minimum bitrate of this file, if included in the metadatas of the file

Returns:
The minimum bitrate

getBitRateNominal

public int getBitRateNominal()
Return the nominal bitrate of this file, if included in the metadatas of the file

Returns:
The nominal bitrate

getChannels

public int getChannels()
Return the number of channels in this stream

Returns:
The number of channels in this stream

getFile

public java.io.File getFile()
Return this ogg file as a java File object. Usefull for getting informations on it.

Returns:
this ogg file as a java File object.

getOggVersion

public int getOggVersion()
Return the ogg version of this file (usually 0)

Returns:
the ogg version of this file (usually 0)

getSampleRate

public int getSampleRate()
Return the sample rate of this file

Returns:
the sample rate of this file

setComments

public void setComments(java.util.Properties comments)
Set the ogg comments of this file throught a Properties object.

Parameters:
comments - The comments to set