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