ScummVM API documentation
dimuse_files.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#if !defined(SCUMM_IMUSE_DIGI_FILES_H) && defined(ENABLE_SCUMM_7_8)
23#define SCUMM_IMUSE_DIGI_FILES_H
24
25#include "common/scummsys.h"
26#include "common/textconsole.h"
27#include "common/util.h"
28#include "scumm/resource.h"
29#include "scumm/file.h"
30#include "scumm/imuse_digi/dimuse_bndmgr.h"
31#include "scumm/imuse_digi/dimuse_sndmgr.h"
32
33namespace Scumm {
34
35class IMuseDigiFilesHandler {
36
37private:
38 IMuseDigital *_engine;
39 ImuseDigiSndMgr *_sound;
40 ScummEngine_v7 *_vm;
41 Common::Mutex _mutex;
42 IMuseDigiSndBuffer _soundBuffers[4];
43 char _currentSpeechFilename[60] = {};
44 ScummFile *_ftSpeechFile;
45 char _ftSpeechFilename[160] = {};
46 int _ftSpeechSubFileOffset;
47 int _ftSpeechFileSize;
48 int _ftSpeechFileCurPos;
49
50 void getFilenameFromSoundId(int soundId, char *fileName, size_t size);
51public:
52 IMuseDigiFilesHandler(IMuseDigital *engine, ScummEngine_v7 *vm);
53 ~IMuseDigiFilesHandler();
54
55 uint8 *getSoundAddrData(int soundId);
56 int getSoundAddrDataSize(int soundId, bool hasStream);
57 int getNextSound(int soundId);
58 int seek(int soundId, int32 offset, int mode, int bufId);
59 int read(int soundId, uint8 *buf, int32 size, int bufId);
60 IMuseDigiSndBuffer *getBufInfo(int bufId);
61 int openSound(int soundId);
62 void closeSound(int soundId);
63 void closeAllSounds();
64 void allocSoundBuffer(int bufId, int32 size, int32 loadSize, int32 criticalSize);
65 void deallocSoundBuffer(int bufId);
66 void flushSounds();
67 int setCurrentSpeechFilename(const char *fileName);
68 void setCurrentFtSpeechFile(const char *fileName, ScummFile *file, uint32 offset, uint32 size);
69 void closeSoundImmediatelyById(int soundId);
70 void saveLoad(Common::Serializer &ser);
71};
72
73} // End of namespace Scumm
74#endif
Definition: mutex.h:67
Definition: serializer.h:80
Definition: actor.h:30