khronosfws/openmax_al/src/mmf_adaptation/xanokialinearvolumeitfadaptationmmf.c
author Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
Fri, 17 Sep 2010 08:33:15 +0300
changeset 52 4ce423f34688
parent 42 1fa3fb47b1e3
permissions -rw-r--r--
Revision: 201035 Kit: 201037
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
16
43d09473c595 Revision: 201017
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
     1
/*
31
8dfd592727cb Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 16
diff changeset
     2
 * Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
8dfd592727cb Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 16
diff changeset
     3
 * All rights reserved.
8dfd592727cb Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 16
diff changeset
     4
 * This component and the accompanying materials are made available
8dfd592727cb Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 16
diff changeset
     5
 * under the terms of "Eclipse Public License v1.0"
8dfd592727cb Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 16
diff changeset
     6
 * which accompanies this distribution, and is available
8dfd592727cb Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 16
diff changeset
     7
 * at the URL "http://www.eclipse.org/legal/epl-v10.html".
8dfd592727cb Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 16
diff changeset
     8
 *
8dfd592727cb Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 16
diff changeset
     9
 * Initial Contributors:
8dfd592727cb Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 16
diff changeset
    10
 * Nokia Corporation - initial contribution.
8dfd592727cb Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 16
diff changeset
    11
 *
8dfd592727cb Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 16
diff changeset
    12
 * Contributors:
8dfd592727cb Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 16
diff changeset
    13
 *
8dfd592727cb Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 16
diff changeset
    14
 * Description: Nokia Linear Volume MMF impl
8dfd592727cb Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 16
diff changeset
    15
 *
8dfd592727cb Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 16
diff changeset
    16
 */
16
43d09473c595 Revision: 201017
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    17
43d09473c595 Revision: 201017
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    18
#include "xaadaptationmmf.h"
43d09473c595 Revision: 201017
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    19
#include "xanokialinearvolumeitfadaptationmmf.h"
43d09473c595 Revision: 201017
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    20
#include "xamediaplayeradaptctxmmf.h"
43d09473c595 Revision: 201017
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    21
#include "cmmfbackendengine.h"
31
8dfd592727cb Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 16
diff changeset
    22
#include "cmmfradiobackendengine.h"
8dfd592727cb Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 16
diff changeset
    23
32
94fc26b6e006 Revision: 201025
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 31
diff changeset
    24
XAresult XANokiaLinearVolumeItfAdapt_GetVolumeLevel(XAAdaptationMMFCtx *ctx, XAuint32* percentage)
94fc26b6e006 Revision: 201025
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 31
diff changeset
    25
{
94fc26b6e006 Revision: 201025
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 31
diff changeset
    26
    XAresult res = XA_RESULT_SUCCESS;
94fc26b6e006 Revision: 201025
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 31
diff changeset
    27
    XAuint32 maxvol;
94fc26b6e006 Revision: 201025
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 31
diff changeset
    28
    XAuint32 vol;
94fc26b6e006 Revision: 201025
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 31
diff changeset
    29
    DEBUG_API("->XANokiaLinearVolumeItfAdapt_GetVolumeLevel");
94fc26b6e006 Revision: 201025
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 31
diff changeset
    30
    if(!ctx || ( ctx->baseObj.ctxId != XAMediaPlayerAdaptation &&
94fc26b6e006 Revision: 201025
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 31
diff changeset
    31
                 ctx->baseObj.ctxId != XAMediaRecorderAdaptation &&
94fc26b6e006 Revision: 201025
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 31
diff changeset
    32
                 ctx->baseObj.ctxId != XARadioAdaptation) )
94fc26b6e006 Revision: 201025
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 31
diff changeset
    33
    {
94fc26b6e006 Revision: 201025
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 31
diff changeset
    34
        DEBUG_ERR("XA_RESULT_PARAMETER_INVALID");
94fc26b6e006 Revision: 201025
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 31
diff changeset
    35
        DEBUG_API("<-XANokiaLinearVolumeItfAdapt_GetVolumeLevel");
94fc26b6e006 Revision: 201025
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 31
diff changeset
    36
        /* invalid parameter */
94fc26b6e006 Revision: 201025
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 31
diff changeset
    37
        return XA_RESULT_PARAMETER_INVALID;
94fc26b6e006 Revision: 201025
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 31
diff changeset
    38
    }
94fc26b6e006 Revision: 201025
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 31
diff changeset
    39
    
94fc26b6e006 Revision: 201025
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 31
diff changeset
    40
    if(ctx->baseObj.ctxId == XAMediaPlayerAdaptation)
94fc26b6e006 Revision: 201025
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 31
diff changeset
    41
        {
94fc26b6e006 Revision: 201025
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 31
diff changeset
    42
        mmf_volumeitf_get_maxvolume(((XAMediaPlayerAdaptationMMFCtx*)ctx)->mmfContext,
94fc26b6e006 Revision: 201025
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 31
diff changeset
    43
                                        &maxvol); 
94fc26b6e006 Revision: 201025
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 31
diff changeset
    44
		mmf_volumeitf_get_volume(((XAMediaPlayerAdaptationMMFCtx*)ctx)->mmfContext,
94fc26b6e006 Revision: 201025
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 31
diff changeset
    45
                                    &vol);
94fc26b6e006 Revision: 201025
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 31
diff changeset
    46
        
94fc26b6e006 Revision: 201025
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 31
diff changeset
    47
        *percentage = (vol * MAX_PERCENTAGE_VOLUME)/maxvol;
94fc26b6e006 Revision: 201025
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 31
diff changeset
    48
        
94fc26b6e006 Revision: 201025
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 31
diff changeset
    49
        }
42
1fa3fb47b1e3 Revision: 201031
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 32
diff changeset
    50
    else if (ctx->baseObj.ctxId == XARadioAdaptation)
1fa3fb47b1e3 Revision: 201031
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 32
diff changeset
    51
        {
1fa3fb47b1e3 Revision: 201031
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 32
diff changeset
    52
        res = get_volume(cmmfradiobackendengine_init(), &vol);
1fa3fb47b1e3 Revision: 201031
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 32
diff changeset
    53
        *percentage = vol;
1fa3fb47b1e3 Revision: 201031
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 32
diff changeset
    54
        }      
32
94fc26b6e006 Revision: 201025
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 31
diff changeset
    55
52
4ce423f34688 Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 42
diff changeset
    56
    DEBUG_API_A1("<-XANokiaLinearVolumeItfAdapt_GetVolumeLevel %d", (int)percentage);
32
94fc26b6e006 Revision: 201025
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 31
diff changeset
    57
    return res;
94fc26b6e006 Revision: 201025
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 31
diff changeset
    58
}
94fc26b6e006 Revision: 201025
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 31
diff changeset
    59
