com.tuneology.avm
Class DiscInfo

java.lang.Object
  |
  +--com.tuneology.avm.DiscInfo

public class DiscInfo
extends java.lang.Object

Describes the contents of a CD. Contents can be read from some sort of data store, or edited manually. Automatically maintains track numbers as tracks are inserted, deleted, and moved.

Version:
$Id: DiscInfo.java,v 1.9 2003/06/19 17:55:54 xnarf Exp $
Author:
Fran Taylor

Constructor Summary
DiscInfo()
           
DiscInfo(int n)
           
 
Method Summary
 void addTrack(TocEntry ent)
          Adds a new track to the album at the end, re-allocating the Toc and incrementing the total number of tracks.
 void addTrack(TocEntry ent, int ind)
          Adds a new track to the album at the indicated position, re-allocating the Toc and incrementing the total number of tracks.
 void calculateIds()
          Calculates the cdindexId and discId values.
 void calculateTrackString()
           
 DiscInfo copy()
           
 void deleteTrack(TocEntry ent)
          Deletes the indicated track.
 java.lang.String getAlbum()
          album name
 java.lang.String getAlbumPath()
          The album name, with all strange characters replaced by '_'.
 java.lang.String getArranger()
          from CD-TEXT info
 java.lang.String getArtist()
          cddb info
 java.lang.String getArtistPath()
          The artist's name, with all strange characters replaced by '_'.
 int getAudioLength()
          the sum of the lengths of all the audio tracks
 int getAudioTrackCount()
           
 java.lang.String getCdindexId()
          the discid as required for cdindex
 java.lang.String getComment()
          a comment
 int getDiscId()
          the discid as required for freedb
 int getExtraStart()
          the index of the beginning of the ISO 9660 volume on a CD-Extra disc
 int getFlags()
          bits to indicate status of drive and media
 int getFs()
          the type of filesystem on the disc, with flags
 int getFsSize()
          the size of filesystem on the disc, in blocks
 java.lang.String getGenre()
          hopefully an ID3 genre if you want it written to an MP3 file
 int getId()
          an external ID
 int getJolietLevel()
           
 int getLeadin()
           
 int getLeadout()
          the last index on the disc
 long getLength()
           
 int getMaxAudioTracks()
           
 java.lang.String getMcn()
          Media Catalog Number, if present and read
 java.lang.String getPath()
           
 long getSize()
           
 java.lang.String getSongwriter()
          from CD-TEXT info
 int getTocEntries()
           
 TocEntry getTocEntry(int i)
          the table of audio contents
 java.lang.String getTrackString()
          the list of tracks as required for freedb
 java.lang.String getVolName()
          the ISO9660 Volume Label String
 int getYear()
          year of publishing
 boolean isInitialized()
          true if this information had been set
 boolean isMultiArtist()
          true if there is more than one artist
 void moveDown(TocEntry ent)
          Swaps the track with the one below it.
 void moveUp(TocEntry ent)
          Swaps the track with the one previous to it.
 void setAlbum(java.lang.String a)
          album name
 void setArranger(java.lang.String a)
          from CD-TEXT info
 void setArtist(java.lang.String a)
          cddb info
 void setAudioLength(int a)
          the sum of the lengths of all the audio tracks
 void setCdindexId(java.lang.String str)
           
 void setComment(java.lang.String c)
          a comment
 void setDiscId(int i)
           
 void setExtraStart(int e)
          the index of the beginning of the ISO 9660 volume on a CD-Extra disc
 void setFlags(int f)
          bits to indicate status of drive and media
 void setFs(int f)
          the type of filesystem on the disc, with flags
 void setFsSize(int f)
          the size of filesystem on the disc, in blocks
 void setGenre(java.lang.String g)
          hopefully an ID3 comment if you want it written to an MP3 file
 void setId(int i)
           
 void setInitialized(boolean b)
          true if this information had been set
 void setJolietLevel(int j)
           
 void setLeadin(int l)
           
 void setLeadout(int l)
          the last index on the disc
 void setMaxAudioTracks(int tracks)
           
 void setMcn(java.lang.String m)
          Media Catalog Number, if present and read
 void setMultiArtist(boolean m)
          true if there is more than one artist
 void setPath(java.lang.String p)
           
 void setSongwriter(java.lang.String s)
          from CD-TEXT info
 void setTocEntries(int n)
          Sets the size of the track array; previous contents are lost.
 void setTrackString(java.lang.String s)
          the list of tracks as required for freedb
 void setVolName(java.lang.String v)
          the ISO9660 Volume Label String
 void setYear(int y)
          year of publishing
static void touch()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DiscInfo

public DiscInfo()

DiscInfo

public DiscInfo(int n)
         throws java.lang.IndexOutOfBoundsException
Parameters:
n - number of tracks to create.
Throws:
java.lang.IndexOutOfBoundsException -  
Method Detail

getLeadin

public int getLeadin()

getMaxAudioTracks

public int getMaxAudioTracks()

setMaxAudioTracks

public void setMaxAudioTracks(int tracks)
                       throws java.lang.IndexOutOfBoundsException
Parameters:
tracks -  
Throws:
java.lang.IndexOutOfBoundsException -  

getSize

public long getSize()

getAudioTrackCount

public int getAudioTrackCount()

getLength

public long getLength()

getFlags

public int getFlags()
bits to indicate status of drive and media

getFs

public int getFs()
the type of filesystem on the disc, with flags

getFsSize

