diff MediaPlayer.h @ 2455:51d4f38aca6c

audio through OpenAL (begining)
author Ritor1
date Fri, 25 Jul 2014 17:49:20 +0600
parents 16f0278279a5
children 5abd8fc8f1c6
line wrap: on
line diff
--- a/MediaPlayer.h	Fri Jul 25 15:47:11 2014 +0600
+++ b/MediaPlayer.h	Fri Jul 25 17:49:20 2014 +0600
@@ -39,6 +39,13 @@
   char pVideoName[40];
   unsigned int uFileOffset;
 };
+struct SoundHeader
+{
+  char pSoundName[40];
+  unsigned int uFileOffset;
+  unsigned int uCompressedSize;
+  unsigned int uDecompressedSize;
+};
 
 enum MovieType
 {
@@ -101,18 +108,18 @@
       DWORD time_video_begin;
       int current_movie_width;
       int current_movie_height;
-
-      HANDLE hVidFile;
+	  HANDLE hVidFile;
       int uSize;
       int uOffset;
 
       void Initialize(OSWindow *window);
 
-      void OpenGlobalMovie(const char *pFilename, unsigned int bLoop);
+      void OpenFullscreenMovie(const char *pFilename, unsigned int bLoop);
       void OpenHouseMovie(const char *pMovieName, unsigned int a3_1);
 
       void LoadMovie(const char *);
       void SelectMovieType();
+
       inline void PlayFullscreenMovie(MovieType movie_type, bool bShowMouseAfterPlayback)
       {
         extern unsigned int bNoVideo;
@@ -120,21 +127,20 @@
 
         switch (movie_type)
         {
-          case MOVIE_3DOLogo: GlobalMovieLoop("3dologo", 0);        break;
-          case MOVIE_NWCLogo: GlobalMovieLoop("new world logo", 0); break;
-          case MOVIE_JVC:     GlobalMovieLoop("jvc", 0);            break;
-          case MOVIE_Intro:   GlobalMovieLoop("Intro", 0);          break;
-          case MOVIE_Emerald: GlobalMovieLoop("Intro Post", 0);     break;
-          case MOVIE_Death:   GlobalMovieLoop("losegame", 2);       break;
-          case MOVIE_Outro:   GlobalMovieLoop("end_seq1", 20);      break;
+          case MOVIE_3DOLogo: FullscreenMovieLoop("3dologo", 0);        break;
+          case MOVIE_NWCLogo: FullscreenMovieLoop("new world logo", 0); break;
+          case MOVIE_JVC:     FullscreenMovieLoop("jvc", 0);            break;
+          case MOVIE_Intro:   FullscreenMovieLoop("Intro", 0);          break;
+          case MOVIE_Emerald: FullscreenMovieLoop("Intro Post", 0);     break;
+          case MOVIE_Death:   FullscreenMovieLoop("losegame", 2);       break;
+          case MOVIE_Outro:   FullscreenMovieLoop("end_seq1", 20);      break;
 
           default:
             Error("Invalid movie requested: %u", movie_type);
           break;
         }
       }
-
-	  void GlobalMovieLoop(const char *pMovieName, int a2);
+	  void FullscreenMovieLoop(const char *pMovieName, int a2);
       void HouseMovieLoop();
 
       void ShowMM7IntroVideo_and_LoadingScreen();
@@ -144,6 +150,14 @@
       IMovie *LoadMovie(const wchar_t *name, int width, int height, int cache_ms);
       IMovie *LoadMovieFromLOD(HANDLE h, int readFunction(void*, uint8_t*, int), int64_t seekFunction(void*, int64_t, int), int width, int height);
 
+	  //for audio////////////////////////////////////
+	  HANDLE hAudioSnd;
+	  unsigned int uNumSoundHeaders;
+	  struct SoundHeader *pSoundHeaders;
+
+	  void LoadAudioSnd();
+	  ///////////////////////////////////////////////
+
 
       ITrack *LoadTrack(const wchar_t *name);