javauis/amms_akn/mmacontrol/inc/cammseffectcontrol.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:  Controls an abstract filter with various preset settings.
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 #ifndef CAMMSEFFECTCONTROL_H
       
    20 #define CAMMSEFFECTCONTROL_H
       
    21 
       
    22 //  INCLUDES
       
    23 #include <e32base.h>
       
    24 #include <badesca.h>
       
    25 #include <AudioEffectBase.h>
       
    26 #include "cammscontrol.h"
       
    27 
       
    28 // CLASS DECLARATION
       
    29 
       
    30 /**
       
    31 *
       
    32 *  Controls for the audio effect control.
       
    33 *  This class delegates Audio Effect method calls to native
       
    34 *  audio effect (created either in CAMMSEqualizerControl or
       
    35 *  in CAMMSReverbControl).
       
    36 *
       
    37 *
       
    38 *  @since 3.0
       
    39 */
       
    40 NONSHARABLE_CLASS(CAMMSEffectControl): public CAMMSControl
       
    41 {
       
    42 public:  // Constructors and destructor
       
    43     /**
       
    44     * Destructor.
       
    45     */
       
    46     ~CAMMSEffectControl();
       
    47 
       
    48 public: // New functions
       
    49     /**
       
    50     * Sets the effect according to the given preset.
       
    51     *
       
    52     * @param aPreset The new preset that will be taken into use.
       
    53     *
       
    54     * @par Leaving:
       
    55     * @li \c KErrArgument - \a aPreset is not available or it is null.
       
    56     */
       
    57     virtual void SetPresetL(const TDesC& aPreset) = 0;
       
    58 
       
    59     /**
       
    60     * Gets the available preset names.
       
    61     *
       
    62     * @return The names of all the available preset modes.
       
    63     */
       
    64     virtual const CDesCArray& PresetNamesL() = 0;
       
    65 
       
    66     /**
       
    67     * Gets the current preset.
       
    68     *
       
    69     * @return The preset that is set at the moment. If none of the presets
       
    70     * is set, null will be returned.
       
    71     */
       
    72     virtual const TDesC& PresetL() = 0;
       
    73 
       
    74     /**
       
    75     * Enables/disables the effect.
       
    76     *
       
    77     * @param aEnabled The boolean value, true=enabled, false=disabled.
       
    78     *
       
    79     * @par Leaving:
       
    80     * From Java API the leave codes are:
       
    81     * - java.lang.IllegalStateException - if the effect cannot be enabled
       
    82     * in this state of the player.
       
    83     * - javax.microedition.media.MediaException - if enabling is not
       
    84     * supported (with the scope set).
       
    85     */
       
    86     virtual void SetEnabledL(TBool aEnable) = 0;
       
    87 
       
    88 //Making the following funcitons virtual because of EMC added functionalities
       
    89     /**
       
    90     * Enforces the effect to be in use. If this is an EffectControl of a
       
    91     * MediaProcessor, the enforced setting does not affect in any way.
       
    92     *
       
    93     * @param aPreset The boolean value - true if the effect is essential
       
    94     * and cannot be dropped, false if the effect can be dropped if the
       
    95     * system runs out of resources.
       
    96     *
       
    97     * @par Leaving:
       
    98     * @li \c KErrArgument - some error happened.
       
    99     */
       
   100     virtual void SetEnforcedL(TBool aEnforced);
       
   101 
       
   102     /**
       
   103     * Returns the current enforced setting of the effect.
       
   104     *
       
   105     * @return The boolean, true if the effect is an enforced effect, false
       
   106     * if not.
       
   107     */
       
   108     virtual TBool Enforced();
       
   109 
       
   110     /**
       
   111     * Sets the scope of the effect. If this is an EffectControl of the
       
   112     * MediaProcessor, the scope setting does not affect in anything.
       
   113     *
       
   114     * @param aScope SCOPE_LIVE_ONLY, SCOPE_RECORD_ONLY or
       
   115     * SCOPE_LIVE_AND_RECORD.
       
   116     *
       
   117     * @par Leaving:
       
   118     * From Java API the leave codes are:
       
   119     * - javax.microedition.media.MediaException - if the given scope is
       
   120     * not supported
       
   121     */
       
   122     virtual void SetScopeL(TInt aScope);
       
   123 
       
   124     /**
       
   125     * Returns the scope in which the effect is present.
       
   126     *
       
   127     * @return SCOPE_LIVE_ONLY, SCOPE_RECORD_ONLY or SCOPE_LIVE_AND_RECORD.
       
   128     */
       
   129     virtual TInt Scope();
       
   130 
       
   131 protected:
       
   132     /**
       
   133     * C++ default constructor.
       
   134     * @param aPlayer Player that has this control.
       
   135     */
       
   136     CAMMSEffectControl(CMMAPlayer* aPlayer);
       
   137 
       
   138 protected:
       
   139     /**
       
   140     * Apply changed settings if Effect is in enabled state.
       
   141     */
       
   142     virtual void ApplySettingsL();
       
   143 
       
   144 protected:
       
   145     /**
       
   146     * By default Symbian 2nd phase constructor is private,
       
   147     * but allow now the base class to access ConstructL.
       
   148     */
       
   149     void ConstructL();
       
   150 
       
   151 protected: // Data
       
   152 
       
   153     /* Native audio effect */
       
   154     CAudioEffect* iAudioEffect;
       
   155 
       
   156 };
       
   157 
       
   158 #endif // CAMMSEFFECTCONTROL_H
       
   159 
       
   160