com.dt.iTunesController
Class ITPlaylist

java.lang.Object
  extended by com.dt.iTunesController.ITObject
      extended by com.dt.iTunesController.ITPlaylist
Direct Known Subclasses:
ITAudioCDPlaylist, ITLibraryPlaylist, ITUserPlaylist

public class ITPlaylist
extends ITObject

Represents a playlist. A playlist is always associated with an ITSource. You can retrieve all the playlists defined for a source using ITSource.getPlaylists(). For convenience, you can retrieve the main library playlist using iTunes.getLibraryPlaylist(). You can create a new playlist using iTunes.createPlaylist().


Field Summary
 
Fields inherited from class com.dt.iTunesController.ITObject
object
 
Constructor Summary
ITPlaylist(com.jacob.com.Dispatch d)
           
 
Method Summary
 void delete()
          Delete this object.
 int getDuration()
          Returns the total length of all songs in the object (in seconds).
 ITPlaylistKind getKind()
          Returns the kind of the object.
 double getSize()
          Returns the total size of all songs in the object (in bytes).
 ITPlaylistRepeatMode getSongRepeat()
          Returns the playback repeat mode.
 ITSource getSource()
          Returns an ITSource object corresponding to the source that contains the object.
 java.lang.String getTime()
          Returns the total length of all songs in the object (in MM:SS format).
 ITTrackCollection getTracks()
          Returns a collection containing the tracks in this object.
 boolean getVisible()
          Returns true if the object is visible in the sources list.
 void playFirstTrack()
          Start playing the first track in this object.
 void print(boolean showPrintDialog, ITPlaylistPrintKind printKind, java.lang.String theme)
          Print this object.
 ITTrackCollection search(java.lang.String searchText, ITPlaylistSearchField searchFields)
          Returns a collection containing the tracks with the specified text.
 void setShuffle(boolean shouldShuffle)
          Set whether songs in the object should be played in random order.
 void setSongRepeat(ITPlaylistRepeatMode repeatMode)
          Sets the playback repeat mode.
 
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

ITPlaylist

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

delete

public void delete()
Delete this object.


playFirstTrack

public void playFirstTrack()
Start playing the first track in this object.


print

public void print(boolean showPrintDialog,
                  ITPlaylistPrintKind printKind,
                  java.lang.String theme)
Print this object.

Parameters:
showPrintDialog - If true, display the print dialog.
printKind - The printout kind.
theme - The name of the theme to use. This corresponds to the name of a Theme combo box item in the print dialog for the specified printKind (e.g. "Track length"). This string cannot be longer than 255 characters, but it may be empty.

search

public ITTrackCollection search(java.lang.String searchText,
                                ITPlaylistSearchField searchFields)
Returns a collection containing the tracks with the specified text.

Parameters:
searchText - The text to search for. This string cannot be longer than 255 chracters.
searchFields - Specifies which fields of each track should be searched for searchText.
Returns:
Collection of IITTrack objects. This will be NULL if no tracks meet the search criteria.

getKind

public ITPlaylistKind getKind()
Returns the kind of the object.

Returns:
Returns the kind of the object.

getSource

public ITSource getSource()
Returns an ITSource object corresponding to the source that contains the object.

Returns:
Returns an ITSource object corresponding to the source that contains the object.

getDuration

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

Returns:
Returns the total length of all songs in the object (in seconds).

setShuffle

public void setShuffle(boolean shouldShuffle)
Set whether songs in the object should be played in random order.

Parameters:
shouldShuffle - True if songs in the object should be played in random order.

getSize

public double getSize()
Returns the total size of all songs in the object (in bytes).

Returns:
Returns the total size of all songs in the object (in bytes).

setSongRepeat

public void setSongRepeat(ITPlaylistRepeatMode repeatMode)
Sets the playback repeat mode.

Parameters:
repeatMode - The new playback repeat mode.

getSongRepeat

public ITPlaylistRepeatMode getSongRepeat()
Returns the playback repeat mode.

Returns:
Returns the playback repeat mode.

getTime

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

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

getVisible

public boolean getVisible()
Returns true if the object is visible in the sources list.

Returns:
True if the object is visible in the sources list.

getTracks

public ITTrackCollection getTracks()
Returns a collection containing the tracks in this object.

Returns:
Collection of ITTrack objects.