mpx/playbackframework/playbackengine/src/mpxplaybackengine.cpp
changeset 27 cbb1bfb7ebfb
parent 25 d881023c13eb
child 32 edd273b3192a
equal deleted inserted replaced
25:d881023c13eb 27:cbb1bfb7ebfb
  1476         // Check if position is not past the duration
  1476         // Check if position is not past the duration
  1477 	if ( iProperties[EPbPropertyPosition] >= iProperties[EPbPropertyDuration] )
  1477 	if ( iProperties[EPbPropertyPosition] >= iProperties[EPbPropertyDuration] )
  1478             {
  1478             {
  1479             iProperties[EPbPropertyPosition] = 0;
  1479             iProperties[EPbPropertyPosition] = 0;
  1480             }
  1480             }
       
  1481 	
       
  1482 	//check whether plugin is KMPXPlaybackPluginVersion2, if not, set saved position
       
  1483     CDesCArray* interfaces = iPluginHandler->SupportedInterfacesL( iPluginUid );
       
  1484     TBool version2InterfaceSupported = EFalse;
       
  1485     if ( interfaces->MdcaCount() )
       
  1486         {
       
  1487         TInt pos(0);            
       
  1488         version2InterfaceSupported = !interfaces->FindIsq( KMPXPlaybackPluginVersion2, pos );
       
  1489         }
       
  1490     delete interfaces;
       
  1491     
       
  1492     if ( !version2InterfaceSupported )
       
  1493         {
       
  1494         // Set position to restore saved position.
       
  1495         TRAP_IGNORE( // uPnP leaves if set position in stop state
       
  1496                 PluginL()->SetL( EPbPropertyPosition, iProperties[EPbPropertyPosition] ));
       
  1497         }
  1481 
  1498 
  1482     iAutoResumeHandler->HandleOpenFileComplete();
  1499     iAutoResumeHandler->HandleOpenFileComplete();
  1483     
  1500     
  1484     // Check if playback should not be started automatically.
  1501     // Check if playback should not be started automatically.
  1485     if ( iAccessPoint || ( iPlaylist && (!iPlaylist->AutoPlay()) ) )
  1502     if ( iAccessPoint || ( iPlaylist && (!iPlaylist->AutoPlay()) ) )
  1676         {
  1693         {
  1677         ASSERT(iTaskQueue->Task() == EProperty && iTaskQueue->Callback() == iCallback);
  1694         ASSERT(iTaskQueue->Task() == EProperty && iTaskQueue->Callback() == iCallback);
  1678         iCallback->HandleProperty(aProperty,aValue,aError);
  1695         iCallback->HandleProperty(aProperty,aValue,aError);
  1679         iCallback = NULL;
  1696         iCallback = NULL;
  1680         iTaskQueue->CompleteTask();
  1697         iTaskQueue->CompleteTask();
  1681         
       
  1682         // notify client the new position during the playback
       
  1683         if ((EPbPropertyPosition == aProperty) && (iProgressTimer->IsActive()))
       
  1684             {
       
  1685             TRAP_IGNORE(iClientList->SendMsgL(
       
  1686                     TMPXPlaybackMessage(TMPXPlaybackMessage::EPropertyChanged,
       
  1687                                         EPbPropertyPosition,aValue)));            
       
  1688             }
       
  1689         }
  1698         }
  1690     MPX_DEBUG2("<--CMPXPlaybackEngine::HandleProperty 0x%08x", this);
  1699     MPX_DEBUG2("<--CMPXPlaybackEngine::HandleProperty 0x%08x", this);
  1691     }
  1700     }
  1692 
  1701 
  1693 // ----------------------------------------------------------------------------
  1702 // ----------------------------------------------------------------------------
  2626 void CMPXPlaybackEngine::DoStopL(TBool aSavePlaybackInfo)
  2635 void CMPXPlaybackEngine::DoStopL(TBool aSavePlaybackInfo)
  2627     {
  2636     {
  2628     MPX_DEBUG1("==>CMPXPlaybackEngine::DoStopL()");
  2637     MPX_DEBUG1("==>CMPXPlaybackEngine::DoStopL()");
  2629     Suspend();
  2638     Suspend();
  2630     if (iState == EPbStatePaused || iState == EPbStatePlaying ||
  2639     if (iState == EPbStatePaused || iState == EPbStatePlaying ||
  2631         iState == EPbStateInitialising)
  2640         iState == EPbStateInitialising || iState == EPbStateBuffering)
  2632         {
  2641         {
  2633         if (aSavePlaybackInfo && (iState == EPbStatePaused || iState == EPbStatePlaying ))
  2642         if (aSavePlaybackInfo && (iState == EPbStatePaused || iState == EPbStatePlaying ))
  2634             {
  2643             {
  2635             TRAP_IGNORE(SavePlaybackInfoL()); // Leave when MMC eject and database already closed.
  2644             TRAP_IGNORE(SavePlaybackInfoL()); // Leave when MMC eject and database already closed.
  2636             }
  2645             }