Leaked source code of windows server 2003
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.

225 lines
6.5 KiB

  1. /////////////////////////////////////////////////////////////////////////////////////
  2. // DVBTLocatorimpl.h : implementation helper template for ATSClocator interface
  3. // Copyright (c) Microsoft Corporation 2000.
  4. #ifndef DVBTLOCATORIMPL_H
  5. #define DVBTLOCATORIMPL_H
  6. #include <locatorimpl.h>
  7. namespace BDATuningModel {
  8. template<class T,
  9. class MostDerived = IDVBTLocator,
  10. LPCGUID iid = &__uuidof(MostDerived),
  11. LPCGUID LibID = &LIBID_TunerLib,
  12. WORD wMajor = 1,
  13. WORD wMinor = 0,
  14. class tihclass = CComTypeInfoHolder
  15. > class ATL_NO_VTABLE IDVBTLocatorImpl :
  16. public ILocatorImpl<T, MostDerived, iid, LibID, wMajor, wMinor, tihclass>
  17. {
  18. // IDVBTLocator
  19. public:
  20. typedef ILocatorImpl<T, MostDerived, iid, LibID, wMajor, wMinor, tihclass> basetype;
  21. typedef IDVBTLocatorImpl<T, MostDerived, iid, LibID, wMajor, wMinor, tihclass> thistype;
  22. IDVBTLocatorImpl() : m_Bandwidth(-1),
  23. m_LPInnerFECMethod(BDA_FEC_METHOD_NOT_SET),
  24. m_LPInnerFECRate(BDA_BCC_RATE_NOT_SET),
  25. m_HAlpha(BDA_HALPHA_NOT_SET),
  26. m_GuardInterval(BDA_GUARD_NOT_SET),
  27. m_XmitMode(BDA_XMIT_MODE_NOT_SET),
  28. m_OtherFreqInUse(VARIANT_FALSE) {}
  29. virtual ~IDVBTLocatorImpl() {}
  30. long m_Bandwidth;
  31. FECMethod m_LPInnerFECMethod;
  32. BinaryConvolutionCodeRate m_LPInnerFECRate;
  33. HierarchyAlpha m_HAlpha;
  34. GuardInterval m_GuardInterval;
  35. TransmissionMode m_XmitMode;
  36. VARIANT_BOOL m_OtherFreqInUse;
  37. BEGIN_PROP_MAP(thistype)
  38. CHAIN_PROP_MAP(basetype)
  39. PROP_DATA_ENTRY("Bandwidth", m_Bandwidth, VT_I4)
  40. PROP_DATA_ENTRY("LPInnerFECMethod", m_LPInnerFECMethod, VT_I4)
  41. PROP_DATA_ENTRY("LPInnerFECRate", m_LPInnerFECRate, VT_I4)
  42. PROP_DATA_ENTRY("HierarchyAlpha", m_HAlpha, VT_I4)
  43. PROP_DATA_ENTRY("GuardInterval", m_GuardInterval, VT_I4)
  44. PROP_DATA_ENTRY("TransmissionMode", m_XmitMode, VT_I4)
  45. PROP_DATA_ENTRY("OtherFrequencyInUse", m_OtherFreqInUse, VT_BOOL)
  46. END_PROP_MAP()
  47. // IDVBTLocator
  48. public:
  49. STDMETHOD(get_Bandwidth)(/*[out, retval]*/ long *pBandwidth) {
  50. try {
  51. if (!pBandwidth) {
  52. return E_POINTER;
  53. }
  54. ATL_LOCKT();
  55. *pBandwidth = m_Bandwidth;
  56. return NOERROR;
  57. } catch (...) {
  58. return E_POINTER;
  59. }
  60. }
  61. STDMETHOD(put_Bandwidth)(/*[in]*/ long NewBandwidth) {
  62. ATL_LOCKT();
  63. m_Bandwidth = NewBandwidth;
  64. MARK_DIRTY(T);
  65. return NOERROR;
  66. }
  67. STDMETHOD(get_LPInnerFEC)(/*[out, retval]*/ FECMethod *pLPInnerFECMethod) {
  68. try {
  69. if (!pLPInnerFECMethod) {
  70. return E_POINTER;
  71. }
  72. ATL_LOCKT();
  73. *pLPInnerFECMethod = m_LPInnerFECMethod;
  74. return NOERROR;
  75. } catch (...) {
  76. return E_POINTER;
  77. }
  78. }
  79. STDMETHOD(put_LPInnerFEC)(/*[in]*/ FECMethod NewLPInnerFECMethod) {
  80. ATL_LOCKT();
  81. m_LPInnerFECMethod = NewLPInnerFECMethod;
  82. MARK_DIRTY(T);
  83. return NOERROR;
  84. }
  85. STDMETHOD(get_LPInnerFECRate)(/*[out, retval]*/ BinaryConvolutionCodeRate *pLPInnerFECRate) {
  86. try {
  87. if (!pLPInnerFECRate) {
  88. return E_POINTER;
  89. }
  90. ATL_LOCKT();
  91. *pLPInnerFECRate = m_LPInnerFECRate;
  92. return NOERROR;
  93. } catch (...) {
  94. return E_POINTER;
  95. }
  96. }
  97. STDMETHOD(put_LPInnerFECRate)(/*[in]*/ BinaryConvolutionCodeRate NewLPInnerFECRate) {
  98. ATL_LOCKT();
  99. m_LPInnerFECRate = NewLPInnerFECRate;
  100. MARK_DIRTY(T);
  101. return NOERROR;
  102. }
  103. STDMETHOD(get_HAlpha)(/*[out, retval]*/ HierarchyAlpha *pHierarchyAlpha) {
  104. try {
  105. if (!pHierarchyAlpha) {
  106. return E_POINTER;
  107. }
  108. ATL_LOCKT();
  109. *pHierarchyAlpha = m_HAlpha;
  110. return NOERROR;
  111. } catch (...) {
  112. return E_POINTER;
  113. }
  114. }
  115. STDMETHOD(put_HAlpha)(/*[in]*/ HierarchyAlpha NewHierarchyAlpha) {
  116. ATL_LOCKT();
  117. m_HAlpha = NewHierarchyAlpha;
  118. MARK_DIRTY(T);
  119. return NOERROR;
  120. }
  121. STDMETHOD(get_Guard)(/*[out, retval]*/ GuardInterval *pGuardInterval) {
  122. try {
  123. if (!pGuardInterval) {
  124. return E_POINTER;
  125. }
  126. ATL_LOCKT();
  127. *pGuardInterval = m_GuardInterval;
  128. return NOERROR;
  129. } catch (...) {
  130. return E_POINTER;
  131. }
  132. }
  133. STDMETHOD(put_Guard)(/*[in]*/ GuardInterval NewGuardInterval) {
  134. ATL_LOCKT();
  135. m_GuardInterval = NewGuardInterval;
  136. MARK_DIRTY(T);
  137. return NOERROR;
  138. }
  139. STDMETHOD(get_Mode)(/*[out, retval]*/ TransmissionMode *pTransmissionMode) {
  140. try {
  141. if (!pTransmissionMode) {
  142. return E_POINTER;
  143. }
  144. ATL_LOCKT();
  145. *pTransmissionMode = m_XmitMode;
  146. return NOERROR;
  147. } catch (...) {
  148. return E_POINTER;
  149. }
  150. }
  151. STDMETHOD(put_Mode)(/*[in]*/ TransmissionMode NewTransmissionMode) {
  152. ATL_LOCKT();
  153. m_XmitMode = NewTransmissionMode;
  154. MARK_DIRTY(T);
  155. return NOERROR;
  156. }
  157. STDMETHOD(get_OtherFrequencyInUse)(/*[out, retval]*/ VARIANT_BOOL *pOtherFrequencyInUse) {
  158. try {
  159. if (!pOtherFrequencyInUse) {
  160. return E_POINTER;
  161. }
  162. ATL_LOCKT();
  163. *pOtherFrequencyInUse = m_OtherFreqInUse;
  164. return NOERROR;
  165. } catch (...) {
  166. return E_POINTER;
  167. }
  168. }
  169. STDMETHOD(put_OtherFrequencyInUse)(/*[in]*/ VARIANT_BOOL NewOtherFrequencyInUse) {
  170. ATL_LOCKT();
  171. m_OtherFreqInUse = NewOtherFrequencyInUse;
  172. MARK_DIRTY(T);
  173. return NOERROR;
  174. }
  175. STDMETHOD(Clone) (ILocator **ppNew) {
  176. try {
  177. if (!ppNew) {
  178. return E_POINTER;
  179. }
  180. ATL_LOCKT();
  181. HRESULT hr = basetype::Clone(ppNew);
  182. if (FAILED(hr)) {
  183. return hr;
  184. }
  185. T* pt = static_cast<T*>(*ppNew);
  186. pt->m_Bandwidth = m_Bandwidth;
  187. pt->m_LPInnerFECMethod = m_LPInnerFECMethod;;
  188. pt->m_LPInnerFECRate = m_LPInnerFECRate;
  189. pt->m_HAlpha = m_HAlpha;
  190. pt->m_GuardInterval = m_GuardInterval;
  191. pt->m_XmitMode = m_XmitMode;
  192. pt->m_OtherFreqInUse = m_OtherFreqInUse;
  193. return NOERROR;
  194. } catch (HRESULT h) {
  195. return h;
  196. } catch (...) {
  197. return E_POINTER;
  198. }
  199. }
  200. };
  201. typedef CComQIPtr<IDVBTLocator> PQDVBTLocator;
  202. }; // namespace
  203. #endif // DVBTLOCATORIMPL_H
  204. // end of file -- DVBTLocatorimpl.h