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

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

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

revision 24 by schoenebeck, Fri Dec 26 16:15:31 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 642  namespace RIFF { Line 642  namespace RIFF {
642      }      }
643    
644      /**      /**
645       *  Returns number subchunks within the list.       *  Returns number of subchunks within the list.
646       */       */
647      unsigned int List::CountSubChunks() {      unsigned int List::CountSubChunks() {
648          if (!pSubChunks) LoadSubChunks();          if (!pSubChunks) LoadSubChunks();
# Line 721  namespace RIFF { Line 721  namespace RIFF {
721          if (!pSubChunks) {          if (!pSubChunks) {
722              pSubChunks    = new ChunkList();              pSubChunks    = new ChunkList();
723              pSubChunksMap = new ChunkMap();              pSubChunksMap = new ChunkMap();
724                unsigned long uiOriginalPos = GetPos();
725                SetPos(0); // jump to beginning of list chunk body
726              while (RemainingBytes() >= CHUNK_HEADER_SIZE) {              while (RemainingBytes() >= CHUNK_HEADER_SIZE) {
727                  Chunk* ck;                  Chunk* ck;
728                  uint32_t ckid;                  uint32_t ckid;
# Line 740  namespace RIFF { Line 742  namespace RIFF {
742                  (*pSubChunksMap)[ckid] = ck;                  (*pSubChunksMap)[ckid] = ck;
743                  if (GetPos() % 2 != 0) SetPos(1, RIFF::stream_curpos); // jump over pad byte                  if (GetPos() % 2 != 0) SetPos(1, RIFF::stream_curpos); // jump over pad byte
744              }              }
745                SetPos(uiOriginalPos); // restore position before this call
746          }          }
747      }      }
748    
# Line 811  namespace RIFF { Line 814  namespace RIFF {
814          std::cout << "RIFF::Exception: " << Message << std::endl;          std::cout << "RIFF::Exception: " << Message << std::endl;
815      }      }
816    
817    
818    // *************** functions ***************
819    // *
820    
821        /**
822         * Returns the name of this C++ library. This is usually "libgig" of
823         * course. This call is equivalent to DLS::libraryName() and
824         * gig::libraryName().
825         */
826        String libraryName() {
827            return PACKAGE;
828        }
829    
830        /**
831         * Returns version of this C++ library. This call is equivalent to
832         * DLS::libraryVersion() and gig::libraryVersion().
833         */
834        String libraryVersion() {
835            return VERSION;
836        }
837    
838  } // namespace RIFF  } // namespace RIFF
839  #endif  #endif

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

  ViewVC Help
Powered by ViewVC