Revision: 201023 RCL_3 PDK_3.0.1
authorDremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
Mon, 21 Jun 2010 15:36:50 +0300
branchRCL_3
changeset 18 407431f36921
parent 16 ce86b6d44a6d
child 20 2d2c7d1515f7
Revision: 201023 Kit: 2010125
inc/musindicatorapi.h
mmsharing/mmshengine/src/musengmcesession.cpp
mmsharing/mmshengine/src/musengorientationhandler.cpp
mmsharing/mmshengine/tsrc/ut_engine/src/ut_musengmcesession.cpp
mmsharing/mmshindicator/src/musindicatorapi.cpp
mmsharing/mmshui/inc/musuiclipsharingviewcontainer.h
mmsharing/mmshui/inc/musuigeneralview.h
mmsharing/mmshui/inc/musuisendviewcontainer.h
mmsharing/mmshui/src/musuiclipsharingview.cpp
mmsharing/mmshui/src/musuiclipsharingviewcontainer.cpp
mmsharing/mmshui/src/musuigeneralview.cpp
mmsharing/mmshui/src/musuilivesharingview.cpp
mmsharing/mmshui/src/musuireceiveview.cpp
mmsharing/mmshui/src/musuisendviewcontainer.cpp
--- a/inc/musindicatorapi.h	Wed Jun 09 09:37:52 2010 +0300
+++ b/inc/musindicatorapi.h	Mon Jun 21 15:36:50 2010 +0300
@@ -29,7 +29,7 @@
 #include <e32property.h>
 
 
-class CMusIndicatorDsa;
+
 class CAknGlobalMsgQuery;
 class CMusSoundPlayer;
 
@@ -146,11 +146,6 @@
         
 private: // data
 
-    /**
-     * Pointer to indicator window
-     * Own.
-     */
-    CMusIndicatorDsa* iIndicatorWindow;
 
     /**
      * Sound player.
--- a/mmsharing/mmshengine/src/musengmcesession.cpp	Wed Jun 09 09:37:52 2010 +0300
+++ b/mmsharing/mmshengine/src/musengmcesession.cpp	Mon Jun 21 15:36:50 2010 +0300
@@ -328,6 +328,11 @@
 EXPORT_C TBool CMusEngMceSession::IsDisplayEnabledL()
     {
     __ASSERT_ALWAYS( iSession, User::Leave( KErrNotReady ) );
+    if ( iSession->State() == CMceSession::ETerminated || 
+         iSession->State() == CMceSession::EIdle )
+        {
+        return EFalse;   
+        }
     CMceDisplaySink* display = MusEngMceUtils::GetDisplayL( *iSession );
     return display->IsEnabled();
     }
--- a/mmsharing/mmshengine/src/musengorientationhandler.cpp	Wed Jun 09 09:37:52 2010 +0300
+++ b/mmsharing/mmshengine/src/musengorientationhandler.cpp	Mon Jun 21 15:36:50 2010 +0300
@@ -24,7 +24,7 @@
 
 // SYSTEM
 
-const TInt KMusEngDelayedResume = 300000; // 300 ms
+const TInt KMusEngDelayedResume = 500000; // 500 ms
 
 // -----------------------------------------------------------------------------
 //
--- a/mmsharing/mmshengine/tsrc/ut_engine/src/ut_musengmcesession.cpp	Wed Jun 09 09:37:52 2010 +0300
+++ b/mmsharing/mmshengine/tsrc/ut_engine/src/ut_musengmcesession.cpp	Mon Jun 21 15:36:50 2010 +0300
@@ -237,6 +237,13 @@
     //Disable
     display->iIsEnabled = EFalse;
     EUNIT_ASSERT( !iLiveSession->IsDisplayEnabledL() );
+    
+    // Display is reported as disabled when session state is terminated or idle
+    iLiveSession->iSession->iState = CMceSession::ETerminated;
+    display->iIsEnabled = ETrue;
+    EUNIT_ASSERT( !iLiveSession->IsDisplayEnabledL() );
+    iLiveSession->iSession->iState = CMceSession::EIdle;
+    EUNIT_ASSERT( !iLiveSession->IsDisplayEnabledL() );
     }
 	
 	
--- a/mmsharing/mmshindicator/src/musindicatorapi.cpp	Wed Jun 09 09:37:52 2010 +0300
+++ b/mmsharing/mmshindicator/src/musindicatorapi.cpp	Mon Jun 21 15:36:50 2010 +0300
@@ -79,7 +79,6 @@
     MUS_LOG( "mus: [MUSIND ]  ->  MusIndicatorApi::~CMusIndicatorApi" );
     
     Cancel();
-    delete iIndicatorWindow;
     delete iSoundPlayer;
 
     Indicator( EFalse );
--- a/mmsharing/mmshui/inc/musuiclipsharingviewcontainer.h	Wed Jun 09 09:37:52 2010 +0300
+++ b/mmsharing/mmshui/inc/musuiclipsharingviewcontainer.h	Mon Jun 21 15:36:50 2010 +0300
@@ -111,6 +111,14 @@
      * @return           Handle to wanted control
      */
     CCoeControl* ComponentControl( TInt aIndex ) const;
