2 |
* * |
* * |
3 |
* libgig - C++ cross-platform Gigasampler format file loader library * |
* libgig - C++ cross-platform Gigasampler format file loader library * |
4 |
* * |
* * |
5 |
* Copyright (C) 2003 by Christian Schoenebeck * |
* Copyright (C) 2003, 2004 by Christian Schoenebeck * |
6 |
* <cuse@users.sourceforge.net> * |
* <cuse@users.sourceforge.net> * |
7 |
* * |
* * |
8 |
* This library is free software; you can redistribute it and/or modify * |
* 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 * |
* it under the terms of the GNU General Public License as published by * |
192 |
#if DEBUG |
#if DEBUG |
193 |
std::cout << "Chunk::Read(void*,ulong,ulong)" << std::endl; |
std::cout << "Chunk::Read(void*,ulong,ulong)" << std::endl; |
194 |
#endif // DEBUG |
#endif // DEBUG |
195 |
if (ChunkSize - ulPos <= 0) return 0; |
if (ulPos >= ChunkSize) return 0; |
196 |
if (ulPos + WordCount * WordSize >= ChunkSize) WordCount = (ChunkSize - ulPos) / WordSize; |
if (ulPos + WordCount * WordSize >= ChunkSize) WordCount = (ChunkSize - ulPos) / WordSize; |
197 |
#if POSIX |
#if POSIX |
198 |
if (lseek(hFile, ulStartPos + ulPos, SEEK_SET) < 0) return 0; |
if (lseek(hFile, ulStartPos + ulPos, SEEK_SET) < 0) return 0; |