iTunes COM Interface: IiTunes Interface Reference

iTunes COM

IiTunes Interface Reference

List of all members.

Detailed Description

Defines the top-level iTunes application object.

This interface defines the top-level iTunes application object. All other iTunes interfaces are accessed through this object.

This is the only externally creatable iTunes COM interface. All other iTunes interfaces are accessed through this interface. It can be created using the iTunesApp class.

To create an IiTunes object from C++:

    #include "iTunesCOMInterface.h"
    
    HRESULT  hRes;
    IiTunes* iITunes;
    
    // note - CLSID_iTunesApp and IID_IiTunes are defined in iTunesCOMInterface_i.c
    hRes = ::CoCreateInstance(CLSID_iTunesApp, NULL, CLSCTX_LOCAL_SERVER, IID_IiTunes, (PVOID *)&iITunes);

To create an IiTunes object from C#:

    iTunesLib.IiTunes iTunesApp;
    iTunesApp = new iTunesLib.iTunesAppClass();

To create an IiTunes object from Visual Basic:

    Imports iTunesLib
    Dim iTunesApp as new iTunesApp

To create an IiTunes object from VBScript:

    Dim iTunesApp;
    Set iTunesApp = WScript.CreateObject("iTunes.Application");

To create an IiTunes object from JScript:

    var iTunesApp = WScript.CreateObject("iTunes.Application");

To create an IiTunes object from Perl:

    $iTunesApp = new Win32::OLE("iTunes.Application");

Public Member Functions

Player Controls
HRESULT BackTrack ()
 Reposition to the beginning of the current track or go to the previous track if already at start of current track.
HRESULT FastForward ()
 Skip forward in a playing track.
HRESULT NextTrack ()
 Advance to the next track in the current playlist.
HRESULT Pause ()
 Pause playback.
HRESULT Play ()
 Play the currently targeted track.
HRESULT PlayFile ([in] BSTR filePath)
 Play the specified file path, adding it to the library if not already present.
HRESULT PlayPause ()
 Toggle the playing/paused state of the current track.
HRESULT PreviousTrack ()
 Return to the previous track in the current playlist.
HRESULT Resume ()
 Disable fast forward/rewind and resume playback, if playing.
HRESULT Rewind ()
 Skip backwards in a playing track.
HRESULT Stop ()
 Stop playback.
HRESULT GetPlayerButtonsState ([out] VARIANT_BOOL *previousEnabled,[out] ITPlayButtonState *playPauseStopState,[out] VARIANT_BOOL *nextEnabled)
 Retrieves the current state of the player buttons in the window containing the currently targeted track. If there is no currently targeted track, returns the current state of the player buttons in the main browser window.
HRESULT PlayerButtonClicked ([in] ITPlayerButton playerButton,[in] long playerButtonModifierKeys)
 Simulate a click on a player control button in the window containing the currently targeted track. If there is no currently targeted track, simulates a click on a player control button in the main browser window.
Conversion Methods
HRESULT ConvertFile ([in] BSTR filePath,[out, retval] IITOperationStatus **iStatus)
 Start converting the specified file or folder.
HRESULT ConvertFiles ([in] VARIANT *filePaths,[out, retval] IITOperationStatus **iStatus)
 Start converting the specified files and/or folders.
HRESULT ConvertTrack ([in] VARIANT *iTrackToConvert,[out, retval] IITOperationStatus **iStatus)
 Start converting the specified track.
HRESULT ConvertTracks ([in] VARIANT *iTracksToConvert,[out, retval] IITOperationStatus **iStatus)
 Start converting the specified tracks.
HRESULT ConvertFile2 ([in] BSTR filePath,[out, retval] IITConvertOperationStatus **iStatus)
 Start converting the specified file or folder.
HRESULT ConvertFiles2 ([in] VARIANT *filePaths,[out, retval] IITConvertOperationStatus **iStatus)
 Start converting the specified files and/or folders.
HRESULT ConvertTrack2 ([in] VARIANT *iTrackToConvert,[out, retval] IITConvertOperationStatus **iStatus)
 Start converting the specified track.
HRESULT ConvertTracks2 ([in] VARIANT *iTracksToConvert,[out, retval] IITConvertOperationStatus **iStatus)
 Start converting the specified tracks.
Miscellaneous Methods
HRESULT CheckVersion ([in] long majorVersion,[in] long minorVersion,[out, retval] VARIANT_BOOL *isCompatible)
 Returns true if this version of the iTunes type library is compatible with the specified version.
HRESULT GetITObjectByID ([in] long sourceID,[in] long playlistID,[in] long trackID,[in] long databaseID,[out, retval] IITObject **iObject)
 Returns an IITObject corresponding to the specified IDs.
HRESULT CreatePlaylist ([in] BSTR playlistName,[out, retval] IITPlaylist **iPlaylist)
 Creates a new playlist in the main library.
HRESULT OpenURL ([in] BSTR url)
 Open the specified iTunes Store or streaming audio URL.
HRESULT GotoMusicStoreHomePage ()
 Go to the iTunes Store home page.
HRESULT UpdateIPod ()
 Update the contents of the iPod.
HRESULT Quit ()
 Exits the iTunes application.
HRESULT CreateEQPreset ([in] BSTR eqPresetName,[out, retval] IITEQPreset **iEQPreset)
 Creates a new EQ preset.
HRESULT CreatePlaylistInSource ([in] BSTR playlistName,[in] VARIANT *iSource,[out, retval] IITPlaylist **iPlaylist)
 Creates a new playlist in an existing source.
HRESULT SubscribeToPodcast ([in] BSTR url)
 Subscribes to the specified podcast feed URL. Any "unsafe" characters in the URL should already be converted into their corresponding escape sequences, iTunes will not do this.
HRESULT UpdatePodcastFeeds ()
 Updates all podcast feeds. This is equivalent to the user pressing the Update button when Podcasts is selected in the Source list.
HRESULT CreateFolder ([in] BSTR folderName,[out, retval] IITPlaylist **iFolder)
 Creates a new folder in the main library.
HRESULT CreateFolderInSource ([in] BSTR folderName,[in] VARIANT *iSource,[out, retval] IITPlaylist **iFolder)
 Creates a new folder in an existing source.
HRESULT GetITObjectPersistentIDs ([in] VARIANT *iObject,[out] long *highID,[out] long *lowID)
 Returns the high and low 32 bits of the persistent ID of the specified IITObject. See the documentation on IITObject for more information on persistent IDs.
Collection Properties
HRESULT Sources ([out, retval] IITSourceCollection **iSourceCollection)
 Returns a collection of music sources (music library, CD, device, etc.).
HRESULT Encoders ([out, retval] IITEncoderCollection **iEncoderCollection)
 Returns a collection of encoders.
HRESULT EQPresets ([out, retval] IITEQPresetCollection **iEQPresetCollection)
 Returns a collection of EQ presets.
HRESULT Visuals ([out, retval] IITVisualCollection **iVisualCollection)
 Returns a collection of visual plug-ins.
HRESULT Windows ([out, retval] IITWindowCollection **iWindowCollection)
 Returns a collection of visual plug-ins.
Sound Properties
HRESULT SoundVolume ([out, retval] long *volume)
 Returns the sound output volume (0 = minimum, 100 = maximum).
