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

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

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

revision 308 by schoenebeck, Sun Nov 21 18:02:21 2004 UTC revision 355 by schoenebeck, Fri Feb 4 00:21:30 2005 UTC
# Line 66  namespace gig { Line 66  namespace gig {
66          Compressed = (waveList->GetSubChunk(CHUNK_ID_EWAV));          Compressed = (waveList->GetSubChunk(CHUNK_ID_EWAV));
67          if (Compressed) {          if (Compressed) {
68              ScanCompressedSample();              ScanCompressedSample();
69              if (!pDecompressionBuffer) {          }
70                  pDecompressionBuffer    = new int8_t[INITIAL_SAMPLE_BUFFER_SIZE];  
71                  DecompressionBufferSize = INITIAL_SAMPLE_BUFFER_SIZE;          if (BitDepth > 24)                throw gig::Exception("Only samples up to 24 bit supported");
72              }          if (Compressed && Channels == 1)  throw gig::Exception("Mono compressed samples not yet supported");
73            if (Compressed && BitDepth == 24) throw gig::Exception("24 bit compressed samples not yet supported");
74    
75            // we use a buffer for decompression and for truncating 24 bit samples to 16 bit
76            if ((Compressed || BitDepth == 24) && !pDecompressionBuffer) {
77                pDecompressionBuffer    = new int8_t[INITIAL_SAMPLE_BUFFER_SIZE];
78                DecompressionBufferSize = INITIAL_SAMPLE_BUFFER_SIZE;
79          }          }
80          FrameOffset = 0; // just for streaming compressed samples          FrameOffset = 0; // just for streaming compressed samples
81    
# Line 502  namespace gig { Line 508  namespace gig {
508       */       */
509      unsigned long Sample::Read(void* pBuffer, unsigned long SampleCount) {      unsigned long Sample::Read(void* pBuffer, unsigned long SampleCount) {
510          if (SampleCount == 0) return 0;          if (SampleCount == 0) return 0;
511          if (!Compressed) return pCkData->Read(pBuffer, SampleCount, FrameSize); //FIXME: channel inversion due to endian correction?          if (!Compressed) {
512                if (BitDepth == 24) {
513                    // 24 bit sample. For now just truncate to 16 bit.
514                    int8_t* pSrc = (int8_t*)this->pDecompressionBuffer;
515                    int8_t* pDst = (int8_t*)pBuffer;
516                    unsigned long n = pCkData->Read(pSrc, SampleCount, FrameSize);
517                    for (int i = SampleCount * (FrameSize / 3) ; i > 0 ; i--) {
518                        pSrc++;
519                        *pDst++ = *pSrc++;
520                        *pDst++ = *pSrc++;
521                    }
522                    return SampleCount;
523                } else {
524                    return pCkData->Read(pBuffer, SampleCount, FrameSize); //FIXME: channel inversion due to endian correction?
525                }
526            }
527          else { //FIXME: no support for mono compressed samples yet, are there any?          else { //FIXME: no support for mono compressed samples yet, are there any?
528              if (this->SamplePos >= this->SamplesTotal) return 0;              if (this->SamplePos >= this->SamplesTotal) return 0;
529              //TODO: efficiency: we simply assume here that all frames are compressed, maybe we should test for an average compression rate              //TODO: efficiency: we simply assume here that all frames are compressed, maybe we should test for an average compression rate
# Line 520  namespace gig { Line 541  namespace gig {
541                  // local buffer reallocation - hope this won't happen                  // local buffer reallocation - hope this won't happen
542                  if (this->pDecompressionBuffer) delete[] (int8_t*) this->pDecompressionBuffer;                  if (this->pDecompressionBuffer) delete[] (int8_t*) this->pDecompressionBuffer;
543                  this->pDecompressionBuffer    = new int8_t[assumedsize << 1]; // double of current needed size                  this->pDecompressionBuffer    = new int8_t[assumedsize << 1]; // double of current needed size
544                  this->DecompressionBufferSize = assumedsize;                  this->DecompressionBufferSize = assumedsize << 1;
545              }              }
546    
547              int16_t  compressionmode, left, dleft, right, dright;              int16_t  compressionmode, left, dleft, right, dright;
# Line 660  namespace gig { Line 681  namespace gig {
681    
682      Sample::~Sample() {      Sample::~Sample() {
683          Instances--;          Instances--;
684          if (!Instances && pDecompressionBuffer) delete[] (int8_t*) pDecompressionBuffer;          if (!Instances && pDecompressionBuffer) {
685                delete[] (int8_t*) pDecompressionBuffer;
686                pDecompressionBuffer = NULL;
687            }
688          if (FrameTable) delete[] FrameTable;          if (FrameTable) delete[] FrameTable;
689          if (RAMCache.pStart) delete[] (int8_t*) RAMCache.pStart;          if (RAMCache.pStart) delete[] (int8_t*) RAMCache.pStart;
690      }      }
# Line 781  namespace gig { Line 805  namespace gig {
805          LFO3Controller           = static_cast<lfo3_ctrl_t>(lfo3ctrl & 0x07); // lower 3 bits          LFO3Controller           = static_cast<lfo3_ctrl_t>(lfo3ctrl & 0x07); // lower 3 bits
806          LFO3Sync                 = lfo3ctrl & 0x20; // bit 5          LFO3Sync                 = lfo3ctrl & 0x20; // bit 5
807          InvertAttenuationController = lfo3ctrl & 0x80; // bit 7          InvertAttenuationController = lfo3ctrl & 0x80; // bit 7
         if (VCFType == vcf_type_lowpass) {  
             if (lfo3ctrl & 0x40) // bit 6  
                 VCFType = vcf_type_lowpassturbo;  
         }  
