author | Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com> |
Wed, 13 Oct 2010 14:34:36 +0300 | |
branch | RCL_3 |
changeset 70 | 375929f879c2 |
parent 57 | befca0ec475f |
permissions | -rw-r--r-- |
57 | 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 CMPXVideoPlaybackControl |
|
15 |
* |
|
16 |
*/ |
|
17 |
||
18 |
||
70
375929f879c2
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
57
diff
changeset
|
19 |
// Version : %version: 23.1.1 % |
57 | 20 |
|
21 |
||
22 |
// INCLUDE FILES |
|
23 |
#include <avkon.hrh> |
|
24 |
#include <e32std.h> |
|
25 |
#include <AknUtils.h> |
|
26 |
||
27 |
#include "mpxcommonvideoplaybackview.hrh" |
|
28 |
#include "mpxvideoplaybackcontrol.h" |
|
29 |
#include "mpxvideoplaybackvolumebar.h" |
|
30 |
#include "mpxvideoplaybackbuttonbar.h" |
|
31 |
#include "mpxvideoplaybackprogressbar.h" |
|
32 |
#include "mpxvideoplaybackcontrolscontroller.h" |
|
33 |
#include "mpxvideoplaybackviewfiledetails.h" |
|
34 |
#include "mpxvideoplaybackaspectratioicon.h" |
|
35 |
#include "mpxvideoplaybackbrandinganimation.h" |
|
36 |
#include "mpxvideoplaybackuserinputhandler.h" |
|
37 |
#include "mpxvideoplaybackcontainer.h" |
|
38 |
#include "mpxvideo_debug.h" |
|
39 |
||
40 |
#ifdef RD_TACTILE_FEEDBACK |
|
41 |
#include <touchfeedback.h> |
|
42 |
#endif //RD_TACTILE_FEEDBACK |
|
43 |
||
44 |
// ================= MEMBER FUNCTIONS ============================================================== |
|
45 |
||
46 |
// ------------------------------------------------------------------------------------------------- |
|
47 |
// CMPXVideoPlaybackControl::CMPXVideoPlaybackControl() |
|
48 |
// C++ default constructor can NOT contain any code, that |
|
49 |
// might leave. |
|
50 |
// ------------------------------------------------------------------------------------------------- |
|
51 |
// |
|
52 |
CMPXVideoPlaybackControl::CMPXVideoPlaybackControl( |
|
53 |
CMPXVideoPlaybackControlsController* aController, |
|
54 |
CCoeControl* aControl, |
|
55 |
TMPXVideoPlaybackControls aControlIndex, |
|
56 |
TUint aProperties ) |
|
57 |
: iController( aController ) |
|
58 |
, iControl( aControl ) |
|
59 |
, iControlIndex( aControlIndex ) |
|
60 |
, iProperties( aProperties ) |
|
61 |
{ |
|
62 |
} |
|
63 |
||
64 |
// ------------------------------------------------------------------------------------------------- |
|
65 |
// CMPXVideoPlaybackControl::ConstructL() |
|
66 |
// Symbian 2nd phase constructor can leave. |
|
67 |
// ------------------------------------------------------------------------------------------------- |
|
68 |
// |
|
69 |
void CMPXVideoPlaybackControl::ConstructL( TRect aRect ) |
|
70 |
{ |
|
71 |
MPX_DEBUG(_L("CMPXVideoPlaybackControl::ConstructL()")); |
|
72 |
||
73 |
CreateWindowL(); |
|
74 |
||
75 |
Window().SetTransparencyAlphaChannel(); |
|
76 |
||
77 |
EnableDragEvents(); |
|
78 |
||
79 |
iEikonEnv->EikAppUi()->AddToStackL( this, ECoeStackPriorityDefault ); |
|
80 |
||
81 |
SetRect( aRect ); |
|
82 |
||
83 |
iControl->SetContainerWindowL( *this ); |
|
84 |
iControl->SetRect( Rect() ); |
|
85 |
SetComponentsToInheritVisibility( ETrue ); |
|
86 |
||
87 |
#ifdef RD_TACTILE_FEEDBACK |
|
88 |
if ( iProperties & EMPXSoftkeyControl ) |
|
89 |
{ |
|
90 |
iFeedback = MTouchFeedback::Instance(); |
|
91 |
} |
|
92 |
#endif //RD_TACTILE_FEEDBACK |
|
93 |
||
94 |
Window().SetNonFading( ETrue ); |
|
95 |
||
96 |
ActivateL(); |
|
97 |
} |
|
98 |
||
99 |
// ------------------------------------------------------------------------------------------------- |
|
100 |
// CMPXVideoPlaybackControl::NewL() |
|
101 |
// Two-phased constructor. |
|
102 |
// ------------------------------------------------------------------------------------------------- |
|
103 |
// |
|
104 |
CMPXVideoPlaybackControl* CMPXVideoPlaybackControl::NewL( |
|
105 |
CMPXVideoPlaybackControlsController* aController, |
|
106 |
CCoeControl* aControl, |
|
107 |
TRect aRect, |
|
108 |
TMPXVideoPlaybackControls aControlIndex, |
|
109 |
TUint aProperties ) |
|
110 |
{ |
|
111 |
MPX_DEBUG(_L("CMPXVideoPlaybackControl::NewL()")); |
|
112 |
||
113 |
CMPXVideoPlaybackControl* self = |
|
114 |
new (ELeave) CMPXVideoPlaybackControl( aController, aControl, aControlIndex, aProperties ); |
|
115 |
||
116 |
CleanupStack::PushL(self); |
|
117 |
self->ConstructL( aRect ); |
|
118 |
CleanupStack::Pop(); |
|
119 |
||
120 |
return self; |
|
121 |
} |
|
122 |
||
123 |
// ------------------------------------------------------------------------------------------------- |
|
124 |
// CMPXVideoPlaybackControl::~CMPXVideoPlaybackControlsController() |
|
125 |
// Destructor. |
|
126 |
// ------------------------------------------------------------------------------------------------- |
|
127 |
// |
|
128 |
CMPXVideoPlaybackControl::~CMPXVideoPlaybackControl() |
|
129 |
{ |
|
130 |
MPX_DEBUG(_L("CMPXVideoPlaybackControl::~CMPXVideoPlaybackControl()")); |
|
131 |
||
132 |
iEikonEnv->EikAppUi()->RemoveFromStack( this ); |
|
133 |
||
134 |
#ifdef RD_TACTILE_FEEDBACK |
|
135 |
if ( iFeedback ) |
|
136 |
{ |
|
137 |
iFeedback->RemoveFeedbackForControl( this ); |
|
138 |
} |
|
139 |
#endif //RD_TACTILE_FEEDBACK |
|
140 |
||
141 |
if ( iControl ) |
|
142 |
{ |
|
143 |
delete iControl; |
|
144 |
iControl = NULL; |
|
145 |
} |
|
146 |
||
147 |
CloseWindow(); |
|
148 |
} |
|
149 |
||
150 |
// ------------------------------------------------------------------------------------------------- |
|
151 |
// From CCoeControl |
|
152 |
// Gets the number of controls contained in a compound control. |
|
153 |
// ------------------------------------------------------------------------------------------------- |
|
154 |
// |
|
155 |
TInt CMPXVideoPlaybackControl::CountComponentControls() const |
|
156 |
{ |
|
157 |
return 1; |
|
158 |
} |
|
159 |
||
160 |
// ------------------------------------------------------------------------------------------------- |
|
161 |
// From CCoeControl |
|
162 |
// Gets an indexed component of a compound control. |
|
163 |
// ------------------------------------------------------------------------------------------------- |
|
164 |
// |
|
165 |
CCoeControl* CMPXVideoPlaybackControl::ComponentControl( TInt /*aIndex*/ ) const |
|
166 |
{ |
|
167 |
return iControl; |
|
168 |
} |
|
169 |
||
170 |
// ------------------------------------------------------------------------------------------------- |
|
171 |
// CMPXVideoPlaybackControl::Draw() |
|
172 |
// ------------------------------------------------------------------------------------------------- |
|
173 |
// |
|
174 |
void CMPXVideoPlaybackControl::Draw( const TRect& aRect ) const |
|
175 |
{ |
|
176 |
MPX_DEBUG(_L("CMPXVideoPlaybackControl::Draw()")); |
|
177 |
||
178 |
CWindowGc& gc = SystemGc(); |
|
179 |
gc.SetClippingRect( aRect ); |
|
180 |
||
181 |
if ( Window().DisplayMode() == EColor16MAP ) |
|
182 |
{ |
|
183 |
gc.SetDrawMode( CGraphicsContext::EDrawModeWriteAlpha ); |
|
184 |
gc.SetBrushColor( TRgb::Color16MAP( 255 ) ); |
|
185 |
} |
|
186 |
else if ( Window().DisplayMode() == EColor16MA ) |
|
187 |
{ |
|
188 |
gc.SetDrawMode( CGraphicsContext::EDrawModeWriteAlpha ); |
|
189 |
gc.SetBrushColor( TRgb::Color16MA( 0 ) ); |
|
190 |
} |
|
191 |
||
192 |
gc.Clear( aRect ); |
|
193 |
} |
|
194 |
||
195 |
// ------------------------------------------------------------------------------------------------- |
|
196 |
// CMPXVideoPlaybackControl::HandlePointerEventL() |
|
197 |
// ------------------------------------------------------------------------------------------------- |
|
198 |
// |
|
199 |
void CMPXVideoPlaybackControl::HandlePointerEventL( const TPointerEvent& aPointerEvent ) |
|
200 |
{ |
|
201 |
MPX_ENTER_EXIT(_L("CMPXVideoPlaybackControl::HandlePointerEventL()"), |
|
202 |
_L("iControlIndex = %d"), iControlIndex ); |
|
203 |
||
204 |
iController->iContainer->UserInputHandler()->ProcessPointerEventL( this, |
|
205 |
aPointerEvent, |
|
206 |
EMpxVideoPlaybackControl ); |
|
207 |
} |
|
208 |
||
209 |
// ------------------------------------------------------------------------------------------------- |
|
210 |
// CMPXVideoPlaybackControl::DoHandlePointerEventL() |
|
211 |
// ------------------------------------------------------------------------------------------------- |
|
212 |
// |
|
213 |
EXPORT_C void CMPXVideoPlaybackControl::DoHandlePointerEventL( const TPointerEvent& aPointerEvent) |
|
214 |
{ |
|
215 |
MPX_ENTER_EXIT(_L("CMPXVideoPlaybackControl::DoHandlePointerEventL()"), |
|
216 |
_L(" iControlIndex = %d, aPointerEvent.iType = %d"), |
|
217 |
iControlIndex, aPointerEvent.iType ); |
|
218 |
||
219 |
if ( AknLayoutUtils::PenEnabled() ) |
|
220 |
{ |
|
221 |
if ( aPointerEvent.iType == TPointerEvent::EButton1Down ) |
|
222 |
{ |
|
223 |
iController->ResetDisappearingTimers( EMPXTimerCancel ); |
|
224 |
||
225 |
// |
|
226 |
// Grab the pointer event for all controls so the events will not transfer to a |
|
227 |
// different control as a dragging event occurs |
|
228 |
// |
|
229 |
SetPointerCapture( ETrue ); |
|
230 |
ClaimPointerGrab( ETrue ); |
|
231 |
} |
|
232 |
else if ( aPointerEvent.iType == TPointerEvent::EButton1Up ) |
|
233 |
{ |
|
234 |
iController->ResetDisappearingTimers( EMPXTimerReset ); |
|
235 |
||
236 |
SetPointerCapture( EFalse ); |
|
237 |
ClaimPointerGrab( EFalse ); |
|
238 |
} |
|
239 |
||
240 |
switch( iControlIndex ) |
|
241 |
{ |
|
242 |
case EMPXProgressBar: |
|
243 |
case EMPXVolumeBar: |
|
244 |
case EMPXButtonBar: |
|
245 |
case EMPXAspectRatioIcon: |
|
246 |
case EMPXMediaDetailsViewer: |
|
247 |
{ |
|
248 |
// |
|
249 |
// Pass an event to controller |
|
250 |
// |
|
251 |
iControl->HandlePointerEventL( aPointerEvent ); |
|
252 |
break; |
|
253 |
} |
|
254 |
case EMPXSoftkeyDetails: |
|
255 |
{ |
|
256 |
if ( aPointerEvent.iType == TPointerEvent::EButton1Up ) |
|
257 |
{ |
|
258 |
#ifdef RD_TACTILE_FEEDBACK |
|
259 |
if ( iFeedback ) |
|
260 |
{ |
|
261 |
iFeedback->InstantFeedback( ETouchFeedbackBasic ); |
|
262 |
} |
|
263 |
#endif //RD_TACTILE_FEEDBACK |
|
264 |
||
265 |
iController->HandleCommandL( EMPXPbvCmdShowFileDetails ); |
|
266 |
} |
|
267 |
break; |
|
268 |
} |
|
269 |
case EMPXSoftkeyBack: |
|
270 |
{ |
|
271 |
if ( aPointerEvent.iType == TPointerEvent::EButton1Up ) |
|
272 |
{ |
|
273 |
#ifdef RD_TACTILE_FEEDBACK |
|
274 |
if ( iFeedback ) |
|
275 |
{ |
|
276 |
iFeedback->InstantFeedback( ETouchFeedbackBasic ); |
|
277 |
} |
|
278 |
#endif //RD_TACTILE_FEEDBACK |
|
279 |
||
280 |
iController->HandleCommandL( EAknSoftkeyBack ); |
|
281 |
} |
|
282 |
break; |
|
283 |
} |
|
284 |
case EMPXNoVideoBitmap: |
|
285 |
case EMPXRealAudioBitmap: |
|
286 |
case EMPXSoundBitmap: |
|
287 |
case EMPXTitleLabel: |
|
288 |
case EMPXArtistLabel: |
|
289 |
case EMPXBrandingAnimation: |
|
290 |
default: |
|
291 |
{ |
|
292 |
// |
|
293 |
// Ignore pointer events for these controls |
|
294 |
// |
|
295 |
break; |
|
296 |
} |
|
297 |
} |
|
298 |
} |
|
299 |
} |
|
300 |
||
301 |
// ------------------------------------------------------------------------------------------------- |
|
302 |
// CMPXVideoPlaybackControl::SetVisibility() |
|
303 |
// ------------------------------------------------------------------------------------------------- |
|
304 |
// |
|
305 |
void CMPXVideoPlaybackControl::SetVisibility( TMPXPlaybackState aState ) |
|
306 |
{ |
|
307 |
TBool visible = EFalse; |
|
308 |
||
309 |
switch( aState ) |
|
310 |
{ |
|
311 |
case EPbStatePlaying: |
|
312 |
{ |
|
313 |
if ( iProperties & EMPXShownWhenPlaying ) |
|
314 |
{ |
|
315 |
visible = ETrue; |
|
316 |
} |
|
317 |
break; |
|
318 |
} |
|
319 |
case EPbStatePaused: |
|
320 |
{ |
|
321 |
if ( iProperties & EMPXShownWhenPaused ) |
|
322 |
{ |
|
323 |
visible = ETrue; |
|
324 |
} |
|
325 |
break; |
|
326 |
} |
|
327 |
case EPbStatePluginSeeking: |
|
328 |
{ |
|
329 |
if ( iProperties & EMPXShownWhenSeeking ) |
|
330 |
{ |
|
331 |
visible = ETrue; |
|
332 |
} |
|
333 |
break; |
|
334 |
} |
|
335 |
case EPbStateBuffering: |
|
336 |
{ |
|
337 |
if ( iProperties & EMPXBufferingControl ) |
|
338 |
{ |
|
339 |
visible = ETrue; |
|
340 |
} |
|
341 |
break; |
|
342 |
} |
|
343 |
case EPbStateStopped: |
|
344 |
{ |
|
345 |
if ( iProperties & EMPXShownWhenStopped ) |
|
346 |
{ |
|
347 |
visible = ETrue; |
|
348 |
} |
|
349 |
break; |
|
350 |
} |
|
351 |
case EPbStateNotInitialised: |
|
352 |
case EPbStateInitialising: |
|
353 |
{ |
|
354 |
if ( iProperties & EMPXShownWhenInitializing ) |
|
355 |
{ |
|
356 |
visible = ETrue; |
|
357 |
} |
|
358 |
break; |
|
359 |
} |
|
360 |
} |
|
361 |
||
362 |
MPX_DEBUG(_L("CMPXVideoPlaybackControl::SetVisibility(%d)"), visible); |
|
363 |
||
364 |
MakeVisible( visible ); |
|
365 |
} |
|
366 |
||
367 |
// ------------------------------------------------------------------------------------------------- |
|
368 |
// CMPXVideoPlaybackControl::ControlIndex() |
|
369 |
// ------------------------------------------------------------------------------------------------- |
|
370 |
// |
|
371 |
TMPXVideoPlaybackControls CMPXVideoPlaybackControl::ControlIndex() |
|
372 |
{ |
|
373 |
return iControlIndex; |
|
374 |
} |
|
375 |
||
376 |
// ------------------------------------------------------------------------------------------------- |
|
377 |
// CMPXVideoPlaybackControl::VolumeChanged() |
|
378 |
// ------------------------------------------------------------------------------------------------- |
|
379 |
// |
|
380 |
TBool CMPXVideoPlaybackControl::VolumeChanged( TInt aVolume ) |
|
381 |
{ |
|
382 |
TBool changed = EFalse; |
|
383 |
||
384 |
if ( iControlIndex == EMPXVolumeBar ) |
|
385 |
{ |
|
386 |
MPX_DEBUG(_L("CMPXVideoPlaybackControlsController::VolumeChanged() [%d]"), aVolume); |
|
387 |
||
388 |
static_cast<CMPXVideoPlaybackVolumeBar*>(iControl)->VolumeChanged( aVolume ); |
|
389 |
||
390 |
changed = ETrue; |
|
391 |
} |
|
392 |
||
393 |
return changed; |
|
394 |
} |
|
395 |
||
396 |
// ------------------------------------------------------------------------------------------------- |
|
397 |
// CMPXVideoPlaybackControl::DurationChangedL() |
|
398 |
// ------------------------------------------------------------------------------------------------- |
|
399 |
// |
|
400 |
TBool CMPXVideoPlaybackControl::DurationChangedL( TInt aDuration ) |
|
401 |
{ |
|
402 |
TBool changed = EFalse; |
|
403 |
||
404 |
if ( iControlIndex == EMPXProgressBar ) |
|
405 |
{ |
|
406 |
MPX_DEBUG(_L("CMPXVideoPlaybackControlsController::DurationChangedL() [%d]"), aDuration); |
|
407 |
||
408 |
static_cast<CMPXVideoPlaybackProgressBar*>(iControl)->DurationChangedL( aDuration ); |
|
409 |
||
410 |
changed = ETrue; |
|
411 |
} |
|
412 |
||
413 |
return changed; |
|
414 |
} |
|
415 |
||
416 |
// ------------------------------------------------------------------------------------------------- |
|
417 |
// CMPXVideoPlaybackControl::PositionChangedL() |
|
418 |
// ------------------------------------------------------------------------------------------------- |
|
419 |
// |
|
420 |
TBool CMPXVideoPlaybackControl::PositionChangedL( TInt aPosition ) |
|
421 |
{ |
|
422 |
TBool changed = EFalse; |
|
423 |
||
424 |
if ( iControlIndex == EMPXProgressBar ) |
|
425 |
{ |
|
426 |
MPX_DEBUG(_L("CMPXVideoPlaybackControlsController::PositionChangedL() [%d]"), aPosition); |
|
427 |
||
428 |
static_cast<CMPXVideoPlaybackProgressBar*>(iControl)->PositionChangedL( aPosition ); |
|
429 |
||
430 |
changed = ETrue; |
|
431 |
} |
|
432 |
||
433 |
return changed; |
|
434 |
} |
|
435 |
||
436 |
// ------------------------------------------------------------------------------------------------- |
|
437 |
// CMPXVideoPlaybackControl::AspectRatioChanged() |
|
438 |
// ------------------------------------------------------------------------------------------------- |
|
439 |
// |
|
440 |
TBool CMPXVideoPlaybackControl::AspectRatioChanged( TInt aAspectRatio ) |
|
441 |
{ |
|
442 |
TBool changed = EFalse; |
|
443 |
||
444 |
if ( iControlIndex == EMPXAspectRatioIcon ) |
|
445 |
{ |
|
446 |
MPX_DEBUG( |
|
447 |
_L("CMPXVideoPlaybackControlsController::AspectRatioChanged() [%d]"), aAspectRatio); |
|
448 |
||
449 |
static_cast<CMPXVideoPlaybackAspectRatioIcon*>(iControl)-> |
|
450 |
AspectRatioChanged( aAspectRatio ); |
|
451 |
||
452 |
changed = ETrue; |
|
453 |
} |
|
454 |
||
455 |
return changed; |
|
456 |
} |
|
457 |
||
458 |
// ------------------------------------------------------------------------------------------------- |
|
459 |
// CMPXVideoPlaybackControl::SetDownloadSize() |
|
460 |
// ------------------------------------------------------------------------------------------------- |
|
461 |
// |
|
462 |
TBool CMPXVideoPlaybackControl::SetDownloadSize( TInt aSize ) |
|
463 |
{ |
|
464 |
TBool changed = EFalse; |
|
465 |
||
466 |
if ( iControlIndex == EMPXProgressBar ) |
|
467 |
{ |
|
468 |
MPX_DEBUG(_L("CMPXVideoPlaybackControlsController::SetDownloadSize() [%d]"), aSize); |
|
469 |
||
470 |
static_cast<CMPXVideoPlaybackProgressBar*>(iControl)->SetDownloadSize( aSize ); |
|
471 |
||
472 |
changed = ETrue; |
|
473 |
} |
|
474 |
||
475 |
return changed; |
|
476 |
} |
|
477 |
||
478 |
// ------------------------------------------------------------------------------------------------- |
|
479 |
// CMPXVideoPlaybackControl::UpdateDownloadPosition() |
|
480 |
// ------------------------------------------------------------------------------------------------- |
|
481 |
// |
|
482 |
TBool CMPXVideoPlaybackControl::UpdateDownloadPosition( TInt aSize ) |
|
483 |
{ |
|
484 |
TBool changed = EFalse; |
|
485 |
||
486 |
if ( iControlIndex == EMPXProgressBar ) |
|
487 |
{ |
|
488 |
MPX_DEBUG(_L("CMPXVideoPlaybackControlsController::UpdateDownloadPosition() [%d]"), aSize); |
|
489 |
||
490 |
static_cast<CMPXVideoPlaybackProgressBar*>(iControl)->UpdateDownloadPosition( aSize ); |
|
491 |
||
492 |
changed = ETrue; |
|
493 |
} |
|
494 |
||
495 |
return changed; |
|
496 |
} |
|
497 |
||
498 |
// ------------------------------------------------------------------------------------------------- |
|
499 |
// CMPXVideoPlaybackControl::UpdateStateOnButtonBar() |
|
500 |
// ------------------------------------------------------------------------------------------------- |
|
501 |
// |
|
502 |
TBool CMPXVideoPlaybackControl::UpdateStateOnButtonBar( TMPXPlaybackState aState ) |
|
503 |
{ |
|
504 |
TBool changed = EFalse; |
|
505 |
||
506 |
if ( iControlIndex == EMPXButtonBar ) |
|
507 |
{ |
|
508 |
MPX_DEBUG(_L("CMPXVideoPlaybackControlsController::UpdateStateOnButtonBar() [%d]"), aState); |
|
509 |
||
510 |
static_cast<CMPXVideoPlaybackButtonBar*>(iControl)->UpdateStateOnButtonBar( aState ); |
|
511 |
||
512 |
changed = ETrue; |
|
513 |
} |
|
514 |
||
515 |
return changed; |
|
516 |
} |
|
517 |
||
518 |
// ------------------------------------------------------------------------------------------------- |
|
519 |
// CMPXVideoPlaybackControl::UpdateControlsWithFileDetailsL() |
|
520 |
// ------------------------------------------------------------------------------------------------- |
|
521 |
// |
|
522 |
void CMPXVideoPlaybackControl::UpdateControlsWithFileDetailsL( |
|
523 |
CMPXVideoPlaybackViewFileDetails* aDetails ) |
|
524 |
{ |
|
525 |
iPlaybackMode = aDetails->iPlaybackMode; |
|
526 |
||
527 |
// |
|
528 |
// Controls should be shown when if there is no video or the TV-Out is connected |
|
529 |
// |
|
530 |
if ( iControlIndex == EMPXButtonBar ) |
|
531 |
{ |
|
532 |
static_cast<CMPXVideoPlaybackButtonBar*>(iControl)->UpdateButtonBarState( aDetails ); |
|
533 |
} |
|
534 |
else if ( iControlIndex == EMPXProgressBar ) |
|
535 |
{ |
|
536 |
static_cast<CMPXVideoPlaybackProgressBar*>(iControl)->UpdateProgressBarStateL( aDetails ); |
|
537 |
} |
|
538 |
} |
|
539 |
||
540 |
// ------------------------------------------------------------------------------------------------- |
|
541 |
// CMPXVideoPlaybackControl::StopBrandingAnimationTimer() |
|
542 |
// ------------------------------------------------------------------------------------------------- |
|
543 |
// |
|
544 |
TBool CMPXVideoPlaybackControl::StopBrandingAnimationTimer() |
|
545 |
{ |
|
546 |
TBool changed = EFalse; |
|
547 |
||
548 |
if ( iControlIndex == EMPXBrandingAnimation ) |
|
549 |
{ |
|
550 |
MPX_DEBUG(_L("CMPXVideoPlaybackControlsController::StopBrandingAnimationTimer()")); |
|
551 |
||
552 |
static_cast<CMPXVideoPlaybackBrandingAnimation*>(iControl)->CancelBrandingTimer(); |
|
553 |
||
554 |
changed = ETrue; |
|
555 |
} |
|
556 |
||
557 |
return changed; |
|
558 |
} |
|
559 |
||
560 |
// ------------------------------------------------------------------------------------------------- |
|
561 |
// CMPXVideoPlaybackControl::UpdateTVOutStatusL() |
|
562 |
// ------------------------------------------------------------------------------------------------- |
|
563 |
// |
|
564 |
TBool CMPXVideoPlaybackControl::UpdateTVOutStatusL( TBool aTvOutConnected) |
|
565 |
{ |
|
566 |
TBool changed = EFalse; |
|
567 |
||
568 |
if ( iControlIndex == EMPXVolumeBar ) |
|
569 |
{ |
|
570 |
MPX_DEBUG(_L("CMPXVideoPlaybackControlsController::UpdateTVOutStatus()")); |
|
571 |
||
572 |
static_cast<CMPXVideoPlaybackVolumeBar*>(iControl)->UpdateTVOutStatusL( aTvOutConnected ); |
|
573 |
||
574 |
changed = ETrue; |
|
575 |
} |
|
576 |
||
577 |
return changed; |
|
578 |
} |
|
579 |
||
580 |
// ------------------------------------------------------------------------------------------------- |
|
581 |
// CMPXVideoPlaybackControl::ResetControl() |
|
582 |
// ------------------------------------------------------------------------------------------------- |
|
583 |
// |
|
584 |
void CMPXVideoPlaybackControl::ResetControl() |
|
585 |
{ |
|
586 |
MPX_DEBUG(_L("CMPXVideoPlaybackControlsController::ResetControl()")); |
|
587 |
||
588 |
SetPointerCapture( EFalse ); |
|
589 |
ClaimPointerGrab( EFalse ); |
|
590 |
||
591 |
switch( iControlIndex ) |
|
592 |
{ |
|
593 |
case EMPXButtonBar: |
|
594 |
{ |
|
595 |
static_cast<CMPXVideoPlaybackButtonBar*>(iControl)->Reset(); |
|
596 |
break; |
|
597 |
} |
|
598 |
case EMPXProgressBar: |
|
599 |
{ |
|
600 |
static_cast<CMPXVideoPlaybackProgressBar*>(iControl)->Reset(); |
|
601 |
break; |
|
602 |
} |
|
603 |
case EMPXVolumeBar: |
|
604 |
{ |
|
605 |
static_cast<CMPXVideoPlaybackVolumeBar*>(iControl)->Reset(); |
|
606 |
break; |
|
607 |
} |
|
608 |
} |
|
609 |
} |
|
610 |
||
611 |
// End of File |