author | Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com> |
Wed, 13 Oct 2010 14:34:36 +0300 | |
branch | RCL_3 |
changeset 70 | 375929f879c2 |
parent 57 | befca0ec475f |
permissions | -rw-r--r-- |
57 | 1 |
/* |
2 |
* Copyright (c) 2008 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: Volume bar control |
|
15 |
* |
|
16 |
*/ |
|
17 |
||
18 |
||
70
375929f879c2
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
57
diff
changeset
|
19 |
// Version : %version: 25 % |
57 | 20 |
|
21 |
||
22 |
// INCLUDE FILES |
|
23 |
#include <eikenv.h> |
|
24 |
#include <gulicon.h> |
|
25 |
#include <gulfont.h> |
|
26 |
#include <AknUtils.h> |
|
27 |
#include <AknIconUtils.h> |
|
28 |
#include <StringLoader.h> |
|
29 |
#include <AknsDrawUtils.h> |
|
30 |
#include <data_caging_path_literals.hrh> |
|
31 |
#include <aknlayoutscalable_avkon.cdl.h> |
|
32 |
#include <aknlayoutscalable_apps.cdl.h> |
|
33 |
#include <mpxvideoplaybackcontrols.mbg> |
|
34 |
||
35 |
#include "mpxcommonvideoplaybackview.hrh" |
|
36 |
#include "mpxvideoplaybackvolumebar.h" |
|
37 |
#include "mpxvideoplaybackviewfiledetails.h" |
|
38 |
#include "mpxvideoplaybackcontrolscontroller.h" |
|
39 |
#include "mpxvideo_debug.h" |
|
40 |
||
41 |
#ifdef RD_TACTILE_FEEDBACK |
|
42 |
#include <touchfeedback.h> |
|
43 |
#endif //RD_TACTILE_FEEDBACK |
|
44 |
||
45 |
// CONSTANTS |
|
46 |
const TInt KMPXSliderHeight = 30; |
|
47 |
const TInt KMPXSliderWidth = 18; |
|
48 |
const TInt KMPXVolumeDragEventTimeOut = 100000; |
|
49 |
const TInt KMPXPtrEventRepeatRequestTime = 200000; |
|
50 |
const TInt KDynamicSliderFeedbackTimeOut = 100000; |
|
51 |
const TInt KDynamicSliderFeedbackIntensity = 100; |
|
52 |
||
53 |
using namespace AknLayoutScalable_Apps; |
|
54 |
using namespace AknLayoutScalable_Avkon; |
|
55 |
||
56 |
// ============================ MEMBER FUNCTIONS =================================================== |
|
57 |
||
58 |
CMPXVideoPlaybackVolumeBar::CMPXVideoPlaybackVolumeBar( |
|
59 |
CMPXVideoPlaybackControlsController* aController, TRect aRect ) |
|
60 |
: iOneVolumeIncrementHeight(0) |
|
61 |
, iMuted(EFalse) |
|
62 |
, iRect(aRect) |
|
63 |
, iDragging(EVolumeNotDragging) |
|
64 |
, iController(aController) |
|
65 |
{ |
|
66 |
} |
|
67 |
||
68 |
// ------------------------------------------------------------------------------------------------- |
|
69 |
// CMPXVideoPlaybackVolumeBar::ConstructL() |
|
70 |
// Symbian 2nd phase constructor can leave. |
|
71 |
// ------------------------------------------------------------------------------------------------- |
|
72 |
// |
|
73 |
void CMPXVideoPlaybackVolumeBar::ConstructL() |
|
74 |
{ |
|
75 |
MPX_ENTER_EXIT(_L("CMPXVideoPlaybackVolumeBar::ConstructL()")); |
|
76 |
||
77 |
SetLayout(); |
|
78 |
SkinChangeL(); |
|
79 |
||
80 |
iDraggingHandlerTimer = CPeriodic::NewL( CActive::EPriorityStandard ); |
|
81 |
||
82 |
#ifdef RD_TACTILE_FEEDBACK |
|
83 |
iFeedback = MTouchFeedback::Instance(); |
|
84 |
#endif //RD_TACTILE_FEEDBACK |
|
85 |
} |
|
86 |
||
87 |
// ------------------------------------------------------------------------------------------------- |
|
88 |
// CMPXVideoPlaybackVolumeBar::NewL() |
|
89 |
// Two-phased constructor. |
|
90 |
// ------------------------------------------------------------------------------------------------- |
|
91 |
// |
|
92 |
CMPXVideoPlaybackVolumeBar* CMPXVideoPlaybackVolumeBar::NewL( |
|
93 |
CMPXVideoPlaybackControlsController* aController, TRect aRect ) |
|
94 |
{ |
|
95 |
CMPXVideoPlaybackVolumeBar* self = |
|
96 |
new ( ELeave ) CMPXVideoPlaybackVolumeBar( aController, aRect ); |
|
97 |
||
98 |
CleanupStack::PushL( self ); |
|
99 |
self->ConstructL(); |
|
100 |
CleanupStack::Pop(); |
|
101 |
return self; |
|
102 |
} |
|
103 |
||
104 |
// ------------------------------------------------------------------------------------------------- |
|
105 |
// CMPXVideoPlaybackVolumeBar::~CMPXVideoPlaybackVolumeBar() |
|
106 |
// Destructor. |
|
107 |
// ------------------------------------------------------------------------------------------------- |
|
108 |
// |
|
109 |
CMPXVideoPlaybackVolumeBar::~CMPXVideoPlaybackVolumeBar() |
|
110 |
{ |
|
111 |
MPX_ENTER_EXIT(_L("CMPXVideoPlaybackVolumeBar::~CMPXVideoPlaybackVolumeBar()")); |
|
112 |
||
113 |
if ( iDraggingHandlerTimer ) |
|
114 |
{ |
|
115 |
iDraggingHandlerTimer->Cancel(); |
|
116 |
delete iDraggingHandlerTimer; |
|
117 |
iDraggingHandlerTimer = NULL; |
|
118 |
} |
|
119 |
||
120 |
if (iSpeakerIcon) |
|
121 |
{ |
|
122 |
delete iSpeakerIcon; |
|
123 |
iSpeakerIcon = NULL; |
|
124 |
} |
|
125 |
||
126 |
if (iSpeakerMuteIcon) |
|
127 |
{ |
|
128 |
delete iSpeakerMuteIcon; |
|
129 |
iSpeakerMuteIcon = NULL; |
|
130 |
} |
|
131 |
||
132 |
if (iSliderIcon) |
|
133 |
{ |
|
134 |
delete iSliderIcon; |
|
135 |
iSliderIcon = NULL; |
|
136 |
} |
|
137 |
||
138 |
if (iSliderSelectedIcon) |
|
139 |
{ |
|
140 |
delete iSliderSelectedIcon; |
|
141 |
iSliderSelectedIcon = NULL; |
|
142 |
} |
|
143 |
||
144 |
if (iVolumeUpIcon) |
|
145 |
{ |
|
146 |
delete iVolumeUpIcon; |
|
147 |
iVolumeUpIcon = NULL; |
|
148 |
} |
|
149 |
||
150 |
if (iVolumeDownIcon) |
|
151 |
{ |
|
152 |
delete iVolumeDownIcon; |
|
153 |
iVolumeDownIcon = NULL; |
|
154 |
} |
|
155 |
||
156 |
if (iVolumeFrameIconTop) |
|
157 |
{ |
|
158 |
delete iVolumeFrameIconTop; |
|
159 |
iVolumeFrameIconTop = NULL; |
|
160 |
} |
|
161 |
||
162 |
if (iVolumeFrameIconMiddle) |
|
163 |
{ |
|
164 |
delete iVolumeFrameIconMiddle; |
|
165 |
iVolumeFrameIconMiddle = NULL; |
|
166 |
} |
|
167 |
||
168 |
if (iVolumeFrameIconBottom) |
|
169 |
{ |
|
170 |
delete iVolumeFrameIconBottom; |
|
171 |
iVolumeFrameIconBottom = NULL; |
|
172 |
} |
|
173 |
||
174 |
if (iNoAudioIcon) |
|
175 |
{ |
|
176 |
delete iNoAudioIcon; |
|
177 |
iNoAudioIcon = NULL; |
|
178 |
} |
|
179 |
||
180 |
#ifdef RD_TACTILE_FEEDBACK |
|
181 |
if ( iFeedback ) |
|
182 |
{ |
|
183 |
iFeedback->RemoveFeedbackForControl(this); |
|
184 |
} |
|
185 |
#endif //RD_TACTILE_FEEDBACK |
|
186 |
} |
|
187 |
||
188 |
// ------------------------------------------------------------------------------------------------- |
|
189 |
// CMPXVideoPlaybackVolumeBar::HandleResourceChange() |
|
190 |
// ------------------------------------------------------------------------------------------------- |
|
191 |
// |
|
192 |
void CMPXVideoPlaybackVolumeBar::HandleResourceChange( TInt aType ) |
|
193 |
{ |
|
194 |
MPX_ENTER_EXIT(_L("CMPXVideoPlaybackVolumeBar::HandleResourceChange()"), |
|
195 |
_L("aType = 0x%X"), aType); |
|
196 |
||
197 |
if ( aType == KAknsMessageSkinChange ) |
|
198 |
{ |
|
199 |
TRAP_IGNORE( SkinChangeL() ); |
|
200 |
} |
|
201 |
||
202 |
CCoeControl::HandleResourceChange( aType ); |
|
203 |
} |
|
204 |
||
205 |
// ------------------------------------------------------------------------------------------------- |
|
206 |
// CMPXVideoPlaybackVolumeBar::SetLayout() |
|
207 |
// ------------------------------------------------------------------------------------------------- |
|
208 |
// |
|
209 |
void CMPXVideoPlaybackVolumeBar::SetLayout() |
|
210 |
{ |
|
211 |
MPX_ENTER_EXIT(_L("CMPXVideoPlaybackVolumeBar::SetLayout()")); |
|
212 |
||
213 |
TAknLayoutRect tmpLayoutRect; |
|
214 |
||
215 |
iRect = TRect( 0, 0, iRect.Width(), iRect.Height() ); |
|
216 |
||
217 |
tmpLayoutRect.LayoutRect( iRect, bg_popup_window_pane_cp19( 9 ).LayoutLine() ); |
|
218 |
iVolumeControlRect = tmpLayoutRect.Rect(); |
|
219 |
||
220 |
||
221 |
tmpLayoutRect.LayoutRect( iRect, aid_touch_area_slider( 6 ).LayoutLine() ); |
|
222 |
iVolumeBarRect = tmpLayoutRect.Rect(); |
|
223 |
||
224 |
tmpLayoutRect.LayoutRect( iRect, slider_pane( 6 ).LayoutLine() ); |
|
225 |
TRect sliderBarRect( tmpLayoutRect.Rect() ); |
|
226 |
TInt volumeBarEndHeight = sliderBarRect.Height() / 10; |
|
227 |
iVolumeBarRectTop = TRect( sliderBarRect.iTl.iX, |
|
228 |
sliderBarRect.iTl.iY, |
|
229 |
sliderBarRect.iBr.iX, |
|
230 |
sliderBarRect.iTl.iY + volumeBarEndHeight ); |
|
231 |
||
232 |
iVolumeBarRectBottom = TRect( sliderBarRect.iTl.iX, |
|
233 |
sliderBarRect.iBr.iY - volumeBarEndHeight, |
|
234 |
sliderBarRect.iBr.iX, |
|
235 |
sliderBarRect.iBr.iY ); |
|
236 |
||
237 |
iVolumeBarRectMiddle = TRect( iVolumeBarRectTop.iTl.iX, |
|
238 |
iVolumeBarRectTop.iBr.iY, |
|
239 |
iVolumeBarRectTop.iBr.iX, |
|
240 |
iVolumeBarRectBottom.iTl.iY ); |
|
241 |
||
242 |
TInt volumeBarMiddleX = sliderBarRect.iTl.iX + sliderBarRect.Width() / 2; |
|
243 |
iSliderRect = TRect( volumeBarMiddleX - KMPXSliderWidth / 2, |
|
244 |
sliderBarRect.iBr.iY - KMPXSliderHeight, |
|
245 |
volumeBarMiddleX + KMPXSliderWidth / 2, |
|
246 |
sliderBarRect.iBr.iY ); |
|
247 |
||
248 |
tmpLayoutRect.LayoutRect( iRect, aid_touch_area_increase( 6 ).LayoutLine() ); |
|
249 |
iVolumeUpControlRect = tmpLayoutRect.Rect(); |
|
250 |
||
251 |
tmpLayoutRect.LayoutRect( iRect, aid_touch_area_decrease( 6 ).LayoutLine() ); |
|
252 |
iVolumeDownControlRect = tmpLayoutRect.Rect(); |
|
253 |
||
254 |
tmpLayoutRect.LayoutRect( iRect, popup_slider_window_g4( 6 ).LayoutLine() ); |
|
255 |
iVolumeUpRect = tmpLayoutRect.Rect(); |
|
256 |
||
257 |
tmpLayoutRect.LayoutRect( iRect, popup_slider_window_g5( 6 ).LayoutLine() ); |
|
258 |
iVolumeDownRect = tmpLayoutRect.Rect(); |
|
259 |
||
260 |
tmpLayoutRect.LayoutRect( iRect, aid_touch_area_mute( 4 ).LayoutLine() ); |
|
261 |
iSpeakerControlRect = tmpLayoutRect.Rect(); |
|
262 |
||
263 |
tmpLayoutRect.LayoutRect( iRect, popup_slider_window_g6( 2 ).LayoutLine() ); |
|
264 |
iSpeakerRect = tmpLayoutRect.Rect(); |
|
265 |
||
266 |
iOneVolumeIncrementHeight = (TReal)( iVolumeBarRect.Height() - KMPXSliderHeight ) |
|
267 |
/ (TReal)KPbPlaybackVolumeLevelMax; |
|
268 |
} |
|
269 |
||
270 |
// ------------------------------------------------------------------------------------------------- |
|
271 |
// CMPXVideoPlaybackVolumeBar::SkinChangeL() |
|
272 |
// ------------------------------------------------------------------------------------------------- |
|
273 |
// |
|
274 |
void CMPXVideoPlaybackVolumeBar::SkinChangeL() |
|
275 |
{ |
|
276 |
MPX_ENTER_EXIT(_L("CMPXVideoPlaybackVolumeBar::SkinChangeL()")); |
|
277 |
||
278 |
// |
|
279 |
// Create icons |
|
280 |
// |
|
281 |
MAknsSkinInstance* skin = AknsUtils::SkinInstance(); |
|
282 |
||
283 |
TFileName iconsPath; |
|
284 |
iController->LocateBitmapFileL( iconsPath ); |
|
285 |
||
286 |
CreateSliderIconsL(); |
|
287 |
||
288 |
delete iSpeakerIcon; |
|
289 |
iSpeakerIcon = NULL; |
|
290 |
iSpeakerIcon = AknsUtils::CreateGulIconL( |
|
291 |
skin, |
|
292 |
KAknsIIDQgnIndiNsliderUnmuted, |
|
293 |
iconsPath, |
|
294 |
EMbmMpxvideoplaybackcontrolsQgn_indi_nslider_unmuted, |
|
295 |
EMbmMpxvideoplaybackcontrolsQgn_indi_nslider_unmuted_mask ); |
|
296 |
||
297 |
if ( iSpeakerIcon ) |
|
298 |
{ |
|
299 |
AknIconUtils::SetSize( iSpeakerIcon->Bitmap(), |
|
300 |
iSpeakerRect.Size(), |
|
301 |
EAspectRatioPreserved ); |
|
302 |
} |
|
303 |
||
304 |
delete iSpeakerMuteIcon; |
|
305 |
iSpeakerMuteIcon = NULL; |
|
306 |
iSpeakerMuteIcon = AknsUtils::CreateGulIconL( |
|
307 |
skin, |
|
308 |
KAknsIIDQgnIndiNsliderMuted, |
|
309 |
iconsPath, |
|
310 |
EMbmMpxvideoplaybackcontrolsQgn_indi_nslider_muted, |
|
311 |
EMbmMpxvideoplaybackcontrolsQgn_indi_nslider_muted_mask ); |
|
312 |
||
313 |
||
314 |
if ( iSpeakerMuteIcon ) |
|
315 |
{ |
|
316 |
AknIconUtils::SetSize( iSpeakerMuteIcon->Bitmap(), |
|
317 |
iSpeakerRect.Size(), |
|
318 |
EAspectRatioPreserved ); |
|
319 |
} |
|
320 |
||
321 |
delete iNoAudioIcon; |
|
322 |
iNoAudioIcon = NULL; |
|
323 |
iNoAudioIcon = AknsUtils::CreateGulIconL( |
|
324 |
skin, |
|
325 |
KAknsIIDQgnGrafMupLstCorrupttrack, |
|
326 |
iconsPath, |
|
327 |
EMbmMpxvideoplaybackcontrolsQgn_graf_mup_lst_corrupttrack, |
|
328 |
EMbmMpxvideoplaybackcontrolsQgn_graf_mup_lst_corrupttrack_mask ); |
|
329 |
||
330 |
||
331 |
if ( iNoAudioIcon ) |
|
332 |
{ |
|
333 |
AknIconUtils::SetSize( iNoAudioIcon->Bitmap(), |
|
334 |
iSpeakerRect.Size(), |
|
335 |
EAspectRatioPreserved ); |
|
336 |
} |
|
337 |
||
338 |
delete iVolumeUpIcon; |
|
339 |
iVolumeUpIcon = NULL; |
|
340 |
iVolumeUpIcon = AknsUtils::CreateGulIconL( |
|
341 |
skin, |
|
342 |
KAknsIIDQgnIndiCam4ZoomMax, |
|
343 |
iconsPath, |
|
344 |
EMbmMpxvideoplaybackcontrolsQgn_indi_nslider_level_increase, |
|
345 |
EMbmMpxvideoplaybackcontrolsQgn_indi_nslider_level_increase_mask ); |
|
346 |
||
347 |
if ( iVolumeUpIcon ) |
|
348 |
{ |
|
349 |
AknIconUtils::SetSize( iVolumeUpIcon->Bitmap(), |
|
350 |
iVolumeUpRect.Size(), |
|
351 |
EAspectRatioPreserved ); |
|
352 |
} |
|
353 |
||
354 |
delete iVolumeDownIcon; |
|
355 |
iVolumeDownIcon = NULL; |
|
356 |
iVolumeDownIcon = AknsUtils::CreateGulIconL( |
|
357 |
skin, |
|
358 |
KAknsIIDQgnIndiCam4ZoomMin, |
|
359 |
iconsPath, |
|
360 |
EMbmMpxvideoplaybackcontrolsQgn_indi_nslider_level_decrease, |
|
361 |
EMbmMpxvideoplaybackcontrolsQgn_indi_nslider_level_decrease_mask ); |
|
362 |
||
363 |
if ( iVolumeDownIcon ) |
|
364 |
{ |
|
365 |
AknIconUtils::SetSize( iVolumeDownIcon->Bitmap(), |
|
366 |
iVolumeDownRect.Size(), |
|
367 |
EAspectRatioPreserved ); |
|
368 |
} |
|
369 |
||
370 |
delete iVolumeFrameIconTop; |
|
371 |
iVolumeFrameIconTop = NULL; |
|
372 |
iVolumeFrameIconTop = AknsUtils::CreateGulIconL( |
|
373 |
skin, |
|
374 |
KAknsIIDQgnIndiCam4ZoomTop, |
|
375 |
iconsPath, |
|
376 |
EMbmMpxvideoplaybackcontrolsQgn_graf_nslider_vertical_top, |
|
377 |
EMbmMpxvideoplaybackcontrolsQgn_graf_nslider_vertical_top_mask ); |
|
378 |
||
379 |
if ( iVolumeFrameIconTop ) |
|
380 |
{ |
|
381 |
AknIconUtils::SetSize( iVolumeFrameIconTop->Bitmap(), |
|
382 |
TSize( iVolumeBarRectTop.Width(), iVolumeBarRectTop.Height() ), |
|
383 |
EAspectRatioNotPreserved ); |
|
384 |
} |
|
385 |
||
386 |
delete iVolumeFrameIconMiddle; |
|
387 |
iVolumeFrameIconMiddle = NULL; |
|
388 |
iVolumeFrameIconMiddle = AknsUtils::CreateGulIconL( |
|
389 |
skin, |
|
390 |
KAknsIIDQgnIndiCam4ZoomMiddle, |
|
391 |
iconsPath, |
|
392 |
EMbmMpxvideoplaybackcontrolsQgn_graf_nslider_vertical_middle, |
|
393 |
EMbmMpxvideoplaybackcontrolsQgn_graf_nslider_vertical_middle_mask ); |
|
394 |
||
395 |
if ( iVolumeFrameIconMiddle ) |
|
396 |
{ |
|
397 |
AknIconUtils::SetSize( iVolumeFrameIconMiddle->Bitmap(), |
|
398 |
TSize( iVolumeBarRectMiddle.Width(), iVolumeBarRectMiddle.Height() ), |
|
399 |
EAspectRatioNotPreserved ); |
|
400 |
} |
|
401 |
||
402 |
delete iVolumeFrameIconBottom; |
|
403 |
iVolumeFrameIconBottom = NULL; |
|
404 |
iVolumeFrameIconBottom = AknsUtils::CreateGulIconL( |
|
405 |
skin, |
|
406 |
KAknsIIDQgnIndiCam4ZoomBottom, |
|
407 |
iconsPath, |
|
408 |
EMbmMpxvideoplaybackcontrolsQgn_graf_nslider_vertical_bottom, |
|
409 |
EMbmMpxvideoplaybackcontrolsQgn_graf_nslider_vertical_bottom_mask ); |
|
410 |
||
411 |
if ( iVolumeFrameIconBottom ) |
|
412 |
{ |
|
413 |
AknIconUtils::SetSize( iVolumeFrameIconBottom->Bitmap(), |
|
414 |
TSize( iVolumeBarRectBottom.Width(), iVolumeBarRectBottom.Height() ), |
|
415 |
EAspectRatioNotPreserved ); |
|
416 |
} |
|
417 |
||
418 |
// Calculate the X coordinate to center the icon of sliderbar |
|
419 |
TRect volumeBarRectPart; |
|
420 |
CGulIcon* volumeFrameIconPart = NULL; |
|
421 |
||
422 |
if ( iVolumeFrameIconTop ) |
|
423 |
{ |
|
424 |
volumeFrameIconPart = iVolumeFrameIconTop; |
|
425 |
volumeBarRectPart = iVolumeBarRectTop; |
|
426 |
} |
|
427 |
else if ( iVolumeFrameIconMiddle ) |
|
428 |
{ |
|
429 |
volumeFrameIconPart = iVolumeFrameIconMiddle; |
|
430 |
volumeBarRectPart = iVolumeBarRectMiddle; |
|
431 |
} |
|
432 |
else if ( iVolumeFrameIconBottom ) |
|
433 |
{ |
|
434 |
volumeFrameIconPart = iVolumeFrameIconBottom; |
|
435 |
volumeBarRectPart = iVolumeBarRectBottom; |
|
436 |
} |
|
437 |
||
438 |
if ( volumeFrameIconPart ) |
|
439 |
{ |
|
440 |
iCenteredSliderbarIconX = volumeBarRectPart.iTl.iX + |
|
441 |
( volumeBarRectPart.Width() - |
|
442 |
volumeFrameIconPart->Bitmap()->SizeInPixels().iWidth ) / 2; |
|
443 |
} |
|
444 |
} |
|
445 |
||
446 |
// ------------------------------------------------------------------------------------------------- |
|
447 |
// CMPXVideoPlaybackVolumeBar::HandleVolumeIncreaseL |
|
448 |
// ------------------------------------------------------------------------------------------------- |
|
449 |
// |
|
450 |
void CMPXVideoPlaybackVolumeBar::HandleVolumeIncreaseL( const TPointerEvent& aPointerEvent ) |
|
451 |
{ |
|
452 |
MPX_ENTER_EXIT(_L("CMPXVideoPlaybackVolumeBar::HandleVolumeIncreaseL()"), |
|
453 |
_L("aPointerEvent.iType = %d"), aPointerEvent.iType); |
|
454 |
||
455 |
switch ( aPointerEvent.iType ) |
|
456 |
{ |
|
457 |
case TPointerEvent::EButtonRepeat: |
|
458 |
{ |
|
459 |
#ifdef RD_TACTILE_FEEDBACK |
|
70
375929f879c2
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
57
diff
changeset
|
460 |
if ( iFeedback ) |
57 | 461 |
{ |
70
375929f879c2
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
57
diff
changeset
|
462 |
#ifdef SYMBIAN_BUILD_GCE |
57 | 463 |
iFeedback->InstantFeedback( ETouchFeedbackSlider ); |
70
375929f879c2
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
57
diff
changeset
|
464 |
#else |
375929f879c2
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
57
diff
changeset
|
465 |
iFeedback->InstantFeedback( ETouchFeedbackSensitive ); |
375929f879c2
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
57
diff
changeset
|
466 |
#endif //SYMBIAN_BUILD_GCE |
57 | 467 |
} |
468 |
#endif //RD_TACTILE_FEEDBACK |
|
469 |
iController->HandleCommandL( EMPXPbvCmdIncreaseVolume ); |
|
470 |
iDragging = EVolumeIncreaseDragging; |
|
471 |
||
472 |
} |
|
473 |
case TPointerEvent::EButton1Down: |
|
474 |
{ |
|
475 |
Window().RequestPointerRepeatEvent( |
|
476 |
TTimeIntervalMicroSeconds32(KMPXPtrEventRepeatRequestTime) |
|
477 |
,iVolumeUpControlRect); |
|
478 |
||
479 |
break; |
|
480 |
} |
|
481 |
case TPointerEvent::EDrag: |
|
482 |
{ |
|
483 |
iDragging = EVolumeIncreaseDragging; |
|
484 |
break; |
|
485 |
} |
|
486 |
case TPointerEvent::EButton1Up: |
|
487 |
{ |
|
488 |
#ifdef RD_TACTILE_FEEDBACK |
|
70
375929f879c2
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
57
diff
changeset
|
489 |
if ( iFeedback ) |
57 | 490 |
{ |
70
375929f879c2
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
57
diff
changeset
|
491 |
#ifdef SYMBIAN_BUILD_GCE |
57 | 492 |
iFeedback->InstantFeedback( ETouchFeedbackSlider ); |
70
375929f879c2
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
57
diff
changeset
|
493 |
#else |
375929f879c2
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
57
diff
changeset
|
494 |
iFeedback->InstantFeedback( ETouchFeedbackBasic ); |
375929f879c2
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
57
diff
changeset
|
495 |
#endif //SYMBIAN_BUILD_GCE |
57 | 496 |
} |
497 |
#endif //RD_TACTILE_FEEDBACK |
|
498 |
||
499 |
iController->HandleCommandL( EMPXPbvCmdIncreaseVolume ); |
|
500 |
||
501 |
iDragging = EVolumeNotDragging; |
|
502 |
||
503 |
break; |
|
504 |
} |
|
505 |
} |
|
506 |
} |
|
507 |
||
508 |
// ------------------------------------------------------------------------------------------------- |
|
509 |
// CMPXVideoPlaybackVolumeBar::HandleVolumeDecreaseL |
|
510 |
// ------------------------------------------------------------------------------------------------- |
|
511 |
// |
|
512 |
void CMPXVideoPlaybackVolumeBar::HandleVolumeDecreaseL( const TPointerEvent& aPointerEvent ) |
|
513 |
{ |
|
514 |
MPX_ENTER_EXIT(_L("CMPXVideoPlaybackVolumeBar::HandleVolumeDecreaseL()"), |
|
515 |
_L("aPointerEvent.iType = %d"), aPointerEvent.iType); |
|
516 |
||
517 |
switch ( aPointerEvent.iType ) |
|
518 |
{ |
|
519 |
case TPointerEvent::EButtonRepeat: |
|
520 |
{ |
|
521 |
#ifdef RD_TACTILE_FEEDBACK |
|
70
375929f879c2
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
57
diff
changeset
|
522 |
if ( iFeedback ) |
57 | 523 |
{ |
70
375929f879c2
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
57
diff
changeset
|
524 |
#ifdef SYMBIAN_BUILD_GCE |
57 | 525 |
iFeedback->InstantFeedback( ETouchFeedbackSlider ); |
70
375929f879c2
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
57
diff
changeset
|
526 |
#else |
375929f879c2
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
57
diff
changeset
|
527 |
iFeedback->InstantFeedback( ETouchFeedbackSensitive ); |
375929f879c2
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
57
diff
changeset
|
528 |
#endif //SYMBIAN_BUILD_GCE |
57 | 529 |
} |
530 |
#endif //RD_TACTILE_FEEDBACK |
|
531 |
iController->HandleCommandL( EMPXPbvCmdDecreaseVolume ); |
|
532 |
iDragging = EVolumeDecreaseDragging; |
|
533 |
||
534 |
} |
|
535 |
case TPointerEvent::EButton1Down: |
|
536 |
{ |
|
537 |
Window().RequestPointerRepeatEvent( |
|
538 |
TTimeIntervalMicroSeconds32(KMPXPtrEventRepeatRequestTime) |
|
539 |
,iVolumeDownControlRect); |
|
540 |
||
541 |
break; |
|
542 |
} |
|
543 |
case TPointerEvent::EDrag: |
|
544 |
{ |
|
545 |
iDragging = EVolumeDecreaseDragging; |
|
546 |
break; |
|
547 |
} |
|
548 |
case TPointerEvent::EButton1Up: |
|
549 |
{ |
|
550 |
#ifdef RD_TACTILE_FEEDBACK |
|
70
375929f879c2
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
57
diff
changeset
|
551 |
if ( iFeedback ) |
57 | 552 |
{ |
70
375929f879c2
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
57
diff
changeset
|
553 |
#ifdef SYMBIAN_BUILD_GCE |
57 | 554 |
iFeedback->InstantFeedback( ETouchFeedbackSlider ); |
70
375929f879c2
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
57
diff
changeset
|
555 |
#else |
375929f879c2
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
57
diff
changeset
|
556 |
iFeedback->InstantFeedback( ETouchFeedbackBasic ); |
375929f879c2
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
57
diff
changeset
|
557 |
#endif //SYMBIAN_BUILD_GCE |
57 | 558 |
} |
559 |
#endif //RD_TACTILE_FEEDBACK |
|
560 |
||
561 |
iController->HandleCommandL( EMPXPbvCmdDecreaseVolume ); |
|
562 |
||
563 |
iDragging = EVolumeNotDragging; |
|
564 |
||
565 |
break; |
|
566 |
} |
|
567 |
} |
|
568 |
} |
|
569 |
||
570 |
// ------------------------------------------------------------------------------------------------- |
|
571 |
// CMPXVideoPlaybackVolumeBar::HandleSpeakerControlEventL |
|
572 |
// ------------------------------------------------------------------------------------------------- |
|
573 |
// |
|
574 |
void CMPXVideoPlaybackVolumeBar::HandleSpeakerControlEventL( const TPointerEvent& aPointerEvent ) |
|
575 |
{ |
|
576 |
MPX_ENTER_EXIT(_L("CMPXVideoPlaybackVolumeBar::HandleSpeakerControlEventL()"), |
|
577 |
_L("aPointerEvent.iType = %d"), aPointerEvent.iType); |
|
578 |
||
579 |
switch ( aPointerEvent.iType ) |
|
580 |
{ |
|
581 |
case TPointerEvent::EButton1Up: |
|
582 |
{ |
|
583 |
#ifdef RD_TACTILE_FEEDBACK |
|
584 |
if ( iFeedback ) |
|
585 |
{ |
|
70
375929f879c2
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
57
diff
changeset
|
586 |
#ifdef SYMBIAN_BUILD_GCE |
57 | 587 |
iFeedback->InstantFeedback( ETouchFeedbackBasicButton ); |
70
375929f879c2
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
57
diff
changeset
|
588 |
#else |
375929f879c2
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
57
diff
changeset
|
589 |
iFeedback->InstantFeedback( ETouchFeedbackBasic ); |
375929f879c2
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
57
diff
changeset
|
590 |
#endif //SYMBIAN_BUILD_GCE |
57 | 591 |
} |
592 |
#endif //RD_TACTILE_FEEDBACK |
|
593 |
||
594 |
if ( iMuted ) |
|
595 |
{ |
|
596 |
iController->HandleCommandL( EMPXPbvCmdUnMute ); |
|
597 |
} |
|
598 |
else |
|
599 |
{ |
|
600 |
iController->HandleCommandL( EMPXPbvCmdMute ); |
|
601 |
} |
|
602 |
||
603 |
iDragging = EVolumeNotDragging; |
|
604 |
||
605 |
break; |
|
606 |
} |
|
607 |
case TPointerEvent::EDrag: |
|
608 |
{ |
|
609 |
iDragging = EVolumeSpeakerDragging; |
|
610 |
||
611 |
break; |
|
612 |
} |
|
613 |
case TPointerEvent::EButton1Down: |
|
614 |
{ |
|
615 |
iDragging = EVolumeNotDragging; |
|
616 |
||
617 |
break; |
|
618 |
} |
|
619 |
} |
|
620 |
} |
|
621 |
||
622 |
// ------------------------------------------------------------------------------------------------- |
|
623 |
// CMPXVideoPlaybackVolumeBar::HandleVolumeBarEventL |
|
624 |
// ------------------------------------------------------------------------------------------------- |
|
625 |
// |
|
626 |
void CMPXVideoPlaybackVolumeBar::HandleVolumeBarEventL( const TPointerEvent& aPointerEvent ) |
|
627 |
{ |
|
628 |
MPX_ENTER_EXIT(_L("CMPXVideoPlaybackVolumeBar::HandleVolumeBarEventL()"), |
|
629 |
_L("aPointerEvent.iType = %d"), aPointerEvent.iType); |
|
630 |
||
631 |
TInt vol = 0; |
|
632 |
||
633 |
// |
|
634 |
// Dynamic Slider Feedback should only be given when the slider is not at the top or bottom |
|
635 |
// |
|
636 |
TBool giveDynamicSliderFeedback = EFalse; |
|
637 |
||
638 |
if ( aPointerEvent.iPosition.iY < iVolumeBarRect.iTl.iY + KMPXSliderHeight / 2 ) |
|
639 |
{ |
|
640 |
vol = KPbPlaybackVolumeLevelMax; |
|
641 |
} |
|
642 |
else if ( aPointerEvent.iPosition.iY > iVolumeBarRect.iBr.iY - KMPXSliderHeight / 2 ) |
|
643 |
{ |
|
644 |
vol = 0; |
|
645 |
} |
|
646 |
else |
|
647 |
{ |
|
648 |
giveDynamicSliderFeedback = ETrue; |
|
649 |
||
650 |
vol = ( iVolumeBarRect.iBr.iY - KMPXSliderHeight / 2 - aPointerEvent.iPosition.iY ) / |
|
651 |
iOneVolumeIncrementHeight; |
|
652 |
} |
|
653 |
||
654 |
switch ( aPointerEvent.iType ) |
|
655 |
{ |
|
656 |
case TPointerEvent::EButton1Down: |
|
657 |
{ |
|
658 |
#ifdef RD_TACTILE_FEEDBACK |
|
70
375929f879c2
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
57
diff
changeset
|
659 |
if ( iFeedback ) |
57 | 660 |
{ |
661 |
iFeedback->InstantFeedback( ETouchFeedbackSlider ); |
|
662 |
} |
|
663 |
#endif //RD_TACTILE_FEEDBACK |
|
664 |
||
665 |
if ( ! iDraggingHandlerTimer->IsActive() ) |
|
666 |
{ |
|
667 |
iDraggingHandlerTimer->Start( |
|
668 |
KMPXVolumeDragEventTimeOut, |
|
669 |
KMPXVolumeDragEventTimeOut, |
|
670 |
TCallBack( CMPXVideoPlaybackVolumeBar::HandleVolumeDragEventTimeOut, this ) ); |
|
671 |
} |
|
672 |
||
673 |
iDragging = EVolumeNotDragging; |
|
674 |
||
675 |
break; |
|
676 |
} |
|
677 |
case TPointerEvent::EDrag: |
|
678 |
{ |
|
679 |
#ifdef RD_TACTILE_FEEDBACK |
|
70
375929f879c2
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
57
diff
changeset
|
680 |
if ( iFeedback && giveDynamicSliderFeedback ) |
57 | 681 |
{ |
682 |
iFeedback->StartFeedback( this, |
|
683 |
ETouchDynamicSlider, |
|
684 |
&aPointerEvent, |
|
685 |
KDynamicSliderFeedbackIntensity, |
|
686 |
KDynamicSliderFeedbackTimeOut ); |
|
687 |
} |
|
688 |
#endif //RD_TACTILE_FEEDBACK |
|
689 |
||
690 |
iVolumeWhileDraggingEvent = vol; |
|
691 |
iDragging = EVolumeBarDragging; |
|
692 |
||
693 |
break; |
|
694 |
} |
|
695 |
case TPointerEvent::EButton1Up: |
|
696 |
{ |
|
697 |
if ( iDraggingHandlerTimer->IsActive() ) |
|
698 |
{ |
|
699 |
iDraggingHandlerTimer->Cancel(); |
|
700 |
} |
|
701 |
||
702 |
SetVolumeL( vol ); |
|
703 |
||
704 |
if ( iDragging == EVolumeBarDragging && vol == 0 ) |
|
705 |
{ |
|
706 |
// |
|
707 |
// volume & mute levels are kept track in playbackplugin. |
|
708 |
// |
|
709 |
iController->HandleCommandL( EMPXPbvCmdMute ); |
|
710 |
} |
|
711 |
||
712 |
iDragging = EVolumeNotDragging; |
|
713 |
||
714 |
if ( IsVisible() ) |
|
715 |
{ |
|
716 |
DrawNow(); |
|
717 |
} |
|
718 |
||
719 |
break; |
|
720 |
} |
|
721 |
} |
|
722 |
} |
|
723 |
||
724 |
// ------------------------------------------------------------------------------------------------- |
|
725 |
// CMPXVideoPlaybackVolumeBar::HandleVolumeDragEventTimeOut |
|
726 |
// ------------------------------------------------------------------------------------------------- |
|
727 |
// |
|
728 |
TInt CMPXVideoPlaybackVolumeBar::HandleVolumeDragEventTimeOut( TAny* aPtr ) |
|
729 |
{ |
|
730 |
static_cast<CMPXVideoPlaybackVolumeBar*>(aPtr)->DoHandleVolumeDragEventTimeOut(); |
|
731 |
return KErrNone; |
|
732 |
} |
|
733 |
||
734 |
// ------------------------------------------------------------------------------------------------- |
|
735 |
// CMPXVideoPlaybackVolumeBar::DoHandleVolumeDragEventTimeOut |
|
736 |
// ------------------------------------------------------------------------------------------------- |
|
737 |
// |
|
738 |
void CMPXVideoPlaybackVolumeBar::DoHandleVolumeDragEventTimeOut() |
|
739 |
{ |
|
740 |
MPX_ENTER_EXIT(_L("CMPXVideoPlaybackController::DoHandleVolumeDragEventTimeOut()")); |
|
741 |
||
742 |
if ( iDragging == EVolumeBarDragging ) |
|
743 |
{ |
|
744 |
MPX_TRAPD( err, SetVolumeL( iVolumeWhileDraggingEvent ) ); |
|
745 |
} |
|
746 |
} |
|
747 |
||
748 |
// ------------------------------------------------------------------------------------------------- |
|
749 |
// CMPXVideoPlaybackVolumeBar::HandlePointerEventL |
|
750 |
// ------------------------------------------------------------------------------------------------- |
|
751 |
// |
|
752 |
void CMPXVideoPlaybackVolumeBar::HandlePointerEventL( const TPointerEvent& aPointerEvent ) |
|
753 |
{ |
|
754 |
MPX_ENTER_EXIT(_L("CMPXVideoPlaybackVolumeBar::HandlePointerEventL()")); |
|
755 |
||
756 |
if ( iController->FileDetails()->iAudioEnabled ) |
|
757 |
{ |
|
758 |
// |
|
759 |
// Volume up |
|
760 |
// |
|
761 |
if ( iDragging == EVolumeIncreaseDragging || |
|
762 |
( iVolumeUpControlRect.Contains( aPointerEvent.iPosition ) && |
|
763 |
iDragging == EVolumeNotDragging ) ) |
|
764 |
{ |
|
765 |
HandleVolumeIncreaseL( aPointerEvent ); |
|
766 |
} |
|
767 |
// |
|
768 |
// Volume down |
|
769 |
// |
|
770 |
else if ( iDragging == EVolumeDecreaseDragging || |
|
771 |
( iVolumeDownControlRect.Contains( aPointerEvent.iPosition ) && |
|
772 |
iDragging == EVolumeNotDragging ) ) |
|
773 |
{ |
|
774 |
HandleVolumeDecreaseL( aPointerEvent ); |
|
775 |
} |
|
776 |
// |
|
777 |
// Speaker/Mute |
|
778 |
// |
|
779 |
else if ( iDragging == EVolumeSpeakerDragging || |
|
780 |
( iSpeakerControlRect.Contains( aPointerEvent.iPosition ) && |
|
781 |
iDragging == EVolumeNotDragging ) ) |
|
782 |
{ |
|
783 |
HandleSpeakerControlEventL( aPointerEvent ); |
|
784 |
} |
|
785 |
// |
|
786 |
// Volume Bar |
|
787 |
// |
|
788 |
else |
|
789 |
{ |
|
790 |
HandleVolumeBarEventL( aPointerEvent ); |
|
791 |
} |
|
792 |
} |
|
793 |
} |
|
794 |
||
795 |
// ------------------------------------------------------------------------------------------------- |
|
796 |
// CMPXVideoPlaybackVolumeBar::Draw() |
|
797 |
// ------------------------------------------------------------------------------------------------- |
|
798 |
// |
|
799 |
void CMPXVideoPlaybackVolumeBar::Draw( const TRect& aRect ) const |
|
800 |
{ |
|
801 |
MPX_DEBUG(_L("CMPXVideoPlaybackVolumeBar::Draw()")); |
|
802 |
||
803 |
CWindowGc& gc = SystemGc(); |
|
804 |
gc.SetClippingRect( aRect ); |
|
805 |
||
806 |
if ( Window().DisplayMode() == EColor16MAP ) |
|
807 |
{ |
|
808 |
gc.SetDrawMode( CGraphicsContext::EDrawModeWriteAlpha ); |
|
809 |
gc.SetBrushColor( TRgb::Color16MAP( 255 ) ); |
|
810 |
gc.Clear( aRect ); |
|
811 |
} |
|
812 |
else if ( Window().DisplayMode() == EColor16MA ) |
|
813 |
{ |
|
814 |
gc.SetDrawMode( CGraphicsContext::EDrawModeWriteAlpha ); |
|
815 |
gc.SetBrushColor( TRgb::Color16MA( 0 ) ); |
|
816 |
gc.Clear( aRect ); |
|
817 |
} |
|
818 |
||
819 |
if ( ! iController->FileDetails()->iAudioEnabled || iMuted ) |
|
820 |
{ |
|
821 |
if ( iController->FileDetails()->iAudioEnabled ) |
|
822 |
{ |
|
823 |
// |
|
824 |
// use "Mute" icon for media clip with audio supported |
|
825 |
// |
|
826 |
gc.BitBltMasked( iSpeakerRect.iTl, |
|
827 |
iSpeakerMuteIcon->Bitmap(), |
|
828 |
TRect(iSpeakerRect.Size()), |
|
829 |
iSpeakerMuteIcon->Mask(), |
|
830 |
ETrue ); |
|
831 |
} |
|
832 |
else |
|
833 |
{ |
|
834 |
// |
|
835 |
// use "No Audio" icon instead of the generic "Mute" icon |
|
836 |
// for media clip with audio not supported |
|
837 |
// |
|
838 |
gc.BitBltMasked( iSpeakerRect.iTl, |
|
839 |
iNoAudioIcon->Bitmap(), |
|
840 |
TRect(iSpeakerRect.Size()), |
|
841 |
iNoAudioIcon->Mask(), |
|
842 |
ETrue ); |
|
843 |
} |
|
844 |
} |
|
845 |
else |
|
846 |
{ |
|
847 |
gc.BitBltMasked( iSpeakerRect.iTl, |
|
848 |
iSpeakerIcon->Bitmap(), |
|
849 |
TRect(iSpeakerRect.Size()), |
|
850 |
iSpeakerIcon->Mask(), |
|
851 |
ETrue ); |
|
852 |
} |
|
853 |
||
854 |
if ( iVolumeUpIcon ) |
|
855 |
{ |
|
856 |
gc.BitBltMasked( iVolumeUpRect.iTl, |
|
857 |
iVolumeUpIcon->Bitmap(), |
|
858 |
TRect(iVolumeUpRect.Size()), |
|
859 |
iVolumeUpIcon->Mask(), |
|
860 |
ETrue ); |
|
861 |
} |
|
862 |
||
863 |
if ( iVolumeDownIcon ) |
|
864 |
{ |
|
865 |
gc.BitBltMasked( iVolumeDownRect.iTl, |
|
866 |
iVolumeDownIcon->Bitmap(), |
|
867 |
TRect(iVolumeDownRect.Size()), |
|
868 |
iVolumeDownIcon->Mask(), |
|
869 |
ETrue ); |
|
870 |
} |
|
871 |
||
872 |
TPoint srcPoint( iCenteredSliderbarIconX, 0 ); |
|
873 |
if ( iVolumeFrameIconTop ) |
|
874 |
{ |
|
875 |
srcPoint.iY = iVolumeBarRectTop.iTl.iY; |
|
876 |
gc.BitBltMasked( srcPoint, |
|
877 |
iVolumeFrameIconTop->Bitmap(), |
|
878 |
TRect(iVolumeBarRectTop.Size()), |
|
879 |
iVolumeFrameIconTop->Mask(), |
|
880 |
ETrue ); |
|
881 |
} |
|
882 |
||
883 |
if ( iVolumeFrameIconMiddle ) |
|
884 |
{ |
|
885 |
srcPoint.iY = iVolumeBarRectMiddle.iTl.iY; |
|
886 |
gc.BitBltMasked( srcPoint, |
|
887 |
iVolumeFrameIconMiddle->Bitmap(), |
|
888 |
TRect(iVolumeBarRectMiddle.Size()), |
|
889 |
iVolumeFrameIconMiddle->Mask(), |
|
890 |
ETrue ); |
|
891 |
} |
|
892 |
||
893 |
if ( iVolumeFrameIconBottom ) |
|
894 |
{ |
|
895 |
srcPoint.iY = iVolumeBarRectBottom.iTl.iY; |
|
896 |
gc.BitBltMasked( srcPoint, |
|
897 |
iVolumeFrameIconBottom->Bitmap(), |
|
898 |
TRect(iVolumeBarRectBottom.Size()), |
|
899 |
iVolumeFrameIconBottom->Mask(), |
|
900 |
ETrue ); |
|
901 |
} |
|
902 |
||
903 |
if ( iController->FileDetails() && |
|
904 |
iController->FileDetails()->iAudioEnabled && |
|
905 |
!iController->FileDetails()->iTvOutConnected && |
|
906 |
iSliderIcon && |
|
907 |
iSliderSelectedIcon ) |
|
908 |
{ |
|
909 |
if ( iDragging == EVolumeBarDragging ) |
|
910 |
{ |
|
911 |
gc.BitBltMasked( iSliderRect.iTl, |
|
912 |
iSliderSelectedIcon->Bitmap(), |
|
913 |
TRect(iSliderRect.Size()), |
|
914 |
iSliderSelectedIcon->Mask(), |
|
915 |
ETrue ); |
|
916 |
} |
|
917 |
else |
|
918 |
{ |
|
919 |
gc.BitBltMasked( iSliderRect.iTl, |
|
920 |
iSliderIcon->Bitmap(), |
|
921 |
TRect(iSliderRect.Size()), |
|
922 |
iSliderIcon->Mask(), |
|
923 |
ETrue ); |
|
924 |
} |
|
925 |
} |
|
926 |
} |
|
927 |
||
928 |
// ------------------------------------------------------------------------------------------------- |
|
929 |
// CMPXVideoPlaybackVolumeBar::CountComponentControls() |
|
930 |
// ------------------------------------------------------------------------------------------------- |
|
931 |
// |
|
932 |
TInt CMPXVideoPlaybackVolumeBar::CountComponentControls() const |
|
933 |
{ |
|
934 |
return 0; |
|
935 |
} |
|
936 |
||
937 |
// ------------------------------------------------------------------------------------------------- |
|
938 |
// CMPXVideoPlaybackVolumeBar::VolumeChanged() |
|
939 |
// ------------------------------------------------------------------------------------------------- |
|
940 |
// |
|
941 |
void CMPXVideoPlaybackVolumeBar::VolumeChanged( TInt aVolume ) |
|
942 |
{ |
|
943 |
MPX_DEBUG(_L("CMPXVideoPlaybackVolumeBar::VolumeChanged() [%d]"), aVolume); |
|
944 |
||
945 |
iMuted = (aVolume == 0)? ETrue:EFalse; |
|
946 |
||
947 |
TReal volumeBarHeight = (TReal)iVolumeBarRect.iBr.iY - |
|
948 |
iOneVolumeIncrementHeight * (TReal)aVolume; |
|
949 |
||
950 |
iSliderRect.iTl.iY = volumeBarHeight - KMPXSliderHeight; |
|
951 |
iSliderRect.iBr.iY = volumeBarHeight; |
|
952 |
||
953 |
if ( IsVisible() ) |
|
954 |
{ |
|
955 |
DrawNow(); |
|
956 |
} |
|
957 |
} |
|
958 |
||
959 |
// ------------------------------------------------------------------------------------------------- |
|
960 |
// CMPXVideoPlaybackVolumeBar::Reset |
|
961 |
// ------------------------------------------------------------------------------------------------- |
|
962 |
// |
|
963 |
void CMPXVideoPlaybackVolumeBar::Reset() |
|
964 |
{ |
|
965 |
MPX_ENTER_EXIT(_L("CMPXVideoPlaybackVolumeBar::Reset()")); |
|
966 |
||
967 |
if ( iDragging != EVolumeNotDragging ) |
|
968 |
{ |
|
969 |
TPointerEvent event; |
|
970 |
event.iType = TPointerEvent::EButton1Up; |
|
971 |
event.iPosition.iY = ( iSliderRect.iTl.iY + iSliderRect.iBr.iY ) / 2; |
|
972 |
||
973 |
MPX_TRAPD( err, HandlePointerEventL(event) ); |
|
974 |
} |
|
975 |
} |
|
976 |
||
977 |
// ------------------------------------------------------------------------------------------------- |
|
978 |
// CMPXVideoPlaybackVolumeBar::SetVolumeL() |
|
979 |
// ------------------------------------------------------------------------------------------------- |
|
980 |
// |
|
981 |
void CMPXVideoPlaybackVolumeBar::SetVolumeL( TInt aVolume ) |
|
982 |
{ |
|
983 |
MPX_ENTER_EXIT(_L("CMPXVideoPlaybackVolumeBar::SetVolumeL()"), |
|
984 |
_L("aVolume = %d"), aVolume ); |
|
985 |
||
986 |
iController->HandleCommandL( EMPXPbvCmdSetVolume, aVolume ); |
|
987 |
} |
|
988 |
||
989 |
// ------------------------------------------------------------------------------------------------- |
|
990 |
// CMPXVideoPlaybackVolumeBar::UpdateTVOutStatus() |
|
991 |
// ------------------------------------------------------------------------------------------------- |
|
992 |
// |
|
993 |
void CMPXVideoPlaybackVolumeBar::UpdateTVOutStatusL( TBool aConnected ) |
|
994 |
{ |
|
995 |
MPX_ENTER_EXIT(_L("CMPXVideoPlaybackVolumeBar::UpdateTVOutStatus()")); |
|
996 |
||
997 |
if ( aConnected ) |
|
998 |
{ |
|
999 |
if ( iSliderIcon ) |
|
1000 |
{ |
|
1001 |
delete iSliderIcon; |
|
1002 |
iSliderIcon = NULL; |
|
1003 |
} |
|
1004 |
||
1005 |
if ( iSliderSelectedIcon ) |
|
1006 |
{ |
|
1007 |
delete iSliderSelectedIcon; |
|
1008 |
iSliderSelectedIcon = NULL; |
|
1009 |
} |
|
1010 |
} |
|
1011 |
else |
|
1012 |
{ |
|
1013 |
CreateSliderIconsL(); |
|
1014 |
} |
|
1015 |
} |
|
1016 |
||
1017 |
// ------------------------------------------------------------------------------------------------- |
|
1018 |
// CMPXVideoPlaybackVolumeBar::CreateSliderIconsL() |
|
1019 |
// ------------------------------------------------------------------------------------------------- |
|
1020 |
// |
|
1021 |
void CMPXVideoPlaybackVolumeBar::CreateSliderIconsL() |
|
1022 |
{ |
|
1023 |
MPX_ENTER_EXIT(_L("CMPXVideoPlaybackVolumeBar::CreateSliderIconsL()")); |
|
1024 |
||
1025 |
// |
|
1026 |
// Create icons |
|
1027 |
// |
|
1028 |
MAknsSkinInstance* skin = AknsUtils::SkinInstance(); |
|
1029 |
||
1030 |
TFileName iconsPath; |
|
1031 |
iController->LocateBitmapFileL( iconsPath ); |
|
1032 |
||
1033 |
delete iSliderIcon; |
|
1034 |
iSliderIcon = NULL; |
|
1035 |
iSliderIcon = AknsUtils::CreateGulIconL( |
|
1036 |
skin, |
|
1037 |
KAknsIIDQgnGrafNsliderVerticalMarker, |
|
1038 |
iconsPath, |
|
1039 |
EMbmMpxvideoplaybackcontrolsQgn_graf_nslider_vertical_marker, |
|
1040 |
EMbmMpxvideoplaybackcontrolsQgn_graf_nslider_vertical_marker_mask ); |
|
1041 |
||
1042 |
if ( iSliderIcon ) |
|
1043 |
{ |
|
1044 |
AknIconUtils::SetSize( iSliderIcon->Bitmap(), |
|
1045 |
TSize(KMPXSliderWidth, KMPXSliderHeight), |
|
1046 |
EAspectRatioNotPreserved ); |
|
1047 |
} |
|
1048 |
||
1049 |
delete iSliderSelectedIcon; |
|
1050 |
iSliderSelectedIcon = NULL; |
|
1051 |
iSliderSelectedIcon = AknsUtils::CreateGulIconL( |
|
1052 |
skin, |
|
1053 |
KAknsIIDQgnGrafNsliderVerticalMarkerSelected, |
|
1054 |
iconsPath, |
|
1055 |
EMbmMpxvideoplaybackcontrolsQgn_graf_nslider_vertical_marker_selected, |
|
1056 |
EMbmMpxvideoplaybackcontrolsQgn_graf_nslider_vertical_marker_selected_mask ); |
|
1057 |
||
1058 |
if ( iSliderSelectedIcon ) |
|
1059 |
{ |
|
1060 |
AknIconUtils::SetSize( iSliderSelectedIcon->Bitmap(), |
|
1061 |
TSize(KMPXSliderWidth, KMPXSliderHeight), |
|
1062 |
EAspectRatioNotPreserved ); |
|
1063 |
} |
|
1064 |
} |
|
1065 |
// End of File |