mpxplugins/serviceplugins/playbackplugins/audioeffects/src/mpxaudioeffectengine.cpp
equal
deleted
inserted
replaced
107 EXPORT_C void CMPXAudioEffectEngine::SetBalanceL() |
107 EXPORT_C void CMPXAudioEffectEngine::SetBalanceL() |
108 { |
108 { |
109 iProp->LoadFromFileL(); |
109 iProp->LoadFromFileL(); |
110 if(iMdaPlayer) |
110 if(iMdaPlayer) |
111 { |
111 { |
112 if(iMdaPlayer->SetBalance(iProp->Balance())!=KErrNone) |
112 TInt currentBalance; |
113 { |
113 TInt err = iMdaPlayer->GetBalance(currentBalance); |
114 User::Leave(KErrNotSupported); |
114 if( err !=KErrNone ) |
|
115 { |
|
116 User::Leave(KErrNotSupported); |
|
117 } |
|
118 // don't set non-changed values: |
|
119 if( iProp->Balance() != currentBalance ) |
|
120 { |
|
121 err = iMdaPlayer->SetBalance(iProp->Balance()); |
|
122 if( err !=KErrNone ) |
|
123 { |
|
124 User::Leave(KErrNotSupported); |
|
125 } |
115 } |
126 } |
116 } |
127 } |
117 } |
128 } |
118 |
129 |
119 |
130 |
217 iStereoEffect = NULL; |
228 iStereoEffect = NULL; |
218 User::Leave(KErrNotSupported); |
229 User::Leave(KErrNotSupported); |
219 } |
230 } |
220 } |
231 } |
221 |
232 |
222 iStereoEffect->EnableL(); |
233 if ( !iStereoEffect->IsEnabled() ) |
223 TUint8 level = 30; |
234 { |
224 iStereoEffect->SetStereoWideningLevelL( level ); |
235 iStereoEffect->EnableL(); |
225 iStereoEffect->ApplyL(); |
236 TUint8 level = 30; |
|
237 iStereoEffect->SetStereoWideningLevelL( level ); |
|
238 iStereoEffect->ApplyL(); |
|
239 } |
|
240 |
226 } |
241 } |
227 else |
242 else |
228 { |
243 { |
229 if (iStereoEffect) // If audio effects was not on, then no need to disable |
244 if (iStereoEffect && iStereoEffect->IsEnabled() ) // If audio effects was not on, then no need to disable |
230 { |
245 { |
231 iStereoEffect->DisableL(); |
246 iStereoEffect->DisableL(); |
232 } |
247 } |
233 } |
248 } |
234 #endif |
249 #endif |
293 else |
308 else |
294 { |
309 { |
295 } |
310 } |
296 } |
311 } |
297 |
312 |
298 iLoudnessEffect->EnableL(); |
313 if( !iLoudnessEffect->IsEnabled() ) |
|
314 { |
|
315 iLoudnessEffect->EnableL(); |
|
316 } |
299 } |
317 } |
300 else |
318 else |
301 { |
319 { |
302 if( iLoudnessEffect ) // Only disable if it was constructed |
320 if( iLoudnessEffect && iLoudnessEffect->IsEnabled() ) |
303 { |
321 { |
304 iLoudnessEffect->DisableL(); |
322 iLoudnessEffect->DisableL(); |
305 } |
323 } |
306 } |
324 } |
307 #endif |
325 #endif |
308 } |
326 } |