CMPRecentList:
Article Metadata
CMPRecentList is used to access the recently accessed file list of media player. we can make use of these API's to know all the files which were accessed most recently, at the same time we can add and update the files to recent list, load the list and save the recent list.
Below is the example code that demostrate the usuage of CMPRecentList:
void CTestMPRecentListAppUi::ConstructL()
{
...
iMPRecentList = CMPRecentList::NewL();
...
}
_LIT(KFile,"c:\\sample.wav");
_LIT(KFile1,"c:\\sample1.wav");
void CTestMPRecentListAppUi::RecentList()
{
//RecentList is a recent file list which returns pointer to array of recent files.
MDesCArray* iList = iMPRecentList->RecentList();
// get the count of the list items
TInt i = iList->MdcaCount();
TBuf<20> aText;
aText.AppendNum(i);
CEikonEnv::InfoWinL(_L("List Count:"),aText);
for (int k = 0;k<i; k++)
{
aText.Zero();
//gets the list item name at a perticular index
TPtrC iName = iList->MdcaPoint(k);
aText.Append(iName);
CEikonEnv::InfoWinL(_L("List Item:"),aText);
}
}
void CTestMPRecentListAppUi::AddRecentListL()
{
//Add a file KFile to recent file list
iMPRecentList->AddRecentFileL(KFile);
}
void CTestMPRecentListAppUi::UpdateRecentListL()
{
//Reads, updates, and saves KFile1 to the recent list
iMPRecentList->UpdateRecentListL(KFile1);
}
void CTestMPRecentListAppUi::SaveRecentList()
{
//Saves recent file list
iMPRecentList->SaveRecentList();
}
void CTestMPRecentListAppUi::LoadRecentList()
{
//Loads recent file list
iMPRecentList->LoadRecentList();
}


(no comments yet)