590 |
msg << "There's no instrument with index " << Key.Index << "."; |
msg << "There's no instrument with index " << Key.Index << "."; |
591 |
throw InstrumentManagerException(msg.str()); |
throw InstrumentManagerException(msg.str()); |
592 |
} |
} |
593 |
pGig->GetFirstSample(); // just to force complete instrument loading |
pGig->GetSample(0); // just to force complete instrument loading |
594 |
dmsg(1,("OK\n")); |
dmsg(1,("OK\n")); |
595 |
|
|
596 |
uint maxSamplesPerCycle = GetMaxSamplesPerCycle(pConsumer); |
uint maxSamplesPerCycle = GetMaxSamplesPerCycle(pConsumer); |
648 |
::RIFF::File* riff = static_cast< ::RIFF::File*>(pRegInfo->pArg); |
::RIFF::File* riff = static_cast< ::RIFF::File*>(pRegInfo->pArg); |
649 |
if (gig) { |
if (gig) { |
650 |
gig->DeleteSample(pSample); |
gig->DeleteSample(pSample); |
651 |
if (!gig->GetFirstSample()) { |
if (!gig->GetSample(0)) { |
652 |
dmsg(2,("No more samples in use - freeing gig\n")); |
dmsg(2,("No more samples in use - freeing gig\n")); |
653 |
delete gig; |
delete gig; |
654 |
delete riff; |
delete riff; |
998 |
delete (::RIFF::File*) pArg; |
delete (::RIFF::File*) pArg; |
999 |
} else { |
} else { |
1000 |
dmsg(2,("keeping some samples that are in use...")); |
dmsg(2,("keeping some samples that are in use...")); |
1001 |
::gig::Sample* nextSample; |
ssize_t i = pResource->CountSamples(); |
1002 |
for (::gig::Sample* sample = pResource->GetFirstSample() ; |
for (--i; i >= 0; --i) { |
1003 |
sample ; |
::gig::Sample* sample = pResource->GetSample(i); |
|
sample = nextSample) { |
|
|
nextSample = pResource->GetNextSample(); |
|
1004 |
if (parent->SampleRefCount.find(sample) == parent->SampleRefCount.end()) { |
if (parent->SampleRefCount.find(sample) == parent->SampleRefCount.end()) { |
1005 |
pResource->DeleteSample(sample); |
pResource->DeleteSample(sample); |
1006 |
} |
} |