874 |
* boundary! |
* boundary! |
875 |
* |
* |
876 |
* @param NewSize - new chunk body size in bytes (must be greater than zero) |
* @param NewSize - new chunk body size in bytes (must be greater than zero) |
877 |
* @throws RIFF::Exception if \a NewSize is less than 1 or Unrealistic large |
* @throws RIFF::Exception if \a NewSize is less than 1 or unrealistic large |
878 |
* @see File::Save() |
* @see File::Save() |
879 |
*/ |
*/ |
880 |
void Chunk::Resize(file_offset_t NewSize) { |
void Chunk::Resize(file_offset_t NewSize) { |
1079 |
/** |
/** |
1080 |
* Returns sublist chunk with list type <i>\a ListType</i> within this |
* Returns sublist chunk with list type <i>\a ListType</i> within this |
1081 |
* chunk list. Use this method if you expect only one sublist chunk of |
* chunk list. Use this method if you expect only one sublist chunk of |
1082 |
* that type in the list. It there are more than one, it's undetermined |
* that type in the list. If there are more than one, it's undetermined |
1083 |
* which one of them will be returned! If there are no sublists with |
* which one of them will be returned! If there are no sublists with |
1084 |
* that desired list type, NULL will be returned. |
* that desired list type, NULL will be returned. |
1085 |
* |
* |
1105 |
} |
} |
1106 |
|
|
1107 |
/** |
/** |
1108 |
* Returns the first subchunk within the list. You have to call this |
* Returns the first subchunk within the list (which may be an ordinary |
1109 |
|
* chunk as well as a list chunk). You have to call this |
1110 |
* method before you can call GetNextSubChunk(). Recall it when you want |
* method before you can call GetNextSubChunk(). Recall it when you want |
1111 |
* to start from the beginning of the list again. |
* to start from the beginning of the list again. |
1112 |
* |
* |
1123 |
} |
} |
1124 |
|
|
1125 |
/** |
/** |
1126 |
* Returns the next subchunk within the list. You have to call |
* Returns the next subchunk within the list (which may be an ordinary |
1127 |
|
* chunk as well as a list chunk). You have to call |
1128 |
* GetFirstSubChunk() before you can use this method! |
* GetFirstSubChunk() before you can use this method! |
1129 |
* |
* |
1130 |
* @returns pointer to the next subchunk within the list or NULL if |
* @returns pointer to the next subchunk within the list or NULL if |
1186 |
} |
} |
1187 |
|
|
1188 |
/** |
/** |
1189 |
* Returns number of subchunks within the list. |
* Returns number of subchunks within the list (including list chunks). |
1190 |
*/ |
*/ |
1191 |
unsigned int List::CountSubChunks() { |
size_t List::CountSubChunks() { |
1192 |
if (!pSubChunks) LoadSubChunks(); |
if (!pSubChunks) LoadSubChunks(); |
1193 |
return pSubChunks->size(); |
return pSubChunks->size(); |
1194 |
} |
} |
1197 |
* Returns number of subchunks within the list with chunk ID |
* Returns number of subchunks within the list with chunk ID |
1198 |
* <i>\a ChunkId</i>. |
* <i>\a ChunkId</i>. |
1199 |
*/ |
*/ |
1200 |
unsigned int List::CountSubChunks(uint32_t ChunkID) { |
size_t List::CountSubChunks(uint32_t ChunkID) { |
1201 |
unsigned int result = 0; |
size_t result = 0; |
1202 |
if (!pSubChunks) LoadSubChunks(); |
if (!pSubChunks) LoadSubChunks(); |
1203 |
ChunkList::iterator iter = pSubChunks->begin(); |
ChunkList::iterator iter = pSubChunks->begin(); |
1204 |
ChunkList::iterator end = pSubChunks->end(); |
ChunkList::iterator end = pSubChunks->end(); |
1214 |
/** |
/** |
1215 |
* Returns number of sublists within the list. |
* Returns number of sublists within the list. |
1216 |
*/ |
*/ |
1217 |
unsigned int List::CountSubLists() { |
size_t List::CountSubLists() { |
1218 |
return CountSubChunks(CHUNK_ID_LIST); |
return CountSubChunks(CHUNK_ID_LIST); |
1219 |
} |
} |
1220 |
|
|
1222 |
* Returns number of sublists within the list with list type |
* Returns number of sublists within the list with list type |
1223 |
* <i>\a ListType</i> |
* <i>\a ListType</i> |
1224 |
*/ |
*/ |
1225 |
unsigned int List::CountSubLists(uint32_t ListType) { |
size_t List::CountSubLists(uint32_t ListType) { |
1226 |
unsigned int result = 0; |
size_t result = 0; |
1227 |
if (!pSubChunks) LoadSubChunks(); |
if (!pSubChunks) LoadSubChunks(); |
1228 |
ChunkList::iterator iter = pSubChunks->begin(); |
ChunkList::iterator iter = pSubChunks->begin(); |
1229 |
ChunkList::iterator end = pSubChunks->end(); |
ChunkList::iterator end = pSubChunks->end(); |
1497 |
|
|
1498 |
// write all subchunks (including sub list chunks) recursively |
// write all subchunks (including sub list chunks) recursively |
1499 |
if (pSubChunks) { |
if (pSubChunks) { |
1500 |
int i = 0; |
size_t i = 0; |
1501 |
const int n = pSubChunks->size(); |
const size_t n = pSubChunks->size(); |
1502 |
for (ChunkList::iterator iter = pSubChunks->begin(), end = pSubChunks->end(); iter != end; ++iter, ++i) { |
for (ChunkList::iterator iter = pSubChunks->begin(), end = pSubChunks->end(); iter != end; ++iter, ++i) { |
1503 |
// divide local progress into subprogress for loading current Instrument |
// divide local progress into subprogress for loading current Instrument |
1504 |
progress_t subprogress; |
progress_t subprogress; |
1910 |
#if defined(WIN32) |
#if defined(WIN32) |
1911 |
DWORD iBytesMoved = 1; // we have to pass it via pointer to the Windows API, thus the correct size must be ensured |
DWORD iBytesMoved = 1; // we have to pass it via pointer to the Windows API, thus the correct size must be ensured |
1912 |
#else |
#else |
1913 |
int iBytesMoved = 1; |
ssize_t iBytesMoved = 1; |
1914 |
#endif |
#endif |
1915 |
for (file_offset_t ullPos = workingFileSize, iNotif = 0; iBytesMoved > 0; ++iNotif) { |
for (file_offset_t ullPos = workingFileSize, iNotif = 0; iBytesMoved > 0; ++iNotif) { |
1916 |
iBytesMoved = (ullPos < 4096) ? ullPos : 4096; |
iBytesMoved = (ullPos < 4096) ? ullPos : 4096; |