devsoundextensions/mmfcustominterfaces/WmaDecoderIntfc/WmaDecoderIntfcProxy/src/WmaDecoderIntfcProxy.cpp
author hgs
Tue, 02 Nov 2010 12:13:59 +0000
changeset 5 b220a9341636
parent 0 b8ed18f6c07b
permissions -rw-r--r--
2010wk46_01
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
0
b8ed18f6c07b 2010wk40
hgs
parents:
diff changeset
     1
/*
b8ed18f6c07b 2010wk40
hgs
parents:
diff changeset
     2
* Copyright (c) 2006 Nokia Corporation and/or its subsidiary(-ies). 
b8ed18f6c07b 2010wk40
hgs
parents:
diff changeset
     3
* All rights reserved.
b8ed18f6c07b 2010wk40
hgs
parents:
diff changeset
     4
* This component and the accompanying materials are made available
b8ed18f6c07b 2010wk40
hgs
parents:
diff changeset
     5
* under the terms of "Eclipse Public License v1.0"
b8ed18f6c07b 2010wk40
hgs
parents:
diff changeset
     6
* which accompanies this distribution, and is available
b8ed18f6c07b 2010wk40
hgs
parents:
diff changeset
     7
* at the URL "http://www.eclipse.org/legal/epl-v10.html".
b8ed18f6c07b 2010wk40
hgs
parents:
diff changeset
     8
*
b8ed18f6c07b 2010wk40
hgs
parents:
diff changeset
     9
* Initial Contributors:
b8ed18f6c07b 2010wk40
hgs
parents:
diff changeset
    10
* Nokia Corporation - initial contribution.
b8ed18f6c07b 2010wk40
hgs
parents:
diff changeset
    11
*
b8ed18f6c07b 2010wk40
hgs
parents:
diff changeset
    12
* Contributors:
b8ed18f6c07b 2010wk40
hgs
parents:
diff changeset
    13
*
b8ed18f6c07b 2010wk40
hgs
parents:
diff changeset
    14
* Description:   Interface proxy for WMA Decoder CI.
b8ed18f6c07b 2010wk40
hgs
parents:
diff changeset
    15
*
b8ed18f6c07b 2010wk40
hgs
parents:
diff changeset
    16
*/
b8ed18f6c07b 2010wk40
hgs
parents:
diff changeset
    17
b8ed18f6c07b 2010wk40
hgs
parents:
diff changeset
    18
b8ed18f6c07b 2010wk40
hgs
parents:
diff changeset
    19
b8ed18f6c07b 2010wk40
hgs
parents:
diff changeset
    20
// INCLUDE FILES
b8ed18f6c07b 2010wk40
hgs
parents:
diff changeset
    21
#include <CustomCommandUtility.h>
b8ed18f6c07b 2010wk40
hgs
parents:
diff changeset
    22
#include <CustomInterfaceUtility.h>
b8ed18f6c07b 2010wk40
hgs
parents:
diff changeset
    23
#include "WmaDecoderIntfcMsgs.h"
b8ed18f6c07b 2010wk40
hgs
parents:
diff changeset
    24
#include "WmaDecoderIntfcProxy.h"
b8ed18f6c07b 2010wk40
hgs
parents:
diff changeset
    25
b8ed18f6c07b 2010wk40
hgs
parents:
diff changeset
    26
// EXTERNAL DATA STRUCTURES
b8ed18f6c07b 2010wk40
hgs
parents:
diff changeset
    27
b8ed18f6c07b 2010wk40
hgs
parents:
diff changeset
    28
// EXTERNAL FUNCTION PROTOTYPES
b8ed18f6c07b 2010wk40
hgs
parents:
diff changeset
    29
b8ed18f6c07b 2010wk40
hgs
parents:
diff changeset
    30
// CONSTANTS
b8ed18f6c07b 2010wk40
hgs
parents:
diff changeset
    31
b8ed18f6c07b 2010wk40
hgs
parents:
diff changeset
    32
// MACROS
b8ed18f6c07b 2010wk40
hgs
parents:
diff changeset
    33
b8ed18f6c07b 2010wk40
hgs
parents:
diff changeset
    34
// LOCAL CONSTANTS AND MACROS
b8ed18f6c07b 2010wk40
hgs
parents:
diff changeset
    35
b8ed18f6c07b 2010wk40
hgs
parents:
diff changeset
    36
// MODULE DATA STRUCTURES
b8ed18f6c07b 2010wk40
hgs
parents:
diff changeset
    37
b8ed18f6c07b 2010wk40
hgs
parents:
diff changeset
    38
// LOCAL FUNCTION PROTOTYPES
b8ed18f6c07b 2010wk40
hgs
parents:
diff changeset
    39
b8ed18f6c07b 2010wk40
hgs
parents:
diff changeset
    40
// FORWARD DECLARATIONS
b8ed18f6c07b 2010wk40
hgs
parents:
diff changeset
    41
b8ed18f6c07b 2010wk40
hgs
parents:
diff changeset
    42
// ============================= LOCAL FUNCTIONS ===============================
b8ed18f6c07b 2010wk40
hgs
parents:
diff changeset
    43
b8ed18f6c07b 2010wk40
hgs
parents:
diff changeset
    44
// ============================= MEMBER FUNCTIONS ==============================
b8ed18f6c07b 2010wk40
hgs
parents:
diff changeset
    45
b8ed18f6c07b 2010wk40
hgs
parents:
diff changeset
    46
//------------------------------------------------------------------------------
b8ed18f6c07b 2010wk40
hgs
parents:
diff changeset
    47
// CWmaDecoderIntfcProxy::CWmaDecoderIntfcProxy
b8ed18f6c07b 2010wk40
hgs
parents:
diff changeset
    48
// C++ default constructor can NOT contain any code, that might leave.
b8ed18f6c07b 2010wk40
hgs
parents:
diff changeset
    49
//------------------------------------------------------------------------------
b8ed18f6c07b 2010wk40
hgs
parents:
diff changeset
    50
CWmaDecoderIntfcProxy::CWmaDecoderIntfcProxy(
b8ed18f6c07b 2010wk40
hgs
parents:
diff changeset
    51
                            TMMFMessageDestinationPckg aMessageHandler,
b8ed18f6c07b 2010wk40
hgs
parents:
diff changeset
    52
                            MCustomCommand& aCustomCommand,
b8ed18f6c07b 2010wk40
hgs
parents:
diff changeset
    53
                            CCustomInterfaceUtility* aCustomInterfaceUtility) :
b8ed18f6c07b 2010wk40
hgs
parents:
diff changeset
    54
    iCustomCommand(aCustomCommand),
b8ed18f6c07b 2010wk40
hgs
parents:
diff changeset
    55
    iMessageHandler(aMessageHandler),
b8ed18f6c07b 2010wk40
hgs
parents:
diff changeset
    56
    iCustomInterfaceUtility(aCustomInterfaceUtility)
b8ed18f6c07b 2010wk40
hgs
parents:
diff changeset
    57
    {
b8ed18f6c07b 2010wk40
hgs
parents:
diff changeset
    58
    }
b8ed18f6c07b 2010wk40
hgs
parents:
diff changeset
    59
b8ed18f6c07b 2010wk40
hgs
parents:
diff changeset
    60
//------------------------------------------------------------------------------
b8ed18f6c07b 2010wk40
hgs
parents:
diff changeset
    61
// CWmaDecoderIntfcProxy::ConstructL
b8ed18f6c07b 2010wk40
hgs
parents:
diff changeset
    62
// Symbian 2nd phase constructor can leave.
b8ed18f6c07b 2010wk40
hgs
parents:
diff changeset
    63
//------------------------------------------------------------------------------
b8ed18f6c07b 2010wk40
hgs
parents:
diff changeset
    64
void CWmaDecoderIntfcProxy::ConstructL()
b8ed18f6c07b 2010wk40
hgs
parents:
diff changeset
    65
    {
b8ed18f6c07b 2010wk40
hgs
parents:
diff changeset
    66
    iToolOutPut32Bit = EFalse;
b8ed18f6c07b 2010wk40
hgs
parents:
diff changeset
    67
    iToolDownMixToStereo = ETrue;
b8ed18f6c07b 2010wk40
hgs
parents:
diff changeset
    68
    iToolLostDataConcealment = EFalse;
b8ed18f6c07b 2010wk40
hgs
parents:
diff changeset
    69
	iParametersSameAsAdaptation = EFalse;
b8ed18f6c07b 2010wk40
hgs
parents:
diff changeset
    70
    }
b8ed18f6c07b 2010wk40
hgs
parents:
diff changeset
    71
b8ed18f6c07b 2010wk40
hgs
parents:
diff changeset
    72
//------------------------------------------------------------------------------
b8ed18f6c07b 2010wk40
hgs
parents:
diff changeset
    73
// CWmaDecoderIntfcProxy::NewL
b8ed18f6c07b 2010wk40
hgs
parents:
diff changeset
    74
// Two-phased constructor.
b8ed18f6c07b 2010wk40
hgs
parents:
diff changeset
    75
//------------------------------------------------------------------------------
b8ed18f6c07b 2010wk40
hgs
parents:
diff changeset
    76
EXPORT_C CWmaDecoderIntfcProxy* CWmaDecoderIntfcProxy::NewL(
b8ed18f6c07b 2010wk40
hgs
parents:
diff changeset
    77
                              TMMFMessageDestinationPckg aMessageHandler,
b8ed18f6c07b 2010wk40
hgs
parents:
diff changeset
    78
                              MCustomCommand& aCustomCommand,
b8ed18f6c07b 2010wk40
hgs
parents:
diff changeset
    79
                              CCustomInterfaceUtility* aCustomInterfaceUtility)
b8ed18f6c07b 2010wk40
hgs
parents:
diff changeset
    80
    {
b8ed18f6c07b 2010wk40
hgs
parents:
diff changeset
    81
    CWmaDecoderIntfcProxy* self = new(ELeave) CWmaDecoderIntfcProxy(
b8ed18f6c07b 2010wk40
hgs
parents:
diff changeset
    82
                                                   aMessageHandler,
b8ed18f6c07b 2010wk40
hgs
parents:
diff changeset
    83
                                                   aCustomCommand,
b8ed18f6c07b 2010wk40
hgs
parents:
diff changeset
    84
                                                   aCustomInterfaceUtility);
b8ed18f6c07b 2010wk40
hgs
parents:
diff changeset
    85
    CleanupStack::PushL( self );
b8ed18f6c07b 2010wk40
hgs
parents:
diff changeset
    86
    self->ConstructL();
b8ed18f6c07b 2010wk40
hgs
parents:
diff changeset
    87
    CleanupStack::Pop( self );
b8ed18f6c07b 2010wk40
hgs
parents:
diff changeset
    88
    return self;
b8ed18f6c07b 2010wk40
hgs
parents:
diff changeset
    89
    }
b8ed18f6c07b 2010wk40
hgs
parents:
diff changeset
    90
b8ed18f6c07b 2010wk40
hgs
parents:
diff changeset
    91
//------------------------------------------------------------------------------
b8ed18f6c07b 2010wk40
hgs
parents:
diff changeset
    92
// Destructor
b8ed18f6c07b 2010wk40
hgs
parents:
diff changeset
    93
//------------------------------------------------------------------------------
b8ed18f6c07b 2010wk40
hgs
parents:
diff changeset
    94
EXPORT_C CWmaDecoderIntfcProxy::~CWmaDecoderIntfcProxy()
b8ed18f6c07b 2010wk40
hgs
parents:
diff changeset
    95
    {
b8ed18f6c07b 2010wk40
hgs
parents:
diff changeset
    96
    iCustomInterfaceUtility->RemoveCustomInterface(iMessageHandler);
b8ed18f6c07b 2010wk40
hgs
parents:
diff changeset
    97
    delete iCustomInterfaceUtility;
b8ed18f6c07b 2010wk40
hgs
parents:
diff changeset
    98
/*
b8ed18f6c07b 2010wk40
hgs
parents:
diff changeset
    99
    iSupportedFormats.Close();
b8ed18f6c07b 2010wk40
hgs
parents:
diff changeset
   100
    iSupportedTools.Close();
b8ed18f6c07b 2010wk40
hgs
parents:
diff changeset
   101
    iControllableTools.Close();
b8ed18f6c07b 2010wk40
hgs
parents:
diff changeset
   102
    iCurrentSupportedFormats.Close();
b8ed18f6c07b 2010wk40
hgs
parents:
diff changeset
   103
    iCurrentSupportedTools.Close();
b8ed18f6c07b 2010wk40
hgs
parents:
diff changeset
   104
    iCurrentControllableTools.Close(); 
b8ed18f6c07b 2010wk40
hgs
parents:
diff changeset
   105
*/
b8ed18f6c07b 2010wk40
hgs
parents:
diff changeset
   106
    }
b8ed18f6c07b 2010wk40
hgs
parents:
diff changeset
   107
b8ed18f6c07b 2010wk40
hgs
parents:
diff changeset
   108
// From CWmaDecoderIntfc
b8ed18f6c07b 2010wk40
hgs
parents:
diff changeset
   109
//------------------------------------------------------------------------------
b8ed18f6c07b 2010wk40
hgs
parents:
diff changeset
   110
// Configures format.
b8ed18f6c07b 2010wk40
hgs
parents:
diff changeset
   111
//------------------------------------------------------------------------------
b8ed18f6c07b 2010wk40
hgs
parents:
diff changeset
   112
EXPORT_C void CWmaDecoderIntfcProxy::SetFormat(TFormat aFormat)
b8ed18f6c07b 2010wk40
hgs
parents:
diff changeset
   113
    {
b8ed18f6c07b 2010wk40
hgs
parents:
diff changeset
   114
    iFormat = aFormat;
b8ed18f6c07b 2010wk40
hgs
parents:
diff changeset
   115
    }