16
43d09473c595 Revision: 201017
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    60
/*
43d09473c595 Revision: 201017
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    61
 * XAresult XANokiaLinearVolumeItfAdapt_SetVolumeLevel(void *ctx, AdaptationContextIDS ctx->baseObj.ctxId,
43d09473c595 Revision: 201017
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    62
 *                                          XAuint32 percentage)
43d09473c595 Revision: 201017
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    63
 * @param void *ctx - Adaptation context, this will be casted to correct type regarding to contextID
43d09473c595 Revision: 201017
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    64
 * XAuint32 percentage - Requested volume level, in between MIN_VOLUME_LEVEL and MAX_VOLUME_LEVEL
43d09473c595 Revision: 201017
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    65
 * @return XAresult ret - Success value
43d09473c595 Revision: 201017
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    66
 */
31
8dfd592727cb Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 16
diff changeset
    67
XAresult XANokiaLinearVolumeItfAdapt_SetVolumeLevel(XAAdaptationMMFCtx *ctx,
8dfd592727cb Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 16
diff changeset
    68
        XAuint32 percentage)
8dfd592727cb Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 16
diff changeset
    69
    {
16
43d09473c595 Revision: 201017
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    70
    XAresult res = XA_RESULT_SUCCESS;
43d09473c595 Revision: 201017
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    71
    XAuint32 maxvol;
43d09473c595 Revision: 201017
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    72
    XAuint32 vol;
43d09473c595 Revision: 201017
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    73
    DEBUG_API_A1("->XANokiaLinearVolumeItfAdapt_SetVolumeLevel to: %d", percentage);
31
8dfd592727cb Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 16
diff changeset
    74
    if (!ctx || (ctx->baseObj.ctxId != XAMediaPlayerAdaptation
8dfd592727cb Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 16
diff changeset
    75
            && ctx->baseObj.ctxId != XAMediaRecorderAdaptation
8dfd592727cb Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 16
diff changeset
    76
            && ctx->baseObj.ctxId != XARadioAdaptation))
8dfd592727cb Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 16
diff changeset
    77
        {
42
1fa3fb47b1e3 Revision: 201031
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 32
diff changeset
    78
        DEBUG_ERR("XA_RESULT_PARAMETER_INVALID");
1fa3fb47b1e3 Revision: 201031
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 32
diff changeset
    79
        DEBUG_API("<-XANokiaLinearVolumeItfAdapt_SetVolumeLevel");
16
43d09473c595 Revision: 201017
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    80
        /* invalid parameter */
31
8dfd592727cb Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 16
diff changeset
    81
        res = XA_RESULT_PARAMETER_INVALID;
8dfd592727cb Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 16
diff changeset
    82
        return res;
8dfd592727cb Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 16
diff changeset
    83
        }
8dfd592727cb Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 16
diff changeset
    84
8dfd592727cb Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 16
diff changeset
    85
    if (ctx->baseObj.ctxId == XAMediaPlayerAdaptation)
16
43d09473c595 Revision: 201017
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    86
        {
31
8dfd592727cb Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 16
diff changeset
    87
        res = mmf_volumeitf_get_maxvolume(
8dfd592727cb Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 16
diff changeset
    88
                ((XAMediaPlayerAdaptationMMFCtx*) ctx)->mmfContext, &maxvol);
8dfd592727cb Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 16
diff changeset
    89
8dfd592727cb Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 16
diff changeset
    90
        if(res == XA_RESULT_SUCCESS)
8dfd592727cb Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 16
diff changeset
    91
            {
8dfd592727cb Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 16
diff changeset
    92
            vol = (percentage * maxvol) / MAX_PERCENTAGE_VOLUME;
8dfd592727cb Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 16
diff changeset
    93
            res = mmf_volumeitf_set_volume(
8dfd592727cb Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 16
diff changeset
    94
                    ((XAMediaPlayerAdaptationMMFCtx*) ctx)->mmfContext, vol);
8dfd592727cb Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 16
diff changeset
    95
            }
8dfd592727cb Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 16
diff changeset
    96
16
43d09473c595 Revision: 201017
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    97
        }
31
8dfd592727cb Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 16
diff changeset
    98
    else if (ctx->baseObj.ctxId == XARadioAdaptation)
8dfd592727cb Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 16
diff changeset
    99
        {
52
4ce423f34688 Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 42
diff changeset
   100
        res = set_volume(cmmfradiobackendengine_init(), ctx, percentage);
42
1fa3fb47b1e3 Revision: 201031
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 32
diff changeset
   101
        }
1fa3fb47b1e3 Revision: 201031
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 32
diff changeset
   102
    DEBUG_API("<-XANokiaLinearVolumeItfAdapt_SetVolumeLevel");
16
43d09473c595 Revision: 201017
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   103
    return res;
31
8dfd592727cb Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 16
diff changeset
   104
    }
