35
|
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 MPXVideoPlaybackControlPolicy
|
|
15 |
*
|
|
16 |
*/
|
|
17 |
|
37
|
18 |
// Version : %version: da1mmcf#13 %
|
35
|
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 |
{
|
36
|
74 |
//
|
|
75 |
// If it is local playback & full screen view, show the controls while buffering
|
|
76 |
// If not, won't show
|
|
77 |
//
|
|
78 |
if ( details->mPlaybackMode == EMPXVideoLocal && viewMode == EFullScreenView )
|
35
|
79 |
{
|
|
80 |
properties = EMPXShownWhenPlaying |
|
|
81 |
EMPXShownWhenPaused |
|
36
|
82 |
EMPXShownWhenSeeking |
|
|
83 |
EMPXShownWhenBuffering;
|
|
84 |
}
|
|
85 |
else
|
|
86 |
{
|
|
87 |
properties = EMPXAllProperties;
|
35
|
88 |
}
|
|
89 |
break;
|
|
90 |
}
|
|
91 |
case EMPXControlBar:
|
|
92 |
{
|
|
93 |
//
|
37
|
94 |
// We don't delete Tool Bar and Progress Bar from the controlsList
|
35
|
95 |
// to update information all the time though it's not visible or activated
|
|
96 |
// So just hide these if it is details view
|
|
97 |
//
|
|
98 |
if ( viewMode == EDetailsView )
|
|
99 |
{
|
|
100 |
properties = 0;
|
|
101 |
}
|
|
102 |
else if ( viewMode == EAudioOnlyView )
|
|
103 |
{
|
|
104 |
properties = EMPXAllProperties;
|
|
105 |
}
|
|
106 |
else
|
|
107 |
{
|
36
|
108 |
//
|
|
109 |
// If it is local playback, show the controls while buffering
|
|
110 |
// If not, won't show
|
|
111 |
//
|
|
112 |
if ( details->mPlaybackMode == EMPXVideoLocal )
|
|
113 |
{
|
|
114 |
properties = EMPXShownWhenPlaying |
|
|
115 |
EMPXShownWhenPaused |
|
|
116 |
EMPXShownWhenSeeking |
|
|
117 |
EMPXShownWhenBuffering;
|
|
118 |
}
|
|
119 |
else
|
|
120 |
{
|
|
121 |
properties = EMPXShownWhenPlaying |
|
|
122 |
EMPXShownWhenPaused |
|
|
123 |
EMPXShownWhenSeeking;
|
|
124 |
}
|
35
|
125 |
}
|
|
126 |
break;
|
|
127 |
}
|
|
128 |
case EMPXFileDetailsWidget:
|
|
129 |
case EMPXIndicatorBitmap:
|
|
130 |
case EMPXDetailsViewPlaybackWindow:
|
|
131 |
{
|
|
132 |
//
|
|
133 |
// Add all these controls when it is details view or audio only view
|
|
134 |
// Once it's added to controlsList, these are visible always
|
|
135 |
//
|
|
136 |
properties = EMPXAllProperties;
|
|
137 |
break;
|
|
138 |
}
|
|
139 |
}
|
|
140 |
}
|
|
141 |
|
|
142 |
// End of File
|