MMPXPlaybackUtility Class Reference

class MMPXPlaybackUtility

Main client interface for playback. Some terms used in the documentation of this interface:

Engine - it is the 'engine' which manages the playback and maintains the state. An abstract concept for where the playback functionality is somehow implemented, but is completely hidden from the client.

Player - the engine may access of a number of 'players' for playback, using only one at a time. A player is an abstract concept representing the knowledge to play either a 'specific kind of item', or 'play in a specific way', or both. The player may therefore automatically change between items if required ('specific kind of item'), or the client may choose the players that are used ('play in a specific way').

Sub player - a player may support 0 or more 'sub' players, a logical concept whereby the client,having chosen a player, can select options within this player identified by name (text)

Playlist - an abstract list of items. A collection path allows the client to cross reference the playlist with a collection, for example to iterate through the playlist, extract user-supplied metadata etc.

mpxplaybackutility.lib

Public Member Functions
void AddObserverL (MMPXPlaybackObserver &)
void AddSubscriptionL (const CMPXSubscription &)
void CancelRequest ()
void ClearSubscriptionsL ()
void Close ()
void CommandL ( TMPXPlaybackCommand , TInt )
void CommandL ( CMPXCommand &, MMPXPlaybackCallback *)
void GetClientsL ( RArray < TProcessId > &)
void Init64L (RFile64 &)
void InitL (const CMPXCollectionPlaylist &, TBool )
void InitL (const TDesC &, const TDesC8 *)
void InitL ( RFile &)
void InitStreaming64L (RFile64 &, const )
void InitStreamingL (const TDesC &, const TDesC8 *, const TInt )
void InitStreamingL ( RFile &, const TInt )
IMPORT_C MMPXPlaybackUtility * NewL (const TUid &, MMPXPlaybackObserver *)
IMPORT_C MMPXPlaybackUtility * NewL (const TMPXCategory , const TUid &, MMPXPlaybackObserver *)
MMPXPlayerManager & PlayerManager ()
void PropertyL (MMPXPlaybackCallback &, TMPXPlaybackProperty )
void RemoveObserverL (MMPXPlaybackObserver &)
void RemoveSubscriptionL (const CMPXSubscription &)
void SetL ( TMPXPlaybackProperty , TInt )
TInt SetPrimaryClientL ()
void SetPriority ( TInt )
MMPXSource * Source ()
TMPXPlaybackState StateL ()
CDesCArray * SupportedExtensions ()
CDesCArray * SupportedMimeTypes ()
CDesCArray * SupportedSchemas ()
IMPORT_C MMPXPlaybackUtility * UtilityL (const TUid &)
IMPORT_C MMPXPlaybackUtility * UtilityL (const TMPXCategory , const TUid &)
void ValueL (MMPXPlaybackCallback &, TMPXPlaybackProperty )

Member Functions Documentation

AddObserverL(MMPXPlaybackObserver &)

void AddObserverL ( MMPXPlaybackObserver & aObs ) [pure virtual]

Add a Observer. Clients only receive events from the engine corresponding to the specific mode the interface was created in.

Since
S60 3.2.3

Parameters

MMPXPlaybackObserver & aObs observer to be added

AddSubscriptionL(const CMPXSubscription &)

void AddSubscriptionL ( const CMPXSubscription & aSubscription ) [pure virtual]

Adds a message subscription for this client.

Since
S60 3.2.3

Parameters

const CMPXSubscription & aSubscription subscription to be added

CancelRequest()

void CancelRequest ( ) [pure virtual]

Stops any async operations that are currently under way.

Since
S60 3.2.3

ClearSubscriptionsL()

void ClearSubscriptionsL ( ) [pure virtual]

Removes all message subscriptions for this client.

Since
S60 3.2.3

Close()

void Close ( ) [pure virtual]

Frees up client side resources only; a player is freed when there are no clients using it, and all resources are freed when the last client closed.

Since
S60 3.2.3

CommandL(TMPXPlaybackCommand, TInt)

void CommandL ( TMPXPlaybackCommand aCmd,
TInt aData = 0
) [pure virtual]

Issue player commands, with optional data. ECommandReceived and ECommandComplete events should follow.

Since
S60 3.2.3
Use method MMPXPlaybackUtility::CommandL (CMPXCommand& aCmd, MMPXPlaybackCallback* aCallback=NULL) instead.

Parameters

TMPXPlaybackCommand aCmd the command
TInt aData = 0 optional data

CommandL(CMPXCommand &, MMPXPlaybackCallback *)

void CommandL ( CMPXCommand & aCmd,
MMPXPlaybackCallback * aCallback = NULL
) [pure virtual]

Send a command to the playback server.

Since
S60 3.2.3

Parameters

