CUPnPMusicAdapter Class Reference

class CUPnPMusicAdapter : public CBase

A class providing play back services for playing within UPnP framework.

upnpmusicadapter.lib
Since
S60 v3.1

Inherits from

Public Member Functions
~CUPnPMusicAdapter ()
MUPnPAVController & AVController ()
MMPXCollectionUtility & CollectionUtility ()
void Complete ( MUPnPPlaylistFiller *)
IMPORT_C void Dismiss ( TInt )
IMPORT_C TInt ExecuteMusicInLocalL (CEikAppUi *, CUPnPPlayListFiller *)
IMPORT_C TInt ExecuteMusicInRemoteL (CEikAppUi *, CUPnPPlayListFiller *, const CUpnpAVDevice &)
IMPORT_C TInt ExecuteMusicLiteInLocalL (CEikAppUi *, MUPnPPlaylistFiller *)
IMPORT_C TInt ExecuteMusicLiteInRemoteL (CEikAppUi *, MUPnPPlaylistFiller *, const CUpnpAVDevice &)
IMPORT_C CUPnPMusicAdapter * NewL ( MUPnPAVController &)
TUid PlaylistCollectionId ()
Protected Member Functions
void HandleCollectionMediaL (const CMPXMedia &, TInt )
void HandleCollectionMessage ( CMPXMessage *, TInt )
void HandleCommandComplete ( CMPXCommand *, TInt )
void HandleMediaL (const CMPXMedia &, TInt )
void HandleOpenL (const CMPXMedia &, TInt , TBool , TInt )
void HandleOpenL (const CMPXCollectionPlaylist &, TInt )
void HandlePlaybackMessage ( CMPXMessage *, TInt )
void HandlePropertyL ( TMPXPlaybackProperty , TInt , TInt )
void HandleSubPlayerNamesL ( TUid , const MDesCArray *, TBool , TInt )
Private Member Functions
CUPnPMusicAdapter ( MUPnPAVController &)
void ConstructL ()
void CreatePlayListL ()
void DisplayUI ()
void DoHandleCollectionMessageL ( TInt , TInt , TInt )
void DoHandlePlaybackMessageL ( TInt , TInt , TInt )
void DoHandleSubPlayerNamesL ( TUid , const MDesCArray *, TBool , TInt )
void Exit ( TInt )
void InitState ()
void TakeOwnershipOfTheFiller ( MUPnPPlaylistFiller *)
void UiShowLoopL ()
Inherited Functions
CBase::CBase()
CBase::Delete(CBase *)
CBase::Extension_(TUint,TAny *&,TAny *)
CBase::operator new(TUint)
CBase::operator new(TUint,TAny *)
CBase::operator new(TUint,TLeave)
CBase::operator new(TUint,TLeave,TUint)
CBase::operator new(TUint,TUint)
CBase::~CBase()
Public Member Enumerations
enum TAdapterState {
EStateIdle  = 0, EStatePreparing , EStatePreparingWait , EStateInitialising , EStateRunning , EStateClosing
}
enum TFillerState { EFillerStateIdle  = 0, EFillerStateFilling , EFillerStateComplete }
Private Attributes
MUPnPAVController & iAVController
CEikAppUi * iAppUi
MMPXCollectionUtility * iCollectionUtility
MUPnPPlaylistFiller * iCurrentFiller
TFillerState iCurrentFillerState
CMPXMedia * iMedia
CUPnPMpxHelper * iMpxHelper
MMPXPlaybackUtility * iPlaybackUtility
CMPXCollectionPlaylist * iPlaylist
TUid iPlaylistCollectionId
TBool iRemotePlayer
TInt iReturnCode
TAdapterState iState
const CUpnpAVDevice * iTargetDevice
CMPXMediaArray * iTrackArray
MMPXViewUtility * iViewUtility
CActiveSchedulerWait * iWait

Constructor & Destructor Documentation

CUPnPMusicAdapter(MUPnPAVController &)

CUPnPMusicAdapter ( MUPnPAVController & aAVController ) [private]

Default constructor

Since
Series 60 3.1

Parameters

MUPnPAVController & aAVController reference to AVController resource.

~CUPnPMusicAdapter()

IMPORT_C ~CUPnPMusicAdapter ( ) [virtual]

Destructor

Since
Series 60 3.1

Member Functions Documentation

AVController()

MUPnPAVController & AVController ( )

The AVController resource (to be used by the fillers)

Since
Series 60 3.1

CollectionUtility()

MMPXCollectionUtility & CollectionUtility ( )

The MPX CollectionUtility. Accessor for the filler

Complete(MUPnPPlaylistFiller *)

void Complete ( MUPnPPlaylistFiller * aFiller )

Called when playlist fill has completed. Does not pass ownership.

Since
Series 60 3.1

Parameters

MUPnPPlaylistFiller * aFiller the object that has completed its job.

ConstructL()

void ConstructL ( ) [private]

2nd phase constructor

Since
Series 60 3.1

CreatePlayListL()