b8ed18f6c07b 2010wk40
hgs
parents:
diff changeset
   116
b8ed18f6c07b 2010wk40
hgs
parents:
diff changeset
   117
//------------------------------------------------------------------------------
b8ed18f6c07b 2010wk40
hgs
parents:
diff changeset
   118
// Configures decoder's bits per sample.
b8ed18f6c07b 2010wk40
hgs
parents:
diff changeset
   119
//------------------------------------------------------------------------------
b8ed18f6c07b 2010wk40
hgs
parents:
diff changeset
   120
EXPORT_C void CWmaDecoderIntfcProxy::SetBitsPerSampleIn(TUint aBitsPerSample)
b8ed18f6c07b 2010wk40
hgs
parents:
diff changeset
   121
    {
b8ed18f6c07b 2010wk40
hgs
parents:
diff changeset
   122
    iBitsPerSample = aBitsPerSample;
b8ed18f6c07b 2010wk40
hgs
parents:
diff changeset
   123
    }
b8ed18f6c07b 2010wk40
hgs
parents:
diff changeset
   124
b8ed18f6c07b 2010wk40
hgs
parents:
diff changeset
   125
//------------------------------------------------------------------------------
b8ed18f6c07b 2010wk40
hgs
parents:
diff changeset
   126
// Configures decoder's number of channels.
b8ed18f6c07b 2010wk40
hgs
parents:
diff changeset
   127
//------------------------------------------------------------------------------
b8ed18f6c07b 2010wk40
hgs
parents:
diff changeset
   128
EXPORT_C void CWmaDecoderIntfcProxy::SetNumChannelsIn (TUint aNumChannelsIn)
b8ed18f6c07b 2010wk40
hgs
parents:
diff changeset
   129
    {
b8ed18f6c07b 2010wk40
hgs
parents:
diff changeset
   130
    iNumChannelsIn = aNumChannelsIn;
b8ed18f6c07b 2010wk40
hgs
parents:
diff changeset
   131
    }
b8ed18f6c07b 2010wk40
hgs
parents:
diff changeset
   132
b8ed18f6c07b 2010wk40
hgs
parents:
diff changeset
   133
//------------------------------------------------------------------------------
b8ed18f6c07b 2010wk40
hgs
parents:
diff changeset
   134
// Configures decoder's sample rate.
b8ed18f6c07b 2010wk40
hgs
parents:
diff changeset
   135
//------------------------------------------------------------------------------
b8ed18f6c07b 2010wk40
hgs
parents:
diff changeset
   136
EXPORT_C void CWmaDecoderIntfcProxy::SetSamplesPerSec (TUint aSamplesPerSec)
b8ed18f6c07b 2010wk40
hgs
parents:
diff changeset
   137
    {
b8ed18f6c07b 2010wk40
hgs
parents:
diff changeset
   138
    iSamplesPerSec = aSamplesPerSec;
b8ed18f6c07b 2010wk40
hgs
parents:
diff changeset
   139
    }
b8ed18f6c07b 2010wk40
hgs
parents:
diff changeset
   140
b8ed18f6c07b 2010wk40
hgs
parents:
diff changeset
   141
//------------------------------------------------------------------------------
b8ed18f6c07b 2010wk40
hgs
parents:
diff changeset
   142
// Configures decoder's average bytes per second.
b8ed18f6c07b 2010wk40
hgs
parents:
diff changeset
   143
//------------------------------------------------------------------------------
b8ed18f6c07b 2010wk40
hgs
parents:
diff changeset
   144
EXPORT_C void CWmaDecoderIntfcProxy::SetAvgBytesPerSec (TUint aAvgBytesPerSec)
b8ed18f6c07b 2010wk40
hgs
parents:
diff changeset
   145
    {
b8ed18f6c07b 2010wk40
hgs
parents:
diff changeset
   146
    iAvgBytesPerSec = aAvgBytesPerSec;
b8ed18f6c07b 2010wk40
hgs
parents:
diff changeset
   147
    }
b8ed18f6c07b 2010wk40
hgs
parents:
diff changeset
   148
    
b8ed18f6c07b 2010wk40
hgs
parents:
diff changeset
   149
//------------------------------------------------------------------------------
b8ed18f6c07b 2010wk40
hgs
parents:
diff changeset
   150
// Configures decoder's block align.
b8ed18f6c07b 2010wk40
hgs
parents:
diff changeset
   151
//------------------------------------------------------------------------------
b8ed18f6c07b 2010wk40
hgs
parents:
diff changeset
   152
EXPORT_C void CWmaDecoderIntfcProxy::SetBlockAlign (TUint aBlockAlign)
b8ed18f6c07b 2010wk40
hgs
parents:
diff changeset
   153
    {
b8ed18f6c07b 2010wk40
hgs
parents:
diff changeset
   154
    iBlockAlign = aBlockAlign;
b8ed18f6c07b 2010wk40
hgs
parents:
diff changeset
   155
    }
b8ed18f6c07b 2010wk40
hgs
parents:
diff changeset
   156
b8ed18f6c07b 2010wk40
hgs
parents:
diff changeset
   157
//------------------------------------------------------------------------------
b8ed18f6c07b 2010wk40
hgs
parents:
diff changeset
   158
// Configures decoder's Encode Options.
b8ed18f6c07b 2010wk40
hgs
parents:
diff changeset
   159
//------------------------------------------------------------------------------
b8ed18f6c07b 2010wk40
hgs
parents:
diff changeset
   160
EXPORT_C void CWmaDecoderIntfcProxy::SetEncodeOptions (TUint aEncodeOptions)
b8ed18f6c07b 2010wk40
hgs
parents:
diff changeset
   161
    {
b8ed18f6c07b 2010wk40
hgs
parents:
diff changeset
   162
    iEncodeOptions = aEncodeOptions;
b8ed18f6c07b 2010wk40
hgs
parents:
diff changeset
   163
    }
b8ed18f6c07b 2010wk40
hgs
parents:
diff changeset
   164
    
b8ed18f6c07b 2010wk40
hgs
parents:
diff changeset
   165
//------------------------------------------------------------------------------
b8ed18f6c07b 2010wk40
hgs
parents:
diff changeset
   166
// Configures decoder's Encode Options1.
b8ed18f6c07b 2010wk40
hgs
parents:
diff changeset
   167
//------------------------------------------------------------------------------
b8ed18f6c07b 2010wk40
hgs
parents:
diff changeset
   168
EXPORT_C void CWmaDecoderIntfcProxy::SetEncodeOptions1 (TUint aEncodeOptions1)
b8ed18f6c07b 2010wk40
hgs
parents:
diff changeset
   169
    {
b8ed18f6c07b 2010wk40
hgs
parents:
diff changeset
   170
    iEncodeOptions1 = aEncodeOptions1;
b8ed18f6c07b 2010wk40
hgs
parents:
diff changeset
   171
    }
b8ed18f6c07b 2010wk40
hgs
parents:
diff changeset
   172
b8ed18f6c07b 2010wk40
hgs
parents:
diff changeset
   173
//------------------------------------------------------------------------------
b8ed18f6c07b 2010wk40
hgs
parents:
diff changeset
   174
// Configures decoder's Encode Options2.
b8ed18f6c07b 2010wk40
hgs
parents:
diff changeset
   175
//------------------------------------------------------------------------------
b8ed18f6c07b 2010wk40
hgs
parents:
diff changeset
   176
EXPORT_C void CWmaDecoderIntfcProxy::SetEncodeOptions2 (TUint aEncodeOptions2)
b8ed18f6c07b 2010wk40
hgs
parents:
diff changeset
   177
    {
b8ed18f6c07b 2010wk40
hgs
parents:
diff changeset
   178
    iEncodeOptions2 = aEncodeOptions2;
b8ed18f6c07b 2010wk40
hgs
parents:
diff changeset
   179
    }
b8ed18f6c07b 2010wk40
hgs
parents:
diff changeset
   180
    
b8ed18f6c07b 2010wk40
hgs
parents:
diff changeset
   181
//------------------------------------------------------------------------------
b8ed18f6c07b 2010wk40
hgs
parents:
diff changeset
   182
//Configures decoder's Channel Mask.
b8ed18f6c07b 2010wk40
hgs
parents:
diff changeset
   183
//------------------------------------------------------------------------------
b8ed18f6c07b 2010wk40
hgs
parents:
diff changeset
   184
EXPORT_C void CWmaDecoderIntfcProxy::SetChannelMaskIn (TUint aChannelMask)
b8ed18f6c07b 2010wk40
hgs
parents:
diff changeset
   185
    {
b8ed18f6c07b 2010wk40
hgs
parents:
diff changeset
   186
    iChannelMask = aChannelMask;
b8ed18f6c07b 2010wk40
hgs
parents:
diff changeset
   187
    }
b8ed18f6c07b 2010wk40
hgs
parents:
diff changeset
   188
b8ed18f6c07b 2010wk40
hgs
parents:
diff changeset
   189
//------------------------------------------------------------------------------
b8ed18f6c07b 2010wk40
hgs
parents:
diff changeset
   190
// Returns decoder's current configured format.
b8ed18f6c07b 2010wk40
hgs
parents:
diff changeset
   191
//------------------------------------------------------------------------------
b8ed18f6c07b 2010wk40
hgs
parents:
diff changeset
   192
EXPORT_C TInt CWmaDecoderIntfcProxy::GetFormat (TFormat& aFormat)
b8ed18f6c07b 2010wk40
hgs
parents:
diff changeset
   193
    {
b8ed18f6c07b 2010wk40
hgs
parents:
diff changeset
   194
    TInt status = KErrNone;
b8ed18f6c07b 2010wk40
hgs
parents:
diff changeset
   195
b8ed18f6c07b 2010wk40
hgs
parents:
diff changeset
   196
	if (!iParametersSameAsAdaptation)
b8ed18f6c07b 2010wk40
hgs
parents:
diff changeset
   197
		{
b8ed18f6c07b 2010wk40
hgs
parents:
diff changeset
   198
		status = GetAllMessage();	
b8ed18f6c07b 2010wk40
hgs
parents:
diff changeset
   199
		}
b8ed18f6c07b 2010wk40
hgs
parents:
diff changeset
   200
	if (status == KErrNone)
b8ed18f6c07b 2010wk40
hgs
parents:
diff changeset
   201
		{
b8ed18f6c07b 2010wk40
hgs
parents:
diff changeset
   202
	   	aFormat = iCurrentFormat;
b8ed18f6c07b 2010wk40
hgs
parents:
diff changeset
   203
   		status = iCurrentFormatStatus;
b8ed18f6c07b 2010wk40
hgs
parents:
diff changeset
   204
		}
b8ed18f6c07b 2010wk40
hgs
parents:
diff changeset
   205
   	if (!ValidGetStatus(status))
b8ed18f6c07b 2010wk40
hgs
parents:
diff changeset
   206
        {
b8ed18f6c07b 2010wk40
hgs
parents:
diff changeset
   207
    	status = KErrGeneral;	
b8ed18f6c07b 2010wk40
hgs
parents:
diff changeset
   208
    	}
b8ed18f6c07b 2010wk40
hgs
parents:
diff changeset
   209
    return status;
b8ed18f6c07b 2010wk40
hgs
parents:
diff changeset
   210
	}
b8ed18f6c07b 2010wk40
hgs
parents:
diff changeset
   211
b8ed18f6c07b 2010wk40
hgs
parents:
diff changeset
   212
//------------------------------------------------------------------------------
b8ed18f6c07b 2010wk40
hgs
parents:
diff changeset
   213
// Returns configured bits per sample .
b8ed18f6c07b 2010wk40
hgs
parents:
diff changeset
   214
//------------------------------------------------------------------------------
b8ed18f6c07b 2010wk40
hgs
parents:
diff changeset
   215
EXPORT_C TInt CWmaDecoderIntfcProxy::GetBitsPerSampleIn(TUint& aBitsPerSample) 
b8ed18f6c07b 2010wk40
hgs
parents:
diff changeset
   216
    {
b8ed18f6c07b 2010wk40
hgs
parents:
diff changeset
   217
    TInt status = KErrNone;
b8ed18f6c07b 2010wk40
hgs
parents:
diff changeset
   218
b8ed18f6c07b 2010wk40
hgs
parents:
diff changeset
   219
	if (!iParametersSameAsAdaptation)
b8ed18f6c07b 2010wk40
hgs
parents:
diff changeset
   220
		{
b8ed18f6c07b 2010wk40
hgs
parents:
diff changeset
   221
		status = GetAllMessage();	
b8ed18f6c07b 2010wk40
hgs
parents:
diff changeset
   222
		}
b8ed18f6c07b 2010wk40
hgs
parents:
diff changeset
   223
	if (status == KErrNone)
b8ed18f6c07b 2010wk40
hgs
parents:
diff changeset
   224
		{
b8ed18f6c07b 2010wk40
hgs
parents:
diff changeset
   225
   	    aBitsPerSample = iCurrentBitsPerSample;
b8ed18f6c07b 2010wk40
hgs
parents:
diff changeset
   226
   	    status = iCurrentBitsPerSampleStatus;
b8ed18f6c07b 2010wk40
hgs
parents:
diff changeset
   227
		}
b8ed18f6c07b 2010wk40
hgs
parents:
diff changeset
   228
   	if (!ValidGetStatus(status))
b8ed18f6c07b 2010wk40
hgs
parents:
diff changeset
   229
        {
b8ed18f6c07b 2010wk40
hgs
parents:
diff changeset
   230
    	status = KErrGeneral;	
b8ed18f6c07b 2010wk40
hgs
parents:
diff changeset
   231
    	}        
b8ed18f6c07b 2010wk40
hgs
parents:
diff changeset
   232
    	
b8ed18f6c07b 2010wk40
hgs
parents:
diff changeset
   233
    return status;
b8ed18f6c07b 2010wk40
hgs
parents:
diff changeset
   234
    }
