ScummVM API documentation
wb.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 FREESCAPE_WB_H
23 #define FREESCAPE_WB_H
24 
25 #include "audio/audiostream.h"
26 #include "common/types.h"
27 
28 #include "freescape/music.h"
29 
30 namespace Freescape {
31 
32 namespace WBCommon {
33 
35 int8 decodeOrderTranspose(byte cmd);
36 
38 byte decodeTickSpeed(byte cmd);
39 
41 byte decodeDuration(byte cmd);
42 
53 byte buildArpeggioTable(const byte intervals[8], byte mask, byte *outTable, byte maxLen, bool includeBase);
54 
55 } // End of namespace WBCommon
56 
59  uint32 periodTable; // 48 x uint16 BE
60  uint32 samplePtrTable; // numSamples x uint32 BE
61  uint32 instrumentTable; // numInstruments x 8 bytes
62  uint32 arpeggioIntervals; // 8 bytes
63  uint32 envelopeTable; // numEnvelopes x 8 bytes
64  uint32 songTable; // 2 songs x 4 channels x uint32 BE
65  uint32 patternPtrTable; // up to 128 x uint32 BE
66  int numSamples;
67  int numInstruments;
68  int numEnvelopes;
69 };
70 
83 Audio::AudioStream *makeWallyBebenStream(const byte *data, uint32 dataSize,
84  int songNum = 1, int rate = 44100,
85  bool stereo = true,
86  const WBTableOffsets *offsets = nullptr);
87 
91  uint32 periodTable; // 96 x uint16 BE
92  uint32 arpeggioIntervals; // 8 bytes
93  uint32 instrumentTable; // numInstruments x 8 bytes
94  uint32 songTable; // 2 songs x 3 channels x uint32 BE
95  uint32 patternPtrTable; // up to 32 x uint32 BE
96  int numInstruments;
97 
98  byte noiseSeed; // noise period loaded by instrument flag bit 0
99  bool noiseFollowsInstrument; // flag bit 1 takes the noise period from byte 5
100  byte noiseDrift; // subtracted while the noise counter runs
101 
102  // Frequency sweep, instrument flag bit 2
103  int16 sweepStep;
104  uint16 sweepMask; // period wrap, 0 for none
105  int8 sweepNoiseDelta;
106 };
107 
108 extern const WBAtariTableOffsets kEclipseAtariOffsets;
109 extern const WBAtariTableOffsets kDarkSideAtariOffsets;
110 
119 MusicPlayer *makeWallyBebenAtariPlayer(const byte *data, uint32 dataSize,
120  const WBAtariTableOffsets &offsets,
121  int songNum = 1);
122 
123 } // End of namespace Freescape
124 
125 #endif
Definition: area.h:36
Definition: audiostream.h:50
Definition: music.h:29
MusicPlayer * makeWallyBebenAtariPlayer(const byte *data, uint32 dataSize, const WBAtariTableOffsets &offsets, int songNum=1)
Audio::AudioStream * makeWallyBebenStream(const byte *data, uint32 dataSize, int songNum=1, int rate=44100, bool stereo=true, const WBTableOffsets *offsets=nullptr)
Definition: wb.h:58