iTunes COM Interface: IITTrackCollection Interface Reference

iTunes COM

IITTrackCollection Interface Reference

List of all members.

Detailed Description

Represents a collection of track objects.

Note that collection indices are always 1-based.

You can retrieve all the tracks defined for a playlist using IITPlaylist::Tracks().

You can retrieve the currently selected track or tracks using IiTunes::SelectedTracks().

After calling IITLibraryPlaylist::AddFile(), IITLibraryPlaylist::AddFiles(), IITUserPlaylist::AddFile(), IITUserPlaylist::AddFiles(), IiTunes::ConvertFile(), IiTunes::ConvertFile2(), IiTunes::ConvertFiles(), IiTunes::ConvertFiles2(), IiTunes::ConvertTrack(), IiTunes::ConvertTrack2(), IiTunes::ConvertTracks(), or IiTunes::ConvertTracks2(), you can retrieve the added or converted tracks using IITOperationStatus::Tracks().

Public Member Functions

Properties
HRESULT Count ([out, retval] long *count)
 Returns the number of tracks in the collection.
HRESULT Item ([in] long index,[out, retval] IITTrack **iTrack)
 Returns an IITTrack object corresponding to the given index (1-based).
HRESULT ItemByPlayOrder ([in] long index,[out, retval] IITTrack **iTrack)
 Returns an IITTrack object corresponding to the given index (1-based).
HRESULT ItemByName ([in] BSTR name,[out, retval] IITTrack **iTrack)
 Returns an IITTrack object with the specified name.
HRESULT _NewEnum ([out, retval] IUnknown **iEnumerator)
 Returns an IEnumVARIANT object which can enumerate the collection.
HRESULT ItemByPersistentID ([in] long highID,[in] long lowID,[out, retval] IITTrack **iTrack)
 Returns an IITTrack object with the specified persistent ID. See the documentation on IITObject for more information on persistent IDs.

Member Function Documentation

HRESULT IITTrackCollection::_NewEnum [out, retval] IUnknown **  iEnumerator  ) 
 

Returns an IEnumVARIANT object which can enumerate the collection.

Note that track enumerators use IITTrackCollection::Item(), not IITTrackCollection::ItemByPlayOrder(). In other words, you cannot use an enumerator to enumerate tracks by play order.

Note:
This property is available in iTunes 4.7 and later (iTunes type library 1.2 and later).
Parameters:
iEnumerator Returns an IEnumVARIANT object which can enumerate the collection.
Return values:
S_OK The operation was successful.
E_POINTER iEnumerator is NULL.
E_FAIL An unexpected error occurred.

HRESULT IITTrackCollection::Count [out, retval] long *  count  ) 
 

Returns the number of tracks in the collection.

Parameters:
count Returns the number of tracks in the collection.
Return values:
S_OK The operation was successful.
E_POINTER count is NULL.
ITUNES_E_OBJECTDELETED The playlist containing the tracks has been deleted.
E_FAIL An unexpected error occurred.

HRESULT IITTrackCollection::Item [in] long  index,
[out, retval] IITTrack **  iTrack
 

Returns an IITTrack object corresponding to the given index (1-based).

The index is independent of the play order in the playlist.

Parameters:
index Index of the track to retrieve, must be less than or equal to IITTrackCollection::Count().
iTrack Returns an IITTrack object corresponding to the given index. Will be set to NULL if no track could be retrieved.
Return values:
S_OK The operation was successful.
S_FALSE index is too high.
E_INVALIDARG index is less than one.
E_POINTER iTrack is NULL.
ITUNES_E_OBJECTDELETED The playlist containing the tracks has been deleted.
E_FAIL An unexpected error occurred.

HRESULT IITTrackCollection::ItemByName [in] BSTR  name,
[out, retval] IITTrack **  iTrack
 

Returns an IITTrack object with the specified name.

Parameters:
name The name of the track to retrieve.
iTrack Returns an IITTrack object with the specified name. Will be set to NULL if no track could be retrieved.
Return values:
S_OK The operation was successful.
S_FALSE A track with the specified name could not be found.
E_INVALIDARG name is empty.
E_POINTER name or iTrack is NULL.
ITUNES_E_OBJECTDELETED The playlist containing the tracks has been deleted.
E_FAIL An unexpected error occurred.

HRESULT IITTrackCollection::ItemByPersistentID [in] long  highID,
[in] long  lowID,
[out, retval] IITTrack **  iTrack
 

Returns an IITTrack object with the specified persistent ID. See the documentation on IITObject for more information on persistent IDs.

Note:
This property is available in iTunes 7.7 and later (iTunes type library 1.11 and later).
Parameters:
highID The high 32 bits of the 64-bit persistent ID.
lowID The low 32 bits of the 64-bit persistent ID.
iTrack Returns an IITTrack object with the specified persistent ID. Will be set to NULL if no track could be retrieved.
Return values:
S_OK The operation was successful.
S_FALSE A track with the specified persistent ID could not be found.
E_POINTER iTrack is NULL.
ITUNES_E_OBJECTDELETED The playlist containing the tracks has been deleted.
E_FAIL An unexpected error occurred.

HRESULT IITTrackCollection::ItemByPlayOrder [in] long  index,
[out, retval] IITTrack **  iTrack
 

Returns an IITTrack object corresponding to the given index (1-based).

The index is defined by the play order of the playlist containing the track collection.

Parameters:
index Index of the track to retrieve, must be less than or equal to IITTrackCollection::Count().
iTrack Returns an IITTrack object corresponding to the given play order index. Will be set to NULL if no track could be retrieved.
Return values:
S_OK The operation was successful.
S_FALSE index is too high.
E_INVALIDARG index is less than one.
E_POINTER iTrack is NULL.
ITUNES_E_OBJECTDELETED The playlist containing the tracks has been deleted.
E_FAIL An unexpected error occurred.


Generated on Fri Mar 13 12:50:54 2009 for iTunes 8.1.0.52
©2004-2007 Apple Computer, Inc.