MCPcopy Create free account
hub / github.com/HertzDevil/0CC-FamiTracker / SetupDevice

Method SetupDevice

Source/DirectSound.cpp:47–68  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

45}
46
47bool CDSound::SetupDevice(int iDevice)
48{
49 if (iDevice > (int)GetDeviceCount()) // // //
50 iDevice = 0;
51
52 if (m_lpDirectSound) {
53 m_lpDirectSound->Release();
54 m_lpDirectSound = NULL;
55 }
56
57 if (FAILED(DirectSoundCreate((LPCGUID)&devices_[iDevice].second, &m_lpDirectSound, NULL))) {
58 m_lpDirectSound = NULL;
59 return false;
60 }
61
62 if (m_hWndTarget != NULL && FAILED(m_lpDirectSound->SetCooperativeLevel(m_hWndTarget, DSSCL_PRIORITY))) { // // //
63 m_lpDirectSound = NULL;
64 return false;
65 }
66
67 return true;
68}
69
70void CDSound::CloseDevice()
71{

Callers 1

ResetAudioDeviceMethod · 0.80

Calls 1

ReleaseMethod · 0.45

Tested by

no test coverage detected