|
1 /* |
|
2 * Copyright (c) 2006 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 Common Playback view's container. |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 |
|
20 // INCLUDE FILES |
|
21 #include <eiklabel.h> |
|
22 #include <eikimage.h> |
|
23 #include <eikprogi.h> |
|
24 #include <eikmenub.h> |
|
25 #include <eikappui.h> |
|
26 #include <eikenv.h> |
|
27 #include <aknview.h> |
|
28 #include <AknsUtils.h> |
|
29 #include <AknDef.h> |
|
30 #include <AknsConstants.h> |
|
31 #include <AknsSkinInstance.h> |
|
32 #include <AknsControlContext.h> |
|
33 #include <AknsDrawUtils.h> |
|
34 #include <AknsBasicBackgroundControlContext.h> |
|
35 #include <barsread.h> |
|
36 #include <centralrepository.h> |
|
37 #include <StringLoader.h> |
|
38 #include <fontids.hrh> |
|
39 #include <gulfont.h> |
|
40 #include <applayout.cdl.h> |
|
41 #include <AknIconArray.h> |
|
42 #include <AknIconUtils.h> |
|
43 #include <gulicon.h> |
|
44 #include <featmgr.h> |
|
45 #include <aknnotewrappers.h> |
|
46 |
|
47 #include <data_caging_path_literals.hrh> |
|
48 #include <aknlayoutscalable_apps.cdl.h> |
|
49 #include <layoutmetadata.cdl.h> |
|
50 #include <avkon.mbg> |
|
51 #include <mpxcommonplaybackview.rsg> |
|
52 #include <mpxcommonplaybackview.mbg> |
|
53 #include <mpxconstants.h> |
|
54 #include <mpxfmtx.rsg> // For FF_FMTX |
|
55 #include <mpxappui.hrh> |
|
56 |
|
57 #include "mpxcommonplaybackviewcontainer.h" |
|
58 #include "mpxcommonplaybackviewlayout.h" |
|
59 #include "mpxcommonplaybackview.hrh" |
|
60 #include "mpxplaybackview.hlp.hrh" |
|
61 #include "mpxplaybackviewinfolabel.h" |
|
62 #include "mpxplaybackviewlayoutinterface.h" |
|
63 #include "mpxlayoutswitchobserver.h" |
|
64 #include "mpxcommonuihelper.h" |
|
65 #include <mpxinternalcrkeys.h> |
|
66 #include "mpxbuttonmanager.h" |
|
67 #include "mpxlog.h" |
|
68 |
|
69 #include <touchfeedback.h> |
|
70 |
|
71 // CONSTANTS |
|
72 const TInt KLabelCount = ETextCount; |
|
73 const TInt KMPXMinSecSeparatorIndex = 2; |
|
74 |
|
75 _LIT(KMPXZeroDurationMark, "--"); |
|
76 |
|
77 const TInt KOneHourInSeconds = 3600; |
|
78 const TInt KMPXTimeIndicatorLength = 16; |
|
79 |
|
80 // S60 softkey positions in CBA |
|
81 const TInt KMPXCbaLeftSoftkeyPos = 0; |
|
82 const TInt KMPXCbaRightSoftkeyPos = 2; |
|
83 |
|
84 // delay for actual seek operation |
|
85 const TInt KSeekDelay = 100000; // 0.1s |
|
86 |
|
87 const TInt KOneSecondInOneMilliSecond = 1000; |
|
88 // ======== MEMBER FUNCTIONS ======== |
|
89 |
|
90 |
|
91 // --------------------------------------------------------------------------- |
|
92 // Symbian 2nd phase constructor can leave. |
|
93 // --------------------------------------------------------------------------- |
|
94 // |
|
95 EXPORT_C void CMPXCommonPlaybackViewContainer::ConstructL( const TRect& /*aRect*/ ) |
|
96 { |
|
97 MPX_DEBUG1( "CMPXCommonPlaybackViewContainer::ConstructL() entering" ); |
|
98 |
|
99 CreateWindowL(); |
|
100 |
|
101 TAknWindowLineLayout screenLayout = |
|
102 AknLayout::screen(); |
|
103 TRect screenRect = screenLayout.Rect(); |
|
104 iBackground = CAknsBasicBackgroundControlContext::NewL( |
|
105 KAknsIIDQsnBgAreaMainMp, screenRect, EFalse ); |
|
106 |
|
107 iSeekTimer = CPeriodic::NewL( EPriorityLow ); |
|
108 |
|
109 TInt flags( 0 ); |
|
110 CRepository* repository = CRepository::NewL( KCRUidMPXMPFeatures ); |
|
111 User::LeaveIfError( repository->Get( KMPXMPLocalVariation, flags )); |
|
112 delete repository; |
|
113 repository = NULL; |
|
114 |
|
115 iEnableMarquee = static_cast<TBool>( flags & KMPXMarqueeArtistName ); |
|
116 |
|
117 iEnableButtons = static_cast<TBool>( flags & KMPXRockerMappingSupport ); |
|
118 |
|
119 CreateBackgroundImagesL(); |
|
120 |
|
121 // Create labels |
|
122 CreateLabelsL(); |
|
123 iLabels[ETextPlaylistCount]->MakeVisible( ETrue ); |
|
124 |
|
125 if ( FeatureManager::FeatureSupported( KFeatureIdFmtx ) ) |
|
126 { |
|
127 // By default, FMTX label is displayed |
|
128 iLabels[ETextFMFrequency]->MakeVisible( ETrue ); |
|
129 SetFMTXMode(ETrue); |
|
130 } |
|
131 |
|
132 // Create icons |
|
133 CreateIconsL(); |
|
134 |
|
135 // Create buttons if enabled |
|
136 if ( iEnableButtons ) |
|
137 { |
|
138 TRect rockerParentRect; |
|
139 if ( iCurrentLayout.Width()) |
|
140 { |
|
141 rockerParentRect = iCurrentLayout; |
|
142 } |
|
143 else |
|
144 { |
|
145 rockerParentRect = iCurrentLayout; |
|
146 } |
|
147 |
|
148 iButtonManager = CMPXButtonManager::NewL( |
|
149 this, |
|
150 iLayout, |
|
151 *this); |
|
152 |
|
153 iButtonManager->SetContainerWindowL( *this ); |
|
154 iButtonManager->SetMopParent( this ); |
|
155 iButtonManager->SetRect(rockerParentRect); |
|
156 } |
|
157 |
|
158 // Read time format strings from AVKON resource |
|
159 iMinSecFormatString = StringLoader::LoadL( |
|
160 R_QTN_TIME_DURAT_MIN_SEC_WITH_ZERO ); |
|
161 |
|
162 iShortFormatString = |
|
163 StringLoader::LoadL( R_QTN_TIME_DURAT_SHORT_WITH_ZERO ); |
|
164 |
|
165 iCommonUiHelper = CMPXCommonUiHelper::NewL(); |
|
166 |
|
167 // Refresh the progress bar |
|
168 UpdateProgressBarGraphics(); |
|
169 |
|
170 iMode = EUninitialized; |
|
171 iLabels[ETextDownloadState]->MakeVisible( ETrue ); |
|
172 iLabels[ETextArtist]->MakeVisible( EFalse ); |
|
173 iLabels[ETextTrack]->MakeVisible( EFalse ); |
|
174 iLabels[ETextElapsedTime]->MakeVisible( EFalse ); |
|
175 iLabels[ETextRemainingTime]->MakeVisible( EFalse ); |
|
176 iDisplayAlbumArt = EFalse; |
|
177 ActivateL(); |
|
178 |
|
179 iTouchDown = EFalse; |
|
180 iActiveView = ETrue; |
|
181 iPrerollCompleted = EFalse; |
|
182 |
|
183 DrawableWindow()->SetPointerGrab( ETrue ); |
|
184 EnableDragEvents(); |
|
185 |
|
186 MPX_DEBUG1( "CMPXCommonPlaybackViewContainer::ConstructL() exiting" ); |
|
187 } |
|
188 |
|
189 // --------------------------------------------------------------------------- |
|
190 // Destructor |
|
191 // --------------------------------------------------------------------------- |
|
192 // |
|
193 EXPORT_C CMPXCommonPlaybackViewContainer::~CMPXCommonPlaybackViewContainer() |
|
194 { |
|
195 // Pointer events |
|
196 SetGloballyCapturing( EFalse ); |
|
197 SetPointerCapture( EFalse ); |
|
198 |
|
199 FreeIcons(); |
|
200 delete iTrackAlbumArt; |
|
201 |
|
202 delete iBackground; |
|
203 iLabels.ResetAndDestroy(); |
|
204 delete iMinSecFormatString; |
|
205 delete iShortFormatString; |
|
206 delete iCommonUiHelper; |
|
207 |
|
208 delete iOffScreenBitmap; |
|
209 delete iOSBitmapContext; |
|
210 delete iOSBitmapDevice; |
|
211 |
|
212 delete iButtonManager; |
|
213 |
|
214 MTouchFeedback* feedback = MTouchFeedback::Instance(); |
|
215 if (feedback) |
|
216 { |
|
217 feedback->RemoveFeedbackForControl(this); |
|
218 } |
|
219 |
|
220 if ( iIdle ) |
|
221 { |
|
222 iIdle->Cancel(); |
|
223 delete iIdle; |
|
224 } |
|
225 |
|
226 if ( iSeekTimer ) |
|
227 { |
|
228 iSeekTimer->Cancel(); |
|
229 delete iSeekTimer; |
|
230 } |
|
231 } |
|
232 |
|
233 // --------------------------------------------------------------------------- |
|
234 // Updates time indicators. |
|
235 // --------------------------------------------------------------------------- |
|
236 // |
|
237 EXPORT_C void CMPXCommonPlaybackViewContainer::UpdateTimeIndicatorsL( |
|
238 TInt aPlaybackPosInSeconds, |
|
239 TInt aTotalLengthInSeconds ) |
|
240 { |
|
241 iTrackTotalLengthInSeconds = aTotalLengthInSeconds; |
|
242 if (!iTouchDown) |
|
243 { |
|
244 if( iDragProgressBar ) |
|
245 { |
|
246 TInt expectPlaybackPos = iNewSongPosition / KOneSecondInOneMilliSecond; |
|
247 if( expectPlaybackPos == aPlaybackPosInSeconds ) |
|
248 { |
|
249 iDragProgressBar = EFalse; |
|
250 } |
|
251 else |
|
252 { |
|
253 return; |
|
254 } |
|
255 } |
|
256 if ( aTotalLengthInSeconds == 0 ) |
|
257 { |
|
258 TLocale locale; |
|
259 TBuf<KMPXTimeIndicatorLength> pos; |
|
260 TChar separator = locale.TimeSeparator( KMPXMinSecSeparatorIndex ); |
|
261 pos = KMPXZeroDurationMark; |
|
262 pos.Append( separator ); |
|
263 pos += KMPXZeroDurationMark; |
|
264 |
|
265 UpdateLabelL( ETextElapsedTime, pos ); |
|
266 UpdateLabelL( ETextRemainingTime, pos ); |
|
267 } |
|
268 else |
|
269 { |
|
270 CMPXCommonUiHelper::TMPXDuratDisplayMode durationMode = |
|
271 CMPXCommonUiHelper::EMPXDuratAuto; |
|
272 if ( aTotalLengthInSeconds > KOneHourInSeconds ) |
|
273 { |
|
274 durationMode = CMPXCommonUiHelper::EMPXDuratHMS; |
|
275 } |
|
276 |
|
277 // Convert ellapsed time to texts |
|
278 HBufC* position = iCommonUiHelper->DisplayableDurationL( |
|
279 aPlaybackPosInSeconds, |
|
280 durationMode ); |
|
281 CleanupStack::PushL( position ); |
|
282 |
|
283 TInt remainingTime = aTotalLengthInSeconds - aPlaybackPosInSeconds; |
|
284 if ( remainingTime < 0 ) |
|
285 { |
|
286 // Convert all negative value to zero |
|
287 remainingTime = 0; |
|
288 } |
|
289 |
|
290 // Convert remaining time to texts |
|
291 HBufC* remaining = iCommonUiHelper->DisplayableDurationL( |
|
292 remainingTime, |
|
293 durationMode ); |
|
294 CleanupStack::PushL( remaining ); |
|
295 |
|
296 UpdateLabelL( ETextElapsedTime, *position ); |
|
297 UpdateLabelL( ETextRemainingTime, *remaining ); |
|
298 |
|
299 CleanupStack::PopAndDestroy( remaining ); |
|
300 CleanupStack::PopAndDestroy( position ); |
|
301 } |
|
302 |
|
303 if ( ( iMode != EUninitialized ) |
|
304 || ( iMode == EPlayMode || iMode == EPauseMode ) ) |
|
305 { |
|
306 if ( aTotalLengthInSeconds ) |
|
307 { |
|
308 TReal t = aTotalLengthInSeconds; |
|
309 iPlaybackRatio = aPlaybackPosInSeconds / t; |
|
310 } |
|
311 RefreshProgressBar(); |
|
312 } |
|
313 } |
|
314 } |
|
315 |
|
316 // --------------------------------------------------------------------------- |
|
317 // Updates label |
|
318 // --------------------------------------------------------------------------- |
|
319 // |
|
320 EXPORT_C void CMPXCommonPlaybackViewContainer::UpdateLabelL( |
|
321 TMPXPbvTextIndicator aLabel, |
|
322 const TDesC& aText ) |
|
323 { |
|
324 ASSERT( aLabel >= 0 && aLabel < iLabels.Count() ); |
|
325 CMPXPlaybackViewInfoLabel* label = iLabels[aLabel]; |
|
326 if(aLabel == ETextDownloadState) |
|
327 { |
|
328 iSliderPaneRect = iLayout->IndicatorLayout( Rect(), ESliderPane ); |
|
329 iLayout->LayoutLabel( |
|
330 iLabels[ETextDownloadState], iSliderPaneRect, ETextDownloadState ); |
|
331 |
|
332 MAknsSkinInstance* skin = AknsUtils::SkinInstance(); |
|
333 TRgb color = KRgbBlack; |
|
334 |
|
335 AknsUtils::GetCachedColor( |
|
336 skin, |
|
337 color, |
|
338 KAknsIIDQsnTextColors, |
|
339 EAknsCIQsnTextColorsCG50 ); |
|
340 |
|
341 AknLayoutUtils::OverrideControlColorL( |
|
342 *iLabels[ETextDownloadState], |
|
343 EColorLabelText, |
|
344 color ); |
|
345 } |
|
346 if ( label ) |
|
347 { |
|
348 TBool needRedraw = EFalse; |
|
349 |
|
350 if ( label->FullText() != aText ) |
|
351 { |
|
352 needRedraw = ETrue; |
|
353 label->SetLabelTextL( aText); |
|
354 } |
|
355 |
|
356 if ( needRedraw && label->IsVisible() ) |
|
357 { |
|
358 label->StartMarquee(); |
|
359 label->DrawDeferred(); |
|
360 } |
|
361 } |
|
362 } |
|
363 |
|
364 // --------------------------------------------------------------------------- |
|
365 // Sets main pane mode. |
|
366 // --------------------------------------------------------------------------- |
|
367 // |
|
368 EXPORT_C void CMPXCommonPlaybackViewContainer::SetMode( TMPXPbvPlaybackMode aMode ) |
|
369 { |
|
370 iMode = aMode; |
|
371 iDisplayAlbumArt = ETrue; |
|
372 |
|
373 switch ( iMode ) |
|
374 { |
|
375 case EUninitialized: |
|
376 { |
|
377 // Set label visibility |
|
378 iLabels[ETextDownloadState]->MakeVisible( ETrue ); |
|
379 iLabels[ETextArtist]->MakeVisible( ETrue ); |
|
380 iLabels[ETextTrack]->MakeVisible( ETrue ); |
|
381 //iLabels[ETextEmpty]->MakeVisible( EFalse ); |
|
382 iLabels[ETextElapsedTime]->MakeVisible( ETrue && iPrerollCompleted); |
|
383 iLabels[ETextRemainingTime]->MakeVisible( ETrue && iPrerollCompleted); |
|
384 break; |
|
385 } |
|
386 case ENoTracksMode: |
|
387 { |
|
388 // Set label visibility |
|
389 iLabels[ETextDownloadState]->MakeVisible( ETrue ); |
|
390 iLabels[ETextArtist]->MakeVisible( EFalse ); |
|
391 iLabels[ETextTrack]->MakeVisible( EFalse ); |
|
392 //iLabels[ETextEmpty]->MakeVisible( ETrue ); |
|
393 iLabels[ETextElapsedTime]->MakeVisible( ETrue && iPrerollCompleted); |
|
394 iLabels[ETextRemainingTime]->MakeVisible( ETrue && iPrerollCompleted); |
|
395 iDisplayAlbumArt = EFalse; |
|
396 break; |
|
397 } |
|
398 case EStopMode: |
|
399 { |
|
400 // Fixed the layout for Download label and time label are overlaped in position |
|
401 iLabels[ETextDownloadState]->MakeVisible( EFalse ); |
|
402 iLabels[ETextTrack]->MakeVisible( ETrue ); |
|
403 iLabels[ETextArtist]->MakeVisible( ETrue ); |
|
404 //iLabels[ETextEmpty]->MakeVisible( EFalse ); |
|
405 iLabels[ETextElapsedTime]->MakeVisible( ETrue && iPrerollCompleted); |
|
406 iLabels[ETextRemainingTime]->MakeVisible( ETrue && iPrerollCompleted); |
|
407 break; |
|
408 } |
|
409 case EInitialising: |
|
410 { |
|
411 iLabels[ETextDownloadState]->MakeVisible( ETrue ); |
|
412 iLabels[ETextTrack]->MakeVisible( ETrue ); |
|
413 iLabels[ETextArtist]->MakeVisible( ETrue ); |
|
414 //iLabels[ETextEmpty]->MakeVisible( EFalse ); |
|
415 iLabels[ETextElapsedTime]->MakeVisible( ETrue && iPrerollCompleted); |
|
416 iLabels[ETextRemainingTime]->MakeVisible( ETrue && iPrerollCompleted); |
|
417 break; |
|
418 } |
|
419 case EMediaKeySkipping: |
|
420 { |
|
421 iLabels[ETextDownloadState]->MakeVisible( ETrue ); |
|
422 iLabels[ETextTrack]->MakeVisible( ETrue ); |
|
423 iLabels[ETextArtist]->MakeVisible( ETrue ); |
|
424 //iLabels[ETextEmpty]->MakeVisible( EFalse ); |
|
425 iLabels[ETextElapsedTime]->MakeVisible( ETrue && iPrerollCompleted); |
|
426 iLabels[ETextRemainingTime]->MakeVisible( ETrue && iPrerollCompleted); |
|
427 break; |
|
428 } |
|
429 case EInvalidMode: |
|
430 { |
|
431 iLabels[ETextDownloadState]->MakeVisible( EFalse ); |
|
432 iLabels[ETextTrack]->MakeVisible( EFalse ); |
|
433 iLabels[ETextArtist]->MakeVisible( EFalse ); |
|
434 //iLabels[ETextEmpty]->MakeVisible( EFalse ); |
|
435 iLabels[ETextElapsedTime]->MakeVisible( ETrue && iPrerollCompleted); |
|
436 iLabels[ETextRemainingTime]->MakeVisible( ETrue && iPrerollCompleted); |
|
437 |
|
438 break; |
|
439 } |
|
440 case EBufferingMode: |
|
441 { |
|
442 // Set label visibility |
|
443 iLabels[ETextDownloadState]->MakeVisible( EFalse ); |
|
444 iLabels[ETextArtist]->MakeVisible( ETrue ); |
|
445 iLabels[ETextTrack]->MakeVisible( ETrue ); |
|
446 //iLabels[ETextEmpty]->MakeVisible( EFalse ); |
|
447 iLabels[ETextElapsedTime]->MakeVisible( ETrue && iPrerollCompleted); |
|
448 iLabels[ETextRemainingTime]->MakeVisible( ETrue && iPrerollCompleted); |
|
449 break; |
|
450 } |
|
451 default: |
|
452 { |
|
453 // Set label visibility |
|
454 iLabels[ETextDownloadState]->MakeVisible( EFalse ); |
|
455 iLabels[ETextArtist]->MakeVisible( ETrue ); |
|
456 iLabels[ETextTrack]->MakeVisible( ETrue ); |
|
457 //iLabels[ETextEmpty]->MakeVisible( EFalse ); |
|
458 iLabels[ETextElapsedTime]->MakeVisible( ETrue && iPrerollCompleted); |
|
459 iLabels[ETextRemainingTime]->MakeVisible( ETrue && iPrerollCompleted); |
|
460 break; |
|
461 } |
|
462 } |
|
463 |
|
464 if ( iMode == EPlayMode ) |
|
465 { |
|
466 iLabels[ETextArtist]->StartMarquee(); |
|
467 iLabels[ETextTrack]->StartMarquee(); |
|
468 } |
|
469 else |
|
470 { |
|
471 iLabels[ETextArtist]->StopMarquee(); |
|
472 iLabels[ETextTrack]->StopMarquee(); |
|
473 } |
|
474 DrawDeferred(); |
|
475 } |
|
476 |
|
477 // --------------------------------------------------------------------------- |
|
478 // Set random mode. |
|
479 // --------------------------------------------------------------------------- |
|
480 // |
|
481 EXPORT_C void CMPXCommonPlaybackViewContainer::SetRandomMode( TBool aRandomMode ) |
|
482 { |
|
483 iRandomMode = aRandomMode; |
|
484 Window().Invalidate( iRandomIconRect ); |
|
485 } |
|
486 |
|
487 // --------------------------------------------------------------------------- |
|
488 // Set repeat mode. |
|
489 // --------------------------------------------------------------------------- |
|
490 // |
|
491 EXPORT_C void CMPXCommonPlaybackViewContainer::SetRepeatMode( |
|
492 TBool aRepeatAll, |
|
493 TBool aRepeatOne ) |
|
494 { |
|
495 iRepeatAllMode = aRepeatAll; |
|
496 iRepeatOneMode = aRepeatOne; |
|
497 Window().Invalidate( iRepeatIconRect ); |
|
498 } |
|
499 |
|
500 // --------------------------------------------------------------------------- |
|
501 // Set RealPlayer mode. |
|
502 // --------------------------------------------------------------------------- |
|
503 // |
|
504 EXPORT_C void CMPXCommonPlaybackViewContainer::SetRealAudioMode( |
|
505 TBool aRealAudioMode ) |
|
506 { |
|
507 #ifdef RD_RA_SUPPORT_FOR_MUSIC_PLAYER |
|
508 iRealAudioMode = aRealAudioMode; |
|
509 Window().Invalidate( iRealIconRect ); |
|
510 #else |
|
511 (void) aRealAudioMode; |
|
512 ASSERT( 0 ); |
|
513 #endif |
|
514 } |
|
515 |
|
516 // ----------------------------------------------------------------------------- |
|
517 // CMPXCommonPlaybackViewContainer::UpdateButtons |
|
518 // ----------------------------------------------------------------------------- |
|
519 // |
|
520 EXPORT_C void CMPXCommonPlaybackViewContainer::UpdateButtons( |
|
521 TMPXPlaybackState aState ) |
|
522 { |
|
523 if ( iEnableButtons ) |
|
524 { |
|
525 iButtonManager->UpdateButtonStates( aState ); |
|
526 DrawDeferred(); |
|
527 } |
|
528 } |
|
529 |
|
530 // --------------------------------------------------------------------------- |
|
531 // Set layout for all elements and set sizes for icons. |
|
532 // --------------------------------------------------------------------------- |
|
533 // |
|
534 EXPORT_C void CMPXCommonPlaybackViewContainer::UpdateLayout() |
|
535 { |
|
536 MPX_FUNC( "CMPXCommonPlaybackViewContainer::UpdateLayout" ); |
|
537 TRAP_IGNORE( DoUpdateLayoutL() ); |
|
538 } |
|
539 |
|
540 // --------------------------------------------------------------------------- |
|
541 // Updates duration label. |
|
542 // --------------------------------------------------------------------------- |
|
543 // |
|
544 EXPORT_C void CMPXCommonPlaybackViewContainer::UpdateDurationLabelL( |
|
545 TInt aTotalLengthInSeconds ) |
|
546 { |
|
547 HBufC* labelText( NULL ); |
|
548 HBufC* duration( NULL ); |
|
549 |
|
550 if ( aTotalLengthInSeconds == 0 ) |
|
551 { |
|
552 TLocale locale; |
|
553 TChar separator = locale.TimeSeparator( KMPXMinSecSeparatorIndex ); |
|
554 |
|
555 duration = HBufC::NewLC( KMPXTimeIndicatorLength ); |
|
556 TPtr durationTPtr( duration->Des() ); |
|
557 |
|
558 durationTPtr = KMPXZeroDurationMark; |
|
559 durationTPtr.Append( separator ); |
|
560 durationTPtr += KMPXZeroDurationMark; |
|
561 } |
|
562 else |
|
563 { |
|
564 // Convert track duration to text |
|
565 duration = iCommonUiHelper->DisplayableDurationL( |
|
566 aTotalLengthInSeconds ); |
|
567 CleanupStack::PushL( duration ); |
|
568 } |
|
569 |
|
570 labelText = StringLoader::LoadLC( |
|
571 R_MPX_PBV_TRACK_DURATION_FORMAT, |
|
572 *duration ); |
|
573 |
|
574 CleanupStack::PopAndDestroy( labelText ); |
|
575 CleanupStack::PopAndDestroy( duration ); |
|
576 } |
|
577 |
|
578 // --------------------------------------------------------------------------- |
|
579 // Force softkey label colors to what is specified in skin |
|
580 // for Music Player soft keys. |
|
581 // --------------------------------------------------------------------------- |
|
582 // |
|
583 EXPORT_C void CMPXCommonPlaybackViewContainer::UpdateSoftkeyColors() |
|
584 { |
|
585 CEikButtonGroupContainer* cbgc = CEikButtonGroupContainer::Current(); |
|
586 MEikButtonGroup* bg = NULL; |
|
587 if ( cbgc ) |
|
588 { |
|
589 bg = cbgc->ButtonGroup(); |
|
590 } |
|
591 |
|
592 if ( bg ) |
|
593 { |
|
594 MAknsSkinInstance* skin = AknsUtils::SkinInstance(); |
|
595 |
|
596 TRgb color = KRgbBlack; |
|
597 CCoeControl* lsk = cbgc->ControlOrNull( |
|
598 bg->CommandId( KMPXCbaLeftSoftkeyPos ) ); |
|
599 if ( lsk ) |
|
600 { |
|
601 // Color is not updated if it not found from the skin |
|
602 if (!AknsUtils::GetCachedColor( |
|
603 skin, color, KAknsIIDQsnTextColors, |
|
604 EAknsCIQsnTextColorsCG47 ) ) |
|
605 { |
|
606 TRAP_IGNORE( |
|
607 AknLayoutUtils::OverrideControlColorL( *lsk, |
|
608 EColorLabelText, |
|
609 color ) ); |
|
610 } |
|
611 } |
|
612 |
|
613 CCoeControl* rsk = cbgc->ControlOrNull( |
|
614 bg->CommandId( KMPXCbaRightSoftkeyPos ) ); |
|
615 if ( rsk ) |
|
616 { |
|
617 // Color is not updated if it not found from the skin |
|
618 if ( !AknsUtils::GetCachedColor( |
|
619 skin, color, KAknsIIDQsnTextColors, |
|
620 EAknsCIQsnTextColorsCG46 ) ) |
|
621 { |
|
622 TRAP_IGNORE( |
|
623 AknLayoutUtils::OverrideControlColorL( *rsk, |
|
624 EColorLabelText, |
|
625 color ) ); |
|
626 } |
|
627 } |
|
628 cbgc->DrawDeferred(); |
|
629 } |
|
630 } |
|
631 |
|
632 // --------------------------------------------------------------------------- |
|
633 // Handles foreground events |
|
634 // --------------------------------------------------------------------------- |
|
635 // |
|
636 EXPORT_C void CMPXCommonPlaybackViewContainer::HandleForegroundEventL( |
|
637 TBool aForeground ) |
|
638 { |
|
639 MPX_FUNC( "CMPXCommonPlaybackViewContainer::HandleForegroundEventL" ); |
|
640 if ( !aForeground && iEnableButtons ) |
|
641 { |
|
642 // if losing foreground and buttons are enabled |
|
643 iButtonManager->HandleForegroundLostL(); |
|
644 } |
|
645 |
|
646 if ( !aForeground && iTouchDown ) |
|
647 { |
|
648 // Pointer events |
|
649 SetGloballyCapturing( EFalse ); |
|
650 SetPointerCapture( EFalse ); |
|
651 |
|
652 iTouchDown = EFalse; |
|
653 } |
|
654 |
|
655 // Special case: if going to background but still partially visible |
|
656 if( iActiveView && !aForeground ) |
|
657 { |
|
658 CAknAppUi* appUi = (CAknAppUi*)CEikonEnv::Static()->AppUi(); |
|
659 if( !appUi->IsFaded() ) |
|
660 { |
|
661 iActiveView = EFalse; |
|
662 } |
|
663 } |
|
664 else |
|
665 { |
|
666 iActiveView = aForeground; |
|
667 } |
|
668 |
|
669 RefreshProgressBar(); |
|
670 } |
|
671 |
|
672 // --------------------------------------------------------------------------- |
|
673 // From MMPXAlbumArtUtilObserver |
|
674 // Notify that extraction of album art started. |
|
675 // --------------------------------------------------------------------------- |
|
676 // |
|
677 EXPORT_C void CMPXCommonPlaybackViewContainer::ExtractAlbumArtStarted() |
|
678 { |
|
679 MPX_DEBUG1("CMPXCommonPlaybackViewContainer::ExtractAlbumArtStarted(): Entering"); |
|
680 |
|
681 MPX_DEBUG1("CMPXCommonPlaybackViewContainer::ExtractAlbumArtStarted(): Exiting"); |
|
682 } |
|
683 |
|
684 |
|
685 // --------------------------------------------------------------------------- |
|
686 // From MMPXAlbumArtUtilObserver |
|
687 // Album art is extracted from file and ready to use. |
|
688 // --------------------------------------------------------------------------- |
|
689 // |
|
690 EXPORT_C void CMPXCommonPlaybackViewContainer::ExtractAlbumArtCompleted( |
|
691 CFbsBitmap* aBitmap, |
|
692 TInt aErr ) |
|
693 { |
|
694 // Here we are making the assumption that if we get an update on album |
|
695 // art, it is Ok to Start displaying the items. |
|
696 iLabels[ETextTrack]->MakeVisible( ETrue ); |
|
697 iLabels[ETextArtist]->MakeVisible( ETrue ); |
|
698 iLabels[ETextElapsedTime]->MakeVisible( ETrue); |
|
699 iLabels[ETextRemainingTime]->MakeVisible( ETrue); |
|
700 iPrerollCompleted = ETrue; |
|
701 |
|
702 MPX_DEBUG3( "CMPXCommonPlaybackViewContainer::ExtractAlbumArtCompleted(bitmap:0x%x, err:%d)", |
|
703 aBitmap, aErr ); |
|
704 |
|
705 delete iTrackAlbumArt; |
|
706 iTrackAlbumArt = NULL; |
|
707 |
|
708 if ( aBitmap && KErrNone == aErr ) |
|
709 { |
|
710 iTrackAlbumArt = aBitmap; |
|
711 } |
|
712 |
|
713 DrawDeferred(); |
|
714 //Window().Invalidate( iAlbumArtRect ); |
|
715 //Window().Invalidate( iSliderPaneRect ); |
|
716 } |
|
717 |
|
718 // --------------------------------------------------------------------------- |
|
719 // From CCoeControl |
|
720 // Handles key events. |
|
721 // --------------------------------------------------------------------------- |
|
722 // |
|
723 EXPORT_C TKeyResponse CMPXCommonPlaybackViewContainer::OfferKeyEventL( |
|
724 const TKeyEvent& aKeyEvent, |
|
725 TEventCode aType ) |
|
726 { |
|
727 MPX_DEBUG4( "CMPXCommonPlaybackViewContainer::OfferKeyEventL(iCode=%d, iScanCode=%d, aType=%d)", |
|
728 aKeyEvent.iCode, aKeyEvent.iScanCode, aType ); |
|
729 |
|
730 TKeyResponse response = EKeyWasNotConsumed; |
|
731 |
|
732 if ( iEnableButtons ) |
|
733 { |
|
734 response = iButtonManager->OfferKeyEventL( aKeyEvent, aType ); |
|
735 if ( response == EKeyWasConsumed ) |
|
736 { |
|
737 CWindowGc& gc = SystemGc(); |
|
738 gc.Activate( *DrawableWindow() ); |
|
739 // iButtonManager->RedrawIfNeeded(gc); |
|
740 gc.Deactivate(); |
|
741 } |
|
742 } |
|
743 |
|
744 if ( response == EKeyWasNotConsumed ) |
|
745 { |
|
746 // TODO |
|
747 /* |
|
748 if ( aKeyEvent.iCode == EKeyLeftArrow && !FeatureManager::FeatureSupported( |
|
749 KFeatureIdSideVolumeKeys )) |
|
750 { |
|
751 iCommandObserver->ProcessCommandL( EMPlayerCmdDecreaseVolume) ; |
|
752 response = EKeyWasConsumed; |
|
753 } |
|
754 else if ( aKeyEvent.iCode == EKeyRightArrow && !FeatureManager::FeatureSupported( |
|
755 KFeatureIdSideVolumeKeys )) |
|
756 { |
|
757 iCommandObserver->ProcessCommandL( EMPlayerCmdIncreaseVolume ); |
|
758 response = EKeyWasConsumed; |
|
759 } |
|
760 else |
|
761 { |
|
762 // Do nothing |
|
763 } |
|
764 */ |
|
765 } |
|
766 |
|
767 return response; |
|
768 } |
|
769 |
|
770 // --------------------------------------------------------------------------- |
|
771 // From CCoeControl |
|
772 // Handles a change to the control's resources. |
|
773 // --------------------------------------------------------------------------- |
|
774 // |
|
775 EXPORT_C void CMPXCommonPlaybackViewContainer::HandleResourceChange( TInt aType ) |
|
776 { |
|
777 CCoeControl::HandleResourceChange( aType ); |
|
778 |
|
779 if ( aType == KAknsMessageSkinChange ) |
|
780 { |
|
781 iRefreshBackBuffer = ETrue; |
|
782 // Reload icons |
|
783 TRAP_IGNORE( |
|
784 { |
|
785 CreateIconsL(); |
|
786 } ); |
|
787 |
|
788 // Make sure execute layout again |
|
789 iCurrentLayout = TRect(); |
|
790 UpdateLayout(); // To make sure AknIconUtils::SetSize() gets called |
|
791 } |
|
792 else if ( aType == KEikDynamicLayoutVariantSwitch ) |
|
793 { |
|
794 iLayoutObserver->HandleLayoutChange(); |
|
795 UpdateBackgroundSkinControlContext( Rect() ); |
|
796 |
|
797 // recreate background image |
|
798 TRAP_IGNORE( CreateBackgroundImagesL() ); |
|
799 } |
|
800 else |
|
801 { |
|
802 // pass |
|
803 } |
|
804 } |
|
805 |
|
806 // --------------------------------------------------------------------------- |
|
807 // From CCoeControl |
|
808 // Gets the control's help context. |
|
809 // --------------------------------------------------------------------------- |
|
810 // |
|
811 EXPORT_C void CMPXCommonPlaybackViewContainer::GetHelpContext( |
|
812 TCoeHelpContext& aContext ) const |
|
813 { |
|
814 aContext.iMajor = KAppUidMusicPlayerX; |
|
815 /* |
|
816 if ( iIsEmbedded ) |
|
817 { |
|
818 // TODO: Handle for embedded mode |
|
819 aContext.iContext = KMUS_HLP_PLAYBACK_VIEW; |
|
820 } |
|
821 else |
|
822 { |
|
823 aContext.iContext = KMUS_HLP_PLAYBACK_VIEW; |
|
824 } |
|
825 */ |
|
826 } |
|
827 |
|
828 // --------------------------------------------------------------------------- |
|
829 // Starts marquee for a playback label |
|
830 // --------------------------------------------------------------------------- |
|
831 // |
|
832 EXPORT_C void CMPXCommonPlaybackViewContainer::StartMarquee( |
|
833 TMPXPbvTextIndicator aLabel ) |
|
834 { |
|
835 MPX_FUNC( "CMPXCommonPlaybackViewContainer::StartMarquee" ); |
|
836 ASSERT( aLabel >= 0 && aLabel < iLabels.Count() ); |
|
837 CMPXPlaybackViewInfoLabel* label = iLabels[aLabel]; |
|
838 if ( label ) |
|
839 { |
|
840 if ( label->IsVisible() ) |
|
841 { |
|
842 label->StartMarquee(); |
|
843 label->DrawDeferred(); |
|
844 } |
|
845 } |
|
846 } |
|
847 |
|
848 // --------------------------------------------------------------------------- |
|
849 // Creates background images |
|
850 // --------------------------------------------------------------------------- |
|
851 // |
|
852 EXPORT_C void CMPXCommonPlaybackViewContainer::CreateBackgroundImagesL() |
|
853 { |
|
854 |
|
855 CWindowGc& gc( SystemGc() ); |
|
856 CGraphicsDevice* device( gc.Device() ); |
|
857 TSize size( device->SizeInPixels() ); |
|
858 TDisplayMode mode( device->DisplayMode() ); |
|
859 |
|
860 if( iOffScreenBitmap && |
|
861 size == iOffScreenBitmap->SizeInPixels() && |
|
862 mode == iOffScreenBitmap->DisplayMode() ) |
|
863 { |
|
864 // No need to update backbuffer |
|
865 return; |
|
866 } |
|
867 |
|
868 delete iOffScreenBitmap; |
|
869 iOffScreenBitmap = NULL; |
|
870 delete iOSBitmapContext; |
|
871 iOSBitmapContext = NULL; |
|
872 delete iOSBitmapDevice; |
|
873 iOSBitmapDevice = NULL; |
|
874 |
|
875 iOffScreenBitmap = new (ELeave) CFbsBitmap(); |
|
876 TInt err( iOffScreenBitmap->Create( size, mode )); |
|
877 if ( KErrNone != err ) |
|
878 { |
|
879 delete iOffScreenBitmap; |
|
880 iOffScreenBitmap = NULL; |
|
881 User::Leave( err ); |
|
882 } |
|
883 |
|
884 iOSBitmapDevice = CFbsBitmapDevice::NewL( iOffScreenBitmap ); |
|
885 err = iOSBitmapDevice->CreateContext( iOSBitmapContext ); |
|
886 if ( KErrNone != err ) |
|
887 { |
|
888 delete iOSBitmapDevice; |
|
889 iOSBitmapDevice = NULL; |
|
890 User::Leave( err ); |
|
891 } |
|
892 iRefreshBackBuffer = ETrue; |
|
893 } |
|
894 |
|
895 // --------------------------------------------------------------------------- |
|
896 // Creates labels. |
|
897 // --------------------------------------------------------------------------- |
|
898 // |
|
899 EXPORT_C void CMPXCommonPlaybackViewContainer::CreateLabelsL() |
|
900 { |
|
901 CMPXPlaybackViewInfoLabel* label = NULL; |
|
902 |
|
903 for ( TInt index = 0; index < KLabelCount; ++index ) |
|
904 { |
|
905 label = new ( ELeave ) CMPXPlaybackViewInfoLabel(); |
|
906 CleanupStack::PushL( label ); |
|
907 label->SetContainerWindowL( *this ); |
|
908 label->SetTextL( KNullDesC ); |
|
909 label->ConstructL( |
|
910 iEnableMarquee && ( index == ETextTrack ) ); |
|
911 |
|
912 label->SetBackground( iBackground ); |
|
913 User::LeaveIfError( iLabels.Append( label ) ); |
|
914 CleanupStack::Pop( label ); |
|
915 } |
|
916 } |
|
917 |
|
918 // --------------------------------------------------------------------------- |
|
919 // Creates icons. |
|
920 // --------------------------------------------------------------------------- |
|
921 // |
|
922 EXPORT_C void CMPXCommonPlaybackViewContainer::CreateIconsL() |
|
923 { |
|
924 FreeIcons(); |
|
925 |
|
926 // Play/stop/pause icons |
|
927 iPlayIcon = |
|
928 iLayout->GetIndicatorIconMaskL( EIconPlay ); |
|
929 iPauseIcon = |
|
930 iLayout->GetIndicatorIconMaskL(EIconPause ); |
|
931 |
|
932 // Repeat, random, etc |
|
933 iRepeatAllIcon = |
|
934 iLayout->GetIndicatorIconMaskL( EIconRepeatAll ); |
|
935 iRepeatOneIcon = |
|
936 iLayout->GetIndicatorIconMaskL( EIconRepeatOne ); |
|
937 iRandomIcon = |
|
938 iLayout->GetIndicatorIconMaskL( EIconRandom ); |
|
939 #ifdef RD_RA_SUPPORT_FOR_MUSIC_PLAYER |
|
940 iRealIcon = |
|
941 iLayout->GetIndicatorIconMaskL( EIconReal ); |
|
942 #endif |
|
943 |
|
944 // Download slider |
|
945 iDownloadSlider = iLayout->GetIndicatorIconMaskL( |
|
946 EDownloadSlider ); |
|
947 iPlaybackSlider = iLayout->GetIndicatorIconMaskL( |
|
948 EPlaybackSlider ); |
|
949 iSliderBackground = iLayout->GetIndicatorIconMaskL( |
|
950 ESliderBackground ); |
|
951 |
|
952 // Default album art |
|
953 iDefaultAlbumArt = iLayout->GetIndicatorIconMaskL( |
|
954 EAlbumArtArea ); |
|
955 } |
|
956 |
|
957 // --------------------------------------------------------------------------- |
|
958 // Deletes all icon objects. |
|
959 // --------------------------------------------------------------------------- |
|
960 // |
|
961 EXPORT_C void CMPXCommonPlaybackViewContainer::FreeIcons() |
|
962 { |
|
963 delete iPauseIcon; |
|
964 iPauseIcon = NULL; |
|
965 delete iPlayIcon; |
|
966 iPlayIcon = NULL; |
|
967 delete iRandomIcon; |
|
968 iRandomIcon = NULL; |
|
969 delete iRepeatOneIcon; |
|
970 iRepeatOneIcon = NULL; |
|
971 delete iRepeatAllIcon; |
|
972 iRepeatAllIcon = NULL; |
|
973 delete iDownloadSlider; |
|
974 iDownloadSlider = NULL; |
|
975 delete iPlaybackSlider; |
|
976 iPlaybackSlider = NULL; |
|
977 delete iSliderBackground; |
|
978 iSliderBackground = NULL; |
|
979 delete iDefaultAlbumArt; |
|
980 iDefaultAlbumArt = NULL; |
|
981 #ifdef RD_RA_SUPPORT_FOR_MUSIC_PLAYER |
|
982 delete iRealIcon; |
|
983 iRealIcon = NULL; |
|
984 #endif |
|
985 } |
|
986 |
|
987 // --------------------------------------------------------------------------- |
|
988 // Draw an icon |
|
989 // --------------------------------------------------------------------------- |
|
990 // |
|
991 EXPORT_C void CMPXCommonPlaybackViewContainer::DrawIndicator( |
|
992 CBitmapContext& aGc, |
|
993 const TRect& aDirtyRect, |
|
994 const TRect& aIndicatorRect, |
|
995 const CGulIcon* aIcon, |
|
996 TBool aInvertMask ) const |
|
997 { |
|
998 if ( aIcon && aIndicatorRect.Intersects( aDirtyRect ) ) |
|
999 { |
|
1000 aGc.BitBltMasked( |
|
1001 aIndicatorRect.iTl, |
|
1002 aIcon->Bitmap(), |
|
1003 TRect( aIndicatorRect.Size() ), |
|
1004 aIcon->Mask(), |
|
1005 aInvertMask ); |
|
1006 } |
|
1007 } |
|
1008 |
|
1009 // --------------------------------------------------------------------------- |
|
1010 // Redraw part of the screen. |
|
1011 // --------------------------------------------------------------------------- |
|
1012 // |
|
1013 EXPORT_C void CMPXCommonPlaybackViewContainer::RedrawRect( |
|
1014 const TRect& aRect, |
|
1015 CBitmapContext& aGc) const |
|
1016 { |
|
1017 MAknsSkinInstance* skin = AknsUtils::SkinInstance(); |
|
1018 AknsDrawUtils::DrawBackground( |
|
1019 skin, |
|
1020 iBackground, |
|
1021 this, |
|
1022 aGc, |
|
1023 aRect.iTl, |
|
1024 aRect, |
|
1025 KAknsDrawParamDefault ); |
|
1026 |
|
1027 |
|
1028 TBool embedded = iEikonEnv->StartedAsServerApp(); |
|
1029 |
|
1030 if ( iPrerollCompleted ) |
|
1031 { |
|
1032 if ( iRepeatAllMode && !embedded ) |
|
1033 { |
|
1034 DrawIndicator( aGc, aRect, iRepeatIconRect, iRepeatAllIcon ); |
|
1035 } |
|
1036 |
|
1037 if ( iRepeatOneMode && !embedded ) |
|
1038 { |
|
1039 DrawIndicator(aGc, aRect, iRepeatIconRect, iRepeatOneIcon); |
|
1040 } |
|
1041 |
|
1042 if ( iRandomMode && !embedded ) |
|
1043 { |
|
1044 DrawIndicator(aGc, aRect, iRandomIconRect, iRandomIcon); |
|
1045 } |
|
1046 |
|
1047 #ifdef RD_RA_SUPPORT_FOR_MUSIC_PLAYER |
|
1048 if ( iRealAudioMode ) |
|
1049 { |
|
1050 DrawIndicator( aGc, aRect, iRealIconRect, iRealIcon ); |
|
1051 } |
|
1052 #endif |
|
1053 |
|
1054 DrawIndicator( aGc, aRect, iSliderBackgroundRect, iSliderBackground ); |
|
1055 if ( iMode == EPlayMode || iMode == EPauseMode ) |
|
1056 { |
|
1057 |
|
1058 DrawIndicator( aGc, aRect, TRect(iDownloadSliderRect.iTl, |
|
1059 iDownloadSlider->Bitmap()->SizeInPixels()), |
|
1060 iDownloadSlider ); |
|
1061 DrawIndicator(aGc, aRect, TRect(iPlaybackSliderRect.iTl, |
|
1062 iPlaybackSlider->Bitmap()->SizeInPixels() ), |
|
1063 iPlaybackSlider ); |
|
1064 } |
|
1065 |
|
1066 if ( iDisplayAlbumArt && aRect.Intersects( iAlbumArtRect ) ) |
|
1067 { |
|
1068 if ( iTrackAlbumArt ) |
|
1069 { |
|
1070 // Calculating the CenterPoint for Drawing the albumart image |
|
1071 TSize bmpSizeInPixels = iTrackAlbumArt->SizeInPixels(); |
|
1072 TInt xPos = ( iAlbumArtRect.Width() - bmpSizeInPixels.iWidth ) |
|
1073 / 2; |
|
1074 TInt yPos = |
|
1075 ( iAlbumArtRect.Height() - bmpSizeInPixels.iHeight ) |
|
1076 / 2; |
|
1077 TPoint Centerpos = TPoint(xPos, yPos ); |
|
1078 // bitmap top left corner position |
|
1079 Centerpos += iAlbumArtRect.iTl; |
|
1080 |
|
1081 // Draw album art and frame |
|
1082 aGc.BitBlt( Centerpos, iTrackAlbumArt); |
|
1083 TRgb color = KRgbBlack; |
|
1084 AknsUtils::GetCachedColor( skin, color, KAknsIIDQsnTextColors, |
|
1085 EAknsCIQsnTextColorsCG50 ); |
|
1086 TRect imageRect( Centerpos, iTrackAlbumArt->SizeInPixels() ); |
|
1087 aGc.SetPenStyle( CGraphicsContext::ESolidPen ); |
|
1088 aGc.SetBrushStyle( CGraphicsContext::ENullBrush ); |
|
1089 aGc.SetPenColor( color ); |
|
1090 aGc.DrawRect( imageRect ); |
|
1091 } |
|
1092 else |
|
1093 { |
|
1094 DrawIndicator( aGc, aRect, iAlbumArtRect, iDefaultAlbumArt ); |
|
1095 } |
|
1096 } |
|
1097 } |
|
1098 } |
|
1099 |
|
1100 // --------------------------------------------------------------------------- |
|
1101 // Update progress bar graphics based on current playback |
|
1102 // and download position. |
|
1103 // --------------------------------------------------------------------------- |
|
1104 // |
|
1105 EXPORT_C void CMPXCommonPlaybackViewContainer::UpdateProgressBarGraphics() |
|
1106 { |
|
1107 TSize downloadBarSize = iDownloadSliderRect.Size(); |
|
1108 TSize playbackBarSize = iPlaybackSliderRect.Size(); |
|
1109 |
|
1110 downloadBarSize.iWidth *= iDownloadRatio; |
|
1111 playbackBarSize.iWidth *= iPlaybackRatio; |
|
1112 |
|
1113 AknIconUtils::SetSize( |
|
1114 iDownloadSlider->Bitmap(), |
|
1115 downloadBarSize, |
|
1116 EAspectRatioNotPreserved ); |
|
1117 AknIconUtils::SetSize( |
|
1118 iPlaybackSlider->Bitmap(), |
|
1119 playbackBarSize, |
|
1120 EAspectRatioNotPreserved ); |
|
1121 } |
|
1122 |
|
1123 // --------------------------------------------------------------------------- |
|
1124 // Update progress bar graphics and redraw. |
|
1125 // --------------------------------------------------------------------------- |
|
1126 // |
|
1127 EXPORT_C void CMPXCommonPlaybackViewContainer::RefreshProgressBar() |
|
1128 { |
|
1129 UpdateProgressBarGraphics(); |
|
1130 Window().Invalidate( iSliderPaneRect ); |
|
1131 } |
|
1132 |
|
1133 // --------------------------------------------------------------------------- |
|
1134 // Update label text color according to skin |
|
1135 // --------------------------------------------------------------------------- |
|
1136 // |
|
1137 EXPORT_C void CMPXCommonPlaybackViewContainer::UpdateLabelColorsL() |
|
1138 { |
|
1139 MAknsSkinInstance* skin = AknsUtils::SkinInstance(); |
|
1140 TRgb color = KRgbBlack; |
|
1141 // Color is not updated if it not found from the skin |
|
1142 AknsUtils::GetCachedColor( |
|
1143 skin, |
|
1144 color, |
|
1145 KAknsIIDQsnTextColors, |
|
1146 EAknsCIQsnTextColorsCG50 ); |
|
1147 |
|
1148 for ( TInt i = 0; i < iLabels.Count(); i++ ) |
|
1149 { |
|
1150 AknLayoutUtils::OverrideControlColorL( |
|
1151 *iLabels[i], |
|
1152 EColorLabelText, |
|
1153 color ); |
|
1154 } |
|
1155 } |
|
1156 |
|
1157 // --------------------------------------------------------------------------- |
|
1158 // Update skin control context for background |
|
1159 // --------------------------------------------------------------------------- |
|
1160 // |
|
1161 EXPORT_C void CMPXCommonPlaybackViewContainer::UpdateBackgroundSkinControlContext( |
|
1162 const TRect& aRect ) |
|
1163 { |
|
1164 CAknsBasicBackgroundControlContext* background = |
|
1165 static_cast<CAknsBasicBackgroundControlContext*>( iBackground ); |
|
1166 |
|
1167 if ( Layout_Meta_Data::IsLandscapeOrientation() ) |
|
1168 { |
|
1169 TAknWindowLineLayout screenLayout = |
|
1170 AknLayout::screen(); |
|
1171 TRect screenRect = screenLayout.Rect(); |
|
1172 background->SetBitmap( KAknsIIDQsnBgAreaMainMp ); |
|
1173 background->SetRect( screenRect ); |
|
1174 } |
|
1175 else |
|
1176 { |
|
1177 background->SetBitmap( KAknsIIDQsnBgAreaMainMp ); |
|
1178 background->SetRect( aRect ); |
|
1179 } |
|
1180 iRefreshBackBuffer = ETrue; |
|
1181 } |
|
1182 |
|
1183 // --------------------------------------------------------------------------- |
|
1184 // Set FMTX mode. |
|
1185 // FMTX label shouldn't appear in some playback views |
|
1186 // --------------------------------------------------------------------------- |
|
1187 // |
|
1188 EXPORT_C void CMPXCommonPlaybackViewContainer::SetFMTXMode( |
|
1189 TBool aFMTXMode ) |
|
1190 { |
|
1191 if ( FeatureManager::FeatureSupported( KFeatureIdFmtx ) ) |
|
1192 { |
|
1193 iFMTXMode = aFMTXMode; |
|
1194 } |
|
1195 } |
|
1196 |
|
1197 // --------------------------------------------------------------------------- |
|
1198 // From CCoeControl |
|
1199 // Responds to changes to the size and position of the contents of this |
|
1200 // control. |
|
1201 // --------------------------------------------------------------------------- |
|
1202 // |
|
1203 EXPORT_C void CMPXCommonPlaybackViewContainer::SizeChanged() |
|
1204 { |
|
1205 MPX_FUNC("CMPXCommonPlaybackViewContainer::SizeChanged()"); |
|
1206 UpdateLayout(); |
|
1207 UpdateSoftkeyColors(); |
|
1208 UpdateBackgroundSkinControlContext( Rect() ); |
|
1209 } |
|
1210 |
|
1211 // --------------------------------------------------------------------------- |
|
1212 // From CCoeControl |
|
1213 // Gets the number of controls contained in a compound control. |
|
1214 // --------------------------------------------------------------------------- |
|
1215 // |
|
1216 EXPORT_C TInt CMPXCommonPlaybackViewContainer::CountComponentControls() const |
|
1217 { |
|
1218 if(iPrerollCompleted) |
|
1219 { |
|
1220 return KLabelCount + 1; // ButtonManager |
|
1221 } |
|
1222 else |
|
1223 { |
|
1224 return 0; |
|
1225 } |
|
1226 } |
|
1227 // --------------------------------------------------------------------------- |
|
1228 // From CCoeControl |
|
1229 // Gets an indexed component of a compound control. |
|
1230 // --------------------------------------------------------------------------- |
|
1231 // |
|
1232 EXPORT_C CCoeControl* CMPXCommonPlaybackViewContainer::ComponentControl( TInt aIndex ) const |
|
1233 { |
|
1234 CCoeControl* control = NULL; |
|
1235 if(iPrerollCompleted) |
|
1236 { |
|
1237 if (aIndex < KLabelCount) |
|
1238 { |
|
1239 control = iLabels[aIndex]; |
|
1240 } |
|
1241 else |
|
1242 { |
|
1243 control = iButtonManager; |
|
1244 } |
|
1245 } |
|
1246 |
|
1247 return control; |
|
1248 } |
|
1249 |
|
1250 // --------------------------------------------------------------------------- |
|
1251 // From CCoeControl |
|
1252 // Draws the control. |
|
1253 // --------------------------------------------------------------------------- |
|
1254 // |
|
1255 EXPORT_C void CMPXCommonPlaybackViewContainer::Draw( const TRect& aRect ) const |
|
1256 { |
|
1257 if( iActiveView || iRefreshBackBuffer ) |
|
1258 { |
|
1259 if ( iOSBitmapContext ) |
|
1260 { |
|
1261 RedrawRect( aRect, *iOSBitmapContext ); |
|
1262 iRefreshBackBuffer = EFalse; |
|
1263 } |
|
1264 } |
|
1265 |
|
1266 // Draw off-screen bitmap to display |
|
1267 if ( iOffScreenBitmap ) |
|
1268 { |
|
1269 CWindowGc& gc = SystemGc(); |
|
1270 gc.BitBlt( TPoint(),iOffScreenBitmap ); |
|
1271 } |
|
1272 } |
|
1273 |
|
1274 // ----------------------------------------------------------------------------- |
|
1275 // CMPXCommonPlaybackViewContainer::HandleButtonCommandL |
|
1276 // ----------------------------------------------------------------------------- |
|
1277 // |
|
1278 EXPORT_C void CMPXCommonPlaybackViewContainer::HandleButtonCommandL( TInt aCommand ) |
|
1279 { |
|
1280 MPX_DEBUG2("CMPXCommonPlaybackViewContainer::HandleButtonCommandL(%d) entering", aCommand); |
|
1281 if ( iCommandObserver ) |
|
1282 { |
|
1283 iCommandObserver->ProcessCommandL( aCommand ); |
|
1284 } |
|
1285 MPX_DEBUG1("CMPXCommonPlaybackViewContainer::HandleButtonCommandL() exiting"); |
|
1286 } |
|
1287 |
|
1288 // --------------------------------------------------------------------------- |
|
1289 // CMPXCommonPlaybackViewContainer::HandlePointerEventL |
|
1290 // --------------------------------------------------------------------------- |
|
1291 // |
|
1292 EXPORT_C void CMPXCommonPlaybackViewContainer::HandlePointerEventL(const TPointerEvent& aPointerEvent) |
|
1293 { |
|
1294 MPX_DEBUG1( "CMPXCommonPlaybackViewContainer::HandlePointerEventL" ); |
|
1295 if(AknLayoutUtils::PenEnabled()) |
|
1296 { |
|
1297 TSize playbackBarSize = iPlaybackSliderRect.Size(); |
|
1298 TReal width; |
|
1299 switch( aPointerEvent.iType ) |
|
1300 { |
|
1301 case TPointerEvent::EButton1Down: |
|
1302 { |
|
1303 if ( iSliderPaneRect.Contains(aPointerEvent.iPosition) && |
|
1304 ( iMode == EPlayMode || iMode == EPauseMode )) |
|
1305 { |
|
1306 // Pointer events |
|
1307 SetGloballyCapturing( ETrue ); |
|
1308 SetPointerCapture( ETrue ); |
|
1309 |
|
1310 MPX_DEBUG1( "CMPXCommonPlaybackViewContainer::HandlePointerEventL btnDOWN" ); |
|
1311 iTouchDown = ETrue; |
|
1312 width = aPointerEvent.iPosition.iX - iSliderBackgroundRect.iTl.iX; |
|
1313 playbackBarSize.iWidth = width; |
|
1314 AknIconUtils::SetSize( |
|
1315 iPlaybackSlider->Bitmap(), |
|
1316 playbackBarSize, |
|
1317 EAspectRatioNotPreserved ); |
|
1318 } |
|
1319 if ( iAlbumArtRect.Contains(aPointerEvent.iPosition ) ) |
|
1320 { |
|
1321 MTouchFeedback* feedback = MTouchFeedback::Instance(); |
|
1322 if (feedback) |
|
1323 { |
|
1324 feedback->InstantFeedback(ETouchFeedbackBasic); |
|
1325 } |
|
1326 |
|
1327 if ( iCommandObserver ) |
|
1328 { |
|
1329 iCommandObserver->ProcessCommandL( EMPXCmdVolumeChanged ); |
|
1330 } |
|
1331 } |
|
1332 break; |
|
1333 } |
|
1334 |
|
1335 case TPointerEvent::EDrag: |
|
1336 { |
|
1337 if(iTouchDown && ( iMode == EPlayMode || iMode == EPauseMode ) ) |
|
1338 { |
|
1339 MPX_DEBUG1( "CMPXCommonPlaybackViewContainer::HandlePointerEventL ****btnDrag****" ); |
|
1340 |
|
1341 MTouchFeedback* feedback = MTouchFeedback::Instance(); |
|
1342 if (feedback) |
|
1343 { |
|
1344 feedback->InstantFeedback(ETouchFeedbackSensitive); |
|
1345 } |
|
1346 |
|
1347 if (aPointerEvent.iPosition.iX <= iSliderBackgroundRect.iTl.iX) |
|
1348 { |
|
1349 width = 0; |
|
1350 } |
|
1351 else if (aPointerEvent.iPosition.iX >= iSliderBackgroundRect.iBr.iX) |
|
1352 { |
|
1353 width = iSliderBackgroundRect.iBr.iX - iSliderBackgroundRect.iTl.iX; |
|
1354 } |
|
1355 else |
|
1356 { |
|
1357 width = aPointerEvent.iPosition.iX - iSliderBackgroundRect.iTl.iX; |
|
1358 } |
|
1359 |
|
1360 playbackBarSize.iWidth = width; |
|
1361 AknIconUtils::SetSize( |
|
1362 iPlaybackSlider->Bitmap(), |
|
1363 playbackBarSize, |
|
1364 EAspectRatioNotPreserved ); |
|
1365 |
|
1366 // Update the ellapsed and remaining time texts for user feedback |
|
1367 TReal totalWidth = iPlaybackSliderRect.Width(); |
|
1368 TReal ratio = width/totalWidth; |
|
1369 TInt newSongPositionInSec = ratio * iTrackTotalLengthInSeconds; |
|
1370 CMPXCommonUiHelper::TMPXDuratDisplayMode durationMode = |
|
1371 CMPXCommonUiHelper::EMPXDuratAuto; |
|
1372 if ( iTrackTotalLengthInSeconds > KOneHourInSeconds ) |
|
1373 { |
|
1374 durationMode = CMPXCommonUiHelper::EMPXDuratHMS; |
|
1375 } |
|
1376 |
|
1377 // Convert ellapsed time to text |
|
1378 HBufC* position = iCommonUiHelper->DisplayableDurationL( |
|
1379 newSongPositionInSec, |
|
1380 durationMode ); |
|
1381 CleanupStack::PushL( position ); |
|
1382 |
|
1383 TInt remainingTime = iTrackTotalLengthInSeconds - newSongPositionInSec; |
|
1384 if ( remainingTime < 0 ) |
|
1385 { |
|
1386 remainingTime = 0; |
|
1387 } |
|
1388 |
|
1389 // Convert remaining time to text |
|
1390 HBufC* remaining = iCommonUiHelper->DisplayableDurationL( |
|
1391 remainingTime, |
|
1392 durationMode ); |
|
1393 CleanupStack::PushL( remaining ); |
|
1394 |
|
1395 UpdateLabelL( ETextElapsedTime, *position ); |
|
1396 UpdateLabelL( ETextRemainingTime, *remaining ); |
|
1397 CleanupStack::PopAndDestroy( remaining ); |
|
1398 CleanupStack::PopAndDestroy( position ); |
|
1399 |
|
1400 // Invalidate rect so it will be redrawn immediately |
|
1401 Window().Invalidate( iSliderPaneRect ); |
|
1402 } |
|
1403 else |
|
1404 { |
|
1405 SetGloballyCapturing( EFalse ); |
|
1406 SetPointerCapture( EFalse ); |
|
1407 iTouchDown = EFalse; |
|
1408 } |
|
1409 break; |
|
1410 } |
|
1411 |
|
1412 case TPointerEvent::EButton1Up: |
|
1413 { |
|
1414 MPX_DEBUG1( "CMPXCommonPlaybackViewContainer::HandlePointerEventL btnUP" ); |
|
1415 if(iTouchDown) |
|
1416 { |
|
1417 // Pointer events |
|
1418 SetGloballyCapturing( EFalse ); |
|
1419 SetPointerCapture( EFalse ); |
|
1420 if ( ( iMode == EPlayMode || iMode == EPauseMode ) ) |
|
1421 { |
|
1422 iTouchDown = EFalse; |
|
1423 if ( aPointerEvent.iPosition.iX |
|
1424 <= iSliderBackgroundRect.iTl.iX ) |
|
1425 { |
|
1426 width = 0; |
|
1427 } |
|
1428 else if ( aPointerEvent.iPosition.iX |
|
1429 >= iSliderBackgroundRect.iBr.iX ) |
|
1430 { |
|
1431 width = iSliderBackgroundRect.iBr.iX |
|
1432 - iSliderBackgroundRect.iTl.iX; |
|
1433 } |
|
1434 else |
|
1435 { |
|
1436 width = aPointerEvent.iPosition.iX |
|
1437 - iSliderBackgroundRect.iTl.iX; |
|
1438 } |
|
1439 playbackBarSize.iWidth = width; |
|
1440 AknIconUtils::SetSize( iPlaybackSlider->Bitmap(), |
|
1441 playbackBarSize, EAspectRatioNotPreserved ); |
|
1442 |
|
1443 // Set new song position based upon progress bar location |
|
1444 TReal totalWidth = iPlaybackSliderRect.Width(); |
|
1445 TReal ratio = width / totalWidth; |
|
1446 iNewSongPosition = (ratio |
|
1447 * iTrackTotalLengthInSeconds) * 1000; |
|
1448 |
|
1449 // Invalidate rect so it will be redrawn immediately |
|
1450 Window().Invalidate( iSliderPaneRect ); |
|
1451 iSeekTimer->Cancel(); |
|
1452 iSeekTimer->Start( KSeekDelay, KSeekDelay, TCallBack( CallSetPosition, this ) ); |
|
1453 iDragProgressBar = ETrue; |
|
1454 } |
|
1455 } |
|
1456 break; |
|
1457 } |
|
1458 |
|
1459 default: |
|
1460 { |
|
1461 MPX_DEBUG1( "CMPXCommonPlaybackViewContainer::HandlePointerEventL default" ); |
|
1462 break; |
|
1463 } |
|
1464 } |
|
1465 } |
|
1466 } |
|
1467 |
|
1468 // --------------------------------------------------------------------------- |
|
1469 // CMPXCommonPlaybackViewContainer::GetNewSongPosition |
|
1470 // --------------------------------------------------------------------------- |
|
1471 // |
|
1472 EXPORT_C TInt CMPXCommonPlaybackViewContainer::GetNewSongPosition() |
|
1473 { |
|
1474 return iNewSongPosition; |
|
1475 } |
|
1476 |
|
1477 // --------------------------------------------------------------------------- |
|
1478 // CMPXCommonPlaybackViewContainer::SetNewSongPosition |
|
1479 // --------------------------------------------------------------------------- |
|
1480 // |
|
1481 void CMPXCommonPlaybackViewContainer::SetNewSongPosition( const TInt64& aPositon ) |
|
1482 { |
|
1483 iNewSongPosition = aPositon; |
|
1484 } |
|
1485 |
|
1486 // --------------------------------------------------------------------------- |
|
1487 // Helper function to set layout for all elements and set sizes for icons. |
|
1488 // --------------------------------------------------------------------------- |
|
1489 // |
|
1490 void CMPXCommonPlaybackViewContainer::DoUpdateLayoutL() |
|
1491 { |
|
1492 TRect myRect = Rect(); |
|
1493 if ( myRect == iCurrentLayout ) |
|
1494 { |
|
1495 // Layout has not changed, do nothing |
|
1496 return; |
|
1497 } |
|
1498 |
|
1499 CreateBackgroundImagesL(); |
|
1500 |
|
1501 MPX_DEBUG5( "CMPXCommonPlaybackViewContainer::DoUpdateLayoutL() -- new layout: top-left (%d, %d) size (%d, %d)", |
|
1502 myRect.iTl.iX, myRect.iTl.iY, myRect.Size().iWidth, myRect.Size().iHeight ); |
|
1503 |
|
1504 // Get layout data |
|
1505 iSliderPaneRect = iLayout->IndicatorLayout( |
|
1506 myRect, ESliderPane ); |
|
1507 iLayout->LayoutLabel( |
|
1508 iLabels[ETextElapsedTime], iSliderPaneRect, ETextElapsedTime ); |
|
1509 iLayout->LayoutLabel( |
|
1510 iLabels[ETextRemainingTime], iSliderPaneRect, ETextRemainingTime ); |
|
1511 iLayout->LayoutLabel( |
|
1512 iLabels[ETextArtist], myRect, ETextArtist ); |
|
1513 iLayout->LayoutLabel( |
|
1514 iLabels[ETextTrack], myRect, ETextTrack ); |
|
1515 iLayout->LayoutLabel( |
|
1516 iLabels[ETextPlaylistCount], myRect, ETextPlaylistCount ); |
|
1517 //iLayout->LayoutLabel( |
|
1518 // iLabels[ETextEmpty], myRect, ETextEmpty ); |
|
1519 iLayout->LayoutLabel( |
|
1520 iLabels[ETextDownloadState], iSliderPaneRect, ETextDownloadState ); |
|
1521 |
|
1522 if ( iFMTXMode ) |
|
1523 { |
|
1524 iLayout->LayoutLabel( |
|
1525 iLabels[ETextFMFrequency], myRect, ETextFMFrequency ); |
|
1526 } |
|
1527 |
|
1528 // Check if the artist and title rects intersect, if so move them |
|
1529 TRect titleRect = iLabels[ETextTrack]->Rect(); |
|
1530 TRect artistRect = iLabels[ETextArtist]->Rect(); |
|
1531 if ( titleRect.Intersects( artistRect )) |
|
1532 { |
|
1533 TRect intersection = titleRect; |
|
1534 intersection.Intersection( artistRect ); |
|
1535 TInt diff = -(intersection.Height()); |
|
1536 iLayout->LayoutLabel( |
|
1537 iLabels[ETextTrack], myRect, ETextTrack, 0, diff ); |
|
1538 } |
|
1539 |
|
1540 iIconLayout = iLayout->IndicatorLayout( myRect, EIconPlay ); |
|
1541 iRandomIconRect = iLayout->IndicatorLayout( myRect, EIconRandom ); |
|
1542 iRepeatIconRect = iLayout->IndicatorLayout( myRect, EIconRepeatAll ); |
|
1543 iBackgroundLayout = myRect; |
|
1544 |
|
1545 iDownloadSliderRect = iLayout->IndicatorLayout( |
|
1546 iSliderPaneRect, EDownloadSlider ); |
|
1547 iPlaybackSliderRect = iLayout->IndicatorLayout( |
|
1548 iSliderPaneRect, EPlaybackSlider ); |
|
1549 iSliderBackgroundRect = iLayout->IndicatorLayout( |
|
1550 iSliderPaneRect, ESliderBackground ); |
|
1551 |
|
1552 iAlbumArtRect = iLayout->IndicatorLayout( |
|
1553 myRect, EAlbumArtArea ); |
|
1554 |
|
1555 #ifdef RD_RA_SUPPORT_FOR_MUSIC_PLAYER |
|
1556 iRealIconRect = iLayout->IndicatorLayout( myRect, EIconReal ); |
|
1557 #endif |
|
1558 |
|
1559 // Scale icons |
|
1560 if ( iPauseIcon ) |
|
1561 { |
|
1562 AknIconUtils::SetSize( |
|
1563 iPauseIcon->Bitmap(), iIconLayout.Size() ); |
|
1564 } |
|
1565 if ( iPlayIcon ) |
|
1566 { |
|
1567 AknIconUtils::SetSize( |
|
1568 iPlayIcon->Bitmap(), iIconLayout.Size() ); |
|
1569 } |
|
1570 if ( iRandomIcon ) |
|
1571 { |
|
1572 AknIconUtils::SetSize( |
|
1573 iRandomIcon->Bitmap(), iRandomIconRect.Size() ); |
|
1574 } |
|
1575 if ( iRepeatAllIcon ) |
|
1576 { |
|
1577 AknIconUtils::SetSize( |
|
1578 iRepeatAllIcon->Bitmap(), iRepeatIconRect.Size() ); |
|
1579 } |
|
1580 if ( iRepeatOneIcon ) |
|
1581 { |
|
1582 AknIconUtils::SetSize( |
|
1583 iRepeatOneIcon->Bitmap(), iRepeatIconRect.Size() ); |
|
1584 } |
|
1585 |
|
1586 if ( iSliderBackground ) |
|
1587 { |
|
1588 AknIconUtils::SetSize( |
|
1589 iSliderBackground->Bitmap(), |
|
1590 iSliderBackgroundRect.Size(), |
|
1591 EAspectRatioNotPreserved ); |
|
1592 UpdateProgressBarGraphics(); |
|
1593 if ( iMode == EPlayMode || iMode == EPauseMode ) |
|
1594 { |
|
1595 MTouchFeedback* feedback = MTouchFeedback::Instance(); |
|
1596 if ( feedback ) |
|
1597 { |
|
1598 feedback->SetFeedbackArea( this, 0, iSliderPaneRect, |
|
1599 ETouchFeedbackBasic, ETouchEventStylusDown); |
|
1600 } |
|
1601 } |
|
1602 } |
|
1603 |
|
1604 if ( iDefaultAlbumArt ) |
|
1605 { |
|
1606 AknIconUtils::SetSize( |
|
1607 iDefaultAlbumArt->Bitmap(), iAlbumArtRect.Size() ); |
|
1608 } |
|
1609 |
|
1610 #ifdef RD_RA_SUPPORT_FOR_MUSIC_PLAYER |
|
1611 if (iRealIcon) |
|
1612 { |
|
1613 AknIconUtils::SetSize( |
|
1614 iRealIcon->Bitmap(), iRealIconRect.Size() ); |
|
1615 } |
|
1616 #endif |
|
1617 |
|
1618 iCurrentLayout = myRect; |
|
1619 |
|
1620 if ( iEnableButtons ) |
|
1621 { |
|
1622 if (iButtonManager) |
|
1623 { |
|
1624 iButtonManager->SetParentRect( myRect ); |
|
1625 iButtonManager->SetRect(myRect); |
|
1626 } |
|
1627 } |
|
1628 |
|
1629 // Update label colors according to skin (ignore the color in layout data) |
|
1630 UpdateLabelColorsL(); |
|
1631 |
|
1632 // update artist/title labels to use the full length of control |
|
1633 // other controls should not have been clipped in the first place |
|
1634 if ( iLabels[ ETextTrack ]->FullText().Length() > 0 ) |
|
1635 { |
|
1636 HBufC* title = iLabels[ ETextTrack ]->FullText().AllocLC(); |
|
1637 iLabels[ ETextTrack ]->SetLabelTextL( *title ); |
|
1638 CleanupStack::PopAndDestroy( title ); |
|
1639 } |
|
1640 if ( iLabels[ ETextArtist ]->FullText().Length() > 0 ) |
|
1641 { |
|
1642 HBufC* title = iLabels[ ETextArtist ]->FullText().AllocLC(); |
|
1643 iLabels[ ETextArtist ]->SetLabelTextL( *title ); |
|
1644 CleanupStack::PopAndDestroy( title ); |
|
1645 } |
|
1646 |
|
1647 MPX_DEBUG1( "CMPXCommonPlaybackViewContainer::DoUpdateLayoutL() exiting" ); |
|
1648 } |
|
1649 |
|
1650 // ----------------------------------------------------------------------------- |
|
1651 // CMPXCommonPlaybackViewContainer::ReStoreButtons |
|
1652 // ----------------------------------------------------------------------------- |
|
1653 // |
|
1654 void CMPXCommonPlaybackViewContainer::RestoreButtons( |
|
1655 TMPXPlaybackState aState ) |
|
1656 { |
|
1657 if ( iEnableButtons ) |
|
1658 { |
|
1659 iButtonManager->RestoreButtonStates( aState ); |
|
1660 DrawDeferred(); |
|
1661 } |
|
1662 } |
|
1663 |
|
1664 TInt CMPXCommonPlaybackViewContainer::CallSetPosition() |
|
1665 { |
|
1666 TRAP_IGNORE( HandleButtonCommandL( EMPXPbvCmdPosition ) ); |
|
1667 iSeekTimer->Cancel(); |
|
1668 return 0; |
|
1669 } |
|
1670 |
|
1671 TInt CMPXCommonPlaybackViewContainer::CallSetPosition( TAny* aAny ) |
|
1672 { |
|
1673 return ((CMPXCommonPlaybackViewContainer*)aAny)->CallSetPosition(); |
|
1674 } |
|
1675 |
|
1676 // ----------------------------------------------------------------------------- |
|
1677 // CMPXCommonPlaybackViewContainer::AdjustOrdinalPosition |
|
1678 // ----------------------------------------------------------------------------- |
|
1679 // |
|
1680 void CMPXCommonPlaybackViewContainer::AdjustOrdinalPosition( TInt aNewOrdinalPosition ) |
|
1681 { |
|
1682 return Window().SetOrdinalPosition( aNewOrdinalPosition ); |
|
1683 } |
|
1684 // End of File |