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
voidAddObserverL(MMPXPlaybackObserver &)
voidAddSubscriptionL(const CMPXSubscription &)
voidCancelRequest()
voidClearSubscriptionsL()
voidClose()
voidCommandL(TMPXPlaybackCommand, TInt)
voidCommandL(CMPXCommand &, MMPXPlaybackCallback *)
voidGetClientsL(RArray< TProcessId > &)
voidInit64L(RFile64 &)
voidInitL(const CMPXCollectionPlaylist &, TBool)
voidInitL(const TDesC &, const TDesC8 *)
voidInitL(RFile &)
voidInitStreaming64L(RFile64 &, const )
voidInitStreamingL(const TDesC &, const TDesC8 *, const TInt)
voidInitStreamingL(RFile &, const TInt)
IMPORT_C MMPXPlaybackUtility *NewL(const TUid &, MMPXPlaybackObserver *)
IMPORT_C MMPXPlaybackUtility *NewL(const TMPXCategory, const TUid &, MMPXPlaybackObserver *)
MMPXPlayerManager &PlayerManager()
voidPropertyL(MMPXPlaybackCallback &, TMPXPlaybackProperty)
voidRemoveObserverL(MMPXPlaybackObserver &)
voidRemoveSubscriptionL(const CMPXSubscription &)
voidSetL(TMPXPlaybackProperty, TInt)
TInt SetPrimaryClientL()
voidSetPriority(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 &)
voidValueL(MMPXPlaybackCallback &, TMPXPlaybackProperty)

Member Functions Documentation

AddObserverL(MMPXPlaybackObserver &)

voidAddObserverL(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 & aObsobserver to be added

AddSubscriptionL(const CMPXSubscription &)

voidAddSubscriptionL(const CMPXSubscription &aSubscription)[pure virtual]

Adds a message subscription for this client.

Since
S60 3.2.3

Parameters

const CMPXSubscription & aSubscriptionsubscription to be added

CancelRequest()

voidCancelRequest()[pure virtual]

Stops any async operations that are currently under way.

Since
S60 3.2.3

ClearSubscriptionsL()

voidClearSubscriptionsL()[pure virtual]

Removes all message subscriptions for this client.

Since
S60 3.2.3

Close()

voidClose()[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)

voidCommandL(TMPXPlaybackCommandaCmd,
TIntaData = 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 aCmdthe command
TInt aData = 0optional data

CommandL(CMPXCommand &, MMPXPlaybackCallback *)

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

Send a command to the playback server.

Since
S60 3.2.3

Parameters

CMPXCommand & aCmdreference to command object
MMPXPlaybackCallback * aCallback = NULLcall back when command exection completed. Asynchronously command only

GetClientsL(RArray< TProcessId > &)

voidGetClientsL(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 > & aClientsArray of Pids returned.

Init64L(RFile64 &)

voidInit64L(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)

voidInitL(const CMPXCollectionPlaylist &aPlaylist,
TBoolaPlay = ETrue
)[pure virtual]

Initializes a track given by aCollectionPath.

Since
S60 3.2.3

Parameters

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

InitL(const TDesC &, const TDesC8 *)

voidInitL(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 & aUriURI of the item
const TDesC8 * aType = NULLthe mime type of the item

InitL(RFile &)

voidInitL(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 & aShareableFileshareable file handle

InitStreaming64L(RFile64 &, const)

voidInitStreaming64L(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)

voidInitStreamingL(const TDesC &aUri,
const TDesC8 *aType,
const TIntaAccessPoint
)[pure virtual]

Inititialises for streaming with URI and Access Point

Since
S60 9.2

Parameters

const TDesC & aUriURI of the item
const TDesC8 * aTypethe mime type of the item
const TInt aAccessPointthe access point of the item

InitStreamingL(RFile &, const TInt)

voidInitStreamingL(RFile &aShareableFile,
const TIntaAccessPoint
)[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 & aShareableFileshareable file handle
const TInt aAccessPointthe 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 = NULLplabyback observer

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

IMPORT_C MMPXPlaybackUtility *NewL(const TMPXCategoryaCategory,
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 aCategoryengine category (TMPXCategory)
const TUid & aModeId =  KPbModeDefault playback mode
MMPXPlaybackObserver * aObs = NULLplabyback observer

PlayerManager()

MMPXPlayerManager &PlayerManager()[pure virtual]

Player manager.

Since
S60 3.2.3

PropertyL(MMPXPlaybackCallback &, TMPXPlaybackProperty)

voidPropertyL(MMPXPlaybackCallback &aCallback,
TMPXPlaybackPropertyaProperty
)[pure virtual]

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

Since
S60 3.2.3

Parameters

MMPXPlaybackCallback & aCallbackplayback callback
TMPXPlaybackProperty aPropertythe property

RemoveObserverL(MMPXPlaybackObserver &)

voidRemoveObserverL(MMPXPlaybackObserver &aObs)[pure virtual]

Remove a observer.

Since
S60 3.2.3

Parameters

MMPXPlaybackObserver & aObsobserver to be removed

RemoveSubscriptionL(const CMPXSubscription &)

voidRemoveSubscriptionL(const CMPXSubscription &aSubscription)[pure virtual]

Removes a message subscription for this client.

Since
S60 3.2.3

Parameters

const CMPXSubscription & aSubscriptionsubscription to be removed.

SetL(TMPXPlaybackProperty, TInt)

voidSetL(TMPXPlaybackPropertyaProperty,
TIntaValue
)[pure virtual]

Set playback property, EPropertyChanged event when complete.

Since
S60 3.2.3

Parameters

TMPXPlaybackProperty aPropertythe property to be set
TInt aValuethe the value of the property

SetPrimaryClientL()

TInt SetPrimaryClientL()[inline, virtual]

Sets the primary client

Since
S60 9.2

SetPriority(TInt)

voidSetPriority(TIntaPriority)[pure virtual]

Sets the priority of the playback utility.

Since
S60 3.2.3

Parameters

TInt aPriorityPriority 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 TMPXCategoryaCategory,
const TUid &aModeId =  KPbModeDefault
)[static]

Parameters

const TMPXCategory aCategory
const TUid & aModeId =  KPbModeDefault

ValueL(MMPXPlaybackCallback &, TMPXPlaybackProperty)

voidValueL(MMPXPlaybackCallback &aCallback,
TMPXPlaybackPropertyaProperty
)[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 & aCallbackplayback callback
TMPXPlaybackProperty aPropertythe property