videoplayback/hbvideoplaybackview/tsrc/testvideoplaybackcontrolscontroller/stub/src/mpxvideoplaybackcontrolpolicy.cpp
changeset 44 518105d52e45
parent 42 17f382c040b1
child 49 824471cb468a
equal deleted inserted replaced
42:17f382c040b1 44:518105d52e45
     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 MPXVideoPlaybackControlPolicy
       
    15 *
       
    16 */
       
    17 
       
    18 // Version : %version: 2 %
       
    19 
       
    20 
       
    21 
       
    22 // INCLUDE FILES
       
    23 
       
    24 #include "mpxvideo_debug.h"
       
    25 #include "mpxvideoplaybackcontrolpolicy.h"
       
    26 #include "mpxvideoplaybackviewfiledetails.h"
       
    27 
       
    28 // ================= MEMBER FUNCTIONS ==============================================================
       
    29 
       
    30 // -------------------------------------------------------------------------------------------------
       
    31 // CMPXVideoPlaybackControlPolicy::CMPXVideoPlaybackControlPolicy()
       
    32 // C++ default constructor can NOT contain any code, that might leave.
       
    33 // -------------------------------------------------------------------------------------------------
       
    34 //
       
    35 QMPXVideoPlaybackControlPolicy::QMPXVideoPlaybackControlPolicy()
       
    36 {
       
    37     MPX_DEBUG(_L("QMPXVideoPlaybackControlPolicy::QMPXVideoPlaybackControlPolicy()"));
       
    38 }
       
    39 
       
    40 // -------------------------------------------------------------------------------------------------
       
    41 // QMPXVideoPlaybackControlPolicy::~QMPXVideoPlaybackControlPolicy()
       
    42 // Destructor.
       
    43 // -------------------------------------------------------------------------------------------------
       
    44 //
       
    45 QMPXVideoPlaybackControlPolicy::~QMPXVideoPlaybackControlPolicy()
       
    46 {
       
    47     MPX_DEBUG(_L("QMPXVideoPlaybackControlPolicy::~QMPXVideoPlaybackControlPolicy()"));
       
    48 }
       
    49 
       
    50 // -------------------------------------------------------------------------------------------------
       
    51 // QMPXVideoPlaybackControlPolicy::setControlProperties()
       
    52 // -------------------------------------------------------------------------------------------------
       
    53 //
       
    54 void 
       
    55 QMPXVideoPlaybackControlPolicy::setControlProperties( TMPXVideoPlaybackControls controlIndex,
       
    56                                                       TUint& properties,
       
    57                                                       QMPXVideoPlaybackViewFileDetails *details,
       
    58                                                       TPlaybackViewMode viewMode )
       
    59 {
       
    60     MPX_DEBUG(_L("QMPXVideoPlaybackControlPolicy::setControlProperties()"));
       
    61 
       
    62     properties = 0;
       
    63 
       
    64     switch ( controlIndex )
       
    65     {
       
    66         case EMPXBufferingAnimation:
       
    67         {
       
    68             properties = EMPXShownWhenInitializing |
       
    69                          EMPXShownWhenBuffering;
       
    70             break;
       
    71         }
       
    72         case EMPXStatusPane:
       
    73         {
       
    74             if ( details->mPlaybackMode != EMPXVideoLocal ||
       
    75             	   viewMode == EAudioOnlyView ||
       
    76             	   viewMode == EDetailsView )
       
    77             {                
       
    78                 properties = EMPXAllProperties;
       
    79             }
       
    80             else
       
    81             {
       
    82                 properties = EMPXShownWhenPlaying |
       
    83                              EMPXShownWhenPaused |
       
    84                              EMPXShownWhenSeeking;
       
    85             }
       
    86             break;
       
    87         }
       
    88         case EMPXControlBar:
       
    89         {
       
    90             //
       
    91             // We don't delete ButtonBar and Progress Bar from the controlsList 
       
    92             // to update information all the time though it's not visible or activated
       
    93             // So just hide these if it is details view
       
    94             //
       
    95             if ( viewMode == EDetailsView )
       
    96             {
       
    97                 properties = 0;
       
    98             }
       
    99             else if ( viewMode == EAudioOnlyView )
       
   100             {
       
   101                 properties = EMPXAllProperties;
       
   102             }
       
   103             else
       
   104             {
       
   105                 properties = EMPXShownWhenPlaying |
       
   106                              EMPXShownWhenPaused |
       
   107                              EMPXShownWhenSeeking;
       
   108             }
       
   109             break;
       
   110         }
       
   111         case EMPXFileDetailsWidget:
       
   112         case EMPXIndicatorBitmap:
       
   113         case EMPXDetailsViewPlaybackWindow:
       
   114         {
       
   115             //
       
   116             // Add all these controls when it is details view or audio only view
       
   117             // Once it's added to controlsList, these are visible always
       
   118             //
       
   119             properties = EMPXAllProperties;
       
   120             break;
       
   121         }
       
   122     }
       
   123 }
       
   124 
       
   125 // End of File