void CreatePlayListL ( ) [private]
Creates play list
Since
Series 60 3.1

Dismiss(TInt)

IMPORT_C void Dismiss ( TInt aReturnCode =  KErrCancel )

Dismiss the music player UI. The Execute... method will immediately return with the given return code

Since
Series 60 3.1

Parameters

TInt aReturnCode =  KErrCancel Exit code for the execution thread

DisplayUI()

void DisplayUI ( ) [private]
Commands the UI to be shown in UiShowLoop
Since
Series 60 3.1

DoHandleCollectionMessageL(TInt, TInt, TInt)

void DoHandleCollectionMessageL ( TInt aEvent,
TInt aType,
TInt aData
) [private]

Locally handles the corresponding callback

Parameters

TInt aEvent
TInt aType
TInt aData

DoHandlePlaybackMessageL(TInt, TInt, TInt)

void DoHandlePlaybackMessageL ( TInt aEvent,
TInt aType,
TInt aData
) [private]

Locally handles the corresponding callback

Parameters

TInt aEvent
TInt aType
TInt aData

DoHandleSubPlayerNamesL(TUid, const MDesCArray *, TBool, TInt)

void DoHandleSubPlayerNamesL ( TUid aPlayer,
const MDesCArray * aSubPlayers,
TBool aComplete,
TInt aError
) [private]

Locally handles the corresponding callback

Parameters

TUid aPlayer
const MDesCArray * aSubPlayers
TBool aComplete
TInt aError

ExecuteMusicInLocalL(CEikAppUi *, CUPnPPlayListFiller *)

IMPORT_C TInt ExecuteMusicInLocalL ( CEikAppUi * aAppUi,
CUPnPPlayListFiller * aFiller
)

Initiates music play in the local device The method will block until music player exits. Music adapter will take ownership of the filler in all conditions.

Since
Series 60 3.1

Parameters

CEikAppUi * aAppUi the app.ui in case we are displaying a view/dialog
CUPnPPlayListFiller * aFiller Object that contains playlist information

ExecuteMusicInRemoteL(CEikAppUi *, CUPnPPlayListFiller *, const CUpnpAVDevice &)

IMPORT_C TInt ExecuteMusicInRemoteL ( CEikAppUi * aParentUi,
CUPnPPlayListFiller * aFiller,
const CUpnpAVDevice & aRenderer
)

Initiates music play in a remote renderer. The method will block until music player exits. Music adapter will take ownership of the filler in all conditions.

Since
Series 60 3.1

Parameters

CEikAppUi * aParentUi
CUPnPPlayListFiller * aFiller Object that contains playlist information
const CUpnpAVDevice & aRenderer the selected renderer device

ExecuteMusicLiteInLocalL(CEikAppUi *, MUPnPPlaylistFiller *)

IMPORT_C TInt ExecuteMusicLiteInLocalL ( CEikAppUi * aAppUi,
MUPnPPlaylistFiller * aFiller
)

Initiates music play in the local device The method will block until music player exits. Music adapter will take ownership of the filler in all conditions.

Since
Series 60 3.1

Parameters

CEikAppUi * aAppUi the app.ui in case we are displaying a view/dialog
MUPnPPlaylistFiller * aFiller Object that contains playlist information

ExecuteMusicLiteInRemoteL(CEikAppUi *, MUPnPPlaylistFiller *, const CUpnpAVDevice &)

IMPORT_C TInt ExecuteMusicLiteInRemoteL ( CEikAppUi * aParentUi,
MUPnPPlaylistFiller * aFiller,
const CUpnpAVDevice & aRenderer
)

Initiates music play in a remote renderer. The method will block until music player exits. Music adapter will take ownership of the filler in all conditions.

Since
Series 60 3.1

Parameters

CEikAppUi * aParentUi
MUPnPPlaylistFiller * aFiller Object that contains playlist information
const CUpnpAVDevice & aRenderer the selected renderer device

Exit(TInt)

void Exit ( TInt aReturnCode ) [private]
Causes an internal exit
Since
Series 60 3.1

Parameters

TInt aReturnCode the return code for the thread

HandleCollectionMediaL(const CMPXMedia &, TInt)

void HandleCollectionMediaL ( const CMPXMedia & aMedia,
TInt aError
) [protected]

see MMPXCollectionMediaObserver

Parameters

const CMPXMedia & aMedia
TInt aError

HandleCollectionMessage(CMPXMessage *, TInt)

void HandleCollectionMessage ( CMPXMessage * aMsg,
TInt aErr
) [protected]

see MMPXCollectionObserver

Parameters

CMPXMessage * aMsg
TInt aErr

HandleCommandComplete(CMPXCommand *, TInt)

void HandleCommandComplete ( CMPXCommand * aCommandResult,
TInt aError
) [protected]

MMPXPlaybackObserver

Parameters

CMPXCommand * aCommandResult
TInt aError

HandleMediaL(const CMPXMedia &, TInt)

void HandleMediaL ( const CMPXMedia & aProperties,
TInt aError
) [protected]

