ScummVM API documentation
dimuse_sndmgr.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 SCUMM_IMUSE_DIGI_SNDMGR_H
23 #define SCUMM_IMUSE_DIGI_SNDMGR_H
24 
25 
26 #include "common/scummsys.h"
27 
28 namespace Audio {
29 class SeekableAudioStream;
30 }
31 
32 namespace Common {
33 class SeekableReadStream;
34 }
35 
36 namespace Scumm {
37 
38 class ScummEngine;
39 class BundleMgr;
40 class BundleDirCache;
41 
43 public:
44 
45 #define MAX_IMUSE_SOUNDS 16
46 
47 #define IMUSE_RESOURCE 1
48 #define IMUSE_BUNDLE 2
49 
50 #define IMUSE_VOLGRP_VOICE 1
51 #define IMUSE_VOLGRP_SFX 2
52 #define IMUSE_VOLGRP_MUSIC 3
53 
54 public:
55 
56  struct SoundDesc {
57  bool inUse;
58  bool scheduledForDealloc;
59 
60  byte *resPtr;
61  int resSize;
62  int resCurOffset;
63  char name[15];
64  int16 soundId;
65  BundleMgr *bundle;
66  };
67 
68 private:
69 
70  SoundDesc _sounds[MAX_IMUSE_SOUNDS];
71  bool checkForProperHandle(SoundDesc *soundDesc);
72  SoundDesc *allocSlot();
73 
74  ScummEngine *_vm;
75  byte _disk;
76  BundleDirCache *_cacheBundleDir;
77 
78  bool openMusicBundle(SoundDesc *sound, int &disk);
79  bool openVoiceBundle(SoundDesc *sound, int &disk);
80 
81 public:
82 
84  ~ImuseDigiSndMgr();
85 
86  SoundDesc *openSound(int32 soundId, const char *soundName, int soundType, int volGroupId, int disk);
87  void closeSound(SoundDesc *soundDesc);
88  void closeSoundById(int soundId);
89  SoundDesc *findSoundById(int soundId);
90  SoundDesc *getSounds();
91  void scheduleSoundForDeallocation(int soundId);
92 
93 };
94 
95 } // End of namespace Scumm
96 
97 #endif
Definition: dimuse_bndmgr.h:68
Definition: scumm.h:518
Definition: dimuse_sndmgr.h:42
Definition: dimuse_bndmgr.h:33
Definition: algorithm.h:29
Definition: dimuse_sndmgr.h:56
Definition: actor.h:30
Definition: system.h:38