videoplayback/videoplaybackcontrols/src/mpxvideoplaybackcontrolpolicy.cpp
changeset 0 96612d01cf9f
child 54 315810614048
equal deleted inserted replaced
-1:000000000000 0:96612d01cf9f
       
     1 /*
       
     2 * Copyright (c) 2008 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: 9 %
       
    19 
       
    20 
       
    21 // INCLUDE FILES
       
    22 
       
    23 #include "mpxvideo_debug.h"
       
    24 #include "mpxvideoplaybackviewfiledetails.h"
       
    25 #include "mpxvideoplaybackcontrolpolicy.h"
       
    26 
       
    27 // ================= MEMBER FUNCTIONS ==============================================================
       
    28 
       
    29 // -------------------------------------------------------------------------------------------------
       
    30 // CMPXVideoPlaybackControlPolicy::CMPXVideoPlaybackControlPolicy()
       
    31 // C++ default constructor can NOT contain any code, that might leave.
       
    32 // -------------------------------------------------------------------------------------------------
       
    33 //
       
    34 CMPXVideoPlaybackControlPolicy::CMPXVideoPlaybackControlPolicy()
       
    35 {
       
    36     MPX_DEBUG(_L("CMPXVideoPlaybackControlPolicy::CMPXVideoPlaybackControlPolicy()"));
       
    37 }
       
    38 
       
    39 // -------------------------------------------------------------------------------------------------
       
    40 // CMPXVideoPlaybackControlPolicy::ConstructL()
       
    41 // Symbian 2nd phase constructor can leave.
       
    42 // -------------------------------------------------------------------------------------------------
       
    43 //
       
    44 void CMPXVideoPlaybackControlPolicy::ConstructL()
       
    45 {
       
    46     MPX_DEBUG(_L("CMPXVideoPlaybackControlPolicy::ConstructL()"));
       
    47 }
       
    48 
       
    49 // -------------------------------------------------------------------------------------------------
       
    50 // CMPXVideoPlaybackControlPolicy::NewL()
       
    51 // Two-phased constructor.
       
    52 // -------------------------------------------------------------------------------------------------
       
    53 //
       
    54 CMPXVideoPlaybackControlPolicy* CMPXVideoPlaybackControlPolicy::NewL()
       
    55 {
       
    56     MPX_DEBUG(_L("CMPXVideoPlaybackControlPolicy::NewL()"));
       
    57 
       
    58     CMPXVideoPlaybackControlPolicy* self = new (ELeave) CMPXVideoPlaybackControlPolicy();
       
    59 
       
    60     CleanupStack::PushL(self);
       
    61     self->ConstructL();
       
    62     CleanupStack::Pop();
       
    63 
       
    64     return self;
       
    65 }
       
    66 
       
    67 // -------------------------------------------------------------------------------------------------
       
    68 // CMPXVideoPlaybackControlPolicy::~CMPXVideoPlaybackControlPolicy()
       
    69 // Destructor.
       
    70 // -------------------------------------------------------------------------------------------------
       
    71 //
       
    72 CMPXVideoPlaybackControlPolicy::~CMPXVideoPlaybackControlPolicy()
       
    73 {
       
    74     MPX_DEBUG(_L("CMPXVideoPlaybackControlPolicy::~CMPXVideoPlaybackControlPolicy()"));
       
    75 }
       
    76 
       
    77 // -------------------------------------------------------------------------------------------------
       
    78 // CMPXVideoPlaybackControlPolicy::SetControlProperties()
       
    79 // -------------------------------------------------------------------------------------------------
       
    80 //
       
    81 void CMPXVideoPlaybackControlPolicy::SetControlProperties(
       
    82                                          TMPXVideoPlaybackControls aControlIndex,
       
    83                                          TUint& aProperties,
       
    84                                          CMPXVideoPlaybackViewFileDetails* aDetails )
       
    85 {
       
    86     MPX_DEBUG(_L("CMPXVideoPlaybackControlPolicy::SetControlProperties()"));
       
    87 
       
    88     aProperties = 0;
       
    89 
       
    90     switch ( aControlIndex )
       
    91     {
       
    92         case EMPXSoftkeyBack:
       
    93         {
       
    94             //
       
    95             //  Transitory Buffering states will be filtered out by the View
       
    96             //
       
    97             aProperties = EMPXBufferingControl;
       
    98 
       
    99             //
       
   100             //  Do not show Back when Initializing for Local Mode
       
   101             //  It causes a flicker when playback begins
       
   102             //
       
   103             if ( aDetails->iPlaybackMode != EMPXVideoLocal )
       
   104             {
       
   105                 aProperties += EMPXShownWhenInitializing;
       
   106             }
       
   107         }
       
   108         case EMPXSoftkeyDetails:
       
   109         {
       
   110             aProperties += EMPXSoftkeyControl |
       
   111                            EMPXShownWhenPlaying |
       
   112                            EMPXShownWhenPaused |
       
   113                            EMPXShownWhenStopped |
       
   114                            EMPXShownWhenSeeking;
       
   115             break;
       
   116         }
       
   117         case EMPXBufferingLabel:
       
   118         {
       
   119             aProperties = EMPXBufferingControl;
       
   120             break;
       
   121         }
       
   122         case EMPXTitleLabel:
       
   123         case EMPXArtistLabel:
       
   124         {
       
   125             aProperties = EMPXBufferingControl;
       
   126         }
       
   127         case EMPXButtonBar:
       
   128         case EMPXProgressBar:
       
   129         case EMPXVolumeBar:
       
   130         case EMPXAspectRatioIcon:
       
   131         {
       
   132             aProperties += EMPXShownWhenPlaying |
       
   133                            EMPXShownWhenPaused |
       
   134                            EMPXShownWhenStopped |
       
   135                            EMPXShownWhenSeeking;
       
   136             break;
       
   137         }
       
   138         case EMPXNoVideoBitmap:
       
   139         case EMPXRealAudioBitmap:
       
   140         case EMPXSoundBitmap:
       
   141         {
       
   142             aProperties = EMPXBufferingControl |
       
   143                           EMPXShownWhenPlaying |
       
   144                           EMPXShownWhenPaused |
       
   145                           EMPXShownWhenStopped |
       
   146                           EMPXShownWhenSeeking;
       
   147             break;
       
   148         }
       
   149         case EMPXDownloadPausedIcon:
       
   150         {
       
   151             aProperties = EMPXAllProperties;
       
   152             break;
       
   153         }
       
   154         case EMPXVideoPausedIcon:
       
   155         {
       
   156             aProperties = EMPXShownWhenPaused;
       
   157             break;
       
   158         }
       
   159         case EMPXBrandingAnimation:
       
   160         {
       
   161             aProperties = EMPXShownWhenInitializing;
       
   162             break;
       
   163         }
       
   164     }
       
   165 }
       
   166 
       
   167 // End of File