| 978 | // |
| 979 | |
| 980 | BOOL CSoundGen::InitInstance() |
| 981 | { |
| 982 | // |
| 983 | // Setup the sound player object, called when thread is started |
| 984 | // |
| 985 | |
| 986 | ASSERT(m_pDocument != NULL); |
| 987 | // ASSERT(m_pTrackerView != NULL); |
| 988 | |
| 989 | // First check if thread creation should be cancelled |
| 990 | // This will occur when no sound object is available |
| 991 | |
| 992 | if (m_pDSound == NULL) |
| 993 | return FALSE; |
| 994 | |
| 995 | // Set running flag |
| 996 | m_bRunning = true; |
| 997 | |
| 998 | if (!ResetAudioDevice()) { |
| 999 | TRACE(L"SoundGen: Failed to reset audio device!\n"); |
| 1000 | if (m_pVisualizerWnd != NULL) |
| 1001 | m_pVisualizerWnd->ReportAudioProblem(); |
| 1002 | } |
| 1003 | |
| 1004 | ResetAPU(); |
| 1005 | |
| 1006 | TRACE(L"SoundGen: Created thread (0x%04x)\n", m_nThreadID); |
| 1007 | |
| 1008 | SetThreadPriority(THREAD_PRIORITY_TIME_CRITICAL); |
| 1009 | |
| 1010 | m_iFrameCounter = 0; |
| 1011 | |
| 1012 | // SetupChannels(); |
| 1013 | |
| 1014 | return TRUE; |
| 1015 | } |
| 1016 | |
| 1017 | int CSoundGen::ExitInstance() |
| 1018 | { |
nothing calls this directly
no test coverage detected