|
1 // Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies). |
|
2 // All rights reserved. |
|
3 // This component and the accompanying materials are made available |
|
4 // under the terms of "Eclipse Public License v1.0" |
|
5 // which accompanies this distribution, and is available |
|
6 // at the URL "http://www.eclipse.org/legal/epl-v10.html". |
|
7 // |
|
8 // Initial Contributors: |
|
9 // Nokia Corporation - initial contribution. |
|
10 // |
|
11 // Contributors: |
|
12 // |
|
13 // Description: |
|
14 // |
|
15 |
|
16 #include <ecom/implementationproxy.h> |
|
17 #include <ecom/implementationproxy.h> |
|
18 #include <ecom/ecom.h> |
|
19 #include <f32file.h> |
|
20 #include "audiodspcontroltestdevice.h" |
|
21 #include "devsoundciutestdevices.hrh" |
|
22 |
|
23 |
|
24 /* |
|
25 CMMFAudioDspControl implementation |
|
26 */ |
|
27 CMMFAudioDspControl* CMMFAudioDspControl::NewL() |
|
28 { |
|
29 CMMFAudioDspControl* self = new(ELeave) CMMFAudioDspControl(); |
|
30 return self; |
|
31 } |
|
32 |
|
33 CMMFAudioDspControl::~CMMFAudioDspControl() |
|
34 { |
|
35 } |
|
36 |
|
37 //Actual implementation of method MmdspcGetAudioPlaybackInfo |
|
38 TInt CMMFAudioDspControl::MmdspcGetAudioPlaybackInfo (TInt64& aSamplesPlayed, TInt64& aSystemTime, TUint& aB, TUint& aT) |
|
39 { |
|
40 aSamplesPlayed = 999; |
|
41 aSystemTime = 999; |
|
42 aB = 999; |
|
43 aT = 999; |
|
44 |
|
45 return KErrNone; |
|
46 } |
|
47 |
|
48 //Actual implementation of method MmdspcAcceptRecordBuffersInvalidFollowingStop |
|
49 TInt CMMFAudioDspControl::MmdspcAcceptRecordBuffersInvalidFollowingStop() |
|
50 { |
|
51 return KErrNone; |
|
52 } |
|
53 |
|
54 //Actual implementation of method MmdspcAcceptPlaybackBuffersInvalidFollowingStop |
|
55 TInt CMMFAudioDspControl::MmdspcAcceptPlaybackBuffersInvalidFollowingStop() |
|
56 { |
|
57 return KErrNone; |
|
58 } |
|
59 |
|
60 |
|
61 /* |
|
62 implementation |
|
63 */ |
|
64 CMMFHwDevice* CAudioDspControlTestDevice::NewL() |
|
65 { |
|
66 CAudioDspControlTestDevice* self=new(ELeave) CAudioDspControlTestDevice(); |
|
67 CleanupStack::PushL(self); |
|
68 self->ConstructL(); |
|
69 CleanupStack::Pop(self); |
|
70 return self; |
|
71 } |
|
72 |
|
73 CAudioDspControlTestDevice::~CAudioDspControlTestDevice() |
|
74 { |
|
75 delete iAudioDspControl; |
|
76 } |
|
77 |
|
78 CAudioDspControlTestDevice::CAudioDspControlTestDevice() |
|
79 { |
|
80 } |
|
81 |
|
82 void CAudioDspControlTestDevice::ConstructL() |
|
83 { |
|
84 } |
|
85 |
|
86 TInt CAudioDspControlTestDevice::Start(TDeviceFunc /*aFuncCmd*/, TDeviceFlow /*aFlowCmd*/) |
|
87 { |
|
88 return 0; |
|
89 } |
|
90 |
|
91 TInt CAudioDspControlTestDevice::Stop() |
|
92 { |
|
93 return 0; |
|
94 } |
|
95 |
|
96 TInt CAudioDspControlTestDevice::Pause() |
|
97 { |
|
98 return 0; |
|
99 } |
|
100 |
|
101 TInt CAudioDspControlTestDevice::Init(THwDeviceInitParams& /*aDevInfo*/) |
|
102 { |
|
103 return 0; |
|
104 } |
|
105 |
|
106 TAny* CAudioDspControlTestDevice::CustomInterface(TUid aInterfaceId) |
|
107 { |
|
108 // Just return something non-NULL to keep the |
|
109 // DevSound initialisation process happy |
|
110 TAny* ret = static_cast<TAny*>(this); |
|
111 |
|
112 // Now for the CIs we want to test... |
|
113 if (aInterfaceId == KUidDSPControl) |
|
114 { |
|
115 if (!iAudioDspControl) |
|
116 { |
|
117 TRAPD(err, iAudioDspControl = CMMFAudioDspControl::NewL()); |
|
118 if (err == KErrNone && iAudioDspControl) |
|
119 { |
|
120 MMMFDSPControl* ptr = this; |
|
121 ret = static_cast<TAny*>(ptr); |
|
122 } |
|
123 else |
|
124 { |
|
125 ret = NULL; |
|
126 } |
|
127 } |
|
128 } |
|
129 |
|
130 return ret; |
|
131 } |
|
132 |
|
133 TInt CAudioDspControlTestDevice::ThisHwBufferFilled(CMMFBuffer& /*aFillBufferPtr*/) |
|
134 { |
|
135 return 0; |
|
136 } |
|
137 |
|
138 TInt CAudioDspControlTestDevice::ThisHwBufferEmptied(CMMFBuffer& /*aEmptyBufferPtr*/) |
|
139 { |
|
140 return 0; |
|
141 } |
|
142 |
|
143 TInt CAudioDspControlTestDevice::SetConfig(TTaskConfig& /*aConfig*/) |
|
144 { |
|
145 return 0; |
|
146 } |
|
147 |
|
148 TInt CAudioDspControlTestDevice::StopAndDeleteCodec() |
|
149 { |
|
150 return 0; |
|
151 } |
|
152 |
|
153 TInt CAudioDspControlTestDevice::DeleteCodec() |
|
154 { |
|
155 return 0; |
|
156 } |
|
157 |
|
158 CMMFSwCodec& CAudioDspControlTestDevice::Codec() |
|
159 { |
|
160 return *iCodec; |
|
161 } |
|
162 |
|
163 TInt CAudioDspControlTestDevice::MmdspcGetAudioPlaybackInfo (TInt64& aSamplesPlayed, TInt64& aSystemTime, TUint& aB, TUint& aT) |
|
164 { |
|
165 TInt result = KErrBadHandle; |
|
166 |
|
167 if (iAudioDspControl) |
|
168 { |
|
169 result = iAudioDspControl->MmdspcGetAudioPlaybackInfo (aSamplesPlayed, aSystemTime, aB, aT); |
|
170 } |
|
171 |
|
172 return result; |
|
173 } |
|
174 |
|
175 TInt CAudioDspControlTestDevice::MmdspcAcceptRecordBuffersInvalidFollowingStop() |
|
176 { |
|
177 TInt result = KErrBadHandle; |
|
178 |
|
179 if (iAudioDspControl) |
|
180 { |
|
181 result = iAudioDspControl->MmdspcAcceptRecordBuffersInvalidFollowingStop(); |
|
182 } |
|
183 |
|
184 return result; |
|
185 } |
|
186 |
|
187 TInt CAudioDspControlTestDevice::MmdspcAcceptPlaybackBuffersInvalidFollowingStop() |
|
188 { |
|
189 TInt result = KErrBadHandle; |
|
190 |
|
191 if (iAudioDspControl) |
|
192 { |
|
193 result = iAudioDspControl->MmdspcAcceptPlaybackBuffersInvalidFollowingStop(); |
|
194 } |
|
195 |
|
196 return result; |
|
197 } |