16
43d09473c595 Revision: 201017
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   105
43d09473c595 Revision: 201017
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   106
XAresult XANokiaLinearVolumeItfAdapt_GetStepCount(XAAdaptationMMFCtx *ctx,
31
8dfd592727cb Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 16
diff changeset
   107
        XAuint32* stepcount)
16
43d09473c595 Revision: 201017
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   108
    {
43d09473c595 Revision: 201017
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   109
    XAresult res = XA_RESULT_SUCCESS;
31
8dfd592727cb Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 16
diff changeset
   110
    DEBUG_API("->XANokiaLinearVolumeItfAdapt_GetStepCount ");
8dfd592727cb Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 16
diff changeset
   111
    if (!ctx || (ctx->baseObj.ctxId != XAMediaPlayerAdaptation
8dfd592727cb Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 16
diff changeset
   112
            && ctx->baseObj.ctxId != XAMediaRecorderAdaptation
8dfd592727cb Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 16
diff changeset
   113
            && ctx->baseObj.ctxId != XARadioAdaptation))
8dfd592727cb Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 16
diff changeset
   114
        {
42
1fa3fb47b1e3 Revision: 201031
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 32
diff changeset
   115
        DEBUG_ERR("XA_RESULT_PARAMETER_INVALID");
1fa3fb47b1e3 Revision: 201031
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 32
diff changeset
   116
        DEBUG_API("<-XANokiaLinearVolumeItfAdapt_SetVolumeLevel");
16
43d09473c595 Revision: 201017
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   117
        /* invalid parameter */
43d09473c595 Revision: 201017
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   118
        return XA_RESULT_PARAMETER_INVALID;
31
8dfd592727cb Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 16
diff changeset
   119
        }
8dfd592727cb Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 16
diff changeset
   120
8dfd592727cb Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 16
diff changeset
   121
    if (ctx->baseObj.ctxId == XAMediaPlayerAdaptation)
8dfd592727cb Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 16
diff changeset
   122
        {
8dfd592727cb Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 16
diff changeset
   123
        res = mmf_volumeitf_get_maxvolume(
8dfd592727cb Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 16
diff changeset
   124
                ((XAMediaPlayerAdaptationMMFCtx*) ctx)->mmfContext, stepcount);
8dfd592727cb Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 16
diff changeset
   125
        }
8dfd592727cb Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 16
diff changeset
   126
8dfd592727cb Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 16
diff changeset
   127
    DEBUG_API("<-XANokiaLinearVolumeItfAdapt_GetStepCount");
8dfd592727cb Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 16
diff changeset
   128
    return res;
16
43d09473c595 Revision: 201017
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   129
    }
43d09473c595 Revision: 201017
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   130
43d09473c595 Revision: 201017
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   131
52
4ce423f34688 Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 42
diff changeset
   132