videoplayback/videoplaybackviews/src/mpxvideoplaybackcontainer.cpp
branchRCL_3
changeset 15 8f0df5c82986
parent 14 55fa1ec415c6
child 21 315810614048
equal deleted inserted replaced
14:55fa1ec415c6 15:8f0df5c82986
    14 * Description:  Implementation of Video playback view's container.
    14 * Description:  Implementation of Video playback view's container.
    15 *
    15 *
    16 */
    16 */
    17 
    17 
    18 
    18 
    19 // Version : %version: 28 %
    19 // Version : %version: 29 %
    20 
    20 
    21 
    21 
    22 // INCLUDE FILES
    22 // INCLUDE FILES
    23 
    23 
    24 #include <w32std.h> // RWindowBase
    24 #include <w32std.h> // RWindowBase
   417     MPX_ENTER_EXIT(_L("CMPXVideoPlaybackContainer::Draw()"));
   417     MPX_ENTER_EXIT(_L("CMPXVideoPlaybackContainer::Draw()"));
   418 
   418 
   419     CWindowGc& gc = SystemGc();
   419     CWindowGc& gc = SystemGc();
   420 
   420 
   421     gc.SetBrushStyle( CGraphicsContext::ESolidBrush );
   421     gc.SetBrushStyle( CGraphicsContext::ESolidBrush );
   422 
   422     gc.SetDrawMode( CGraphicsContext::EDrawModeWriteAlpha );
   423     //
   423 
   424     //  Make the window transparent when a surface has been created
   424     if ( Window().DisplayMode() == EColor16MAP )
   425     //  unless TV-Out is connected
   425     {
   426     //
   426         gc.SetBrushColor( TRgb::Color16MAP(255) );
   427     if ( iSurfaceCreated && ! iTvOutConnected )
   427     }
   428     {
   428     else if ( Window().DisplayMode() == EColor16MA )
   429         gc.SetDrawMode( CGraphicsContext::EDrawModeWriteAlpha );
   429     {
   430 
   430         gc.SetBrushColor( TRgb::Color16MA(0) );
   431         if ( Window().DisplayMode() == EColor16MAP )
   431     }
   432         {
   432 
   433             gc.SetBrushColor( TRgb::Color16MAP(255) );
   433     gc.Clear( aRect );
   434         }
       
   435         else if ( Window().DisplayMode() == EColor16MA )
       
   436         {
       
   437             gc.SetBrushColor( TRgb::Color16MA(0) );
       
   438         }
       
   439 
       
   440         gc.Clear( aRect );
       
   441     }
       
   442     else
       
   443     {
       
   444         //
       
   445         //  Set the background to black
       
   446         //
       
   447         gc.SetBrushColor( KRgbBlack );
       
   448         gc.DrawRect( aRect );
       
   449     }
       
   450 }
   434 }
   451 
   435 
   452 // -------------------------------------------------------------------------------------------------
   436 // -------------------------------------------------------------------------------------------------
   453 // CMPXVideoPlaybackContainer::HandleEventL()
   437 // CMPXVideoPlaybackContainer::HandleEventL()
   454 // -------------------------------------------------------------------------------------------------
   438 // -------------------------------------------------------------------------------------------------
   464     }
   448     }
   465     else if ( aEvent == EMPXControlCmdHandleForegroundEvent )
   449     else if ( aEvent == EMPXControlCmdHandleForegroundEvent )
   466     {
   450     {
   467         iUserInputHandler->SetForeground(ETrue);
   451         iUserInputHandler->SetForeground(ETrue);
   468     }
   452     }
   469     else if ( aEvent == EMPXControlCmdTvOutConnected )
       
   470     {
       
   471         iTvOutConnected = ETrue;
       
   472         DrawNow();
       
   473     }
       
   474     else if ( aEvent == EMPXControlCmdTvOutDisconnected )
       
   475     {
       
   476         iTvOutConnected = EFalse;
       
   477         DrawNow();
       
   478     }
       
   479 
   453 
   480     iControlsController->HandleEventL( aEvent, aValue );
   454     iControlsController->HandleEventL( aEvent, aValue );
   481 }
   455 }
   482 
   456 
   483 // -------------------------------------------------------------------------------------------------
   457 // -------------------------------------------------------------------------------------------------
   496             iView->SetPropertyL( EPbPropertyPosition, (TInt)aValue * KPbMilliMultiplier );
   470             iView->SetPropertyL( EPbPropertyPosition, (TInt)aValue * KPbMilliMultiplier );
   497             break;
   471             break;
   498         }
   472         }
   499         case EMPXPbvCmdResetControls:
   473         case EMPXPbvCmdResetControls:
   500         {
   474         {
       
   475             if ( iRealOneBitmapTimer )
       
   476             {
       
   477                 iRealOneBitmapTimer->Cancel();
       
   478                 delete iRealOneBitmapTimer;
       
   479                 iRealOneBitmapTimer = NULL;
       
   480             }
       
   481 
   501             //
   482             //
   502             //  Recreate the controls with the new clip
   483             //  Recreate the controls with the new clip
   503             //
   484             //
   504             CreateControlsL();
   485             CreateControlsL();
   505 
   486 
   520             iView->SetPropertyL( EPbPropertyVolume, aValue );
   501             iView->SetPropertyL( EPbPropertyVolume, aValue );
   521             break;
   502             break;
   522         }
   503         }
   523         case EMPXPbvSurfaceCreated:
   504         case EMPXPbvSurfaceCreated:
   524         {
   505         {
   525             iSurfaceCreated = ETrue;
       
   526             iControlsController->HandleEventL( EMPXControlCmdSurfaceCreated );
   506             iControlsController->HandleEventL( EMPXControlCmdSurfaceCreated );
   527             DrawNow();
   507             DrawNow();
   528             break;
   508             break;
   529         }
   509         }
   530         case EMPXPbvSurfaceRemoved:
   510         case EMPXPbvSurfaceRemoved:
   531         {
   511         {
   532             iSurfaceCreated = EFalse;
       
   533             iControlsController->HandleEventL( EMPXControlCmdSurfaceRemoved );
   512             iControlsController->HandleEventL( EMPXControlCmdSurfaceRemoved );
   534             DrawNow();
   513             DrawNow();
   535             break;
   514             break;
   536         }
   515         }
   537         default:
   516         default:
   608             0,
   587             0,
   609             TCallBack( CMPXVideoPlaybackContainer::HandleRealOneBitmapTimeout, this ) );
   588             TCallBack( CMPXVideoPlaybackContainer::HandleRealOneBitmapTimeout, this ) );
   610 
   589 
   611         DrawNow();
   590         DrawNow();
   612     }
   591     }
   613 
       
   614     iTvOutConnected = iFileDetails->iTvOutConnected;
       
   615 }
   592 }
   616 
   593 
   617 // -------------------------------------------------------------------------------------------------
   594 // -------------------------------------------------------------------------------------------------
   618 //   CMPXVideoPlaybackContainer::UserInputHandler()
   595 //   CMPXVideoPlaybackContainer::UserInputHandler()
   619 // -------------------------------------------------------------------------------------------------
   596 // -------------------------------------------------------------------------------------------------