javauis/amms_qt/mmacontrol/inc/cammsdistanceattenuationcontrol.h
branchRCL_3
changeset 24 0fd27995241b
equal deleted inserted replaced
20:f9bb0fca356a 24:0fd27995241b
       
     1 /*
       
     2 * Copyright (c) 2005 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:  Controls how the sound is attenuated with its distance.
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 #ifndef CAMMSDISTANCEATTENUATIONCONTROL_H
       
    20 #define CAMMSDISTANCEATTENUATIONCONTROL_H
       
    21 
       
    22 //  INCLUDES
       
    23 #include <e32base.h>
       
    24 #include <DistanceAttenuationBase.h>
       
    25 #include <CustomCommandUtility.h>
       
    26 #include "cammsbasedistanceattenuationcontrol.h"
       
    27 
       
    28 // CONSTANTS
       
    29 _LIT(KAMMSDistanceAttenuationControl, "DistanceAttenuationControl");
       
    30 
       
    31 // CLASS DECLARATION
       
    32 
       
    33 /**
       
    34 *
       
    35 *  Controls for the Distance Attenuation effect.
       
    36 *  This class delegates Distance Attenuation effect method calls to
       
    37 *  CDistanceAttenuation.
       
    38 *
       
    39 *
       
    40 *  @since 3.0
       
    41 */
       
    42 NONSHARABLE_CLASS(CAMMSDistanceAttenuationControl): public CAMMSBaseDistanceAttenuationControl
       
    43 {
       
    44 public:  // Constructors and destructor
       
    45 
       
    46     /**
       
    47     * Two-phased constructor.
       
    48     * @param aPlayer Player that has this control.
       
    49     */
       
    50     static CAMMSDistanceAttenuationControl* NewLC(CMMAPlayer* aPlayer);
       
    51 
       
    52     /**
       
    53     * Destructor.
       
    54     */
       
    55     ~CAMMSDistanceAttenuationControl();
       
    56 
       
    57 public: // override base class functions
       
    58 
       
    59     /**
       
    60     * Sets all the 3D audio distance attenuation parameters simultaneously.
       
    61     * Distances are specified in units defined by
       
    62     * "GlobalManager.getUnitsPerMeter()"
       
    63     *
       
    64     * @param aMinDistance The minimum distance, below which the distance
       
    65     * gain is clipped to its maximum value of 1.0.
       
    66     * @param aMaxDistance The maximum distance, beyond which the distance
       
    67     * gain does not decrease any more. The exact behaviour of the gain at
       
    68     * distances beyond the maximum distance depends on the value of the
       
    69     * muteAfterMax.
       
    70     * @param aMuteAfterMax A boolean determining how the distance gain
       
    71     * behaves at distances greater than maxDistance: true if beyond the
       
    72     * maximum distance the source is silent; false if beyond the maximum
       
    73     * distance the source's gain is held constant at the level at the
       
    74     * maximum distance.
       
    75     * @param aRolloffFactor The rolloff factor, specified in thousandths
       
    76     * (1000 representing a rolloff factor of 1.0, 2000 representing 2.0 and
       
    77     * 500 representing 0.5). Higher values cause the distance gain to
       
    78     * attenuate more quickly.
       
    79     * @return The value that was actually set.
       
    80     *
       
    81     * @par Leaving:
       
    82     * @li \c KErrArgument - \a aMaxDistance <= \a aMinDistance,
       
    83     * \a aMinDistance <= 0, \a aMaxDistance <= 0 or \a aRolloffFactor < 0
       
    84     */
       
    85     void SetParametersL(
       
    86         TInt aMinDistance,
       
    87         TInt aMaxDistance,
       
    88         TBool aMuteAfterMax,
       
    89         TInt aRolloffFactor);
       
    90 
       
    91 public: // Functions from base classes
       
    92     const TDesC& ClassName() const;
       
    93 
       
    94     /**
       
    95     * Prepares the Control.
       
    96     */
       
    97     void PrepareControlL();
       
    98 
       
    99     /**
       
   100     * Deallocates the Control.
       
   101     */
       
   102     void DeallocateControl();
       
   103 
       
   104 private:
       
   105     /**
       
   106     * C++ constructor.
       
   107     * @param aPlayer Player that has this control.
       
   108     */
       
   109     CAMMSDistanceAttenuationControl(CMMAPlayer* aPlayer);
       
   110 
       
   111 private:  // Data
       
   112 
       
   113     /** Native distance attenuation */
       
   114     CDistanceAttenuation* iDistanceAttenuation;
       
   115 
       
   116 
       
   117 };
       
   118 
       
   119 #endif // CAMMSDISTANCEATTENUATIONCONTROL_H
       
   120 
       
   121