Namespaces
Variants
Actions

CMPRecentList:

Jump to: navigation, search
Article Metadata

Article
Created: samiudd (05 Jul 2007)
Last edited: hamishwillee (19 Jul 2012)

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();
}
This page was last modified on 19 July 2012, at 09:17.
106 page views in the last 30 days.
Nokia Developer aims to help you create apps and publish them so you can connect with users around the world.

京ICP备05048969号  © Copyright Nokia 2013 All rights reserved