Revision: 201019 RCL_3 PDK_3.0.0
authorDremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
Tue, 25 May 2010 12:39:12 +0300
branchRCL_3
changeset 18 56b11cf8addb
parent 17 70a8526f03f2
child 19 a12246c97fcc
Revision: 201019 Kit: 2010121
mpxmusicplayer/app/src/mpxappui.cpp
mpxmusicplayer/mediakeyhandler/inc/mpxmediakeyhandlerimp.h
mpxmusicplayer/mediakeyhandler/src/mpxmediakeyhandlerimp.cpp
mpxplugins/serviceplugins/collectionplugins/mpxsqlitedbcommon/src/mpxdbmanager.cpp
mpxplugins/serviceplugins/playbackplugins/localaudio/inc/mpxlocalaudioplayback.h
mpxplugins/serviceplugins/playbackplugins/localaudio/src/mpxlocalaudioplayback.cpp
mpxplugins/serviceplugins/playbackplugins/progressdownloadsb/inc/mpxprogressdownloadsb.h
mpxplugins/serviceplugins/playbackplugins/progressdownloadsb/src/mpxprogressdownloadsb.cpp
mpxplugins/serviceplugins/screensaverplugins/mpxscreensaverplugin/data/mpxscreensaverplugin.rss
mpxplugins/viewplugins/views/collectionviewhg/data/mpxcollectionviewhg.rss
mpxplugins/viewplugins/views/collectionviewhg/group/mpxcollectionviewhg.mmp
mpxplugins/viewplugins/views/collectionviewhg/inc/mpxcollectionviewhgcontainer.h
mpxplugins/viewplugins/views/collectionviewhg/inc/mpxcollectionviewhgimp.h
mpxplugins/viewplugins/views/collectionviewhg/src/mpxcollectionviewhgcontainer.cpp
mpxplugins/viewplugins/views/collectionviewhg/src/mpxcollectionviewhgimp.cpp
mpxplugins/viewplugins/views/commonplaybackview/loc/mpxcommonplaybackview.loc
mpxplugins/viewplugins/views/commonplaybackview/src/mpxcommonplaybackviewcontainer.cpp
mpxplugins/viewplugins/views/commonplaybackview/src/mpxcommonplaybackviewimp.cpp
mpxplugins/viewplugins/views/inc/mpxcommonplaybackviewcontainer.h
mpxplugins/viewplugins/views/metadataeditordialog/src/mpxmetadataeditordialog.cpp
--- a/mpxmusicplayer/app/src/mpxappui.cpp	Tue May 11 16:10:56 2010 +0300
+++ b/mpxmusicplayer/app/src/mpxappui.cpp	Tue May 25 12:39:12 2010 +0300
@@ -159,6 +159,7 @@
 const TUid KCRUidMPXMPSettings = {0x101FFCDC};
 const TUint32 KMPXMPPlaybackRandomMode = 0x0B;
 const TUint32 KMPXMPPlaybackRepeatMode = 0x0C;
+const TInt KIMMusicPluginUid  = 0x10282960;
 
 // ======== MEMBER FUNCTIONS ========
 
@@ -3415,15 +3416,45 @@
 
             MMPXPlaybackUtility* activePlaybackUtility = MMPXPlaybackUtility::UtilityL( KPbModeActivePlayer );
 
-            MMPXPlayer* player =
-                activePlaybackUtility->PlayerManager().CurrentPlayer();
+            
+            MMPXSource* source = activePlaybackUtility->Source();
+            CMPXCollectionPlaylist* pl = NULL;
+            if( source )
+                {
+                CMPXCollectionPlaylist* pl = source->PlaylistL();
+                if (pl)
+                    {
+                    CleanupStack::PushL( pl );
+                    const CMPXCollectionPath& path = pl->Path();
+                    if(path.Levels() > 0)
+                        {
+                        //Fix for ou1cimx1#355699 Go to Now Playing view doesn’t work after application interaction
+                        //If active player is KIMMusicPluginUid i.e. embedded player, we don't want use it because
+                        //eventually plugin resolver resolves then wrong plugin. Instead of it get this instance's 
+                        //default playback utility 
+                        if ((TUid::Uid(path.Id(0)).iUid) == KIMMusicPluginUid)
+                            {
+                            source = NULL;
+                            activePlaybackUtility->Close();
+                            activePlaybackUtility = MMPXPlaybackUtility::UtilityL( KPbModeDefault );
+                            }
+                        }
+                    CleanupStack::PopAndDestroy( pl );
+					pl = NULL;
+                    }
+                }
+            
             TUid pluginUid( KNullUid );
             RArray<TUid> array;
             CleanupClosePushL( array );
 
-
-            MMPXSource* source = activePlaybackUtility->Source();
-            CMPXCollectionPlaylist* pl = NULL;
+            MMPXPlayer* player =
+                activePlaybackUtility->PlayerManager().CurrentPlayer();
+
+            if (!source)
+                {
+                source = activePlaybackUtility->Source();
+                }
             if( source )
                 {
                 pl = source->PlaylistL();
--- a/mpxmusicplayer/mediakeyhandler/inc/mpxmediakeyhandlerimp.h	Tue May 11 16:10:56 2010 +0300
+++ b/mpxmusicplayer/mediakeyhandler/inc/mpxmediakeyhandlerimp.h	Tue May 25 12:39:12 2010 +0300
@@ -342,6 +342,11 @@
      * @return The check result. If mpx is foreground, return true.
      */
     TBool IsAppForeground();
+    
+    static VolumePopupSynchTimerCallback( TAny* aPtr );
+    void DoVolumePopupSynch();
+    void StartVolumePopupSynchTimer();
+    
 
 private:    // Data
 
@@ -375,13 +380,12 @@
     TInt iCurrentVol;
     TBool iIncreaseVol;
     TBool iMuted;
-    TInt iTouchVolEventCount;
-    TInt iVolumeEventCount;
     TInt iVolumeSteps;			// Number of volume steps in ui
     #ifdef UPNP_INCLUDED
     CUpnpCopyCommand* iUpnpCopyCommand;
     #endif
     TInt iUpnpVolume; // absolute upnp volume value
+    CPeriodic* iVolumePopupSynchTimer;
     };
 
 #endif  // C_CMPXMEDIAKEYHANDLERIMP_H
--- a/mpxmusicplayer/mediakeyhandler/src/mpxmediakeyhandlerimp.cpp	Tue May 11 16:10:56 2010 +0300
+++ b/mpxmusicplayer/mediakeyhandler/src/mpxmediakeyhandlerimp.cpp	Tue May 25 12:39:12 2010 +0300
@@ -68,7 +68,7 @@
 const TInt KMPXVolumeSteps(1);
 const TInt KTenStepsVolume = 10;   
 const TInt KTwentyStepsVolume = 20;
-
+const TInt KVolumePopupSynchInterval = 300000; // 300 ms
 const TRemConCoreApiOperationId KSupportedCoreFeatures[] = {
         ERemConCoreApiVolumeUp,
         ERemConCoreApiVolumeDown,
@@ -164,7 +164,10 @@
         iVolPopup->SetObserver(this);
         iVolPopup->SetRange(KMPXMinVolume, iVolumeSteps);
         iVolPopup->SetStepSize(KMPXVolumeSteps);
-
+        // Ensure that initial value is set to popup. If not initialized, CAknVolumePopup::Value() returns 0 
+        // but the control appears unmuted and allows volume to be decreased out of range (panics also with Avkon 6 in UDEB)
+        iVolPopup->SetValue( 0 );
+        
         HBufC* popupText = StringLoader::LoadLC( R_MPX_VOLUME_POPUP_TEXT );
         iVolPopup->SetTitleTextL( *popupText );
         CleanupStack::PopAndDestroy( popupText );
@@ -207,6 +210,7 @@
             }
         }
 #endif
+    iVolumePopupSynchTimer = CPeriodic::NewL( CActive::EPriorityStandard );
     }
 
 // ---------------------------------------------------------------------------
@@ -232,6 +236,11 @@
 //
 CMPXMediaKeyHandlerImp::~CMPXMediaKeyHandlerImp()
     {
+    if ( iVolumePopupSynchTimer )
+        {
+        iVolumePopupSynchTimer->Cancel();
+        delete iVolumePopupSynchTimer;
+        }
     if ( iPlaybackUtility )
         {
         TRAP_IGNORE( iPlaybackUtility->RemoveObserverL( *this ) );
@@ -324,8 +333,6 @@
 
         if ( forwardCommand )
             {
-            iVolumeEventCount++;
-        	
             TInt volume(0);
             TFileName subPlayerName;
             TMPXPlaybackPlayerType currentPlayerType = EPbLocal;
@@ -350,6 +357,7 @@
                 volume = KMPXMaxVolume;
                 }
             
+            MPX_DEBUG3( "CMPXMediaKeyHandlerImp::DoFilterAndSendCommandL: aCommandId(%d), volume(%d)" , aCommandId, volume );
             iObserver->HandleMediaKeyCommand( aCommandId, volume );
             }
         }
