videoplayback/hbvideoplaybackview/controlsrc/mpxvideoplaybackcontrolpolicy.cpp
author hgs
Fri, 28 May 2010 09:45:19 +0300
changeset 39 f6d44a0cd476
parent 37 4eb2df7f7cbe
permissions -rw-r--r--
201021
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
35
hgs
parents:
diff changeset
     1
/*
hgs
parents:
diff changeset
     2
* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
hgs
parents:
diff changeset
     3
* All rights reserved.
hgs
parents:
diff changeset
     4
* This component and the accompanying materials are made available
hgs
parents:
diff changeset
     5
* under the terms of "Eclipse Public License v1.0"
hgs
parents:
diff changeset
     6
* which accompanies this distribution, and is available
hgs
parents:
diff changeset
     7
* at the URL "http://www.eclipse.org/legal/epl-v10.html".
hgs
parents:
diff changeset
     8
*
hgs
parents:
diff changeset
     9
* Initial Contributors:
hgs
parents:
diff changeset
    10
* Nokia Corporation - initial contribution.
hgs
parents:
diff changeset
    11
*
hgs
parents:
diff changeset
    12
* Contributors:
hgs
parents:
diff changeset
    13
*
hgs
parents:
diff changeset
    14
* Description:  Implementation of MPXVideoPlaybackControlPolicy
hgs
parents:
diff changeset
    15
*
hgs
parents:
diff changeset
    16
*/
hgs
parents:
diff changeset
    17
39
hgs
parents: 37
diff changeset
    18
// Version : %version: da1mmcf#14 %
35
hgs
parents:
diff changeset
    19
hgs
parents:
diff changeset
    20
hgs
parents:
diff changeset
    21
hgs
parents:
diff changeset
    22
// INCLUDE FILES
hgs
parents:
diff changeset
    23
hgs
parents:
diff changeset
    24
#include "mpxvideo_debug.h"
hgs
parents:
diff changeset
    25
#include "mpxvideoplaybackcontrolpolicy.h"
hgs
parents:
diff changeset
    26
#include "mpxvideoplaybackviewfiledetails.h"
hgs
parents:
diff changeset
    27
hgs
parents:
diff changeset
    28
// ================= MEMBER FUNCTIONS ==============================================================
hgs
parents:
diff changeset
    29
hgs
parents:
diff changeset
    30
// -------------------------------------------------------------------------------------------------
hgs
parents:
diff changeset
    31
// CMPXVideoPlaybackControlPolicy::CMPXVideoPlaybackControlPolicy()
hgs
parents:
diff changeset
    32
// C++ default constructor can NOT contain any code, that might leave.
hgs
parents:
diff changeset
    33
// -------------------------------------------------------------------------------------------------
hgs
parents:
diff changeset
    34
//
hgs
parents:
diff changeset
    35
QMPXVideoPlaybackControlPolicy::QMPXVideoPlaybackControlPolicy()
hgs
parents:
diff changeset
    36
{
hgs
parents:
diff changeset
    37
    MPX_DEBUG(_L("QMPXVideoPlaybackControlPolicy::QMPXVideoPlaybackControlPolicy()"));
hgs
parents:
diff changeset
    38
}
hgs
parents:
diff changeset
    39
hgs
parents:
diff changeset
    40
// -------------------------------------------------------------------------------------------------
hgs
parents:
diff changeset
    41
// QMPXVideoPlaybackControlPolicy::~QMPXVideoPlaybackControlPolicy()
hgs
parents:
diff changeset
    42
// Destructor.
hgs
parents:
diff changeset
    43
// -------------------------------------------------------------------------------------------------
hgs
parents:
diff changeset
    44
//
hgs
parents:
diff changeset
    45
QMPXVideoPlaybackControlPolicy::~QMPXVideoPlaybackControlPolicy()
hgs
parents:
diff changeset
    46
{
hgs
parents:
diff changeset
    47
    MPX_DEBUG(_L("QMPXVideoPlaybackControlPolicy::~QMPXVideoPlaybackControlPolicy()"));
hgs
parents:
diff changeset
    48
}
hgs
parents:
diff changeset
    49
hgs
parents:
diff changeset
    50
// -------------------------------------------------------------------------------------------------
hgs
parents:
diff changeset
    51
// QMPXVideoPlaybackControlPolicy::setControlProperties()
hgs
parents:
diff changeset
    52
// -------------------------------------------------------------------------------------------------
hgs
parents:
diff changeset
    53
//
hgs
parents:
diff changeset
    54
void 
hgs
parents:
diff changeset
    55
QMPXVideoPlaybackControlPolicy::setControlProperties( TMPXVideoPlaybackControls controlIndex,
hgs
parents:
diff changeset
    56
                                                      TUint& properties,
hgs
parents:
diff changeset
    57
                                                      QMPXVideoPlaybackViewFileDetails *details,
hgs
parents:
diff changeset
    58
                                                      TPlaybackViewMode viewMode )