b8ed18f6c07b 2010wk40
hgs
parents:
diff changeset
   235
b8ed18f6c07b 2010wk40
hgs
parents:
diff changeset
   236
//------------------------------------------------------------------------------
b8ed18f6c07b 2010wk40
hgs
parents:
diff changeset
   237
// Returns configured number of channels.
b8ed18f6c07b 2010wk40
hgs
parents:
diff changeset
   238
//------------------------------------------------------------------------------
b8ed18f6c07b 2010wk40
hgs
parents:
diff changeset
   239
EXPORT_C TInt CWmaDecoderIntfcProxy::GetNumOfChannelsIn (TUint& aNumOfChannels)
b8ed18f6c07b 2010wk40
hgs
parents:
diff changeset
   240
    {
b8ed18f6c07b 2010wk40
hgs
parents:
diff changeset
   241
    TInt status = KErrNone;
b8ed18f6c07b 2010wk40
hgs
parents:
diff changeset
   242
b8ed18f6c07b 2010wk40
hgs
parents:
diff changeset
   243
	if (!iParametersSameAsAdaptation)
b8ed18f6c07b 2010wk40
hgs
parents:
diff changeset
   244
		{
b8ed18f6c07b 2010wk40
hgs
parents:
diff changeset
   245
		status = GetAllMessage();	
b8ed18f6c07b 2010wk40
hgs
parents:
diff changeset
   246
		} 
b8ed18f6c07b 2010wk40
hgs
parents:
diff changeset
   247
	if (status == KErrNone)
b8ed18f6c07b 2010wk40
hgs
parents:
diff changeset
   248
		{
b8ed18f6c07b 2010wk40
hgs
parents:
diff changeset
   249
   		aNumOfChannels = iCurrentNumChannelsIn;
b8ed18f6c07b 2010wk40
hgs
parents:
diff changeset
   250
   		status = iCurrentNumChannelsInStatus;
b8ed18f6c07b 2010wk40
hgs
parents:
diff changeset
   251
		}
b8ed18f6c07b 2010wk40
hgs
parents:
diff changeset
   252
   	if (!ValidGetStatus(status))
b8ed18f6c07b 2010wk40
hgs
parents:
diff changeset
   253
        {
b8ed18f6c07b 2010wk40
hgs
parents:
diff changeset
   254
    	status = KErrGeneral;	
b8ed18f6c07b 2010wk40
hgs
parents:
diff changeset
   255
    	}        
b8ed18f6c07b 2010wk40
hgs
parents:
diff changeset
   256
    	
b8ed18f6c07b 2010wk40
hgs
parents:
diff changeset
   257
    return status;
b8ed18f6c07b 2010wk40
hgs
parents:
diff changeset
   258
    }
b8ed18f6c07b 2010wk40
hgs
parents:
diff changeset
   259
b8ed18f6c07b 2010wk40
hgs
parents:
diff changeset
   260
//------------------------------------------------------------------------------
b8ed18f6c07b 2010wk40
hgs
parents:
diff changeset
   261
// Returns configured sample rate.
b8ed18f6c07b 2010wk40
hgs
parents:
diff changeset
   262
//------------------------------------------------------------------------------
b8ed18f6c07b 2010wk40
hgs
parents:
diff changeset
   263
EXPORT_C TInt CWmaDecoderIntfcProxy::GetSamplesPerSec (TUint& aSamplesPerSec)
b8ed18f6c07b 2010wk40
hgs
parents:
diff changeset
   264
    {
b8ed18f6c07b 2010wk40
hgs
parents:
diff changeset
   265
    TInt status = KErrNone;
b8ed18f6c07b 2010wk40
hgs
parents:
diff changeset
   266
b8ed18f6c07b 2010wk40
hgs
parents:
diff changeset
   267
	if (!iParametersSameAsAdaptation)
b8ed18f6c07b 2010wk40
hgs
parents:
diff changeset
   268
		{
b8ed18f6c07b 2010wk40
hgs
parents:
diff changeset
   269
		status = GetAllMessage();	
b8ed18f6c07b 2010wk40
hgs
parents:
diff changeset
   270
		} 
b8ed18f6c07b 2010wk40
hgs
parents:
diff changeset
   271
	if (status == KErrNone)
b8ed18f6c07b 2010wk40
hgs
parents:
diff changeset
   272
		{
b8ed18f6c07b 2010wk40
hgs
parents:
diff changeset
   273
   		aSamplesPerSec = iCurrentSamplesPerSec;
b8ed18f6c07b 2010wk40
hgs
parents:
diff changeset
   274
   		status = iCurrentSamplesPerSecStatus;
b8ed18f6c07b 2010wk40
hgs
parents:
diff changeset
   275
		}
b8ed18f6c07b 2010wk40
hgs
parents:
diff changeset
   276
   	if (!ValidGetStatus(status))
b8ed18f6c07b 2010wk40
hgs
parents:
diff changeset
   277
        {
b8ed18f6c07b 2010wk40
hgs
parents:
diff changeset
   278
    	status = KErrGeneral;	
b8ed18f6c07b 2010wk40
hgs
parents:
diff changeset
   279
    	}        
b8ed18f6c07b 2010wk40
hgs
parents:
diff changeset
   280
    return status;
b8ed18f6c07b 2010wk40
hgs
parents:
diff changeset
   281
    }
b8ed18f6c07b 2010wk40
hgs
parents:
diff changeset
   282
b8ed18f6c07b 2010wk40
hgs
parents:
diff changeset
   283
//------------------------------------------------------------------------------
b8ed18f6c07b 2010wk40
hgs
parents:
diff changeset
   284
// Returns configured average bytes per second.
b8ed18f6c07b 2010wk40
hgs
parents:
diff changeset
   285
//------------------------------------------------------------------------------
b8ed18f6c07b 2010wk40
hgs
parents:
diff changeset
   286
EXPORT_C TInt CWmaDecoderIntfcProxy::GetAvgBytesPerSec (TUint& aAvgBytesPerSec)
b8ed18f6c07b 2010wk40
hgs
parents:
diff changeset
   287
    {
b8ed18f6c07b 2010wk40
hgs
parents:
diff changeset
   288
    TInt status = KErrNone;
b8ed18f6c07b 2010wk40
hgs
parents:
diff changeset
   289
b8ed18f6c07b 2010wk40
hgs
parents:
diff changeset
   290
	if (!iParametersSameAsAdaptation)
b8ed18f6c07b 2010wk40
hgs
parents:
diff changeset
   291
		{
b8ed18f6c07b 2010wk40
hgs
parents:
diff changeset
   292
		status = GetAllMessage();	
b8ed18f6c07b 2010wk40
hgs
parents:
diff changeset
   293
		} 
b8ed18f6c07b 2010wk40
hgs
parents:
diff changeset
   294
	if (status == KErrNone)
b8ed18f6c07b 2010wk40
hgs
parents:
diff changeset
   295
		{
b8ed18f6c07b 2010wk40
hgs
parents:
diff changeset
   296
   		aAvgBytesPerSec = iCurrentAvgBytesPerSec;
b8ed18f6c07b 2010wk40
hgs
parents:
diff changeset
   297
   		status = iCurrentAvgBytesPerSecStatus;
b8ed18f6c07b 2010wk40
hgs
parents:
diff changeset
   298
		}
b8ed18f6c07b 2010wk40
hgs
parents:
diff changeset
   299
   	if (!ValidGetStatus(status))
b8ed18f6c07b 2010wk40
hgs
parents:
diff changeset
   300
        {
b8ed18f6c07b 2010wk40
hgs
parents:
diff changeset
   301
    	status = KErrGeneral;	
b8ed18f6c07b 2010wk40
hgs
parents:
diff changeset
   302
    	}        
b8ed18f6c07b 2010wk40
hgs
parents:
diff changeset
   303
    return status;
b8ed18f6c07b 2010wk40
hgs
parents:
diff changeset
   304
    }
b8ed18f6c07b 2010wk40
hgs
parents:
diff changeset
   305
b8ed18f6c07b 2010wk40
hgs
parents:
diff changeset
   306
//------------------------------------------------------------------------------
b8ed18f6c07b 2010wk40
hgs
parents:
diff changeset
   307
// Returns configured block align.
b8ed18f6c07b 2010wk40
hgs
parents:
diff changeset
   308
//------------------------------------------------------------------------------
b8ed18f6c07b 2010wk40
hgs
parents:
diff changeset
   309
EXPORT_C TInt CWmaDecoderIntfcProxy::GetBlockAlign (TUint& aBlockAlign)
b8ed18f6c07b 2010wk40
hgs
parents:
diff changeset
   310
    {
b8ed18f6c07b 2010wk40
hgs
parents:
diff changeset
   311
    TInt status = KErrNone;
b8ed18f6c07b 2010wk40
hgs
parents:
diff changeset
   312
b8ed18f6c07b 2010wk40
hgs
parents:
diff changeset
   313
	if (!iParametersSameAsAdaptation)
b8ed18f6c07b 2010wk40
hgs
parents:
diff changeset
   314
		{
b8ed18f6c07b 2010wk40
hgs
parents:
diff changeset
   315
		status = GetAllMessage();	
b8ed18f6c07b 2010wk40
hgs
parents:
diff changeset
   316
		} 
b8ed18f6c07b 2010wk40
hgs
parents:
diff changeset
   317
	if (status == KErrNone)
b8ed18f6c07b 2010wk40
hgs
parents:
diff changeset
   318
		{
b8ed18f6c07b 2010wk40
hgs
parents:
diff changeset
   319
   		aBlockAlign = iCurrentBlockAlign;
b8ed18f6c07b 2010wk40
hgs
parents:
diff changeset
   320
   		status = iCurrentBlockAlignStatus;
b8ed18f6c07b 2010wk40
hgs
parents:
diff changeset
   321
		}
b8ed18f6c07b 2010wk40
hgs
parents:
diff changeset
   322
   	if (!ValidGetStatus(status))
b8ed18f6c07b 2010wk40
hgs
parents:
diff changeset
   323
        {
b8ed18f6c07b 2010wk40
hgs
parents:
diff changeset
   324
    	status = KErrGeneral;	
b8ed18f6c07b 2010wk40
hgs
parents:
diff changeset
   325
    	}        
b8ed18f6c07b 2010wk40
hgs
parents:
diff changeset
   326
    	    	
b8ed18f6c07b 2010wk40
hgs
parents:
diff changeset
   327
    return status;
b8ed18f6c07b 2010wk40
hgs
parents:
diff changeset
   328
    }
b8ed18f6c07b 2010wk40
hgs
parents:
diff changeset
   329
b8ed18f6c07b 2010wk40
hgs
parents:
diff changeset
   330
//------------------------------------------------------------------------------
b8ed18f6c07b 2010wk40
hgs
parents:
diff changeset
   331
// Returns configured encode options.
b8ed18f6c07b 2010wk40
hgs
parents:
diff changeset
   332
//------------------------------------------------------------------------------
b8ed18f6c07b 2010wk40
hgs
parents:
diff changeset
   333
EXPORT_C TInt CWmaDecoderIntfcProxy::GetEncodeOptions (TUint& aEncodeOpts)
b8ed18f6c07b 2010wk40
hgs
parents:
diff changeset
   334
    {
b8ed18f6c07b 2010wk40
hgs
parents:
diff changeset
   335
    TInt status = KErrNone;
b8ed18f6c07b 2010wk40
hgs
parents:
diff changeset
   336
b8ed18f6c07b 2010wk40
hgs
parents:
diff changeset
   337
	if (!iParametersSameAsAdaptation)
b8ed18f6c07b 2010wk40
hgs
parents:
diff changeset
   338
		{
b8ed18f6c07b 2010wk40
hgs
parents:
diff changeset
   339
		status = GetAllMessage();	
b8ed18f6c07b 2010wk40
hgs
parents:
diff changeset
   340
		} 
b8ed18f6c07b 2010wk40
hgs
parents:
diff changeset
   341
	if (status == KErrNone)
b8ed18f6c07b 2010wk40
hgs
parents:
diff changeset
   342
		{
b8ed18f6c07b 2010wk40
hgs
parents:
diff changeset
   343
   		aEncodeOpts = iCurrentEncodeOptions;
b8ed18f6c07b 2010wk40
hgs
parents:
diff changeset
   344
   		status = iCurrentEncodeOptionsStatus;
b8ed18f6c07b 2010wk40
hgs
parents:
diff changeset
   345
		}
b8ed18f6c07b 2010wk40
hgs
parents:
diff changeset
   346
   	if (!ValidGetStatus(status))
b8ed18f6c07b 2010wk40
hgs
parents:
diff changeset
   347
        {
b8ed18f6c07b 2010wk40
hgs
parents:
diff changeset
   348
    	status = KErrGeneral;	
b8ed18f6c07b 2010wk40
hgs
parents:
diff changeset
   349
    	}        
b8ed18f6c07b 2010wk40
hgs
parents:
diff changeset
   350
    return status;
b8ed18f6c07b 2010wk40
hgs
parents:
diff changeset
   351
    }
b8ed18f6c07b 2010wk40
hgs
parents:
diff changeset
   352
b8ed18f6c07b 2010wk40
hgs
parents:
diff changeset
   353
//------------------------------------------------------------------------------
b8ed18f6c07b 2010wk40
hgs
parents:
diff changeset
   354
