269 { |
261 { |
270 MPX_DEBUG(_L("CMPXVideoPlaybackMediaDetailsViewer::Draw()")); |
262 MPX_DEBUG(_L("CMPXVideoPlaybackMediaDetailsViewer::Draw()")); |
271 |
263 |
272 CWindowGc& gc = SystemGc(); |
264 CWindowGc& gc = SystemGc(); |
273 gc.SetClippingRect( aRect ); |
265 gc.SetClippingRect( aRect ); |
274 |
266 |
275 this->DrawableWindow()->SetCornerType(EWindowCorner5); |
267 this->DrawableWindow()->SetCornerType(EWindowCorner5); |
276 |
268 |
277 TRAP_IGNORE( UpdateBackgroundBitmapL() ); |
269 TRAP_IGNORE( UpdateBackgroundBitmapL() ); |
278 gc.SetDrawMode( CGraphicsContext::EDrawModeWriteAlpha ); |
270 gc.SetDrawMode( CGraphicsContext::EDrawModeWriteAlpha ); |
279 gc.BitBlt( Rect().iTl, iBackgroundBitmap ); |
271 gc.BitBlt( Rect().iTl, iBackgroundBitmap ); |
280 |
272 |
281 TRAP_IGNORE( FormatLabelsL() ); |
273 TRAP_IGNORE( FormatLabelsL() ); |
282 |
274 |
283 gc.SetBrushStyle( CGraphicsContext::ENullBrush ); |
275 gc.SetBrushStyle( CGraphicsContext::ENullBrush ); |
284 } |
276 } |
285 |
277 |
286 // ------------------------------------------------------------------------------------------------- |
278 // ------------------------------------------------------------------------------------------------- |
287 // CMPXVideoPlaybackMediaDetailsViewer::FormatLabelsL() |
279 // CMPXVideoPlaybackMediaDetailsViewer::FormatLabelsL() |
288 // ------------------------------------------------------------------------------------------------- |
280 // ------------------------------------------------------------------------------------------------- |
289 // |
281 // |
290 void CMPXVideoPlaybackMediaDetailsViewer::FormatLabelsL() const |
282 void CMPXVideoPlaybackMediaDetailsViewer::FormatLabelsL() const |
291 { |
283 { |
292 // FORMAT LABELS |
284 // FORMAT LABELS |
293 |
285 |
294 |
286 |
295 TInt labelWidth = Rect().iBr.iX; |
287 TInt labelWidth = Rect().iBr.iX; |
296 TInt labelHeight = iController->iContainer->Rect().iBr.iY / KMediaDetailsViewerMaxItems; |
288 TInt labelHeight = iController->iContainer->Rect().iBr.iY / KMediaDetailsViewerMaxItems; |
297 TInt rowsAdded = 0; |
289 TInt rowsAdded = 0; |
298 |
290 |
299 // License |
291 // License |
300 if ( iController->FileDetails()->iDrmProtected ) |
292 if ( iController->FileDetails()->iDrmProtected ) |
301 { |
293 { |
302 iLicenseLabel->SetExtent( |
294 iLicenseLabel->SetExtent( |
303 TPoint(Rect().iTl.iX, Rect().iTl.iY + ( labelHeight * rowsAdded) ) , |
295 TPoint(Rect().iTl.iX, Rect().iTl.iY + ( labelHeight * rowsAdded) ) , |
304 TSize( labelWidth, labelHeight ) |
296 TSize( labelWidth, labelHeight ) |
305 ); |
297 ); |
306 HBufC* heading = iEikonEnv->AllocReadResourceL( R_MPX_LICENSE_HEADING ); |
298 HBufC* heading = iEikonEnv->AllocReadResourceL( R_MPX_LICENSE_HEADING ); |
307 CleanupStack::PushL( heading ); |
299 CleanupStack::PushL( heading ); |
308 |
300 |
309 TBuf<KMediaDetailsViewerMaxBufLen> licenseField; |
301 TBuf<KMediaDetailsViewerMaxBufLen> licenseField; |
310 licenseField.Append(KLeftMargin); |
302 licenseField.Append(KLeftMargin); |
311 licenseField.Append( *heading ); |
303 licenseField.Append( *heading ); |
312 iLicenseLabel->OverrideColorL(EColorLabelText, KRgbDarkBlue); |
304 iLicenseLabel->OverrideColorL(EColorLabelText, KRgbDarkBlue); |
313 iLicenseLabel->SetTextL(licenseField); |
305 iLicenseLabel->SetTextL(licenseField); |
314 iLicenseLabel->SetAllMarginsTo(KMediaDetailsViewerItemMargin); |
306 iLicenseLabel->SetAllMarginsTo(KMediaDetailsViewerItemMargin); |
315 iLicenseLabel->SetLabelAlignment(ELayoutAlignCenter); |
307 iLicenseLabel->SetLabelAlignment(ELayoutAlignCenter); |
316 iLicenseLabel->SetUnderlining(ETrue); |
308 iLicenseLabel->SetUnderlining(ETrue); |
317 iLicenseLabel->MakeVisible( ETrue ); |
309 iLicenseLabel->MakeVisible( ETrue ); |
318 rowsAdded++; |
310 rowsAdded++; |
319 |
311 |
320 CleanupStack::PopAndDestroy( heading ); |
312 CleanupStack::PopAndDestroy( heading ); |
321 } |
313 } |
322 |
314 |
323 // Filename |
315 // Filename |
324 HBufC* fileName = iController->FileDetails()->GenerateFileNameL(); |
316 HBufC* fileName = iController->FileDetails()->GenerateFileNameL(); |
|
317 |
325 if ( fileName && fileName->Length() ) |
318 if ( fileName && fileName->Length() ) |
326 { |
319 { |
327 // file name gets populated by HandleScrollFilenameTimer method |
320 // file name gets populated by HandleScrollFilenameTimer method |
328 iClipnameLabel->SetExtent( |
321 iClipnameLabel->SetExtent( |
329 TPoint( Rect().iTl.iX, Rect().iTl.iY + ( labelHeight * rowsAdded ) ) , |
322 TPoint( Rect().iTl.iX, Rect().iTl.iY + ( labelHeight * rowsAdded ) ) , |
330 TSize( labelWidth, labelHeight ) |
323 TSize( labelWidth, labelHeight ) |
331 ); |
324 ); |
332 iClipnameLabel->SetAllMarginsTo(KMediaDetailsViewerItemMargin); |
325 iClipnameLabel->SetAllMarginsTo(KMediaDetailsViewerItemMargin); |
333 iClipnameLabel->MakeVisible( ETrue ); |
326 iClipnameLabel->MakeVisible( ETrue ); |
334 rowsAdded++; |
327 rowsAdded++; |
335 |
328 |
336 delete fileName; |
329 delete fileName; |
337 } |
330 } |
338 |
331 |
339 // Mime Type (Format) |
332 // Mime Type (Format) |
340 if ( iController->FileDetails()->iMimeType |
333 if ( iController->FileDetails()->iMimeType && iController->FileDetails()->iMimeType->Length() ) |
341 && iController->FileDetails()->iMimeType->Length() ) |
334 { |
342 { |
335 iFormatLabel->SetExtent( |
343 iFormatLabel->SetExtent( |
336 TPoint( Rect().iTl.iX, Rect().iTl.iY + ( labelHeight * rowsAdded ) ) , |
344 TPoint( Rect().iTl.iX, Rect().iTl.iY + ( labelHeight * rowsAdded ) ) , |
|
345 TSize( labelWidth, labelHeight ) |
337 TSize( labelWidth, labelHeight ) |
346 ); |
338 ); |
347 HBufC* heading = iEikonEnv->AllocReadResourceL( R_MPX_FORMAT_HEADING ); |
339 HBufC* heading = iEikonEnv->AllocReadResourceL( R_MPX_FORMAT_HEADING ); |
348 CleanupStack::PushL( heading ); |
340 CleanupStack::PushL( heading ); |
349 |
341 |
350 TBuf<KMediaDetailsViewerMaxBufLen> formatField; |
342 TBuf<KMediaDetailsViewerMaxBufLen> formatField; |
351 formatField.Append(KLeftMargin); |
343 formatField.Append(KLeftMargin); |
352 formatField.Append( *heading ); |
344 formatField.Append( *heading ); |
353 formatField.Append( KHeadingValueSeperator ); |
345 formatField.Append( KHeadingValueSeperator ); |
354 TInt allowLen = KMediaDetailsViewerMaxBufLen-formatField.Length(); |
346 TInt allowLen = KMediaDetailsViewerMaxBufLen-formatField.Length(); |
355 formatField.Append( (iController->FileDetails()->iMimeType)->Left(allowLen) ); |
347 formatField.Append( (iController->FileDetails()->iMimeType)->Left(allowLen) ); |
356 iFormatLabel->SetTextL(formatField); |
348 iFormatLabel->SetTextL(formatField); |
357 iFormatLabel->SetAllMarginsTo(KMediaDetailsViewerItemMargin); |
349 iFormatLabel->SetAllMarginsTo(KMediaDetailsViewerItemMargin); |
358 iFormatLabel->MakeVisible( ETrue ); |
350 iFormatLabel->MakeVisible( ETrue ); |
359 rowsAdded++; |
351 rowsAdded++; |
360 |
352 |
361 CleanupStack::PopAndDestroy( heading ); |
353 CleanupStack::PopAndDestroy( heading ); |
362 } |
354 } |
363 |
355 |
364 // Resolution |
356 // Resolution |
365 if ( iController->FileDetails()->iVideoHeight && |
357 if ( iController->FileDetails()->iVideoHeight && iController->FileDetails()->iVideoWidth ) |
366 iController->FileDetails()->iVideoWidth ) |
358 { |
367 { |
359 iResolutionLabel->SetExtent( |
368 iResolutionLabel->SetExtent( |
360 TPoint( Rect().iTl.iX, Rect().iTl.iY + ( labelHeight * rowsAdded ) ) , |
369 TPoint( Rect().iTl.iX, Rect().iTl.iY + ( labelHeight * rowsAdded ) ) , |
|
370 TSize( labelWidth, labelHeight ) |
361 TSize( labelWidth, labelHeight ) |
371 ); |
362 ); |
372 HBufC* heading = iEikonEnv->AllocReadResourceL( R_MPX_RESOLUTION_HEADING ); |
363 HBufC* heading = iEikonEnv->AllocReadResourceL( R_MPX_RESOLUTION_HEADING ); |
373 CleanupStack::PushL( heading ); |
364 CleanupStack::PushL( heading ); |
374 |
365 |
375 TBuf<KMediaDetailsViewerMaxBufLen> resolutionField; |
366 TBuf<KMediaDetailsViewerMaxBufLen> resolutionField; |
376 resolutionField.Append(KLeftMargin); |
367 resolutionField.Append(KLeftMargin); |
377 resolutionField.Append( *heading ); |
368 resolutionField.Append( *heading ); |
378 resolutionField.Append( KHeadingValueSeperator ); |
369 resolutionField.Append( KHeadingValueSeperator ); |
379 resolutionField.AppendNum( iController->FileDetails()->iVideoWidth ); |
370 resolutionField.AppendNum( iController->FileDetails()->iVideoWidth ); |
380 resolutionField.Append( KWidthHeightSeparator ); |
371 resolutionField.Append( KWidthHeightSeparator ); |
381 resolutionField.AppendNum( iController->FileDetails()->iVideoHeight); |
372 resolutionField.AppendNum( iController->FileDetails()->iVideoHeight); |
382 AknTextUtils::DisplayTextLanguageSpecificNumberConversion( resolutionField ); |
373 AknTextUtils::DisplayTextLanguageSpecificNumberConversion( resolutionField ); |
383 |
374 |
384 iResolutionLabel->SetTextL(resolutionField); |
375 iResolutionLabel->SetTextL(resolutionField); |
385 iResolutionLabel->SetAllMarginsTo(KMediaDetailsViewerItemMargin); |
376 iResolutionLabel->SetAllMarginsTo(KMediaDetailsViewerItemMargin); |
386 iResolutionLabel->MakeVisible( ETrue ); |
377 iResolutionLabel->MakeVisible( ETrue ); |
387 rowsAdded++; |
378 rowsAdded++; |
388 |
379 |
389 CleanupStack::PopAndDestroy( heading ); |
380 CleanupStack::PopAndDestroy( heading ); |
390 } |
381 } |
391 |
382 |
392 // Duration |
383 // Duration |
393 if ( iController->FileDetails()->iDuration > 0 ) |
384 if ( iController->FileDetails()->iDuration > 0 ) |
394 { |
385 { |
395 iDurationLabel->SetExtent( |
386 iDurationLabel->SetExtent( |
396 TPoint( Rect().iTl.iX, Rect().iTl.iY + ( labelHeight * rowsAdded) ) , |
387 TPoint( Rect().iTl.iX, Rect().iTl.iY + ( labelHeight * rowsAdded) ) , |
397 TSize( labelWidth, labelHeight ) |
388 TSize( labelWidth, labelHeight ) |
398 ); |
389 ); |
399 HBufC* heading = iEikonEnv->AllocReadResourceL( R_MPX_DURATION_HEADING ); |
390 HBufC* heading = iEikonEnv->AllocReadResourceL( R_MPX_DURATION_HEADING ); |
400 CleanupStack::PushL( heading ); |
391 CleanupStack::PushL( heading ); |
401 |
392 |
402 TBuf<KMediaDetailsViewerMaxBufLen> durationField; |
393 TBuf<KMediaDetailsViewerMaxBufLen> durationField; |
403 durationField.Append(KLeftMargin); |
394 durationField.Append(KLeftMargin); |
404 durationField.Append( *heading ); |
395 durationField.Append( *heading ); |
405 durationField.Append( KHeadingValueSeperator ); |
396 durationField.Append( KHeadingValueSeperator ); |
406 |
397 |
407 TInt64 durationInSeconds = iController->FileDetails()->iDuration / 1000; |
398 TInt64 durationInSeconds = iController->FileDetails()->iDuration / 1000; |
408 |
399 |
409 HBufC* unitFormatString; |
400 HBufC* unitFormatString; |
|
401 |
410 if ( durationInSeconds < 3600 ) // one hour |
402 if ( durationInSeconds < 3600 ) // one hour |
411 { |
403 { |
412 unitFormatString = StringLoader::LoadLC(R_QTN_TIME_DURAT_MIN_SEC); |
404 unitFormatString = StringLoader::LoadLC(R_QTN_TIME_DURAT_MIN_SEC); |
413 } |
405 } |
414 else |
406 else |
415 { |
407 { |
416 unitFormatString = StringLoader::LoadLC(R_QTN_TIME_DURAT_LONG); |
408 unitFormatString = StringLoader::LoadLC(R_QTN_TIME_DURAT_LONG); |
417 } |
409 } |
418 |
410 |
419 TBuf<64> dur; |
411 TBuf<64> dur; |
420 TTime durTime = TTime(durationInSeconds * 1000000); |
412 TTime durTime = TTime(durationInSeconds * 1000000); |
421 durTime.FormatL(dur, *unitFormatString); |
413 durTime.FormatL(dur, *unitFormatString); |
422 AknTextUtils::DisplayTextLanguageSpecificNumberConversion( dur ); |
414 AknTextUtils::DisplayTextLanguageSpecificNumberConversion( dur ); |
423 |
415 |
424 durationField.Append( dur ); |
416 durationField.Append( dur ); |
425 iDurationLabel->SetTextL(durationField); |
417 iDurationLabel->SetTextL(durationField); |
426 iDurationLabel->SetAllMarginsTo(KMediaDetailsViewerItemMargin); |
418 iDurationLabel->SetAllMarginsTo(KMediaDetailsViewerItemMargin); |
427 iDurationLabel->MakeVisible( ETrue ); |
419 iDurationLabel->MakeVisible( ETrue ); |
428 rowsAdded++; |
420 rowsAdded++; |
429 |
421 |
430 CleanupStack::PopAndDestroy( unitFormatString ); // unitFormatString |
422 CleanupStack::PopAndDestroy( unitFormatString ); // unitFormatString |
431 CleanupStack::PopAndDestroy( heading ); |
423 CleanupStack::PopAndDestroy( heading ); |
432 |
424 } |
433 } |
|
434 |
|
435 |
425 |
436 // Bitrate |
426 // Bitrate |
437 if ( iController->FileDetails()->iBitRate > 0 ) |
427 if ( iController->FileDetails()->iBitRate > 0 ) |
438 { |
428 { |
439 iBitrateLabel->SetExtent( |
429 iBitrateLabel->SetExtent( |
440 TPoint( Rect().iTl.iX, Rect().iTl.iY + ( labelHeight * rowsAdded ) ) , |
430 TPoint( Rect().iTl.iX, Rect().iTl.iY + ( labelHeight * rowsAdded ) ) , |
441 TSize( labelWidth, labelHeight ) |
431 TSize( labelWidth, labelHeight ) |
442 ); |
432 ); |
443 HBufC* heading = iEikonEnv->AllocReadResourceL( R_MPX_BITRATE_HEADING ); |
433 HBufC* heading = iEikonEnv->AllocReadResourceL( R_MPX_BITRATE_HEADING ); |
444 CleanupStack::PushL( heading ); |
434 CleanupStack::PushL( heading ); |
445 |
435 |
446 TBuf<KMediaDetailsViewerMaxBufLen> bitrateField; |
436 TBuf<KMediaDetailsViewerMaxBufLen> bitrateField; |
447 bitrateField.Append(KLeftMargin); |
437 bitrateField.Append(KLeftMargin); |
448 bitrateField.Append( *heading ); |
438 bitrateField.Append( *heading ); |
449 bitrateField.Append( KHeadingValueSeperator ); |
439 bitrateField.Append( KHeadingValueSeperator ); |
450 |
440 |
451 HBufC* formattedBitrate = |
441 HBufC* formattedBitrate = |
452 StringLoader::LoadLC(R_MPX_BITRATE_UNITS,iController->FileDetails()->iBitRate / 1000 ); |
442 StringLoader::LoadLC(R_MPX_BITRATE_UNITS,iController->FileDetails()->iBitRate / 1000 ); |
453 |
443 |
454 bitrateField.Append( *formattedBitrate ); |
444 bitrateField.Append( *formattedBitrate ); |
455 iBitrateLabel->SetTextL(bitrateField); |
445 iBitrateLabel->SetTextL(bitrateField); |
456 iBitrateLabel->SetAllMarginsTo(KMediaDetailsViewerItemMargin); |
446 iBitrateLabel->SetAllMarginsTo(KMediaDetailsViewerItemMargin); |
457 iBitrateLabel->MakeVisible( ETrue ); |
447 iBitrateLabel->MakeVisible( ETrue ); |
458 rowsAdded++; |
448 rowsAdded++; |
459 |
449 |
460 CleanupStack::PopAndDestroy( formattedBitrate ); // formattedBitrate |
450 CleanupStack::PopAndDestroy( formattedBitrate ); // formattedBitrate |
461 CleanupStack::PopAndDestroy( heading ); |
451 CleanupStack::PopAndDestroy( heading ); |
462 } |
452 } |
463 |
453 |
464 // Title |
454 // Title |
465 if ( iController->FileDetails()->iTitle |
455 if ( iController->FileDetails()->iTitle && iController->FileDetails()->iTitle->Length() ) |
466 && iController->FileDetails()->iTitle->Length() ) |
456 { |
467 { |
457 iTitleLabel->SetExtent( |
468 iTitleLabel->SetExtent( |
458 TPoint( Rect().iTl.iX, Rect().iTl.iY + ( labelHeight * rowsAdded ) ) , |
469 TPoint( Rect().iTl.iX, Rect().iTl.iY + ( labelHeight * rowsAdded ) ) , |
459 TSize( labelWidth, labelHeight ) |
470 TSize( labelWidth, labelHeight ) |
|
471 ); |
460 ); |
472 HBufC* heading = iEikonEnv->AllocReadResourceL( R_MPX_TITLE_HEADING ); |
461 HBufC* heading = iEikonEnv->AllocReadResourceL( R_MPX_TITLE_HEADING ); |
473 CleanupStack::PushL( heading ); |
462 CleanupStack::PushL( heading ); |
474 |
463 |
475 TBuf<KMediaDetailsViewerMaxBufLen> titleField; |
464 TBuf<KMediaDetailsViewerMaxBufLen> titleField; |
476 titleField.Append(KLeftMargin); |
465 titleField.Append(KLeftMargin); |
477 titleField.Append( *heading ); |
466 titleField.Append( *heading ); |
478 titleField.Append( KHeadingValueSeperator ); |
467 titleField.Append( KHeadingValueSeperator ); |
479 TInt allowLen = KMediaDetailsViewerMaxBufLen-titleField.Length(); |
468 TInt allowLen = KMediaDetailsViewerMaxBufLen-titleField.Length(); |
480 titleField.Append( (iController->FileDetails()->iTitle)->Left(allowLen) ); |
469 titleField.Append( (iController->FileDetails()->iTitle)->Left(allowLen) ); |
481 iTitleLabel->SetTextL(titleField); |
470 iTitleLabel->SetTextL(titleField); |
482 iTitleLabel->SetAllMarginsTo(KMediaDetailsViewerItemMargin); |
471 iTitleLabel->SetAllMarginsTo(KMediaDetailsViewerItemMargin); |
483 iTitleLabel->MakeVisible( ETrue ); |
472 iTitleLabel->MakeVisible( ETrue ); |
484 rowsAdded++; |
473 rowsAdded++; |
485 |
474 |
486 CleanupStack::PopAndDestroy( heading ); |
475 CleanupStack::PopAndDestroy( heading ); |
487 } |
476 } |
488 |
477 |
489 // Artist |
478 // Artist |
490 if ( iController->FileDetails()->iArtist |
479 if ( iController->FileDetails()->iArtist && iController->FileDetails()->iArtist->Length() ) |
491 && iController->FileDetails()->iArtist->Length() ) |
480 { |
492 { |
481 iArtistLabel->SetExtent( |
493 iArtistLabel->SetExtent( |
482 TPoint( Rect().iTl.iX, Rect().iTl.iY + ( labelHeight * rowsAdded ) ) , |
494 TPoint( Rect().iTl.iX, Rect().iTl.iY + ( labelHeight * rowsAdded ) ) , |
|
495 TSize( labelWidth, labelHeight ) |
483 TSize( labelWidth, labelHeight ) |
496 ); |
484 ); |
497 HBufC* heading = iEikonEnv->AllocReadResourceL( R_MPX_ARTIST_HEADING ); |
485 HBufC* heading = iEikonEnv->AllocReadResourceL( R_MPX_ARTIST_HEADING ); |
498 CleanupStack::PushL( heading ); |
486 CleanupStack::PushL( heading ); |
499 |
487 |
500 TBuf<KMediaDetailsViewerMaxBufLen> artistField; |
488 TBuf<KMediaDetailsViewerMaxBufLen> artistField; |
501 artistField.Append(KLeftMargin); |
489 artistField.Append(KLeftMargin); |
502 artistField.Append( *heading ); |
490 artistField.Append( *heading ); |
503 artistField.Append( KHeadingValueSeperator ); |
491 artistField.Append( KHeadingValueSeperator ); |
504 TInt allowLen = KMediaDetailsViewerMaxBufLen-artistField.Length(); |
492 TInt allowLen = KMediaDetailsViewerMaxBufLen-artistField.Length(); |
505 artistField.Append( (iController->FileDetails()->iArtist)->Left( allowLen ) ); |
493 artistField.Append( (iController->FileDetails()->iArtist)->Left( allowLen ) ); |
506 iArtistLabel->SetTextL(artistField); |
494 iArtistLabel->SetTextL(artistField); |
507 iArtistLabel->SetAllMarginsTo(KMediaDetailsViewerItemMargin); |
495 iArtistLabel->SetAllMarginsTo(KMediaDetailsViewerItemMargin); |
508 iArtistLabel->MakeVisible( ETrue ); |
496 iArtistLabel->MakeVisible( ETrue ); |
509 rowsAdded++; |
497 rowsAdded++; |
510 |
498 |
511 CleanupStack::PopAndDestroy( heading ); |
499 CleanupStack::PopAndDestroy( heading ); |
512 } |
500 } |
513 |
501 |
514 |
|
515 // Additional Label |
502 // Additional Label |
516 if ( iAdditionalString && iAdditionalString->Length() ) |
503 if ( iAdditionalString && iAdditionalString->Length() ) |
517 { |
504 { |
518 iAdditionalLabel->SetExtent( |
505 iAdditionalLabel->SetExtent( |
519 TPoint( Rect().iTl.iX, Rect().iTl.iY + ( labelHeight * rowsAdded ) ) , |
506 TPoint( Rect().iTl.iX, Rect().iTl.iY + ( labelHeight * rowsAdded ) ) , |
520 TSize( labelWidth, labelHeight ) |
507 TSize( labelWidth, labelHeight ) |
521 ); |
508 ); |
522 |
509 |
523 TBuf<KMediaDetailsViewerMaxBufLen> titleField; |
510 TBuf<KMediaDetailsViewerMaxBufLen> titleField; |
524 titleField.Append(KLeftMargin); |
511 titleField.Append(KLeftMargin); |
525 TInt allowLen = KMediaDetailsViewerMaxBufLen-titleField.Length(); |
512 TInt allowLen = KMediaDetailsViewerMaxBufLen-titleField.Length(); |
526 titleField.Append( iAdditionalString->Left(allowLen) ); |
513 titleField.Append( iAdditionalString->Left(allowLen) ); |
527 iAdditionalLabel->SetTextL(titleField); |
514 iAdditionalLabel->SetTextL(titleField); |
596 // CMPXVideoPlaybackMediaDetailsViewer::CreateLabelsL |
583 // CMPXVideoPlaybackMediaDetailsViewer::CreateLabelsL |
597 // ------------------------------------------------------------------------------------------------- |
584 // ------------------------------------------------------------------------------------------------- |
598 // |
585 // |
599 void CMPXVideoPlaybackMediaDetailsViewer::CreateLabelsL() |
586 void CMPXVideoPlaybackMediaDetailsViewer::CreateLabelsL() |
600 { |
587 { |
601 // Licence / DRM |
588 // Licence / DRM |
602 iLicenseLabel = new (ELeave) CEikLabel; |
589 iLicenseLabel = new (ELeave) CEikLabel; |
603 iLicenseLabel->SetContainerWindowL( *this ); |
590 iLicenseLabel->SetContainerWindowL( *this ); |
604 iLicenseLabel->SetTextL( KNullDesC ); |
591 iLicenseLabel->SetTextL( KNullDesC ); |
605 |
592 |
606 // Filename |
593 // Filename |
607 iClipnameLabel = new (ELeave) CEikLabel; |
594 iClipnameLabel = new (ELeave) CEikLabel; |
608 iClipnameLabel->SetContainerWindowL( *this ); |
595 iClipnameLabel->SetContainerWindowL( *this ); |
609 iClipnameLabel->SetTextL( KNullDesC ); |
596 iClipnameLabel->SetTextL( KNullDesC ); |
610 iClipnameLabel->SetLabelAlignment( ELayoutAlignBidi ); |
597 iClipnameLabel->SetLabelAlignment( ELayoutAlignBidi ); |
611 |
598 |
612 // Title |
599 // Title |
613 iTitleLabel = new (ELeave) CEikLabel; |
600 iTitleLabel = new (ELeave) CEikLabel; |
614 iTitleLabel->SetContainerWindowL( *this ); |
601 iTitleLabel->SetContainerWindowL( *this ); |
615 iTitleLabel->SetTextL( KNullDesC ); |
602 iTitleLabel->SetTextL( KNullDesC ); |
616 iTitleLabel->SetLabelAlignment( ELayoutAlignBidi ); |
603 iTitleLabel->SetLabelAlignment( ELayoutAlignBidi ); |
617 |
604 |
618 // Artist |
605 // Artist |
619 iArtistLabel = new (ELeave) CEikLabel; |
606 iArtistLabel = new (ELeave) CEikLabel; |
620 iArtistLabel->SetContainerWindowL( *this ); |
607 iArtistLabel->SetContainerWindowL( *this ); |
621 iArtistLabel->SetTextL( KNullDesC ); |
608 iArtistLabel->SetTextL( KNullDesC ); |
622 iArtistLabel->SetLabelAlignment( ELayoutAlignBidi ); |
609 iArtistLabel->SetLabelAlignment( ELayoutAlignBidi ); |
623 |
610 |
624 // Format |
611 // Format |
625 iFormatLabel = new (ELeave) CEikLabel; |
612 iFormatLabel = new (ELeave) CEikLabel; |
626 iFormatLabel->SetContainerWindowL( *this ); |
613 iFormatLabel->SetContainerWindowL( *this ); |
627 iFormatLabel->SetTextL( KNullDesC ); |
614 iFormatLabel->SetTextL( KNullDesC ); |
628 iFormatLabel->SetLabelAlignment( ELayoutAlignBidi ); |
615 iFormatLabel->SetLabelAlignment( ELayoutAlignBidi ); |
629 |
616 |
630 // Resolution |
617 // Resolution |
631 iResolutionLabel = new (ELeave) CEikLabel; |
618 iResolutionLabel = new (ELeave) CEikLabel; |
632 iResolutionLabel->SetContainerWindowL( *this ); |
619 iResolutionLabel->SetContainerWindowL( *this ); |
633 iResolutionLabel->SetTextL( KNullDesC ); |
620 iResolutionLabel->SetTextL( KNullDesC ); |
634 iResolutionLabel->SetLabelAlignment( ELayoutAlignBidi ); |
621 iResolutionLabel->SetLabelAlignment( ELayoutAlignBidi ); |
635 |
622 |
636 // Duration |
623 // Duration |
637 iDurationLabel = new (ELeave) CEikLabel; |
624 iDurationLabel = new (ELeave) CEikLabel; |
638 iDurationLabel->SetContainerWindowL( *this ); |
625 iDurationLabel->SetContainerWindowL( *this ); |
639 iDurationLabel->SetTextL( KNullDesC ); |
626 iDurationLabel->SetTextL( KNullDesC ); |
640 iDurationLabel->SetLabelAlignment( ELayoutAlignBidi ); |
627 iDurationLabel->SetLabelAlignment( ELayoutAlignBidi ); |
641 |
628 |
642 // Bitrate |
629 // Bitrate |
643 iBitrateLabel = new (ELeave) CEikLabel; |
630 iBitrateLabel = new (ELeave) CEikLabel; |
644 iBitrateLabel->SetContainerWindowL( *this ); |
631 iBitrateLabel->SetContainerWindowL( *this ); |
645 iBitrateLabel->SetTextL( KNullDesC ); |
632 iBitrateLabel->SetTextL( KNullDesC ); |
646 iBitrateLabel->SetLabelAlignment( ELayoutAlignBidi ); |
633 iBitrateLabel->SetLabelAlignment( ELayoutAlignBidi ); |
647 |
634 |
648 // Additional Labels |
635 // Additional Labels |
649 iAdditionalLabel = new (ELeave) CEikLabel; |
636 iAdditionalLabel = new (ELeave) CEikLabel; |
650 iAdditionalLabel->SetContainerWindowL( *this ); |
637 iAdditionalLabel->SetContainerWindowL( *this ); |
651 iAdditionalLabel->SetTextL( KNullDesC ); |
638 iAdditionalLabel->SetTextL( KNullDesC ); |
652 iAdditionalLabel->SetLabelAlignment( ELayoutAlignBidi ); |
639 iAdditionalLabel->SetLabelAlignment( ELayoutAlignBidi ); |
653 |
640 } |
654 } |
|
655 |
641 |
656 // ----------------------------------------------------------------------------- |
642 // ----------------------------------------------------------------------------- |
657 // CMPXVideoPlaybackMediaDetailsViewer::UpdateBackgroundBitmapL |
643 // CMPXVideoPlaybackMediaDetailsViewer::UpdateBackgroundBitmapL |
658 // Update background bitmap |
644 // Update background bitmap |
659 // ----------------------------------------------------------------------------- |
645 // ----------------------------------------------------------------------------- |
660 // |
646 // |
661 void CMPXVideoPlaybackMediaDetailsViewer::UpdateBackgroundBitmapL() const |
647 void CMPXVideoPlaybackMediaDetailsViewer::UpdateBackgroundBitmapL() const |
662 { |
648 { |
663 TSize bitmapSize = Rect().Size(); |
649 TSize bitmapSize = Rect().Size(); |
664 |
650 |
665 CFbsBitmapDevice* bgBitmapDevice = |
651 CFbsBitmapDevice* bgBitmapDevice = CFbsBitmapDevice::NewL( iBackgroundBitmap ); |
666 CFbsBitmapDevice::NewL( iBackgroundBitmap ); |
|
667 CleanupStack::PushL( bgBitmapDevice ); |
652 CleanupStack::PushL( bgBitmapDevice ); |
668 |
653 |
669 CFbsBitGc* bgBitGc( NULL ); |
654 CFbsBitGc* bgBitGc( NULL ); |
670 User::LeaveIfError( bgBitmapDevice->CreateContext( bgBitGc ) ); |
655 User::LeaveIfError( bgBitmapDevice->CreateContext( bgBitGc ) ); |
671 CleanupStack::PushL( bgBitGc ); |
656 CleanupStack::PushL( bgBitGc ); |
672 |
657 |
673 bgBitGc->SetBrushColor( TRgb(0x708090) ); // slate gray |
658 bgBitGc->SetBrushColor( TRgb(0x708090) ); // slate gray |
674 bgBitGc->Clear(); |
659 bgBitGc->Clear(); |
675 |
660 |
676 CleanupStack::PopAndDestroy( bgBitGc ); |
661 CleanupStack::PopAndDestroy( bgBitGc ); |
677 CleanupStack::PopAndDestroy( bgBitmapDevice ); |
662 CleanupStack::PopAndDestroy( bgBitmapDevice ); |
678 |
663 |
679 // Dither alpha channel for semitransparency |
664 // Dither alpha channel for semitransparency |
680 // |
665 // |
681 // Scan line length in 32-bit words |
666 // Scan line length in 32-bit words |
682 TInt scanLineLengthWord = CFbsBitmap::ScanLineLength( bitmapSize.iWidth, EColor16MA) / 4; |
667 TInt scanLineLengthWord = CFbsBitmap::ScanLineLength( bitmapSize.iWidth, EColor16MA) / 4; |
683 |
668 |
684 iBackgroundBitmap->LockHeap(); |
669 iBackgroundBitmap->LockHeap(); |
685 TUint32* dataAddr = |
670 TUint32* dataAddr = reinterpret_cast<TUint32*>( iBackgroundBitmap->DataAddress() ); |
686 reinterpret_cast<TUint32*>( iBackgroundBitmap->DataAddress() ); |
671 |
687 for ( TInt y = 0; y < bitmapSize.iHeight; y++ ) |
672 for ( TInt y = 0; y < bitmapSize.iHeight; y++ ) |
|
673 { |
|
674 for ( TInt x = 0; x < bitmapSize.iWidth; x++ ) |
|
675 { |
|
676 if ( ( y + x ) & 1 ) |
688 { |
677 { |
689 for ( TInt x = 0; x < bitmapSize.iWidth; x++ ) |
678 // Make this pixel transparent |
|
679 dataAddr[y * scanLineLengthWord + x] = 0x00000000; |
|
680 } |
|
681 } |
|
682 } |
|
683 |
|
684 iBackgroundBitmap->UnlockHeap(); |
|
685 } |
|
686 |
|
687 // ------------------------------------------------------------------------------------------------- |
|
688 // CMPXVideoPlaybackMediaDetailsViewer::ScrollFilenameTimer |
|
689 // ------------------------------------------------------------------------------------------------- |
|
690 // |
|
691 TInt CMPXVideoPlaybackMediaDetailsViewer::ScrollFilenameTimer( TAny* aPtr ) |
|
692 { |
|
693 TRAP_IGNORE( |
|
694 static_cast<CMPXVideoPlaybackMediaDetailsViewer*>(aPtr)->HandleScrollFilenameTimerL() |
|
695 ); |
|
696 return KErrNone; |
|
697 } |
|
698 |
|
699 // ------------------------------------------------------------------------------------------------- |
|
700 // CMPXVideoPlaybackMediaDetailsViewer::HandleScrollFilenameTimerL |
|
701 // ------------------------------------------------------------------------------------------------- |
|
702 // |
|
703 void CMPXVideoPlaybackMediaDetailsViewer::HandleScrollFilenameTimerL() |
|
704 { |
|
705 MPX_ENTER_EXIT( _L( "CMPXVideoPlaybackMediaDetailsViewer::HandleScrollFilenameTimerL" ) ); |
|
706 |
|
707 TBool skipForTimerDelay = EFalse; |
|
708 |
|
709 // add a delay after each complete scrolling |
|
710 if ( iScrollTimerDelayBeginningTick != KInvalidTick ) |
|
711 { |
|
712 if ( ( User::NTickCount() - iScrollTimerDelayBeginningTick ) >= KScrollTimerDelayTickCounts ) |
|
713 { |
|
714 iScrollTimerDelayBeginningTick = KInvalidTick; |
|
715 } |
|
716 else |
|
717 { |
|
718 skipForTimerDelay = ETrue; |
|
719 } |
|
720 } |
|
721 |
|
722 if ( !skipForTimerDelay && iShouldPauseScrolling ) |
|
723 { |
|
724 iShouldPauseScrolling = EFalse; |
|
725 iScrollTimerDelayBeginningTick = User::NTickCount(); |
|
726 skipForTimerDelay = ETrue; |
|
727 } |
|
728 |
|
729 // skip the scrolling operation if the loop for delay is going on |
|
730 if ( !skipForTimerDelay ) |
|
731 { |
|
732 HBufC* fileName = iController->FileDetails()->GenerateFileNameL(); |
|
733 |
|
734 |
|
735 if ( fileName && fileName->Length() ) |
|
736 { |
|
737 CleanupStack::PushL( fileName ); |
|
738 |
|
739 TInt length = fileName->Length(); |
|
740 |
|
741 HBufC* heading = iEikonEnv->AllocReadResourceL( R_MPX_FILENAME_HEADING ); |
|
742 CleanupStack::PushL( heading ); |
|
743 |
|
744 TBuf<KMediaDetailsViewerMaxBufLen> filenameField; |
|
745 filenameField.Append(KLeftMargin); |
|
746 filenameField.Append( *heading ); |
|
747 filenameField.Append( KHeadingValueSeperator ); |
|
748 |
|
749 if ( length >= KMediaDetailsViewerVisibleCharacters ) |
|
750 { |
|
751 filenameField.Append( fileName->Mid( iScrollPosition, |
|
752 KMediaDetailsViewerVisibleCharacters ) ); |
|
753 |
|
754 if ( iScrollPosition == (length - KMediaDetailsViewerVisibleCharacters) ) |
690 { |
755 { |
691 if ( ( y + x ) & 1 ) |
756 iScrollPosition = 0; |
692 { |
757 iShouldPauseScrolling = ETrue; |
693 // Make this pixel transparent |
|
694 dataAddr[y * scanLineLengthWord + x] = 0x00000000; |
|
695 } |
|
696 } |
758 } |
697 } |
759 else |
698 |
760 { |
699 iBackgroundBitmap->UnlockHeap(); |
761 iScrollPosition++; |
700 } |
762 } |
701 |
|
702 // ------------------------------------------------------------------------------------------------- |
|
703 // CMPXVideoPlaybackMediaDetailsViewer::ScrollFilenameTimer |
|
704 // ------------------------------------------------------------------------------------------------- |
|
705 // |
|
706 TInt CMPXVideoPlaybackMediaDetailsViewer::ScrollFilenameTimer( TAny* aPtr ) |
|
707 { |
|
708 TRAP_IGNORE( |
|
709 static_cast<CMPXVideoPlaybackMediaDetailsViewer*>(aPtr)->HandleScrollFilenameTimerL() |
|
710 ); |
|
711 return KErrNone; |
|
712 } |
|
713 |
|
714 // ------------------------------------------------------------------------------------------------- |
|
715 // CMPXVideoPlaybackMediaDetailsViewer::HandleScrollFilenameTimerL |
|
716 // ------------------------------------------------------------------------------------------------- |
|
717 // |
|
718 void CMPXVideoPlaybackMediaDetailsViewer::HandleScrollFilenameTimerL() |
|
719 { |
|
720 HBufC* fileName = iController->FileDetails()->GenerateFileNameL(); |
|
721 |
|
722 if ( fileName && fileName->Length() ) |
|
723 { |
|
724 CleanupStack::PushL( fileName ); |
|
725 if ( iShouldPauseScrolling ) |
|
726 { |
|
727 iShouldPauseScrolling = EFalse; |
|
728 User::After( 2000000 ); // add a 2 second delay after each complete scrolling |
|
729 } |
|
730 |
|
731 TInt length = fileName->Length(); |
|
732 |
|
733 HBufC* heading = iEikonEnv->AllocReadResourceL( R_MPX_FILENAME_HEADING ); |
|
734 CleanupStack::PushL( heading ); |
|
735 |
|
736 TBuf<KMediaDetailsViewerMaxBufLen> filenameField; |
|
737 filenameField.Append(KLeftMargin); |
|
738 filenameField.Append( *heading ); |
|
739 filenameField.Append( KHeadingValueSeperator ); |
|
740 |
|
741 if ( length >= KMediaDetailsViewerVisibleCharacters ) |
|
742 { |
|
743 filenameField.Append( fileName->Mid( iScrollPosition, |
|
744 KMediaDetailsViewerVisibleCharacters ) ); |
|
745 |
|
746 if ( iScrollPosition == (length - KMediaDetailsViewerVisibleCharacters) ) |
|
747 { |
|
748 iScrollPosition = 0; |
|
749 iShouldPauseScrolling = ETrue; |
|
750 } |
763 } |
751 else |
764 else |
752 { |
765 { |
753 iScrollPosition++; |
766 filenameField.Append( *fileName ); |
|
767 iScrollingTextTimer->Cancel(); // no need to keep the timer active |
754 } |
768 } |
|
769 |
|
770 iClipnameLabel->SetTextL(filenameField); |
|
771 DrawNow(); |
|
772 |
|
773 CleanupStack::PopAndDestroy( heading ); |
|
774 CleanupStack::PopAndDestroy( fileName ); |
755 } |
775 } |
756 else |
776 } |
757 { |
|
758 filenameField.Append( *fileName ); |
|
759 iScrollingTextTimer->Cancel(); // no need to keep the timer active |
|
760 } |
|
761 |
|
762 iClipnameLabel->SetTextL(filenameField); |
|
763 DrawNow(); |
|
764 |
|
765 CleanupStack::PopAndDestroy( heading ); |
|
766 CleanupStack::PopAndDestroy( fileName ); |
|
767 } |
|
768 } |
777 } |
769 |
778 |
770 |
779 |
771 // ------------------------------------------------------------------------------------------------- |
780 // ------------------------------------------------------------------------------------------------- |
772 // CMPXVideoPlaybackMediaDetailsViewer::NumOfItemsShownInViewer |
781 // CMPXVideoPlaybackMediaDetailsViewer::NumOfItemsShownInViewer |
773 // ------------------------------------------------------------------------------------------------- |
782 // ------------------------------------------------------------------------------------------------- |
774 // |
783 // |
775 TInt CMPXVideoPlaybackMediaDetailsViewer::NumOfItemsShownInViewerL() |
784 TInt CMPXVideoPlaybackMediaDetailsViewer::NumOfItemsShownInViewerL() |
776 { |
785 { |
777 TInt numOfItems = 0; |
786 TInt numOfItems = 0; |
778 |
787 |
779 if ( iController->FileDetails()->iDrmProtected ) |
788 if ( iController->FileDetails()->iDrmProtected ) |
780 { |
789 { |
781 numOfItems++; |
790 numOfItems++; |
782 } |
791 } |
783 |
792 |
784 if ( iController->FileDetails()->iClipName ) |
793 if ( iController->FileDetails()->iClipName ) |
785 { |
794 { |
786 numOfItems++; |
795 numOfItems++; |
787 } |
796 } |
788 |
797 |
789 if ( iController->FileDetails()->iMimeType ) |
798 if ( iController->FileDetails()->iMimeType ) |
790 { |
799 { |
791 numOfItems++; |
800 numOfItems++; |
792 } |
801 } |
793 |
802 |
794 if ( iController->FileDetails()->iVideoHeight && |
803 if ( iController->FileDetails()->iVideoHeight && |
795 iController->FileDetails()->iVideoWidth ) |
804 iController->FileDetails()->iVideoWidth ) |
796 { |
805 { |
797 numOfItems++; |
806 numOfItems++; |
798 } |
807 } |
799 |
808 |
800 if ( iController->FileDetails()->iDuration > 0 ) |
809 if ( iController->FileDetails()->iDuration > 0 ) |
801 { |
810 { |
802 numOfItems++; |
811 numOfItems++; |
803 } |
812 } |
804 |
813 |
805 if ( iController->FileDetails()->iBitRate > 0 ) |
814 if ( iController->FileDetails()->iBitRate > 0 ) |
806 { |
815 { |
807 numOfItems++; |
816 numOfItems++; |
808 } |
817 } |
809 |
818 |
810 if ( iController->FileDetails()->iTitle ) |
819 if ( iController->FileDetails()->iTitle ) |
811 { |
820 { |
812 numOfItems++; |
821 numOfItems++; |
813 } |
822 } |
814 |
823 |
815 if ( iController->FileDetails()->iArtist ) |
824 if ( iController->FileDetails()->iArtist ) |
816 { |
825 { |
817 numOfItems++; |
826 numOfItems++; |
818 } |
827 } |
819 |
828 |
820 // Additional File Details |
829 // Additional File Details |
821 CMPXFileDetailsPlugin* addPlugin( NULL ); |
830 CMPXFileDetailsPlugin* addPlugin( NULL ); |
822 |
831 |
823 // Use the interface to load the ecom plugin |
832 // Use the interface to load the ecom plugin |
824 TRAPD ( err, addPlugin = CMPXFileDetailsPlugin::NewL( KFileDetailsCntlPluginUid ) ); |
833 TRAPD ( err, addPlugin = CMPXFileDetailsPlugin::NewL( KFileDetailsCntlPluginUid ) ); |
825 |
834 |
826 // If plugin loaded successfully |
835 // If plugin loaded successfully |
827 if (!err ) |
836 if ( ! err ) |
828 { |
837 { |
829 TPtrC addLabel; |
838 TPtrC addLabel; |
830 addLabel.Set( addPlugin->GetAdditionalLabelLC( iController->FileDetails()->iFourCCCode ) ); |
839 addLabel.Set( addPlugin->GetAdditionalLabelLC( iController->FileDetails()->iFourCCCode ) ); |
831 iAdditionalString = addLabel.AllocL(); |
840 iAdditionalString = addLabel.AllocL(); |
832 |
841 |
833 if ( iAdditionalString->Length() ) |
842 if ( iAdditionalString->Length() ) |
834 { |
843 { |
835 numOfItems++; |
844 numOfItems++; |
836 } |
845 } |
837 |
846 |
838 CleanupStack::PopAndDestroy(); // addLabel |
847 CleanupStack::PopAndDestroy(); // addLabel |
839 } |
848 } |
840 |
849 |
841 delete addPlugin; |
850 delete addPlugin; |
842 |
851 |
843 return numOfItems; |
852 return numOfItems; |
844 } |
853 } |
845 |
854 |
846 // ------------------------------------------------------------------------------------------------- |
855 // ------------------------------------------------------------------------------------------------- |
847 // CMPXVideoPlaybackMediaDetailsViewer::CalculateViewerRect |
856 // CMPXVideoPlaybackMediaDetailsViewer::CalculateViewerRect |
848 // ------------------------------------------------------------------------------------------------- |
857 // ------------------------------------------------------------------------------------------------- |
849 // |
858 // |
850 TRect CMPXVideoPlaybackMediaDetailsViewer::CalculateViewerRectL() |
859 TRect CMPXVideoPlaybackMediaDetailsViewer::CalculateViewerRectL() |
851 { |
860 { |
852 TInt numOfItems = NumOfItemsShownInViewerL(); |
861 TInt numOfItems = NumOfItemsShownInViewerL(); |
853 TRect viewerRect; |
862 TRect viewerRect; |
854 |
863 |
855 // optimize viewer's width for the clipname |
864 // optimize viewer's width for the clipname |
856 TInt horizontalOffset = 0; |
865 TInt horizontalOffset = 0; |
857 TInt filenameLength = iController->FileDetails()->iClipName->Des().Length(); |
866 TInt filenameLength = iController->FileDetails()->iClipName->Des().Length(); |
858 |
867 |
859 if ( filenameLength <= KMediaDetailsViewerFilenameMedium ) |
868 if ( filenameLength <= KMediaDetailsViewerFilenameMedium ) |
860 { |
869 { |
861 horizontalOffset = |
870 horizontalOffset = |
862 iController->iContainer->Rect().iBr.iX / KMediaDetailsViewerOffsetDivisorMedium; |
871 iController->iContainer->Rect().iBr.iX / KMediaDetailsViewerOffsetDivisorMedium; |
863 } |
872 } |
864 else |
873 else |
865 { |
874 { |
866 horizontalOffset = |
875 horizontalOffset = |
867 iController->iContainer->Rect().iBr.iX / KMediaDetailsViewerOffsetDivisorMax; |
876 iController->iContainer->Rect().iBr.iX / KMediaDetailsViewerOffsetDivisorMax; |
868 } |
877 } |
869 |
878 |
870 TInt eachItemHeight = |
879 TInt eachItemHeight = iController->iContainer->Rect().iBr.iY / KMediaDetailsViewerMaxItems; |
871 iController->iContainer->Rect().iBr.iY / KMediaDetailsViewerMaxItems; |
880 |
872 |
881 TInt verticalHalf = iController->iContainer->Rect().iBr.iY / 2; |
873 TInt verticalHalf = iController->iContainer->Rect().iBr.iY / 2; |
882 |
874 |
|
875 TInt tLX = (iController->iContainer->Rect().iTl.iX) + horizontalOffset; |
883 TInt tLX = (iController->iContainer->Rect().iTl.iX) + horizontalOffset; |
876 TInt bRX = (iController->iContainer->Rect().iBr.iX) - horizontalOffset; |
884 TInt bRX = (iController->iContainer->Rect().iBr.iX) - horizontalOffset; |
877 |
885 |
878 TInt tLY = verticalHalf - ( eachItemHeight * numOfItems/2 ); |
886 TInt tLY = verticalHalf - ( eachItemHeight * numOfItems/2 ); |
879 |
887 |
880 // pad for the margins on top and bottom of viewer |
888 // pad for the margins on top and bottom of viewer |
881 TInt bRY = verticalHalf + ( eachItemHeight * numOfItems/2 ) + (KMediaDetailsViewerItemMargin * 2); |
889 TInt bRY = |
882 |
890 verticalHalf + ( eachItemHeight * numOfItems/2 ) + ( KMediaDetailsViewerItemMargin * 2 ); |
|
891 |
883 viewerRect = TRect( tLX, tLY, bRX, bRY ); |
892 viewerRect = TRect( tLX, tLY, bRX, bRY ); |
884 |
893 |
885 return viewerRect; |
894 return viewerRect; |
886 } |
895 } |
887 |
896 |
888 // ------------------------------------------------------------------------------------------------- |
897 // ------------------------------------------------------------------------------------------------- |
889 // CMPXVideoPlaybackMediaDetailsViewer::ViewerRect |
898 // CMPXVideoPlaybackMediaDetailsViewer::ViewerRect |