+    
+    /**
+    * Gets called by the application framework when drawing is
+    * needed.
+    *
+    * @param aRect The rectangle that needs to be drawn.
+    */
+    void Draw( const TRect& aRect ) const;
 
     /**
      * Handles key events.
--- a/mmsharing/mmshui/inc/musuigeneralview.h	Wed Jun 09 09:37:52 2010 +0300
+++ b/mmsharing/mmshui/inc/musuigeneralview.h	Mon Jun 21 15:36:50 2010 +0300
@@ -244,6 +244,7 @@
     TInt ToolbarPlaceHolderHeight() const;
     TInt ToolbarPlaceHolderWidth() const;
     void UpdateBackgroundOrdinalPosition( TBool aUp );  
+    void RefreshBackgroundContainer();
 
 protected: // data
 
--- a/mmsharing/mmshui/inc/musuisendviewcontainer.h	Wed Jun 09 09:37:52 2010 +0300
+++ b/mmsharing/mmshui/inc/musuisendviewcontainer.h	Mon Jun 21 15:36:50 2010 +0300
@@ -77,10 +77,14 @@
      * @param aView         Parent view of container.
      * @param aRect         Frame rectangle for container.
      * @param aInputParams  Packaged data.
+     * @param aContainerVisible
+     * @param aIndicatorVisible
      */
     void ConstructL( CMusUiGeneralView* aView, 
                      const TRect& aRect,
-                     TAknOrientation aIndicatorLayout );
+                     TAknOrientation aIndicatorLayout,
+                     TBool aContainerVisible = EFalse,
+                     TBool aIndicatorVisible = EFalse );
 
 
 private: // from base class CCoeControl
--- a/mmsharing/mmshui/src/musuiclipsharingview.cpp	Wed Jun 09 09:37:52 2010 +0300
+++ b/mmsharing/mmshui/src/musuiclipsharingview.cpp	Mon Jun 21 15:36:50 2010 +0300
@@ -471,10 +471,7 @@
     {
     MUS_LOG( "mus: [MUSUI ]  -> CMusUiClipSharingView::RefreshView" );
     
-    if ( iBackgroundContainer )
-        {
-        iBackgroundContainer->SetRect( ClientRect() );
-        }
+    RefreshBackgroundContainer();
     
     if ( iContainer )
         {            
--- a/mmsharing/mmshui/src/musuiclipsharingviewcontainer.cpp	Wed Jun 09 09:37:52 2010 +0300
+++ b/mmsharing/mmshui/src/musuiclipsharingviewcontainer.cpp	Mon Jun 21 15:36:50 2010 +0300
@@ -48,7 +48,9 @@
     
     CMusUiSendViewContainer::ConstructL( aView, 
                                          aRect,
-                                         EAknOrientationHorizontal );
+                                         EAknOrientationHorizontal,
+                                         ETrue,
+                                         EFalse );
     // check if operator specific functionality is needed  
     iOperatorSpecificFunctionality = 
         ( MultimediaSharingSettings::OperatorVariantSettingL() == 
@@ -247,7 +249,7 @@
 void CMusUiClipSharingViewContainer::SetDurationIndicatorVisible( TBool aVisible )
     {
     iIndicator->SetIndicatorType(EMusUiIndicatorTypeDuration);
-    MakeVisible( aVisible );
+    iIndicator->MakeVisible( aVisible );
     }
     
 
@@ -309,6 +311,24 @@
     return control;
     }
 
+// -----------------------------------------------------------------------------
+// Called by framework to redraw the screen area.
+// -----------------------------------------------------------------------------
+//
+void CMusUiClipSharingViewContainer::Draw( const TRect& aRect ) const
+    {
+    CWindowGc& gc = SystemGc();
+
+    MAknsSkinInstance* skin = AknsUtils::SkinInstance();
+    MAknsControlContext* cc = AknsDrawUtils::ControlContext( this );
+    if(!AknsDrawUtils::Background( skin, cc,this,gc,aRect,KAknsDrawParamDefault ))
+        {
+        MUS_LOG( "mus: [MUSUI ]     Skin not valid or not found" );
+        gc.SetBrushColor( iEikonEnv->ControlColor( EColorWindowBackground, *this ) );
+        gc.SetBrushStyle( CGraphicsContext::ESolidBrush );
+        gc.Clear( aRect );
+        }
+    }
 
 // -----------------------------------------------------------------------------
 // Called by framework to act on key events if required.
--- a/mmsharing/mmshui/src/musuigeneralview.cpp	Wed Jun 09 09:37:52 2010 +0300
+++ b/mmsharing/mmshui/src/musuigeneralview.cpp	Mon Jun 21 15:36:50 2010 +0300
@@ -893,8 +893,34 @@
     if ( iBackgroundContainer )
         {
         iBackgroundContainer->UpdateOrdinalPositionValue( aUp );              
-        }    
+        }
     }
