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