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 QMPXVideoPlaybackFullScreenControl |
|
15 * |
|
16 */ |
|
17 |
|
18 // Version : %version: da1mmcf#9 % |
|
19 |
|
20 |
|
21 |
|
22 #include <w32std.h> |
|
23 |
|
24 #include "mpxvideo_debug.h" |
|
25 #include "mpxvideoplaybackcontrolbar.h" |
|
26 #include "mpxvideoplaybackfullscreencontrol.h" |
|
27 #include "mpxvideoplaybackfiledetailswidget.h" |
|
28 #include "mpxvideoplaybackcontrolscontroller.h" |
|
29 #include "mpxvideoplaybackdetailsplaybackwindow.h" |
|
30 |
|
31 |
|
32 // ------------------------------------------------------------------------------------------------- |
|
33 // QMPXVideoPlaybackFullScreenControl::QMPXVideoPlaybackFullScreenControl() |
|
34 // ------------------------------------------------------------------------------------------------- |
|
35 // |
|
36 QMPXVideoPlaybackFullScreenControl::QMPXVideoPlaybackFullScreenControl( |
|
37 QMPXVideoPlaybackControlsController* controller, |
|
38 TMPXVideoPlaybackControls index, |
|
39 HbWidget* widget, |
|
40 TUint controlproperties ) |
|
41 : mController( controller ) |
|
42 , mControl( widget ) |
|
43 , mControlIndex( index ) |
|
44 , mProperties( controlproperties ) |
|
45 { |
|
46 MPX_ENTER_EXIT(_L("QMPXVideoPlaybackFullScreenControl::QMPXVideoPlaybackFullScreenControl()")); |
|
47 |
|
48 setParent( mController ); |
|
49 } |
|
50 |
|
51 // ------------------------------------------------------------------------------------------------- |
|
52 // QMPXVideoPlaybackFullScreenControl::~QMPXVideoPlaybackFullScreenControl() |
|
53 // ------------------------------------------------------------------------------------------------- |
|
54 // |
|
55 QMPXVideoPlaybackFullScreenControl::~QMPXVideoPlaybackFullScreenControl() |
|
56 { |
|
57 MPX_DEBUG(_L("QMPXVideoPlaybackControlsController::~QMPXVideoPlaybackFullScreenControl")); |
|
58 } |
|
59 |
|
60 // ------------------------------------------------------------------------------------------------- |
|
61 // QMPXVideoPlaybackFullScreenControl::setVisible() |
|
62 // ------------------------------------------------------------------------------------------------- |
|
63 // |
|
64 void QMPXVideoPlaybackFullScreenControl::setVisible( bool visible ) |
|
65 { |
|
66 switch ( mControlIndex ) |
|
67 { |
|
68 case EMPXControlBar: |
|
69 { |
|
70 static_cast<QMPXVideoPlaybackControlBar*>(mControl)->setVisibleToControlBar( visible ); |
|
71 break; |
|
72 } |
|
73 default: |
|
74 { |
|
75 mControl->setVisible( visible ); |
|
76 break; |
|
77 } |
|
78 } |
|
79 } |
|
80 |
|
81 // ------------------------------------------------------------------------------------------------- |
|
82 // QMPXVideoPlaybackFullScreenControl::isVisible() |
|
83 // ------------------------------------------------------------------------------------------------- |
|
84 // |
|
85 bool QMPXVideoPlaybackFullScreenControl::isVisible() |
|
86 { |
|
87 return mControl->isVisible(); |
|
88 } |
|
89 |
|
90 // ------------------------------------------------------------------------------------------------- |
|
91 // QMPXVideoPlaybackFullScreenControl::setVisibility() |
|
92 // ------------------------------------------------------------------------------------------------- |
|
93 // |
|
94 void QMPXVideoPlaybackFullScreenControl::setVisibility( TMPXPlaybackState state ) |
|
95 { |
|
96 MPX_DEBUG(_L("QMPXVideoPlaybackFullScreenControl::setVisibility()")); |
|
97 |
|
98 bool visible = false; |
|
99 |
|
100 switch( state ) |
|
101 { |
|
102 case EPbStatePlaying: |
|
103 { |
|
104 if ( mProperties & EMPXShownWhenPlaying ) |
|
105 { |
|
106 visible = true; |
|
107 } |
|
108 break; |
|
109 } |
|
110 case EPbStatePaused: |
|
111 { |
|
112 if ( mProperties & EMPXShownWhenPaused ) |
|
113 { |
|
114 visible = true; |
|
115 } |
|
116 break; |
|
117 } |
|
118 case EPbStatePluginSeeking: |
|
119 { |
|
120 if ( mProperties & EMPXShownWhenSeeking ) |
|
121 { |
|
122 visible = true; |
|
123 } |
|
124 break; |
|
125 } |
|
126 case EPbStateBuffering: |
|
127 { |
|
128 if ( mProperties & EMPXShownWhenBuffering ) |
|
129 { |
|
130 visible = true; |
|
131 } |
|
132 break; |
|
133 } |
|
134 case EPbStateNotInitialised: |
|
135 case EPbStateInitialising: |
|
136 { |
|
137 if ( mProperties & EMPXShownWhenInitializing ) |
|
138 { |
|
139 visible = true; |
|
140 } |
|
141 break; |
|
142 } |
|
143 } |
|
144 |
|
145 setVisible( visible ); |
|
146 } |
|
147 |
|
148 // ------------------------------------------------------------------------------------------------- |
|
149 // QMPXVideoPlaybackFullScreenControl::controlIndex() |
|
150 // ------------------------------------------------------------------------------------------------- |
|
151 // |
|
152 TMPXVideoPlaybackControls QMPXVideoPlaybackFullScreenControl::controlIndex() |
|
153 { |
|
154 return mControlIndex; |
|
155 } |
|
156 |
|
157 // ------------------------------------------------------------------------------------------------- |
|
158 // QMPXVideoPlaybackFullScreenControl::durationChanged() |
|
159 // ------------------------------------------------------------------------------------------------- |
|
160 // |
|
161 bool QMPXVideoPlaybackFullScreenControl::durationChanged( int duration ) |
|
162 { |
|
163 bool changed = EFalse; |
|
164 |
|
165 if ( mControlIndex == EMPXControlBar ) |
|
166 { |
|
167 MPX_DEBUG(_L("QMPXVideoPlaybackFullScreenControl::DurationChanged() [%d]"), duration); |
|
168 |
|
169 static_cast<QMPXVideoPlaybackControlBar*>(mControl)->durationChanged( duration ); |
|
170 |
|
171 changed = ETrue; |
|
172 } |
|
173 |
|
174 return changed; |
|
175 } |
|
176 |
|
177 // ------------------------------------------------------------------------------------------------- |
|
178 // QMPXVideoPlaybackFullScreenControl::positionChanged() |
|
179 // ------------------------------------------------------------------------------------------------- |
|
180 // |
|
181 bool QMPXVideoPlaybackFullScreenControl::positionChanged( int position ) |
|
182 { |
|
183 bool changed = EFalse; |
|
184 |
|
185 if ( mControlIndex == EMPXControlBar ) |
|
186 { |
|
187 MPX_DEBUG(_L("QMPXVideoPlaybackFullScreenControl::positionChanged() [%d]"), position); |
|
188 |
|
189 static_cast<QMPXVideoPlaybackControlBar*>(mControl)->positionChanged( position ); |
|
190 |
|
191 changed = ETrue; |
|
192 } |
|
193 |
|
194 return changed; |
|
195 } |
|
196 |
|
197 // ------------------------------------------------------------------------------------------------- |
|
198 // QMPXVideoPlaybackFullScreenControl::aspectRatioChanged() |
|
199 // ------------------------------------------------------------------------------------------------- |
|
200 // |
|
201 bool QMPXVideoPlaybackFullScreenControl::aspectRatioChanged( int aspectRatio ) |
|
202 { |
|
203 bool changed = EFalse; |
|
204 |
|
205 if ( mControlIndex == EMPXControlBar ) |
|
206 { |
|
207 MPX_DEBUG( |
|
208 _L("QMPXVideoPlaybackFullScreenControl::aspectRatioChanged() [%d]"), aspectRatio); |
|
209 |
|
210 static_cast<QMPXVideoPlaybackControlBar*>(mControl)->aspectRatioChanged( aspectRatio ); |
|
211 |
|
212 changed = ETrue; |
|
213 } |
|
214 |
|
215 return changed; |
|
216 } |
|
217 |
|
218 // ------------------------------------------------------------------------------------------------- |
|
219 // QMPXVideoPlaybackFullScreenControl::setDownloadSize() |
|
220 // ------------------------------------------------------------------------------------------------- |
|
221 // |
|
222 bool QMPXVideoPlaybackFullScreenControl::setDownloadSize( int /*size*/ ) |
|
223 { |
|
224 bool changed = EFalse; |
|
225 |
|
226 /* |
|
227 if ( mControlIndex == EMPXProgressBar ) |
|
228 { |
|
229 MPX_DEBUG(_L("QMPXVideoPlaybackFullScreenControl::SetDownloadSize() [%d]"), size); |
|
230 |
|
231 //static_cast<CMPXVideoPlaybackProgressBar*>(mControl)->SetDownloadSize( size ); |
|
232 |
|
233 changed = ETrue; |
|
234 } |
|
235 */ |
|
236 return changed; |
|
237 } |
|
238 |
|
239 // ------------------------------------------------------------------------------------------------- |
|
240 // QMPXVideoPlaybackFullScreenControl::updateDownloadPosition() |
|
241 // ------------------------------------------------------------------------------------------------- |
|
242 // |
|
243 bool QMPXVideoPlaybackFullScreenControl::updateDownloadPosition( int /*size*/ ) |
|
244 { |
|
245 bool changed = EFalse; |
|
246 |
|
247 /* |
|
248 if ( mControlIndex == EMPXProgressBar ) |
|
249 { |
|
250 MPX_DEBUG(_L("QMPXVideoPlaybackFullScreenControl::UpdateDownloadPosition() [%d]"), size); |
|
251 |
|
252 //static_cast<CMPXVideoPlaybackProgressBar*>(mControl)->updateDownloadPosition( size ); |
|
253 |
|
254 changed = ETrue; |
|
255 }*/ |
|
256 |
|
257 return changed; |
|
258 } |
|
259 |
|
260 // ------------------------------------------------------------------------------------------------- |
|
261 // QMPXVideoPlaybackFullScreenControl::updateState() |
|
262 // ------------------------------------------------------------------------------------------------- |
|
263 // |
|
264 void QMPXVideoPlaybackFullScreenControl::updateState( TMPXPlaybackState state ) |
|
265 { |
|
266 switch ( mControlIndex ) |
|
267 { |
|
268 case EMPXControlBar: |
|
269 { |
|
270 static_cast<QMPXVideoPlaybackControlBar*>(mControl)->updateState( state ); |
|
271 break; |
|
272 } |
|
273 case EMPXDetailsViewPlaybackWindow: |
|
274 { |
|
275 static_cast<QMPXVideoPlaybackDetailsPlaybackWindow*>(mControl)->updateState( state ); |
|
276 break; |
|
277 } |
|
278 } |
|
279 } |
|
280 |
|
281 // ------------------------------------------------------------------------------------------------- |
|
282 // QMPXVideoPlaybackFullScreenControl::updateControlsWithFileDetails() |
|
283 // ------------------------------------------------------------------------------------------------- |
|
284 // |
|
285 void QMPXVideoPlaybackFullScreenControl::updateControlsWithFileDetails( |
|
286 QMPXVideoPlaybackViewFileDetails* details ) |
|
287 { |
|
288 switch ( mControlIndex ) |
|
289 { |
|
290 case EMPXControlBar: |
|
291 { |
|
292 static_cast<QMPXVideoPlaybackControlBar*>(mControl)->updateWithFileDetails( details ); |
|
293 break; |
|
294 } |
|
295 case EMPXFileDetailsWidget: |
|
296 { |
|
297 static_cast<QMPXVideoPlaybackFileDetailsWidget*>(mControl)->updateWithFileDetails( details ); |
|
298 break; |
|
299 } |
|
300 } |
|
301 } |
|
302 |
|
303 // ------------------------------------------------------------------------------------------------- |
|
304 // QMPXVideoPlaybackFullScreenControl::updateControlProperties() |
|
305 // ------------------------------------------------------------------------------------------------- |
|
306 // |
|
307 void QMPXVideoPlaybackFullScreenControl::updateControlProperties( TUint properties ) |
|
308 { |
|
309 mProperties = properties; |
|
310 } |
|
311 |
|
312 // End of file |
|