audiostubs/devsoundextensions_stubs/audioeffectscistubs/bassboostcistub/src/BassBoostCIStub.cpp
changeset 43 e71858845f73
parent 40 b7e5ed8c1342
child 46 e1758cbb96ac
equal deleted inserted replaced
40:b7e5ed8c1342 43:e71858845f73
     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 bassboost effect Custom Interface class
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 #ifdef _DEBUG
       
    20 #include <e32svr.h> // Needed for RDebug Prints
       
    21 #endif
       
    22 
       
    23 #include "BassBoostCI.h"
       
    24 #include <sounddevice.h>
       
    25 
       
    26 // -----------------------------------------------------------------------------
       
    27 // CBassBoost::NewL
       
    28 // Static function for creating an instance of the CBassBoostCI object.
       
    29 // -----------------------------------------------------------------------------
       
    30 //
       
    31 
       
    32 EXPORT_C CBassBoostCI* CBassBoostCI::NewL(
       
    33 	CMMFDevSound& aDevSound )
       
    34 	{
       
    35 	CBassBoostCI* self = new(ELeave) CBassBoostCI(aDevSound);
       
    36 	return self;
       
    37 	}
       
    38 
       
    39 CBassBoostCI::CBassBoostCI(
       
    40 	CMMFDevSound& aDevSound )
       
    41 	:	iDevSound(&aDevSound)
       
    42 	{
       
    43 	}
       
    44 
       
    45 // -----------------------------------------------------------------------------
       
    46 // CBassBoost::NewL
       
    47 // Static function for creating an instance of the CBassBoostCI object.
       
    48 // -----------------------------------------------------------------------------
       
    49 //
       
    50 
       
    51 EXPORT_C CBassBoostCI* CBassBoostCI::NewL()
       
    52 	{
       
    53 	CBassBoostCI* self = new(ELeave) CBassBoostCI();
       
    54 	return self;
       
    55 	}
       
    56 
       
    57 CBassBoostCI::CBassBoostCI()
       
    58 	{
       
    59 	}
       
    60 
       
    61 // Destructor
       
    62 
       
    63 CBassBoostCI::~CBassBoostCI()
       
    64 	{
       
    65 #ifdef _DEBUG
       
    66     RDebug::Print(_L("CBassBoostCI::~CBassBoostCI"));
       
    67 #endif
       
    68 	}
       
    69 
       
    70 // -----------------------------------------------------------------------------
       
    71 // CBassBoostCI::ApplyL
       
    72 //
       
    73 // Applies the bassboost settings.
       
    74 // Adaptation must check each settings and take appropriate actions since
       
    75 // this method might be called after several settings have been made.
       
    76 // -----------------------------------------------------------------------------
       
    77 //
       
    78 void CBassBoostCI::ApplyL()
       
    79 	{
       
    80 #ifdef _DEBUG
       
    81     RDebug::Print(_L("CBassBoostCI::ApplyL"));
       
    82 #endif
       
    83 
       
    84 	if ( !HaveUpdateRights() )
       
    85 		{
       
    86 		User::Leave(KErrAccessDenied);
       
    87 		}
       
    88 
       
    89 	if ( IsEnabled() )
       
    90 		{
       
    91 		}
       
    92 
       
    93 	// The effect change event is simulated by changing the bassboost and
       
    94 	// sending the observer a message indicating bassboost has changed.
       
    95 	// This is done for testing only.
       
    96 
       
    97 	// The intention of this callback is to notify the observer when the bassboost
       
    98 	// object changes spontaneously. ie the user did not change the settings but
       
    99 	// event somewhere in the system causes the bassboost object to change state.
       
   100 
       
   101 	if (iObservers.Count() > 0)
       
   102 		{
       
   103 		iObservers[0]->EffectChanged(this, (TUint8)MBassBoostObserver::KBassBoostChanged);
       
   104 		}
       
   105 	}
       
   106 
       
   107 
       
   108 // ========================== OTHER EXPORTED FUNCTIONS =========================
       
   109 
       
   110 
       
   111 
       
   112 // End of File