@@ -461,91 +469,69 @@
                 }
             case EPbPropertyMute:
             	{
-                if ( iTouchVolEventCount > 0 )
-                    {
-                    --iTouchVolEventCount;
-                    }
-                if ( iVolumeEventCount > 0 )
-                	{
-                	--iVolumeEventCount;
-                	}
             	iMuted = aValue;
-            	if ( iMuted )
-            	    {
-            	    iVolPopup->SetValue( 0 );
-            	    }
-            	else
-            		{
-            		iVolPopup->SetValue( iCurrentVol );
-            		}
+            	StartVolumePopupSynchTimer();
 				break;
 				}
 			case EPbPropertyVolume:
                 {
-				if ( iVolPopup )
-					{
-	                if ( iTouchVolEventCount > 0 )
-	                    {
-	                    --iTouchVolEventCount;
-	                    }
-					// Avkon Volume has 10 steps, but the rest of the framework
-                    // has 100 steps. Need to scale it to 10 steps.
-                    if ( aValue > 0 )
+                // Avkon Volume has 10 steps, but the rest of the framework
+                // has 100 steps. Need to scale it to 10 steps.
+                if ( aValue > 0 )
+                    {
+                    aValue = aValue * iVolumeSteps;
+                    aValue = aValue / KPbPlaybackVolumeLevelMax;
+                    if ( aValue > iVolumeSteps )
                         {
-                        aValue = aValue * iVolumeSteps;
-                        aValue = aValue / KPbPlaybackVolumeLevelMax;
-                        if ( aValue > iVolumeSteps )
-                        	{
-                        	aValue = iVolumeSteps;
-                        	}
+                        aValue = iVolumeSteps;
                         }
+                    }
 
-					if( !iMuted && aValue > 0 ) // unmute
-			            {
-			            iMuted = EFalse;
-			            iCurrentVol = aValue;
-			            iVolPopup->SetValue( iCurrentVol );
-			            }
-		            else if( aValue == 0 ) // mute
-			            {
-			            if( !iMuted ) 
-				            {
-				            iMuted = ETrue;
-				            iVolPopup->SetValue( 0 );
-				            }
-			            }
-                    else if ( aValue != iCurrentVol && !iTouchVolEventCount && !iVolumeEventCount )
-					    {
-					    if ( aValue != 0 )
-					        {
-					        iCurrentVol = aValue;
-					        }
-				        iVolPopup->SetValue( iCurrentVol );
-					    }
+                if( iMuted && aValue > 0  ) // unmute
+                    {
+                    iMuted = EFalse;
+                    iCurrentVol = aValue;
+                    }
+                else if( aValue == 0 ) // mute
+                    {
+                    if( !iMuted ) 
+                        {
+                        iMuted = ETrue;
+                        }
+                    }
+                    else if ( aValue != iCurrentVol )
+                    {
+                    if ( aValue != 0 )
+                        {
+                        iCurrentVol = aValue;
+                        }
+                    }
+                
+                if ( iCurrentVol == KErrNotFound ) // muted by some other application before launching Music Player
+                    {
+                    iCurrentVol = aValue;
+                    }
+                
+                StartVolumePopupSynchTimer();
+                
+                // send a command to UI to display Volume bar on device when controlling volume via UPnP  
+                if ( IsUpnpVisibleL() && iPlayerState != EPbStateNotInitialised )
+                    {
+                    TFileName subPlayerName;
+                    TMPXPlaybackPlayerType currentPlayerType = EPbLocal;
+                    GetSubPlayerInfoL( subPlayerName, currentPlayerType );
 
-				    if ( iVolumeEventCount > 0 )
-				    	{
-				    	--iVolumeEventCount;
-					    }
-
-                    // send a command to UI to display Volume bar on device when controlling volume via UPnP  
-                    if ( IsUpnpVisibleL() && iPlayerState != EPbStateNotInitialised )
+                    if ( currentPlayerType != EPbLocal )
                         {
-                        TFileName subPlayerName;
-                        TMPXPlaybackPlayerType currentPlayerType = EPbLocal;
-                        GetSubPlayerInfoL( subPlayerName, currentPlayerType );
-
-                        if ( currentPlayerType != EPbLocal )
-                            {
-                            iObserver->HandleMediaKeyCommand( EPbCmdSetVolume, iUpnpVolume ); 
-                            }            
-                        }
-							  
-					if ( iUpnpFrameworkSupport )
-						{
-						SetVolumePopupTitleL();
-						}
-					}
+                        iObserver->HandleMediaKeyCommand( EPbCmdSetVolume, iUpnpVolume ); 
+                        }            
+                    }
+                          
+                if ( iUpnpFrameworkSupport )
+                    {
+                    SetVolumePopupTitleL();
+                    }
+					
 				break;
                 }
             default:
@@ -771,12 +757,16 @@
 			{
 			iMuted = EFalse;
 			iCommandId = EPbCmdUnMuteVolume;
+            if ( iCurrentVol == 0 ) // prevent muting again when HandleControlEvent is called next time
+                {
+                iCurrentVol = 1; // "1" is the first step of 20-step volume
+                }
 			iVolPopup->SetValue( iCurrentVol );
 			}
 		else
 			{
 			iCommandId = EPbCmdSetVolume;
-			iCurrentVol = iCurrentVol < iVolumeSteps ? (iCurrentVol + 1) : iCurrentVol;	// +KMPXVolumeSteps; ?
+			iCurrentVol = iCurrentVol < iVolumeSteps ? (iCurrentVol + 1) : iCurrentVol;
 			iVolPopup->SetValue( iCurrentVol );
 			}
 		}
@@ -797,7 +787,7 @@
 		else
 			{
 			iCommandId = EPbCmdSetVolume;
-			iCurrentVol = iCurrentVol - 1;	// KMPXVolumeSteps ?
+			iCurrentVol = iCurrentVol - 1;
 			iVolPopup->SetValue( iCurrentVol );
 			}
 		}
