CUPnPPlaylistServices Class Reference

class CUPnPPlaylistServices : public CBase
A class providing abstract playlist handling services. upnpmusicadapter.lib
Since
S60 v3.1

Inherits from

Public Member Functions
~CUPnPPlaylistServices ()
IMPORT_C void AddMediaToPlaylistL (const TDesC &, const TDesC &)
IMPORT_C void CreatePlaylistL (const TDesC &, const MDesCArray &, TDes *)
IMPORT_C void CreateTrackL (const TDesC &, const CUpnpItem &)
IMPORT_C void DeletePlaylistL (const TDesC &)
IMPORT_C void DeleteTrackL (const TDesC &)
IMPORT_C TBool IsValidPlaylistL (const TDesC &)
IMPORT_C TBool IsValidTrackL (const TDesC &)
IMPORT_C void ListPlaylistsL ( CDesCArray &, CDesCArray &)
IMPORT_C CUPnPPlaylistServices * NewL ()
IMPORT_C void OpenPlaylistL (const TDesC &, CDesCArray &)
Protected Member Functions
TMPXItemId Desc2Id (const TDesC &)
CMPXMedia * FetchPlaylistContentL (const TDesC &)
CMPXMedia * FindItemL ( TFindCategory , const TDesC &, const TMPXAttributeData *, const TMPXAttributeData *, const TMPXAttributeData *)
HBufC16 * GetElementLC (const CUpnpItem &, const TDesC8 &)
const TDesC & Id2Desc (const TMPXItemId &)
Private Member Functions
CUPnPPlaylistServices ()
void ConstructL ()
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()
Protected Member Enumerations
enum TFindCategory { ESongs , ESongByUri , EPlaylists , EPlaylistById , EPlaylistByTitle }
Private Attributes
MMPXCollectionUtility * iCollectionUtility
TMPXItemId iCurrentId
CUPnPMpxHelper * iMpxHelper
TInt iStatus
TBuf < KTempBufferSize > iTempBuffer

Constructor & Destructor Documentation

CUPnPPlaylistServices()

CUPnPPlaylistServices ( ) [private]

default constructor

~CUPnPPlaylistServices()

~CUPnPPlaylistServices ( ) [virtual]

desctuctor

Member Functions Documentation

AddMediaToPlaylistL(const TDesC &, const TDesC &)

IMPORT_C void AddMediaToPlaylistL ( const TDesC & aPlaylistId,
const TDesC & aTrackPath
)

Adds a file into an existing playlist. The track should be introduced to MPX using CreateTrackL prior to calling this method.

Parameters

const TDesC & aPlaylistId ID of the playlist
const TDesC & aTrackPath path to the track media

ConstructL()

void ConstructL ( ) [private]

2nd phase constructor

CreatePlaylistL(const TDesC &, const MDesCArray &, TDes *)

IMPORT_C void CreatePlaylistL ( const TDesC & aPlaylistName,
const MDesCArray & aTrackPaths,
TDes * aPlaylistId
)

Creates a playlist by given data into the music library. The tracks should be introduced to MPX using CreateTrackL prior to calling this method.

Parameters

const TDesC & aPlaylistName the name of the playlist
const MDesCArray & aTrackPaths array of playlist content file paths
TDes * aPlaylistId receives the playlist ID (KMaxPlaylistId) Can also be NULL, if ID is not needed.

CreateTrackL(const TDesC &, const CUpnpItem &)

IMPORT_C void CreateTrackL ( const TDesC & aTrackPath,
const CUpnpItem & aTrackMetadata
)

Creates a record of a music track into the music library. The media is assumed to exist already.

Parameters

const TDesC & aTrackPath path to the track media
const CUpnpItem & aTrackMetadata the upnp item for track metadata

DeletePlaylistL(const TDesC &)

IMPORT_C void DeletePlaylistL ( const TDesC & aPlaylistId )

Deletes a record of a playlist from the music library. Note that this does not delete the actual media.

Parameters

const TDesC & aPlaylistId ID of the playlist

DeleteTrackL(const TDesC &)

IMPORT_C void DeleteTrackL ( const TDesC & aTrackPath )

Deletes a record of a music track from the music library. Note that this does not delete the actual media.

Parameters

const TDesC & aTrackPath the actual file path

