6005 |
pMidiRules[0] = NULL; |
pMidiRules[0] = NULL; |
6006 |
|
|
6007 |
// delete all old regions |
// delete all old regions |
6008 |
while (Regions) DeleteRegion(GetFirstRegion()); |
while (Regions) DeleteRegion(GetRegionAt(0)); |
6009 |
// create new regions and copy them from original |
// create new regions and copy them from original |
6010 |
{ |
{ |
6011 |
RegionList::const_iterator it = orig->pRegions->begin(); |
RegionList::const_iterator it = orig->pRegions->begin(); |
6359 |
// remove all references to the sample |
// remove all references to the sample |
6360 |
for (Instrument* instrument = GetFirstInstrument() ; instrument ; |
for (Instrument* instrument = GetFirstInstrument() ; instrument ; |
6361 |
instrument = GetNextInstrument()) { |
instrument = GetNextInstrument()) { |
6362 |
for (Region* region = instrument->GetFirstRegion() ; region ; |
size_t iRgn = 0; |
6363 |
region = instrument->GetNextRegion()) { |
for (Region* region = instrument->GetRegionAt(iRgn); region; |
6364 |
|
region = instrument->GetRegionAt(++iRgn)) |
6365 |
|
{ |
6366 |
if (region->GetSample() == pSample) region->SetSample(NULL); |
if (region->GetSample() == pSample) region->SetSample(NULL); |
6367 |
|
|
6368 |
for (int i = 0 ; i < region->DimensionRegions ; i++) { |
for (int i = 0 ; i < region->DimensionRegions ; i++) { |
7254 |
|
|
7255 |
memset(&pData[(instrumentIdx + 1) * sublen + 48], 0, sublen - 48); |
memset(&pData[(instrumentIdx + 1) * sublen + 48], 0, sublen - 48); |
7256 |
|
|
7257 |
for (Region* region = instrument->GetFirstRegion() ; region ; |
size_t iRgn = 0; |
7258 |
region = instrument->GetNextRegion()) { |
for (Region* region = instrument->GetRegionAt(iRgn); region; |
7259 |
|
region = instrument->GetRegionAt(++iRgn)) |
7260 |
|
{ |
7261 |
for (int i = 0 ; i < region->DimensionRegions ; i++) { |
for (int i = 0 ; i < region->DimensionRegions ; i++) { |
7262 |
gig::DimensionRegion *d = region->pDimensionRegions[i]; |
gig::DimensionRegion *d = region->pDimensionRegions[i]; |
7263 |
if (d->pSample) { |
if (d->pSample) { |