6270 |
} |
} |
6271 |
} |
} |
6272 |
|
|
6273 |
|
/** |
6274 |
|
* Returns a pointer to the first <i>Sample</i> object of the file, |
6275 |
|
* <i>NULL</i> otherwise. |
6276 |
|
* |
6277 |
|
* @param pProgress - optional: callback function for progress notification |
6278 |
|
* @deprecated This method is not reentrant-safe, use GetSample() |
6279 |
|
* instead. |
6280 |
|
*/ |
6281 |
Sample* File::GetFirstSample(progress_t* pProgress) { |
Sample* File::GetFirstSample(progress_t* pProgress) { |
6282 |
if (!pSamples) LoadSamples(pProgress); |
if (!pSamples) LoadSamples(pProgress); |
6283 |
if (!pSamples) return NULL; |
if (!pSamples) return NULL; |
6285 |
return static_cast<gig::Sample*>( (SamplesIterator != pSamples->end()) ? *SamplesIterator : NULL ); |
return static_cast<gig::Sample*>( (SamplesIterator != pSamples->end()) ? *SamplesIterator : NULL ); |
6286 |
} |
} |
6287 |
|
|
6288 |
|
/** |
6289 |
|
* Returns a pointer to the next <i>Sample</i> object of the file, |
6290 |
|
* <i>NULL</i> otherwise. |
6291 |
|
* |
6292 |
|
* @deprecated This method is not reentrant-safe, use GetSample() |
6293 |
|
* instead. |
6294 |
|
*/ |
6295 |
Sample* File::GetNextSample() { |
Sample* File::GetNextSample() { |
6296 |
if (!pSamples) return NULL; |
if (!pSamples) return NULL; |
6297 |
SamplesIterator++; |
SamplesIterator++; |
6301 |
/** |
/** |
6302 |
* Returns Sample object of @a index. |
* Returns Sample object of @a index. |
6303 |
* |
* |
6304 |
|
* @param index - position of sample in sample list (0..n) |
6305 |
|
* @param pProgress - optional: callback function for progress notification |
6306 |
* @returns sample object or NULL if index is out of bounds |
* @returns sample object or NULL if index is out of bounds |
6307 |
*/ |
*/ |
6308 |
Sample* File::GetSample(uint index) { |
Sample* File::GetSample(size_t index, progress_t* pProgress) { |
6309 |
if (!pSamples) LoadSamples(); |
if (!pSamples) LoadSamples(pProgress); |
6310 |
if (!pSamples) return NULL; |
if (!pSamples) return NULL; |
6311 |
DLS::File::SampleList::iterator it = pSamples->begin(); |
if (index >= pSamples->size()) return NULL; |
6312 |
for (int i = 0; i < index; ++i) { |
return static_cast<gig::Sample*>( (*pSamples)[index] ); |
|
++it; |
|
|
if (it == pSamples->end()) return NULL; |
|
|
} |
|
|
if (it == pSamples->end()) return NULL; |
|
|
return static_cast<gig::Sample*>( *it ); |
|
6313 |
} |
} |
6314 |
|
|
6315 |
/** |
/** |