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;
|
2360
|
31 extern class Movie *movie;
|
2356
|
32
|
2345
|
33 extern bool end_current_file;
|
|
34 extern bool loop_current_file;
|
|
35 extern DWORD time_video_begin;
|
|
36 extern int current_movie_width;
|
|
37 extern int current_movie_height;
|
2347
|
38
|
2359
|
39 extern int mSourceID;
|
|
40
|
2360
|
41 //int64_t seekFunction(void* opaque, int64_t offset, int whence);
|
2356
|
42 extern void PlayMovie(const wchar_t * pFilename);
|
|
43 extern void PlayAudio(const wchar_t * pFilename);
|
2360
|
44 extern void MovieRelease();
|
2347
|
45
|
2356
|
46 //////////////////////////////////////////////////////////////////////////
|
|
47 //Included from a VideoPlayer.h file/вставлено из файла VideoPlayer.h/
|
|
48 //////////////////////////////////////////////////////////////////////////
|
|
49
|
|
50 //used in void VideoPlayer::Initialize(OSWindow *target_window) for open .vid files
|
|
51 struct MovieHeader
|
|
52 {
|
|
53 char pVideoName[40];
|
|
54 unsigned int uFileOffset;
|
|
55 };
|
|
56
|
|
57 extern MovieHeader *pMightVideoHeaders;
|
|
58 extern MovieHeader *pMagicVideoHeaders;
|
|
59 extern HANDLE hMightVid;
|
|
60 extern HANDLE hMagicVid;
|
|
61 extern unsigned __int64 uBinkVersion;
|
|
62 extern unsigned int uNumMightVideoHeaders;
|
|
63 extern unsigned int uNumMagicVideoHeaders;
|
|
64 // |