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 VideoPlaybackControlsController
|
|
15 |
*
|
|
16 |
*/
|
|
17 |
|
49
|
18 |
// Version : %version: da1mmcf#48 %
|
44
|
19 |
|
|
20 |
|
|
21 |
|
|
22 |
// INCLUDE FILES
|
|
23 |
#include <coecntrl.h>
|
|
24 |
#include <bautils.h>
|
|
25 |
#include <barsread.h>
|
|
26 |
#include <f32file.h>
|
|
27 |
|
|
28 |
#include <QTimer>
|
|
29 |
#include <thumbnailmanager_qt.h>
|
|
30 |
#include <xqserviceutil.h>
|
|
31 |
|
|
32 |
#include <hblabel.h>
|
|
33 |
#include <hbvolumesliderpopup.h>
|
|
34 |
#include <hbtransparentwindow.h>
|
|
35 |
#include <hbiconanimationmanager.h>
|
|
36 |
#include <shareui.h>
|
|
37 |
#include <hbinstance.h>
|
|
38 |
#include <hbtapgesture.h>
|
|
39 |
#include <hbpangesture.h>
|
|
40 |
|
|
41 |
#include "mpxvideoviewwrapper.h"
|
|
42 |
#include "videobaseplaybackview.h"
|
|
43 |
#include "videoplaybackcontrolbar.h"
|
|
44 |
#include "videoplaybackcontrolpolicy.h"
|
|
45 |
#include "videoplaybackdocumentloader.h"
|
|
46 |
#include "videoplaybackviewfiledetails.h"
|
|
47 |
#include "videoplaybackstatuspanecontrol.h"
|
|
48 |
#include "videoplaybackfiledetailswidget.h"
|
|
49 |
#include "videoplaybackfullscreencontrol.h"
|
|
50 |
#include "videoplaybackcontrolscontroller.h"
|
|
51 |
#include "videoplaybackcontrolconfiguration.h"
|
|
52 |
#include "videoplaybackdetailsplaybackwindow.h"
|
|
53 |
#include "videoservices.h"
|
|
54 |
|
|
55 |
|
|
56 |
// ================= MEMBER FUNCTIONS ==============================================================
|
|
57 |
|
|
58 |
// -------------------------------------------------------------------------------------------------
|
|
59 |
// VideoPlaybackControlsController::VideoPlaybackControlsController()
|
|
60 |
// -------------------------------------------------------------------------------------------------
|
|
61 |
//
|
|
62 |
VideoPlaybackControlsController::VideoPlaybackControlsController(
|
|
63 |
VideoBasePlaybackView *view,
|
|
64 |
CMPXVideoViewWrapper *viewWrapper,
|
|
65 |
VideoPlaybackViewFileDetails *details )
|
|
66 |
: mView( view )
|
|
67 |
, mViewWrapper( viewWrapper )
|
|
68 |
, mFileDetails( details )
|
|
69 |
, mControlsPolicy( NULL )
|
|
70 |
, mControlsConfig( NULL )
|
|
71 |
, mControlsTimer( NULL )
|
|
72 |
, mRNLogoTimer( NULL )
|
|
73 |
, mLoader( NULL )
|
|
74 |
, mVolumeControl( NULL )
|
|
75 |
, mThumbnailManager( NULL )
|
|
76 |
, mVideoServices( 0 )
|
|
77 |
, mViewTransitionIsGoingOn( false )
|
|
78 |
, mIsAttachOperation( false )
|
49
|
79 |
, mFileDetailsAdded( false )
|
44
|
80 |
, mThumbNailState( EThumbNailEmpty )
|
|
81 |
, mState( EPbStateNotInitialised )
|
|
82 |
, mViewMode( EFullScreenView )
|
|
83 |
{
|
|
84 |
MPX_ENTER_EXIT(_L("VideoPlaybackControlsController::VideoPlaybackControlsController()"));
|
|
85 |
|
|
86 |
initializeController();
|
|
87 |
}
|
|
88 |
|
|
89 |
// -------------------------------------------------------------------------------------------------
|
|
90 |
// VideoPlaybackControlsController::initializeController()
|
|
91 |
// -------------------------------------------------------------------------------------------------
|
|
92 |
//
|
|
93 |
void VideoPlaybackControlsController::initializeController()
|
|
94 |
{
|
|
95 |
MPX_ENTER_EXIT(_L("VideoPlaybackControlsController::initializeController()"));
|
|
96 |
|
|
97 |
mOrientation = hbInstance->allMainWindows()[0]->orientation();
|
|
98 |
bool ok = connect( hbInstance->allMainWindows()[0], SIGNAL( orientationChanged( Qt::Orientation ) ),
|
|
99 |
this, SLOT( handleOrientationChanged( Qt::Orientation ) ) );
|
|
100 |
|
|
101 |
MPX_DEBUG(
|
|
102 |
_L("VideoPlaybackControlsController::initializeController() orientation = %d, ok =%d"),
|
|
103 |
mOrientation, ok );
|
|
104 |
|
|
105 |
setParent( mView );
|
|
106 |
|
|
107 |
mView->hideItems( Hb::AllItems );
|
|
108 |
|
|
109 |
//
|
|
110 |
// Create layout loader
|
|
111 |
//
|
|
112 |
ok = false;
|
|
113 |
mLoader = new VideoPlaybackDocumentLoader( this );
|
|
114 |
mLoader->load( KPLAYBACKVIEW_DOCML, &ok );
|
|
115 |
|
|
116 |
if ( ok )
|
|
117 |
{
|
|
118 |
QGraphicsWidget *widget = mLoader->findWidget( QString( "content" ) );
|
|
119 |
mView->setWidget( widget );
|
|
120 |
}
|
|
121 |
else
|
|
122 |
{
|
|
123 |
MPX_DEBUG(
|
|
124 |
_L("VideoPlaybackControlsController::initializeController()- can't find xml"));
|
|
125 |
|
|
126 |
//
|
|
127 |
// Can't find xml for layout. Delete mLoader
|
|
128 |
//
|
|
129 |
delete mLoader;
|
|
130 |
mLoader = NULL;
|
|
131 |
}
|
|
132 |
|
|
133 |
mFileDetails->mRNFormat = realFormat( mFileDetails->mClipName );
|
|
134 |
|
|
135 |
//
|
|
136 |
// Controls dismissing timer
|
|
137 |
//
|
|
138 |
mControlsTimer = new QTimer( this );
|
|
139 |
mControlsTimer->setInterval( KControlsTimeOut );
|
|
140 |
mControlsTimer->setSingleShot( false );
|
|
141 |
connect( mControlsTimer, SIGNAL( timeout() ), this, SLOT( hideAllControls() ) );
|
|
142 |
|
|
143 |
mControlsPolicy = new VideoPlaybackControlPolicy();
|
|
144 |
|
|
145 |
mControlsConfig = new VideoPlaybackControlConfiguration( this );
|
|
146 |
connect( mControlsConfig, SIGNAL( controlListUpdated() ), this, SLOT( controlsListUpdated() ) );
|
|
147 |
mControlsConfig->createControlList();
|
|
148 |
|
|
149 |
//
|
|
150 |
// Create volume popup control
|
|
151 |
//
|
|
152 |
mVolumeControl = new HbVolumeSliderPopup();
|
|
153 |
mVolumeControl->setVisible( false );
|
|
154 |
mVolumeControl->setTimeout( KControlsTimeOut );
|
|
155 |
mVolumeControl->setTickPosition( Hb::NoSliderTicks );
|
|
156 |
mVolumeControl->setRange( KPbPlaybackVolumeLevelMin, KPbPlaybackVolumeLevelMax );
|
|
157 |
|
|
158 |
//
|
|
159 |
// grab tap gesture
|
|
160 |
//
|
|
161 |
mView->grabGesture( Qt::TapGesture );
|
|
162 |
connect( mView, SIGNAL( tappedOnScreen() ), this, SLOT( handleTappedOnScreen() ) );
|
|
163 |
|
|
164 |
//
|
|
165 |
// if videoplayback is in service mode, create a videoservices instance
|
|
166 |
//
|
|
167 |
if ( XQServiceUtil::isService() && ! mVideoServices )
|
|
168 |
{
|
|
169 |
//
|
|
170 |
// obtain VideoServices instance
|
|
171 |
//
|
|
172 |
mVideoServices = VideoServices::instance();
|
|
173 |
|
|
174 |
//
|
|
175 |
// allow 'attach' operation only for non-streaming media clips
|
|
176 |
//
|
|
177 |
if ( mVideoServices && mFileDetails->mPlaybackMode == EMPXVideoLocal )
|
|
178 |
{
|
|
179 |
//
|
|
180 |
// determine if this is 'attach' operation
|
|
181 |
//
|
|
182 |
mIsAttachOperation = ( mVideoServices->currentService() == VideoServices::EUriFetcher );
|
|
183 |
|
|
184 |
if ( mIsAttachOperation )
|
|
185 |
{
|
|
186 |
//
|
|
187 |
// connect signal filePath() to videoservices slot itemSelected()
|
|
188 |
//
|
|
189 |
connect( this, SIGNAL( attachVideoPath( const QString& ) ),
|
|
190 |
mVideoServices, SLOT( itemSelected( const QString& ) ) );
|
|
191 |
}
|
|
192 |
}
|
|
193 |
}
|
|
194 |
}
|
|
195 |
|
|
196 |
// -------------------------------------------------------------------------------------------------
|
|
197 |
// VideoPlaybackControlsController::~VideoPlaybackControlsController
|
|
198 |
// -------------------------------------------------------------------------------------------------
|
|
199 |
//
|
|
200 |
VideoPlaybackControlsController::~VideoPlaybackControlsController()
|
|
201 |
{
|
|
202 |
MPX_ENTER_EXIT(_L("VideoPlaybackControlsController::~VideoPlaybackControlsController()"));
|
|
203 |
|
|
204 |
mView->ungrabGesture( Qt::TapGesture );
|
|
205 |
disconnect( mView, SIGNAL( tappedOnScreen() ), this, SLOT( handleTappedOnScreen() ) );
|
|
206 |
|
|
207 |
if ( mFileDetails->mMultiItemPlaylist && mFileDetails->mSeekable )
|
|
208 |
{
|
|
209 |
mView->ungrabGesture( Qt::PanGesture );
|
|
210 |
|
|
211 |
disconnect( mView, SIGNAL( pannedToRight() ), this, SLOT( skipToNextVideoItem() ) );
|
|
212 |
disconnect( mView, SIGNAL( pannedToLeft() ), this, SLOT( skipToPreviousVideoItem() ) );
|
|
213 |
}
|
|
214 |
|
|
215 |
disconnect( mControlsConfig, SIGNAL( controlListUpdated() ), this, SLOT( controlsListUpdated() ) );
|
|
216 |
disconnect( mControlsTimer, SIGNAL( timeout() ), this, SLOT( hideAllControls() ) );
|
|
217 |
disconnect( hbInstance->allMainWindows()[0], SIGNAL( orientationChanged( Qt::Orientation ) ),
|
|
218 |
this, SLOT( handleOrientationChanged( Qt::Orientation ) ) );
|
|
219 |
|
|
220 |
mView->setWidget( NULL );
|
|
221 |
|
|
222 |
mControls.clear();
|
|
223 |
|
|
224 |
if ( mControlsTimer )
|
|
225 |
{
|
|
226 |
delete mControlsTimer;
|
|
227 |
mControlsTimer = NULL;
|
|
228 |
}
|
|
229 |
|
|
230 |
if ( mRNLogoTimer )
|
|
231 |
{
|
|
232 |
disconnect( mRNLogoTimer, SIGNAL( timeout() ), this, SLOT( handleRNLogoTimeout() ) );
|
|
233 |
|
|
234 |
delete mRNLogoTimer;
|
|
235 |
mRNLogoTimer = NULL;
|
|
236 |
}
|
|
237 |
|
|
238 |
if ( mControlsPolicy )
|
|
239 |
{
|
|
240 |
delete mControlsPolicy;
|
|
241 |
mControlsPolicy = NULL;
|
|
242 |
}
|
|
243 |
|
|
244 |
if ( mControlsConfig )
|
|
245 |
{
|
|
246 |
delete mControlsConfig;
|
|
247 |
mControlsConfig = NULL;
|
|
248 |
}
|
|
249 |
|
|
250 |
if ( mLoader )
|
|
251 |
{
|
|
252 |
delete mLoader;
|
|
253 |
mLoader = NULL;
|
|
254 |
}
|
|
255 |
|
|
256 |
if ( mThumbnailManager )
|
|
257 |
{
|
|
258 |
delete mThumbnailManager;
|
|
259 |
mThumbnailManager = NULL;
|
|
260 |
}
|
|
261 |
|
|
262 |
if ( mVolumeControl )
|
|
263 |
{
|
|
264 |
delete mVolumeControl;
|
|
265 |
mVolumeControl = NULL;
|
|
266 |
}
|
|
267 |
|
|
268 |
if ( mIsAttachOperation )
|
|
269 |
{
|
|
270 |
//
|
|
271 |
// disable connection for 'attach' operation
|
|
272 |
//
|
|
273 |
disconnect( this, SIGNAL( attachVideoPath( const QString& ) ),
|
|
274 |
mVideoServices, SLOT( itemSelected( const QString& ) ) );
|
|
275 |
}
|
|
276 |
|
|
277 |
if ( mVideoServices )
|
|
278 |
{
|
|
279 |
//
|
|
280 |
// decrease videoservices instance count
|
|
281 |
//
|
|
282 |
mVideoServices->decreaseReferenceCount();
|
|
283 |
mVideoServices = 0;
|
|
284 |
}
|
|
285 |
}
|
|
286 |
|
|
287 |
// -------------------------------------------------------------------------------------------------
|
|
288 |
// VideoPlaybackControlsController::addFileDetails()
|
|
289 |
// -------------------------------------------------------------------------------------------------
|
|
290 |
//
|
|
291 |
void VideoPlaybackControlsController::addFileDetails(
|
|
292 |
VideoPlaybackViewFileDetails* details )
|
|
293 |
{
|
|
294 |
MPX_ENTER_EXIT(_L("VideoPlaybackControlsController::addFileDetails"));
|
|
295 |
|
49
|
296 |
mFileDetailsAdded = true;
|
|
297 |
|
44
|
298 |
mFileDetails = details;
|
|
299 |
|
|
300 |
mFileDetails->mRNFormat = realFormat( mFileDetails->mClipName );
|
|
301 |
|
|
302 |
mControlsConfig->updateControlsWithFileDetails();
|
|
303 |
|
|
304 |
//
|
|
305 |
// for audio-only clips and tv-out, default view is flip view
|
|
306 |
//
|
|
307 |
if ( ! details->mVideoEnabled )
|
|
308 |
{
|
|
309 |
changeViewMode( EAudioOnlyView, false );
|
|
310 |
}
|
|
311 |
|
|
312 |
if ( details->mTvOutConnected )
|
|
313 |
{
|
|
314 |
handleEvent( EControlCmdTvOutConnected );
|
|
315 |
}
|
|
316 |
|
|
317 |
//
|
|
318 |
// Dimmed the volume control if it is video only
|
|
319 |
//
|
|
320 |
if ( ! mFileDetails->mAudioEnabled )
|
|
321 |
{
|
|
322 |
mVolumeControl->setValue( 0 );
|
|
323 |
mVolumeControl->setEnabled( false );
|
|
324 |
}
|
|
325 |
|
|
326 |
//
|
|
327 |
// grab pan gesture for playlist and seekable(skippable) clip
|
|
328 |
//
|
|
329 |
if ( mFileDetails->mMultiItemPlaylist && mFileDetails->mSeekable )
|
|
330 |
{
|
|
331 |
mView->grabGesture( Qt::PanGesture );
|
|
332 |
connect( mView, SIGNAL( pannedToRight() ), this, SLOT( skipToPreviousVideoItem() ) );
|
|
333 |
connect( mView, SIGNAL( pannedToLeft() ), this, SLOT( skipToNextVideoItem() ) );
|
|
334 |
}
|
|
335 |
}
|
|
336 |
|
|
337 |
// -------------------------------------------------------------------------------------------------
|
|
338 |
// VideoPlaybackControlsController::handleEvent
|
|
339 |
// -------------------------------------------------------------------------------------------------
|
|
340 |
//
|
|
341 |
void VideoPlaybackControlsController::handleEvent(
|
|
342 |
TVideoPlaybackControlCommandIds event, int value )
|
|
343 |
{
|
|
344 |
MPX_DEBUG(_L("VideoPlaybackControlsController::handleEvent(%d)"), event);
|
|
345 |
|
|
346 |
switch ( event )
|
|
347 |
{
|
|
348 |
case EControlCmdSetPosition:
|
|
349 |
{
|
|
350 |
MPX_DEBUG(_L(" [EControlCmdSetPosition [%d]]"), value );
|
|
351 |
|
|
352 |
positionChanged( (qreal)value / (qreal)KPbMilliMultiplier);
|
|
353 |
break;
|
|
354 |
}
|
|
355 |
case EControlCmdSetDuration:
|
|
356 |
{
|
|
357 |
MPX_DEBUG(_L(" [EControlCmdSetDuration [%d]]"), value );
|
|
358 |
|
|
359 |
durationChanged( (qreal)value / (qreal)KPbMilliMultiplier );
|
|
360 |
break;
|
|
361 |
}
|
|
362 |
case EControlCmdStateChanged:
|
|
363 |
{
|
|
364 |
MPX_DEBUG(_L(" [EControlCmdStateChanged]"));
|
|
365 |
|
|
366 |
handleStateChange( (TMPXPlaybackState)value );
|
|
367 |
break;
|
|
368 |
}
|
|
369 |
case EControlCmdSetVolume:
|
|
370 |
{
|
|
371 |
MPX_DEBUG(_L(" [EControlCmdSetVolume [%d]]"), value );
|
|
372 |
|
|
373 |
volumeChanged( value );
|
|
374 |
break;
|
|
375 |
}
|
|
376 |
case EControlCmdSetAspectRatio:
|
|
377 |
{
|
|
378 |
MPX_DEBUG(_L(" [EControlCmdSetAspectRatio %d]"), value );
|
|
379 |
|
|
380 |
aspectRatioChanged( value );
|
|
381 |
|
|
382 |
break;
|
|
383 |
}
|
|
384 |
case EControlCmdSetDownloadSize:
|
|
385 |
{
|
|
386 |
MPX_DEBUG(_L(" [EControlCmdSetDownloadSize [%d]]"), value );
|
|
387 |
setDownloadSize( value );
|
|
388 |
break;
|
|
389 |
}
|
|
390 |
case EControlCmdDownloadUpdated:
|
|
391 |
{
|
|
392 |
MPX_DEBUG(_L(" [EControlCmdDownloadUpdated [%d]]"), value );
|
|
393 |
updateDownloadPosition( value );
|
|
394 |
break;
|
|
395 |
}
|
|
396 |
case EControlCmdDownloadComplete:
|
|
397 |
{
|
|
398 |
MPX_DEBUG(_L(" [EControlCmdDownloadComplete [%d]]"), value);
|
|
399 |
updateDownloadPosition( value );
|
|
400 |
break;
|
|
401 |
}
|
|
402 |
case EControlCmdSetDownloadPaused:
|
|
403 |
case EControlCmdClearDownloadPaused:
|
|
404 |
{
|
|
405 |
mControlsConfig->updateControlList( event );
|
|
406 |
break;
|
|
407 |
}
|
|
408 |
case EControlCmdTvOutConnected:
|
|
409 |
{
|
|
410 |
MPX_DEBUG(_L(" [EControlCmdTvOutConnected]"));
|
|
411 |
|
|
412 |
handleTvOutEvent( true, event );
|
|
413 |
break;
|
|
414 |
}
|
|
415 |
case EControlCmdTvOutDisconnected:
|
|
416 |
{
|
|
417 |
MPX_DEBUG(_L(" [EControlCmdTvOutDisConnected]"));
|
|
418 |
|
|
419 |
handleTvOutEvent( false, event );
|
|
420 |
break;
|
|
421 |
}
|
|
422 |
case EControlCmdHandleErrors:
|
|
423 |
{
|
|
424 |
MPX_DEBUG(_L(" [EControlCmdHandleErrors]"));
|
|
425 |
|
|
426 |
handleErrors();
|
|
427 |
|
|
428 |
break;
|
|
429 |
}
|
|
430 |
case EControlCmdShowVolumeControls:
|
|
431 |
{
|
|
432 |
MPX_DEBUG(_L(" [EControlCmdShowVolumeControls]"));
|
|
433 |
|
|
434 |
showVolumeControls();
|
|
435 |
break;
|
|
436 |
}
|
|
437 |
}
|
|
438 |
}
|
|
439 |
|
|
440 |
// -------------------------------------------------------------------------------------------------
|
|
441 |
// VideoPlaybackControlsController::handleStateChange
|
|
442 |
// -------------------------------------------------------------------------------------------------
|
|
443 |
//
|
|
444 |
void VideoPlaybackControlsController::handleStateChange( TMPXPlaybackState newState )
|
|
445 |
{
|
|
446 |
MPX_ENTER_EXIT(_L("VideoPlaybackControlsController::handleStateChange()"),
|
|
447 |
_L("new state = %d"), newState );
|
|
448 |
|
|
449 |
//
|
|
450 |
// Somehow EPbStatePlaying, EPbStatePaused gets called twice continously
|
|
451 |
//
|
|
452 |
if ( newState != mState )
|
|
453 |
{
|
|
454 |
mState = newState;
|
|
455 |
|
|
456 |
switch ( newState )
|
|
457 |
{
|
|
458 |
case EPbStatePlaying:
|
|
459 |
case EPbStateInitialising:
|
|
460 |
case EPbStateBuffering:
|
|
461 |
case EPbStatePaused:
|
|
462 |
case EPbStateNotInitialised:
|
|
463 |
{
|
|
464 |
//
|
|
465 |
// Show all the controls
|
|
466 |
//
|
|
467 |
showControls();
|
|
468 |
|
|
469 |
updateState();
|
|
470 |
|
|
471 |
break;
|
|
472 |
}
|
|
473 |
default:
|
|
474 |
{
|
|
475 |
break;
|
|
476 |
}
|
|
477 |
}
|
|
478 |
}
|
|
479 |
}
|
|
480 |
|
|
481 |
// -------------------------------------------------------------------------------------------------
|
|
482 |
// VideoPlaybackControlsController::controlsListUpdated()
|
|
483 |
// -------------------------------------------------------------------------------------------------
|
|
484 |
//
|
|
485 |
void VideoPlaybackControlsController::controlsListUpdated()
|
|
486 |
{
|
|
487 |
MPX_ENTER_EXIT(_L("VideoPlaybackControlsController::controlsListUpdated()"));
|
|
488 |
|
|
489 |
hideAllControls();
|
|
490 |
|
|
491 |
QList<TVideoPlaybackControls>& updatedList = mControlsConfig->controlList();
|
|
492 |
|
|
493 |
QList<TVideoPlaybackControls> myList = updatedList;
|
|
494 |
|
|
495 |
int controlCount = mControls.count();
|
|
496 |
|
|
497 |
int i = 0 ;
|
|
498 |
int index = KErrNotFound;
|
|
499 |
|
|
500 |
|
|
501 |
for ( int iCnt = 0 ; iCnt < controlCount ; iCnt++ )
|
|
502 |
{
|
|
503 |
index = myList.indexOf( mControls[i]->controlIndex() );
|
|
504 |
|
|
505 |
if ( index == KErrNotFound )
|
|
506 |
{
|
|
507 |
//
|
|
508 |
// Delete control since it doesn't exist in new list
|
|
509 |
//
|
|
510 |
mControls.removeAt( i );
|
|
511 |
}
|
|
512 |
else
|
|
513 |
{
|
|
514 |
//
|
|
515 |
// Control exists in new list.
|
|
516 |
// Update the policy property based on file details and view mode to the controls
|
|
517 |
//
|
|
518 |
TUint properties = 0;
|
|
519 |
mControlsPolicy->setControlProperties(
|
|
520 |
mControls[i]->controlIndex(), properties, mFileDetails, mViewMode );
|
|
521 |
mControls[i]->updateControlProperties( properties );
|
|
522 |
|
|
523 |
//
|
|
524 |
// Control exists in new list.
|
|
525 |
//
|
|
526 |
myList.removeAt( index );
|
|
527 |
i++;
|
|
528 |
}
|
|
529 |
}
|
|
530 |
|
|
531 |
//
|
|
532 |
// The updated list will contain added controls only
|
|
533 |
//
|
|
534 |
for ( int j = 0 ; j < myList.count() ; j++ )
|
|
535 |
{
|
|
536 |
appendControl( myList[j] );
|
|
537 |
}
|
|
538 |
|
|
539 |
for ( int i = 0 ; i < mControls.count() ; i++ )
|
|
540 |
{
|
|
541 |
mControls[i]->updateControlsWithFileDetails( mFileDetails );
|
|
542 |
}
|
|
543 |
|
|
544 |
showControls();
|
|
545 |
}
|
|
546 |
|
|
547 |
// -------------------------------------------------------------------------------------------------
|
|
548 |
// VideoPlaybackControlsController::appendControl()
|
|
549 |
// -------------------------------------------------------------------------------------------------
|
|
550 |
//
|
|
551 |
void VideoPlaybackControlsController::appendControl( TVideoPlaybackControls controlIndex )
|
|
552 |
{
|
|
553 |
MPX_ENTER_EXIT(_L("VideoPlaybackControlsController::appendControl()"),
|
|
554 |
_L("control index = %d"), controlIndex );
|
|
555 |
|
|
556 |
TUint properties = 0;
|
|
557 |
|
|
558 |
mControlsPolicy->setControlProperties( controlIndex, properties, mFileDetails, mViewMode );
|
|
559 |
VideoPlaybackFullScreenControl* control;
|
|
560 |
|
|
561 |
switch ( controlIndex )
|
|
562 |
{
|
|
563 |
case EBufferingAnimation:
|
|
564 |
{
|
|
565 |
//
|
|
566 |
// Load animation icons
|
|
567 |
//
|
|
568 |
QString animationName = ":/videoplaybackview/animations/";
|
|
569 |
|
|
570 |
if ( mFileDetails->mRNFormat )
|
|
571 |
{
|
|
572 |
animationName.append( "rn_preroll_anim.axml" );
|
|
573 |
}
|
|
574 |
else
|
|
575 |
{
|
|
576 |
animationName.append( "generic_preroll_anim.axml" );
|
|
577 |
}
|
|
578 |
|
|
579 |
HbIconAnimationManager* manager = HbIconAnimationManager::global();
|
|
580 |
bool ok = manager->addDefinitionFile( animationName );
|
|
581 |
|
|
582 |
MPX_DEBUG(_L(" EBufferingAnimation add animation definition ok = %d"), ok);
|
|
583 |
|
|
584 |
//
|
|
585 |
// Buffering animation icon
|
|
586 |
//
|
|
587 |
QGraphicsWidget *widget = mLoader->findWidget( QString( "bufferingIcon" ) );
|
|
588 |
HbLabel *bufferingAnim = qobject_cast<HbLabel*>( widget );
|
|
589 |
|
|
590 |
control = new VideoPlaybackFullScreenControl( this,
|
|
591 |
controlIndex,
|
|
592 |
bufferingAnim,
|
|
593 |
properties );
|
|
594 |
mControls.append( control );
|
|
595 |
|
|
596 |
break;
|
|
597 |
}
|
|
598 |
case EStatusPane:
|
|
599 |
{
|
|
600 |
//
|
|
601 |
// Status key (signal + title + back key)
|
|
602 |
//
|
|
603 |
control = new VideoPlaybackStatusPaneControl( this,
|
|
604 |
controlIndex,
|
|
605 |
NULL,
|
|
606 |
properties );
|
|
607 |
mControls.append( control );
|
|
608 |
|
|
609 |
break;
|
|
610 |
}
|
|
611 |
case EControlBar:
|
|
612 |
{
|
|
613 |
//
|
|
614 |
// Button bar
|
|
615 |
//
|
|
616 |
QGraphicsWidget *widget = mLoader->findWidget( QString( "controlBarLayout" ) );
|
|
617 |
VideoPlaybackControlBar *controlBar =
|
|
618 |
qobject_cast<VideoPlaybackControlBar*>( widget );
|
|
619 |
controlBar->initialize();
|
|
620 |
|
|
621 |
control = new VideoPlaybackFullScreenControl( this,
|
|
622 |
controlIndex,
|
|
623 |
controlBar,
|
|
624 |
properties );
|
|
625 |
mControls.append( control );
|
|
626 |
|
|
627 |
break;
|
|
628 |
}
|
|
629 |
case EFileDetailsWidget:
|
|
630 |
{
|
|
631 |
QGraphicsWidget *widget = mLoader->findWidget( QString( "fileDetailsLayout" ) );
|
|
632 |
VideoPlaybackFileDetailsWidget *fileDetails =
|
|
633 |
qobject_cast<VideoPlaybackFileDetailsWidget*>( widget );
|
|
634 |
|
|
635 |
control = new VideoPlaybackFullScreenControl( this,
|
|
636 |
controlIndex,
|
|
637 |
fileDetails,
|
|
638 |
properties );
|
|
639 |
|
|
640 |
mControls.append( control );
|
|
641 |
break;
|
|
642 |
}
|
|
643 |
case EIndicatorBitmap:
|
|
644 |
{
|
|
645 |
QGraphicsWidget *widget = mLoader->findWidget( QString( "bitmapLayout" ) );
|
|
646 |
HbWidget *bitmapWidget = qobject_cast<HbWidget*>( widget );
|
|
647 |
|
|
648 |
setDefaultBitmap();
|
|
649 |
control = new VideoPlaybackFullScreenControl( this,
|
|
650 |
controlIndex,
|
|
651 |
bitmapWidget,
|
|
652 |
properties );
|
|
653 |
mControls.append( control );
|
|
654 |
|
|
655 |
break;
|
|
656 |
}
|
|
657 |
case ERealLogoBitmap:
|
|
658 |
{
|
|
659 |
QGraphicsWidget *widget = mLoader->findWidget( QString( "rnLogoBitmap" ) );
|
|
660 |
HbWidget *bitmapWidget = qobject_cast<HbWidget*>( widget );
|
|
661 |
|
|
662 |
control = new VideoPlaybackFullScreenControl( this,
|
|
663 |
controlIndex,
|
|
664 |
bitmapWidget,
|
|
665 |
properties );
|
|
666 |
mControls.append( control );
|
|
667 |
|
|
668 |
connect( bitmapWidget, SIGNAL( visibleChanged() ),
|
|
669 |
this, SLOT( handleRNLogoVisibleChanged() ) );
|
|
670 |
|
|
671 |
break;
|
|
672 |
}
|
|
673 |
case EDetailsViewPlaybackWindow:
|
|
674 |
{
|
|
675 |
QGraphicsWidget *widget = mLoader->findWidget( QString( "detailsPlaybackWindow" ) );
|
|
676 |
VideoPlaybackDetailsPlaybackWindow *detailsPlaybackWindow =
|
|
677 |
qobject_cast<VideoPlaybackDetailsPlaybackWindow*>( widget );
|
|
678 |
detailsPlaybackWindow->initialize();
|
|
679 |
|
|
680 |
control = new VideoPlaybackFullScreenControl( this,
|
|
681 |
controlIndex,
|
|
682 |
detailsPlaybackWindow,
|
|
683 |
properties );
|
|
684 |
mControls.append( control );
|
|
685 |
|
|
686 |
break;
|
|
687 |
}
|
|
688 |
}
|
|
689 |
}
|
|
690 |
|
|
691 |
// -------------------------------------------------------------------------------------------------
|
|
692 |
// VideoPlaybackControlsController::handleTappedOnScreen()
|
|
693 |
// -------------------------------------------------------------------------------------------------
|
|
694 |
//
|
|
695 |
void VideoPlaybackControlsController::handleTappedOnScreen()
|
|
696 |
{
|
|
697 |
MPX_ENTER_EXIT(_L("VideoPlaybackControlsController::handleTappedOnScreen()"));
|
|
698 |
|
|
699 |
//
|
|
700 |
// If we are in full screen view, toggle the visibility when playing and paused
|
|
701 |
// If we are in details view, issue playpause
|
|
702 |
// If we are in audio only view, ignore
|
|
703 |
//
|
|
704 |
switch( mViewMode )
|
|
705 |
{
|
|
706 |
case EFullScreenView:
|
|
707 |
{
|
|
708 |
if ( mState == EPbStatePlaying || mState == EPbStatePaused )
|
|
709 |
{
|
|
710 |
if ( isVisible() )
|
|
711 |
{
|
|
712 |
//
|
|
713 |
// If the volume control is visible, hide it
|
|
714 |
//
|
|
715 |
if ( mVolumeControl->isVisible() )
|
|
716 |
{
|
|
717 |
mVolumeControl->setVisible( false );
|
|
718 |
}
|
|
719 |
|
|
720 |
hideAllControls();
|
|
721 |
}
|
|
722 |
else
|
|
723 |
{
|
|
724 |
showControls();
|
|
725 |
}
|
|
726 |
}
|
|
727 |
|
|
728 |
break;
|
|
729 |
}
|
|
730 |
case EDetailsView:
|
|
731 |
{
|
|
732 |
//
|
49
|
733 |
// ignore the tap for 'Pause' action for non-pausable stream in
|
44
|
734 |
// 'Details' view during 'Playing' state
|
|
735 |
//
|
|
736 |
if ( mState != EPbStatePlaying || mFileDetails->mPausableStream )
|
|
737 |
{
|
|
738 |
handleCommand( EMPXPbvCmdPlayPause );
|
|
739 |
}
|
|
740 |
|
|
741 |
break;
|
|
742 |
}
|
|
743 |
}
|
|
744 |
}
|
|
745 |
|
|
746 |
// -------------------------------------------------------------------------------------------------
|
|
747 |
// VideoPlaybackControlsController::resetDisappearingTimers()
|
|
748 |
// -------------------------------------------------------------------------------------------------
|
|
749 |
//
|
|
750 |
void VideoPlaybackControlsController::resetDisappearingTimers( TTimerAction timerAction )
|
|
751 |
{
|
|
752 |
MPX_DEBUG(_L("VideoPlaybackControlsController::resetDisappearingTimers()"));
|
|
753 |
|
|
754 |
if ( mControlsTimer->isActive() )
|
|
755 |
{
|
|
756 |
mControlsTimer->stop();
|
|
757 |
}
|
|
758 |
|
|
759 |
//
|
|
760 |
// Do not start the time for DetailsView and AudioOnlyView
|
|
761 |
//
|
|
762 |
if ( timerAction == ETimerReset &&
|
|
763 |
mState == EPbStatePlaying &&
|
|
764 |
mViewMode == EFullScreenView )
|
|
765 |
{
|
|
766 |
MPX_DEBUG(_L(" Starting Controls Timer"));
|
|
767 |
|
|
768 |
mControlsTimer->start();
|
|
769 |
}
|
|
770 |
}
|
|
771 |
|
|
772 |
// -------------------------------------------------------------------------------------------------
|
|
773 |
// VideoPlaybackControlsController::hideAllControls()
|
|
774 |
// -------------------------------------------------------------------------------------------------
|
|
775 |
//
|
|
776 |
void VideoPlaybackControlsController::hideAllControls()
|
|
777 |
{
|
|
778 |
MPX_DEBUG(_L("VideoPlaybackControlsController::hideControls()"));
|
|
779 |
|
|
780 |
resetDisappearingTimers( ETimerCancel );
|
|
781 |
|
|
782 |
for ( int i = 0 ; i < mControls.count() ; i++ )
|
|
783 |
{
|
|
784 |
mControls[i]->setVisible( false );
|
|
785 |
}
|
|
786 |
}
|
|
787 |
|
|
788 |
// -------------------------------------------------------------------------------------------------
|
|
789 |
// VideoPlaybackControlsController::showControls()
|
|
790 |
// -------------------------------------------------------------------------------------------------
|
|
791 |
//
|
|
792 |
void VideoPlaybackControlsController::showControls()
|
|
793 |
{
|
|
794 |
MPX_DEBUG(_L("VideoPlaybackControlsController::showControls()"));
|
|
795 |
|
|
796 |
resetDisappearingTimers( ETimerReset );
|
|
797 |
|
|
798 |
if ( ! mViewTransitionIsGoingOn && mOrientation == Qt::Horizontal )
|
|
799 |
{
|
|
800 |
for ( int i = 0 ; i < mControls.count() ; i++ )
|
|
801 |
{
|
|
802 |
mControls[i]->setVisibility( mState );
|
|
803 |
}
|
|
804 |
}
|
|
805 |
}
|
|
806 |
|
|
807 |
// -------------------------------------------------------------------------------------------------
|
|
808 |
// VideoPlaybackControlsController::isVisible()
|
|
809 |
// -------------------------------------------------------------------------------------------------
|
|
810 |
//
|
|
811 |
bool VideoPlaybackControlsController::isVisible()
|
|
812 |
{
|
|
813 |
bool visible = false;
|
|
814 |
|
|
815 |
for ( int i = 0 ; i < mControls.count() ; i++ )
|
|
816 |
{
|
|
817 |
if ( mControls[i]->controlIndex() == EControlBar )
|
|
818 |
{
|
|
819 |
if ( mControls[i]->isVisible() )
|
|
820 |
{
|
|
821 |
visible = true;
|
|
822 |
}
|
|
823 |
|
|
824 |
break;
|
|
825 |
}
|
|
826 |
}
|
|
827 |
|
|
828 |
MPX_DEBUG(_L("VideoPlaybackControlsController::isVisible() [%d]"), visible);
|
|
829 |
|
|
830 |
return visible;
|
|
831 |
}
|
|
832 |
|
|
833 |
// -------------------------------------------------------------------------------------------------
|
|
834 |
// VideoPlaybackControlsController::handleCommand()
|
|
835 |
// -------------------------------------------------------------------------------------------------
|
|
836 |
//
|
|
837 |
void VideoPlaybackControlsController::handleCommand(
|
|
838 |
TMPXVideoPlaybackViewCommandIds command, int value )
|
|
839 |
{
|
|
840 |
MPX_DEBUG(_L("VideoPlaybackControlsController::handleCommand(%d)"), command);
|
|
841 |
|
|
842 |
switch( command )
|
|
843 |
{
|
|
844 |
case EMPXPbvCmdSetPosition:
|
|
845 |
{
|
|
846 |
TRAP_IGNORE( mViewWrapper->SetPropertyL( EPbPropertyPosition,
|
|
847 |
value * KPbMilliMultiplier ) );
|
|
848 |
break;
|
|
849 |
}
|
|
850 |
case EMPXPbvCmdSetVolume:
|
|
851 |
{
|
|
852 |
TRAP_IGNORE( mViewWrapper->SetPropertyL( EPbPropertyVolume, value ) );
|
|
853 |
break;
|
|
854 |
}
|
|
855 |
default:
|
|
856 |
{
|
|
857 |
TRAP_IGNORE( mViewWrapper->HandleCommandL( command ) );
|
|
858 |
break;
|
|
859 |
}
|
|
860 |
}
|
|
861 |
}
|
|
862 |
|
|
863 |
// -------------------------------------------------------------------------------------------------
|
|
864 |
// VideoPlaybackControlsController::volumeChanged()
|
|
865 |
// -------------------------------------------------------------------------------------------------
|
|
866 |
//
|
|
867 |
void VideoPlaybackControlsController::volumeChanged( int volume )
|
|
868 |
{
|
|
869 |
MPX_DEBUG(_L("VideoPlaybackControlsController::volumeChanged() [%d]"), volume);
|
|
870 |
|
|
871 |
if ( mVolumeControl )
|
|
872 |
{
|
|
873 |
mVolumeControl->setValue( volume );
|
|
874 |
}
|
|
875 |
}
|
|
876 |
|
|
877 |
// -------------------------------------------------------------------------------------------------
|
|
878 |
// VideoPlaybackControlsController::showVolumeControls()
|
|
879 |
// -------------------------------------------------------------------------------------------------
|
|
880 |
//
|
|
881 |
void VideoPlaybackControlsController::showVolumeControls()
|
|
882 |
{
|
|
883 |
MPX_DEBUG(_L("VideoPlaybackControlsController::showVolumeControls()"));
|
|
884 |
|
|
885 |
if ( mVolumeControl )
|
|
886 |
{
|
|
887 |
mVolumeControl->setVisible( true );
|
|
888 |
}
|
|
889 |
}
|
|
890 |
|
|
891 |
// -------------------------------------------------------------------------------------------------
|
|
892 |
// VideoPlaybackControlsController::durationChanged()
|
|
893 |
// -------------------------------------------------------------------------------------------------
|
|
894 |
//
|
|
895 |
void VideoPlaybackControlsController::durationChanged( int duration )
|
|
896 |
{
|
|
897 |
MPX_DEBUG(_L("VideoPlaybackControlsController::durationChanged() [%d]"), duration);
|
|
898 |
|
|
899 |
for ( int i = 0 ; i < mControls.count() ; i++ )
|
|
900 |
{
|
|
901 |
if ( mControls[i]->durationChanged( duration ) )
|
|
902 |
{
|
|
903 |
break;
|
|
904 |
}
|
|
905 |
}
|
|
906 |
}
|
|
907 |
|
|
908 |
// -------------------------------------------------------------------------------------------------
|
|
909 |
// VideoPlaybackControlsController::positionChanged()
|
|
910 |
// -------------------------------------------------------------------------------------------------
|
|
911 |
//
|
|
912 |
void VideoPlaybackControlsController::positionChanged( int position )
|
|
913 |
{
|
|
914 |
MPX_DEBUG(_L("VideoPlaybackControlsController::positionChanged() [%d]"), position);
|
|
915 |
|
|
916 |
for ( int i = 0 ; i < mControls.count() ; i++ )
|
|
917 |
{
|
|
918 |
if ( mControls[i]->positionChanged( position ) )
|
|
919 |
{
|
|
920 |
break;
|
|
921 |
}
|
|
922 |
}
|
|
923 |
}
|
|
924 |
|
|
925 |
// -------------------------------------------------------------------------------------------------
|
|
926 |
// VideoPlaybackControlsController::aspectRatioChanged()
|
|
927 |
// -------------------------------------------------------------------------------------------------
|
|
928 |
//
|
|
929 |
void VideoPlaybackControlsController::aspectRatioChanged( int aspectRatio )
|
|
930 |
{
|
|
931 |
MPX_DEBUG(_L("CMPXVideoPlaybackControlsController::aspectRatioChanged() [%d]"), aspectRatio);
|
|
932 |
|
|
933 |
for ( int i = 0 ; i < mControls.count() ; i++ )
|
|
934 |
{
|
|
935 |
if ( mControls[i]->aspectRatioChanged( aspectRatio ) )
|
|
936 |
{
|
|
937 |
break;
|
|
938 |
}
|
|
939 |
}
|
|
940 |
}
|
|
941 |
|
|
942 |
// -------------------------------------------------------------------------------------------------
|
|
943 |
// VideoPlaybackControlsController::updateState()
|
|
944 |
// -------------------------------------------------------------------------------------------------
|
|
945 |
//
|
|
946 |
void VideoPlaybackControlsController::updateState()
|
|
947 |
{
|
|
948 |
MPX_DEBUG(_L("VideoPlaybackControlsController::updateState() [%d]"), mState);
|
|
949 |
|
|
950 |
for ( int i = 0 ; i < mControls.count() ; i++ )
|
|
951 |
{
|
|
952 |
mControls[i]->updateState( mState );
|
|
953 |
}
|
|
954 |
}
|
|
955 |
|
|
956 |
// -------------------------------------------------------------------------------------------------
|
|
957 |
// VideoPlaybackControlsController::realFormat()
|
|
958 |
// -------------------------------------------------------------------------------------------------
|
|
959 |
//
|
|
960 |
bool VideoPlaybackControlsController::realFormat( QString filename )
|
|
961 |
{
|
|
962 |
bool realFormat = false;
|
|
963 |
|
|
964 |
if ( !filename.isNull() && !filename.isEmpty() )
|
|
965 |
{
|
|
966 |
if ( mFileDetails->mPlaybackMode == EMPXVideoStreaming ||
|
|
967 |
mFileDetails->mPlaybackMode == EMPXVideoLiveStreaming )
|
|
968 |
{
|
|
969 |
TBufC<255> file(filename.utf16());
|
|
970 |
realFormat = realFormatForStreaming( file );
|
|
971 |
}
|
|
972 |
else
|
|
973 |
{
|
|
974 |
realFormat = realFormatForLocal();
|
|
975 |
}
|
|
976 |
}
|
|
977 |
|
|
978 |
MPX_DEBUG(_L("VideoPlaybackControlsController::realFormat() [%d]"), realFormat);
|
|
979 |
|
|
980 |
return realFormat;
|
|
981 |
}
|
|
982 |
|
|
983 |
// -------------------------------------------------------------------------------------------------
|
|
984 |
// VideoPlaybackControlsController::realFormatForStreaming()
|
|
985 |
// -------------------------------------------------------------------------------------------------
|
|
986 |
//
|
|
987 |
bool VideoPlaybackControlsController::realFormatForStreaming( const TDesC& des )
|
|
988 |
{
|
|
989 |
bool realFormat = false;
|
|
990 |
TParse filePath;
|
|
991 |
|
|
992 |
_LIT(KMPXRMEXT, ".R" );
|
|
993 |
|
|
994 |
int err = filePath.Set( des, NULL, NULL );
|
|
995 |
|
|
996 |
//
|
|
997 |
// It is valid to have a "\" character in a url, but parsing fails,
|
|
998 |
// switch these characters to "/" for the local string and try parsing again.
|
|
999 |
//
|
|
1000 |
if ( err == KErrBadName )
|
|
1001 |
{
|
|
1002 |
int backsashPos = des.LocateF('\\');
|
|
1003 |
|
|
1004 |
if( backsashPos != KErrNotFound )
|
|
1005 |
{
|
|
1006 |
HBufC* fileName = NULL;
|
|
1007 |
|
|
1008 |
TRAP( err, fileName = des.AllocL() );
|
|
1009 |
|
|
1010 |
if ( err == KErrNone )
|
|
1011 |
{
|
|
1012 |
int count( fileName->Des().Length() );
|
|
1013 |
|
|
1014 |
for ( int j = backsashPos ; j < count; ++j )
|
|
1015 |
{
|
|
1016 |
if ( fileName->Des()[j]== '\\' )
|
|
1017 |
{
|
|
1018 |
fileName->Des()[j]='/';
|
|
1019 |
}
|
|
1020 |
}
|
|
1021 |
err = filePath.Set( fileName->Des(), NULL, NULL );
|
|
1022 |
}
|
|
1023 |
|
|
1024 |
if ( fileName )
|
|
1025 |
{
|
|
1026 |
delete fileName;
|
|
1027 |
fileName = NULL;
|
|
1028 |
}
|
|
1029 |
}
|
|
1030 |
}
|
|
1031 |
|
|
1032 |
if ( err == KErrNone )
|
|
1033 |
{
|
|
1034 |
//
|
|
1035 |
// The requirement to support arguments with the extension in streaming links
|
|
1036 |
// for-ex: /video.3gp?start=10&end=40 will have to supported
|
|
1037 |
// as well. So just by doing p.Ext() would retrieve all the string
|
|
1038 |
// after "." so by doing a Left(2) would retrieve only
|
|
1039 |
// .3g or .rm and so on. This would help better
|
|
1040 |
// interpret the extension and decide the branding accordingly
|
|
1041 |
//
|
|
1042 |
filePath.Set( filePath.NameAndExt(), NULL, NULL );
|
|
1043 |
TPtrC extension = filePath.Ext().Left( 2 );
|
|
1044 |
|
|
1045 |
TBuf<2> buf;
|
|
1046 |
buf.Format( extension );
|
|
1047 |
buf.UpperCase();
|
|
1048 |
|
|
1049 |
// RealMedia Branding
|
|
1050 |
if ( ! buf.Compare( KMPXRMEXT ) )
|
|
1051 |
{
|
|
1052 |
realFormat = true;
|
|
1053 |
}
|
|
1054 |
}
|
|
1055 |
|
|
1056 |
MPX_DEBUG(_L("VideoPlaybackControlsController::realFormatForStreaming()[%d]"), realFormat);
|
|
1057 |
|
|
1058 |
return realFormat;
|
|
1059 |
}
|
|
1060 |
|
|
1061 |
// -------------------------------------------------------------------------------------------------
|
|
1062 |
// VideoPlaybackControlsController::realFormatForLocal()
|
|
1063 |
// -------------------------------------------------------------------------------------------------
|
|
1064 |
//
|
|
1065 |
bool VideoPlaybackControlsController::realFormatForLocal()
|
|
1066 |
{
|
|
1067 |
bool realFormat = false;
|
|
1068 |
|
|
1069 |
QString real( "real" );
|
|
1070 |
QString rn( "rn" );
|
|
1071 |
|
|
1072 |
if ( mFileDetails->mMimeType.contains( real, Qt::CaseInsensitive ) ||
|
|
1073 |
mFileDetails->mMimeType.contains( rn, Qt::CaseInsensitive ) )
|
|
1074 |
{
|
|
1075 |
realFormat = true;
|
|
1076 |
}
|
|
1077 |
|
|
1078 |
MPX_DEBUG(_L("VideoPlaybackControlsController::realFormatForLocal() [%d]"), realFormat);
|
|
1079 |
|
|
1080 |
return realFormat;
|
|
1081 |
}
|
|
1082 |
|
|
1083 |
// -------------------------------------------------------------------------------------------------
|
|
1084 |
// VideoPlaybackControlsController::setDownloadSize()
|
|
1085 |
// -------------------------------------------------------------------------------------------------
|
|
1086 |
//
|
|
1087 |
void VideoPlaybackControlsController::setDownloadSize( int size )
|
|
1088 |
{
|
|
1089 |
MPX_DEBUG(_L("VideoPlaybackControlsController::setDownloadSize() [%d]"), size);
|
|
1090 |
|
|
1091 |
for ( int i = 0 ; i < mControls.count() ; i++ )
|
|
1092 |
{
|
|
1093 |
if ( mControls[i]->setDownloadSize( size ) )
|
|
1094 |
{
|
|
1095 |
break;
|
|
1096 |
}
|
|
1097 |
}
|
|
1098 |
}
|
|
1099 |
|
|
1100 |
// -------------------------------------------------------------------------------------------------
|
|
1101 |
// VideoPlaybackControlsController::updateDownloadPosition()
|
|
1102 |
// -------------------------------------------------------------------------------------------------
|
|
1103 |
//
|
|
1104 |
void VideoPlaybackControlsController::updateDownloadPosition( int size )
|
|
1105 |
{
|
|
1106 |
MPX_DEBUG(_L("VideoPlaybackControlsController::updateDownloadPosition() [%d]"), size);
|
|
1107 |
|
|
1108 |
for ( int i = 0 ; i < mControls.count() ; i++ )
|
|
1109 |
{
|
|
1110 |
if ( mControls[i]->updateDownloadPosition( size ) )
|
|
1111 |
{
|
|
1112 |
break;
|
|
1113 |
}
|
|
1114 |
}
|
|
1115 |
}
|
|
1116 |
|
|
1117 |
// -------------------------------------------------------------------------------------------------
|
|
1118 |
// VideoPlaybackControlsController::handleErrors
|
|
1119 |
// -------------------------------------------------------------------------------------------------
|
|
1120 |
//
|
|
1121 |
void VideoPlaybackControlsController::handleErrors()
|
|
1122 |
{
|
|
1123 |
MPX_ENTER_EXIT(_L("VideoPlaybackControlsController::handleErrors()"),
|
|
1124 |
_L("mState = %d"), mState );
|
|
1125 |
}
|
|
1126 |
|
|
1127 |
// -------------------------------------------------------------------------------------------------
|
|
1128 |
// VideoPlaybackControlsController::isSoftKeyVisible()
|
|
1129 |
// -------------------------------------------------------------------------------------------------
|
|
1130 |
//
|
|
1131 |
bool VideoPlaybackControlsController::isSoftKeyVisible()
|
|
1132 |
{
|
|
1133 |
bool visible = false;
|
|
1134 |
|
|
1135 |
for ( int i = 0 ; i < mControls.count() ; i++ )
|
|
1136 |
{
|
|
1137 |
if ( mControls[i]->controlIndex() == EStatusPane )
|
|
1138 |
{
|
|
1139 |
if ( mControls[i]->isVisible() )
|
|
1140 |
{
|
|
1141 |
visible = true;
|
|
1142 |
}
|
|
1143 |
|
|
1144 |
break;
|
|
1145 |
}
|
|
1146 |
}
|
|
1147 |
|
|
1148 |
MPX_DEBUG(_L("VideoPlaybackControlsController::isSoftKeyVisible() [%d]"), visible);
|
|
1149 |
|
|
1150 |
return visible;
|
|
1151 |
}
|
|
1152 |
|
|
1153 |
// -------------------------------------------------------------------------------------------------
|
|
1154 |
// VideoPlaybackControlsController::handleTvOutEvent
|
|
1155 |
// -------------------------------------------------------------------------------------------------
|
|
1156 |
//
|
|
1157 |
void VideoPlaybackControlsController::handleTvOutEvent(
|
|
1158 |
bool connected, TVideoPlaybackControlCommandIds event )
|
|
1159 |
{
|
|
1160 |
Q_UNUSED( event );
|
|
1161 |
|
|
1162 |
MPX_DEBUG(_L("VideoPlaybackControlsController::handleTvOutEvent()"));
|
|
1163 |
|
|
1164 |
mFileDetails->mTvOutConnected = connected;
|
|
1165 |
|
|
1166 |
setDefaultBitmap();
|
|
1167 |
|
|
1168 |
if ( mFileDetails->mTvOutConnected )
|
|
1169 |
{
|
|
1170 |
generateThumbNail();
|
|
1171 |
}
|
|
1172 |
|
|
1173 |
//
|
|
1174 |
// Change the view.
|
|
1175 |
// If Tv-out is connected, go to AudioOnlyView.
|
|
1176 |
// If not, go back to default view.
|
|
1177 |
//
|
|
1178 |
TPlaybackViewMode viewMode = EFullScreenView;
|
|
1179 |
|
|
1180 |
if ( mFileDetails->mTvOutConnected || ! mFileDetails->mVideoEnabled )
|
|
1181 |
{
|
|
1182 |
viewMode = EAudioOnlyView;
|
|
1183 |
}
|
|
1184 |
|
|
1185 |
changeViewMode( viewMode, false );
|
|
1186 |
}
|
|
1187 |
|
|
1188 |
// -------------------------------------------------------------------------------------------------
|
|
1189 |
// VideoPlaybackControlsController::changeViewMode
|
|
1190 |
// -------------------------------------------------------------------------------------------------
|
|
1191 |
//
|
|
1192 |
void VideoPlaybackControlsController::changeViewMode(
|
|
1193 |
TPlaybackViewMode viewMode, bool transitionEffect )
|
|
1194 |
{
|
|
1195 |
MPX_DEBUG(_L("VideoPlaybackControlsController::changeViewMode( %d, %d )"),
|
|
1196 |
viewMode, transitionEffect );
|
|
1197 |
|
|
1198 |
if ( viewMode != mViewMode )
|
|
1199 |
{
|
|
1200 |
switch ( viewMode )
|
|
1201 |
{
|
|
1202 |
case EFullScreenView:
|
|
1203 |
case EDetailsView:
|
|
1204 |
{
|
|
1205 |
if ( mFileDetails->mVideoEnabled && ! mFileDetails->mTvOutConnected )
|
|
1206 |
{
|
|
1207 |
mViewMode = viewMode;
|
|
1208 |
|
|
1209 |
//
|
|
1210 |
// Hack to clean up the screen before transition. We may not need it in NGA env
|
|
1211 |
//
|
|
1212 |
hideAllControls();
|
|
1213 |
|
|
1214 |
updateVideoRect( transitionEffect );
|
|
1215 |
}
|
|
1216 |
|
|
1217 |
break;
|
|
1218 |
}
|
|
1219 |
case EAudioOnlyView:
|
|
1220 |
{
|
|
1221 |
if ( ! mFileDetails->mVideoEnabled || mFileDetails->mTvOutConnected )
|
|
1222 |
{
|
|
1223 |
mViewMode = viewMode;
|
|
1224 |
|
|
1225 |
mControlsConfig->updateControlList( EControlCmdAudionOnlyViewOpened );
|
|
1226 |
}
|
|
1227 |
|
|
1228 |
break;
|
|
1229 |
}
|
|
1230 |
default:
|
|
1231 |
{
|
|
1232 |
break;
|
|
1233 |
}
|
|
1234 |
}
|
|
1235 |
}
|
|
1236 |
}
|
|
1237 |
|
|
1238 |
// -------------------------------------------------------------------------------------------------
|
|
1239 |
// VideoPlaybackControlsController::updateVideoRectDone
|
|
1240 |
// -------------------------------------------------------------------------------------------------
|
|
1241 |
//
|
|
1242 |
void VideoPlaybackControlsController::updateVideoRectDone()
|
|
1243 |
{
|
|
1244 |
MPX_DEBUG(_L("VideoPlaybackControlsController::updateVideoRectDone()"));
|
|
1245 |
|
|
1246 |
mViewTransitionIsGoingOn = false;
|
|
1247 |
|
|
1248 |
TVideoPlaybackControlCommandIds event = EControlCmdFullScreenViewOpened;
|
|
1249 |
|
|
1250 |
if ( mViewMode == EDetailsView )
|
|
1251 |
{
|
|
1252 |
event = EControlCmdDetailsViewOpened;
|
|
1253 |
}
|
|
1254 |
|
|
1255 |
mControlsConfig->updateControlList( event );
|
|
1256 |
}
|
|
1257 |
|
|
1258 |
// -------------------------------------------------------------------------------------------------
|
|
1259 |
// VideoPlaybackControlsController::skipToPreviousVideoItem
|
|
1260 |
// -------------------------------------------------------------------------------------------------
|
|
1261 |
//
|
|
1262 |
void VideoPlaybackControlsController::skipToPreviousVideoItem()
|
|
1263 |
{
|
|
1264 |
MPX_DEBUG(_L("VideoPlaybackControlsController::skipToPreviousVideoItem()"));
|
|
1265 |
|
|
1266 |
if ( mViewMode == EFullScreenView )
|
|
1267 |
{
|
|
1268 |
handleCommand( EMPXPbvCmdPreviousListItem );
|
|
1269 |
}
|
|
1270 |
}
|
|
1271 |
|
|
1272 |
// -------------------------------------------------------------------------------------------------
|
|
1273 |
// VideoPlaybackControlsController::skipToNextVideoItem
|
|
1274 |
// -------------------------------------------------------------------------------------------------
|
|
1275 |
//
|
|
1276 |
void VideoPlaybackControlsController::skipToNextVideoItem()
|
|
1277 |
{
|
|
1278 |
MPX_DEBUG(_L("VideoPlaybackControlsController::skipToNextVideoItem()"));
|
|
1279 |
|
|
1280 |
if ( mViewMode == EFullScreenView )
|
|
1281 |
{
|
|
1282 |
handleCommand( EMPXPbvCmdNextListItem );
|
|
1283 |
}
|
|
1284 |
}
|
|
1285 |
|
|
1286 |
// -------------------------------------------------------------------------------------------------
|
|
1287 |
// VideoPlaybackControlsController::updateVideoRect()
|
|
1288 |
// -------------------------------------------------------------------------------------------------
|
|
1289 |
//
|
|
1290 |
void VideoPlaybackControlsController::updateVideoRect( bool transitionEffect )
|
|
1291 |
{
|
|
1292 |
MPX_DEBUG(_L("VideoPlaybackControlsController::updateVideoRect( %d )"),
|
|
1293 |
transitionEffect );
|
|
1294 |
|
|
1295 |
if ( mFileDetails->mVideoEnabled && ! mFileDetails->mTvOutConnected )
|
|
1296 |
{
|
|
1297 |
mViewTransitionIsGoingOn = true;
|
|
1298 |
|
|
1299 |
QRectF rect;
|
|
1300 |
|
|
1301 |
MPX_DEBUG(_L("VideoPlaybackControlsController::updateVideoRect() : mViewMode = %d )"),
|
|
1302 |
mViewMode );
|
|
1303 |
|
|
1304 |
if ( mViewMode == EDetailsView )
|
|
1305 |
{
|
|
1306 |
QGraphicsWidget *parent = mLoader->findWidget( QString( "detailsPlaybackWindow" ) );
|
|
1307 |
QGraphicsWidget *child = mLoader->findWidget( QString( "small_transparentWindow" ) );
|
|
1308 |
|
|
1309 |
rect = parent->mapRectToScene( child->geometry() );
|
|
1310 |
}
|
|
1311 |
else if ( mViewMode == EFullScreenView )
|
|
1312 |
{
|
|
1313 |
QGraphicsWidget *widget = mLoader->findWidget( QString( "content" ) );
|
|
1314 |
rect = widget->geometry();
|
|
1315 |
}
|
|
1316 |
|
|
1317 |
mViewWrapper->UpdateVideoRect(
|
|
1318 |
rect.x(), rect.y(), rect.width(), rect.height(), transitionEffect );
|
|
1319 |
}
|
|
1320 |
}
|
|
1321 |
|
|
1322 |
// -------------------------------------------------------------------------------------------------
|
|
1323 |
// VideoPlaybackControlsController::setDefaultBitmap()
|
|
1324 |
// -------------------------------------------------------------------------------------------------
|
|
1325 |
//
|
|
1326 |
void VideoPlaybackControlsController::setDefaultBitmap()
|
|
1327 |
{
|
|
1328 |
MPX_DEBUG(_L("VideoPlaybackControlsController::setDefaultBitmap()"));
|
|
1329 |
|
|
1330 |
//
|
|
1331 |
// set specific bitmaps for audio only and tv out cases
|
|
1332 |
// If we already requested a thumbnail, we will set the thumbnail after we receive the thumbnail
|
|
1333 |
//
|
|
1334 |
if ( mLoader && mThumbNailState != EThumbNailRequsted )
|
|
1335 |
{
|
|
1336 |
QGraphicsWidget *tvOutBitmap = mLoader->findWidget( "tvOutBitmap" );
|
|
1337 |
tvOutBitmap->setVisible( false );
|
|
1338 |
|
|
1339 |
QGraphicsWidget *realAudioOnlyBitmap = mLoader->findWidget( "realAudioOnlyBitmap" );
|
|
1340 |
realAudioOnlyBitmap->setVisible( false );
|
|
1341 |
|
|
1342 |
QGraphicsWidget *partialAudioOnlyBitmap = mLoader->findWidget( "partialAudioOnlyBitmap" );
|
|
1343 |
partialAudioOnlyBitmap->setVisible( false );
|
|
1344 |
|
|
1345 |
QGraphicsWidget *audioOnlyBitmap = mLoader->findWidget( "audioOnlyBitmap" );
|
|
1346 |
audioOnlyBitmap->setVisible( false );
|
|
1347 |
|
|
1348 |
if ( mFileDetails->mTvOutConnected )
|
|
1349 |
{
|
|
1350 |
tvOutBitmap->setVisible( true );
|
|
1351 |
}
|
|
1352 |
else if ( mFileDetails->mRNFormat )
|
|
1353 |
{
|
|
1354 |
realAudioOnlyBitmap->setVisible( true );
|
|
1355 |
}
|
|
1356 |
else if ( mFileDetails->mPartialPlayback )
|
|
1357 |
{
|
|
1358 |
partialAudioOnlyBitmap->setVisible( true );
|
|
1359 |
}
|
|
1360 |
else
|
|
1361 |
{
|
|
1362 |
audioOnlyBitmap->setVisible( true );
|
|
1363 |
}
|
|
1364 |
}
|
|
1365 |
}
|
|
1366 |
|
|
1367 |
// -------------------------------------------------------------------------------------------------
|
|
1368 |
// VideoPlaybackControlsController::generateThumbNail()
|
|
1369 |
// -------------------------------------------------------------------------------------------------
|
|
1370 |
//
|
|
1371 |
void VideoPlaybackControlsController::generateThumbNail()
|
|
1372 |
{
|
|
1373 |
MPX_DEBUG(_L("VideoPlaybackControlsController::generateThumbNail()"));
|
|
1374 |
|
|
1375 |
//
|
|
1376 |
// Generate thumbnail if it is local playback
|
|
1377 |
//
|
|
1378 |
if ( mFileDetails->mPlaybackMode == EMPXVideoLocal )
|
|
1379 |
{
|
|
1380 |
if ( mThumbNailState == EThumbNailEmpty )
|
|
1381 |
{
|
|
1382 |
mThumbnailManager = new ThumbnailManager(); ;
|
|
1383 |
|
|
1384 |
mThumbnailManager->setThumbnailSize( ThumbnailManager::ThumbnailLarge );
|
|
1385 |
mThumbnailManager->setQualityPreference( ThumbnailManager::OptimizeForPerformance );
|
|
1386 |
|
|
1387 |
if ( connect( mThumbnailManager, SIGNAL( thumbnailReady( QPixmap , void * , int , int ) ),
|
|
1388 |
this, SLOT( handleThumbnailReady( QPixmap , void * , int , int ) ) ) )
|
|
1389 |
{
|
|
1390 |
mThumbnailManager->getThumbnail( mFileDetails->mClipName );
|
|
1391 |
mThumbNailState = EThumbNailRequsted;
|
|
1392 |
}
|
|
1393 |
}
|
|
1394 |
}
|
|
1395 |
else
|
|
1396 |
{
|
|
1397 |
mThumbNailState = EThumbNailNotAvailable;
|
|
1398 |
}
|
|
1399 |
}
|
|
1400 |
|
|
1401 |
// -------------------------------------------------------------------------------------------------
|
|
1402 |
// VideoPlaybackControlsController::handleThumbnailReady()
|
|
1403 |
// -------------------------------------------------------------------------------------------------
|
|
1404 |
//
|
|
1405 |
void VideoPlaybackControlsController::handleThumbnailReady(
|
|
1406 |
QPixmap tnData, void *internal , int id, int error )
|
|
1407 |
{
|
|
1408 |
Q_UNUSED( internal );
|
|
1409 |
Q_UNUSED( id );
|
|
1410 |
|
|
1411 |
if( ! error && mLoader )
|
|
1412 |
{
|
|
1413 |
QGraphicsWidget *tvOutBitmap = mLoader->findWidget( "tvOutBitmap" );
|
|
1414 |
HbLabel *tvOutLabel = qobject_cast<HbLabel*>( tvOutBitmap );
|
|
1415 |
|
49
|
1416 |
QIcon qicon( tnData );
|
44
|
1417 |
|
49
|
1418 |
HbIcon hbIcon( qicon );
|
|
1419 |
hbIcon.setSize( tvOutBitmap->size() );
|
|
1420 |
tvOutLabel->setIcon( hbIcon );
|
44
|
1421 |
|
|
1422 |
mThumbNailState = EThumbNailSet;
|
|
1423 |
}
|
|
1424 |
else
|
|
1425 |
{
|
|
1426 |
mThumbNailState = EThumbNailNotAvailable;
|
|
1427 |
}
|
|
1428 |
|
|
1429 |
setDefaultBitmap();
|
|
1430 |
|
|
1431 |
disconnect( mThumbnailManager, SIGNAL( thumbnailReady( QPixmap , void * , int , int ) ),
|
|
1432 |
this, SLOT( handleThumbnailReady( QPixmap , void * , int , int ) ) );
|
|
1433 |
}
|
|
1434 |
|
|
1435 |
// -------------------------------------------------------------------------------------------------
|
|
1436 |
// VideoPlaybackControlsController::attachVideo()
|
|
1437 |
// -------------------------------------------------------------------------------------------------
|
|
1438 |
//
|
|
1439 |
void VideoPlaybackControlsController::attachVideo()
|
|
1440 |
{
|
|
1441 |
MPX_ENTER_EXIT(_L("VideoPlaybackControlsController::attachVideo()"),
|
|
1442 |
_L("file = %s"), mFileDetails->mClipName.data() );
|
|
1443 |
|
|
1444 |
//
|
|
1445 |
// close playback view
|
|
1446 |
//
|
|
1447 |
mView->closePlaybackView();
|
|
1448 |
|
|
1449 |
//
|
|
1450 |
// emit signal to launch videoservices itemSelected() slot
|
|
1451 |
//
|
|
1452 |
emit( attachVideoPath( mFileDetails->mClipName ) );
|
|
1453 |
|
|
1454 |
}
|
|
1455 |
|
|
1456 |
// -------------------------------------------------------------------------------------------------
|
|
1457 |
// VideoPlaybackControlsController::sendVideo()
|
|
1458 |
// -------------------------------------------------------------------------------------------------
|
|
1459 |
//
|
|
1460 |
void VideoPlaybackControlsController::sendVideo()
|
|
1461 |
{
|
|
1462 |
MPX_ENTER_EXIT(_L("VideoPlaybackControlsController::sendVideo()"),
|
|
1463 |
_L("file = %s"), mFileDetails->mClipName.data() );
|
|
1464 |
|
|
1465 |
//
|
|
1466 |
// send video to shareUI
|
|
1467 |
//
|
|
1468 |
ShareUi dlg;
|
|
1469 |
QStringList fileList;
|
|
1470 |
fileList.append( mFileDetails->mClipName );
|
|
1471 |
dlg.send( fileList, true );
|
|
1472 |
}
|
|
1473 |
|
|
1474 |
// -------------------------------------------------------------------------------------------------
|
|
1475 |
// VideoPlaybackControlsController::handleRNLogoVisibleChanged()
|
|
1476 |
// -------------------------------------------------------------------------------------------------
|
|
1477 |
//
|
|
1478 |
void VideoPlaybackControlsController::handleRNLogoVisibleChanged()
|
|
1479 |
{
|
|
1480 |
MPX_ENTER_EXIT(_L("VideoPlaybackControlsController::handleRNLogoVisibleChanged()"));
|
|
1481 |
|
|
1482 |
QGraphicsWidget *widget = mLoader->findWidget( QString( "rnLogoBitmap" ) );
|
|
1483 |
|
|
1484 |
if ( widget->isVisible() )
|
|
1485 |
{
|
|
1486 |
if ( mRNLogoTimer )
|
|
1487 |
{
|
|
1488 |
delete mRNLogoTimer;
|
|
1489 |
mRNLogoTimer = NULL;
|
|
1490 |
}
|
|
1491 |
|
|
1492 |
mRNLogoTimer = new QTimer( this );
|
|
1493 |
mRNLogoTimer->setInterval( KRNLogoTimeOut );
|
|
1494 |
mRNLogoTimer->setSingleShot( true );
|
|
1495 |
connect( mRNLogoTimer, SIGNAL( timeout() ), this, SLOT( handleRNLogoTimeout() ) );
|
|
1496 |
|
|
1497 |
mRNLogoTimer->start();
|
|
1498 |
}
|
|
1499 |
}
|
|
1500 |
|
|
1501 |
// -------------------------------------------------------------------------------------------------
|
|
1502 |
// VideoPlaybackControlsController::handleRNLogoTimeout()
|
|
1503 |
// -------------------------------------------------------------------------------------------------
|
|
1504 |
//
|
|
1505 |
void VideoPlaybackControlsController::handleRNLogoTimeout()
|
|
1506 |
{
|
|
1507 |
MPX_DEBUG(_L("VideoPlaybackControlsController::handleRNLogoTimeout()"));
|
|
1508 |
|
|
1509 |
if ( mRNLogoTimer->isActive() )
|
|
1510 |
{
|
|
1511 |
mRNLogoTimer->stop();
|
|
1512 |
}
|
|
1513 |
|
|
1514 |
//
|
|
1515 |
// Remove RN logo from the controls list and issue play command if needed
|
|
1516 |
//
|
|
1517 |
mControlsConfig->updateControlList( EControlCmdRemoveRNLogo );
|
|
1518 |
handleCommand( EMPXPbvCmdRealOneBitmapTimeout );
|
|
1519 |
}
|
|
1520 |
|
|
1521 |
// -------------------------------------------------------------------------------------------------
|
|
1522 |
// VideoPlaybackControlsController::isRNLogoBitmapInControlList()
|
|
1523 |
// -------------------------------------------------------------------------------------------------
|
|
1524 |
//
|
|
1525 |
bool VideoPlaybackControlsController::isRNLogoBitmapInControlList()
|
|
1526 |
{
|
|
1527 |
bool exist = false;
|
|
1528 |
|
|
1529 |
//
|
|
1530 |
// If we have a rn logo in the list, we are supposed to show the logo all the time
|
|
1531 |
// unless we are in the middle of orientation transition
|
|
1532 |
//
|
|
1533 |
for ( int i = 0 ; i < mControls.count() ; i++ )
|
|
1534 |
{
|
|
1535 |
if ( mControls[i]->controlIndex() == ERealLogoBitmap )
|
|
1536 |
{
|
|
1537 |
exist = true;
|
|
1538 |
break;
|
|
1539 |
}
|
|
1540 |
}
|
|
1541 |
|
|
1542 |
MPX_DEBUG(_L("VideoPlaybackControlsController::isRNLogoBitmapInControlList() [%d]"), exist);
|
|
1543 |
|
|
1544 |
return exist;
|
|
1545 |
}
|
|
1546 |
|
|
1547 |
// -------------------------------------------------------------------------------------------------
|
|
1548 |
// VideoPlaybackControlsController::handleOrientationChanged()
|
|
1549 |
// -------------------------------------------------------------------------------------------------
|
|
1550 |
//
|
|
1551 |
void VideoPlaybackControlsController::handleOrientationChanged( Qt::Orientation orientation )
|
|
1552 |
{
|
|
1553 |
MPX_ENTER_EXIT(_L("VideoPlaybackControlsController::handleOrientationChanged()"),
|
|
1554 |
_L("old orientation %d, new orientation = %d"), mOrientation, orientation );
|
|
1555 |
|
|
1556 |
Qt::Orientation oldOrientaiton = mOrientation;
|
|
1557 |
mOrientation = orientation;
|
|
1558 |
|
|
1559 |
if ( oldOrientaiton == Qt::Vertical && orientation == Qt::Horizontal )
|
|
1560 |
{
|
|
1561 |
showControls();
|
|
1562 |
}
|
|
1563 |
}
|
|
1564 |
|
|
1565 |
// -------------------------------------------------------------------------------------------------
|
|
1566 |
// VideoPlaybackControlsController::shouldShowRNLogo()
|
|
1567 |
// -------------------------------------------------------------------------------------------------
|
|
1568 |
//
|
|
1569 |
bool VideoPlaybackControlsController::shouldShowRNLogo()
|
|
1570 |
{
|
|
1571 |
MPX_ENTER_EXIT(_L("VideoPlaybackControlsController::shouldShowRNLogo()"));
|
|
1572 |
|
|
1573 |
bool showRNLogo = false;
|
49
|
1574 |
|
|
1575 |
if ( mFileDetails->mRNFormat &&
|
44
|
1576 |
!mViewWrapper->IsResumingPlaybackAfterTermination() )
|
|
1577 |
{
|
|
1578 |
showRNLogo = true;
|
|
1579 |
}
|
49
|
1580 |
|
44
|
1581 |
return showRNLogo;
|
|
1582 |
}
|
|
1583 |
|
|
1584 |
// End of File
|