186 |
186 |
187 This signal is emitted when framework receives a volume related property notification, |
187 This signal is emitted when framework receives a volume related property notification, |
188 such as EPbPropertyVolume, EPbPropertyMaxVolume, EPbPropertyMute. |
188 such as EPbPropertyVolume, EPbPropertyMaxVolume, EPbPropertyMute. |
189 */ |
189 */ |
190 |
190 |
|
191 /*! |
|
192 \fn void corruptedStop(); |
|
193 |
|
194 This signal is emitted when framework determines the corrupted song is the last |
|
195 song of the playlist. |
|
196 */ |
191 |
197 |
192 /*! |
198 /*! |
193 Constructs music player engine. |
199 Constructs music player engine. |
194 */ |
200 */ |
195 MpEngine::MpEngine() |
201 MpEngine::MpEngine() |
197 mSongScanner(0), |
203 mSongScanner(0), |
198 mMpxCollectionWrapper(0), |
204 mMpxCollectionWrapper(0), |
199 mMpxPlaybackWrapper(0), |
205 mMpxPlaybackWrapper(0), |
200 mAudioEffectsWrapper(0), |
206 mAudioEffectsWrapper(0), |
201 mEqualizerWrapper(0), |
207 mEqualizerWrapper(0), |
202 mCurrentPresetIndex(KEqualizerPresetNone), |
208 mCurrentPresetIndex(0), |
203 mSongData(0), |
209 mSongData(0), |
204 mUsbBlockingState(USB_NotConnected), |
210 mUsbBlockingState(USB_NotConnected), |
205 mPreviousUsbState(USB_NotConnected), |
211 mPreviousUsbState(USB_NotConnected), |
206 mHandleMediaCommands(true) |
212 mHandleMediaCommands(true) |
207 { |
213 { |
287 |
293 |
288 // Playback Wrapper |
294 // Playback Wrapper |
289 mMpxPlaybackWrapper = new MpMpxPlaybackFrameworkWrapper( mHostUid, mSongData ); |
295 mMpxPlaybackWrapper = new MpMpxPlaybackFrameworkWrapper( mHostUid, mSongData ); |
290 connect( this, SIGNAL( libraryUpdated() ), |
296 connect( this, SIGNAL( libraryUpdated() ), |
291 mMpxPlaybackWrapper, SLOT( closeCurrentPlayback() ) ); |
297 mMpxPlaybackWrapper, SLOT( closeCurrentPlayback() ) ); |
292 connect( mMpxPlaybackWrapper, SIGNAL( volumePropertyChanged( MpCommon::MpVolumeProperty, int ) ), |
298 connect( mMpxPlaybackWrapper, SIGNAL ( corruptedStop() ), |
|
299 this, SIGNAL( corruptedStop() )); |
|
300 connect( mMpxPlaybackWrapper, SIGNAL( volumePropertyChanged( MpCommon::MpVolumeProperty, int ) ), |
293 this, SIGNAL( volumePropertyChanged( MpCommon::MpVolumeProperty, int ) ) ); |
301 this, SIGNAL( volumePropertyChanged( MpCommon::MpVolumeProperty, int ) ) ); |
294 |
302 |
295 // AudioEffects wrapper |
303 // AudioEffects wrapper |
296 mAudioEffectsWrapper = new MpAudioEffectsFrameworkWrapper(); |
304 mAudioEffectsWrapper = new MpAudioEffectsFrameworkWrapper(); |
297 } |
305 } |
324 |
332 |
325 // Playback Wrapper |
333 // Playback Wrapper |
326 mMpxPlaybackWrapper = new MpMpxPlaybackFrameworkWrapper( mHostUid, 0 ); |
334 mMpxPlaybackWrapper = new MpMpxPlaybackFrameworkWrapper( mHostUid, 0 ); |
327 connect( this, SIGNAL( libraryUpdated() ), |
335 connect( this, SIGNAL( libraryUpdated() ), |
328 mMpxPlaybackWrapper, SLOT( closeCurrentPlayback() ) ); |
336 mMpxPlaybackWrapper, SLOT( closeCurrentPlayback() ) ); |
329 connect( mMpxPlaybackWrapper, SIGNAL( volumePropertyChanged( MpCommon::MpVolumeProperty, int ) ), |
337 connect( mMpxPlaybackWrapper, SIGNAL ( corruptedStop() ), |
|
338 this, SIGNAL( corruptedStop() )); |
|
339 connect( mMpxPlaybackWrapper, SIGNAL( volumePropertyChanged( MpCommon::MpVolumeProperty, int ) ), |
330 this, SIGNAL( volumePropertyChanged( MpCommon::MpVolumeProperty, int ) ) ); |
340 this, SIGNAL( volumePropertyChanged( MpCommon::MpVolumeProperty, int ) ) ); |
331 |
341 |
332 } |
342 } |
333 else if ( MediaBrowsing == mode ) { |
343 else if ( MediaBrowsing == mode ) { |
334 // Collection Wrapper |
344 // Collection Wrapper |
1120 */ |
1130 */ |
1121 void MpEngine::disableEqualizer() |
1131 void MpEngine::disableEqualizer() |
1122 { |
1132 { |
1123 TX_ENTRY |
1133 TX_ENTRY |
1124 |
1134 |
1125 mCurrentPresetIndex = KEqualizerPresetNone; |
1135 mCurrentPresetIndex = 0; |
1126 // Store in CenRep file |
1136 // Store in CenRep file |
1127 MpSettingsManager::setPreset( mCurrentPresetIndex ); |
1137 MpSettingsManager::setPreset( KEqualizerPresetNone ); |
1128 // Notify playback framework of the change. |
1138 // Notify playback framework of the change. |
1129 mMpxPlaybackWrapper->applyEqualizer(); |
1139 mMpxPlaybackWrapper->applyEqualizer(); |
1130 |
1140 |
1131 TX_EXIT |
1141 TX_EXIT |
1132 } |
1142 } |
1173 TX_ENTRY |
1183 TX_ENTRY |
1174 |
1184 |
1175 // Get preset id from cenrep |
1185 // Get preset id from cenrep |
1176 TInt presetKey( MpSettingsManager::preset() ); |
1186 TInt presetKey( MpSettingsManager::preset() ); |
1177 |
1187 |
1178 //Set the current preset index. 1 is added to index because index 0 represent "Off" at UI level. |
|
1179 mCurrentPresetIndex = mEqualizerWrapper->getPresetIndex( presetKey ); |
1188 mCurrentPresetIndex = mEqualizerWrapper->getPresetIndex( presetKey ); |
1180 mCurrentPresetIndex++; |
|
1181 emit equalizerReady(); |
1189 emit equalizerReady(); |
1182 |
1190 |
1183 TX_EXIT |
1191 TX_EXIT |
1184 } |
1192 } |
1185 |
1193 |