equal
deleted
inserted
replaced
19 #include <stdlib.h> |
19 #include <stdlib.h> |
20 #include <assert.h> |
20 #include <assert.h> |
21 |
21 |
22 #include "xavolumeitf.h" |
22 #include "xavolumeitf.h" |
23 |
23 |
24 #include "xavolumeitfadaptation.h" |
|
25 #include "xanokiavolumeextitfadaptationmmf.h" |
24 #include "xanokiavolumeextitfadaptationmmf.h" |
26 /** |
25 /** |
27 * XAVolumeItfImpl* GetImpl(XAVolumeItf self) |
26 * XAVolumeItfImpl* GetImpl(XAVolumeItf self) |
28 * Description: Validated interface pointer and cast it to implementations pointer. |
27 * Description: Validated interface pointer and cast it to implementations pointer. |
29 **/ |
28 **/ |
79 == XA_RESULT_PRECONDITIONS_VIOLATED) |
78 == XA_RESULT_PRECONDITIONS_VIOLATED) |
80 { |
79 { |
81 DEBUG_API("<-XAVolumeItfImpl_SetVolumeLevel"); |
80 DEBUG_API("<-XAVolumeItfImpl_SetVolumeLevel"); |
82 return ret; |
81 return ret; |
83 } |
82 } |
84 if (impl->adapCtx->fwtype == FWMgrFWGST) |
|
85 { |
|
86 ret = XAVolumeItfAdapt_SetVolumeLevel( |
|
87 (XAAdaptationGstCtx*) impl->adapCtx, level); |
|
88 } |
|
89 else |
|
90 { |
|
91 impl->volumeLevel = level; |
|
92 } |
|
93 |
83 |
94 if (ret == XA_RESULT_SUCCESS) |
84 if (ret == XA_RESULT_SUCCESS) |
95 { |
85 { |
96 impl->volumeLevel = level; |
86 impl->volumeLevel = level; |
97 } |
87 } |
150 == XA_RESULT_PRECONDITIONS_VIOLATED) |
140 == XA_RESULT_PRECONDITIONS_VIOLATED) |
151 { |
141 { |
152 DEBUG_API("<-XAVolumeItfImpl_GetMaxVolumeLevel"); |
142 DEBUG_API("<-XAVolumeItfImpl_GetMaxVolumeLevel"); |
153 return ret; |
143 return ret; |
154 } |
144 } |
155 if (impl->adapCtx->fwtype == FWMgrFWGST) |
145 *pMaxLevel = MAX_SUPPORT_VOLUME_LEVEL; |
156 { |
|
157 ret = XAVolumeItfAdapt_GetMaxVolumeLevel( |
|
158 (XAAdaptationGstCtx*) impl->adapCtx, pMaxLevel); |
|
159 } |
|
160 else |
|
161 { |
|
162 *pMaxLevel = MAX_SUPPORT_VOLUME_LEVEL; |
|
163 } |
|
164 |
146 |
165 XAAdaptationBase_ThreadExit(impl->adapCtx); |
147 XAAdaptationBase_ThreadExit(impl->adapCtx); |
166 |
148 |
167 DEBUG_API("<-XAVolumeItfImpl_GetMaxVolumeLevel"); |
149 DEBUG_API("<-XAVolumeItfImpl_GetMaxVolumeLevel"); |
168 return ret; |
150 return ret; |
199 if (impl->adapCtx->fwtype == FWMgrFWMMF) |
181 if (impl->adapCtx->fwtype == FWMgrFWMMF) |
200 { |
182 { |
201 ret = XANokiaVolumeExtItfAdapt_SetMute( |
183 ret = XANokiaVolumeExtItfAdapt_SetMute( |
202 (XAAdaptationMMFCtx*) impl->adapCtx, mute); |
184 (XAAdaptationMMFCtx*) impl->adapCtx, mute); |
203 } |
185 } |
204 else |
|
205 { |
|
206 ret = XAVolumeItfAdapt_SetMute( |
|
207 (XAAdaptationGstCtx*) impl->adapCtx, mute); |
|
208 } |
|
209 |
186 |
210 if (ret == XA_RESULT_SUCCESS) |
187 if (ret == XA_RESULT_SUCCESS) |
211 { |
188 { |
212 impl->mute = mute; |
189 impl->mute = mute; |
213 } |
190 } |
270 return ret; |
247 return ret; |
271 } |
248 } |
272 /* Check is stereo position state changed */ |
249 /* Check is stereo position state changed */ |
273 if (enable != impl->enableStereoPos) |
250 if (enable != impl->enableStereoPos) |
274 { |
251 { |
275 if (impl->adapCtx->fwtype == FWMgrFWGST) |
252 if (impl->adapCtx->fwtype == FWMgrFWMMF) |
276 { |
|
277 ret = XAVolumeItfAdapt_EnableStereoPosition( |
|
278 (XAAdaptationGstCtx*) impl->adapCtx, enable); |
|
279 } |
|
280 else |
|
281 { |
253 { |
282 ret = XANokiaVolumeExtItfAdapt_EnableStereoPosition( |
254 ret = XANokiaVolumeExtItfAdapt_EnableStereoPosition( |
283 (XAAdaptationMMFCtx*) impl->adapCtx, enable); |
255 (XAAdaptationMMFCtx*) impl->adapCtx, enable); |
284 } |
256 } |
285 if (ret == XA_RESULT_SUCCESS) |
257 if (ret == XA_RESULT_SUCCESS) |
351 return ret; |
323 return ret; |
352 } |
324 } |
353 /* check is stereo position effect enabled if is then handle effect */ |
325 /* check is stereo position effect enabled if is then handle effect */ |
354 if (impl->enableStereoPos) |
326 if (impl->enableStereoPos) |
355 { |
327 { |
356 if (impl->adapCtx->fwtype == FWMgrFWGST) |
328 if (impl->adapCtx->fwtype == FWMgrFWMMF) |
357 { |
|
358 ret = XAVolumeItfAdapt_SetStereoPosition( |
|
359 (XAAdaptationGstCtx*) impl->adapCtx, stereoPosition); |
|
360 } |
|
361 else |
|
362 { |
329 { |
363 ret = XANokiaVolumeExtItfAdapt_SetStereoPosition( |
330 ret = XANokiaVolumeExtItfAdapt_SetStereoPosition( |
364 (XAAdaptationMMFCtx*) impl->adapCtx, stereoPosition); |
331 (XAAdaptationMMFCtx*) impl->adapCtx, stereoPosition); |
365 } |
332 } |
366 } |
333 } |