175 |
layout_flat = 1 ///< Not a "real" RIFF file: First chunk in file is an ordinary data chunk, not a List chunk, and there might be other chunks after that first chunk. |
layout_flat = 1 ///< Not a "real" RIFF file: First chunk in file is an ordinary data chunk, not a List chunk, and there might be other chunks after that first chunk. |
176 |
}; |
}; |
177 |
|
|
178 |
|
/** |
179 |
|
* @brief Used for indicating the progress of a certain task. |
180 |
|
* |
181 |
|
* The function pointer argument has to be supplied with a valid |
182 |
|
* function of the given signature which will then be called on |
183 |
|
* progress changes. An equivalent progress_t structure will be passed |
184 |
|
* back as argument to the callback function on each progress change. |
185 |
|
* The factor field of the supplied progress_t structure will then |
186 |
|
* reflect the current progress as value between 0.0 and 1.0. You might |
187 |
|
* want to use the custom field for data needed in your callback |
188 |
|
* function. |
189 |
|
*/ |
190 |
|
struct progress_t { |
191 |
|
void (*callback)(progress_t*); ///< Callback function pointer which has to be assigned to a function for progress notification. |
192 |
|
float factor; ///< Reflects current progress as value between 0.0 and 1.0. |
193 |
|
void* custom; ///< This pointer can be used for arbitrary data. |
194 |
|
float __range_min; ///< Only for internal usage, do not modify! |
195 |
|
float __range_max; ///< Only for internal usage, do not modify! |
196 |
|
progress_t(); |
197 |
|
}; |
198 |
|
|
199 |
/** @brief Ordinary RIFF Chunk |
/** @brief Ordinary RIFF Chunk |
200 |
* |
* |
201 |
* Provides convenient methods to access data of ordinary RIFF chunks |
* Provides convenient methods to access data of ordinary RIFF chunks |
287 |
} |
} |
288 |
return result; |
return result; |
289 |
} |
} |
290 |
virtual unsigned long WriteChunk(unsigned long ulWritePos, unsigned long ulCurrentDataOffset); |
virtual unsigned long WriteChunk(unsigned long ulWritePos, unsigned long ulCurrentDataOffset, progress_t* pProgress = NULL); |
291 |
virtual void __resetPos(); ///< Sets Chunk's read/write position to zero. |
virtual void __resetPos(); ///< Sets Chunk's read/write position to zero. |
292 |
|
|
293 |
friend class List; |
friend class List; |
333 |
List(File* pFile, List* pParent, uint32_t uiListID); |
List(File* pFile, List* pParent, uint32_t uiListID); |
334 |
void ReadHeader(unsigned long fPos); |
void ReadHeader(unsigned long fPos); |
335 |
void WriteHeader(unsigned long fPos); |
void WriteHeader(unsigned long fPos); |
336 |
void LoadSubChunks(); |
void LoadSubChunks(progress_t* pProgress = NULL); |
337 |
void LoadSubChunksRecursively(); |
void LoadSubChunksRecursively(progress_t* pProgress = NULL); |
338 |
virtual unsigned long WriteChunk(unsigned long ulWritePos, unsigned long ulCurrentDataOffset); |
virtual unsigned long WriteChunk(unsigned long ulWritePos, unsigned long ulCurrentDataOffset, progress_t* pProgress = NULL); |
339 |
virtual void __resetPos(); ///< Sets List Chunk's read/write position to zero and causes all sub chunks to do the same. |
virtual void __resetPos(); ///< Sets List Chunk's read/write position to zero and causes all sub chunks to do the same. |
340 |
void DeleteChunkList(); |
void DeleteChunkList(); |
341 |
}; |
}; |
358 |
void SetFileName(const String& path); |
void SetFileName(const String& path); |
359 |
bool IsNew() const; |
bool IsNew() const; |
360 |
layout_t GetLayout() const; |
layout_t GetLayout() const; |
361 |
virtual void Save(); |
virtual void Save(progress_t* pProgress = NULL); |
362 |
virtual void Save(const String& path); |
virtual void Save(const String& path, progress_t* pProgress = NULL); |
363 |
virtual ~File(); |
virtual ~File(); |
364 |
protected: |
protected: |
365 |
#if POSIX |
#if POSIX |