javauis/amms_akn/jni/src/volumecontrol.cpp
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:
       
    15 *
       
    16 */
       
    17 
       
    18 #include <jutils.h>
       
    19 #include <jdebug.h>
       
    20 
       
    21 #include <cmmaeventsource.h>
       
    22 
       
    23 // Generated JNI header.
       
    24 #include "com_nokia_amms_control_VolumeControl.h"
       
    25 
       
    26 #include "cammsvolumecontrolgroup.h"
       
    27 
       
    28 /**
       
    29  * Calls CAMMSVolumeControlGroup::SetLevelL method.
       
    30  * @param aVolumeControl CAMMSVolumeControlGroup instance.
       
    31  * @param aLevel Level to set.
       
    32  */
       
    33 LOCAL_C void SetVolumeL(CAMMSVolumeControlGroup* aVolumeControl, TInt aLevel)
       
    34 {
       
    35     aVolumeControl->SetVolumeL(aLevel);
       
    36 }
       
    37 
       
    38 /**
       
    39  * JNI function.
       
    40  */
       
    41 JNIEXPORT jint JNICALL Java_com_nokia_amms_control_VolumeControl__1setLevel
       
    42 (JNIEnv* /*aJniEnv*/,
       
    43  jclass,
       
    44  jint aEventSourceHandle,
       
    45  jint aControlHandle,
       
    46  jint aVolume)
       
    47 {
       
    48     DEBUG_INT("AMMS::VolumeControl.cpp::setLevel level = %d", aVolume);
       
    49     CMMAEventSource* eventSource =
       
    50         JavaUnhand< CMMAEventSource >(aEventSourceHandle);
       
    51 
       
    52     CAMMSVolumeControlGroup* control =
       
    53         JavaUnhand< CAMMSVolumeControlGroup >(aControlHandle);
       
    54 
       
    55     // call CAMMSVolumeControlGroup::SetVolumeL through local SetVolumeL function.
       
    56     return eventSource->ExecuteTrap(&SetVolumeL,
       
    57                                     control,
       
    58                                     aVolume);
       
    59 }
       
    60 
       
    61 //  End of File
       
    62 
       
    63 
       
    64