808          AttenuationController  = DecodeLeverageController(static_cast<_lev_ctrl_t>(_3ewa->ReadUint8()));          AttenuationController  = DecodeLeverageController(static_cast<_lev_ctrl_t>(_3ewa->ReadUint8()));
809          uint8_t lfo2ctrl       = _3ewa->ReadUint8();          uint8_t lfo2ctrl       = _3ewa->ReadUint8();
810          LFO2Controller         = static_cast<lfo2_ctrl_t>(lfo2ctrl & 0x07); // lower 3 bits          LFO2Controller         = static_cast<lfo2_ctrl_t>(lfo2ctrl & 0x07); // lower 3 bits
# Line 829  namespace gig { Line 849  namespace gig {
849          VCFVelocityDynamicRange = vcfvelocity % 5;          VCFVelocityDynamicRange = vcfvelocity % 5;
850          VCFVelocityCurve        = static_cast<curve_type_t>(vcfvelocity / 5);          VCFVelocityCurve        = static_cast<curve_type_t>(vcfvelocity / 5);
851          VCFType = static_cast<vcf_type_t>(_3ewa->ReadUint8());          VCFType = static_cast<vcf_type_t>(_3ewa->ReadUint8());
852            if (VCFType == vcf_type_lowpass) {
853                if (lfo3ctrl & 0x40) // bit 6
854                    VCFType = vcf_type_lowpassturbo;
855            }
856    
857          // get the corresponding velocity->volume table from the table map or create & calculate that table if it doesn't exist yet          // get the corresponding velocity->volume table from the table map or create & calculate that table if it doesn't exist yet
858          uint32_t tableKey = (VelocityResponseCurve<<16) | (VelocityResponseDepth<<8) | VelocityResponseCurveScaling;          uint32_t tableKey = (VelocityResponseCurve<<16) | (VelocityResponseDepth<<8) | VelocityResponseCurveScaling;
# Line 836  namespace gig { Line 860  namespace gig {
860              pVelocityAttenuationTable = (*pVelocityTables)[tableKey];              pVelocityAttenuationTable = (*pVelocityTables)[tableKey];
861          }          }
862          else {          else {
863              pVelocityAttenuationTable =              pVelocityAttenuationTable =
864                  CreateVelocityTable(VelocityResponseCurve,                  CreateVelocityTable(VelocityResponseCurve,
865                                      VelocityResponseDepth,                                      VelocityResponseDepth,
866                                      VelocityResponseCurveScaling);                                      VelocityResponseCurveScaling);
# Line 993  namespace gig { Line 1017  namespace gig {
1017      }      }
1018    
1019      double* DimensionRegion::CreateVelocityTable(curve_type_t curveType, uint8_t depth, uint8_t scaling) {      double* DimensionRegion::CreateVelocityTable(curve_type_t curveType, uint8_t depth, uint8_t scaling) {
1020            
1021          // line-segment approximations of the 15 velocity curves          // line-segment approximations of the 15 velocity curves
1022    
1023          // linear          // linear
# Line 1005  namespace gig { Line 1029  namespace gig {
1029    
1030          // non-linear          // non-linear
1031          const int non0[] = { 1, 4, 24, 5, 57, 17, 92, 57, 122, 127, 127, 127 };          const int non0[] = { 1, 4, 24, 5, 57, 17, 92, 57, 122, 127, 127, 127 };
1032          const int non1[] = { 1, 4, 46, 9, 93, 56, 118, 106, 123, 127,          const int non1[] = { 1, 4, 46, 9, 93, 56, 118, 106, 123, 127,
1033                               127, 127 };                               127, 127 };
1034          const int non2[] = { 1, 4, 46, 9, 57, 20, 102, 107, 107, 127,          const int non2[] = { 1, 4, 46, 9, 57, 20, 102, 107, 107, 127,
1035                               127, 127 };                               127, 127 };
1036          const int non3[] = { 1, 15, 10, 19, 67, 73, 80, 80, 90, 98, 98, 127,          const int non3[] = { 1, 15, 10, 19, 67, 73, 80, 80, 90, 98, 98, 127,
1037                               127, 127 };                               127, 127 };
1038          const int non4[] = { 1, 25, 33, 57, 82, 81, 92, 127, 127, 127 };          const int non4[] = { 1, 25, 33, 57, 82, 81, 92, 127, 127, 127 };
1039            
1040          // special          // special
1041          const int spe0[] = { 1, 2, 76, 10, 90, 15, 95, 20, 99, 28, 103, 44,          const int spe0[] = { 1, 2, 76, 10, 90, 15, 95, 20, 99, 28, 103, 44,
1042                               113, 127, 127, 127 };                               113, 127, 127, 127 };
1043          const int spe1[] = { 1, 2, 27, 5, 67, 18, 89, 29, 95, 35, 107, 67,          const int spe1[] = { 1, 2, 27, 5, 67, 18, 89, 29, 95, 35, 107, 67,
1044                               118, 127, 127, 127 };                               118, 127, 127, 127 };
1045          const int spe2[] = { 1, 1, 33, 1, 53, 5, 61, 13, 69, 32, 79, 74,          const int spe2[] = { 1, 1, 33, 1, 53, 5, 61, 13, 69, 32, 79, 74,
1046                               85, 90, 91, 127, 127, 127 };                               85, 90, 91, 127, 127, 127 };
1047          const int spe3[] = { 1, 32, 28, 35, 66, 48, 89, 59, 95, 65, 99, 73,          const int spe3[] = { 1, 32, 28, 35, 66, 48, 89, 59, 95, 65, 99, 73,
1048                               117, 127, 127, 127 };                               117, 127, 127, 127 };
1049          const int spe4[] = { 1, 4, 23, 5, 49, 13, 57, 17, 92, 57, 122, 127,          const int spe4[] = { 1, 4, 23, 5, 49, 13, 57, 17, 92, 57, 122, 127,
1050                               127, 127 };                               127, 127 };
1051            
1052          const int* const curves[] = { non0, non1, non2, non3, non4,          const int* const curves[] = { non0, non1, non2, non3, non4,
1053                                        lin0, lin1, lin2, lin3, lin4,                                        lin0, lin1, lin2, lin3, lin4,
1054                                        spe0, spe1, spe2, spe3, spe4 };                                        spe0, spe1, spe2, spe3, spe4 };
1055            
1056          double* const table = new double[128];          double* const table = new double[128];
1057    
1058          const int* curve = curves[curveType * 5 + depth];          const int* curve = curves[curveType * 5 + depth];
1059          const int s = scaling == 0 ? 20 : scaling; // 0 or 20 means no scaling          const int s = scaling == 0 ? 20 : scaling; // 0 or 20 means no scaling
1060            
1061          table[0] = 0;          table[0] = 0;
1062          for (int x = 1 ; x < 128 ; x++) {          for (int x = 1 ; x < 128 ; x++) {
1063    
1064              if (x > curve[2]) curve += 2;              if (x > curve[2]) curve += 2;
1065              double y = curve[1] + (x - curve[0]) *              double y = curve[1] + (x - curve[0]) *
1066                  (double(curve[3] - curve[1]) / (curve[2] - curve[0]));                  (double(curve[3] - curve[1]) / (curve[2] - curve[0]));
1067              y = y / 127;              y = y / 127;
1068    
# Line 1062  namespace gig { Line 1086  namespace gig {
1086      Region::Region(Instrument* pInstrument, RIFF::List* rgnList) : DLS::Region((DLS::Instrument*) pInstrument, rgnList) {      Region::Region(Instrument* pInstrument, RIFF::List* rgnList) : DLS::Region((DLS::Instrument*) pInstrument, rgnList) {
1087          // Initialization          // Initialization
1088          Dimensions = 0;          Dimensions = 0;
1089          for (int i = 0; i < 32; i++) {          for (int i = 0; i < 256; i++) {
1090              pDimensionRegions[i] = NULL;              pDimensionRegions[i] = NULL;
1091          }          }
1092          Layers = 1;          Layers = 1;
1093            File* file = (File*) GetParent()->GetParent();
1094            int dimensionBits = (file->pVersion && file->pVersion->major == 3) ? 8 : 5;
1095    
1096          // Actual Loading          // Actual Loading
1097    
# Line 1074  namespace gig { Line 1100  namespace gig {
1100          RIFF::Chunk* _3lnk = rgnList->GetSubChunk(CHUNK_ID_3LNK);          RIFF::Chunk* _3lnk = rgnList->GetSubChunk(CHUNK_ID_3LNK);
1101          if (_3lnk) {          if (_3lnk) {
1102              DimensionRegions = _3lnk->ReadUint32();              DimensionRegions = _3lnk->ReadUint32();
1103              for (int i = 0; i < 5; i++) {              for (int i = 0; i < dimensionBits; i++) {
1104                  dimension_t dimension = static_cast<dimension_t>(_3lnk->ReadUint8());                  dimension_t dimension = static_cast<dimension_t>(_3lnk->ReadUint8());
1105                  uint8_t     bits      = _3lnk->ReadUint8();                  uint8_t     bits      = _3lnk->ReadUint8();
1106                  if (dimension == dimension_none) { // inactive dimension                  if (dimension == dimension_none) { // inactive dimension
# Line 1117  namespace gig { Line 1143  namespace gig {
1143                      else { // custom defined ranges                      else { // custom defined ranges
1144                          pDimDef->split_type = split_type_customvelocity;                          pDimDef->split_type = split_type_customvelocity;
1145                          pDimDef->ranges     = new range_t[pDimDef->zones];                          pDimDef->ranges     = new range_t[pDimDef->zones];
1146                          unsigned int bits[5] = {0,0,0,0,0};                          uint8_t bits[8] = { 0 };
1147                          int previousUpperLimit = -1;                          int previousUpperLimit = -1;
1148                          for (int velocityZone = 0; velocityZone < pDimDef->zones; velocityZone++) {                          for (int velocityZone = 0; velocityZone < pDimDef->zones; velocityZone++) {
1149                              bits[i] = velocityZone;                              bits[i] = velocityZone;
1150                              DimensionRegion* pDimRegion = GetDimensionRegionByBit(bits[4],bits[3],bits[2],bits[1],bits[0]);                              DimensionRegion* pDimRegion = GetDimensionRegionByBit(bits);
1151    
1152                              pDimDef->ranges[velocityZone].low  = previousUpperLimit + 1;                              pDimDef->ranges[velocityZone].low  = previousUpperLimit + 1;
1153                              pDimDef->ranges[velocityZone].high = pDimRegion->VelocityUpperLimit;                              pDimDef->ranges[velocityZone].high = pDimRegion->VelocityUpperLimit;
# Line 1135  namespace gig { Line 1161  namespace gig {
1161                  }                  }
1162              }              }
1163    
1164                // jump to start of the wave pool indices (if not already there)
1165                File* file = (File*) GetParent()->GetParent();
1166                if (file->pVersion && file->pVersion->major == 3)
1167                    _3lnk->SetPos(68); // version 3 has a different 3lnk structure
1168                else
1169                    _3lnk->SetPos(44);
1170    
1171              // load sample references              // load sample references
             _3lnk->SetPos(44); // jump to start of the wave pool indices (if not already there)  
1172              for (uint i = 0; i < DimensionRegions; i++) {              for (uint i = 0; i < DimensionRegions; i++) {
1173                  uint32_t wavepoolindex = _3lnk->ReadUint32();                  uint32_t wavepoolindex = _3lnk->ReadUint32();
1174                  pDimensionRegions[i]->pSample = GetSampleFromWavePool(wavepoolindex);                  pDimensionRegions[i]->pSample = GetSampleFromWavePool(wavepoolindex);
# Line 1165  namespace gig { Line 1197  namespace gig {
1197          for (uint i = 0; i < Dimensions; i++) {          for (uint i = 0; i < Dimensions; i++) {
1198              if (pDimensionDefinitions[i].ranges) delete[] pDimensionDefinitions[i].ranges;              if (pDimensionDefinitions[i].ranges) delete[] pDimensionDefinitions[i].ranges;
1199          }          }
1200          for (int i = 0; i < 32; i++) {          for (int i = 0; i < 256; i++) {
1201              if (pDimensionRegions[i]) delete pDimensionRegions[i];              if (pDimensionRegions[i]) delete pDimensionRegions[i];
1202          }          }
1203      }      }
# Line 1183  namespace gig { Line 1215  namespace gig {
1215       * left channel, 1 for right channel or 0 for layer 0, 1 for layer 1,       * left channel, 1 for right channel or 0 for layer 0, 1 for layer 1,
1216       * etc.).       * etc.).
1217       *       *
1218       * @param  Dim4Val  MIDI controller value (0-127) for dimension 4       * @param  DimValues  MIDI controller values (0-127) for dimension 0 to 7
      * @param  Dim3Val  MIDI controller value (0-127) for dimension 3  
      * @param  Dim2Val  MIDI controller value (0-127) for dimension 2  
      * @param  Dim1Val  MIDI controller value (0-127) for dimension 1  
      * @param  Dim0Val  MIDI controller value (0-127) for dimension 0  
1219       * @returns         adress to the DimensionRegion for the given situation       * @returns         adress to the DimensionRegion for the given situation
1220       * @see             pDimensionDefinitions       * @see             pDimensionDefinitions
1221       * @see             Dimensions       * @see             Dimensions
1222       */       */
1223      DimensionRegion* Region::GetDimensionRegionByValue(uint Dim4Val, uint Dim3Val, uint Dim2Val, uint Dim1Val, uint Dim0Val) {      DimensionRegion* Region::GetDimensionRegionByValue(const uint DimValues[8]) {
1224          uint8_t bits[5] = {Dim0Val,Dim1Val,Dim2Val,Dim3Val,Dim4Val};          uint8_t bits[8] = { 0 };
1225          for (uint i = 0; i < Dimensions; i++) {          for (uint i = 0; i < Dimensions; i++) {
1226                bits[i] = DimValues[i];
1227              switch (pDimensionDefinitions[i].split_type) {              switch (pDimensionDefinitions[i].split_type) {
1228                  case split_type_normal:                  case split_type_normal:
1229                      bits[i] /= pDimensionDefinitions[i].zone_size;                      bits[i] /= pDimensionDefinitions[i].zone_size;
# Line 1208  namespace gig { Line 1237  namespace gig {
1237                      break;                      break;
1238              }              }
1239          }          }
1240          return GetDimensionRegionByBit(bits[4],bits[3],bits[2],bits[1],bits[0]);          return GetDimensionRegionByBit(bits);
1241      }      }
1242    
1243      /**      /**
# Line 1216  namespace gig { Line 1245  namespace gig {
1245       * numbers (zone index). You usually use <i>GetDimensionRegionByValue</i>       * numbers (zone index). You usually use <i>GetDimensionRegionByValue</i>
1246       * instead of calling this method directly!       * instead of calling this method directly!
1247       *       *
1248       * @param Dim4Bit  Bit number for dimension 4       * @param DimBits  Bit numbers for dimension 0 to 7
      * @param Dim3Bit  Bit number for dimension 3  
      * @param Dim2Bit  Bit number for dimension 2  
      * @param Dim1Bit  Bit number for dimension 1  
      * @param Dim0Bit  Bit number for dimension 0  
1249       * @returns        adress to the DimensionRegion for the given dimension       * @returns        adress to the DimensionRegion for the given dimension
1250       *                 bit numbers       *                 bit numbers
1251       * @see            GetDimensionRegionByValue()       * @see            GetDimensionRegionByValue()
1252       */       */
1253      DimensionRegion* Region::GetDimensionRegionByBit(uint8_t Dim4Bit, uint8_t Dim3Bit, uint8_t Dim2Bit, uint8_t Dim1Bit, uint8_t Dim0Bit) {      DimensionRegion* Region::GetDimensionRegionByBit(const uint8_t DimBits[8]) {
1254          return *(pDimensionRegions + ((((((((Dim4Bit << pDimensionDefinitions[3].bits) | Dim3Bit)          return pDimensionRegions[((((((DimBits[7] << pDimensionDefinitions[6].bits | DimBits[6])
1255                                                       << pDimensionDefinitions[2].bits) | Dim2Bit)                                                    << pDimensionDefinitions[5].bits | DimBits[5])
1256                                                       << pDimensionDefinitions[1].bits) | Dim1Bit)                                                    << pDimensionDefinitions[4].bits | DimBits[4])
1257                                                       << pDimensionDefinitions[0].bits) | Dim0Bit) );                                                    << pDimensionDefinitions[3].bits | DimBits[3])
1258                                                      << pDimensionDefinitions[2].bits | DimBits[2])
1259                                                      << pDimensionDefinitions[1].bits | DimBits[1])
1260                                                      << pDimensionDefinitions[0].bits | DimBits[0]];
1261      }      }
1262    
1263      /**      /**
# Line 1247  namespace gig { Line 1275  namespace gig {
1275      }      }
1276    
1277      Sample* Region::GetSampleFromWavePool(unsigned int WavePoolTableIndex) {      Sample* Region::GetSampleFromWavePool(unsigned int WavePoolTableIndex) {
1278            if ((int32_t)WavePoolTableIndex == -1) return NULL;
1279          File* file = (File*) GetParent()->GetParent();          File* file = (File*) GetParent()->GetParent();
1280          unsigned long soughtoffset = file->pWavePoolTable[WavePoolTableIndex];          unsigned long soughtoffset = file->pWavePoolTable[WavePoolTableIndex];
1281          Sample* sample = file->GetFirstSample();          Sample* sample = file->GetFirstSample();
# Line 1288  namespace gig { Line 1317  namespace gig {
1317          RIFF::List* lrgn = insList->GetSubList(LIST_TYPE_LRGN);          RIFF::List* lrgn = insList->GetSubList(LIST_TYPE_LRGN);
1318          if (!lrgn) throw gig::Exception("Mandatory chunks in <ins > chunk not found.");          if (!lrgn) throw gig::Exception("Mandatory chunks in <ins > chunk not found.");
1319          pRegions = new Region*[Regions];          pRegions = new Region*[Regions];
1320            for (uint i = 0; i < Regions; i++) pRegions[i] = NULL;
1321          RIFF::List* rgn = lrgn->GetFirstSubList();          RIFF::List* rgn = lrgn->GetFirstSubList();
1322          unsigned int iRegion = 0;          unsigned int iRegion = 0;
1323          while (rgn) {          while (rgn) {
# Line 1311  namespace gig { Line 1341  namespace gig {
1341              if (pRegions) {              if (pRegions) {
1342                  if (pRegions[i]) delete (pRegions[i]);                  if (pRegions[i]) delete (pRegions[i]);
1343              }              }
             delete[] pRegions;  
1344          }          }
1345            if (pRegions) delete[] pRegions;
1346      }      }
1347    
1348      /**      /**
# Line 1368  namespace gig { Line 1398  namespace gig {
1398          pInstruments = NULL;          pInstruments = NULL;
1399      }      }
1400    
1401        File::~File() {
1402            // free samples
1403            if (pSamples) {
1404                SamplesIterator = pSamples->begin();
1405                while (SamplesIterator != pSamples->end() ) {
1406                    delete (*SamplesIterator);
1407                    SamplesIterator++;
1408                }
1409                pSamples->clear();
1410                delete pSamples;
1411    
1412            }
1413            // free instruments
1414            if (pInstruments) {
1415                InstrumentsIterator = pInstruments->begin();
1416                while (InstrumentsIterator != pInstruments->end() ) {
1417                    delete (*InstrumentsIterator);
1418                    InstrumentsIterator++;
1419                }
1420                pInstruments->clear();
1421                delete pInstruments;
1422            }
1423        }
1424    
1425      Sample* File::GetFirstSample() {      Sample* File::GetFirstSample() {
1426          if (!pSamples) LoadSamples();          if (!pSamples) LoadSamples();
1427          if (!pSamples) return NULL;          if (!pSamples) return NULL;

Legend:
Removed from v.308  
changed lines
  Added in v.355

  ViewVC Help
Powered by ViewVC