Es geschah am Samstag 27 November 2004 12:58 als Andreas Persson schrieb:
> I ignored all new (and for me unknown) features and made some small
> changes to libgig, and - it worked! The offsets in the sample pool table
> are now 64 bits, supporting large files. I cheated and removed the upper
> half of the offsets. The samples are 24 bits. I cheated and removed the
> lower 8 bits. Looped or compressed samples are not supported, and
> probably a million other things, but I do have gig3 pipe organ sounds
> coming out of LS!
Very, very fine! :)
We now just have to clean up those changes a little bit. E.g.:
Index: linuxsampler/src/lib/fileloader/libgig/DLS.cpp
===================================================================
RCS
file: /var/cvs/linuxsampler/linuxsampler/src/lib/fileloader/libgig/DLS.cpp,v
retrieving revision 1.2
diff -u -2 -r1.2 DLS.cpp
--- linuxsampler/src/lib/fileloader/libgig/DLS.cpp 27 Apr 2004 09:21:58 -0000
1.2
+++ linuxsampler/src/lib/fileloader/libgig/DLS.cpp 27 Nov 2004 11:21:17 -0000
@@ -415,5 +415,13 @@
pWavePoolTable = new uint32_t[WavePoolCount];
ptbl->SetPos(headersize);
- ptbl->Read(pWavePoolTable, WavePoolCount, sizeof(uint32_t));
+
+ // Check for 64 bit offsets (used in gig v3 files)
+ if (ptbl->GetSize() - headersize == WavePoolCount * 8) {
+ for (int i = 0 ; i < WavePoolCount ; i++) {
+ ptbl->ReadUint32(); // Just ignore the upper bits for now
+ pWavePoolTable[i] = ptbl->ReadUint32();
+ }
+ } else
+ ptbl->Read(pWavePoolTable, WavePoolCount, sizeof(uint32_t));
this should better check for the file format version instead of testing the
size of the pool table chunk. Otherwise we'll get into trouble with even
newer format versions.
and next:
Index: linuxsampler/src/lib/fileloader/libgig/gig.cpp
===================================================================
RCS
file: /var/cvs/linuxsampler/linuxsampler/src/lib/fileloader/libgig/gig.cpp,v
retrieving revision 1.7
diff -u -2 -r1.7 gig.cpp
--- linuxsampler/src/lib/fileloader/libgig/gig.cpp 21 Nov 2004 18:07:42 -0000
1.7
+++ linuxsampler/src/lib/fileloader/libgig/gig.cpp 27 Nov 2004 11:21:18 -0000
@@ -67,8 +67,8 @@
if (Compressed) {
ScanCompressedSample();
- if (!pDecompressionBuffer) {
- pDecompressionBuffer = new
int8_t[INITIAL_SAMPLE_BUFFER_SIZE];
- DecompressionBufferSize = INITIAL_SAMPLE_BUFFER_SIZE;
- }
+ }
+ if (!pDecompressionBuffer) {
+ pDecompressionBuffer = new int8_t[INITIAL_SAMPLE_BUFFER_SIZE];
+ DecompressionBufferSize = INITIAL_SAMPLE_BUFFER_SIZE;
}
FrameOffset = 0; // just for streaming compressed samples
the decompresstion buffer should really only be allocated in case of
compressed samples or on v3 file format gigs.
The sample Read() code vor v3 should be improved of course, but that's ok for
the moment.
Anyway, great work !
CU
Christian
|