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 VideoPlaybackFullScreenControl
|
|
15 |
*
|
|
16 |
*/
|
|
17 |
|
|
18 |
// Version : %version: da1mmcf#10 %
|
|
19 |
|
|
20 |
|
|
21 |
|
|
22 |
#include <w32std.h>
|
|
23 |
|
|
24 |
#include "mpxvideo_debug.h"
|
|
25 |
#include "videoplaybackcontrolbar.h"
|
|
26 |
#include "videoplaybackfullscreencontrol.h"
|
|
27 |
#include "videoplaybackfiledetailswidget.h"
|
|
28 |
#include "videoplaybackcontrolscontroller.h"
|
|
29 |
#include "videoplaybackdetailsplaybackwindow.h"
|
|
30 |
|
|
31 |
|
|
32 |
// -------------------------------------------------------------------------------------------------
|
|
33 |
// VideoPlaybackFullScreenControl::VideoPlaybackFullScreenControl()
|
|
34 |
// -------------------------------------------------------------------------------------------------
|
|
35 |
//
|
|
36 |
VideoPlaybackFullScreenControl::VideoPlaybackFullScreenControl(
|
|
37 |
VideoPlaybackControlsController* controller,
|
|
38 |
TVideoPlaybackControls index,
|
|
39 |
HbWidget* widget,
|
|
40 |
TUint controlproperties )
|
|
41 |
: mController( controller )
|
|
42 |
, mControl( widget )
|
|
43 |
, mControlIndex( index )
|
|
44 |
, mProperties( controlproperties )
|
|
45 |
{
|
|
46 |
MPX_ENTER_EXIT(_L("VideoPlaybackFullScreenControl::VideoPlaybackFullScreenControl()"));
|
|
47 |
|
|
48 |
setParent( mController );
|
|
49 |
}
|
|
50 |
|
|
51 |
// -------------------------------------------------------------------------------------------------
|
|
52 |
// VideoPlaybackFullScreenControl::~VideoPlaybackFullScreenControl()
|
|
53 |
// -------------------------------------------------------------------------------------------------
|
|
54 |
//
|
|
55 |
VideoPlaybackFullScreenControl::~VideoPlaybackFullScreenControl()
|
|
56 |
{
|
|
57 |
MPX_DEBUG(_L("VideoPlaybackControlsController::~VideoPlaybackFullScreenControl"));
|
|
58 |
}
|
|
59 |
|
|
60 |
// -------------------------------------------------------------------------------------------------
|
|
61 |
// VideoPlaybackFullScreenControl::setVisible()
|
|
62 |
// -------------------------------------------------------------------------------------------------
|
|
63 |
//
|
|
64 |
void VideoPlaybackFullScreenControl::setVisible( bool visible )
|
|
65 |
{
|
|
66 |
switch ( mControlIndex )
|
|
67 |
{
|
|
68 |
case EControlBar:
|
|
69 |
{
|
|
70 |
static_cast<VideoPlaybackControlBar*>(mControl)->setVisibleToControlBar( visible );
|
|
71 |
break;
|
|
72 |
}
|
|
73 |
default:
|
|
74 |
{
|
|
75 |
mControl->setVisible( visible );
|
|
76 |
break;
|
|
77 |
}
|
|
78 |
}
|
|
79 |
}
|
|
80 |
|
|
81 |
// -------------------------------------------------------------------------------------------------
|
|
82 |
// VideoPlaybackFullScreenControl::isVisible()
|
|
83 |
// -------------------------------------------------------------------------------------------------
|
|
84 |
//
|
|
85 |
bool VideoPlaybackFullScreenControl::isVisible()
|
|
86 |
{
|
|
87 |
return mControl->isVisible();
|
|
88 |
}
|
|
89 |
|
|
90 |
// -------------------------------------------------------------------------------------------------
|
|
91 |
// VideoPlaybackFullScreenControl::setVisibility()
|
|
92 |
// -------------------------------------------------------------------------------------------------
|
|
93 |
//
|
|
94 |
void VideoPlaybackFullScreenControl::setVisibility( TMPXPlaybackState state )
|
|
95 |
{
|
|
96 |
MPX_DEBUG(_L("VideoPlaybackFullScreenControl::setVisibility()"));
|
|
97 |
|
|
98 |
bool visible = false;
|
|
99 |
|
|
100 |
switch( state )
|
|
101 |
{
|
|
102 |
case EPbStatePlaying:
|
|
103 |
{
|
|
104 |
if ( mProperties & EShownWhenPlaying )
|
|
105 |
{
|
|
106 |
visible = true;
|
|
107 |
}
|
|
108 |
break;
|
|
109 |
}
|
|
110 |
case EPbStatePaused:
|
|
111 |
{
|
|
112 |
if ( mProperties & EShownWhenPaused )
|
|
113 |
{
|
|
114 |
visible = true;
|
|
115 |
}
|
|
116 |
break;
|
|
117 |
}
|
|
118 |
case EPbStatePluginSeeking:
|
|
119 |
{
|
|
120 |
if ( mProperties & EShownWhenSeeking )
|
|
121 |
{
|
|
122 |
visible = true;
|
|
123 |
}
|
|
124 |
break;
|
|
125 |
}
|
|
126 |
case EPbStateBuffering:
|
|
127 |
{
|
|
128 |
if ( mProperties & EShownWhenBuffering )
|
|
129 |
{
|
|
130 |
visible = true;
|
|
131 |
}
|
|
132 |
break;
|
|
133 |
}
|
|
134 |
case EPbStateNotInitialised:
|
|
135 |
case EPbStateInitialising:
|
|
136 |
{
|
|
137 |
if ( mProperties & EShownWhenInitializing )
|
|
138 |
{
|
|
139 |
visible = true;
|
|
140 |
}
|
|
141 |
break;
|
|
142 |
}
|
|
143 |
}
|
|
144 |
|
|
145 |
setVisible( visible );
|
|
146 |
}
|
|
147 |
|
|
148 |
// -------------------------------------------------------------------------------------------------
|
|
149 |
// VideoPlaybackFullScreenControl::controlIndex()
|
|
150 |
// -------------------------------------------------------------------------------------------------
|
|
151 |
//
|
|
152 |
TVideoPlaybackControls VideoPlaybackFullScreenControl::controlIndex()
|
|
153 |
{
|
|
154 |
return mControlIndex;
|
|
155 |
}
|
|
156 |
|
|
157 |
// -------------------------------------------------------------------------------------------------
|
|
158 |
// VideoPlaybackFullScreenControl::durationChanged()
|
|
159 |
// -------------------------------------------------------------------------------------------------
|
|
160 |
//
|
|
161 |
bool VideoPlaybackFullScreenControl::durationChanged( int duration )
|
|
162 |
{
|
|
163 |
bool changed = EFalse;
|
|
164 |
|
|
165 |
if ( mControlIndex == EControlBar )
|
|
166 |
{
|
|
167 |
MPX_DEBUG(_L("VideoPlaybackFullScreenControl::DurationChanged() [%d]"), duration);
|
|
168 |
|
|
169 |
static_cast<VideoPlaybackControlBar*>(mControl)->durationChanged( duration );
|
|
170 |
|
|
171 |
changed = ETrue;
|
|
172 |
}
|
|
173 |
|
|
174 |
return changed;
|
|
175 |
}
|
|
176 |
|
|
177 |
// -------------------------------------------------------------------------------------------------
|
|
178 |
// VideoPlaybackFullScreenControl::positionChanged()
|
|
179 |
// -------------------------------------------------------------------------------------------------
|
|
180 |
//
|
|
181 |
bool VideoPlaybackFullScreenControl::positionChanged( int position )
|
|
182 |
{
|
|
183 |
bool changed = EFalse;
|
|
184 |
|
|
185 |
if ( mControlIndex == EControlBar )
|
|
186 |
{
|
|
187 |
MPX_DEBUG(_L("VideoPlaybackFullScreenControl::positionChanged() [%d]"), position);
|
|
188 |
|
|
189 |
static_cast<VideoPlaybackControlBar*>(mControl)->positionChanged( position );
|
|
190 |
|
|
191 |
changed = ETrue;
|
|
192 |
}
|
|
193 |
|
|
194 |
return changed;
|
|
195 |
}
|
|
196 |
|
|
197 |
// -------------------------------------------------------------------------------------------------
|
|
198 |
// VideoPlaybackFullScreenControl::aspectRatioChanged()
|
|
199 |
// -------------------------------------------------------------------------------------------------
|
|
200 |
//
|
|
201 |
bool VideoPlaybackFullScreenControl::aspectRatioChanged( int aspectRatio )
|
|
202 |
{
|
|
203 |
bool changed = EFalse;
|
|
204 |
|
|
205 |
if ( mControlIndex == EControlBar )
|
|
206 |
{
|
|
207 |
MPX_DEBUG(
|
|
208 |
_L("VideoPlaybackFullScreenControl::aspectRatioChanged() [%d]"), aspectRatio);
|
|
209 |
|
|
210 |
static_cast<VideoPlaybackControlBar*>(mControl)->aspectRatioChanged( aspectRatio );
|
|
211 |
|
|
212 |
changed = ETrue;
|
|
213 |
}
|
|
214 |
|
|
215 |
return changed;
|
|
216 |
}
|
|
217 |
|
|
218 |
// -------------------------------------------------------------------------------------------------
|
|
219 |
// VideoPlaybackFullScreenControl::setDownloadSize()
|
|
220 |
// -------------------------------------------------------------------------------------------------
|
|
221 |
//
|
|
222 |
bool VideoPlaybackFullScreenControl::setDownloadSize( int /*size*/ )
|
|
223 |
{
|
|
224 |
bool changed = EFalse;
|
|
225 |
|
|
226 |
/*
|
|
227 |
if ( mControlIndex == EMPXProgressBar )
|
|
228 |
{
|
|
229 |
MPX_DEBUG(_L("VideoPlaybackFullScreenControl::SetDownloadSize() [%d]"), size);
|
|
230 |
|
|
231 |
//static_cast<VideoPlaybackProgressBar*>(mControl)->SetDownloadSize( size );
|
|
232 |
|
|
233 |
changed = ETrue;
|
|
234 |
}
|
|
235 |
*/
|
|
236 |
return changed;
|
|
237 |
}
|
|
238 |
|
|
239 |
// -------------------------------------------------------------------------------------------------
|
|
240 |
// VideoPlaybackFullScreenControl::updateDownloadPosition()
|
|
241 |
// -------------------------------------------------------------------------------------------------
|
|
242 |
//
|
|
243 |
bool VideoPlaybackFullScreenControl::updateDownloadPosition( int /*size*/ )
|
|
244 |
{
|
|
245 |
bool changed = EFalse;
|
|
246 |
|
|
247 |
/*
|
|
248 |
if ( mControlIndex == EMPXProgressBar )
|
|
249 |
{
|
|
250 |
MPX_DEBUG(_L("VideoPlaybackFullScreenControl::UpdateDownloadPosition() [%d]"), size);
|
|
251 |
|
|
252 |
//static_cast<VideoPlaybackProgressBar*>(mControl)->updateDownloadPosition( size );
|
|
253 |
|
|
254 |
changed = ETrue;
|
|
255 |
}*/
|
|
256 |
|
|
257 |
return changed;
|
|
258 |
}
|
|
259 |
|
|
260 |
// -------------------------------------------------------------------------------------------------
|
|
261 |
// VideoPlaybackFullScreenControl::updateState()
|
|
262 |
// -------------------------------------------------------------------------------------------------
|
|
263 |
//
|
|
264 |
void VideoPlaybackFullScreenControl::updateState( TMPXPlaybackState state )
|
|
265 |
{
|
|
266 |
switch ( mControlIndex )
|
|
267 |
{
|
|
268 |
case EControlBar:
|
|
269 |
{
|
|
270 |
static_cast<VideoPlaybackControlBar*>(mControl)->updateState( state );
|
|
271 |
break;
|
|
272 |
}
|
|
273 |
case EDetailsViewPlaybackWindow:
|
|
274 |
{
|
|
275 |
static_cast<VideoPlaybackDetailsPlaybackWindow*>(mControl)->updateState( state );
|
|
276 |
break;
|
|
277 |
}
|
|
278 |
}
|
|
279 |
}
|
|
280 |
|
|
281 |
// -------------------------------------------------------------------------------------------------
|
|
282 |
// VideoPlaybackFullScreenControl::updateControlsWithFileDetails()
|
|
283 |
// -------------------------------------------------------------------------------------------------
|
|
284 |
//
|
|
285 |
void VideoPlaybackFullScreenControl::updateControlsWithFileDetails(
|
|
286 |
VideoPlaybackViewFileDetails* details )
|
|
287 |
{
|
|
288 |
switch ( mControlIndex )
|
|
289 |
{
|
|
290 |
case EControlBar:
|
|
291 |
{
|
|
292 |
static_cast<VideoPlaybackControlBar*>(mControl)->updateWithFileDetails( details );
|
|
293 |
break;
|
|
294 |
}
|
|
295 |
case EFileDetailsWidget:
|
|
296 |
{
|
|
297 |
static_cast<VideoPlaybackFileDetailsWidget*>(mControl)->updateWithFileDetails( details );
|
|
298 |
break;
|
|
299 |
}
|
|
300 |
}
|
|
301 |
}
|
|
302 |
|
|
303 |
// -------------------------------------------------------------------------------------------------
|
|
304 |
// VideoPlaybackFullScreenControl::updateControlProperties()
|
|
305 |
// -------------------------------------------------------------------------------------------------
|
|
306 |
//
|
|
307 |
void VideoPlaybackFullScreenControl::updateControlProperties( TUint properties )
|
|
308 |
{
|
|
309 |
mProperties = properties;
|
|
310 |
}
|
|
311 |
|
|
312 |
// End of file
|