ScummVM API documentation
drives.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  * CD/drive handling functions
21  */
22 
23 #ifndef TINSEL_DRIVES_H
24 #define TINSEL_DRIVES_H
25 
26 #include "common/coroutines.h"
27 #include "common/stream.h"
28 #include "tinsel/dw.h"
29 
30 namespace Common {
31 class Path;
32 }
33 
34 namespace Tinsel {
35 
36 // flags2
37 #define fCd1 0x00000001L
38 #define fCd2 0x00000002L
39 #define fCd3 0x00000004L
40 #define fCd4 0x00000008L
41 #define fCd5 0x00000010L
42 #define fCd6 0x00000020L
43 #define fCd7 0x00000040L
44 #define fCd8 0x00000080L
45 
46 #define fAllCds (fCd1|fCd2|fCd3|fCd4|fCd5|fCd6|fCd7|fCd8)
47 
48 void DoCdChange();
49 
50 void CdCD(CORO_PARAM);
51 
52 int GetCurrentCD();
53 
54 void SetCD(int flags);
55 
56 int GetCD(int flags);
57 
58 void SetNextCD(int cdNumber);
59 
60 bool GotoCD();
61 
63 private:
64  static bool _warningShown;
66  bool openInternal(const Common::Path &filename);
67 public:
68  // This constructor is only used for _sampleStream inside sound.h
69  TinselFile();
70  TinselFile(bool bigEndian);
71  ~TinselFile() override;
72  bool open(const Common::String &filename);
73  void close();
74  char getCdNumber();
75 
76  bool err() const override;
77  void clearErr() override;
78 
79  bool eos() const override;
80  uint32 read(void *dataPtr, uint32 dataSize) override;
81 
82  int64 pos() const override;
83  int64 size() const override;
84  bool seek(int64 offset, int whence = SEEK_SET) override;
85 };
86 
87 
88 } // End of namespace Tinsel
89 
90 #endif /* TINSEL_DRIVES_H */
Definition: stream.h:854
Definition: str.h:59
Definition: drives.h:62
Definition: path.h:52
Definition: stream.h:745
Path
Definition: game.h:75
#define CORO_PARAM
Definition: coroutines.h:107
Definition: algorithm.h:29
Definition: actors.h:36