| 282 | } |
| 283 | |
| 284 | bool MockingboardCardManager::Init(void) |
| 285 | { |
| 286 | if (!DSAvailable()) |
| 287 | return false; |
| 288 | |
| 289 | HRESULT hr = DSGetSoundBuffer(&m_mockingboardVoice, SOUNDBUFFER_SIZE, MockingboardCard::SAMPLE_RATE, MockingboardCard::NUM_MB_CHANNELS, "MB"); |
| 290 | LogFileOutput("MBCardMgr: DSGetSoundBuffer(), hr=0x%08X\n", hr); |
| 291 | if (FAILED(hr)) |
| 292 | { |
| 293 | LogFileOutput("MBCardMgr: DSGetSoundBuffer failed (%08X)\n", hr); |
| 294 | return false; |
| 295 | } |
| 296 | |
| 297 | bool bRes = DSZeroVoiceBuffer(&m_mockingboardVoice, SOUNDBUFFER_SIZE); // ... and Play() |
| 298 | LogFileOutput("MBCardMgr: DSZeroVoiceBuffer(), res=%d\n", bRes ? 1 : 0); |
| 299 | if (!bRes) |
| 300 | return false; |
| 301 | |
| 302 | hr = m_mockingboardVoice.lpDSBvoice->SetVolume(m_mockingboardVoice.nVolume); |
| 303 | LogFileOutput("MBCardMgr: SetVolume(), hr=0x%08X\n", hr); |
| 304 | |
| 305 | return true; |
| 306 | } |
| 307 | |
| 308 | UINT MockingboardCardManager::GenerateAllSoundData(void) |
| 309 | { |
nothing calls this directly
no test coverage detected