ScummVM API documentation
common.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  * VGMTrans (c) 2002-2019
23  * Licensed under the zlib license,
24  * refer to the included VGMTrans_LICENSE.txt file
25  */
26 #ifndef AUDIO_SOUNDFONT_COMMON_H
27 #define AUDIO_SOUNDFONT_COMMON_H
28 
29 #include "common/scummsys.h"
30 #include "common/array.h"
31 
32 enum LoopMeasure {
33  LM_SAMPLES, LM_BYTES
34 };
35 
36 struct Loop {
37  Loop()
38  : loopStatus(-1),
39  loopType(0),
40  loopStartMeasure(LM_BYTES),
41  loopLengthMeasure(LM_BYTES),
42  loopStart(0),
43  loopLength(0) {}
44 
45  int loopStatus;
46  uint32 loopType;
47  uint8 loopStartMeasure;
48  uint8 loopLengthMeasure;
49  uint32 loopStart;
50  uint32 loopLength;
51 };
52 
54  uint32 size;
55  uint32 offset;
56 
57  SizeOffsetPair() : size(0), offset(0) {}
58 
59  SizeOffsetPair(uint32 offset_, uint32 size_) : size(size_), offset(offset_) {}
60 };
61 
62 template<class T>
63 void DeleteVect(Common::Array<T *> &array) {
64  for (typename Common::Array<T *>::iterator iter = array.begin(); iter != array.end(); iter++) {
65  delete (*iter);
66  }
67  array.clear();
68 }
69 
70 #endif // AUDIO_SOUNDFONT_COMMON_H
Definition: common.h:53
Definition: array.h:52
void clear()
Definition: array.h:320
iterator end()
Definition: array.h:379
iterator begin()
Definition: array.h:374
T * iterator
Definition: array.h:54
Definition: common.h:36