Desc2Id(const TDesC &)

TMPXItemId Desc2Id ( const TDesC & aDesc ) [protected]

Converts an ID from descriptor form to TMPXItemId form. conversion is guaranteed symmetric to Id2Desc()

Parameters

const TDesC & aDesc the id as a descriptor

FetchPlaylistContentL(const TDesC &)

CMPXMedia * FetchPlaylistContentL ( const TDesC & aId ) [protected]

Fetch a playlist content by id

Parameters

const TDesC & aId playlist id

FindItemL(TFindCategory, const TDesC &, const TMPXAttributeData *, const TMPXAttributeData *, const TMPXAttributeData *)

CMPXMedia * FindItemL ( TFindCategory aCategory,
const TDesC & aKey,
const TMPXAttributeData * aAttribute1 = 0,
const TMPXAttributeData * aAttribute2 = 0,
const TMPXAttributeData * aAttribute3 = 0
) [protected]

Finds a playlist according to given criteria.

Parameters

TFindCategory aCategory
const TDesC & aKey find key, depends on the category
const TMPXAttributeData * aAttribute1 = 0 attribute to get (optional)
const TMPXAttributeData * aAttribute2 = 0 attribute to get (optional)
const TMPXAttributeData * aAttribute3 = 0 attribute to get (optional)

GetElementLC(const CUpnpItem &, const TDesC8 &)

HBufC16 * GetElementLC ( const CUpnpItem & aSource,
const TDesC8 & aSourceField
) const [protected]

Finds an element within CUpnpItem returns the element value converted to unicode, pushed to cleanup stack.

Parameters

const CUpnpItem & aSource the source CUpnpItem
const TDesC8 & aSourceField the element name within source

Id2Desc(const TMPXItemId &)

const TDesC & Id2Desc ( const TMPXItemId & aId ) [protected]

Converts an ID from TMPXItemId form to descriptor form. conversion is guaranteed symmetric to Desc2Id()

Parameters

const TMPXItemId & aId the id in TMPXItemId form

IsValidPlaylistL(const TDesC &)

IMPORT_C TBool IsValidPlaylistL ( const TDesC & aPlaylistName )

Checks if the given playlist exists in the music library. Note: does not check the existence of the actual media

Parameters

const TDesC & aPlaylistName

IsValidTrackL(const TDesC &)

IMPORT_C TBool IsValidTrackL ( const TDesC & aTrackPath )

Checks if the given track exists in the music library. Note: does not check the existence of the actual media

Parameters

const TDesC & aTrackPath the actual file path

ListPlaylistsL(CDesCArray &, CDesCArray &)

IMPORT_C void ListPlaylistsL ( CDesCArray & aPlaylistIds,
CDesCArray & aPlaylistNames
)

Lists all playlists in the music library. Returns a list of playlist ID's and a names. ID can be used to open or modify the playlist.

Parameters

CDesCArray & aPlaylistIds array to receive playlist ID's
CDesCArray & aPlaylistNames array to receive playlist names

NewL()

IMPORT_C CUPnPPlaylistServices * NewL ( ) [static]

Static constructor

OpenPlaylistL(const TDesC &, CDesCArray &)

IMPORT_C void OpenPlaylistL ( const TDesC & aPlaylistId,
CDesCArray & aContentMedia
)

Retrieves contents of given playlist.

Parameters

const TDesC & aPlaylistId ID of the playlist
CDesCArray & aContentMedia array to receive the content file paths

Member Enumerations Documentation

Enum TFindCategory

category to be used in FindItemL

Enumerators

ESongs
ESongByUri
EPlaylists
EPlaylistById
EPlaylistByTitle

Member Data Documentation

MMPXCollectionUtility * iCollectionUtility

MMPXCollectionUtility * iCollectionUtility [private]

Collection utility of MPX framework

TMPXItemId iCurrentId

TMPXItemId iCurrentId [private]

ID of item currently processed asynchronously

CUPnPMpxHelper * iMpxHelper

CUPnPMpxHelper * iMpxHelper [private]

internal helper for some MPX operations

TInt iStatus

TInt iStatus [private]

tells if collection plugin exists

TBuf< KTempBufferSize > iTempBuffer

TBuf < KTempBufferSize > iTempBuffer [private]

temp buffer used in Id2Desc