HRESULT SoundVolume ([in] long volume)
 Sets the sound output volume (0 = minimum, 100 = maximum).
HRESULT Mute ([out, retval] VARIANT_BOOL *isMuted)
 Returns true if the sound output is muted.
HRESULT Mute ([in] VARIANT_BOOL shouldMute)
 Sets sound output mute state.
Player Properties
HRESULT PlayerState ([out, retval] ITPlayerState *playerState)
 Returns the current player state.
HRESULT PlayerPosition ([out, retval] long *playerPos)
 Returns the player's position within the currently playing track in seconds.
HRESULT PlayerPosition ([in] long playerPos)
 Sets the player's position within the currently playing track in seconds.
Encoder Properties
HRESULT CurrentEncoder ([out, retval] IITEncoder **iEncoder)
 Returns the currently selected encoder (AAC, MP3, AIFF, WAV, etc.).
HRESULT CurrentEncoder ([in] IITEncoder *iEncoder)
 Sets the current encoder (AAC, MP3, AIFF, WAV, etc.).
Visual Properties
HRESULT VisualsEnabled ([out, retval] VARIANT_BOOL *isEnabled)
 Returns true if visuals are currently being displayed.
HRESULT VisualsEnabled ([in] VARIANT_BOOL shouldEnable)
 Set whether visuals should be displayed.
HRESULT FullScreenVisuals ([out, retval] VARIANT_BOOL *isFullScreen)
 Returns true if the visuals are displayed using the entire screen.
HRESULT FullScreenVisuals ([in] VARIANT_BOOL shouldUseFullScreen)
 Set whether visuals should be displayed using the entire screen.
HRESULT VisualSize ([out, retval] ITVisualSize *visualSize)
 Returns the size of the displayed visual.
HRESULT VisualSize ([in] ITVisualSize visualSize)
 Sets the size of the displayed visual.
HRESULT CurrentVisual ([out, retval] IITVisual **iVisual)
 Returns the currently selected visual plug-in.
HRESULT CurrentVisual ([in] IITVisual *iVisual)
 Sets the current visual plug-in.
EQ Properties
HRESULT EQEnabled ([out, retval] VARIANT_BOOL *isEnabled)
 Returns true if the equalizer is enabled.
HRESULT EQEnabled ([in] VARIANT_BOOL shouldEnable)
 Set whether the equalizer should be enabled.
HRESULT CurrentEQPreset ([out, retval] IITEQPreset **iEQPreset)
 Returns the currently selected EQ preset.
HRESULT CurrentEQPreset ([in] IITEQPreset *iEQPreset)
 Sets the current EQ preset.
Streaming Properties
HRESULT CurrentStreamTitle ([out, retval] BSTR *streamTitle)
 Returns the name of the current song in the playing stream (provided by streaming server).
HRESULT CurrentStreamURL ([out, retval] BSTR *streamURL)
 Returns the URL of the playing stream or streaming web site (provided by streaming server).
Miscellaneous Properties
HRESULT BrowserWindow ([out, retval] IITBrowserWindow **iBrowserWindow)
 Returns the main iTunes browser window.
HRESULT EQWindow ([out, retval] IITWindow **iEQWindow)
 Returns the EQ window.
HRESULT LibrarySource ([out, retval] IITSource **iLibrarySource)
 Returns the source that represents the main library.
HRESULT LibraryPlaylist ([out, retval] IITLibraryPlaylist **iLibraryPlaylist)
 Returns the main library playlist in the main library source.
HRESULT CurrentTrack ([out, retval] IITTrack **iTrack)
 Returns the currently targeted track.
HRESULT CurrentPlaylist ([out, retval] IITPlaylist **iPlaylist)
 Returns the playlist containing the currently targeted track.
HRESULT SelectedTracks ([out, retval] IITTrackCollection **iTrackCollection)
 Returns a collection containing the currently selected track or tracks.
HRESULT Version ([out, retval] BSTR *version)
 Returns the version of the iTunes application.
HRESULT AppCommandMessageProcessingEnabled ([out, retval] VARIANT_BOOL *isEnabled)
 Returns true if iTunes will process APPCOMMAND Windows messages.
HRESULT AppCommandMessageProcessingEnabled ([in] VARIANT_BOOL shouldEnable)
 Controls whether iTunes should process APPCOMMAND Windows messages.
HRESULT ForceToForegroundOnDialog ([out, retval] VARIANT_BOOL *forceToForegroundOnDialog)
 Returns true if iTunes will force itself to be the foreground application when it displays a dialog.
HRESULT ForceToForegroundOnDialog ([in] VARIANT_BOOL forceToForegroundOnDialog)
 Controls whether iTunes will force itself to be the foreground application when it displays a dialog.
HRESULT CanSetShuffle ([in] VARIANT *iPlaylist,[out, retval] VARIANT_BOOL *canSetShuffle)
 Returns true if the IITPlaylist::Shuffle property is writable for the specified playlist.
HRESULT CanSetSongRepeat ([in] VARIANT *iPlaylist,[out, retval] VARIANT_BOOL *canSetSongRepeat)
 Returns true if the IITPlaylist::SongRepeat property is writable for the specified playlist.
HRESULT ConvertOperationStatus ([out, retval] IITConvertOperationStatus **iStatus)
 Returns an IITConvertOperationStatus object if there is currently a conversion in progress.
HRESULT SoundVolumeControlEnabled ([out, retval] VARIANT_BOOL *isEnabled)
 Returns true if the sound volume control is enabled.
HRESULT LibraryXMLPath ([out, retval] BSTR *filePath)
 Returns the full path to the current iTunes library XML file. The default file is "iTunes Music Library.xml" inside the "iTunes" folder in the user's "My Music" folder.
HRESULT ITObjectPersistentIDHigh ([in] VARIANT *iObject,[out, retval] long *highID)
 Returns the high 32 bits of the persistent ID of the specified IITObject. See the documentation on IITObject for more information on persistent IDs.
HRESULT ITObjectPersistentIDLow ([in] VARIANT *iObject,[out, retval] long *lowID)
 Returns the low 32 bits of the persistent ID of the specified IITObject. See the documentation on IITObject for more information on persistent IDs.

Member Function Documentation

HRESULT IiTunes::AppCommandMessageProcessingEnabled [in] VARIANT_BOOL  shouldEnable  ) 
 

Controls whether iTunes should process APPCOMMAND Windows messages.

If true, iTunes will process Windows APPCOMMAND messages such as APPCOMMAND_MEDIA_PLAY, APPCOMMAND_MEDIA_PAUSE, APPCOMMAND_MEDIA_NEXTTRACK, etc. Typically, these messages are generated by special keys on multimedia keyboards.

Note:
This property is available in iTunes 4.6 and later (iTunes type library 1.1 and later).
Parameters:
shouldEnable True if iTunes should process APPCOMMAND Windows messages.
Return values:
S_OK The operation was successful.
E_FAIL An unexpected error occurred.

HRESULT IiTunes::AppCommandMessageProcessingEnabled [out, retval] VARIANT_BOOL *  isEnabled  ) 
 

Returns true if iTunes will process APPCOMMAND Windows messages.

