author | Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com> |
Wed, 13 Oct 2010 14:28:40 +0300 | |
branch | RCL_3 |
changeset 66 | 1f1dad4af8f8 |
parent 53 | 3de6c4cf6b67 |
permissions | -rw-r--r-- |
53 | 1 |
/* |
2 |
* Copyright (c) 2006 Nokia Corporation and/or its subsidiary(-ies). |
|
3 |
* All rights reserved. |
|
4 |
* This component and the accompanying materials are made available |
|
5 |
* under the terms of "Eclipse Public License v1.0" |
|
6 |
* which accompanies this distribution, and is available |
|
7 |
* at the URL "http://www.eclipse.org/legal/epl-v10.html". |
|
8 |
* |
|
9 |
* Initial Contributors: |
|
10 |
* Nokia Corporation - initial contribution. |
|
11 |
* |
|
12 |
* Contributors: |
|
13 |
* |
|
14 |
* Description: Music Player stautus observer |
|
15 |
* |
|
16 |
*/ |
|
17 |
||
18 |
||
19 |
#include <mpxplaybackutility.h> |
|
20 |
#include <mpxplaybackmessage.h> |
|
21 |
#include <mpxmedia.h> |
|
22 |
#include <mpxmediageneraldefs.h> |
|
23 |
#include <mpxmediamusicdefs.h> |
|
24 |
#include <mpxmessagegeneraldefs.h> |
|
25 |
#include <mpxplaybackmessagedefs.h> |
|
26 |
#include <mpxalbumartutil.h> |
|
27 |
#include <mpxlog.h> |
|
28 |
||
29 |
#include "aiplayerpluginengine.h" |
|
30 |
||
31 |
const TInt KMPXOneSecInMilliSecs( 1000 ); |
|
32 |
const TUid KMusicPlayerAppUid = { 0x102072C3 }; |
|
33 |
||
34 |
// ======== MEMBER FUNCTIONS ======== |
|
35 |
||
36 |
// --------------------------------------------------------------------------- |
|
37 |
// CAiPlayerPluginEngine::ConstructL |
|
38 |
// --------------------------------------------------------------------------- |
|
39 |
// |
|
40 |
void CAiPlayerPluginEngine::ConstructL() |
|
41 |
{ |
|
42 |
MPX_DEBUG1("CAiPlayerPluginEngine::ConstructL"); |
|
43 |
// Get the playback utility instance from engine. |
|
44 |
//iPlaybackUtility = MMPXPlaybackUtility::NewL( KPbModeActivePlayer, this ); |
|
45 |
iPlaybackUtility = MMPXPlaybackUtility::NewL( KMusicPlayerAppUid, this ); |
|
46 |
iAlbumArtUtil = CMPXAlbumArtUtil::NewL(); |
|
47 |
if (iPlaybackUtility->StateL() == EPbStatePlaying) |
|
48 |
{ |
|
49 |
RequestMediaL(); |
|
50 |
} |
|
51 |
} |
|
52 |
||
53 |
// --------------------------------------------------------------------------- |
|
54 |
// CAiPlayerPluginEngine::NewL |
|
55 |
// --------------------------------------------------------------------------- |
|
56 |
// |
|
57 |
CAiPlayerPluginEngine* CAiPlayerPluginEngine::NewL( |
|
58 |
MAiPlayerPluginEngineObserver& aObserver ) |
|
59 |
{ |
|
60 |
MPX_DEBUG1("CAiPlayerPluginEngine::NewL"); |
|
61 |
CAiPlayerPluginEngine* self = new ( ELeave ) |
|
62 |
CAiPlayerPluginEngine( aObserver ); |
|
63 |
CleanupStack::PushL( self ); |
|
64 |
self->ConstructL(); |
|
65 |
CleanupStack::Pop( self ); |
|
66 |
return self; |
|
67 |
} |
|
68 |
||
69 |
// --------------------------------------------------------------------------- |
|
70 |
// CAiPlayerPluginEngine::CAiPlayerPluginEngine |
|
71 |
// --------------------------------------------------------------------------- |
|
72 |
// |
|
73 |
CAiPlayerPluginEngine::CAiPlayerPluginEngine( |
|
74 |
MAiPlayerPluginEngineObserver& aObserver ) |
|
75 |
: iObserver( &aObserver ), |
|
76 |
iPlaybackUtility( NULL ), |
|
77 |
iTitle( NULL ), |
|
78 |
iArtist( NULL ), |
|
79 |
iUri( NULL ), |
|
80 |
iMedia( NULL ), |
|
81 |
iPosition( KErrNotFound ), |
|
82 |
iDuration( KErrNotFound ), |
|
83 |
iExtractingAlbumArt( EFalse ), |
|
84 |
iSkipping( EFalse ) |
|
85 |
{ |
|
86 |
} |
|
87 |
||
88 |
// --------------------------------------------------------------------------- |
|
89 |
// CAiPlayerPluginEngine::~CAiPlayerPluginEngine |
|
90 |
// --------------------------------------------------------------------------- |
|
91 |
// |
|
92 |
CAiPlayerPluginEngine::~CAiPlayerPluginEngine() |
|
93 |
{ |
|
94 |
MPX_DEBUG1("CAiPlayerPluginEngine::~CAiPlayerPluginEngine"); |
|
95 |
if ( iPlaybackUtility ) |
|
96 |
{ |
|
97 |
iPlaybackUtility->Close(); |
|
98 |
} |
|
99 |
delete iMedia; |
|
100 |
delete iAlbumArtUtil; |
|
101 |
delete iTitle; |
|
102 |
delete iArtist; |
|
103 |
delete iUri; |
|
104 |
||
105 |
} |
|
106 |
||
107 |
// --------------------------------------------------------------------------- |
|
108 |
// From MMPXPlaybackObserver |
|
109 |
// Handle playback message. |
|
110 |
// --------------------------------------------------------------------------- |
|
111 |
// |
|
112 |
void CAiPlayerPluginEngine::HandlePlaybackMessage( CMPXMessage* aMessage, |
|
113 |
TInt aError ) |
|
114 |
{ |
|
115 |
if ( aError == KErrNone && aMessage ) |
|
116 |
{ |
|
117 |
TRAP_IGNORE( DoHandlePlaybackMessageL( *aMessage ) ); |
|
118 |
} |
|
119 |
} |
|
120 |
||
121 |
// --------------------------------------------------------------------------- |
|
122 |
// From MMPXPlaybackCallback |
|
123 |
// Handle playback property. |
|
124 |
// --------------------------------------------------------------------------- |
|
125 |
// |
|
126 |
void CAiPlayerPluginEngine::HandlePropertyL( TMPXPlaybackProperty aProperty, |
|
127 |
TInt aValue, TInt aError ) |
|
128 |
{ |
|
129 |
DoHandlePropertyL( aProperty, aValue, aError ); |
|
130 |
} |
|
131 |
||
132 |
// --------------------------------------------------------------------------- |
|
133 |
// From MMPXPlaybackCallback |
|
134 |
// Method is called continously until aComplete=ETrue, signifying that |
|
135 |
// it is done and there will be no more callbacks |
|
136 |
// Only new items are passed each time |
|
137 |
// --------------------------------------------------------------------------- |
|
138 |
// |
|
139 |
void CAiPlayerPluginEngine::HandleSubPlayerNamesL( |
|
140 |
TUid /* aPlayer */, |
|
141 |
const MDesCArray* /* aSubPlayers */, |
|
142 |
TBool /* aComplete */, |
|
143 |
TInt /* aError */ ) |
|
144 |
{ |
|
145 |
// do nothing |
|
146 |
} |
|
147 |
||
148 |
// --------------------------------------------------------------------------- |
|
149 |
// From MMPXPlaybackCallback |
|
150 |
// Handle media |
|
151 |
// --------------------------------------------------------------------------- |
|
152 |
// |
|
153 |
void CAiPlayerPluginEngine::HandleMediaL( const CMPXMedia& aMedia, |
|
154 |
TInt aError ) |
|
155 |
{ |
|
156 |
MPX_DEBUG1("CAiPlayerPluginEngine::HandleMediaL"); |
|
157 |
if ( KErrNone == aError ) |
|
158 |
{ |
|
159 |
delete iUri; |
|
160 |
iUri = NULL; |
|
161 |
if (aMedia.IsSupported(KMPXMediaGeneralUri)) |
|
162 |
{ |
|
163 |
TParsePtrC filePath(aMedia.ValueText(KMPXMediaGeneralUri) ); |
|
164 |
iUri = filePath.FullName().AllocL(); |
|
165 |
} |
|
166 |
||
167 |
delete iTitle; |
|
168 |
iTitle = NULL; |
|
169 |
if ( aMedia.IsSupported( KMPXMediaGeneralTitle ) ) |
|
170 |
{ |
|
171 |
iTitle = ( aMedia.ValueText( KMPXMediaGeneralTitle ) ).AllocL(); |
|
172 |
} |
|
173 |
else if ( aMedia.IsSupported( KMPXMediaGeneralUri ) ) |
|
174 |
{ |
|
175 |
TParsePtrC filePath( aMedia.ValueText( KMPXMediaGeneralUri ) ); |
|
176 |
iTitle = (filePath.Name()).AllocL(); |
|
177 |
} |
|
178 |
delete iArtist; |
|
179 |
iArtist = NULL; |
|
180 |
if ( aMedia.IsSupported( KMPXMediaMusicArtist ) ) |
|
181 |
{ |
|
182 |
iArtist = ( aMedia.ValueText( KMPXMediaMusicArtist ) ).AllocL(); |
|
183 |
} |
|
184 |
||
185 |
iObserver->TrackInfoChanged(iTitle ? *iTitle : KNullDesC(), iArtist ? *iArtist : KNullDesC()); |
|
186 |
||
187 |
if (!iSkipping) |
|
188 |
{ |
|
189 |
if (iExtractingAlbumArt) |
|
190 |
{ |
|
191 |
iAlbumArtUtil->CancelRequest(); |
|
192 |
iExtractingAlbumArt=EFalse; |
|
193 |
} |
|
194 |
||
195 |
if ( aMedia.IsSupported( KMPXMediaMusicAlbumArtFileName ) ) |
|
196 |
{ |
|
197 |
delete iMedia; |
|
198 |
iMedia=NULL; |
|
199 |
iMedia = CMPXMedia::NewL( aMedia ); |
|
200 |
TRAPD(err,iAlbumArtUtil->ExtractAlbumArtL( |
|
201 |
*iMedia, |
|
202 |
*this, |
|
203 |
TSize(70,70), |
|
204 |
EFalse)); |
|
205 |
||
206 |
if (err != KErrNone) |
|
207 |
{ |
|
208 |
iObserver->AlbumArtChanged(NULL); |
|
209 |
} |
|
210 |
} |
|
211 |
else |
|
212 |
{ |
|
213 |
iObserver->AlbumArtChanged(NULL); |
|
214 |
} |
|
215 |
||
216 |
} |
|
217 |
else |
|
218 |
{ |
|
219 |
iObserver->AlbumArtChanged(NULL); |
|
220 |
} |
|
221 |
} |
|
222 |
} |
|
223 |
||
224 |
// --------------------------------------------------------------------------- |
|
225 |
// From MMPXPlaybackCallback |
|
226 |
// Handle completion of a asynchronous command |
|
227 |
// --------------------------------------------------------------------------- |
|
228 |
// |
|
229 |
void CAiPlayerPluginEngine::HandlePlaybackCommandComplete( |
|
230 |
CMPXCommand* /*aCommandResult*/, TInt /*aError*/ ) |
|
231 |
{ |
|
232 |
// do nothing |
|
233 |
} |
|
234 |
||
235 |
// --------------------------------------------------------------------------- |
|
236 |
// From MMPXAlbumArtUtilObserver |
|
237 |
// Notify that extraction of album art started. |
|
238 |
// --------------------------------------------------------------------------- |
|
239 |
// |
|
240 |
void CAiPlayerPluginEngine::ExtractAlbumArtStarted() |
|
241 |
{ |
|
242 |
iExtractingAlbumArt = ETrue; |
|
243 |
} |
|
244 |
||
245 |
// --------------------------------------------------------------------------- |
|
246 |
// From MMPXAlbumArtUtilObserver |
|
247 |
// Notify that the extraction of album art has completed. |
|
248 |
// --------------------------------------------------------------------------- |
|
249 |
// |
|
250 |
void CAiPlayerPluginEngine::ExtractAlbumArtCompleted( |
|
251 |
CFbsBitmap* aBitmap, |
|
252 |
TInt aErr ) |
|
253 |
{ |
|
254 |
if (aErr == KErrNone) |
|
255 |
{ |
|
256 |
iObserver->AlbumArtChanged(aBitmap); |
|
257 |
} |
|
258 |
else |
|
259 |
{ |
|
260 |
iObserver->AlbumArtChanged(NULL); |
|
261 |
} |
|
262 |
iExtractingAlbumArt = EFalse; |
|
263 |
} |
|
264 |
||
265 |
// --------------------------------------------------------------------------- |
|
266 |
// Get the current state of the active player |
|
267 |
// --------------------------------------------------------------------------- |
|
268 |
// |
|
269 |
TMPlayerState CAiPlayerPluginEngine::PlayerState() |
|
270 |
{ |
|
271 |
MPX_DEBUG1( "CAiPlayerPluginEngine::PlayerState" ); |
|
272 |
TMPXPlaybackState state( EPbStateNotInitialised ); |
|
273 |
TRAP_IGNORE( state = iPlaybackUtility->StateL() ); |
|
274 |
return MapState( state ); |
|
275 |
} |
|
276 |
||
277 |
// --------------------------------------------------------------------------- |
|
278 |
// CAiPlayerPluginEngine::TitleL |
|
279 |
// --------------------------------------------------------------------------- |
|
280 |
// |
|
281 |
const TDesC& CAiPlayerPluginEngine::TitleL() |
|
282 |
{ |
|
283 |
||
284 |
if ( iTitle ) |
|
285 |
{ |
|
286 |
return *iTitle; |
|
287 |
} |
|
288 |
else |
|
289 |
{ |
|
290 |
RequestMediaL(); |
|
291 |
return KNullDesC; |
|
292 |
} |
|
293 |
} |
|
294 |
||
295 |
// --------------------------------------------------------------------------- |
|
296 |
// CAiPlayerPluginEngine::Artist |
|
297 |
// --------------------------------------------------------------------------- |
|
298 |
// |
|
299 |
const TDesC& CAiPlayerPluginEngine::Artist() |
|
300 |
{ |
|
301 |
if ( iArtist ) |
|
302 |
{ |
|
303 |
return *iArtist; |
|
304 |
} |
|
305 |
else |
|
306 |
{ |
|
307 |
return KNullDesC; |
|
308 |
} |
|
309 |
} |
|
310 |
// --------------------------------------------------------------------------- |
|
311 |
// CAiPlayerPluginEngine::Artist |
|
312 |
// --------------------------------------------------------------------------- |
|
313 |
// |
|
314 |
const TDesC& CAiPlayerPluginEngine::Uri() |
|
315 |
{ |
|
316 |
if ( iUri ) |
|
317 |
{ |
|
318 |
return *iUri; |
|
319 |
} |
|
320 |
else |
|
321 |
{ |
|
322 |
return KNullDesC; |
|
323 |
} |
|
324 |
} |
|
325 |
||
326 |
// ---------------------------------------------------- |
|
327 |
// CAiPlayerPluginEngine::Position |
|
328 |
// ---------------------------------------------------- |
|
329 |
// |
|
330 |
TInt CAiPlayerPluginEngine::Position() |
|
331 |
{ |
|
332 |
return iPosition; |
|
333 |
} |
|
334 |
||
335 |
// ---------------------------------------------------- |
|
336 |
// CAiPlayerPluginEngine::Duration |
|
337 |
// ---------------------------------------------------- |
|
338 |
// |
|
339 |
TInt CAiPlayerPluginEngine::Duration() |
|
340 |
{ |
|
341 |
return iDuration; |
|
342 |
} |
|
343 |
||
344 |
// --------------------------------------------------------------------------- |
|
345 |
// Handle playback message. |
|
346 |
// --------------------------------------------------------------------------- |
|
347 |
// |
|
348 |
void CAiPlayerPluginEngine::DoHandlePlaybackMessageL( |
|
349 |
const CMPXMessage& aMessage ) |
|
350 |
{ |
|
351 |
MPX_DEBUG1("CAiPlayerPluginEngine::DoHandlePlaybackMessageL"); |
|
352 |
||
353 |
TMPXMessageId id( |
|
354 |
aMessage.ValueTObjectL<TMPXMessageId>( KMPXMessageGeneralId ) ); |
|
355 |
if ( KMPXMessageGeneral == id ) |
|
356 |
{ |
|
357 |
TInt event( aMessage.ValueTObjectL<TInt>( KMPXMessageGeneralEvent ) ); |
|
358 |
MPX_DEBUG2( "CAiPlayerPluginEngine::DoHandlePlaybackMessageL(%d)", |
|
359 |
event ); |
|
360 |
switch ( event ) |
|
361 |
{ |
|
362 |
case TMPXPlaybackMessage::EPropertyChanged: |
|
363 |
{ |
|
364 |
TInt error( KErrNone ); |
|
365 |
DoHandlePropertyL( |
|
366 |
aMessage.ValueTObjectL<TInt>( KMPXMessageGeneralType ), |
|
367 |
aMessage.ValueTObjectL<TInt>( KMPXMessageGeneralData ), |
|
368 |
error ); |
|
369 |
break; |
|
370 |
} |
|
371 |
case TMPXPlaybackMessage::EStateChanged: |
|
372 |
{ |
|
373 |
TMPXPlaybackState state( |
|
374 |
aMessage.ValueTObjectL<TMPXPlaybackState>( |
|
375 |
KMPXMessageGeneralType )); |
|
376 |
MPX_DEBUG2("CAiPlayerPluginEngine::HandlePlaybackMessageL - E" |
|
377 |
"StateChanged(%d)", state); |
|
378 |
||
379 |
DoHandleStateChangedL( state ); |
|
380 |
break; |
|
381 |
} |
|
382 |
case TMPXPlaybackMessage::EMediaChanged: |
|
383 |
case TMPXPlaybackMessage::EPlaylistUpdated: |
|
384 |
{ |
|
66
1f1dad4af8f8
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
53
diff
changeset
|
385 |
iPlaybackUtility->PropertyL( *this, EPbPropertyPosition ); |
1f1dad4af8f8
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
53
diff
changeset
|
386 |
iPlaybackUtility->PropertyL( *this, EPbPropertyDuration ); |
1f1dad4af8f8
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
53
diff
changeset
|
387 |
RequestMediaL(); |
53 | 388 |
break; |
389 |
} |
|
390 |
case TMPXPlaybackMessage::ECommandReceived: |
|
391 |
{ |
|
392 |
MPX_DEBUG2("CAiPlayerPluginEngine::HandlePlaybackMessageL - E" |
|
393 |
"CommandReceived(%d)", |
|
394 |
aMessage.ValueTObjectL<TInt>( KMPXMessageGeneralType ) ); |
|
395 |
break; |
|
396 |
} |
|
397 |
case TMPXPlaybackMessage::EActivePlayerChanged: |
|
398 |
{ |
|
399 |
MPX_DEBUG3("CAiPlayerPluginEngine::HandlePlaybackMessageL - E" |
|
400 |
"ActivePlayerChanged(%d, %d)", |
|
401 |
aMessage.ValueTObjectL<TInt>( KMPXMessageGeneralType ), |
|
402 |
aMessage.ValueTObjectL<TInt>( KMPXMessageGeneralData ) ); |
|
403 |
iPlaybackUtility->PropertyL( *this, EPbPropertyPosition ); |
|
404 |
iPlaybackUtility->PropertyL( *this, EPbPropertyDuration ); |
|
405 |
DoHandleStateChangedL( iPlaybackUtility->StateL() ); |
|
406 |
// refresh media property |
|
407 |
RequestMediaL(); |
|
408 |
break; |
|
409 |
} |
|
410 |
case TMPXPlaybackMessage::ESkipping: |
|
411 |
{ |
|
412 |
MPX_DEBUG1( "CAiPlayerPluginEngine::DoHandlePlaybackMessageL - ESkipping"); |
|
413 |
iAlbumArtUtil->CancelRequest(); |
|
414 |
iObserver->Opening(); |
|
415 |
iSkipping =ETrue; |
|
416 |
break; |
|
417 |
} |
|
418 |
case TMPXPlaybackMessage::ESkipEnd: |
|
419 |
{ |
|
420 |
MPX_DEBUG1( "CAiPlayerPluginEngine::DoHandlePlaybackMessageL - ESkipEnd()"); |
|
421 |
iSkipping = EFalse; |
|
422 |
break; |
|
423 |
} |
|
424 |
default: |
|
425 |
{ |
|
426 |
break; |
|
427 |
} |
|
428 |
} |
|
429 |
} |
|
430 |
} |
|
431 |
||
432 |
// --------------------------------------------------------------------------- |
|
433 |
// Handle playback property. |
|
434 |
// --------------------------------------------------------------------------- |
|
435 |
// |
|
436 |
void CAiPlayerPluginEngine::DoHandlePropertyL( TInt aProperty, TInt aValue, |
|
437 |
TInt aError ) |
|
438 |
{ |
|
439 |
MPX_DEBUG4("CAiPlayerPluginEngine::DoHandlePropertyL - Property(%d); Valu" |
|
440 |
"e(%d); Error(%d)", aProperty, aValue, aError ); |
|
441 |
if ( KErrNone == aError ) |
|
442 |
{ |
|
443 |
switch ( aProperty ) |
|
444 |
{ |
|
445 |
case EPbPropertyPosition: |
|
446 |
{ |
|
447 |
iPosition = aValue / KMPXOneSecInMilliSecs; |
|
448 |
iObserver->PlaybackPositionChanged( iPosition ); |
|
449 |
break; |
|
450 |
} |
|
451 |
case EPbPropertyDuration: |
|
452 |
{ |
|
453 |
iDuration = aValue / KMPXOneSecInMilliSecs; |
|
454 |
break; |
|
455 |
} |
|
456 |
default: |
|
457 |
{ |
|
458 |
break; |
|
459 |
} |
|
460 |
} |
|
461 |
} |
|
462 |
} |
|
463 |
||
464 |
// --------------------------------------------------------------------------- |
|
465 |
// Handle playback state changed. |
|
466 |
// --------------------------------------------------------------------------- |
|
467 |
// |
|
468 |
void CAiPlayerPluginEngine::DoHandleStateChangedL( TMPXPlaybackState aState ) |
|
469 |
{ |
|
470 |
TMPlayerState state = MapState( aState ); |
|
471 |
MPX_DEBUG3("CAiPlayerPluginEngine::DoHandleStateChangedL - State mapped " |
|
472 |
"from (%d) to (%d)", aState, state ); |
|
473 |
if (state != EMPlayerStateStarting) |
|
474 |
{ |
|
475 |
iObserver->PlayerStateChanged(state); |
|
476 |
} |
|
477 |
else |
|
478 |
{ |
|
479 |
iObserver->Opening(); |
|
480 |
} |
|
481 |
} |
|
482 |
||
483 |
// --------------------------------------------------------------------------- |
|
484 |
// Displays error notes. |
|
485 |
// --------------------------------------------------------------------------- |
|
486 |
// |
|
487 |
void CAiPlayerPluginEngine::HandleErrorL( TInt aError ) |
|
488 |
{ |
|
489 |
MPX_DEBUG2("CAiPlayerPluginEngine::HandleErrorL(%d)", aError ); |
|
490 |
} |
|
491 |
||
492 |
// --------------------------------------------------------------------------- |
|
493 |
// Map states from TMPXPlaybackState to TMPlayerState |
|
494 |
// --------------------------------------------------------------------------- |
|
495 |
// |
|
496 |
TMPlayerState CAiPlayerPluginEngine::MapState( TMPXPlaybackState aState ) |
|
497 |
{ |
|
498 |
TMPlayerState state = EMPlayerStateOther; |
|
499 |
switch ( aState ) |
|
500 |
{ |
|
501 |
case EPbStatePlaying: |
|
502 |
state = EMPlayerStatePlaying; |
|
503 |
break; |
|
504 |
case EPbStatePaused: |
|
505 |
state = EMPlayerStatePaused; |
|
506 |
break; |
|
507 |
case EPbStateSeekingForward: |
|
508 |
case EPbStateSeekingBackward: |
|
509 |
state = EMPlayerStateSeeking; |
|
510 |
break; |
|
511 |
case EPbStateNotInitialised: |
|
512 |
case EPbStateInitialising: |
|
513 |
state = EMPlayerStateStarting; |
|
514 |
break; |
|
515 |
case EPbStateStopped: |
|
516 |
state = EMPlayerStateStopped; |
|
517 |
break; |
|
518 |
default: |
|
519 |
break; |
|
520 |
} |
|
521 |
return state; |
|
522 |
} |
|
523 |
||
524 |
// --------------------------------------------------------------------------- |
|
525 |
// Requests Media. |
|
526 |
// --------------------------------------------------------------------------- |
|
527 |
// |
|
528 |
void CAiPlayerPluginEngine::RequestMediaL() |
|
529 |
{ |
|
530 |
MPX_DEBUG1( "CAiPlayerPluginEngine::RequestMediaL" ); |
|
531 |
MMPXSource* s = iPlaybackUtility->Source(); |
|
532 |
if ( s ) |
|
533 |
{ |
|
534 |
RArray<TMPXAttribute> attrs; |
|
535 |
CleanupClosePushL(attrs); |
|
536 |
attrs.Append( KMPXMediaGeneralUri ); |
|
537 |
attrs.Append( KMPXMediaGeneralTitle ); |
|
538 |
attrs.Append( KMPXMediaMusicArtist ); |
|
539 |
attrs.Append( KMPXMediaMusicAlbumArtFileName ); |
|
540 |
s->MediaL( attrs.Array(), *this ); |
|
541 |
CleanupStack::PopAndDestroy( &attrs ); |
|
542 |
} |
|
66
1f1dad4af8f8
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
53
diff
changeset
|
543 |
else |
1f1dad4af8f8
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
53
diff
changeset
|
544 |
{ |
1f1dad4af8f8
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
53
diff
changeset
|
545 |
iObserver->PlaylisIsEmpty(); |
1f1dad4af8f8
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
53
diff
changeset
|
546 |
} |
53 | 547 |
} |
548 |
// End of File |