# HG changeset patch # User Dremov Kirill (Nokia-D-MSW/Tampere) # Date 1277123810 -10800 # Node ID 407431f36921c1f3c7a1c65056c22fc41c1ee887 # Parent ce86b6d44a6d7790c7a64bac013589408887840f Revision: 201023 Kit: 2010125 diff -r ce86b6d44a6d -r 407431f36921 inc/musindicatorapi.h --- 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 -class CMusIndicatorDsa; + class CAknGlobalMsgQuery; class CMusSoundPlayer; @@ -146,11 +146,6 @@ private: // data - /** - * Pointer to indicator window - * Own. - */ - CMusIndicatorDsa* iIndicatorWindow; /** * Sound player. diff -r ce86b6d44a6d -r 407431f36921 mmsharing/mmshengine/src/musengmcesession.cpp --- 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(); } diff -r ce86b6d44a6d -r 407431f36921 mmsharing/mmshengine/src/musengorientationhandler.cpp --- 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 // ----------------------------------------------------------------------------- // diff -r ce86b6d44a6d -r 407431f36921 mmsharing/mmshengine/tsrc/ut_engine/src/ut_musengmcesession.cpp --- 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() ); } diff -r ce86b6d44a6d -r 407431f36921 mmsharing/mmshindicator/src/musindicatorapi.cpp --- 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 ); diff -r ce86b6d44a6d -r 407431f36921 mmsharing/mmshui/inc/musuiclipsharingviewcontainer.h --- 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. diff -r ce86b6d44a6d -r 407431f36921 mmsharing/mmshui/inc/musuigeneralview.h --- 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 diff -r ce86b6d44a6d -r 407431f36921 mmsharing/mmshui/inc/musuisendviewcontainer.h --- 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 diff -r ce86b6d44a6d -r 407431f36921 mmsharing/mmshui/src/musuiclipsharingview.cpp --- 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 ) { diff -r ce86b6d44a6d -r 407431f36921 mmsharing/mmshui/src/musuiclipsharingviewcontainer.cpp --- 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. diff -r ce86b6d44a6d -r 407431f36921 mmsharing/mmshui/src/musuigeneralview.cpp --- 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 diff -r ce86b6d44a6d -r 407431f36921 mmsharing/mmshui/src/musuilivesharingview.cpp --- 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" ); } diff -r ce86b6d44a6d -r 407431f36921 mmsharing/mmshui/src/musuireceiveview.cpp --- 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 ) { diff -r ce86b6d44a6d -r 407431f36921 mmsharing/mmshui/src/musuisendviewcontainer.cpp --- 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" );