ScummVM API documentation
video.h
1 /* ScummVM - Graphic Adventure Engine
2  *
3  * ScummVM is the legal property of its developers, whose names
4  * are too numerous to list here. Please refer to the COPYRIGHT
5  * file distributed with this source distribution.
6  *
7  * This program is free software: you can redistribute it and/or modify
8  * it under the terms of the GNU General Public License as published by
9  * the Free Software Foundation, either version 3 of the License, or
10  * (at your option) any later version.
11 
12  * This program is distributed in the hope that it will be useful,
13  * but WITHOUT ANY WARRANTY; without even the implied warranty of
14  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15  * GNU General Public License for more details.
16 
17  * You should have received a copy of the GNU General Public License
18  * along with this program. If not, see <http://www.gnu.org/licenses/>.
19  *
20  */
21 
22 #ifndef ASYLUM_VIEWS_VIDEO_H
23 #define ASYLUM_VIEWS_VIDEO_H
24 
25 #include "common/array.h"
26 #include "common/events.h"
27 #include "common/system.h"
28 #include "common/list.h"
29 
30 #include "audio/mixer.h"
31 
32 #include "graphics/surface.h"
33 
34 #include "video/video_decoder.h"
35 
36 #include "asylum/eventhandler.h"
37 #include "asylum/shared.h"
38 
39 #include "asylum/system/screen.h"
40 
41 namespace Asylum {
42 
43 class AsylumEngine;
44 class GraphicResource;
45 class VideoText;
46 struct GraphicFrame;
47 
48 struct VideoSubtitle {
49  int frameStart;
50  int frameEnd;
51  ResourceId resourceId;
52 };
53 
54 class VideoPlayer : public EventHandler {
55 public:
56  VideoPlayer(AsylumEngine *engine, Audio::Mixer *mixer);
57  virtual ~VideoPlayer();
58 
65  void play(uint32 videoNumber, EventHandler *handler);
66 
74  bool handleEvent(const AsylumEvent &evt);
75 
76 private:
77  AsylumEngine *_vm;
78 
79  Video::VideoDecoder *_decoder;
81 
82  int32 _currentMovie;
83  int32 _subtitleIndex;
84  int32 _subtitleCounter;
85  ResourceId _previousFont;
86  bool _done;
87  byte _subtitlePalette[PALETTE_SIZE];
88 
95  void play(const Common::Path &filename, bool showSubtitles);
96 
100  void setupPalette();
101 
105  void loadSubtitles();
106 };
107 
108 } // end of namespace Asylum
109 
110 #endif // ASYLUM_VIEWS_VIDEO_H
Definition: array.h:52
Definition: asylum.h:53
Definition: path.h:52
Definition: video.h:48
Definition: eventhandler.h:43
Definition: mixer.h:59
Definition: video.h:54
Definition: video_decoder.h:53
Definition: eventhandler.h:61
Definition: asylum.h:73