0
|
1 |
/*
|
|
2 |
* Copyright (c) 2006 Nokia Corporation and/or its subsidiary(-ies).
|
|
3 |
* All rights reserved.
|
|
4 |
* This component and the accompanying materials are made available
|
|
5 |
* under the terms of "Eclipse Public License v1.0"
|
|
6 |
* which accompanies this distribution, and is available
|
|
7 |
* at the URL "http://www.eclipse.org/legal/epl-v10.html".
|
|
8 |
*
|
|
9 |
* Initial Contributors:
|
|
10 |
* Nokia Corporation - initial contribution.
|
|
11 |
*
|
|
12 |
* Contributors:
|
|
13 |
*
|
|
14 |
* Description: Implementation of the Phone Profile Settings API
|
|
15 |
*
|
|
16 |
*/
|
|
17 |
|
|
18 |
|
|
19 |
|
|
20 |
|
|
21 |
// INCLUDE FILES
|
|
22 |
#include "GlobalAudioSettingsImpl.h"
|
|
23 |
#include <e32std.h>
|
|
24 |
#include <GlobalAudioSettingsPSKeys.h>
|
|
25 |
#include <MGlobalAudioSettingsObserver.h>
|
|
26 |
#include <centralrepository.h>
|
|
27 |
#include "AudioClientsListManagerAO.h"
|
|
28 |
#include <AudioClientsListPSKeys.h>
|
|
29 |
|
|
30 |
#ifdef _DEBUG
|
|
31 |
#define PRINT_MESSAGE
|
|
32 |
#endif // _DEBUG
|
|
33 |
|
|
34 |
const TInt KMaxLength=256;
|
|
35 |
_LIT( KNoSound, "z:\\resource\\No_Sound.wav" );
|
|
36 |
// ============================ MEMBER FUNCTIONS ===============================
|
|
37 |
|
|
38 |
// -----------------------------------------------------------------------------
|
|
39 |
// CGlobalAudioSettingsImpl::NewL();
|
|
40 |
//
|
|
41 |
// -----------------------------------------------------------------------------
|
|
42 |
//
|
|
43 |
CGlobalAudioSettingsImpl::CGlobalAudioSettingsImpl(
|
|
44 |
CGlobalAudioSettings &aGlobalAudioSettings,
|
|
45 |
MAudioSettingsObserver& aAudioSettingsObserver)
|
|
46 |
:iGlobalAudioSettings(aGlobalAudioSettings),
|
|
47 |
iAudioSettingsObserver(aAudioSettingsObserver)
|
|
48 |
{
|
|
49 |
}
|
|
50 |
|
|
51 |
// -----------------------------------------------------------------------------
|
|
52 |
// CGlobalAudioSettingsImpl::NewL();
|
|
53 |
//
|
|
54 |
// -----------------------------------------------------------------------------
|
|
55 |
//
|
|
56 |
CGlobalAudioSettingsImpl* CGlobalAudioSettingsImpl::NewL(
|
|
57 |
CGlobalAudioSettings &aGlobalAudioSettings,
|
|
58 |
MAudioSettingsObserver& aAudioSettingsObserver)
|
|
59 |
{
|
|
60 |
CGlobalAudioSettingsImpl* self = new (ELeave) CGlobalAudioSettingsImpl(
|
|
61 |
aGlobalAudioSettings,aAudioSettingsObserver);
|
|
62 |
CleanupStack::PushL( self );
|
|
63 |
self->ConstructL();
|
|
64 |
CleanupStack::Pop( self );
|
|
65 |
return self;
|
|
66 |
}
|
|
67 |
|
|
68 |
// -----------------------------------------------------------------------------
|
|
69 |
// CGlobalAudioSettingsImpl::ConstructL();
|
|
70 |
//
|
|
71 |
// -----------------------------------------------------------------------------
|
|
72 |
//
|
|
73 |
void CGlobalAudioSettingsImpl::ConstructL()
|
|
74 |
{
|
|
75 |
|
|
76 |
|
|
77 |
CreatePropertiesL();
|
|
78 |
|
|
79 |
iWarningTonesObserverAO = CWarningTonesObserverAO::NewL(
|
|
80 |
iGlobalAudioSettings,
|
|
81 |
iAudioSettingsObserver,
|
|
82 |
iGlobalAudioSettingsData);
|
|
83 |
iWarningTonesObserverAO->Subscribe();
|
|
84 |
|
|
85 |
iMessagingTonesObserverAO = CMessagingTonesObserverAO::NewL(
|
|
86 |
iGlobalAudioSettings,
|
|
87 |
iAudioSettingsObserver,
|
|
88 |
iGlobalAudioSettingsData);
|
|
89 |
iMessagingTonesObserverAO->Subscribe();
|
|
90 |
|
|
91 |
iSilentProfileObserverAO = CSilentProfileObserverAO::NewL(
|
|
92 |
iGlobalAudioSettings,
|
|
93 |
iAudioSettingsObserver,
|
|
94 |
iGlobalAudioSettingsData);
|
|
95 |
iSilentProfileObserverAO->Subscribe();
|
|
96 |
|
|
97 |
iVibraObserverAO = CVibraObserverAO::NewL(
|
|
98 |
iGlobalAudioSettings,
|
|
99 |
iAudioSettingsObserver,
|
|
100 |
iGlobalAudioSettingsData);
|
|
101 |
iVibraObserverAO->Subscribe();
|
|
102 |
iRingingTypeObserverAO = CRingingTypeObserverAO::NewL(
|
|
103 |
iGlobalAudioSettings,
|
|
104 |
iAudioSettingsObserver,
|
|
105 |
iGlobalAudioSettingsData);
|
|
106 |
iRingingTypeObserverAO->Subscribe();
|
|
107 |
|
|
108 |
iMessageToneObserverAO = CMessageToneObserverAO::NewL(
|
|
109 |
iGlobalAudioSettings,
|
|
110 |
iAudioSettingsObserver,
|
|
111 |
iGlobalAudioSettingsData);
|
|
112 |
iMessageToneObserverAO->Subscribe();
|
|
113 |
iEmailToneObserverAO = CEmailToneObserverAO::NewL(
|
|
114 |
iGlobalAudioSettings,
|
|
115 |
iAudioSettingsObserver,
|
|
116 |
iGlobalAudioSettingsData);
|
|
117 |
iEmailToneObserverAO->Subscribe();
|
|
118 |
|
|
119 |
|
|
120 |
iVideoCallObserverAO = CVideoCallToneObserverAO::NewL(
|
|
121 |
iGlobalAudioSettings,
|
|
122 |
iAudioSettingsObserver,
|
|
123 |
iGlobalAudioSettingsData);
|
|
124 |
iVideoCallObserverAO->Subscribe();
|
|
125 |
|
|
126 |
iRingingTone1ObserverAO = CRingingTone1ObserverAO::NewL(
|
|
127 |
iGlobalAudioSettings,
|
|
128 |
iAudioSettingsObserver,
|
|
129 |
iGlobalAudioSettingsData);
|
|
130 |
iRingingTone1ObserverAO->Subscribe();
|
|
131 |
|
|
132 |
iRingingTone2ObserverAO = CRingingTone2ObserverAO::NewL(
|
|
133 |
iGlobalAudioSettings,
|
|
134 |
iAudioSettingsObserver,
|
|
135 |
iGlobalAudioSettingsData);
|
|
136 |
iRingingTone2ObserverAO->Subscribe();
|
|
137 |
|
|
138 |
iKeypadToneObserverAO = CKeypadToneObserverAO::NewL(
|
|
139 |
iGlobalAudioSettings,
|
|
140 |
iAudioSettingsObserver,
|
|
141 |
iGlobalAudioSettingsData);
|
|
142 |
iKeypadToneObserverAO->Subscribe();
|
|
143 |
|
|
144 |
iSilenceModeObserverAO = CSilenceModeObserverAO::NewL(
|
|
145 |
iGlobalAudioSettings,
|
|
146 |
iAudioSettingsObserver,
|
|
147 |
iGlobalAudioSettingsData);
|
|
148 |
iSilenceModeObserverAO->Subscribe();
|
|
149 |
|
|
150 |
RProperty publicSilenceProperty;
|
|
151 |
User::LeaveIfError(publicSilenceProperty.Attach(KGASPSUidGlobalAudioSettings, KGASPublicSilence));
|
|
152 |
User::LeaveIfError(publicSilenceProperty.Get(iGlobalAudioSettingsData.iPublicSilence));
|
|
153 |
publicSilenceProperty.Close();
|
|
154 |
|
|
155 |
iCAudioClientsListManagerAO = CAudioClientsListManagerAO::NewL( iGlobalAudioSettings,iAudioClientsListObserverArray,KAudioPolicyAudioClients);
|
|
156 |
|
|
157 |
iPausedClientsListManagerAO = CAudioClientsListManagerAO::NewL( iGlobalAudioSettings,iAudioClientsListObserverArray,KAudioPolicyApplicationAudioStatePaused );
|
|
158 |
}
|
|
159 |
|
|
160 |
// Destructor
|
|
161 |
CGlobalAudioSettingsImpl::~CGlobalAudioSettingsImpl()
|
|
162 |
{
|
|
163 |
DeleteProperties();
|
|
164 |
delete iWarningTonesObserverAO;
|
|
165 |
delete iMessagingTonesObserverAO;
|
|
166 |
delete iSilentProfileObserverAO;
|
|
167 |
delete iVibraObserverAO;
|
|
168 |
delete iRingingTypeObserverAO;
|
|
169 |
delete iMessageToneObserverAO;
|
|
170 |
delete iEmailToneObserverAO;
|
|
171 |
delete iVideoCallObserverAO;
|
|
172 |
delete iRingingTone1ObserverAO;
|
|
173 |
delete iRingingTone2ObserverAO;
|
|
174 |
delete iKeypadToneObserverAO;
|
|
175 |
delete iSilenceModeObserverAO;
|
|
176 |
delete iCAudioClientsListManagerAO;
|
|
177 |
delete iPausedClientsListManagerAO;
|
|
178 |
iAudioClientsListObserverArray.Close();
|
|
179 |
}
|
|
180 |
|
|
181 |
// -----------------------------------------------------------------------------
|
|
182 |
// CGlobalAudioSettingsImpl::NewL
|
|
183 |
// Static function for creating an instance of the EnvironmentalReverb object.
|
|
184 |
// -----------------------------------------------------------------------------
|
|
185 |
//
|
|
186 |
TBool CGlobalAudioSettingsImpl::IsWarningTonesEnabled()
|
|
187 |
{
|
|
188 |
if(iGlobalAudioSettingsData.iWarningTones)
|
|
189 |
return(ETrue);
|
|
190 |
else
|
|
191 |
return(EFalse);
|
|
192 |
}
|
|
193 |
|
|
194 |
// -----------------------------------------------------------------------------
|
|
195 |
// CGlobalAudioSettingsImpl::IsMessageTonesEnabled
|
|
196 |
//
|
|
197 |
// -----------------------------------------------------------------------------
|
|
198 |
//
|
|
199 |
TBool CGlobalAudioSettingsImpl::IsMessageTonesEnabled()
|
|
200 |
{
|
|
201 |
if(iGlobalAudioSettingsData.iMessageTones)
|
|
202 |
return(ETrue);
|
|
203 |
else
|
|
204 |
return(EFalse);
|
|
205 |
}
|
|
206 |
|
|
207 |
// -----------------------------------------------------------------------------
|
|
208 |
// CGlobalAudioSettingsImpl::IsSilentProfileEnabled
|
|
209 |
//
|
|
210 |
// -----------------------------------------------------------------------------
|
|
211 |
//
|
|
212 |
TBool CGlobalAudioSettingsImpl::IsSilentProfileEnabled()
|
|
213 |
{
|
|
214 |
if(iGlobalAudioSettingsData.iSilentProfile)
|
|
215 |
return(ETrue);
|
|
216 |
else
|
|
217 |
return(EFalse);
|
|
218 |
}
|
|
219 |
|
|
220 |
// -----------------------------------------------------------------------------
|
|
221 |
// CGlobalAudioSettingsImpl::IsVibraEnabled
|
|
222 |
//
|
|
223 |
// -----------------------------------------------------------------------------
|
|
224 |
//
|
|
225 |
TBool CGlobalAudioSettingsImpl::IsVibraEnabled()
|
|
226 |
{
|
|
227 |
if(iGlobalAudioSettingsData.iVibra)
|
|
228 |
return(ETrue);
|
|
229 |
else
|
|
230 |
return(EFalse);
|
|
231 |
}
|
|
232 |
|
|
233 |
// -----------------------------------------------------------------------------
|
|
234 |
// CGlobalAudioSettingsImpl::IsPublicSilenceEnabled
|
|
235 |
//
|
|
236 |
// -----------------------------------------------------------------------------
|
|
237 |
//
|
|
238 |
TBool CGlobalAudioSettingsImpl::IsPublicSilenceEnabled()
|
|
239 |
{
|
|
240 |
if(iGlobalAudioSettingsData.iPublicSilence)
|
|
241 |
return(ETrue);
|
|
242 |
else
|
|
243 |
return(EFalse);
|
|
244 |
}
|
|
245 |
|
|
246 |
|
|
247 |
|
|
248 |
|
|
249 |
TDesC& CGlobalAudioSettingsImpl::MessageAlertTone()
|
|
250 |
{
|
|
251 |
return *iGlobalAudioSettingsData.iMessageToneName;
|
|
252 |
|
|
253 |
}
|
|
254 |
|
|
255 |
TBool CGlobalAudioSettingsImpl::IsMessageAlertToneEnabled()
|
|
256 |
{
|
|
257 |
if(iGlobalAudioSettingsData.iMessageToneName->CompareF(KNoSound)==0)
|
|
258 |
return EFalse;
|
|
259 |
else
|
|
260 |
return ETrue;
|
|
261 |
|
|
262 |
}
|
|
263 |
TDesC& CGlobalAudioSettingsImpl::EmailAlertTone()
|
|
264 |
{
|
|
265 |
return *iGlobalAudioSettingsData.iEmailToneName;
|
|
266 |
|
|
267 |
}
|
|
268 |
TBool CGlobalAudioSettingsImpl::IsEmailAlertToneEnabled()
|
|
269 |
{
|
|
270 |
if(iGlobalAudioSettingsData.iEmailToneName->CompareF(KNoSound)==0)
|
|
271 |
return EFalse;
|
|
272 |
else
|
|
273 |
return ETrue;
|
|
274 |
|
|
275 |
}
|
|
276 |
CGlobalAudioSettings::TGASRingingType CGlobalAudioSettingsImpl::RingingType()
|
|
277 |
{
|
|
278 |
CGlobalAudioSettings::TGASRingingType type;
|
|
279 |
type= ( CGlobalAudioSettings::TGASRingingType)iGlobalAudioSettingsData.iRingingType;
|
|
280 |
|
|
281 |
return type;
|
|
282 |
}
|
|
283 |
|
|
284 |
TDesC& CGlobalAudioSettingsImpl::VideoCallAlertTone()
|
|
285 |
{
|
|
286 |
return *iGlobalAudioSettingsData.iVideoCallToneName;
|
|
287 |
}
|
|
288 |
TBool CGlobalAudioSettingsImpl::IsVideoCallAlertToneEnabled()
|
|
289 |
{
|
|
290 |
if(iGlobalAudioSettingsData.iVideoCallToneName->CompareF(KNoSound)==0)
|
|
291 |
return EFalse;
|
|
292 |
else
|
|
293 |
return ETrue;
|
|
294 |
|
|
295 |
}
|
|
296 |
TDesC& CGlobalAudioSettingsImpl::RingingAlertTone1()
|
|
297 |
{
|
|
298 |
return *iGlobalAudioSettingsData.iRingingTone1Name;
|
|
299 |
}
|
|
300 |
TBool CGlobalAudioSettingsImpl::IsRingingAlertTone1Enabled()
|
|
301 |
{
|
|
302 |
if(iGlobalAudioSettingsData.iRingingTone1Name->CompareF(KNoSound)==0)
|
|
303 |
return EFalse;
|
|
304 |
else
|
|
305 |
return ETrue;
|
|
306 |
|
|
307 |
}
|
|
308 |
TDesC& CGlobalAudioSettingsImpl::RingingAlertTone2()
|
|
309 |
{
|
|
310 |
return *iGlobalAudioSettingsData.iRingingTone2Name;
|
|
311 |
}
|
|
312 |
|
|
313 |
TBool CGlobalAudioSettingsImpl::IsRingingAlertTone2Enabled()
|
|
314 |
{
|
|
315 |
if(iGlobalAudioSettingsData.iRingingTone2Name->CompareF(KNoSound)==0)
|
|
316 |
return EFalse;
|
|
317 |
else
|
|
318 |
return ETrue;
|
|
319 |
|
|
320 |
}
|
|
321 |
CGlobalAudioSettings::TGASKeypadVolume CGlobalAudioSettingsImpl::KeyPadToneVolume()
|
|
322 |
{
|
|
323 |
return (CGlobalAudioSettings::TGASKeypadVolume)iGlobalAudioSettingsData.iKeyPadVolume;
|
|
324 |
}
|
|
325 |
|
|
326 |
TBool CGlobalAudioSettingsImpl::IsSilenceModeEnabled()
|
|
327 |
{
|
|
328 |
return iGlobalAudioSettingsData.iSilenceMode;
|
|
329 |
}
|
|
330 |
// -----------------------------------------------------------------------------
|
|
331 |
// CGlobalAudioSettingsImpl::RegisterAudioClientsListObserver
|
|
332 |
//
|
|
333 |
// -----------------------------------------------------------------------------
|
|
334 |
//
|
|
335 |
TInt CGlobalAudioSettingsImpl::RegisterAudioClientsListObserver(
|
|
336 |
MAudioClientsListObserver& aObserver )
|
|
337 |
{
|
|
338 |
TInt status(KErrAlreadyExists);
|
|
339 |
if ( iAudioClientsListObserverArray.Find( &aObserver ) == KErrNotFound )
|
|
340 |
{
|
|
341 |
status = iAudioClientsListObserverArray.Append( &aObserver);
|
|
342 |
if ( ( status == KErrNone ) && (iAudioClientsListObserverArray.Count() == 1 ) )
|
|
343 |
{
|
|
344 |
iCAudioClientsListManagerAO->MonitorStart();
|
|
345 |
iPausedClientsListManagerAO->MonitorStart();
|
|
346 |
}
|
|
347 |
}
|
|
348 |
return status;
|
|
349 |
}
|
|
350 |
|
|
351 |
// -----------------------------------------------------------------------------
|
|
352 |
// CGlobalAudioSettingsImpl::UnregisterAudioClientsListObserver
|
|
353 |
//
|
|
354 |
// -----------------------------------------------------------------------------
|
|
355 |
//
|
|
356 |
TInt CGlobalAudioSettingsImpl::UnregisterAudioClientsListObserver(
|
|
357 |
MAudioClientsListObserver& aObserver)
|
|
358 |
{
|
|
359 |
TInt status(KErrNone);
|
|
360 |
status = iAudioClientsListObserverArray.Find( &aObserver );
|
|
361 |
if ( status != KErrNotFound )
|
|
362 |
{
|
|
363 |
iAudioClientsListObserverArray.Remove( status );
|
|
364 |
if ( iAudioClientsListObserverArray.Count() == 0 )
|
|
365 |
{
|
|
366 |
iCAudioClientsListManagerAO->MonitorStop();
|
|
367 |
iPausedClientsListManagerAO->MonitorStop();
|
|
368 |
}
|
|
369 |
}
|
|
370 |
return status;
|
|
371 |
}
|
|
372 |
|
|
373 |
// -----------------------------------------------------------------------------
|
|
374 |
// CGlobalAudioSettingsImpl::GetAudioClientsList
|
|
375 |
//
|
|
376 |
// -----------------------------------------------------------------------------
|
|
377 |
//
|
|
378 |
TInt CGlobalAudioSettingsImpl::GetAudioClientsList(
|
|
379 |
CGlobalAudioSettings::TAudioClientListType aType,
|
|
380 |
RArray<TProcessId>& aList )
|
|
381 |
{
|
|
382 |
TInt status(KErrNone);
|
|
383 |
|
|
384 |
switch(aType)
|
|
385 |
{
|
|
386 |
case CGlobalAudioSettings::EActiveAudioClients:
|
|
387 |
{
|
|
388 |
status = iCAudioClientsListManagerAO->GetAudioClientsList( aType, aList );
|
|
389 |
}
|
|
390 |
break;
|
|
391 |
case CGlobalAudioSettings::EPausedAudioClients:
|
|
392 |
{
|
|
393 |
status = iPausedClientsListManagerAO->GetAudioClientsList( aType, aList );
|
|
394 |
}
|
|
395 |
break;
|
|
396 |
default:
|
|
397 |
break;
|
|
398 |
|
|
399 |
}
|
|
400 |
return status;
|
|
401 |
|
|
402 |
|
|
403 |
}
|
|
404 |
|
|
405 |
void CGlobalAudioSettingsImpl::CreatePropertiesL()
|
|
406 |
{
|
|
407 |
TSecurityPolicy read = TSecurityPolicy(ECapabilityWriteDeviceData);
|
|
408 |
TSecurityPolicy write = TSecurityPolicy(ECapabilityMultimediaDD);
|
|
409 |
|
|
410 |
RProperty property;
|
|
411 |
TInt err = RProperty::Define(
|
|
412 |
KGASPSUidGlobalAudioSettings,
|
|
413 |
KGASWarningTones,
|
|
414 |
RProperty::EInt,
|
|
415 |
read,
|
|
416 |
write);
|
|
417 |
|
|
418 |
if(err == KErrNone)
|
|
419 |
{
|
|
420 |
iPropertiesCreated=ETrue;
|
|
421 |
User::LeaveIfError(RProperty::Define(
|
|
422 |
KGASPSUidGlobalAudioSettings,
|
|
423 |
KGASMessageTones,
|
|
424 |
RProperty::EInt,
|
|
425 |
read,
|
|
426 |
write));
|
|
427 |
|
|
428 |
|
|
429 |
|
|
430 |
User::LeaveIfError(RProperty::Define(
|
|
431 |
KGASPSUidGlobalAudioSettings,
|
|
432 |
KGASSilentProfile,
|
|
433 |
RProperty::EInt,
|
|
434 |
read,
|
|
435 |
write));
|
|
436 |
|
|
437 |
User::LeaveIfError(RProperty::Define(
|
|
438 |
KGASPSUidGlobalAudioSettings,
|
|
439 |
KGASVibra,
|
|
440 |
RProperty::EInt,
|
|
441 |
read,
|
|
442 |
write));
|
|
443 |
|
|
444 |
User::LeaveIfError(RProperty::Define(
|
|
445 |
KGASPSUidGlobalAudioSettings,
|
|
446 |
KGASPublicSilence,
|
|
447 |
RProperty::EInt,
|
|
448 |
read,
|
|
449 |
write));
|
|
450 |
User::LeaveIfError(RProperty::Define(
|
|
451 |
KGASPSUidGlobalAudioSettings,
|
|
452 |
KGASRingingType,
|
|
453 |
RProperty::EInt,
|
|
454 |
read,
|
|
455 |
write));
|
|
456 |
User::LeaveIfError(RProperty::Define(
|
|
457 |
KGASPSUidGlobalAudioSettings,
|
|
458 |
KGASMessageToneName,
|
|
459 |
RProperty::EText,
|
|
460 |
read,
|
|
461 |
write));
|
|
462 |
CleanupClosePushL(property);
|
|
463 |
User::LeaveIfError(property.Attach(
|
|
464 |
KGASPSUidGlobalAudioSettings,
|
|
465 |
KGASMessageToneName));
|
|
466 |
User::LeaveIfError(property.Set(
|
|
467 |
KGASPSUidGlobalAudioSettings,
|
|
468 |
KGASMessageToneName,
|
|
469 |
KNullDesC));
|
|
470 |
CleanupStack::Pop();
|
|
471 |
property.Close();
|
|
472 |
|
|
473 |
User::LeaveIfError(RProperty::Define(
|
|
474 |
KGASPSUidGlobalAudioSettings,
|
|
475 |
KGASEmailToneName,
|
|
476 |
RProperty::EText,
|
|
477 |
read,
|
|
478 |
write));
|
|
479 |
CleanupClosePushL(property);
|
|
480 |
User::LeaveIfError(property.Attach(
|
|
481 |
KGASPSUidGlobalAudioSettings,
|
|
482 |
KGASEmailToneName));
|
|
483 |
User::LeaveIfError(property.Set(
|
|
484 |
KGASPSUidGlobalAudioSettings,
|
|
485 |
KGASEmailToneName,
|
|
486 |
KNullDesC));
|
|
487 |
CleanupStack::Pop();
|
|
488 |
property.Close();
|
|
489 |
User::LeaveIfError(RProperty::Define(
|
|
490 |
KGASPSUidGlobalAudioSettings,
|
|
491 |
KGASVideoCallToneName,
|
|
492 |
RProperty::EText,
|
|
493 |
read,
|
|
494 |
write));
|
|
495 |
CleanupClosePushL(property);
|
|
496 |
|
|
497 |
User::LeaveIfError(property.Attach(
|
|
498 |
KGASPSUidGlobalAudioSettings,
|
|
499 |
KGASVideoCallToneName));
|
|
500 |
User::LeaveIfError(property.Set(
|
|
501 |
KGASPSUidGlobalAudioSettings,
|
|
502 |
KGASVideoCallToneName,
|
|
503 |
KNullDesC));
|
|
504 |
CleanupStack::Pop();
|
|
505 |
property.Close();
|
|
506 |
|
|
507 |
User::LeaveIfError(RProperty::Define(
|
|
508 |
KGASPSUidGlobalAudioSettings,
|
|
509 |
KGASRingingTone1Name,
|
|
510 |
RProperty::EText,
|
|
511 |
read,
|
|
512 |
write));
|
|
513 |
CleanupClosePushL(property);
|
|
514 |
User::LeaveIfError(property.Attach(
|
|
515 |
KGASPSUidGlobalAudioSettings,
|
|
516 |
KGASRingingTone1Name));
|
|
517 |
User::LeaveIfError(property.Set(
|
|
518 |
KGASPSUidGlobalAudioSettings,
|
|
519 |
KGASRingingTone1Name,
|
|
520 |
KNullDesC));
|
|
521 |
CleanupStack::Pop();
|
|
522 |
property.Close();
|
|
523 |
|
|
524 |
User::LeaveIfError(RProperty::Define(
|
|
525 |
KGASPSUidGlobalAudioSettings,
|
|
526 |
KGASRingingTone2Name,
|
|
527 |
RProperty::EText,
|
|
528 |
read,
|
|
529 |
write));
|
|
530 |
CleanupClosePushL(property);
|
|
531 |
User::LeaveIfError(property.Attach(
|
|
532 |
KGASPSUidGlobalAudioSettings,
|
|
533 |
KGASRingingTone2Name));
|
|
534 |
User::LeaveIfError(property.Set(
|
|
535 |
KGASPSUidGlobalAudioSettings,
|
|
536 |
KGASRingingTone2Name,
|
|
537 |
KNullDesC));
|
|
538 |
CleanupStack::Pop();
|
|
539 |
property.Close();
|
|
540 |
|
|
541 |
User::LeaveIfError(RProperty::Define(
|
|
542 |
KGASPSUidGlobalAudioSettings,
|
|
543 |
KGASKeypadToneVolume,
|
|
544 |
RProperty::EInt,
|
|
545 |
read,
|
|
546 |
write));
|
|
547 |
|
|
548 |
User::LeaveIfError(RProperty::Define(
|
|
549 |
KGASPSUidGlobalAudioSettings,
|
|
550 |
KGASSilenceMode,
|
|
551 |
RProperty::EInt,
|
|
552 |
read,
|
|
553 |
write));
|
|
554 |
}
|
|
555 |
else if(err != KErrAlreadyExists)
|
|
556 |
{
|
|
557 |
|
|
558 |
User::Leave(err);
|
|
559 |
}
|
|
560 |
else
|
|
561 |
{
|
|
562 |
|
|
563 |
return;
|
|
564 |
}
|
|
565 |
|
|
566 |
}
|
|
567 |
|
|
568 |
void CGlobalAudioSettingsImpl::DeleteProperties()
|
|
569 |
{
|
|
570 |
|
|
571 |
if(iPropertiesCreated)
|
|
572 |
{
|
|
573 |
|
|
574 |
RProperty::Delete(KGASPSUidGlobalAudioSettings, KGASWarningTones);
|
|
575 |
|
|
576 |
|
|
577 |
RProperty::Delete(KGASPSUidGlobalAudioSettings, KGASMessageTones);
|
|
578 |
|
|
579 |
|
|
580 |
RProperty::Delete(KGASPSUidGlobalAudioSettings, KGASSilentProfile);
|
|
581 |
|
|
582 |
|
|
583 |
RProperty::Delete(KGASPSUidGlobalAudioSettings, KGASVibra);
|
|
584 |
|
|
585 |
|
|
586 |
RProperty::Delete(KGASPSUidGlobalAudioSettings,KGASRingingType);
|
|
587 |
|
|
588 |
|
|
589 |
RProperty::Delete(KGASPSUidGlobalAudioSettings, KGASMessageToneName);
|
|
590 |
|
|
591 |
|
|
592 |
RProperty::Delete(KGASPSUidGlobalAudioSettings,KGASEmailToneName);
|
|
593 |
|
|
594 |
|
|
595 |
RProperty::Delete(KGASPSUidGlobalAudioSettings,KGASVideoCallToneName);
|
|
596 |
|
|
597 |
|
|
598 |
RProperty::Delete(KGASPSUidGlobalAudioSettings,KGASRingingTone1Name);
|
|
599 |
|
|
600 |
|
|
601 |
RProperty::Delete(KGASPSUidGlobalAudioSettings,KGASRingingTone2Name);
|
|
602 |
|
|
603 |
|
|
604 |
RProperty::Delete(KGASPSUidGlobalAudioSettings,KGASKeypadToneVolume);
|
|
605 |
|
|
606 |
RProperty::Delete(KGASPSUidGlobalAudioSettings,KGASSilenceMode);
|
|
607 |
iPropertiesCreated = EFalse;
|
|
608 |
|
|
609 |
}
|
|
610 |
}
|
|
611 |
//////////////////////////////////////////////////////////////////////
|
|
612 |
// CWarningTonesObserverAO //
|
|
613 |
//////////////////////////////////////////////////////////////////////
|
|
614 |
CWarningTonesObserverAO::CWarningTonesObserverAO(
|
|
615 |
CGlobalAudioSettings &aGlobalAudioSettings,
|
|
616 |
MAudioSettingsObserver& aAudioSettingsObserver,
|
|
617 |
TGlobalAudioSettings& aGlobalAudioSettingsData)
|
|
618 |
:CActive(EPriorityStandard),
|
|
619 |
iGlobalAudioSettings(aGlobalAudioSettings),
|
|
620 |
iAudioSettingsObserver(aAudioSettingsObserver),
|
|
621 |
iGlobalAudioSettingsData(aGlobalAudioSettingsData)
|
|
622 |
{
|
|
623 |
CActiveScheduler::Add(this);
|
|
624 |
}
|
|
625 |
|
|
626 |
CWarningTonesObserverAO::~CWarningTonesObserverAO()
|
|
627 |
{
|
|
628 |
Cancel();
|
|
629 |
iWarningTonesProperty.Close();
|
|
630 |
}
|
|
631 |
|
|
632 |
CWarningTonesObserverAO* CWarningTonesObserverAO::NewL(
|
|
633 |
CGlobalAudioSettings &aGlobalAudioSettings,
|
|
634 |
MAudioSettingsObserver& aAudioSettingsObserver,
|
|
635 |
TGlobalAudioSettings& aGlobalAudioSettingsData)
|
|
636 |
{
|
|
637 |
CWarningTonesObserverAO* self = new (ELeave) CWarningTonesObserverAO(
|
|
638 |
aGlobalAudioSettings,
|
|
639 |
aAudioSettingsObserver,
|
|
640 |
aGlobalAudioSettingsData);
|
|
641 |
CleanupStack::PushL(self);
|
|
642 |
self->ConstructL();
|
|
643 |
CleanupStack::Pop();
|
|
644 |
return self;
|
|
645 |
}
|
|
646 |
|
|
647 |
void CWarningTonesObserverAO::ConstructL()
|
|
648 |
{
|
|
649 |
User::LeaveIfError(iWarningTonesProperty.Attach(KGASPSUidGlobalAudioSettings, KGASWarningTones));
|
|
650 |
User::LeaveIfError(iWarningTonesProperty.Get(iGlobalAudioSettingsData.iWarningTones));
|
|
651 |
}
|
|
652 |
|
|
653 |
void CWarningTonesObserverAO::Subscribe()
|
|
654 |
{
|
|
655 |
if (!IsActive())
|
|
656 |
{
|
|
657 |
SetActive();
|
|
658 |
iWarningTonesProperty.Subscribe(iStatus);
|
|
659 |
}
|
|
660 |
}
|
|
661 |
|
|
662 |
void CWarningTonesObserverAO::RunL()
|
|
663 |
{
|
|
664 |
TInt status(iStatus.Int());
|
|
665 |
#ifdef PRINT_MESSAGE
|
|
666 |
RDebug::Print(_L(" CWarningTonesObserverAO::RunL:iStatus[%d]"), status);
|
|
667 |
#endif // PRINT_MESSAGE
|
|
668 |
if ( status == KErrNone )
|
|
669 |
{
|
|
670 |
Subscribe();
|
|
671 |
status = iWarningTonesProperty.Get(iGlobalAudioSettingsData.iWarningTones);
|
|
672 |
if(status == KErrNone)
|
|
673 |
{
|
|
674 |
MAudioSettingsObserver::TGASEventId id=MAudioSettingsObserver::EGASWarningTones;
|
|
675 |
iAudioSettingsObserver.SettingsChanged(iGlobalAudioSettings, id);
|
|
676 |
}
|
|
677 |
#ifdef PRINT_MESSAGE
|
|
678 |
else
|
|
679 |
{
|
|
680 |
RDebug::Print(_L(" CWarningTonesObserverAO::RunL:Property.Get Error[%d]"), status);
|
|
681 |
}
|
|
682 |
#endif // PRINT_MESSAGE
|
|
683 |
}
|
|
684 |
}
|
|
685 |
|
|
686 |
void CWarningTonesObserverAO::DoCancel()
|
|
687 |
{
|
|
688 |
iWarningTonesProperty.Cancel();
|
|
689 |
}
|
|
690 |
|
|
691 |
TInt CWarningTonesObserverAO::RunError(TInt /*aError*/)
|
|
692 |
{
|
|
693 |
return KErrNone;
|
|
694 |
}
|
|
695 |
|
|
696 |
//////////////////////////////////////////////////////////////////////
|
|
697 |
// CMessagingTonesObserverAO //
|
|
698 |
//////////////////////////////////////////////////////////////////////
|
|
699 |
CMessagingTonesObserverAO::CMessagingTonesObserverAO(
|
|
700 |
CGlobalAudioSettings &aGlobalAudioSettings,
|
|
701 |
MAudioSettingsObserver& aAudioSettingsObserver,
|
|
702 |
TGlobalAudioSettings& aGlobalAudioSettingsData)
|
|
703 |
:CActive(EPriorityStandard),
|
|
704 |
iGlobalAudioSettings(aGlobalAudioSettings),
|
|
705 |
iAudioSettingsObserver(aAudioSettingsObserver),
|
|
706 |
iGlobalAudioSettingsData(aGlobalAudioSettingsData)
|
|
707 |
{
|
|
708 |
CActiveScheduler::Add(this);
|
|
709 |
}
|
|
710 |
|
|
711 |
CMessagingTonesObserverAO::~CMessagingTonesObserverAO()
|
|
712 |
{
|
|
713 |
Cancel();
|
|
714 |
iMessagingTonesProperty.Close();
|
|
715 |
}
|
|
716 |
|
|
717 |
CMessagingTonesObserverAO* CMessagingTonesObserverAO::NewL(
|
|
718 |
CGlobalAudioSettings &aGlobalAudioSettings,
|
|
719 |
MAudioSettingsObserver& aAudioSettingsObserver,
|
|
720 |
TGlobalAudioSettings& aGlobalAudioSettingsData)
|
|
721 |
{
|
|
722 |
CMessagingTonesObserverAO* self = new (ELeave) CMessagingTonesObserverAO(
|
|
723 |
aGlobalAudioSettings, aAudioSettingsObserver,
|
|
724 |
aGlobalAudioSettingsData);
|
|
725 |
CleanupStack::PushL(self);
|
|
726 |
self->ConstructL();
|
|
727 |
CleanupStack::Pop();
|
|
728 |
return self;
|
|
729 |
}
|
|
730 |
|
|
731 |
void CMessagingTonesObserverAO::ConstructL()
|
|
732 |
{
|
|
733 |
User::LeaveIfError(iMessagingTonesProperty.Attach(KGASPSUidGlobalAudioSettings, KGASMessageTones));
|
|
734 |
User::LeaveIfError(iMessagingTonesProperty.Get(iGlobalAudioSettingsData.iMessageTones));
|
|
735 |
}
|
|
736 |
|
|
737 |
void CMessagingTonesObserverAO::Subscribe()
|
|
738 |
{
|
|
739 |
if (!IsActive())
|
|
740 |
{
|
|
741 |
SetActive();
|
|
742 |
iMessagingTonesProperty.Subscribe(iStatus);
|
|
743 |
}
|
|
744 |
}
|
|
745 |
|
|
746 |
void CMessagingTonesObserverAO::RunL()
|
|
747 |
{
|
|
748 |
TInt status(iStatus.Int());
|
|
749 |
#ifdef PRINT_MESSAGE
|
|
750 |
RDebug::Print(_L(" CMessagingTonesObserverAO::RunL:iStatus[%d]"), status);
|
|
751 |
#endif // PRINT_MESSAGE
|
|
752 |
if ( status == KErrNone )
|
|
753 |
{
|
|
754 |
Subscribe();
|
|
755 |
status = iMessagingTonesProperty.Get(iGlobalAudioSettingsData.iMessageTones);
|
|
756 |
if(status == KErrNone)
|
|
757 |
{
|
|
758 |
MAudioSettingsObserver::TGASEventId id=MAudioSettingsObserver::EGASMessageTones;
|
|
759 |
iAudioSettingsObserver.SettingsChanged(iGlobalAudioSettings, id);
|
|
760 |
}
|
|
761 |
#ifdef PRINT_MESSAGE
|
|
762 |
else
|
|
763 |
{
|
|
764 |
RDebug::Print(_L(" CMessagingTonesObserverAO::RunL:Property.Get Error[%d]"), status);
|
|
765 |
}
|
|
766 |
#endif // PRINT_MESSAGE
|
|
767 |
}
|
|
768 |
}
|
|
769 |
|
|
770 |
void CMessagingTonesObserverAO::DoCancel()
|
|
771 |
{
|
|
772 |
iMessagingTonesProperty.Cancel();
|
|
773 |
}
|
|
774 |
|
|
775 |
TInt CMessagingTonesObserverAO::RunError(TInt /*aError*/)
|
|
776 |
{
|
|
777 |
return KErrNone;
|
|
778 |
}
|
|
779 |
|
|
780 |
//////////////////////////////////////////////////////////////////////
|
|
781 |
// CSilentProfileObserverAO //
|
|
782 |
//////////////////////////////////////////////////////////////////////
|
|
783 |
CSilentProfileObserverAO::CSilentProfileObserverAO(
|
|
784 |
CGlobalAudioSettings &aGlobalAudioSettings,
|
|
785 |
MAudioSettingsObserver& aAudioSettingsObserver,
|
|
786 |
TGlobalAudioSettings& aGlobalAudioSettingsData)
|
|
787 |
:CActive(EPriorityStandard),
|
|
788 |
iGlobalAudioSettings(aGlobalAudioSettings),
|
|
789 |
iAudioSettingsObserver(aAudioSettingsObserver),
|
|
790 |
iGlobalAudioSettingsData(aGlobalAudioSettingsData)
|
|
791 |
{
|
|
792 |
CActiveScheduler::Add(this);
|
|
793 |
}
|
|
794 |
|
|
795 |
CSilentProfileObserverAO::~CSilentProfileObserverAO()
|
|
796 |
{
|
|
797 |
Cancel();
|
|
798 |
iSilentProfileProperty.Close();
|
|
799 |
}
|
|
800 |
|
|
801 |
CSilentProfileObserverAO* CSilentProfileObserverAO::NewL(
|
|
802 |
CGlobalAudioSettings &aGlobalAudioSettings,
|
|
803 |
MAudioSettingsObserver& aAudioSettingsObserver,
|
|
804 |
TGlobalAudioSettings& aGlobalAudioSettingsData)
|
|
805 |
{
|
|
806 |
CSilentProfileObserverAO* self = new (ELeave) CSilentProfileObserverAO(
|
|
807 |
aGlobalAudioSettings, aAudioSettingsObserver,
|
|
808 |
aGlobalAudioSettingsData);
|
|
809 |
CleanupStack::PushL(self);
|
|
810 |
self->ConstructL();
|
|
811 |
CleanupStack::Pop();
|
|
812 |
return self;
|
|
813 |
}
|
|
814 |
|
|
815 |
void CSilentProfileObserverAO::ConstructL()
|
|
816 |
{
|
|
817 |
User::LeaveIfError(iSilentProfileProperty.Attach(KGASPSUidGlobalAudioSettings, KGASSilentProfile));
|
|
818 |
User::LeaveIfError(iSilentProfileProperty.Get(iGlobalAudioSettingsData.iSilentProfile));
|
|
819 |
}
|
|
820 |
|
|
821 |
void CSilentProfileObserverAO::Subscribe()
|
|
822 |
{
|
|
823 |
if (!IsActive())
|
|
824 |
{
|
|
825 |
SetActive();
|
|
826 |
iSilentProfileProperty.Subscribe(iStatus);
|
|
827 |
}
|
|
828 |
}
|
|
829 |
|
|
830 |
void CSilentProfileObserverAO::RunL()
|
|
831 |
{
|
|
832 |
TInt status(iStatus.Int());
|
|
833 |
#ifdef PRINT_MESSAGE
|
|
834 |
RDebug::Print(_L(" CSilentProfileObserverAO::RunL:iStatus[%d]"), status);
|
|
835 |
#endif // PRINT_MESSAGE
|
|
836 |
if ( status == KErrNone )
|
|
837 |
{
|
|
838 |
Subscribe();
|
|
839 |
status = iSilentProfileProperty.Get(iGlobalAudioSettingsData.iSilentProfile);
|
|
840 |
if(status == KErrNone)
|
|
841 |
{
|
|
842 |
MAudioSettingsObserver::TGASEventId id=MAudioSettingsObserver::EGASSilentProfile;
|
|
843 |
iAudioSettingsObserver.SettingsChanged(iGlobalAudioSettings, id);
|
|
844 |
}
|
|
845 |
#ifdef PRINT_MESSAGE
|
|
846 |
else
|
|
847 |
{
|
|
848 |
RDebug::Print(_L(" CSilentProfileObserverAO::RunL:Property.Get Error[%d]"), status);
|
|
849 |
}
|
|
850 |
#endif // PRINT_MESSAGE
|
|
851 |
}
|
|
852 |
}
|
|
853 |
|
|
854 |
void CSilentProfileObserverAO::DoCancel()
|
|
855 |
{
|
|
856 |
iSilentProfileProperty.Cancel();
|
|
857 |
}
|
|
858 |
|
|
859 |
TInt CSilentProfileObserverAO::RunError(TInt /*aError*/)
|
|
860 |
{
|
|
861 |
return KErrNone;
|
|
862 |
}
|
|
863 |
|
|
864 |
//////////////////////////////////////////////////////////////////////
|
|
865 |
// CVibraObserverAO //
|
|
866 |
//////////////////////////////////////////////////////////////////////
|
|
867 |
CVibraObserverAO::CVibraObserverAO(
|
|
868 |
CGlobalAudioSettings &aGlobalAudioSettings,
|
|
869 |
MAudioSettingsObserver& aAudioSettingsObserver,
|
|
870 |
TGlobalAudioSettings& aGlobalAudioSettingsData)
|
|
871 |
:CActive(EPriorityStandard),
|
|
872 |
iGlobalAudioSettings(aGlobalAudioSettings),
|
|
873 |
iAudioSettingsObserver(aAudioSettingsObserver),
|
|
874 |
iGlobalAudioSettingsData(aGlobalAudioSettingsData)
|
|
875 |
{
|
|
876 |
CActiveScheduler::Add(this);
|
|
877 |
}
|
|
878 |
|
|
879 |
CVibraObserverAO::~CVibraObserverAO()
|
|
880 |
{
|
|
881 |
Cancel();
|
|
882 |
iVibraProperty.Close();
|
|
883 |
}
|
|
884 |
|
|
885 |
CVibraObserverAO* CVibraObserverAO::NewL(
|
|
886 |
CGlobalAudioSettings &aGlobalAudioSettings,
|
|
887 |
MAudioSettingsObserver& aAudioSettingsObserver,
|
|
888 |
TGlobalAudioSettings& aGlobalAudioSettingsData)
|
|
889 |
{
|
|
890 |
CVibraObserverAO* self = new (ELeave) CVibraObserverAO(
|
|
891 |
aGlobalAudioSettings,
|
|
892 |
aAudioSettingsObserver,
|
|
893 |
aGlobalAudioSettingsData);
|
|
894 |
CleanupStack::PushL(self);
|
|
895 |
self->ConstructL();
|
|
896 |
CleanupStack::Pop();
|
|
897 |
return self;
|
|
898 |
}
|
|
899 |
|
|
900 |
void CVibraObserverAO::ConstructL()
|
|
901 |
{
|
|
902 |
User::LeaveIfError(iVibraProperty.Attach(KGASPSUidGlobalAudioSettings, KGASVibra));
|
|
903 |
User::LeaveIfError(iVibraProperty.Get(iGlobalAudioSettingsData.iVibra));
|
|
904 |
}
|
|
905 |
|
|
906 |
void CVibraObserverAO::Subscribe()
|
|
907 |
{
|
|
908 |
if (!IsActive())
|
|
909 |
{
|
|
910 |
SetActive();
|
|
911 |
iVibraProperty.Subscribe(iStatus);
|
|
912 |
}
|
|
913 |
}
|
|
914 |
|
|
915 |
void CVibraObserverAO::RunL()
|
|
916 |
{
|
|
917 |
TInt status(iStatus.Int());
|
|
918 |
#ifdef PRINT_MESSAGE
|
|
919 |
RDebug::Print(_L(" CVibraObserverAO::RunL:iStatus[%d]"), status);
|
|
920 |
#endif // PRINT_MESSAGE
|
|
921 |
if ( status == KErrNone )
|
|
922 |
{
|
|
923 |
Subscribe();
|
|
924 |
status = iVibraProperty.Get(iGlobalAudioSettingsData.iVibra);
|
|
925 |
if( status == KErrNone)
|
|
926 |
{
|
|
927 |
MAudioSettingsObserver::TGASEventId id=MAudioSettingsObserver::EGASVibra;
|
|
928 |
iAudioSettingsObserver.SettingsChanged(iGlobalAudioSettings,id);
|
|
929 |
}
|
|
930 |
#ifdef PRINT_MESSAGE
|
|
931 |
else
|
|
932 |
{
|
|
933 |
RDebug::Print(_L(" CVibraObserverAO::RunL:Property.Get Error[%d]"), status);
|
|
934 |
}
|
|
935 |
#endif // PRINT_MESSAGE
|
|
936 |
}
|
|
937 |
}
|
|
938 |
|
|
939 |
void CVibraObserverAO::DoCancel()
|
|
940 |
{
|
|
941 |
iVibraProperty.Cancel();
|
|
942 |
}
|
|
943 |
|
|
944 |
TInt CVibraObserverAO::RunError(TInt /*aError*/)
|
|
945 |
{
|
|
946 |
return KErrNone;
|
|
947 |
}
|
|
948 |
|
|
949 |
//////////////////////////////////////////////////////////////////////
|
|
950 |
// CRingingTypeObserverAO //
|
|
951 |
//////////////////////////////////////////////////////////////////////
|
|
952 |
CRingingTypeObserverAO::CRingingTypeObserverAO(
|
|
953 |
CGlobalAudioSettings &aGlobalAudioSettings,
|
|
954 |
MAudioSettingsObserver& aAudioSettingsObserver,
|
|
955 |
TGlobalAudioSettings& aGlobalAudioSettingsData)
|
|
956 |
:CActive(EPriorityStandard),
|
|
957 |
iGlobalAudioSettings(aGlobalAudioSettings),
|
|
958 |
iAudioSettingsObserver(aAudioSettingsObserver),
|
|
959 |
iGlobalAudioSettingsData(aGlobalAudioSettingsData)
|
|
960 |
{
|
|
961 |
CActiveScheduler::Add(this);
|
|
962 |
}
|
|
963 |
|
|
964 |
CRingingTypeObserverAO::~CRingingTypeObserverAO()
|
|
965 |
{
|
|
966 |
Cancel();
|
|
967 |
iRingingTypeProperty.Close();
|
|
968 |
}
|
|
969 |
|
|
970 |
CRingingTypeObserverAO* CRingingTypeObserverAO::NewL(
|
|
971 |
CGlobalAudioSettings &aGlobalAudioSettings,
|
|
972 |
MAudioSettingsObserver& aAudioSettingsObserver,
|
|
973 |
TGlobalAudioSettings& aGlobalAudioSettingsData)
|
|
974 |
{
|
|
975 |
CRingingTypeObserverAO* self = new (ELeave) CRingingTypeObserverAO(
|
|
976 |
aGlobalAudioSettings,
|
|
977 |
aAudioSettingsObserver,
|
|
978 |
aGlobalAudioSettingsData);
|
|
979 |
CleanupStack::PushL(self);
|
|
980 |
self->ConstructL();
|
|
981 |
CleanupStack::Pop();
|
|
982 |
return self;
|
|
983 |
}
|
|
984 |
|
|
985 |
void CRingingTypeObserverAO::ConstructL()
|
|
986 |
{
|
|
987 |
User::LeaveIfError(iRingingTypeProperty.Attach(KGASPSUidGlobalAudioSettings, KGASRingingType));
|
|
988 |
TInt value=KErrNone;
|
|
989 |
User::LeaveIfError(iRingingTypeProperty.Get(value));
|
|
990 |
iGlobalAudioSettingsData.iRingingType=(CGlobalAudioSettings::TGASRingingType)value;
|
|
991 |
|
|
992 |
}
|
|
993 |
|
|
994 |
void CRingingTypeObserverAO::Subscribe()
|
|
995 |
{
|
|
996 |
if (!IsActive())
|
|
997 |
{
|
|
998 |
SetActive();
|
|
999 |
|
|
1000 |
iRingingTypeProperty.Subscribe(iStatus);
|
|
1001 |
}
|
|
1002 |
}
|
|
1003 |
|
|
1004 |
void CRingingTypeObserverAO::RunL()
|
|
1005 |
{
|
|
1006 |
TInt status(iStatus.Int());
|
|
1007 |
#ifdef PRINT_MESSAGE
|
|
1008 |
RDebug::Print(_L(" CRingingTypeObserverAO::RunL:iStatus[%d]"), status);
|
|
1009 |
#endif // PRINT_MESSAGE
|
|
1010 |
if ( status == KErrNone )
|
|
1011 |
{
|
|
1012 |
Subscribe();
|
|
1013 |
TInt value=KErrNone;
|
|
1014 |
status=(iRingingTypeProperty.Get(value));
|
|
1015 |
iGlobalAudioSettingsData.iRingingType=(CGlobalAudioSettings::TGASRingingType)value;
|
|
1016 |
if( status == KErrNone)
|
|
1017 |
{
|
|
1018 |
MAudioSettingsObserver::TGASEventId id=MAudioSettingsObserver::EGASRingingType;
|
|
1019 |
iAudioSettingsObserver.SettingsChanged(iGlobalAudioSettings, id);
|
|
1020 |
}
|
|
1021 |
#ifdef PRINT_MESSAGE
|
|
1022 |
else
|
|
1023 |
{
|
|
1024 |
RDebug::Print(_L(" CRingingTypeObserverAO::RunL:Property.Get Error[%d]"), status);
|
|
1025 |
}
|
|
1026 |
#endif // PRINT_MESSAGE
|
|
1027 |
}
|
|
1028 |
}
|
|
1029 |
|
|
1030 |
void CRingingTypeObserverAO::DoCancel()
|
|
1031 |
{
|
|
1032 |
iRingingTypeProperty.Cancel();
|
|
1033 |
}
|
|
1034 |
|
|
1035 |
TInt CRingingTypeObserverAO::RunError(TInt /*aError*/)
|
|
1036 |
{
|
|
1037 |
return KErrNone;
|
|
1038 |
}
|
|
1039 |
|
|
1040 |
//////////////////////////////////////////////////////////////////////
|
|
1041 |
// CMessageToneObserverAO //
|
|
1042 |
//////////////////////////////////////////////////////////////////////
|
|
1043 |
CMessageToneObserverAO::CMessageToneObserverAO(
|
|
1044 |
CGlobalAudioSettings &aGlobalAudioSettings,
|
|
1045 |
MAudioSettingsObserver& aAudioSettingsObserver,
|
|
1046 |
TGlobalAudioSettings& aGlobalAudioSettingsData)
|
|
1047 |
:CActive(EPriorityStandard),
|
|
1048 |
iGlobalAudioSettings(aGlobalAudioSettings),
|
|
1049 |
iAudioSettingsObserver(aAudioSettingsObserver),
|
|
1050 |
iGlobalAudioSettingsData(aGlobalAudioSettingsData)
|
|
1051 |
{
|
|
1052 |
CActiveScheduler::Add(this);
|
|
1053 |
}
|
|
1054 |
|
|
1055 |
CMessageToneObserverAO::~CMessageToneObserverAO()
|
|
1056 |
{
|
|
1057 |
Cancel();
|
|
1058 |
iMessageToneNameProperty.Close();
|
|
1059 |
if( iGlobalAudioSettingsData.iMessageToneName)
|
|
1060 |
{
|
|
1061 |
delete iGlobalAudioSettingsData.iMessageToneName;
|
|
1062 |
iGlobalAudioSettingsData.iMessageToneName=NULL;
|
|
1063 |
}
|
|
1064 |
}
|
|
1065 |
|
|
1066 |
CMessageToneObserverAO* CMessageToneObserverAO::NewL(
|
|
1067 |
CGlobalAudioSettings &aGlobalAudioSettings,
|
|
1068 |
MAudioSettingsObserver& aAudioSettingsObserver,
|
|
1069 |
TGlobalAudioSettings& aGlobalAudioSettingsData)
|
|
1070 |
{
|
|
1071 |
CMessageToneObserverAO* self = new (ELeave) CMessageToneObserverAO(
|
|
1072 |
aGlobalAudioSettings,
|
|
1073 |
aAudioSettingsObserver,
|
|
1074 |
aGlobalAudioSettingsData);
|
|
1075 |
CleanupStack::PushL(self);
|
|
1076 |
self->ConstructL();
|
|
1077 |
CleanupStack::Pop();
|
|
1078 |
return self;
|
|
1079 |
}
|
|
1080 |
|
|
1081 |
void CMessageToneObserverAO::ConstructL()
|
|
1082 |
{
|
|
1083 |
iGlobalAudioSettingsData.iMessageToneName=HBufC::NewL(KMaxLength);
|
|
1084 |
User::LeaveIfError(iMessageToneNameProperty.Attach(KGASPSUidGlobalAudioSettings, KGASMessageToneName));
|
|
1085 |
TPtr16 ptr=iGlobalAudioSettingsData.iMessageToneName->Des();
|
|
1086 |
User::LeaveIfError(iMessageToneNameProperty.Get(ptr));
|
|
1087 |
|
|
1088 |
}
|
|
1089 |
|
|
1090 |
void CMessageToneObserverAO::Subscribe()
|
|
1091 |
{
|
|
1092 |
if (!IsActive())
|
|
1093 |
{
|
|
1094 |
SetActive();
|
|
1095 |
|
|
1096 |
iMessageToneNameProperty.Subscribe(iStatus);
|
|
1097 |
}
|
|
1098 |
}
|
|
1099 |
|
|
1100 |
void CMessageToneObserverAO::RunL()
|
|
1101 |
{
|
|
1102 |
TInt status(iStatus.Int());
|
|
1103 |
#ifdef PRINT_MESSAGE
|
|
1104 |
RDebug::Print(_L(" CMessageToneObserverAO::RunL:iStatus[%d]"), status);
|
|
1105 |
#endif // PRINT_MESSAGE
|
|
1106 |
if ( status == KErrNone )
|
|
1107 |
{
|
|
1108 |
Subscribe();
|
|
1109 |
delete iGlobalAudioSettingsData.iMessageToneName;
|
|
1110 |
iGlobalAudioSettingsData.iMessageToneName=NULL;
|
|
1111 |
iGlobalAudioSettingsData.iMessageToneName=HBufC::NewL(KMaxLength);
|
|
1112 |
TPtr16 ptr=iGlobalAudioSettingsData.iMessageToneName->Des();
|
|
1113 |
status = iMessageToneNameProperty.Get(ptr);
|
|
1114 |
if( status == KErrNone)
|
|
1115 |
{
|
|
1116 |
MAudioSettingsObserver::TGASEventId id=MAudioSettingsObserver::EGASMessageToneName;
|
|
1117 |
iAudioSettingsObserver.SettingsChanged(iGlobalAudioSettings, id);
|
|
1118 |
}
|
|
1119 |
#ifdef PRINT_MESSAGE
|
|
1120 |
else
|
|
1121 |
{
|
|
1122 |
RDebug::Print(_L(" CMessageToneObserverAO::RunL:Property.Get Error[%d]"), status);
|
|
1123 |
}
|
|
1124 |
#endif // PRINT_MESSAGE
|
|
1125 |
}
|
|
1126 |
}
|
|
1127 |
|
|
1128 |
void CMessageToneObserverAO::DoCancel()
|
|
1129 |
{
|
|
1130 |
iMessageToneNameProperty.Cancel();
|
|
1131 |
}
|
|
1132 |
|
|
1133 |
TInt CMessageToneObserverAO::RunError(TInt /*aError*/)
|
|
1134 |
{
|
|
1135 |
return KErrNone;
|
|
1136 |
}
|
|
1137 |
|
|
1138 |
|
|
1139 |
/////////////////////////////////////////////////////////////////////
|
|
1140 |
// CEmailToneObserverAO //
|
|
1141 |
//////////////////////////////////////////////////////////////////////
|
|
1142 |
CEmailToneObserverAO::CEmailToneObserverAO(
|
|
1143 |
CGlobalAudioSettings &aGlobalAudioSettings,
|
|
1144 |
MAudioSettingsObserver& aAudioSettingsObserver,
|
|
1145 |
TGlobalAudioSettings& aGlobalAudioSettingsData)
|
|
1146 |
:CActive(EPriorityStandard),
|
|
1147 |
iGlobalAudioSettings(aGlobalAudioSettings),
|
|
1148 |
iAudioSettingsObserver(aAudioSettingsObserver),
|
|
1149 |
iGlobalAudioSettingsData(aGlobalAudioSettingsData)
|
|
1150 |
{
|
|
1151 |
CActiveScheduler::Add(this);
|
|
1152 |
}
|
|
1153 |
|
|
1154 |
CEmailToneObserverAO::~CEmailToneObserverAO()
|
|
1155 |
{
|
|
1156 |
Cancel();
|
|
1157 |
iEmailToneNameProperty.Close();
|
|
1158 |
|
|
1159 |
if(iGlobalAudioSettingsData.iEmailToneName)
|
|
1160 |
{
|
|
1161 |
delete iGlobalAudioSettingsData.iEmailToneName;
|
|
1162 |
iGlobalAudioSettingsData.iEmailToneName=NULL;
|
|
1163 |
}
|
|
1164 |
|
|
1165 |
}
|
|
1166 |
|
|
1167 |
CEmailToneObserverAO* CEmailToneObserverAO::NewL(
|
|
1168 |
CGlobalAudioSettings &aGlobalAudioSettings,
|
|
1169 |
MAudioSettingsObserver& aAudioSettingsObserver,
|
|
1170 |
TGlobalAudioSettings& aGlobalAudioSettingsData)
|
|
1171 |
{
|
|
1172 |
CEmailToneObserverAO* self = new (ELeave) CEmailToneObserverAO(
|
|
1173 |
aGlobalAudioSettings,
|
|
1174 |
aAudioSettingsObserver,
|
|
1175 |
aGlobalAudioSettingsData);
|
|
1176 |
CleanupStack::PushL(self);
|
|
1177 |
self->ConstructL();
|
|
1178 |
CleanupStack::Pop();
|
|
1179 |
return self;
|
|
1180 |
}
|
|
1181 |
|
|
1182 |
void CEmailToneObserverAO::ConstructL()
|
|
1183 |
{
|
|
1184 |
|
|
1185 |
iGlobalAudioSettingsData.iEmailToneName=HBufC::NewL(KMaxLength);
|
|
1186 |
User::LeaveIfError(iEmailToneNameProperty.Attach(KGASPSUidGlobalAudioSettings, KGASEmailToneName));
|
|
1187 |
TPtr16 ptr=iGlobalAudioSettingsData.iEmailToneName->Des();
|
|
1188 |
User::LeaveIfError(iEmailToneNameProperty.Get(ptr));
|
|
1189 |
|
|
1190 |
}
|
|
1191 |
|
|
1192 |
void CEmailToneObserverAO::Subscribe()
|
|
1193 |
{
|
|
1194 |
if (!IsActive())
|
|
1195 |
{
|
|
1196 |
SetActive();
|
|
1197 |
|
|
1198 |
iEmailToneNameProperty.Subscribe(iStatus);
|
|
1199 |
}
|
|
1200 |
}
|
|
1201 |
|
|
1202 |
void CEmailToneObserverAO::RunL()
|
|
1203 |
{
|
|
1204 |
TInt status(iStatus.Int());
|
|
1205 |
#ifdef PRINT_MESSAGE
|
|
1206 |
RDebug::Print(_L(" CEmailToneObserverAO::RunL:iStatus[%d]"), status);
|
|
1207 |
#endif // PRINT_MESSAGE
|
|
1208 |
if ( status == KErrNone )
|
|
1209 |
{
|
|
1210 |
Subscribe();
|
|
1211 |
delete iGlobalAudioSettingsData.iEmailToneName;
|
|
1212 |
iGlobalAudioSettingsData.iEmailToneName=NULL;
|
|
1213 |
iGlobalAudioSettingsData.iEmailToneName=HBufC::NewL(KMaxLength);
|
|
1214 |
TPtr16 ptr=iGlobalAudioSettingsData.iEmailToneName->Des();
|
|
1215 |
status = iEmailToneNameProperty.Get(ptr);
|
|
1216 |
if( status == KErrNone)
|
|
1217 |
{
|
|
1218 |
MAudioSettingsObserver::TGASEventId id=MAudioSettingsObserver::EGASEmailToneName;
|
|
1219 |
iAudioSettingsObserver.SettingsChanged(iGlobalAudioSettings, id);
|
|
1220 |
}
|
|
1221 |
#ifdef PRINT_MESSAGE
|
|
1222 |
else
|
|
1223 |
{
|
|
1224 |
RDebug::Print(_L(" CEmailToneObserverAO::RunL:Property.Get Error[%d]"), status);
|
|
1225 |
}
|
|
1226 |
#endif // PRINT_MESSAGE
|
|
1227 |
}
|
|
1228 |
}
|
|
1229 |
|
|
1230 |
void CEmailToneObserverAO::DoCancel()
|
|
1231 |
{
|
|
1232 |
iEmailToneNameProperty.Cancel();
|
|
1233 |
}
|
|
1234 |
|
|
1235 |
TInt CEmailToneObserverAO::RunError(TInt /*aError*/)
|
|
1236 |
{
|
|
1237 |
return KErrNone;
|
|
1238 |
}
|
|
1239 |
|
|
1240 |
|
|
1241 |
/////////////////////////////////////////////////////////////////////
|
|
1242 |
// CVideoCallToneObserverAO //
|
|
1243 |
//////////////////////////////////////////////////////////////////////
|
|
1244 |
CVideoCallToneObserverAO::CVideoCallToneObserverAO(
|
|
1245 |
CGlobalAudioSettings &aGlobalAudioSettings,
|
|
1246 |
MAudioSettingsObserver& aAudioSettingsObserver,
|
|
1247 |
TGlobalAudioSettings& aGlobalAudioSettingsData)
|
|
1248 |
:CActive(EPriorityStandard),
|
|
1249 |
iGlobalAudioSettings(aGlobalAudioSettings),
|
|
1250 |
iAudioSettingsObserver(aAudioSettingsObserver),
|
|
1251 |
iGlobalAudioSettingsData(aGlobalAudioSettingsData)
|
|
1252 |
{
|
|
1253 |
CActiveScheduler::Add(this);
|
|
1254 |
}
|
|
1255 |
|
|
1256 |
CVideoCallToneObserverAO::~CVideoCallToneObserverAO()
|
|
1257 |
{
|
|
1258 |
Cancel();
|
|
1259 |
iVideoCallToneNameProperty.Close();
|
|
1260 |
if( iGlobalAudioSettingsData.iVideoCallToneName)
|
|
1261 |
{
|
|
1262 |
delete iGlobalAudioSettingsData.iVideoCallToneName;
|
|
1263 |
iGlobalAudioSettingsData.iVideoCallToneName=NULL;
|
|
1264 |
}
|
|
1265 |
|
|
1266 |
|
|
1267 |
}
|
|
1268 |
|
|
1269 |
CVideoCallToneObserverAO* CVideoCallToneObserverAO::NewL(
|
|
1270 |
CGlobalAudioSettings &aGlobalAudioSettings,
|
|
1271 |
MAudioSettingsObserver& aAudioSettingsObserver,
|
|
1272 |
TGlobalAudioSettings& aGlobalAudioSettingsData)
|
|
1273 |
{
|
|
1274 |
CVideoCallToneObserverAO* self = new (ELeave) CVideoCallToneObserverAO(
|
|
1275 |
aGlobalAudioSettings,
|
|
1276 |
aAudioSettingsObserver,
|
|
1277 |
aGlobalAudioSettingsData);
|
|
1278 |
CleanupStack::PushL(self);
|
|
1279 |
self->ConstructL();
|
|
1280 |
CleanupStack::Pop();
|
|
1281 |
return self;
|
|
1282 |
}
|
|
1283 |
|
|
1284 |
void CVideoCallToneObserverAO::ConstructL()
|
|
1285 |
{
|
|
1286 |
|
|
1287 |
iGlobalAudioSettingsData.iVideoCallToneName=HBufC::NewL(KMaxLength);
|
|
1288 |
User::LeaveIfError(iVideoCallToneNameProperty.Attach(KGASPSUidGlobalAudioSettings, KGASVideoCallToneName));
|
|
1289 |
TPtr16 ptr=iGlobalAudioSettingsData.iVideoCallToneName->Des();
|
|
1290 |
User::LeaveIfError(iVideoCallToneNameProperty.Get(ptr));
|
|
1291 |
|
|
1292 |
}
|
|
1293 |
|
|
1294 |
void CVideoCallToneObserverAO::Subscribe()
|
|
1295 |
{
|
|
1296 |
if (!IsActive())
|
|
1297 |
{
|
|
1298 |
SetActive();
|
|
1299 |
|
|
1300 |
iVideoCallToneNameProperty.Subscribe(iStatus);
|
|
1301 |
}
|
|
1302 |
}
|
|
1303 |
|
|
1304 |
void CVideoCallToneObserverAO::RunL()
|
|
1305 |
{
|
|
1306 |
TInt status(iStatus.Int());
|
|
1307 |
#ifdef PRINT_MESSAGE
|
|
1308 |
RDebug::Print(_L(" CVideocallToneObserverAO::RunL:iStatus[%d]"), status);
|
|
1309 |
#endif // PRINT_MESSAGE
|
|
1310 |
if ( status == KErrNone )
|
|
1311 |
{
|
|
1312 |
Subscribe();
|
|
1313 |
delete iGlobalAudioSettingsData.iVideoCallToneName;
|
|
1314 |
iGlobalAudioSettingsData.iVideoCallToneName=NULL;
|
|
1315 |
iGlobalAudioSettingsData.iVideoCallToneName=HBufC::NewL(KMaxLength);
|
|
1316 |
TPtr16 ptr=iGlobalAudioSettingsData.iVideoCallToneName->Des();
|
|
1317 |
status = iVideoCallToneNameProperty.Get(ptr);
|
|
1318 |
if( status == KErrNone)
|
|
1319 |
{
|
|
1320 |
MAudioSettingsObserver::TGASEventId id=MAudioSettingsObserver::EGASVideoCallToneName;
|
|
1321 |
iAudioSettingsObserver.SettingsChanged(iGlobalAudioSettings, id);
|
|
1322 |
}
|
|
1323 |
#ifdef PRINT_MESSAGE
|
|
1324 |
else
|
|
1325 |
{
|
|
1326 |
RDebug::Print(_L(" CVideoCallToneObserverAO::RunL:Property.Get Error[%d]"), status);
|
|
1327 |
}
|
|
1328 |
#endif // PRINT_MESSAGE
|
|
1329 |
}
|
|
1330 |
}
|
|
1331 |
|
|
1332 |
void CVideoCallToneObserverAO::DoCancel()
|
|
1333 |
{
|
|
1334 |
iVideoCallToneNameProperty.Cancel();
|
|
1335 |
}
|
|
1336 |
|
|
1337 |
TInt CVideoCallToneObserverAO::RunError(TInt /*aError*/)
|
|
1338 |
{
|
|
1339 |
return KErrNone;
|
|
1340 |
}
|
|
1341 |
|
|
1342 |
/////////////////////////////////////////////////////////////////////
|
|
1343 |
// CRingingToneObserverAO //
|
|
1344 |
//////////////////////////////////////////////////////////////////////
|
|
1345 |
CRingingTone1ObserverAO::CRingingTone1ObserverAO(
|
|
1346 |
CGlobalAudioSettings &aGlobalAudioSettings,
|
|
1347 |
MAudioSettingsObserver& aAudioSettingsObserver,
|
|
1348 |
TGlobalAudioSettings& aGlobalAudioSettingsData)
|
|
1349 |
:CActive(EPriorityStandard),
|
|
1350 |
iGlobalAudioSettings(aGlobalAudioSettings),
|
|
1351 |
iAudioSettingsObserver(aAudioSettingsObserver),
|
|
1352 |
iGlobalAudioSettingsData(aGlobalAudioSettingsData)
|
|
1353 |
{
|
|
1354 |
CActiveScheduler::Add(this);
|
|
1355 |
}
|
|
1356 |
|
|
1357 |
CRingingTone1ObserverAO::~CRingingTone1ObserverAO()
|
|
1358 |
{
|
|
1359 |
Cancel();
|
|
1360 |
iRingingTone1NameProperty.Close();
|
|
1361 |
if( iGlobalAudioSettingsData.iRingingTone1Name)
|
|
1362 |
{
|
|
1363 |
delete iGlobalAudioSettingsData.iRingingTone1Name;
|
|
1364 |
iGlobalAudioSettingsData.iRingingTone1Name=NULL;
|
|
1365 |
}
|
|
1366 |
}
|
|
1367 |
|
|
1368 |
CRingingTone1ObserverAO* CRingingTone1ObserverAO::NewL(
|
|
1369 |
CGlobalAudioSettings &aGlobalAudioSettings,
|
|
1370 |
MAudioSettingsObserver& aAudioSettingsObserver,
|
|
1371 |
TGlobalAudioSettings& aGlobalAudioSettingsData)
|
|
1372 |
{
|
|
1373 |
CRingingTone1ObserverAO* self = new (ELeave) CRingingTone1ObserverAO(
|
|
1374 |
aGlobalAudioSettings,
|
|
1375 |
aAudioSettingsObserver,
|
|
1376 |
aGlobalAudioSettingsData);
|
|
1377 |
CleanupStack::PushL(self);
|
|
1378 |
self->ConstructL();
|
|
1379 |
CleanupStack::Pop();
|
|
1380 |
return self;
|
|
1381 |
}
|
|
1382 |
|
|
1383 |
void CRingingTone1ObserverAO::ConstructL()
|
|
1384 |
{
|
|
1385 |
|
|
1386 |
iGlobalAudioSettingsData.iRingingTone1Name=HBufC::NewL(KMaxLength);
|
|
1387 |
User::LeaveIfError(iRingingTone1NameProperty.Attach(KGASPSUidGlobalAudioSettings, KGASRingingTone1Name));
|
|
1388 |
TPtr16 ptr=iGlobalAudioSettingsData.iRingingTone1Name->Des();
|
|
1389 |
User::LeaveIfError(iRingingTone1NameProperty.Get(ptr));
|
|
1390 |
|
|
1391 |
}
|
|
1392 |
|
|
1393 |
void CRingingTone1ObserverAO::Subscribe()
|
|
1394 |
{
|
|
1395 |
if (!IsActive())
|
|
1396 |
{
|
|
1397 |
SetActive();
|
|
1398 |
|
|
1399 |
iRingingTone1NameProperty.Subscribe(iStatus);
|
|
1400 |
}
|
|
1401 |
}
|
|
1402 |
|
|
1403 |
void CRingingTone1ObserverAO::RunL()
|
|
1404 |
{
|
|
1405 |
TInt status(iStatus.Int());
|
|
1406 |
#ifdef PRINT_MESSAGE
|
|
1407 |
RDebug::Print(_L(" CRingingTone1ObserverAO::RunL:iStatus[%d]"), status);
|
|
1408 |
#endif // PRINT_MESSAGE
|
|
1409 |
if ( status == KErrNone )
|
|
1410 |
{
|
|
1411 |
Subscribe();
|
|
1412 |
delete iGlobalAudioSettingsData.iRingingTone1Name;
|
|
1413 |
iGlobalAudioSettingsData.iRingingTone1Name=NULL;
|
|
1414 |
iGlobalAudioSettingsData.iRingingTone1Name=HBufC::NewL(KMaxLength);
|
|
1415 |
TPtr16 ptr=iGlobalAudioSettingsData.iRingingTone1Name->Des();
|
|
1416 |
status = iRingingTone1NameProperty.Get(ptr);
|
|
1417 |
if( status == KErrNone)
|
|
1418 |
{
|
|
1419 |
MAudioSettingsObserver::TGASEventId id=MAudioSettingsObserver::EGASRingingTone1Name;
|
|
1420 |
iAudioSettingsObserver.SettingsChanged(iGlobalAudioSettings, id);
|
|
1421 |
}
|
|
1422 |
#ifdef PRINT_MESSAGE
|
|
1423 |
else
|
|
1424 |
{
|
|
1425 |
RDebug::Print(_L(" CRingingToneObserverAO::RunL:Property.Get Error[%d]"), status);
|
|
1426 |
}
|
|
1427 |
#endif // PRINT_MESSAGE
|
|
1428 |
}
|
|
1429 |
}
|
|
1430 |
|
|
1431 |
void CRingingTone1ObserverAO::DoCancel()
|
|
1432 |
{
|
|
1433 |
iRingingTone1NameProperty.Cancel();
|
|
1434 |
}
|
|
1435 |
|
|
1436 |
TInt CRingingTone1ObserverAO::RunError(TInt /*aError*/)
|
|
1437 |
{
|
|
1438 |
return KErrNone;
|
|
1439 |
}
|
|
1440 |
|
|
1441 |
////////////////////////////////////////////////////////////////////
|
|
1442 |
// CRingingToneObserverAO //
|
|
1443 |
//////////////////////////////////////////////////////////////////////
|
|
1444 |
CRingingTone2ObserverAO::CRingingTone2ObserverAO(
|
|
1445 |
CGlobalAudioSettings &aGlobalAudioSettings,
|
|
1446 |
MAudioSettingsObserver& aAudioSettingsObserver,
|
|
1447 |
TGlobalAudioSettings& aGlobalAudioSettingsData)
|
|
1448 |
:CActive(EPriorityStandard),
|
|
1449 |
iGlobalAudioSettings(aGlobalAudioSettings),
|
|
1450 |
iAudioSettingsObserver(aAudioSettingsObserver),
|
|
1451 |
iGlobalAudioSettingsData(aGlobalAudioSettingsData)
|
|
1452 |
{
|
|
1453 |
CActiveScheduler::Add(this);
|
|
1454 |
}
|
|
1455 |
|
|
1456 |
CRingingTone2ObserverAO::~CRingingTone2ObserverAO()
|
|
1457 |
{
|
|
1458 |
Cancel();
|
|
1459 |
iRingingTone2NameProperty.Close();
|
|
1460 |
if(iGlobalAudioSettingsData.iRingingTone2Name)
|
|
1461 |
{
|
|
1462 |
delete iGlobalAudioSettingsData.iRingingTone2Name;
|
|
1463 |
iGlobalAudioSettingsData.iRingingTone2Name=NULL;
|
|
1464 |
}
|
|
1465 |
|
|
1466 |
|
|
1467 |
}
|
|
1468 |
|
|
1469 |
CRingingTone2ObserverAO* CRingingTone2ObserverAO::NewL(
|
|
1470 |
CGlobalAudioSettings &aGlobalAudioSettings,
|
|
1471 |
MAudioSettingsObserver& aAudioSettingsObserver,
|
|
1472 |
TGlobalAudioSettings& aGlobalAudioSettingsData)
|
|
1473 |
{
|
|
1474 |
CRingingTone2ObserverAO* self = new (ELeave) CRingingTone2ObserverAO(
|
|
1475 |
aGlobalAudioSettings,
|
|
1476 |
aAudioSettingsObserver,
|
|
1477 |
aGlobalAudioSettingsData);
|
|
1478 |
CleanupStack::PushL(self);
|
|
1479 |
self->ConstructL();
|
|
1480 |
CleanupStack::Pop();
|
|
1481 |
return self;
|
|
1482 |
}
|
|
1483 |
|
|
1484 |
void CRingingTone2ObserverAO::ConstructL()
|
|
1485 |
{
|
|
1486 |
|
|
1487 |
iGlobalAudioSettingsData.iRingingTone2Name=HBufC::NewL(KMaxLength);
|
|
1488 |
User::LeaveIfError(iRingingTone2NameProperty.Attach(KGASPSUidGlobalAudioSettings, KGASRingingTone2Name));
|
|
1489 |
TPtr16 ptr=iGlobalAudioSettingsData.iRingingTone2Name->Des();
|
|
1490 |
User::LeaveIfError(iRingingTone2NameProperty.Get(ptr));
|
|
1491 |
|
|
1492 |
}
|
|
1493 |
|
|
1494 |
void CRingingTone2ObserverAO::Subscribe()
|
|
1495 |
{
|
|
1496 |
if (!IsActive())
|
|
1497 |
{
|
|
1498 |
SetActive();
|
|
1499 |
|
|
1500 |
iRingingTone2NameProperty.Subscribe(iStatus);
|
|
1501 |
}
|
|
1502 |
}
|
|
1503 |
|
|
1504 |
void CRingingTone2ObserverAO::RunL()
|
|
1505 |
{
|
|
1506 |
TInt status(iStatus.Int());
|
|
1507 |
#ifdef PRINT_MESSAGE
|
|
1508 |
RDebug::Print(_L(" CRingingTone2ObserverAO::RunL:iStatus[%d]"), status);
|
|
1509 |
#endif // PRINT_MESSAGE
|
|
1510 |
if ( status == KErrNone )
|
|
1511 |
{
|
|
1512 |
Subscribe();
|
|
1513 |
delete iGlobalAudioSettingsData.iRingingTone2Name;
|
|
1514 |
iGlobalAudioSettingsData.iRingingTone2Name=NULL;
|
|
1515 |
iGlobalAudioSettingsData.iRingingTone2Name=HBufC::NewL(KMaxLength);
|
|
1516 |
TPtr16 ptr=iGlobalAudioSettingsData.iRingingTone2Name->Des();
|
|
1517 |
status = iRingingTone2NameProperty.Get(ptr);
|
|
1518 |
if( status == KErrNone)
|
|
1519 |
{
|
|
1520 |
MAudioSettingsObserver::TGASEventId id=MAudioSettingsObserver::EGASRingingTone2Name;
|
|
1521 |
iAudioSettingsObserver.SettingsChanged(iGlobalAudioSettings, id);
|
|
1522 |
}
|
|
1523 |
#ifdef PRINT_MESSAGE
|
|
1524 |
else
|
|
1525 |
{
|
|
1526 |
RDebug::Print(_L(" CRingingToneObserverAO::RunL:Property.Get Error[%d]"), status);
|
|
1527 |
}
|
|
1528 |
#endif // PRINT_MESSAGE
|
|
1529 |
}
|
|
1530 |
}
|
|
1531 |
|
|
1532 |
void CRingingTone2ObserverAO::DoCancel()
|
|
1533 |
{
|
|
1534 |
iRingingTone2NameProperty.Cancel();
|
|
1535 |
}
|
|
1536 |
|
|
1537 |
TInt CRingingTone2ObserverAO::RunError(TInt /*aError*/)
|
|
1538 |
{
|
|
1539 |
return KErrNone;
|
|
1540 |
}
|
|
1541 |
|
|
1542 |
/////////////////////////////////////////////////////////////////////
|
|
1543 |
// CKeypadToneObserverAO //
|
|
1544 |
//////////////////////////////////////////////////////////////////////
|
|
1545 |
CKeypadToneObserverAO::CKeypadToneObserverAO(
|
|
1546 |
CGlobalAudioSettings &aGlobalAudioSettings,
|
|
1547 |
MAudioSettingsObserver& aAudioSettingsObserver,
|
|
1548 |
TGlobalAudioSettings& aGlobalAudioSettingsData)
|
|
1549 |
:CActive(EPriorityStandard),
|
|
1550 |
iGlobalAudioSettings(aGlobalAudioSettings),
|
|
1551 |
iAudioSettingsObserver(aAudioSettingsObserver),
|
|
1552 |
iGlobalAudioSettingsData(aGlobalAudioSettingsData)
|
|
1553 |
{
|
|
1554 |
CActiveScheduler::Add(this);
|
|
1555 |
}
|
|
1556 |
|
|
1557 |
CKeypadToneObserverAO::~CKeypadToneObserverAO()
|
|
1558 |
{
|
|
1559 |
Cancel();
|
|
1560 |
iKeypadToneVolumeProperty.Close();
|
|
1561 |
}
|
|
1562 |
|
|
1563 |
CKeypadToneObserverAO* CKeypadToneObserverAO::NewL(
|
|
1564 |
CGlobalAudioSettings &aGlobalAudioSettings,
|
|
1565 |
MAudioSettingsObserver& aAudioSettingsObserver,
|
|
1566 |
TGlobalAudioSettings& aGlobalAudioSettingsData)
|
|
1567 |
{
|
|
1568 |
CKeypadToneObserverAO* self = new (ELeave) CKeypadToneObserverAO(
|
|
1569 |
aGlobalAudioSettings,
|
|
1570 |
aAudioSettingsObserver,
|
|
1571 |
aGlobalAudioSettingsData);
|
|
1572 |
CleanupStack::PushL(self);
|
|
1573 |
self->ConstructL();
|
|
1574 |
CleanupStack::Pop();
|
|
1575 |
return self;
|
|
1576 |
}
|
|
1577 |
|
|
1578 |
void CKeypadToneObserverAO::ConstructL()
|
|
1579 |
{
|
|
1580 |
|
|
1581 |
|
|
1582 |
User::LeaveIfError(iKeypadToneVolumeProperty.Attach(KGASPSUidGlobalAudioSettings, KGASKeypadToneVolume));
|
|
1583 |
TInt value=KErrNone;
|
|
1584 |
User::LeaveIfError(iKeypadToneVolumeProperty.Get(value));
|
|
1585 |
iGlobalAudioSettingsData.iKeyPadVolume=(CGlobalAudioSettings::TGASKeypadVolume)value;
|
|
1586 |
}
|
|
1587 |
|
|
1588 |
void CKeypadToneObserverAO::Subscribe()
|
|
1589 |
{
|
|
1590 |
if (!IsActive())
|
|
1591 |
{
|
|
1592 |
SetActive();
|
|
1593 |
|
|
1594 |
iKeypadToneVolumeProperty.Subscribe(iStatus);
|
|
1595 |
}
|
|
1596 |
}
|
|
1597 |
|
|
1598 |
void CKeypadToneObserverAO::RunL()
|
|
1599 |
{
|
|
1600 |
TInt status(iStatus.Int());
|
|
1601 |
#ifdef PRINT_MESSAGE
|
|
1602 |
RDebug::Print(_L(" CKeypadToneObserverAO::RunL:iStatus[%d]"), status);
|
|
1603 |
#endif // PRINT_MESSAGE
|
|
1604 |
if ( status == KErrNone )
|
|
1605 |
{
|
|
1606 |
Subscribe();
|
|
1607 |
TInt value=KErrNone;
|
|
1608 |
status=iKeypadToneVolumeProperty.Get(value);
|
|
1609 |
iGlobalAudioSettingsData.iKeyPadVolume=(CGlobalAudioSettings::TGASKeypadVolume)value;
|
|
1610 |
|
|
1611 |
|
|
1612 |
if( status == KErrNone)
|
|
1613 |
{
|
|
1614 |
MAudioSettingsObserver::TGASEventId id=MAudioSettingsObserver::EGASKeyPadVolume;
|
|
1615 |
iAudioSettingsObserver.SettingsChanged(iGlobalAudioSettings, id);
|
|
1616 |
}
|
|
1617 |
#ifdef PRINT_MESSAGE
|
|
1618 |
else
|
|
1619 |
{
|
|
1620 |
RDebug::Print(_L(" CKeypadToneObserverAO::RunL:Property.Get Error[%d]"), status);
|
|
1621 |
}
|
|
1622 |
#endif // PRINT_MESSAGE
|
|
1623 |
}
|
|
1624 |
}
|
|
1625 |
|
|
1626 |
void CKeypadToneObserverAO::DoCancel()
|
|
1627 |
{
|
|
1628 |
iKeypadToneVolumeProperty.Cancel();
|
|
1629 |
}
|
|
1630 |
|
|
1631 |
TInt CKeypadToneObserverAO::RunError(TInt /*aError*/)
|
|
1632 |
{
|
|
1633 |
return KErrNone;
|
|
1634 |
}
|
|
1635 |
|
|
1636 |
|
|
1637 |
/////////////////////////////////////////////////////////////////////
|
|
1638 |
// CSilenceModeObserverAO //
|
|
1639 |
//////////////////////////////////////////////////////////////////////
|
|
1640 |
CSilenceModeObserverAO::CSilenceModeObserverAO(
|
|
1641 |
CGlobalAudioSettings &aGlobalAudioSettings,
|
|
1642 |
MAudioSettingsObserver& aAudioSettingsObserver,
|
|
1643 |
TGlobalAudioSettings& aGlobalAudioSettingsData)
|
|
1644 |
:CActive(EPriorityStandard),
|
|
1645 |
iGlobalAudioSettings(aGlobalAudioSettings),
|
|
1646 |
iAudioSettingsObserver(aAudioSettingsObserver),
|
|
1647 |
iGlobalAudioSettingsData(aGlobalAudioSettingsData)
|
|
1648 |
{
|
|
1649 |
CActiveScheduler::Add(this);
|
|
1650 |
}
|
|
1651 |
|
|
1652 |
CSilenceModeObserverAO::~CSilenceModeObserverAO()
|
|
1653 |
{
|
|
1654 |
Cancel();
|
|
1655 |
iSilenceModeProperty.Close();
|
|
1656 |
}
|
|
1657 |
|
|
1658 |
CSilenceModeObserverAO* CSilenceModeObserverAO::NewL(
|
|
1659 |
CGlobalAudioSettings &aGlobalAudioSettings,
|
|
1660 |
MAudioSettingsObserver& aAudioSettingsObserver,
|
|
1661 |
TGlobalAudioSettings& aGlobalAudioSettingsData)
|
|
1662 |
{
|
|
1663 |
CSilenceModeObserverAO* self = new (ELeave) CSilenceModeObserverAO(
|
|
1664 |
aGlobalAudioSettings,
|
|
1665 |
aAudioSettingsObserver,
|
|
1666 |
aGlobalAudioSettingsData);
|
|
1667 |
CleanupStack::PushL(self);
|
|
1668 |
self->ConstructL();
|
|
1669 |
CleanupStack::Pop();
|
|
1670 |
return self;
|
|
1671 |
}
|
|
1672 |
|
|
1673 |
void CSilenceModeObserverAO::ConstructL()
|
|
1674 |
{
|
|
1675 |
|
|
1676 |
|
|
1677 |
User::LeaveIfError(iSilenceModeProperty.Attach(KGASPSUidGlobalAudioSettings, KGASSilenceMode));
|
|
1678 |
|
|
1679 |
User::LeaveIfError(iSilenceModeProperty.Get(iGlobalAudioSettingsData.iSilenceMode));
|
|
1680 |
RDebug::Printf("in constructL,silence mode %d",iGlobalAudioSettingsData.iSilenceMode);
|
|
1681 |
|
|
1682 |
}
|
|
1683 |
|
|
1684 |
void CSilenceModeObserverAO::Subscribe()
|
|
1685 |
{
|
|
1686 |
if (!IsActive())
|
|
1687 |
{
|
|
1688 |
SetActive();
|
|
1689 |
|
|
1690 |
iSilenceModeProperty.Subscribe(iStatus);
|
|
1691 |
}
|
|
1692 |
}
|
|
1693 |
|
|
1694 |
void CSilenceModeObserverAO::RunL()
|
|
1695 |
{
|
|
1696 |
TInt status(iStatus.Int());
|
|
1697 |
#ifdef PRINT_MESSAGE
|
|
1698 |
RDebug::Print(_L(" CSilenceModeObserverAO::RunL:iStatus[%d]"), status);
|
|
1699 |
#endif // PRINT_MESSAGE
|
|
1700 |
if ( status == KErrNone )
|
|
1701 |
{
|
|
1702 |
Subscribe();
|
|
1703 |
|
|
1704 |
status=iSilenceModeProperty.Get( iGlobalAudioSettingsData.iSilenceMode);
|
|
1705 |
RDebug::Printf("value of silent mode :%d",iGlobalAudioSettingsData.iSilenceMode);
|
|
1706 |
|
|
1707 |
|
|
1708 |
if( status == KErrNone)
|
|
1709 |
{
|
|
1710 |
MAudioSettingsObserver::TGASEventId id=MAudioSettingsObserver::EGASSilenceMode;
|
|
1711 |
iAudioSettingsObserver.SettingsChanged(iGlobalAudioSettings, id);
|
|
1712 |
}
|
|
1713 |
#ifdef PRINT_MESSAGE
|
|
1714 |
else
|
|
1715 |
{
|
|
1716 |
RDebug::Print(_L(" CKeypadToneObserverAO::RunL:Property.Get Error[%d]"), status);
|
|
1717 |
}
|
|
1718 |
#endif // PRINT_MESSAGE
|
|
1719 |
}
|
|
1720 |
}
|
|
1721 |
|
|
1722 |
void CSilenceModeObserverAO::DoCancel()
|
|
1723 |
{
|
|
1724 |
iSilenceModeProperty.Cancel();
|
|
1725 |
}
|
|
1726 |
|
|
1727 |
TInt CSilenceModeObserverAO::RunError(TInt /*aError*/)
|
|
1728 |
{
|
|
1729 |
return KErrNone;
|
|
1730 |
}
|
|
1731 |
|
|
1732 |
//End of file
|