videoplayback/videoplaybackcontrols/src/mpxvideoplaybackprogressbar.cpp
branchRCL_3
changeset 6 7d91903f795f
parent 0 96612d01cf9f
child 10 112a725ff2c2
equal deleted inserted replaced
2:dec420019252 6:7d91903f795f
    13 *
    13 *
    14 * Description: Progress bar control
    14 * Description: Progress bar control
    15 *
    15 *
    16 */
    16 */
    17 
    17 
    18 // Version : %version: 15 %
    18 // Version : %version: 17 %
    19 
    19 
    20 
    20 
    21 // INCLUDE FILES
    21 // INCLUDE FILES
    22 #include <eikenv.h>
    22 #include <eikenv.h>
    23 #include <gulicon.h>
    23 #include <gulicon.h>
    48 const TInt KMPXProgressSliderWidth = 20;
    48 const TInt KMPXProgressSliderWidth = 20;
    49 const TInt KMPXSliderHeightOverProgresBar = 5;
    49 const TInt KMPXSliderHeightOverProgresBar = 5;
    50 const TInt64 KMPXMicroSeconds = 1000000;
    50 const TInt64 KMPXMicroSeconds = 1000000;
    51 const TInt KMPXOneHourInSeconds = 3600;
    51 const TInt KMPXOneHourInSeconds = 3600;
    52 
    52 
       
    53 const TInt KMPXProgressBarHeight = 41;
       
    54 
    53 // ============================ MEMBER FUNCTIONS ===================================================
    55 // ============================ MEMBER FUNCTIONS ===================================================
    54 
    56 
    55 CMPXVideoPlaybackProgressBar::CMPXVideoPlaybackProgressBar(
    57 CMPXVideoPlaybackProgressBar::CMPXVideoPlaybackProgressBar(
    56     CMPXVideoPlaybackControlsController* aController )
    58     CMPXVideoPlaybackControlsController* aController )
    57     : iController( aController )
    59     : iController( aController )
   213     MPX_DEBUG(_L("CMPXVideoPlaybackProgressBar::SetLayoutL()"));
   215     MPX_DEBUG(_L("CMPXVideoPlaybackProgressBar::SetLayoutL()"));
   214 
   216 
   215     //
   217     //
   216     // Calculate icon rects
   218     // Calculate icon rects
   217     //
   219     //
   218     TAknLayoutRect progressPaneRect;
       
   219     progressPaneRect.LayoutRect( iEikonEnv->EikAppUi()->ApplicationRect(),
       
   220                                  mp4_progress_pane(0).LayoutLine() );
       
   221 
   220 
   222     TRect progressRect = Rect();
   221     TRect progressRect = Rect();
   223     progressRect.iBr.iY = progressPaneRect.Rect().Height();
   222     TInt topMarginHeight = ( progressRect.iBr.iY - KMPXProgressBarHeight ) / 2;
       
   223     progressRect.iTl.iY += topMarginHeight;
       
   224     progressRect.iBr.iY = progressRect.iTl.iY + KMPXProgressBarHeight;
   224 
   225 
   225     TAknLayoutRect seekBarFrameRect;
   226     TAknLayoutRect seekBarFrameRect;
   226     seekBarFrameRect.LayoutRect( progressRect, mup_progress_pane_cp04().LayoutLine() );
   227     seekBarFrameRect.LayoutRect( progressRect, mup_progress_pane_cp04().LayoutLine() );
   227 
   228 
   228     iFrameIconRect = seekBarFrameRect.Rect();
   229     iFrameIconRect = seekBarFrameRect.Rect();
   482     MPX_DEBUG(_L("CMPXVideoPlaybackProgressBar::Draw()"));
   483     MPX_DEBUG(_L("CMPXVideoPlaybackProgressBar::Draw()"));
   483 
   484 
   484     CWindowGc& gc = SystemGc();
   485     CWindowGc& gc = SystemGc();
   485     gc.SetClippingRect( aRect );
   486     gc.SetClippingRect( aRect );
   486 
   487 
   487     if ( Window().DisplayMode() == EColor16MAP )
   488     if ( iController->SetBackgroundBlack() )
   488     {
   489     {
   489         gc.SetDrawMode( CGraphicsContext::EDrawModeWriteAlpha );
   490         if ( Window().DisplayMode() == EColor16MAP )
   490         gc.SetBrushColor( TRgb::Color16MAP( 255 ) );
   491         {
   491         gc.Clear( aRect );
   492             gc.SetDrawMode( CGraphicsContext::EDrawModeWriteAlpha );
   492     }
   493             gc.SetBrushColor( TRgb::Color16MAP( 255 ) );
   493     else if ( Window().DisplayMode() == EColor16MA )
   494             gc.Clear( aRect );
   494     {
   495         }
   495         gc.SetDrawMode( CGraphicsContext::EDrawModeWriteAlpha );
   496         else if ( Window().DisplayMode() == EColor16MA )
   496         gc.SetBrushColor( TRgb::Color16MA( 0 ) );
   497         {
   497         gc.Clear( aRect );
   498             gc.SetDrawMode( CGraphicsContext::EDrawModeWriteAlpha );
       
   499             gc.SetBrushColor( TRgb::Color16MA( 0 ) );
       
   500             gc.Clear( aRect );
       
   501         }
   498     }
   502     }
   499     else
   503     else
   500     {
   504     {
   501         // draw a solid background so that the entire progress
   505         // draw a solid background so that the entire progress
   502         // bar is shown not just the area representing the
   506         // bar is shown not just the area representing the