javauis/amms_qt/mmacontrol/inc/cammsbaseequalizercontrol.h
branchRCL_3
changeset 24 0fd27995241b
equal deleted inserted replaced
20:f9bb0fca356a 24:0fd27995241b
       
     1 /*
       
     2 * Copyright (c) 2005-2007 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:  Manipulates the equalization settings of a Player.
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 #ifndef CAMMSBASEEQUALIZERCONTROL_H
       
    20 #define CAMMSBASEEQUALIZERCONTROL_H
       
    21 
       
    22 //  INCLUDES
       
    23 #include <e32base.h>
       
    24 #include "cammseffectcontrol.h"
       
    25 
       
    26 // CONSTANTS
       
    27 _LIT(KAMMSBaseEqualizerControl, "EqualizerControl");
       
    28 const TInt KAMMSHalfOfSamplingFrequency = 24000000; //in milliHertz
       
    29 const TInt KAMMSBandOffset = 1; // Band 0 in JSR-234 equals Band 1 in Effect API
       
    30 
       
    31 // CLASS DECLARATION
       
    32 
       
    33 /**
       
    34 *
       
    35 *  Controls for the Equalizer effect.
       
    36 *
       
    37 *
       
    38 *
       
    39 *  @since 5.1
       
    40 */
       
    41 NONSHARABLE_CLASS(CAMMSBaseEqualizerControl): public CAMMSEffectControl
       
    42 {
       
    43 public:
       
    44     /**
       
    45      * Destructor.
       
    46      */
       
    47     ~CAMMSBaseEqualizerControl();
       
    48 
       
    49 public: // New functions
       
    50 
       
    51     /**
       
    52     * Gets the gain set for the given equalizer band.
       
    53     *
       
    54     * @param aBand The frequency band whose gain is asked. The numbering of
       
    55     * the bands starts from 0 and ends at (getNumberOfBands() - 1).
       
    56     *
       
    57     * @return The gain set for the given band in millibels.
       
    58     *
       
    59     * @par Leaving:
       
    60     * @li \c KErrArgument - \a aBand is out of range.
       
    61     */
       
    62     virtual TInt BandLevelL(TInt aBand) = 0;
       
    63 
       
    64     /**
       
    65     * Returns the maximum band level supported.
       
    66     *
       
    67     * @return The maximum band level in millibels.
       
    68     */
       
    69     virtual TInt MaxBandLevel() = 0;
       
    70 
       
    71     /**
       
    72     * Returns the minimum band level supported.
       
    73     *
       
    74     * @return The minimum band level in millibels.
       
    75     */
       
    76     virtual TInt MinBandLevel() = 0;
       
    77 
       
    78     /**
       
    79     * Returns the band width in Hz for the specified band.
       
    80     *
       
    81     * @param aBand The frequency band whose band width is asked.
       
    82     * The numbering of the bands starts from 0 and ends at
       
    83     * (getNumberOfBands() - 1).
       
    84     *
       
    85     * @return The band width in Hz for the specified band.
       
    86     */
       
    87     virtual TInt BandWidth(TInt aBand) = 0;
       
    88 
       
    89     /**
       
    90     * Returns the center frequency in Hz for a given band.
       
    91     *
       
    92     * @param aBand The frequency band whose center frequency
       
    93     * is asked. The numbering of
       
    94     * the bands starts from 0 and ends at (getNumberOfBands() - 1).
       
    95     *
       
    96     * @return The center frequency in Hz for a given band.
       
    97     */
       
    98     virtual TInt CenterFrequency(TInt aBand) = 0;
       
    99 
       
   100     /**
       
   101     * Returns the cross-over frequency between the given frequency
       
   102     * band (aBand) and the next band.
       
   103     *
       
   104     * @param aBand The frequency band whose gain is asked. The numbering of
       
   105     * the bands starts from 0 and ends at (getNumberOfBands() - 1).
       
   106     *
       
   107     * @return Crossover frequency.
       
   108     */
       
   109     virtual TInt CrossoverFrequency(TInt aBand) = 0;
       
   110 
       
   111     /**
       
   112     * Gets the number of frequency bands that the equalizer supports.
       
   113     *
       
   114     * @return The number of frequency bands that the equalizer supports.
       
   115     */
       
   116     virtual TInt NumberOfBands() = 0;
       
   117 
       
   118     /**
       
   119     * Sets the given equalizer band to the given gain value.
       
   120     *
       
   121     * @param aLevel The new gain in millibels that will be set to the given
       
   122     * band. getMinBandLevel() and getMaxBandLevel() will define the maximum
       
   123     * and minimum values.
       
   124     * @param aBand The frequency band that will have the new gain. The
       
   125     * numbering of the bands starts from 0 and ends at
       
   126     * (getNumberOfBands() - 1).
       
   127     *
       
   128     * @par Leaving:
       
   129     * @li \c KErrArgument - \a aBand or \a aLevel is out of range.
       
   130     */
       
   131     virtual void SetBandLevelL(TInt aLevel, TInt aBand) = 0;
       
   132 
       
   133 public:
       
   134     virtual const TDesC& ClassName() const = 0;
       
   135 
       
   136 protected:
       
   137     /**
       
   138     * C++ constructor.
       
   139     * @param aPlayer Player that has this control.
       
   140     */
       
   141     CAMMSBaseEqualizerControl(CMMAPlayer* aPlayer);
       
   142 
       
   143 };
       
   144 
       
   145 #endif // CAMMSBASEEQUALIZERCONTROL_H
       
   146 
       
   147