|
1 /* |
|
2 * Copyright (c) 2004 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: Audio Stubs - Implementation of the DistanceAttenuation effect Custom Interface class |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 #ifdef _DEBUG |
|
20 #include <e32svr.h> |
|
21 #endif |
|
22 #include "DistanceAttenuationCI.h" |
|
23 |
|
24 |
|
25 EXPORT_C CDistanceAttenuationCI* CDistanceAttenuationCI::NewL( |
|
26 CMMFDevSound& aDevSound ) |
|
27 { |
|
28 CDistanceAttenuationCI* self = new(ELeave) CDistanceAttenuationCI(aDevSound); |
|
29 return self; |
|
30 } |
|
31 |
|
32 CDistanceAttenuationCI::CDistanceAttenuationCI( |
|
33 CMMFDevSound& aDevSound ) |
|
34 : iDevSound(&aDevSound ) |
|
35 { |
|
36 iDistanceAttenuationData.iRMin = 0; |
|
37 iDistanceAttenuationData.iRMax = 100; |
|
38 iDistanceAttenuationData.iMuteAfterMax = EFalse; |
|
39 iDistanceAttenuationData.iRollOffFactor = 100; |
|
40 iDistanceAttenuationData.iRoomRollOffFactor = 100; |
|
41 iDistanceAttenuationData.iRollOffFactorMax = 1000; |
|
42 iDistanceAttenuationData.iRoomRollOffFactorMax = 1000; |
|
43 |
|
44 } |
|
45 |
|
46 EXPORT_C CDistanceAttenuationCI* CDistanceAttenuationCI::NewL() |
|
47 { |
|
48 CDistanceAttenuationCI* self = new(ELeave) CDistanceAttenuationCI(); |
|
49 return self; |
|
50 } |
|
51 |
|
52 CDistanceAttenuationCI::CDistanceAttenuationCI() |
|
53 { |
|
54 iDistanceAttenuationData.iRMin = 0; |
|
55 iDistanceAttenuationData.iRMax = 100; |
|
56 iDistanceAttenuationData.iMuteAfterMax = EFalse; |
|
57 iDistanceAttenuationData.iRollOffFactor = 100; |
|
58 iDistanceAttenuationData.iRoomRollOffFactor = 100; |
|
59 iDistanceAttenuationData.iRollOffFactorMax = 1000; |
|
60 iDistanceAttenuationData.iRoomRollOffFactorMax = 1000; |
|
61 |
|
62 } |
|
63 |
|
64 CDistanceAttenuationCI::~CDistanceAttenuationCI() |
|
65 { |
|
66 } |
|
67 |
|
68 void CDistanceAttenuationCI::ApplyL() |
|
69 { |
|
70 #ifdef _DEBUG |
|
71 RDebug::Print(_L("CDistanceAttenuationCI::ApplyL")); |
|
72 #endif |
|
73 |
|
74 if (iObservers.Count() > 0) |
|
75 { |
|
76 if(iDistanceAttenuationData.iEnabled) |
|
77 { |
|
78 iEnabled = iDistanceAttenuationData.iEnabled; |
|
79 iObservers[0]->EffectChanged(this, (TUint8)MAudioEffectObserver::KEnabled); |
|
80 } |
|
81 else |
|
82 { |
|
83 iEnabled = iDistanceAttenuationData.iEnabled; |
|
84 iObservers[0]->EffectChanged(this, (TUint8)MAudioEffectObserver::KDisabled); |
|
85 } |
|
86 |
|
87 } |
|
88 } |
|
89 |
|
90 |
|
91 // ========================== OTHER EXPORTED FUNCTIONS ========================= |
|
92 |
|
93 |
|
94 |
|
95 |
|
96 // End of File |