|
1 /* |
|
2 * Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). |
|
3 * All rights reserved. |
|
4 * This component and the accompanying materials are made available |
|
5 * under the terms of "Eclipse Public License v1.0" |
|
6 * which accompanies this distribution, and is available |
|
7 * at the URL "http://www.eclipse.org/legal/epl-v10.html". |
|
8 * |
|
9 * Initial Contributors: |
|
10 * Nokia Corporation - initial contribution. |
|
11 * |
|
12 * Contributors: |
|
13 * |
|
14 * Description: AudioRecorder test |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 #if !defined(AFX_RECORDINGBASE_H__AAF8C761_831F_409A_9DC1_D2D05E1180DA__INCLUDED_) |
|
20 #define AFX_RECORDINGBASE_H__AAF8C761_831F_409A_9DC1_D2D05E1180DA__INCLUDED_ |
|
21 |
|
22 #if _MSC_VER > 1000 |
|
23 #pragma once |
|
24 #endif // _MSC_VER > 1000 |
|
25 |
|
26 #include <MdaAudioSampleEditor.h> |
|
27 #include "TestCaseBase.h" |
|
28 #include "MediaEvent.h" |
|
29 |
|
30 class CRecordingBase; |
|
31 |
|
32 typedef CRecordingBase* recPtr; |
|
33 typedef recPtr (*CreateObjectFunction)(CTestModuleIf*, CStifLogger*); |
|
34 |
|
35 class CRecordingBase : public CTestCaseBase, public MMdaObjectStateChangeObserver, public MEventTarget |
|
36 { |
|
37 public: |
|
38 CRecordingBase(CTestModuleIf *aConsole, CStifLogger *aLogger); |
|
39 virtual ~CRecordingBase(); |
|
40 |
|
41 //To recieve AudioRecorderUtility notifications |
|
42 virtual void MoscoStateChangeEvent(CBase* aObject, TInt aPreviousState, TInt aCurrentState, TInt aErrorCode); |
|
43 |
|
44 //To process after timer is completed |
|
45 virtual TInt ExecuteL(CParameters *aParams); |
|
46 |
|
47 static CRecordingBase* NewL(CTestModuleIf *aConsole, CStifLogger *aLogger, TFileName* fileName, CreateObjectFunction coFunc = NULL); |
|
48 |
|
49 TInt StartRecordingL(); |
|
50 |
|
51 CMdaAudioRecorderUtility* recorder; |
|
52 |
|
53 TTimeIntervalMicroSeconds timeToRecord; |
|
54 |
|
55 // TUint maxFileSize; |
|
56 TInt maxFileSize; |
|
57 TInt relativeGain; |
|
58 TInt callbackErr; |
|
59 TInt expectedBalance; |
|
60 TInt expectedBitRate; |
|
61 TInt expectedChannel; |
|
62 TInt expectedSampleRate; |
|
63 TInt fromBeging; |
|
64 TInt relativePos; |
|
65 TInt64 existingDuration; |
|
66 |
|
67 TTimeIntervalMicroSeconds timeAvailable; |
|
68 TTimeIntervalMicroSeconds fileDuration; |
|
69 TTimeIntervalMicroSeconds newFileDuration; |
|
70 TTimeIntervalMicroSeconds position; |
|
71 |
|
72 TFileName recordingFileName; |
|
73 bool CropTest; |
|
74 bool isMp4; |
|
75 bool isWav; |
|
76 bool isAmr; |
|
77 bool isBitRateTest; |
|
78 |
|
79 //To create an object of the derived class |
|
80 static CRecordingBase* CreateObjectL(CTestModuleIf *aConsole, CStifLogger *aLogger); |
|
81 |
|
82 //To forward the run test case |
|
83 static TInt RunTestL(CTestModuleIf *aConsole, CStifLogger *aLogger, CStifSectionParser *aParser, TInt* clipCounter, CreateObjectFunction coFunc = NULL); |
|
84 |
|
85 //Pre process before start recording |
|
86 virtual TInt PreProcess(CStifSectionParser *aParser); |
|
87 |
|
88 //Post process after recording is done |
|
89 virtual TInt PostProcess(CStifSectionParser *aParser); |
|
90 |
|
91 static TInt SimpleRecordL(CTestModuleIf *aConsole, CStifLogger *aLogger, CRecordingBase* recObj, TBool doProcess = false, CStifSectionParser* aParser = NULL, TBool doTimer = true); |
|
92 |
|
93 static TInt CreateRecorderL(CTestModuleIf *aConsole, CStifLogger *aLogger, CStifSectionParser *aParser, TInt* clipCounter, CreateObjectFunction coFunc, CRecordingBase*& recObj, TBool nameReq = true, TBool sizeReq = true); |
|
94 |
|
95 void ConstructL(TFileName * fileName); |
|
96 |
|
97 static void GetFileName(TPtrC path, TFileName* fileName, TInt clipCounter); |
|
98 |
|
99 TTimeIntervalMicroSeconds Duration(); |
|
100 }; |
|
101 |
|
102 #endif // !defined(AFX_RECORDINGBASE_H__AAF8C761_831F_409A_9DC1_D2D05E1180DA__INCLUDED_) |