ScummVM API documentation
music_flex.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 ULTIMA8_AUDIO_MUSICFLEX_H
23 #define ULTIMA8_AUDIO_MUSICFLEX_H
24 
25 #include "ultima/ultima8/filesys/archive.h"
26 
27 namespace Ultima {
28 namespace Ultima8 {
29 
30 
31 class MusicFlex : public Archive {
32 public:
33  struct SongInfo {
34  SongInfo();
35  ~SongInfo();
36 
37  char _filename[17];
38  int _numMeasures;
39  int _loopJump;
40  int *_transitions[128];
41  };
42 
43  struct XMidiData {
44  XMidiData(byte *data, uint32 size) : _data(data), _size(size)
45  {}
46 
47  byte *_data;
48  uint32 _size;
49  };
50 
52  ~MusicFlex() override;
53 
55  XMidiData *getXMidi(uint32 index);
56 
58  const SongInfo *getSongInfo(uint32 index) const;
59 
62 
63  void cache(uint32 index) override;
64  void uncache(uint32 index) override;
65  bool isCached(uint32 index) const override;
66 
67 private:
68  SongInfo *_info[128];
69  XMidiData **_songs;
70 
72  void loadSongInfo();
73 };
74 
75 } // End of namespace Ultima8
76 } // End of namespace Ultima
77 
78 #endif
void cache()
Cache all objects.
const SongInfo * getSongInfo(uint32 index) const
Get song info.
Definition: music_flex.h:31
Definition: music_flex.h:43
bool isCached(uint32 index) const override
Check if an object is cached.
Definition: music_flex.h:33
Definition: stream.h:745
Common::SeekableReadStream * getAdlibTimbres()
Get the Adlib Timbres (index 259)
Definition: detection.h:27
Definition: archive.h:30
XMidiData * getXMidi(uint32 index)
Get an xmidi.