videoplayerapp/videoplayerengine/src/mpxvideoplaybackwrapper.cpp
changeset 15 cf5481c2bc0b
child 17 69946d1824c4
equal deleted inserted replaced
2:dec420019252 15:cf5481c2bc0b
       
     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:  Implimentation of QMpxVideoPlaybackWrapper
       
    15 *
       
    16 */
       
    17 
       
    18 // Version : %version:  3 %
       
    19 
       
    20 
       
    21 #include "mpxvideo_debug.h"
       
    22 #include "mpxvideoplaybackwrapper.h"
       
    23 #include "mpxvideoplayerappuiengine.h"
       
    24 
       
    25 
       
    26 // -------------------------------------------------------------------------------------------------
       
    27 //   QMpxVideoPlaybackWrapper::QMpxVideoPlaybackWrapper()
       
    28 // -------------------------------------------------------------------------------------------------
       
    29 //
       
    30 QMpxVideoPlaybackWrapper::QMpxVideoPlaybackWrapper()
       
    31 {
       
    32     MPX_ENTER_EXIT(_L("QMpxVideoPlaybackWrapper::QMpxVideoPlaybackWrapper()"));
       
    33 
       
    34     initializePlugins();
       
    35 }
       
    36 
       
    37 // -------------------------------------------------------------------------------------------------
       
    38 //   QMpxVideoPlaybackWrapper::~QMpxVideoPlaybackWrapper()
       
    39 // -------------------------------------------------------------------------------------------------
       
    40 //
       
    41 QMpxVideoPlaybackWrapper::~QMpxVideoPlaybackWrapper()
       
    42 {
       
    43     MPX_ENTER_EXIT(_L("QMpxVideoPlaybackWrapper::~QMpxVideoPlaybackWrapper()"));
       
    44 
       
    45     if ( mUiEngine ) 
       
    46     {
       
    47         delete mUiEngine;
       
    48         mUiEngine = NULL;
       
    49     }        
       
    50 }
       
    51 
       
    52 // -------------------------------------------------------------------------------------------------
       
    53 //   QMpxVideoPlaybackWrapper::initializePlugins()
       
    54 // -------------------------------------------------------------------------------------------------
       
    55 //
       
    56 void QMpxVideoPlaybackWrapper::initializePlugins()
       
    57 {
       
    58     MPX_ENTER_EXIT(_L("QMpxVideoPlaybackWrapper::initializePlugins()"));
       
    59 
       
    60     TRAPD( err, mUiEngine = CMpxVideoPlayerAppUiEngine::NewL( this ) );
       
    61     MPX_DEBUG(_L("QMpxVideoPlaybackWrapper::initializePlugins err = %d"), err);
       
    62 }
       
    63 
       
    64 // -------------------------------------------------------------------------------------------------
       
    65 //   QMpxVideoPlaybackWrapper::playMedia()
       
    66 // -------------------------------------------------------------------------------------------------
       
    67 //
       
    68 int QMpxVideoPlaybackWrapper::playMedia( QString aFileName )
       
    69 {
       
    70     MPX_ENTER_EXIT(_L("QMpxVideoPlaybackWrapper::playMedia"));
       
    71 
       
    72     TBuf<KMaxFileName> filename( aFileName.utf16() );
       
    73     TRAPD( error, mUiEngine->OpenFileL( filename ) );
       
    74 
       
    75     MPX_DEBUG(_L("QMpxVideoPlaybackWrapper::playMedia err = %d"), error);
       
    76 
       
    77     return error;
       
    78 }
       
    79 
       
    80 // -------------------------------------------------------------------------------------------------
       
    81 //   QMpxVideoPlaybackWrapper::openPlaybackView()
       
    82 // -------------------------------------------------------------------------------------------------
       
    83 //
       
    84 void QMpxVideoPlaybackWrapper::openPlaybackView()
       
    85 {
       
    86     MPX_ENTER_EXIT(_L("QMpxVideoPlaybackWrapper::openPlaybackView()"));
       
    87 
       
    88     emit handlePlaybackView( MpxHbVideoCommon::ActivatePlaybackView );
       
    89 }
       
    90 
       
    91 // -------------------------------------------------------------------------------------------------
       
    92 //   QMpxVideoPlaybackWrapper::postInit()
       
    93 // -------------------------------------------------------------------------------------------------
       
    94 //
       
    95 void QMpxVideoPlaybackWrapper::lateInit()
       
    96 {
       
    97     MPX_ENTER_EXIT(_L("QMpxVideoPlaybackWrapper::postInit()"));
       
    98     
       
    99     TRAP_IGNORE( mUiEngine->LateInitL() );
       
   100 }
       
   101 
       
   102 // End of File