CUPnPPlaylistServices Class Reference

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

Inherits from

  • CUPnPPlaylistServices
Public Member Functions
~CUPnPPlaylistServices()
IMPORT_C voidAddMediaToPlaylistL(const TDesC &, const TDesC &)
IMPORT_C voidCreatePlaylistL(const TDesC &, const MDesCArray &, TDes *)
IMPORT_C voidCreateTrackL(const TDesC &, const CUpnpItem &)
IMPORT_C voidDeletePlaylistL(const TDesC &)
IMPORT_C voidDeleteTrackL(const TDesC &)
IMPORT_C TBoolIsValidPlaylistL(const TDesC &)
IMPORT_C TBoolIsValidTrackL(const TDesC &)
IMPORT_C voidListPlaylistsL(CDesCArray &, CDesCArray &)
IMPORT_C CUPnPPlaylistServices *NewL()
IMPORT_C voidOpenPlaylistL(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()
voidConstructL()
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
enumTFindCategory { 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 voidAddMediaToPlaylistL(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 & aPlaylistIdID of the playlist
const TDesC & aTrackPathpath to the track media

ConstructL()

voidConstructL()[private]

2nd phase constructor

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

IMPORT_C voidCreatePlaylistL(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 & aPlaylistNamethe name of the playlist
const MDesCArray & aTrackPathsarray of playlist content file paths
TDes * aPlaylistIdreceives the playlist ID (KMaxPlaylistId) Can also be NULL, if ID is not needed.

CreateTrackL(const TDesC &, const CUpnpItem &)

IMPORT_C voidCreateTrackL(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 & aTrackPathpath to the track media
const CUpnpItem & aTrackMetadatathe upnp item for track metadata

DeletePlaylistL(const TDesC &)

IMPORT_C voidDeletePlaylistL(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 & aPlaylistIdID of the playlist

DeleteTrackL(const TDesC &)

IMPORT_C voidDeleteTrackL(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 & aTrackPaththe 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 & aDescthe id as a descriptor

FetchPlaylistContentL(const TDesC &)

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

Fetch a playlist content by id

Parameters

const TDesC & aIdplaylist id

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

CMPXMedia *FindItemL(TFindCategoryaCategory,
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 & aKeyfind key, depends on the category
const TMPXAttributeData * aAttribute1 = 0attribute to get (optional)
const TMPXAttributeData * aAttribute2 = 0attribute to get (optional)
const TMPXAttributeData * aAttribute3 = 0attribute 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 & aSourcethe source CUpnpItem
const TDesC8 & aSourceFieldthe 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 & aIdthe id in TMPXItemId form

IsValidPlaylistL(const TDesC &)

IMPORT_C TBoolIsValidPlaylistL(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 TBoolIsValidTrackL(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 & aTrackPaththe actual file path

ListPlaylistsL(CDesCArray &, CDesCArray &)

IMPORT_C voidListPlaylistsL(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 & aPlaylistIdsarray to receive playlist ID's
CDesCArray & aPlaylistNamesarray to receive playlist names

NewL()

IMPORT_C CUPnPPlaylistServices *NewL()[static]

Static constructor

OpenPlaylistL(const TDesC &, CDesCArray &)

IMPORT_C voidOpenPlaylistL(const TDesC &aPlaylistId,
CDesCArray &aContentMedia
)

Retrieves contents of given playlist.

Parameters

const TDesC & aPlaylistIdID of the playlist
CDesCArray & aContentMediaarray 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