26 #include <f32file.h> |
26 #include <f32file.h> |
27 |
27 |
28 #include <QTimer> |
28 #include <QTimer> |
29 #include <QFileInfo> |
29 #include <QFileInfo> |
30 #include <thumbnailmanager_qt.h> |
30 #include <thumbnailmanager_qt.h> |
|
31 #include <xqserviceutil.h> |
31 |
32 |
32 #include <hblabel.h> |
33 #include <hblabel.h> |
33 #include <hbaction.h> |
|
34 #include <hbiconitem.h> |
34 #include <hbiconitem.h> |
35 #include <hbratingslider.h> |
35 #include <hbratingslider.h> |
36 #include <hbiconanimator.h> |
36 #include <hbiconanimator.h> |
|
37 #include <hbvolumesliderpopup.h> |
37 #include <hbtransparentwindow.h> |
38 #include <hbtransparentwindow.h> |
38 #include <hbiconanimationmanager.h> |
39 #include <hbiconanimationmanager.h> |
39 |
40 |
40 #include "mpxvideoviewwrapper.h" |
41 #include "mpxvideoviewwrapper.h" |
41 #include "hbvideobaseplaybackview.h" |
42 #include "hbvideobaseplaybackview.h" |
43 #include "mpxvideoplaybackcontrolpolicy.h" |
44 #include "mpxvideoplaybackcontrolpolicy.h" |
44 #include "mpxvideoplaybackdocumentloader.h" |
45 #include "mpxvideoplaybackdocumentloader.h" |
45 #include "mpxvideoplaybackviewfiledetails.h" |
46 #include "mpxvideoplaybackviewfiledetails.h" |
46 #include "mpxvideoplaybackstatuspanecontrol.h" |
47 #include "mpxvideoplaybackstatuspanecontrol.h" |
47 #include "mpxvideoplaybackfiledetailswidget.h" |
48 #include "mpxvideoplaybackfiledetailswidget.h" |
48 #include "mpxvideoplaybacknontouchvolumebar.h" |
|
49 #include "mpxvideoplaybackfullscreencontrol.h" |
49 #include "mpxvideoplaybackfullscreencontrol.h" |
50 #include "mpxvideoplaybackcontrolscontroller.h" |
50 #include "mpxvideoplaybackcontrolscontroller.h" |
51 #include "mpxvideoplaybackcontrolconfiguration.h" |
51 #include "mpxvideoplaybackcontrolconfiguration.h" |
52 #include "mpxvideoplaybackdetailsplaybackwindow.h" |
52 #include "mpxvideoplaybackdetailsplaybackwindow.h" |
|
53 #include "videoservices.h" |
53 |
54 |
54 |
55 |
55 // ================= MEMBER FUNCTIONS ============================================================== |
56 // ================= MEMBER FUNCTIONS ============================================================== |
56 |
57 |
57 // ------------------------------------------------------------------------------------------------- |
58 // ------------------------------------------------------------------------------------------------- |
69 , mControlsConfig( NULL ) |
70 , mControlsConfig( NULL ) |
70 , mControlsTimer( NULL ) |
71 , mControlsTimer( NULL ) |
71 , mLoader( NULL ) |
72 , mLoader( NULL ) |
72 , mVolumeControl( NULL ) |
73 , mVolumeControl( NULL ) |
73 , mThumbnailManager( NULL ) |
74 , mThumbnailManager( NULL ) |
|
75 , mVideoServices( 0 ) |
74 , mViewTransitionIsGoingOn( false ) |
76 , mViewTransitionIsGoingOn( false ) |
|
77 , mIsAttachOperation( false ) |
75 , mThumbNailState( EThumbNailEmpty ) |
78 , mThumbNailState( EThumbNailEmpty ) |
76 , mState( EPbStateNotInitialised ) |
79 , mState( EPbStateNotInitialised ) |
77 , mViewMode( EFullScreenView ) |
80 , mViewMode( EFullScreenView ) |
78 { |
81 { |
79 MPX_ENTER_EXIT(_L("QMPXVideoPlaybackControlsController::QMPXVideoPlaybackControlsController()")); |
82 MPX_ENTER_EXIT(_L("QMPXVideoPlaybackControlsController::QMPXVideoPlaybackControlsController()")); |
100 |
103 |
101 if ( ok ) |
104 if ( ok ) |
102 { |
105 { |
103 QGraphicsWidget *widget = mLoader->findWidget( QString( "content" ) ); |
106 QGraphicsWidget *widget = mLoader->findWidget( QString( "content" ) ); |
104 mView->setWidget( widget ); |
107 mView->setWidget( widget ); |
105 |
|
106 widget = mLoader->findWidget( QString( "volumeSlider" ) ); |
|
107 mVolumeControl = qobject_cast<QMPXVideoPlaybackNonTouchVolumeBar*>( widget ); |
|
108 } |
108 } |
109 else |
109 else |
110 { |
110 { |
111 MPX_ENTER_EXIT(_L("QMPXVideoPlaybackControlsController::initializeController()- can't find xml")); |
111 MPX_DEBUG( |
|
112 _L("QMPXVideoPlaybackControlsController::initializeController()- can't find xml")); |
112 |
113 |
113 // |
114 // |
114 // Can't find xml for layout. Delete mLoader |
115 // Can't find xml for layout. Delete mLoader |
115 // |
116 // |
116 delete mLoader; |
117 delete mLoader; |
117 mLoader = NULL; |
118 mLoader = NULL; |
118 } |
119 } |
119 |
120 |
120 mControlsPolicy = new QMPXVideoPlaybackControlPolicy(); |
|
121 mControlsConfig = new QMPXVideoPlaybackControlConfiguration( this ); |
|
122 |
|
123 connect( mControlsConfig, SIGNAL( controlListUpdated() ), this, SLOT( controlsListUpdated() ) ); |
|
124 |
|
125 mControlsTimer = new QTimer( this ); |
121 mControlsTimer = new QTimer( this ); |
126 mControlsTimer->setInterval( KMPXControlsTimeOut ); |
122 mControlsTimer->setInterval( KMPXControlsTimeOut ); |
127 mControlsTimer->setSingleShot( false ); |
123 mControlsTimer->setSingleShot( false ); |
128 connect( mControlsTimer, SIGNAL( timeout() ), this, SLOT( hideAllControls() ) ); |
124 connect( mControlsTimer, SIGNAL( timeout() ), this, SLOT( hideAllControls() ) ); |
129 |
125 |
130 connect( mView, SIGNAL( tappedOnScreen() ), this, SLOT( handleTappedOnScreen() ) ); |
126 connect( mView, SIGNAL( tappedOnScreen() ), this, SLOT( handleTappedOnScreen() ) ); |
|
127 |
|
128 mControlsPolicy = new QMPXVideoPlaybackControlPolicy(); |
|
129 |
|
130 mControlsConfig = new QMPXVideoPlaybackControlConfiguration( this ); |
|
131 connect( mControlsConfig, SIGNAL( controlListUpdated() ), this, SLOT( controlsListUpdated() ) ); |
|
132 mControlsConfig->createControlList(); |
|
133 |
|
134 mVolumeControl = new HbVolumeSliderPopup(); |
|
135 mVolumeControl->setVisible( false ); |
|
136 mVolumeControl->setTimeout( KMPXControlsTimeOut ); |
|
137 mVolumeControl->setTickPosition( Hb::NoSliderTicks ); |
|
138 mVolumeControl->setRange( KPbPlaybackVolumeLevelMin, KPbPlaybackVolumeLevelMax ); |
|
139 |
|
140 // |
|
141 // if videoplayback is in service mode, create a videoservices instance |
|
142 // |
|
143 if ( XQServiceUtil::isService() && ! mVideoServices ) |
|
144 { |
|
145 // |
|
146 // obtain VideoServices instance |
|
147 // |
|
148 mVideoServices = VideoServices::instance(); |
|
149 |
|
150 // |
|
151 // allow 'attach' operation only for non-streaming media clips |
|
152 // |
|
153 if ( mVideoServices && mFileDetails->mPlaybackMode == EMPXVideoLocal ) |
|
154 { |
|
155 // |
|
156 // determine if this is 'attach' operation |
|
157 // |
|
158 mIsAttachOperation = ( mVideoServices->currentService() == VideoServices::EUriFetcher ); |
|
159 |
|
160 if ( mIsAttachOperation ) |
|
161 { |
|
162 // |
|
163 // connect signal filePath() to videoservices slot itemSelected() |
|
164 // |
|
165 connect( this, SIGNAL( attachVideoPath( const QString& ) ), |
|
166 mVideoServices, SLOT( itemSelected( const QString& ) ) ); |
|
167 } |
|
168 } |
|
169 } |
|
170 |
131 } |
171 } |
132 |
172 |
133 // ------------------------------------------------------------------------------------------------- |
173 // ------------------------------------------------------------------------------------------------- |
134 // QMPXVideoPlaybackControlsController::~QMPXVideoPlaybackControlsController |
174 // QMPXVideoPlaybackControlsController::~QMPXVideoPlaybackControlsController |
135 // ------------------------------------------------------------------------------------------------- |
175 // ------------------------------------------------------------------------------------------------- |
136 // |
176 // |
137 QMPXVideoPlaybackControlsController::~QMPXVideoPlaybackControlsController() |
177 QMPXVideoPlaybackControlsController::~QMPXVideoPlaybackControlsController() |
138 { |
178 { |
139 MPX_DEBUG(_L("QMPXVideoPlaybackControlsController::~QMPXVideoPlaybackControlsController")); |
179 MPX_ENTER_EXIT(_L("QMPXVideoPlaybackControlsController::~QMPXVideoPlaybackControlsController()")); |
140 |
180 |
141 disconnect( mControlsConfig, SIGNAL( controlListUpdated() ), this, SLOT( controlsListUpdated() ) ); |
181 disconnect( mControlsConfig, SIGNAL( controlListUpdated() ), this, SLOT( controlsListUpdated() ) ); |
142 |
182 |
143 disconnect( mView, SIGNAL( tappedOnScreen() ), this, SLOT( handleTappedOnScreen() ) ); |
183 disconnect( mView, SIGNAL( tappedOnScreen() ), this, SLOT( handleTappedOnScreen() ) ); |
144 disconnect( mControlsTimer, SIGNAL( timeout() ), this, SLOT( hideAllControls() ) ); |
184 disconnect( mControlsTimer, SIGNAL( timeout() ), this, SLOT( hideAllControls() ) ); |
172 } |
212 } |
173 |
213 |
174 if ( mThumbnailManager ) |
214 if ( mThumbnailManager ) |
175 { |
215 { |
176 delete mThumbnailManager; |
216 delete mThumbnailManager; |
177 mThumbnailManager = 0; |
217 mThumbnailManager = NULL; |
178 } |
218 } |
|
219 |
|
220 if ( mVolumeControl ) |
|
221 { |
|
222 delete mVolumeControl; |
|
223 mVolumeControl = NULL; |
|
224 } |
|
225 |
|
226 if ( mIsAttachOperation ) |
|
227 { |
|
228 // |
|
229 // disable connection for 'attach' operation |
|
230 // |
|
231 disconnect( this, SIGNAL( attachVideoPath( const QString& ) ), |
|
232 mVideoServices, SLOT( itemSelected( const QString& ) ) ); |
|
233 } |
|
234 |
|
235 if ( mVideoServices ) |
|
236 { |
|
237 // |
|
238 // decrease videoservices instance count |
|
239 // |
|
240 mVideoServices->decreaseReferenceCount(); |
|
241 mVideoServices = 0; |
|
242 } |
|
243 |
179 } |
244 } |
180 |
245 |
181 // ------------------------------------------------------------------------------------------------- |
246 // ------------------------------------------------------------------------------------------------- |
182 // QMPXVideoPlaybackControlsController::addFileDetails() |
247 // QMPXVideoPlaybackControlsController::addFileDetails() |
183 // ------------------------------------------------------------------------------------------------- |
248 // ------------------------------------------------------------------------------------------------- |
184 // |
249 // |
185 void QMPXVideoPlaybackControlsController::addFileDetails( |
250 void QMPXVideoPlaybackControlsController::addFileDetails( |
186 QMPXVideoPlaybackViewFileDetails* details ) |
251 QMPXVideoPlaybackViewFileDetails* details ) |
187 { |
252 { |
188 MPX_ENTER_EXIT(_L("QMPXVideoPlaybackControlsController::addFileDetails")); |
253 MPX_ENTER_EXIT(_L("QMPXVideoPlaybackControlsController::addFileDetails")); |
189 |
|
190 // |
|
191 // If it is not local, hide the star rating |
|
192 // |
|
193 if ( details->mPlaybackMode != EMPXVideoLocal ) |
|
194 { |
|
195 QString sectionName = "nonLocalPlayback"; |
|
196 |
|
197 bool ok = false; |
|
198 mLoader->load( KMPXPLAYBACKVIEW_XML, sectionName, &ok ); |
|
199 } |
|
200 |
254 |
201 mFileDetails = details; |
255 mFileDetails = details; |
202 |
256 |
203 mFileDetails->mRNFormat = realFormat( mFileDetails->mClipName ); |
257 mFileDetails->mRNFormat = realFormat( mFileDetails->mClipName ); |
204 |
258 |
1157 // QMPXVideoPlaybackControlsController::updateVideoRect() |
1203 // QMPXVideoPlaybackControlsController::updateVideoRect() |
1158 // ------------------------------------------------------------------------------------------------- |
1204 // ------------------------------------------------------------------------------------------------- |
1159 // |
1205 // |
1160 void QMPXVideoPlaybackControlsController::updateVideoRect( bool transitionEffect ) |
1206 void QMPXVideoPlaybackControlsController::updateVideoRect( bool transitionEffect ) |
1161 { |
1207 { |
1162 MPX_DEBUG(_L("QMPXVideoPlaybackControlsController::updateVideoRect()")); |
1208 MPX_DEBUG(_L("QMPXVideoPlaybackControlsController::updateVideoRect( %d )"), |
|
1209 transitionEffect ); |
1163 |
1210 |
1164 if ( mFileDetails->mVideoEnabled && ! mFileDetails->mTvOutConnected ) |
1211 if ( mFileDetails->mVideoEnabled && ! mFileDetails->mTvOutConnected ) |
1165 { |
1212 { |
1166 mViewTransitionIsGoingOn = true; |
1213 mViewTransitionIsGoingOn = true; |
1167 |
1214 |
1168 QRectF rect; |
1215 QRectF rect; |
1169 |
1216 |
|
1217 MPX_DEBUG(_L("QMPXVideoPlaybackControlsController::updateVideoRect() : mViewMode = %d )"), |
|
1218 mViewMode ); |
|
1219 |
1170 if ( mViewMode == EDetailsView ) |
1220 if ( mViewMode == EDetailsView ) |
1171 { |
1221 { |
1172 QGraphicsWidget *parent = mLoader->findWidget( QString( "detailsPlaybackWindow" ) ); |
1222 QGraphicsWidget *parent = mLoader->findWidget( QString( "detailsPlaybackWindow" ) ); |
1173 QGraphicsWidget *child = mLoader->findWidget( QString( "small_transparentWindow" ) ); |
1223 QGraphicsWidget *child = mLoader->findWidget( QString( "small_transparentWindow" ) ); |
1174 |
1224 |
1306 |
1346 |
1307 disconnect( mThumbnailManager, SIGNAL( thumbnailReady( QPixmap , void * , int , int ) ), |
1347 disconnect( mThumbnailManager, SIGNAL( thumbnailReady( QPixmap , void * , int , int ) ), |
1308 this, SLOT( handleThumbnailReady( QPixmap , void * , int , int ) ) ); |
1348 this, SLOT( handleThumbnailReady( QPixmap , void * , int , int ) ) ); |
1309 } |
1349 } |
1310 |
1350 |
|
1351 // ------------------------------------------------------------------------------------------------- |
|
1352 // QMPXVideoPlaybackControlsController::isAttachOperation |
|
1353 // ------------------------------------------------------------------------------------------------- |
|
1354 // |
|
1355 bool QMPXVideoPlaybackControlsController::isAttachOperation() |
|
1356 { |
|
1357 MPX_DEBUG(_L("QMPXVideoPlaybackControlsController::isAttachOperation() ret %d"), |
|
1358 mIsAttachOperation ); |
|
1359 |
|
1360 return mIsAttachOperation; |
|
1361 } |
|
1362 |
|
1363 // ------------------------------------------------------------------------------------------------- |
|
1364 // QMPXVideoPlaybackControlsController::attachVideo() |
|
1365 // ------------------------------------------------------------------------------------------------- |
|
1366 // |
|
1367 void QMPXVideoPlaybackControlsController::attachVideo() |
|
1368 { |
|
1369 MPX_ENTER_EXIT(_L("QMPXVideoPlaybackControlsController::attachVideo()")); |
|
1370 |
|
1371 // |
|
1372 // close and release resources |
|
1373 // |
|
1374 handleCommand( EMPXPbvCmdClose ); |
|
1375 |
|
1376 // |
|
1377 // emit signal to launch videoservices itemSelected() slot |
|
1378 // |
|
1379 emit( attachVideoPath( mFileDetails->mClipName ) ); |
|
1380 |
|
1381 } |
|
1382 |
1311 // End of File |
1383 // End of File |