javauis/amms_akn/mmacontrol/inc/cammsbasereverbcontrol.h
branchRCL_3
changeset 19 04becd199f91
equal deleted inserted replaced
16:f5050f1da672 19:04becd199f91
       
     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:  Manipulates the settings of an audio effect called reverb.
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 #ifndef CAMMSBASEREVERBCONTROL_H
       
    20 #define CAMMSBASEREVERBCONTROL_H
       
    21 
       
    22 //  INCLUDES
       
    23 #include <e32base.h>
       
    24 #include <EnvironmentalReverbBase.h>
       
    25 #include <EnvironmentalReverbUtility.h>
       
    26 #include <CustomCommandUtility.h>
       
    27 #include "cammseffectcontrol.h"
       
    28 // only require if platform support EMC
       
    29 #ifdef RD_JAVA_HTTP_EMC_ENABLED
       
    30 #include <ReverbControl.h>
       
    31 #endif
       
    32 // CONSTANTS
       
    33 _LIT(KAMMSBaseReverbControl, "ReverbControl");
       
    34 _LIT(KAMMSBaseDefaultReverbPreset, "smallroom");
       
    35 
       
    36 // only require if platform support EMC
       
    37 #ifdef RD_JAVA_HTTP_EMC_ENABLED
       
    38 using multimedia :: MReverbControl;
       
    39 #endif
       
    40 // CLASS DECLARATION
       
    41 
       
    42 /**
       
    43 *
       
    44 *  Controls for the Reverb effect.
       
    45 *  This class delegates Reverb effect method calls to CReverb.
       
    46 *
       
    47 *
       
    48 *  @since 5.1
       
    49 */
       
    50 NONSHARABLE_CLASS(CAMMSBaseReverbControl): public CAMMSEffectControl
       
    51 {
       
    52 public:  // destructor
       
    53 
       
    54     /**
       
    55     * Destructor.
       
    56     */
       
    57     ~CAMMSBaseReverbControl();
       
    58 
       
    59 public:  // New functions
       
    60 
       
    61     /**
       
    62     * Sets the gain level of the reverberation. The value defines what is
       
    63     * the relative level of the first reflections compared to the sound
       
    64     * source without possible distance attenuations, directivities or
       
    65     * obstructions taken into account.
       
    66     *
       
    67     * @param aLevel The new level of the reverberation in millibels.
       
    68     *
       
    69     * @return The value that was actually set.
       
    70     *
       
    71     * @par Leaving:
       
    72     * @li \c KErrArgument - \a aLevel is greater than 0
       
    73     */
       
    74     virtual TInt SetReverbLevelL(TInt aLevel) = 0;
       
    75 
       
    76     /**
       
    77     * Sets the reverberation time of the reverb. The reverberation time is
       
    78     * the time taken for the reverberant sound to attenuate by 60 dB from
       
    79     * its initial level. Typical values are in the range from 100 to 20000
       
    80     * milliseconds.
       
    81     * The implementation might not support long reverberation times.
       
    82     * Therefore, the actual time used might be shorter than the time
       
    83     * specified with this method.
       
    84     *
       
    85     * @param aTime The new reverberation time in milliseconds.
       
    86     *
       
    87     * @return The value that was actually set.
       
    88     *
       
    89     * @par Leaving:
       
    90     * @li \c KErrArgument - \a aTime is negative.
       
    91     * From Java API more leave codes are:
       
    92     * - java.lang.IllegalArgumentException - when the given time is
       
    93     * negative
       
    94     * - javax.microedition.media.MediaException - when the changing of the
       
    95     * reverb time is not supported
       
    96     */
       
    97     virtual void SetReverbTimeL(TInt aTime) = 0;
       
    98 
       
    99     /**
       
   100     * Gets the gain level of the reverberation.
       
   101     *
       
   102     * @return The level of the reverberation in millibels.
       
   103     */
       
   104     virtual TInt ReverbLevel() = 0;
       
   105 
       
   106     /**
       
   107     * Gets the reverberation time.
       
   108     *
       
   109     * @return The time of the reverberation in milliseconds.
       
   110     */
       
   111     virtual TInt ReverbTime() = 0;
       
   112 
       
   113     /**
       
   114     * Gets the minimum level of the reverberation.
       
   115     *
       
   116     * @return The minimum level of the reverberation in millibels.
       
   117     */
       
   118     virtual TInt MinReverbLevel() = 0;
       
   119 
       
   120     /**
       
   121     * Gets the maximum level of the reverberation.
       
   122     *
       
   123     * @return The maximum level of the reverberation in millibels.
       
   124     */
       
   125     virtual TInt MaxReverbLevel() = 0;
       
   126 
       
   127     /**
       
   128     * Gets the current preset index.
       
   129     *
       
   130     */
       
   131     virtual TInt CurrentPresetIndex() = 0;
       
   132 
       
   133 public:
       
   134 
       
   135     virtual const TDesC& ClassName() const = 0;
       
   136 
       
   137 
       
   138 public:  // Functions needed by reverb source control
       
   139 
       
   140     /**
       
   141      * Returns the environmental reverb utility.
       
   142      * ReverbSourceControl has to use the same instance.
       
   143      * The function creates the instance if they do not exist yet.
       
   144      *
       
   145      * @param aEnvironmentalReverbUtility Returned utility instance.
       
   146      */
       
   147     virtual void GetEnvironmentalReverbUtilityL(
       
   148         CEnvironmentalReverbUtility** aEnvironmentalReverbUtility);
       
   149     // only require if platform support EMC
       
   150 #ifdef RD_JAVA_HTTP_EMC_ENABLED
       
   151     virtual MReverbControl* GetReverbControlL();
       
   152 #endif
       
   153 protected:
       
   154     /**
       
   155     * C++ constructor.
       
   156     * @param aPlayer Player that has this control.
       
   157     */
       
   158     CAMMSBaseReverbControl(CMMAPlayer* aPlayer);
       
   159 
       
   160 
       
   161 };
       
   162 
       
   163 #endif // CAMMSBASEREVERBCONTROL_H
       
   164 
       
   165