CMPXCommand & aCmd reference to command object
MMPXPlaybackCallback * aCallback = NULL call back when command exection completed. Asynchronously command only

GetClientsL(RArray< TProcessId > &)

void GetClientsL ( RArray < TProcessId > & aClients ) [pure virtual]

Returns PIds of clients that are using the engine in the mode this interface was created in. For example, if a client was interested in all the clients' pids with an active engine, they would:

MMPXPlaybackUtility* m=MMPXPlaybackUtilityNewL(EActivePlayer); RArray<TProcessId> pids; m->GetClients(pids); ......... pids-> Close() ; m-> Close() ; From the Array of clients returned, the first one will be the last active one.

Since
S60 3.2.3

Parameters

RArray < TProcessId > & aClients Array of Pids returned.

Init64L(RFile64 &)

void Init64L ( RFile64 & ) [inline, virtual]

Inititialises with a single item, may not be part of any collection Before this function can be called, the file server session which owns this file handle must first be marked as shareable by calling RFs::ShareProtected() .

Since
S60 9.2

Parameters

RFile64 &

InitL(const CMPXCollectionPlaylist &, TBool)

void InitL ( const CMPXCollectionPlaylist & aPlaylist,
TBool aPlay = ETrue
) [pure virtual]

Initializes a track given by aCollectionPath.

Since
S60 3.2.3

Parameters

const CMPXCollectionPlaylist & aPlaylist
TBool aPlay = ETrue Whether to initialize for playback, or else just to setup the engine first

InitL(const TDesC &, const TDesC8 *)

void InitL ( const TDesC & aUri,
const TDesC8 * aType = NULL
) [pure virtual]

Inititialises with a single item, may not be part of any collection.

Since
S60 3.2.3

Parameters

const TDesC & aUri URI of the item
const TDesC8 * aType = NULL the mime type of the item

InitL(RFile &)

void InitL ( RFile & aShareableFile ) [pure virtual]

Inititialises with a single item, may not be part of any collection Before this function can be called, the file server session which owns this file handle must first be marked as shareable by calling RFs::ShareProtected() .

Since
S60 3.2.3

Parameters

RFile & aShareableFile shareable file handle

InitStreaming64L(RFile64 &, const)

void InitStreaming64L ( RFile64 & ,
const TInt
) [inline, virtual]

Inititialises for streaming with URI and Access Point, the file may not be part of any collection Before this function can be called, the file server session which owns this file handle must first be marked as shareable by calling RFs::ShareProtected() .

Since
S60 9.2

Parameters

RFile64 &
const TInt

InitStreamingL(const TDesC &, const TDesC8 *, const TInt)

void InitStreamingL ( const TDesC & aUri,
const TDesC8 * aType,
const TInt aAccessPoint
) [pure virtual]

Inititialises for streaming with URI and Access Point

Since
S60 9.2

Parameters

const TDesC & aUri URI of the item
const TDesC8 * aType the mime type of the item
const TInt aAccessPoint the access point of the item

InitStreamingL(RFile &, const TInt)

void InitStreamingL ( RFile & aShareableFile,
const TInt aAccessPoint
) [pure virtual]

Inititialises for streaming with URI and Access Point, the file may not be part of any collection Before this function can be called, the file server session which owns this file handle must first be marked as shareable by calling RFs::ShareProtected() .

Since
S60 9.2

Parameters

RFile & aShareableFile shareable file handle
const TInt aAccessPoint the access point of the item

NewL(const TUid &, MMPXPlaybackObserver *)

IMPORT_C MMPXPlaybackUtility * NewL ( const TUid & aModeId =  KPbModeDefault ,
MMPXPlaybackObserver * aObs = NULL
) [static]

Creates the interface for the client. This interface is bound to (i.e. controls and recieves events from) either an existing engine or a new one, according to:

aModeId=KPbModeDefault - bound to the same engine as any other player running in same thread, or KPbModeNewPlayer if none. aModeId=KPbModeActivePlayer - bound to whichever engine has audio access, else whichever is running, provided the category of client and engine match. Else KPbModeNewPlayer if none. aModeId=KPbModeNewPlayer - new engine created specifically for client, may be shared later. aModeId=Application UID - bound to the same engine as the stand alone Application. When no category is supplied (as with this API), EMPXCategoryMusic is assumed. For category description, refer to next API.

Since
S60 3.2.3

Parameters

const TUid & aModeId =  KPbModeDefault playback mode
MMPXPlaybackObserver * aObs = NULL plabyback observer

NewL(const TMPXCategory, const TUid &, MMPXPlaybackObserver *)

IMPORT_C MMPXPlaybackUtility * NewL ( const TMPXCategory aCategory,
const TUid & aModeId =  KPbModeDefault ,
MMPXPlaybackObserver * aObs = NULL
) [static]

