com.dt.iTunesController
Class ITTrack

java.lang.Object
  extended by com.dt.iTunesController.ITObject
      extended by com.dt.iTunesController.ITTrack

public class ITTrack
extends ITObject

Represents a track. A track represents a song in a single playlist. A song may be in more than one playlist, in which case it would be represented by multiple tracks. You can retrieve the currently targeted (playing) track using iTunes.getCurrentTrack(). Typically, an ITrack is accessed through an ITTrackCollection. You can retrieve all the tracks defined for a playlist using ITPlaylist.getTracks(). You can retrieve the currently selected track or tracks using iTunes.getSelectedTracks().


Constructor Summary
ITTrack(com.jacob.com.Dispatch d)
           
 
Method Summary
 void delete()
          Delete this object.
 java.lang.String getAlbum()
          Returns the name of the album containing the object.
 java.lang.String getArtist()
          Returns the name of the artist/source of the object.
 int getBitRate()
          Returns the bit rate of the object (in kbps).
 int getBPM()
          Returns the tempo of the object (in beats per minute).
 java.lang.String getComment()
          Returns freeform notes about the object.
 boolean getCompilation()
          Returns true if this object is from a compilation album.
 java.lang.String getComposer()
          Returns the composer of the object.
 java.util.Date getDateAdded()
          Returns the date the object was added to the playlist.
 int getDiscCount()
          Returns the total number of discs in the source album.
 int getDiscNumber()
          Returns the index of the disc containing the object on the source album.
 int getDuration()
          Returns the length of the object (in seconds).
 boolean getEnabled()
          Returns true if the object is checked for playback.
 java.lang.String getEQ()
          Returns the name of the EQ preset of the object.
 int getFinish()
          Returns the stop time of the object (in seconds).
 java.lang.String getGenre()
          Set the music/audio genre (category) of the object.
 java.lang.String getGrouping()
          Returns the grouping (piece) of the object.
 ITTrackKind getKind()
           
 java.lang.String getKindAsString()
          Returns the text description of the object (e.g.
 java.util.Date getModificationDate()
          Returns the modification date of the content of the object.
 int getPlayedCount()
          Returns the number of times the object has been played.
 java.util.Date getPlayedDate()
          Returns the date and time the object was last played.
 ITPlaylist getPlaylist()
          Returns an ITPlaylist object corresponding to the playlist that contains the object.
 int getPlayOrderIndex()
          Returns the play order index of the object in the owner playlist (1-based).
 int getRating()
          Returns the rating of the object (0 to 100).
 int getSampleRate()
          Returns the sample rate of the object (in Hz).
 int getSize()
          Returns the size of the object (in bytes).
 int getStart()
          Returns the start time of the object (in seconds).
 java.lang.String getTime()
          Returns the length of the object (in MM:SS format).
 int getTrackCount()
          Returns the total number of tracks on the source album.
 int getTrackNumber()
          Returns the index of the object on the source album.
 int getVolumeAdjustment()
          Returns the relative volume adjustment of the object (-100% to 100%).
 int getYear()
          Returns the year the object was recorded/released.
 void play()
          Start playing this object.
 void setAlbum(java.lang.String album)
          Set the name of the album containing the object.;
 void setArtist(java.lang.String artist)
          Set the name of the artist/source of the object.
 void setBPM(int beatsPerMinute)
          Set the tempo of the object (in beats per minute).
 void setComment(java.lang.String comment)
          Set freeform notes about the object.
 void setCompilation(boolean isCompilation)
          Set whether this object is from a compilation album.
 void setComposer(java.lang.String composer)
          Set the composer of the object.
 void setDiscCount(int discCount)
          Set the total number of discs in the source album.
 void setDiscNumber(int discNumber)
          Set the index of the disc containing the object on the source album.
 void setEnabled(boolean shouldBeEnabled)
          Set whether this object is checked for playback.
 void setEQ(java.lang.String eq)
          Set the name of the EQ preset of the object.
 void setFinish(int finish)
          Set the stop time of the object (in seconds).
 void setGenre(java.lang.String genre)
          Returns the music/audio genre (category) of the object.
 void setGrouping(java.lang.String grouping)
          Set the grouping (piece) of the object.
 void setPlayedCount(int playedCount)
          Set the number of times the object has been played.
 void setPlayedDate(java.util.Date playedDate)
          Set the date and time the object was last played.
 void setRating(int rating)
          Set the rating of the object (0 to 100).
 void setStart(int start)
          Set the start time of the object (in seconds).
 void setTrackCount(int trackCount)
          Set the total number of tracks on the source album.
 void setTrackNumber(int trackNumber)
          Set the index of the object on the source album.
 void setVolumeAdjustment(int volumeAdjustment)
          Set the relative volume adjustment of the object (-100% to 100%).
 void setYear(int year)
          Set the year the object was recorded/released.
 
Methods inherited from class com.dt.iTunesController.ITObject
fetchDispatch, getIndex, getName, getPlaylistID, getSourceID, getTrackDatabaseID, getTrackID, setName
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ITTrack

public ITTrack(com.jacob.com.Dispatch d)
Method Detail

delete

public void delete()
Delete this object.


play

public void play()
Start playing this object.


setAlbum

public void setAlbum(java.lang.String album)
Set the name of the album containing the object.;

Parameters:
album - The new name of the album containing the object.

getAlbum

public java.lang.String getAlbum()
Returns the name of the album containing the object.

Returns:
Returns the name of the album containing the object.

setArtist

public void setArtist(java.lang.String artist)
Set the name of the artist/source of the object.

Parameters:
artist - The new artist/source of the object.

getArtist

public java.lang.String getArtist()
Returns the name of the artist/source of the object.

Returns:
Returns the name of the artist/source of the object.

getBitRate

public int getBitRate()
Returns the bit rate of the object (in kbps).

Returns:
Returns the bit rate of the object (in kbps).

setBPM

public void setBPM(int beatsPerMinute)
Set the tempo of the object (in beats per minute).

Parameters:
beatsPerMinute - The new tempo of the object (in beats per minute).

getBPM

public int getBPM()
Returns the tempo of the object (in beats per minute).

Returns:
Returns the tempo of the object (in beats per minute).

setComment

public void setComment(java.lang.String comment)
Set freeform notes about the object.

Parameters:
comment - The new freeform notes about the object.

getComment

public java.lang.String getComment()
Returns freeform notes about the object.

Returns:
Returns freeform notes about the object.

setCompilation

public void setCompilation(boolean isCompilation)
Set whether this object is from a compilation album.

Parameters:
isCompilation - True if this object should be from a compilation album.

getCompilation

public boolean getCompilation()
Returns true if this object is from a compilation album.

Returns:
Returns true if this object is from a compilation album.

setComposer

public void setComposer(java.lang.String composer)
Set the composer of the object.

Parameters:
composer - The new composer of the object.

getComposer

public java.lang.String getComposer()
Returns the composer of the object.

Returns:
Returns the composer of the object.

getDateAdded

public java.util.Date getDateAdded()
Returns the date the object was added to the playlist.

Returns:
Returns the date the object was added to the playlist.

setDiscCount

public void setDiscCount(int discCount)
Set the total number of discs in the source album.

Parameters:
discCount - The new total number of discs in the source album.

getDiscCount

public int getDiscCount()
Returns the total number of discs in the source album.

Returns:
Returns the total number of discs in the source album.

setDiscNumber

public void setDiscNumber(int discNumber)
Set the index of the disc containing the object on the source album.

Parameters:
discNumber - The new index of the disc containing the object on the source album.

getDiscNumber

public int getDiscNumber()
Returns the index of the disc containing the object on the source album.

Returns:
Returns the index of the disc containing the object on the source album.

getDuration

public int getDuration()
Returns the length of the object (in seconds).

Returns:
Returns the length of the object (in seconds).

setEnabled

public void setEnabled(boolean shouldBeEnabled)
Set whether this object is checked for playback.

Parameters:
shouldBeEnabled - True if the object should be checked for playback.

getEnabled

public boolean getEnabled()
Returns true if the object is checked for playback.

Returns:
Returns true if the object is checked for playback.

setEQ

public void setEQ(java.lang.String eq)
Set the name of the EQ preset of the object.

Parameters:
eq - The new name of the EQ preset of the object.

getEQ

public java.lang.String getEQ()
Returns the name of the EQ preset of the object.

Returns:
Returns the name of the EQ preset of the object.

setFinish

public void setFinish(int finish)
Set the stop time of the object (in seconds).

Parameters:
finish - The new stop time of the object (in seconds).

getFinish

public int getFinish()
Returns the stop time of the object (in seconds).

Returns:
Returns the stop time of the object (in seconds).

setGenre

public void setGenre(java.lang.String genre)
Returns the music/audio genre (category) of the object.

Parameters:
genre - Returns the music/audio genre (category) of the object.

getGenre

public java.lang.String getGenre()
Set the music/audio genre (category) of the object.

Returns:
The new music/audio genre (category) of the object.

setGrouping

public void setGrouping(java.lang.String grouping)
Set the grouping (piece) of the object. Generally used to denote movements within classical work.

Parameters:
grouping - The new grouping (piece) of the object.

getGrouping

public java.lang.String getGrouping()
Returns the grouping (piece) of the object. Generally used to denote movements within classical work.

Returns:
Returns the grouping (piece) of the object.

getKind

public ITTrackKind getKind()

getKindAsString

public java.lang.String getKindAsString()
Returns the text description of the object (e.g. "AAC audio file").

Returns:
Returns the text description of the object (e.g. "AAC audio file").

getModificationDate

public java.util.Date getModificationDate()
Returns the modification date of the content of the object.

Returns:
Returns the modification date of the content of the object.

setPlayedCount

public void setPlayedCount(int playedCount)
Set the number of times the object has been played. This property cannot be set if the object is not playable (e.g. a PDF file).

Parameters:
playedCount - The new number of times the object has been played.

getPlayedCount

public int getPlayedCount()
Returns the number of times the object has been played.

Returns:
Returns the number of times the object has been played.

setPlayedDate

public void setPlayedDate(java.util.Date playedDate)
Set the date and time the object was last played. This property cannot be set if the object is not playable (e.g. a PDF file). A value of zero means no played date.

Parameters:
playedDate - The new date and time the object was last played.

getPlayedDate

public java.util.Date getPlayedDate()
Returns the date and time the object was last played. A value of zero means no played date.

Returns:
Returns the date and time the object was last played.

getPlaylist

public ITPlaylist getPlaylist()
Returns an ITPlaylist object corresponding to the playlist that contains the object. Use ITFileOrCDTrack::Playlists() or IITURLTrack::Playlists() to get the collection of all playlists that contain the song this object represents.

Returns:
Returns an ITPlaylist object corresponding to the playlist that contains the object.

getPlayOrderIndex

public int getPlayOrderIndex()
Returns the play order index of the object in the owner playlist (1-based). You can pass this index to IITTrackCollection::ItemByPlayOrder() for the collection returned by ITPlaylist::Tracks() to retrieve an ITTrack object corresponding to this object.

Returns:
Returns the play order index of the object in the owner playlist.

setRating

public void setRating(int rating)
Set the rating of the object (0 to 100). If the object rating is set to 0, it will be computed based on the album rating.

Parameters:
rating - The new rating of the object (0 to 100).

getRating

public int getRating()
Returns the rating of the object (0 to 100). If the object rating has never been set, or has been set to 0, it will be computed based on the album rating.

Returns:
Returns the rating of the object (0 to 100).

getSampleRate

public int getSampleRate()
Returns the sample rate of the object (in Hz).

Returns:
Returns the sample rate of the object (in Hz).

getSize

public int getSize()
Returns the size of the object (in bytes).

Returns:
Returns the size of the object (in bytes).

setStart

public void setStart(int start)
Set the start time of the object (in seconds).

Parameters:
start - The new start time of the object (in seconds).

getStart

public int getStart()
Returns the start time of the object (in seconds).

Returns:
Returns the start time of the object (in seconds).

getTime

public java.lang.String getTime()
Returns the length of the object (in MM:SS format).

Returns:
Returns the length of the object (in MM:SS format).

setTrackCount

public void setTrackCount(int trackCount)
Set the total number of tracks on the source album.

Parameters:
trackCount - The new total number of tracks on the source album.

getTrackCount

public int getTrackCount()
Returns the total number of tracks on the source album.

Returns:
Returns the total number of tracks on the source album.

setTrackNumber

public void setTrackNumber(int trackNumber)
Set the index of the object on the source album.

Parameters:
trackNumber - The new index of the object on the source album.

getTrackNumber

public int getTrackNumber()
Returns the index of the object on the source album.

Returns:
Returns the index of the object on the source album.

setVolumeAdjustment

public void setVolumeAdjustment(int volumeAdjustment)
Set the relative volume adjustment of the object (-100% to 100%).

Parameters:
volumeAdjustment - Set the relative volume adjustment of the object (-100% to 100%).

getVolumeAdjustment

public int getVolumeAdjustment()
Returns the relative volume adjustment of the object (-100% to 100%).

Returns:
Returns the relative volume adjustment of the object (-100% to 100%).

setYear

public void setYear(int year)
Set the year the object was recorded/released.

Parameters:
year - The new year the object was recorded/released.

getYear

public int getYear()
Returns the year the object was recorded/released.

Returns:
Returns the year the object was recorded/released.