changeset 2510:ae2b7048b3eb

alSourcePause
author Ritor1
date Thu, 02 Oct 2014 13:39:42 +0600
parents fc5e83bbafd1
children fb1c61a82a55
files Media/MediaPlayer.cpp OSWindow.cpp
diffstat 2 files changed, 24 insertions(+), 8 deletions(-) [+]
line wrap: on
line diff
--- a/Media/MediaPlayer.cpp	Thu Oct 02 12:23:52 2014 +0600
+++ b/Media/MediaPlayer.cpp	Thu Oct 02 13:39:42 2014 +0600
@@ -1063,8 +1063,10 @@
   if (!this->bPlaying_Movie)
   {
     pEventTimer->Pause();
-	if (pAudioPlayer->hAILRedbook)
-		AIL_redbook_pause(pAudioPlayer->hAILRedbook);
+	if ( use_music_folder )
+      alSourcePause(mSourceID);
+    else if (pAudioPlayer->hAILRedbook)
+	  AIL_redbook_pause(pAudioPlayer->hAILRedbook);
 
 	bStopBeforeSchedule = false;
 	bFirstFrame = false;
@@ -1081,7 +1083,9 @@
   {
     //Prepare();
     pEventTimer->Pause();
-    if (pAudioPlayer->hAILRedbook)
+    if ( use_music_folder )
+      alSourcePause(mSourceID);
+    else if (pAudioPlayer->hAILRedbook)
       AIL_redbook_pause(pAudioPlayer->hAILRedbook);
 
     bStopBeforeSchedule = false;
@@ -1381,8 +1385,13 @@
   bPlaying_Movie = false;
   uMovieType = 0;
   memset(pCurrentMovieName, 0, 0x40);
-  if ( pAudioPlayer->hAILRedbook && !bGameoverLoop )
-    AIL_redbook_resume(pAudioPlayer->hAILRedbook);
+  if ( !bGameoverLoop && pMediaPlayer->current_movie_width == 460)
+  {
+    if ( use_music_folder )
+      alSourcePlay(mSourceID);
+    else if ( pAudioPlayer->hAILRedbook )
+      AIL_redbook_resume(pAudioPlayer->hAILRedbook);
+  }
   pEventTimer->Resume();
 
   pMovie_Track->Release();
--- a/OSWindow.cpp	Thu Oct 02 12:23:52 2014 +0600
+++ b/OSWindow.cpp	Thu Oct 02 13:39:42 2014 +0600
@@ -322,8 +322,13 @@
               //BackToHouseMenu();
             }
           }
-          if ( pAudioPlayer->hAILRedbook && !bGameoverLoop && !pMovie_Track)//!pVideoPlayer->pSmackerMovie )
-            AIL_redbook_resume(pAudioPlayer->hAILRedbook);
+		  if ( !bGameoverLoop && !pMovie_Track )//continue an audio track
+		  {
+	        if ( use_music_folder )
+              alSourcePlay(mSourceID);
+            else if ( pAudioPlayer->hAILRedbook )//!pVideoPlayer->pSmackerMovie )
+              AIL_redbook_resume(pAudioPlayer->hAILRedbook);
+		  }
         }
       }
       else
@@ -348,7 +353,9 @@
           if (pAudioPlayer != nullptr)
           {
             pAudioPlayer->StopChannels(-1, -1);//приостановка воспроизведения звуков при неактивном окне игры
-            if ( pAudioPlayer->hAILRedbook )
+            if ( use_music_folder )
+              alSourcePause(mSourceID);
+            else if ( pAudioPlayer->hAILRedbook )
               AIL_redbook_pause(pAudioPlayer->hAILRedbook);
           }
         }