First public contribution.
2 * Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
4 * This component and the accompanying materials are made available
5 * under the terms of "Eclipse Public License v1.0"
6 * which accompanies this distribution, and is available
7 * at the URL "http://www.eclipse.org/legal/epl-v10.html".
9 * Initial Contributors:
10 * Nokia Corporation - initial contribution.
22 This contains CT_MdaDevSoundData
25 #if (!defined __T_MDADEVSOUND_DATA_H__)
26 #define __T_MDADEVSOUND_DATA_H__
29 #include "DataWrapperBase.h"
30 #include "sound_util.h"
31 #include "t_soundactivecallback.h"
38 * Class to wrap RMdaDevSound APIs.
41 class CT_MdaDevSoundData: public CDataWrapperBase
45 * Two phase constructor
47 * @leave system wide error
49 static CT_MdaDevSoundData* NewL(RMdaDevSound* aServerStore);
53 ~CT_MdaDevSoundData();
56 * Process a command read from the ini file
58 * @param aCommand requiring command to be processed
59 * @param aSection the section in the ini file requiring the command to be processed
60 * @param aAsyncErrorIndex the index of asynchronous command error code belongs to.
62 * @leave system wide error
64 * @return ETrue if the command is processed
66 virtual TBool DoCommandL(const TTEFFunction& aCommand, const TTEFSectionName& aSection, const TInt aAsyncErrorIndex);
69 * Return a pointer to the object that the data wraps
71 * @return pointer to the object that the data wraps
73 virtual TAny* GetObject();
74 virtual void SetObjectL(TAny* aAny);
75 virtual void DisownObjectL();
77 inline virtual TCleanupOperation CleanupOperation();
80 * Query to see if there are any outstanding requests
82 * @return ETrue if there are any outstanding requests
85 void RunL(CActive* aActive, TInt aIndex);
86 void DoCancel(CActive* aActive, TInt aIndex);
90 * Protected constructor. First phase construction
92 CT_MdaDevSoundData(RMdaDevSound* aServerStore);
94 * Second phase construction
99 static void CleanupOperation( TAny* aAny );
105 void DoCmdOpen(const TDesC& aSection);
107 void DoCmdDestructor();
108 void DoCmdIsMdaSound();
109 void DoCmdVersionRequired(const TDesC& aSection);
114 void DoCmdPlayVolume(const TDesC& aSection);
115 void DoCmdSetPlayVolume(const TDesC& aSection);
116 void DoCmdPlayDataL(const TDesC& aSection, const TInt aAsyncErrorIndex);
117 void DoCmdCancelPlayData();
118 void DoCmdFlushPlayBuffer();
119 void DoCmdNotifyPlayErrorL(const TInt aAsyncErrorIndex);
120 void DoCmdCancelNotifyPlayError();
121 void DoCmdBytesPlayed(const TDesC& aSection);
122 void DoCmdResetBytesPlayed();
123 void DoCmdPausePlayBuffer();
124 void DoCmdResumePlaying();
129 void DoCmdRecordDataL(const TDesC& aSection, const TInt aAsyncErrorIndex);
130 void DoCmdCancelRecordData();
131 void DoCmdFlushRecordBuffer();
132 void DoCmdRecordLevel(const TDesC& aSection);
133 void DoCmdSetRecordLevel(const TDesC& aSection);
134 void DoCmdNotifyRecordErrorL(const TInt aAsyncErrorIndex);
135 void DoCmdCancelNotifyRecordError();
140 void DoCmdPlayFormatsSupportedL(const TDesC& aSection);
141 void DoCmdGetPlayFormatL(const TDesC& aSection);
142 void DoCmdSetPlayFormatL(const TDesC& aSection);
143 void DoCmdRecordFormatsSupportedL(const TDesC& aSection);
144 void DoCmdGetRecordFormatL(const TDesC& aSection);
145 void DoCmdSetRecordFormatL(const TDesC& aSection);
150 void DoCmdUtilityLoadDrivers(const TDesC& aSection);
151 void DoCmdUtilityFreeDrivers(const TDesC& aSection);
152 void DoCmdUtilityDeleteFileL(const TDesC& aSection);
161 /** RMdaDevSound class instance that is tested */
162 RMdaDevSound* iMdaDevSound;
164 /** Reference to RMdaDevSound object stored on server side */
165 RMdaDevSound* iServerStore;
167 /** The request status for playback errors */
168 RPointerArray<CActiveCallback> iNotifyPlayError;
170 /** The request status for recording errors */
171 RPointerArray<CActiveCallback> iNotifyRecordError;
173 /** The request status for sound playback */
174 RPointerArray<CT_SoundActiveCallback> iPlay;
176 /** The request status for sound recording */
177 RPointerArray<CT_SoundActiveCallback> iRecord;
180 #define GET_MANDATORY_STRING_PARAMETER(aParamName, aSection, aResult) GetCommandStringParameter(aParamName, aSection, aResult, (TText8*)__FILE__, __LINE__, ETrue)
181 #define GET_MANDATORY_INT_PARAMETER(aParamName, aSection, aResult) GetCommandIntParameter(aParamName, aSection, aResult,(TText8*) __FILE__, __LINE__, ETrue)
182 #define GET_MANDATORY_INT64_PARAMETER(aParamName, aSection, aResult) GetCommandInt64Parameter(aParamName, aSection, aResult,(TText8*) __FILE__, __LINE__, ETrue)
183 #define GET_MANDATORY_BOOL_PARAMETER(aParamName, aSection, aResult) GetCommandBoolParameter(aParamName, aSection, aResult, (TText8*)__FILE__, __LINE__, ETrue)
185 #define GET_OPTIONAL_STRING_PARAMETER(aParamName, aSection, aResult) GetCommandStringParameter(aParamName, aSection, aResult, (TText8*) __FILE__, __LINE__, EFalse)
186 #define GET_OPTIONAL_INT_PARAMETER(aParamName, aSection, aResult) GetCommandIntParameter(aParamName, aSection, aResult,(TText8*) __FILE__, __LINE__, EFalse)
187 #define GET_OPTIONAL_INT64_PARAMETER(aParamName, aSection, aResult) GetCommandInt64Parameter(aParamName, aSection, aResult,(TText8*) __FILE__, __LINE__, EFalse)
188 #define GET_OPTIONAL_BOOL_PARAMETER(aParamName, aSection, aResult) GetCommandBoolParameter(aParamName, aSection, aResult,(TText8*) __FILE__, __LINE__, EFalse)
190 #endif /* __T_MDADEVSOUND_DATA_H__ */