34 #include <mpxcollectionpath.h> |
34 #include <mpxcollectionpath.h> |
35 |
35 |
36 #include "cmtpplaybackcontrolimpl.h" |
36 #include "cmtpplaybackcontrolimpl.h" |
37 #include "cmtpplaybackplaylisthelper.h" |
37 #include "cmtpplaybackplaylisthelper.h" |
38 #include "mtpplaybackcontrolpanic.h" |
38 #include "mtpplaybackcontrolpanic.h" |
39 |
39 #include "OstTraceDefinitions.h" |
40 // Constants |
40 #ifdef OST_TRACE_COMPILER_IN_USE |
41 __FLOG_STMT(_LIT8(KComponent,"PlaybackPlaylistHelper");) |
41 #include "cmtpplaybackplaylisthelperTraces.h" |
|
42 #endif |
|
43 |
42 |
44 |
43 // ======== MEMBER FUNCTIONS ======== |
45 // ======== MEMBER FUNCTIONS ======== |
44 |
46 |
45 // --------------------------------------------------------------------------- |
47 // --------------------------------------------------------------------------- |
46 // CMTPPlaybackPlaylistHelper::NewL |
48 // CMTPPlaybackPlaylistHelper::NewL |
47 // --------------------------------------------------------------------------- |
49 // --------------------------------------------------------------------------- |
48 // |
50 // |
49 CMTPPlaybackPlaylistHelper* CMTPPlaybackPlaylistHelper::NewL( CMTPPlaybackControlImpl& aControlImpl ) |
51 CMTPPlaybackPlaylistHelper* CMTPPlaybackPlaylistHelper::NewL( CMTPPlaybackControlImpl& aControlImpl ) |
50 { |
52 { |
|
53 OstTraceFunctionEntry0( CMTPPLAYBACKPLAYLISTHELPER_NEWL_ENTRY ); |
|
54 |
51 CMTPPlaybackPlaylistHelper* self = new ( ELeave ) |
55 CMTPPlaybackPlaylistHelper* self = new ( ELeave ) |
52 CMTPPlaybackPlaylistHelper( aControlImpl ); |
56 CMTPPlaybackPlaylistHelper( aControlImpl ); |
53 CleanupStack::PushL( self ); |
57 CleanupStack::PushL( self ); |
54 self->ConstructL(); |
58 self->ConstructL(); |
55 CleanupStack::Pop( self ); |
59 CleanupStack::Pop( self ); |
|
60 |
|
61 OstTraceFunctionExit0( CMTPPLAYBACKPLAYLISTHELPER_NEWL_EXIT ); |
56 return self; |
62 return self; |
57 } |
63 } |
58 |
64 |
59 // --------------------------------------------------------------------------- |
65 // --------------------------------------------------------------------------- |
60 // CMTPPlaybackPlaylistHelper::~CMTPPlaybackPlaylistHelper |
66 // CMTPPlaybackPlaylistHelper::~CMTPPlaybackPlaylistHelper |
61 // --------------------------------------------------------------------------- |
67 // --------------------------------------------------------------------------- |
62 // |
68 // |
63 CMTPPlaybackPlaylistHelper::~CMTPPlaybackPlaylistHelper() |
69 CMTPPlaybackPlaylistHelper::~CMTPPlaybackPlaylistHelper() |
64 { |
70 { |
65 __FLOG(_L8("+CMTPPlaybackPlaylistHelper::~CMTPPlaybackPlaylistHelper")); |
71 OstTraceFunctionEntry0( CMTPPLAYBACKPLAYLISTHELPER_CMTPPLAYBACKPLAYLISTHELPER_ENTRY ); |
66 |
72 |
67 if( iCollectionUiHelper ) |
73 if( iCollectionUiHelper ) |
68 { |
74 { |
69 iCollectionUiHelper->Close(); |
75 iCollectionUiHelper->Close(); |
70 } |
76 } |
79 iCollectionUtil->Close(); |
85 iCollectionUtil->Close(); |
80 } |
86 } |
81 |
87 |
82 delete iPlayObject; |
88 delete iPlayObject; |
83 |
89 |
84 __FLOG(_L8("-CMTPPlaybackPlaylistHelper::~CMTPPlaybackPlaylistHelper")); |
90 OstTraceFunctionExit0( CMTPPLAYBACKPLAYLISTHELPER_CMTPPLAYBACKPLAYLISTHELPER_EXIT ); |
85 __FLOG_CLOSE; |
|
86 } |
91 } |
87 |
92 |
88 // --------------------------------------------------------------------------- |
93 // --------------------------------------------------------------------------- |
89 // CMTPPlaybackPlaylistHelper::GetPlayListFromCollectionL |
94 // CMTPPlaybackPlaylistHelper::GetPlayListFromCollectionL |
90 //// Get Playlist via aMedia |
95 //// Get Playlist via aMedia |
91 // --------------------------------------------------------------------------- |
96 // --------------------------------------------------------------------------- |
92 // |
97 // |
93 void CMTPPlaybackPlaylistHelper::GetPlayListFromCollectionL( const TMTPPbDataSuid& aPlayObject ) |
98 void CMTPPlaybackPlaylistHelper::GetPlayListFromCollectionL( const TMTPPbDataSuid& aPlayObject ) |
94 { |
99 { |
95 __FLOG(_L8("+CMTPPlaybackPlaylistHelper::GetPlayListFromCollectionL")); |
100 OstTraceFunctionEntry0( CMTPPLAYBACKPLAYLISTHELPER_GETPLAYLISTFROMCOLLECTIONL_ENTRY ); |
96 |
101 |
97 //Reset |
102 //Reset |
98 ResetPlaySource(); |
103 ResetPlaySource(); |
99 |
104 |
100 iPlayCategory = aPlayObject.Category(); |
105 iPlayCategory = aPlayObject.Category(); |
117 Panic( EMTPPBCollectionErrCall ); |
122 Panic( EMTPPBCollectionErrCall ); |
118 } |
123 } |
119 break; |
124 break; |
120 } |
125 } |
121 |
126 |
122 __FLOG(_L8("-CMTPPlaybackPlaylistHelper::GetPlayListFromCollectionL")); |
127 OstTraceFunctionExit0( CMTPPLAYBACKPLAYLISTHELPER_GETPLAYLISTFROMCOLLECTIONL_EXIT ); |
123 } |
128 } |
124 |
129 |
125 // --------------------------------------------------------------------------- |
130 // --------------------------------------------------------------------------- |
126 // CMTPPlaybackPlaylistHelper::GetPlayListFromCollectionL |
131 // CMTPPlaybackPlaylistHelper::GetPlayListFromCollectionL |
127 // Get Playlist via index |
132 // Get Playlist via index |
128 // --------------------------------------------------------------------------- |
133 // --------------------------------------------------------------------------- |
129 // |
134 // |
130 void CMTPPlaybackPlaylistHelper::GetPlayListFromCollectionL( TInt aIndex ) |
135 void CMTPPlaybackPlaylistHelper::GetPlayListFromCollectionL( TInt aIndex ) |
131 { |
136 { |
132 __FLOG(_L8("+CMTPPlaybackPlaylistHelper::GetPlayListFromCollectionL")); |
137 OstTraceFunctionEntry0( DUP1_CMTPPLAYBACKPLAYLISTHELPER_GETPLAYLISTFROMCOLLECTIONL_ENTRY ); |
133 |
138 |
134 iSongIndex = aIndex; |
139 iSongIndex = aIndex; |
135 |
140 |
136 UpdatePathAndOpenL(); |
141 UpdatePathAndOpenL(); |
137 |
142 |
138 __FLOG(_L8("-CMTPPlaybackPlaylistHelper::GetPlayListFromCollectionL")); |
143 OstTraceFunctionExit0( DUP1_CMTPPLAYBACKPLAYLISTHELPER_GETPLAYLISTFROMCOLLECTIONL_EXIT ); |
139 } |
144 } |
140 |
145 |
141 // --------------------------------------------------------------------------- |
146 // --------------------------------------------------------------------------- |
142 // CMTPPlaybackPlaylistHelper::GetMTPPBSuidFromCollectionL |
147 // CMTPPlaybackPlaylistHelper::GetMTPPBSuidFromCollectionL |
143 // --------------------------------------------------------------------------- |
148 // --------------------------------------------------------------------------- |
144 // |
149 // |
145 TMTPPbDataSuid CMTPPlaybackPlaylistHelper::GetMTPPBSuidFromCollectionL( |
150 TMTPPbDataSuid CMTPPlaybackPlaylistHelper::GetMTPPBSuidFromCollectionL( |
146 const CMPXCollectionPlaylist& aPlaylist ) |
151 const CMPXCollectionPlaylist& aPlaylist ) |
147 { |
152 { |
148 __FLOG(_L8("+CMTPPlaybackPlaylistHelper::GetPlayListFromCollectionL")); |
153 OstTraceFunctionEntry0( CMTPPLAYBACKPLAYLISTHELPER_GETMTPPBSUIDFROMCOLLECTIONL_ENTRY ); |
149 |
154 |
150 CMPXCollectionPath* path = iCollectionUiHelper->MusicPlaylistPathL(); |
155 CMPXCollectionPath* path = iCollectionUiHelper->MusicPlaylistPathL(); |
151 if ( path->Id() == aPlaylist.Path().Id( KMTPPlaybackPlaylistAblumLevel -1 )) |
156 if ( path->Id() == aPlaylist.Path().Id( KMTPPlaybackPlaylistAblumLevel -1 )) |
152 { |
157 { |
153 iPlayCategory = EMTPPbCatPlayList; |
158 iPlayCategory = EMTPPbCatPlayList; |
157 iPlayCategory = EMTPPbCatAlbum; |
162 iPlayCategory = EMTPPbCatAlbum; |
158 } |
163 } |
159 TFileName uri = ItemIdToUriL( aPlaylist.Path().Id( KMTPPlaybackPlaylistAblumLevel )); |
164 TFileName uri = ItemIdToUriL( aPlaylist.Path().Id( KMTPPlaybackPlaylistAblumLevel )); |
160 TMTPPbDataSuid dataSuid( iPlayCategory, uri ); |
165 TMTPPbDataSuid dataSuid( iPlayCategory, uri ); |
161 |
166 |
162 __FLOG(_L8("-CMTPPlaybackPlaylistHelper::GetPlayListFromCollectionL")); |
167 OstTraceFunctionExit0( CMTPPLAYBACKPLAYLISTHELPER_GETMTPPBSUIDFROMCOLLECTIONL_EXIT ); |
163 return dataSuid; |
168 return dataSuid; |
164 } |
169 } |
165 |
170 |
166 // --------------------------------------------------------------------------- |
171 // --------------------------------------------------------------------------- |
167 // CMTPPlaybackPlaylistHelper::MTPPbCategory |
172 // CMTPPlaybackPlaylistHelper::MTPPbCategory |
168 // --------------------------------------------------------------------------- |
173 // --------------------------------------------------------------------------- |
169 // |
174 // |
170 TMTPPbCategory CMTPPlaybackPlaylistHelper::MTPPbCategory() const |
175 TMTPPbCategory CMTPPlaybackPlaylistHelper::MTPPbCategory() const |
171 { |
176 { |
|
177 OstTraceFunctionEntry0( CMTPPLAYBACKPLAYLISTHELPER_MTPPBCATEGORY_ENTRY ); |
|
178 OstTraceFunctionExit0( CMTPPLAYBACKPLAYLISTHELPER_MTPPBCATEGORY_EXIT ); |
172 return iPlayCategory; |
179 return iPlayCategory; |
173 } |
180 } |
174 // --------------------------------------------------------------------------- |
181 // --------------------------------------------------------------------------- |
175 // CMTPPlaybackPlaylistHelper::MTPPbSuid |
182 // CMTPPlaybackPlaylistHelper::MTPPbSuid |
176 // --------------------------------------------------------------------------- |
183 // --------------------------------------------------------------------------- |
177 // |
184 // |
178 TFileName CMTPPlaybackPlaylistHelper::MTPPbSuid() const |
185 TFileName CMTPPlaybackPlaylistHelper::MTPPbSuid() const |
179 { |
186 { |
|
187 OstTraceFunctionEntry0( CMTPPLAYBACKPLAYLISTHELPER_MTPPBSUID_ENTRY ); |
|
188 OstTraceFunctionExit0( CMTPPLAYBACKPLAYLISTHELPER_MTPPBSUID_EXIT ); |
180 return TFileName( *iPlayObject ); |
189 return TFileName( *iPlayObject ); |
181 } |
190 } |
182 |
191 |
183 // --------------------------------------------------------------------------- |
192 // --------------------------------------------------------------------------- |
184 // From MMPXCollectionObserver |
193 // From MMPXCollectionObserver |
185 // Handle completion of a asynchronous command |
194 // Handle completion of a asynchronous command |
186 // --------------------------------------------------------------------------- |
195 // --------------------------------------------------------------------------- |
187 // |
196 // |
188 void CMTPPlaybackPlaylistHelper::HandleCollectionMessage( CMPXMessage* aMsg, TInt aErr ) |
197 void CMTPPlaybackPlaylistHelper::HandleCollectionMessage( CMPXMessage* aMsg, TInt aErr ) |
189 { |
198 { |
190 __FLOG_1(_L8("+CMTPPlaybackPlaylistHelper::HandleCollectionMessage( %d ) "), aErr ); |
199 OstTraceFunctionEntry0( CMTPPLAYBACKPLAYLISTHELPER_HANDLECOLLECTIONMESSAGE_ENTRY ); |
191 |
200 OstTrace1( TRACE_NORMAL, CMTPPLAYBACKPLAYLISTHELPER_HANDLECOLLECTIONMESSAGE, "CMTPPlaybackPlaylistHelper::HandleCollectionMessage( %d )", aErr ); |
|
201 |
192 if (( KErrNone == aErr ) && aMsg ) |
202 if (( KErrNone == aErr ) && aMsg ) |
193 { |
203 { |
194 TRAP( aErr, DoHandleCollectionMessageL( *aMsg )); |
204 TRAP( aErr, DoHandleCollectionMessageL( *aMsg )); |
195 } |
205 } |
196 |
206 |
198 { |
208 { |
199 TInt error = MTPPlaybackControlImpl().MapError( aErr ); |
209 TInt error = MTPPlaybackControlImpl().MapError( aErr ); |
200 MTPPlaybackControlImpl().DoHandleError( error ); |
210 MTPPlaybackControlImpl().DoHandleError( error ); |
201 } |
211 } |
202 |
212 |
203 __FLOG(_L8("-CMTPPlaybackPlaylistHelper::HandleCollectionMessage")); |
213 OstTraceFunctionExit0( CMTPPLAYBACKPLAYLISTHELPER_HANDLECOLLECTIONMESSAGE_EXIT ); |
204 } |
214 } |
205 // --------------------------------------------------------------------------- |
215 // --------------------------------------------------------------------------- |
206 // From MMPXCollectionObserver |
216 // From MMPXCollectionObserver |
207 // --------------------------------------------------------------------------- |
217 // --------------------------------------------------------------------------- |
208 // |
218 // |
209 void CMTPPlaybackPlaylistHelper::HandleOpenL( const CMPXMedia& aEntries, |
219 void CMTPPlaybackPlaylistHelper::HandleOpenL( const CMPXMedia& aEntries, |
210 TInt /*aIndex*/, TBool /*aComplete*/, TInt aError ) |
220 TInt /*aIndex*/, TBool /*aComplete*/, TInt aError ) |
211 { |
221 { |
212 __FLOG_1(_L8("+CMTPPlaybackPlaylistHelper::HandleOpenL( %d )"), aError ); |
222 OstTraceFunctionEntry0( CMTPPLAYBACKPLAYLISTHELPER_HANDLEOPENL_ENTRY ); |
|
223 OstTrace1( TRACE_FLOW, CMTPPLAYBACKPLAYLISTHELPER_HANDLEOPENL, "CMTPPlaybackPlaylistHelper::HandleOpenL( %d )", aError ); |
213 |
224 |
214 if ( KErrNone == aError ) |
225 if ( KErrNone == aError ) |
215 { |
226 { |
216 TRAP( aError, DoHandleOpenL( aEntries )); |
227 TRAP( aError, DoHandleOpenL( aEntries )); |
217 } |
228 } |
220 { |
231 { |
221 TInt error = MTPPlaybackControlImpl().MapError( aError ); |
232 TInt error = MTPPlaybackControlImpl().MapError( aError ); |
222 MTPPlaybackControlImpl().DoHandleError( error ); |
233 MTPPlaybackControlImpl().DoHandleError( error ); |
223 } |
234 } |
224 |
235 |
225 __FLOG(_L8("-CMTPPlaybackPlaylistHelper::HandleOpenL")); |
236 OstTraceFunctionExit0( CMTPPLAYBACKPLAYLISTHELPER_HANDLEOPENL_EXIT ); |
226 } |
237 } |
227 |
238 |
228 // --------------------------------------------------------------------------- |
239 // --------------------------------------------------------------------------- |
229 // From MMPXCollectionObserver |
240 // From MMPXCollectionObserver |
230 // --------------------------------------------------------------------------- |
241 // --------------------------------------------------------------------------- |
231 // |
242 // |
232 void CMTPPlaybackPlaylistHelper::HandleOpenL( const CMPXCollectionPlaylist& aPlaylist, |
243 void CMTPPlaybackPlaylistHelper::HandleOpenL( const CMPXCollectionPlaylist& aPlaylist, |
233 TInt aError ) |
244 TInt aError ) |
234 { |
245 { |
235 __FLOG_1(_L8("+CMTPPlaybackPlaylistHelper::HandleOpenL( aPlaylist, aError = %d )"), aError ); |
246 OstTraceFunctionEntry0( DUP1_CMTPPLAYBACKPLAYLISTHELPER_HANDLEOPENL_ENTRY ); |
|
247 OstTrace1( TRACE_FLOW, DUP1_CMTPPLAYBACKPLAYLISTHELPER_HANDLEOPENL, "CMTPPlaybackPlaylistHelper::HandleOpenL( aPlaylist, aError = %d )", aError ); |
236 |
248 |
237 if ( KErrNone == aError ) |
249 if ( KErrNone == aError ) |
238 { |
250 { |
239 TRAP( aError, MTPPlaybackControlImpl().GetPlaylistFromCollectionCompleteL( aPlaylist )); |
251 TRAP( aError, MTPPlaybackControlImpl().GetPlaylistFromCollectionCompleteL( aPlaylist )); |
240 } |
252 } |
243 { |
255 { |
244 TInt error = MTPPlaybackControlImpl().MapError( aError ); |
256 TInt error = MTPPlaybackControlImpl().MapError( aError ); |
245 MTPPlaybackControlImpl().DoHandleError( error ); |
257 MTPPlaybackControlImpl().DoHandleError( error ); |
246 } |
258 } |
247 |
259 |
248 __FLOG(_L8("-CMTPPlaybackPlaylistHelper::HandleOpenL( aPlaylist, aError )")); |
260 OstTraceFunctionExit0( DUP1_CMTPPLAYBACKPLAYLISTHELPER_HANDLEOPENL_EXIT ); |
249 } |
261 } |
250 |
262 |
251 // --------------------------------------------------------------------------- |
263 // --------------------------------------------------------------------------- |
252 // From MMPXCollectionMediaObserver |
264 // From MMPXCollectionMediaObserver |
253 // --------------------------------------------------------------------------- |
265 // --------------------------------------------------------------------------- |
254 void CMTPPlaybackPlaylistHelper::HandleCollectionMediaL( const CMPXMedia& /*aMedia*/, TInt /*aError*/ ) |
266 void CMTPPlaybackPlaylistHelper::HandleCollectionMediaL( const CMPXMedia& /*aMedia*/, TInt /*aError*/ ) |
255 { |
267 { |
256 __FLOG(_L8("+CMTPPlaybackPlaylistHelper::HandleCollectionMediaL")); |
268 OstTraceFunctionEntry0( CMTPPLAYBACKPLAYLISTHELPER_HANDLECOLLECTIONMEDIAL_ENTRY ); |
257 __FLOG(_L8("-CMTPPlaybackPlaylistHelper::HandleCollectionMediaL")); |
269 OstTraceFunctionExit0( CMTPPLAYBACKPLAYLISTHELPER_HANDLECOLLECTIONMEDIAL_EXIT ); |
258 } |
270 } |
259 |
271 |
260 // |
272 // |
261 // CMTPPlaybackPlaylistHelper::CMTPPlaybackPlaylistHelper |
273 // CMTPPlaybackPlaylistHelper::CMTPPlaybackPlaylistHelper |
262 // --------------------------------------------------------------------------- |
274 // --------------------------------------------------------------------------- |
266 iCollectionHelper( NULL ), |
278 iCollectionHelper( NULL ), |
267 iCollectionUtil( NULL ), |
279 iCollectionUtil( NULL ), |
268 iPlayObject( NULL ), |
280 iPlayObject( NULL ), |
269 iMTPPlaybackControl( aControlImpl ) |
281 iMTPPlaybackControl( aControlImpl ) |
270 { |
282 { |
|
283 OstTraceFunctionEntry0( DUP1_CMTPPLAYBACKPLAYLISTHELPER_CMTPPLAYBACKPLAYLISTHELPER_ENTRY ); |
|
284 OstTraceFunctionExit0( DUP1_CMTPPLAYBACKPLAYLISTHELPER_CMTPPLAYBACKPLAYLISTHELPER_EXIT ); |
271 } |
285 } |
272 |
286 |
273 // --------------------------------------------------------------------------- |
287 // --------------------------------------------------------------------------- |
274 // CMTPPlaybackPlaylistHelper::ConstructL |
288 // CMTPPlaybackPlaylistHelper::ConstructL |
275 // --------------------------------------------------------------------------- |
289 // --------------------------------------------------------------------------- |
276 // |
290 // |
277 void CMTPPlaybackPlaylistHelper::ConstructL() |
291 void CMTPPlaybackPlaylistHelper::ConstructL() |
278 { |
292 { |
279 __FLOG_OPEN(KMTPSubsystem, KComponent); |
293 OstTraceFunctionEntry0( CMTPPLAYBACKPLAYLISTHELPER_CONSTRUCTL_ENTRY ); |
280 __FLOG(_L8("+CMTPPlaybackPlaylistHelper::ConstructL")); |
|
281 |
294 |
282 iCollectionUiHelper = CMPXCollectionHelperFactory::NewCollectionUiHelperL(); |
295 iCollectionUiHelper = CMPXCollectionHelperFactory::NewCollectionUiHelperL(); |
283 iCollectionUtil = MMPXCollectionUtility::NewL( this, KMcModeDefault ); |
296 iCollectionUtil = MMPXCollectionUtility::NewL( this, KMcModeDefault ); |
284 |
297 |
285 __FLOG(_L8("-CMTPPlaybackPlaylistHelper::ConstructL")); |
298 OstTraceFunctionExit0( CMTPPLAYBACKPLAYLISTHELPER_CONSTRUCTL_EXIT ); |
286 } |
299 } |
287 |
300 |
288 // --------------------------------------------------------------------------- |
301 // --------------------------------------------------------------------------- |
289 // CMTPPlaybackPlaylistHelper::DoHandleCollectionMessage |
302 // CMTPPlaybackPlaylistHelper::DoHandleCollectionMessage |
290 // --------------------------------------------------------------------------- |
303 // --------------------------------------------------------------------------- |
291 // |
304 // |
292 void CMTPPlaybackPlaylistHelper::DoHandleCollectionMessageL( const CMPXMessage& aMsg ) |
305 void CMTPPlaybackPlaylistHelper::DoHandleCollectionMessageL( const CMPXMessage& aMsg ) |
293 { |
306 { |
294 __FLOG(_L8("+CMTPPlaybackPlaylistHelper::DoHandleCollectionMessage")); |
307 OstTraceFunctionEntry0( CMTPPLAYBACKPLAYLISTHELPER_DOHANDLECOLLECTIONMESSAGEL_ENTRY ); |
295 |
308 |
296 TMPXMessageId id( aMsg.ValueTObjectL<TMPXMessageId>( KMPXMessageGeneralId ) ); |
309 TMPXMessageId id( aMsg.ValueTObjectL<TMPXMessageId>( KMPXMessageGeneralId ) ); |
297 |
310 |
298 if ( KMPXMessageGeneral == id ) |
311 if ( KMPXMessageGeneral == id ) |
299 { |
312 { |
300 TInt event( aMsg.ValueTObjectL<TInt>( KMPXMessageGeneralEvent ) ); |
313 TInt event( aMsg.ValueTObjectL<TInt>( KMPXMessageGeneralEvent ) ); |
301 TInt type( aMsg.ValueTObjectL<TInt>( KMPXMessageGeneralType ) ); |
314 TInt type( aMsg.ValueTObjectL<TInt>( KMPXMessageGeneralType ) ); |
302 TInt data( aMsg.ValueTObjectL<TInt>( KMPXMessageGeneralData ) ); |
315 TInt data( aMsg.ValueTObjectL<TInt>( KMPXMessageGeneralData ) ); |
303 |
316 |
304 __FLOG_VA((_L8("Event code is 0x%X, type code is 0x%X"), event, type )); |
317 OstTraceExt2( TRACE_FLOW, CMTPPLAYBACKPLAYLISTHELPER_DOHANDLECOLLECTIONMESSAGEL, "Event code is 0x%X, type code is 0x%X", static_cast<TUint32>( event ), type ); |
305 __FLOG_1(_L8("Data code is 0x%X"), data ); |
318 OstTrace1( TRACE_FLOW, DUP1_CMTPPLAYBACKPLAYLISTHELPER_DOHANDLECOLLECTIONMESSAGEL, "Data code is 0x%X", data ); |
306 |
319 |
307 if ( event == TMPXCollectionMessage::EPathChanged && |
320 if ( event == TMPXCollectionMessage::EPathChanged && |
308 type == EMcPathChangedByOpen && |
321 type == EMcPathChangedByOpen && |
309 data == EMcContainerOpened ) |
322 data == EMcContainerOpened ) |
310 { |
323 { |
316 { |
329 { |
317 iCollectionUtil->Collection().OpenL(); |
330 iCollectionUtil->Collection().OpenL(); |
318 } |
331 } |
319 else if ( event == TMPXCollectionMessage::ECollectionChanged ) |
332 else if ( event == TMPXCollectionMessage::ECollectionChanged ) |
320 { |
333 { |
321 __FLOG(_L8("Ignore this event")); |
334 OstTrace0( TRACE_NORMAL, DUP2_CMTPPLAYBACKPLAYLISTHELPER_DOHANDLECOLLECTIONMESSAGEL, "Ignore this event" ); |
322 } |
335 } |
323 } |
336 } |
324 |
337 |
325 __FLOG(_L8("-CMTPPlaybackPlaylistHelper::DoHandleCollectionMessage")); |
338 OstTraceFunctionExit0( CMTPPLAYBACKPLAYLISTHELPER_DOHANDLECOLLECTIONMESSAGEL_EXIT ); |
326 } |
339 } |
327 |
340 |
328 // ---------------------------------------------------- |
341 // ---------------------------------------------------- |
329 // CMTPPlaybackPlaylistHelper::DoHandleOpenL |
342 // CMTPPlaybackPlaylistHelper::DoHandleOpenL |
330 // ---------------------------------------------------- |
343 // ---------------------------------------------------- |
331 // |
344 // |
332 void CMTPPlaybackPlaylistHelper::DoHandleOpenL( const CMPXMedia& aEntries ) |
345 void CMTPPlaybackPlaylistHelper::DoHandleOpenL( const CMPXMedia& aEntries ) |
333 { |
346 { |
334 __FLOG(_L8("+CMTPPlaybackPlaylistHelper::DoHandleOpenL( const CMPXMedia )")); |
347 OstTraceFunctionEntry0( CMTPPLAYBACKPLAYLISTHELPER_DOHANDLEOPENL_ENTRY ); |
335 |
348 |
336 if ( EMTPPbCatAlbum == iPlayCategory ) |
349 if ( EMTPPbCatAlbum == iPlayCategory ) |
337 { |
350 { |
338 UpdateAlbumPathAndOpenL(); |
351 UpdateAlbumPathAndOpenL(); |
339 } |
352 } |
359 //open the first song when initObject |
372 //open the first song when initObject |
360 iCollectionUtil->Collection().OpenL( iSongIndex ); |
373 iCollectionUtil->Collection().OpenL( iSongIndex ); |
361 } |
374 } |
362 } |
375 } |
363 |
376 |
364 __FLOG(_L8("-CMTPPlaybackPlaylistHelper::DoHandleOpenL( const CMPXMedia )")); |
377 OstTraceFunctionExit0( CMTPPLAYBACKPLAYLISTHELPER_DOHANDLEOPENL_EXIT ); |
365 } |
378 } |
366 |
379 |
367 // ---------------------------------------------------- |
380 // ---------------------------------------------------- |
368 // CMTPPlaybackPlaylistHelper::OpenMusicPlayListPathL |
381 // CMTPPlaybackPlaylistHelper::OpenMusicPlayListPathL |
369 // ---------------------------------------------------- |
382 // ---------------------------------------------------- |
370 // |
383 // |
371 void CMTPPlaybackPlaylistHelper::OpenMusicPlayListPathL() |
384 void CMTPPlaybackPlaylistHelper::OpenMusicPlayListPathL() |
372 { |
385 { |
373 __FLOG(_L8("+CMTPPlaybackPlaylistHelper::OpenMusicPlayListPathL")); |
386 OstTraceFunctionEntry0( CMTPPLAYBACKPLAYLISTHELPER_OPENMUSICPLAYLISTPATHL_ENTRY ); |
374 |
387 |
375 CMPXCollectionPath* path = iCollectionUiHelper->MusicPlaylistPathL(); |
388 CMPXCollectionPath* path = iCollectionUiHelper->MusicPlaylistPathL(); |
376 CleanupStack::PushL( path ); |
389 CleanupStack::PushL( path ); |
377 iCollectionUtil->Collection().OpenL( *path ); |
390 iCollectionUtil->Collection().OpenL( *path ); |
378 CleanupStack::PopAndDestroy( path ); |
391 CleanupStack::PopAndDestroy( path ); |
379 |
392 |
380 __FLOG(_L8("-CMTPPlaybackPlaylistHelper::OpenMusicPlayListPathL")); |
393 OstTraceFunctionExit0( CMTPPLAYBACKPLAYLISTHELPER_OPENMUSICPLAYLISTPATHL_EXIT ); |
381 } |
394 } |
382 |
395 |
383 // ---------------------------------------------------- |
396 // ---------------------------------------------------- |
384 // CMTPPlaybackPlaylistHelper::OpenMusicAblumPathL |
397 // CMTPPlaybackPlaylistHelper::OpenMusicAblumPathL |
385 // ---------------------------------------------------- |
398 // ---------------------------------------------------- |
386 // |
399 // |
387 void CMTPPlaybackPlaylistHelper::OpenMusicAblumPathL() |
400 void CMTPPlaybackPlaylistHelper::OpenMusicAblumPathL() |
388 { |
401 { |
389 __FLOG(_L8("+CMTPPlaybackPlaylistHelper::OpenMusicAblumPathL")); |
402 OstTraceFunctionEntry0( CMTPPLAYBACKPLAYLISTHELPER_OPENMUSICABLUMPATHL_ENTRY ); |
390 |
403 |
391 CMPXCollectionPath* path = iCollectionUiHelper->MusicMenuPathL(); |
404 CMPXCollectionPath* path = iCollectionUiHelper->MusicMenuPathL(); |
392 CleanupStack::PushL( path ); |
405 CleanupStack::PushL( path ); |
393 path->AppendL(KMPXCollectionArtistAlbum); |
406 path->AppendL(KMPXCollectionArtistAlbum); |
394 iCollectionUtil->Collection().OpenL( *path ); |
407 iCollectionUtil->Collection().OpenL( *path ); |
395 CleanupStack::PopAndDestroy( path ); |
408 CleanupStack::PopAndDestroy( path ); |
396 |
409 |
397 __FLOG(_L8("-CMTPPlaybackPlaylistHelper::OpenMusicAblumPathL")); |
410 OstTraceFunctionExit0( CMTPPLAYBACKPLAYLISTHELPER_OPENMUSICABLUMPATHL_EXIT ); |
398 } |
411 } |
399 |
412 |
400 // ---------------------------------------------------- |
413 // ---------------------------------------------------- |
401 // CMTPPlaybackPlaylistHelper::ResetPlaySource |
414 // CMTPPlaybackPlaylistHelper::ResetPlaySource |
402 // ---------------------------------------------------- |
415 // ---------------------------------------------------- |
403 // |
416 // |
404 void CMTPPlaybackPlaylistHelper::ResetPlaySource() |
417 void CMTPPlaybackPlaylistHelper::ResetPlaySource() |
405 { |
418 { |
406 __FLOG(_L8("+CMTPPlaybackPlaylistHelper::ResetPlaySourceL")); |
419 OstTraceFunctionEntry0( CMTPPLAYBACKPLAYLISTHELPER_RESETPLAYSOURCE_ENTRY ); |
407 |
420 |
408 iPathIndex = -1; |
421 iPathIndex = -1; |
409 iSongIndex = 0; |
422 iSongIndex = 0; |
410 delete iPlayObject; |
423 delete iPlayObject; |
411 iPlayObject = NULL; |
424 iPlayObject = NULL; |
412 |
425 |
413 __FLOG(_L8("-CMTPPlaybackPlaylistHelper::ResetPlaySourceL")); |
426 OstTraceFunctionExit0( CMTPPLAYBACKPLAYLISTHELPER_RESETPLAYSOURCE_EXIT ); |
414 } |
427 } |
415 |
428 |
416 // ---------------------------------------------------- |
429 // ---------------------------------------------------- |
417 // CMTPPlaybackPlaylistHelper::UpdatePlaylistPathIndexL |
430 // CMTPPlaybackPlaylistHelper::UpdatePlaylistPathIndexL |
418 // ---------------------------------------------------- |
431 // ---------------------------------------------------- |
419 // |
432 // |
420 void CMTPPlaybackPlaylistHelper::UpdatePlaylistPathIndexL( const CMPXMedia& aEntries ) |
433 void CMTPPlaybackPlaylistHelper::UpdatePlaylistPathIndexL( const CMPXMedia& aEntries ) |
421 { |
434 { |
422 __FLOG(_L8("+CMTPPlaybackPlaylistHelper::UpdatePlaylistPathIndexL")); |
435 OstTraceFunctionEntry0( CMTPPLAYBACKPLAYLISTHELPER_UPDATEPLAYLISTPATHINDEXL_ENTRY ); |
423 __ASSERT_DEBUG( iPlayCategory == EMTPPbCatPlayList, Panic( EMTPPBCollectionErrCall )); |
436 __ASSERT_DEBUG( iPlayCategory == EMTPPbCatPlayList, Panic( EMTPPBCollectionErrCall )); |
424 |
437 |
425 const CMPXMediaArray* refArray = aEntries.Value<CMPXMediaArray> ( KMPXMediaArrayContents ); |
438 const CMPXMediaArray* refArray = aEntries.Value<CMPXMediaArray> ( KMPXMediaArrayContents ); |
426 TInt count = refArray->Count(); |
439 TInt count = refArray->Count(); |
427 const TMPXItemId playlistId = UriToItemIdL(); |
440 const TMPXItemId playlistId = UriToItemIdL(); |
442 break; |
455 break; |
443 } |
456 } |
444 } |
457 } |
445 } |
458 } |
446 |
459 |
447 __FLOG(_L8("-CMTPPlaybackPlaylistHelper::UpdatePlaylistPathIndexL")); |
460 OstTraceFunctionExit0( CMTPPLAYBACKPLAYLISTHELPER_UPDATEPLAYLISTPATHINDEXL_EXIT ); |
448 } |
461 } |
449 |
462 |
450 // --------------------------------------------------------------------------- |
463 // --------------------------------------------------------------------------- |
451 // return instance of CollectionHelper. |
464 // return instance of CollectionHelper. |
452 // --------------------------------------------------------------------------- |
465 // --------------------------------------------------------------------------- |
453 // |
466 // |
454 MMPXCollectionHelper* CMTPPlaybackPlaylistHelper::CollectionHelperL() |
467 MMPXCollectionHelper* CMTPPlaybackPlaylistHelper::CollectionHelperL() |
455 { |
468 { |
456 __FLOG(_L8("+CMTPPlaybackPlaylistHelper::CollectionHelperL")); |
469 OstTraceFunctionEntry0( CMTPPLAYBACKPLAYLISTHELPER_COLLECTIONHELPERL_ENTRY ); |
457 |
470 |
458 if ( iCollectionHelper == NULL ) |
471 if ( iCollectionHelper == NULL ) |
459 { |
472 { |
460 iCollectionHelper = CMPXCollectionHelperFactory::NewCollectionCachedHelperL(); |
473 iCollectionHelper = CMPXCollectionHelperFactory::NewCollectionCachedHelperL(); |
461 |
474 |
476 /* |
489 /* |
477 * store root |
490 * store root |
478 */ |
491 */ |
479 TChar driveChar = 'c'; |
492 TChar driveChar = 'c'; |
480 TInt driveNumber; |
493 TInt driveNumber; |
481 User::LeaveIfError( RFs::CharToDrive( driveChar, driveNumber ) ); |
494 TInt ret = RFs::CharToDrive( driveChar, driveNumber ); |
|
495 LEAVEIFERROR( ret, |
|
496 OstTrace0( TRACE_ERROR, CMTPPLAYBACKPLAYLISTHELPER_COLLECTIONHELPERL, "Can't get driveNumber" )); |
482 |
497 |
483 // get root path |
498 // get root path |
484 TBuf<KStorageRootMaxLength> storeRoot; |
499 TBuf<KStorageRootMaxLength> storeRoot; |
485 User::LeaveIfError( PathInfo::GetRootPath( storeRoot, driveNumber ) ); |
500 ret = PathInfo::GetRootPath( storeRoot, driveNumber ); |
|
501 LEAVEIFERROR( ret, |
|
502 OstTrace0( TRACE_ERROR, DUP1_CMTPPLAYBACKPLAYLISTHELPER_COLLECTIONHELPERL, "Can't get storeRoot" )); |
486 |
503 |
487 searchMedia->SetTextValueL( KMPXMediaGeneralDrive, storeRoot ); |
504 searchMedia->SetTextValueL( KMPXMediaGeneralDrive, storeRoot ); |
488 |
505 |
489 RArray<TMPXAttribute> songAttributes; |
506 RArray<TMPXAttribute> songAttributes; |
490 CleanupClosePushL( songAttributes ); // + songAttributes |
507 CleanupClosePushL( songAttributes ); // + songAttributes |
502 |
519 |
503 if ( err != KErrNone ) |
520 if ( err != KErrNone ) |
504 { |
521 { |
505 iCollectionHelper->Close(); |
522 iCollectionHelper->Close(); |
506 iCollectionHelper = NULL; |
523 iCollectionHelper = NULL; |
507 User::Leave( KErrGeneral ); |
524 LEAVEIFERROR( KErrGeneral, |
|
525 OstTrace0( TRACE_ERROR, DUP2_CMTPPLAYBACKPLAYLISTHELPER_COLLECTIONHELPERL, "MPX database error" )); |
508 } |
526 } |
509 CleanupStack::PopAndDestroy( foundMedia ); // - foundMedia |
527 CleanupStack::PopAndDestroy( foundMedia ); // - foundMedia |
510 } |
528 } |
511 |
529 |
512 __FLOG(_L8("-CMTPPlaybackPlaylistHelper::CollectionHelperL")); |
530 OstTraceFunctionExit0( CMTPPLAYBACKPLAYLISTHELPER_COLLECTIONHELPERL_EXIT ); |
513 return iCollectionHelper; |
531 return iCollectionHelper; |
514 } |
532 } |
515 |
533 |
516 // --------------------------------------------------------------------------- |
534 // --------------------------------------------------------------------------- |
517 // CMTPPlaybackPlaylistHelper::UriToItemIdL |
535 // CMTPPlaybackPlaylistHelper::UriToItemIdL |
518 // --------------------------------------------------------------------------- |
536 // --------------------------------------------------------------------------- |
519 // |
537 // |
520 const TMPXItemId CMTPPlaybackPlaylistHelper::UriToItemIdL() |
538 const TMPXItemId CMTPPlaybackPlaylistHelper::UriToItemIdL() |
521 { |
539 { |
522 __FLOG(_L8("+CMTPPlaybackPlaylistHelper::UriToItemIdL")); |
540 OstTraceFunctionEntry0( CMTPPLAYBACKPLAYLISTHELPER_URITOITEMIDL_ENTRY ); |
523 |
|
524 |
541 |
525 TMPXItemId itemId( KMPXInvalidItemId ); |
542 TMPXItemId itemId( KMPXInvalidItemId ); |
526 TInt error = KErrNone; |
543 TInt error = KErrNone; |
527 CMPXMedia* result = NULL; |
544 CMPXMedia* result = NULL; |
528 |
545 |
549 itemId = result->ValueTObjectL<TMPXItemId>(KMPXMediaGeneralId); |
566 itemId = result->ValueTObjectL<TMPXItemId>(KMPXMediaGeneralId); |
550 CleanupStack::PopAndDestroy( result ); |
567 CleanupStack::PopAndDestroy( result ); |
551 CleanupStack::PopAndDestroy( &atts ); |
568 CleanupStack::PopAndDestroy( &atts ); |
552 } |
569 } |
553 |
570 |
554 __FLOG(_L8("-CMTPPlaybackPlaylistHelper::UriToItemIdL")); |
571 OstTraceFunctionExit0( CMTPPLAYBACKPLAYLISTHELPER_URITOITEMIDL_EXIT ); |
555 return itemId; |
572 return itemId; |
556 } |
573 } |
557 |
574 |
558 // --------------------------------------------------------------------------- |
575 // --------------------------------------------------------------------------- |
559 // CMTPPlaybackPlaylistHelper::ItemIdToUriL. |
576 // CMTPPlaybackPlaylistHelper::ItemIdToUriL. |
560 // --------------------------------------------------------------------------- |
577 // --------------------------------------------------------------------------- |
561 // |
578 // |
562 const TFileName CMTPPlaybackPlaylistHelper::ItemIdToUriL( const TMPXItemId& aId ) |
579 const TFileName CMTPPlaybackPlaylistHelper::ItemIdToUriL( const TMPXItemId& aId ) |
563 { |
580 { |
564 __FLOG(_L8("+CMTPPlaybackPlaylistHelper::ItemIdToUriL")); |
581 OstTraceFunctionEntry0( CMTPPLAYBACKPLAYLISTHELPER_ITEMIDTOURIL_ENTRY ); |
565 |
582 |
566 TFileName itemUri( KNullDesC ); |
583 TFileName itemUri( KNullDesC ); |
567 |
584 |
568 RArray<TInt> contentIDs; |
585 RArray<TInt> contentIDs; |
569 CleanupClosePushL( contentIDs ); // + contentIDs |
586 CleanupClosePushL( contentIDs ); // + contentIDs |
596 CleanupStack::PopAndDestroy( searchMedia ); // - searchMedia |
613 CleanupStack::PopAndDestroy( searchMedia ); // - searchMedia |
597 |
614 |
598 CleanupStack::PushL( foundMedia ); // + foundMedia |
615 CleanupStack::PushL( foundMedia ); // + foundMedia |
599 if ( !foundMedia->IsSupported( KMPXMediaArrayCount )) |
616 if ( !foundMedia->IsSupported( KMPXMediaArrayCount )) |
600 { |
617 { |
601 User::Leave( KErrNotSupported ); |
618 LEAVEIFERROR( KErrNotSupported, |
|
619 OstTrace0( TRACE_ERROR, CMTPPLAYBACKPLAYLISTHELPER_ITEMIDTOURIL, "ItemId convert to Uri error" )); |
602 } |
620 } |
603 else if ( *foundMedia->Value<TInt>( KMPXMediaArrayCount ) != 1 ) |
621 else if ( *foundMedia->Value<TInt>( KMPXMediaArrayCount ) != 1 ) |
604 { |
622 { |
605 User::Leave( KErrNotSupported ); |
623 LEAVEIFERROR( KErrNotSupported, |
|
624 OstTrace0( TRACE_ERROR, DUP1_CMTPPLAYBACKPLAYLISTHELPER_ITEMIDTOURIL, "ItemId convert to Uri error" )); |
606 } |
625 } |
607 |
626 |
608 const CMPXMediaArray* tracksArray = foundMedia->Value<CMPXMediaArray> ( KMPXMediaArrayContents ); |
627 const CMPXMediaArray* tracksArray = foundMedia->Value<CMPXMediaArray> ( KMPXMediaArrayContents ); |
609 CMPXMedia* item = tracksArray->AtL(0); |
628 CMPXMedia* item = tracksArray->AtL(0); |
610 |
629 |
613 itemUri = item->ValueText(KMPXMediaGeneralUri); |
632 itemUri = item->ValueText(KMPXMediaGeneralUri); |
614 } |
633 } |
615 |
634 |
616 CleanupStack::PopAndDestroy( foundMedia ); // - foundMedia |
635 CleanupStack::PopAndDestroy( foundMedia ); // - foundMedia |
617 |
636 |
618 __FLOG(_L8("-CMTPPlaybackPlaylistHelper::ItemIdToUriL")); |
637 OstTraceFunctionExit0( CMTPPLAYBACKPLAYLISTHELPER_ITEMIDTOURIL_EXIT ); |
619 return itemUri; |
638 return itemUri; |
620 } |
639 } |
621 |
640 |
622 // --------------------------------------------------------------------------- |
641 // --------------------------------------------------------------------------- |
623 // CMTPPlaybackPlaylistHelper::FindAlbumSongsL |
642 // CMTPPlaybackPlaylistHelper::FindAlbumSongsL |
624 // --------------------------------------------------------------------------- |
643 // --------------------------------------------------------------------------- |
625 // |
644 // |
626 CMPXMedia* CMTPPlaybackPlaylistHelper::FindAlbumSongsL( const TMPXItemId& aAlbumId ) |
645 CMPXMedia* CMTPPlaybackPlaylistHelper::FindAlbumSongsL( const TMPXItemId& aAlbumId ) |
627 { |
646 { |
628 __FLOG(_L8("+CMTPPlaybackPlaylistHelper::FindAlbumSongsL")); |
647 OstTraceFunctionEntry0( CMTPPLAYBACKPLAYLISTHELPER_FINDALBUMSONGSL_ENTRY ); |
629 |
648 |
630 // Fetch the songs for the selected album |
649 // Fetch the songs for the selected album |
631 CMPXMedia* findCriteria = CMPXMedia::NewL(); |
650 CMPXMedia* findCriteria = CMPXMedia::NewL(); |
632 CleanupStack::PushL( findCriteria ); |
651 CleanupStack::PushL( findCriteria ); |
633 findCriteria->SetTObjectValueL<TMPXGeneralType>( KMPXMediaGeneralType, EMPXGroup ); |
652 findCriteria->SetTObjectValueL<TMPXGeneralType>( KMPXMediaGeneralType, EMPXGroup ); |
645 CleanupStack::PopAndDestroy( &attrs ); |
664 CleanupStack::PopAndDestroy( &attrs ); |
646 CleanupStack::PopAndDestroy( findCriteria ); |
665 CleanupStack::PopAndDestroy( findCriteria ); |
647 |
666 |
648 if ( !foundMedia->IsSupported( KMPXMediaArrayCount ) ) |
667 if ( !foundMedia->IsSupported( KMPXMediaArrayCount ) ) |
649 { |
668 { |
650 User::Leave( KErrNotSupported ); |
669 LEAVEIFERROR( KErrNotSupported, |
|
670 OstTrace0( TRACE_ERROR, CMTPPLAYBACKPLAYLISTHELPER_FINDALBUMSONGSL, "Find album song error" )); |
651 } |
671 } |
652 TInt foundItemCount = *foundMedia->Value<TInt>( KMPXMediaArrayCount ); |
672 TInt foundItemCount = *foundMedia->Value<TInt>( KMPXMediaArrayCount ); |
653 if ( foundItemCount == 0 ) |
673 if ( foundItemCount == 0 ) |
654 { |
674 { |
655 User::Leave( KErrNotFound ); |
675 LEAVEIFERROR( KErrNotFound, |
|
676 OstTrace0( TRACE_ERROR, DUP1_CMTPPLAYBACKPLAYLISTHELPER_FINDALBUMSONGSL, "Can't find album song" )); |
656 } |
677 } |
657 if ( !foundMedia->IsSupported( KMPXMediaArrayContents ) ) |
678 if ( !foundMedia->IsSupported( KMPXMediaArrayContents ) ) |
658 { |
679 { |
659 User::Leave( KErrNotSupported ); |
680 LEAVEIFERROR( KErrNotSupported, |
660 } |
681 OstTrace0( TRACE_ERROR, DUP2_CMTPPLAYBACKPLAYLISTHELPER_FINDALBUMSONGSL, "Find album song error" )); |
661 |
682 } |
662 __FLOG(_L8("-CMTPPlaybackPlaylistHelper::FindAlbumSongsL")); |
683 |
|
684 OstTraceFunctionExit0( CMTPPLAYBACKPLAYLISTHELPER_FINDALBUMSONGSL_EXIT ); |
663 return foundMedia; |
685 return foundMedia; |
664 } |
686 } |
665 |
687 |
666 // --------------------------------------------------------------------------- |
688 // --------------------------------------------------------------------------- |
667 // CMTPPlaybackPlaylistHelper::UpdatePathAndOpenL. |
689 // CMTPPlaybackPlaylistHelper::UpdatePathAndOpenL. |
668 // aParam: const CMPXMedia& aAlbums |
690 // aParam: const CMPXMedia& aAlbums |
669 // --------------------------------------------------------------------------- |
691 // --------------------------------------------------------------------------- |
670 // |
692 // |
671 void CMTPPlaybackPlaylistHelper::UpdateAlbumPathAndOpenL() |
693 void CMTPPlaybackPlaylistHelper::UpdateAlbumPathAndOpenL() |
672 { |
694 { |
673 __FLOG(_L8("+CMTPPlaybackPlaylistHelper::UpdateAlbumPathAndOpenL")); |
695 OstTraceFunctionEntry0( CMTPPLAYBACKPLAYLISTHELPER_UPDATEALBUMPATHANDOPENL_ENTRY ); |
674 |
696 |
675 RArray<TMPXItemId> ids; |
697 RArray<TMPXItemId> ids; |
676 CleanupClosePushL(ids); |
698 CleanupClosePushL(ids); |
677 |
699 |
678 CMPXCollectionPath* cpath = iCollectionUtil->Collection().PathL(); |
700 CMPXCollectionPath* cpath = iCollectionUtil->Collection().PathL(); |
699 ids.Reset(); |
722 ids.Reset(); |
700 |
723 |
701 CMPXMedia* songs = FindAlbumSongsL( id ); |
724 CMPXMedia* songs = FindAlbumSongsL( id ); |
702 CleanupStack::PushL( songs ); |
725 CleanupStack::PushL( songs ); |
703 const CMPXMediaArray* tracksArray = songs->Value<CMPXMediaArray> ( KMPXMediaArrayContents ); |
726 const CMPXMediaArray* tracksArray = songs->Value<CMPXMediaArray> ( KMPXMediaArrayContents ); |
704 User::LeaveIfNull(const_cast<CMPXMediaArray*>(tracksArray)); |
727 if ( const_cast<CMPXMediaArray*>(tracksArray) == NULL ) |
|
728 { |
|
729 LEAVEIFERROR( KErrNoMemory, |
|
730 OstTrace0( TRACE_ERROR, CMTPPLAYBACKPLAYLISTHELPER_UPDATEALBUMPATHANDOPENL, "Find album song error" )); |
|
731 } |
705 TUint count = tracksArray->Count(); |
732 TUint count = tracksArray->Count(); |
706 for (TInt i=0; i<count; ++i) |
733 for (TInt i=0; i<count; ++i) |
707 { |
734 { |
708 CMPXMedia* song = tracksArray->AtL(i); |
735 CMPXMedia* song = tracksArray->AtL(i); |
709 const TMPXItemId id = song->ValueTObjectL<TMPXItemId>(KMPXMediaGeneralId); |
736 const TMPXItemId id = song->ValueTObjectL<TMPXItemId>(KMPXMediaGeneralId); |
716 iCollectionUtil->Collection().OpenL(*cpath); |
743 iCollectionUtil->Collection().OpenL(*cpath); |
717 CleanupStack::PopAndDestroy( songs ); |
744 CleanupStack::PopAndDestroy( songs ); |
718 CleanupStack::PopAndDestroy( cpath ); |
745 CleanupStack::PopAndDestroy( cpath ); |
719 CleanupStack::PopAndDestroy(&ids); |
746 CleanupStack::PopAndDestroy(&ids); |
720 |
747 |
721 __FLOG(_L8("-CMTPPlaybackPlaylistHelper::UpdateAlbumPathAndOpenL")); |
748 OstTraceFunctionExit0( DUP1_CMTPPLAYBACKPLAYLISTHELPER_UPDATEALBUMPATHANDOPENL_EXIT ); |
722 } |
749 } |
723 |
750 |
724 // --------------------------------------------------------------------------- |
751 // --------------------------------------------------------------------------- |
725 // CMTPPlaybackPlaylistHelper::UpdatePathAndOpenL. |
752 // CMTPPlaybackPlaylistHelper::UpdatePathAndOpenL. |
726 // --------------------------------------------------------------------------- |
753 // --------------------------------------------------------------------------- |
727 // |
754 // |
728 void CMTPPlaybackPlaylistHelper::UpdatePathAndOpenL() |
755 void CMTPPlaybackPlaylistHelper::UpdatePathAndOpenL() |
729 { |
756 { |
730 __FLOG(_L8("+CMTPPlaybackPlaylistHelper::UpdatePathAndOpenL()")); |
757 OstTraceFunctionEntry0( CMTPPLAYBACKPLAYLISTHELPER_UPDATEPATHANDOPENL_ENTRY ); |
731 |
758 |
732 RArray<TMPXItemId> ids; |
759 RArray<TMPXItemId> ids; |
733 CleanupClosePushL(ids); |
760 CleanupClosePushL(ids); |
734 |
761 |
735 CMPXCollectionPath* cpath = iCollectionUtil->Collection().PathL(); |
762 CMPXCollectionPath* cpath = iCollectionUtil->Collection().PathL(); |
739 |
766 |
740 iCollectionUtil->Collection().OpenL(*cpath); |
767 iCollectionUtil->Collection().OpenL(*cpath); |
741 CleanupStack::PopAndDestroy( cpath ); |
768 CleanupStack::PopAndDestroy( cpath ); |
742 CleanupStack::PopAndDestroy(&ids); |
769 CleanupStack::PopAndDestroy(&ids); |
743 |
770 |
744 __FLOG(_L8("-CMTPPlaybackPlaylistHelper::UpdatePathAndOpenL( aSong Index )")); |
771 OstTraceFunctionExit0( CMTPPLAYBACKPLAYLISTHELPER_UPDATEPATHANDOPENL_EXIT ); |
745 } |
772 } |
746 |
773 |
747 // --------------------------------------------------------------------------- |
774 // --------------------------------------------------------------------------- |
748 // CMTPPlaybackPlaylistHelper::MTPPlaybackControlImpl. |
775 // CMTPPlaybackPlaylistHelper::MTPPlaybackControlImpl. |
749 // --------------------------------------------------------------------------- |
776 // --------------------------------------------------------------------------- |
750 // |
777 // |
751 CMTPPlaybackControlImpl& CMTPPlaybackPlaylistHelper::MTPPlaybackControlImpl() |
778 CMTPPlaybackControlImpl& CMTPPlaybackPlaylistHelper::MTPPlaybackControlImpl() |
752 { |
779 { |
|
780 OstTraceFunctionEntry0( CMTPPLAYBACKPLAYLISTHELPER_MTPPLAYBACKCONTROLIMPL_ENTRY ); |
|
781 OstTraceFunctionExit0( CMTPPLAYBACKPLAYLISTHELPER_MTPPLAYBACKCONTROLIMPL_EXIT ); |
753 return iMTPPlaybackControl; |
782 return iMTPPlaybackControl; |
754 } |
783 } |
755 |
784 |
756 |
785 |