Creates the interface for the client. This interface is bound to (i.e. controls and recieves events from) either an existing engine or a new one, according to:

aModeId=KPbModeDefault - bound to the same engine as any other player running in same thread, or KPbModeNewPlayer if none. aModeId=KPbModeActivePlayer - bound to whichever engine has audio access, else whichever is running, provided the category of client and engine match. Else KPbModeNewPlayer if none. aModeId=KPbModeNewPlayer - new engine created specifically for client, may be shared later. aModeId=Application UID - bound to the same engine as the stand alone Application.

aCategory - a client can associate itself with a category (TMPXCategory). Category is used primarily with the KPbModeActivePlayer mode. The client gets EActivePlayerChanged message only when an engine with the same category becomes active. If a new engine (player) is created, the engine is tagged with the category. When no category is supplied, EMPXCategoryMusic is assumed.

Since
S60 3.2.3

Parameters

const TMPXCategory aCategory engine category (TMPXCategory)
const TUid & aModeId =  KPbModeDefault playback mode
MMPXPlaybackObserver * aObs = NULL plabyback observer

PlayerManager()

MMPXPlayerManager & PlayerManager ( ) [pure virtual]

Player manager.

Since
S60 3.2.3

PropertyL(MMPXPlaybackCallback &, TMPXPlaybackProperty)

void PropertyL ( MMPXPlaybackCallback & aCallback,
TMPXPlaybackProperty aProperty
) [pure virtual]

Get value of a playback property, Asyc. Result will be called back in HandleProperty.

Since
S60 3.2.3

Parameters

MMPXPlaybackCallback & aCallback playback callback
TMPXPlaybackProperty aProperty the property

RemoveObserverL(MMPXPlaybackObserver &)

void RemoveObserverL ( MMPXPlaybackObserver & aObs ) [pure virtual]

Remove a observer.

Since
S60 3.2.3

Parameters

MMPXPlaybackObserver & aObs observer to be removed

RemoveSubscriptionL(const CMPXSubscription &)

void RemoveSubscriptionL ( const CMPXSubscription & aSubscription ) [pure virtual]

Removes a message subscription for this client.

Since
S60 3.2.3

Parameters

const CMPXSubscription & aSubscription subscription to be removed.

SetL(TMPXPlaybackProperty, TInt)

void SetL ( TMPXPlaybackProperty aProperty,
TInt aValue
) [pure virtual]

Set playback property, EPropertyChanged event when complete.

Since
S60 3.2.3

Parameters

TMPXPlaybackProperty aProperty the property to be set
TInt aValue the the value of the property

SetPrimaryClientL()

TInt SetPrimaryClientL ( ) [inline, virtual]

Sets the primary client

Since
S60 9.2

SetPriority(TInt)

void SetPriority ( TInt aPriority ) [pure virtual]

Sets the priority of the playback utility.

Since
S60 3.2.3

Parameters

TInt aPriority Priority to set

Source()

MMPXSource * Source ( ) [pure virtual]

Current source of playlist being played, NULL if none was supplied.

Since
S60 3.2.3

StateL()

TMPXPlaybackState StateL ( ) const [pure virtual]

Current state of player.

Since
S60 3.2.3

SupportedExtensions()

CDesCArray * SupportedExtensions ( ) [pure virtual]

Return a list of file extensions supported by playback framework.

Since
S60 3.2.3

SupportedMimeTypes()

CDesCArray * SupportedMimeTypes ( ) [pure virtual]

Return a list of mime types supported by playback framework.

Since
S60 3.2.3

SupportedSchemas()

CDesCArray * SupportedSchemas ( ) [pure virtual]

Return a list of schemas supported by playback framework.

Since
S60 3.2.3

UtilityL(const TUid &)

IMPORT_C MMPXPlaybackUtility * UtilityL ( const TUid & aModeId =  KPbModeDefault ) [static]

Parameters

const TUid & aModeId =  KPbModeDefault

UtilityL(const TMPXCategory, const TUid &)

IMPORT_C MMPXPlaybackUtility * UtilityL ( const TMPXCategory aCategory,
const TUid & aModeId =  KPbModeDefault
) [static]

Parameters

const TMPXCategory aCategory
const TUid & aModeId =  KPbModeDefault

ValueL(MMPXPlaybackCallback &, TMPXPlaybackProperty)

void ValueL ( MMPXPlaybackCallback & aCallback,
TMPXPlaybackProperty aProperty
) [pure virtual]

Get value of a playback property, Asyc.

Since
S60 3.2.3
Use method MMPXPlaybackUtility::PropertyL ( MMPXPlaybackCallback& aCallback, TMPXPlaybackProperty aProperty) instead.

Parameters

MMPXPlaybackCallback & aCallback playback callback
TMPXPlaybackProperty aProperty the property