MMPXPlaybackCallback

Parameters

const CMPXMedia & aProperties
TInt aError

HandleOpenL(const CMPXMedia &, TInt, TBool, TInt)

void HandleOpenL ( const CMPXMedia & aEntries,
TInt aIndex,
TBool aComplete,
TInt aError
) [protected]

see MMPXCollectionObserver

Parameters

const CMPXMedia & aEntries
TInt aIndex
TBool aComplete
TInt aError

HandleOpenL(const CMPXCollectionPlaylist &, TInt)

void HandleOpenL ( const CMPXCollectionPlaylist & aPlaylist,
TInt aError
) [protected]

MMPXPlaybackObserver

Parameters

const CMPXCollectionPlaylist & aPlaylist
TInt aError

HandlePlaybackMessage(CMPXMessage *, TInt)

void HandlePlaybackMessage ( CMPXMessage * aMsg,
TInt aErr
) [protected]

MMPXPlaybackObserver

Parameters

CMPXMessage * aMsg
TInt aErr

HandlePropertyL(TMPXPlaybackProperty, TInt, TInt)

void HandlePropertyL ( TMPXPlaybackProperty aProperty,
TInt aValue,
TInt aError
) [protected]

MMPXPlaybackCallback

Parameters

TMPXPlaybackProperty aProperty
TInt aValue
TInt aError

HandleSubPlayerNamesL(TUid, const MDesCArray *, TBool, TInt)

void HandleSubPlayerNamesL ( TUid aPlayer,
const MDesCArray * aSubPlayers,
TBool aComplete,
TInt aError
) [protected]

MMPXPlaybackCallback

Parameters

TUid aPlayer
const MDesCArray * aSubPlayers
TBool aComplete
TInt aError

InitState()

void InitState ( ) [private]

Initialises the state before execution

Since
Series 60 3.1

NewL(MUPnPAVController &)

IMPORT_C CUPnPMusicAdapter * NewL ( MUPnPAVController & aAVController ) [static]

1st phase constructor

Since
Series 60 3.1

Parameters

MUPnPAVController & aAVController reference to AVController resource.

PlaylistCollectionId()

TUid PlaylistCollectionId ( )

The Collection UID used for the playlist. Accessor for the filler

TakeOwnershipOfTheFiller(MUPnPPlaylistFiller *)

void TakeOwnershipOfTheFiller ( MUPnPPlaylistFiller * aFiller ) [private]

Obtains ownership of the filler pointer.

Since
Series 60 3.1

Parameters

MUPnPPlaylistFiller * aFiller the filler object to own

UiShowLoopL()

void UiShowLoopL ( ) [private]
A loop to show the UI
Since
Series 60 3.1

Member Enumerations Documentation

Enum TAdapterState

the adapter state

Enumerators

EStateIdle = 0
EStatePreparing
EStatePreparingWait
EStateInitialising
EStateRunning
EStateClosing

Enum TFillerState

Enumerators

EFillerStateIdle = 0
EFillerStateFilling
EFillerStateComplete

Member Data Documentation

MUPnPAVController & iAVController

MUPnPAVController & iAVController [private]

AVController resource

CEikAppUi * iAppUi

CEikAppUi * iAppUi [private]

Pointer to host application ui. NO OWNERSHIP

MMPXCollectionUtility * iCollectionUtility

MMPXCollectionUtility * iCollectionUtility [private]

For collection Own.

MUPnPPlaylistFiller * iCurrentFiller

MUPnPPlaylistFiller * iCurrentFiller [private]

The current playlist filler object

TFillerState iCurrentFillerState

TFillerState iCurrentFillerState [private]

Whether the filler is in working state

CMPXMedia * iMedia

CMPXMedia * iMedia [private]

For media object array

CUPnPMpxHelper * iMpxHelper

CUPnPMpxHelper * iMpxHelper [private]

For playlist creation Own.

MMPXPlaybackUtility * iPlaybackUtility

MMPXPlaybackUtility * iPlaybackUtility [private]

For playback Own.

CMPXCollectionPlaylist * iPlaylist

CMPXCollectionPlaylist * iPlaylist [private]

The current playlist

TUid iPlaylistCollectionId

TUid iPlaylistCollectionId [private]

Collection ID to use when communicating to MPX

TBool iRemotePlayer

TBool iRemotePlayer [private]

Tells are we using remote playback

TInt iReturnCode

TInt iReturnCode [private]

Exit code

TAdapterState iState

TAdapterState iState [private]

state of the adapter

const CUpnpAVDevice * iTargetDevice

const CUpnpAVDevice * iTargetDevice [private]

The renderer device we are rendering on NULL, if rendering locally NO OWNERSHIP

CMPXMediaArray * iTrackArray

CMPXMediaArray * iTrackArray [private]

The current temp playlist Own.

MMPXViewUtility * iViewUtility

MMPXViewUtility * iViewUtility [private]

View utility.

CActiveSchedulerWait * iWait

CActiveSchedulerWait * iWait [private]

Scheduler wait loop