|
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: Audio stream test component |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 #ifndef STREAMER_BASE_H |
|
20 #define STREAMER_BASE_H |
|
21 |
|
22 //#include <StifTestInterface.h> |
|
23 #include <MdaAudioOutputStream.h> |
|
24 #include <StifLogger.h> |
|
25 #include "mda/common/audio.h" |
|
26 #include "EventTarget.h" |
|
27 #include "AudioStreamConstants.h" |
|
28 //#include "TestModuleConstants.h" |
|
29 |
|
30 class CStreamerBase : public CBase , public MEventTarget |
|
31 { |
|
32 private: |
|
33 void Exit(TInt aExitCode); |
|
34 protected: |
|
35 CStreamerBase(CStifLogger *aLogger); |
|
36 |
|
37 public: |
|
38 ~CStreamerBase(); |
|
39 |
|
40 virtual void SetPriority(TInt aPriority, TMdaPriorityPreference aPref)=0; |
|
41 virtual TInt GetBalanceL()=0; |
|
42 virtual void SetBalanceL(TInt aBalance)=0; |
|
43 |
|
44 void SetId(TInt aId); |
|
45 |
|
46 TInt GetId(); |
|
47 TInt GetFinalError(); |
|
48 |
|
49 TTimeIntervalMicroSeconds GetExecDuration(); |
|
50 TTime GetStartTime(); |
|
51 TTime GetStopTime(); |
|
52 |
|
53 TInt AppendBuffer(TDes8 *aBuffer); |
|
54 TMdaAudioDataSettings::TAudioCaps TranslateRate(TInt aSampleRate, TMdaAudioDataSettings::TAudioCaps aDefaultSampleRate); |
|
55 |
|
56 void SetExitAfterOpen(TBool aFlag); |
|
57 |
|
58 public: |
|
59 static const TInt KBitRate8; |
|
60 static const TInt KSampleRate8000Hz; |
|
61 static const TInt KSampleRate11025Hz; |
|
62 static const TInt KSampleRate12000Hz; |
|
63 static const TInt KSampleRate16000Hz; |
|
64 static const TInt KSampleRate22050Hz; |
|
65 static const TInt KSampleRate24000Hz; |
|
66 static const TInt KSampleRate32000Hz; |
|
67 static const TInt KSampleRate44100Hz; |
|
68 static const TInt KSampleRate48000Hz; |
|
69 static const TInt KSampleRate64000Hz; |
|
70 static const TInt KSampleRate96000Hz; |
|
71 |
|
72 static const TInt KChannelsMono; |
|
73 static const TInt KChannelsStereo; |
|
74 |
|
75 protected: |
|
76 TInt iFinalError; |
|
77 TInt iId; |
|
78 |
|
79 //CStifLogger *iLogger; |
|
80 CStifLogger *iLogger; |
|
81 |
|
82 RPointerArray<TDes8> iBuffers; |
|
83 TInt iCurrentBuffer; |
|
84 |
|
85 TBool iPlayInmediately; |
|
86 TBool iExitAfterOpen; |
|
87 |
|
88 TTime iLastStartTime; |
|
89 TTime iLastStopTime; |
|
90 |
|
91 private: |
|
92 }; |
|
93 |
|
94 #endif // STREAMER_BASE_H |