javauis/amms_qt/jni/src/reverbcontrol.cpp
changeset 23 98ccebc37403
child 26 dc7c549001d5
equal deleted inserted replaced
21:2a9601315dfc 23:98ccebc37403
       
     1 /*
       
     2 * Copyright (c) 2002 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:
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 //#include <jutils.h>
       
    20 
       
    21 #include "com_nokia_amms_control_audioeffect_ReverbControl.h"
       
    22 #include <mmafunctionserver.h>
       
    23 #include "cammsreverbcontrolgroup.h"
       
    24 
       
    25 /**
       
    26  * wrapper for CAMMSReverbControlGroup::SetReverbLevelL()
       
    27  */
       
    28 static void SetReverbLevelL(
       
    29     CAMMSReverbControlGroup* aControl,
       
    30     TInt *aLevel)
       
    31 {
       
    32     aControl->SetReverbLevelL(*aLevel);
       
    33     *aLevel = aControl->ReverbLevel();
       
    34 }
       
    35 
       
    36 /**
       
    37  * wrapper for CAMMSReverbControlGroup::SetReverbLevelL()
       
    38  */
       
    39 static void SetReverbTimeL(
       
    40     CAMMSReverbControlGroup* aControl,
       
    41     TInt aTime)
       
    42 {
       
    43     aControl->SetReverbTimeL(aTime);
       
    44 }
       
    45 
       
    46 /*
       
    47  * Class:     com_nokia_amms_control_audioeffect_ReverbControl
       
    48  * Method:    _getReverbLevel
       
    49  * Signature: (II)I
       
    50  */
       
    51 JNIEXPORT jint JNICALL Java_com_nokia_amms_control_audioeffect_ReverbControl__1getReverbLevel(
       
    52     JNIEnv*,
       
    53     jclass,
       
    54     jint aEventSource,
       
    55     jint aControl)
       
    56 {
       
    57     CAMMSReverbControlGroup* control = static_cast< CAMMSReverbControlGroup* >(
       
    58                                            reinterpret_cast< CAMMSControlGroup* >(aControl));
       
    59 
       
    60     return control->ReverbLevel();
       
    61 }
       
    62 
       
    63 /*
       
    64  * Class:     com_nokia_amms_control_audioeffect_ReverbControl
       
    65  * Method:    _getReverbTime
       
    66  * Signature: (II)I
       
    67  */
       
    68 JNIEXPORT jint JNICALL Java_com_nokia_amms_control_audioeffect_ReverbControl__1getReverbTime(
       
    69     JNIEnv*, jclass, jint aEventSource, jint aControl)
       
    70 {
       
    71     CAMMSReverbControlGroup* control = static_cast< CAMMSReverbControlGroup* >(
       
    72                                            reinterpret_cast< CAMMSControlGroup *>(aControl));
       
    73 
       
    74     return control->ReverbTime();
       
    75 }
       
    76 
       
    77 /*
       
    78  * Class:     com_nokia_amms_control_audioeffect_ReverbControl
       
    79  * Method:    _setReverbTime
       
    80  * Signature: (III)I
       
    81  */
       
    82 JNIEXPORT jint JNICALL Java_com_nokia_amms_control_audioeffect_ReverbControl__1setReverbTime(
       
    83     JNIEnv*,
       
    84     jclass,
       
    85     jint aEventSource,
       
    86     jint aControl,
       
    87     jint aTime)
       
    88 {
       
    89     MMAFunctionServer* eventSource =
       
    90         reinterpret_cast< MMAFunctionServer *>(aEventSource);
       
    91 
       
    92     CAMMSReverbControlGroup* control = static_cast< CAMMSReverbControlGroup* >(
       
    93                                            reinterpret_cast< CAMMSControlGroup* >(aControl));
       
    94 
       
    95     TInt error;
       
    96     error = eventSource->ExecuteTrap(SetReverbTimeL, control, (TInt) aTime);
       
    97     return error;
       
    98 }
       
    99 
       
   100 /*
       
   101  * Class:     com_nokia_amms_control_audioeffect_ReverbControl
       
   102  * Method:    _setReverbLevel
       
   103  * Signature: (III)I
       
   104  */
       
   105 JNIEXPORT jint JNICALL Java_com_nokia_amms_control_audioeffect_ReverbControl__1setReverbLevel(
       
   106     JNIEnv* aJniEnv,
       
   107     jclass,
       
   108     jint aEventSource,
       
   109     jint aControl,
       
   110     jint aLevel,
       
   111     jintArray aError)
       
   112 {
       
   113     MMAFunctionServer* eventSource =
       
   114         reinterpret_cast< MMAFunctionServer* >(aEventSource);
       
   115 
       
   116     CAMMSReverbControlGroup* control = static_cast< CAMMSReverbControlGroup* >(
       
   117                                            reinterpret_cast< CAMMSControlGroup* >(aControl));
       
   118 
       
   119     TInt error;
       
   120     TInt level = aLevel;
       
   121 
       
   122     error = eventSource->ExecuteTrap(
       
   123                 SetReverbLevelL,
       
   124                 control,
       
   125                 (TInt *) &level);
       
   126 
       
   127     jint javaError[ 1 ] = { error };
       
   128     aJniEnv->SetIntArrayRegion(aError, 0, 1, javaError);
       
   129 
       
   130     return level;
       
   131 }
       
   132 
       
   133 
       
   134 //  End of File