If true, iTunes will process Windows APPCOMMAND messages such as APPCOMMAND_MEDIA_PLAY, APPCOMMAND_MEDIA_PAUSE, APPCOMMAND_MEDIA_NEXTTRACK, etc. Typically, these messages are generated by special keys on multimedia keyboards.

Note:
This property is available in iTunes 4.6 and later (iTunes type library 1.1 and later).
Parameters:
isEnabled Returns true if iTunes will process APPCOMMAND Windows messages.
Return values:
S_OK The operation was successful.
E_POINTER isEnabled is NULL.
E_FAIL An unexpected error occurred.

HRESULT IiTunes::BackTrack  ) 
 

Reposition to the beginning of the current track or go to the previous track if already at start of current track.

Note:
As of iTunes 4.7 and later (iTunes type library 1.2 and later), iTunes will suppress the authorization dialog if this method attempts to start playing a purchased track that has not been authorized for playback on the current machine. The unauthorized track is skipped in this case.
Return values:
S_OK The operation was successful.
E_FAIL An unexpected error occurred.

HRESULT IiTunes::BrowserWindow [out, retval] IITBrowserWindow **  iBrowserWindow  ) 
 

Returns the main iTunes browser window.

Parameters:
iBrowserWindow An IITBrowserWindow object corresponding to the main iTunes browser window.
Return values:
S_OK The operation was successful.
E_POINTER iBrowserWindow is NULL.
E_FAIL An unexpected error occurred.

HRESULT IiTunes::CanSetShuffle [in] VARIANT *  iPlaylist,
[out, retval] VARIANT_BOOL *  canSetShuffle
 

Returns true if the IITPlaylist::Shuffle property is writable for the specified playlist.

Note:
This property is available in iTunes 4.7 and later (iTunes type library 1.2 and later).
Parameters:
iPlaylist A VARIANT of type VT_DISPATCH that points to an IITPlaylist.
canSetShuffle True if the IITPlaylist::Shuffle property is writable for the specified playlist.
Return values:
S_OK The operation was successful.
E_INVALIDARG iPlaylist is not the correct VARIANT type.
E_POINTER iPlaylist or canSetShuffle is NULL.
ITUNES_E_OBJECTDELETED The playlist has been deleted.
E_FAIL An unexpected error occurred.

HRESULT IiTunes::CanSetSongRepeat [in] VARIANT *  iPlaylist,
[out, retval] VARIANT_BOOL *  canSetSongRepeat
 

Returns true if the IITPlaylist::SongRepeat property is writable for the specified playlist.

Note:
This property is available in iTunes 4.7 and later (iTunes type library 1.2 and later).
Parameters:
iPlaylist A VARIANT of type VT_DISPATCH that points to an IITPlaylist.
canSetSongRepeat True if the IITPlaylist::SongRepeat property is writable for the specified playlist.
Return values:
S_OK The operation was successful.
E_INVALIDARG iPlaylist is not the correct VARIANT type.
E_POINTER iPlaylist or canSetShuffle is NULL.
ITUNES_E_OBJECTDELETED The playlist has been deleted.
E_FAIL An unexpected error occurred.

HRESULT IiTunes::CheckVersion [in] long  majorVersion,
[in] long  minorVersion,
[out, retval] VARIANT_BOOL *  isCompatible
 

Returns true if this version of the iTunes type library is compatible with the specified version.

The current major version is kITTypeLibrary_MajorVersion. The current minor version is kITTypeLibrary_MinorVersion.

iTunes 4.5 included version 1.0 of the iTunes type library. iTunes 4.6 included version 1.1 of the iTunes type library.

Parameters:
majorVersion Major version of iTunes interface.
minorVersion Minor version of iTunes interface.
isCompatible Returns true if iTunes is compatible with the indicated interface version.
Return values:
S_OK The operation was successful.
E_POINTER isCompatible is NULL.
E_FAIL An unexpected error occurred.

HRESULT IiTunes::ConvertFile [in] BSTR  filePath,
[out, retval] IITOperationStatus **  iStatus
 

Start converting the specified file or folder.

The file or files will added to the main library after conversion. For a file on an audio CD, this is equivalent to importing the song.

Use IiTunes::CurrentEncoder() to set the current encoder before converting.

Note:
As of iTunes 4.6 and later (iTunes type library 1.1 and later), you should use IiTunes::ConvertFile2(), which returns an IITConvertOperationStatus object to allow clients to retrieve additional conversion progress information.
Parameters:
filePath The full path to the file or folder to convert.
iStatus Returns an IITOperationStatus object corresponding to the asynchronous operation.
Return values:
S_OK The operation was successful.
E_POINTER filePath or iStatus is NULL.
E_INVALIDARG filePath is empty or too long.
ITUNES_E_CONVERSIONINPROGRESS There is already a conversion in progress.
E_FAIL An unexpected error occurred.

HRESULT IiTunes::ConvertFile2 [in] BSTR  filePath,
[out, retval] IITConvertOperationStatus **  iStatus
 

Start converting the specified file or folder.

The file or files will added to the main library after conversion. For a file on an audio CD, this is equivalent to importing the song.

Use IiTunes::CurrentEncoder() to set the current encoder before converting.

Note:
This method is available in iTunes 4.6 and later (iTunes type library 1.1 and later).
Parameters:
filePath The full path to the file or folder to convert.
iStatus Returns an IITConvertOperationStatus object corresponding to the asynchronous operation.
Return values:
S_OK The operation was successful.
E_POINTER filePath or iStatus is NULL.
E_INVALIDARG filePath is empty or too long.
ITUNES_E_CONVERSIONINPROGRESS There is already a conversion in progress.
E_FAIL An unexpected error occurred.

HRESULT IiTunes::ConvertFiles [in] VARIANT *  filePaths,
[out, retval] IITOperationStatus **  iStatus
 

Start converting the specified files and/or folders.

The files will added to the main library after conversion. For files on an audio CD, this is equivalent to importing the songs.

Use IiTunes::CurrentEncoder() to set the current encoder before converting.

Note:
As of iTunes 4.6 and later (iTunes type library 1.1 and later), you should use IiTunes::ConvertFiles2(), which returns an IITConvertOperationStatus object to allow clients to retrieve additional conversion progress information.
Parameters:
filePaths The single-dimensioned array of full paths to each file or folder. filePaths can be of type VT_ARRAY|VT_VARIANT, where each entry is a VT_BSTR, or VT_ARRAY|VT_BSTR. You can also pass a JScript Array object.
iStatus Returns an IITOperationStatus object corresponding to the asynchronous operation.
Return values:
S_OK The operation was successful.
E_POINTER filePaths or iStatus is NULL.
E_INVALIDARG filePaths is not the correct VARIANT type.
ITUNES_E_CONVERSIONINPROGRESS There is already a conversion in progress.
E_FAIL An unexpected error occurred.

HRESULT IiTunes::ConvertFiles2 [in] VARIANT *  filePaths,
[out, retval] IITConvertOperationStatus **  iStatus
 

Start converting the specified files and/or folders.

The files will added to the main library after conversion. For files on an audio CD, this is equivalent to importing the songs.

Use IiTunes::CurrentEncoder() to set the current encoder before converting.

