IWMPSyncDevice::getItemInfo method

The getItemInfo method retrieves a metadata value from the device.

Syntax


HRESULT getItemInfo(
  [in]  BSTR bstrItemName,
  [out] BSTR *pbstrVal
);

Parameters

bstrItemName [in]

BSTR containing the metadata item name. The following table lists the supported item names and describes the value that each retrieves.

Name Retrieves
AutoSyncDefaultRules

Whether automatic synchronization is done according to default rules or custom rules. A value of "True" indicates default rules, and a value of "False" indicates custom rules.

Use of this attribute is permitted only for devices that have a partnership with Windows Media Player.

Requires Windows Media Player 12.

BackgroundSyncState

Whether Windows Media Player is allowed to perform background operations for the device.

The value can be a string (BSTR) representation of a bitwise combination of one or more of the following flags.

  • 1 Background synchronization is allowed.
  • 2 Background transcoding is allowed.

The value can also be one of the following strings.

  • "0" No background operations are allowed.
  • "255" All background operations are allowed.

The value of this attribute lasts for the lifetime of Windows Media Player, but is not stored in the Windows Media Player library.

Use of this attribute is permitted only for devices that have a partnership with Windows Media Player.

Requires Windows Media Player 12.

ConnectedWhether the device is currently connected to Windows Media Player. Possible values are "True" and "False".
FreeSpaceThe size, in bytes, of the available device memory.
FriendlyNameThe friendly name for the device.
LastSyncErrorCountThe number of synchronization errors that occurred during the most recent synchronization.
LastSyncNoFitCountThe number of media items that would not fit on the device during the most recent synchronization.
LastSyncTimeThe time of the most recent synchronization.
NameThe name of the device.
PercentSpaceReservedLimits the amount of device storage that Windows Media Player uses for file synchronization by specifying a portion of the storage as reserved. The value is the numeric percentage of total storage on the device represented by a string (BSTR). Supported values range from "0" to "95" inclusive.

Use of this attribute is permitted only for devices that have a partnership with Windows Media Player.

Requires Windows Media Player 11.

PreferredAudio

A string (BSTR) representation of the numeric identifier of the preferred storage for audio files on the device. If the device supports hints, the preferred storage is the location specified by the hint. If the device does not support hints, the preferred storage is the largest storage.

Requires Windows Media Player 12.

PreferredVideo

A string (BSTR) representation of the numeric identifier of the preferred storage for video files on the device. If the device supports hints, the preferred storage is the location specified by the hint. If the device does not support hints, the preferred storage is the largest storage.

Requires Windows Media Player 12.

PreferredPhoto

A string (BSTR) representation of the numeric identifier of the preferred storage for picture files on the device. If the device supports hints, the preferred storage is the location specified by the hint. If the device does not support hints, the preferred storage is the largest storage.

Requires Windows Media Player 12.

SerialNumberThe device serial number.
SkippedFiles

Whether the device has any skipped files. A value of "1" indicates that the device has skipped files. A value of "0" indicates that the device does not have any skipped files.

Use of this attribute is permitted only for devices with which Windows Media Player has a partnership.

Requires Windows Media Player 12.

SupportsAudioWhether the device supports audio playback. Possible values are "True" and "False".
SupportsPhotoWhether the device supports displaying photos. Possible values are "True" and "False".
SupportsVideoWhether the device supports video playback. Possible values are "True" and "False".
SyncFilter

The types of files that will be synchronized during the next synchronization session, and an indication of whether content can be acquired from the device during that synchronization session.

The value can be a string (BSTR) representation of a bitwise combination of one or more of the following flags.

  • "1" Music files will be synchronized.
  • "2" Video files will be synchronized.
  • "4" Picture files will be synchronized.
  • "8" Content can be written to the device, but can not be acquired from the device.

For example, the string value "5" indicates that music and picture files will be synchronized.

The value can also be one of the following strings.

  • "0xFF" No filter will be applied to the synchronization session. That is, files of all types will be synchronized, and content can be both written to the device and acquired from the device.
  • "0x07" Files of all types will be synchronized.

This attribute affects only the next synchronization session.

Use of this attribute is permitted only for devices that have a partnership with Windows Media Player.

Requires Windows Media Player 12.

SyncIndexThe partnership index for the device. Possible values are the integers 0 through 16.
SyncItemCountThe count of items synchronized to the device.
SyncOnConnect

Whether Windows Media Player will synchronize the device when the device gets connected. A value of "True" indicates that Windows Media Player will synchronize the device, and a value of "False" indicates that Windows Media Player will not synchronize the device.

Use of this attribute is permitted only for devices that have a partnership with Windows Media Player.

Requires Windows Media Player 12.

SyncPercentCompleteThe progress of synchronization as a percentage.
SyncRelationshipA number indicating how the device synchronizes with respect to the current instance of Windows Media Player. Possible values are:

0, meaning no relationship.

1, meaning manual synchronization.

2, meaning a partnership exists with the current instance of Windows Media Player.

3, meaning a partnership exists with another instance of Windows Media Player.

TotalSpaceThe size, in bytes, of the total memory for the device.

 

pbstrVal [out]

Pointer to a BSTR that contains the specified metadata item name.

Return value

The method returns an HRESULT. Possible values include, but are not limited to, those in the following table.

Return codeDescription
S_OK

The method succeeded.

NS_E_PDA_INITIALIZINGDEVICES (0xC00D118D)

Windows Media Player is currently busy initializing devices. Please try again later.

 

Remarks

This method cannot retrieve metadata values for devices having the status wmpdsManualDevice.

Windows Media Player 10 Mobile: This method is not supported.

Requirements

Version

Windows Media Player 10 or later

Header

Wmp.h

DLL

Wmp.dll

See also

IWMPSyncDevice Interface
Retrieving Device Attributes

 

 

Show: