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.

118 lines
2.9 KiB

  1. //---------------------------------------------------------------------------
  2. //
  3. // Module: pni.h
  4. //
  5. // Description: Pin Node Instance Class
  6. //
  7. //
  8. //@@BEGIN_MSINTERNAL
  9. // Development Team:
  10. // Mike McLaughlin
  11. //
  12. // History: Date Author Comment
  13. //
  14. //@@END_MSINTERNAL
  15. //---------------------------------------------------------------------------
  16. //
  17. // THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY
  18. // KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
  19. // IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR
  20. // PURPOSE.
  21. //
  22. // Copyright (c) 1996-1999 Microsoft Corporation. All Rights Reserved.
  23. //
  24. //---------------------------------------------------------------------------
  25. //---------------------------------------------------------------------------
  26. // Constants and Macros
  27. //---------------------------------------------------------------------------
  28. #define SETSTATE_FLAG_IGNORE_ERROR 0x00000001
  29. #define SETSTATE_FLAG_SINK 0x00000002
  30. #define SETSTATE_FLAG_SOURCE 0x00000004
  31. #define MAX_STATES (KSSTATE_RUN+1)
  32. // Enable temp fix for LEAKING the last portion of previous sound.
  33. #define FIX_SOUND_LEAK 1
  34. //---------------------------------------------------------------------------
  35. // Classes
  36. //---------------------------------------------------------------------------
  37. #ifdef DEBUG
  38. typedef class CPinNodeInstance : public CListMultiItem
  39. #else
  40. typedef class CPinNodeInstance : public CObj
  41. #endif
  42. {
  43. private:
  44. ~CPinNodeInstance(
  45. );
  46. public:
  47. static NTSTATUS
  48. Create(
  49. PPIN_NODE_INSTANCE *ppPinNodeInstance,
  50. PFILTER_NODE_INSTANCE pFilterNodeInstance,
  51. PPIN_NODE pPinNode,
  52. PKSPIN_CONNECT pPinConnect,
  53. BOOL fRender
  54. #ifdef FIX_SOUND_LEAK
  55. ,BOOL fDirectConnection
  56. #endif
  57. );
  58. VOID
  59. Destroy(
  60. )
  61. {
  62. if(this != NULL) {
  63. Assert(this);
  64. delete this;
  65. }
  66. };
  67. NTSTATUS
  68. SetState(
  69. KSSTATE NewState,
  70. KSSTATE PreviousState,
  71. ULONG ulFlags
  72. );
  73. #ifdef DEBUG
  74. ENUMFUNC Dump();
  75. #endif
  76. PPIN_NODE pPinNode;
  77. PFILE_OBJECT pFileObject;
  78. HANDLE hPin;
  79. private:
  80. KSSTATE CurrentState;
  81. int cState[MAX_STATES];
  82. PFILTER_NODE_INSTANCE pFilterNodeInstance;
  83. BOOL fRender;
  84. #ifdef FIX_SOUND_LEAK
  85. BOOL fDirectConnection;
  86. BOOL ForceRun;
  87. #endif
  88. public:
  89. DefineSignature(0x20494E50); // PNI
  90. } PIN_NODE_INSTANCE, *PPIN_NODE_INSTANCE;
  91. //---------------------------------------------------------------------------
  92. #ifdef DEBUG
  93. typedef ListMulti<PIN_NODE_INSTANCE> LIST_PIN_NODE_INSTANCE;
  94. typedef LIST_PIN_NODE_INSTANCE *PLIST_PIN_NODE_INSTANCE;
  95. //---------------------------------------------------------------------------
  96. // Globals
  97. //---------------------------------------------------------------------------
  98. extern PLIST_PIN_NODE_INSTANCE gplstPinNodeInstance;
  99. #endif