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-2005 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 * |
414 |
WavePoolCount = ptbl->ReadUint32(); |
WavePoolCount = ptbl->ReadUint32(); |
415 |
pWavePoolTable = new uint32_t[WavePoolCount]; |
pWavePoolTable = new uint32_t[WavePoolCount]; |
416 |
ptbl->SetPos(headersize); |
ptbl->SetPos(headersize); |
417 |
ptbl->Read(pWavePoolTable, WavePoolCount, sizeof(uint32_t)); |
|
418 |
|
// Check for 64 bit offsets (used in gig v3 files) |
419 |
|
if (ptbl->GetSize() - headersize == WavePoolCount * 8) { |
420 |
|
for (int i = 0 ; i < WavePoolCount ; i++) { |
421 |
|
// Just ignore the upper bits for now |
422 |
|
uint32_t upper = ptbl->ReadUint32(); |
423 |
|
pWavePoolTable[i] = ptbl->ReadUint32(); |
424 |
|
if (upper || (pWavePoolTable[i] & 0x80000000)) |
425 |
|
throw DLS::Exception("Files larger than 2 GB not yet supported"); |
426 |
|
} |
427 |
|
} |
428 |
|
else ptbl->Read(pWavePoolTable, WavePoolCount, sizeof(uint32_t)); |
429 |
|
|
430 |
pSamples = NULL; |
pSamples = NULL; |
431 |
pInstruments = NULL; |
pInstruments = NULL; |