videoplayback/videoplaybackview/tsrc/testvideodisplayhandler/stub/src/mpxvideoviewwrapper.cpp
changeset 44 518105d52e45
child 50 21fe8338c6bf
equal deleted inserted replaced
42:17f382c040b1 44:518105d52e45
       
     1 /*
       
     2 * Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
       
     3 * All rights reserved.
       
     4 * This component and the accompanying materials are made available
       
     5 * under the terms of "Eclipse Public License v1.0"
       
     6 * which accompanies this distribution, and is available
       
     7 * at the URL "http://www.eclipse.org/legal/epl-v10.html".
       
     8 *
       
     9 * Initial Contributors:
       
    10 * Nokia Corporation - initial contribution.
       
    11 *
       
    12 * Contributors:
       
    13 *
       
    14 * Description:   Implementation of Video base playback view
       
    15 *
       
    16 */
       
    17 
       
    18 // Version : %version: 6 %
       
    19 
       
    20 
       
    21 
       
    22 //  Include Files
       
    23 
       
    24 #include "mpxvideoviewwrapper.h"
       
    25 #include "videobaseplaybackview.h"
       
    26 #include "videoplaybackviewfiledetails.h"
       
    27 #include "mpxcommonvideoplaybackview.hrh"
       
    28 
       
    29 //  Member Functions
       
    30 
       
    31 // -------------------------------------------------------------------------------------------------
       
    32 // CMPXVideoViewWrapper::CMPXVideoViewWrapper()
       
    33 // -------------------------------------------------------------------------------------------------
       
    34 //
       
    35 CMPXVideoViewWrapper::CMPXVideoViewWrapper( VideoBasePlaybackView* aView )
       
    36     : iView( aView )    
       
    37 {
       
    38 }
       
    39 
       
    40 // -------------------------------------------------------------------------------------------------
       
    41 // CMPXVideoViewWrapper::NewL()
       
    42 // -------------------------------------------------------------------------------------------------
       
    43 //
       
    44 CMPXVideoViewWrapper* CMPXVideoViewWrapper::NewL( VideoBasePlaybackView* aView )
       
    45 {
       
    46     CMPXVideoViewWrapper* self = new (ELeave) CMPXVideoViewWrapper( aView );
       
    47 
       
    48     CleanupStack::PushL( self );
       
    49     self->ConstructL();
       
    50     CleanupStack::Pop();
       
    51 
       
    52     return self;
       
    53 }
       
    54 
       
    55 // -------------------------------------------------------------------------------------------------
       
    56 //   CMPXVideoViewWrapper::ConstructL()
       
    57 // -------------------------------------------------------------------------------------------------
       
    58 //
       
    59 void CMPXVideoViewWrapper::ConstructL()
       
    60 {
       
    61     iMediaRequested = EFalse;        
       
    62 }
       
    63 
       
    64 // -------------------------------------------------------------------------------------------------
       
    65 // CMPXVideoViewWrapper::~CMPXVideoViewWrapper()
       
    66 // -------------------------------------------------------------------------------------------------
       
    67 //
       
    68 CMPXVideoViewWrapper::~CMPXVideoViewWrapper()
       
    69 {
       
    70 }
       
    71 
       
    72 // -------------------------------------------------------------------------------------------------
       
    73 // CMPXVideoViewWrapper::IsLive()
       
    74 // -------------------------------------------------------------------------------------------------
       
    75 //
       
    76 TBool CMPXVideoViewWrapper::IsLive()
       
    77 {
       
    78     return EFalse;
       
    79 }
       
    80 
       
    81 // -------------------------------------------------------------------------------------------------
       
    82 // CMPXVideoViewWrapper::IsPlaylist()
       
    83 // -------------------------------------------------------------------------------------------------
       
    84 //
       
    85 TBool CMPXVideoViewWrapper::IsPlaylist()
       
    86 {
       
    87     return EFalse;    
       
    88 }
       
    89 
       
    90 // -------------------------------------------------------------------------------------------------
       
    91 //   CMPXVideoViewWrapper::CreateGeneralPlaybackCommandL()
       
    92 // -------------------------------------------------------------------------------------------------
       
    93 //
       
    94 void CMPXVideoViewWrapper::CreateGeneralPlaybackCommandL( int aCmd )
       
    95 {
       
    96     Q_UNUSED( aCmd );
       
    97 }
       
    98 
       
    99 // -------------------------------------------------------------------------------------------------
       
   100 //   CMPXVideoViewWrapper::HandleCommandL()
       
   101 // -------------------------------------------------------------------------------------------------
       
   102 //
       
   103 void CMPXVideoViewWrapper::HandleCommandL( TInt aCommand )
       
   104 {
       
   105     switch ( 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 }
       
   121 
       
   122 // -------------------------------------------------------------------------------------------------
       
   123 // Request for the media object
       
   124 // -------------------------------------------------------------------------------------------------
       
   125 //
       
   126 void CMPXVideoViewWrapper::RequestMediaL()
       
   127 {
       
   128     iMediaRequested = ETrue;
       
   129     
       
   130     SetFileDetails( ETrue );
       
   131     
       
   132 }
       
   133 
       
   134 
       
   135 // -------------------------------------------------------------------------------------------------
       
   136 //   CMPXVideoViewWrapper::ActivateClosePlayerActiveObject
       
   137 // -------------------------------------------------------------------------------------------------
       
   138 //
       
   139 void CMPXVideoViewWrapper::ActivateClosePlayerActiveObject()
       
   140 {
       
   141     iClosePlayerAO = ETrue;
       
   142 }
       
   143 
       
   144 // -------------------------------------------------------------------------------------------------
       
   145 //   CMPXVideoViewWrapper::IsMultiItemPlaylist()
       
   146 // -------------------------------------------------------------------------------------------------
       
   147 //
       
   148 TBool CMPXVideoViewWrapper::IsMultiItemPlaylist()
       
   149 {
       
   150     return iFileDetails->mMultiItemPlaylist;
       
   151 }
       
   152 
       
   153 // -------------------------------------------------------------------------------------------------
       
   154 //   CMPXVideoViewWrapper::SetFileDetails()
       
   155 // -------------------------------------------------------------------------------------------------
       
   156 //
       
   157 void CMPXVideoViewWrapper::SetFileDetails(TBool aDefault)
       
   158 {
       
   159     if ( iFileDetails )
       
   160     {
       
   161         delete iFileDetails;
       
   162         iFileDetails = NULL;
       
   163     }
       
   164     
       
   165     iFileDetails = new VideoPlaybackViewFileDetails(); 
       
   166  
       
   167     _LIT(KTestMimeType, "video/3gp");        
       
   168     const QString qMimeType( (QChar*)KTestMimeType().Ptr(), KTestMimeType().Length() );
       
   169     iFileDetails->mMimeType = qMimeType;   
       
   170 
       
   171     _LIT(KTestTitle, "Test Video Title");
       
   172     const QString qTitle( (QChar*)KTestTitle().Ptr(), KTestTitle().Length() );
       
   173     iFileDetails->mTitle = qTitle;    
       
   174 
       
   175     _LIT(KTestArtist, "TestArtist");
       
   176     const QString qArtist( (QChar*)KTestArtist().Ptr(), KTestArtist().Length() );
       
   177     iFileDetails->mArtist = qArtist;
       
   178 
       
   179     _LIT(KTestDescription, "Test Description");
       
   180     const QString qDescription( (QChar*)KTestDescription().Ptr(), KTestDescription().Length() );
       
   181     iFileDetails->mDescription = qDescription;
       
   182 
       
   183     _LIT(KTestLocation, "Test Location");
       
   184     const QString qLocation( (QChar*)KTestLocation().Ptr(), KTestLocation().Length() );
       
   185     iFileDetails->mLocation = qLocation;
       
   186 
       
   187     _LIT(KTestCopyright, "Test Copyright");
       
   188     const QString qCopyright( (QChar*)KTestCopyright().Ptr(), KTestCopyright().Length() );
       
   189     iFileDetails->mCopyright = qCopyright;
       
   190 
       
   191     _LIT(KTestLanguage, "Test Language");
       
   192     const QString qLanguage( (QChar*)KTestLanguage().Ptr(), KTestLanguage().Length() );
       
   193     iFileDetails->mLanguage = qLanguage;
       
   194 
       
   195     _LIT(KTestKeywords, "Test Keywords");
       
   196     const QString qKeywords( (QChar*)KTestKeywords().Ptr(), KTestKeywords().Length() );
       
   197     iFileDetails->mKeywords = qKeywords;
       
   198 
       
   199     if ( aDefault )
       
   200     {
       
   201         _LIT(KTestClipName, "testClip.3gp");
       
   202         const QString qClipname( (QChar*)KTestClipName().Ptr(), KTestClipName().Length() );
       
   203         iFileDetails->mClipName = qClipname;        
       
   204     }
       
   205     else
       
   206     {
       
   207         _LIT(KTestClipName, "nextClip.3gp");
       
   208         const QString qClipname( (QChar*)KTestClipName().Ptr(), KTestClipName().Length() );
       
   209         iFileDetails->mClipName = qClipname;        
       
   210     }
       
   211     
       
   212     
       
   213     iFileDetails->mPlaybackMode = EMPXVideoLocal;
       
   214     iFileDetails->mSeekable = true;
       
   215     iFileDetails->mPausableStream = true;
       
   216     iFileDetails->mAudioEnabled = true;
       
   217     iFileDetails->mVideoEnabled = true;
       
   218     iFileDetails->mPartialPlayback = false;
       
   219     iFileDetails->mRNFormat = false;
       
   220     iFileDetails->mDuration = 100;
       
   221     iFileDetails->mTvOutConnected  = false;
       
   222     iFileDetails->mDrmProtected = false;
       
   223     iFileDetails->mMultiItemPlaylist = false;
       
   224     iFileDetails->mVideoHeight = 320;
       
   225     iFileDetails->mVideoWidth  = 240;
       
   226     iFileDetails->mBitRate = 16000;         
       
   227 }
       
   228 
       
   229 // -------------------------------------------------------------------------------------------------
       
   230 //   CMPXVideoViewWrapper::IssueVideoAppForegroundCmd()
       
   231 // -------------------------------------------------------------------------------------------------
       
   232 //
       
   233 void CMPXVideoViewWrapper::IssueVideoAppForegroundCmdL( TBool aForeground )
       
   234 {
       
   235     iForeground = aForeground;
       
   236 }
       
   237 
       
   238 
       
   239 // -------------------------------------------------------------------------------------------------
       
   240 //   CMPXVideoViewWrapper::UpdateVideoRectDone()
       
   241 // -------------------------------------------------------------------------------------------------
       
   242 //
       
   243 void CMPXVideoViewWrapper::UpdateVideoRectDone()
       
   244 {
       
   245 }
       
   246 // EOF