31 #include "tmscenrepaudiohandler.h" |
31 #include "tmscenrepaudiohandler.h" |
32 #include "tmscenreplistener.h" |
32 #include "tmscenreplistener.h" |
33 #include "tmspubsublistener.h" |
33 #include "tmspubsublistener.h" |
34 #include "tmsutility.h" |
34 #include "tmsutility.h" |
35 |
35 |
|
36 #ifdef __WINSCW__ |
36 const TInt KDefaultMaxGain = 64; |
37 const TInt KDefaultMaxGain = 64; |
|
38 #else |
|
39 const TInt KDefaultMaxGain = 1; |
|
40 #endif |
37 |
41 |
38 using namespace TMS; |
42 using namespace TMS; |
39 |
43 |
40 // --------------------------------------------------------------------------- |
44 // --------------------------------------------------------------------------- |
41 // TMSCenRepAudioHandler::NewL. |
45 // TMSCenRepAudioHandler::NewL. |
63 delete iIncallLoudspeakerVolumeListener; |
67 delete iIncallLoudspeakerVolumeListener; |
64 delete iIncallEarVolumeListener; |
68 delete iIncallEarVolumeListener; |
65 TRACE_PRN_FN_EXT; |
69 TRACE_PRN_FN_EXT; |
66 } |
70 } |
67 |
71 |
|
72 // --------------------------------------------------------------------------- |
|
73 // TMSCenRepAudioHandler::HandleNotifyPSL |
|
74 // --------------------------------------------------------------------------- |
|
75 // |
68 void TMSCenRepAudioHandler::HandleNotifyPSL(const TUid /*aUid*/, |
76 void TMSCenRepAudioHandler::HandleNotifyPSL(const TUid /*aUid*/, |
69 const TInt& /*aKey*/, const TRequestStatus& /*aStatus*/) |
77 const TInt& /*aKey*/, const TRequestStatus& /*aStatus*/) |
70 { |
78 { |
71 TInt muteVal; |
79 TInt muteVal; |
72 TInt err = KErrNotFound; |
80 TInt err = KErrNotFound; |
73 |
81 if (iPublish) |
|
82 { |
|
83 if (iMuteListener) |
|
84 { |
|
85 err = iMuteListener->Get(muteVal); |
|
86 } |
|
87 if (err == KErrNone && muteVal == EPSTelMicMuteOn) |
|
88 { |
|
89 #if !defined(__WINSCW__) |
|
90 if (iTMSSer) |
|
91 { |
|
92 iTMSSer->SetGain(NULL, 0); |
|
93 } |
|
94 #endif //__WINSCW__ |
|
95 } |
|
96 else if (err == KErrNone) |
|
97 { |
|
98 #if !defined(__WINSCW__) |
|
99 // Change when gain is really changed |
|
100 if (iTMSSer) |
|
101 { |
|
102 iTMSSer->SetGain(NULL, KDefaultMaxGain); |
|
103 } |
|
104 #endif //__WINSCW__ |
|
105 } |
|
106 } |
|
107 iPublish = TRUE; |
|
108 } |
|
109 |
|
110 // --------------------------------------------------------------------------- |
|
111 // TMSCenRepAudioHandler::SetMuteState |
|
112 // --------------------------------------------------------------------------- |
|
113 // |
|
114 void TMSCenRepAudioHandler::SetMuteState(TInt level) |
|
115 { |
74 if (iMuteListener) |
116 if (iMuteListener) |
75 { |
117 { |
76 err = iMuteListener->Get(muteVal); |
118 if (level == 0) |
77 } |
119 { |
78 if (err == KErrNone && muteVal == EPSTelMicMuteOn) |
120 iMuteListener->Set(EPSTelMicMuteOn); |
79 { |
121 } |
80 #if !defined(__WINSCW__) |
122 else |
81 if (iTMSSer) |
123 { |
82 { |
124 iMuteListener->Set(EPSTelMicMuteOff); |
83 iTMSSer->SetGain(NULL, 0); |
125 } |
84 } |
126 } |
85 #endif //__WINSCW__ |
127 iPublish = FALSE; |
86 } |
|
87 else if (err == KErrNone) |
|
88 { |
|
89 #if !defined(__WINSCW__) |
|
90 // Change when gain is really changed |
|
91 if (iTMSSer) |
|
92 { |
|
93 iTMSSer->SetGain(NULL, KDefaultMaxGain); |
|
94 } |
|
95 #endif //__WINSCW__ |
|
96 } |
|
97 } |
128 } |
98 |
129 |
99 // --------------------------------------------------------------------------- |
130 // --------------------------------------------------------------------------- |
100 // TMSCenRepAudioHandler::SetLoudSpeakerVol |
131 // TMSCenRepAudioHandler::SetLoudSpeakerVol |
101 // --------------------------------------------------------------------------- |
132 // --------------------------------------------------------------------------- |