// Returns configured advanced encode options.
b8ed18f6c07b 2010wk40
hgs
parents:
diff changeset
   355
//------------------------------------------------------------------------------
b8ed18f6c07b 2010wk40
hgs
parents:
diff changeset
   356
EXPORT_C TInt CWmaDecoderIntfcProxy::GetEncodeOptions1 (TUint& EncodeOpts1)
b8ed18f6c07b 2010wk40
hgs
parents:
diff changeset
   357
    {
b8ed18f6c07b 2010wk40
hgs
parents:
diff changeset
   358
    TInt status = KErrNone;
b8ed18f6c07b 2010wk40
hgs
parents:
diff changeset
   359
b8ed18f6c07b 2010wk40
hgs
parents:
diff changeset
   360
	if (!iParametersSameAsAdaptation)
b8ed18f6c07b 2010wk40
hgs
parents:
diff changeset
   361
		{
b8ed18f6c07b 2010wk40
hgs
parents:
diff changeset
   362
		status = GetAllMessage();	
b8ed18f6c07b 2010wk40
hgs
parents:
diff changeset
   363
		} 
b8ed18f6c07b 2010wk40
hgs
parents:
diff changeset
   364
	if (status == KErrNone)
b8ed18f6c07b 2010wk40
hgs
parents:
diff changeset
   365
		{
b8ed18f6c07b 2010wk40
hgs
parents:
diff changeset
   366
   		EncodeOpts1 = iCurrentEncodeOptions1;
b8ed18f6c07b 2010wk40
hgs
parents:
diff changeset
   367
   		status = iCurrentEncodeOptions1Status;
b8ed18f6c07b 2010wk40
hgs
parents:
diff changeset
   368
		}
b8ed18f6c07b 2010wk40
hgs
parents:
diff changeset
   369
	if (!ValidGetStatus(status) &&
b8ed18f6c07b 2010wk40
hgs
parents:
diff changeset
   370
        status != KErrNotSupported)
b8ed18f6c07b 2010wk40
hgs
parents:
diff changeset
   371
        {
b8ed18f6c07b 2010wk40
hgs
parents:
diff changeset
   372
    	status = KErrGeneral;	
b8ed18f6c07b 2010wk40
hgs
parents:
diff changeset
   373
    	}        
b8ed18f6c07b 2010wk40
hgs
parents:
diff changeset
   374
    return status;
b8ed18f6c07b 2010wk40
hgs
parents:
diff changeset
   375
    }
b8ed18f6c07b 2010wk40
hgs
parents:
diff changeset
   376
b8ed18f6c07b 2010wk40
hgs
parents:
diff changeset
   377
//------------------------------------------------------------------------------
b8ed18f6c07b 2010wk40
hgs
parents:
diff changeset
   378
// Returns configured advanced encode options.
b8ed18f6c07b 2010wk40
hgs
parents:
diff changeset
   379
//------------------------------------------------------------------------------
b8ed18f6c07b 2010wk40
hgs
parents:
diff changeset
   380
EXPORT_C TInt CWmaDecoderIntfcProxy::GetEncodeOptions2 (TUint& EncodeOpts2)
b8ed18f6c07b 2010wk40
hgs
parents:
diff changeset
   381
    {
b8ed18f6c07b 2010wk40
hgs
parents:
diff changeset
   382
    TInt status = KErrNone;
b8ed18f6c07b 2010wk40
hgs
parents:
diff changeset
   383
b8ed18f6c07b 2010wk40
hgs
parents:
diff changeset
   384
	if (!iParametersSameAsAdaptation)
b8ed18f6c07b 2010wk40
hgs
parents:
diff changeset
   385
		{
b8ed18f6c07b 2010wk40
hgs
parents:
diff changeset
   386
		status = GetAllMessage();	
b8ed18f6c07b 2010wk40
hgs
parents:
diff changeset
   387
		} 
b8ed18f6c07b 2010wk40
hgs
parents:
diff changeset
   388
	if (status == KErrNone)
b8ed18f6c07b 2010wk40
hgs
parents:
diff changeset
   389
		{
b8ed18f6c07b 2010wk40
hgs
parents:
diff changeset
   390
   		EncodeOpts2 = iCurrentEncodeOptions2;
b8ed18f6c07b 2010wk40
hgs
parents:
diff changeset
   391
   		status = iCurrentEncodeOptions2Status;
b8ed18f6c07b 2010wk40
hgs
parents:
diff changeset
   392
		}
b8ed18f6c07b 2010wk40
hgs
parents:
diff changeset
   393
	if (!ValidGetStatus(status) &&
b8ed18f6c07b 2010wk40
hgs
parents:
diff changeset
   394
        status != KErrNotSupported)
b8ed18f6c07b 2010wk40
hgs
parents:
diff changeset
   395
        {
b8ed18f6c07b 2010wk40
hgs
parents:
diff changeset
   396
    	status = KErrGeneral;	
b8ed18f6c07b 2010wk40
hgs
parents:
diff changeset
   397
    	}        
b8ed18f6c07b 2010wk40
hgs
parents:
diff changeset
   398
    return status;
b8ed18f6c07b 2010wk40
hgs
parents:
diff changeset
   399
    }
b8ed18f6c07b 2010wk40
hgs
parents:
diff changeset
   400
    
b8ed18f6c07b 2010wk40
hgs
parents:
diff changeset
   401
//------------------------------------------------------------------------------
b8ed18f6c07b 2010wk40
hgs
parents:
diff changeset
   402
// Returns configured channel mask.
b8ed18f6c07b 2010wk40
hgs
parents:
diff changeset
   403
//------------------------------------------------------------------------------
b8ed18f6c07b 2010wk40
hgs
parents:
diff changeset
   404
EXPORT_C TInt CWmaDecoderIntfcProxy::GetChannelMaskIn (TUint& aChannelMask)
b8ed18f6c07b 2010wk40
hgs
parents:
diff changeset
   405
    {
b8ed18f6c07b 2010wk40
hgs
parents:
diff changeset
   406
    TInt status = KErrNone;
b8ed18f6c07b 2010wk40
hgs
parents:
diff changeset
   407
b8ed18f6c07b 2010wk40
hgs
parents:
diff changeset
   408
	if (!iParametersSameAsAdaptation)
b8ed18f6c07b 2010wk40
hgs
parents:
diff changeset
   409
		{
b8ed18f6c07b 2010wk40
hgs
parents:
diff changeset
   410
		status = GetAllMessage();	
b8ed18f6c07b 2010wk40
hgs
parents:
diff changeset
   411
		} 
b8ed18f6c07b 2010wk40
hgs
parents:
diff changeset
   412
	if (status == KErrNone)
b8ed18f6c07b 2010wk40
hgs
parents:
diff changeset
   413
		{
b8ed18f6c07b 2010wk40
hgs
parents:
diff changeset
   414
   		aChannelMask = iCurrentChannelMask;
b8ed18f6c07b 2010wk40
hgs
parents:
diff changeset
   415
   		status = iCurrentChannelMaskStatus;
b8ed18f6c07b 2010wk40
hgs
parents:
diff changeset
   416
		}
b8ed18f6c07b 2010wk40
hgs
parents:
diff changeset
   417
	if (!ValidGetStatus(status) &&
b8ed18f6c07b 2010wk40
hgs
parents:
diff changeset
   418
        status != KErrNotSupported)
b8ed18f6c07b 2010wk40
hgs
parents:
diff changeset
   419
        {
b8ed18f6c07b 2010wk40
hgs
parents:
diff changeset
   420
    	status = KErrGeneral;	
b8ed18f6c07b 2010wk40
hgs
parents:
diff changeset
   421
    	}        
b8ed18f6c07b 2010wk40
hgs
parents:
diff changeset
   422
b8ed18f6c07b 2010wk40
hgs
parents:
diff changeset
   423
    return status;
b8ed18f6c07b 2010wk40
hgs
parents:
diff changeset
   424
    }
b8ed18f6c07b 2010wk40
hgs
parents:
diff changeset
   425
    
b8ed18f6c07b 2010wk40
hgs
parents:
diff changeset
   426
//------------------------------------------------------------------------------
b8ed18f6c07b 2010wk40
hgs
parents:
diff changeset
   427
// Returns supported formats.
b8ed18f6c07b 2010wk40
hgs
parents:
diff changeset
   428
//------------------------------------------------------------------------------
b8ed18f6c07b 2010wk40
hgs
parents:
diff changeset
   429
EXPORT_C TInt CWmaDecoderIntfcProxy::GetSupportedFormats(RArray<TFormat>& aSupportedFormats)
b8ed18f6c07b 2010wk40
hgs
parents:
diff changeset
   430
    {
b8ed18f6c07b 2010wk40
hgs
parents:
diff changeset
   431
b8ed18f6c07b 2010wk40
hgs
parents:
diff changeset
   432
    TInt status = KErrNone;
b8ed18f6c07b 2010wk40
hgs
parents:
diff changeset
   433
    TRAPD(err, status = GetSupportedFormatsL(aSupportedFormats))
b8ed18f6c07b 2010wk40
hgs
parents:
diff changeset
   434
    if (err != KErrNone)
b8ed18f6c07b 2010wk40
hgs
parents:
diff changeset
   435
    	{
b8ed18f6c07b 2010wk40
hgs
parents:
diff changeset
   436
        if (err != KErrNone  && err != KErrNotFound)
b8ed18f6c07b 2010wk40
hgs
parents:
diff changeset
   437
        	{
b8ed18f6c07b 2010wk40
hgs
parents:
diff changeset
   438
    		status = KErrGeneral;	    		
b8ed18f6c07b 2010wk40
hgs
parents:
diff changeset
   439
    		}
b8ed18f6c07b 2010wk40
hgs
parents:
diff changeset
   440
    	}
b8ed18f6c07b 2010wk40
hgs
parents:
diff changeset
   441
    return status;
b8ed18f6c07b 2010wk40
hgs
parents:
diff changeset
   442
    }
b8ed18f6c07b 2010wk40
hgs
parents:
diff changeset
   443
b8ed18f6c07b 2010wk40
hgs
parents:
diff changeset
   444
//------------------------------------------------------------------------------
b8ed18f6c07b 2010wk40
hgs
parents:
diff changeset
   445
// Returns supported tools.
b8ed18f6c07b 2010wk40
hgs
parents:
diff changeset
   446
//------------------------------------------------------------------------------
b8ed18f6c07b 2010wk40
hgs
parents:
diff changeset
   447
EXPORT_C TInt CWmaDecoderIntfcProxy::GetSupportedTools(RArray<TTool>& aSupportedTools)
b8ed18f6c07b 2010wk40
hgs
parents:
diff changeset
   448
    {
b8ed18f6c07b 2010wk40
hgs
parents:
diff changeset
   449
    TInt status = KErrNone;
b8ed18f6c07b 2010wk40
hgs
parents:
diff changeset
   450
    TRAPD(err, status = GetSupportedToolsL(aSupportedTools))
b8ed18f6c07b 2010wk40
hgs
parents:
diff changeset
   451
    if (err != KErrNone)
b8ed18f6c07b 2010wk40
hgs
parents:
diff changeset
   452
    	{
b8ed18f6c07b 2010wk40
hgs
parents:
diff changeset
   453
        if (err != KErrNone  && err != KErrNotFound)
b8ed18f6c07b 2010wk40
hgs
parents:
diff changeset
   454
        	{
b8ed18f6c07b 2010wk40
hgs
parents:
diff changeset
   455
    		status = KErrGeneral;	    		
b8ed18f6c07b 2010wk40
hgs
parents:
diff changeset
   456
    		}
b8ed18f6c07b 2010wk40
hgs
parents:
diff changeset
   457
    	}
b8ed18f6c07b 2010wk40
hgs
parents:
diff changeset
   458
b8ed18f6c07b 2010wk40
hgs
parents:
diff changeset
   459
    return status;
b8ed18f6c07b 2010wk40
hgs
parents:
diff changeset
   460
    }
b8ed18f6c07b 2010wk40
hgs
parents:
diff changeset
   461
b8ed18f6c07b 2010wk40
hgs
parents:
diff changeset
   462
//------------------------------------------------------------------------------
b8ed18f6c07b 2010wk40
hgs
parents:
diff changeset
   463
// Returns supported max number of channels.
b8ed18f6c07b 2010wk40
hgs
parents:
diff changeset
   464
//------------------------------------------------------------------------------
b8ed18f6c07b 2010wk40
hgs
parents:
diff changeset
   465
EXPORT_C TInt CWmaDecoderIntfcProxy::GetSupportedMaxChannelsIn(TUint& aSupportedMaxChannelsIn)
b8ed18f6c07b 2010wk40
hgs
parents:
diff changeset
   466
    {
b8ed18f6c07b 2010wk40
hgs
parents:
diff changeset
   467
    TInt status = KErrNone;
b8ed18f6c07b 2010wk40
hgs
parents:
diff changeset
   468
    
b8ed18f6c07b 2010wk40
hgs
parents:
diff changeset
   469
	TPckgBuf<TUint> pckgBuf;
b8ed18f6c07b 2010wk40
hgs
parents:
diff changeset
   470
    status = iCustomCommand.CustomCommandSync(
b8ed18f6c07b 2010wk40
hgs
parents:
diff changeset
   471
                                               iMessageHandler, 
b8ed18f6c07b 2010wk40
hgs
parents:
diff changeset
   472
                                               EWmaGetSupportedMaxChannels, 
b8ed18f6c07b 2010wk40
hgs
parents:
diff changeset
   473
                                               KNullDesC8,
b8ed18f6c07b 2010wk40
hgs
parents:
diff changeset
   474
                                               KNullDesC8,
b8ed18f6c07b 2010wk40
hgs
parents:
diff changeset
   475
                                               pckgBuf);
b8ed18f6c07b 2010wk40
hgs
parents:
diff changeset
   476
                                               
b8ed18f6c07b 2010wk40
hgs
parents:
diff changeset
   477
	aSupportedMaxChannelsIn = pckgBuf();	
b8ed18f6c07b 2010wk40
hgs
parents:
diff changeset
   478
    if (status != KErrNone  && status != KErrNotFound)
b8ed18f6c07b 2010wk40
hgs
parents:
diff changeset
   479
        {
b8ed18f6c07b 2010wk40
hgs
parents:
diff changeset
   480
    	status = KErrGeneral;	    		
b8ed18f6c07b 2010wk40
hgs
parents:
diff changeset
   481
    	}
b8ed18f6c07b 2010wk40
hgs
parents:
diff changeset
   482
    return status;
b8ed18f6c07b 2010wk40
hgs
parents:
diff changeset
   483
    }
