Lines Matching refs:lpToneGen
1330 ToneGenerator *lpToneGen = static_cast<ToneGenerator *>(user); in audioCallback() local
1333 const ToneDescriptor *lpToneDesc = lpToneGen->mpToneDesc; in audioCallback()
1342 … unsigned int lReqSmp = lNumSmp < lpToneGen->mProcessSize*2 ? lNumSmp : lpToneGen->mProcessSize; in audioCallback()
1347 lpToneGen->mLock.lock(); in audioCallback()
1351 lpToneGen->mTotalSmp += lReqSmp; in audioCallback()
1354 switch (lpToneGen->mState) { in audioCallback()
1368 lpToneGen->mNextSegSmp = TONEGEN_INF; // forced to skip state machine management below in audioCallback()
1379 if (lpToneDesc->segments[lpToneGen->mCurSegment].duration == 0 || in audioCallback()
1380 lpToneGen->mTotalSmp > lpToneGen->mMaxSmp) { in audioCallback()
1381 if (lpToneGen->mState == TONE_PLAYING) { in audioCallback()
1382 lpToneGen->mState = TONE_STOPPING; in audioCallback()
1384 if (lpToneDesc->segments[lpToneGen->mCurSegment].duration == 0) { in audioCallback()
1389 lpToneGen->mNextSegSmp = TONEGEN_INF; // forced to skip state machine management below in audioCallback()
1392 if (lpToneGen->mTotalSmp > lpToneGen->mNextSegSmp) { in audioCallback()
1400 if (lpToneDesc->segments[lpToneGen->mCurSegment].waveFreq[0] != 0) { in audioCallback()
1403 … uint16_t lFrequency = lpToneDesc->segments[lpToneGen->mCurSegment].waveFreq[lFreqIdx]; in audioCallback()
1406 WaveGenerator *lpWaveGen = lpToneGen->mWaveGens.valueFor(lFrequency); in audioCallback()
1408 lFrequency = lpToneDesc->segments[lpToneGen->mCurSegment].waveFreq[++lFreqIdx]; in audioCallback()
1414 if (lpToneDesc->segments[lpToneGen->mCurSegment].loopCnt) { in audioCallback()
1415 … if (lpToneGen->mLoopCounter < lpToneDesc->segments[lpToneGen->mCurSegment].loopCnt) { in audioCallback()
1417 lpToneDesc->segments[lpToneGen->mCurSegment].loopCnt, in audioCallback()
1418 lpToneGen->mLoopCounter, in audioCallback()
1419 lpToneGen->mCurSegment); in audioCallback()
1420 lpToneGen->mCurSegment = lpToneDesc->segments[lpToneGen->mCurSegment].loopIndx; in audioCallback()
1421 ++lpToneGen->mLoopCounter; in audioCallback()
1424 lpToneGen->mLoopCounter = 0; in audioCallback()
1425 lpToneGen->mCurSegment++; in audioCallback()
1427 lpToneDesc->segments[lpToneGen->mCurSegment].loopCnt, in audioCallback()
1428 lpToneGen->mLoopCounter, in audioCallback()
1429 lpToneGen->mCurSegment); in audioCallback()
1432 lpToneGen->mCurSegment++; in audioCallback()
1434 lpToneDesc->segments[lpToneGen->mCurSegment].loopCnt, in audioCallback()
1435 lpToneGen->mLoopCounter, in audioCallback()
1436 lpToneGen->mCurSegment); in audioCallback()
1441 if (lpToneDesc->segments[lpToneGen->mCurSegment].duration == 0) { in audioCallback()
1442 ALOGV("Last Seg: %d", lpToneGen->mCurSegment); in audioCallback()
1445 if (++lpToneGen->mCurCount <= lpToneDesc->repeatCnt) { in audioCallback()
1446 ALOGV("Repeating Count: %d", lpToneGen->mCurCount); in audioCallback()
1448 lpToneGen->mCurSegment = lpToneDesc->repeatSegment; in audioCallback()
1453 ALOGV("New segment %d, Next Time: %lld", lpToneGen->mCurSegment, in audioCallback()
1454 ((long long)(lpToneGen->mNextSegSmp)*1000)/lpToneGen->mSamplingRate); in audioCallback()
1462 ALOGV("New segment %d, Next Time: %lld", lpToneGen->mCurSegment, in audioCallback()
1463 ((long long)(lpToneGen->mNextSegSmp)*1000)/lpToneGen->mSamplingRate); in audioCallback()
1465 if (lpToneDesc->segments[lpToneGen->mCurSegment].waveFreq[0] != 0) { in audioCallback()
1476 lpToneGen->mNextSegSmp in audioCallback()
1477 … += (lpToneDesc->segments[lpToneGen->mCurSegment].duration * lpToneGen->mSamplingRate) / 1000; in audioCallback()
1481 if (lpToneDesc->segments[lpToneGen->mCurSegment].waveFreq[0] == 0) { in audioCallback()
1491 uint16_t lFrequency = lpToneDesc->segments[lpToneGen->mCurSegment].waveFreq[lFreqIdx]; in audioCallback()
1494 WaveGenerator *lpWaveGen = lpToneGen->mWaveGens.valueFor(lFrequency); in audioCallback()
1496 lFrequency = lpToneDesc->segments[lpToneGen->mCurSegment].waveFreq[++lFreqIdx]; in audioCallback()
1505 switch (lpToneGen->mState) { in audioCallback()
1508 if (lpToneGen->prepareWave()) { in audioCallback()
1509 lpToneGen->mState = TONE_STARTING; in audioCallback()
1510 if (clock_gettime(CLOCK_MONOTONIC, &lpToneGen->mStartTime) != 0) { in audioCallback()
1511 lpToneGen->mStartTime.tv_sec = 0; in audioCallback()
1514 lpToneDesc = lpToneGen->mpToneDesc; in audioCallback()
1517 lpToneGen->mState = TONE_IDLE; in audioCallback()
1518 lpToneGen->mpAudioTrack->stop(); in audioCallback()
1526 lpToneGen->mState = TONE_STOPPED; in audioCallback()
1531 lpToneGen->mState = TONE_INIT; in audioCallback()
1533 lpToneGen->mpAudioTrack->stop(); in audioCallback()
1541 lpToneGen->mState = TONE_PLAYING; in audioCallback()
1554 lpToneGen->mWaitCbkCond.broadcast(); in audioCallback()
1555 lpToneGen->mLock.unlock(); in audioCallback()