videoplayback/hbvideoplaybackview/tsrc/testvideoplaybackview/stub/src/mpxvideoviewwrapper.cpp
changeset 52 e3cecb93e76a
parent 47 45e72b57a2fd
child 59 a76e86df7ccd
equal deleted inserted replaced
47:45e72b57a2fd 52:e3cecb93e76a
     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: 7 %
       
    19 
       
    20 
       
    21 
       
    22 //  Include Files
       
    23 
       
    24 #include "mpxvideoviewwrapper.h"
       
    25 #include "hbvideobaseplaybackview.h"
       
    26 #include "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::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     iCommand = aCommand;
       
   106 }
       
   107 
       
   108 // -------------------------------------------------------------------------------------------------
       
   109 // Request for the media object
       
   110 // -------------------------------------------------------------------------------------------------
       
   111 //
       
   112 void CMPXVideoViewWrapper::RequestMediaL()
       
   113 {
       
   114     iMediaRequested = ETrue;
       
   115 
       
   116     SetFileDetails( ETrue );
       
   117 
       
   118 }
       
   119 
       
   120 // -------------------------------------------------------------------------------------------------
       
   121 //   CMPXVideoViewWrapper::ActivateClosePlayerActiveObject
       
   122 // -------------------------------------------------------------------------------------------------
       
   123 //
       
   124 void CMPXVideoViewWrapper::ActivateClosePlayerActiveObject()
       
   125 {
       
   126     iClosePlayerAO = ETrue;
       
   127 }
       
   128 
       
   129 // -------------------------------------------------------------------------------------------------
       
   130 //   CMPXVideoViewWrapper::IsMultiItemPlaylist()
       
   131 // -------------------------------------------------------------------------------------------------
       
   132 //
       
   133 TBool CMPXVideoViewWrapper::IsMultiItemPlaylist()
       
   134 {
       
   135     return iFileDetails->mMultiItemPlaylist;
       
   136 }
       
   137 
       
   138 // -------------------------------------------------------------------------------------------------
       
   139 //   CMPXVideoViewWrapper::SetFileDetails()
       
   140 // -------------------------------------------------------------------------------------------------
       
   141 //
       
   142 void CMPXVideoViewWrapper::SetFileDetails(TBool aDefault)
       
   143 {
       
   144     if ( iFileDetails )
       
   145     {
       
   146         delete iFileDetails;
       
   147         iFileDetails = NULL;
       
   148     }
       
   149 
       
   150     iFileDetails = new QMPXVideoPlaybackViewFileDetails();
       
   151 
       
   152     _LIT(KTestMimeType, "video/3gp");
       
   153     const QString qMimeType( (QChar*)KTestMimeType().Ptr(), KTestMimeType().Length() );
       
   154     iFileDetails->mMimeType = qMimeType;
       
   155 
       
   156     _LIT(KTestTitle, "Test Video Title");
       
   157     const QString qTitle( (QChar*)KTestTitle().Ptr(), KTestTitle().Length() );
       
   158     iFileDetails->mTitle = qTitle;
       
   159 
       
   160     _LIT(KTestArtist, "TestArtist");
       
   161     const QString qArtist( (QChar*)KTestArtist().Ptr(), KTestArtist().Length() );
       
   162     iFileDetails->mArtist = qArtist;
       
   163 
       
   164     _LIT(KTestDescription, "Test Description");
       
   165     const QString qDescription( (QChar*)KTestDescription().Ptr(), KTestDescription().Length() );
       
   166     iFileDetails->mDescription = qDescription;
       
   167 
       
   168     _LIT(KTestLocation, "Test Location");
       
   169     const QString qLocation( (QChar*)KTestLocation().Ptr(), KTestLocation().Length() );
       
   170     iFileDetails->mLocation = qLocation;
       
   171 
       
   172     _LIT(KTestCopyright, "Test Copyright");
       
   173     const QString qCopyright( (QChar*)KTestCopyright().Ptr(), KTestCopyright().Length() );
       
   174     iFileDetails->mCopyright = qCopyright;
       
   175 
       
   176     _LIT(KTestLanguage, "Test Language");
       
   177     const QString qLanguage( (QChar*)KTestLanguage().Ptr(), KTestLanguage().Length() );
       
   178     iFileDetails->mLanguage = qLanguage;
       
   179 
       
   180     _LIT(KTestKeywords, "Test Keywords");
       
   181     const QString qKeywords( (QChar*)KTestKeywords().Ptr(), KTestKeywords().Length() );
       
   182     iFileDetails->mKeywords = qKeywords;
       
   183 
       
   184     if ( aDefault )
       
   185     {
       
   186         _LIT(KTestClipName, "testClip.3gp");
       
   187         const QString qClipname( (QChar*)KTestClipName().Ptr(), KTestClipName().Length() );
       
   188         iFileDetails->mClipName = qClipname;
       
   189     }
       
   190     else
       
   191     {
       
   192         _LIT(KTestClipName, "nextClip.3gp");
       
   193         const QString qClipname( (QChar*)KTestClipName().Ptr(), KTestClipName().Length() );
       
   194         iFileDetails->mClipName = qClipname;
       
   195     }
       
   196 
       
   197     iFileDetails->mPlaybackMode = EMPXVideoLocal;
       
   198     iFileDetails->mSeekable = true;
       
   199     iFileDetails->mPausableStream = true;
       
   200     iFileDetails->mAudioEnabled = true;
       
   201     iFileDetails->mVideoEnabled = true;
       
   202     iFileDetails->mPartialPlayback = false;
       
   203     iFileDetails->mRNFormat = false;
       
   204     iFileDetails->mDuration = 100;
       
   205     iFileDetails->mTvOutConnected  = false;
       
   206     iFileDetails->mDrmProtected = false;
       
   207     iFileDetails->mMultiItemPlaylist = false;
       
   208     iFileDetails->mVideoHeight = 320;
       
   209     iFileDetails->mVideoWidth  = 240;
       
   210     iFileDetails->mBitRate = 16000;
       
   211 }
       
   212 
       
   213 // -------------------------------------------------------------------------------------------------
       
   214 //   CMPXVideoViewWrapper::IssueVideoAppForegroundCmd()
       
   215 // -------------------------------------------------------------------------------------------------
       
   216 //
       
   217 void CMPXVideoViewWrapper::IssueVideoAppForegroundCmdL( TBool aForeground )
       
   218 {
       
   219     iForeground = aForeground;
       
   220 }
       
   221 
       
   222 // EOF