b8ed18f6c07b 2010wk40
hgs
parents:
diff changeset
   484
b8ed18f6c07b 2010wk40
hgs
parents:
diff changeset
   485
//------------------------------------------------------------------------------
b8ed18f6c07b 2010wk40
hgs
parents:
diff changeset
   486
// Returns supported max bit rate.
b8ed18f6c07b 2010wk40
hgs
parents:
diff changeset
   487
//------------------------------------------------------------------------------
b8ed18f6c07b 2010wk40
hgs
parents:
diff changeset
   488
EXPORT_C TInt CWmaDecoderIntfcProxy::GetSupportedMaxBitrate(TUint& aSupportedMaxBitrate)
b8ed18f6c07b 2010wk40
hgs
parents:
diff changeset
   489
    {
b8ed18f6c07b 2010wk40
hgs
parents:
diff changeset
   490
    TInt status = KErrNone;
b8ed18f6c07b 2010wk40
hgs
parents:
diff changeset
   491
b8ed18f6c07b 2010wk40
hgs
parents:
diff changeset
   492
	TPckgBuf<TUint> pckgBuf;
b8ed18f6c07b 2010wk40
hgs
parents:
diff changeset
   493
    status = iCustomCommand.CustomCommandSync(
b8ed18f6c07b 2010wk40
hgs
parents:
diff changeset
   494
                                               iMessageHandler, 
b8ed18f6c07b 2010wk40
hgs
parents:
diff changeset
   495
                                               EWmaGetSupportedMaxBitrate, 
b8ed18f6c07b 2010wk40
hgs
parents:
diff changeset
   496
                                               KNullDesC8,
b8ed18f6c07b 2010wk40
hgs
parents:
diff changeset
   497
                                               KNullDesC8,
b8ed18f6c07b 2010wk40
hgs
parents:
diff changeset
   498
                                               pckgBuf);
b8ed18f6c07b 2010wk40
hgs
parents:
diff changeset
   499
                                               
b8ed18f6c07b 2010wk40
hgs
parents:
diff changeset
   500
	aSupportedMaxBitrate = pckgBuf();	
b8ed18f6c07b 2010wk40
hgs
parents:
diff changeset
   501
	
b8ed18f6c07b 2010wk40
hgs
parents:
diff changeset
   502
b8ed18f6c07b 2010wk40
hgs
parents:
diff changeset
   503
    if (status != KErrNone  && status != KErrNotFound)
b8ed18f6c07b 2010wk40
hgs
parents:
diff changeset
   504
        {
b8ed18f6c07b 2010wk40
hgs
parents:
diff changeset
   505
    	status = KErrGeneral;	    		
b8ed18f6c07b 2010wk40
hgs
parents:
diff changeset
   506
    	}
b8ed18f6c07b 2010wk40
hgs
parents:
diff changeset
   507
b8ed18f6c07b 2010wk40
hgs
parents:
diff changeset
   508
    return status;
b8ed18f6c07b 2010wk40
hgs
parents:
diff changeset
   509
    }
b8ed18f6c07b 2010wk40
hgs
parents:
diff changeset
   510
b8ed18f6c07b 2010wk40
hgs
parents:
diff changeset
   511
//------------------------------------------------------------------------------
b8ed18f6c07b 2010wk40
hgs
parents:
diff changeset
   512
// Get Supported Max Sample Rate
b8ed18f6c07b 2010wk40
hgs
parents:
diff changeset
   513
//------------------------------------------------------------------------------
5
b220a9341636 2010wk46_01
hgs
parents: 0
diff changeset
   514
EXPORT_C TInt CWmaDecoderIntfcProxy::GetSupportedMaxSampleRate(TUint& aSupportedMaxSampleRate)
0
b8ed18f6c07b 2010wk40
hgs
parents:
diff changeset
   515
	{
b8ed18f6c07b 2010wk40
hgs
parents:
diff changeset
   516
    TInt status = KErrNone;
b8ed18f6c07b 2010wk40
hgs
parents:
diff changeset
   517
    
b8ed18f6c07b 2010wk40
hgs
parents:
diff changeset
   518
	TPckgBuf<TUint> pckgBuf;
b8ed18f6c07b 2010wk40
hgs
parents:
diff changeset
   519
    status = iCustomCommand.CustomCommandSync(
b8ed18f6c07b 2010wk40
hgs
parents:
diff changeset
   520
                                               iMessageHandler, 
b8ed18f6c07b 2010wk40
hgs
parents:
diff changeset
   521
                                               EWmaGetSupportedMaxSampleRate, 
b8ed18f6c07b 2010wk40
hgs
parents:
diff changeset
   522
                                               KNullDesC8,
b8ed18f6c07b 2010wk40
hgs
parents:
diff changeset
   523
                                               KNullDesC8,
b8ed18f6c07b 2010wk40
hgs
parents:
diff changeset
   524
                                               pckgBuf);
b8ed18f6c07b 2010wk40
hgs
parents:
diff changeset
   525
                                               
b8ed18f6c07b 2010wk40
hgs
parents:
diff changeset
   526
	aSupportedMaxSampleRate = pckgBuf();	
b8ed18f6c07b 2010wk40
hgs
parents:
diff changeset
   527
    if (status != KErrNone  && status != KErrNotFound)
b8ed18f6c07b 2010wk40
hgs
parents:
diff changeset
   528
        {
b8ed18f6c07b 2010wk40
hgs
parents:
diff changeset
   529
    	status = KErrGeneral;	    		
b8ed18f6c07b 2010wk40
hgs
parents:
diff changeset
   530
    	}
b8ed18f6c07b 2010wk40
hgs
parents:
diff changeset
   531
b8ed18f6c07b 2010wk40
hgs
parents:
diff changeset
   532
    return status;
b8ed18f6c07b 2010wk40
hgs
parents:
diff changeset
   533
	}
b8ed18f6c07b 2010wk40
hgs
parents:
diff changeset
   534
b8ed18f6c07b 2010wk40
hgs
parents:
diff changeset
   535
//------------------------------------------------------------------------------
b8ed18f6c07b 2010wk40
hgs
parents:
diff changeset
   536
// Returns controllable tools.
b8ed18f6c07b 2010wk40
hgs
parents:
diff changeset
   537
//------------------------------------------------------------------------------
b8ed18f6c07b 2010wk40
hgs
parents:
diff changeset
   538
EXPORT_C TInt CWmaDecoderIntfcProxy::GetControllableTools(RArray<TTool>& aControllableTools)
b8ed18f6c07b 2010wk40
hgs
parents:
diff changeset
   539
    {
b8ed18f6c07b 2010wk40
hgs
parents:
diff changeset
   540
    TInt status = KErrNone;
b8ed18f6c07b 2010wk40
hgs
parents:
diff changeset
   541
    TRAPD(err, status = GetControllableToolsL(aControllableTools))
b8ed18f6c07b 2010wk40
hgs
parents:
diff changeset
   542
    if (err != KErrNone)
b8ed18f6c07b 2010wk40
hgs
parents:
diff changeset
   543
    	{
b8ed18f6c07b 2010wk40
hgs
parents:
diff changeset
   544
        if (err != KErrNone  && err != KErrNotFound)
b8ed18f6c07b 2010wk40
hgs
parents:
diff changeset
   545
        	{
b8ed18f6c07b 2010wk40
hgs
parents:
diff changeset
   546
    		status = KErrGeneral;	    		
b8ed18f6c07b 2010wk40
hgs
parents:
diff changeset
   547
    		}
b8ed18f6c07b 2010wk40
hgs
parents:
diff changeset
   548
    	}
b8ed18f6c07b 2010wk40
hgs
parents:
diff changeset
   549
b8ed18f6c07b 2010wk40
hgs
parents:
diff changeset
   550
    return status;
b8ed18f6c07b 2010wk40
hgs
parents:
diff changeset
   551
    }
b8ed18f6c07b 2010wk40
hgs
parents:
diff changeset
   552
b8ed18f6c07b 2010wk40
hgs
parents:
diff changeset
   553
//------------------------------------------------------------------------------
b8ed18f6c07b 2010wk40
hgs
parents:
diff changeset
   554
// Enable tool.
b8ed18f6c07b 2010wk40
hgs
parents:
diff changeset
   555
//------------------------------------------------------------------------------
b8ed18f6c07b 2010wk40
hgs
parents:
diff changeset
   556
EXPORT_C void CWmaDecoderIntfcProxy::EnableTool(TTool aTool) 
b8ed18f6c07b 2010wk40
hgs
parents:
diff changeset
   557
    {
b8ed18f6c07b 2010wk40
hgs
parents:
diff changeset
   558
	switch (aTool)
b8ed18f6c07b 2010wk40
hgs
parents:
diff changeset
   559
		{
b8ed18f6c07b 2010wk40
hgs
parents:
diff changeset
   560
    	case EToolOutput32Bit:
b8ed18f6c07b 2010wk40
hgs
parents:
diff changeset
   561
    	     iToolOutPut32Bit = ETrue;
b8ed18f6c07b 2010wk40
hgs
parents:
diff changeset
   562
    	     break;
b8ed18f6c07b 2010wk40
hgs
parents:
diff changeset
   563
    	case EDownMixToStereo:
b8ed18f6c07b 2010wk40
hgs
parents:
diff changeset
   564
             iToolDownMixToStereo = ETrue;
b8ed18f6c07b 2010wk40
hgs
parents:
diff changeset
   565
             break;
b8ed18f6c07b 2010wk40
hgs
parents:
diff changeset
   566
    	case ELostDataConcealment:
b8ed18f6c07b 2010wk40
hgs
parents:
diff changeset
   567
    	     iToolLostDataConcealment = ETrue;
b8ed18f6c07b 2010wk40
hgs
parents:
diff changeset
   568
    	     break;
b8ed18f6c07b 2010wk40
hgs
parents:
diff changeset
   569
    	default:
b8ed18f6c07b 2010wk40
hgs
parents:
diff changeset
   570
    	     break;     			
b8ed18f6c07b 2010wk40
hgs
parents:
diff changeset
   571
		}
b8ed18f6c07b 2010wk40
hgs
parents:
diff changeset
   572
b8ed18f6c07b 2010wk40
hgs
parents:
diff changeset
   573
    }
b8ed18f6c07b 2010wk40
hgs
parents:
diff changeset
   574
b8ed18f6c07b 2010wk40
hgs
parents:
diff changeset
   575
//------------------------------------------------------------------------------
b8ed18f6c07b 2010wk40
hgs
parents:
diff changeset
   576
// disable tool.
b8ed18f6c07b 2010wk40
hgs
parents:
diff changeset
   577
//------------------------------------------------------------------------------
b8ed18f6c07b 2010wk40
hgs
parents:
diff changeset
   578
EXPORT_C void CWmaDecoderIntfcProxy::DisableTool(TTool aTool) 
b8ed18f6c07b 2010wk40
hgs
parents:
diff changeset
   579
    {
b8ed18f6c07b 2010wk40
hgs
parents:
diff changeset
   580
	switch (aTool)
b8ed18f6c07b 2010wk40
hgs
parents:
diff changeset
   581
		{
b8ed18f6c07b 2010wk40
hgs
parents:
diff changeset
   582
    	case EToolOutput32Bit:
b8ed18f6c07b 2010wk40
hgs
parents:
diff changeset
   583
    	     iToolOutPut32Bit = EFalse;
b8ed18f6c07b 2010wk40
hgs
parents:
diff changeset
   584
    	     break;
b8ed18f6c07b 2010wk40
hgs
parents:
diff changeset
   585
    	case EDownMixToStereo:
b8ed18f6c07b 2010wk40
hgs
parents:
diff changeset
   586
             iToolDownMixToStereo = EFalse;
b8ed18f6c07b 2010wk40
hgs
parents:
diff changeset
   587
             break;
b8ed18f6c07b 2010wk40
hgs
parents:
diff changeset
   588
    	case ELostDataConcealment:
b8ed18f6c07b 2010wk40
hgs
parents:
diff changeset
   589
    	     iToolLostDataConcealment = EFalse;
b8ed18f6c07b 2010wk40
hgs
parents:
diff changeset
   590
    	     break;
b8ed18f6c07b 2010wk40
hgs
parents:
diff changeset
   591
    	default:
b8ed18f6c07b 2010wk40
hgs
parents:
diff changeset
   592
    	     break;     			
b8ed18f6c07b 2010wk40
hgs
parents:
diff changeset
   593
		}
b8ed18f6c07b 2010wk40
hgs
parents:
diff changeset
   594
    }
b8ed18f6c07b 2010wk40
hgs
parents:
diff changeset
   595
b8ed18f6c07b 2010wk40
hgs
parents:
diff changeset
   596
b8ed18f6c07b 2010wk40
hgs
parents:
diff changeset
   597
