MusicKit
0.0.0
|
00001 00002 // 00003 // CAudOutWO - Win32 WaveOut API version of CAudOut 00004 // 00005 // SKoT McDonald / Vellocet 00006 // skot@vellocet.ii.net 00007 // (c) 1999 Vellocet 00008 // All rights reserved. 00009 // 00010 // Last change: 14 July 1999 00011 // 00013 00014 #ifndef __VELLOCET_AUDOUTWO_H 00015 #define __VELLOCET_AUDOUTWO_H 00016 00017 #include "AudOut.h" 00018 00020 00021 class CAudOutWO : public CAudOut 00022 { 00023 // Members 00024 00025 private: 00026 // none 00027 00028 protected: 00029 HANDLE m_hNextAudio; 00030 DWORD m_dwCurBuffer; // current buffer to write to... 00031 DWORD m_dwPlaBuffer; // current buffer being played 00032 WAVEOUTCAPS *m_pWaveOutCaps; 00033 HWAVEOUT m_hwo; 00034 WAVEHDR *m_pwhdr; 00035 void **m_ppBuffer; 00036 00037 public: 00038 // none 00039 00040 // Methods 00041 00042 private: 00043 // none 00044 00045 protected: 00046 static void __cdecl AudioThread (void* pThis); 00047 bool Close (void); 00048 void DoNextBuffer (void); 00049 bool FreeBuffers (void); 00050 bool Open (short iDevID); 00051 bool ProcessMMReturn (MMRESULT r); 00052 00053 static void CALLBACK waveOutProc (HWAVEOUT hwo, UINT uMsg, 00054 DWORD dwInstance, 00055 DWORD dwParam1, DWORD dwParam2); 00056 00057 00058 public: 00059 CAudOutWO(); 00060 ~CAudOutWO(); 00061 00062 bool Initialise (void (*GenAudio)(float**, DWORD, DWORD, DWORD), 00063 DWORD dwGenAudioData); 00064 bool AllocateBuffers (DWORD dwNumBuffers, DWORD dwBufferSize); 00065 00066 char* GetDevName (DWORD n); 00067 00068 bool Start(void); 00069 00070 // Class access cheapy functions 00071 00072 WAVEOUTCAPS* GetCurDevCaps(void); 00073 00074 // Three utility functions can be used to help build 00075 // extended device info dialogs 00076 00077 bool GetCurDevManufacturer (char* text, long liLen); 00078 CString GetSupportsStr(void); 00079 CString GetFormatsStr(void); 00080 00081 // TODO: get rid of CString dependency 00082 }; 00083 00084 #endif 00085