Lines Matching defs:sampleID
191 sp<Sample> SoundPool::findSample(int sampleID)
194 return findSample_l(sampleID);
197 sp<Sample> SoundPool::findSample_l(int sampleID)
199 return mSamples.valueFor(sampleID);
226 int sampleID;
229 sampleID = ++mNextSampleID;
230 sp<Sample> sample = new Sample(sampleID, fd, offset, length);
231 mSamples.add(sampleID, sample);
239 mDecodeThread->loadSample(sampleID);
240 return sampleID;
243 bool SoundPool::unload(int sampleID)
245 ALOGV("unload: sampleID=%d", sampleID);
247 return mSamples.removeItem(sampleID) >= 0; // removeItem() returns index or BAD_VALUE
250 int SoundPool::play(int sampleID, float leftVolume, float rightVolume,
253 ALOGV("play sampleID=%d, leftVolume=%f, rightVolume=%f, priority=%d, loop=%d, rate=%f",
254 sampleID, leftVolume, rightVolume, priority, loop, rate);
264 sp<Sample> sample(findSample_l(sampleID));
266 ALOGW(" sample %d not READY", sampleID);
273 channel = allocateChannel_l(priority, sampleID);
288 SoundChannel* SoundPool::allocateChannel_l(int priority, int sampleID)
293 // check if channel for given sampleID still available
296 if (sampleID == (*iter)->getPrevSampleID() && (*iter)->state() == SoundChannel::IDLE) {
299 ALOGV("Allocated recycled channel for same sampleID");
486 Sample::Sample(int sampleID, int fd, int64_t offset, int64_t length)
489 mSampleID = sampleID;
493 ALOGV("create sampleID=%d, fd=%d, offset=%" PRId64 " length=%" PRId64,
510 ALOGV("Sample::destructor sampleID=%d, fd=%d", mSampleID, mFd);
729 ALOGV("SoundChannel::play %p: sampleID=%d, channelID=%d, leftVolume=%f, rightVolume=%f,"
731 this, sample->sampleID(), nextChannelID, leftVolume, rightVolume,
772 if (mAudioTrack != 0 && mPrevSampleID == sample->sampleID()) {
776 ALOGV("reusing track %p for sample %d", mAudioTrack.get(), sample->sampleID());
813 ALOGV("using new track %p for sample %d", newTrack.get(), sample->sampleID());
959 mPrevSampleID = mSample->sampleID();