os/mm/devsoundextensions/effects/EnvReverb/EnvironmentalReverbEffect/Src/EnvironmentalReverbBase.cpp
changeset 0 bde4ae8d615e
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/os/mm/devsoundextensions/effects/EnvReverb/EnvironmentalReverbEffect/Src/EnvironmentalReverbBase.cpp	Fri Jun 15 03:10:57 2012 +0200
     1.3 @@ -0,0 +1,757 @@
     1.4 +/*
     1.5 +* Copyright (c) 2006 Nokia Corporation and/or its subsidiary(-ies). 
     1.6 +* All rights reserved.
     1.7 +* This component and the accompanying materials are made available
     1.8 +* under the terms of "Eclipse Public License v1.0"
     1.9 +* which accompanies this distribution, and is available
    1.10 +* at the URL "http://www.eclipse.org/legal/epl-v10.html".
    1.11 +*
    1.12 +* Initial Contributors:
    1.13 +* Nokia Corporation - initial contribution.
    1.14 +*
    1.15 +* Contributors:
    1.16 +*
    1.17 +* Description:   Implementation of the Environmental Reverb effect class
    1.18 +*
    1.19 +*/
    1.20 +
    1.21 +
    1.22 +
    1.23 +
    1.24 +// INCLUDE FILES
    1.25 +
    1.26 +#ifdef _DEBUG
    1.27 +#include <e32svr.h>
    1.28 +#endif
    1.29 +
    1.30 +#include <EnvironmentalReverbBase.h>
    1.31 +#include <CustomInterfaceUtility.h>
    1.32 +#include "EnvironmentalReverbProxy.h"
    1.33 +#include <DrmAudioSamplePlayer.h>
    1.34 +#include <mdaaudioinputstream.h>
    1.35 +#include <mdaaudiooutputstream.h>
    1.36 +#include <mdaaudiotoneplayer.h>
    1.37 +#include <mmf/server/sounddevice.h>
    1.38 +
    1.39 +#ifdef _DEBUG
    1.40 +#define DEBPRN0         RDebug::Printf( "%s", __PRETTY_FUNCTION__);
    1.41 +#define DEBPRN1(str)    RDebug::Printf( "%s %s", __PRETTY_FUNCTION__, str );
    1.42 +#else
    1.43 +#define DEBPRN0
    1.44 +#define DEBPRN1(str)
    1.45 +#endif
    1.46 +
    1.47 +// ============================ MEMBER FUNCTIONS ===============================
    1.48 +
    1.49 +// -----------------------------------------------------------------------------
    1.50 +// CEnvironmentalReverb::CEnvironmentalReverb
    1.51 +// C++ default constructor can NOT contain any code, that
    1.52 +// might leave.
    1.53 +// -----------------------------------------------------------------------------
    1.54 +//
    1.55 +EXPORT_C CEnvironmentalReverb::CEnvironmentalReverb()
    1.56 +    : 	iReverbData(),
    1.57 +    	iDataPckgTo(iReverbData)
    1.58 +    {
    1.59 +    }
    1.60 +
    1.61 +// Destructor
    1.62 +EXPORT_C CEnvironmentalReverb::~CEnvironmentalReverb()
    1.63 +    {
    1.64 +    }
    1.65 +
    1.66 +// -----------------------------------------------------------------------------
    1.67 +// CEnvironmentalReverb::NewL
    1.68 +// Static function for creating an instance of the Environmental Reverb object.
    1.69 +// -----------------------------------------------------------------------------
    1.70 +//
    1.71 +EXPORT_C CEnvironmentalReverb* CEnvironmentalReverb::NewL()
    1.72 +	{
    1.73 +	User::Leave(KErrNotSupported);
    1.74 +	return NULL;
    1.75 +	}
    1.76 +
    1.77 +// -----------------------------------------------------------------------------
    1.78 +// CEnvironmentalReverb::NewL
    1.79 +// Static function for creating an instance of the EnvironmentalReverb object.
    1.80 +// -----------------------------------------------------------------------------
    1.81 +//
    1.82 +EXPORT_C CEnvironmentalReverb* CEnvironmentalReverb::NewL(
    1.83 +	CMdaAudioConvertUtility& aUtility )
    1.84 +	{
    1.85 +
    1.86 +    DEBPRN0;
    1.87 +   	CCustomInterfaceUtility* customInterface = CCustomInterfaceUtility::NewL(aUtility);
    1.88 +    CleanupStack::PushL(customInterface);
    1.89 +
    1.90 +	CEnvironmentalReverbProxy* environmentalReverbProxy = (CEnvironmentalReverbProxy*)customInterface->CustomInterface(KUidEnvironmentalReverbEffect);
    1.91 +
    1.92 +	if ( !environmentalReverbProxy )
    1.93 +		{
    1.94 +		DEBPRN1("No Adaptation Support - leaving");
    1.95 +		User::Leave(KErrNotSupported);
    1.96 +		}
    1.97 +
    1.98 +	CleanupStack::Pop(customInterface);
    1.99 +
   1.100 +    return environmentalReverbProxy;
   1.101 +	}
   1.102 +
   1.103 +// -----------------------------------------------------------------------------
   1.104 +// CEnvironmentalReverb::NewL
   1.105 +// Static function for creating an instance of the EnvironmentalReverb object.
   1.106 +// -----------------------------------------------------------------------------
   1.107 +//
   1.108 +EXPORT_C CEnvironmentalReverb* CEnvironmentalReverb::NewL(
   1.109 +	CMdaAudioInputStream& aUtility )
   1.110 +	{
   1.111 +
   1.112 +    DEBPRN0;
   1.113 +    CEnvironmentalReverbProxy* environmentalReverbProxy = (CEnvironmentalReverbProxy*)aUtility.CustomInterface(KUidEnvironmentalReverbEffect);
   1.114 +
   1.115 +	if (environmentalReverbProxy == NULL)
   1.116 +		{
   1.117 +        DEBPRN1("No Adaptation Support - leaving");
   1.118 +    	User::Leave(KErrNotSupported);
   1.119 +		}
   1.120 +
   1.121 +    return environmentalReverbProxy;
   1.122 +	}
   1.123 +
   1.124 +// -----------------------------------------------------------------------------
   1.125 +// CEnvironmentalReverb::NewL
   1.126 +// Static function for creating an instance of the EnvironmentalReverb object.
   1.127 +// -----------------------------------------------------------------------------
   1.128 +//
   1.129 +EXPORT_C CEnvironmentalReverb* CEnvironmentalReverb::NewL(
   1.130 +	CMdaAudioOutputStream& aUtility )
   1.131 +	{
   1.132 +
   1.133 +    DEBPRN0;
   1.134 +    CEnvironmentalReverbProxy* environmentalReverbProxy = (CEnvironmentalReverbProxy*)aUtility.CustomInterface(KUidEnvironmentalReverbEffect);
   1.135 +
   1.136 +	if (environmentalReverbProxy == NULL)
   1.137 +		{
   1.138 +        DEBPRN1("No Adaptation Support - leaving");
   1.139 +    	User::Leave(KErrNotSupported);
   1.140 +		}
   1.141 +
   1.142 +    return environmentalReverbProxy;
   1.143 +	}
   1.144 +
   1.145 +// -----------------------------------------------------------------------------
   1.146 +// CEnvironmentalReverb::NewL
   1.147 +// Static function for creating an instance of the EnvironmentalReverb object.
   1.148 +// -----------------------------------------------------------------------------
   1.149 +//
   1.150 +EXPORT_C CEnvironmentalReverb* CEnvironmentalReverb::NewL(
   1.151 +	CMdaAudioPlayerUtility& aUtility )
   1.152 +	{
   1.153 +
   1.154 +    DEBPRN0;
   1.155 +   	CCustomInterfaceUtility* customInterface = CCustomInterfaceUtility::NewL(aUtility);
   1.156 +    CleanupStack::PushL(customInterface);
   1.157 +
   1.158 +	CEnvironmentalReverbProxy* environmentalReverbProxy = (CEnvironmentalReverbProxy*)customInterface->CustomInterface(KUidEnvironmentalReverbEffect);
   1.159 +
   1.160 +	if ( !environmentalReverbProxy )
   1.161 +		{
   1.162 +		DEBPRN1("No Adaptation Support - leaving");
   1.163 +		User::Leave(KErrNotSupported);
   1.164 +		}
   1.165 +
   1.166 +	CleanupStack::Pop(customInterface);
   1.167 +
   1.168 +    return environmentalReverbProxy;
   1.169 +	}
   1.170 +
   1.171 +// -----------------------------------------------------------------------------
   1.172 +// CEnvironmentalReverb::NewL
   1.173 +// Static function for creating an instance of the EnvironmentalReverb object.
   1.174 +// -----------------------------------------------------------------------------
   1.175 +//
   1.176 +EXPORT_C CEnvironmentalReverb* CEnvironmentalReverb::NewL(
   1.177 +	CMdaAudioRecorderUtility& aUtility,
   1.178 +	TBool aRecordStream )
   1.179 +	{
   1.180 +
   1.181 +    DEBPRN0;
   1.182 +   	CCustomInterfaceUtility* customInterface = CCustomInterfaceUtility::NewL(aUtility, aRecordStream);
   1.183 +    CleanupStack::PushL(customInterface);
   1.184 +
   1.185 +	CEnvironmentalReverbProxy* environmentalReverbProxy = (CEnvironmentalReverbProxy*)customInterface->CustomInterface(KUidEnvironmentalReverbEffect);
   1.186 +
   1.187 +	if ( !environmentalReverbProxy )
   1.188 +		{
   1.189 +		DEBPRN1("No Adaptation Support - leaving");
   1.190 +		User::Leave(KErrNotSupported);
   1.191 +		}
   1.192 +
   1.193 +	CleanupStack::Pop(customInterface);
   1.194 +
   1.195 +    return environmentalReverbProxy;
   1.196 +	}
   1.197 +
   1.198 +// -----------------------------------------------------------------------------
   1.199 +// CEnvironmentalReverb::NewL
   1.200 +// Static function for creating an instance of the EnvironmentalReverb object.
   1.201 +// -----------------------------------------------------------------------------
   1.202 +//
   1.203 +EXPORT_C CEnvironmentalReverb* CEnvironmentalReverb::NewL(
   1.204 +	CMdaAudioToneUtility& aUtility )
   1.205 +	{
   1.206 +
   1.207 +	DEBPRN0;
   1.208 +    CEnvironmentalReverbProxy* environmentalReverbProxy = (CEnvironmentalReverbProxy*)aUtility.CustomInterface(KUidEnvironmentalReverbEffect);
   1.209 +
   1.210 +	if (environmentalReverbProxy == NULL)
   1.211 +		{
   1.212 +        DEBPRN1("No Adaptation Support - leaving");
   1.213 +    	User::Leave(KErrNotSupported);
   1.214 +		}
   1.215 +
   1.216 +    return environmentalReverbProxy;
   1.217 +	}
   1.218 +
   1.219 +// -----------------------------------------------------------------------------
   1.220 +// CAudioEqualizer::NewL
   1.221 +// Static function for creating an instance of the EnvironmentalReverb object.
   1.222 +// -----------------------------------------------------------------------------
   1.223 +//
   1.224 +EXPORT_C CEnvironmentalReverb* CEnvironmentalReverb::NewL(
   1.225 +	CMMFDevSound& aDevSound )
   1.226 +	{
   1.227 +
   1.228 +	DEBPRN0;
   1.229 +    CEnvironmentalReverbProxy* environmentalReverbProxy = (CEnvironmentalReverbProxy*)aDevSound.CustomInterface(KUidEnvironmentalReverbEffect);
   1.230 +
   1.231 +	if (environmentalReverbProxy == NULL)
   1.232 +		{
   1.233 +        DEBPRN1("No Adaptation Support - leaving");
   1.234 +    	User::Leave(KErrNotSupported);
   1.235 +		}
   1.236 +
   1.237 +    return environmentalReverbProxy;
   1.238 +	}
   1.239 +
   1.240 +// -----------------------------------------------------------------------------
   1.241 +// CEnvironmentalReverb::NewL
   1.242 +// Static function for creating an instance of the EnvironmentalReverb object.
   1.243 +// -----------------------------------------------------------------------------
   1.244 +//
   1.245 +EXPORT_C CEnvironmentalReverb* CEnvironmentalReverb::NewL(
   1.246 +	CCustomCommandUtility* aUtility )
   1.247 +	{
   1.248 +
   1.249 +    DEBPRN0;
   1.250 +   	CCustomInterfaceUtility* customInterface = CCustomInterfaceUtility::NewL(aUtility);
   1.251 +    CleanupStack::PushL(customInterface);
   1.252 +
   1.253 +	CEnvironmentalReverbProxy* environmentalReverbProxy = (CEnvironmentalReverbProxy*)customInterface->CustomInterface(KUidEnvironmentalReverbEffect);
   1.254 +
   1.255 +	if ( !environmentalReverbProxy )
   1.256 +		{
   1.257 +		DEBPRN1("No Adaptation Support - leaving");
   1.258 +		User::Leave(KErrNotSupported);
   1.259 +		}
   1.260 +
   1.261 + 	CleanupStack::Pop(customInterface);
   1.262 +
   1.263 +    return environmentalReverbProxy;
   1.264 +	}
   1.265 +
   1.266 +// -----------------------------------------------------------------------------
   1.267 +// CEnvironmentalReverb::NewL
   1.268 +// Static function for creating an instance of the EnvironmentalReverb object.
   1.269 +// -----------------------------------------------------------------------------
   1.270 +//
   1.271 +EXPORT_C CEnvironmentalReverb* CEnvironmentalReverb::NewL(
   1.272 +	MCustomInterface& aCustomInterface )
   1.273 +	{
   1.274 +
   1.275 +    DEBPRN0;
   1.276 +	CEnvironmentalReverb* environmentalReverbProxy = (CEnvironmentalReverb*)aCustomInterface.CustomInterface(KUidEnvironmentalReverbEffect);
   1.277 +	if ( !environmentalReverbProxy )
   1.278 +		{
   1.279 +		DEBPRN1("No Adaptation Support - leaving");
   1.280 +		User::Leave(KErrNotSupported);
   1.281 +		}
   1.282 +
   1.283 +    return environmentalReverbProxy;
   1.284 +	}
   1.285 +
   1.286 +
   1.287 +// -----------------------------------------------------------------------------
   1.288 +// CEnvironmentalReverb::NewL
   1.289 +// Static function for creating an instance of the EnvironmentalReverb object.
   1.290 +// -----------------------------------------------------------------------------
   1.291 +//
   1.292 +EXPORT_C CEnvironmentalReverb* CEnvironmentalReverb::NewL(CMidiClientUtility& aUtility )
   1.293 +	{
   1.294 +
   1.295 +    DEBPRN0;
   1.296 +   	CCustomInterfaceUtility* customInterface = CCustomInterfaceUtility::NewL(aUtility);
   1.297 +    CleanupStack::PushL(customInterface);
   1.298 +
   1.299 +	CEnvironmentalReverbProxy* environmentalReverbProxy = (CEnvironmentalReverbProxy*)customInterface->CustomInterface(KUidEnvironmentalReverbEffect);
   1.300 +
   1.301 +	if ( !environmentalReverbProxy )
   1.302 +		{
   1.303 +		DEBPRN1("No Adaptation Support - leaving");
   1.304 +		User::Leave(KErrNotSupported);
   1.305 +		}
   1.306 +
   1.307 +	CleanupStack::Pop(customInterface);
   1.308 +
   1.309 +    return environmentalReverbProxy;
   1.310 +	}
   1.311 +
   1.312 +// -----------------------------------------------------------------------------
   1.313 +// CEnvironmentalReverb::NewL
   1.314 +// Static function for creating an instance of the EnvironmentalReverb object.
   1.315 +// -----------------------------------------------------------------------------
   1.316 +//
   1.317 +EXPORT_C CEnvironmentalReverb* CEnvironmentalReverb::NewL(CDrmPlayerUtility& aUtility)
   1.318 +	{
   1.319 +
   1.320 +    DEBPRN0;
   1.321 +   	CCustomInterfaceUtility* customInterface = CCustomInterfaceUtility::NewL(aUtility);
   1.322 +    CleanupStack::PushL(customInterface);
   1.323 +
   1.324 +	CEnvironmentalReverbProxy* environmentalReverbProxy = (CEnvironmentalReverbProxy*)customInterface->CustomInterface(KUidEnvironmentalReverbEffect);
   1.325 +
   1.326 +	if ( !environmentalReverbProxy )
   1.327 +		{
   1.328 +		DEBPRN1("No Adaptation Support - leaving");
   1.329 +		User::Leave(KErrNotSupported);
   1.330 +		}
   1.331 +
   1.332 +	CleanupStack::Pop(customInterface);
   1.333 +
   1.334 +    return environmentalReverbProxy;
   1.335 +	}
   1.336 +
   1.337 +// -----------------------------------------------------------------------------
   1.338 +// CEnvironmentalReverb::NewL
   1.339 +// Static function for creating an instance of the EnvironmentalReverb object.
   1.340 +// -----------------------------------------------------------------------------
   1.341 +//
   1.342 +EXPORT_C CEnvironmentalReverb* CEnvironmentalReverb::NewL(CVideoPlayerUtility& aUtility)
   1.343 +	{
   1.344 +
   1.345 +    DEBPRN0;
   1.346 +   	CCustomInterfaceUtility* customInterface = CCustomInterfaceUtility::NewL(aUtility);
   1.347 +    CleanupStack::PushL(customInterface);
   1.348 +
   1.349 +	CEnvironmentalReverbProxy* environmentalReverbProxy = (CEnvironmentalReverbProxy*)customInterface->CustomInterface(KUidEnvironmentalReverbEffect);
   1.350 +
   1.351 +	if ( !environmentalReverbProxy )
   1.352 +		{
   1.353 +		DEBPRN1("No Adaptation Support - leaving");
   1.354 +		User::Leave(KErrNotSupported);
   1.355 +		}
   1.356 +
   1.357 +	CleanupStack::Pop(customInterface);
   1.358 +
   1.359 +    return environmentalReverbProxy;
   1.360 +	}
   1.361 +
   1.362 +// -----------------------------------------------------------------------------
   1.363 +// CEnvironmentalReverb::DecayHFRatio
   1.364 +// -----------------------------------------------------------------------------
   1.365 +//
   1.366 +EXPORT_C TUint32 CEnvironmentalReverb::DecayHFRatio() const
   1.367 +	{
   1.368 +	return iReverbData.iDecayHFRatio;
   1.369 +	}
   1.370 +
   1.371 +// -----------------------------------------------------------------------------
   1.372 +// CEnvironmentalReverb::DecayHFRatioRange
   1.373 +// -----------------------------------------------------------------------------
   1.374 +//
   1.375 +EXPORT_C void CEnvironmentalReverb::DecayHFRatioRange(
   1.376 +	TUint32& aMin,
   1.377 +	TUint32& aMax )
   1.378 +	{
   1.379 +	aMin = iReverbData.iDecayHFRatioMin;
   1.380 +	aMax = iReverbData.iDecayHFRatioMax;
   1.381 +	}
   1.382 +
   1.383 +// -----------------------------------------------------------------------------
   1.384 +// CEnvironmentalReverb::DecayTime
   1.385 +// -----------------------------------------------------------------------------
   1.386 +//
   1.387 +EXPORT_C TUint32 CEnvironmentalReverb::DecayTime() const
   1.388 +	{
   1.389 +	return iReverbData.iDecayTime;
   1.390 +	}
   1.391 +
   1.392 +// -----------------------------------------------------------------------------
   1.393 +// CEnvironmentalReverb::DecayTimeRange
   1.394 +// -----------------------------------------------------------------------------
   1.395 +//
   1.396 +EXPORT_C void CEnvironmentalReverb::DecayTimeRange(
   1.397 +	TUint32& aMin,
   1.398 +	TUint32& aMax)
   1.399 +	{
   1.400 +	aMin = iReverbData.iDecayTimeMin;
   1.401 +	aMax = iReverbData.iDecayTimeMax;
   1.402 +	}
   1.403 +
   1.404 +// -----------------------------------------------------------------------------
   1.405 +// CEnvironmentalReverb::Density
   1.406 +// -----------------------------------------------------------------------------
   1.407 +//
   1.408 +EXPORT_C TUint32 CEnvironmentalReverb::Density() const
   1.409 +	{
   1.410 +	return iReverbData.iDensity;
   1.411 +	}
   1.412 +
   1.413 +// -----------------------------------------------------------------------------
   1.414 +// CEnvironmentalReverb::Diffusion
   1.415 +// -----------------------------------------------------------------------------
   1.416 +//
   1.417 +EXPORT_C TUint32 CEnvironmentalReverb::Diffusion() const
   1.418 +	{
   1.419 +	return iReverbData.iDiffusion;
   1.420 +	}
   1.421 +
   1.422 +// -----------------------------------------------------------------------------
   1.423 +// CEnvironmentalReverb::ReflectionsDelay
   1.424 +// -----------------------------------------------------------------------------
   1.425 +//
   1.426 +EXPORT_C TUint32 CEnvironmentalReverb::ReflectionsDelay() const
   1.427 +	{
   1.428 +	return iReverbData.iReflectionsDelay;
   1.429 +	}
   1.430 +
   1.431 +// -----------------------------------------------------------------------------
   1.432 +// CEnvironmentalReverb::ReflectionsDelayMax
   1.433 +// -----------------------------------------------------------------------------
   1.434 +//
   1.435 +EXPORT_C TUint32 CEnvironmentalReverb::ReflectionsDelayMax() const
   1.436 +	{
   1.437 +	return iReverbData.iReflectionsDelayMax;
   1.438 +	}
   1.439 +
   1.440 +// -----------------------------------------------------------------------------
   1.441 +// CEnvironmentalReverb::ReflectionsLevel
   1.442 +// -----------------------------------------------------------------------------
   1.443 +//
   1.444 +EXPORT_C TInt32 CEnvironmentalReverb::ReflectionsLevel() const
   1.445 +	{
   1.446 +	return iReverbData.iReflectionsLevel;
   1.447 +	}
   1.448 +
   1.449 +// -----------------------------------------------------------------------------
   1.450 +// CEnvironmentalReverb::ReflectionLevelRange
   1.451 +// -----------------------------------------------------------------------------
   1.452 +//
   1.453 +EXPORT_C void CEnvironmentalReverb::ReflectionLevelRange(
   1.454 +	TInt32& aMin,
   1.455 +	TInt32& aMax)
   1.456 +	{
   1.457 +	aMin = iReverbData.iReflectionLevelMin;
   1.458 +	aMax = iReverbData.iReflectionLevelMax;
   1.459 +	}
   1.460 +
   1.461 +// -----------------------------------------------------------------------------
   1.462 +// CEnvironmentalReverb::ReverbDelay
   1.463 +// -----------------------------------------------------------------------------
   1.464 +//
   1.465 +EXPORT_C TUint32 CEnvironmentalReverb::ReverbDelay() const
   1.466 +	{
   1.467 +	return iReverbData.iReverbDelay;
   1.468 +	}
   1.469 +
   1.470 +// -----------------------------------------------------------------------------
   1.471 +// CEnvironmentalReverb::ReverbDelayMax
   1.472 +// -----------------------------------------------------------------------------
   1.473 +//
   1.474 +EXPORT_C TUint32 CEnvironmentalReverb::ReverbDelayMax() const
   1.475 +	{
   1.476 +	return iReverbData.iReverbDelayMax;
   1.477 +	}
   1.478 +
   1.479 +
   1.480 +// -----------------------------------------------------------------------------
   1.481 +// CEnvironmentalReverb::ReverbLevel
   1.482 +// -----------------------------------------------------------------------------
   1.483 +//
   1.484 +EXPORT_C TInt32 CEnvironmentalReverb::ReverbLevel() const
   1.485 +	{
   1.486 +	return iReverbData.iReverbLevel;
   1.487 +	}
   1.488 +
   1.489 +// -----------------------------------------------------------------------------
   1.490 +// CEnvironmentalReverb::ReverbLevelRange
   1.491 +// -----------------------------------------------------------------------------
   1.492 +//
   1.493 +EXPORT_C void CEnvironmentalReverb::ReverbLevelRange(
   1.494 +	TInt32& aMin,
   1.495 +	TInt32& aMax)
   1.496 +	{
   1.497 +	aMin = iReverbData.iReverbLevelMin;
   1.498 +	aMax = iReverbData.iReverbLevelMax;
   1.499 +	}
   1.500 +
   1.501 +
   1.502 +// -----------------------------------------------------------------------------
   1.503 +// CEnvironmentalReverb::RoomHFLevel
   1.504 +// -----------------------------------------------------------------------------
   1.505 +//
   1.506 +EXPORT_C TInt32 CEnvironmentalReverb::RoomHFLevel() const
   1.507 +	{
   1.508 +	return iReverbData.iRoomHFLevel;
   1.509 +	}
   1.510 +
   1.511 +
   1.512 +// -----------------------------------------------------------------------------
   1.513 +// CEnvironmentalReverb::RoomHFLevelRange
   1.514 +// -----------------------------------------------------------------------------
   1.515 +//
   1.516 +EXPORT_C void CEnvironmentalReverb::RoomHFLevelRange(
   1.517 +	TInt32& aMin,
   1.518 +	TInt32& aMax)
   1.519 +	{
   1.520 +	aMin = iReverbData.iRoomHFLevelMin;
   1.521 +	aMax = iReverbData.iRoomHFLevelMax;
   1.522 +	}
   1.523 +
   1.524 +
   1.525 +// -----------------------------------------------------------------------------
   1.526 +// CEnvironmentalReverb::RoomLevel
   1.527 +// -----------------------------------------------------------------------------
   1.528 +//
   1.529 +EXPORT_C TInt32 CEnvironmentalReverb::RoomLevel() const
   1.530 +
   1.531 +	{
   1.532 +	return iReverbData.iRoomLevel;
   1.533 +	}
   1.534 +
   1.535 +
   1.536 +// -----------------------------------------------------------------------------
   1.537 +// CEnvironmentalReverb::RoomLevelRange
   1.538 +// -----------------------------------------------------------------------------
   1.539 +//
   1.540 +EXPORT_C void CEnvironmentalReverb::RoomLevelRange(
   1.541 +	TInt32& aMin,
   1.542 +	TInt32& aMax)
   1.543 +	{
   1.544 +	aMin = iReverbData.iRoomLevelMin;
   1.545 +	aMax = iReverbData.iRoomLevelMax;
   1.546 +	}
   1.547 +
   1.548 +
   1.549 +
   1.550 +// -----------------------------------------------------------------------------
   1.551 +// CEnvironmentalReverb::SetDecayHFRatioL
   1.552 +// -----------------------------------------------------------------------------
   1.553 +//
   1.554 +EXPORT_C void CEnvironmentalReverb::SetDecayHFRatioL(
   1.555 +	TUint32 aDecayHFRatio )
   1.556 +	{
   1.557 +	if ( (aDecayHFRatio >= iReverbData.iDecayHFRatioMin) && (aDecayHFRatio <= iReverbData.iDecayHFRatioMax) )
   1.558 +		{
   1.559 +		iReverbData.iDecayHFRatio = aDecayHFRatio;
   1.560 +		}
   1.561 +	else
   1.562 +		{
   1.563 +		User::Leave(KErrArgument);
   1.564 +		}
   1.565 +	}
   1.566 +
   1.567 +
   1.568 +// -----------------------------------------------------------------------------
   1.569 +// CEnvironmentalReverb::SetDecayTimeL
   1.570 +// -----------------------------------------------------------------------------
   1.571 +//
   1.572 +EXPORT_C void CEnvironmentalReverb::SetDecayTimeL(
   1.573 +	TUint32 aDecayTime )
   1.574 +	{
   1.575 +	if ( (aDecayTime >= iReverbData.iDecayTimeMin) && (aDecayTime <= iReverbData.iDecayTimeMax) )
   1.576 +		{
   1.577 +		iReverbData.iDecayTime = aDecayTime;
   1.578 +		}
   1.579 +	else
   1.580 +		{
   1.581 +		User::Leave(KErrArgument);
   1.582 +		}
   1.583 +	}
   1.584 +
   1.585 +
   1.586 +// -----------------------------------------------------------------------------
   1.587 +// CEnvironmentalReverb::SetDensityL
   1.588 +// -----------------------------------------------------------------------------
   1.589 +//
   1.590 +EXPORT_C void CEnvironmentalReverb::SetDensityL(
   1.591 +	TUint32 aDensity )
   1.592 +	{
   1.593 +	iReverbData.iDensity = aDensity;
   1.594 +	}
   1.595 +
   1.596 +// -----------------------------------------------------------------------------
   1.597 +// CEnvironmentalReverb::SetDiffusionL
   1.598 +// -----------------------------------------------------------------------------
   1.599 +//
   1.600 +EXPORT_C void CEnvironmentalReverb::SetDiffusionL(
   1.601 +	TUint32 aDiffusion )
   1.602 +	{
   1.603 +	iReverbData.iDiffusion = aDiffusion;
   1.604 +	}
   1.605 +
   1.606 +
   1.607 +// -----------------------------------------------------------------------------
   1.608 +// CEnvironmentalReverb::SetReflectionsDelayL
   1.609 +// -----------------------------------------------------------------------------
   1.610 +//
   1.611 +EXPORT_C void CEnvironmentalReverb::SetReflectionsDelayL(
   1.612 +	TUint32 aReflectionsDelay )
   1.613 +	{
   1.614 +	if ( aReflectionsDelay > iReverbData.iReflectionsDelayMax )
   1.615 +		{
   1.616 +		User::Leave(KErrArgument);
   1.617 +		}
   1.618 +	else
   1.619 +		{
   1.620 +		iReverbData.iReflectionsDelay = aReflectionsDelay;
   1.621 +		}
   1.622 +	}
   1.623 +
   1.624 +// -----------------------------------------------------------------------------
   1.625 +// CEnvironmentalReverb::SetReflectionsLevelL
   1.626 +// -----------------------------------------------------------------------------
   1.627 +//
   1.628 +EXPORT_C void CEnvironmentalReverb::SetReflectionsLevelL(
   1.629 +	TInt32 aReflectionsLevel )
   1.630 +	{
   1.631 +	if ( (aReflectionsLevel >= iReverbData.iReflectionLevelMin) && (aReflectionsLevel <= iReverbData.iReflectionLevelMax) )
   1.632 +		{
   1.633 +		iReverbData.iReflectionsLevel = aReflectionsLevel;
   1.634 +		}
   1.635 +	else
   1.636 +		{
   1.637 +		User::Leave(KErrArgument);
   1.638 +		}
   1.639 +	}
   1.640 +
   1.641 +// -----------------------------------------------------------------------------
   1.642 +// CEnvironmentalReverb::SetReverbDelayL
   1.643 +// -----------------------------------------------------------------------------
   1.644 +//
   1.645 +EXPORT_C void CEnvironmentalReverb::SetReverbDelayL(
   1.646 +	TUint32 aReverbDelay )
   1.647 +	{
   1.648 +	if ( aReverbDelay > iReverbData.iReverbDelayMax )
   1.649 +		{
   1.650 +		User::Leave(KErrArgument);
   1.651 +		}
   1.652 +	else
   1.653 +		{
   1.654 +		iReverbData.iReverbDelay = aReverbDelay;
   1.655 +		}
   1.656 +	}
   1.657 +
   1.658 +
   1.659 +// -----------------------------------------------------------------------------
   1.660 +// CEnvironmentalReverb::SetReverbLevelL
   1.661 +// -----------------------------------------------------------------------------
   1.662 +//
   1.663 +EXPORT_C void CEnvironmentalReverb::SetReverbLevelL(
   1.664 +	TInt32 aReverbLevel )
   1.665 +	{
   1.666 +	if ( (aReverbLevel >= iReverbData.iReverbLevelMin) && (aReverbLevel <= iReverbData.iReverbLevelMax) )
   1.667 +		{
   1.668 +		iReverbData.iReverbLevel = aReverbLevel;
   1.669 +		}
   1.670 +	else
   1.671 +		{
   1.672 +		User::Leave(KErrArgument);
   1.673 +		}
   1.674 +	}
   1.675 +
   1.676 +// -----------------------------------------------------------------------------
   1.677 +// CEnvironmentalReverb::SetRoomHFLevelL
   1.678 +// -----------------------------------------------------------------------------
   1.679 +//
   1.680 +EXPORT_C void CEnvironmentalReverb::SetRoomHFLevelL(
   1.681 +	TInt32 aRoomHFLevel )
   1.682 +	{
   1.683 +	if ( (aRoomHFLevel >= iReverbData.iRoomHFLevelMin) && (aRoomHFLevel <= iReverbData.iRoomHFLevelMax) )
   1.684 +		{
   1.685 +		iReverbData.iRoomHFLevel = aRoomHFLevel;
   1.686 +		}
   1.687 +	else
   1.688 +		{
   1.689 +		User::Leave(KErrArgument);
   1.690 +		}
   1.691 +	}
   1.692 +
   1.693 +// -----------------------------------------------------------------------------
   1.694 +// CEnvironmentalReverb::SetRoomLevelL
   1.695 +// -----------------------------------------------------------------------------
   1.696 +//
   1.697 +EXPORT_C void CEnvironmentalReverb::SetRoomLevelL(
   1.698 +	TInt32 aRoomLevel )
   1.699 +	{
   1.700 +	if ( (aRoomLevel >= iReverbData.iRoomLevelMin) && (aRoomLevel <= iReverbData.iRoomLevelMax) )
   1.701 +		{
   1.702 +		iReverbData.iRoomLevel = aRoomLevel;
   1.703 +		}
   1.704 +	else
   1.705 +		{
   1.706 +		User::Leave(KErrArgument);
   1.707 +		}
   1.708 +	}
   1.709 +
   1.710 +// -----------------------------------------------------------------------------
   1.711 +// CEnvironmentalReverb::DelayMax
   1.712 +// -----------------------------------------------------------------------------
   1.713 +//
   1.714 +EXPORT_C TUint32 CEnvironmentalReverb::DelayMax() const
   1.715 +	{
   1.716 +	return iReverbData.iDelayMax;
   1.717 +	}
   1.718 +
   1.719 +
   1.720 +// -----------------------------------------------------------------------------
   1.721 +// CEnvironmentalReverb::Uid
   1.722 +// -----------------------------------------------------------------------------
   1.723 +//
   1.724 +EXPORT_C TUid CEnvironmentalReverb::Uid() const
   1.725 +	{
   1.726 +	return KUidEnvironmentalReverbEffect;
   1.727 +	}
   1.728 +
   1.729 +
   1.730 +// -----------------------------------------------------------------------------
   1.731 +// CEnvironmentalReverb::DoEffectData
   1.732 +// -----------------------------------------------------------------------------
   1.733 +//
   1.734 +EXPORT_C const TDesC8& CEnvironmentalReverb::DoEffectData()
   1.735 +	{
   1.736 +    DEBPRN0;
   1.737 +	iDataPckgTo = iReverbData;
   1.738 +	return iDataPckgTo;
   1.739 +	}
   1.740 +
   1.741 +// -----------------------------------------------------------------------------
   1.742 +// CEnvironmentalReverb::SetEffectData
   1.743 +// -----------------------------------------------------------------------------
   1.744 +//
   1.745 +EXPORT_C void CEnvironmentalReverb::SetEffectData(
   1.746 +	const TDesC8& aEffectDataBuffer )
   1.747 +	{
   1.748 +    DEBPRN0;
   1.749 +	TEfEnvReverbDataPckg dataPckg;
   1.750 +	dataPckg.Copy(aEffectDataBuffer);
   1.751 +	iReverbData = dataPckg();
   1.752 +	iEnabled = iReverbData.iEnabled;
   1.753 +	iEnforced = iReverbData.iEnforced;
   1.754 +	iHaveUpdateRights = iReverbData.iHaveUpdateRights;
   1.755 +	}
   1.756 +
   1.757 +
   1.758 +// ========================== OTHER EXPORTED FUNCTIONS =========================
   1.759 +
   1.760 +