videoplayback/hbvideoplaybackview/tsrc/testvideoplaybackview/stub/src/mpxvideoviewwrapper.cpp
changeset 46 adbe7d5ba2f5
parent 24 7d93ee07fb27
equal deleted inserted replaced
28:c48470be1ba7 46:adbe7d5ba2f5
    13 *
    13 *
    14 * Description:   Implementation of Video base playback view
    14 * Description:   Implementation of Video base playback view
    15 *
    15 *
    16 */
    16 */
    17 
    17 
    18 // Version : %version: 6 %
    18 // Version : %version: 7 %
    19 
    19 
    20 
    20 
    21 
    21 
    22 //  Include Files
    22 //  Include Files
    23 
    23 
    31 // -------------------------------------------------------------------------------------------------
    31 // -------------------------------------------------------------------------------------------------
    32 // CMPXVideoViewWrapper::CMPXVideoViewWrapper()
    32 // CMPXVideoViewWrapper::CMPXVideoViewWrapper()
    33 // -------------------------------------------------------------------------------------------------
    33 // -------------------------------------------------------------------------------------------------
    34 //
    34 //
    35 CMPXVideoViewWrapper::CMPXVideoViewWrapper( HbVideoBasePlaybackView* aView )
    35 CMPXVideoViewWrapper::CMPXVideoViewWrapper( HbVideoBasePlaybackView* aView )
    36     : iView( aView )    
    36     : iView( aView )
    37 {
    37 {
    38 }
    38 }
    39 
    39 
    40 // -------------------------------------------------------------------------------------------------
    40 // -------------------------------------------------------------------------------------------------
    41 // CMPXVideoViewWrapper::NewL()
    41 // CMPXVideoViewWrapper::NewL()
    56 //   CMPXVideoViewWrapper::ConstructL()
    56 //   CMPXVideoViewWrapper::ConstructL()
    57 // -------------------------------------------------------------------------------------------------
    57 // -------------------------------------------------------------------------------------------------
    58 //
    58 //
    59 void CMPXVideoViewWrapper::ConstructL()
    59 void CMPXVideoViewWrapper::ConstructL()
    60 {
    60 {
    61     iMediaRequested = EFalse;        
    61     iMediaRequested = EFalse;
    62 }
    62 }
    63 
    63 
    64 // -------------------------------------------------------------------------------------------------
    64 // -------------------------------------------------------------------------------------------------
    65 // CMPXVideoViewWrapper::~CMPXVideoViewWrapper()
    65 // CMPXVideoViewWrapper::~CMPXVideoViewWrapper()
    66 // -------------------------------------------------------------------------------------------------
    66 // -------------------------------------------------------------------------------------------------
    82 // CMPXVideoViewWrapper::IsPlaylist()
    82 // CMPXVideoViewWrapper::IsPlaylist()
    83 // -------------------------------------------------------------------------------------------------
    83 // -------------------------------------------------------------------------------------------------
    84 //
    84 //
    85 TBool CMPXVideoViewWrapper::IsPlaylist()
    85 TBool CMPXVideoViewWrapper::IsPlaylist()
    86 {
    86 {
    87     return EFalse;    
    87     return EFalse;
    88 }
    88 }
    89 
    89 
    90 // -------------------------------------------------------------------------------------------------
    90 // -------------------------------------------------------------------------------------------------
    91 //   CMPXVideoViewWrapper::CreateGeneralPlaybackCommandL()
    91 //   CMPXVideoViewWrapper::CreateGeneralPlaybackCommandL()
    92 // -------------------------------------------------------------------------------------------------
    92 // -------------------------------------------------------------------------------------------------
   100 //   CMPXVideoViewWrapper::HandleCommandL()
   100 //   CMPXVideoViewWrapper::HandleCommandL()
   101 // -------------------------------------------------------------------------------------------------
   101 // -------------------------------------------------------------------------------------------------
   102 //
   102 //
   103 void CMPXVideoViewWrapper::HandleCommandL( TInt aCommand )
   103 void CMPXVideoViewWrapper::HandleCommandL( TInt aCommand )
   104 {
   104 {
   105     switch ( aCommand )
   105     iCommand = aCommand;
   106     {
       
   107         case EMPXPbvCmdNextListItem:
       
   108         {
       
   109             SetFileDetails( EFalse );            
       
   110             break;    
       
   111         }
       
   112         
       
   113         case EMPXPbvCmdPreviousListItem:
       
   114         {
       
   115             SetFileDetails( ETrue );  
       
   116             break;    
       
   117         }
       
   118     }
       
   119 
       
   120 }
   106 }
   121 
   107 
   122 // -------------------------------------------------------------------------------------------------
   108 // -------------------------------------------------------------------------------------------------
   123 // Request for the media object
   109 // Request for the media object
   124 // -------------------------------------------------------------------------------------------------
   110 // -------------------------------------------------------------------------------------------------
   125 //
   111 //
   126 void CMPXVideoViewWrapper::RequestMediaL()
   112 void CMPXVideoViewWrapper::RequestMediaL()
   127 {
   113 {
   128     iMediaRequested = ETrue;
   114     iMediaRequested = ETrue;
   129     
   115 
   130     SetFileDetails( ETrue );
   116     SetFileDetails( ETrue );
   131     
   117 
   132 }
   118 }
   133 
       
   134 
   119 
   135 // -------------------------------------------------------------------------------------------------
   120 // -------------------------------------------------------------------------------------------------
   136 //   CMPXVideoViewWrapper::ActivateClosePlayerActiveObject
   121 //   CMPXVideoViewWrapper::ActivateClosePlayerActiveObject
   137 // -------------------------------------------------------------------------------------------------
   122 // -------------------------------------------------------------------------------------------------
   138 //
   123 //
   159     if ( iFileDetails )
   144     if ( iFileDetails )
   160     {
   145     {
   161         delete iFileDetails;
   146         delete iFileDetails;
   162         iFileDetails = NULL;
   147         iFileDetails = NULL;
   163     }
   148     }
   164     
   149 
   165     iFileDetails = new QMPXVideoPlaybackViewFileDetails(); 
   150     iFileDetails = new QMPXVideoPlaybackViewFileDetails();
   166     
   151 
   167     
   152     _LIT(KTestMimeType, "video/3gp");
   168     _LIT(KTestMimeType, "video/3gp");        
       
   169     const QString qMimeType( (QChar*)KTestMimeType().Ptr(), KTestMimeType().Length() );
   153     const QString qMimeType( (QChar*)KTestMimeType().Ptr(), KTestMimeType().Length() );
   170     iFileDetails->mMimeType = qMimeType;   
   154     iFileDetails->mMimeType = qMimeType;
   171     
   155 
   172     
       
   173     _LIT(KTestTitle, "Test Video Title");
   156     _LIT(KTestTitle, "Test Video Title");
   174     const QString qTitle( (QChar*)KTestTitle().Ptr(), KTestTitle().Length() );
   157     const QString qTitle( (QChar*)KTestTitle().Ptr(), KTestTitle().Length() );
   175     iFileDetails->mTitle = qTitle;    
   158     iFileDetails->mTitle = qTitle;
   176     
   159 
   177     
       
   178     _LIT(KTestArtist, "TestArtist");
   160     _LIT(KTestArtist, "TestArtist");
   179     const QString qArtist( (QChar*)KTestArtist().Ptr(), KTestArtist().Length() );
   161     const QString qArtist( (QChar*)KTestArtist().Ptr(), KTestArtist().Length() );
   180     iFileDetails->mArtist = qArtist;
   162     iFileDetails->mArtist = qArtist;
   181     
   163 
   182     
       
   183     _LIT(KTestDescription, "Test Description");
   164     _LIT(KTestDescription, "Test Description");
   184     const QString qDescription( (QChar*)KTestDescription().Ptr(), KTestDescription().Length() );
   165     const QString qDescription( (QChar*)KTestDescription().Ptr(), KTestDescription().Length() );
   185     iFileDetails->mDescription = qDescription;
   166     iFileDetails->mDescription = qDescription;
   186 
   167 
   187 
       
   188     _LIT(KTestLocation, "Test Location");
   168     _LIT(KTestLocation, "Test Location");
   189     const QString qLocation( (QChar*)KTestLocation().Ptr(), KTestLocation().Length() );
   169     const QString qLocation( (QChar*)KTestLocation().Ptr(), KTestLocation().Length() );
   190     iFileDetails->mLocation = qLocation;
   170     iFileDetails->mLocation = qLocation;
   191 
   171 
   192 
       
   193     _LIT(KTestCopyright, "Test Copyright");
   172     _LIT(KTestCopyright, "Test Copyright");
   194     const QString qCopyright( (QChar*)KTestCopyright().Ptr(), KTestCopyright().Length() );
   173     const QString qCopyright( (QChar*)KTestCopyright().Ptr(), KTestCopyright().Length() );
   195     iFileDetails->mCopyright = qCopyright;
   174     iFileDetails->mCopyright = qCopyright;
   196 
   175 
   197 
       
   198     _LIT(KTestLanguage, "Test Language");
   176     _LIT(KTestLanguage, "Test Language");
   199     const QString qLanguage( (QChar*)KTestLanguage().Ptr(), KTestLanguage().Length() );
   177     const QString qLanguage( (QChar*)KTestLanguage().Ptr(), KTestLanguage().Length() );
   200     iFileDetails->mLanguage = qLanguage;
   178     iFileDetails->mLanguage = qLanguage;
   201 
   179 
   202 
       
   203     _LIT(KTestKeywords, "Test Keywords");
   180     _LIT(KTestKeywords, "Test Keywords");
   204     const QString qKeywords( (QChar*)KTestKeywords().Ptr(), KTestKeywords().Length() );
   181     const QString qKeywords( (QChar*)KTestKeywords().Ptr(), KTestKeywords().Length() );
   205     iFileDetails->mKeywords = qKeywords;
   182     iFileDetails->mKeywords = qKeywords;
   206 
       
   207 
   183 
   208     if ( aDefault )
   184     if ( aDefault )
   209     {
   185     {
   210         _LIT(KTestClipName, "testClip.3gp");
   186         _LIT(KTestClipName, "testClip.3gp");
   211         const QString qClipname( (QChar*)KTestClipName().Ptr(), KTestClipName().Length() );
   187         const QString qClipname( (QChar*)KTestClipName().Ptr(), KTestClipName().Length() );
   212         iFileDetails->mClipName = qClipname;        
   188         iFileDetails->mClipName = qClipname;
   213     }
   189     }
   214     else
   190     else
   215     {
   191     {
   216         _LIT(KTestClipName, "nextClip.3gp");
   192         _LIT(KTestClipName, "nextClip.3gp");
   217         const QString qClipname( (QChar*)KTestClipName().Ptr(), KTestClipName().Length() );
   193         const QString qClipname( (QChar*)KTestClipName().Ptr(), KTestClipName().Length() );
   218         iFileDetails->mClipName = qClipname;        
   194         iFileDetails->mClipName = qClipname;
   219     }
   195     }
   220     
   196 
   221     
       
   222     iFileDetails->mPlaybackMode = EMPXVideoLocal;
   197     iFileDetails->mPlaybackMode = EMPXVideoLocal;
   223     iFileDetails->mSeekable = true;
   198     iFileDetails->mSeekable = true;
   224     iFileDetails->mPausableStream = true;
   199     iFileDetails->mPausableStream = true;
   225     iFileDetails->mAudioEnabled = true;
   200     iFileDetails->mAudioEnabled = true;
   226     iFileDetails->mVideoEnabled = true;
   201     iFileDetails->mVideoEnabled = true;
   230     iFileDetails->mTvOutConnected  = false;
   205     iFileDetails->mTvOutConnected  = false;
   231     iFileDetails->mDrmProtected = false;
   206     iFileDetails->mDrmProtected = false;
   232     iFileDetails->mMultiItemPlaylist = false;
   207     iFileDetails->mMultiItemPlaylist = false;
   233     iFileDetails->mVideoHeight = 320;
   208     iFileDetails->mVideoHeight = 320;
   234     iFileDetails->mVideoWidth  = 240;
   209     iFileDetails->mVideoWidth  = 240;
   235     iFileDetails->mBitRate = 16000;         
   210     iFileDetails->mBitRate = 16000;
   236 }
   211 }
   237 
   212 
   238 // -------------------------------------------------------------------------------------------------
   213 // -------------------------------------------------------------------------------------------------
   239 //   CMPXVideoViewWrapper::IssueVideoAppForegroundCmd()
   214 //   CMPXVideoViewWrapper::IssueVideoAppForegroundCmd()
   240 // -------------------------------------------------------------------------------------------------
   215 // -------------------------------------------------------------------------------------------------