/[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 3944 by schoenebeck, Fri Jun 18 15:28:14 2021 UTC revision 3946 by schoenebeck, Fri Jun 18 15:51:32 2021 UTC
# Line 6412  namespace { Line 6412  namespace {
6412          pSample->DeleteChunks();          pSample->DeleteChunks();
6413          delete pSample;          delete pSample;
6414    
         SampleList::iterator tmp = SamplesIterator;  
6415          // remove all references to the sample          // remove all references to the sample
6416          for (Instrument* instrument = GetFirstInstrument() ; instrument ;          size_t iIns = 0;
6417               instrument = GetNextInstrument()) {          for (Instrument* instrument = GetInstrument(iIns); instrument;
6418                             instrument = GetInstrument(++iIns))
6419            {
6420              size_t iRgn = 0;              size_t iRgn = 0;
6421              for (Region* region = instrument->GetRegionAt(iRgn); region;              for (Region* region = instrument->GetRegionAt(iRgn); region;
6422                   region = instrument->GetRegionAt(++iRgn))                   region = instrument->GetRegionAt(++iRgn))
# Line 6428  namespace { Line 6429  namespace {
6429                  }                  }
6430              }              }
6431          }          }
         SamplesIterator = tmp; // restore iterator  
6432      }      }
6433    
6434      void File::LoadSamples() {      void File::LoadSamples() {
# Line 7325  namespace { Line 7325  namespace {
7325    
7326              memset(&pData[48], 0, sublen - 48);              memset(&pData[48], 0, sublen - 48);
7327    
7328              for (Instrument* instrument = GetFirstInstrument() ; instrument ;              size_t iIns = 0;
7329                   instrument = GetNextInstrument()) {              for (Instrument* instrument = GetInstrument(iIns); instrument;
7330                                 instrument = GetInstrument(++iIns))
7331                {
7332                  int nbusedsamples = 0;                  int nbusedsamples = 0;
7333                  int nbusedchannels = 0;                  int nbusedchannels = 0;
7334                  int nbdimregions = 0;                  int nbdimregions = 0;
# Line 7431  namespace { Line 7433  namespace {
7433      void File::UpdateFileOffsets() {      void File::UpdateFileOffsets() {
7434          DLS::File::UpdateFileOffsets();          DLS::File::UpdateFileOffsets();
7435    
7436          for (Instrument* instrument = GetFirstInstrument(); instrument;          size_t i = 0;
7437               instrument = GetNextInstrument())          for (Instrument* instrument = GetInstrument(i); instrument;
7438                             instrument = GetInstrument(++i))
7439          {          {
7440              instrument->UpdateScriptFileOffsets();              instrument->UpdateScriptFileOffsets();
7441          }          }

Legend:
Removed from v.3944  
changed lines
  Added in v.3946

  ViewVC Help
Powered by ViewVC