25 // SYSTEM |
25 // SYSTEM |
26 #include <e32base.h> |
26 #include <e32base.h> |
27 #include <MTelephonyAudioRoutingObserver.h> |
27 #include <MTelephonyAudioRoutingObserver.h> |
28 #include <TelephonyAudioRouting.h> |
28 #include <TelephonyAudioRouting.h> |
29 #include <RPhCltServer.h> |
29 #include <RPhCltServer.h> |
|
30 #include <cenrepnotifyhandler.h> |
30 |
31 |
31 // FORWARD DECLARATIONS |
32 // FORWARD DECLARATIONS |
32 class CRepository; |
33 class CRepository; |
33 class CTelephonyAudioRouting; |
34 class CTelephonyAudioRouting; |
34 class CPhCltCommandHandler; |
35 class CPhCltCommandHandler; |
35 class MMusEngAudioRoutingObserver; |
36 class MMusEngAudioRoutingObserver; |
|
37 class MMusEngVolumeChangeObserver; |
36 |
38 |
37 /** |
39 /** |
38 * Utility class to handle all phone related requests: |
40 * Utility class to handle all phone related requests: |
39 * Audio routing, volume control and microphone muting. |
41 * Audio routing, volume control and microphone muting. |
40 */ |
42 */ |
41 class CMusEngTelephoneUtils : public CActive, |
43 class CMusEngTelephoneUtils : public CActive, |
42 public MTelephonyAudioRoutingObserver |
44 public MTelephonyAudioRoutingObserver, |
|
45 public MCenRepNotifyHandlerCallback |
43 { |
46 { |
44 MUS_UNITTEST( UT_CMusEngTelephoneUtils ) |
47 MUS_UNITTEST( UT_CMusEngTelephoneUtils ) |
45 MUS_UNITTEST( UT_CMusEngSession ) |
48 MUS_UNITTEST( UT_CMusEngSession ) |
46 |
49 |
47 public: |
50 public: |
102 * Sets audio routing observer. Can be set to NULL in order to indicate |
110 * Sets audio routing observer. Can be set to NULL in order to indicate |
103 * ending of observing changes in audio routing. |
111 * ending of observing changes in audio routing. |
104 */ |
112 */ |
105 void SetAudioRoutingObserver( MMusEngAudioRoutingObserver* aObserver ); |
113 void SetAudioRoutingObserver( MMusEngAudioRoutingObserver* aObserver ); |
106 |
114 |
|
115 /** |
|
116 * Sets volume level observer. Can be set to NULL in order to indicate |
|
117 * ending of observing changes in volume level. |
|
118 */ |
|
119 void SetVolumeChangeObserver( MMusEngVolumeChangeObserver* aObserver ); |
107 |
120 |
108 private: // inherited from CActive |
121 private: // inherited from CActive |
109 |
122 |
110 /** |
123 /** |
111 * |
124 * |
143 * Set output if setting is currently allowed. Leaves with KErrAccessDenied |
156 * Set output if setting is currently allowed. Leaves with KErrAccessDenied |
144 * if setting is not allowed. |
157 * if setting is not allowed. |
145 */ |
158 */ |
146 void DoSetOutputL( CTelephonyAudioRouting::TAudioOutput aAudioOutput ); |
159 void DoSetOutputL( CTelephonyAudioRouting::TAudioOutput aAudioOutput ); |
147 |
160 |
|
161 private:// From MCenRepNotifyHandlerCallback |
|
162 |
|
163 void HandleNotifyGeneric( TUint32 aId ); |
|
164 |
148 private: |
165 private: |
149 |
166 |
150 /** |
167 /** |
151 * Default C++ constructor |
168 * Default C++ constructor |
152 */ |
169 */ |
165 * |
182 * |
166 * @return validated volume value |
183 * @return validated volume value |
167 */ |
184 */ |
168 TInt ValidateVolume( const TInt aVolume ) const; |
185 TInt ValidateVolume( const TInt aVolume ) const; |
169 |
186 |
170 |
187 /** |
|
188 * Checks current volume level and notifies observer, if volume changed |
|
189 * @param aAudioRouteChanged, ETrue if volume check should be done |
|
190 * because of audio route change |
|
191 */ |
|
192 void UpdateCurrentVolume( TBool aAudioRouteChanged ); |
|
193 |
171 private: // DATA |
194 private: // DATA |
172 |
195 |
173 /** |
196 /** |
174 * Stores the audio routing state at startup. |
197 * Stores the audio routing state at startup. |
175 */ |
198 */ |