| 391 | } |
| 392 | |
| 393 | ResMusic::BGMWrapper::BGMWrapper(fcyRefPointer<f2dSoundDecoder> pOrg, fDouble LoopStart, fDouble LoopEnd) |
| 394 | : m_pDecoder(pOrg) |
| 395 | { |
| 396 | LASSERT(pOrg); |
| 397 | |
| 398 | // ������� |
| 399 | m_TotalSample = m_pDecoder->GetBufferSize() / m_pDecoder->GetBlockAlign(); |
| 400 | |
| 401 | if (LoopStart < 0) |
| 402 | LoopStart = 0; |
| 403 | m_pLoopStartSample = (fuInt)(LoopStart * m_pDecoder->GetSamplesPerSec()); |
| 404 | |
| 405 | if (LoopEnd <= 0) |
| 406 | m_pLoopEndSample = m_TotalSample; |
| 407 | else |
| 408 | m_pLoopEndSample = min(m_TotalSample, (fuInt)(LoopEnd * m_pDecoder->GetSamplesPerSec())); |
| 409 | |
| 410 | if (m_pLoopEndSample < m_pLoopStartSample) |
| 411 | std::swap(m_pLoopStartSample, m_pLoopEndSample); |
| 412 | |
| 413 | if (m_pLoopEndSample == m_pLoopStartSample) |
| 414 | throw fcyException("ResMusic::BGMWrapper::BGMWrapper", "Invalid loop period."); |
| 415 | } |
| 416 | |
| 417 | //////////////////////////////////////////////////////////////////////////////// |
| 418 | /// ResFX |
nothing calls this directly
no test coverage detected