os/mm/devsoundextensions/effectspresets/EnvironmentalReverbUtility/src/TempEnvironmentalReverb.cpp
Update contrib.
2 * Copyright (c) 2004 Nokia Corporation and/or its subsidiary(-ies).
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".
9 * Initial Contributors:
10 * Nokia Corporation - initial contribution.
14 * Description: Implementation of the audio EnvironmentalReverb proxy class
27 #include "TempEnvironmentalReverb.h"
29 // ============================ MEMBER FUNCTIONS ===============================
31 // -----------------------------------------------------------------------------
32 // CTempEnvironmentalReverb::CTempEnvironmentalReverb
33 // C++ default constructor can NOT contain any code, that
35 // -----------------------------------------------------------------------------
37 CTempEnvironmentalReverb::CTempEnvironmentalReverb()
42 CTempEnvironmentalReverb::~CTempEnvironmentalReverb()
46 // -----------------------------------------------------------------------------
47 // CTempEnvironmentalReverb::NewL
48 // Static function for creating an instance of the Audio EnvironmentalReverb object.
49 // -----------------------------------------------------------------------------
51 EXPORT_C CTempEnvironmentalReverb* CTempEnvironmentalReverb::NewL(CEnvironmentalReverb* aEnvironmentalReverb)
54 RDebug::Print(_L("CTempEnvironmentalReverb::NewL"));
57 CTempEnvironmentalReverb* self = new (ELeave) CTempEnvironmentalReverb();
58 CleanupStack::PushL( self );
59 self->ConstructL(aEnvironmentalReverb);
60 CleanupStack::Pop(self);
64 // -----------------------------------------------------------------------------
65 // CTempEnvironmentalReverb::ConstructL
66 // -----------------------------------------------------------------------------
68 void CTempEnvironmentalReverb::ConstructL(CEnvironmentalReverb* aEnvironmentalReverb)
71 RDebug::Print(_L("CTempEnvironmentalReverb::ConstructL"));
74 iEnvironmentalReverb = aEnvironmentalReverb;
78 // -----------------------------------------------------------------------------
79 // CTempEnvironmentalReverb::ApplyL
80 // Apply the Audio EnvironmentalReverb settings.
81 // -----------------------------------------------------------------------------
83 EXPORT_C void CTempEnvironmentalReverb::ApplyL()
86 RDebug::Print(_L("CTempEnvironmentalReverb::Apply"));
88 if (DecayHFRatio() != iEnvironmentalReverb->DecayHFRatio())
89 iEnvironmentalReverb->SetDecayHFRatioL (DecayHFRatio());
91 if (DecayTime() != iEnvironmentalReverb->DecayTime())
92 iEnvironmentalReverb->SetDecayTimeL (DecayTime());
94 if (Density() != iEnvironmentalReverb->Density())
95 iEnvironmentalReverb->SetDensityL ( Density());
97 if (Diffusion() != iEnvironmentalReverb->Diffusion())
98 iEnvironmentalReverb->SetDiffusionL (Diffusion());
100 if (ReflectionsLevel() != iEnvironmentalReverb->ReflectionsLevel())
101 iEnvironmentalReverb->SetReflectionsLevelL (ReflectionsLevel());
103 if (ReflectionsDelay() != iEnvironmentalReverb->ReflectionsDelay())
104 iEnvironmentalReverb->SetReflectionsDelayL (ReflectionsDelay());
106 if (ReverbDelay() != iEnvironmentalReverb->ReverbDelay())
107 iEnvironmentalReverb->SetReverbDelayL (ReverbDelay());
109 if (ReverbLevel() != iEnvironmentalReverb->ReverbLevel())
110 iEnvironmentalReverb->SetReverbLevelL (ReverbLevel());
112 if (RoomHFLevel() != iEnvironmentalReverb->RoomHFLevel())
113 iEnvironmentalReverb->SetRoomHFLevelL (RoomHFLevel());
115 if (RoomLevel() != iEnvironmentalReverb->RoomLevel())
116 iEnvironmentalReverb->SetRoomLevelL (RoomLevel());
119 if(iEnvironmentalReverb)
120 iEnvironmentalReverb->EnableL();
126 // -----------------------------------------------------------------------------
127 // CTempEnvironmentalReverb::EnableL
128 // Enable the Audio EnvironmentalReverb settings.
129 // -----------------------------------------------------------------------------
131 EXPORT_C void CTempEnvironmentalReverb::EnableL()
134 RDebug::Print(_L("CTempEnvironmentalReverb::EnableL"));
141 // -----------------------------------------------------------------------------
142 // CTempEnvironmentalReverb::DisableL
143 // Disable the Audio EnvironmentalReverb settings.
144 // -----------------------------------------------------------------------------
146 EXPORT_C void CTempEnvironmentalReverb::DisableL()
149 RDebug::Print(_L("CTempEnvironmentalReverb::DisableL"));
153 if(iEnvironmentalReverb)
154 iEnvironmentalReverb->DisableL();
157 // -----------------------------------------------------------------------------
158 // CTempEnvironmentalReverb::IsEnableL
159 // Return enable flag.
160 // -----------------------------------------------------------------------------
162 EXPORT_C TBool CTempEnvironmentalReverb::IsEnabled() const
165 RDebug::Print(_L("CTempEnvironmentalReverb::IsEnabled"));
168 TBool ifEnabled = EFalse;
169 if(iEnvironmentalReverb)
170 ifEnabled = iEnvironmentalReverb->IsEnabled();
178 // -----------------------------------------------------------------------------
179 // CTempEnvironmentalReverb::IsEnforced
180 // Return enForce flag
181 // -----------------------------------------------------------------------------
183 EXPORT_C TBool CTempEnvironmentalReverb::IsEnforced() const
186 RDebug::Print(_L("CTempEnvironmentalReverb::IsEnforced"));
189 TBool ifEnforced = EFalse;
190 if(iEnvironmentalReverb)
191 ifEnforced = iEnvironmentalReverb->IsEnforced();
198 // -----------------------------------------------------------------------------
199 // CTempEnvironmentalReverb::EnforceL
200 // Enforce the effect
201 // -----------------------------------------------------------------------------
203 EXPORT_C void CTempEnvironmentalReverb::EnforceL( TBool aEnforced )
206 RDebug::Print(_L("CTempEnvironmentalReverb::EnforceL"));
209 iEnforced = aEnforced;
211 if(iEnvironmentalReverb)
212 iEnvironmentalReverb->EnforceL(aEnforced);
217 // -----------------------------------------------------------------------------
218 // CTempEnvironmentalReverb::HaveUpdateRights
219 // Return enForce flag
220 // -----------------------------------------------------------------------------
222 EXPORT_C TBool CTempEnvironmentalReverb::HaveUpdateRights() const
225 RDebug::Print(_L("CTempEnvironmentalReverb::HaveUpdateRights"));
228 TBool ifHaveUpdateRights = EFalse;
229 if(iEnvironmentalReverb)
230 ifHaveUpdateRights = iEnvironmentalReverb->HaveUpdateRights();
232 return ifHaveUpdateRights;
238 // ========================== OTHER EXPORTED FUNCTIONS =========================