mmserv/tms/tmsserver/src/tmscenrepaudiohandler.cpp
changeset 28 ebf79c79991a
parent 14 80975da52420
--- a/mmserv/tms/tmsserver/src/tmscenrepaudiohandler.cpp	Fri Jun 11 19:59:23 2010 -0500
+++ b/mmserv/tms/tmsserver/src/tmscenrepaudiohandler.cpp	Fri Jun 25 17:36:03 2010 -0500
@@ -33,7 +33,11 @@
 #include "tmspubsublistener.h"
 #include "tmsutility.h"
 
+#ifdef __WINSCW__
 const TInt KDefaultMaxGain = 64;
+#else
+const TInt KDefaultMaxGain = 1;
+#endif
 
 using namespace TMS;
 
@@ -65,35 +69,62 @@
     TRACE_PRN_FN_EXT;
     }
 
+// ---------------------------------------------------------------------------
+// TMSCenRepAudioHandler::HandleNotifyPSL
+// ---------------------------------------------------------------------------
+//
 void TMSCenRepAudioHandler::HandleNotifyPSL(const TUid /*aUid*/,
         const TInt& /*aKey*/, const TRequestStatus& /*aStatus*/)
     {
     TInt muteVal;
     TInt err = KErrNotFound;
+    if (iPublish)
+        {
+        if (iMuteListener)
+            {
+            err = iMuteListener->Get(muteVal);
+            }
+        if (err == KErrNone && muteVal == EPSTelMicMuteOn)
+            {
+#if !defined(__WINSCW__)
+            if (iTMSSer)
+                {
+                iTMSSer->SetGain(NULL, 0);
+                }
+#endif //__WINSCW__
+            }
+        else if (err == KErrNone)
+            {
+#if !defined(__WINSCW__)
+            // Change when gain is really changed
+            if (iTMSSer)
+                {
+                iTMSSer->SetGain(NULL, KDefaultMaxGain);
+                }
+#endif //__WINSCW__
+            }
+        }
+    iPublish = TRUE;
+    }
 
+// ---------------------------------------------------------------------------
+// TMSCenRepAudioHandler::SetMuteState
+// ---------------------------------------------------------------------------
+//
+void TMSCenRepAudioHandler::SetMuteState(TInt level)
+    {
     if (iMuteListener)
         {
-        err = iMuteListener->Get(muteVal);
-        }
-    if (err == KErrNone && muteVal == EPSTelMicMuteOn)
-        {
-#if !defined(__WINSCW__)
-        if (iTMSSer)
+        if (level == 0)
             {
-            iTMSSer->SetGain(NULL, 0);
+            iMuteListener->Set(EPSTelMicMuteOn);
             }
-#endif //__WINSCW__
+        else
+            {
+            iMuteListener->Set(EPSTelMicMuteOff);
+            }
         }
-    else if (err == KErrNone)
-        {
-#if !defined(__WINSCW__)
-        // Change when gain is really changed
-        if (iTMSSer)
-            {
-            iTMSSer->SetGain(NULL, KDefaultMaxGain);
-            }
-#endif //__WINSCW__
-        }
+    iPublish = FALSE;
     }
 
 // ---------------------------------------------------------------------------
@@ -189,6 +220,7 @@
         /*volGetRes =*/ iIncallLoudspeakerVolumeListener->Get(volLoud);
         }
 
+    iPublish = TRUE;
     TRACE_PRN_FN_EXT;
     }