sl@0
|
1 |
/*
|
sl@0
|
2 |
* Copyright (c) 2004 Nokia Corporation and/or its subsidiary(-ies).
|
sl@0
|
3 |
* All rights reserved.
|
sl@0
|
4 |
* This component and the accompanying materials are made available
|
sl@0
|
5 |
* under the terms of "Eclipse Public License v1.0"
|
sl@0
|
6 |
* which accompanies this distribution, and is available
|
sl@0
|
7 |
* at the URL "http://www.eclipse.org/legal/epl-v10.html".
|
sl@0
|
8 |
*
|
sl@0
|
9 |
* Initial Contributors:
|
sl@0
|
10 |
* Nokia Corporation - initial contribution.
|
sl@0
|
11 |
*
|
sl@0
|
12 |
* Contributors:
|
sl@0
|
13 |
*
|
sl@0
|
14 |
* Description: Implementation of the audio EnvironmentalReverb proxy class
|
sl@0
|
15 |
*
|
sl@0
|
16 |
*/
|
sl@0
|
17 |
|
sl@0
|
18 |
|
sl@0
|
19 |
|
sl@0
|
20 |
|
sl@0
|
21 |
// INCLUDE FILES
|
sl@0
|
22 |
|
sl@0
|
23 |
#ifdef _DEBUG
|
sl@0
|
24 |
#include <e32svr.h>
|
sl@0
|
25 |
#endif
|
sl@0
|
26 |
|
sl@0
|
27 |
#include "TempEnvironmentalReverb.h"
|
sl@0
|
28 |
|
sl@0
|
29 |
// ============================ MEMBER FUNCTIONS ===============================
|
sl@0
|
30 |
|
sl@0
|
31 |
// -----------------------------------------------------------------------------
|
sl@0
|
32 |
// CTempEnvironmentalReverb::CTempEnvironmentalReverb
|
sl@0
|
33 |
// C++ default constructor can NOT contain any code, that
|
sl@0
|
34 |
// might leave.
|
sl@0
|
35 |
// -----------------------------------------------------------------------------
|
sl@0
|
36 |
//
|
sl@0
|
37 |
CTempEnvironmentalReverb::CTempEnvironmentalReverb()
|
sl@0
|
38 |
{
|
sl@0
|
39 |
}
|
sl@0
|
40 |
|
sl@0
|
41 |
// Destructor
|
sl@0
|
42 |
CTempEnvironmentalReverb::~CTempEnvironmentalReverb()
|
sl@0
|
43 |
{
|
sl@0
|
44 |
}
|
sl@0
|
45 |
|
sl@0
|
46 |
// -----------------------------------------------------------------------------
|
sl@0
|
47 |
// CTempEnvironmentalReverb::NewL
|
sl@0
|
48 |
// Static function for creating an instance of the Audio EnvironmentalReverb object.
|
sl@0
|
49 |
// -----------------------------------------------------------------------------
|
sl@0
|
50 |
//
|
sl@0
|
51 |
EXPORT_C CTempEnvironmentalReverb* CTempEnvironmentalReverb::NewL(CEnvironmentalReverb* aEnvironmentalReverb)
|
sl@0
|
52 |
{
|
sl@0
|
53 |
#ifdef _DEBUG
|
sl@0
|
54 |
RDebug::Print(_L("CTempEnvironmentalReverb::NewL"));
|
sl@0
|
55 |
#endif
|
sl@0
|
56 |
|
sl@0
|
57 |
CTempEnvironmentalReverb* self = new (ELeave) CTempEnvironmentalReverb();
|
sl@0
|
58 |
CleanupStack::PushL( self );
|
sl@0
|
59 |
self->ConstructL(aEnvironmentalReverb);
|
sl@0
|
60 |
CleanupStack::Pop(self);
|
sl@0
|
61 |
return self;
|
sl@0
|
62 |
}
|
sl@0
|
63 |
|
sl@0
|
64 |
// -----------------------------------------------------------------------------
|
sl@0
|
65 |
// CTempEnvironmentalReverb::ConstructL
|
sl@0
|
66 |
// -----------------------------------------------------------------------------
|
sl@0
|
67 |
//
|
sl@0
|
68 |
void CTempEnvironmentalReverb::ConstructL(CEnvironmentalReverb* aEnvironmentalReverb)
|
sl@0
|
69 |
{
|
sl@0
|
70 |
#ifdef _DEBUG
|
sl@0
|
71 |
RDebug::Print(_L("CTempEnvironmentalReverb::ConstructL"));
|
sl@0
|
72 |
#endif
|
sl@0
|
73 |
|
sl@0
|
74 |
iEnvironmentalReverb = aEnvironmentalReverb;
|
sl@0
|
75 |
}
|
sl@0
|
76 |
|
sl@0
|
77 |
|
sl@0
|
78 |
// -----------------------------------------------------------------------------
|
sl@0
|
79 |
// CTempEnvironmentalReverb::ApplyL
|
sl@0
|
80 |
// Apply the Audio EnvironmentalReverb settings.
|
sl@0
|
81 |
// -----------------------------------------------------------------------------
|
sl@0
|
82 |
//
|
sl@0
|
83 |
EXPORT_C void CTempEnvironmentalReverb::ApplyL()
|
sl@0
|
84 |
{
|
sl@0
|
85 |
#ifdef _DEBUG
|
sl@0
|
86 |
RDebug::Print(_L("CTempEnvironmentalReverb::Apply"));
|
sl@0
|
87 |
#endif
|
sl@0
|
88 |
if (DecayHFRatio() != iEnvironmentalReverb->DecayHFRatio())
|
sl@0
|
89 |
iEnvironmentalReverb->SetDecayHFRatioL (DecayHFRatio());
|
sl@0
|
90 |
|
sl@0
|
91 |
if (DecayTime() != iEnvironmentalReverb->DecayTime())
|
sl@0
|
92 |
iEnvironmentalReverb->SetDecayTimeL (DecayTime());
|
sl@0
|
93 |
|
sl@0
|
94 |
if (Density() != iEnvironmentalReverb->Density())
|
sl@0
|
95 |
iEnvironmentalReverb->SetDensityL ( Density());
|
sl@0
|
96 |
|
sl@0
|
97 |
if (Diffusion() != iEnvironmentalReverb->Diffusion())
|
sl@0
|
98 |
iEnvironmentalReverb->SetDiffusionL (Diffusion());
|
sl@0
|
99 |
|
sl@0
|
100 |
if (ReflectionsLevel() != iEnvironmentalReverb->ReflectionsLevel())
|
sl@0
|
101 |
iEnvironmentalReverb->SetReflectionsLevelL (ReflectionsLevel());
|
sl@0
|
102 |
|
sl@0
|
103 |
if (ReflectionsDelay() != iEnvironmentalReverb->ReflectionsDelay())
|
sl@0
|
104 |
iEnvironmentalReverb->SetReflectionsDelayL (ReflectionsDelay());
|
sl@0
|
105 |
|
sl@0
|
106 |
if (ReverbDelay() != iEnvironmentalReverb->ReverbDelay())
|
sl@0
|
107 |
iEnvironmentalReverb->SetReverbDelayL (ReverbDelay());
|
sl@0
|
108 |
|
sl@0
|
109 |
if (ReverbLevel() != iEnvironmentalReverb->ReverbLevel())
|
sl@0
|
110 |
iEnvironmentalReverb->SetReverbLevelL (ReverbLevel());
|
sl@0
|
111 |
|
sl@0
|
112 |
if (RoomHFLevel() != iEnvironmentalReverb->RoomHFLevel())
|
sl@0
|
113 |
iEnvironmentalReverb->SetRoomHFLevelL (RoomHFLevel());
|
sl@0
|
114 |
|
sl@0
|
115 |
if (RoomLevel() != iEnvironmentalReverb->RoomLevel())
|
sl@0
|
116 |
iEnvironmentalReverb->SetRoomLevelL (RoomLevel());
|
sl@0
|
117 |
|
sl@0
|
118 |
|
sl@0
|
119 |
if(iEnvironmentalReverb)
|
sl@0
|
120 |
iEnvironmentalReverb->EnableL();
|
sl@0
|
121 |
|
sl@0
|
122 |
}
|
sl@0
|
123 |
|
sl@0
|
124 |
|
sl@0
|
125 |
|
sl@0
|
126 |
// -----------------------------------------------------------------------------
|
sl@0
|
127 |
// CTempEnvironmentalReverb::EnableL
|
sl@0
|
128 |
// Enable the Audio EnvironmentalReverb settings.
|
sl@0
|
129 |
// -----------------------------------------------------------------------------
|
sl@0
|
130 |
//
|
sl@0
|
131 |
EXPORT_C void CTempEnvironmentalReverb::EnableL()
|
sl@0
|
132 |
{
|
sl@0
|
133 |
#ifdef _DEBUG
|
sl@0
|
134 |
RDebug::Print(_L("CTempEnvironmentalReverb::EnableL"));
|
sl@0
|
135 |
#endif
|
sl@0
|
136 |
|
sl@0
|
137 |
iEnabled = ETrue;
|
sl@0
|
138 |
ApplyL();
|
sl@0
|
139 |
}
|
sl@0
|
140 |
|
sl@0
|
141 |
// -----------------------------------------------------------------------------
|
sl@0
|
142 |
// CTempEnvironmentalReverb::DisableL
|
sl@0
|
143 |
// Disable the Audio EnvironmentalReverb settings.
|
sl@0
|
144 |
// -----------------------------------------------------------------------------
|
sl@0
|
145 |
//
|
sl@0
|
146 |
EXPORT_C void CTempEnvironmentalReverb::DisableL()
|
sl@0
|
147 |
{
|
sl@0
|
148 |
#ifdef _DEBUG
|
sl@0
|
149 |
RDebug::Print(_L("CTempEnvironmentalReverb::DisableL"));
|
sl@0
|
150 |
#endif
|
sl@0
|
151 |
|
sl@0
|
152 |
iEnabled = EFalse;
|
sl@0
|
153 |
if(iEnvironmentalReverb)
|
sl@0
|
154 |
iEnvironmentalReverb->DisableL();
|
sl@0
|
155 |
}
|
sl@0
|
156 |
|
sl@0
|
157 |
// -----------------------------------------------------------------------------
|
sl@0
|
158 |
// CTempEnvironmentalReverb::IsEnableL
|
sl@0
|
159 |
// Return enable flag.
|
sl@0
|
160 |
// -----------------------------------------------------------------------------
|
sl@0
|
161 |
//
|
sl@0
|
162 |
EXPORT_C TBool CTempEnvironmentalReverb::IsEnabled() const
|
sl@0
|
163 |
{
|
sl@0
|
164 |
#ifdef _DEBUG
|
sl@0
|
165 |
RDebug::Print(_L("CTempEnvironmentalReverb::IsEnabled"));
|
sl@0
|
166 |
#endif
|
sl@0
|
167 |
|
sl@0
|
168 |
TBool ifEnabled = EFalse;
|
sl@0
|
169 |
if(iEnvironmentalReverb)
|
sl@0
|
170 |
ifEnabled = iEnvironmentalReverb->IsEnabled();
|
sl@0
|
171 |
|
sl@0
|
172 |
|
sl@0
|
173 |
return ifEnabled;
|
sl@0
|
174 |
}
|
sl@0
|
175 |
|
sl@0
|
176 |
|
sl@0
|
177 |
|
sl@0
|
178 |
// -----------------------------------------------------------------------------
|
sl@0
|
179 |
// CTempEnvironmentalReverb::IsEnforced
|
sl@0
|
180 |
// Return enForce flag
|
sl@0
|
181 |
// -----------------------------------------------------------------------------
|
sl@0
|
182 |
//
|
sl@0
|
183 |
EXPORT_C TBool CTempEnvironmentalReverb::IsEnforced() const
|
sl@0
|
184 |
{
|
sl@0
|
185 |
#ifdef _DEBUG
|
sl@0
|
186 |
RDebug::Print(_L("CTempEnvironmentalReverb::IsEnforced"));
|
sl@0
|
187 |
#endif
|
sl@0
|
188 |
|
sl@0
|
189 |
TBool ifEnforced = EFalse;
|
sl@0
|
190 |
if(iEnvironmentalReverb)
|
sl@0
|
191 |
ifEnforced = iEnvironmentalReverb->IsEnforced();
|
sl@0
|
192 |
|
sl@0
|
193 |
return ifEnforced;
|
sl@0
|
194 |
|
sl@0
|
195 |
}
|
sl@0
|
196 |
|
sl@0
|
197 |
|
sl@0
|
198 |
// -----------------------------------------------------------------------------
|
sl@0
|
199 |
// CTempEnvironmentalReverb::EnforceL
|
sl@0
|
200 |
// Enforce the effect
|
sl@0
|
201 |
// -----------------------------------------------------------------------------
|
sl@0
|
202 |
//
|
sl@0
|
203 |
EXPORT_C void CTempEnvironmentalReverb::EnforceL( TBool aEnforced )
|
sl@0
|
204 |
{
|
sl@0
|
205 |
#ifdef _DEBUG
|
sl@0
|
206 |
RDebug::Print(_L("CTempEnvironmentalReverb::EnforceL"));
|
sl@0
|
207 |
#endif
|
sl@0
|
208 |
|
sl@0
|
209 |
iEnforced = aEnforced;
|
sl@0
|
210 |
|
sl@0
|
211 |
if(iEnvironmentalReverb)
|
sl@0
|
212 |
iEnvironmentalReverb->EnforceL(aEnforced);
|
sl@0
|
213 |
}
|
sl@0
|
214 |
|
sl@0
|
215 |
|
sl@0
|
216 |
|
sl@0
|
217 |
// -----------------------------------------------------------------------------
|
sl@0
|
218 |
// CTempEnvironmentalReverb::HaveUpdateRights
|
sl@0
|
219 |
// Return enForce flag
|
sl@0
|
220 |
// -----------------------------------------------------------------------------
|
sl@0
|
221 |
//
|
sl@0
|
222 |
EXPORT_C TBool CTempEnvironmentalReverb::HaveUpdateRights() const
|
sl@0
|
223 |
{
|
sl@0
|
224 |
#ifdef _DEBUG
|
sl@0
|
225 |
RDebug::Print(_L("CTempEnvironmentalReverb::HaveUpdateRights"));
|
sl@0
|
226 |
#endif
|
sl@0
|
227 |
|
sl@0
|
228 |
TBool ifHaveUpdateRights = EFalse;
|
sl@0
|
229 |
if(iEnvironmentalReverb)
|
sl@0
|
230 |
ifHaveUpdateRights = iEnvironmentalReverb->HaveUpdateRights();
|
sl@0
|
231 |
|
sl@0
|
232 |
return ifHaveUpdateRights;
|
sl@0
|
233 |
|
sl@0
|
234 |
}
|
sl@0
|
235 |
|
sl@0
|
236 |
|
sl@0
|
237 |
|
sl@0
|
238 |
// ========================== OTHER EXPORTED FUNCTIONS =========================
|
sl@0
|
239 |
|
sl@0
|
240 |
// End of File
|
sl@0
|
241 |
|