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