44
|
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 Video base playback view
|
|
15 |
*
|
|
16 |
*/
|
|
17 |
|
66
|
18 |
// Version : %version: da1mmcf#49.1.3 %
|
44
|
19 |
|
|
20 |
|
|
21 |
|
|
22 |
// Include Files
|
|
23 |
|
|
24 |
|
|
25 |
|
|
26 |
#include <QTimer>
|
|
27 |
#include <QGraphicsSceneEvent>
|
|
28 |
|
|
29 |
#include <hbmenu.h>
|
|
30 |
#include <hbaction.h>
|
|
31 |
#include <hbinstance.h>
|
|
32 |
#include <hbnotificationdialog.h>
|
63
|
33 |
#include <hbmessagebox.h>
|
44
|
34 |
#include <hblabel.h>
|
|
35 |
#include <hbtapgesture.h>
|
|
36 |
#include <hbpangesture.h>
|
|
37 |
|
|
38 |
#include <textresolver.h>
|
|
39 |
#include <mmf/common/mmferrors.h>
|
|
40 |
#include <DRMHelper.h>
|
|
41 |
|
|
42 |
#include <mpxvideoplaybackdefs.h>
|
|
43 |
#include <mpxplaybackcommanddefs.h>
|
|
44 |
#include <mpxhbvideocommondefs.h>
|
|
45 |
|
|
46 |
#include "mpxvideo_debug.h"
|
|
47 |
#include "mpxvideoviewwrapper.h"
|
|
48 |
#include "mpxvideoplaybackuids.hrh"
|
|
49 |
#include "videobaseplaybackview.h"
|
49
|
50 |
#include "videoactivitystate.h"
|
|
51 |
#include "videoplaybackviewfiledetails.h"
|
44
|
52 |
#include "mpxcommonvideoplaybackview.hrh"
|
|
53 |
|
66
|
54 |
const int KPanGestureThreshold = 200;
|
44
|
55 |
|
|
56 |
// Member Functions
|
|
57 |
|
|
58 |
// -------------------------------------------------------------------------------------------------
|
|
59 |
// VideoBasePlaybackView::VideoBasePlaybackView()
|
|
60 |
// -------------------------------------------------------------------------------------------------
|
|
61 |
//
|
|
62 |
VideoBasePlaybackView::VideoBasePlaybackView()
|
|
63 |
: mVideoMpxWrapper( NULL )
|
|
64 |
, mTimerForClosingView( NULL )
|
|
65 |
, mActivated( false )
|
|
66 |
, mStayPaused ( false )
|
|
67 |
{
|
|
68 |
MPX_ENTER_EXIT(_L("VideoBasePlaybackView::VideoBasePlaybackView()"));
|
|
69 |
}
|
|
70 |
|
|
71 |
// -------------------------------------------------------------------------------------------------
|
|
72 |
// VideoBasePlaybackView::initializeVideoPlaybackView()
|
|
73 |
// -------------------------------------------------------------------------------------------------
|
|
74 |
//
|
|
75 |
void VideoBasePlaybackView::initializeVideoPlaybackView()
|
|
76 |
{
|
|
77 |
MPX_ENTER_EXIT(_L("VideoBasePlaybackView::initializeVideoPlaybackView()"));
|
|
78 |
|
|
79 |
//
|
|
80 |
// Need to set to control full screen including status pane area
|
|
81 |
//
|
|
82 |
setContentFullScreen();
|
|
83 |
|
|
84 |
mTimerForClosingView = new QTimer();
|
|
85 |
mTimerForClosingView->setSingleShot( true );
|
|
86 |
mTimerForClosingView->setInterval( 10 );
|
|
87 |
connect( mTimerForClosingView, SIGNAL( timeout() ), this, SIGNAL( activatePreviousView() ) );
|
49
|
88 |
|
44
|
89 |
//
|
|
90 |
// Read activity data ...
|
|
91 |
// If last playback was forced to terminate due to low memory (GOOM, etc.)
|
49
|
92 |
// then the clip needs to be restored to the last played position
|
44
|
93 |
// and the state needs to be paused, since forced termination can only occur for
|
|
94 |
// background apps - so if this happened Video Player must have been in background
|
|
95 |
// which implies paused state
|
49
|
96 |
//
|
|
97 |
int lastViewType = VideoActivityState::instance().getActivityData(KEY_VIEWPLUGIN_TYPE).toInt();
|
|
98 |
if ( lastViewType == MpxHbVideoCommon::PlaybackView )
|
44
|
99 |
{
|
|
100 |
QVariant data = VideoActivityState::instance().getActivityData(KEY_LAST_PLAY_POSITION_ID);
|
49
|
101 |
mLastPlayPosition = data.toInt();
|
|
102 |
|
44
|
103 |
mStayPaused = true;
|
49
|
104 |
}
|
63
|
105 |
|
|
106 |
MPX_TRAPD( err, mVideoMpxWrapper = CMPXVideoViewWrapper::NewL( this ) );
|
44
|
107 |
}
|
|
108 |
|
|
109 |
// -------------------------------------------------------------------------------------------------
|
|
110 |
// VideoBasePlaybackView::~VideoBasePlaybackView()
|
|
111 |
// -------------------------------------------------------------------------------------------------
|
|
112 |
//
|
|
113 |
VideoBasePlaybackView::~VideoBasePlaybackView()
|
|
114 |
{
|
|
115 |
MPX_DEBUG(_L("VideoBasePlaybackView::~VideoBasePlaybackView()"));
|
|
116 |
|
|
117 |
if ( mTimerForClosingView )
|
|
118 |
{
|
|
119 |
disconnect( mTimerForClosingView, SIGNAL( timeout() ), this, SIGNAL( activatePreviousView() ) );
|
|
120 |
|
|
121 |
if ( mTimerForClosingView->isActive() )
|
|
122 |
{
|
|
123 |
mTimerForClosingView->stop();
|
|
124 |
}
|
|
125 |
|
|
126 |
delete mTimerForClosingView;
|
|
127 |
mTimerForClosingView = NULL;
|
|
128 |
}
|
|
129 |
|
|
130 |
if ( mVideoMpxWrapper )
|
|
131 |
{
|
|
132 |
delete mVideoMpxWrapper;
|
|
133 |
mVideoMpxWrapper = NULL;
|
|
134 |
}
|
|
135 |
|
|
136 |
setParentItem( 0 );
|
|
137 |
}
|
|
138 |
|
|
139 |
// -------------------------------------------------------------------------------------------------
|
|
140 |
// VideoBasePlaybackView::handleActivateView()
|
|
141 |
// -------------------------------------------------------------------------------------------------
|
|
142 |
//
|
|
143 |
void VideoBasePlaybackView::handleActivateView()
|
|
144 |
{
|
|
145 |
MPX_ENTER_EXIT(_L("VideoBasePlaybackView::handleActivateView()"));
|
|
146 |
|
63
|
147 |
MPX_TRAPD( err, mVideoMpxWrapper->ActivateL() );
|
44
|
148 |
|
50
|
149 |
connect( hbInstance->allMainWindows()[0], SIGNAL( obscured() ), this, SLOT( handleAppBackground() ) );
|
|
150 |
connect( hbInstance->allMainWindows()[0], SIGNAL( revealed() ), this, SLOT( handleAppForeground() ) );
|
|
151 |
|
44
|
152 |
QCoreApplication::instance()->installEventFilter( this );
|
|
153 |
|
|
154 |
//
|
|
155 |
// Request the needed Media from the Playback Plugin
|
|
156 |
//
|
|
157 |
MPX_TRAP( err, mVideoMpxWrapper->RequestMediaL() );
|
|
158 |
|
|
159 |
menu()->close();
|
|
160 |
|
|
161 |
//
|
|
162 |
// Landscape orientation
|
|
163 |
// Workaround: Disable orientation transition effect
|
|
164 |
// since orbit couldn't emit the orientationChanged signal with transition effect
|
|
165 |
//
|
|
166 |
hbInstance->allMainWindows()[0]->setOrientation( Qt::Horizontal, false );
|
|
167 |
|
|
168 |
mActivated = true;
|
|
169 |
}
|
|
170 |
|
|
171 |
// -------------------------------------------------------------------------------------------------
|
|
172 |
// VideoBasePlaybackView::handleDeactivateView()
|
|
173 |
// -------------------------------------------------------------------------------------------------
|
|
174 |
//
|
|
175 |
void VideoBasePlaybackView::handleDeactivateView()
|
|
176 |
{
|
|
177 |
MPX_ENTER_EXIT(_L("VideoBasePlaybackView::handleDeactivateView()"));
|
|
178 |
|
|
179 |
saveActivityData();
|
49
|
180 |
|
44
|
181 |
mActivated = false;
|
|
182 |
|
|
183 |
QCoreApplication::instance()->removeEventFilter( this );
|
|
184 |
|
50
|
185 |
disconnect( hbInstance->allMainWindows()[0], SIGNAL( obscured() ), this, SLOT( handleAppBackground() ) );
|
|
186 |
disconnect( hbInstance->allMainWindows()[0], SIGNAL( revealed() ), this, SLOT( handleAppForeground() ) );
|
|
187 |
|
44
|
188 |
//
|
|
189 |
// Close the playback plugin to release all references to previous clip
|
|
190 |
//
|
|
191 |
MPX_TRAPD( err, mVideoMpxWrapper->HandleCommandL( EMPXPbvCmdClose ) );
|
|
192 |
|
63
|
193 |
MPX_TRAP( err, mVideoMpxWrapper->Deactivate() );
|
44
|
194 |
|
|
195 |
//
|
|
196 |
// go back to device orientation
|
|
197 |
//
|
|
198 |
//hbInstance->allMainWindows()[0]->unsetOrientation();
|
|
199 |
}
|
|
200 |
|
|
201 |
// -------------------------------------------------------------------------------------------------
|
|
202 |
// VideoBasePlaybackView::saveActivityData()
|
|
203 |
// -------------------------------------------------------------------------------------------------
|
|
204 |
//
|
|
205 |
void VideoBasePlaybackView::saveActivityData()
|
|
206 |
{
|
49
|
207 |
MPX_DEBUG( _L("VideoBasePlaybackView::saveActivityData()") );
|
|
208 |
|
55
|
209 |
VideoActivityState& videoActivityState = VideoActivityState::instance();
|
|
210 |
|
44
|
211 |
// save the activity data
|
|
212 |
QVariant data = QString( mVideoMpxWrapper->iFileDetails->mClipName );
|
55
|
213 |
videoActivityState.setActivityData( data, KEY_LAST_PLAYED_CLIP );
|
49
|
214 |
|
44
|
215 |
data = int( mVideoMpxWrapper->iPlayPosition );
|
55
|
216 |
videoActivityState.setActivityData( data, KEY_LAST_PLAY_POSITION_ID );
|
49
|
217 |
|
44
|
218 |
data = bool( mVideoMpxWrapper->iFileDetails->mPlaybackMode == EMPXVideoLocal );
|
55
|
219 |
videoActivityState.setActivityData( data, KEY_LAST_LOCAL_PLAYBACK );
|
|
220 |
|
49
|
221 |
data = uint ( mVideoMpxWrapper->GetMediaId() );
|
55
|
222 |
videoActivityState.setActivityData( data, KEY_LAST_PLAYED_MEDIA_ID );
|
44
|
223 |
}
|
|
224 |
|
|
225 |
// -------------------------------------------------------------------------------------------------
|
|
226 |
// VideoBasePlaybackView::handleClosePlaybackView()
|
|
227 |
// -------------------------------------------------------------------------------------------------
|
|
228 |
//
|
|
229 |
void VideoBasePlaybackView::handleClosePlaybackView()
|
|
230 |
{
|
|
231 |
MPX_DEBUG(
|
|
232 |
_L("VideoBasePlaybackView::handleClosePlaybackView()") );
|
|
233 |
|
|
234 |
if ( mVideoMpxWrapper && mVideoMpxWrapper->IsMultiItemPlaylist() )
|
|
235 |
{
|
|
236 |
TRAP_IGNORE( mVideoMpxWrapper->HandleCommandL( EMPXPbvCmdNextListItem ) );
|
|
237 |
}
|
|
238 |
else
|
|
239 |
{
|
|
240 |
closePlaybackView();
|
|
241 |
}
|
|
242 |
}
|
|
243 |
|
|
244 |
// -------------------------------------------------------------------------------------------------
|
|
245 |
// VideoBasePlaybackView::handlePluginError()
|
|
246 |
// -------------------------------------------------------------------------------------------------
|
|
247 |
//
|
|
248 |
void VideoBasePlaybackView::handlePluginError( int aError )
|
|
249 |
{
|
|
250 |
MPX_DEBUG(
|
|
251 |
_L("VideoBasePlaybackView::handlePluginError() aError = %d"), aError );
|
|
252 |
|
|
253 |
switch ( aError )
|
|
254 |
{
|
|
255 |
case KErrCancel:
|
|
256 |
{
|
|
257 |
handleClosePlaybackView();
|
|
258 |
break;
|
|
259 |
}
|
|
260 |
case KErrMMDRMNotAuthorized:
|
|
261 |
case KErrCANoRights:
|
|
262 |
case KErrCANoPermission:
|
|
263 |
{
|
|
264 |
showDialog( hbTrId( "txt_videos_info_license_has_expired_or_it_is_missi" ) );
|
|
265 |
break;
|
|
266 |
}
|
|
267 |
case KMPXVideoCallOngoingError:
|
|
268 |
{
|
|
269 |
showDialog( hbTrId( "txt_videos_info_video_playback_is_not_allowed_duri" ), false );
|
|
270 |
break;
|
|
271 |
}
|
|
272 |
default:
|
|
273 |
{
|
|
274 |
TRAP_IGNORE(
|
|
275 |
|
|
276 |
//
|
|
277 |
// TextResolver instance for error resolving.
|
|
278 |
//
|
|
279 |
CTextResolver* textresolver = CTextResolver::NewLC();
|
|
280 |
|
|
281 |
//
|
|
282 |
// Resolve the error text
|
|
283 |
//
|
|
284 |
TPtrC text;
|
|
285 |
text.Set( textresolver->ResolveErrorString( aError ) );
|
|
286 |
|
|
287 |
//
|
|
288 |
// convert to QString
|
|
289 |
//
|
|
290 |
const QString qString( (QChar*)text.Ptr(), text.Length() );
|
|
291 |
|
|
292 |
//
|
|
293 |
// clean up textresolver
|
|
294 |
//
|
|
295 |
CleanupStack::PopAndDestroy( textresolver );
|
|
296 |
|
|
297 |
//
|
|
298 |
// display error and close playback view
|
|
299 |
//
|
|
300 |
showDialog( qString );
|
|
301 |
);
|
|
302 |
}
|
|
303 |
}
|
|
304 |
}
|
|
305 |
|
|
306 |
// -------------------------------------------------------------------------------------------------
|
|
307 |
// VideoBasePlaybackView::showDialog
|
|
308 |
// -------------------------------------------------------------------------------------------------
|
|
309 |
//
|
63
|
310 |
void VideoBasePlaybackView::showDialog( const QString& string, bool closeView, bool isError )
|
44
|
311 |
{
|
63
|
312 |
MPX_DEBUG(_L("VideoBasePlaybackView::showDialog( %s, %d, %d )"), string.data(), closeView, isError );
|
44
|
313 |
|
|
314 |
//
|
63
|
315 |
// create pop-up dialog for error notes and notifications,
|
66
|
316 |
// For error notes, HbMessageBox is used:
|
63
|
317 |
// - Note will be dismissed by using standard timeout or
|
|
318 |
// - If user taps anywhere on the screen.
|
|
319 |
// For notifications, HbNotification dialog will be used.
|
44
|
320 |
//
|
63
|
321 |
|
|
322 |
HbDialog *dlg = 0;
|
|
323 |
if(isError)
|
|
324 |
{
|
66
|
325 |
dlg = new HbMessageBox( string, HbMessageBox::MessageTypeWarning );
|
63
|
326 |
// dialog will be closed by timeout, no buttons used
|
|
327 |
qobject_cast<HbMessageBox*>( dlg )->setStandardButtons( HbMessageBox::NoButton );
|
66
|
328 |
}
|
63
|
329 |
else
|
|
330 |
{
|
|
331 |
dlg = new HbNotificationDialog();
|
|
332 |
qobject_cast<HbNotificationDialog*>( dlg )->setTitle( string );
|
66
|
333 |
}
|
44
|
334 |
dlg->setAttribute( Qt::WA_DeleteOnClose );
|
63
|
335 |
dlg->setDismissPolicy( HbPopup::TapAnywhere );
|
|
336 |
dlg->setTimeout( HbPopup::StandardTimeout );
|
44
|
337 |
if ( closeView )
|
|
338 |
{
|
|
339 |
//
|
|
340 |
// connect aboutToClose() signal to handleClosePopupDialog() slot so that
|
|
341 |
// when pop-up dialog is closed, playback view is closed also
|
|
342 |
//
|
|
343 |
connect( dlg, SIGNAL( aboutToClose() ), this, SLOT( handleClosePopupDialog() ) );
|
|
344 |
}
|
|
345 |
|
|
346 |
dlg->show();
|
|
347 |
}
|
|
348 |
|
|
349 |
// -------------------------------------------------------------------------------------------------
|
|
350 |
// VideoBasePlaybackView::doClosePlayer
|
|
351 |
// -------------------------------------------------------------------------------------------------
|
|
352 |
//
|
|
353 |
void VideoBasePlaybackView::doClosePlayer()
|
|
354 |
{
|
|
355 |
MPX_DEBUG(_L("VideoBasePlaybackView::doClosePlayer()"));
|
|
356 |
|
|
357 |
handleDeactivateView();
|
|
358 |
|
|
359 |
qApp->quit();
|
|
360 |
}
|
|
361 |
|
|
362 |
// -------------------------------------------------------------------------------------------------
|
|
363 |
// VideoBasePlaybackView::issuePlayCommand
|
|
364 |
// -------------------------------------------------------------------------------------------------
|
|
365 |
//
|
|
366 |
void VideoBasePlaybackView::issuePlayCommand()
|
|
367 |
{
|
|
368 |
MPX_ENTER_EXIT(_L("VideoBasePlaybackView::issuePlayCommand()"));
|
|
369 |
|
|
370 |
int err = KErrNone;
|
|
371 |
|
|
372 |
TRAP( err, mVideoMpxWrapper->CreateGeneralPlaybackCommandL( EPbCmdPlay ));
|
|
373 |
|
|
374 |
MPX_DEBUG(_L("VideoBasePlaybackView::issuePlayCommand() error = %d"), err);
|
|
375 |
}
|
|
376 |
|
|
377 |
// -------------------------------------------------------------------------------------------------
|
|
378 |
// VideoBasePlaybackView::retrievePdlInformation
|
|
379 |
// -------------------------------------------------------------------------------------------------
|
|
380 |
//
|
|
381 |
void VideoBasePlaybackView::retrievePdlInformation()
|
|
382 |
{
|
|
383 |
MPX_DEBUG(_L("VideoBasePlaybackView::retrievePdlInformation()"));
|
|
384 |
}
|
|
385 |
|
|
386 |
// -------------------------------------------------------------------------------------------------
|
|
387 |
// VideoBasePlaybackView::handleBufferingState
|
|
388 |
// -------------------------------------------------------------------------------------------------
|
|
389 |
//
|
|
390 |
void VideoBasePlaybackView::handleBufferingState()
|
|
391 |
{
|
|
392 |
MPX_DEBUG(_L("VideoBasePlaybackView::handleBufferingState()"));
|
|
393 |
}
|
|
394 |
|
|
395 |
// -------------------------------------------------------------------------------------------------
|
|
396 |
// VideoBasePlaybackView::closePlaybackView()
|
|
397 |
// -------------------------------------------------------------------------------------------------
|
|
398 |
//
|
|
399 |
void VideoBasePlaybackView::closePlaybackView()
|
|
400 |
{
|
|
401 |
MPX_ENTER_EXIT(_L("VideoBasePlaybackView::closePlaybackView()"));
|
|
402 |
|
|
403 |
mTimerForClosingView->start( 0 );
|
|
404 |
}
|
|
405 |
|
50
|
406 |
// -------------------------------------------------------------------------------------------------
|
44
|
407 |
// VideoBasePlaybackView::eventFilter
|
50
|
408 |
// -------------------------------------------------------------------------------------------------
|
44
|
409 |
//
|
|
410 |
bool VideoBasePlaybackView::eventFilter( QObject *object, QEvent *event )
|
|
411 |
{
|
|
412 |
Q_UNUSED( object );
|
|
413 |
|
|
414 |
switch ( event->type() )
|
|
415 |
{
|
|
416 |
case QEvent::ApplicationActivate:
|
|
417 |
{
|
|
418 |
if ( mActivated )
|
|
419 |
{
|
|
420 |
MPX_DEBUG(_L("VideoBasePlaybackView::eventFilter foreground()") );
|
50
|
421 |
TRAP_IGNORE( mVideoMpxWrapper->IssueVideoAppForegroundCmdL(
|
|
422 |
true, ! hbInstance->allMainWindows()[0]->isObscured() ) );
|
44
|
423 |
}
|
|
424 |
break;
|
|
425 |
}
|
|
426 |
case QEvent::ApplicationDeactivate:
|
|
427 |
{
|
|
428 |
if ( mActivated )
|
|
429 |
{
|
|
430 |
MPX_DEBUG(_L("VideoBasePlaybackView::eventFilter background()") );
|
50
|
431 |
TRAP_IGNORE( mVideoMpxWrapper->IssueVideoAppForegroundCmdL(
|
|
432 |
false, ! hbInstance->allMainWindows()[0]->isObscured() ) );
|
44
|
433 |
}
|
|
434 |
break;
|
|
435 |
}
|
|
436 |
}
|
|
437 |
|
|
438 |
return QObject::eventFilter( object, event );
|
|
439 |
}
|
|
440 |
|
|
441 |
// -------------------------------------------------------------------------------------------------
|
|
442 |
// VideoBasePlaybackView::getWindow()
|
|
443 |
// -------------------------------------------------------------------------------------------------
|
|
444 |
//
|
|
445 |
RWindow *VideoBasePlaybackView::getWindow()
|
|
446 |
{
|
|
447 |
return static_cast<RWindow*>( hbInstance->allMainWindows()[0]->effectiveWinId()->DrawableWindow() );
|
|
448 |
}
|
|
449 |
|
|
450 |
// -------------------------------------------------------------------------------------------------
|
|
451 |
// VideoBasePlaybackView::handleClosePopupDialog()
|
|
452 |
// -------------------------------------------------------------------------------------------------
|
|
453 |
//
|
|
454 |
void VideoBasePlaybackView::handleClosePopupDialog()
|
|
455 |
{
|
|
456 |
MPX_DEBUG(_L("VideoBasePlaybackView::handleClosePopupDialog()") );
|
|
457 |
|
|
458 |
handleClosePlaybackView();
|
|
459 |
}
|
|
460 |
|
|
461 |
// -------------------------------------------------------------------------------------------------
|
|
462 |
// VideoBasePlaybackView::gestureEvent()
|
|
463 |
// -------------------------------------------------------------------------------------------------
|
|
464 |
//
|
|
465 |
void VideoBasePlaybackView::gestureEvent( QGestureEvent* event )
|
|
466 |
{
|
|
467 |
if ( HbTapGesture * gesture = static_cast<HbTapGesture *>( event->gesture( Qt::TapGesture ) ) )
|
|
468 |
{
|
|
469 |
if ( gesture->state() == Qt::GestureFinished && mActivated )
|
|
470 |
{
|
|
471 |
MPX_DEBUG(_L("VideoBasePlaybackView::gestureEvent() tapGesture finished") );
|
|
472 |
|
|
473 |
emit tappedOnScreen();
|
|
474 |
}
|
|
475 |
}
|
66
|
476 |
|
|
477 |
if ( HbPanGesture* gesture = static_cast<HbPanGesture*>( event->gesture( Qt::PanGesture ) ) )
|
44
|
478 |
{
|
66
|
479 |
if ( mActivated && gesture->state() == Qt::GestureFinished )
|
44
|
480 |
{
|
66
|
481 |
MPX_DEBUG(_L("VideoBasePlaybackView::gestureEvent() pan gesture finished"));
|
44
|
482 |
|
66
|
483 |
int nonZeroVelocity = (int)( gesture->sceneVelocity().x() );
|
|
484 |
int offset = (int)( gesture->sceneOffset().x() );
|
|
485 |
|
|
486 |
if ( offset > KPanGestureThreshold && nonZeroVelocity > 0 )
|
44
|
487 |
{
|
66
|
488 |
MPX_DEBUG(_L("VideoBasePlaybackView::gestureEvent() pan gesture right") );
|
44
|
489 |
|
|
490 |
emit pannedToRight();
|
|
491 |
}
|
66
|
492 |
else if ( offset < KPanGestureThreshold * -1.0f && nonZeroVelocity < 0 )
|
44
|
493 |
{
|
66
|
494 |
MPX_DEBUG(_L("VideoBasePlaybackView::gestureEvent() pan gesture left") );
|
44
|
495 |
|
|
496 |
emit pannedToLeft();
|
|
497 |
}
|
|
498 |
}
|
|
499 |
}
|
|
500 |
}
|
|
501 |
|
50
|
502 |
// -------------------------------------------------------------------------------------------------
|
|
503 |
// VideoBasePlaybackView::handleAppBackground()
|
|
504 |
// -------------------------------------------------------------------------------------------------
|
|
505 |
//
|
|
506 |
void VideoBasePlaybackView::handleAppBackground()
|
|
507 |
{
|
|
508 |
MPX_ENTER_EXIT(_L("VideoBasePlaybackView::handleAppBackground()") );
|
|
509 |
|
|
510 |
if ( mActivated )
|
|
511 |
{
|
|
512 |
TRAP_IGNORE( mVideoMpxWrapper->IssueVideoAppForegroundCmdL( false, false ) );
|
|
513 |
}
|
|
514 |
}
|
|
515 |
|
|
516 |
// -------------------------------------------------------------------------------------------------
|
|
517 |
// VideoBasePlaybackView::handleAppForeground()
|
|
518 |
// -------------------------------------------------------------------------------------------------
|
|
519 |
//
|
|
520 |
void VideoBasePlaybackView::handleAppForeground()
|
|
521 |
{
|
|
522 |
MPX_ENTER_EXIT(_L("VideoBasePlaybackView::handleAppForeground()") );
|
|
523 |
|
|
524 |
if ( mActivated )
|
|
525 |
{
|
|
526 |
TRAP_IGNORE( mVideoMpxWrapper->IssueVideoAppForegroundCmdL( true, true ) );
|
|
527 |
}
|
|
528 |
}
|
|
529 |
|
44
|
530 |
// EOF
|