hgs
parents:
diff changeset
    59
{
hgs
parents:
diff changeset
    60
    MPX_DEBUG(_L("QMPXVideoPlaybackControlPolicy::setControlProperties()"));
hgs
parents:
diff changeset
    61
hgs
parents:
diff changeset
    62
    properties = 0;
hgs
parents:
diff changeset
    63
hgs
parents:
diff changeset
    64
    switch ( controlIndex )
hgs
parents:
diff changeset
    65
    {
hgs
parents:
diff changeset
    66
        case EMPXBufferingAnimation:
hgs
parents:
diff changeset
    67
        {
hgs
parents:
diff changeset
    68
            properties = EMPXShownWhenInitializing |
hgs
parents:
diff changeset
    69
                         EMPXShownWhenBuffering;
hgs
parents:
diff changeset
    70
            break;
hgs
parents:
diff changeset
    71
        }
hgs
parents:
diff changeset
    72
        case EMPXStatusPane:
hgs
parents:
diff changeset
    73
        {
36
hgs
parents: 35
diff changeset
    74
            //
hgs
parents: 35
diff changeset
    75
            // If it is local playback & full screen view, show the controls while buffering
hgs
parents: 35
diff changeset
    76
            // If not, won't show
hgs
parents: 35
diff changeset
    77
            //
hgs
parents: 35
diff changeset
    78
            if ( details->mPlaybackMode == EMPXVideoLocal && viewMode == EFullScreenView )
35
hgs
parents:
diff changeset
    79
            {
hgs
parents:
diff changeset
    80
                properties = EMPXShownWhenPlaying |
hgs
parents:
diff changeset
    81
                             EMPXShownWhenPaused |
36
hgs
parents: 35
diff changeset
    82
                             EMPXShownWhenSeeking |
hgs
parents: 35
diff changeset
    83
                             EMPXShownWhenBuffering;
hgs
parents: 35
diff changeset
    84
            }
hgs
parents: 35
diff changeset
    85
            else
hgs
parents: 35
diff changeset
    86
            {                
hgs
parents: 35
diff changeset
    87
                properties = EMPXAllProperties;
35
hgs
parents:
diff changeset
    88
            }
hgs
parents:
diff changeset
    89
            break;
hgs
parents:
diff changeset
    90
        }
hgs
parents:
diff changeset
    91
        case EMPXControlBar:
hgs
parents:
diff changeset
    92
        {
hgs
parents:
diff changeset
    93
            //
37
hgs
parents: 36
diff changeset
    94
            // We don't delete Tool Bar and Progress Bar from the controlsList 
35
hgs
parents:
diff changeset
    95
            // to update information all the time though it's not visible or activated
hgs
parents:
diff changeset
    96
            // So just hide these if it is details view
hgs
parents:
diff changeset
    97
            //
hgs
parents:
diff changeset
    98
            if ( viewMode == EDetailsView )
hgs
parents:
diff changeset
    99
            {
hgs
parents:
diff changeset
   100
                properties = 0;
hgs
parents:
diff changeset
   101
            }
hgs
parents:
diff changeset
   102
            else if ( viewMode == EAudioOnlyView )
hgs
parents:
diff changeset
   103
            {
hgs
parents:
diff changeset
   104
                properties = EMPXAllProperties;
hgs
parents:
diff changeset
   105
            }
hgs
parents:
diff changeset
   106
            else
hgs
parents:
diff changeset
   107
            {
36
hgs
parents: 35
diff changeset
   108
                //
hgs
parents: 35
diff changeset
   109
                // If it is local playback, show the controls while buffering
hgs
parents: 35
diff changeset
   110
                // If not, won't show
hgs
parents: 35
diff changeset
   111
                //
hgs
parents: 35
diff changeset
   112
                if ( details->mPlaybackMode == EMPXVideoLocal )
hgs
parents: 35
diff changeset
   113
                {
hgs
parents: 35
diff changeset
   114
                    properties = EMPXShownWhenPlaying |
hgs
parents: 35
diff changeset
   115
                                 EMPXShownWhenPaused |
hgs
parents: 35
diff changeset
   116
                                 EMPXShownWhenSeeking |
hgs
parents: 35
diff changeset
   117
                                 EMPXShownWhenBuffering;                    
hgs
parents: 35
diff changeset
   118
                }
hgs
parents: 35
diff changeset
   119
                else
hgs
parents: 35
diff changeset
   120
                {
hgs
parents: 35
diff changeset
   121
                    properties = EMPXShownWhenPlaying |
hgs
parents: 35
diff changeset
   122
                                 EMPXShownWhenPaused |
hgs
parents: 35
diff changeset
   123
                                 EMPXShownWhenSeeking;                    
hgs
parents: 35
diff changeset
   124
                }
35
hgs
parents:
diff changeset
   125
            }
hgs
parents:
diff changeset
   126
            break;
hgs
parents:
diff changeset
   127
        }
hgs
parents:
diff changeset
   128
        case EMPXFileDetailsWidget:
hgs
parents:
diff changeset
   129
        case EMPXIndicatorBitmap:
39
hgs
parents: 37
diff changeset
   130
        case EMPXRealLogoBitmap:
35
hgs
parents:
diff changeset
   131
        case EMPXDetailsViewPlaybackWindow:
hgs
parents:
diff changeset
   132
        {
hgs
parents:
diff changeset
   133
            //
hgs
parents:
diff changeset
   134
            // Add all these controls when it is details view or audio only view
hgs
parents:
diff changeset
   135
            // Once it's added to controlsList, these are visible always
hgs
parents:
diff changeset
   136
            //
hgs
parents:
diff changeset
   137
            properties = EMPXAllProperties;
hgs
parents:
diff changeset
   138
            break;
hgs
parents:
diff changeset
   139
        }
hgs
parents:
diff changeset
   140
    }
hgs
parents:
diff changeset
   141
}
hgs
parents:
diff changeset
   142
hgs
parents:
diff changeset
   143
// End of File