+
+// -----------------------------------------------------------------------------
+// Do refresh for background container only if display is disabled.
+// Refreshing if display is enabled would cause bg container
+// to draw itself on top of display area, making it invisible.
+// -----------------------------------------------------------------------------
+//
+void CMusUiGeneralView::RefreshBackgroundContainer()
+    {
+    if ( !iBackgroundContainer )
+        {
+        return;
+        }  
+    TBool displayEnabled( EFalse );
+    if ( EventController() )
+        {
+        TRAP_IGNORE( displayEnabled = EventController()->IsDisplayEnabledL() )
+        }
+
+    if ( !displayEnabled )
+        {
+        MUS_LOG( "mus: [MUSUI ] <-> CMusUiGeneralView::RefreshBackgroundContainer()" )
+        iBackgroundContainer->SetRect( ClientRect() );
+        }
+    }
+
 // end of file
 
 
--- a/mmsharing/mmshui/src/musuilivesharingview.cpp	Wed Jun 09 09:37:52 2010 +0300
+++ b/mmsharing/mmshui/src/musuilivesharingview.cpp	Mon Jun 21 15:36:50 2010 +0300
@@ -591,10 +591,9 @@
     {
     MUS_LOG( "mus: [MUSUI ]  -> CMusUiLiveSharingView::DoRefreshView" );
     
-    if ( iBackgroundContainer )
-        {
-        iBackgroundContainer->SetRect(ClientRect());
-        }
+    // Refresh background container before and after as display status
+    // may change due async orientation change handling.
+    RefreshBackgroundContainer();
     
     if ( iContainer )
         {
@@ -620,6 +619,8 @@
             }                        
         iController->SetRect( videoRect );
         }
+    
+    RefreshBackgroundContainer();
             
     MUS_LOG( "mus: [MUSUI ]  <- CMusUiLiveSharingView::DoRefreshView" );
     } 
--- a/mmsharing/mmshui/src/musuireceiveview.cpp	Wed Jun 09 09:37:52 2010 +0300
+++ b/mmsharing/mmshui/src/musuireceiveview.cpp	Mon Jun 21 15:36:50 2010 +0300
@@ -390,10 +390,7 @@
     {
     MUS_LOG( "mus: [MUSUI ]  -> CMusUiReceiveView::RefreshView" );
     
-    if ( iBackgroundContainer )
-    	{
-		iBackgroundContainer->SetRect( ClientRect() );
-    	}
+    RefreshBackgroundContainer();
     
     if ( iContainer )
         {
--- a/mmsharing/mmshui/src/musuisendviewcontainer.cpp	Wed Jun 09 09:37:52 2010 +0300
+++ b/mmsharing/mmshui/src/musuisendviewcontainer.cpp	Mon Jun 21 15:36:50 2010 +0300
@@ -46,9 +46,12 @@
 //
 void CMusUiSendViewContainer::ConstructL( CMusUiGeneralView* aView,
                                           const TRect& aRect,
-                                          TAknOrientation aIndicatorLayout )
+                                          TAknOrientation aIndicatorLayout,
+                                          TBool aContainerVisible,
+                                          TBool aIndicatorVisible )
     {
-    MUS_LOG( "mus: [MUSUI ]  -> CMusUiSendViewContainer::ConstructL" );
+    MUS_LOG2( "mus: [MUSUI ]  -> CMusUiSendViewContainer::ConstructL, visibilty:%d,%d",
+        aContainerVisible, aIndicatorVisible );
     
     CreateWindowL();
     iView = aView;
@@ -70,8 +73,13 @@
     SetRect( aRect );
     
     iIndicator->SetRect( Rect() );
+    
+    if ( aContainerVisible && !aIndicatorVisible )
+        {
+        iIndicator->MakeVisible( aIndicatorVisible );
+        }
 
-    MakeVisible( EFalse );
+    MakeVisible( aContainerVisible );
     ActivateL();
     
     MUS_LOG( "mus: [MUSUI ]  <- CMusUiSendViewContainer::ConstructL" );