|
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 VideoPlaybackControlPolicy |
|
15 * |
|
16 */ |
|
17 |
|
18 // Version : %version: 3 % |
|
19 |
|
20 |
|
21 |
|
22 // INCLUDE FILES |
|
23 |
|
24 #include "mpxvideo_debug.h" |
|
25 #include "videoplaybackcontrolpolicy.h" |
|
26 #include "videoplaybackviewfiledetails.h" |
|
27 |
|
28 // ================= MEMBER FUNCTIONS ============================================================== |
|
29 |
|
30 // ------------------------------------------------------------------------------------------------- |
|
31 // VideoPlaybackControlPolicy::VideoPlaybackControlPolicy() |
|
32 // C++ default constructor can NOT contain any code, that might leave. |
|
33 // ------------------------------------------------------------------------------------------------- |
|
34 // |
|
35 VideoPlaybackControlPolicy::VideoPlaybackControlPolicy() |
|
36 { |
|
37 MPX_DEBUG(_L("VideoPlaybackControlPolicy::VideoPlaybackControlPolicy()")); |
|
38 } |
|
39 |
|
40 // ------------------------------------------------------------------------------------------------- |
|
41 // VideoPlaybackControlPolicy::~VideoPlaybackControlPolicy() |
|
42 // Destructor. |
|
43 // ------------------------------------------------------------------------------------------------- |
|
44 // |
|
45 VideoPlaybackControlPolicy::~VideoPlaybackControlPolicy() |
|
46 { |
|
47 MPX_DEBUG(_L("VideoPlaybackControlPolicy::~VideoPlaybackControlPolicy()")); |
|
48 } |
|
49 |
|
50 // ------------------------------------------------------------------------------------------------- |
|
51 // VideoPlaybackControlPolicy::setControlProperties() |
|
52 // ------------------------------------------------------------------------------------------------- |
|
53 // |
|
54 void |
|
55 VideoPlaybackControlPolicy::setControlProperties( TVideoPlaybackControls controlIndex, |
|
56 TUint& properties, |
|
57 VideoPlaybackViewFileDetails *details, |
|
58 TPlaybackViewMode viewMode ) |
|
59 { |
|
60 MPX_DEBUG(_L("VideoPlaybackControlPolicy::setControlProperties()")); |
|
61 |
|
62 properties = 0; |
|
63 |
|
64 switch ( controlIndex ) |
|
65 { |
|
66 case EBufferingAnimation: |
|
67 { |
|
68 properties = EShownWhenInitializing | |
|
69 EShownWhenBuffering; |
|
70 break; |
|
71 } |
|
72 case EStatusPane: |
|
73 { |
|
74 if ( details->mPlaybackMode != EMPXVideoLocal || |
|
75 viewMode == EAudioOnlyView || |
|
76 viewMode == EDetailsView ) |
|
77 { |
|
78 properties = EAllProperties; |
|
79 } |
|
80 else |
|
81 { |
|
82 properties = EShownWhenPlaying | |
|
83 EShownWhenPaused | |
|
84 EShownWhenSeeking; |
|
85 } |
|
86 break; |
|
87 } |
|
88 case EControlBar: |
|
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 = EAllProperties; |
|
102 } |
|
103 else |
|
104 { |
|
105 properties = EShownWhenPlaying | |
|
106 EShownWhenPaused | |
|
107 EShownWhenSeeking; |
|
108 } |
|
109 break; |
|
110 } |
|
111 case EFileDetailsWidget: |
|
112 case EIndicatorBitmap: |
|
113 case EDetailsViewPlaybackWindow: |
|
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 = EAllProperties; |
|
120 break; |
|
121 } |
|
122 } |
|
123 } |
|
124 |
|
125 // End of File |