//------------------------------------------------------------------------------
b8ed18f6c07b 2010wk40
hgs
parents:
diff changeset
   598
// Returns tool state.
b8ed18f6c07b 2010wk40
hgs
parents:
diff changeset
   599
//------------------------------------------------------------------------------
b8ed18f6c07b 2010wk40
hgs
parents:
diff changeset
   600
EXPORT_C TInt CWmaDecoderIntfcProxy::GetTool(TTool aTool, TBool& aEnabled)
b8ed18f6c07b 2010wk40
hgs
parents:
diff changeset
   601
    {
b8ed18f6c07b 2010wk40
hgs
parents:
diff changeset
   602
    TInt status = KErrNone;
b8ed18f6c07b 2010wk40
hgs
parents:
diff changeset
   603
b8ed18f6c07b 2010wk40
hgs
parents:
diff changeset
   604
	if (!iParametersSameAsAdaptation)
b8ed18f6c07b 2010wk40
hgs
parents:
diff changeset
   605
		{
b8ed18f6c07b 2010wk40
hgs
parents:
diff changeset
   606
		status = GetAllMessage();	
b8ed18f6c07b 2010wk40
hgs
parents:
diff changeset
   607
		} 
b8ed18f6c07b 2010wk40
hgs
parents:
diff changeset
   608
	switch (aTool)
b8ed18f6c07b 2010wk40
hgs
parents:
diff changeset
   609
		{
b8ed18f6c07b 2010wk40
hgs
parents:
diff changeset
   610
    	case EToolOutput32Bit:
b8ed18f6c07b 2010wk40
hgs
parents:
diff changeset
   611
    	     if (iCurrentToolOutPut32Bit)
b8ed18f6c07b 2010wk40
hgs
parents:
diff changeset
   612
    	     	{
b8ed18f6c07b 2010wk40
hgs
parents:
diff changeset
   613
    	     	aEnabled = ETrue;	
b8ed18f6c07b 2010wk40
hgs
parents:
diff changeset
   614
    	     	}
b8ed18f6c07b 2010wk40
hgs
parents:
diff changeset
   615
    	     else
b8ed18f6c07b 2010wk40
hgs
parents:
diff changeset
   616
    	     	{
b8ed18f6c07b 2010wk40
hgs
parents:
diff changeset
   617
     	     	aEnabled = EFalse;	   	     		
b8ed18f6c07b 2010wk40
hgs
parents:
diff changeset
   618
    	     	}
b8ed18f6c07b 2010wk40
hgs
parents:
diff changeset
   619
    	     status = iCurrentToolOutPut32BitStatus;
b8ed18f6c07b 2010wk40
hgs
parents:
diff changeset
   620
    	     break;
b8ed18f6c07b 2010wk40
hgs
parents:
diff changeset
   621
    	     
b8ed18f6c07b 2010wk40
hgs
parents:
diff changeset
   622
    	case EDownMixToStereo:
b8ed18f6c07b 2010wk40
hgs
parents:
diff changeset
   623
    	     if (iCurrentToolDownMixToStereo)
b8ed18f6c07b 2010wk40
hgs
parents:
diff changeset
   624
    	     	{
b8ed18f6c07b 2010wk40
hgs
parents:
diff changeset
   625
    	     	aEnabled = ETrue;	
b8ed18f6c07b 2010wk40
hgs
parents:
diff changeset
   626
    	     	}
b8ed18f6c07b 2010wk40
hgs
parents:
diff changeset
   627
    	     else
b8ed18f6c07b 2010wk40
hgs
parents:
diff changeset
   628
    	     	{
b8ed18f6c07b 2010wk40
hgs
parents:
diff changeset
   629
     	     	aEnabled = EFalse;	   	     		
b8ed18f6c07b 2010wk40
hgs
parents:
diff changeset
   630
    	     	}
b8ed18f6c07b 2010wk40
hgs
parents:
diff changeset
   631
    	     status = iCurrentToolDownMixToStereoStatus;
b8ed18f6c07b 2010wk40
hgs
parents:
diff changeset
   632
			 break;
b8ed18f6c07b 2010wk40
hgs
parents:
diff changeset
   633
b8ed18f6c07b 2010wk40
hgs
parents:
diff changeset
   634
    	case ELostDataConcealment:
b8ed18f6c07b 2010wk40
hgs
parents:
diff changeset
   635
    	     if (iCurrentToolLostDataConcealment)
b8ed18f6c07b 2010wk40
hgs
parents:
diff changeset
   636
    	     	{
b8ed18f6c07b 2010wk40
hgs
parents:
diff changeset
   637
    	     	aEnabled = ETrue;	
b8ed18f6c07b 2010wk40
hgs
parents:
diff changeset
   638
    	     	}
b8ed18f6c07b 2010wk40
hgs
parents:
diff changeset
   639
    	     else
b8ed18f6c07b 2010wk40
hgs
parents:
diff changeset
   640
    	     	{
b8ed18f6c07b 2010wk40
hgs
parents:
diff changeset
   641
     	     	aEnabled = EFalse;	   	     		
b8ed18f6c07b 2010wk40
hgs
parents:
diff changeset
   642
    	     	}
b8ed18f6c07b 2010wk40
hgs
parents:
diff changeset
   643
    	     status = iCurrentToolLostDataConcealmentStatus;
b8ed18f6c07b 2010wk40
hgs
parents:
diff changeset
   644
    	     break;
b8ed18f6c07b 2010wk40
hgs
parents:
diff changeset
   645
    	default:
b8ed18f6c07b 2010wk40
hgs
parents:
diff changeset
   646
    	     break;     			
b8ed18f6c07b 2010wk40
hgs
parents:
diff changeset
   647
		}
b8ed18f6c07b 2010wk40
hgs
parents:
diff changeset
   648
b8ed18f6c07b 2010wk40
hgs
parents:
diff changeset
   649
	if (!ValidGetStatus(status) &&
b8ed18f6c07b 2010wk40
hgs
parents:
diff changeset
   650
        status != KErrNotSupported)
b8ed18f6c07b 2010wk40
hgs
parents:
diff changeset
   651
        {
b8ed18f6c07b 2010wk40
hgs
parents:
diff changeset
   652
    	status = KErrGeneral;	
b8ed18f6c07b 2010wk40
hgs
parents:
diff changeset
   653
    	}        
b8ed18f6c07b 2010wk40
hgs
parents:
diff changeset
   654
    	
b8ed18f6c07b 2010wk40
hgs
parents:
diff changeset
   655
    return status;
b8ed18f6c07b 2010wk40
hgs
parents:
diff changeset
   656
 
b8ed18f6c07b 2010wk40
hgs
parents:
diff changeset
   657
b8ed18f6c07b 2010wk40
hgs
parents:
diff changeset
   658
    }
b8ed18f6c07b 2010wk40
hgs
parents:
diff changeset
   659
b8ed18f6c07b 2010wk40
hgs
parents:
diff changeset
   660
//------------------------------------------------------------------------------
b8ed18f6c07b 2010wk40
hgs
parents:
diff changeset
   661
// Applies configuration settings to the decoder.
b8ed18f6c07b 2010wk40
hgs
parents:
diff changeset
   662
//------------------------------------------------------------------------------
b8ed18f6c07b 2010wk40
hgs
parents:
diff changeset
   663
EXPORT_C TInt CWmaDecoderIntfcProxy::ApplyConfig()
b8ed18f6c07b 2010wk40
hgs
parents:
diff changeset
   664
    {
b8ed18f6c07b 2010wk40
hgs
parents:
diff changeset
   665
    TInt status = KErrNone;
b8ed18f6c07b 2010wk40
hgs
parents:
diff changeset
   666
    
b8ed18f6c07b 2010wk40
hgs
parents:
diff changeset
   667
    
b8ed18f6c07b 2010wk40
hgs
parents:
diff changeset
   668
       TWmaDecoderConfig configParams;        
b8ed18f6c07b 2010wk40
hgs
parents:
diff changeset
   669
       
b8ed18f6c07b 2010wk40
hgs
parents:
diff changeset
   670
        configParams.iFormat = iFormat;
b8ed18f6c07b 2010wk40
hgs
parents:
diff changeset
   671
        configParams.iBitsPerSample = iBitsPerSample;
b8ed18f6c07b 2010wk40
hgs
parents:
diff changeset
   672
        configParams.iNumChannelsIn = iNumChannelsIn;
b8ed18f6c07b 2010wk40
hgs
parents:
diff changeset
   673
        configParams.iSamplesPerSec = iSamplesPerSec;
b8ed18f6c07b 2010wk40
hgs
parents:
diff changeset
   674
        configParams.iAvgBytesPerSec = iAvgBytesPerSec;
b8ed18f6c07b 2010wk40
hgs
parents:
diff changeset
   675
    	configParams.iBlockAlign = iBlockAlign;
b8ed18f6c07b 2010wk40
hgs
parents:
diff changeset
   676
    	configParams.iEncodeOptions = iEncodeOptions;
b8ed18f6c07b 2010wk40
hgs
parents:
diff changeset
   677
    	configParams.iEncodeOptions1 = iEncodeOptions1;
b8ed18f6c07b 2010wk40
hgs
parents:
diff changeset
   678
     	configParams.iEncodeOptions2 = iEncodeOptions2;   	
b8ed18f6c07b 2010wk40
hgs
parents:
diff changeset
   679
    	configParams.iChannelMask = iChannelMask;
b8ed18f6c07b 2010wk40
hgs
parents:
diff changeset
   680
        configParams.iToolOutPut32Bit = iToolOutPut32Bit;
b8ed18f6c07b 2010wk40
hgs
parents:
diff changeset
   681
        configParams.iToolDownMixToStereo = iToolDownMixToStereo;
b8ed18f6c07b 2010wk40
hgs
parents:
diff changeset
   682
        configParams.iToolLostDataConcealment = iToolLostDataConcealment;
b8ed18f6c07b 2010wk40
hgs
parents:
diff changeset
   683
b8ed18f6c07b 2010wk40
hgs
parents:
diff changeset
   684
b8ed18f6c07b 2010wk40
hgs
parents:
diff changeset
   685
    	TPckgBuf<TWmaDecoderConfig> pckgBuf(configParams);
b8ed18f6c07b 2010wk40
hgs
parents:
diff changeset
   686
    	status = iCustomCommand.CustomCommandSync(iMessageHandler,
b8ed18f6c07b 2010wk40
hgs
parents:
diff changeset
   687
    	                                               EWmaApplyConfig,
b8ed18f6c07b 2010wk40
hgs
parents:
diff changeset
   688
    	                                               pckgBuf,
b8ed18f6c07b 2010wk40
hgs
parents:
diff changeset
   689
    	                                               KNullDesC8);
b8ed18f6c07b 2010wk40
hgs
parents:
diff changeset
   690
    	if (status == KErrNone)
b8ed18f6c07b 2010wk40
hgs
parents:
diff changeset
   691
    		{
b8ed18f6c07b 2010wk40
hgs
parents:
diff changeset
   692
			iCurrentFormat = iFormat;
b8ed18f6c07b 2010wk40
hgs
parents:
diff changeset
   693
        	iCurrentBitsPerSample = iBitsPerSample;
b8ed18f6c07b 2010wk40
hgs
parents:
diff changeset
   694
        	iCurrentNumChannelsIn = iNumChannelsIn;
b8ed18f6c07b 2010wk40
hgs
parents:
diff changeset
   695
        	iCurrentSamplesPerSec = iSamplesPerSec;
b8ed18f6c07b 2010wk40
hgs
parents:
diff changeset
   696
        	iCurrentAvgBytesPerSec = iAvgBytesPerSec;
b8ed18f6c07b 2010wk40
hgs
parents:
diff changeset
   697
        	iCurrentBlockAlign = iBlockAlign;
b8ed18f6c07b 2010wk40
hgs
parents:
diff changeset
   698
        	iCurrentEncodeOptions = iEncodeOptions;
b8ed18f6c07b 2010wk40
hgs
parents:
diff changeset
   699
			iCurrentEncodeOptions1 = iEncodeOptions1;
b8ed18f6c07b 2010wk40
hgs
parents:
diff changeset
   700
			iCurrentEncodeOptions2 = iEncodeOptions2;			
b8ed18f6c07b 2010wk40
hgs
parents:
diff changeset
   701
        	iCurrentChannelMask = iChannelMask;
b8ed18f6c07b 2010wk40
hgs
parents:
diff changeset
   702
            iCurrentToolOutPut32Bit = iToolOutPut32Bit;
b8ed18f6c07b 2010wk40
hgs
parents:
diff changeset
   703
            iCurrentToolDownMixToStereo = iToolDownMixToStereo;
b8ed18f6c07b 2010wk40
hgs
parents:
diff changeset
   704
            iCurrentToolLostDataConcealment = iToolLostDataConcealment;
b8ed18f6c07b 2010wk40
hgs
parents:
diff changeset
   705
b8ed18f6c07b 2010wk40
hgs
parents:
diff changeset
   706
  		    iCurrentFormatStatus = status;
b8ed18f6c07b 2010wk40
hgs
parents:
diff changeset
   707
          	iCurrentBitsPerSampleStatus = status;       
b8ed18f6c07b 2010wk40
hgs
parents:
diff changeset
   708
         	iCurrentNumChannelsInStatus = status ;        
b8ed18f6c07b 2010wk40
hgs
parents:
diff changeset
   709
         	iCurrentSamplesPerSecStatus = status;
b8ed18f6c07b 2010wk40
hgs
parents:
diff changeset
   710
         	iCurrentAvgBytesPerSecStatus = status ;
b8ed18f6c07b 2010wk40
hgs
parents:
diff changeset
   711
         	iCurrentBlockAlignStatus = status;
b8ed18f6c07b 2010wk40
hgs
parents:
diff changeset
   712
         	iCurrentEncodeOptionsStatus = status;
b8ed18f6c07b 2010wk40
hgs
parents:
diff changeset
   713
			iCurrentEncodeOptions1Status = status;
b8ed18f6c07b 2010wk40
hgs
parents:
diff changeset
   714
			iCurrentEncodeOptions2Status = status;		
b8ed18f6c07b 2010wk40
hgs
parents:
diff changeset
   715
        	iCurrentChannelMaskStatus = status;
b8ed18f6c07b 2010wk40
hgs
parents:
diff changeset
   716
        	iCurrentToolOutPut32BitStatus = status;
b8ed18f6c07b 2010wk40
hgs
parents:
diff changeset
   717
        	iCurrentToolDownMixToStereoStatus = status;
b8ed18f6c07b 2010wk40
hgs
parents:
diff changeset
   718
        	iCurrentToolLostDataConcealmentStatus = status;              
b8ed18f6c07b 2010wk40
hgs
parents:
diff changeset
   719
b8ed18f6c07b 2010wk40
hgs
parents:
diff changeset
   720
			iParametersSameAsAdaptation = ETrue;
b8ed18f6c07b 2010wk40
hgs
parents:
diff changeset
   721
       		}
b8ed18f6c07b 2010wk40
hgs
parents:
diff changeset
   722
        else
b8ed18f6c07b 2010wk40
hgs
parents:
diff changeset
   723
        	{
b8ed18f6c07b 2010wk40
hgs
parents:
diff changeset
   724
			iParametersSameAsAdaptation = EFalse;        		
b8ed18f6c07b 2010wk40
hgs
parents:
diff changeset
   725
        	} 
b8ed18f6c07b 2010wk40
hgs
parents:
diff changeset
   726
	return status;
b8ed18f6c07b 2010wk40
hgs
parents:
diff changeset
   727
    }