Note:
This method is available in iTunes 4.6 and later (iTunes type library 1.1 and later).
Parameters:
filePaths The single-dimensioned array of full paths to each file or folder. filePaths can be of type VT_ARRAY|VT_VARIANT, where each entry is a VT_BSTR, or VT_ARRAY|VT_BSTR. You can also pass a JScript Array object.
iStatus Returns an IITConvertOperationStatus object corresponding to the asynchronous operation.
Return values:
S_OK The operation was successful.
E_POINTER filePaths or iStatus is NULL.
E_INVALIDARG filePaths is not the correct VARIANT type.
ITUNES_E_CONVERSIONINPROGRESS There is already a conversion in progress.
E_FAIL An unexpected error occurred.

HRESULT IiTunes::ConvertOperationStatus [out, retval] IITConvertOperationStatus **  iStatus  ) 
 

Returns an IITConvertOperationStatus object if there is currently a conversion in progress.

Note:
This property is available in iTunes 4.8 and later (iTunes type library 1.3 and later).
Parameters:
iStatus An IITConvertOperationStatus object which can be used to monitor the current conversion operation. Will be set to NULL if there is no conversion operation in progress.
Return values:
S_OK The operation was successful.
S_FALSE There is no conversion operation in progress.
E_POINTER iStatus is NULL.
E_FAIL An unexpected error occurred.

HRESULT IiTunes::ConvertTrack [in] VARIANT *  iTrackToConvert,
[out, retval] IITOperationStatus **  iStatus
 

Start converting the specified track.

For a track in an audio CD playlist, this is equivalent to importing the song.

Use IiTunes::CurrentEncoder() to set the current encoder before converting.

Note:
As of iTunes 4.6 and later (iTunes type library 1.1 and later), you should use IiTunes::ConvertTrack2(), which returns an IITConvertOperationStatus object to allow clients to retrieve additional conversion progress information.
Parameters:
iTrackToConvert The track to convert. This must be a VARIANT of type VT_DISPATCH that points to an IITTrack.
iStatus Returns an IITOperationStatus object corresponding to the asynchronous operation.
Return values:
S_OK The operation was successful.
E_POINTER iTrackToConvert or iStatus is NULL.
E_INVALIDARG iTrackToConvert is not the correct VARIANT type.
ITUNES_E_CONVERSIONINPROGRESS There is already a conversion in progress.
E_FAIL An unexpected error occurred.

HRESULT IiTunes::ConvertTrack2 [in] VARIANT *  iTrackToConvert,
[out, retval] IITConvertOperationStatus **  iStatus
 

Start converting the specified track.

For a track in an audio CD playlist, this is equivalent to importing the song.

Use IiTunes::CurrentEncoder() to set the current encoder before converting.

Note:
This method is available in iTunes 4.6 and later (iTunes type library 1.1 and later).
Parameters:
iTrackToConvert The track to convert. This must be a VARIANT of type VT_DISPATCH that points to an IITTrack.
iStatus Returns an IITConvertOperationStatus object corresponding to the asynchronous operation.
Return values:
S_OK The operation was successful.
E_POINTER iTrackToConvert or iStatus is NULL.
E_INVALIDARG iTrackToConvert is not the correct VARIANT type.
ITUNES_E_CONVERSIONINPROGRESS There is already a conversion in progress.
E_FAIL An unexpected error occurred.

HRESULT IiTunes::ConvertTracks [in] VARIANT *  iTracksToConvert,
[out, retval] IITOperationStatus **  iStatus
 

Start converting the specified tracks.

For a tracks in an audio CD playlist, this is equivalent to importing the songs.

Use IiTunes::CurrentEncoder() to set the current encoder before converting.

Note:
As of iTunes 4.6 and later (iTunes type library 1.1 and later), you should use IiTunes::ConvertTracks2(), which returns an IITConvertOperationStatus object to allow clients to retrieve additional conversion progress information.
Parameters:
iTracksToConvert The tracks to convert. This must be a VARIANT of type VT_DISPATCH that points to an IITTrackCollection.
iStatus Returns an IITOperationStatus object corresponding to the asynchronous operation.
Return values:
S_OK The operation was successful.
E_POINTER iTracksToConvert or iStatus is NULL.
E_INVALIDARG iTracksToConvert is not the correct VARIANT type.
ITUNES_E_CONVERSIONINPROGRESS There is already a conversion in progress.
E_FAIL An unexpected error occurred.

HRESULT IiTunes::ConvertTracks2 [in] VARIANT *  iTracksToConvert,
[out, retval] IITConvertOperationStatus **  iStatus
 

Start converting the specified tracks.

For a tracks in an audio CD playlist, this is equivalent to importing the songs.

Use IiTunes::CurrentEncoder() to set the current encoder before converting.

Note:
This method is available in iTunes 4.6 and later (iTunes type library 1.1 and later).
Parameters:
iTracksToConvert The tracks to convert. This must be a VARIANT of type VT_DISPATCH that points to an IITTrackCollection.
iStatus Returns an IITConvertOperationStatus object corresponding to the asynchronous operation.
Return values:
S_OK The operation was successful.
E_POINTER iTracksToConvert or iStatus is NULL.
E_INVALIDARG iTracksToConvert is not the correct VARIANT type.
ITUNES_E_CONVERSIONINPROGRESS There is already a conversion in progress.
E_FAIL An unexpected error occurred.

HRESULT IiTunes::CreateEQPreset [in] BSTR  eqPresetName,
[out, retval] IITEQPreset **  iEQPreset
 

Creates a new EQ preset.

The EQ preset will be created "flat", i.e. the preamp and all band levels will be set to 0.

EQ preset names cannot start with leading spaces. If you specify a name that starts with leading spaces they will be stripped out.

If eqPresetName is NULL or empty, the EQ preset will be created with a default name.

Note:
This method is available in iTunes 4.7 and later (iTunes type library 1.2 and later).
Parameters:
eqPresetName The name of the new EQ preset (may be NULL or empty).
iEQPreset Returns an IITEQPreset object corresponding to the new EQ preset.
Return values:
S_OK The operation was successful.
E_POINTER iEQPreset is NULL.
ITUNES_E_OBJECTEXISTS An EQ preset with this name already exists.
E_FAIL An unexpected error occurred.

HRESULT IiTunes::CreateFolder [in] BSTR  folderName,
[out, retval] IITPlaylist **  iFolder
 

Creates a new folder in the main library.

If folderName is NULL or empty, the folder will be created with a default name.

Note:
This method is available in iTunes 6.0.2 and later (iTunes type library 1.7 and later).
Parameters:
folderName The name of the new folder (may be NULL or empty).
iFolder Returns an IITPlaylist object corresponding to the new folder.
Return values:
S_OK The operation was successful.
E_POINTER iFolder is NULL.
E_FAIL An unexpected error occurred.

HRESULT IiTunes::CreateFolderInSource [in] BSTR  folderName,
[in] VARIANT *  iSource,
[out, retval] IITPlaylist **  iFolder
 

Creates a new folder in an existing source.

You may not be able to create a folder in every source. For example, you cannot create a folder in an audio CD source, or in an iPod source if it is in auto update mode.

If folderName is NULL or empty, the folder will be created with a default name.

