Source code of Windows XP (NT5)
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

493 lines
21 KiB

  1. /*==========================================================================
  2. *
  3. * Copyright (C) 1999 Microsoft Corporation. All Rights Reserved.
  4. *
  5. * File: dvclientengine.h
  6. * Content: Definition of class for DirectXVoice Client
  7. *
  8. * History:
  9. * Date By Reason
  10. * ==== == ======
  11. * 07/06/99 rodtoll Created it
  12. * 07/21/99 rodtoll Added flags field to entity data
  13. * 07/26/99 rodtoll Updated to support IDirectXVoiceNotify interface
  14. * 08/25/99 rodtoll General Cleanup/Modifications to support new
  15. * compression sub-system.
  16. * 08/30/99 rodtoll Added additional members to handle connect/disconnect timeout
  17. * 08/31/99 rodtoll Added new handle for new disconnect procedure
  18. * 09/03/99 rodtoll Re-work of playback core to support mixing to multiple buffers
  19. * for 3d support.
  20. * Re-worked playback to use position instead of notifications
  21. * allows for simpler handling of high CPU and 3d support
  22. * Implemented CreateUserBuffer/DeleteUserBuffer
  23. * 09/14/99 rodtoll Added members to support new notify masks
  24. * rodtoll Added CheckShouldSendMessage
  25. * rodtoll Added SendPlayerLevels
  26. * rodtoll Updated initialize for new parameters
  27. * rodtoll Added SetNotifyMask function
  28. * 09/18/99 rodtoll Added HandleThreadError to be called when an internal thread dies.
  29. * 09/27/99 rodtoll Added playback volume control
  30. * rodtoll Added reduction of playback volume when transmitting
  31. * 09/28/99 rodtoll Double notifications of local client when host migrates fixed.
  32. * rodtoll Added queue for notifications, notifications are added to the queue and
  33. * then signalled by the notify thread. (Prevents problems caused by notify
  34. * handlers taking a long time to return).
  35. * 09/29/99 pnewson Major AGC overhaul
  36. * 10/19/99 rodtoll Fix: Bug #113904 Shutdown Issues
  37. * Added handler for SESSIONLOST messages
  38. * 10/29/99 rodtoll Bug #113726 - Integrate Voxware Codecs, updating to use new
  39. * pluggable codec architecture.
  40. * 11/12/99 rodtoll Updated to use new playback and record classes and remove
  41. * old playback/record system. (Includes new waveIn/waveOut support)
  42. * rodtoll Updated to support new recording thread
  43. * rodtoll Added new echo suppression code
  44. * 11/17/99 rodtoll Fix: Bug #117177 - Calling Connect w/o voice session never returns
  45. * 11/23/99 rodtoll Updated Initialize/SetNotifyMask so error checking behaviour is consistant
  46. * 12/16/99 rodtoll Bug #117405 - 3D Sound APIs misleading - 3d sound apis renamed
  47. * The Delete3DSoundBuffer was re-worked to match the create
  48. * rodtoll Bug #122629 - Host migration broken in unusual configurations
  49. * Implemented new host migration scheme
  50. * 01/10/00 pnewson AGC and VA tuning
  51. * 01/14/2000 rodtoll Updated for new Set/GetTransmit target parameters
  52. * rodtoll Updated to support multiple targets
  53. * rodtoll Updated for new notification queueing
  54. * rodtoll Added FPM for handling notification memory
  55. * 01/21/00 rodtoll Bug #128897 - Disconnect timeout broken
  56. * 01/24/2000 rodtoll Bug #129427: Calling Destroy3DSoundBuffer for player who has
  57. * already disconnected resulted in an incorrect DVERR_NOTBUFFERED
  58. * error code.
  59. * 01/27/2000 rodtoll Bug #129934 - Update Create3DSoundBuffer to take DSBUFFERDESC
  60. * 02/17/2000 rodtoll Bug #133691 - Choppy audio - queue was not adapting
  61. * Added instrumentation
  62. * 03/28/2000 rodtoll Re-wrote nametable handling and locking -- more scalable
  63. * 03/29/2000 rodtoll Bug #30957 - Made conversion quality setting optional
  64. * rodtoll Bug #30753 - Added volatile to the class definition
  65. * 04/07/2000 rodtoll Bug #32179 - Prevent registration of > 1 interface
  66. * rodtoll Updated to use no copy sends, so handles pooling frames to be sent, proper
  67. * pulling of frames from pools and returns.
  68. * 05/17/2000 rodtoll Bug #35110 Simultaneous playback of 2 voices results in distorted playback
  69. * 06/21/2000 rodtoll Bug #35767 - Implement ability for Dsound effects processing if dpvoice buffers
  70. * Updated Connect and Create3DSoundBuffer to take buffers instead of descriptions
  71. * rodtoll Bug #36820 - Host migrates to wrong client when server is shut down before host's client disconnects
  72. * Caused because client attempts to register new server when there is one already
  73. * rodtoll Bug #37045 - Race conditions prevent acknowledgement of new host
  74. * Added send when new host is elected of settingsconfirm message
  75. * 06/27/2000 rodtoll Fixed window where outstanding sends being returned after we have deregistered
  76. * Voice now waits for all outstanding voice sends to complete before shutting down
  77. * rodtoll Added COM abstraction
  78. * 07/09/2000 rodtoll Added signature bytes
  79. * 07/12/2000 rodtoll Bug #39117 - Access violation while running VoicePosition. Several issues:
  80. * - Allow Destroy3DBuffer during disconnect
  81. * - Move nametable cleanup to before freesoundbufferlist
  82. * - Fixed code so always remove from list on DeleteSoundTarget
  83. * - Removed unneeded logic
  84. * 07/22/20000 rodtoll Bug #40296, 38858 - Crashes due to shutdown race condition
  85. * Now ensures that all threads from transport have left and that
  86. * all notificatinos have been processed before shutdown is complete.
  87. * 11/16/2000 rodtoll Bug #40587 - DPVOICE: Mixing server needs to use multi-processors
  88. * 01/26/2001 rodtoll WINBUG #293197 - DPVOICE: [STRESS} Stress applications cannot tell difference between out of memory and internal errors.
  89. * Remap DSERR_OUTOFMEMORY to DVERR_OUTOFMEMORY instead of DVERR_SOUNDINITFAILURE.
  90. * Remap DSERR_ALLOCATED to DVERR_PLAYBACKSYSTEMERROR instead of DVERR_SOUNDINITFAILURE.
  91. * 04/06/2001 kareemc Added Voice Defense
  92. * 04/11/2001 rodtoll WINBUG #221494 DPVOICE: Capped the # of queued recording events to prevent multiple wakeups resulting in false lockup
  93. * detection
  94. *
  95. ***************************************************************************/
  96. #ifndef __DVCLIENTENGINE_H
  97. #define __DVCLIENTENGINE_H
  98. #define DVCSTATE_NOTINITIALIZED 0x00000000
  99. #define DVCSTATE_IDLE 0x00000001
  100. #define DVCSTATE_CONNECTING 0x00000002
  101. #define DVCSTATE_CONNECTED 0x00000003
  102. #define DVCSTATE_DISCONNECTING 0x00000004
  103. #define DVCECHOSTATE_IDLE 0x00000000
  104. #define DVCECHOSTATE_RECORDING 0x00000001
  105. #define DVCECHOSTATE_PLAYBACK 0x00000002
  106. struct DIRECTVOICECLIENTOBJECT;
  107. // Size in bytes of the fixed size elements
  108. #define DV_CLIENT_NOTIFY_ELEMENT_SIZE 16
  109. // Wakeup multiplier -- how many times / time we're supposed
  110. // to wakeup should we actually wake up
  111. #define DV_CLIENT_WAKEUP_MULTIPLER 4
  112. #if defined(DEBUG) || defined(DBG)
  113. #define CHECKLISTINTEGRITY CheckListIntegrity
  114. #else
  115. #define CHECKLISTINTEGRITY()
  116. #endif
  117. // CDirectVoiceClientEngine
  118. //
  119. // This class represents the IDirectXVoiceClient interface.
  120. //
  121. // The class is thread safe except for construction and
  122. // destruction. The class is protected with a Multiple-Reader
  123. // Single-Write lock.
  124. //
  125. #define VSIG_CLIENTENGINE 'ELCV'
  126. #define VSIG_CLIENTENGINE_FREE 'ELC_'
  127. //
  128. volatile class CDirectVoiceClientEngine: public CDirectVoiceEngine
  129. {
  130. protected:
  131. typedef enum { NOTIFY_FIXED, // Structure stored in fixed
  132. NOTIFY_DYNAMIC // Memory allocated in dynamic
  133. } ElementType;
  134. struct CNotifyElement
  135. {
  136. typedef VOID (*PNOTIFY_COMPLETE)(PVOID pvContext, CNotifyElement *pElement);
  137. DWORD m_dwType;
  138. union _Element
  139. {
  140. struct
  141. {
  142. LPVOID m_lpData;
  143. } dynamic;
  144. struct
  145. {
  146. BYTE m_bFixedHolder[DV_CLIENT_NOTIFY_ELEMENT_SIZE];
  147. } fixed;
  148. } m_element;
  149. DWORD m_dwDataSize;
  150. ElementType m_etElementType;
  151. PVOID pvContext;
  152. PNOTIFY_COMPLETE pNotifyFunc;
  153. CNotifyElement *m_lpNext;
  154. };
  155. struct TimerHandlerParam
  156. {
  157. HANDLE hPlaybackTimerEvent;
  158. volatile LONG lPlaybackCount;
  159. HANDLE hRecordTimerEvent;
  160. DNCRITICAL_SECTION csPlayCount;
  161. };
  162. public:
  163. CDirectVoiceClientEngine( DIRECTVOICECLIENTOBJECT *lpObject );
  164. ~CDirectVoiceClientEngine();
  165. public: // IDirectXVoiceClient Interface
  166. HRESULT Connect( LPDVSOUNDDEVICECONFIG lpSoundDeviceConfig, LPDVCLIENTCONFIG lpClientConfig, DWORD dwFlags );
  167. HRESULT Disconnect( DWORD dwFlags );
  168. HRESULT GetSessionDesc( LPDVSESSIONDESC lpSessionDescBuffer );
  169. HRESULT GetClientConfig( LPDVCLIENTCONFIG lpClientConfig );
  170. HRESULT SetClientConfig( LPDVCLIENTCONFIG lpClientConfig );
  171. HRESULT GetCaps( LPDVCAPS lpCaps );
  172. HRESULT GetCompressionTypes( LPVOID lpBuffer, LPDWORD lpdwSize, LPDWORD lpdwNumElements, DWORD dwFlags );
  173. HRESULT SetTransmitTarget( PDVID dvidTarget, DWORD dwNumTargets, DWORD dwFlags );
  174. HRESULT GetTransmitTarget( LPDVID lpdvidTargets, PDWORD pdwNumElements, DWORD dwFlags );
  175. HRESULT Create3DSoundBuffer( DVID dvidID, LPDIRECTSOUNDBUFFER lpdsBufferDesc, DWORD dwPriority, DWORD dwFlags, LPDIRECTSOUND3DBUFFER *lpBuffer );
  176. HRESULT Delete3DSoundBuffer( DVID dvidID, LPDIRECTSOUND3DBUFFER *lpBuffer );
  177. HRESULT SetNotifyMask( LPDWORD lpdwMessages, DWORD dwNumElements );
  178. HRESULT GetSoundDeviceConfig( PDVSOUNDDEVICECONFIG pSoundDeviceConfig, PDWORD pdwBufferSize );
  179. public: // CDirectVoiceEngine Members
  180. HRESULT Initialize( CDirectVoiceTransport *lpTransport, LPDVMESSAGEHANDLER lpdvHandler, LPVOID lpUserContext, LPDWORD lpdwMessages, DWORD dwNumElements );
  181. BOOL ReceiveSpeechMessage( DVID dvidSource, LPVOID lpMessage, DWORD dwSize );
  182. HRESULT StartTransportSession();
  183. HRESULT StopTransportSession();
  184. HRESULT AddPlayer( DVID dvID );
  185. HRESULT RemovePlayer( DVID dvID );
  186. HRESULT CreateGroup( DVID dvID );
  187. HRESULT DeleteGroup( DVID dvID );
  188. HRESULT AddPlayerToGroup( DVID dvidGroup, DVID dvidPlayer );
  189. HRESULT RemovePlayerFromGroup( DVID dvidGroup, DVID dvidPlayer );
  190. HRESULT MigrateHost( DVID dvidNewHost, LPDIRECTPLAYVOICESERVER lpdvServer );
  191. HRESULT MigrateHost_RunElection();
  192. inline DWORD GetCurrentState() { return m_dwCurrentState; };
  193. BOOL InitClass();
  194. public: // packet validation
  195. inline BOOL ValidateSessionType( DWORD dwSessionType );
  196. inline BOOL ValidateSessionFlags( DWORD dwFlags );
  197. inline BOOL ValidatePlayerFlags( DWORD dwFlags );
  198. inline BOOL ValidatePlayerDVID( DVID dvid );
  199. inline BOOL ValidatePacketType( PDVPROTOCOLMSG_FULLMESSAGE lpdvFullMessage );
  200. protected: // Message handlers
  201. HRESULT InternalSetNotifyMask( LPDWORD lpdwMessages, DWORD dwNumElements );
  202. BOOL QueueSpeech( DVID dvidSource, PDVPROTOCOLMSG_SPEECHHEADER pdvSpeechHeader, PBYTE pbData, DWORD dwSize );
  203. BOOL HandleConnectRefuse( DVID dvidSource, PDVPROTOCOLMSG_CONNECTREFUSE lpdvConnectRefuse, DWORD dwSize );
  204. BOOL HandleCreateVoicePlayer( DVID dvidSource, PDVPROTOCOLMSG_PLAYERJOIN lpdvCreatePlayer, DWORD dwSize );
  205. BOOL HandleDeleteVoicePlayer( DVID dvidSource, PDVPROTOCOLMSG_PLAYERQUIT lpdvDeletePlayer, DWORD dwSize );
  206. BOOL HandleSpeech( DVID dvidSource, PDVPROTOCOLMSG_SPEECHHEADER lpdvSpeech, DWORD dwSize );
  207. BOOL HandleSpeechWithFrom( DVID dvidSource, PDVPROTOCOLMSG_SPEECHWITHFROM lpdvSpeech, DWORD dwSize );
  208. BOOL HandleSpeechBounce( DVID dvidSource, PDVPROTOCOLMSG_SPEECHHEADER lpdvSpeech, DWORD dwSize );
  209. BOOL HandleConnectAccept( DVID dvidSource, PDVPROTOCOLMSG_CONNECTACCEPT lpdvConnectAccept, DWORD dwSize );
  210. BOOL HandleDisconnectConfirm( DVID dvidSource, PDVPROTOCOLMSG_DISCONNECT lpdvDisconnect, DWORD dwSize );
  211. BOOL HandleSetTarget( DVID dvidSource, PDVPROTOCOLMSG_SETTARGET lpdvSetTarget, DWORD dwSize );
  212. BOOL HandleSessionLost( DVID dvidSource, PDVPROTOCOLMSG_SESSIONLOST lpdvSessionLost, DWORD dwSize );
  213. BOOL HandlePlayerList( DVID dvidSource, PDVPROTOCOLMSG_PLAYERLIST lpdvPlayerList, DWORD dwSize );
  214. BOOL HandleHostMigrated( DVID dvidSource, PDVPROTOCOLMSG_HOSTMIGRATED lpdvHostMigrated, DWORD dwSize );
  215. BOOL HandleHostMigrateLeave( DVID dvidSource, PDVPROTOCOLMSG_HOSTMIGRATELEAVE lpdvHostMigrateLeave, DWORD dwSize );
  216. friend class CClientRecordSubSystem;
  217. protected:
  218. void CheckListIntegrity();
  219. void DoSessionLost(HRESULT hrReason);
  220. void DoSignalDisconnect(HRESULT hrDisconnectReason);
  221. void HandleThreadError( HRESULT hrResult );
  222. // Actually send the message to the client app
  223. void TransmitMessage( DWORD dwMessageType, LPVOID lpData, DWORD dwSize );
  224. void Cleanup();
  225. void DoDisconnect();
  226. void DoConnectResponse();
  227. void WaitForBufferReturns();
  228. void SetCurrentState( DWORD dwState );
  229. HRESULT InitializeSoundSystem();
  230. HRESULT ShutdownSoundSystem();
  231. HRESULT CheckForDuplicateObjects();
  232. HRESULT HandleLocalHostMigrateCreate();
  233. void SetConnectResult( HRESULT hrOriginalResult );
  234. HRESULT GetConnectResult();
  235. void SetupPlaybackBufferDesc( LPDSBUFFERDESC lpdsBufferDesc, LPDSBUFFERDESC lpdsBufferSource );
  236. HRESULT InitializeClientServer();
  237. void DeInitializeClientServer();
  238. void CheckForUserTimeout( DWORD dwCurTime );
  239. void SendPlayerLevels();
  240. BOOL CheckShouldSendMessage( DWORD dwMessageType );
  241. HRESULT CreateGeneralBuffer( );
  242. void UpdateActivePlayPendingList();
  243. void UpdateActiveNotifyPendingList();
  244. void CleanupNotifyLists();
  245. void CleanupPlaybackLists();
  246. static void __cdecl RecordThread( void *lpParam );
  247. static void __cdecl PlaybackThread( void *lpParam );
  248. static void __cdecl NotifyThread( void *lpParam );
  249. static BOOL MixingWakeupProc( DWORD_PTR param );
  250. static PVOID ClientBufferAlloc( void *const pv, const DWORD dwSize );
  251. static void ClientBufferFree( void *const pv, void *const pvBuffer );
  252. PDVTRANSPORT_BUFFERDESC GetTransmitBuffer( DWORD dwSize, LPVOID *ppvContext );
  253. HRESULT SendComplete( PDVEVENTMSG_SENDCOMPLETE pSendComplete );
  254. void ReturnTransmitBuffer( PVOID pvContext );
  255. HRESULT Send_ConnectRequest();
  256. HRESULT Send_DisconnectRequest();
  257. HRESULT Send_SessionLost();
  258. HRESULT Send_SettingsConfirm();
  259. HRESULT SetPlaybackVolume( LONG lVolume );
  260. DWORD m_dwSignature;
  261. CFramePool *m_lpFramePool; // Pool of frames
  262. CDirectVoiceTransport *m_lpSessionTransport; // Transport for the session
  263. DVSOUNDDEVICECONFIG m_dvSoundDeviceConfig; // Sound device config
  264. DVCLIENTCONFIG m_dvClientConfig; // Sound general config
  265. DVSESSIONDESC m_dvSessionDesc; // Session configuration
  266. DVCAPS m_dvCaps; // Caps
  267. LPDVMESSAGEHANDLER m_lpMessageHandler; // User message handler
  268. LPVOID m_lpUserContext; // User context for message handler
  269. DVID m_dvidServer; // DVID of the server
  270. PDVID m_pdvidTargets; // DVID of the current target(s) (Protected by m_csTargetLock)
  271. DWORD m_dwNumTargets; // # of targets (Protected by m_csTargetLock)
  272. DWORD m_dwTargetVersion; // Increment each time targets are changed
  273. DNCRITICAL_SECTION m_csTargetLock; // If you need write/read lock, always take it before this lock
  274. HRESULT InternalSetTransmitTarget( PDVID pdvidTargets, DWORD dwNumTargets );
  275. HRESULT CheckForAndRemoveTarget( DVID dvidID );
  276. volatile DWORD m_dwCurrentState; // Current engine state
  277. CFrame *m_tmpFrame; // Tmp frame for receiving
  278. LPDIRECTPLAYVOICESERVER m_lpdvServerMigrated; // Stores reference to migrated host
  279. DWORD m_dwActiveCount;
  280. DWORD m_dwEchoState;
  281. DNCRITICAL_SECTION m_lockPlaybackMode;
  282. DNCRITICAL_SECTION m_csCleanupProtect; // Used to ensure only only cleanup instance is active
  283. protected: // Buffer maintenance
  284. HRESULT AddSoundTarget( CSoundTarget *lpcsTarget );
  285. HRESULT DeleteSoundTarget( DVID dvidID );
  286. HRESULT FindSoundTarget( DVID dvidID, CSoundTarget **lpcsTarget );
  287. HRESULT InitSoundTargetList();
  288. HRESULT FreeSoundTargetList();
  289. protected: // Notification queue
  290. // Queue up a notification for the user
  291. HRESULT NotifyQueue_Add( DWORD dwMessageType, LPVOID lpData, DWORD dwDataSize, PVOID pvContext = NULL, CNotifyElement::PNOTIFY_COMPLETE pNotifyFunc = NULL );
  292. HRESULT NotifyQueue_Get( CNotifyElement **pneElement );
  293. HRESULT NotifyQueue_Init();
  294. HRESULT NotifyQueue_Free();
  295. HRESULT NotifyQueue_ElementFree( CNotifyElement *lpElement );
  296. HRESULT NotifyQueue_IndicateNext();
  297. void NotifyQueue_Disable();
  298. void NotifyQueue_Enable();
  299. void NotifyQueue_Flush();
  300. static void NotifyComplete_SyncWait( PVOID pvContext, CNotifyElement *pElement );
  301. static void NotifyComplete_LocalPlayer( PVOID pvContext, CNotifyElement *pElement );
  302. static void NotifyComplete_RemotePlayer( PVOID pvContext, CNotifyElement *pElement );
  303. DNCRITICAL_SECTION m_csNotifyQueueLock; // Notification queue
  304. BOOL m_fNotifyQueueEnabled;
  305. CNotifyElement *m_lpNotifyList; // List of notifications
  306. HANDLE m_hNewNotifyElement; // Semaphore signalled when new event is queued
  307. HRESULT SendConnectResult();
  308. HRESULT SendDisconnectResult();
  309. protected:
  310. HRESULT SetupInitialBuffers();
  311. HRESULT SetupSpeechBuffer();
  312. HRESULT FreeBuffers();
  313. protected: // Statistics
  314. void ClientStats_Reset();
  315. void ClientStats_Begin();
  316. void ClientStats_End();
  317. void ClientStats_Dump();
  318. void ClientStats_Dump_Record();
  319. void ClientStats_Dump_Playback();
  320. void ClientStats_Dump_Receive();
  321. void ClientStats_Dump_Transmit();
  322. ClientStatistics m_stats;
  323. ClientStatistics *m_pStatsBlob;
  324. protected: // Sound System Information
  325. CAudioPlaybackBuffer *m_audioPlaybackBuffer; // Audio playback buffer
  326. CAudioRecordDevice *m_audioRecordDevice; // Audio record device
  327. CAudioPlaybackDevice *m_audioPlaybackDevice; // Audio Playback Device
  328. CAudioRecordBuffer *m_audioRecordBuffer; // Audio Record Buffer;
  329. HANDLE m_hNotifyDone; // Signalled when notify thread dies
  330. HANDLE m_hNotifyTerminate; // Signalled to terminate notify thread
  331. HANDLE m_hNotifyChange; // Signalled when notification interval changes
  332. HANDLE m_hRecordDone; // Record thread done signal
  333. HANDLE m_hRecordTerminate; // Record thread stop signal
  334. HANDLE m_hPlaybackDone; // Playback thread done signal
  335. HANDLE m_hPlaybackTerminate; // Playback thread terminate signal
  336. HANDLE m_hConnectAck; // Signalled when connect complete
  337. HANDLE m_hDisconnectAck; // Signalled when disconnect complete
  338. HRESULT m_hrDisconnectResult; // Result of the disconnect result
  339. HRESULT m_hrConnectResult; // Result of the connection request
  340. HRESULT m_hrOriginalConnectResult; // Original Connect Result (Untranslated)
  341. DVID m_dvidLocal; // Local DVID
  342. DNCRITICAL_SECTION m_csClassLock;
  343. BOOL m_fCritSecInited;
  344. protected:
  345. // Compression Control Data
  346. LPDVFULLCOMPRESSIONINFO m_lpdvfCompressionInfo; // Information about current compression type
  347. // Memory pointed to is owned by dvcdb.cpp
  348. DWORD m_dwCompressedFrameSize;
  349. // Size of a compressed frame
  350. DWORD m_dwUnCompressedFrameSize;
  351. // Size of an uncompressed frame
  352. DWORD m_dwNumPerBuffer; // # of frames / directsound buffer
  353. CFramePool *m_pFramePool; // Frame pool
  354. DIRECTVOICECLIENTOBJECT *m_lpObject; // Cached pointer to the COM interface
  355. DWORD m_dwSynchBegin; // GetTickCount at Connect/Disconnect start
  356. HANDLE m_hNotifySynch; // Notified when connect/disconnect completes
  357. HANDLE m_hNotifyDisconnect; // Signalled
  358. HANDLE m_hNotifyConnect; // Connect
  359. HANDLE m_hRecordThreadHandle;
  360. HANDLE m_hPlaybackThreadHandle;
  361. DNCRITICAL_SECTION m_csBufferLock; // Lock to protect playback mixing buffers
  362. CSoundTarget *m_lpstBufferList; // Other Playback Mixing Buffers
  363. CSoundTarget *m_lpstGeneralBuffer; // General Playback Mixing Buffer
  364. LPDWORD m_lpdwMessageElements; // Buffer with notifiers
  365. DWORD m_dwNumMessageElements; // Number of notifiers
  366. DNCRITICAL_SECTION m_csNotifyLock; // Lock on list of notifiers
  367. DSBUFFERDESC m_dsBufferDesc;
  368. TimerHandlerParam m_thTimerInfo;
  369. Timer *m_pTimer;
  370. DWORD m_dwLastConnectSent;
  371. DWORD m_dwHostOrderID;
  372. DWORD m_dwMigrateHostOrderID; // Host Order ID of current host
  373. PVOID m_pvLocalPlayerContext;
  374. DIRECTSOUNDMIXER_SRCQUALITY m_dwOriginalRecordQuality;
  375. DIRECTSOUNDMIXER_SRCQUALITY m_dwOriginalPlayQuality;
  376. PFPOOL m_pfpNotifications; // Frame pool for notifications
  377. BYTE m_bLastPeak; // Last frame peak
  378. BYTE m_bLastPlaybackPeak; // Last peak on playback
  379. BYTE m_bMsgNum; // Last msg # transmitted
  380. BYTE m_bSeqNum; // Last sequence # transmitted
  381. BOOL m_bLastTransmitted; // Was last frame sent?
  382. BOOL m_fSessionLost; // Flag indicating session was lost
  383. BOOL m_fLocalPlayerNotify; // Has notification been sent for local player
  384. BOOL m_fLocalPlayerAvailable;
  385. BOOL m_fConnectAsync; // Are we connecting async?
  386. BOOL m_fDisconnectAsync; // Are we disconnecting async?
  387. CVoiceNameTable m_voiceNameTable;
  388. DWORD m_dwPlayActiveCount;
  389. BILINK m_blPlayActivePlayers;
  390. BILINK m_blPlayAddPlayers;
  391. DNCRITICAL_SECTION m_csPlayAddList;
  392. BILINK m_blNotifyActivePlayers;
  393. BILINK m_blNotifyAddPlayers;
  394. DNCRITICAL_SECTION m_csNotifyAddList;
  395. CLockedFixedPool<CVoicePlayer> m_fpPlayers;
  396. DNCRITICAL_SECTION m_csTransmitBufferLock;
  397. PFPOOL m_pBufferDescPool;
  398. PFPOOL *m_pBufferPools;
  399. DWORD *m_pdwBufferPoolSizes;
  400. DWORD m_dwNumPools;
  401. PERF_APPLICATION m_perfInfo; // Perf info entry for this object
  402. PERF_APPLICATION_INFO m_perfAppInfo;
  403. };
  404. #endif