2315
|
1 #pragma once
|
|
2
|
|
3 namespace Media
|
|
4 {
|
|
5 class ITrack
|
|
6 {
|
|
7 public: virtual void Play(bool loop = false) = 0;
|
|
8 };
|
|
9
|
|
10 class IMovie
|
|
11 {
|
|
12 public: virtual void Play() = 0;
|
|
13 virtual void GetNextFrame(double dt, void *target_surface) = 0;
|
|
14 };
|
|
15
|
2356
|
16 class MPlayer
|
2315
|
17 {
|
|
18 public:
|
2356
|
19 MPlayer();
|
|
20 virtual ~MPlayer();
|
2315
|
21
|
|
22 ITrack *LoadTrack(const wchar_t *name);
|
|
23 IMovie *LoadMovie(const wchar_t *name, int width, int height, int cache_ms);
|
2345
|
24 IMovie *LoadMovieFromLOD(HANDLE h, int readFunction(void*, uint8_t*, int), int64_t seekFunction(void*, int64_t, int), int width, int height);
|
2315
|
25 };
|
2345
|
26 };
|
|
27
|
2356
|
28 extern Media::MPlayer *pMediaPlayer;
|
|
29 extern Media::IMovie *pMovie;
|
|
30 extern Media::ITrack *pTrack;
|
|
31
|
2345
|
32 extern bool end_current_file;
|
|
33 extern bool loop_current_file;
|
|
34 extern DWORD time_video_begin;
|
|
35 extern int current_movie_width;
|
|
36 extern int current_movie_height;
|
2347
|
37
|
|
38 int64_t seekFunction(void* opaque, int64_t offset, int whence);
|
2356
|
39 extern void PlayMovie(const wchar_t * pFilename);
|
|
40 extern void PlayAudio(const wchar_t * pFilename);
|
2347
|
41
|
2356
|
42 //////////////////////////////////////////////////////////////////////////
|
|
43 //Included from a VideoPlayer.h file/вставлено из файла VideoPlayer.h/
|
|
44 //////////////////////////////////////////////////////////////////////////
|
|
45
|
|
46 //used in void VideoPlayer::Initialize(OSWindow *target_window) for open .vid files
|
|
47 struct MovieHeader
|
|
48 {
|
|
49 char pVideoName[40];
|
|
50 unsigned int uFileOffset;
|
|
51 };
|
|
52
|
|
53 extern MovieHeader *pMightVideoHeaders;
|
|
54 extern MovieHeader *pMagicVideoHeaders;
|
|
55 extern HANDLE hMightVid;
|
|
56 extern HANDLE hMagicVid;
|
|
57 extern unsigned __int64 uBinkVersion;
|
|
58 extern unsigned int uNumMightVideoHeaders;
|
|
59 extern unsigned int uNumMagicVideoHeaders;
|
|
60 // |