MCPcopy Create free account
hub / github.com/AppleWin/AppleWin / Init

Method Init

source/MockingboardCardManager.cpp:284–306  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

282}
283
284bool 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
308UINT MockingboardCardManager::GenerateAllSoundData(void)
309{

Callers

nothing calls this directly

Calls 5

DSAvailableFunction · 0.85
DSGetSoundBufferFunction · 0.85
LogFileOutputFunction · 0.85
DSZeroVoiceBufferFunction · 0.85
SetVolumeMethod · 0.45

Tested by

no test coverage detected