b8ed18f6c07b 2010wk40
hgs
parents:
diff changeset
   728
b8ed18f6c07b 2010wk40
hgs
parents:
diff changeset
   729
	    
b8ed18f6c07b 2010wk40
hgs
parents:
diff changeset
   730
//------------------------------------------------------------------------------
b8ed18f6c07b 2010wk40
hgs
parents:
diff changeset
   731
// Receive all configure paramemters
b8ed18f6c07b 2010wk40
hgs
parents:
diff changeset
   732
//------------------------------------------------------------------------------
b8ed18f6c07b 2010wk40
hgs
parents:
diff changeset
   733
TInt CWmaDecoderIntfcProxy::GetAllMessage()
b8ed18f6c07b 2010wk40
hgs
parents:
diff changeset
   734
	{
b8ed18f6c07b 2010wk40
hgs
parents:
diff changeset
   735
	TPckgBuf<TAllParams> pckg;
b8ed18f6c07b 2010wk40
hgs
parents:
diff changeset
   736
    TInt status = iCustomCommand.CustomCommandSync(
b8ed18f6c07b 2010wk40
hgs
parents:
diff changeset
   737
                                               iMessageHandler, 
b8ed18f6c07b 2010wk40
hgs
parents:
diff changeset
   738
                                               EWmaGetAllMsg, 
b8ed18f6c07b 2010wk40
hgs
parents:
diff changeset
   739
                                               KNullDesC8,
b8ed18f6c07b 2010wk40
hgs
parents:
diff changeset
   740
                                               KNullDesC8,pckg);
b8ed18f6c07b 2010wk40
hgs
parents:
diff changeset
   741
   	if (status == KErrNone)
b8ed18f6c07b 2010wk40
hgs
parents:
diff changeset
   742
   		{		
b8ed18f6c07b 2010wk40
hgs
parents:
diff changeset
   743
   		iCurrentFormat = pckg().iCurrentFormat;
b8ed18f6c07b 2010wk40
hgs
parents:
diff changeset
   744
		iCurrentFormatStatus = pckg().iCurrentFormatStatus;    	
b8ed18f6c07b 2010wk40
hgs
parents:
diff changeset
   745
b8ed18f6c07b 2010wk40
hgs
parents:
diff changeset
   746
    	iCurrentBitsPerSample = pckg().iCurrentBitsPerSample;
b8ed18f6c07b 2010wk40
hgs
parents:
diff changeset
   747
		iCurrentBitsPerSampleStatus =pckg().iCurrentBitsPerSampleStatus;    	
b8ed18f6c07b 2010wk40
hgs
parents:
diff changeset
   748
b8ed18f6c07b 2010wk40
hgs
parents:
diff changeset
   749
   		iCurrentNumChannelsIn = pckg().iCurrentNumChannelsIn;
b8ed18f6c07b 2010wk40
hgs
parents:
diff changeset
   750
		iCurrentNumChannelsInStatus = pckg().iCurrentNumChannelsInStatus;    	
b8ed18f6c07b 2010wk40
hgs
parents:
diff changeset
   751
b8ed18f6c07b 2010wk40
hgs
parents:
diff changeset
   752
    	iCurrentSamplesPerSec =	pckg().iCurrentSamplesPerSec ;
b8ed18f6c07b 2010wk40
hgs
parents:
diff changeset
   753
		iCurrentSamplesPerSecStatus = pckg().iCurrentSamplesPerSecStatus;    	
b8ed18f6c07b 2010wk40
hgs
parents:
diff changeset
   754
b8ed18f6c07b 2010wk40
hgs
parents:
diff changeset
   755
   		iCurrentAvgBytesPerSec = pckg().iCurrentAvgBytesPerSec;
b8ed18f6c07b 2010wk40
hgs
parents:
diff changeset
   756
		iCurrentAvgBytesPerSecStatus = pckg().iCurrentAvgBytesPerSecStatus;    	
b8ed18f6c07b 2010wk40
hgs
parents:
diff changeset
   757
b8ed18f6c07b 2010wk40
hgs
parents:
diff changeset
   758
   		iCurrentBlockAlign = pckg().iCurrentBlockAlign;
b8ed18f6c07b 2010wk40
hgs
parents:
diff changeset
   759
		iCurrentBlockAlignStatus = pckg().iCurrentBlockAlignStatus;    	
b8ed18f6c07b 2010wk40
hgs
parents:
diff changeset
   760
b8ed18f6c07b 2010wk40
hgs
parents:
diff changeset
   761
   		iCurrentEncodeOptions = pckg().iCurrentEncodeOptions;
b8ed18f6c07b 2010wk40
hgs
parents:
diff changeset
   762
		iCurrentEncodeOptionsStatus = pckg().iCurrentEncodeOptionsStatus ;    	
b8ed18f6c07b 2010wk40
hgs
parents:
diff changeset
   763
b8ed18f6c07b 2010wk40
hgs
parents:
diff changeset
   764
   		iCurrentEncodeOptions1 = pckg().iCurrentEncodeOptions1;
b8ed18f6c07b 2010wk40
hgs
parents:
diff changeset
   765
		iCurrentEncodeOptions1Status = pckg().iCurrentEncodeOptions1Status;    
b8ed18f6c07b 2010wk40
hgs
parents:
diff changeset
   766
		
b8ed18f6c07b 2010wk40
hgs
parents:
diff changeset
   767
   		iCurrentEncodeOptions2 =  pckg().iCurrentEncodeOptions2;
b8ed18f6c07b 2010wk40
hgs
parents:
diff changeset
   768
		iCurrentEncodeOptions2Status = pckg().iCurrentEncodeOptions2Status;    	
b8ed18f6c07b 2010wk40
hgs
parents:
diff changeset
   769
   	
b8ed18f6c07b 2010wk40
hgs
parents:
diff changeset
   770
   		iCurrentChannelMask = pckg().iCurrentChannelMask ;
b8ed18f6c07b 2010wk40
hgs
parents:
diff changeset
   771
		iCurrentChannelMaskStatus = pckg().iCurrentChannelMaskStatus;    	
b8ed18f6c07b 2010wk40
hgs
parents:
diff changeset
   772
   	
b8ed18f6c07b 2010wk40
hgs
parents:
diff changeset
   773
   		iCurrentToolOutPut32Bit = pckg().iCurrentToolOutPut32Bit;
b8ed18f6c07b 2010wk40
hgs
parents:
diff changeset
   774
		iCurrentToolOutPut32BitStatus = pckg().iCurrentToolOutPut32BitStatus;    	
b8ed18f6c07b 2010wk40
hgs
parents:
diff changeset
   775
   	
b8ed18f6c07b 2010wk40
hgs
parents:
diff changeset
   776
   		iCurrentToolDownMixToStereo = pckg().iCurrentToolDownMixToStereo;
b8ed18f6c07b 2010wk40
hgs
parents:
diff changeset
   777
		iCurrentToolDownMixToStereoStatus =  pckg().iCurrentToolDownMixToStereoStatus;    	
b8ed18f6c07b 2010wk40
hgs
parents:
diff changeset
   778
	   	
b8ed18f6c07b 2010wk40
hgs
parents:
diff changeset
   779
   		iCurrentToolLostDataConcealment = pckg().iCurrentToolLostDataConcealment;
b8ed18f6c07b 2010wk40
hgs
parents:
diff changeset
   780
		iCurrentToolLostDataConcealmentStatus = pckg().iCurrentToolLostDataConcealmentStatus ;
b8ed18f6c07b 2010wk40
hgs
parents:
diff changeset
   781
		iParametersSameAsAdaptation = ETrue;    	
b8ed18f6c07b 2010wk40
hgs
parents:
diff changeset
   782
	}
b8ed18f6c07b 2010wk40
hgs
parents:
diff changeset
   783
	return status;
b8ed18f6c07b 2010wk40
hgs
parents:
diff changeset
   784
}
b8ed18f6c07b 2010wk40
hgs
parents:
diff changeset
   785
b8ed18f6c07b 2010wk40
hgs
parents:
diff changeset
   786
//------------------------------------------------------------------------------
b8ed18f6c07b 2010wk40
hgs
parents:
diff changeset
   787
// check return status
b8ed18f6c07b 2010wk40
hgs
parents:
diff changeset
   788
//------------------------------------------------------------------------------
b8ed18f6c07b 2010wk40
hgs
parents:
diff changeset
   789
TBool CWmaDecoderIntfcProxy::ValidGetStatus(TInt aStatus)
b8ed18f6c07b 2010wk40
hgs
parents:
diff changeset
   790
	{
b8ed18f6c07b 2010wk40
hgs
parents:
diff changeset
   791
    if (aStatus != KErrNone  &&  aStatus != KErrCompletion &&
b8ed18f6c07b 2010wk40
hgs
parents:
diff changeset
   792
        aStatus != KErrUnknown &&  aStatus != KErrArgument &&
b8ed18f6c07b 2010wk40
hgs
parents:
diff changeset
   793
        aStatus != KErrNotReady && aStatus != KErrNotFound &&
b8ed18f6c07b 2010wk40
hgs
parents:
diff changeset
   794
        aStatus != KErrGeneral)
b8ed18f6c07b 2010wk40
hgs
parents:
diff changeset
   795
    	{
b8ed18f6c07b 2010wk40
hgs
parents:
diff changeset
   796
    	return EFalse;	
b8ed18f6c07b 2010wk40
hgs
parents:
diff changeset
   797
    	}
b8ed18f6c07b 2010wk40
hgs
parents:
diff changeset
   798
    else
b8ed18f6c07b 2010wk40
hgs
parents:
diff changeset
   799
    	{
b8ed18f6c07b 2010wk40
hgs
parents:
diff changeset
   800
    	return ETrue;
b8ed18f6c07b 2010wk40
hgs
parents:
diff changeset
   801
    	}
b8ed18f6c07b 2010wk40
hgs
parents:
diff changeset
   802
	}
b8ed18f6c07b 2010wk40
hgs
parents:
diff changeset
   803
b8ed18f6c07b 2010wk40
hgs
parents:
diff changeset
   804
b8ed18f6c07b 2010wk40
hgs
parents:
diff changeset
   805
//------------------------------------------------------------------------------
b8ed18f6c07b 2010wk40
hgs
parents:
diff changeset
   806
// GetSupportedFormatsL
b8ed18f6c07b 2010wk40
hgs
parents:
diff changeset
   807
//------------------------------------------------------------------------------
b8ed18f6c07b 2010wk40
hgs
parents:
diff changeset
   808