Note:
This method is available in iTunes 6.0.2 and later (iTunes type library 1.7 and later).
Parameters:
folderName The name of the new folder (may be NULL or empty).
iSource The source that will contain the new folder. This is a VARIANT of type VT_DISPATCH that points to an IITSource.
iFolder Returns an IITPlaylist object corresponding to the new folder.
Return values:
S_OK The operation was successful.
E_POINTER iSource or iFolder is NULL.
E_INVALIDARG iSource is not the correct VARIANT type.
ITUNES_E_OBJECTLOCKED A folder cannot be created in this source.
ITUNES_E_OBJECTDELETED The source has been deleted.
E_FAIL An unexpected error occurred.

HRESULT IiTunes::CreatePlaylist [in] BSTR  playlistName,
[out, retval] IITPlaylist **  iPlaylist
 

Creates a new playlist in the main library.

If playlistName is NULL or empty, the playlist will be created with a default name.

Parameters:
playlistName The name of the new playlist (may be NULL or empty).
iPlaylist Returns an IITPlaylist object corresponding to the new playlist.
Return values:
S_OK The operation was successful.
E_POINTER iPlaylist is NULL.
E_FAIL An unexpected error occurred.

HRESULT IiTunes::CreatePlaylistInSource [in] BSTR  playlistName,
[in] VARIANT *  iSource,
[out, retval] IITPlaylist **  iPlaylist
 

Creates a new playlist in an existing source.

You may not be able to create a playlist in every source. For example, you cannot create a playlist in an audio CD source, or in an iPod source if it is in auto update mode.

If playlistName is NULL or empty, the playlist will be created with a default name.

Note:
This method is available in iTunes 4.7 and later (iTunes type library 1.2 and later).
Parameters:
playlistName The name of the new playlist (may be NULL or empty).
iSource The source that will contain the new playlist. This is a VARIANT of type VT_DISPATCH that points to an IITSource.
iPlaylist Returns an IITPlaylist object corresponding to the new playlist.
Return values:
S_OK The operation was successful.
E_POINTER iSource or iPlaylist is NULL.
E_INVALIDARG iSource is not the correct VARIANT type.
ITUNES_E_OBJECTLOCKED A playlist cannot be created in this source.
ITUNES_E_OBJECTDELETED The source has been deleted.
E_FAIL An unexpected error occurred.

HRESULT IiTunes::CurrentEncoder [in] IITEncoder iEncoder  ) 
 

Sets the current encoder (AAC, MP3, AIFF, WAV, etc.).

Parameters:
iEncoder An IITEncoder object corresponding to the new encoder.
Return values:
S_OK The operation was successful.
E_POINTER iEncoder is NULL.
ITUNES_E_OBJECTDELETED The encoder corresponding to iEncoder is not available.
E_FAIL An unexpected error occurred.

HRESULT IiTunes::CurrentEncoder [out, retval] IITEncoder **  iEncoder  ) 
 

Returns the currently selected encoder (AAC, MP3, AIFF, WAV, etc.).

Parameters:
iEncoder Returns an IITEncoder object corresponding to the current encoder.
Return values:
S_OK The operation was successful.
E_POINTER iEncoder is NULL.
E_FAIL An unexpected error occurred.

HRESULT IiTunes::CurrentEQPreset [in] IITEQPreset iEQPreset  ) 
 

Sets the current EQ preset.

Parameters:
iEQPreset An IITEQPreset object corresponding to the new EQ preset.
Return values:
S_OK The operation was successful.
E_POINTER iEQPreset is NULL.
ITUNES_E_OBJECTDELETED The EQ preset corresponding to iEQPreset is not available.
E_FAIL An unexpected error occurred.

HRESULT IiTunes::CurrentEQPreset [out, retval] IITEQPreset **  iEQPreset  ) 
 

Returns the currently selected EQ preset.

Parameters:
iEQPreset Returns an IITEQPreset object corresponding to the current EQ preset.
Return values:
S_OK The operation was successful.
E_POINTER iEQPreset is NULL.
E_FAIL An unexpected error occurred.

HRESULT IiTunes::CurrentPlaylist [out, retval] IITPlaylist **  iPlaylist  ) 
 

Returns the playlist containing the currently targeted track.

Parameters:
iPlaylist An IITPlaylist object corresponding to the playlist containing the currently targeted track. Will be set to NULL if there is no currently targeted playlist.
Return values:
S_OK The operation was successful.
S_FALSE There is no currently targeted track, so there is no currently targeted playlist.
E_POINTER iPlaylist is NULL.
E_FAIL An unexpected error occurred.

HRESULT IiTunes::CurrentStreamTitle [out, retval] BSTR *  streamTitle  ) 
 

Returns the name of the current song in the playing stream (provided by streaming server).

Parameters:
streamTitle Returns the name of the current song in the playing stream. Will be set to NULL if no stream title is available.
Return values:
S_OK The operation was successful.
E_POINTER streamTitle is NULL.
E_FAIL An unexpected error occurred.

HRESULT IiTunes::CurrentStreamURL [out, retval] BSTR *  streamURL  ) 
 

Returns the URL of the playing stream or streaming web site (provided by streaming server).

Parameters:
streamURL Returns the URL of the playing stream or streaming web site. Will be set to NULL if no stream URL is available.
Return values:
S_OK The operation was successful.
E_POINTER streamURL is NULL.
E_FAIL An unexpected error occurred.

HRESULT IiTunes::CurrentTrack [out, retval] IITTrack **  iTrack  ) 
 

Returns the currently targeted track.

Parameters:
iTrack An IITTrack object corresponding to the currently targeted track. Will be set to NULL if there is no currently targeted track.
Return values:
S_OK The operation was successful.
S_FALSE There is no currently targeted track.
E_POINTER iTrack is NULL.
E_FAIL An unexpected error occurred.

HRESULT IiTunes::CurrentVisual [in] IITVisual iVisual  ) 
 

Sets the current visual plug-in.

Parameters:
iVisual An IITVisual object corresponding to the new visual plug-in.
Return values:
S_OK The operation was successful.
E_POINTER iVisual is NULL.
ITUNES_E_OBJECTDELETED The visual plug-in corresponding to iVisual is not available.
E_FAIL An unexpected error occurred.

HRESULT IiTunes::CurrentVisual [out, retval] IITVisual **  iVisual  ) 
 

Returns the currently selected visual plug-in.

Parameters:
iVisual Returns an IITVisual object corresponding to the current visual plug-in.
Return values:
S_OK The operation was successful.
E_POINTER iVisual is NULL.
E_FAIL An unexpected error occurred.

HRESULT IiTunes::Encoders [out, retval] IITEncoderCollection **  iEncoderCollection  ) 
 

Returns a collection of encoders.

Parameters:
iEncoderCollection Collection of IITEncoder objects.
Return values:
S_OK The operation was successful.
E_POINTER iEncoderCollection is NULL.
E_FAIL An unexpected error occurred.

HRESULT IiTunes::EQEnabled [in] VARIANT_BOOL  shouldEnable  ) 
 

Set whether the equalizer should be enabled.

Parameters:
shouldEnable True if the equalizer should be enabled.
Return values:
S_OK The operation was successful.
E_FAIL An unexpected error occurred.

