mpengine/src/mpmpxplaybackframeworkwrapper_p.cpp
changeset 32 c163ef0b758d
parent 29 8192e5b5c935
child 43 0f32e550d9d8
child 48 af3740e3753f
--- a/mpengine/src/mpmpxplaybackframeworkwrapper_p.cpp	Thu May 27 12:49:57 2010 +0300
+++ b/mpengine/src/mpmpxplaybackframeworkwrapper_p.cpp	Fri Jun 11 13:36:36 2010 +0300
@@ -64,8 +64,8 @@
     TX_ENTRY
 
     if ( iPlaybackUtility ) {
-        ForceStopL();
-        iPlaybackUtility->RemoveObserverL(*this);
+        TRAP_IGNORE( ForceStopL() );
+        TRAP_IGNORE( iPlaybackUtility->RemoveObserverL(*this) );
         iPlaybackUtility->Close();
     }
 
@@ -379,7 +379,7 @@
                 aProperties.ValueText( KMPXMediaMusicArtist ).Length() ) );
     }
     else {
-            changed |= iPlaybackData->setArtist(hbTrId("txt_mus_other_unknown3"));
+            changed |= iPlaybackData->setArtist(QString());
     }
     if ( aProperties.IsSupported( KMPXMediaMusicAlbum ) ) {
         changed |= iPlaybackData->setAlbum(
@@ -388,7 +388,7 @@
                 aProperties.ValueText( KMPXMediaMusicAlbum ).Length() ) );
     }
     else {
-            changed |= iPlaybackData->setAlbum(hbTrId("txt_mus_other_unknown4"));
+            changed |= iPlaybackData->setAlbum(QString());
     }
     if (aProperties.IsSupported(TMPXAttribute(KMPXMediaGeneralMimeType))) {
         
@@ -480,13 +480,12 @@
     if ( ok ) {
         iPlaybackUtility->InitL( xqfile );
     }
-	else {
-		TX_LOG_ARGS("Error: " << ok << "; should never get here.");
-	}
-    
-    
+    else {
+        TX_LOG_ARGS("Error: " << ok << "; should never get here.");
+    }
     TX_EXIT
 }
+
 /*!
  \internal
  */
@@ -565,8 +564,6 @@
         cmd->SetTObjectValueL<TBool>( KMPXCommandPlaybackGeneralNoBuffer, ETrue );
         iPlaybackUtility->CommandL( *cmd );
         CleanupStack::PopAndDestroy( cmd );
-
-       // iPlaybackUtility->RemoveObserverL(*this);
     }
     TX_EXIT
 }
@@ -579,7 +576,11 @@
     TX_ENTRY
     if ( !iPlaybackUtility->Source() ) {
         TX_LOG_ARGS("There is no source")
-        iPlaybackData->setPlaybackState( MpPlaybackData::NotPlaying );
+        //this to prevent mutiple calls to state change.
+        if ( iPlaybackData->playbackState() != MpPlaybackData::NotPlaying ) {
+            iPlaybackData->setPlaybackState( MpPlaybackData::NotPlaying );
+            iPlaybackData->resetData();
+        }
     }
     else {
         switch ( iPlaybackUtility->StateL() ) {