ScummVM API documentation
demoplayer.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  * This file is dual-licensed.
22  * In addition to the GPLv3 license mentioned above, this code is also
23  * licensed under LGPL 2.1. See LICENSES/COPYING.LGPL file for the
24  * full text of the license.
25  *
26  */
27 
28 #ifndef GOB_DEMOPLAYER_H
29 #define GOB_DEMOPLAYER_H
30 
31 #include "common/str.h"
32 #include "common/stream.h"
33 #include "common/hashmap.h"
34 
35 namespace Gob {
36 
37 class GobEngine;
38 
39 class DemoPlayer {
40 public:
41  DemoPlayer(GobEngine *vm);
42  virtual ~DemoPlayer();
43 
44  bool play(const char *fileName);
45  bool play(uint32 index);
46 
47 protected:
48  GobEngine *_vm;
49  bool _doubleMode;
50  bool _autoDouble;
51  bool _rebase0;
52 
53  virtual bool playStream(Common::SeekableReadStream &stream) = 0;
54 
55  bool lineStartsWith(const Common::String &line, const char *start);
56 
57  void init();
58 
59  void evaluateVideoMode(const char *mode);
60  void clearScreen();
61  void playVideo(const char *fileName);
62  void playADL(const char *params);
63 
64  void playVideoNormal(int slot);
65  void playVideoDoubled(int slot);
66  void playADL(const Common::String &fileName, bool waitEsc = true, int32 repeat = -1);
67 
68 private:
69  enum ScriptSource {
70  kScriptSourceFile,
71  kScriptSourceDirect
72  };
73 
74  struct Script {
75  ScriptSource source;
76  const char *script;
77  };
78 
79  static Script _scripts[];
80 };
81 
82 } // End of namespace Gob
83 
84 #endif // GOB_DEMOPLAYER_H
Definition: gob.h:163
Definition: str.h:59
Definition: demoplayer.h:39
Definition: stream.h:745
Definition: anifile.h:40