13 * |
13 * |
14 * Description: Implementation of MPXVideoPlaybackControlsController |
14 * Description: Implementation of MPXVideoPlaybackControlsController |
15 * |
15 * |
16 */ |
16 */ |
17 |
17 |
18 // Version : %version: da1mmcf#25 % |
18 // Version : %version: da1mmcf#27 % |
19 |
19 |
20 |
20 |
21 |
21 |
22 // INCLUDE FILES |
22 // INCLUDE FILES |
23 #include <coecntrl.h> |
23 #include <coecntrl.h> |
24 #include <bautils.h> |
24 #include <bautils.h> |
25 #include <barsread.h> |
25 #include <barsread.h> |
26 #include <stringloader.h> |
26 #include <StringLoader.h> |
27 #include <f32file.h> |
27 #include <f32file.h> |
28 |
28 |
29 #include <qtimer> |
29 #include <QTimer> |
30 #include <qfileinfo> |
30 #include <QFileInfo> |
31 #include <thumbnailmanager_qt.h> |
31 #include <thumbnailmanager_qt.h> |
32 |
32 |
33 #include <hblabel.h> |
33 #include <hblabel.h> |
34 #include <hbaction.h> |
34 #include <hbaction.h> |
35 #include <hbiconitem.h> |
35 #include <hbiconitem.h> |
90 { |
90 { |
91 MPX_ENTER_EXIT(_L("QMPXVideoPlaybackControlsController::initializeController()")); |
91 MPX_ENTER_EXIT(_L("QMPXVideoPlaybackControlsController::initializeController()")); |
92 |
92 |
93 setParent( mView ); |
93 setParent( mView ); |
94 |
94 |
|
95 // |
|
96 // Create layout loader |
|
97 // |
|
98 bool ok = false; |
|
99 mLoader = new QMPXVideoPlaybackDocumentLoader( this ); |
|
100 mLoader->load( KMPXPLAYBACKVIEW_XML, &ok ); |
|
101 |
|
102 if ( ok ) |
|
103 { |
|
104 QGraphicsWidget *widget = mLoader->findWidget( QString( "content" ) ); |
|
105 mView->setWidget( widget ); |
|
106 |
|
107 widget = mLoader->findWidget( QString( "volumeSlider" ) ); |
|
108 mVolumeControl = qobject_cast<QMPXVideoPlaybackNonTouchVolumeBar*>( widget ); |
|
109 } |
|
110 else |
|
111 { |
|
112 MPX_ENTER_EXIT(_L("QMPXVideoPlaybackControlsController::initializeController()- can't find xml")); |
|
113 |
|
114 // |
|
115 // Can't find xml for layout. Delete mLoader |
|
116 // |
|
117 delete mLoader; |
|
118 mLoader = NULL; |
|
119 } |
|
120 |
95 mControlsPolicy = new QMPXVideoPlaybackControlPolicy(); |
121 mControlsPolicy = new QMPXVideoPlaybackControlPolicy(); |
96 mControlsConfig = new QMPXVideoPlaybackControlConfiguration( this ); |
122 mControlsConfig = new QMPXVideoPlaybackControlConfiguration( this ); |
97 |
123 |
98 connect( mControlsConfig, SIGNAL( controlListUpdated() ), this, SLOT( controlsListUpdated() ) ); |
124 connect( mControlsConfig, SIGNAL( controlListUpdated() ), this, SLOT( controlsListUpdated() ) ); |
99 |
125 |
101 mControlsTimer->setInterval( KMPXControlsTimeOut ); |
127 mControlsTimer->setInterval( KMPXControlsTimeOut ); |
102 mControlsTimer->setSingleShot( false ); |
128 mControlsTimer->setSingleShot( false ); |
103 connect( mControlsTimer, SIGNAL( timeout() ), this, SLOT( hideAllControls() ) ); |
129 connect( mControlsTimer, SIGNAL( timeout() ), this, SLOT( hideAllControls() ) ); |
104 |
130 |
105 connect( mView, SIGNAL( tappedOnScreen() ), this, SLOT( handleTappedOnScreen() ) ); |
131 connect( mView, SIGNAL( tappedOnScreen() ), this, SLOT( handleTappedOnScreen() ) ); |
106 |
|
107 // |
|
108 // Create layout loader |
|
109 // |
|
110 bool ok = false; |
|
111 mLoader = new QMPXVideoPlaybackDocumentLoader( this ); |
|
112 mLoader->load( KMPXPLAYBACKVIEW_XML, &ok ); |
|
113 |
|
114 if ( ok ) |
|
115 { |
|
116 QGraphicsWidget *widget = mLoader->findWidget( QString( "content" ) ); |
|
117 mView->setWidget( widget ); |
|
118 |
|
119 // |
|
120 // Update controls list based on configuration + volume |
|
121 // |
|
122 controlsListUpdated(); |
|
123 |
|
124 widget = mLoader->findWidget( QString( "volumeSlider" ) ); |
|
125 mVolumeControl = qobject_cast<QMPXVideoPlaybackNonTouchVolumeBar*>( widget ); |
|
126 } |
|
127 else |
|
128 { |
|
129 MPX_ENTER_EXIT(_L("QMPXVideoPlaybackControlsController::initializeController()- can't find xml")); |
|
130 |
|
131 // |
|
132 // Can't find xml for layout. Delete mLoader |
|
133 // |
|
134 delete mLoader; |
|
135 mLoader = NULL; |
|
136 } |
|
137 } |
132 } |
138 |
133 |
139 // ------------------------------------------------------------------------------------------------- |
134 // ------------------------------------------------------------------------------------------------- |
140 // QMPXVideoPlaybackControlsController::~QMPXVideoPlaybackControlsController |
135 // QMPXVideoPlaybackControlsController::~QMPXVideoPlaybackControlsController |
141 // ------------------------------------------------------------------------------------------------- |
136 // ------------------------------------------------------------------------------------------------- |