HRESULT IiTunes::EQEnabled [out, retval] VARIANT_BOOL *  isEnabled  ) 
 

Returns true if the equalizer is enabled.

Parameters:
isEnabled True if the equalizer is enabled.
Return values:
S_OK The operation was successful.
E_POINTER isEnabled is NULL.
E_FAIL An unexpected error occurred.

HRESULT IiTunes::EQPresets [out, retval] IITEQPresetCollection **  iEQPresetCollection  ) 
 

Returns a collection of EQ presets.

Parameters:
iEQPresetCollection Collection of IITEQPreset objects.
Return values:
S_OK The operation was successful.
E_POINTER iEQPresetCollection is NULL.
E_FAIL An unexpected error occurred.

HRESULT IiTunes::EQWindow [out, retval] IITWindow **  iEQWindow  ) 
 

Returns the EQ window.

Parameters:
iEQWindow An IITWindow object corresponding to the EQ window.
Return values:
S_OK The operation was successful.
E_POINTER iEQWindow is NULL.
E_FAIL An unexpected error occurred.

HRESULT IiTunes::FastForward  ) 
 

Skip forward in a playing track.

Return values:
S_OK The operation was successful.
E_FAIL An unexpected error occurred.

HRESULT IiTunes::ForceToForegroundOnDialog [in] VARIANT_BOOL  forceDialogsToForeground  ) 
 

Controls whether iTunes will force itself to be the foreground application when it displays a dialog.

This property is false by default, since typically a user will not want iTunes to come to the foreground if it isn't already the foreground application. For example, a user may be listening to a radio stream in the background, and a progress dialog could be displayed if the stream needs to be rebuffered. Since this dialog will go away when the rebuffering is complete, there is no reason for iTunes be forced to the foreground.

Note:
This property is available in iTunes 4.6 and later (iTunes type library 1.1 and later).
Parameters:
forceDialogsToForeground True if iTunes should force itself to be the foreground application when it displays a dialog.
Return values:
S_OK The operation was successful.
E_FAIL An unexpected error occurred.

HRESULT IiTunes::ForceToForegroundOnDialog [out, retval] VARIANT_BOOL *  forceDialogsToForeground  ) 
 

Returns true if iTunes will force itself to be the foreground application when it displays a dialog.

This property is false by default, since typically a user will not want iTunes to come to the foreground if it isn't already the foreground application. For example, a user may be listening to a radio stream in the background, and a progress dialog could be displayed if the stream needs to be rebuffered. Since this dialog will go away when the rebuffering is complete, there is no reason for iTunes be forced to the foreground.

Note:
This property is available in iTunes 4.6 and later (iTunes type library 1.1 and later).
Parameters:
forceDialogsToForeground Returns true if iTunes will force itself to be the foreground application when it displays a dialog.
Return values:
S_OK The operation was successful.
E_POINTER forceDialogsToForeground is NULL.
E_FAIL An unexpected error occurred.

HRESULT IiTunes::FullScreenVisuals [in] VARIANT_BOOL  shouldUseFullScreen  ) 
 

Set whether visuals should be displayed using the entire screen.

Parameters:
shouldUseFullScreen True if the visuals should be displayed using the entire screen.
Return values:
S_OK The operation was successful.
E_ACCESSDENIED This setting cannot be changed currently.
E_FAIL An unexpected error occurred.

HRESULT IiTunes::FullScreenVisuals [out, retval] VARIANT_BOOL *  isFullScreen  ) 
 

Returns true if the visuals are displayed using the entire screen.

Parameters:
isFullScreen True if the visuals are displayed using the entire screen.
Return values:
S_OK The operation was successful.
E_POINTER isFullScreen is NULL.
E_FAIL An unexpected error occurred.

HRESULT IiTunes::GetITObjectByID [in] long  sourceID,
[in] long  playlistID,
[in] long  trackID,
[in] long  databaseID,
[out, retval] IITObject **  iObject
 

Returns an IITObject corresponding to the specified IDs.

The object may be a source, playlist, or track.

Parameters:
sourceID The ID that identifies the source. Valid for a source, playlist, or track.
playlistID The ID that identifies the playlist. Valid for a playlist or track. Must be zero for a source.
trackID The ID that identifies the track within the playlist. Valid for a track. Must be zero for a source or playlist.
databaseID The ID that identifies the track, independent of its playlist. Valid for a track. Must be zero for a source or playlist.
iObject Returns an IITObject object corresponding to the specified IDs. Will be set to NULL if no object could be retrieved.
Return values:
S_OK The operation was successful.
S_FALSE An object with the specified IDs could not be found.
E_INVALIDARG Invalid combination of IDs.
E_POINTER iObject is NULL.
E_FAIL An unexpected error occurred.

HRESULT IiTunes::GetITObjectPersistentIDs [in] VARIANT *  iObject,
[out] long *  highID,
[out] long *  lowID
 

Returns the high and low 32 bits of the persistent ID of the specified IITObject. See the documentation on IITObject for more information on persistent IDs.

This method is not usable from scripting clients, since it returns multiple output parameters. Scripting clients must use IiTunes::ITObjectPersistentIDHigh() and IiTunes::ITObjectPersistentIDLow() properties instead.

The object may be a source, playlist, or track.

Note:
This property is available in iTunes 7.7 and later (iTunes type library 1.11 and later).
Parameters:
iObject A VARIANT of type VT_DISPATCH that points to an IITObject.
highID The high 32 bits of the 64-bit persistent ID.
lowID The low 32 bits of the 64-bit persistent ID.
Return values:
S_OK The operation was successful.
E_POINTER iObject, highID, or lowID is NULL.
E_INVALIDARG iObject is not the correct VARIANT type.
E_FAIL An unexpected error occurred.

HRESULT IiTunes::GetPlayerButtonsState [out] VARIANT_BOOL *  previousEnabled,
[out] ITPlayButtonState playPauseStopState,
[out] VARIANT_BOOL *  nextEnabled
 

Retrieves the current state of the player buttons in the window containing the currently targeted track. If there is no currently targeted track, returns the current state of the player buttons in the main browser window.

This method is not usable from scripting clients, since it returns multiple output parameters.

Note:
This method is available in iTunes 4.7 and later (iTunes type library 1.2 and later).
Parameters:
previousEnabled Returns whether the previous button is enabled.
playPauseStopState Returns whether the play/pause/stop button is enabled, and whether it is currently showing play, pause, or stop.
nextEnabled Returns whether the next button is enabled.
Return values:
S_OK The operation was successful.
E_POINTER previousEnabled, playPauseStopState, or nextEnabled is NULL.
E_FAIL An unexpected error occurred.

HRESULT IiTunes::GotoMusicStoreHomePage  ) 
 

Go to the iTunes Store home page.

If the iTunes Store is already open in a separate window, the home page will be displayed there. Otherwise, it will be displayed in the main browser window. The window containing the store will be brought to the foreground.

Return values:
S_OK The operation was successful.
ITUNES_E_MUSICSTOREDISABLED Access to the iTunes Store is disabled in the preferences.
E_FAIL An unexpected error occurred.

HRESULT IiTunes::ITObjectPersistentIDHigh [in] VARIANT *  iObject,
[out, retval] long *  highID
 

