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 Video playback view's container.
|
|
15 |
*
|
|
16 |
*/
|
|
17 |
|
|
18 |
|
|
19 |
// Version : %version: 30 %
|
|
20 |
|
|
21 |
|
|
22 |
// INCLUDE FILES
|
|
23 |
|
|
24 |
#include <w32std.h> // RWindowBase
|
|
25 |
#include <e32base.h>
|
|
26 |
#include <StringLoader.h>
|
|
27 |
#include <AknUtils.h>
|
|
28 |
#include <eikclbd.h>
|
|
29 |
#include <aknconsts.h>
|
|
30 |
#include <AknUtils.h>
|
|
31 |
#include <AknIconUtils.h> // SetSize for the icons
|
|
32 |
#include <remconcoreapi.h>
|
|
33 |
#include <remconcoreapitarget.h>
|
|
34 |
#include <remconinterfaceselector.h> // Side volume key
|
|
35 |
#include <data_caging_path_literals.hrh> // KDC_APP_BITMAP_DIR
|
|
36 |
#include <aknlayoutscalable_apps.cdl.h>
|
|
37 |
#include <aknlayoutscalable_avkon.cdl.h>
|
|
38 |
#include <mpxvideoplaybackviews.rsg>
|
|
39 |
|
|
40 |
#include "mpxcommonvideoplaybackview.hrh"
|
|
41 |
#include "mpxvideoplaybackview.h"
|
|
42 |
#include "mpxvideoplaybackviewfiledetails.h"
|
|
43 |
#include "mpxvideoplaybackcontainer.h"
|
|
44 |
#include "mpxvideoplaybackcontrolscontroller.h"
|
|
45 |
#include "mpxvideoplaybackuserinputhandler.h"
|
|
46 |
#include <mpxvideoplaybackdefs.h>
|
|
47 |
#include "mpxvideo_debug.h"
|
|
48 |
|
|
49 |
using namespace AknLayoutScalable_Apps;
|
|
50 |
|
|
51 |
//
|
|
52 |
// CONSTANTS
|
|
53 |
//
|
|
54 |
const TInt KMPXRealOneLogoTimeOut = 600000;
|
|
55 |
|
|
56 |
// ======== MEMBER FUNCTIONS =======================================================================
|
|
57 |
|
|
58 |
// -------------------------------------------------------------------------------------------------
|
|
59 |
// CMPXVideoPlaybackContainer::CMPXVideoPlaybackContainer()
|
|
60 |
// -------------------------------------------------------------------------------------------------
|
|
61 |
//
|
|
62 |
CMPXVideoPlaybackContainer::CMPXVideoPlaybackContainer( CMPXVideoBasePlaybackView* aView )
|
|
63 |
: iView( aView )
|
|
64 |
{
|
|
65 |
}
|
|
66 |
|
|
67 |
// -------------------------------------------------------------------------------------------------
|
|
68 |
// CMPXVideoPlaybackContainer::NewL()
|
|
69 |
// -------------------------------------------------------------------------------------------------
|
|
70 |
//
|
|
71 |
CMPXVideoPlaybackContainer* CMPXVideoPlaybackContainer::NewL( CMPXVideoBasePlaybackView* aView )
|
|
72 |
{
|
|
73 |
MPX_DEBUG(_L("CMPXVideoPlaybackContainer::NewL()"));
|
|
74 |
|
|
75 |
CMPXVideoPlaybackContainer* self = new (ELeave) CMPXVideoPlaybackContainer( aView );
|
|
76 |
CleanupStack::PushL( self );
|
|
77 |
self->ConstructL();
|
|
78 |
CleanupStack::Pop();
|
|
79 |
return self;
|
|
80 |
}
|
|
81 |
|
|
82 |
// -------------------------------------------------------------------------------------------------
|
|
83 |
// CMPNormalScreenPlaybackContainer::ConstructL
|
|
84 |
// Symbian 2nd phase constructor can leave.
|
|
85 |
// -------------------------------------------------------------------------------------------------
|
|
86 |
//
|
|
87 |
void CMPXVideoPlaybackContainer::ConstructL()
|
|
88 |
{
|
|
89 |
MPX_ENTER_EXIT(_L("CMPXVideoPlaybackContainer::ConstructL()"));
|
|
90 |
|
|
91 |
SetMopParent( iView );
|
|
92 |
CreateWindowL();
|
|
93 |
|
|
94 |
TAknWindowLineLayout screenLayout = AknLayout::screen();
|
|
95 |
TRect screenRect = screenLayout.Rect();
|
|
96 |
|
|
97 |
SetRect( screenRect );
|
|
98 |
|
|
99 |
CreateControlsL();
|
|
100 |
|
|
101 |
iUserInputHandler =
|
|
102 |
CMPXVideoPlaybackUserInputHandler::NewL( this );
|
|
103 |
|
|
104 |
ActivateL();
|
|
105 |
}
|
|
106 |
|
|
107 |
// -------------------------------------------------------------------------------------------------
|
|
108 |
// CMPXVideoPlaybackContainer::~CMPXVideoPlaybackContainer()
|
|
109 |
// -------------------------------------------------------------------------------------------------
|
|
110 |
//
|
|
111 |
CMPXVideoPlaybackContainer::~CMPXVideoPlaybackContainer()
|
|
112 |
{
|
|
113 |
if ( iRealOneBitmapTimer )
|
|
114 |
{
|
|
115 |
iRealOneBitmapTimer->Cancel();
|
|
116 |
delete iRealOneBitmapTimer;
|
|
117 |
iRealOneBitmapTimer = NULL;
|
|
118 |
}
|
|
119 |
|
|
120 |
if ( iFileDetails )
|
|
121 |
{
|
|
122 |
delete iFileDetails;
|
|
123 |
iFileDetails = NULL;
|
|
124 |
}
|
|
125 |
|
|
126 |
if ( iControlsController )
|
|
127 |
{
|
|
128 |
delete iControlsController;
|
|
129 |
iControlsController = NULL;
|
|
130 |
}
|
|
131 |
|
|
132 |
if ( iUserInputHandler )
|
|
133 |
{
|
|
134 |
delete iUserInputHandler;
|
|
135 |
iUserInputHandler = NULL;
|
|
136 |
}
|
|
137 |
|
|
138 |
CloseWindow();
|
|
139 |
}
|
|
140 |
|
|
141 |
// -------------------------------------------------------------------------------------------------
|
|
142 |
// CMPXVideoPlaybackContainer::AddFileDetailsL()
|
|
143 |
// -------------------------------------------------------------------------------------------------
|
|
144 |
//
|
|
145 |
void CMPXVideoPlaybackContainer::AddFileDetailsL( CMPXVideoPlaybackViewFileDetails* aDetails )
|
|
146 |
{
|
|
147 |
MPX_ENTER_EXIT(_L("CMPXVideoPlaybackContainer::AddFileDetailsL()"));
|
|
148 |
|
|
149 |
//
|
|
150 |
// If clip is audio only Real Media, delay adding the file details until the
|
|
151 |
// Real One bitmap has been shown.
|
|
152 |
//
|
|
153 |
if ( iRealOneBitmapTimer && iRealOneBitmapTimer->IsActive() && ! aDetails->iVideoEnabled )
|
|
154 |
{
|
|
155 |
MPX_DEBUG(_L("CMPXVideoPlaybackContainer::AddFileDetailsL() file details delayed"));
|
|
156 |
|
|
157 |
iDelayedFileDetails = aDetails;
|
|
158 |
}
|
|
159 |
else
|
|
160 |
{
|
|
161 |
iControlsController->AddFileDetailsL( aDetails );
|
|
162 |
|
|
163 |
//
|
|
164 |
// Delete the temp file details since plugin initialization is complete
|
|
165 |
//
|
|
166 |
if ( iFileDetails )
|
|
167 |
{
|
|
168 |
delete iFileDetails;
|
|
169 |
iFileDetails = NULL;
|
|
170 |
}
|
|
171 |
}
|
|
172 |
}
|
|
173 |
|
|
174 |
// -------------------------------------------------------------------------------------------------
|
|
175 |
// CMPXVideoPlaybackContainer::GetWindow()
|
|
176 |
// -------------------------------------------------------------------------------------------------
|
|
177 |
//
|
|
178 |
RWindow& CMPXVideoPlaybackContainer::GetWindow() const
|
|
179 |
{
|
|
180 |
return Window();
|
|
181 |
}
|
|
182 |
|
|
183 |
// -------------------------------------------------------------------------------------------------
|
|
184 |
// From CCoeControl
|
|
185 |
// Handles key events.
|
|
186 |
// -------------------------------------------------------------------------------------------------
|
|
187 |
//
|
|
188 |
TKeyResponse CMPXVideoPlaybackContainer::OfferKeyEventL( const TKeyEvent& aKeyEvent,
|
|
189 |
TEventCode aType )
|
|
190 |
{
|
|
191 |
MPX_ENTER_EXIT(
|
|
192 |
_L("CMPXVideoPlaybackContainer::OfferKeyEventL()"),
|
|
193 |
_L("aKeyEvent = (%d,%d), aType = %d"), aKeyEvent.iCode, aKeyEvent.iScanCode, aType );
|
|
194 |
|
|
195 |
iKeyResponse = EKeyWasNotConsumed;
|
|
196 |
|
|
197 |
iUserInputHandler->ProcessKeyEventL( aKeyEvent, aType );
|
|
198 |
|
|
199 |
return iKeyResponse;
|
|
200 |
}
|
|
201 |
|
|
202 |
|
|
203 |
// -------------------------------------------------------------------------------------------------
|
|
204 |
// CMPXVideoPlaybackContainer::DoHandleKeyEventL()
|
|
205 |
// -------------------------------------------------------------------------------------------------
|
|
206 |
//
|
|
207 |
EXPORT_C void
|
|
208 |
CMPXVideoPlaybackContainer::DoHandleKeyEventL( const TKeyEvent& aKeyEvent, TEventCode aType )
|
|
209 |
{
|
|
210 |
MPX_ENTER_EXIT(_L("CMPXVideoPlaybackContainer::DoHandleKeyEventL()"));
|
|
211 |
|
|
212 |
switch ( aKeyEvent.iScanCode )
|
|
213 |
{
|
|
214 |
case EStdKeyDevice3: // rocker middle key
|
|
215 |
case EStdKeyEnter: // enter key on a qwerty key board
|
|
216 |
{
|
|
217 |
HandleRockerMiddleKeyL( aKeyEvent, aType );
|
|
218 |
iKeyResponse = EKeyWasConsumed;
|
|
219 |
break;
|
|
220 |
}
|
|
221 |
case EStdKeyUpArrow: // rocker up key
|
|
222 |
{
|
|
223 |
if ( aType != EEventKeyUp )
|
|
224 |
{
|
|
225 |
HandleCommandL( EMPXPbvCmdIncreaseVolume );
|
|
226 |
iKeyResponse = EKeyWasConsumed;
|
|
227 |
}
|
|
228 |
|
|
229 |
break;
|
|
230 |
}
|
|
231 |
case EStdKeyDownArrow: // rocker down key
|
|
232 |
{
|
|
233 |
if ( aType != EEventKeyUp )
|
|
234 |
{
|
|
235 |
HandleCommandL( EMPXPbvCmdDecreaseVolume );
|
|
236 |
iKeyResponse = EKeyWasConsumed;
|
|
237 |
}
|
|
238 |
|
|
239 |
break;
|
|
240 |
}
|
|
241 |
case EStdKeyLeftArrow: // rocker left key
|
|
242 |
{
|
|
243 |
HandleSeekBackL( aType );
|
|
244 |
iKeyResponse = EKeyWasConsumed;
|
|
245 |
break;
|
|
246 |
}
|
|
247 |
case EStdKeyRightArrow: // rocker right key
|
|
248 |
{
|
|
249 |
HandleSeekFwdL( aType );
|
|
250 |
iKeyResponse = EKeyWasConsumed;
|
|
251 |
break;
|
|
252 |
}
|
|
253 |
case EStdKeyDevice0: // LSK
|
|
254 |
case EStdKeyDevice1: // RSK
|
|
255 |
{
|
|
256 |
if ( aType == EEventKeyUp )
|
|
257 |
{
|
|
258 |
iControlsController->HandleEventL( EMPXControlCmdSoftKeyPressed,
|
|
259 |
aKeyEvent.iScanCode );
|
|
260 |
}
|
|
261 |
|
|
262 |
iKeyResponse = EKeyWasConsumed;
|
|
263 |
break;
|
|
264 |
}
|
|
265 |
}
|
|
266 |
}
|
|
267 |
|
|
268 |
// -------------------------------------------------------------------------------------------------
|
|
269 |
// Handles rocker's middle key => Toggles between play & pause
|
|
270 |
// -------------------------------------------------------------------------------------------------
|
|
271 |
//
|
|
272 |
void CMPXVideoPlaybackContainer::HandleRockerMiddleKeyL( const TKeyEvent& aKeyEvent,
|
|
273 |
TEventCode aType )
|
|
274 |
{
|
|
275 |
if ( aKeyEvent.iCode == EKeyNull && aType == EEventKeyDown )
|
|
276 |
{
|
|
277 |
iView->HandleCommandL( EMPXPbvCmdPlayPause );
|
|
278 |
}
|
|
279 |
}
|
|
280 |
|
|
281 |
// -------------------------------------------------------------------------------------------------
|
|
282 |
// Starts/Stops Seeking Forward
|
|
283 |
// -------------------------------------------------------------------------------------------------
|
|
284 |
//
|
|
285 |
void CMPXVideoPlaybackContainer::HandleSeekFwdL( TEventCode aType )
|
|
286 |
{
|
|
287 |
if ( aType == EEventKeyDown )
|
|
288 |
{
|
|
289 |
iView->HandleCommandL( EMPXPbvCmdSeekForward );
|
|
290 |
}
|
|
291 |
else if ( aType == EEventKeyUp )
|
|
292 |
{
|
|
293 |
iView->HandleCommandL( EMPXPbvCmdEndSeek );
|
|
294 |
}
|
|
295 |
}
|
|
296 |
|
|
297 |
// -------------------------------------------------------------------------------------------------
|
|
298 |
// Starts/Stops Seeking Backward
|
|
299 |
// -------------------------------------------------------------------------------------------------
|
|
300 |
//
|
|
301 |
void CMPXVideoPlaybackContainer::HandleSeekBackL( TEventCode aType )
|
|
302 |
{
|
|
303 |
if ( aType == EEventKeyDown )
|
|
304 |
{
|
|
305 |
iView->HandleCommandL(EMPXPbvCmdSeekBackward);
|
|
306 |
}
|
|
307 |
else if ( aType == EEventKeyUp )
|
|
308 |
{
|
|
309 |
iView->HandleCommandL( EMPXPbvCmdEndSeek );
|
|
310 |
}
|
|
311 |
}
|
|
312 |
|
|
313 |
// -------------------------------------------------------------------------------------------------
|
|
314 |
// From CCoeControl
|
|
315 |
// Handles a change to the control's resources.
|
|
316 |
// -------------------------------------------------------------------------------------------------
|
|
317 |
//
|
|
318 |
void CMPXVideoPlaybackContainer::HandleResourceChange( TInt aType )
|
|
319 |
{
|
|
320 |
CCoeControl::HandleResourceChange( aType );
|
|
321 |
}
|
|
322 |
|
|
323 |
// -------------------------------------------------------------------------------------------------
|
|
324 |
// From CCoeControl
|
|
325 |
// Gets the control's help context.
|
|
326 |
// -------------------------------------------------------------------------------------------------
|
|
327 |
//
|
|
328 |
void CMPXVideoPlaybackContainer::GetHelpContext( TCoeHelpContext& /*aContext*/ ) const
|
|
329 |
{
|
|
330 |
}
|
|
331 |
|
|
332 |
// -------------------------------------------------------------------------------------------------
|
|
333 |
// From CCoeControl
|
|
334 |
// Gets the number of controls contained in a compound control.
|
|
335 |
// -------------------------------------------------------------------------------------------------
|
|
336 |
//
|
|
337 |
TInt CMPXVideoPlaybackContainer::CountComponentControls() const
|
|
338 |
{
|
|
339 |
TInt count = 0;
|
|
340 |
|
|
341 |
if ( iRealOneBitmap )
|
|
342 |
{
|
|
343 |
count = 1;
|
|
344 |
}
|
|
345 |
|
|
346 |
return count;
|
|
347 |
}
|
|
348 |
|
|
349 |
// -------------------------------------------------------------------------------------------------
|
|
350 |
// From CCoeControl
|
|
351 |
// Gets an indexed component of a compound control.
|
|
352 |
// -------------------------------------------------------------------------------------------------
|
|
353 |
//
|
|
354 |
CCoeControl* CMPXVideoPlaybackContainer::ComponentControl( TInt aIndex ) const
|
|
355 |
{
|
|
356 |
CCoeControl* control = NULL;
|
|
357 |
|
|
358 |
switch ( aIndex )
|
|
359 |
{
|
|
360 |
case 0:
|
|
361 |
{
|
|
362 |
control = iRealOneBitmap;
|
|
363 |
break;
|
|
364 |
}
|
|
365 |
}
|
|
366 |
|
|
367 |
return control;
|
|
368 |
}
|
|
369 |
|
|
370 |
// -------------------------------------------------------------------------------------------------
|
|
371 |
// CMPXVideoPlaybackContainer::HandlePointerEventL()
|
|
372 |
// -------------------------------------------------------------------------------------------------
|
|
373 |
//
|
|
374 |
void CMPXVideoPlaybackContainer::HandlePointerEventL( const TPointerEvent& aPointerEvent )
|
|
375 |
{
|
|
376 |
MPX_ENTER_EXIT(_L("CMPXVideoPlaybackContainer::HandlePointerEventL()"));
|
|
377 |
|
|
378 |
iUserInputHandler->ProcessPointerEventL( this, aPointerEvent, EMpxVideoPlaybackContainer );
|
|
379 |
}
|
|
380 |
|
|
381 |
|
|
382 |
// -------------------------------------------------------------------------------------------------
|
|
383 |
// CMPXVideoPlaybackContainer::DoHandlePointerEventL()
|
|
384 |
//
|
|
385 |
// Gets called from the Controls Controller
|
|
386 |
// only if if OK to handle pointer events
|
|
387 |
// -------------------------------------------------------------------------------------------------
|
|
388 |
//
|
|
389 |
EXPORT_C
|
|
390 |
void CMPXVideoPlaybackContainer::DoHandlePointerEventL( const TPointerEvent& aPointerEvent )
|
|
391 |
{
|
|
392 |
MPX_ENTER_EXIT(_L("CMPXVideoPlaybackContainer::DoHandlePointerEventL()"),
|
|
393 |
_L("aPointerEvent.iType = %d"), aPointerEvent.iType );
|
|
394 |
|
|
395 |
if ( AknLayoutUtils::PenEnabled() )
|
|
396 |
{
|
|
397 |
if ( aPointerEvent.iType == TPointerEvent::EButton1Up )
|
|
398 |
{
|
|
399 |
iControlsController->HandleEventL( EMPXControlCmdToggleVisibility );
|
|
400 |
|
|
401 |
SetPointerCapture( EFalse );
|
|
402 |
ClaimPointerGrab( EFalse );
|
|
403 |
}
|
|
404 |
else if ( aPointerEvent.iType == TPointerEvent::EButton1Down )
|
|
405 |
{
|
|
406 |
SetPointerCapture( ETrue );
|
|
407 |
ClaimPointerGrab( ETrue );
|
|
408 |
}
|
|
409 |
}
|
|
410 |
}
|
|
411 |
|
|
412 |
// -------------------------------------------------------------------------------------------------
|
|
413 |
// CMPXVideoPlaybackContainer::Draw()
|
|
414 |
// -------------------------------------------------------------------------------------------------
|
|
415 |
//
|
|
416 |
void CMPXVideoPlaybackContainer::Draw( const TRect& aRect ) const
|
|
417 |
{
|
|
418 |
MPX_ENTER_EXIT(_L("CMPXVideoPlaybackContainer::Draw()"));
|
|
419 |
|
|
420 |
CWindowGc& gc = SystemGc();
|
|
421 |
|
|
422 |
gc.SetBrushStyle( CGraphicsContext::ESolidBrush );
|
|
423 |
gc.SetDrawMode( CGraphicsContext::EDrawModeWriteAlpha );
|
|
424 |
|
|
425 |
if ( Window().DisplayMode() == EColor16MAP )
|
|
426 |
{
|
|
427 |
gc.SetBrushColor( TRgb::Color16MAP(255) );
|
|
428 |
}
|
|
429 |
else if ( Window().DisplayMode() == EColor16MA )
|
|
430 |
{
|
|
431 |
gc.SetBrushColor( TRgb::Color16MA(0) );
|
|
432 |
}
|
|
433 |
|
|
434 |
gc.Clear( aRect );
|
|
435 |
}
|
|
436 |
|
|
437 |
// -------------------------------------------------------------------------------------------------
|
|
438 |
// CMPXVideoPlaybackContainer::HandleEventL()
|
|
439 |
// -------------------------------------------------------------------------------------------------
|
|
440 |
//
|
|
441 |
void CMPXVideoPlaybackContainer::HandleEventL( TMPXVideoPlaybackControlCommandIds aEvent,
|
|
442 |
TInt aValue )
|
|
443 |
{
|
|
444 |
MPX_ENTER_EXIT(_L("CMPXVideoPlaybackContainer::HandleEventL()"));
|
|
445 |
|
|
446 |
if ( aEvent == EMPXControlCmdHandleBackgroundEvent )
|
|
447 |
{
|
|
448 |
iUserInputHandler->SetForeground(EFalse);
|
|
449 |
}
|
|
450 |
else if ( aEvent == EMPXControlCmdHandleForegroundEvent )
|
|
451 |
{
|
|
452 |
iUserInputHandler->SetForeground(ETrue);
|
|
453 |
}
|
|
454 |
|
|
455 |
iControlsController->HandleEventL( aEvent, aValue );
|
|
456 |
}
|
|
457 |
|
|
458 |
// -------------------------------------------------------------------------------------------------
|
|
459 |
// CMPXVideoPlaybackContainer::HandleCommandL()
|
|
460 |
// -------------------------------------------------------------------------------------------------
|
|
461 |
//
|
|
462 |
EXPORT_C void CMPXVideoPlaybackContainer::HandleCommandL( TInt aCommand, TInt aValue )
|
|
463 |
{
|
|
464 |
MPX_ENTER_EXIT(_L("CMPXVideoPlaybackContainer::HandleCommandL()"),
|
|
465 |
_L("aCommand = %d aValue = %d"), aCommand, aValue );
|
|
466 |
|
|
467 |
switch ( aCommand )
|
|
468 |
{
|
|
469 |
case EMPXPbvCmdSetPosition:
|
|
470 |
{
|
|
471 |
iView->SetPropertyL( EPbPropertyPosition, (TInt)aValue * KPbMilliMultiplier );
|
|
472 |
break;
|
|
473 |
}
|
|
474 |
case EMPXPbvCmdResetControls:
|
|
475 |
{
|
|
476 |
if ( iRealOneBitmapTimer )
|
|
477 |
{
|
|
478 |
iRealOneBitmapTimer->Cancel();
|
|
479 |
delete iRealOneBitmapTimer;
|
|
480 |
iRealOneBitmapTimer = NULL;
|
|
481 |
}
|
|
482 |
|
|
483 |
//
|
|
484 |
// Recreate the controls with the new clip
|
|
485 |
//
|
|
486 |
CreateControlsL();
|
|
487 |
|
|
488 |
//
|
|
489 |
// Retrieve the PDL information for container
|
|
490 |
//
|
|
491 |
iView->RetrievePdlInformationL();
|
|
492 |
|
|
493 |
break;
|
|
494 |
}
|
|
495 |
case EAknSoftkeyOptions:
|
|
496 |
{
|
|
497 |
static_cast<CAknView*>(iView)->ProcessCommandL( EAknSoftkeyOptions );
|
|
498 |
break;
|
|
499 |
}
|
|
500 |
case EMPXPbvCmdSetVolume:
|
|
501 |
{
|
|
502 |
iView->SetPropertyL( EPbPropertyVolume, aValue );
|
|
503 |
break;
|
|
504 |
}
|
|
505 |
case EMPXPbvSurfaceCreated:
|
|
506 |
{
|
|
507 |
iControlsController->HandleEventL( EMPXControlCmdSurfaceCreated );
|
|
508 |
DrawNow();
|
|
509 |
break;
|
|
510 |
}
|
|
511 |
case EMPXPbvSurfaceRemoved:
|
|
512 |
{
|
|
513 |
iControlsController->HandleEventL( EMPXControlCmdSurfaceRemoved );
|
|
514 |
DrawNow();
|
|
515 |
break;
|
|
516 |
}
|
|
517 |
default:
|
|
518 |
{
|
|
519 |
iView->HandleCommandL( aCommand );
|
|
520 |
break;
|
|
521 |
}
|
|
522 |
}
|
|
523 |
}
|
|
524 |
|
|
525 |
// -------------------------------------------------------------------------------------------------
|
|
526 |
// CMPXVideoPlaybackContainer::CreateControlsL()
|
|
527 |
// -------------------------------------------------------------------------------------------------
|
|
528 |
//
|
|
529 |
void CMPXVideoPlaybackContainer::CreateControlsL()
|
|
530 |
{
|
|
531 |
MPX_ENTER_EXIT(_L("CMPXVideoPlaybackContainer::CreateControlsL()"));
|
|
532 |
|
|
533 |
//
|
|
534 |
// Query playback plugin for filename and mode
|
|
535 |
//
|
|
536 |
CMPXCommand* cmd = CMPXCommand::NewL();
|
|
537 |
CleanupStack::PushL( cmd );
|
|
538 |
|
|
539 |
iView->RetrieveFileNameAndModeL( cmd );
|
|
540 |
|
|
541 |
//
|
|
542 |
// Create a temporary file details that is populated with the
|
|
543 |
// file name and playback mode. This will be delete when
|
|
544 |
// plugin initialization is complete
|
|
545 |
//
|
|
546 |
if ( iFileDetails )
|
|
547 |
{
|
|
548 |
delete iFileDetails;
|
|
549 |
iFileDetails = NULL;
|
|
550 |
}
|
|
551 |
|
|
552 |
iFileDetails = CMPXVideoPlaybackViewFileDetails::NewL();
|
|
553 |
|
|
554 |
TPtrC fileName( cmd->ValueText( KMPXMediaVideoPlaybackFileName ) );
|
|
555 |
iFileDetails->iClipName = fileName.AllocL();
|
|
556 |
|
|
557 |
iFileDetails->iPlaybackMode = (TMPXVideoMode) cmd->ValueTObjectL<TInt>( KMPXMediaVideoMode );
|
|
558 |
|
|
559 |
iFileDetails->iTvOutConnected = cmd->ValueTObjectL<TInt>( KMPXMediaVideoTvOutConnected );
|
|
560 |
|
|
561 |
TPtrC mimeType( cmd->ValueText( KMPXMediaVideoRecognizedMimeType ) );
|
|
562 |
iFileDetails->iMimeType = mimeType.AllocL();
|
|
563 |
|
|
564 |
CleanupStack::PopAndDestroy( cmd );
|
|
565 |
|
|
566 |
if ( iControlsController )
|
|
567 |
{
|
|
568 |
delete iControlsController;
|
|
569 |
iControlsController = NULL;
|
|
570 |
}
|
|
571 |
|
|
572 |
iControlsController = CMPXVideoPlaybackControlsController::NewL( this, Rect(), iFileDetails );
|
|
573 |
|
|
574 |
//
|
|
575 |
// Retrieve the Real One Logo bitmap
|
|
576 |
//
|
|
577 |
iRealOneBitmap = iControlsController->GetBitmap( EMPXRealLogoBitmap );
|
|
578 |
|
|
579 |
if ( iRealOneBitmap )
|
|
580 |
{
|
|
581 |
//
|
|
582 |
// Start timer since Real One bitmap is created
|
|
583 |
//
|
|
584 |
iRealOneBitmapTimer = CPeriodic::NewL( CActive::EPriorityStandard );
|
|
585 |
|
|
586 |
iRealOneBitmapTimer->Start(
|
|
587 |
KMPXRealOneLogoTimeOut,
|
|
588 |
0,
|
|
589 |
TCallBack( CMPXVideoPlaybackContainer::HandleRealOneBitmapTimeout, this ) );
|
|
590 |
|
|
591 |
DrawNow();
|
|
592 |
}
|
|
593 |
}
|
|
594 |
|
|
595 |
// -------------------------------------------------------------------------------------------------
|
|
596 |
// CMPXVideoPlaybackContainer::UserInputHandler()
|
|
597 |
// -------------------------------------------------------------------------------------------------
|
|
598 |
//
|
|
599 |
EXPORT_C CMPXVideoPlaybackUserInputHandler* CMPXVideoPlaybackContainer::UserInputHandler()
|
|
600 |
{
|
|
601 |
MPX_DEBUG(_L("CMPXVideoPlaybackContainer::UserInputHandler()"));
|
|
602 |
return iUserInputHandler;
|
|
603 |
}
|
|
604 |
|
|
605 |
// -------------------------------------------------------------------------------------------------
|
|
606 |
// CMPXVideoPlaybackContainer::IsRealOneBitmapTimerActive()
|
|
607 |
// -------------------------------------------------------------------------------------------------
|
|
608 |
//
|
|
609 |
TBool CMPXVideoPlaybackContainer::IsRealOneBitmapTimerActive()
|
|
610 |
{
|
|
611 |
TBool timerActive( EFalse );
|
|
612 |
|
|
613 |
if ( iRealOneBitmapTimer )
|
|
614 |
{
|
|
615 |
timerActive = iRealOneBitmapTimer->IsActive();
|
|
616 |
}
|
|
617 |
|
|
618 |
MPX_DEBUG(_L("CMPXVideoPlaybackContainer::IsRealOneBitmapTimerActive(%d)"), timerActive);
|
|
619 |
|
|
620 |
return timerActive;
|
|
621 |
}
|
|
622 |
|
|
623 |
|
|
624 |
// -------------------------------------------------------------------------------------------------
|
|
625 |
// CMPXVideoPlaybackContainer::HandleRealOneBitmapTimeout
|
|
626 |
// -------------------------------------------------------------------------------------------------
|
|
627 |
//
|
|
628 |
TInt CMPXVideoPlaybackContainer::HandleRealOneBitmapTimeout( TAny* aPtr )
|
|
629 |
{
|
|
630 |
MPX_DEBUG(_L("CMPXVideoPlaybackContainer::HandleRealOneBitmapTimeout()"));
|
|
631 |
static_cast<CMPXVideoPlaybackContainer*>(aPtr)->DoHandleRealOneBitmapTimeout();
|
|
632 |
return KErrNone;
|
|
633 |
}
|
|
634 |
|
|
635 |
// -------------------------------------------------------------------------------------------------
|
|
636 |
// CMPXVideoPlaybackContainer::DoHandleRealOneBitmapTimeout
|
|
637 |
// -------------------------------------------------------------------------------------------------
|
|
638 |
//
|
|
639 |
void CMPXVideoPlaybackContainer::DoHandleRealOneBitmapTimeout()
|
|
640 |
{
|
|
641 |
MPX_DEBUG(_L("CMPXVideoPlaybackContainer::DoHandleRealOneBitmapTimeout()"));
|
|
642 |
|
|
643 |
if ( iDelayedFileDetails )
|
|
644 |
{
|
|
645 |
MPX_TRAPD( err, iControlsController->AddFileDetailsL( iDelayedFileDetails ) );
|
|
646 |
|
|
647 |
//
|
|
648 |
// Delete the temp file details since plugin initialization is complete
|
|
649 |
//
|
|
650 |
if ( iFileDetails )
|
|
651 |
{
|
|
652 |
delete iFileDetails;
|
|
653 |
iFileDetails = NULL;
|
|
654 |
}
|
|
655 |
|
|
656 |
iDelayedFileDetails = NULL;
|
|
657 |
}
|
|
658 |
|
|
659 |
if ( iRealOneBitmapTimer->IsActive() )
|
|
660 |
{
|
|
661 |
iRealOneBitmapTimer->Cancel();
|
|
662 |
delete iRealOneBitmapTimer;
|
|
663 |
iRealOneBitmapTimer = NULL;
|
|
664 |
}
|
|
665 |
|
|
666 |
MPX_TRAPD( err, iView->HandleCommandL( EMPXPbvCmdRealOneBitmapTimeout ) );
|
|
667 |
}
|
|
668 |
|
|
669 |
// EOF
|