ScummVM API documentation
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Modules Pages
sci_resource.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 DGDS_SOUND_RESOURCE_SCI_RESOURCE_H
23 #define DGDS_SOUND_RESOURCE_SCI_RESOURCE_H
24 
25 #include "dgds/sound/scispan.h"
26 
27 namespace Common {
28 class File;
29 class FSList;
30 class FSNode;
31 class WriteStream;
32 class SeekableReadStream;
33 }
34 
35 namespace Dgds {
36 
38 class SciResource : public SciSpan<const byte> {
39 public:
40  SciResource(const byte *data, int dataSz, int16 id);
41  ~SciResource();
42  void unalloc();
43 };
44 
46 public:
47  struct Channel {
48  byte number;
49  byte flags;
50  byte poly;
51  uint16 prio;
53  uint16 curPos;
54  long time;
55  byte prev;
56 
57  Channel() :
58  number(0),
59  flags(0),
60  poly(0),
61  prio(0),
62  data(),
63  curPos(0) {
64  time = 0;
65  prev = 0;
66  }
67  };
68 
69  struct Track {
70  byte type;
71  byte channelCount;
72  SciSpan<const byte> header;
73  Channel *channels;
74  int16 digitalChannelNr;
75  uint16 digitalSampleRate;
76  uint16 digitalSampleSize;
77  uint16 digitalSampleStart;
78  uint16 digitalSampleEnd;
79  };
80 public:
81  SoundResource(uint32 resNumberu, const byte *data, int dataSz);
82  ~SoundResource();
83 
84  Track *getTrackByType(byte type);
85  Track *getDigitalTrack();
86 
87  byte getSoundPriority() const { return _soundPriority; }
88  bool exists() const { return _resource != nullptr; }
89 
90 private:
91  int _trackCount;
92  Track *_tracks;
93  SciResource *_resource;
94  byte _soundPriority;
95 };
96 
97 } // End of namespace Dgds
98 
99 #endif // DGDS_SOUND_RESOURCE_SCI_RESOURCE_H
Definition: sci_resource.h:69
Definition: ads.h:28
Definition: sci_resource.h:45
Definition: algorithm.h:29
Definition: scispan.h:167
Definition: sci_resource.h:38
Definition: sci_resource.h:47