mpxmusicplayer/app/src/mpxappui.cpp
branchRCL_3
changeset 11 943ff5625028
parent 9 13afc0e517bd
child 14 c54d95799c80
--- a/mpxmusicplayer/app/src/mpxappui.cpp	Fri Feb 19 22:48:30 2010 +0200
+++ b/mpxmusicplayer/app/src/mpxappui.cpp	Fri Mar 12 15:42:25 2010 +0200
@@ -211,6 +211,10 @@
 // initialize FeatureManager
     FeatureManager::InitializeLibL();
 
+    // Check updates from IAD, continue UI launching even if something fails there
+	// Uncomment when to add IAD update checking functionality to music player
+    // TRAP_IGNORE( CheckUpdatesL() );
+
     if ( FeatureManager::FeatureSupported( KFeatureIdCoverDisplay ) )
         {
         iCoverDisplay = ETrue;
@@ -780,11 +784,17 @@
             if ( !MPXUser::IsCallOngoing( KMPXCallTypeGenericVoice ) ||
                 ( playerState == EPbStatePlaying ) ||
                 ( playerState == EPbStateSeekingForward ) ||
-                ( playerState == EPbStateSeekingBackward ) )
+                ( playerState == EPbStateSeekingBackward ) ||
+                iPdParameterHandler )
                 {
+                TMPXPlaybackState pdPlayerState( EPbStateNotInitialised );
+                if ( iPdParameterHandler )
+                    {
+                    pdPlayerState = iPdParameterHandler->PdStateL();
+                    }
                 // only process command if there no call ongoing
                 // or if we're actively playing during call
-                if ( IsForeground() || EPbStatePlaying == playerState )
+                if ( IsForeground() || EPbStatePlaying == playerState || EPbStatePlaying == pdPlayerState )
                     {
                     MuteVolume();
                     HandlePopupL( EPbCmdMuteVolume );
@@ -799,11 +809,17 @@
             if ( !MPXUser::IsCallOngoing( KMPXCallTypeGenericVoice ) ||
                 ( playerState == EPbStatePlaying ) ||
                 ( playerState == EPbStateSeekingForward ) ||
-                ( playerState == EPbStateSeekingBackward ) )
+                ( playerState == EPbStateSeekingBackward ) ||
+                iPdParameterHandler )
                 {
                 // only process command if there no call ongoing
                 // or if we're actively playing during call
-                if ( IsForeground() || EPbStatePlaying == playerState )
+                TMPXPlaybackState pdPlayerState( EPbStateNotInitialised );
+                if ( iPdParameterHandler )
+                    {
+                    pdPlayerState = iPdParameterHandler->PdStateL();
+                    }
+                if ( IsForeground() || EPbStatePlaying == playerState || EPbStatePlaying == pdPlayerState )
                     {
                     UnMuteVolume();
                     HandlePopupL( EPbCmdUnMuteVolume );
@@ -2096,8 +2112,9 @@
         CleanupClosePushL( procArray );
         TProcessId npProcId( 0 );
         MMPXPlaybackUtility* activePbU = MMPXPlaybackUtility::UtilityL( KPbModeActivePlayer );
+        CleanupClosePushL( *activePbU );
         activePbU->GetClientsL( procArray );
-        activePbU->Close();
+        CleanupStack::PopAndDestroy( activePbU );
         npProcId = procArray[ 0 ];
         CleanupStack::PopAndDestroy( &procArray );
 
@@ -3333,11 +3350,6 @@
     TMPXPlaybackCommand cmd = EPbCmdEnd;
     switch ( aCommand )
         {
-	    case EMPXCmdCheckIADUpdates:
-	        {
-	        TRAP_IGNORE( CheckUpdatesL() );
-	        break;
-	        }
         case EMPXCmdPlay:
         case EMPXCmdPause:
         case EMPXCmdPlayPause:
@@ -4352,7 +4364,12 @@
     cmd->SetTObjectValueL<TBool>( KMPXCommandPlaybackGeneralNoBuffer, ETrue );
     cmd->SetTObjectValueL<TInt>( KMPXCommandPlaybackGeneralType, EPbCmdSetVolume );
     cmd->SetTObjectValueL<TUint>( KMPXCommandPlaybackGeneralData, aVolume );
-    iPlaybackUtility->CommandL( *cmd );
+    
+    MMPXPlaybackUtility* activePbu = MMPXPlaybackUtility::UtilityL( KPbModeActivePlayer );
+    CleanupClosePushL( *activePbu );
+    activePbu->CommandL( *cmd );
+    CleanupStack::PopAndDestroy( activePbu );
+    
     CleanupStack::PopAndDestroy( cmd );
     }
 
@@ -4368,7 +4385,12 @@
     cmd->SetTObjectValueL<TBool>( KMPXCommandGeneralDoSync, ETrue );
     cmd->SetTObjectValueL<TBool>( KMPXCommandPlaybackGeneralNoBuffer, ETrue );
     cmd->SetTObjectValueL<TInt>( KMPXCommandPlaybackGeneralType, EPbCmdMuteVolume );
-    iPlaybackUtility->CommandL( *cmd );
+    
+    MMPXPlaybackUtility* activePbu = MMPXPlaybackUtility::UtilityL( KPbModeActivePlayer );
+    CleanupClosePushL( *activePbu );
+    activePbu->CommandL( *cmd );
+    CleanupStack::PopAndDestroy( activePbu );
+    
     CleanupStack::PopAndDestroy( cmd );
     }
 
@@ -4384,7 +4406,12 @@
     cmd->SetTObjectValueL<TBool>( KMPXCommandGeneralDoSync, ETrue );
     cmd->SetTObjectValueL<TBool>( KMPXCommandPlaybackGeneralNoBuffer, ETrue );
     cmd->SetTObjectValueL<TInt>( KMPXCommandPlaybackGeneralType, EPbCmdUnMuteVolume );
-    iPlaybackUtility->CommandL( *cmd );
+    
+    MMPXPlaybackUtility* activePbu = MMPXPlaybackUtility::UtilityL( KPbModeActivePlayer );
+    CleanupClosePushL( *activePbu );
+    activePbu->CommandL( *cmd );
+    CleanupStack::PopAndDestroy( activePbu );
+    
     CleanupStack::PopAndDestroy( cmd );
     }