55
|
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 playback view's input handler
|
|
15 |
*
|
|
16 |
*/
|
|
17 |
|
58
|
18 |
// Version : %version: 11 %
|
55
|
19 |
|
|
20 |
|
|
21 |
// INCLUDE FILES
|
|
22 |
#include <e32std.h>
|
|
23 |
#include <w32std.h> // RWindowBase
|
|
24 |
#include <e32base.h>
|
|
25 |
#include <eikclbd.h>
|
|
26 |
#include <aknconsts.h>
|
|
27 |
#include <remconcoreapi.h>
|
|
28 |
#include <remconcoreapitarget.h>
|
|
29 |
#include <remconinterfaceselector.h> // Side volume key
|
|
30 |
#include <mpxplaybackframeworkdefs.h>
|
|
31 |
#include <centralrepository.h> // for peripheral display timeout setting
|
|
32 |
#include <settingsinternalcrkeys.h> // display timeout setting keys
|
|
33 |
#include <hwrmlightdomaincrkeys.h>
|
|
34 |
#include <mpxvideoplaybackdefs.h>
|
58
|
35 |
#include <avkondomainpskeys.h>
|
55
|
36 |
|
|
37 |
#include "mpxvideo_debug.h"
|
|
38 |
#include "mpxvideoviewwrapper.h"
|
|
39 |
#include "mpxcommonvideoplaybackview.hrh"
|
|
40 |
#include "videoplaybackuserinputhandler.h"
|
|
41 |
|
|
42 |
|
|
43 |
|
|
44 |
// ======== MEMBER FUNCTIONS =======================================================================
|
|
45 |
|
|
46 |
// -------------------------------------------------------------------------------------------------
|
|
47 |
// CVideoPlaybackUserInputHandler::CVideoPlaybackUserInputHandler()
|
|
48 |
// -------------------------------------------------------------------------------------------------
|
|
49 |
//
|
|
50 |
CVideoPlaybackUserInputHandler::CVideoPlaybackUserInputHandler( CMPXVideoViewWrapper* aWrapper )
|
58
|
51 |
: iProcessingInputType( EVideoNone )
|
|
52 |
, iForeground( ETrue )
|
|
53 |
, iViewWrapper( aWrapper )
|
55
|
54 |
{
|
|
55 |
}
|
|
56 |
|
|
57 |
// -------------------------------------------------------------------------------------------------
|
|
58 |
// CVideoPlaybackUserInputHandler::NewL()
|
|
59 |
// -------------------------------------------------------------------------------------------------
|
|
60 |
//
|
58
|
61 |
CVideoPlaybackUserInputHandler* CVideoPlaybackUserInputHandler::NewL( CMPXVideoViewWrapper* aWrapper )
|
55
|
62 |
{
|
58
|
63 |
MPX_ENTER_EXIT(_L("CVideoPlaybackUserInputHandler::NewL()"));
|
55
|
64 |
|
|
65 |
CVideoPlaybackUserInputHandler* self =
|
|
66 |
new (ELeave) CVideoPlaybackUserInputHandler( aWrapper );
|
|
67 |
CleanupStack::PushL( self );
|
58
|
68 |
self->ConstructL();
|
55
|
69 |
CleanupStack::Pop();
|
|
70 |
return self;
|
|
71 |
}
|
|
72 |
|
|
73 |
// -------------------------------------------------------------------------------------------------
|
|
74 |
// CVideoPlaybackUserInputHandler::ConstructL
|
|
75 |
// Symbian 2nd phase constructor can leave.
|
|
76 |
// -------------------------------------------------------------------------------------------------
|
|
77 |
//
|
58
|
78 |
void CVideoPlaybackUserInputHandler::ConstructL()
|
55
|
79 |
{
|
|
80 |
MPX_ENTER_EXIT(_L("CVideoPlaybackUserInputHandler::ConstructL()"));
|
|
81 |
|
|
82 |
iVolumeRepeatTimer = CPeriodic::NewL( CActive::EPriorityStandard );
|
58
|
83 |
|
55
|
84 |
iInterfaceSelector = CRemConInterfaceSelector::NewL();
|
|
85 |
iCoreTarget = CRemConCoreApiTarget::NewL( *iInterfaceSelector, *this );
|
|
86 |
|
|
87 |
// not detrimental if Media Keys dont work - so ignore any errors here
|
|
88 |
TRAP_IGNORE( iInterfaceSelector->OpenTargetL() );
|
|
89 |
}
|
|
90 |
|
|
91 |
// -------------------------------------------------------------------------------------------------
|
|
92 |
// CVideoPlaybackUserInputHandler::~CVideoPlaybackUserInputHandler()
|
|
93 |
// -------------------------------------------------------------------------------------------------
|
|
94 |
//
|
|
95 |
CVideoPlaybackUserInputHandler::~CVideoPlaybackUserInputHandler()
|
|
96 |
{
|
58
|
97 |
MPX_ENTER_EXIT(_L("CVideoPlaybackUserInputHandler::~CVideoPlaybackUserInputHandler()"));
|
|
98 |
|
55
|
99 |
if ( iVolumeRepeatTimer )
|
|
100 |
{
|
|
101 |
iVolumeRepeatTimer->Cancel();
|
|
102 |
delete iVolumeRepeatTimer;
|
|
103 |
}
|
|
104 |
|
|
105 |
if ( iInterfaceSelector )
|
|
106 |
{
|
|
107 |
delete iInterfaceSelector;
|
|
108 |
iCoreTarget = NULL;
|
|
109 |
iInterfaceSelector = NULL;
|
|
110 |
}
|
|
111 |
}
|
|
112 |
|
|
113 |
// -------------------------------------------------------------------------------------------------
|
|
114 |
// CVideoPlaybackUserInputHandler::MrccatoPlay()
|
|
115 |
// -------------------------------------------------------------------------------------------------
|
|
116 |
//
|
|
117 |
void CVideoPlaybackUserInputHandler::MrccatoPlay( TRemConCoreApiPlaybackSpeed /*aSpeed*/,
|
|
118 |
TRemConCoreApiButtonAction aButtonAct )
|
|
119 |
{
|
|
120 |
MPX_ENTER_EXIT(
|
|
121 |
_L("CVideoPlaybackUserInputHandler::MrccatoPlay"),
|
|
122 |
_L("aButtonAct = %d"), aButtonAct );
|
|
123 |
|
|
124 |
ProcessMediaKey(ERemConCoreApiPlay, aButtonAct);
|
|
125 |
}
|
|
126 |
|
|
127 |
// -------------------------------------------------------------------------------------------------
|
|
128 |
// CVideoPlaybackUserInputHandler::MrccatoCommand()
|
|
129 |
// -------------------------------------------------------------------------------------------------
|
|
130 |
//
|
|
131 |
void CVideoPlaybackUserInputHandler::MrccatoCommand( TRemConCoreApiOperationId aOperationId,
|
|
132 |
TRemConCoreApiButtonAction aButtonAct )
|
|
133 |
{
|
|
134 |
MPX_ENTER_EXIT(
|
|
135 |
_L("CVideoPlaybackUserInputHandler::MrccatoCommand"),
|
|
136 |
_L("aButtonAct = %d"), aButtonAct );
|
|
137 |
|
|
138 |
ProcessMediaKey(aOperationId, aButtonAct);
|
|
139 |
}
|
|
140 |
|
|
141 |
|
|
142 |
// -------------------------------------------------------------------------------------------------
|
|
143 |
// CVideoPlaybackUserInputHandler::DoHandleMediaKey()
|
|
144 |
// -------------------------------------------------------------------------------------------------
|
|
145 |
//
|
|
146 |
void CVideoPlaybackUserInputHandler::DoHandleMediaKey( TRemConCoreApiOperationId aOperationId,
|
|
147 |
TRemConCoreApiButtonAction aButtonAct )
|
|
148 |
{
|
58
|
149 |
MPX_ENTER_EXIT(_L("CVideoPlaybackUserInputHandler::DoHandleMediaKey()"),
|
|
150 |
_L("aOperationId = %d"), aOperationId );
|
55
|
151 |
|
|
152 |
switch ( aOperationId )
|
|
153 |
{
|
|
154 |
case ERemConCoreApiStop:
|
|
155 |
{
|
|
156 |
if ( aButtonAct == ERemConCoreApiButtonClick )
|
|
157 |
{
|
58
|
158 |
TRAP_IGNORE( iViewWrapper->HandleCommandL( EMPXPbvCmdStop ) );
|
55
|
159 |
}
|
|
160 |
break;
|
|
161 |
}
|
|
162 |
case ERemConCoreApiRewind:
|
|
163 |
{
|
58
|
164 |
HandleRewind( aButtonAct );
|
55
|
165 |
break;
|
|
166 |
}
|
|
167 |
case ERemConCoreApiFastForward:
|
|
168 |
{
|
58
|
169 |
HandleFastForward( aButtonAct );
|
55
|
170 |
break;
|
|
171 |
}
|
|
172 |
case ERemConCoreApiVolumeUp:
|
|
173 |
{
|
58
|
174 |
HandleVolumeUp( aButtonAct );
|
55
|
175 |
break;
|
|
176 |
}
|
|
177 |
case ERemConCoreApiVolumeDown:
|
|
178 |
{
|
58
|
179 |
HandleVolumeDown( aButtonAct );
|
55
|
180 |
break;
|
|
181 |
}
|
|
182 |
case ERemConCoreApiPausePlayFunction:
|
|
183 |
{
|
|
184 |
if ( aButtonAct == ERemConCoreApiButtonClick )
|
|
185 |
{
|
58
|
186 |
TRAP_IGNORE( iViewWrapper->HandleCommandL( EMPXPbvCmdPlayPause ) );
|
55
|
187 |
}
|
|
188 |
break;
|
|
189 |
}
|
|
190 |
case ERemConCoreApiPause:
|
|
191 |
{
|
58
|
192 |
TRAP_IGNORE( iViewWrapper->HandleCommandL( EMPXPbvCmdPause ) );
|
55
|
193 |
break;
|
|
194 |
}
|
|
195 |
case ERemConCoreApiPlay:
|
|
196 |
{
|
|
197 |
if ( aButtonAct == ERemConCoreApiButtonClick )
|
|
198 |
{
|
|
199 |
TRAP_IGNORE(iViewWrapper->HandleCommandL(EMPXPbvCmdPlay));
|
|
200 |
}
|
|
201 |
break;
|
|
202 |
}
|
|
203 |
default:
|
58
|
204 |
{
|
55
|
205 |
break;
|
58
|
206 |
}
|
55
|
207 |
}
|
|
208 |
}
|
|
209 |
|
|
210 |
// -------------------------------------------------------------------------------------------------
|
|
211 |
// CVideoPlaybackUserInputHandler::HandleFastForward()
|
|
212 |
// -------------------------------------------------------------------------------------------------
|
|
213 |
//
|
|
214 |
void CVideoPlaybackUserInputHandler::HandleFastForward( TRemConCoreApiButtonAction aButtonAct )
|
|
215 |
{
|
58
|
216 |
MPX_ENTER_EXIT(_L("CVideoPlaybackUserInputHandler::HandleFastForward()"));
|
|
217 |
|
|
218 |
if ( aButtonAct == ERemConCoreApiButtonPress )
|
55
|
219 |
{
|
58
|
220 |
TRAP_IGNORE( iViewWrapper->HandleCommandL( EMPXPbvCmdSeekForward ) );
|
55
|
221 |
}
|
58
|
222 |
else if ( aButtonAct == ERemConCoreApiButtonRelease )
|
55
|
223 |
{
|
58
|
224 |
TRAP_IGNORE( iViewWrapper->HandleCommandL( EMPXPbvCmdEndSeek ) );
|
55
|
225 |
}
|
|
226 |
}
|
|
227 |
|
|
228 |
|
|
229 |
// -------------------------------------------------------------------------------------------------
|
|
230 |
// CVideoPlaybackUserInputHandler::HandleRewind()
|
|
231 |
// -------------------------------------------------------------------------------------------------
|
|
232 |
//
|
|
233 |
void CVideoPlaybackUserInputHandler::HandleRewind( TRemConCoreApiButtonAction aButtonAct )
|
|
234 |
{
|
58
|
235 |
MPX_ENTER_EXIT(_L("CVideoPlaybackUserInputHandler::HandleFastForward()"));
|
|
236 |
|
|
237 |
if ( aButtonAct == ERemConCoreApiButtonPress )
|
55
|
238 |
{
|
58
|
239 |
TRAP_IGNORE( iViewWrapper->HandleCommandL( EMPXPbvCmdSeekBackward ) );
|
55
|
240 |
}
|
58
|
241 |
else if ( aButtonAct == ERemConCoreApiButtonRelease )
|
55
|
242 |
{
|
58
|
243 |
TRAP_IGNORE( iViewWrapper->HandleCommandL( EMPXPbvCmdEndSeek ) );
|
55
|
244 |
}
|
|
245 |
}
|
|
246 |
|
|
247 |
// -------------------------------------------------------------------------------------------------
|
|
248 |
// CVideoPlaybackUserInputHandler::HandleVolumeUp()
|
|
249 |
// -------------------------------------------------------------------------------------------------
|
|
250 |
//
|
|
251 |
void CVideoPlaybackUserInputHandler::HandleVolumeUp( TRemConCoreApiButtonAction aButtonAct )
|
|
252 |
{
|
58
|
253 |
MPX_ENTER_EXIT(_L("CVideoPlaybackUserInputHandler::HandleVolumeUp()"),
|
|
254 |
_L("aButtonAct = %d"), aButtonAct );
|
|
255 |
|
55
|
256 |
switch ( aButtonAct )
|
|
257 |
{
|
|
258 |
case ERemConCoreApiButtonPress:
|
|
259 |
{
|
|
260 |
// Volume Up - Pressed
|
|
261 |
if ( iVolumeRepeatTimer->IsActive() )
|
|
262 |
{
|
|
263 |
iVolumeRepeatTimer->Cancel();
|
|
264 |
}
|
|
265 |
|
|
266 |
iVolumeRepeatUp = ETrue;
|
58
|
267 |
|
55
|
268 |
iVolumeRepeatTimer->Start(
|
|
269 |
KAknStandardKeyboardRepeatRate,
|
|
270 |
KAknStandardKeyboardRepeatRate,
|
|
271 |
TCallBack(
|
|
272 |
CVideoPlaybackUserInputHandler::HandleVolumeRepeatTimeoutL,
|
|
273 |
this ) );
|
|
274 |
|
|
275 |
break;
|
|
276 |
}
|
|
277 |
case ERemConCoreApiButtonRelease:
|
|
278 |
{
|
|
279 |
// Volume Up - Released
|
|
280 |
iVolumeRepeatTimer->Cancel();
|
|
281 |
break;
|
|
282 |
}
|
|
283 |
case ERemConCoreApiButtonClick:
|
|
284 |
{
|
|
285 |
// Volume Up - Clicked
|
|
286 |
TRAP_IGNORE( iViewWrapper->HandleCommandL( EMPXPbvCmdIncreaseVolume ) );
|
|
287 |
break;
|
|
288 |
}
|
|
289 |
}
|
|
290 |
}
|
|
291 |
|
|
292 |
// -------------------------------------------------------------------------------------------------
|
|
293 |
// CVideoPlaybackUserInputHandler::HandleVolumeDown()
|
|
294 |
// -------------------------------------------------------------------------------------------------
|
|
295 |
//
|
|
296 |
void CVideoPlaybackUserInputHandler::HandleVolumeDown( TRemConCoreApiButtonAction aButtonAct )
|
|
297 |
{
|
58
|
298 |
MPX_ENTER_EXIT(_L("CVideoPlaybackUserInputHandler::HandleVolumeDown()"));
|
|
299 |
|
55
|
300 |
switch ( aButtonAct )
|
|
301 |
{
|
|
302 |
case ERemConCoreApiButtonPress:
|
|
303 |
{
|
|
304 |
// Volume Up - Pressed
|
|
305 |
if ( iVolumeRepeatTimer->IsActive() )
|
|
306 |
{
|
|
307 |
iVolumeRepeatTimer->Cancel();
|
|
308 |
}
|
|
309 |
|
|
310 |
iVolumeRepeatUp = EFalse;
|
58
|
311 |
|
55
|
312 |
iVolumeRepeatTimer->Start(
|
|
313 |
KAknStandardKeyboardRepeatRate,
|
|
314 |
KAknStandardKeyboardRepeatRate,
|
|
315 |
TCallBack(
|
|
316 |
CVideoPlaybackUserInputHandler::HandleVolumeRepeatTimeoutL,
|
|
317 |
this ) );
|
|
318 |
|
|
319 |
break;
|
|
320 |
}
|
|
321 |
case ERemConCoreApiButtonRelease:
|
|
322 |
{
|
|
323 |
// Volume Up - Released
|
|
324 |
iVolumeRepeatTimer->Cancel();
|
|
325 |
break;
|
|
326 |
}
|
|
327 |
case ERemConCoreApiButtonClick:
|
|
328 |
{
|
|
329 |
// Volume Down - Clicked
|
|
330 |
TRAP_IGNORE( iViewWrapper->HandleCommandL( EMPXPbvCmdDecreaseVolume ) );
|
|
331 |
break;
|
|
332 |
}
|
|
333 |
}
|
|
334 |
}
|
|
335 |
|
58
|
336 |
/*
|
55
|
337 |
// -------------------------------------------------------------------------------------------------
|
58
|
338 |
// CMPXVideoPlaybackUserInputHandler::ProcessPointerEvent()
|
55
|
339 |
// -------------------------------------------------------------------------------------------------
|
|
340 |
//
|
58
|
341 |
void
|
|
342 |
CMPXVideoPlaybackUserInputHandler::ProcessPointerEventL( CCoeControl* aControl,
|
|
343 |
const TPointerEvent& aPointerEvent,
|
|
344 |
TMPXVideoControlType aControl )
|
55
|
345 |
{
|
58
|
346 |
MPX_ENTER_EXIT(_L("CMPXVideoPlaybackUserInputHandler::ProcessPointerEvent()"),
|
|
347 |
_L("iProcessingInputType = %d, aPointerEvent.iType = %d"),
|
|
348 |
iProcessingInputType, aPointerEvent.iType );
|
55
|
349 |
|
58
|
350 |
switch ( iProcessingInputType )
|
55
|
351 |
{
|
58
|
352 |
case EMpxVideoNone:
|
55
|
353 |
{
|
58
|
354 |
if ( aPointerEvent.iType == TPointerEvent::EButton1Down && IsUserInputAllowed() )
|
55
|
355 |
{
|
58
|
356 |
iProcessingInputType = EMpxVideoTouch;
|
|
357 |
|
|
358 |
//
|
|
359 |
// Save the active controls pointer to reroute invalid pointer events
|
|
360 |
//
|
|
361 |
iActiveControlPtr = aControl;
|
|
362 |
iActiveControlType = aMPXControl;
|
|
363 |
|
|
364 |
ReRoutePointerEventL( aControl, aPointerEvent, aMPXControl );
|
55
|
365 |
}
|
58
|
366 |
|
55
|
367 |
break;
|
|
368 |
}
|
58
|
369 |
case EMpxVideoTouch:
|
55
|
370 |
{
|
58
|
371 |
if ( aControl == iActiveControlPtr )
|
55
|
372 |
{
|
58
|
373 |
//
|
|
374 |
// Event is from the active control, process pointer event normally
|
|
375 |
//
|
|
376 |
if ( aPointerEvent.iType != TPointerEvent::EButton1Down )
|
55
|
377 |
{
|
58
|
378 |
ReRoutePointerEventL( aControl, aPointerEvent, aMPXControl );
|
55
|
379 |
|
58
|
380 |
//
|
|
381 |
// reset the value only on pointer up event - but not on drag
|
|
382 |
//
|
|
383 |
if ( aPointerEvent.iType == TPointerEvent::EButton1Up )
|
|
384 |
{
|
|
385 |
iProcessingInputType = EMpxVideoNone;
|
|
386 |
iActiveControlPtr = NULL;
|
|
387 |
}
|
55
|
388 |
}
|
|
389 |
}
|
58
|
390 |
else
|
|
391 |
{
|
|
392 |
//
|
|
393 |
// Event is from non active control
|
|
394 |
// This should not happen, but if event is a button up event,
|
|
395 |
// end the current active control pointer processing
|
|
396 |
//
|
|
397 |
if ( aPointerEvent.iType == TPointerEvent::EButton1Up )
|
|
398 |
{
|
|
399 |
//
|
|
400 |
// Reroute button up event to active control and end current
|
|
401 |
// control processing
|
|
402 |
//
|
|
403 |
ReRoutePointerEventL( iActiveControlPtr, aPointerEvent, iActiveControlType );
|
|
404 |
iProcessingInputType = EMpxVideoNone;
|
|
405 |
iActiveControlPtr = NULL;
|
|
406 |
}
|
|
407 |
}
|
|
408 |
|
55
|
409 |
break;
|
|
410 |
}
|
58
|
411 |
} // switch
|
55
|
412 |
}
|
|
413 |
|
|
414 |
// -------------------------------------------------------------------------------------------------
|
58
|
415 |
// CMPXVideoPlaybackUserInputHandler::ReRoutePointerEventL()
|
|
416 |
// -------------------------------------------------------------------------------------------------
|
|
417 |
//
|
|
418 |
void CMPXVideoPlaybackUserInputHandler::ReRoutePointerEventL( CCoeControl* aControl,
|
|
419 |
const TPointerEvent& aPointerEvent,
|
|
420 |
TVideoControlType aMPXControl )
|
|
421 |
{
|
|
422 |
MPX_ENTER_EXIT(_L("CMPXVideoPlaybackUserInputHandler::ReRoutePointerEventL()"),
|
|
423 |
_L("aMPXControl = %d"), aMPXControl );
|
|
424 |
|
|
425 |
if ( aMPXControl == EMpxVideoPlaybackContainer )
|
|
426 |
{
|
|
427 |
iContainer->DoHandlePointerEventL( aPointerEvent );
|
|
428 |
}
|
|
429 |
else if ( aMPXControl == EMpxVideoPlaybackControl )
|
|
430 |
{
|
|
431 |
static_cast<CMPXVideoPlaybackControl*>(aControl)->DoHandlePointerEventL( aPointerEvent );
|
|
432 |
}
|
|
433 |
}*/
|
|
434 |
|
|
435 |
// -------------------------------------------------------------------------------------------------
|
55
|
436 |
// CVideoPlaybackUserInputHandler::ProcessMediaKey()
|
|
437 |
// -------------------------------------------------------------------------------------------------
|
|
438 |
//
|
|
439 |
void CVideoPlaybackUserInputHandler::ProcessMediaKey( TRemConCoreApiOperationId aOperationId,
|
|
440 |
TRemConCoreApiButtonAction aButtonAct )
|
|
441 |
{
|
58
|
442 |
MPX_ENTER_EXIT(_L("CVideoPlaybackUserInputHandler::ProcessMediaKey()"),
|
|
443 |
_L("iProcessingInputType = %d, aButtonAct = %d"),
|
|
444 |
iProcessingInputType, aButtonAct );
|
55
|
445 |
|
58
|
446 |
switch ( iProcessingInputType )
|
55
|
447 |
{
|
|
448 |
case EVideoNone:
|
|
449 |
{
|
58
|
450 |
if ( iForeground && !IsKeyLocked() )
|
55
|
451 |
{
|
58
|
452 |
if ( aButtonAct == ERemConCoreApiButtonPress )
|
|
453 |
{
|
|
454 |
iProcessingInputType = EVideoMediaKeys;
|
|
455 |
iLastMediaKeyPressed = aOperationId;
|
|
456 |
DoHandleMediaKey( aOperationId, aButtonAct );
|
|
457 |
}
|
|
458 |
else if ( aButtonAct == ERemConCoreApiButtonClick )
|
|
459 |
{
|
|
460 |
DoHandleMediaKey( aOperationId, aButtonAct );
|
|
461 |
|
|
462 |
// reset on click AND/OR release
|
|
463 |
iProcessingInputType = EVideoNone;
|
55
|
464 |
}
|
|
465 |
}
|
58
|
466 |
|
55
|
467 |
break;
|
|
468 |
}
|
|
469 |
case EVideoMediaKeys:
|
|
470 |
{
|
58
|
471 |
if ( aButtonAct == ERemConCoreApiButtonRelease )
|
55
|
472 |
{
|
|
473 |
// handle only if this release is for media-key being currently handled
|
|
474 |
// ignore spurious media key presses
|
58
|
475 |
if ( iLastMediaKeyPressed == aOperationId )
|
55
|
476 |
{
|
58
|
477 |
DoHandleMediaKey( aOperationId, aButtonAct );
|
55
|
478 |
// reset on click AND/OR release
|
|
479 |
iProcessingInputType = EVideoNone;
|
|
480 |
}
|
|
481 |
}
|
|
482 |
break;
|
|
483 |
}
|
|
484 |
default:
|
|
485 |
{
|
|
486 |
// user input is disallowed
|
|
487 |
break;
|
|
488 |
}
|
|
489 |
} // switch
|
|
490 |
}
|
|
491 |
|
|
492 |
// -------------------------------------------------------------------------------------------------
|
|
493 |
// CVideoPlaybackUserInputHandler::HandleVolumeRepeatTimeoutL()
|
|
494 |
// -------------------------------------------------------------------------------------------------
|
|
495 |
//
|
|
496 |
TInt CVideoPlaybackUserInputHandler::HandleVolumeRepeatTimeoutL( TAny* aPtr )
|
|
497 |
{
|
|
498 |
MPX_DEBUG(_L("CVideoPlaybackUserInputHandler::HandleVolumeRepeatTimeoutL()"));
|
|
499 |
|
|
500 |
static_cast<CVideoPlaybackUserInputHandler*>(aPtr)->HandleVolumeRepeatL();
|
|
501 |
|
|
502 |
return KErrNone;
|
|
503 |
}
|
|
504 |
|
|
505 |
// -------------------------------------------------------------------------------------------------
|
|
506 |
// CVideoPlaybackUserInputHandler::HandleVolumeRepeatL()
|
|
507 |
// -------------------------------------------------------------------------------------------------
|
|
508 |
//
|
|
509 |
void CVideoPlaybackUserInputHandler::HandleVolumeRepeatL()
|
|
510 |
{
|
|
511 |
MPX_DEBUG(_L("CVideoPlaybackUserInputHandler::HandleVolumeRepeatL()"));
|
|
512 |
|
|
513 |
TMPXVideoPlaybackViewCommandIds command = EMPXPbvCmdDecreaseVolume;
|
|
514 |
|
|
515 |
if ( iVolumeRepeatUp )
|
|
516 |
{
|
|
517 |
command = EMPXPbvCmdIncreaseVolume;
|
|
518 |
}
|
|
519 |
|
|
520 |
iViewWrapper->HandleCommandL( command );
|
|
521 |
}
|
|
522 |
|
|
523 |
// -------------------------------------------------------------------------------------------------
|
|
524 |
// CVideoPlaybackUserInputHandler::SetForeground()
|
|
525 |
// -------------------------------------------------------------------------------------------------
|
|
526 |
//
|
|
527 |
void CVideoPlaybackUserInputHandler::SetForeground( TBool aForeground )
|
|
528 |
{
|
58
|
529 |
MPX_ENTER_EXIT(_L("CVideoPlaybackUserInputHandler::SetForeground()"),
|
|
530 |
_L("aForeground = %d"), aForeground );
|
|
531 |
|
55
|
532 |
iForeground = aForeground;
|
|
533 |
|
58
|
534 |
if ( ! iForeground )
|
55
|
535 |
{
|
58
|
536 |
//
|
|
537 |
// Keyboard focus has been lost
|
|
538 |
// Reset input type and clear volume timer if necessary
|
|
539 |
//
|
55
|
540 |
iProcessingInputType = EVideoNone;
|
58
|
541 |
|
|
542 |
if ( iVolumeRepeatTimer->IsActive() )
|
|
543 |
{
|
|
544 |
iVolumeRepeatTimer->Cancel();
|
|
545 |
}
|
55
|
546 |
}
|
|
547 |
}
|
|
548 |
|
|
549 |
// -------------------------------------------------------------------------------------------------
|
58
|
550 |
// CVideoPlaybackUserInputHandler::IsKeyLocked
|
55
|
551 |
// -------------------------------------------------------------------------------------------------
|
|
552 |
//
|
58
|
553 |
TBool CVideoPlaybackUserInputHandler::IsKeyLocked()
|
55
|
554 |
{
|
58
|
555 |
TBool keylock( EFalse );
|
|
556 |
RProperty::Get( KPSUidAvkonDomain, KAknKeyguardStatus, keylock );
|
55
|
557 |
|
58
|
558 |
MPX_DEBUG(_L("CVideoPlaybackUserInputHandler::IsKeyLocked(%d)"), keylock);
|
55
|
559 |
|
58
|
560 |
return keylock;
|
55
|
561 |
}
|
|
562 |
|
|
563 |
// EOF
|