@@ -1241,6 +1231,7 @@
 //
 void CMPXMediaKeyHandlerImp::HandleControlEventL( CCoeControl* aControl, TCoeEvent aEventType )
 	{
+    MPX_FUNC("CMPXMediaKeyHandlerImp::HandleControlEventL");
 	if ( !AknLayoutUtils::PenEnabled() )
 		{
 		return;
@@ -1249,13 +1240,15 @@
 	if( (aEventType == EEventStateChanged) && (aControl == iVolPopup) )
 		{
 		TInt vol = iVolPopup->Value();
-		if ( vol == iCurrentVol )
+		
+		MPX_DEBUG4( "CMPXMediaKeyHandlerImp::HandleControlEventL: vol(%d), iCurrentVol(%d), iMuted(%d)", vol, iCurrentVol, iMuted );
+		
+		if ( vol == iCurrentVol && vol != 0 )
 		    {
             if ( iMuted )
                 {
                 iMuted = EFalse;
                 FilterAndSendCommand( EPbCmdUnMuteVolume );
-                iTouchVolEventCount++;
                 }
             else
                 {
@@ -1273,7 +1266,6 @@
 			    {
 			    iMuted = ETrue;
 			    FilterAndSendCommand( EPbCmdMuteVolume );
-			    iTouchVolEventCount++;
 			    }
 			}
 		else
@@ -1281,15 +1273,19 @@
 			if ( iMuted )
 				{
 				iMuted = EFalse;
+				
+				if ( iCurrentVol == 0 ) // setting volume to 0 would reapply mute, use slider value instead
+				    {
+                    iCurrentVol = vol;
+				    }
+				
 				iVolPopup->SetValue( iCurrentVol );
 				FilterAndSendCommand( EPbCmdUnMuteVolume );
-				iTouchVolEventCount++;
 				}
 			else
 				{
 				iCurrentVol = vol;
 				FilterAndSendCommand( EPbCmdSetVolume );
-				iTouchVolEventCount++;
 				}
 			}
 		}
@@ -1319,4 +1315,60 @@
 
     return isForeground;
     }
+
+// ---------------------------------------------------------------------------
+// CMPXMediaKeyHandlerImp::VolumePopupSynchTimerCallback
+// ---------------------------------------------------------------------------
+//
+TInt CMPXMediaKeyHandlerImp::VolumePopupSynchTimerCallback( TAny* aPtr )
+    {
+    static_cast<CMPXMediaKeyHandlerImp*>( aPtr )->DoVolumePopupSynch();
+    return KErrNone;
+    }
+
+// ---------------------------------------------------------------------------
+// CMPXMediaKeyHandlerImp::DoVolumePopupSynch
+// ---------------------------------------------------------------------------
+//
+void CMPXMediaKeyHandlerImp::DoVolumePopupSynch()
+    {
+    MPX_FUNC("CMPXMediaKeyHandlerImp::DoVolumePopupSynch");
+    
+    iVolumePopupSynchTimer->Cancel();
+    
+    TInt popupValue = iVolPopup->Value();
+    
+    MPX_DEBUG4("CMPXMediaKeyHandlerImp::DoVolumePopupSynch: popupValue(%d), iMuted(%d), iCurrentVol(%d)",
+               popupValue, iMuted, iCurrentVol );
+    
+    if ( iMuted )
+        {
+        if ( popupValue != 0 )
+            {
+            MPX_DEBUG1("CMPXMediaKeyHandlerImp::DoVolumePopupSynch: popup out of synch (muted)" );
+            iVolPopup->SetValue( 0 );
+            }
+        }
+    else
+        {
+        if ( iCurrentVol != popupValue )
+            {
+            MPX_DEBUG1("CMPXMediaKeyHandlerImp::DoVolumePopupSynch: popup out of synch" );
+            iVolPopup->SetValue( iCurrentVol );
+            }
+        }
+    }
+
+// ---------------------------------------------------------------------------
+// CMPXMediaKeyHandlerImp::StartVolumePopupSynchTimer
+// ---------------------------------------------------------------------------
+//
+void CMPXMediaKeyHandlerImp::StartVolumePopupSynchTimer()
+    {
+    iVolumePopupSynchTimer->Cancel();
+    iVolumePopupSynchTimer->Start( KVolumePopupSynchInterval,
+                                   KVolumePopupSynchInterval,
+                                   TCallBack( VolumePopupSynchTimerCallback, this ) );
+
+    }
 // End of File
--- a/mpxplugins/serviceplugins/collectionplugins/mpxsqlitedbcommon/src/mpxdbmanager.cpp	Tue May 11 16:10:56 2010 +0300
+++ b/mpxplugins/serviceplugins/collectionplugins/mpxsqlitedbcommon/src/mpxdbmanager.cpp	Tue May 25 12:39:12 2010 +0300
@@ -29,7 +29,7 @@
 #include <sysutil.h>
 #ifdef __RAMDISK_PERF_ENABLE
 #include <centralrepository.h>
-#include <BAUTILS.H>  
+#include <bautils.h>  
 #include <mpxinternalcrkeys.h>
 #endif //__RAMDISK_PERF_ENABLE
 
--- a/mpxplugins/serviceplugins/playbackplugins/localaudio/inc/mpxlocalaudioplayback.h	Tue May 11 16:10:56 2010 +0300
+++ b/mpxplugins/serviceplugins/playbackplugins/localaudio/inc/mpxlocalaudioplayback.h	Tue May 25 12:39:12 2010 +0300
@@ -180,14 +180,16 @@
         /**
         * Sets the volume level in audio controller
         * @param aVolume Volume level, ranges from 0 - KPbPlaybackVolumeLevelMax
+        * @param aNotifyChange ETrue if EPVolumeChanged must be sent to observer
         */
-        void SetVolume( TInt aVolume );
+        void SetVolume( TInt aVolume, TBool aNotifyChange = ETrue );
 
         /**
         * Sets the volume level in audio controller to mute.
         * @param aMute ETrue to indicated mute
+        * @param aNotifyChange ETrue if EPMuteChanged must be sent to observer 
         */
-        void SetMute( TBool aMute );
+        void SetMute( TBool aMute, TBool aNotifyChange = ETrue );
 
         /**
         *  Consumes the rights for the current media according
--- a/mpxplugins/serviceplugins/playbackplugins/localaudio/src/mpxlocalaudioplayback.cpp	Tue May 11 16:10:56 2010 +0300
+++ b/mpxplugins/serviceplugins/playbackplugins/localaudio/src/mpxlocalaudioplayback.cpp	Tue May 25 12:39:12 2010 +0300
@@ -495,14 +495,14 @@
         {
         case EPbPropertyVolume:
             {
-            SetVolume( aValue );
+            SetVolume( aValue, EFalse ); // don't notify MPX because playback engine converts EPSetComplete to EPropertyChanged
             break;
             }
         case EPbPropertyVolumeRamp:
             iPlayer->SetVolumeRamp(TTimeIntervalMicroSeconds(TInt64(aValue)));
             break;
         case EPbPropertyMute:
-            SetMute( aValue );
+            SetMute( aValue, EFalse ); // don't notify MPX because playback engine converts EPSetComplete to EPropertyChanged
             break;
         case EPbPropertyBalance:
             iPlayer->SetBalance(MMFBalance(aValue));
@@ -1110,7 +1110,7 @@
 // Sets the volume level in audio controller
 // ----------------------------------------------------------------------------
 //
-void CMPXLocalAudioPlayback::SetVolume( TInt aVolume )
+void CMPXLocalAudioPlayback::SetVolume( TInt aVolume, TBool aNotifyChange )
     {
     MPX_DEBUG3("-->CMPXLocalAudioPlayback::SetVolume 0x%08x vol (%d)", this, aVolume);
 
@@ -1162,9 +1162,15 @@
                 }
             }
         }
+    else if ( volError == KErrNone && aVolume == currentVol && changed )
+        {
+        // volume changed only to player after it has been initialised, 
+        // no need to reflect this to upper layers as the stored setting haven't changed
+        changed = EFalse;
+        }
 
     // Notify observer if value changed
-    if ( changed )
+    if ( changed && aNotifyChange )
         {
         iObs->HandlePluginEvent( MMPXPlaybackPluginObserver::EPVolumeChanged,
                                  aVolume,
@@ -1178,7 +1184,7 @@
 // Sets the volume level in audio controller
 // ----------------------------------------------------------------------------
 //
-void CMPXLocalAudioPlayback::SetMute( TBool aMute )
+void CMPXLocalAudioPlayback::SetMute( TBool aMute, TBool aNotifyChange )
     {
     MPX_DEBUG3("-->CMPXLocalAudioPlayback::SetMute 0x%08x vol (%d)", this, aMute);
 
@@ -1214,10 +1220,14 @@
             {
             MPX_TRAP( muteError, iMuteWatcher->SetValueL( aMute ) );
             }
+        else if ( changed ) // Cenrep setting hasn't changed, no need to propagate to MPX
+            {
+            changed = EFalse;
+            }
         }
 
     // Notify observer if value changed
-    if ( changed )
+    if ( changed  && aNotifyChange )
         {
         iObs->HandlePluginEvent( MMPXPlaybackPluginObserver::EPMuteChanged,
                                  aMute,
--- a/mpxplugins/serviceplugins/playbackplugins/progressdownloadsb/inc/mpxprogressdownloadsb.h	Tue May 11 16:10:56 2010 +0300
+++ b/mpxplugins/serviceplugins/playbackplugins/progressdownloadsb/inc/mpxprogressdownloadsb.h	Tue May 25 12:39:12 2010 +0300
@@ -197,14 +197,16 @@
         /**
         * Sets the volume level in audio controller
         * @param aVolume Volume level, ranges from 0 - KPbPlaybackVolumeLevelMax
+        * @param aNotifyChange ETrue if EPVolumeChanged must be sent to observer
         */
-        void SetVolume( TInt aVolume );
+        void SetVolume( TInt aVolume, TBool aNotifyChange = EFalse );
 
         /**
         * Sets the volume level in audio controller to mute.
         * @param aMute ETrue to indicated mute
+        * @param aNotifyChange ETrue if EPMuteChanged must be sent to observer
         */
-        void SetMute( TBool aMute );
+        void SetMute( TBool aMute, TBool aNotifyChange = EFalse );
 
         void ResetEnhancedMediaClient();
 
--- a/mpxplugins/serviceplugins/playbackplugins/progressdownloadsb/src/mpxprogressdownloadsb.cpp	Tue May 11 16:10:56 2010 +0300
+++ b/mpxplugins/serviceplugins/playbackplugins/progressdownloadsb/src/mpxprogressdownloadsb.cpp	Tue May 25 12:39:12 2010 +0300
@@ -472,7 +472,7 @@
         {
         case EPbPropertyVolume:
             {
-            SetVolume(aValue);
+            SetVolume( aValue, EFalse ); // don't notify MPX because playback engine converts EPSetComplete to EPropertyChanged
             }
             break;
         case EPbPropertyVolumeRamp:
@@ -489,7 +489,7 @@
             }
             break;
         case EPbPropertyMute:
-            SetMute( aValue );
+            SetMute( aValue, EFalse );  // don't notify MPX because playback engine converts EPSetComplete to EPropertyChanged
             break;
         case EPbPropertyBalance:
             break;
@@ -1372,7 +1372,7 @@
 // Sets the volume level in audio controller
 // ----------------------------------------------------------------------------
 //
-void CMPXProgressDownloadSB::SetVolume( TInt aVolume )
+void CMPXProgressDownloadSB::SetVolume( TInt aVolume, TBool aNotifyChange )
     {
     MPX_DEBUG2("CMPXProgressDownloadSB::SetVolume(%d) entering", aVolume);
 
@@ -1430,7 +1430,7 @@
 
 
     // Notify observer if value changed
-    if ( changed )
+    if ( changed && aNotifyChange )
         {
         iObs->HandlePluginEvent( MMPXPlaybackPluginObserver::EPVolumeChanged,
                                  aVolume,
@@ -1444,7 +1444,7 @@
 // Sets the volume level in audio controller
 // ----------------------------------------------------------------------------
 //
-void CMPXProgressDownloadSB::SetMute( TBool aMute )
+void CMPXProgressDownloadSB::SetMute( TBool aMute, TBool aNotifyChange )
     {
     MPX_DEBUG3("-->CMPXProgressDownloadSB::SetMute 0x%08x vol (%d)", this, aMute);
 
@@ -1483,7 +1483,7 @@
         }
 
     // Notify observer if value changed
-    if ( changed )
+    if ( changed && aNotifyChange )
         {
         iObs->HandlePluginEvent( MMPXPlaybackPluginObserver::EPMuteChanged,
                                  aMute,
--- a/mpxplugins/serviceplugins/screensaverplugins/mpxscreensaverplugin/data/mpxscreensaverplugin.rss	Tue May 11 16:10:56 2010 +0300
+++ b/mpxplugins/serviceplugins/screensaverplugins/mpxscreensaverplugin/data/mpxscreensaverplugin.rss	Tue May 25 12:39:12 2010 +0300
@@ -580,7 +580,7 @@
 //
 RESOURCE AVKON_LAYOUT_LABEL r_mpx_screensaver_title_layout_qhd_portrait
     {
-    font = EAknLogicalFontPrimaryFont; C = 0; l = 44; r = 10; B = 118; W = 298; J = ELayoutAlignLeft;
+    font = EAknLogicalFontPrimaryFont; C = 0; l = 44; r = 10; B = 107; W = 298; J = ELayoutAlignLeft;
     }
 
 // ---------------------------------------------------------------------------
--- a/mpxplugins/viewplugins/views/collectionviewhg/data/mpxcollectionviewhg.rss	Tue May 11 16:10:56 2010 +0300
+++ b/mpxplugins/viewplugins/views/collectionviewhg/data/mpxcollectionviewhg.rss	Tue May 25 12:39:12 2010 +0300
@@ -1576,30 +1576,30 @@
 // -----------------------------------------------------------------------------
 //
 RESOURCE DIALOG r_mpx_about_dialog
-     {
-     flags=EEikDialogFlagNoDrag |EEikDialogFlagCbaButtons |EEikDialogFlagWait;
-     buttons = R_AVKON_SOFTKEYS_OK_EMPTY;
-     items =
-         {
-         DLG_LINE
-             {
-             type = EAknCtPopupHeadingPane;
-             id = EAknMessageQueryHeaderId;
-             control = AVKON_HEADING
-                 {
-                 headinglayout = R_AVKON_LIST_HEADING_PANE_POPUPS;
-                 };
-             },
-         DLG_LINE
-             {
-             type = EAknCtMessageQuery;
-             id = EAknMessageQueryContentId;
-             control = AVKON_MESSAGE_QUERY
-                 {
-                 };
-             }
-         };
-     }
+    {
+    flags = EGeneralQueryFlags;
+    buttons = R_AVKON_SOFTKEYS_OK_EMPTY;
+    items =
+        {
+        DLG_LINE
+            {
+            type = EAknCtPopupHeadingPane;
+            id = EAknMessageQueryHeaderId;
+            control = AVKON_HEADING
+                {
+                headinglayout = R_AVKON_LIST_HEADING_PANE_POPUPS;
+                };
+            },
+        DLG_LINE
+            {
+            type = EAknCtMessageQuery;
+            id = EAknMessageQueryContentId;
+            control = AVKON_MESSAGE_QUERY
+                {
+                };
+            }
+        };
+    }
 
 // ---------------------------------------------------------------------------
 // r_qtn_nmp_note_educating_the_user
--- a/mpxplugins/viewplugins/views/collectionviewhg/group/mpxcollectionviewhg.mmp	Tue May 11 16:10:56 2010 +0300
+++ b/mpxplugins/viewplugins/views/collectionviewhg/group/mpxcollectionviewhg.mmp	Tue May 25 12:39:12 2010 +0300
@@ -75,6 +75,7 @@
 LIBRARY         bafl.lib
 LIBRARY         aknskins.lib
 LIBRARY         aknicon.lib
+LIBRARY         fbscli.lib
 LIBRARY         commonengine.lib
 LIBRARY         sendui.lib
 LIBRARY         centralrepository.lib
--- a/mpxplugins/viewplugins/views/collectionviewhg/inc/mpxcollectionviewhgcontainer.h	Tue May 11 16:10:56 2010 +0300
+++ b/mpxplugins/viewplugins/views/collectionviewhg/inc/mpxcollectionviewhgcontainer.h	Tue May 25 12:39:12 2010 +0300
@@ -556,11 +556,8 @@
 
 	/**
 	 * Records begin state for the transition animation.
-	 *
-	 * @param aPrevViewWasPlayback ETrue if previous view was playback.
-	 *     This information used to decide animation direction.
 	 */
-	void BeginFullScreenAnimation( TBool aPrevViewWasPlayback = EFalse );
+	void BeginFullScreenAnimation();
 
 	/**
 	 * Set the previous view Uid
@@ -876,6 +873,14 @@
      */
     void ResolvePopupListSizeL();
 
+    /**
+     * Setup transition type
+	 * @param aType Type of transition to be used.
+	 * @param aPrevViewWasPlayback ETrue if previous view was playback.
+	 *     This information used to decide animation direction.
+	 */
+    void SetupTransitionType( TInt aType, TBool aPrevViewWasPlayback = EFalse );
+
 private: // data member
 
     /**
@@ -1006,6 +1011,7 @@
     TBool iLayoutSwitch;
     TRect iPopupListRect;
     TUid iPreviousViewId;
+    TBool iPreviousOrientation;
     };
 
 #endif  // CMPXCOLLECTIONVIEWHGCONTAINER_H
--- a/mpxplugins/viewplugins/views/collectionviewhg/inc/mpxcollectionviewhgimp.h	Tue May 11 16:10:56 2010 +0300
+++ b/mpxplugins/viewplugins/views/collectionviewhg/inc/mpxcollectionviewhgimp.h	Tue May 25 12:39:12 2010 +0300
@@ -26,7 +26,7 @@
 
 // INCLUDES
 #include <eikclb.h>
-#include <aknwaitdialog.h>
+#include <AknWaitDialog.h>
 #include <eikprogi.h>
 #include <mpxmediageneraldefs.h>
 #include <mpxcollectionobserver.h>
--- a/mpxplugins/viewplugins/views/collectionviewhg/src/mpxcollectionviewhgcontainer.cpp	Tue May 11 16:10:56 2010 +0300
+++ b/mpxplugins/viewplugins/views/collectionviewhg/src/mpxcollectionviewhgcontainer.cpp	Tue May 25 12:39:12 2010 +0300
@@ -105,6 +105,8 @@
 const TReal KIconFactor = 0.7;
 
 const TInt KThumbLoadingPauseForTransition(500000);
+const TInt KMPXInterviewTransition = 0;
+const TInt KMPXIntraviewTransition = 1;
 
 _LIT( KMPXDash, " - " );
 #ifdef HG_MP_LOC_AVAILABLE
@@ -112,14 +114,6 @@
 #endif //HG_MP_LOC_AVAILABLE
 _LIT( KMPXZeroDurationMark, "--");
 
-_LIT( KSong, " song" );
-_LIT( KSongs, " songs" );
-_LIT( KEpisode, " episode" );
-_LIT( KEpisodes, " episodes" );
-_LIT( KAlbum, " album" );
-_LIT( KAlbums, " albums" );
-_LIT( KSongDash, " song - " );
-_LIT( KSongsDash, " songs - " );
 
 // ======== MEMBER FUNCTIONS ========
 
@@ -217,12 +211,6 @@
     delete iPlaylist;
     delete iPlaylistHelper;
 
-    if( iAsyncCallBack )
-        {
-        iAsyncCallBack->Cancel();
-        }
-    delete iAsyncCallBack;
-
     iCoeEnv->RemoveForegroundObserver( *this );
     }
 
@@ -274,9 +262,7 @@
     iIsForeground = ETrue;
     iCoeEnv->AddForegroundObserverL( *this );
 
-    TCallBack callback(CMPXCollectionViewHgContainer::AsyncCallback, this);
-    iAsyncCallBack = new (ELeave) CAsyncCallBack( CActive::EPriorityStandard );
-    iAsyncCallBack->Set(callback);
+    iPreviousOrientation = Layout_Meta_Data::IsLandscapeOrientation();
 
     GfxTransEffect::Enable();
 
@@ -728,12 +714,12 @@
             {
             delete iIconArray;
             iIconArray = NULL;
-            CreateIconArrayL();
 
             if( iCurrentViewType == EMPXViewMediawall || iCurrentViewType == EMPXViewTBone )
                 {
             	iMediaWall->SetDefaultIconL(NULL);
-                iMediaWall->EnableScrollBufferL(*this, KMPXListBufferSize, KMPXListBufferSize/4);
+            	CreateIconArrayL();
+                iMediaWall->EnableScrollBufferL(*this, KMPXListBufferSizeWithMediaWall, KMPXListBufferSizeWithMediaWall/4);
                 }
             else
                 {
@@ -741,14 +727,45 @@
                 if( list )
                     {
                     list->SetDefaultIconL(NULL);
-                    list->EnableScrollBufferL(*this, KMPXListBufferSizeWithMediaWall, KMPXListBufferSizeWithMediaWall/4);
+            		CreateIconArrayL();
+                    list->EnableScrollBufferL(*this, KMPXListBufferSize, KMPXListBufferSize/4);
                     }
                 }
-			SetDetailIconShuffleL();
+            // Reset the shuffle item for TBone view
+			if ( iCurrentViewType == EMPXViewTBone )
+				{
+				if (iMwListWidget && iMwListWidget->ItemCount() > 1)
+					{
+					SetShuffleItemToListL(iMwListWidget);
+					}
+				}
+			// Songs dialog is opened in mediawall, we need to reset its shuffle item
+			else if ( iCurrentViewType == EMPXViewMediawall && iDialog )
+				{
+				CAknIconArray* iconArray = new( ELeave ) CAknIconArray( 1 );
+				CleanupStack::PushL( iconArray );
+				// Prepare icon array.
+				CGulIcon* icon = (*iIconArray)[EMPXClvIconShuffle];
+				CGulIcon* iconCopy = CGulIcon::NewL(icon->Bitmap(), icon->Mask());
+				iconCopy->SetBitmapsOwnedExternally(ETrue);
+				iconArray->AppendL(iconCopy);
+				CAknSingleGraphicPopupMenuStyleListBox* listbox = (CAknSingleGraphicPopupMenuStyleListBox *)iDialog->ListBox();
+				listbox->ItemDrawer()->ColumnData()->SetIconArrayL( iconArray );
+				CleanupStack::Pop(); // iconArray
+				}
+			else
+				{
+            	// Reset the shuffle item for other views
+				SetDetailIconShuffleL();
+				}
             }
-        else if ( aType == KEikDynamicLayoutVariantSwitch )
+        else if ( aType == KEikDynamicLayoutVariantSwitch &&
+        		( iPreviousOrientation != landscapeOrientation ) )
             {
             iLayoutSwitch = ETrue;
+			// To prevent multiple layout change causing multiple repopulation of the list.
+			// Temporary fix until rootcause is found.
+            iPreviousOrientation = landscapeOrientation;
 
             if ( iCurrentViewType == EMPXViewMediawall )
                 {
@@ -756,9 +773,6 @@
                     {
                     iDialog->CancelPopup();
                     }
-                // make cba visible so that visible screen area is calculated correctly in list view
-                if( iCbaHandler )
-                    iCbaHandler->ChangeCbaVisibility( ETrue );
                 }
             iSetEmptyTextNeeded = ETrue;
 
@@ -1227,8 +1241,13 @@
             if ( pbv )
                 {
             	iPreviousViewId = TUid::Uid(0);
+            	SetupTransitionType(KMPXInterviewTransition, pbv);
                 }
-            BeginFullScreenAnimation( pbv );
+            else // intraview transitions
+				{
+            	SetupTransitionType(KMPXIntraviewTransition);
+				}
+            BeginFullScreenAnimation();
             }
 
         switch (iCurrentViewType)
@@ -1269,7 +1288,6 @@
 
     DrawableWindow()->SetOrdinalPosition( -1 );
 
-    CleanPrevView();
     iPrevViewType = iCurrentViewType;
     iPrevContext = iContext;
     if ( iSetEmptyTextNeeded )
@@ -1277,11 +1295,6 @@
         LoadAndSetEmptyTextL();
         iSetEmptyTextNeeded = EFalse;
         }
-    if( !iDefaultIconSet )
-        {
-        SetDefaultIconL();
-        }
-
     iLayoutSwitch = EFalse;
     }
 
@@ -1518,9 +1531,15 @@
              SaveSelectedAlbumItemL( iSelectedAlbumIndex );
             }
 
+        TInt prevItemCount( iMediaWall->ItemCount() );
         iMediaWall->Reset();
         if ( aCount )
             {
+            // enable scroll buffering now as it has not been enabled when empty mediawall was constructed
+            if ( !prevItemCount )
+                {
+                iMediaWall->EnableScrollBufferL( *this, KMPXListBufferSizeWithMediaWall, KMPXListBufferSizeWithMediaWall/4 );
+                }
             iMediaWall->ResizeL( aCount );
             ProvideDataWithoutThumbnailsMwL(aMediaArray);
 
@@ -1608,13 +1627,22 @@
         {
         MPX_DEBUG1("CMPXCollectionViewHgContainer::PrepareListL - EnableScrollBufferL");
         iListWidget->EnableScrollBufferL(*this, KMPXListBufferSize, KMPXListBufferSize/4);
+   		iDefaultIconSet = EFalse;
+		// Setting an empty icon to the list as default icon.
+        iListWidget->SetDefaultIconL(CGulIcon::NewL(new CFbsBitmap()));
+        CleanPrevView();
         }
     else
         {
+		// Note: Special case
+		// We need to clean previous view prior to setting default icon otherwise the
+		// icon will be set to the wrong scroller.
+		CleanPrevView();
+        SetDefaultIconL();
         EndFullScreenAnimation();
         iListWidget->RefreshScreen(0);
+    	iDefaultIconSet = ETrue;
         }
-    iDefaultIconSet = EFalse;
     }
 
 // ----------------------------------------------------------------------------
@@ -1661,7 +1689,7 @@
 				CHgVgMediaWall::EHgVgMediaWallStyleCoverflowTBonePortrait,
 				EFalse,
 				this,
-				DefaultIconL() );
+				CGulIcon::NewL( new CFbsBitmap()) );
 
 		if( !iIsForeground )
 		    iMediaWall->HandleLosingForeground();
@@ -1729,7 +1757,8 @@
         OpenAlbumL(iAlbumIndex);
        }
     iMwListWidget->RefreshScreen(0);
-	iDefaultIconSet = ETrue;
+
+	CleanPrevView();
     }
 
 // ----------------------------------------------------------------------------
@@ -1754,7 +1783,7 @@
         {
         switchBuffer = CMPXCollectionViewHgSwitchBuffer::CreateBufferLC( *iListWidget );
         }
-    else if ( iMediaWall )
+    else if ( iMediaWall && iPrevViewType == EMPXViewTBone )
         {
         switchBuffer = CMPXCollectionViewHgSwitchBuffer::CreateBufferLC( *iMediaWall );
         switchBuffer->SetIndexOffset(1);
@@ -1786,7 +1815,7 @@
         // Check if the list is empty, Enable scroll buffer won't call requst if list is empty
         if( iMediaWall->ItemCount() != 0 )
             {
-        		iMediaWall->EnableScrollBufferL(
+        	iMediaWall->EnableScrollBufferL(
                 *this,
                 KMPXListBufferSizeWithMediaWall,
                 KMPXListBufferSizeWithMediaWall / 4);
@@ -1819,7 +1848,7 @@
 		// Check if the list is empty, Enable scroll buffer won't call requst if list is empty
         if( iMediaWall->ItemCount() != 0 )
             {
-        		iMediaWall->EnableScrollBufferL(
+        	iMediaWall->EnableScrollBufferL(
                 *this,
                 KMPXListBufferSizeWithMediaWall,
                 KMPXListBufferSizeWithMediaWall / 4);
@@ -1840,11 +1869,11 @@
         iMediaWall->SetFlags( CHgVgMediaWall::EHgVgMediaWallDrawToWindowGC );
         }
 
-	if( iPopupListRect == TRect(0,0,0,0) )
-		{
-	    ResolvePopupListSizeL();
-		}
-
+	  if( iPopupListRect == TRect(0,0,0,0) )
+		   {
+	     ResolvePopupListSizeL();
+		   }
+		
     iMediaWall->SetOpenedItemRect( iPopupListRect );
     iMediaWall->SetOpeningAnimationType( CHgVgMediaWall::EHgVgOpeningAnimationZoomToFront );
 
@@ -1855,6 +1884,7 @@
         switchBuffer = NULL;
         }
 	iDefaultIconSet = ETrue;
+	CleanPrevView();
     }
 
 // ----------------------------------------------------------------------------
@@ -2114,6 +2144,10 @@
                     break;
                 }
             }
+        // Start animation now as next view activated is
+        // now playing view. We will end animation in now playing view.
+        SetupTransitionType(KMPXInterviewTransition);
+        BeginFullScreenAnimation();
         }
     }
 
@@ -2172,6 +2206,10 @@
 		{
         SaveSelectedAlbumItemL(iSelectedAlbumIndex);
 		UpdatePathAndOpenL(index);
+        // Start animation now as next view activated is
+        // now playing view. We will end animation in now playing view.
+        SetupTransitionType(KMPXInterviewTransition);
+        BeginFullScreenAnimation();
 		}
     else if ( iContext == EContextGroupAlbum )
         {
@@ -2192,6 +2230,10 @@
             // To open the selected album.
             iView->ProcessCommandL( EMPXCmdCommonEnterKey );
             }
+        // Start animation now as next view activated is
+        // now playing view. We will end animation in now playing view.
+        SetupTransitionType(KMPXInterviewTransition);
+        BeginFullScreenAnimation();
         }
     else
 		{
@@ -2238,6 +2280,10 @@
            // Open the selected song of album
             UpdatePathAndOpenL(index);
             }
+        // Start animation now as next view activated is
+        // now playing view. We will end animation in now playing view.
+        SetupTransitionType(KMPXInterviewTransition);
+        BeginFullScreenAnimation();
         }
     else if ( iContext == EContextGroupAlbum  )
         {
@@ -2248,6 +2294,13 @@
 				{
 	            OpenAlbumL(index);
 				}
+			else
+				{
+				// Start animation now as next view activated is
+				// now playing view. We will end animation in now playing view.
+				SetupTransitionType(KMPXInterviewTransition);
+				BeginFullScreenAnimation();
+				}
             }
         }
     else
@@ -2656,11 +2709,16 @@
 			}
         if ( canRefresh )
             {
+			if( !iDefaultIconSet )
+				{
+				SetDefaultIconL();
+				iDefaultIconSet = ETrue;
+				}
             if( iCurrentViewType == EMPXViewTBone || iCurrentViewType == EMPXViewMediawall )
                 {
                 if( iTranstionType != EMPXTranstionNotDefined )
                     {
-                    // This will tricker the transtition animation
+                    // This will trigger the transtition animation
                     EndFullScreenAnimation();
                     iMediaWall->DrawNow();
                     }
@@ -2673,7 +2731,7 @@
                 {
                 if( iTranstionType != EMPXTranstionNotDefined )
                     {
-                    // This will tricker the transtition animation
+                    // This will trigger the transtition animation
                     // Use DrawNow since RefreshScreen uses DrawDeferred and we want to start
                     // the animation immediately.
                     EndFullScreenAnimation();
@@ -2781,7 +2839,7 @@
 		case EContextItemAlbum:
             {
             defaultIcon = EMPXDefaultIconAlbum;
-            iconIndex = EMPXClvIconAlbum;
+            iconIndex = 27; // default album art in mediawall and list view
 			break;
 			}
 		case EContextGroupPodcast:
@@ -4487,8 +4545,8 @@
     TInt songCount = songArray->Count();
 
     CDesC16ArrayFlat* songList = new (ELeave) CDesC16ArrayFlat(songCount);
-    CleanupStack::PushL(songList); 
-    
+    CleanupStack::PushL(songList);
+
     if ( songCount > 1 )
         {
         HBufC* shuffleText = StringLoader::LoadLC(
@@ -4557,6 +4615,10 @@
         SaveSelectedAlbumItemL(iSelectedAlbumIndex);
         // Open the selected song of album
         UpdatePathAndOpenL(index);
+        // Start animation now as next view activated is
+        // now playing view. We will end animation in now playing view.
+        SetupTransitionType(KMPXInterviewTransition);
+        BeginFullScreenAnimation();
         }
     else if( !iLayoutSwitch && iMediaWall )
         {
@@ -4797,6 +4859,11 @@
 void CMPXCollectionViewHgContainer::HandleGainingForeground()
     {
     iIsForeground = ETrue;
+    if ( iCurrentViewType == EMPXViewMediawall )
+        {
+        if( iCbaHandler )
+            iCbaHandler->ChangeCbaVisibility( EFalse );
+        }
     }
 
 void CMPXCollectionViewHgContainer::HandleLosingForeground()
@@ -4869,6 +4936,7 @@
 
     if( !iLayoutSwitch  )
         {
+		SetupTransitionType(KMPXIntraviewTransition);
         BeginFullScreenAnimation();
         }
 
@@ -4877,14 +4945,8 @@
 
     DrawableWindow()->SetOrdinalPosition( -1 );
 
-    CleanPrevView();
-
     iPrevViewType = iCurrentViewType;
 
-    if( !iDefaultIconSet )
-        {
-        SetDefaultIconL();
-        }
     // We need to adjust the CBA for this view.
 	if( iCbaHandler )
 		iCbaHandler->UpdateCba();
@@ -5012,41 +5074,11 @@
 // Prepare and begin fullscreen animation effects
 // ---------------------------------------------------------------------------
 //
-void CMPXCollectionViewHgContainer::BeginFullScreenAnimation(TBool aPrevViewWasPlayback)
+void CMPXCollectionViewHgContainer::BeginFullScreenAnimation()
     {
-    if( iTranstionType != EMPXTranstionNotDefined )
+    if( iTranstionType == EMPXTranstionNotDefined )
         return;
 
-    iTranstionType = EMPXTranstionToLeft;
-
-    if ( (iPrevContext == EContextUnknown ||
-          iPrevContext == EContextItemAlbum ) && aPrevViewWasPlayback )
-        {
-        iTranstionType = EMPXTranstionToLeft;
-        }
-    else if( iPrevContext == EContextUnknown )
-        {
-        // We aren't coming from playback view and prev context is unknown.
-        // Musicplayer is propably started so we shouldn't use any animation.
-        iTranstionType = EMPXTranstionNotDefined;
-        return;
-        }
-    else if( iContext == EContextItemAlbum ||
-             iContext == EContextItemGenre ||
-             iContext == EContextItemPlaylist )
-        {
-        iTranstionType = EMPXTranstionToRight;
-        }
-
-    if( iPrevViewType == EMPXViewMediawall || iPrevViewType == EMPXViewTBone )
-        {
-        iMediaWall->SetFlags( CHgVgMediaWall::EHgVgMediaWallDrawToWindowGC );
-        iMediaWall->DrawNow();
-		// workaround for NGA animations: includes Media Wall into transition animation.
-		iCoeEnv->WsSession().Finish();
-		User::After(1000);
-        }
-
     const TInt flags = AknTransEffect::TParameter::EActivateExplicitCancel;
     TRect appRect = ((CAknAppUi*)iCoeEnv->AppUi())->ApplicationRect();
     GfxTransEffect::BeginFullScreen( iTranstionType, appRect,
@@ -5070,6 +5102,48 @@
     }
 
 // ---------------------------------------------------------------------------
+// Setup transition types for animation.
+// ---------------------------------------------------------------------------
+//
+void CMPXCollectionViewHgContainer::SetupTransitionType( TInt aType, TBool aPrevViewWasPlayback )
+    {
+	if ( aType == KMPXIntraviewTransition )
+		{
+		iTranstionType = EMPXTranstionToLeft;
+
+		if( iPrevContext == EContextUnknown )
+			{
+			// We aren't coming from playback view and prev context is unknown.
+			// Musicplayer is propably started so we shouldn't use any animation.
+			iTranstionType = EMPXTranstionNotDefined;
+			return;
+			}
+		else if( iContext == EContextItemAlbum ||
+				 iContext == EContextItemGenre ||
+				 iContext == EContextItemPlaylist )
+			{
+			iTranstionType = EMPXTranstionToRight;
+			}
+
+		if( iPrevViewType == EMPXViewMediawall || iPrevViewType == EMPXViewTBone )
+			{
+			iMediaWall->SetFlags( CHgVgMediaWall::EHgVgMediaWallDrawToWindowGC );
+			iMediaWall->DrawNow();
+			}
+		}
+	else // interview transition
+		{
+
+		iTranstionType = EMPXTranstionToRight;
+		if ( (iPrevContext == EContextUnknown ||
+			  iPrevContext == EContextItemAlbum ) && aPrevViewWasPlayback )
+			{
+			iTranstionType = EMPXTranstionToLeft;
+			}
+		}
+    }
+
+// ---------------------------------------------------------------------------
 // Resolving the size of the popup list rectangle.
 // ---------------------------------------------------------------------------
 //
--- a/mpxplugins/viewplugins/views/collectionviewhg/src/mpxcollectionviewhgimp.cpp	Tue May 11 16:10:56 2010 +0300
+++ b/mpxplugins/viewplugins/views/collectionviewhg/src/mpxcollectionviewhgimp.cpp	Tue May 25 12:39:12 2010 +0300
@@ -91,9 +91,10 @@
 #include <mpxfindinmusicshop.h>
 #include <mpxfindinmusicshopcommon.h>  // KFindInMShopKeyInValid
 
-// cenrep key need to be checked whether USB cable is connected in MTP/Combined Mode
+// cenrep key need to be checked whether Mass Storage or MTP is connected
 #include <UsbWatcherInternalPSKeys.h>
 #include <usbpersonalityids.h>
+#include <mtpprivatepskeys.h>
 #include <mpxappui.hrh>
 #include <mpxinternalcrkeys.h>
 #include <mpxtlshelper.h>
@@ -616,13 +617,16 @@
     TInt usbStatus;
     RProperty::Get(KPSUidUsbWatcher, KUsbWatcherSelectedPersonality, usbStatus);
 
-
-    // Whenever usb  is connected
-    if ( usbStatus == KUsbPersonalityIdMTP 
-            || usbStatus == KUsbPersonalityIdMS
-            || usbStatus == KUsbPersonalityIdPTP
-            || usbStatus == KUsbPersonalityIdPCSuiteMTP 
-            || usbStatus == KUsbPersonalityIdPCSuite )
+    TInt mtpStatus = EMtpPSStatusUninitialized;
+    RProperty::Get( KMtpPSUid, KMtpPSStatus, mtpStatus);
+    
+    MPX_DEBUG2("CMPXCollectionViewHgImp::ConstructL, mtpstatus = %d", mtpStatus);
+
+    // Whenever usb/mtp is connected
+    if ( usbStatus == KUsbPersonalityIdMS
+                || usbStatus == KUsbPersonalityIdPTP
+                || usbStatus == KUsbPersonalityIdPCSuite 
+                || mtpStatus != EMtpPSStatusUninitialized )
         {
         RProperty::Set( KMPXViewPSUid,
         		        KMPXUSBUnblockingPSStatus,
@@ -754,12 +758,12 @@
                         {
                         iContainer->EnableFindBox(EFalse);
                         }
+
+                    // delete songs list to update T-bone view after deleting a song
+                    album->Delete( KMPXMediaArrayContents );
                     }
                 iConfirmationDlg = NULL;
-                CleanupStack::PopAndDestroy( waitNoteText );
-                
-                // delete songs list to update T-bone view after deleting a song
-                album->Delete( KMPXMediaArrayContents );
+                CleanupStack::PopAndDestroy( waitNoteText );                
                 }
             }
         CleanupStack::PopAndDestroy( path );
@@ -1269,7 +1273,7 @@
             else if ( ( aIndex > 0 )
                 && ( aIndex < iContainer->CurrentListItemCount() ) )
                 {
-                iContainer->SetLbxCurrentItemIndexAndDraw( aIndex );
+                // No need to do anything here
                 }
             else
                 {
@@ -3670,7 +3674,8 @@
     {
     MPX_FUNC( "CMPXCollectionViewHgImp::UpdateMiddleSoftKeyDisplayL" );
     CEikButtonGroupContainer* cba = Cba();
-    if ( cba )
+	// We only update middle softkey for non-touch UI
+    if ( cba && !AknLayoutUtils::PenEnabled() )
         {
         if ( !iContainer->CurrentListItemCount() ) // list is empty
             {
@@ -4073,15 +4078,7 @@
                 } 
             // USB flags
             //
-	       CEikMenuBar* menuBar( MenuBar() );
-            if(iContainer)
-                {
-                iContainer->EnableMarking( EFalse );
-                }
-            if(menuBar)
-                {
-                menuBar->SetMenuTitleResourceId( R_MPX_COLLECTION_VIEW_MENUBAR_NO_MARKING );
-                }
+	        CEikMenuBar* menuBar( MenuBar() );
 	        TBool IsUSBEvent( EFalse );
             if( type == EMcMsgUSBMassStorageStart || type == EMcMsgUSBMTPStart )
                 {
@@ -5951,25 +5948,16 @@
     // Add view deactivation observer
     AppUi()->AddViewDeactivationObserverL( this );
 
-#ifdef __ENABLE_PODCAST_IN_MUSIC_MENU
+    CMPXCollectionPath* cpath( iCollectionUtility->Collection().PathL() );
+    CleanupStack::PushL( cpath );
     // media is not valid until the first HandleOpenL call
     CEikButtonGroupContainer* cba = Cba();
     if ( cba )
         {
-        cba->SetCommandSetL(R_MPX_OPTIONS_BACK_CBA_NO_ACTION); 
-        cba->DrawNow(); 
-        }
-#else
-    // media is not valid until the first HandleOpenL call
-    CEikButtonGroupContainer* cba = Cba();
-    if ( cba )
-        {
-        cba->SetCommandSetL(
-            ( iViewUtility->ViewHistoryDepth() == 1 && !iIsEmbedded ) ?
-            R_MPX_OPTIONS_EXIT_CBA_NO_ACTION : R_MPX_OPTIONS_BACK_CBA_NO_ACTION );
-        cba->DrawDeferred();
-        }
-#endif
+        cba->SetCommandSetL(( cpath->Levels() == 3 && !iIsEmbedded ) ?
+            R_MPX_OPTIONS_HIDE_CBA: R_MPX_OPTIONS_BACK_CBA_NO_ACTION );
+        cba->DrawDeferred(); 
+        }
 
     // Set status pane layout if switched here directly from another view,
     // such as when using the AnyKey
@@ -5985,10 +5973,6 @@
     AppUi()->AddToStackL( *this, iContainer );
     iContainer->SetRect( ClientRect() );
 
-    CMPXCollectionPath* cpath( iCollectionUtility->Collection().PathL() );
-    CleanupStack::PushL( cpath );
-
-
 
 	UpdateTitlePaneL();
 
@@ -6022,7 +6006,6 @@
         if ( cpath->Levels() > 1 )
             {
             // valid path in collection
-            GetDurationL();
             MPX_DEBUG_PATH(*cpath);
 
             DoIncrementalOpenL();
@@ -6042,12 +6025,8 @@
             {
             iPodcast = ETrue;
             }
-        // don't bother getting duration if at plugin list
-        if ( cpath->Levels() > 1 )
 #endif
-            {
-            GetDurationL();
-            }
+
         MPX_DEBUG_PATH(*cpath);
 
         DoIncrementalOpenL( cpath->Levels()>KMusicCollectionMenuLevel ? ETrue:EFalse );
@@ -6210,7 +6189,14 @@
 			{
 			// playlist view
 			aMenuPane->SetItemDimmed( EMPXCmdGoToPlaylists, ETrue );
-            aMenuPane->SetItemDimmed(EMPXCmdGoToMusicShop, iGoToMusicShopOptionHidden );
+			if(usbUnblockingStatus)
+			 {
+			 aMenuPane->SetItemDimmed( EMPXCmdGoToMusicShop, ETrue );
+			 }
+			else          
+			 {
+             aMenuPane->SetItemDimmed(EMPXCmdGoToMusicShop, iGoToMusicShopOptionHidden );
+             }
 	        if (containerType != EMPXGroup ) // EMPXItem -> playlist tracks level
 			 {
 			  aMenuPane->SetItemDimmed( EMPXCmdGoToArtistAlbums, ETrue );
@@ -6230,7 +6216,14 @@
 			{
 			// Artists & Albums view
 			aMenuPane->SetItemDimmed( EMPXCmdGoToArtistAlbums, ETrue );
-            aMenuPane->SetItemDimmed(EMPXCmdGoToMusicShop, iGoToMusicShopOptionHidden ); 
+			if(usbUnblockingStatus)
+			 {
+             aMenuPane->SetItemDimmed( EMPXCmdGoToMusicShop, ETrue );
+			 }
+			else          
+			 {
+             aMenuPane->SetItemDimmed(EMPXCmdGoToMusicShop, iGoToMusicShopOptionHidden );
+             }
 			if ( iContainer->IsTBoneView() ) //TBone View
 			    {
 			    aMenuPane->SetItemDimmed( EMPXCmdGoToAllSongs, ETrue );
@@ -6247,7 +6240,14 @@
 			{
 			// Genre view
         	aMenuPane->SetItemDimmed( EMPXCmdGoToGenre, ETrue );
-            aMenuPane->SetItemDimmed(EMPXCmdGoToMusicShop, iGoToMusicShopOptionHidden );    
+			if(usbUnblockingStatus)
+			 {
+			 aMenuPane->SetItemDimmed( EMPXCmdGoToMusicShop, ETrue );
+			 }
+			else          
+			 {
+			 aMenuPane->SetItemDimmed(EMPXCmdGoToMusicShop, iGoToMusicShopOptionHidden );
+             }
 			if ( containerType != EMPXGroup ) // EMPXItem -> tracks level
 				{
                 aMenuPane->SetItemDimmed( EMPXCmdGoToAllSongs, ETrue );
@@ -6267,7 +6267,14 @@
 			{
 			// Song view and Genre Track view
 			aMenuPane->SetItemDimmed( EMPXCmdGoToAllSongs, ETrue );
-            aMenuPane->SetItemDimmed(EMPXCmdGoToMusicShop, iGoToMusicShopOptionHidden );
+			if(usbUnblockingStatus)
+			 {
+			 aMenuPane->SetItemDimmed( EMPXCmdGoToMusicShop, ETrue );
+			 }
+			else          
+			 {
+             aMenuPane->SetItemDimmed(EMPXCmdGoToMusicShop, iGoToMusicShopOptionHidden );
+			 }
 			break;
 			}
 		default:
@@ -6313,6 +6320,7 @@
 
 				if ( iContainer->CurrentLbxItemIndex() > KErrNotFound && !iContainer->IsTBoneView())
 				    {
+				    aMenuPane->SetItemDimmed( EMPXCmdPlayItem, EFalse );			    	       
                     if ( usbUnblockingStatus == EMPXUSBUnblockingPSStatusActive )
                         {
                         aMenuPane->SetItemDimmed( EMPXCmdAddToPlaylist, ETrue );
@@ -6322,7 +6330,6 @@
                         {
                          aMenuPane->SetItemDimmed( EMPXCmdAddToPlaylist, EFalse );
                          aMenuPane->SetItemDimmed( EMPXCmdDelete, EFalse );
-                         aMenuPane->SetItemDimmed( EMPXCmdPlayItem, EFalse );
                         }
 					}
 				if ( iContainer->IsSelectedItemASong() && iContainer->IsTBoneView() )
@@ -6364,7 +6371,16 @@
 			aMenuPane->SetItemDimmed( EMPXCmdPlaylistDetails, ETrue );
 			if ( !Layout_Meta_Data::IsLandscapeOrientation() )
  				{
-			    if( !iContainer->IsTBoneView()&& (iContainer->CurrentLbxItemIndex() > KErrNotFound))
+ 				TInt usbUnblockingStatus;
+				RProperty::Get( KMPXViewPSUid,
+							KMPXUSBUnblockingPSStatus,
+							usbUnblockingStatus);
+
+				if (usbUnblockingStatus == EMPXUSBUnblockingPSStatusActive)
+					{
+					aMenuPane->SetItemDimmed( EMPXCmdFindInMusicShop, ETrue); 
+					}
+				else if( !iContainer->IsTBoneView()&& (iContainer->CurrentLbxItemIndex() > KErrNotFound))								
 			        {  
                     CMPXCollectionViewListBoxArray* array =
                     static_cast<CMPXCollectionViewListBoxArray*>(
@@ -6571,6 +6587,7 @@
 
             if ( iContainer->CurrentLbxItemIndex() > KErrNotFound )
                 {
+                aMenuPane->SetItemDimmed( EMPXCmdPlayItem, EFalse ); 
                 TInt usbUnblockingStatus;
                 RProperty::Get( KMPXViewPSUid,
                                 KMPXUSBUnblockingPSStatus,
@@ -6582,7 +6599,6 @@
                 else
                     {
                     aMenuPane->SetItemDimmed( EMPXCmdAddToPlaylist, EFalse );
-                    aMenuPane->SetItemDimmed( EMPXCmdPlayItem, EFalse );
                     }
                 }
             
@@ -6720,7 +6736,20 @@
 						aMenuPane->SetItemDimmed( EMPXCmdAlbumArt, ETrue );
 						aMenuPane->SetItemDimmed( EMPXCmdFindInMusicShop, ETrue );
 						}
-					aMenuPane->SetItemDimmed( EMPXCmdFindInMusicShop, !iUsingNokiaService );
+
+					TInt usbUnblockingStatus;
+					RProperty::Get( KMPXViewPSUid,
+						KMPXUSBUnblockingPSStatus,
+						usbUnblockingStatus);
+
+					if (usbUnblockingStatus == EMPXUSBUnblockingPSStatusActive)
+						{
+						aMenuPane->SetItemDimmed( EMPXCmdFindInMusicShop, ETrue); 
+						}
+					else
+						{	
+					    aMenuPane->SetItemDimmed( EMPXCmdFindInMusicShop, !iUsingNokiaService );
+						}
 					}
 				}
 			aMenuPane->SetItemDimmed( EMPXCmdRename, ETrue );
@@ -6763,6 +6792,11 @@
         {
         case R_MPX_COLLECTION_VIEW_MENU_1:
             {
+            TInt usbUnblockingStatus;
+            RProperty::Get( KMPXViewPSUid,
+                    KMPXUSBUnblockingPSStatus,
+                    usbUnblockingStatus);
+								
             HandleInitMusicMenuPaneL(aMenuPane);
             aMenuPane->SetItemDimmed( EMPXCmdGoToNowPlaying, NowPlayingOptionVisibilityL() );
 			if ( isListEmpty )
@@ -6777,7 +6811,14 @@
 				aMenuPane->SetItemDimmed( EMPXCmdDelete, ETrue );
 				aMenuPane->SetItemDimmed( EMPXCmdRemove, ETrue );
 				aMenuPane->SetItemDimmed( EMPXCmdPlayItem, ETrue );
-				aMenuPane->SetItemDimmed( EMPXCmdAddSongs, EFalse );
+				if ( usbUnblockingStatus == EMPXUSBUnblockingPSStatusActive )
+					{
+					aMenuPane->SetItemDimmed( EMPXCmdAddSongs, ETrue );
+					}
+                else
+					{
+					aMenuPane->SetItemDimmed( EMPXCmdAddSongs, EFalse );
+					}
 				}
 			else
 				{
@@ -6792,10 +6833,7 @@
                 aMenuPane->SetItemDimmed( EMPXCmdRemove, ETrue );
 				aMenuPane->SetItemDimmed( EMPXCmdPlayItem, ETrue );
 				
-				TInt usbUnblockingStatus;
-				RProperty::Get( KMPXViewPSUid,
-								KMPXUSBUnblockingPSStatus,
-								usbUnblockingStatus);
+
 
 				if ( usbUnblockingStatus == EMPXUSBUnblockingPSStatusActive )
 					{
@@ -6811,8 +6849,15 @@
 						{
 						selectionCount = iSelectionIndexCache->Count();
 						}
-					// do not display add songs option when marking is on
-					aMenuPane->SetItemDimmed( EMPXCmdAddSongs, selectionCount > 0 );
+					// do not display add songs option when marking is on or USB is connected
+					if ( usbUnblockingStatus == EMPXUSBUnblockingPSStatusActive )
+						{
+						aMenuPane->SetItemDimmed( EMPXCmdAddSongs, ETrue );
+						}
+					else
+						{
+						aMenuPane->SetItemDimmed( EMPXCmdAddSongs, selectionCount > 0 );
+						}
 
 					if ( iContainer->CurrentLbxItemIndex() > KErrNotFound )
 						{
@@ -6880,7 +6925,20 @@
 						{
 						aMenuPane->SetItemDimmed( EMPXCmdSongDetails, ETrue );
 						}
-					aMenuPane->SetItemDimmed( EMPXCmdFindInMusicShop, !iUsingNokiaService );
+						
+					TInt usbUnblockingStatus;
+					RProperty::Get( KMPXViewPSUid,
+							KMPXUSBUnblockingPSStatus,
+							usbUnblockingStatus);
+
+					if (usbUnblockingStatus == EMPXUSBUnblockingPSStatusActive)
+						{
+						aMenuPane->SetItemDimmed( EMPXCmdFindInMusicShop, ETrue);
+						}
+					else
+						{		
+					    aMenuPane->SetItemDimmed( EMPXCmdFindInMusicShop, !iUsingNokiaService );
+						}
 					}
 				}
 			if (iServiceHandler->HandleSubmenuL(*aMenuPane))
--- a/mpxplugins/viewplugins/views/commonplaybackview/loc/mpxcommonplaybackview.loc	Tue May 11 16:10:56 2010 +0300
+++ b/mpxplugins/viewplugins/views/commonplaybackview/loc/mpxcommonplaybackview.loc	Tue May 25 12:39:12 2010 +0300
@@ -103,8 +103,8 @@
 // d:A string in the main pane.
 // d:Shown in player view when player FM transmitter is turned on
 // d:%U is the FM frequency in MHz
-// l:mup3_progress_pane_t3
-// r:3.1
+// l:main_mup3_pane_t7/opt14
+// r:5.2
 //
 #define qtn_nmp_display_fm_freq "%U MHz"
 
--- a/mpxplugins/viewplugins/views/commonplaybackview/src/mpxcommonplaybackviewcontainer.cpp	Tue May 11 16:10:56 2010 +0300
+++ b/mpxplugins/viewplugins/views/commonplaybackview/src/mpxcommonplaybackviewcontainer.cpp	Tue May 25 12:39:12 2010 +0300
@@ -1160,7 +1160,6 @@
     {
     MPX_FUNC("CMPXCommonPlaybackViewContainer::SizeChanged()");
     UpdateLayout();
-    UpdateSoftkeyColors();
     UpdateBackgroundSkinControlContext( Rect() );
     }
 
@@ -1671,4 +1670,13 @@
         }
     }
 
+
+// -----------------------------------------------------------------------------
+// CMPXCommonPlaybackViewContainer::SetTransitionType
+// -----------------------------------------------------------------------------
+//
+void CMPXCommonPlaybackViewContainer::SetTransitionType( TTransitionType aTransitionType )
+    {
+	iTransitionType = aTransitionType;
+    }
 //  End of File
--- a/mpxplugins/viewplugins/views/commonplaybackview/src/mpxcommonplaybackviewimp.cpp	Tue May 11 16:10:56 2010 +0300
+++ b/mpxplugins/viewplugins/views/commonplaybackview/src/mpxcommonplaybackviewimp.cpp	Tue May 25 12:39:12 2010 +0300
@@ -2504,12 +2504,6 @@
     {
     MPX_FUNC_EX( "CMPXCommonPlaybackViewImp::DoActivateL()" );
 
-    if( aPrevViewId.iAppUid == KAppUidMusicPlayerX && iContainer )
-        {
-        // record the begin state for the transition animation.
-        iContainer->BeginTransition();
-        }
-            
     iSwitchingView = EFalse;
     iDatabaseNotReady = EFalse;
 	iUnsupportedNoteDisabled = EFalse;
@@ -2570,6 +2564,14 @@
             }
         }
 
+    if( aPrevViewId.iAppUid == KAppUidMusicPlayerX && iContainer )
+        {
+		iContainer->SetTransitionType(EMPXTranstionToLeft);
+        // Transition was started in collection view, we end it here.
+        iContainer->EndTransition();
+        }
+
+
     iPlaybackState = iPlaybackUtility->StateL();
     MPX_DEBUG2("CMPXCommonPlaybackViewImp::DoActivateL(): state = %d", iPlaybackState);
     if ( iPlaybackState == EPbStateInitialising )
@@ -4076,6 +4078,8 @@
         {
         toolbar->SetToolbarVisibility(ETrue);
         }
+    iContainer->SetRect( ClientRect());
+    iContainer->DrawDeferred();
     }
     
 //  End of File
--- a/mpxplugins/viewplugins/views/inc/mpxcommonplaybackviewcontainer.h	Tue May 11 16:10:56 2010 +0300
+++ b/mpxplugins/viewplugins/views/inc/mpxcommonplaybackviewcontainer.h	Tue May 25 12:39:12 2010 +0300
@@ -399,10 +399,19 @@
 
     /**
      * Records the transition animation begin state. 
-     * Animation is started when albumart is fetched.
      */
     void BeginTransition();
-    
+
+    /**
+     * Mark the end state. Triggers the transtition.
+     */
+    void EndTransition();
+
+    /**
+     * Sets the transtition type for animation.
+     */
+    void SetTransitionType( TTransitionType aTransitionType );
+
 private:
 
     /**
@@ -410,11 +419,8 @@
      */
     void DoUpdateLayoutL();
 
-    /**
-     * Trickers the transtition.
-     */
-    void EndTransition();
-    
+
+
  protected:   // data
 
     MEikCommandObserver* iCommandObserver;  // not owned
--- a/mpxplugins/viewplugins/views/metadataeditordialog/src/mpxmetadataeditordialog.cpp	Tue May 11 16:10:56 2010 +0300
+++ b/mpxplugins/viewplugins/views/metadataeditordialog/src/mpxmetadataeditordialog.cpp	Tue May 25 12:39:12 2010 +0300
@@ -191,6 +191,11 @@
     delete iParam;
     delete iIdle;
     delete iDrmInfo;
+    if ( iPlaybackUtility ) 
+        { 
+        iPlaybackUtility->CancelRequest(); 
+        iPlaybackUtility->Close(); 
+        } 
     if ( iCollectionUtility )
         {
         iCollectionUtility->Close();
@@ -1118,51 +1123,43 @@
         PopulatePodcastFileDetailsL( aHeadingsArray, aDataArray );
         }
 
-    // Get modified
-    if ( iMedia->IsSupported( KMPXMediaGeneralDate ) )
-        {
-        TInt64 timeInt( ( TInt64 )iMedia->ValueTObjectL<TInt64>(
-            KMPXMediaGeneralDate ) );
-        TTime time( timeInt );
-        ConvertToLocalTimeL(time);
-        HBufC* modDateTime = HBufC::NewLC(
-            KMPXMaxTimeLength + KMPXDurationDisplayResvLen );
-        HBufC* format = StringLoader::LoadLC(
-            R_QTN_DATE_USUAL_WITH_ZERO );
-        TPtr modDatePtr = modDateTime->Des();
-        MPX_TRAPD( err, time.FormatL( modDatePtr, *format ) );
-        CleanupStack::PopAndDestroy( format );
-        if (err != KErrNone)
-            {
-            aDataArray->AppendL( KNullDesC );
-            }
-        else
-            {
-            format = StringLoader::LoadLC(
-                R_QTN_TIME_USUAL_WITH_ZERO );
-            HBufC* modTime = HBufC::NewLC(
-                format->Length() + KMPXDurationDisplayResvLen );
-            TPtr modTimePtr = modTime->Des();
-            MPX_TRAPD( err, time.FormatL( modTimePtr, *format ) );
-            if ( err != KErrNone )
-                {
-                aDataArray->AppendL( KNullDesC );
-                }
-            else
-                {
-                modDatePtr.Append( KMPXSpace );
-                modDatePtr.Append( modTimePtr );
-                aDataArray->AppendL( modDatePtr );
-                }
-            CleanupStack::PopAndDestroy( modTime );
-            CleanupStack::PopAndDestroy( format );
-            }
-        CleanupStack::PopAndDestroy( modDateTime );
-        }
-    else
-        {
-        aDataArray->AppendL( KNullDesC );
-        }
+    // Get last modified time
+    TTime time;
+    User::LeaveIfError( fs.Modified( uri, time ) );
+    ConvertToLocalTimeL( time );
+	HBufC* modDateTime = HBufC::NewLC(
+		KMPXMaxTimeLength + KMPXDurationDisplayResvLen );
+	HBufC* format = StringLoader::LoadLC(
+		R_QTN_DATE_USUAL_WITH_ZERO );
+	TPtr modDatePtr = modDateTime->Des();
+	MPX_TRAPD( error, time.FormatL( modDatePtr, *format ) );
+	CleanupStack::PopAndDestroy( format );
+	if (error != KErrNone)
+		{
+		aDataArray->AppendL( KNullDesC );
+		}
+	else
+		{
+		format = StringLoader::LoadLC(
+			R_QTN_TIME_USUAL_WITH_ZERO );
+		HBufC* modTime = HBufC::NewLC(
+			format->Length() + KMPXDurationDisplayResvLen );
+		TPtr modTimePtr = modTime->Des();
+		MPX_TRAPD( err, time.FormatL( modTimePtr, *format ) );
+		if ( err != KErrNone )
+			{
+			aDataArray->AppendL( KNullDesC );
+			}
+		else
+			{
+			modDatePtr.Append( KMPXSpace );
+			modDatePtr.Append( modTimePtr );
+			aDataArray->AppendL( modDatePtr );
+			}
+		CleanupStack::PopAndDestroy( modTime );
+		CleanupStack::PopAndDestroy( format );
+		}
+	CleanupStack::PopAndDestroy( modDateTime );
 
     // Get filename
     AppendStringToArrayL( aDataArray, iMedia->ValueText(
@@ -2485,8 +2482,8 @@
     else // Dialog launched from NowPlayingView
         {
         // Get the playback utility instance from engine.
-        MMPXPlaybackUtility* playbackUtility = MMPXPlaybackUtility::UtilityL( KPbModeDefault );
-        MMPXSource* s = playbackUtility->Source();
+        iPlaybackUtility = MMPXPlaybackUtility::UtilityL( KPbModeDefault );
+        MMPXSource* s = iPlaybackUtility->Source();
         if ( s )
             {
             RArray<TMPXAttribute> attrs;
@@ -2504,7 +2501,6 @@
                 s->MediaL(attrs.Array(), *this);
                 CleanupStack::PopAndDestroy( &attrs );
             }  
-        playbackUtility->Close();
         }
     
 
@@ -2990,25 +2986,21 @@
         {
           PopulatePodcastFileDetailsL();
         }
-// Get modified
-if ( iMedia->IsSupported( KMPXMediaGeneralDate ) )
-    {
-    TInt64 timeInt( ( TInt64 )iMedia->ValueTObjectL<TInt64>(
-            KMPXMediaGeneralDate ) );
-    TTime time( timeInt );
-    ConvertToLocalTimeL(time);
+    // Get last modified time
+    TTime time;
+    User::LeaveIfError( fs.Modified( uri, time ) );
+    ConvertToLocalTimeL( time );
     HBufC* modDateTime = HBufC::NewLC(
             KMPXMaxTimeLength + KMPXDurationDisplayResvLen );
     HBufC* format = StringLoader::LoadLC(
             R_QTN_DATE_USUAL_WITH_ZERO );
     TPtr modDatePtr = modDateTime->Des();
-    MPX_TRAPD( err, time.FormatL( modDatePtr, *format ) );
+    MPX_TRAPD( error, time.FormatL( modDatePtr, *format ) );
     CleanupStack::PopAndDestroy( format );
-    if (err != KErrNone)
+    if ( error != KErrNone)
         {
         SetControlTextL(EMPXMetadataEditorDlgCtrlIdLastModified,
                 KNullDesC, KNullDesC);
-
         }
     else
         {
@@ -3037,13 +3029,6 @@
         CleanupStack::PopAndDestroy( format );
         }
     CleanupStack::PopAndDestroy( modDateTime );
-    }
-else
-    {
-    SetControlTextL(EMPXMetadataEditorDlgCtrlIdLastModified,
-            KNullDesC, KNullDesC);
-
-    }
 
 // Get filename
 SetControlTextL(EMPXMetadataEditorDlgCtrlIdCopyright,