com.melloware.jukes.file.tag
Class AudioFileTag

java.lang.Object
  extended by com.melloware.jukes.file.tag.MusicTag
      extended by com.melloware.jukes.file.tag.AudioFileTag
All Implemented Interfaces:
ITag, java.lang.Comparable

public final class AudioFileTag
extends MusicTag

MusicTag class used for editing OGG, FLAC, SPEEX, and APE file tags. The Ogg Vorbiscomment system is used as described at xiph.org/vorbis/doc/v-comment.html

The Entagged (http://entagged.sourceforge.net/) library is used to read these types of Tags.

Copyright (c) 2006 Melloware, Inc.

Version:
4.0
Author:
Emil A. Lefkof III

Field Summary
 
Fields inherited from class com.melloware.jukes.file.tag.MusicTag
artist, bitRate, comment, CURRENT_YEAR, DEFAULT_FILE_FORMAT, disc, encodedBy, file, genre, header, NO_TAG, title, track, trackLength, year
 
Constructor Summary
AudioFileTag(java.io.File aFile)
          Contructor that accepts a file.
 
Method Summary
 java.lang.String getArtist()
          Gets the artist.
 java.lang.Long getBitRate()
          Gets the bitRate.
 java.lang.String getComment()
          Gets the comment.
 java.lang.String getCopyrighted()
           
 java.lang.String getDisc()
          Gets the disc.
 java.lang.String getEmphasis()
           
 java.lang.String getEncodedBy()
          Gets the encodedBy.
 java.lang.String getFrequency()
           
 java.lang.String getGenre()
          Gets the genre.
 java.util.Map getHeader()
          Gets the header.
 java.lang.String getLayer()
           
 java.lang.String getMode()
           
 java.lang.String getTitle()
          Gets the title.
 java.lang.String getTrack()
          Gets the track.
 long getTrackLength()
          Gets the trackLength.
 java.lang.String getVersion()
           
 java.lang.String getYear()
          Gets the year.
 boolean isVBR()
           
 void removeTags()
          Removes tags from the audio file.
 boolean renameFile(java.lang.String aFormat)
          Renames this Music file based on a format from prefs.
 void save()
          Saves the tag back to the file.
 void setArtist(java.lang.String aArtist)
          Sets the artist.
 void setComment(java.lang.String aComment)
          Sets the comment.
 void setDisc(java.lang.String aDisc)
          Sets the disc.
 void setEncodedBy(java.lang.String aEncodedBy)
          Sets the encodedBy.
 void setGenre(java.lang.String aGenre)
          Sets the genre.
 void setTitle(java.lang.String aTitle)
          Sets the title.
 void setTrack(java.lang.String aTrack)
          Sets the track.
 void setTrack(java.lang.String aTrack, int aPadding)
          Sets the track.
 void setTrackLength(long aTrackLength)
          Sets the trackLength.
 void setYear(java.lang.String aYear)
          Sets the year.
 
Methods inherited from class com.melloware.jukes.file.tag.MusicTag
compareTo, createFilenameFromFormat, equals, extractTitleFromFilename, fileExists, getAbsolutePath, getBitRateAsString, getFile, getGenreTypes, getHeaderInfo, getHeaderValue, getTrackLengthAsString, hashCode, renameFile, synchronize, toString
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

AudioFileTag

public AudioFileTag(java.io.File aFile)
             throws MusicTagException
Contructor that accepts a file.

Parameters:
aFile - the file to open
Throws:
MusicTagException - if any error occurs loading tag
Method Detail

getArtist

public java.lang.String getArtist()
Description copied from class: MusicTag
Gets the artist.

Specified by:
getArtist in interface ITag
Specified by:
getArtist in class MusicTag
Returns:
Returns the artist.

getBitRate

public java.lang.Long getBitRate()
Description copied from class: MusicTag
Gets the bitRate.

Specified by:
getBitRate in interface ITag
Specified by:
getBitRate in class MusicTag
Returns:
Returns the bitRate.

getComment

public java.lang.String getComment()
Description copied from class: MusicTag
Gets the comment.

Specified by:
getComment in interface ITag
Specified by:
getComment in class MusicTag
Returns:
Returns the comment.

getCopyrighted

public java.lang.String getCopyrighted()
Specified by:
getCopyrighted in interface ITag
Specified by:
getCopyrighted in class MusicTag

getDisc

public java.lang.String getDisc()
Description copied from class: MusicTag
Gets the disc.

Specified by:
getDisc in interface ITag
Specified by:
getDisc in class MusicTag
Returns:
Returns the disc.

getEmphasis

public java.lang.String getEmphasis()
Specified by:
getEmphasis in interface ITag
Specified by:
getEmphasis in class MusicTag

getEncodedBy

public java.lang.String getEncodedBy()
Description copied from class: MusicTag
Gets the encodedBy.

Specified by:
getEncodedBy in interface ITag
Specified by:
getEncodedBy in class MusicTag
Returns:
Returns the encodedBy.

getFrequency

public java.lang.String getFrequency()
Specified by:
getFrequency in interface ITag
Specified by:
getFrequency in class MusicTag

getGenre

public java.lang.String getGenre()
Description copied from class: MusicTag
Gets the genre.

Specified by:
getGenre in interface ITag
Specified by:
getGenre in class MusicTag
Returns:
Returns the genre.

getHeader

public java.util.Map getHeader()
Description copied from class: MusicTag
Gets the header.

Specified by:
getHeader in interface ITag
Specified by:
getHeader in class MusicTag
Returns:
Returns the header.

getLayer

public java.lang.String getLayer()
Specified by:
getLayer in interface ITag
Specified by:
getLayer in class MusicTag

getMode

public java.lang.String getMode()
Specified by:
getMode in interface ITag
Specified by:
getMode in class MusicTag

getTitle

public java.lang.String getTitle()
Description copied from class: MusicTag
Gets the title.

Specified by:
getTitle in interface ITag
Specified by:
getTitle in class MusicTag
Returns:
Returns the title.

getTrack

public java.lang.String getTrack()
Description copied from class: MusicTag
Gets the track.

Specified by:
getTrack in interface ITag
Specified by:
getTrack in class MusicTag
Returns:
Returns the track.

getTrackLength

public long getTrackLength()
Description copied from class: MusicTag
Gets the trackLength.

Specified by:
getTrackLength in interface ITag
Specified by:
getTrackLength in class MusicTag
Returns:
Returns the trackLength.

getVersion

public java.lang.String getVersion()
Specified by:
getVersion in interface ITag
Specified by:
getVersion in class MusicTag

getYear

public java.lang.String getYear()
Description copied from class: MusicTag
Gets the year.

Specified by:
getYear in interface ITag
Specified by:
getYear in class MusicTag
Returns:
Returns the year.

setArtist

public void setArtist(java.lang.String aArtist)
Description copied from class: MusicTag
Sets the artist.

Specified by:
setArtist in interface ITag
Specified by:
setArtist in class MusicTag
Parameters:
aArtist - The artist to set.

setComment

public void setComment(java.lang.String aComment)
Description copied from class: MusicTag
Sets the comment.

Specified by:
setComment in interface ITag
Specified by:
setComment in class MusicTag
Parameters:
aComment - The comment to set.

setDisc

public void setDisc(java.lang.String aDisc)
Description copied from class: MusicTag
Sets the disc.

Specified by:
setDisc in interface ITag
Specified by:
setDisc in class MusicTag
Parameters:
aDisc - The disc to set.

setEncodedBy

public void setEncodedBy(java.lang.String aEncodedBy)
Description copied from class: MusicTag
Sets the encodedBy.

Specified by:
setEncodedBy in interface ITag
Specified by:
setEncodedBy in class MusicTag
Parameters:
aEncodedBy - The encodedBy to set.

setGenre

public void setGenre(java.lang.String aGenre)
Description copied from class: MusicTag
Sets the genre.

Specified by:
setGenre in interface ITag
Specified by:
setGenre in class MusicTag
Parameters:
aGenre - The genre to set.

setTitle

public void setTitle(java.lang.String aTitle)
Description copied from class: MusicTag
Sets the title.

Specified by:
setTitle in interface ITag
Specified by:
setTitle in class MusicTag
Parameters:
aTitle - The title to set.

setTrack

public void setTrack(java.lang.String aTrack)
Description copied from class: MusicTag
Sets the track.

Specified by:
setTrack in interface ITag
Specified by:
setTrack in class MusicTag
Parameters:
aTrack - The track to set.

setTrack

public void setTrack(java.lang.String aTrack,
                     int aPadding)
Sets the track.

Specified by:
setTrack in interface ITag
Specified by:
setTrack in class MusicTag
Parameters:
aTrack - The track to set.
aPadding - the number of 0's to pad this track with

setTrackLength

public void setTrackLength(long aTrackLength)
Description copied from class: MusicTag
Sets the trackLength.

Specified by:
setTrackLength in class MusicTag
Parameters:
aTrackLength - The trackLength to set.

setYear

public void setYear(java.lang.String aYear)
Description copied from class: MusicTag
Sets the year.

Specified by:
setYear in interface ITag
Specified by:
setYear in class MusicTag
Parameters:
aYear - The year to set.

isVBR

public boolean isVBR()
Specified by:
isVBR in interface ITag
Specified by:
isVBR in class MusicTag

removeTags

public void removeTags()
                throws MusicTagException
Description copied from class: MusicTag
Removes tags from the audio file.

Specified by:
removeTags in class MusicTag
Throws:
MusicTagException - if any error occurs removing the tag

renameFile

public boolean renameFile(java.lang.String aFormat)
Renames this Music file based on a format from prefs. The format is in aFormat and can have values %n for track number, %t for title, %a for artist, and %d for disc. Replaces any invalid characters (\\, /, :, , *, ?, ", <, >, or |) with underscores _ to prevent any errors on file systems. Examples: %n -%t = 01 - Track.mp3 %a - %d - %n - %t = Artist - Album - 01 - Track.mp3

Specified by:
renameFile in class MusicTag
Parameters:
aFormat - the string format like %n -%t to rename 01 - Track.mp3
Returns:
true if renamed, false if failure

save

public void save()
          throws MusicTagException
Description copied from class: MusicTag
Saves the tag back to the file.

Specified by:
save in class MusicTag
Throws:
MusicTagException - if any error occurs saving the file


Copyright © 1999-2008 Melloware Inc. All Rights Reserved.