Returns the high 32 bits of the persistent ID of the specified IITObject. See the documentation on IITObject for more information on persistent IDs.

This property and IiTunes::ITObjectPersistentIDLow() are meant to be used from scripting clients, since they can't handle multiple output parameters. If you don't need an automation-compatible interface, use the IiTunes::GetITObjectPersistentIDs() method instead.

The object may be a source, playlist, or track.

Note:
This property is available in iTunes 7.7 and later (iTunes type library 1.11 and later).
Parameters:
iObject A VARIANT of type VT_DISPATCH that points to an IITObject.
highID The high 32 bits of the 64-bit persistent ID.
Return values:
S_OK The operation was successful.
E_POINTER iObject or highID is NULL.
E_INVALIDARG iObject is not the correct VARIANT type.
E_FAIL An unexpected error occurred.

HRESULT IiTunes::ITObjectPersistentIDLow [in] VARIANT *  iObject,
[out, retval] long *  lowID
 

Returns the low 32 bits of the persistent ID of the specified IITObject. See the documentation on IITObject for more information on persistent IDs.

This property and IiTunes::ITObjectPersistentIDHigh() are meant to be used from scripting clients, since they can't handle multiple output parameters. If you don't need an automation-compatible interface, use the IiTunes::GetITObjectPersistentIDs() method instead.

The object may be a source, playlist, or track.

Note:
This property is available in iTunes 7.7 and later (iTunes type library 1.11 and later).
Parameters:
iObject A VARIANT of type VT_DISPATCH that points to an IITObject.
lowID The low 32 bits of the 64-bit persistent ID.
Return values:
S_OK The operation was successful.
E_POINTER iObject or highID is NULL.
E_INVALIDARG iObject is not the correct VARIANT type.
E_FAIL An unexpected error occurred.

HRESULT IiTunes::LibraryPlaylist [out, retval] IITLibraryPlaylist **  iLibraryPlaylist  ) 
 

Returns the main library playlist in the main library source.

Parameters:
iLibraryPlaylist An IITLibraryPlaylist object corresponding to the main library playlist.
Return values:
S_OK The operation was successful.
E_POINTER iLibraryPlaylist is NULL.
E_FAIL An unexpected error occurred.

HRESULT IiTunes::LibrarySource [out, retval] IITSource **  iLibrarySource  ) 
 

Returns the source that represents the main library.

You can also find the main library source by iterating over IiTunes::Sources() and looking for an IITSource of kind ITSourceKindLibrary.

Parameters:
iLibrarySource An IITSource object corresponding to the main library.
Return values:
S_OK The operation was successful.
E_POINTER iLibrarySource is NULL.
E_FAIL An unexpected error occurred.

HRESULT IiTunes::LibraryXMLPath [out, retval] BSTR *  filePath  ) 
 

Returns the full path to the current iTunes library XML file. The default file is "iTunes Music Library.xml" inside the "iTunes" folder in the user's "My Music" folder.

Note:
This property is available in iTunes 7.0 and later (iTunes type library 1.8 and later).
Parameters:
filePath The full path to the current iTunes library XML file.
Return values:
S_OK The operation was successful.
E_POINTER filePath is NULL.
E_FAIL An unexpected error occurred.

HRESULT IiTunes::Mute [in] VARIANT_BOOL  shouldMute  ) 
 

Sets sound output mute state.

Parameters:
shouldMute If true, sound output will be muted.
Return values:
S_OK The operation was successful.
E_FAIL An unexpected error occurred.

HRESULT IiTunes::Mute [out, retval] VARIANT_BOOL *  isMuted  ) 
 

Returns true if the sound output is muted.

Parameters:
isMuted True is sound output is muted.
Return values:
S_OK The operation was successful.
E_POINTER isMuted is NULL.
E_FAIL An unexpected error occurred.

HRESULT IiTunes::NextTrack  ) 
 

Advance to the next track in the current playlist.

Note:
As of iTunes 4.7 and later (iTunes type library 1.2 and later), iTunes will suppress the authorization dialog if this method attempts to start playing a purchased track that has not been authorized for playback on the current machine. The unauthorized track is skipped in this case.
Return values:
S_OK The operation was successful.
E_FAIL An unexpected error occurred.

HRESULT IiTunes::OpenURL [in] BSTR  url  ) 
 

Open the specified iTunes Store or streaming audio URL.

If the specified URL is an iTunes Store URL, the window containing the store will be brought to the foreground. If the iTunes Store is already open in a separate window, the home page will be displayed there. Otherwise, it will be displayed in the main browser window.

Parameters:
url The URL to open. The length of the URL cannot exceed 512 characters. iTunes Store URLs start with itms:// or itmss://. Streaming audio URLs start with http://.
Return values:
S_OK The operation was successful.
E_POINTER url is NULL.
E_INVALIDARG url has an invalid length.
E_FAIL An unexpected error occurred.

HRESULT IiTunes::Pause  ) 
 

Pause playback.

Return values:
S_OK The operation was successful.
E_FAIL An unexpected error occurred.

HRESULT IiTunes::Play  ) 
 

Play the currently targeted track.

Return values:
S_OK The operation was successful.
E_FAIL An unexpected error occurred.

HRESULT IiTunes::PlayerButtonClicked [in] ITPlayerButton  playerButton,
[in] long  playerButtonModifierKeys
 

Simulate a click on a player control button in the window containing the currently targeted track. If there is no currently targeted track, simulates a click on a player control button in the main browser window.

You can specify modifier keys to get the special behaviors built into iTunes (e.g. shift-control-next button to go to the next chapter in an audio book).

Note:
This method is available in iTunes 4.7 and later (iTunes type library 1.2 and later).
Parameters:
playerButton The player button to click
playerButtonModifierKeys A combination of one or more flags in ITPlayerButtonModifierKey. Specify ITPlayerButtonModifierKeyNone for no modifiers.
Return values:
S_OK The operation was successful.
E_INVALIDARG playerButton is invalid.
E_FAIL An unexpected error occurred.

HRESULT IiTunes::PlayerPosition [in] long  playerPos  ) 
 

Sets the player's position within the currently playing track in seconds.

If playerPos specifies a position before the beginning of the track, the position will be set to the beginning. If playerPos specifies a position after the end of the track, the position will be set to the end.

Parameters:
playerPos The player's position within the currently playing track in seconds.
Return values:
S_OK The operation was successful.
E_FAIL An unexpected error occurred, e.g. no track is being played.

HRESULT IiTunes::PlayerPosition [out, retval] long *  playerPos  ) 
 

Returns the player's position within the currently playing track in seconds.

Parameters:
playerPos The player's position within the currently playing track in seconds.
Return values:
S_OK The operation was successful.
E_POINTER playerPos is NULL.
E_FAIL An unexpected error occurred, e.g. no track is being played.

HRESULT IiTunes::PlayerState [out, retval] ITPlayerState playerState  ) 
 

Returns the current player state.

Parameters:
playerState The current player state.
Return values:
S_OK The operation was successful.
E_POINTER playerState is NULL.
E_FAIL An unexpected error occurred.

HRESULT IiTunes::PlayFile [in] BSTR  filePath  ) 
 

Play the specified file path, adding it to the library if not already present.

