mpserviceplugins/localaudio/src/mpxlocalaudioplayback.cpp
changeset 29 8192e5b5c935
parent 25 3ec52facab4d
child 32 c163ef0b758d
--- a/mpserviceplugins/localaudio/src/mpxlocalaudioplayback.cpp	Fri May 14 15:49:53 2010 +0300
+++ b/mpserviceplugins/localaudio/src/mpxlocalaudioplayback.cpp	Thu May 27 12:49:57 2010 +0300
@@ -493,14 +493,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));
@@ -1108,7 +1108,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);
 
@@ -1160,9 +1160,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,
@@ -1176,7 +1182,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);
 
@@ -1212,10 +1218,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,