videoplayback/hbvideoplaybackview/tsrc/teststatuspanecontrol/stub/src/mpxvideoviewwrapper.cpp
changeset 35 3738fe97f027
parent 34 bbb98528c666
child 36 8aed59de29f9
equal deleted inserted replaced
34:bbb98528c666 35:3738fe97f027
     1 /*
       
     2 * Copyright (c) 2010 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:  1 %
       
    19 
       
    20 
       
    21 
       
    22 //  Include Files
       
    23 
       
    24 #include "../inc/mpxvideoviewwrapper.h"
       
    25 #include "../inc/hbvideobaseplaybackview.h"
       
    26 #include "../inc/mpxvideoplaybackviewfiledetails.h"
       
    27 #include "mpxcommonvideoplaybackview.hrh"
       
    28 
       
    29 //  Member Functions
       
    30 
       
    31 // -------------------------------------------------------------------------------------------------
       
    32 // CMPXVideoViewWrapper::CMPXVideoViewWrapper()
       
    33 // -------------------------------------------------------------------------------------------------
       
    34 //
       
    35 CMPXVideoViewWrapper::CMPXVideoViewWrapper( HbVideoBasePlaybackView* aView )
       
    36     : iView( aView )    
       
    37 {
       
    38 }
       
    39 
       
    40 // -------------------------------------------------------------------------------------------------
       
    41 // CMPXVideoViewWrapper::NewL()
       
    42 // -------------------------------------------------------------------------------------------------
       
    43 //
       
    44 CMPXVideoViewWrapper* CMPXVideoViewWrapper::NewL( HbVideoBasePlaybackView* 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::HandleCommandL()
       
    92 // -------------------------------------------------------------------------------------------------
       
    93 //
       
    94 void CMPXVideoViewWrapper::HandleCommandL( TInt aCommand )
       
    95 {
       
    96     switch ( aCommand )
       
    97     {
       
    98         case EMPXPbvCmdNextListItem:
       
    99         {
       
   100             SetFileDetails( EFalse );            
       
   101             break;    
       
   102         }
       
   103         
       
   104         case EMPXPbvCmdPreviousListItem:
       
   105         {
       
   106             SetFileDetails( ETrue );  
       
   107             break;    
       
   108         }
       
   109     }
       
   110 
       
   111 }
       
   112 
       
   113 // -------------------------------------------------------------------------------------------------
       
   114 // Request for the media object
       
   115 // -------------------------------------------------------------------------------------------------
       
   116 //
       
   117 void CMPXVideoViewWrapper::RequestMediaL()
       
   118 {
       
   119     iMediaRequested = ETrue;
       
   120     
       
   121     SetFileDetails( ETrue );
       
   122     
       
   123 }
       
   124 
       
   125 
       
   126 // -------------------------------------------------------------------------------------------------
       
   127 //   CMPXVideoViewWrapper::ActivateClosePlayerActiveObject
       
   128 // -------------------------------------------------------------------------------------------------
       
   129 //
       
   130 void CMPXVideoViewWrapper::ActivateClosePlayerActiveObject()
       
   131 {
       
   132     iClosePlayerAO = ETrue;
       
   133 }
       
   134 
       
   135 // -------------------------------------------------------------------------------------------------
       
   136 //   CMPXVideoViewWrapper::IsMultiItemPlaylist()
       
   137 // -------------------------------------------------------------------------------------------------
       
   138 //
       
   139 TBool CMPXVideoViewWrapper::IsMultiItemPlaylist()
       
   140 {
       
   141     return iFileDetails->mMultiItemPlaylist;
       
   142 }
       
   143 
       
   144 // -------------------------------------------------------------------------------------------------
       
   145 //   CMPXVideoViewWrapper::SetFileDetails()
       
   146 // -------------------------------------------------------------------------------------------------
       
   147 //
       
   148 void CMPXVideoViewWrapper::SetFileDetails(TBool aDefault)
       
   149 {
       
   150     if ( iFileDetails )
       
   151     {
       
   152         delete iFileDetails;
       
   153         iFileDetails = NULL;
       
   154     }
       
   155     
       
   156     iFileDetails = new QMPXVideoPlaybackViewFileDetails(); 
       
   157     
       
   158     
       
   159     _LIT(KTestMimeType, "video/3gp");        
       
   160     const QString qMimeType( (QChar*)KTestMimeType().Ptr(), KTestMimeType().Length() );
       
   161     iFileDetails->mMimeType = qMimeType;   
       
   162     
       
   163     
       
   164     _LIT(KTestTitle, "Test Video Title");
       
   165     const QString qTitle( (QChar*)KTestTitle().Ptr(), KTestTitle().Length() );
       
   166     iFileDetails->mTitle = qTitle;    
       
   167     
       
   168     
       
   169     _LIT(KTestArtist, "TestArtist");
       
   170     const QString qArtist( (QChar*)KTestArtist().Ptr(), KTestArtist().Length() );
       
   171     iFileDetails->mArtist = qArtist;
       
   172     
       
   173     
       
   174     _LIT(KTestDescription, "Test Description");
       
   175     const QString qDescription( (QChar*)KTestDescription().Ptr(), KTestDescription().Length() );
       
   176     iFileDetails->mDescription = qDescription;
       
   177 
       
   178 
       
   179     _LIT(KTestLocation, "Test Location");
       
   180     const QString qLocation( (QChar*)KTestLocation().Ptr(), KTestLocation().Length() );
       
   181     iFileDetails->mLocation = qLocation;
       
   182 
       
   183 
       
   184     _LIT(KTestCopyright, "Test Copyright");
       
   185     const QString qCopyright( (QChar*)KTestCopyright().Ptr(), KTestCopyright().Length() );
       
   186     iFileDetails->mCopyright = qCopyright;
       
   187 
       
   188 
       
   189     _LIT(KTestLanguage, "Test Language");
       
   190     const QString qLanguage( (QChar*)KTestLanguage().Ptr(), KTestLanguage().Length() );
       
   191     iFileDetails->mLanguage = qLanguage;
       
   192 
       
   193 
       
   194     _LIT(KTestKeywords, "Test Keywords");
       
   195     const QString qKeywords( (QChar*)KTestKeywords().Ptr(), KTestKeywords().Length() );
       
   196     iFileDetails->mKeywords = qKeywords;
       
   197 
       
   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->mTvOutPlayAllowed = true;
       
   223     iFileDetails->mDrmProtected = false;
       
   224     iFileDetails->mMultiItemPlaylist = false;
       
   225     iFileDetails->mVideoHeight = 320;
       
   226     iFileDetails->mVideoWidth  = 240;
       
   227     iFileDetails->mBitRate = 16000;         
       
   228 }
       
   229 
       
   230 // -------------------------------------------------------------------------------------------------
       
   231 //   CMPXVideoViewWrapper::IssueVideoAppForegroundCmd()
       
   232 // -------------------------------------------------------------------------------------------------
       
   233 //
       
   234 void CMPXVideoViewWrapper::IssueVideoAppForegroundCmdL( TBool aForeground )
       
   235 {
       
   236     iForeground = aForeground;
       
   237 }
       
   238 
       
   239 // EOF