Parameters:
filePath Full path to the file to be played.
Return values:
S_OK The operation was successful.
E_POINTER filePath is NULL.
E_INVALIDARG filePath is invalid.
E_FAIL An unexpected error occurred.

HRESULT IiTunes::PlayPause  ) 
 

Toggle the playing/paused state of the current track.

Return values:
S_OK The operation was successful.
E_FAIL An unexpected error occurred.

HRESULT IiTunes::PreviousTrack  ) 
 

Return to the previous track in the current playlist.

Note:
As of iTunes 4.7 and later (iTunes type library 1.2 and later), iTunes will suppress the authorization dialog if this method attempts to start playing a purchased track that has not been authorized for playback on the current machine. The unauthorized track is skipped in this case.
Return values:
S_OK The operation was successful.
E_FAIL An unexpected error occurred.

HRESULT IiTunes::Quit  ) 
 

Exits the iTunes application.

Return values:
S_OK The operation was successful.
ITUNES_E_USERCANCEL The operation was canceled by the user.
E_FAIL An unexpected error occurred.

HRESULT IiTunes::Resume  ) 
 

Disable fast forward/rewind and resume playback, if playing.

Return values:
S_OK The operation was successful.
E_FAIL An unexpected error occurred.

HRESULT IiTunes::Rewind  ) 
 

Skip backwards in a playing track.

Return values:
S_OK The operation was successful.
E_FAIL An unexpected error occurred.

HRESULT IiTunes::SelectedTracks [out, retval] IITTrackCollection **  iTrackCollection  ) 
 

Returns a collection containing the currently selected track or tracks.

The frontmost visible window in iTunes must be a browser or playlist window. If there is no frontmost visible window (e.g. iTunes is minimized to the system tray), the main browser window is used.

Parameters:
iTrackCollection Collection of IITTrack objects. Will be set to NULL if there is no current selection.
Return values:
S_OK The operation was successful.
S_FALSE There is no current selection.
E_POINTER iTrackCollection is NULL.
E_FAIL An unexpected error occurred.

HRESULT IiTunes::SoundVolume [in] long  volume  ) 
 

Sets the sound output volume (0 = minimum, 100 = maximum).

Note that volume will be pinned to the range 0 through 100.

Parameters:
volume New sound output volume
Return values:
S_OK The operation was successful.
E_FAIL An unexpected error occurred.

HRESULT IiTunes::SoundVolume [out, retval] long *  volume  ) 
 

Returns the sound output volume (0 = minimum, 100 = maximum).

Parameters:
volume Current sound output volume
Return values:
S_OK The operation was successful.
E_POINTER volume is NULL.
E_FAIL An unexpected error occurred.

HRESULT IiTunes::SoundVolumeControlEnabled [out, retval] VARIANT_BOOL *  isEnabled  ) 
 

Returns true if the sound volume control is enabled.

Note:
This property is available in iTunes 6.0.2 and later (iTunes type library 1.7 and later).
Parameters:
isEnabled True if the sound volume control is enabled.
Return values:
S_OK The operation was successful.
E_POINTER isEnabled is NULL.
E_FAIL An unexpected error occurred.

HRESULT IiTunes::Sources [out, retval] IITSourceCollection **  iSourceCollection  ) 
 

Returns a collection of music sources (music library, CD, device, etc.).

Parameters:
iSourceCollection Collection of IITSource objects.
Return values:
S_OK The operation was successful.
E_POINTER iSourceCollection is NULL.
E_FAIL An unexpected error occurred.

HRESULT IiTunes::Stop  ) 
 

Stop playback.

Return values:
S_OK The operation was successful.
E_FAIL An unexpected error occurred.

HRESULT IiTunes::SubscribeToPodcast [in] BSTR  url  ) 
 

Subscribes to the specified podcast feed URL. Any "unsafe" characters in the URL should already be converted into their corresponding escape sequences, iTunes will not do this.

Note:
This method is available in iTunes 4.9 and later (iTunes type library 1.4 and later).
Parameters:
url The URL to subscribe to.
Return values:
S_OK The operation was successful.
E_POINTER url is NULL.
E_INVALIDARG url has an invalid length.
ITUNES_E_PODCASTSDISABLED Access to podcasts is disabled in the preferences.
E_FAIL An unexpected error occurred.

HRESULT IiTunes::UpdateIPod  ) 
 

Update the contents of the iPod.

Return values:
S_OK The operation was successful.
S_FALSE No iPod source was found.
E_FAIL An unexpected error occurred.

HRESULT IiTunes::UpdatePodcastFeeds  ) 
 

Updates all podcast feeds. This is equivalent to the user pressing the Update button when Podcasts is selected in the Source list.

Note:
This method is available in iTunes 5.0 and later (iTunes type library 1.5 and later).
Return values:
S_OK The operation was successful.
ITUNES_E_PODCASTSDISABLED Access to podcasts is disabled in the preferences.
E_FAIL An unexpected error occurred.

HRESULT IiTunes::Version [out, retval] BSTR *  version  ) 
 

Returns the version of the iTunes application.

Parameters:
version Returns the version of the iTunes application
Return values:
S_OK The operation was successful.
E_POINTER version is NULL.
E_FAIL An unexpected error occurred.

HRESULT IiTunes::Visuals [out, retval] IITVisualCollection **  iVisualCollection  ) 
 

Returns a collection of visual plug-ins.

Parameters:
iVisualCollection Collection of IITVisual objects.
Return values:
S_OK The operation was successful.
E_POINTER iVisualCollection is NULL.
E_FAIL An unexpected error occurred.

HRESULT IiTunes::VisualsEnabled [in] VARIANT_BOOL  shouldEnable  ) 
 

Set whether visuals should be displayed.

Parameters:
shouldEnable True if visuals should be displayed.
Return values:
S_OK The operation was successful.
E_ACCESSDENIED Visuals cannot be enabled or disabled. For example, this can happen if the iTunes Store is currently being viewed.
E_FAIL An unexpected error occurred.

HRESULT IiTunes::VisualsEnabled [out, retval] VARIANT_BOOL *  isEnabled  ) 
 

Returns true if visuals are currently being displayed.

Parameters:
isEnabled True if visuals are currently being displayed.
Return values:
S_OK The operation was successful.
E_POINTER isEnabled is NULL.
E_FAIL An unexpected error occurred.

HRESULT IiTunes::VisualSize [in] ITVisualSize  visualSize  ) 
 

Sets the size of the displayed visual.

Parameters:
visualSize The new size of the visuals.
Return values:
S_OK The operation was successful.
E_FAIL An unexpected error occurred.

HRESULT IiTunes::VisualSize [out, retval] ITVisualSize visualSize  ) 
 

Returns the size of the displayed visual.

Parameters:
visualSize The current size of the visuals.
Return values:
S_OK The operation was successful.
E_POINTER visualSize is NULL.
E_FAIL An unexpected error occurred.

HRESULT IiTunes::Windows [out, retval] IITWindowCollection **  iWindowCollection  ) 
 

Returns a collection of visual plug-ins.

Parameters:
iWindowCollection Collection of IITWindow objects.
Return values:
S_OK The operation was successful.
E_POINTER iWindowCollection is NULL.
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.