os/mm/devsoundextensions/effects/EnvReverb/EnvironmentalReverbEffect/Src/EnvironmentalReverbBase.cpp
author sl
Tue, 10 Jun 2014 14:32:02 +0200
changeset 1 260cb5ec6c19
permissions -rw-r--r--
Update contrib.
     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 Environmental Reverb effect class
    15 *
    16 */
    17 
    18 
    19 
    20 
    21 // INCLUDE FILES
    22 
    23 #ifdef _DEBUG
    24 #include <e32svr.h>
    25 #endif
    26 
    27 #include <EnvironmentalReverbBase.h>
    28 #include <CustomInterfaceUtility.h>
    29 #include "EnvironmentalReverbProxy.h"
    30 #include <DrmAudioSamplePlayer.h>
    31 #include <mdaaudioinputstream.h>
    32 #include <mdaaudiooutputstream.h>
    33 #include <mdaaudiotoneplayer.h>
    34 #include <mmf/server/sounddevice.h>
    35 
    36 #ifdef _DEBUG
    37 #define DEBPRN0         RDebug::Printf( "%s", __PRETTY_FUNCTION__);
    38 #define DEBPRN1(str)    RDebug::Printf( "%s %s", __PRETTY_FUNCTION__, str );
    39 #else
    40 #define DEBPRN0
    41 #define DEBPRN1(str)
    42 #endif
    43 
    44 // ============================ MEMBER FUNCTIONS ===============================
    45 
    46 // -----------------------------------------------------------------------------
    47 // CEnvironmentalReverb::CEnvironmentalReverb
    48 // C++ default constructor can NOT contain any code, that
    49 // might leave.
    50 // -----------------------------------------------------------------------------
    51 //
    52 EXPORT_C CEnvironmentalReverb::CEnvironmentalReverb()
    53     : 	iReverbData(),
    54     	iDataPckgTo(iReverbData)
    55     {
    56     }
    57 
    58 // Destructor
    59 EXPORT_C CEnvironmentalReverb::~CEnvironmentalReverb()
    60     {
    61     }
    62 
    63 // -----------------------------------------------------------------------------
    64 // CEnvironmentalReverb::NewL
    65 // Static function for creating an instance of the Environmental Reverb object.
    66 // -----------------------------------------------------------------------------
    67 //
    68 EXPORT_C CEnvironmentalReverb* CEnvironmentalReverb::NewL()
    69 	{
    70 	User::Leave(KErrNotSupported);
    71 	return NULL;
    72 	}
    73 
    74 // -----------------------------------------------------------------------------
    75 // CEnvironmentalReverb::NewL
    76 // Static function for creating an instance of the EnvironmentalReverb object.
    77 // -----------------------------------------------------------------------------
    78 //
    79 EXPORT_C CEnvironmentalReverb* CEnvironmentalReverb::NewL(
    80 	CMdaAudioConvertUtility& aUtility )
    81 	{
    82 
    83     DEBPRN0;
    84    	CCustomInterfaceUtility* customInterface = CCustomInterfaceUtility::NewL(aUtility);
    85     CleanupStack::PushL(customInterface);
    86 
    87 	CEnvironmentalReverbProxy* environmentalReverbProxy = (CEnvironmentalReverbProxy*)customInterface->CustomInterface(KUidEnvironmentalReverbEffect);
    88 
    89 	if ( !environmentalReverbProxy )
    90 		{
    91 		DEBPRN1("No Adaptation Support - leaving");
    92 		User::Leave(KErrNotSupported);
    93 		}
    94 
    95 	CleanupStack::Pop(customInterface);
    96 
    97     return environmentalReverbProxy;
    98 	}
    99 
   100 // -----------------------------------------------------------------------------
   101 // CEnvironmentalReverb::NewL
   102 // Static function for creating an instance of the EnvironmentalReverb object.
   103 // -----------------------------------------------------------------------------
   104 //
   105 EXPORT_C CEnvironmentalReverb* CEnvironmentalReverb::NewL(
   106 	CMdaAudioInputStream& aUtility )
   107 	{
   108 
   109     DEBPRN0;
   110     CEnvironmentalReverbProxy* environmentalReverbProxy = (CEnvironmentalReverbProxy*)aUtility.CustomInterface(KUidEnvironmentalReverbEffect);
   111 
   112 	if (environmentalReverbProxy == NULL)
   113 		{
   114         DEBPRN1("No Adaptation Support - leaving");
   115     	User::Leave(KErrNotSupported);
   116 		}
   117 
   118     return environmentalReverbProxy;
   119 	}
   120 
   121 // -----------------------------------------------------------------------------
   122 // CEnvironmentalReverb::NewL
   123 // Static function for creating an instance of the EnvironmentalReverb object.
   124 // -----------------------------------------------------------------------------
   125 //
   126 EXPORT_C CEnvironmentalReverb* CEnvironmentalReverb::NewL(
   127 	CMdaAudioOutputStream& aUtility )
   128 	{
   129 
   130     DEBPRN0;
   131     CEnvironmentalReverbProxy* environmentalReverbProxy = (CEnvironmentalReverbProxy*)aUtility.CustomInterface(KUidEnvironmentalReverbEffect);
   132 
   133 	if (environmentalReverbProxy == NULL)
   134 		{
   135         DEBPRN1("No Adaptation Support - leaving");
   136     	User::Leave(KErrNotSupported);
   137 		}
   138 
   139     return environmentalReverbProxy;
   140 	}
   141 
   142 // -----------------------------------------------------------------------------
   143 // CEnvironmentalReverb::NewL
   144 // Static function for creating an instance of the EnvironmentalReverb object.
   145 // -----------------------------------------------------------------------------
   146 //
   147 EXPORT_C CEnvironmentalReverb* CEnvironmentalReverb::NewL(
   148 	CMdaAudioPlayerUtility& aUtility )
   149 	{
   150 
   151     DEBPRN0;
   152    	CCustomInterfaceUtility* customInterface = CCustomInterfaceUtility::NewL(aUtility);
   153     CleanupStack::PushL(customInterface);
   154 
   155 	CEnvironmentalReverbProxy* environmentalReverbProxy = (CEnvironmentalReverbProxy*)customInterface->CustomInterface(KUidEnvironmentalReverbEffect);
   156 
   157 	if ( !environmentalReverbProxy )
   158 		{
   159 		DEBPRN1("No Adaptation Support - leaving");
   160 		User::Leave(KErrNotSupported);
   161 		}
   162 
   163 	CleanupStack::Pop(customInterface);
   164 
   165     return environmentalReverbProxy;
   166 	}
   167 
   168 // -----------------------------------------------------------------------------
   169 // CEnvironmentalReverb::NewL
   170 // Static function for creating an instance of the EnvironmentalReverb object.
   171 // -----------------------------------------------------------------------------
   172 //
   173 EXPORT_C CEnvironmentalReverb* CEnvironmentalReverb::NewL(
   174 	CMdaAudioRecorderUtility& aUtility,
   175 	TBool aRecordStream )
   176 	{
   177 
   178     DEBPRN0;
   179    	CCustomInterfaceUtility* customInterface = CCustomInterfaceUtility::NewL(aUtility, aRecordStream);
   180     CleanupStack::PushL(customInterface);
   181 
   182 	CEnvironmentalReverbProxy* environmentalReverbProxy = (CEnvironmentalReverbProxy*)customInterface->CustomInterface(KUidEnvironmentalReverbEffect);
   183 
   184 	if ( !environmentalReverbProxy )
   185 		{
   186 		DEBPRN1("No Adaptation Support - leaving");
   187 		User::Leave(KErrNotSupported);
   188 		}
   189 
   190 	CleanupStack::Pop(customInterface);
   191 
   192     return environmentalReverbProxy;
   193 	}
   194 
   195 // -----------------------------------------------------------------------------
   196 // CEnvironmentalReverb::NewL
   197 // Static function for creating an instance of the EnvironmentalReverb object.
   198 // -----------------------------------------------------------------------------
   199 //
   200 EXPORT_C CEnvironmentalReverb* CEnvironmentalReverb::NewL(
   201 	CMdaAudioToneUtility& aUtility )
   202 	{
   203 
   204 	DEBPRN0;
   205     CEnvironmentalReverbProxy* environmentalReverbProxy = (CEnvironmentalReverbProxy*)aUtility.CustomInterface(KUidEnvironmentalReverbEffect);
   206 
   207 	if (environmentalReverbProxy == NULL)
   208 		{
   209         DEBPRN1("No Adaptation Support - leaving");
   210     	User::Leave(KErrNotSupported);
   211 		}
   212 
   213     return environmentalReverbProxy;
   214 	}
   215 
   216 // -----------------------------------------------------------------------------
   217 // CAudioEqualizer::NewL
   218 // Static function for creating an instance of the EnvironmentalReverb object.
   219 // -----------------------------------------------------------------------------
   220 //
   221 EXPORT_C CEnvironmentalReverb* CEnvironmentalReverb::NewL(
   222 	CMMFDevSound& aDevSound )
   223 	{
   224 
   225 	DEBPRN0;
   226     CEnvironmentalReverbProxy* environmentalReverbProxy = (CEnvironmentalReverbProxy*)aDevSound.CustomInterface(KUidEnvironmentalReverbEffect);
   227 
   228 	if (environmentalReverbProxy == NULL)
   229 		{
   230         DEBPRN1("No Adaptation Support - leaving");
   231     	User::Leave(KErrNotSupported);
   232 		}
   233 
   234     return environmentalReverbProxy;
   235 	}
   236 
   237 // -----------------------------------------------------------------------------
   238 // CEnvironmentalReverb::NewL
   239 // Static function for creating an instance of the EnvironmentalReverb object.
   240 // -----------------------------------------------------------------------------
   241 //
   242 EXPORT_C CEnvironmentalReverb* CEnvironmentalReverb::NewL(
   243 	CCustomCommandUtility* aUtility )
   244 	{
   245 
   246     DEBPRN0;
   247    	CCustomInterfaceUtility* customInterface = CCustomInterfaceUtility::NewL(aUtility);
   248     CleanupStack::PushL(customInterface);
   249 
   250 	CEnvironmentalReverbProxy* environmentalReverbProxy = (CEnvironmentalReverbProxy*)customInterface->CustomInterface(KUidEnvironmentalReverbEffect);
   251 
   252 	if ( !environmentalReverbProxy )
   253 		{
   254 		DEBPRN1("No Adaptation Support - leaving");
   255 		User::Leave(KErrNotSupported);
   256 		}
   257 
   258  	CleanupStack::Pop(customInterface);
   259 
   260     return environmentalReverbProxy;
   261 	}
   262 
   263 // -----------------------------------------------------------------------------
   264 // CEnvironmentalReverb::NewL
   265 // Static function for creating an instance of the EnvironmentalReverb object.
   266 // -----------------------------------------------------------------------------
   267 //
   268 EXPORT_C CEnvironmentalReverb* CEnvironmentalReverb::NewL(
   269 	MCustomInterface& aCustomInterface )
   270 	{
   271 
   272     DEBPRN0;
   273 	CEnvironmentalReverb* environmentalReverbProxy = (CEnvironmentalReverb*)aCustomInterface.CustomInterface(KUidEnvironmentalReverbEffect);
   274 	if ( !environmentalReverbProxy )
   275 		{
   276 		DEBPRN1("No Adaptation Support - leaving");
   277 		User::Leave(KErrNotSupported);
   278 		}
   279 
   280     return environmentalReverbProxy;
   281 	}
   282 
   283 
   284 // -----------------------------------------------------------------------------
   285 // CEnvironmentalReverb::NewL
   286 // Static function for creating an instance of the EnvironmentalReverb object.
   287 // -----------------------------------------------------------------------------
   288 //
   289 EXPORT_C CEnvironmentalReverb* CEnvironmentalReverb::NewL(CMidiClientUtility& aUtility )
   290 	{
   291 
   292     DEBPRN0;
   293    	CCustomInterfaceUtility* customInterface = CCustomInterfaceUtility::NewL(aUtility);
   294     CleanupStack::PushL(customInterface);
   295 
   296 	CEnvironmentalReverbProxy* environmentalReverbProxy = (CEnvironmentalReverbProxy*)customInterface->CustomInterface(KUidEnvironmentalReverbEffect);
   297 
   298 	if ( !environmentalReverbProxy )
   299 		{
   300 		DEBPRN1("No Adaptation Support - leaving");
   301 		User::Leave(KErrNotSupported);
   302 		}
   303 
   304 	CleanupStack::Pop(customInterface);
   305 
   306     return environmentalReverbProxy;
   307 	}
   308 
   309 // -----------------------------------------------------------------------------
   310 // CEnvironmentalReverb::NewL
   311 // Static function for creating an instance of the EnvironmentalReverb object.
   312 // -----------------------------------------------------------------------------
   313 //
   314 EXPORT_C CEnvironmentalReverb* CEnvironmentalReverb::NewL(CDrmPlayerUtility& aUtility)
   315 	{
   316 
   317     DEBPRN0;
   318    	CCustomInterfaceUtility* customInterface = CCustomInterfaceUtility::NewL(aUtility);
   319     CleanupStack::PushL(customInterface);
   320 
   321 	CEnvironmentalReverbProxy* environmentalReverbProxy = (CEnvironmentalReverbProxy*)customInterface->CustomInterface(KUidEnvironmentalReverbEffect);
   322 
   323 	if ( !environmentalReverbProxy )
   324 		{
   325 		DEBPRN1("No Adaptation Support - leaving");
   326 		User::Leave(KErrNotSupported);
   327 		}
   328 
   329 	CleanupStack::Pop(customInterface);
   330 
   331     return environmentalReverbProxy;
   332 	}
   333 
   334 // -----------------------------------------------------------------------------
   335 // CEnvironmentalReverb::NewL
   336 // Static function for creating an instance of the EnvironmentalReverb object.
   337 // -----------------------------------------------------------------------------
   338 //
   339 EXPORT_C CEnvironmentalReverb* CEnvironmentalReverb::NewL(CVideoPlayerUtility& aUtility)
   340 	{
   341 
   342     DEBPRN0;
   343    	CCustomInterfaceUtility* customInterface = CCustomInterfaceUtility::NewL(aUtility);
   344     CleanupStack::PushL(customInterface);
   345 
   346 	CEnvironmentalReverbProxy* environmentalReverbProxy = (CEnvironmentalReverbProxy*)customInterface->CustomInterface(KUidEnvironmentalReverbEffect);
   347 
   348 	if ( !environmentalReverbProxy )
   349 		{
   350 		DEBPRN1("No Adaptation Support - leaving");
   351 		User::Leave(KErrNotSupported);
   352 		}
   353 
   354 	CleanupStack::Pop(customInterface);
   355 
   356     return environmentalReverbProxy;
   357 	}
   358 
   359 // -----------------------------------------------------------------------------
   360 // CEnvironmentalReverb::DecayHFRatio
   361 // -----------------------------------------------------------------------------
   362 //
   363 EXPORT_C TUint32 CEnvironmentalReverb::DecayHFRatio() const
   364 	{
   365 	return iReverbData.iDecayHFRatio;
   366 	}
   367 
   368 // -----------------------------------------------------------------------------
   369 // CEnvironmentalReverb::DecayHFRatioRange
   370 // -----------------------------------------------------------------------------
   371 //
   372 EXPORT_C void CEnvironmentalReverb::DecayHFRatioRange(
   373 	TUint32& aMin,
   374 	TUint32& aMax )
   375 	{
   376 	aMin = iReverbData.iDecayHFRatioMin;
   377 	aMax = iReverbData.iDecayHFRatioMax;
   378 	}
   379 
   380 // -----------------------------------------------------------------------------
   381 // CEnvironmentalReverb::DecayTime
   382 // -----------------------------------------------------------------------------
   383 //
   384 EXPORT_C TUint32 CEnvironmentalReverb::DecayTime() const
   385 	{
   386 	return iReverbData.iDecayTime;
   387 	}
   388 
   389 // -----------------------------------------------------------------------------
   390 // CEnvironmentalReverb::DecayTimeRange
   391 // -----------------------------------------------------------------------------
   392 //
   393 EXPORT_C void CEnvironmentalReverb::DecayTimeRange(
   394 	TUint32& aMin,
   395 	TUint32& aMax)
   396 	{
   397 	aMin = iReverbData.iDecayTimeMin;
   398 	aMax = iReverbData.iDecayTimeMax;
   399 	}
   400 
   401 // -----------------------------------------------------------------------------
   402 // CEnvironmentalReverb::Density
   403 // -----------------------------------------------------------------------------
   404 //
   405 EXPORT_C TUint32 CEnvironmentalReverb::Density() const
   406 	{
   407 	return iReverbData.iDensity;
   408 	}
   409 
   410 // -----------------------------------------------------------------------------
   411 // CEnvironmentalReverb::Diffusion
   412 // -----------------------------------------------------------------------------
   413 //
   414 EXPORT_C TUint32 CEnvironmentalReverb::Diffusion() const
   415 	{
   416 	return iReverbData.iDiffusion;
   417 	}
   418 
   419 // -----------------------------------------------------------------------------
   420 // CEnvironmentalReverb::ReflectionsDelay
   421 // -----------------------------------------------------------------------------
   422 //
   423 EXPORT_C TUint32 CEnvironmentalReverb::ReflectionsDelay() const
   424 	{
   425 	return iReverbData.iReflectionsDelay;
   426 	}
   427 
   428 // -----------------------------------------------------------------------------
   429 // CEnvironmentalReverb::ReflectionsDelayMax
   430 // -----------------------------------------------------------------------------
   431 //
   432 EXPORT_C TUint32 CEnvironmentalReverb::ReflectionsDelayMax() const
   433 	{
   434 	return iReverbData.iReflectionsDelayMax;
   435 	}
   436 
   437 // -----------------------------------------------------------------------------
   438 // CEnvironmentalReverb::ReflectionsLevel
   439 // -----------------------------------------------------------------------------
   440 //
   441 EXPORT_C TInt32 CEnvironmentalReverb::ReflectionsLevel() const
   442 	{
   443 	return iReverbData.iReflectionsLevel;
   444 	}
   445 
   446 // -----------------------------------------------------------------------------
   447 // CEnvironmentalReverb::ReflectionLevelRange
   448 // -----------------------------------------------------------------------------
   449 //
   450 EXPORT_C void CEnvironmentalReverb::ReflectionLevelRange(
   451 	TInt32& aMin,
   452 	TInt32& aMax)
   453 	{
   454 	aMin = iReverbData.iReflectionLevelMin;
   455 	aMax = iReverbData.iReflectionLevelMax;
   456 	}
   457 
   458 // -----------------------------------------------------------------------------
   459 // CEnvironmentalReverb::ReverbDelay
   460 // -----------------------------------------------------------------------------
   461 //
   462 EXPORT_C TUint32 CEnvironmentalReverb::ReverbDelay() const
   463 	{
   464 	return iReverbData.iReverbDelay;
   465 	}
   466 
   467 // -----------------------------------------------------------------------------
   468 // CEnvironmentalReverb::ReverbDelayMax
   469 // -----------------------------------------------------------------------------
   470 //
   471 EXPORT_C TUint32 CEnvironmentalReverb::ReverbDelayMax() const
   472 	{
   473 	return iReverbData.iReverbDelayMax;
   474 	}
   475 
   476 
   477 // -----------------------------------------------------------------------------
   478 // CEnvironmentalReverb::ReverbLevel
   479 // -----------------------------------------------------------------------------
   480 //
   481 EXPORT_C TInt32 CEnvironmentalReverb::ReverbLevel() const
   482 	{
   483 	return iReverbData.iReverbLevel;
   484 	}
   485 
   486 // -----------------------------------------------------------------------------
   487 // CEnvironmentalReverb::ReverbLevelRange
   488 // -----------------------------------------------------------------------------
   489 //
   490 EXPORT_C void CEnvironmentalReverb::ReverbLevelRange(
   491 	TInt32& aMin,
   492 	TInt32& aMax)
   493 	{
   494 	aMin = iReverbData.iReverbLevelMin;
   495 	aMax = iReverbData.iReverbLevelMax;
   496 	}
   497 
   498 
   499 // -----------------------------------------------------------------------------
   500 // CEnvironmentalReverb::RoomHFLevel
   501 // -----------------------------------------------------------------------------
   502 //
   503 EXPORT_C TInt32 CEnvironmentalReverb::RoomHFLevel() const
   504 	{
   505 	return iReverbData.iRoomHFLevel;
   506 	}
   507 
   508 
   509 // -----------------------------------------------------------------------------
   510 // CEnvironmentalReverb::RoomHFLevelRange
   511 // -----------------------------------------------------------------------------
   512 //
   513 EXPORT_C void CEnvironmentalReverb::RoomHFLevelRange(
   514 	TInt32& aMin,
   515 	TInt32& aMax)
   516 	{
   517 	aMin = iReverbData.iRoomHFLevelMin;
   518 	aMax = iReverbData.iRoomHFLevelMax;
   519 	}
   520 
   521 
   522 // -----------------------------------------------------------------------------
   523 // CEnvironmentalReverb::RoomLevel
   524 // -----------------------------------------------------------------------------
   525 //
   526 EXPORT_C TInt32 CEnvironmentalReverb::RoomLevel() const
   527 
   528 	{
   529 	return iReverbData.iRoomLevel;
   530 	}
   531 
   532 
   533 // -----------------------------------------------------------------------------
   534 // CEnvironmentalReverb::RoomLevelRange
   535 // -----------------------------------------------------------------------------
   536 //
   537 EXPORT_C void CEnvironmentalReverb::RoomLevelRange(
   538 	TInt32& aMin,
   539 	TInt32& aMax)
   540 	{
   541 	aMin = iReverbData.iRoomLevelMin;
   542 	aMax = iReverbData.iRoomLevelMax;
   543 	}
   544 
   545 
   546 
   547 // -----------------------------------------------------------------------------
   548 // CEnvironmentalReverb::SetDecayHFRatioL
   549 // -----------------------------------------------------------------------------
   550 //
   551 EXPORT_C void CEnvironmentalReverb::SetDecayHFRatioL(
   552 	TUint32 aDecayHFRatio )
   553 	{
   554 	if ( (aDecayHFRatio >= iReverbData.iDecayHFRatioMin) && (aDecayHFRatio <= iReverbData.iDecayHFRatioMax) )
   555 		{
   556 		iReverbData.iDecayHFRatio = aDecayHFRatio;
   557 		}
   558 	else
   559 		{
   560 		User::Leave(KErrArgument);
   561 		}
   562 	}
   563 
   564 
   565 // -----------------------------------------------------------------------------
   566 // CEnvironmentalReverb::SetDecayTimeL
   567 // -----------------------------------------------------------------------------
   568 //
   569 EXPORT_C void CEnvironmentalReverb::SetDecayTimeL(
   570 	TUint32 aDecayTime )
   571 	{
   572 	if ( (aDecayTime >= iReverbData.iDecayTimeMin) && (aDecayTime <= iReverbData.iDecayTimeMax) )
   573 		{
   574 		iReverbData.iDecayTime = aDecayTime;
   575 		}
   576 	else
   577 		{
   578 		User::Leave(KErrArgument);
   579 		}
   580 	}
   581 
   582 
   583 // -----------------------------------------------------------------------------
   584 // CEnvironmentalReverb::SetDensityL
   585 // -----------------------------------------------------------------------------
   586 //
   587 EXPORT_C void CEnvironmentalReverb::SetDensityL(
   588 	TUint32 aDensity )
   589 	{
   590 	iReverbData.iDensity = aDensity;
   591 	}
   592 
   593 // -----------------------------------------------------------------------------
   594 // CEnvironmentalReverb::SetDiffusionL
   595 // -----------------------------------------------------------------------------
   596 //
   597 EXPORT_C void CEnvironmentalReverb::SetDiffusionL(
   598 	TUint32 aDiffusion )
   599 	{
   600 	iReverbData.iDiffusion = aDiffusion;
   601 	}
   602 
   603 
   604 // -----------------------------------------------------------------------------
   605 // CEnvironmentalReverb::SetReflectionsDelayL
   606 // -----------------------------------------------------------------------------
   607 //
   608 EXPORT_C void CEnvironmentalReverb::SetReflectionsDelayL(
   609 	TUint32 aReflectionsDelay )
   610 	{
   611 	if ( aReflectionsDelay > iReverbData.iReflectionsDelayMax )
   612 		{
   613 		User::Leave(KErrArgument);
   614 		}
   615 	else
   616 		{
   617 		iReverbData.iReflectionsDelay = aReflectionsDelay;
   618 		}
   619 	}
   620 
   621 // -----------------------------------------------------------------------------
   622 // CEnvironmentalReverb::SetReflectionsLevelL
   623 // -----------------------------------------------------------------------------
   624 //
   625 EXPORT_C void CEnvironmentalReverb::SetReflectionsLevelL(
   626 	TInt32 aReflectionsLevel )
   627 	{
   628 	if ( (aReflectionsLevel >= iReverbData.iReflectionLevelMin) && (aReflectionsLevel <= iReverbData.iReflectionLevelMax) )
   629 		{
   630 		iReverbData.iReflectionsLevel = aReflectionsLevel;
   631 		}
   632 	else
   633 		{
   634 		User::Leave(KErrArgument);
   635 		}
   636 	}
   637 
   638 // -----------------------------------------------------------------------------
   639 // CEnvironmentalReverb::SetReverbDelayL
   640 // -----------------------------------------------------------------------------
   641 //
   642 EXPORT_C void CEnvironmentalReverb::SetReverbDelayL(
   643 	TUint32 aReverbDelay )
   644 	{
   645 	if ( aReverbDelay > iReverbData.iReverbDelayMax )
   646 		{
   647 		User::Leave(KErrArgument);
   648 		}
   649 	else
   650 		{
   651 		iReverbData.iReverbDelay = aReverbDelay;
   652 		}
   653 	}
   654 
   655 
   656 // -----------------------------------------------------------------------------
   657 // CEnvironmentalReverb::SetReverbLevelL
   658 // -----------------------------------------------------------------------------
   659 //
   660 EXPORT_C void CEnvironmentalReverb::SetReverbLevelL(
   661 	TInt32 aReverbLevel )
   662 	{
   663 	if ( (aReverbLevel >= iReverbData.iReverbLevelMin) && (aReverbLevel <= iReverbData.iReverbLevelMax) )
   664 		{
   665 		iReverbData.iReverbLevel = aReverbLevel;
   666 		}
   667 	else
   668 		{
   669 		User::Leave(KErrArgument);
   670 		}
   671 	}
   672 
   673 // -----------------------------------------------------------------------------
   674 // CEnvironmentalReverb::SetRoomHFLevelL
   675 // -----------------------------------------------------------------------------
   676 //
   677 EXPORT_C void CEnvironmentalReverb::SetRoomHFLevelL(
   678 	TInt32 aRoomHFLevel )
   679 	{
   680 	if ( (aRoomHFLevel >= iReverbData.iRoomHFLevelMin) && (aRoomHFLevel <= iReverbData.iRoomHFLevelMax) )
   681 		{
   682 		iReverbData.iRoomHFLevel = aRoomHFLevel;
   683 		}
   684 	else
   685 		{
   686 		User::Leave(KErrArgument);
   687 		}
   688 	}
   689 
   690 // -----------------------------------------------------------------------------
   691 // CEnvironmentalReverb::SetRoomLevelL
   692 // -----------------------------------------------------------------------------
   693 //
   694 EXPORT_C void CEnvironmentalReverb::SetRoomLevelL(
   695 	TInt32 aRoomLevel )
   696 	{
   697 	if ( (aRoomLevel >= iReverbData.iRoomLevelMin) && (aRoomLevel <= iReverbData.iRoomLevelMax) )
   698 		{
   699 		iReverbData.iRoomLevel = aRoomLevel;
   700 		}
   701 	else
   702 		{
   703 		User::Leave(KErrArgument);
   704 		}
   705 	}
   706 
   707 // -----------------------------------------------------------------------------
   708 // CEnvironmentalReverb::DelayMax
   709 // -----------------------------------------------------------------------------
   710 //
   711 EXPORT_C TUint32 CEnvironmentalReverb::DelayMax() const
   712 	{
   713 	return iReverbData.iDelayMax;
   714 	}
   715 
   716 
   717 // -----------------------------------------------------------------------------
   718 // CEnvironmentalReverb::Uid
   719 // -----------------------------------------------------------------------------
   720 //
   721 EXPORT_C TUid CEnvironmentalReverb::Uid() const
   722 	{
   723 	return KUidEnvironmentalReverbEffect;
   724 	}
   725 
   726 
   727 // -----------------------------------------------------------------------------
   728 // CEnvironmentalReverb::DoEffectData
   729 // -----------------------------------------------------------------------------
   730 //
   731 EXPORT_C const TDesC8& CEnvironmentalReverb::DoEffectData()
   732 	{
   733     DEBPRN0;
   734 	iDataPckgTo = iReverbData;
   735 	return iDataPckgTo;
   736 	}
   737 
   738 // -----------------------------------------------------------------------------
   739 // CEnvironmentalReverb::SetEffectData
   740 // -----------------------------------------------------------------------------
   741 //
   742 EXPORT_C void CEnvironmentalReverb::SetEffectData(
   743 	const TDesC8& aEffectDataBuffer )
   744 	{
   745     DEBPRN0;
   746 	TEfEnvReverbDataPckg dataPckg;
   747 	dataPckg.Copy(aEffectDataBuffer);
   748 	iReverbData = dataPckg();
   749 	iEnabled = iReverbData.iEnabled;
   750 	iEnforced = iReverbData.iEnforced;
   751 	iHaveUpdateRights = iReverbData.iHaveUpdateRights;
   752 	}
   753 
   754 
   755 // ========================== OTHER EXPORTED FUNCTIONS =========================
   756 
   757