| 600 | } |
| 601 | |
| 602 | void Feedback360::EffectProc( void *params ) |
| 603 | { |
| 604 | Feedback360 *cThis = (Feedback360 *)params; |
| 605 | |
| 606 | LONG LeftLevel = 0; |
| 607 | LONG RightLevel = 0; |
| 608 | LONG Gain = cThis->Gain; |
| 609 | LONG CalcResult = 0; |
| 610 | |
| 611 | if (cThis->Actuator == true) |
| 612 | { |
| 613 | for (Feedback360EffectIterator effectIterator = cThis->EffectList.begin(); effectIterator != cThis->EffectList.end(); ++effectIterator) |
| 614 | { |
| 615 | if(((CurrentTimeUsingMach() - cThis->LastTime)*1000*1000) >= effectIterator->DiEffect.dwSamplePeriod) { |
| 616 | CalcResult = effectIterator->Calc(&LeftLevel, &RightLevel); |
| 617 | } |
| 618 | } |
| 619 | } |
| 620 | |
| 621 | if ((cThis->PrvLeftLevel != LeftLevel || cThis->PrvRightLevel != RightLevel) && (CalcResult != -1)) |
| 622 | { |
| 623 | //fprintf(stderr, "PL: %d, PR: %d; L: %d, R: %d; \n", cThis->PrvLeftLevel, cThis->PrvRightLevel, LeftLevel, RightLevel); |
| 624 | cThis->SetForce((unsigned char)min(SCALE_MAX, LeftLevel * Gain / 10000),(unsigned char)min(SCALE_MAX, RightLevel * Gain / 10000 )); |
| 625 | |
| 626 | cThis->PrvLeftLevel = LeftLevel; |
| 627 | cThis->PrvRightLevel = RightLevel; |
| 628 | } |
| 629 | } |
| 630 | |
| 631 | HRESULT Feedback360::GetEffectStatus(FFEffectDownloadID EffectHandle, FFEffectStatusFlag *Status) |
| 632 | { |
nothing calls this directly
no test coverage detected