VideoFileDetailsDialog.cpp
上传用户:xinrui0099
上传日期:2010-03-05
资源大小:48k
文件大小:25k
源码类别:

Symbian

开发平台:

C/C++

  1. /*
  2. * ============================================================================
  3. *  Name     : CVideoFileDetailsDialog from VideoFileDetailsDialog.h
  4. *  Part of  : Video
  5. *  Created  : 10/14/2003 by Forum Nokia
  6. *  Description:
  7. *  Declares Video file details dialog
  8. *  Version  :
  9. *  Copyright: Forum Corporation, 2003
  10. * ============================================================================
  11. */
  12.   
  13. #include <aknlists.h>
  14. #include <bautils.h>
  15. #include <stringloader.h>
  16. #include <e32base.h>
  17. #include <utf.h>
  18. #include <Video.rsg>
  19. #include "Videoengine.h"
  20. #include "VideoFileDetailsDialog.h"
  21. #include "MPlayerUIControllerListener.h"
  22. const TInt KFileSizeOneKilobyte = 1024;
  23. const TInt KMaxUrlLength = 1024;
  24. // For meta data 
  25. _LIT(KMPTitle,"Title");
  26. _LIT(KMPCopyright,"Copyright");
  27. /*
  28. -----------------------------------------------------------------------------
  29. CVideoFileDetailsDialog::CVideoFileDetailsDialog()                                         
  30. Description: C++ default constructor can NOT contain any code that might leave.
  31. Comments   :
  32.     Return values: N/A
  33. -----------------------------------------------------------------------------
  34. */
  35. CVideoFileDetailsDialog::CVideoFileDetailsDialog() : iResult(KErrNone)                                         
  36.     {
  37.     }
  38. /*
  39. -----------------------------------------------------------------------------
  40. void CVideoFileDetailsDialog::ConstructL()
  41. Description: Symbian 2nd phase constructor can leave.
  42. Comments   :
  43.     Return values: N/A
  44. -----------------------------------------------------------------------------
  45. */
  46. void CVideoFileDetailsDialog::ConstructL()
  47.     {
  48.     iListBox = new (ELeave) CAknDoublePopupMenuStyleListBox();
  49.     }
  50. /*
  51. -----------------------------------------------------------------------------
  52. CVideoFileDetailsDialog* CVideoFileDetailsDialog::NewL()
  53. Description: Two-phased constructor.
  54. Comments   :
  55.     Return values: CVideoFileDetailsDialog object pointer
  56. -----------------------------------------------------------------------------
  57. */
  58. CVideoFileDetailsDialog* CVideoFileDetailsDialog::NewL()
  59.     {
  60.     CVideoFileDetailsDialog* self = new( ELeave ) CVideoFileDetailsDialog();
  61.     CleanupStack::PushL( self );
  62.     self->ConstructL();
  63.     CleanupStack::Pop();
  64.     return self;
  65.     }
  66. /*
  67. -----------------------------------------------------------------------------
  68. CVideoFileDetailsDialog::~CVideoFileDetailsDialog()
  69. Description: Destructor
  70. Comments   :
  71.     Return values: N/A
  72. -----------------------------------------------------------------------------
  73. */
  74. CVideoFileDetailsDialog::~CVideoFileDetailsDialog()
  75.     {
  76.     delete iListBox;
  77.     }
  78. /*
  79. -----------------------------------------------------------------------------
  80. void CVideoFileDetailsDialog::ExecuteLD(const TDesC& aFileName)
  81. Description: Launches the file details dialog
  82. Comments   :
  83.     Return values: N/A
  84. -----------------------------------------------------------------------------
  85. */
  86. void CVideoFileDetailsDialog::ExecuteLD(const TDesC& aFileName)
  87.     {
  88.   
  89.     CVideoFileDetails* fileDetails = new (ELeave) CVideoFileDetails();
  90.     CleanupStack::PushL(fileDetails);
  91.     
  92.     CleanupStack::PushL(this);
  93.      // filename
  94.     TParse parse;
  95. parse.Set(aFileName,NULL,NULL);
  96.     fileDetails->iFileName = parse.Name().AllocL();
  97.     CPDummyController* dummy = CPDummyController::NewLC();
  98.     TRect tmp;
  99.     CVideoPlayerUtility* videoPlayer = CVideoPlayerUtility::NewL(*this,EMdaPriorityNormal,EMdaPriorityPreferenceNone,
  100. dummy->GetClientWsSession(),dummy->GetScreenDevice(),dummy->GetClientWindow(),tmp,tmp);
  101.     CleanupStack::PushL(videoPlayer);
  102. // open
  103.     videoPlayer->OpenFileL(aFileName);
  104.     // wait open to complete
  105.     iWait.Start();
  106.     User::LeaveIfError(iResult);
  107.     // prepare
  108.     videoPlayer->Prepare();
  109.     // wait prepare to complete
  110.     iWait.Start();
  111.     User::LeaveIfError(iResult);
  112.     // get video file details
  113.     // duration
  114.     fileDetails->iDurationInSeconds = videoPlayer->DurationL().Int64() / KMPOneSecond;
  115.     // resolution
  116.     TSize size;
  117.     videoPlayer->VideoFrameSizeL(size);
  118.     fileDetails->iResolutionHeight = size.iHeight;
  119.     fileDetails->iResolutionWidth = size.iWidth;
  120.     // bitrate
  121.     fileDetails->iBitrate = videoPlayer->VideoBitRateL();
  122.     // format
  123.     TBuf<KMaxDataTypeLength> format;
  124.     CnvUtfConverter::ConvertToUnicodeFromUtf8(format,videoPlayer->VideoFormatMimeType());
  125.     if (format.CompareF(_L("")))
  126. {
  127.         fileDetails->iFormat = format.AllocL();
  128.         }
  129.             
  130. // copyright & title
  131.     TInt metaCount = videoPlayer->NumberOfMetaDataEntriesL();
  132.     CMMFMetaDataEntry* metaData;
  133.     for (TInt i = 0; i < metaCount; i++)
  134. {
  135.         metaData = videoPlayer->MetaDataEntryL(i);
  136.         if (!metaData->Name().CompareF(KMPCopyright))
  137. {
  138.             fileDetails->iCopyright = metaData->Value().AllocL();
  139.              }
  140.         if (!metaData->Name().CompareF(KMPTitle))
  141.              {
  142.              fileDetails->iTitle = metaData->Value().AllocL();
  143.              }
  144.              delete metaData;
  145.          }
  146.          CleanupStack::PopAndDestroy(2); // dummy and videoPlayer
  147.     
  148.     CleanupStack::Pop(); //this
  149.     // Show File Details in differend ExecuteLD
  150.     ExecuteLD(fileDetails);
  151.     CleanupStack::PopAndDestroy(); // fileDetails
  152.     }
  153. /*
  154. -----------------------------------------------------------------------------
  155. void CVideoFileDetailsDialog::ExecuteLD(CVideoFileDetails* aFileDetails)
  156. Description: Launches the dialog
  157. Comments   :
  158.     Return values: N/A
  159. -----------------------------------------------------------------------------
  160. */
  161. void CVideoFileDetailsDialog::ExecuteLD(CVideoFileDetails* aFileDetails)
  162.     {
  163.     CleanupStack::PushL(this);
  164.     CAknPopupList* popupList = CAknPopupList::NewL(iListBox,R_AVKON_SOFTKEYS_OK_EMPTY, AknPopupLayouts::EMenuDoubleWindow);
  165.     CleanupStack::PushL(popupList);
  166.     iListBox->ConstructL(popupList, EAknListBoxViewerFlags);
  167.     iListBox->CreateScrollBarFrameL(ETrue);   
  168.     iListBox->ScrollBarFrame()->SetScrollBarVisibilityL(CEikScrollBarFrame::EOff, CEikScrollBarFrame::EAuto);
  169.     
  170.     SetTitleL(popupList);
  171.     FillListBoxL(aFileDetails);
  172.     CleanupStack::Pop(); //popupList
  173.     popupList->ExecuteLD();
  174.     CleanupStack::PopAndDestroy(); //this
  175.     }
  176. /*
  177. -----------------------------------------------------------------------------
  178. void CVideoFileDetailsDialog::SetTitleL(CAknPopupList* aPopupList)
  179. Description: Sets the title for the Popup list
  180. Comments   :
  181.     Return values: N/A
  182. -----------------------------------------------------------------------------
  183. */
  184. void CVideoFileDetailsDialog::SetTitleL(CAknPopupList* aPopupList)
  185.     {
  186.     HBufC* title = StringLoader::LoadLC(R_VIDEO_FILE_DETAILS);
  187.     aPopupList->SetTitleL(*title);
  188.     CleanupStack::PopAndDestroy(); //title
  189.     }
  190. /*
  191. -----------------------------------------------------------------------------
  192. void CVideoFileDetailsDialog::FillListBoxL(CVideoFileDetails* aFileDetails)
  193. Description: Fills the listbox
  194. Comments   :
  195.     Return values: N/A
  196. -----------------------------------------------------------------------------
  197. */
  198. void CVideoFileDetailsDialog::FillListBoxL(CVideoFileDetails* aFileDetails)
  199.     {
  200.     CDesCArray* itemArray = static_cast<CDesCArray*>(iListBox->Model()->ItemTextArray());
  201.   
  202.     MakeTitleItemL(itemArray,aFileDetails);  
  203.     MakeUrlItemL(itemArray,aFileDetails);
  204.     MakeFormatItemL(itemArray,aFileDetails);
  205.     MakeResolutionItemL(itemArray,aFileDetails);
  206.     MakeDurationItemL(itemArray,aFileDetails);
  207.     MakeBitrateItemL(itemArray,aFileDetails);
  208.     MakeSizeItemL(itemArray,aFileDetails);
  209.     MakeDateItemL(itemArray,aFileDetails);
  210.     MakeTimeItemL(itemArray,aFileDetails);
  211.     MakeCopyrightItemL(itemArray,aFileDetails);
  212.  
  213.     iListBox->HandleItemAdditionL();
  214.     iListBox->SetCurrentItemIndex(0);
  215.     }
  216. /*
  217. -----------------------------------------------------------------------------
  218. void CVideoFileDetailsDialog::AddItemToListBoxL(const TDesC& aHeading, 
  219.     const TDesC& aValue, CDesCArray* aItemArray)
  220. Description: Adds item to the list box
  221. Comments   :
  222.     Return values: N/A
  223. -----------------------------------------------------------------------------
  224. */
  225. void CVideoFileDetailsDialog::AddItemToListBoxL(const TDesC& aHeading, const TDesC& aValue, CDesCArray* aItemArray)
  226.     {
  227.     CDesCArrayFlat* items = new (ELeave) CDesCArrayFlat(2);
  228.     CleanupStack::PushL(items);
  229.     items->AppendL(aHeading); //First string (heading)
  230.     items->AppendL(aValue);   //Second string (value)
  231.     HBufC* headingAndValue = StringLoader::LoadLC( R_VIDEO_FILE_DETAILS_ROW_FORMAT, *items);
  232.     aItemArray->AppendL(*headingAndValue);
  233.     CleanupStack::PopAndDestroy(2); // items & headingAndValue 
  234.     }
  235. /*
  236. -----------------------------------------------------------------------------
  237. void CVideoFileDetailsDialog::MakeTitleItemL(CDesCArray* aItemArray,
  238.                                            CVideoFileDetails* aFileDetails)
  239. Description: Makes the title item
  240. Comments   :
  241.     Return values: N/A
  242. -----------------------------------------------------------------------------
  243. */
  244. void CVideoFileDetailsDialog::MakeTitleItemL(CDesCArray* aItemArray,
  245.                                            CVideoFileDetails* aFileDetails)
  246.     {
  247.     if (aFileDetails->iTitle)
  248.         {
  249.         HBufC* heading = StringLoader::LoadLC(R_VIDEO_FILE_TITLE_HEADING);
  250.         AddItemToListBoxL(*heading,*aFileDetails->iTitle,aItemArray);
  251.         CleanupStack::PopAndDestroy(); // heading
  252.         return;
  253.         }
  254.     
  255.     if (aFileDetails->iFileName)
  256.         {
  257.         HBufC* heading = StringLoader::LoadLC(R_VIDEO_FILE_NAME_HEADING);
  258.         AddItemToListBoxL(*heading,*aFileDetails->iFileName,aItemArray);
  259.         CleanupStack::PopAndDestroy(); // heading
  260.         }
  261.     }
  262. /*
  263. -----------------------------------------------------------------------------
  264. void CVideoFileDetailsDialog::MakeUrlItemL(CDesCArray* aItemArray,
  265.                                            CVideoFileDetails* aFileDetails)
  266. Description: Makes Url item
  267. Comments   :
  268.     Return values: N/A
  269. -----------------------------------------------------------------------------
  270. */
  271. void CVideoFileDetailsDialog::MakeUrlItemL(CDesCArray* aItemArray,
  272.                                            CVideoFileDetails* aFileDetails)
  273.     {
  274.     if (aFileDetails->iUrl)
  275.         {
  276.         HBufC* heading = StringLoader::LoadLC(R_VIDEO_FILE_URL_HEADING);
  277.         AddItemToListBoxL(*heading,*aFileDetails->iUrl,aItemArray);
  278.         CleanupStack::PopAndDestroy(); // heading
  279.         }
  280.     }
  281. /*
  282. -----------------------------------------------------------------------------
  283. void CVideoFileDetailsDialog::MakeFormatItemL(CDesCArray* aItemArray,
  284.                                            CVideoFileDetails* aFileDetails)
  285. Description: Makes video file heading
  286. Comments   :
  287.     Return values: N/A
  288. -----------------------------------------------------------------------------
  289. */
  290. void CVideoFileDetailsDialog::MakeFormatItemL(CDesCArray* aItemArray,
  291.                                            CVideoFileDetails* aFileDetails)
  292.     {
  293.     if (aFileDetails->iFormat)
  294.         {
  295.         HBufC* heading = StringLoader::LoadLC(R_VIDEO_FILE_FORMAT_HEADING);
  296.         AddItemToListBoxL(*heading,*aFileDetails->iFormat,aItemArray);
  297.         CleanupStack::PopAndDestroy(); // heading
  298.         }
  299.     }
  300. /*
  301. -----------------------------------------------------------------------------
  302. void CVideoFileDetailsDialog::MakeResolutionItemL(CDesCArray* aItemArray,
  303.                                                CVideoFileDetails* aFileDetails)
  304. Description: Makes resolution item
  305. Comments   :
  306.     Return values: N/A
  307. -----------------------------------------------------------------------------
  308. */
  309. void CVideoFileDetailsDialog::MakeResolutionItemL(CDesCArray* aItemArray,
  310.                                                CVideoFileDetails* aFileDetails)
  311.     {   
  312.     if (aFileDetails->iResolutionWidth && aFileDetails->iResolutionHeight)
  313.         {
  314.         HBufC* heading = StringLoader::LoadLC(R_VIDEO_FILE_RESOLUTION_HEADING);    
  315.         CArrayFix<TInt>* items = new (ELeave) CArrayFixFlat<TInt>(2);
  316.         CleanupStack::PushL(items);
  317.         items->AppendL(aFileDetails->iResolutionWidth);
  318.         items->AppendL(aFileDetails->iResolutionHeight);
  319.         HBufC* value = StringLoader::LoadLC(R_VIDEO_FILE_RESOLUTION,*items);
  320.         AddItemToListBoxL(*heading,*value,aItemArray);
  321.         CleanupStack::PopAndDestroy(3); // heading,items,value 
  322.         }
  323.     }
  324. /*
  325. -----------------------------------------------------------------------------
  326. void CVideoFileDetailsDialog::MakeDurationItemL(CDesCArray* aItemArray,
  327.                                              CVideoFileDetails* aFileDetails)
  328. Description: Makes duration item
  329. Comments   :
  330.     Return values: N/A
  331. -----------------------------------------------------------------------------
  332. */
  333. void CVideoFileDetailsDialog::MakeDurationItemL(CDesCArray* aItemArray,
  334.                                              CVideoFileDetails* aFileDetails)
  335.     {
  336.     TInt64 duration = aFileDetails->iDurationInSeconds;
  337.     if (duration > 0)
  338.         {
  339.         HBufC* dateFormatString;
  340.         if (duration < KOneHourInSeconds)
  341.             {
  342.             dateFormatString = StringLoader::LoadLC(R_QTN_TIME_DURAT_MIN_SEC); // Read time format string from AVKON resource
  343.             }
  344.         else
  345.             {
  346.             dateFormatString = StringLoader::LoadLC(R_QTN_TIME_DURAT_LONG); // Read time format string from AVKON resource
  347.             }   
  348.         TBuf<16> dur;
  349.         TTime durTime = TTime(duration*KMPOneSecond);
  350.         durTime.FormatL(dur, *dateFormatString);
  351.         HBufC* heading = StringLoader::LoadLC(R_VIDEO_FILE_DURATION_HEADING);
  352.         AddItemToListBoxL(*heading,dur,aItemArray);
  353.         CleanupStack::PopAndDestroy(2); // heading & dateFormatString
  354.         }
  355.     }
  356. /*
  357. -----------------------------------------------------------------------------
  358. void CVideoFileDetailsDialog::MakeBitrateItemL(CDesCArray* aItemArray,
  359.                                             CVideoFileDetails* aFileDetails)
  360. Description: Makes bit-rate item
  361. Comments   :
  362.     Return values: N/A
  363. -----------------------------------------------------------------------------
  364. */
  365. void CVideoFileDetailsDialog::MakeBitrateItemL(CDesCArray* aItemArray,
  366.                                             CVideoFileDetails* aFileDetails)
  367.     {
  368.     if (aFileDetails->iBitrate > 0)
  369.         {
  370.         HBufC* heading = StringLoader::LoadLC(R_VIDEO_FILE_BITRATE_HEADING);
  371.         HBufC* value = StringLoader::LoadLC(R_VIDEO_FILE_BITRATE,aFileDetails->iBitrate / KFileSizeOneKilobyte);
  372.         AddItemToListBoxL(*heading,*value,aItemArray);
  373.         CleanupStack::PopAndDestroy(2); // heading & value
  374.         }
  375.     }
  376. /*
  377. -----------------------------------------------------------------------------
  378. void CVideoFileDetailsDialog::MakeSizeItemL(CDesCArray* aItemArray,
  379.                                          CVideoFileDetails* aFileDetails)
  380. Description: Makes size item
  381. Comments   :
  382.     Return values: N/A
  383. -----------------------------------------------------------------------------
  384. */
  385. void CVideoFileDetailsDialog::MakeSizeItemL(CDesCArray* aItemArray,
  386.                                          CVideoFileDetails* aFileDetails)
  387.     {
  388.     if (aFileDetails->iSize)
  389.         {   
  390.         TRealFormat format = TRealFormat(256,2);
  391.         TBuf<256> sizeString;
  392.         HBufC* value;
  393.         HBufC* heading = StringLoader::LoadLC(R_VIDEO_FILE_SIZE_HEADING);
  394.         TReal size = aFileDetails->iSize;
  395.         size = size/KFileSizeOneKilobyte;
  396.         // Show kilobytes with 3 digits. If more digits needed, show size in megabytes
  397.         if (size < 1000)
  398.             {
  399.             sizeString.Num(size,format);
  400.             switch (sizeString.Length())
  401.                 {
  402.                 case 6:
  403.                     sizeString = sizeString.Left(3);
  404.                     break;
  405.                 case 5:
  406.                     sizeString = sizeString.Left(4);
  407.                     break;
  408.                 default:
  409.                     break;
  410.                 }
  411.             value = StringLoader::LoadLC(R_VIDEO_FILE_SIZE_KB,sizeString);
  412.             }
  413.         else
  414.             {
  415.             size = size/KFileSizeOneKilobyte;
  416.             sizeString.Num(size,format);
  417.             switch (sizeString.Length())
  418.                 {
  419.                 case 6:
  420.                     sizeString = sizeString.Left(3);
  421.                     break;
  422.                 case 5:
  423.                     sizeString = sizeString.Left(4);
  424.                     break;
  425.                 default:
  426.                     break;
  427.                 }
  428.             value = StringLoader::LoadLC(R_VIDEO_FILE_SIZE_MB,sizeString);
  429.             }
  430.         AddItemToListBoxL(*heading,*value,aItemArray);
  431.         CleanupStack::PopAndDestroy(2); // heading & value
  432.         }
  433.     }
  434. /*
  435. -----------------------------------------------------------------------------
  436. void CVideoFileDetailsDialog::MakeSizeItemL(CDesCArray* aItemArray,
  437.                                          CVideoFileDetails* aFileDetails)
  438. Description: Makes date item
  439. Comments   :
  440.     Return values: N/A
  441. -----------------------------------------------------------------------------
  442. */
  443. void CVideoFileDetailsDialog::MakeDateItemL(CDesCArray* aItemArray,
  444.                                          CVideoFileDetails* aFileDetails)
  445.     {
  446.     if (aFileDetails->iTime > TTime(0))
  447.         {
  448.         HBufC* heading = StringLoader::LoadLC(R_VIDEO_FILE_DATE_HEADING);
  449.         HBufC* dateFormatString = StringLoader::LoadLC(R_QTN_DATE_USUAL_WITH_ZERO);
  450.         TBuf<32> date;
  451.         aFileDetails->iTime.FormatL(date,*dateFormatString);
  452.         AddItemToListBoxL(*heading,date,aItemArray);
  453.         CleanupStack::PopAndDestroy(2); // heading & dateFormatString
  454.         }
  455.     }
  456. /*
  457. -----------------------------------------------------------------------------
  458. void CVideoFileDetailsDialog::MakeTimeItemL(CDesCArray* aItemArray,
  459.                                          CVideoFileDetails* aFileDetails)
  460. Description: Makes time item
  461. Comments   :
  462.     Return values: N/A
  463. -----------------------------------------------------------------------------
  464. */
  465. void CVideoFileDetailsDialog::MakeTimeItemL(CDesCArray* aItemArray,
  466.                                          CVideoFileDetails* aFileDetails)
  467.     {
  468.     if (aFileDetails->iTime > TTime(0))
  469.         {
  470.         HBufC* heading = StringLoader::LoadLC(R_VIDEO_FILE_TIME_HEADING);
  471.         HBufC* timeFormatString = StringLoader::LoadLC(R_QTN_TIME_USUAL_WITH_ZERO);
  472.         TBuf<32> time;
  473.         aFileDetails->iTime.FormatL(time,*timeFormatString);
  474.         AddItemToListBoxL(*heading,time,aItemArray);
  475.         CleanupStack::PopAndDestroy(2); // heading & timeFormatString
  476.         }
  477.     }
  478. /*
  479. -----------------------------------------------------------------------------
  480. void CVideoFileDetailsDialog::MakeCopyrightItemL(CDesCArray* aItemArray,
  481.                                               CVideoFileDetails* aFileDetails)
  482. Description: Makes copyright item
  483. Comments   :
  484.     Return values: N/A
  485. -----------------------------------------------------------------------------
  486. */
  487. void CVideoFileDetailsDialog::MakeCopyrightItemL(CDesCArray* aItemArray,
  488.                                               CVideoFileDetails* aFileDetails)
  489.     {
  490.     if (aFileDetails->iCopyright)
  491.         {
  492.         HBufC* heading = StringLoader::LoadLC(R_VIDEO_FILE_COPYRIGHT_HEADING);
  493.         AddItemToListBoxL(*heading,*aFileDetails->iCopyright,aItemArray);
  494.         CleanupStack::PopAndDestroy(); // heading
  495.         }
  496.     }
  497. /*
  498. -----------------------------------------------------------------------------
  499. void CVideoFileDetailsDialog::MapcInitComplete(TInt aError, 
  500. const TTimeIntervalMicroSeconds& aDuration)
  501. Description: Defines required client behaviour when an attempt to open and 
  502.      initialise an audio sample has completed, successfully or 
  503.  otherwise.
  504. Comments   :
  505.     Return values: N/A
  506. -----------------------------------------------------------------------------
  507. */
  508. void CVideoFileDetailsDialog::MapcInitComplete(TInt aError, const TTimeIntervalMicroSeconds& /*aDuration*/)
  509.     {
  510.     // Open completed, resume ExecuteLD(const TDesC& aFileName)
  511.     iResult = aError;
  512.     iWait.AsyncStop();
  513.     }
  514. /*
  515. -----------------------------------------------------------------------------
  516. void CVideoFileDetailsDialog::MapcPlayComplete(TInt aError)
  517. Description: Defines required client behaviour when an attempt to play an 
  518.              audio sample has completed, successfully or otherwise.
  519. Comments   :
  520.     Return values: N/A
  521. -----------------------------------------------------------------------------
  522. */
  523. void CVideoFileDetailsDialog::MapcPlayComplete(TInt /*aError*/)
  524.     {
  525.     
  526.     }
  527. /*
  528. -----------------------------------------------------------------------------
  529. void CVideoFileDetailsDialog::MvpuoOpenComplete(TInt aError)
  530. Description: Open has been completed
  531. Comments   :
  532.     Return values: N/A
  533. -----------------------------------------------------------------------------
  534. */
  535. void CVideoFileDetailsDialog::MvpuoOpenComplete(TInt aError)
  536.     {
  537.     // Open completed, resume ExecuteLD(const TDesC& aFileName)
  538.     iResult = aError;
  539.     iWait.AsyncStop();
  540.     }
  541. /*
  542. -----------------------------------------------------------------------------
  543. void CVideoFileDetailsDialog::MvpuoFrameReady(CFbsBitmap& aFrame,TInt aError)
  544. Description:  Frame is ready. 
  545. Comments   :
  546.     Return values: N/A
  547. -----------------------------------------------------------------------------
  548. */
  549. void CVideoFileDetailsDialog::MvpuoFrameReady(CFbsBitmap& /*aFrame*/,TInt /*aError*/)
  550.     {
  551.     }
  552. /*
  553. -----------------------------------------------------------------------------
  554. void CVideoFileDetailsDialog::MvpuoPlayComplete(TInt aError)
  555. Description:  Play has been completed
  556. Comments   :
  557.     Return values: N/A
  558. -----------------------------------------------------------------------------
  559. */
  560. void CVideoFileDetailsDialog::MvpuoPlayComplete(TInt /*aError*/)
  561.     {
  562.     }
  563. /*
  564. -----------------------------------------------------------------------------
  565. void CVideoFileDetailsDialog::MvpuoPrepareComplete(TInt aError)
  566. Description: Prepare has been completed
  567. Comments   :
  568.     Return values: N/A
  569. -----------------------------------------------------------------------------
  570. */
  571. void CVideoFileDetailsDialog::MvpuoPrepareComplete(TInt aError)
  572.     {
  573.      // Prepare completed, resume ExecuteLD(const TDesC& aFileName)
  574.     iResult = aError;
  575.     iWait.AsyncStop();
  576.     }
  577. /*
  578. -----------------------------------------------------------------------------
  579. void CVideoFileDetailsDialog::MvpuoEvent(const TMMFEvent& aEvent)
  580. Description: Mvpuo Event comes in
  581. Comments   :
  582.     Return values: N/A
  583. -----------------------------------------------------------------------------
  584. */
  585. void CVideoFileDetailsDialog::MvpuoEvent(const TMMFEvent& /*aEvent*/)
  586.     {
  587.     }
  588. /*
  589. -----------------------------------------------------------------------------
  590. CPDummyController::CPDummyController()
  591. Description: C++ default constructor can NOT contain any code that might
  592.  leave
  593. Comments   :
  594.     Return values: N/A
  595. -----------------------------------------------------------------------------
  596. */
  597. CPDummyController::CPDummyController()
  598. {
  599. }
  600. /*
  601. -----------------------------------------------------------------------------
  602. void CPDummyController::ConstructL()
  603. Description: Symbian 2nd phase constructor can leave.
  604. Comments   :
  605.     Return values: N/A
  606. -----------------------------------------------------------------------------
  607. */
  608. void CPDummyController::ConstructL()
  609. {
  610. CreateWindowL();
  611. SetExtent(TPoint(0,0), TSize(50,50));
  612. ActivateL();
  613. SetPointerCapture(ETrue);
  614. ClaimPointerGrab(ETrue);
  615. iEikonEnv->EikAppUi()->AddToStackL(this, ECoeStackPriorityEnvironmentFilter);
  616. }
  617. /*
  618. -----------------------------------------------------------------------------
  619. void CPDummyController::ConstructL()
  620. Description: Two-phased constructor.
  621. Comments   :
  622.     Return values: N/A
  623. -----------------------------------------------------------------------------
  624. */
  625. CPDummyController* CPDummyController::NewLC()
  626. {
  627. CPDummyController* self= new (ELeave) CPDummyController();
  628. CleanupStack::PushL(self);
  629. self->ConstructL();
  630. return self;
  631. }
  632. /*
  633. -----------------------------------------------------------------------------
  634. CPDummyController::~CPDummyController()
  635. Description: destructor
  636. Comments   :
  637.     Return values: N/A
  638. -----------------------------------------------------------------------------
  639. */
  640. CPDummyController::~CPDummyController()
  641. {
  642. if (iCoeEnv && iEikonEnv->EikAppUi())
  643. iEikonEnv->EikAppUi()->RemoveFromStack(this);
  644. }
  645. /*
  646. -----------------------------------------------------------------------------
  647. TKeyResponse CPDummyController::OfferKeyEventL(const TKeyEvent& aKeyEvent,
  648. TEventCode aType)
  649. Description: Absorbs all the key presses
  650. Comments   :
  651.     Return values: EKeyWasConsumed
  652. -----------------------------------------------------------------------------
  653. */
  654. TKeyResponse CPDummyController::OfferKeyEventL(const TKeyEvent& /*aKeyEvent*/,TEventCode /*aType*/)
  655. {
  656. return EKeyWasConsumed;
  657. }