TInt CWmaDecoderIntfcProxy::GetSupportedFormatsL(RArray<TFormat>& aSupportedFormats)
b8ed18f6c07b 2010wk40
hgs
parents:
diff changeset
   809
	{
b8ed18f6c07b 2010wk40
hgs
parents:
diff changeset
   810
    TInt status = KErrNone;
b8ed18f6c07b 2010wk40
hgs
parents:
diff changeset
   811
b8ed18f6c07b 2010wk40
hgs
parents:
diff changeset
   812
	aSupportedFormats.Reset();
b8ed18f6c07b 2010wk40
hgs
parents:
diff changeset
   813
b8ed18f6c07b 2010wk40
hgs
parents:
diff changeset
   814
	TPckgBuf<TUint> supportedFormatsPkg;
b8ed18f6c07b 2010wk40
hgs
parents:
diff changeset
   815
	status = iCustomCommand.CustomCommandSync(
b8ed18f6c07b 2010wk40
hgs
parents:
diff changeset
   816
	                                           iMessageHandler, 
b8ed18f6c07b 2010wk40
hgs
parents:
diff changeset
   817
                                               EWmaGetNumOfSupportedFormats, 
b8ed18f6c07b 2010wk40
hgs
parents:
diff changeset
   818
                                               KNullDesC8,
b8ed18f6c07b 2010wk40
hgs
parents:
diff changeset
   819
                                               KNullDesC8,
b8ed18f6c07b 2010wk40
hgs
parents:
diff changeset
   820
                                               supportedFormatsPkg);
b8ed18f6c07b 2010wk40
hgs
parents:
diff changeset
   821
    HBufC8* buf = HBufC8::NewLC(supportedFormatsPkg()*sizeof(TUint));
b8ed18f6c07b 2010wk40
hgs
parents:
diff changeset
   822
   	// buf is left on cleanup 
b8ed18f6c07b 2010wk40
hgs
parents:
diff changeset
   823
   	TPtr8 ptr = buf->Des();
b8ed18f6c07b 2010wk40
hgs
parents:
diff changeset
   824
    iCustomCommand.CustomCommandSync(
b8ed18f6c07b 2010wk40
hgs
parents:
diff changeset
   825
                                    iMessageHandler, 
b8ed18f6c07b 2010wk40
hgs
parents:
diff changeset
   826
                                    EWmaGetSupportedFormats, 
b8ed18f6c07b 2010wk40
hgs
parents:
diff changeset
   827
                                    KNullDesC8,
b8ed18f6c07b 2010wk40
hgs
parents:
diff changeset
   828
                                    KNullDesC8,
b8ed18f6c07b 2010wk40
hgs
parents:
diff changeset
   829
                                    ptr);
b8ed18f6c07b 2010wk40
hgs
parents:
diff changeset
   830
  	RDesReadStream stream(ptr);
b8ed18f6c07b 2010wk40
hgs
parents:
diff changeset
   831
    CleanupClosePushL(stream); // stream on cleanup
b8ed18f6c07b 2010wk40
hgs
parents:
diff changeset
   832
   	for (TInt i=0; i<supportedFormatsPkg(); i++)
b8ed18f6c07b 2010wk40
hgs
parents:
diff changeset
   833
    	{
b8ed18f6c07b 2010wk40
hgs
parents:
diff changeset
   834
   		aSupportedFormats.AppendL(static_cast<TFormat>(stream.ReadUint32L()));
b8ed18f6c07b 2010wk40
hgs
parents:
diff changeset
   835
   		}
b8ed18f6c07b 2010wk40
hgs
parents:
diff changeset
   836
   	CleanupStack::PopAndDestroy(&stream);
b8ed18f6c07b 2010wk40
hgs
parents:
diff changeset
   837
   	CleanupStack::PopAndDestroy(buf);    			
b8ed18f6c07b 2010wk40
hgs
parents:
diff changeset
   838
    if (status != KErrNone  && status != KErrNotFound)
b8ed18f6c07b 2010wk40
hgs
parents:
diff changeset
   839
        {
b8ed18f6c07b 2010wk40
hgs
parents:
diff changeset
   840
    	status = KErrGeneral;	    		
b8ed18f6c07b 2010wk40
hgs
parents:
diff changeset
   841
    	}
b8ed18f6c07b 2010wk40
hgs
parents:
diff changeset
   842
b8ed18f6c07b 2010wk40
hgs
parents:
diff changeset
   843
    return status;		
b8ed18f6c07b 2010wk40
hgs
parents:
diff changeset
   844
	}
b8ed18f6c07b 2010wk40
hgs
parents:
diff changeset
   845
b8ed18f6c07b 2010wk40
hgs
parents:
diff changeset
   846
//------------------------------------------------------------------------------
b8ed18f6c07b 2010wk40
hgs
parents:
diff changeset
   847
// GetSupportedToolsL
b8ed18f6c07b 2010wk40
hgs
parents:
diff changeset
   848
//------------------------------------------------------------------------------
b8ed18f6c07b 2010wk40
hgs
parents:
diff changeset
   849
TInt CWmaDecoderIntfcProxy::GetSupportedToolsL(RArray<TTool>& aSupportedTools)
b8ed18f6c07b 2010wk40
hgs
parents:
diff changeset
   850
	{
b8ed18f6c07b 2010wk40
hgs
parents:
diff changeset
   851
	
b8ed18f6c07b 2010wk40
hgs
parents:
diff changeset
   852
	TInt status = KErrNone;
b8ed18f6c07b 2010wk40
hgs
parents:
diff changeset
   853
	aSupportedTools.Reset();
b8ed18f6c07b 2010wk40
hgs
parents:
diff changeset
   854
b8ed18f6c07b 2010wk40
hgs
parents:
diff changeset
   855
	TPckgBuf<TUint> supportedToolsPkg;
b8ed18f6c07b 2010wk40
hgs
parents:
diff changeset
   856
	status = iCustomCommand.CustomCommandSync(
b8ed18f6c07b 2010wk40
hgs
parents:
diff changeset
   857
	                                           iMessageHandler, 
b8ed18f6c07b 2010wk40
hgs
parents:
diff changeset
   858
                                               EWmaGetNumOfSupportedTools, 
b8ed18f6c07b 2010wk40
hgs
parents:
diff changeset
   859
                                               KNullDesC8,
b8ed18f6c07b 2010wk40
hgs
parents:
diff changeset
   860
                                               KNullDesC8,
b8ed18f6c07b 2010wk40
hgs
parents:
diff changeset
   861
                                               supportedToolsPkg);
b8ed18f6c07b 2010wk40
hgs
parents:
diff changeset
   862
                                               
b8ed18f6c07b 2010wk40
hgs
parents:
diff changeset
   863
   	HBufC8* buf = HBufC8::NewLC(supportedToolsPkg()*sizeof(TUint));
b8ed18f6c07b 2010wk40
hgs
parents:
diff changeset
   864
   	// buf is left on cleanup 
b8ed18f6c07b 2010wk40
hgs
parents:
diff changeset
   865
   	TPtr8 ptr = buf->Des();
b8ed18f6c07b 2010wk40
hgs
parents:
diff changeset
   866
b8ed18f6c07b 2010wk40
hgs
parents:
diff changeset
   867
    iCustomCommand.CustomCommandSync(
b8ed18f6c07b 2010wk40
hgs
parents:
diff changeset
   868
                                    iMessageHandler, 
b8ed18f6c07b 2010wk40
hgs
parents:
diff changeset
   869
                                    EWmaGetSupportedTools, 
b8ed18f6c07b 2010wk40
hgs
parents:
diff changeset
   870
                                    KNullDesC8,
b8ed18f6c07b 2010wk40
hgs
parents:
diff changeset
   871
                                    KNullDesC8,
b8ed18f6c07b 2010wk40
hgs
parents:
diff changeset
   872
                                    ptr);
b8ed18f6c07b 2010wk40
hgs
parents:
diff changeset
   873
	RDesReadStream stream(ptr);
b8ed18f6c07b 2010wk40
hgs
parents:
diff changeset
   874
	CleanupClosePushL(stream); // stream on cleanup
b8ed18f6c07b 2010wk40
hgs
parents:
diff changeset
   875
	for (TInt i=0; i<supportedToolsPkg(); i++)
b8ed18f6c07b 2010wk40
hgs
parents:
diff changeset
   876
		{
b8ed18f6c07b 2010wk40
hgs
parents:
diff changeset
   877
		aSupportedTools.AppendL(static_cast<TTool>(stream.ReadUint32L()));
b8ed18f6c07b 2010wk40
hgs
parents:
diff changeset
   878
		}
b8ed18f6c07b 2010wk40
hgs
parents:
diff changeset
   879
	CleanupStack::PopAndDestroy(&stream);
b8ed18f6c07b 2010wk40
hgs
parents:
diff changeset
   880
	CleanupStack::PopAndDestroy(buf);
b8ed18f6c07b 2010wk40
hgs
parents:
diff changeset
   881
   		
b8ed18f6c07b 2010wk40
hgs
parents:
diff changeset
   882
   
b8ed18f6c07b 2010wk40
hgs
parents:
diff changeset
   883
   if (status != KErrNone  && status != KErrNotFound)
b8ed18f6c07b 2010wk40
hgs
parents:
diff changeset
   884
        {
b8ed18f6c07b 2010wk40
hgs
parents:
diff changeset
   885
    	status = KErrGeneral;	    		
b8ed18f6c07b 2010wk40
hgs
parents:
diff changeset
   886
    	}
b8ed18f6c07b 2010wk40
hgs
parents:
diff changeset
   887
    	
b8ed18f6c07b 2010wk40
hgs
parents:
diff changeset
   888
   return status;		
b8ed18f6c07b 2010wk40
hgs
parents:
diff changeset
   889
	}
b8ed18f6c07b 2010wk40
hgs
parents:
diff changeset
   890
       
b8ed18f6c07b 2010wk40
hgs
parents:
diff changeset
   891
//------------------------------------------------------------------------------
b8ed18f6c07b 2010wk40
hgs
parents:
diff changeset
   892
// GetControllableToolsL
b8ed18f6c07b 2010wk40
hgs
parents:
diff changeset
   893
//------------------------------------------------------------------------------
b8ed18f6c07b 2010wk40
hgs
parents:
diff changeset
   894
TInt CWmaDecoderIntfcProxy::GetControllableToolsL(RArray<TTool>& aControllableTools)
b8ed18f6c07b 2010wk40
hgs
parents:
diff changeset
   895
	{
b8ed18f6c07b 2010wk40
hgs
parents:
diff changeset
   896
	TInt status = KErrNone;
b8ed18f6c07b 2010wk40
hgs
parents:
diff changeset
   897
	aControllableTools.Reset();
b8ed18f6c07b 2010wk40
hgs
parents:
diff changeset
   898
b8ed18f6c07b 2010wk40
hgs
parents:
diff changeset
   899
	TPckgBuf<TUint> numPckg;
b8ed18f6c07b 2010wk40
hgs
parents:
diff changeset
   900
	status = iCustomCommand.CustomCommandSync(
b8ed18f6c07b 2010wk40
hgs
parents:
diff changeset
   901
	                                           iMessageHandler, 
b8ed18f6c07b 2010wk40
hgs
parents:
diff changeset
   902
                                               EWmaGetNumOfControllableTools, 
b8ed18f6c07b 2010wk40
hgs
parents:
diff changeset
   903
                                               KNullDesC8,
b8ed18f6c07b 2010wk40
hgs
parents:
diff changeset
   904
                                               KNullDesC8,
b8ed18f6c07b 2010wk40
hgs
parents:
diff changeset
   905
                                               numPckg);
b8ed18f6c07b 2010wk40
hgs
parents:
diff changeset
   906
 
b8ed18f6c07b 2010wk40
hgs
parents:
diff changeset
   907
    HBufC8* buf = HBufC8::NewLC(numPckg()*sizeof(TUint));
b8ed18f6c07b 2010wk40
hgs
parents:
diff changeset
   908
    // buf is left on cleanup 
b8ed18f6c07b 2010wk40
hgs
parents:
diff changeset
   909
    TPtr8 ptr = buf->Des();
b8ed18f6c07b 2010wk40
hgs
parents:
diff changeset
   910
b8ed18f6c07b 2010wk40
hgs
parents:
diff changeset
   911
    iCustomCommand.CustomCommandSync(
b8ed18f6c07b 2010wk40
hgs
parents:
diff changeset
   912
                                               iMessageHandler, 
b8ed18f6c07b 2010wk40
hgs
parents:
diff changeset
   913
                                               EWmaGetControllableTools, 
b8ed18f6c07b 2010wk40
hgs
parents:
diff changeset
   914
                                               KNullDesC8,
b8ed18f6c07b 2010wk40
hgs
parents:
diff changeset
   915
                                               KNullDesC8,
b8ed18f6c07b 2010wk40
hgs
parents:
diff changeset
   916
                                               ptr);
b8ed18f6c07b 2010wk40
hgs
parents:
diff changeset
   917
   	RDesReadStream stream(ptr);
b8ed18f6c07b 2010wk40
hgs
parents:
diff changeset
   918
    CleanupClosePushL(stream); // stream on cleanup
b8ed18f6c07b 2010wk40
hgs
parents:
diff changeset
   919
   	for (TInt i=0; i < numPckg(); i++)
b8ed18f6c07b 2010wk40
hgs
parents:
diff changeset
   920
    	{
b8ed18f6c07b 2010wk40
hgs
parents:
diff changeset
   921
   		aControllableTools.AppendL(static_cast<TTool>(stream.ReadUint32L()));
b8ed18f6c07b 2010wk40
hgs
parents:
diff changeset
   922
   		}
b8ed18f6c07b 2010wk40
hgs
parents:
diff changeset
   923
   	CleanupStack::PopAndDestroy(&stream);
b8ed18f6c07b 2010wk40
hgs
parents:
diff changeset
   924
   	CleanupStack::PopAndDestroy(buf);
b8ed18f6c07b 2010wk40
hgs
parents:
diff changeset
   925
    if (status != KErrNone  && status != KErrNotFound)
b8ed18f6c07b 2010wk40
hgs
parents:
diff changeset
   926
        {
b8ed18f6c07b 2010wk40
hgs
parents:
diff changeset
   927
    	status = KErrGeneral;	    		
b8ed18f6c07b 2010wk40
hgs
parents:
diff changeset
   928
    	}
b8ed18f6c07b 2010wk40
hgs
parents:
diff changeset
   929
b8ed18f6c07b 2010wk40
hgs
parents:
diff changeset
   930
    return status;    	
b8ed18f6c07b 2010wk40
hgs
parents:
diff changeset
   931
	}
b8ed18f6c07b 2010wk40
hgs
parents:
diff changeset
   932
b8ed18f6c07b 2010wk40
hgs
parents:
diff changeset
   933
b8ed18f6c07b 2010wk40
hgs
parents:
diff changeset
   934
b8ed18f6c07b 2010wk40
hgs
parents:
diff changeset
   935
// End of File