videoplayback/videohelix/src/mpxvideoplaybackstate.cpp
branchRCL_3
changeset 6 7d91903f795f
parent 1 6711b85517b7
child 9 5294c000a26d
equal deleted inserted replaced
2:dec420019252 6:7d91903f795f
    13 *
    13 *
    14 * Description:  This class plays local video file
    14 * Description:  This class plays local video file
    15 *
    15 *
    16 */
    16 */
    17 
    17 
    18 // Version : %version: 31 %
    18 // Version : %version: 33 %
    19 
    19 
    20 
    20 
    21 //
    21 //
    22 //  INCLUDE FILES
    22 //  INCLUDE FILES
    23 //
    23 //
   524     {
   524     {
   525         aMedia->SetTObjectValueL<TInt>(
   525         aMedia->SetTObjectValueL<TInt>(
   526             TMPXAttribute( KMPXMediaVideoDrmProtected ),
   526             TMPXAttribute( KMPXMediaVideoDrmProtected ),
   527             iVideoPlaybackCtlr->iFileDetails->iDrmProtected );
   527             iVideoPlaybackCtlr->iFileDetails->iDrmProtected );
   528     }
   528     }
       
   529     
       
   530     //
       
   531     //  Description
       
   532     //
       
   533     if ( ( attrV & KMPXMediaVideoDescription.iAttributeId ) &&
       
   534          ( iVideoPlaybackCtlr->iFileDetails->iDescription ) )
       
   535     {
       
   536         aMedia->SetTextValueL(
       
   537             TMPXAttribute( KMPXMediaVideoDescription ),
       
   538             *( iVideoPlaybackCtlr->iFileDetails->iDescription ) );
       
   539     }
       
   540     
       
   541     //
       
   542     //  Location
       
   543     //
       
   544     if ( ( attrV & KMPXMediaVideoLocation.iAttributeId ) &&
       
   545          ( iVideoPlaybackCtlr->iFileDetails->iLocation ) )
       
   546     {
       
   547         aMedia->SetTextValueL(
       
   548             TMPXAttribute( KMPXMediaVideoLocation ),
       
   549             *( iVideoPlaybackCtlr->iFileDetails->iLocation ) );
       
   550     }
       
   551     
       
   552     //
       
   553     //  Copyright
       
   554     //
       
   555     if ( ( attrV & KMPXMediaVideoCopyright.iAttributeId ) &&
       
   556          ( iVideoPlaybackCtlr->iFileDetails->iCopyright ) )
       
   557     {
       
   558         aMedia->SetTextValueL(
       
   559             TMPXAttribute( KMPXMediaVideoCopyright ),
       
   560             *( iVideoPlaybackCtlr->iFileDetails->iCopyright ) );
       
   561     }
       
   562  
       
   563     //
       
   564     //  Language
       
   565     //
       
   566     if ( ( attrV & KMPXMediaVideoLanguage.iAttributeId ) &&
       
   567          ( iVideoPlaybackCtlr->iFileDetails->iLanguage ) )
       
   568     {
       
   569         aMedia->SetTextValueL(
       
   570             TMPXAttribute( KMPXMediaVideoLanguage ),
       
   571             *( iVideoPlaybackCtlr->iFileDetails->iLanguage ) );
       
   572     }
       
   573      
       
   574     //
       
   575     //  Keywords
       
   576     //
       
   577     if ( ( attrV & KMPXMediaVideoKeywords.iAttributeId ) &&
       
   578          ( iVideoPlaybackCtlr->iFileDetails->iKeywords ) )
       
   579     {
       
   580         aMedia->SetTextValueL(
       
   581             TMPXAttribute( KMPXMediaVideoKeywords ),
       
   582             *( iVideoPlaybackCtlr->iFileDetails->iKeywords ) );
       
   583     }        
   529 }
   584 }
   530 
   585 
   531 //  ------------------------------------------------------------------------------------------------
   586 //  ------------------------------------------------------------------------------------------------
   532 //    CMPXVideoPlaybackState::SendErrorToViewL
   587 //    CMPXVideoPlaybackState::SendErrorToViewL
   533 //  ------------------------------------------------------------------------------------------------
   588 //  ------------------------------------------------------------------------------------------------
   667 
   722 
   668 //  ------------------------------------------------------------------------------------------------
   723 //  ------------------------------------------------------------------------------------------------
   669 //    CMPXVideoPlaybackState::IssuePlayCommand()
   724 //    CMPXVideoPlaybackState::IssuePlayCommand()
   670 //  ------------------------------------------------------------------------------------------------
   725 //  ------------------------------------------------------------------------------------------------
   671 void CMPXVideoPlaybackState::IssuePlayCommand( TMPXVideoPlaybackState aState,
   726 void CMPXVideoPlaybackState::IssuePlayCommand( TMPXVideoPlaybackState aState,
   672                                                MMPXPlaybackPluginObserver::TEvent aEvent, 
   727                                                MMPXPlaybackPluginObserver::TEvent aEvent,
   673                                                TBool aSendEvent )
   728                                                TBool aSendEvent )
   674 {
   729 {
   675     MPX_ENTER_EXIT(_L("CMPXVideoPlaybackState::CMPXVideoPlaybackState::IssuePlayCommand()"),
   730     MPX_ENTER_EXIT(_L("CMPXVideoPlaybackState::CMPXVideoPlaybackState::IssuePlayCommand()"),
   676                    _L("aState = %d, aEvent  = %d, aSendEvent = %d"), aState, aEvent, aSendEvent );
   731                    _L("aState = %d, aEvent  = %d, aSendEvent = %d"), aState, aEvent, aSendEvent );
   677 
   732 
   678     MPX_TRAPD( err, iVideoPlaybackCtlr->iPlayer->PlayL() );
   733     MPX_TRAPD( err, iVideoPlaybackCtlr->iPlayer->PlayL() );
   679 
   734 
   680     if ( err == KErrNone )
   735     if ( err == KErrNone )
   681     {
   736     {
   682         iVideoPlaybackCtlr->ChangeState( aState );
   737         iVideoPlaybackCtlr->ChangeState( aState );
   683     
   738 
   684         if ( aSendEvent )
   739         if ( aSendEvent )
   685         {
   740         {
   686             iVideoPlaybackCtlr->iMPXPluginObs->HandlePluginEvent( aEvent, 0, KErrNone );
   741             iVideoPlaybackCtlr->iMPXPluginObs->HandlePluginEvent( aEvent, 0, KErrNone );
   687         }
   742         }
   688     }
   743     }
  1128         //
  1183         //
  1129         //  No need to set position unless it is not 0
  1184         //  No need to set position unless it is not 0
  1130         //
  1185         //
  1131         if ( pos != 0 )
  1186         if ( pos != 0 )
  1132         {
  1187         {
  1133         	iVideoPlaybackCtlr->iPlayer->SetPositionL( pos );
  1188             iVideoPlaybackCtlr->iPlayer->SetPositionL( pos );
  1134         }
  1189         }
  1135     }
  1190     }
  1136     else
  1191     else
  1137     {
  1192     {
  1138         MPX_DEBUG(_L("CMPXInitialisedState::HandleSetPosition() FAIL - file is not seekable"));
  1193         MPX_DEBUG(_L("CMPXInitialisedState::HandleSetPosition() FAIL - file is not seekable"));
  1503                    _L("foreground pause = %d"), iVideoPlaybackCtlr->iForegroundPause );
  1558                    _L("foreground pause = %d"), iVideoPlaybackCtlr->iForegroundPause );
  1504 
  1559 
  1505     if ( iVideoPlaybackCtlr->iForegroundPause )
  1560     if ( iVideoPlaybackCtlr->iForegroundPause )
  1506     {
  1561     {
  1507         iVideoPlaybackCtlr->iState->HandlePlay();
  1562         iVideoPlaybackCtlr->iState->HandlePlay();
       
  1563     }
       
  1564     else
       
  1565     {
       
  1566         iVideoPlaybackCtlr->iPlayer->RefreshFrameL();
  1508     }
  1567     }
  1509 }
  1568 }
  1510 
  1569 
  1511 //  ------------------------------------------------------------------------------------------------
  1570 //  ------------------------------------------------------------------------------------------------
  1512 //    CMPXPausedState::HandleCustomPlay()
  1571 //    CMPXPausedState::HandleCustomPlay()