public int getFsSize()
the size of filesystem on the disc, in blocks

getJolietLevel

public int getJolietLevel()

getMcn

public java.lang.String getMcn()
Media Catalog Number, if present and read

getId

public int getId()
an external ID

getDiscId

public int getDiscId()
the discid as required for freedb

getCdindexId

public java.lang.String getCdindexId()
the discid as required for cdindex

getExtraStart

public int getExtraStart()
the index of the beginning of the ISO 9660 volume on a CD-Extra disc

getAudioLength

public int getAudioLength()
the sum of the lengths of all the audio tracks

getLeadout

public int getLeadout()
the last index on the disc

getTocEntry

public TocEntry getTocEntry(int i)
the table of audio contents

getTocEntries

public int getTocEntries()

getVolName

public java.lang.String getVolName()
the ISO9660 Volume Label String

getTrackString

public java.lang.String getTrackString()
the list of tracks as required for freedb

getArtist

public java.lang.String getArtist()
cddb info

getAlbum

public java.lang.String getAlbum()
album name

getYear

public int getYear()
year of publishing

getComment

public java.lang.String getComment()
a comment

getGenre

public java.lang.String getGenre()
hopefully an ID3 genre if you want it written to an MP3 file

getArranger

public java.lang.String getArranger()
from CD-TEXT info

getSongwriter

public java.lang.String getSongwriter()
from CD-TEXT info

getPath

public java.lang.String getPath()

isMultiArtist

public boolean isMultiArtist()
true if there is more than one artist

isInitialized

public boolean isInitialized()
true if this information had been set

setLeadin

public void setLeadin(int l)

setFlags

public void setFlags(int f)
bits to indicate status of drive and media

setFs

public void setFs(int f)
the type of filesystem on the disc, with flags

setFsSize

public void setFsSize(int f)
the size of filesystem on the disc, in blocks

setJolietLevel

public void setJolietLevel(int j)
                    throws java.lang.IndexOutOfBoundsException

setMcn

public void setMcn(java.lang.String m)
Media Catalog Number, if present and read

setExtraStart

public void setExtraStart(int e)
the index of the beginning of the ISO 9660 volume on a CD-Extra disc

setAudioLength

public void setAudioLength(int a)
the sum of the lengths of all the audio tracks

setLeadout

public void setLeadout(int l)
the last index on the disc

setDiscId

public void setDiscId(int i)

setId

public void setId(int i)

setCdindexId

public void setCdindexId(java.lang.String str)

setTocEntries

public void setTocEntries(int n)
                   throws java.lang.IndexOutOfBoundsException
Sets the size of the track array; previous contents are lost.
Parameters:
n -  
Throws:
java.lang.IndexOutOfBoundsException -  

addTrack

public void addTrack(TocEntry ent)
              throws java.lang.ArrayStoreException
Adds a new track to the album at the end, re-allocating the Toc and incrementing the total number of tracks.
Parameters:
ent - the new track to add to the album.
Throws:
java.lang.ArrayStoreException -  

addTrack

public void addTrack(TocEntry ent,
                     int ind)
              throws java.lang.IndexOutOfBoundsException,
                     java.lang.ArrayStoreException
Adds a new track to the album at the indicated position, re-allocating the Toc and incrementing the total number of tracks.
Parameters:
ent -  
ind -  
Throws:
java.lang.IndexOutOfBoundsException -  
java.lang.ArrayStoreException -  

moveUp

public void moveUp(TocEntry ent)
            throws java.util.NoSuchElementException
Swaps the track with the one previous to it.
Parameters:
ent -  
Throws:
java.util.NoSuchElementException -  

moveDown

public void moveDown(TocEntry ent)
              throws java.util.NoSuchElementException
Swaps the track with the one below it.
Parameters:
ent -  
Throws:
java.util.NoSuchElementException -  

deleteTrack

public void deleteTrack(TocEntry ent)
                 throws java.util.NoSuchElementException
Deletes the indicated track.
Parameters:
ent -  
Throws:
java.util.NoSuchElementException -  

setVolName

public void setVolName(java.lang.String v)
the ISO9660 Volume Label String

setTrackString

public void setTrackString(java.lang.String s)
the list of tracks as required for freedb

setArtist

public void setArtist(java.lang.String a)
cddb info

setAlbum

public void setAlbum(java.lang.String a)
album name

setYear

public void setYear(int y)
year of publishing

setComment

public void setComment(java.lang.String c)
a comment

setGenre

public void setGenre(java.lang.String g)
hopefully an ID3 comment if you want it written to an MP3 file

setArranger

public void setArranger(java.lang.String a)
from CD-TEXT info

setSongwriter

public void setSongwriter(java.lang.String s)
from CD-TEXT info

setPath

public void setPath(java.lang.String p)

setMultiArtist

public void setMultiArtist(boolean m)
true if there is more than one artist

setInitialized

public void setInitialized(boolean b)
true if this information had been set

getArtistPath

public java.lang.String getArtistPath()
The artist's name, with all strange characters replaced by '_'.
Returns:
the artist's name, with all strange characters replaced by '_'.

getAlbumPath

public java.lang.String getAlbumPath()
The album name, with all strange characters replaced by '_'.
Returns:
the album name, with all strange characters replaced by '_'.

calculateIds

public void calculateIds()
Calculates the cdindexId and discId values.

calculateTrackString

public void calculateTrackString()

copy

public DiscInfo copy()

touch

public static void touch()