/[svn]/libgig/trunk/src/DLS.cpp
ViewVC logotype

Diff of /libgig/trunk/src/DLS.cpp

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 11 by schoenebeck, Sun Nov 16 17:47:00 2003 UTC revision 518 by schoenebeck, Sun May 8 16:19:34 2005 UTC
# Line 2  Line 2 
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  *
# Line 414  namespace DLS { Line 414  namespace DLS {
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;
         Instruments  = 0;  
432      }      }
433    
434      File::~File() {      File::~File() {
# Line 529  namespace DLS { Line 539  namespace DLS {
539          std::cout << "DLS::Exception: " << Message << std::endl;          std::cout << "DLS::Exception: " << Message << std::endl;
540      }      }
541    
542    
543    // *************** functions ***************
544    // *
545    
546        /**
547         * Returns the name of this C++ library. This is usually "libgig" of
548         * course. This call is equivalent to RIFF::libraryName() and
549         * gig::libraryName().
550         */
551        String libraryName() {
552            return PACKAGE;
553        }
554    
555        /**
556         * Returns version of this C++ library. This call is equivalent to
557         * RIFF::libraryVersion() and gig::libraryVersion().
558         */
559        String libraryVersion() {
560            return VERSION;
561        }
562    
563  } // namespace DLS  } // namespace DLS

Legend:
Removed from v.11  
changed lines
  Added in v.518

  ViewVC Help
Powered by ViewVC