MediaState Class

A Windows Media Center media state information aggregation. This class maintains the media state properties for all the active Windows Media Center sessions and provides notifications of changes.

System.Object
  MediaState

  public class MediaState : IDisposable

Public Instance Constructors

Constructor Description
MediaState Initializes an instance of the MediaState class.

Public Static Methods

Method Description
IdTagToSession Maps a session ID tag to its session.
LookupDataType Maps a property tag to its expected value data type.
LookupTag Maps a property tag name to its enumeration value.

Public Instance Properties

Property Description
Active Gets a value that indicates whether the Windows Media Center shell is running.
CD Gets the CD session.
DVD Gets the DVD session.
MediaCenter Gets the Windows Media Center (global) session.
Music Gets the Music (stored audio) session.
PhoneCall Gets the Phone Call (caller ID) session.
Pictures Gets the Pictures (photos) session.
Radio Gets the FM Radio session.
TV Gets the live TV session.
TVRecorded Gets the Recorded TV session.
TVRecording Gets the TV Recording (PVR) session.
Video Gets the stored video session.

Public Instance Methods

Method Description
Connect Connects and synchronizes the current state object to a media state aggregation service (MSAS) provider of state information.
Dispose Overloaded. Releases any resources being used.
GetProperty Gets variant state property value for a tag
GetPropertyBool Gets Boolean state property value for a tag.
GetPropertyInt Gets integer state property value for a tag
GetPropertyStr Gets string state property value for a tag
GetPropertyTag Gets tag state property value for a tag
GetSession Overloaded. Finds the SessionState object for this type.

Public Instance Events

Event Description
OnMSASEvent Raised with all MSAS events.

Protected Instance Methods

Method Description
Dispose Overloaded. Releases any resources being used.
Finalize Finalizes and destroys the current object.

Remarks

To use the MediaState object, the MSASState COM sink must be installed and properly registered.

On initialization of an instance of this class, a status consumer adds an EventHandler delegate to the desired session events. One must call the Connect method to start receiving state events from Windows Media Center through the MSASState COM sink.

When the status consumer application ends, it should call the Dispose method to gracefully end the connection.

Requirements

Namespace: Microsoft.MediaCenter.Samples.MediaState

Assembly: MediaState (in MediaState.dll)

Platform: Windows XP Media Center Edition 2004 and later

See Also