libgig 4.4.0
RIFF.h
1/***************************************************************************
2 * *
3 * libgig - C++ cross-platform Gigasampler format file access library *
4 * *
5 * Copyright (C) 2003-2021 by Christian Schoenebeck *
6 * <cuse@users.sourceforge.net> *
7 * *
8 * This library is free software; you can redistribute it and/or modify *
9 * it under the terms of the GNU General Public License as published by *
10 * the Free Software Foundation; either version 2 of the License, or *
11 * (at your option) any later version. *
12 * *
13 * This library is distributed in the hope that it will be useful, *
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of *
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
16 * GNU General Public License for more details. *
17 * *
18 * You should have received a copy of the GNU General Public License *
19 * along with this library; if not, write to the Free Software *
20 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, *
21 * MA 02111-1307 USA *
22 ***************************************************************************/
23
24#ifndef __RIFF_H__
25#define __RIFF_H__
26
27#ifdef WIN32
28# define POSIX 0
29#endif
30
31#ifndef POSIX
32# define POSIX 1
33#endif
34
35#ifndef DEBUG
36# define DEBUG 0
37#endif
38
39#ifndef OVERRIDE
40# if defined(__cplusplus) && __cplusplus >= 201103L
41# define OVERRIDE override
42# else
43# define OVERRIDE
44# endif
45#endif
46
47#ifdef __GNUC__
48# define LIBGIG_DEPRECATED_API(msg) __attribute__ ((deprecated(msg)))
49#else
50# define LIBGIG_DEPRECATED_API(msg)
51#endif
52
53#include <string>
54#include <list>
55#include <map>
56#include <set>
57#include <vector>
58#include <iostream>
59#include <stdarg.h>
60#include <thread>
61#include <mutex>
62
63#ifdef HAVE_CONFIG_H
64# include <config.h>
65#endif
66
67#if POSIX
68# include <sys/types.h>
69# include <sys/stat.h>
70# include <fcntl.h>
71# include <unistd.h>
72#endif // POSIX
73
74#if defined _MSC_VER && _MSC_VER < 1600
75// Visual C++ 2008 doesn't have stdint.h
76typedef __int8 int8_t;
77typedef __int16 int16_t;
78typedef __int32 int32_t;
79typedef __int64 int64_t;
80typedef unsigned __int8 uint8_t;
81typedef unsigned __int16 uint16_t;
82typedef unsigned __int32 uint32_t;
83typedef unsigned __int64 uint64_t;
84#else
85#include <stdint.h>
86#endif
87
88#ifdef WIN32
89# if (_WIN32 && !_WIN64) || (__GNUC__ && !(__x86_64__ || __ppc64__)) /* if 32 bit windows compilation */
90# if _WIN32_WINNT < 0x0501
91# undef _WIN32_WINNT
92# define _WIN32_WINNT 0x0501 /* Win XP (no service pack): required for 32 bit compilation for GetFileSizeEx() to be declared by windows.h */
93# endif
94# endif
95# include <windows.h>
96 typedef unsigned int uint;
97#endif // WIN32
98
99#include <stdio.h>
100
101#if WORDS_BIGENDIAN
102# define CHUNK_ID_RIFF 0x52494646
103# define CHUNK_ID_RIFX 0x52494658
104# define CHUNK_ID_LIST 0x4C495354
105
106# define LIST_TYPE_INFO 0x494E464F
107# define CHUNK_ID_ICMT 0x49434D54
108# define CHUNK_ID_ICOP 0x49434F50
109# define CHUNK_ID_ICRD 0x49435244
110# define CHUNK_ID_IENG 0x49454E47
111# define CHUNK_ID_INAM 0x494E414D
112# define CHUNK_ID_IPRD 0x49505244
113# define CHUNK_ID_ISFT 0x49534654
114
115# define CHUNK_ID_SMPL 0x736D706C
116
117#else // little endian
118# define CHUNK_ID_RIFF 0x46464952
119# define CHUNK_ID_RIFX 0x58464952
120# define CHUNK_ID_LIST 0x5453494C
121
122# define LIST_TYPE_INFO 0x4F464E49
123# define CHUNK_ID_ICMT 0x544D4349
124# define CHUNK_ID_ICOP 0x504F4349
125# define CHUNK_ID_ICRD 0x44524349
126# define CHUNK_ID_IENG 0x474E4549
127# define CHUNK_ID_INAM 0x4D414E49
128# define CHUNK_ID_IPRD 0x44525049
129# define CHUNK_ID_ISFT 0x54465349
130
131# define CHUNK_ID_SMPL 0x6C706D73
132
133#endif // WORDS_BIGENDIAN
134
135#define CHUNK_HEADER_SIZE(fileOffsetSize) (4 + fileOffsetSize)
136#define LIST_HEADER_SIZE(fileOffsetSize) (8 + fileOffsetSize)
137#define RIFF_HEADER_SIZE(fileOffsetSize) (8 + fileOffsetSize)
138
158namespace RIFF {
159
160 /* just symbol prototyping */
161 class Chunk;
162 class List;
163 class File;
164
165 typedef std::string String;
166
168 typedef uint64_t file_offset_t;
169
172 stream_mode_read = 0,
173 stream_mode_read_write = 1,
174 stream_mode_closed = 2
175 };
176
179 stream_ready = 0,
180 stream_end_reached = 1,
181 stream_closed = 2
182 };
183
186 stream_start = 0,
187 stream_curpos = 1,
188 stream_backward = 2,
189 stream_end = 3
190 };
191
193 enum endian_t {
194 endian_little = 0,
195 endian_big = 1,
196 endian_native = 2
197 };
198
204
211
224 struct progress_t {
226 float factor;
227 void* custom;
230 progress_t();
231 std::vector<progress_t> subdivide(int iSubtasks);
232 std::vector<progress_t> subdivide(std::vector<float> vSubTaskPortions);
233 };
234
240 class Chunk {
241 public:
242 Chunk(File* pFile, file_offset_t StartPos, List* Parent);
243 String GetChunkIDString() const;
244 uint32_t GetChunkID() const { return ChunkID; }
245 File* GetFile() const { return pFile; }
246 List* GetParent() const { return pParent; }
247 file_offset_t GetSize() const { return ullCurrentChunkSize; }
248 file_offset_t GetNewSize() const { return ullNewChunkSize; }
249 file_offset_t GetPos() const;
251 file_offset_t SetPos(file_offset_t Where, stream_whence_t Whence = stream_start);
253 stream_state_t GetState() const;
254 file_offset_t Read(void* pData, file_offset_t WordCount, file_offset_t WordSize);
255 file_offset_t ReadInt8(int8_t* pData, file_offset_t WordCount = 1);
256 file_offset_t ReadUint8(uint8_t* pData, file_offset_t WordCount = 1);
257 file_offset_t ReadInt16(int16_t* pData, file_offset_t WordCount = 1);
258 file_offset_t ReadUint16(uint16_t* pData, file_offset_t WordCount = 1);
259 file_offset_t ReadInt32(int32_t* pData, file_offset_t WordCount = 1);
260 file_offset_t ReadUint32(uint32_t* pData, file_offset_t WordCount = 1);
261 int8_t ReadInt8();
262 uint8_t ReadUint8();
263 int16_t ReadInt16();
264 uint16_t ReadUint16();
265 int32_t ReadInt32();
266 uint32_t ReadUint32();
267 void ReadString(String& s, int size);
268 file_offset_t Write(void* pData, file_offset_t WordCount, file_offset_t WordSize);
269 file_offset_t WriteInt8(int8_t* pData, file_offset_t WordCount = 1);
270 file_offset_t WriteUint8(uint8_t* pData, file_offset_t WordCount = 1);
271 file_offset_t WriteInt16(int16_t* pData, file_offset_t WordCount = 1);
272 file_offset_t WriteUint16(uint16_t* pData, file_offset_t WordCount = 1);
273 file_offset_t WriteInt32(int32_t* pData, file_offset_t WordCount = 1);
274 file_offset_t WriteUint32(uint32_t* pData, file_offset_t WordCount = 1);
275 void* LoadChunkData();
276 void ReleaseChunkData();
277 void Resize(file_offset_t NewSize);
278 virtual ~Chunk();
279 protected:
280 uint32_t ChunkID;
281 file_offset_t ullCurrentChunkSize; /* in bytes */
282 file_offset_t ullNewChunkSize; /* in bytes (if chunk was scheduled to be resized) */
283 List* pParent;
284 File* pFile;
285 file_offset_t ullStartPos; /* actual position in file where chunk data (without header) starts */
286 uint8_t* pChunkData;
287 file_offset_t ullChunkDataSize;
288 struct ChunkPos { /* current read/write position as # of bytes from ulStartPos */
289 file_offset_t ullPos; /* used if File::IsIOPerThread() is false (default) */
290 mutable std::map<std::thread::id,file_offset_t> byThread; /* used if File::IsIOPerThread() is true */
291 mutable std::mutex mutex; /* for protecting concurrent changes on byThread map itself */
292 } chunkPos;
293
294 Chunk(File* pFile);
295 Chunk(File* pFile, List* pParent, uint32_t uiChunkID, file_offset_t ullBodySize);
296 void ReadHeader(file_offset_t filePos);
297 void WriteHeader(file_offset_t filePos);
298 file_offset_t ReadSceptical(void* pData, file_offset_t WordCount, file_offset_t WordSize);
299 inline static String convertToString(uint32_t word) {
300 String result;
301 for (int i = 0; i < 4; i++) {
302 uint8_t byte = *((uint8_t*)(&word) + i);
303 char c = byte;
304 result += c;
305 }
306 return result;
307 }
308 virtual file_offset_t RequiredPhysicalSize(int fileOffsetSize);
309 virtual file_offset_t WriteChunk(file_offset_t ullWritePos, file_offset_t ullCurrentDataOffset, progress_t* pProgress = NULL);
310 virtual void __resetPos();
311
312 friend class List;
313 private:
314 file_offset_t& GetPosUnsafeRef();
315 };
316
322 class List : public Chunk {
323 public:
324 List(File* pFile, file_offset_t StartPos, List* Parent);
325 String GetListTypeString() const;
326 uint32_t GetListType() const { return ListType; }
327 Chunk* GetSubChunkAt(size_t pos);
328 Chunk* GetSubChunk(uint32_t ChunkID);
329 List* GetSubListAt(size_t pos);
330 List* GetSubList(uint32_t ListType);
331 Chunk* GetFirstSubChunk() LIBGIG_DEPRECATED_API("Use GetSubChunkAt() instead.");
332 Chunk* GetNextSubChunk() LIBGIG_DEPRECATED_API("Use GetSubChunkAt() instead.");
333 List* GetFirstSubList() LIBGIG_DEPRECATED_API("Use GetSubListAt() instead.");
334 List* GetNextSubList() LIBGIG_DEPRECATED_API("Use GetSubListAt() instead.");
335 size_t CountSubChunks();
336 size_t CountSubChunks(uint32_t ChunkID);
337 size_t CountSubLists();
338 size_t CountSubLists(uint32_t ListType);
339 Chunk* AddSubChunk(uint32_t uiChunkID, file_offset_t ullBodySize);
340 List* AddSubList(uint32_t uiListType);
341 void DeleteSubChunk(Chunk* pSubChunk);
342 void MoveSubChunk(Chunk* pSrc, Chunk* pDst); // read API doc comments !!!
343 void MoveSubChunk(Chunk* pSrc, List* pNewParent);
344 virtual ~List();
345 protected:
346 typedef std::map<uint32_t, RIFF::Chunk*> ChunkMap;
347 typedef std::vector<Chunk*> ChunkList;
348 typedef std::set<Chunk*> ChunkSet;
349
350 uint32_t ListType;
351 ChunkList* pSubChunks;
352 ChunkMap* pSubChunksMap;
353 ChunkList::iterator ChunksIterator;
354 ChunkList::iterator ListIterator;
355
356 List(File* pFile);
357 List(File* pFile, List* pParent, uint32_t uiListID);
358 void ReadHeader(file_offset_t filePos);
359 void WriteHeader(file_offset_t filePos);
360 void LoadSubChunks(progress_t* pProgress = NULL);
361 void LoadSubChunksRecursively(progress_t* pProgress = NULL);
362 virtual file_offset_t RequiredPhysicalSize(int fileOffsetSize);
363 virtual file_offset_t WriteChunk(file_offset_t ullWritePos, file_offset_t ullCurrentDataOffset, progress_t* pProgress = NULL);
364 virtual void __resetPos();
365 void DeleteChunkList();
366 };
367
374 class File : public List {
375 public:
380 #if POSIX
381 typedef int Handle;
382 #elif defined(WIN32)
383 typedef HANDLE Handle;
384 #else
385 typedef FILE* Handle;
386 #endif
387
388 File(uint32_t FileType);
389 File(const String& path);
390 File(const String& path, uint32_t FileType, endian_t Endian, layout_t layout, offset_size_t fileOffsetSize = offset_size_auto);
391 stream_mode_t GetMode() const;
392 bool SetMode(stream_mode_t NewMode);
393 void SetByteOrder(endian_t Endian);
394 String GetFileName() const;
395 void SetFileName(const String& path);
396 Handle FileHandle() const;
397 bool IsNew() const;
398 layout_t GetLayout() const;
399 file_offset_t GetCurrentFileSize() const;
400 file_offset_t GetRequiredFileSize();
401 file_offset_t GetRequiredFileSize(offset_size_t fileOffsetSize);
402 int GetFileOffsetSize() const;
403 int GetRequiredFileOffsetSize();
404 bool IsIOPerThread() const;
405 void SetIOPerThread(bool enable);
406
407 virtual void Save(progress_t* pProgress = NULL);
408 virtual void Save(const String& path, progress_t* pProgress = NULL);
409 virtual ~File();
410 protected:
411 struct HandlePair {
412 Handle hRead;
413 Handle hWrite;
414 stream_mode_t Mode;
415 };
416 struct IO : HandlePair {
417 bool isPerThread;
418 mutable std::map<std::thread::id,HandlePair> byThread;
419 mutable std::mutex mutex;
420 } io;
421 String Filename;
422 bool bEndianNative;
423 bool bIsNewFile;
425 offset_size_t FileOffsetPreference;
427
428 Handle FileWriteHandle() const;
429 HandlePair FileHandlePair() const;
430
431 friend class Chunk;
432 friend class List;
433 private:
434 void __openExistingFile(const String& path, uint32_t* FileType = NULL);
435 void ResizeFile(file_offset_t ullNewSize);
436 #if POSIX
437 file_offset_t __GetFileSize(int hFile) const;
438 #elif defined(WIN32)
439 file_offset_t __GetFileSize(HANDLE hFile) const;
440 #else
441 file_offset_t __GetFileSize(FILE* hFile) const;
442 #endif
443 int FileOffsetSizeFor(file_offset_t fileSize) const;
444 void Cleanup();
445 HandlePair& FileHandlePairUnsafeRef();
446 bool SetModeInternal(stream_mode_t NewMode, bool* pResetPos);
447 };
448
452 class Exception {
453 public:
454 String Message;
455
456 Exception(String format, ...);
457 Exception(String format, va_list arg);
458 void PrintMessage();
459 virtual ~Exception() {}
460
461 protected:
462 Exception();
463 static String assemble(String format, va_list arg);
464 };
465
466 String libraryName();
467 String libraryVersion();
468
469} // namespace RIFF
470#endif // __RIFF_H__
Ordinary RIFF Chunk.
Definition RIFF.h:240
File * GetFile() const
Returns pointer to the chunk's File object.
Definition RIFF.h:245
List * GetParent() const
Returns pointer to the chunk's parent list chunk.
Definition RIFF.h:246
file_offset_t WriteInt16(int16_t *pData, file_offset_t WordCount=1)
Writes WordCount number of 16 Bit signed integer words from the buffer pointed by pData to the chunk'...
Definition RIFF.cpp:693
virtual void __resetPos()
Sets Chunk's read/write position to zero.
Definition RIFF.cpp:1159
void Resize(file_offset_t NewSize)
Resize chunk.
Definition RIFF.cpp:1034
int8_t ReadInt8()
Reads one 8 Bit signed integer word and increments the position within the chunk.
Definition RIFF.cpp:840
uint32_t ReadUint32()
Reads one 32 Bit unsigned integer word and increments the position within the chunk.
Definition RIFF.cpp:929
stream_state_t GetState() const
Returns the current state of the chunk object.
Definition RIFF.cpp:410
file_offset_t SetPos(file_offset_t Where, stream_whence_t Whence=stream_start)
Sets the position within the chunk body, thus within the data portion of the chunk (in bytes).
Definition RIFF.cpp:341
file_offset_t GetFilePos() const
Current, actual offset in file of current chunk data body read/write position.
Definition RIFF.cpp:324
void ReleaseChunkData()
Free loaded chunk body from RAM.
Definition RIFF.cpp:1009
file_offset_t Write(void *pData, file_offset_t WordCount, file_offset_t WordSize)
Writes WordCount number of data words with given WordSize from the buffer pointed by pData.
Definition RIFF.cpp:517
file_offset_t RemainingBytes() const
Returns the number of bytes left to read in the chunk body.
Definition RIFF.cpp:376
int16_t ReadInt16()
Reads one 16 Bit signed integer word and increments the position within the chunk.
Definition RIFF.cpp:875
virtual file_offset_t WriteChunk(file_offset_t ullWritePos, file_offset_t ullCurrentDataOffset, progress_t *pProgress=NULL)
Write chunk persistently e.g.
Definition RIFF.cpp:1057
file_offset_t GetPos() const
Current read/write position within the chunk data body (starting with 0).
Definition RIFF.cpp:311
file_offset_t WriteInt32(int32_t *pData, file_offset_t WordCount=1)
Writes WordCount number of 32 Bit signed integer words from the buffer pointed by pData to the chunk'...
Definition RIFF.cpp:771
file_offset_t ReadSceptical(void *pData, file_offset_t WordCount, file_offset_t WordSize)
Just an internal wrapper for the main Read() method with additional Exception throwing on errors.
Definition RIFF.cpp:575
virtual file_offset_t RequiredPhysicalSize(int fileOffsetSize)
Returns the actual total size in bytes (including header) of this Chunk if being stored to a file.
Definition RIFF.cpp:391
file_offset_t Read(void *pData, file_offset_t WordCount, file_offset_t WordSize)
Reads WordCount number of data words with given WordSize and copies it into a buffer pointed by pData...
Definition RIFF.cpp:441
uint32_t GetChunkID() const
Chunk ID in unsigned integer representation.
Definition RIFF.h:244
void * LoadChunkData()
Load chunk body into RAM.
Definition RIFF.cpp:960
String GetChunkIDString() const
Returns the String representation of the chunk's ID (e.g.
Definition RIFF.cpp:288
uint8_t ReadUint8()
Reads one 8 Bit unsigned integer word and increments the position within the chunk.
Definition RIFF.cpp:857
file_offset_t WriteInt8(int8_t *pData, file_offset_t WordCount=1)
Writes WordCount number of 8 Bit signed integer words from the buffer pointed by pData to the chunk's...
Definition RIFF.cpp:615
file_offset_t WriteUint16(uint16_t *pData, file_offset_t WordCount=1)
Writes WordCount number of 16 Bit unsigned integer words from the buffer pointed by pData to the chun...
Definition RIFF.cpp:732
file_offset_t WriteUint32(uint32_t *pData, file_offset_t WordCount=1)
Writes WordCount number of 32 Bit unsigned integer words from the buffer pointed by pData to the chun...
Definition RIFF.cpp:828
void ReadString(String &s, int size)
Reads a null-padded string of size characters and copies it into the string s.
Definition RIFF.cpp:806
uint16_t ReadUint16()
Reads one 16 Bit unsigned integer word and increments the position within the chunk.
Definition RIFF.cpp:893
file_offset_t GetSize() const
Chunk size in bytes (without header, thus the chunk data body)
Definition RIFF.h:247
int32_t ReadInt32()
Reads one 32 Bit signed integer word and increments the position within the chunk.
Definition RIFF.cpp:911
file_offset_t WriteUint8(uint8_t *pData, file_offset_t WordCount=1)
Writes WordCount number of 8 Bit unsigned integer words from the buffer pointed by pData to the chunk...
Definition RIFF.cpp:654
file_offset_t GetNewSize() const
New chunk size if it was modified with Resize(), otherwise value returned will be equal to GetSize().
Definition RIFF.h:248
Will be thrown whenever an error occurs while handling a RIFF file.
Definition RIFF.h:452
RIFF File.
Definition RIFF.h:374
layout_t Layout
An ordinary RIFF file is always set to layout_standard.
Definition RIFF.h:424
int Handle
OS dependent type serving as file handle / descriptor for OS dependent file I/O operations.
Definition RIFF.h:381
int FileOffsetSize
Size of file offsets (in bytes) when this file was opened (or saved the last time).
Definition RIFF.h:426
RIFF List Chunk.
Definition RIFF.h:322
size_t CountSubLists()
Returns number of sublists within the list.
Definition RIFF.cpp:1422
Chunk * GetSubChunk(uint32_t ChunkID)
Returns subchunk with chunk ID ChunkID within this chunk list.
Definition RIFF.cpp:1246
virtual file_offset_t RequiredPhysicalSize(int fileOffsetSize)
Returns the actual total size in bytes (including List chunk header and all subchunks) of this List C...
Definition RIFF.cpp:1584
void MoveSubChunk(Chunk *pSrc, Chunk *pDst)
Moves a sub chunk witin this list.
Definition RIFF.cpp:1480
List * GetFirstSubList()
Returns the first sublist within the list (that is a subchunk with chunk ID "LIST").
Definition RIFF.cpp:1354
List * AddSubList(uint32_t uiListType)
Creates a new list sub chunk.
Definition RIFF.cpp:1537
Chunk * GetFirstSubChunk()
Returns the first subchunk within the list (which may be an ordinary chunk as well as a list chunk).
Definition RIFF.cpp:1315
virtual file_offset_t WriteChunk(file_offset_t ullWritePos, file_offset_t ullCurrentDataOffset, progress_t *pProgress=NULL)
Write list chunk persistently e.g.
Definition RIFF.cpp:1722
void DeleteSubChunk(Chunk *pSubChunk)
Removes a sub chunk.
Definition RIFF.cpp:1556
List * GetSubListAt(size_t pos)
Returns sublist chunk with list type ListType at supplied pos position among all subchunks of type Li...
Definition RIFF.cpp:1264
size_t CountSubChunks()
Returns number of subchunks within the list (including list chunks).
Definition RIFF.cpp:1396
List * GetSubList(uint32_t ListType)
Returns sublist chunk with list type ListType within this chunk list.
Definition RIFF.cpp:1287
Chunk * GetNextSubChunk()
Returns the next subchunk within the list (which may be an ordinary chunk as well as a list chunk).
Definition RIFF.cpp:1334
uint32_t GetListType() const
Returns unsigned integer representation of the list's ID.
Definition RIFF.h:326
String GetListTypeString() const
Returns string representation of the lists's id.
Definition RIFF.cpp:1770
List * GetNextSubList()
Returns the next sublist (that is a subchunk with chunk ID "LIST") within the list.
Definition RIFF.cpp:1378
Chunk * AddSubChunk(uint32_t uiChunkID, file_offset_t ullBodySize)
Creates a new sub chunk.
Definition RIFF.cpp:1458
virtual void __resetPos()
Sets List Chunk's read/write position to zero and causes all sub chunks to do the same.
Definition RIFF.cpp:1758
Chunk * GetSubChunkAt(size_t pos)
Returns subchunk at supplied pos position within this chunk list.
Definition RIFF.cpp:1229
RIFF specific classes and definitions.
Definition RIFF.h:158
String libraryVersion()
Returns version of this C++ library.
Definition RIFF.cpp:2720
stream_whence_t
File stream position dependent to these relations.
Definition RIFF.h:185
stream_state_t
Current state of the file stream.
Definition RIFF.h:178
String libraryName()
Returns the name of this C++ library.
Definition RIFF.cpp:2712
offset_size_t
Size of RIFF file offsets used in all RIFF chunks' headers.
Definition RIFF.h:206
@ offset_size_64bit
Always use 64 bit offsets (even for files smaller than 4 GB).
Definition RIFF.h:209
@ offset_size_auto
Use 32 bit offsets for files smaller than 4 GB, use 64 bit offsets for files equal or larger than 4 G...
Definition RIFF.h:207
@ offset_size_32bit
Always use 32 bit offsets (even for files larger than 4 GB).
Definition RIFF.h:208
stream_mode_t
Whether file stream is open in read or in read/write mode.
Definition RIFF.h:171
layout_t
General RIFF chunk structure of a RIFF file.
Definition RIFF.h:200
@ layout_standard
Standard RIFF file layout: First chunk in file is a List chunk which contains all other chunks and th...
Definition RIFF.h:201
@ layout_flat
Not a "real" RIFF file: First chunk in file is an ordinary data chunk, not a List chunk,...
Definition RIFF.h:202
endian_t
Alignment of data bytes in memory (system dependant).
Definition RIFF.h:193
uint64_t file_offset_t
Type used by libgig for handling file positioning during file I/O tasks.
Definition RIFF.h:168
Used for indicating the progress of a certain task.
Definition RIFF.h:224
float __range_min
Only for internal usage, do not modify!
Definition RIFF.h:228
std::vector< progress_t > subdivide(int iSubtasks)
Divides this progress task into the requested amount of equal weighted sub-progress tasks and returns...
Definition RIFF.cpp:93
void(* callback)(progress_t *)
Callback function pointer which has to be assigned to a function for progress notification.
Definition RIFF.h:225
float factor
Reflects current progress as value between 0.0 and 1.0.
Definition RIFF.h:226
void * custom
This pointer can be used for arbitrary data.
Definition RIFF.h:227
float __range_max
Only for internal usage, do not modify!
Definition RIFF.h:229