44 |
dmsg(1,("Caching initial samples...")); |
dmsg(1,("Caching initial samples...")); |
45 |
::gig::Region* pRgn = pInstrument->GetFirstRegion(); |
::gig::Region* pRgn = pInstrument->GetFirstRegion(); |
46 |
while (pRgn) { |
while (pRgn) { |
47 |
if (!pRgn->GetSample()->GetCache().Size) { |
if (pRgn->GetSample() && !pRgn->GetSample()->GetCache().Size) { |
48 |
dmsg(2,("C")); |
dmsg(2,("C")); |
49 |
CacheInitialSamples(pRgn->GetSample(), dynamic_cast<gig::Engine*>(pConsumer)); |
CacheInitialSamples(pRgn->GetSample(), dynamic_cast<gig::Engine*>(pConsumer)); |
50 |
} |
} |
90 |
* @param pEngine - pointer to Gig Engine which caused this call |
* @param pEngine - pointer to Gig Engine which caused this call |
91 |
*/ |
*/ |
92 |
void InstrumentResourceManager::CacheInitialSamples(::gig::Sample* pSample, gig::Engine* pEngine) { |
void InstrumentResourceManager::CacheInitialSamples(::gig::Sample* pSample, gig::Engine* pEngine) { |
93 |
if (!pSample || pSample->GetCache().Size) return; |
if (!pSample || pSample->GetCache().Size || !pSample->SamplesTotal) return; |
94 |
if (pSample->SamplesTotal <= NUM_RAM_PRELOAD_SAMPLES) { |
if (pSample->SamplesTotal <= NUM_RAM_PRELOAD_SAMPLES) { |
95 |
// Sample is too short for disk streaming, so we load the whole |
// Sample is too short for disk streaming, so we load the whole |
96 |
// sample into RAM and place 'pAudioIO->FragmentSize << MAX_PITCH' |
// sample into RAM and place 'pAudioIO->FragmentSize << MAX_PITCH' |