Counter Strike : Global Offensive Source Code
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.

1107 lines
40 KiB

  1. //------------------------------------------------------------------------------
  2. // File: Tune.h
  3. //
  4. // Desc: Additional infrastructure to extend the tuner.idl. Works nicely
  5. // from C++.
  6. //
  7. // Copyright (c) 1999 - 2001, Microsoft Corporation. All rights reserved.
  8. //------------------------------------------------------------------------------
  9. #pragma once
  10. #ifndef TUNE_H
  11. #define TUNE_H
  12. #include <tuner.h>
  13. namespace BDATuningModel {
  14. const long DEFAULT_MIN_CHANNEL = 2;
  15. const long DEFAULT_MAX_CHANNEL = 999;
  16. const long DEFAULT_MIN_FREQUENCY = 535; //bottom us am
  17. const long DEFAULT_MAX_FREQUENCY = 108000; // top us fm
  18. const long DEFAULT_ANALOG_TUNER_COUNTRY_CODE = 1; //usa
  19. const TunerInputType DEFAULT_ANALOG_TUNER_INPUT_TYPE = TunerInputCable; //usa
  20. typedef CComQIPtr<ITuningSpaceContainer> PQTuningSpaceContainer;
  21. typedef CComQIPtr<ITuningSpace> PQTuningSpace;
  22. typedef CComQIPtr<IAnalogRadioTuningSpace> PQAnalogRadioTuningSpace;
  23. typedef CComQIPtr<IAnalogTVTuningSpace> PQAnalogTVTuningSpace;
  24. typedef CComQIPtr<IATSCTuningSpace> PQATSCTuningSpace;
  25. typedef CComQIPtr<ITuneRequest> PQTuneRequest;
  26. typedef CComQIPtr<IChannelTuneRequest> PQChannelTuneRequest;
  27. typedef CComQIPtr<IATSCChannelTuneRequest> PQATSCChannelTuneRequest;
  28. typedef CComQIPtr<ILocator> PQLocator;
  29. typedef CComQIPtr<IATSCLocator> PQATSCLocator;
  30. typedef CComQIPtr<IDVBTuningSpace> PQDVBTuningSpace;
  31. typedef CComQIPtr<IDVBTuneRequest> PQDVBTuneRequest;
  32. typedef CComQIPtr<IDVBSLocator> PQDVBSLocator;
  33. typedef CComQIPtr<IDVBTLocator> PQDVBTLocator;
  34. typedef CComQIPtr<IDVBCLocator> PQDVBCLocator;
  35. typedef CComQIPtr<IAuxInTuningSpace> PQAuxInTuningSpace;
  36. // tuning space container
  37. class TNTuningSpaceContainer : public PQTuningSpaceContainer {
  38. TNTuningSpaceContainer() {}
  39. TNTuningSpaceContainer(const PQTuningSpaceContainer &a) : PQTuningSpaceContainer(a) {}
  40. TNTuningSpaceContainer(ITuningSpace *p) : PQTuningSpaceContainer(p) {}
  41. TNTuningSpaceContainer(IUnknown *p) : PQTuningSpaceContainer(p) {}
  42. TNTuningSpaceContainer(const TNTuningSpaceContainer &a) : PQTuningSpaceContainer(a) {}
  43. TNTuningSpaceContainer& operator=(TNTuningSpaceContainer& rhs) {
  44. PQTuningSpaceContainer::operator=(rhs);
  45. return *this;
  46. }
  47. };
  48. // tuning spaces
  49. template<class TUNINGSPACETYPE, class TUNEREQUESTTYPE> class TNTuningSpaceHelper : public TUNINGSPACETYPE {
  50. public:
  51. TNTuningSpaceHelper() {}
  52. TNTuningSpaceHelper(const TUNINGSPACETYPE &a) : TUNINGSPACETYPE(a) {}
  53. TNTuningSpaceHelper(ITuningSpace *p) : TUNINGSPACETYPE(p) {}
  54. TNTuningSpaceHelper(IUnknown *p) : TUNINGSPACETYPE(p) {}
  55. TNTuningSpaceHelper(const TNTuningSpaceHelper<TUNINGSPACETYPE, TUNEREQUESTTYPE> &a) : TUNINGSPACETYPE(a) {}
  56. TNTuningSpaceHelper<TUNINGSPACETYPE, TUNEREQUESTTYPE>& operator=(TNTuningSpaceHelper<TUNINGSPACETYPE, TUNEREQUESTTYPE>& rhs) {
  57. TUNINGSPACETYPE::operator=(rhs);
  58. return *this;
  59. }
  60. TNTuningSpaceHelper<TUNINGSPACETYPE, TUNEREQUESTTYPE>& operator=(TUNINGSPACETYPE& rhs) {
  61. TUNINGSPACETYPE::operator=(rhs);
  62. return *this;
  63. }
  64. TNTuningSpaceHelper<TUNINGSPACETYPE, TUNEREQUESTTYPE>& operator=(IUnknown *rhs) {
  65. TUNINGSPACETYPE::operator=(rhs);
  66. return *this;
  67. }
  68. TNTuningSpaceHelper<TUNINGSPACETYPE, TUNEREQUESTTYPE>& operator=(ITuningSpace *rhs) {
  69. TUNINGSPACETYPE::operator=(rhs);
  70. return *this;
  71. }
  72. bool operator==(TUNINGSPACETYPE& rhs) {
  73. CComBSTR rhsname;
  74. HRESULT hr = rhs->get_UniqueName(&rhsname);
  75. if (FAILED(hr)) {
  76. return false;
  77. }
  78. CComBSTR name;
  79. hr = (*this)->get_UniqueName(&name);
  80. if (FAILED(hr)) {
  81. return false;
  82. }
  83. return name == rhsname;
  84. }
  85. bool operator!=(TUNINGSPACETYPE& rhs) {
  86. return !operator==(rhs);
  87. }
  88. PQTuneRequest CreateTuneRequest() {
  89. PQTuneRequest p;
  90. HRESULT hr = (*this)->CreateTuneRequest(&p);
  91. if (FAILED(hr)) {
  92. return PQTuneRequest();
  93. }
  94. return p;
  95. }
  96. PQLocator Locator() {
  97. _ASSERT(*this);
  98. PQLocator ts;
  99. HRESULT hr = (*this)->get_DefaultLocator(&ts);
  100. if (FAILED(hr)) {
  101. return PQLocator();
  102. }
  103. return ts;
  104. }
  105. HRESULT Locator(PQLocator& l) {
  106. _ASSERT(*this);
  107. return (*this)->put_Locator(l);
  108. }
  109. void Clone() {
  110. PQTuningSpace t;
  111. HRESULT hr = (*this)->Clone(&t);
  112. if (FAILED(hr) || !t) {
  113. Release(); // clone failed, clear ourselves
  114. return;
  115. }
  116. TUNINGSPACETYPE::operator=(t);
  117. }
  118. };
  119. typedef TNTuningSpaceHelper<PQTuningSpace, PQTuneRequest> TNTuningSpace;
  120. template<class TUNINGSPACETYPE, class TUNEREQUESTTYPE> class TNAnalogRadioTuningSpaceHelper : public TNTuningSpaceHelper<TUNINGSPACETYPE, TUNEREQUESTTYPE> {
  121. public:
  122. TNAnalogRadioTuningSpaceHelper() {}
  123. TNAnalogRadioTuningSpaceHelper(const TUNINGSPACETYPE &a) : TNTuningSpaceHelper<TUNINGSPACETYPE, TUNEREQUESTTYPE>(a) {}
  124. TNAnalogRadioTuningSpaceHelper(IUnknown *p) : TNTuningSpaceHelper<TUNINGSPACETYPE, TUNEREQUESTTYPE>(p) {}
  125. TNAnalogRadioTuningSpaceHelper(const TNAnalogRadioTuningSpaceHelper<TUNINGSPACETYPE, TUNEREQUESTTYPE> &a) : TNTuningSpaceHelper<TUNINGSPACETYPE, TUNEREQUESTTYPE>(a) {}
  126. TNAnalogRadioTuningSpaceHelper<TUNINGSPACETYPE, TUNEREQUESTTYPE>& operator=(TNAnalogRadioTuningSpaceHelper<TUNINGSPACETYPE, TUNEREQUESTTYPE>& rhs) {
  127. TNTuningSpaceHelper<TUNINGSPACETYPE, TUNEREQUESTTYPE>::operator=(rhs);
  128. return *this;
  129. }
  130. template<class TS, class TR> TNAnalogRadioTuningSpaceHelper<TUNINGSPACETYPE, TUNEREQUESTTYPE>& operator=(TNTuningSpaceHelper<TS, TR>& rhs) {
  131. TNTuningSpaceHelper<TUNINGSPACETYPE, TUNEREQUESTTYPE>::operator=(TUNINGSPACETYPE(rhs));
  132. return *this;
  133. }
  134. TNAnalogRadioTuningSpaceHelper<TUNINGSPACETYPE, TUNEREQUESTTYPE>& operator=(TUNINGSPACETYPE& rhs) {
  135. TNTuningSpaceHelper<TUNINGSPACETYPE, TUNEREQUESTTYPE>::operator=(rhs);
  136. return *this;
  137. }
  138. TNAnalogRadioTuningSpaceHelper<TUNINGSPACETYPE, TUNEREQUESTTYPE>& operator=(IUnknown* rhs) {
  139. TNTuningSpaceHelper<TUNINGSPACETYPE, TUNEREQUESTTYPE>::operator=(rhs);
  140. return *this;
  141. }
  142. long MaxFrequency() {
  143. _ASSERT(*this);
  144. long freq;
  145. HRESULT hr = (*this)->get_MaxFrequency(&freq);
  146. if (FAILED(hr)) {
  147. freq = DEFAULT_MAX_FREQUENCY;
  148. }
  149. return freq;
  150. }
  151. HRESULT MaxFrequency(long freq) {
  152. _ASSERT(*this);
  153. return (*this)->put_MaxFrequency(freq);
  154. }
  155. long MinFrequency() {
  156. _ASSERT(*this);
  157. long freq;
  158. HRESULT hr = (*this)->get_MinFrequency(&freq);
  159. if (FAILED(hr)) {
  160. freq = DEFAULT_MIN_FREQUENCY;
  161. }
  162. return freq;
  163. }
  164. HRESULT MinFrequency(long freq) {
  165. _ASSERT(*this);
  166. return (*this)->put_MinFrequency(freq);
  167. }
  168. };
  169. typedef TNAnalogRadioTuningSpaceHelper<PQAnalogRadioTuningSpace, PQChannelTuneRequest> TNAnalogRadioTuningSpace;
  170. template<class TUNINGSPACETYPE, class TUNEREQUESTTYPE> class TNAnalogTVTuningSpaceHelper : public TNTuningSpaceHelper<TUNINGSPACETYPE, TUNEREQUESTTYPE> {
  171. public:
  172. TNAnalogTVTuningSpaceHelper() {}
  173. TNAnalogTVTuningSpaceHelper(const TUNINGSPACETYPE &a) : TNTuningSpaceHelper<TUNINGSPACETYPE, TUNEREQUESTTYPE>(a) {}
  174. TNAnalogTVTuningSpaceHelper(IUnknown *p) : TNTuningSpaceHelper<TUNINGSPACETYPE, TUNEREQUESTTYPE>(p) {}
  175. TNAnalogTVTuningSpaceHelper(const TNAnalogTVTuningSpaceHelper<TUNINGSPACETYPE, TUNEREQUESTTYPE> &a) : TNTuningSpaceHelper<TUNINGSPACETYPE, TUNEREQUESTTYPE>(a) {}
  176. TNAnalogTVTuningSpaceHelper<TUNINGSPACETYPE, TUNEREQUESTTYPE>& operator=(TNAnalogTVTuningSpaceHelper<TUNINGSPACETYPE, TUNEREQUESTTYPE>& rhs) {
  177. TNTuningSpaceHelper<TUNINGSPACETYPE, TUNEREQUESTTYPE>::operator=(rhs);
  178. return *this;
  179. }
  180. template<class TS, class TR> TNAnalogTVTuningSpaceHelper<TUNINGSPACETYPE, TUNEREQUESTTYPE>& operator=(TNTuningSpaceHelper<TS, TR>& rhs) {
  181. TNTuningSpaceHelper<TUNINGSPACETYPE, TUNEREQUESTTYPE>::operator=(TUNINGSPACETYPE(rhs));
  182. return *this;
  183. }
  184. TNAnalogTVTuningSpaceHelper<TUNINGSPACETYPE, TUNEREQUESTTYPE>& operator=(TUNINGSPACETYPE& rhs) {
  185. TNTuningSpaceHelper<TUNINGSPACETYPE, TUNEREQUESTTYPE>::operator=(rhs);
  186. return *this;
  187. }
  188. TNAnalogTVTuningSpaceHelper<TUNINGSPACETYPE, TUNEREQUESTTYPE>& operator=(IUnknown* rhs) {
  189. TNTuningSpaceHelper<TUNINGSPACETYPE, TUNEREQUESTTYPE>::operator=(rhs);
  190. return *this;
  191. }
  192. TunerInputType InputType() {
  193. _ASSERT(*this);
  194. TunerInputType ti;
  195. HRESULT hr = (*this)->get_InputType(&ti);
  196. if (FAILED(hr)) {
  197. ti = DEFAULT_ANALOG_TUNER_INPUT_TYPE;
  198. }
  199. return ti;
  200. }
  201. HRESULT InputType(TunerInputType ti) {
  202. _ASSERT(*this);
  203. return (*this)->put_InputType(&ti);
  204. }
  205. long CountryCode() {
  206. _ASSERT(*this);
  207. long cc;
  208. HRESULT hr = (*this)->get_CountryCode(&cc);
  209. if (FAILED(hr)) {
  210. cc = DEFAULT_ANALOG_TUNER_INPUT_TYPE;
  211. }
  212. return cc;
  213. }
  214. HRESULT CountryCode(long cc) {
  215. _ASSERT(*this);
  216. return (*this)->put_CountryCode(cc);
  217. }
  218. long MinChannel() {
  219. _ASSERT(*this);
  220. long chan;
  221. HRESULT hr = (*this)->get_MinChannel(&chan);
  222. if (FAILED(hr)) {
  223. chan = DEFAULT_MIN_CHANNEL;
  224. }
  225. return chan;
  226. }
  227. HRESULT MinChannel(long chan) {
  228. _ASSERT(*this);
  229. return (*this)->put_MinChannel(chan);
  230. }
  231. long MaxChannel() {
  232. _ASSERT(*this);
  233. long chan;
  234. HRESULT hr = (*this)->get_MaxChannel(&chan);
  235. if (FAILED(hr)) {
  236. chan = DEFAULT_MAX_CHANNEL;
  237. }
  238. return chan;
  239. }
  240. HRESULT MaxChannel(long chan) {
  241. _ASSERT(*this);
  242. return (*this)->put_MaxChannel(chan);
  243. }
  244. };
  245. typedef TNAnalogTVTuningSpaceHelper<PQAnalogTVTuningSpace, PQChannelTuneRequest> TNAnalogTVTuningSpace;
  246. template<class TUNINGSPACETYPE, class TUNEREQUESTTYPE> class TNAuxInTuningSpaceHelper : public TNTuningSpaceHelper<TUNINGSPACETYPE, TUNEREQUESTTYPE> {
  247. public:
  248. TNAuxInTuningSpaceHelper() {}
  249. TNAuxInTuningSpaceHelper(const TUNINGSPACETYPE &a) : TNTuningSpaceHelper<TUNINGSPACETYPE, TUNEREQUESTTYPE>(a) {}
  250. TNAuxInTuningSpaceHelper(IUnknown *p) : TNTuningSpaceHelper<TUNINGSPACETYPE, TUNEREQUESTTYPE>(p) {}
  251. TNAuxInTuningSpaceHelper(const TNAuxInTuningSpaceHelper<TUNINGSPACETYPE, TUNEREQUESTTYPE> &a) : TNTuningSpaceHelper<TUNINGSPACETYPE, TUNEREQUESTTYPE>(a) {}
  252. TNAuxInTuningSpaceHelper<TUNINGSPACETYPE, TUNEREQUESTTYPE>& operator=(TNAuxInTuningSpaceHelper<TUNINGSPACETYPE, TUNEREQUESTTYPE>& rhs) {
  253. TNTuningSpaceHelper<TUNINGSPACETYPE, TUNEREQUESTTYPE>::operator=(rhs);
  254. return *this;
  255. }
  256. template<class TS, class TR> TNAuxInTuningSpaceHelper<TUNINGSPACETYPE, TUNEREQUESTTYPE>& operator=(TNTuningSpaceHelper<TS, TR>& rhs) {
  257. TNTuningSpaceHelper<TUNINGSPACETYPE, TUNEREQUESTTYPE>::operator=(TUNINGSPACETYPE(rhs));
  258. return *this;
  259. }
  260. TNAuxInTuningSpaceHelper<TUNINGSPACETYPE, TUNEREQUESTTYPE>& operator=(TUNINGSPACETYPE& rhs) {
  261. TNTuningSpaceHelper<TUNINGSPACETYPE, TUNEREQUESTTYPE>::operator=(rhs);
  262. return *this;
  263. }
  264. TNAuxInTuningSpaceHelper<TUNINGSPACETYPE, TUNEREQUESTTYPE>& operator=(IUnknown* rhs) {
  265. TNTuningSpaceHelper<TUNINGSPACETYPE, TUNEREQUESTTYPE>::operator=(rhs);
  266. return *this;
  267. }
  268. };
  269. typedef TNAuxInTuningSpaceHelper<PQAuxInTuningSpace, PQChannelTuneRequest> TNAuxInTuningSpace;
  270. template<class TUNINGSPACETYPE, class TUNEREQUESTTYPE> class TNATSCTuningSpaceHelper : public TNAnalogTVTuningSpaceHelper<TUNINGSPACETYPE, TUNEREQUESTTYPE> {
  271. public:
  272. TNATSCTuningSpaceHelper() {}
  273. TNATSCTuningSpaceHelper(const TUNINGSPACETYPE &a) : TNAnalogTVTuningSpaceHelper<TUNINGSPACETYPE, TUNEREQUESTTYPE>(a) {}
  274. TNATSCTuningSpaceHelper(IUnknown *p) : TNAnalogTVTuningSpaceHelper<TUNINGSPACETYPE, TUNEREQUESTTYPE>(p) {}
  275. TNATSCTuningSpaceHelper(const TNATSCTuningSpaceHelper<TUNINGSPACETYPE, TUNEREQUESTTYPE> &a) : TNAnalogTVTuningSpaceHelper<TUNINGSPACETYPE, TUNEREQUESTTYPE>(a) {}
  276. TNATSCTuningSpaceHelper<TUNINGSPACETYPE, TUNEREQUESTTYPE>& operator=(TNATSCTuningSpaceHelper<TUNINGSPACETYPE, TUNEREQUESTTYPE>& rhs) {
  277. TNAnalogTVTuningSpaceHelper<TUNINGSPACETYPE, TUNEREQUESTTYPE>::operator=(rhs);
  278. return *this;
  279. }
  280. template<class TS, class TR> TNATSCTuningSpaceHelper<TUNINGSPACETYPE, TUNEREQUESTTYPE>& operator=(TNTuningSpaceHelper<TS, TR>& rhs) {
  281. TNAnalogTVTuningSpaceHelper<TUNINGSPACETYPE, TUNEREQUESTTYPE>::operator=(TUNINGSPACETYPE(rhs));
  282. return *this;
  283. }
  284. TNATSCTuningSpaceHelper<TUNINGSPACETYPE, TUNEREQUESTTYPE>& operator=(TUNINGSPACETYPE& rhs) {
  285. TNAnalogTVTuningSpaceHelper<TUNINGSPACETYPE, TUNEREQUESTTYPE>::operator=(rhs);
  286. return *this;
  287. }
  288. TNATSCTuningSpaceHelper<TUNINGSPACETYPE, TUNEREQUESTTYPE>& operator=(IUnknown* rhs) {
  289. TNAnalogTVTuningSpaceHelper<TUNINGSPACETYPE, TUNEREQUESTTYPE>::operator=(rhs);
  290. return *this;
  291. }
  292. long MinMinorChannel() {
  293. _ASSERT(*this);
  294. long chan;
  295. HRESULT hr = (*this)->get_MinMinorChannel(&chan);
  296. if (FAILED(hr)) {
  297. chan = DEFAULT_MIN_CHANNEL;
  298. }
  299. return chan;
  300. }
  301. HRESULT MinMinorChannel(long chan) {
  302. _ASSERT(*this);
  303. return (*this)->put_MinMinorChannel(chan);
  304. }
  305. long MaxMinorChannel() {
  306. _ASSERT(*this);
  307. long chan;
  308. HRESULT hr = (*this)->get_MaxMinorChannel(&chan);
  309. if (FAILED(hr)) {
  310. chan = DEFAULT_MAX_CHANNEL;
  311. }
  312. return chan;
  313. }
  314. HRESULT MaxMinorChannel(long chan) {
  315. _ASSERT(*this);
  316. return (*this)->put_MaxMinorChannel(chan);
  317. }
  318. long MinPhysicalChannel() {
  319. _ASSERT(*this);
  320. long chan;
  321. HRESULT hr = (*this)->get_MinPhysicalChannel(&chan);
  322. if (FAILED(hr)) {
  323. chan = DEFAULT_MIN_CHANNEL;
  324. }
  325. return chan;
  326. }
  327. HRESULT MinPhysicalChannel(long chan) {
  328. _ASSERT(*this);
  329. return (*this)->put_MinPhysicalChannel(chan);
  330. }
  331. long MaxPhysicalChannel() {
  332. _ASSERT(*this);
  333. long chan;
  334. HRESULT hr = (*this)->get_MaxPhysicalChannel(&chan);
  335. if (FAILED(hr)) {
  336. chan = DEFAULT_MAX_CHANNEL;
  337. }
  338. return chan;
  339. }
  340. HRESULT MaxPhysicalChannel(long chan) {
  341. _ASSERT(*this);
  342. return (*this)->put_MaxPhysicalChannel(chan);
  343. }
  344. };
  345. typedef TNATSCTuningSpaceHelper<PQATSCTuningSpace, PQATSCChannelTuneRequest> TNATSCTuningSpace;
  346. // dvb tuning space
  347. template<class TUNINGSPACETYPE, class TUNEREQUESTTYPE> class TNDVBTuningSpaceHelper : public TNTuningSpaceHelper<TUNINGSPACETYPE, TUNEREQUESTTYPE> {
  348. public:
  349. TNDVBTuningSpaceHelper() {}
  350. TNDVBTuningSpaceHelper(const TUNINGSPACETYPE &a) : TNTuningSpaceHelper<TUNINGSPACETYPE, TUNEREQUESTTYPE>(a) {}
  351. TNDVBTuningSpaceHelper(IUnknown *p) : TNTuningSpaceHelper<TUNINGSPACETYPE, TUNEREQUESTTYPE>(p) {}
  352. TNDVBTuningSpaceHelper(const TNDVBTuningSpaceHelper<TUNINGSPACETYPE, TUNEREQUESTTYPE> &a) : TNTuningSpaceHelper<TUNINGSPACETYPE, TUNEREQUESTTYPE>(a) {}
  353. TNDVBTuningSpaceHelper<TUNINGSPACETYPE, TUNEREQUESTTYPE>& operator=(TNDVBTuningSpaceHelper<TUNINGSPACETYPE, TUNEREQUESTTYPE>& rhs) {
  354. TNTuningSpaceHelper<TUNINGSPACETYPE, TUNEREQUESTTYPE>::operator=(rhs);
  355. return *this;
  356. }
  357. template<class TS, class TR> TNDVBTuningSpaceHelper<TUNINGSPACETYPE, TUNEREQUESTTYPE>& operator=(TNTuningSpaceHelper<TS, TR>& rhs) {
  358. TNTuningSpaceHelper<TUNINGSPACETYPE, TUNEREQUESTTYPE>::operator=(TUNINGSPACETYPE(rhs));
  359. return *this;
  360. }
  361. TNDVBTuningSpaceHelper<TUNINGSPACETYPE, TUNEREQUESTTYPE>& operator=(TUNINGSPACETYPE& rhs) {
  362. TNTuningSpaceHelper<TUNINGSPACETYPE, TUNEREQUESTTYPE>::operator=(rhs);
  363. return *this;
  364. }
  365. TNDVBTuningSpaceHelper<TUNINGSPACETYPE, TUNEREQUESTTYPE>& operator=(IUnknown* rhs) {
  366. TNTuningSpaceHelper<TUNINGSPACETYPE, TUNEREQUESTTYPE>::operator=(rhs);
  367. return *this;
  368. }
  369. DVBSystemType SystemType() const {
  370. DVBSystemType st;
  371. HRESULT hr = (*this)->get_SystemType(&st);
  372. if (FAILED(hr)) {
  373. return DVB_Cable;
  374. }
  375. return st;
  376. }
  377. HRESULT SystemType(DVBSystemType st) {
  378. _ASSERT(*this);
  379. return (*this)->put_SystemType(st);
  380. }
  381. };
  382. typedef TNDVBTuningSpaceHelper<PQDVBTuningSpace, PQDVBTuneRequest> TNDVBTuningSpace;
  383. // locators
  384. template<class LOCATORTYPE> class TNLocatorHelper : public LOCATORTYPE {
  385. public:
  386. TNLocatorHelper() {}
  387. TNLocatorHelper(const LOCATORTYPE &a) : LOCATORTYPE(a) {}
  388. TNLocatorHelper(IUnknown *p) : LOCATORTYPE(p) {}
  389. TNLocatorHelper(const TNLocatorHelper<LOCATORTYPE> &a) : LOCATORTYPE(a) {}
  390. TNLocatorHelper(ILocator *p) : LOCATORTYPE(p) {}
  391. TNLocatorHelper<LOCATORTYPE>& operator=(TNLocatorHelper<LOCATORTYPE>& rhs) {
  392. LOCATORTYPE::operator=(rhs);
  393. return *this;
  394. }
  395. TNLocatorHelper<LOCATORTYPE>& operator=(LOCATORTYPE& rhs) {
  396. LOCATORTYPE::operator=(rhs);
  397. return *this;
  398. }
  399. TNLocatorHelper<LOCATORTYPE>& operator=(ILocator* rhs) {
  400. LOCATORTYPE::operator=(rhs);
  401. return *this;
  402. }
  403. TNLocatorHelper<LOCATORTYPE>& operator=(IUnknown* rhs) {
  404. LOCATORTYPE::operator=(rhs);
  405. return *this;
  406. }
  407. void Clone() {
  408. PQLocator t;
  409. HRESULT hr = (*this)->Clone(&t);
  410. if (FAILED(hr) || !t) {
  411. Release(); // clone failed, clear ourselves
  412. return;
  413. }
  414. LOCATORTYPE::operator=(t);
  415. }
  416. long CarrierFrequency() {
  417. _ASSERT(*this);
  418. long f;
  419. HRESULT hr = (*this)->get_CarrierFrequency(&f);
  420. if (FAILED(hr)) {
  421. return -1;
  422. }
  423. return f;
  424. }
  425. HRESULT CarrierFrequency(long f) {
  426. _ASSERT(*this);
  427. return (*this)->put_CarrierFrequency(f);
  428. }
  429. FECMethod InnerFEC() {
  430. _ASSERT(*this);
  431. FECMethod f;
  432. HRESULT hr = (*this)->get_InnerFEC(&f);
  433. if (FAILED(hr)) {
  434. return BDA_FEC_METHOD_NOT_SET;
  435. }
  436. return f;
  437. }
  438. HRESULT InnerFEC(FECMethod f) {
  439. _ASSERT(*this);
  440. return (*this)->put_InnerFEC(f);
  441. }
  442. BinaryConvolutionCodeRate InnerFECRate() {
  443. _ASSERT(*this);
  444. BinaryConvolutionCodeRate f;
  445. HRESULT hr = (*this)->get_InnerFECRate(&f);
  446. if (FAILED(hr)) {
  447. return BDA_BCC_RATE_NOT_SET;
  448. }
  449. return f;
  450. }
  451. HRESULT InnerFECRate(BinaryConvolutionCodeRate f) {
  452. _ASSERT(*this);
  453. return (*this)->put_InnerFECRate(f);
  454. }
  455. FECMethod OuterFEC() {
  456. _ASSERT(*this);
  457. FECMethod f;
  458. HRESULT hr = (*this)->get_OuterFEC(&f);
  459. if (FAILED(hr)) {
  460. return BDA_FEC_METHOD_NOT_SET;
  461. }
  462. return f;
  463. }
  464. HRESULT OuterFEC(FECMethod f) {
  465. _ASSERT(*this);
  466. return (*this)->put_OuterFEC(f);
  467. }
  468. BinaryConvolutionCodeRate OuterFECRate() {
  469. _ASSERT(*this);
  470. BinaryConvolutionCodeRate f;
  471. HRESULT hr = (*this)->get_OuterFECRate(&f);
  472. if (FAILED(hr)) {
  473. return BDA_BCC_RATE_NOT_SET;
  474. }
  475. return f;
  476. }
  477. HRESULT OuterFECRate(BinaryConvolutionCodeRate f) {
  478. _ASSERT(*this);
  479. return (*this)->put_OuterFECRate(f);
  480. }
  481. ModulationType Modulation() {
  482. _ASSERT(*this);
  483. ModulationType f;
  484. HRESULT hr = (*this)->get_Modulation(&f);
  485. if (FAILED(hr)) {
  486. return BDA_MOD_NOT_SET;
  487. }
  488. return f;
  489. }
  490. HRESULT Modulation(ModulationType f) {
  491. _ASSERT(*this);
  492. return (*this)->put_Modulation(f);
  493. }
  494. long SymbolRate() {
  495. _ASSERT(*this);
  496. long f;
  497. HRESULT hr = (*this)->get_SymbolRate(&f);
  498. if (FAILED(hr)) {
  499. return -1;
  500. }
  501. return f;
  502. }
  503. HRESULT SymbolRate(long f) {
  504. _ASSERT(*this);
  505. return (*this)->put_SymbolRate(f);
  506. }
  507. };
  508. typedef TNLocatorHelper<PQLocator> TNLocator;
  509. template<class LOCATORTYPE> class TNATSCLocatorHelper : public TNLocatorHelper<LOCATORTYPE> {
  510. public:
  511. TNATSCLocatorHelper() {}
  512. TNATSCLocatorHelper(const LOCATORTYPE &a) : TNLocatorHelper<LOCATORTYPE>(a) {}
  513. TNATSCLocatorHelper(IUnknown *p) : TNLocatorHelper<LOCATORTYPE>(p) {}
  514. TNATSCLocatorHelper(const TNATSCLocatorHelper<LOCATORTYPE> &a) : TNLocatorHelper<LOCATORTYPE>(a) {}
  515. TNATSCLocatorHelper(IATSCLocator *p) : TNLocatorHelper<LOCATORTYPE>(p) {}
  516. TNATSCLocatorHelper(const TNLocatorHelper<LOCATORTYPE> &a) : TNLocatorHelper<LOCATORTYPE>(a) {}
  517. TNATSCLocatorHelper<LOCATORTYPE>& operator=(TNATSCLocatorHelper<LOCATORTYPE>& rhs) {
  518. TNLocatorHelper<LOCATORTYPE>::operator=(rhs);
  519. return *this;
  520. }
  521. TNATSCLocatorHelper<LOCATORTYPE>& operator=(TNLocatorHelper<LOCATORTYPE>& rhs) {
  522. TNLocatorHelper<LOCATORTYPE>::operator=(rhs);
  523. return *this;
  524. }
  525. TNATSCLocatorHelper<LOCATORTYPE>& operator=(LOCATORTYPE& rhs) {
  526. TNLocatorHelper<LOCATORTYPE>::operator=(rhs);
  527. return *this;
  528. }
  529. TNATSCLocatorHelper<LOCATORTYPE>& operator=(IATSCLocator* rhs) {
  530. TNLocatorHelper<LOCATORTYPE>::operator=(rhs);
  531. return *this;
  532. }
  533. TNATSCLocatorHelper<LOCATORTYPE>& operator=(IUnknown* rhs) {
  534. TNLocatorHelper<LOCATORTYPE>::operator=(rhs);
  535. return *this;
  536. }
  537. long PhysicalChannel() {
  538. _ASSERT(*this);
  539. long pc;
  540. HRESULT hr = (*this)->get_PhysicalChannel(&pc);
  541. if (FAILED(hr)) {
  542. return -1;
  543. }
  544. return pc;
  545. }
  546. HRESULT PhysicalChannel(long pc) {
  547. _ASSERT(*this);
  548. return (*this)->put_PhysicalChannel(pc);
  549. }
  550. long TSID() {
  551. _ASSERT(*this);
  552. long pc;
  553. HRESULT hr = (*this)->get_TSID(&pc);
  554. if (FAILED(hr)) {
  555. return -1;
  556. }
  557. return pc;
  558. }
  559. HRESULT TSID(long pc) {
  560. _ASSERT(*this);
  561. return (*this)->put_TSID(pc);
  562. }
  563. long ProgramNumber() {
  564. _ASSERT(*this);
  565. long pc;
  566. HRESULT hr = (*this)->get_ProgramNumber(&pc);
  567. if (FAILED(hr)) {
  568. return -1;
  569. }
  570. return pc;
  571. }
  572. HRESULT ProgramNumber(long pc) {
  573. _ASSERT(*this);
  574. return (*this)->put_ProgramNumber(pc);
  575. }
  576. };
  577. typedef TNATSCLocatorHelper<PQATSCLocator> TNATSCLocator;
  578. template<class LOCATORTYPE> class TNDVBSLocatorHelper : public TNLocatorHelper<LOCATORTYPE> {
  579. public:
  580. TNDVBSLocatorHelper() {}
  581. TNDVBSLocatorHelper(const LOCATORTYPE &a) : TNLocatorHelper<LOCATORTYPE>(a) {}
  582. TNDVBSLocatorHelper(IUnknown *p) : TNLocatorHelper<LOCATORTYPE>(p) {}
  583. TNDVBSLocatorHelper(const TNDVBSLocatorHelper<LOCATORTYPE> &a) : TNLocatorHelper<LOCATORTYPE>(a) {}
  584. TNDVBSLocatorHelper(IDVBSLocator *p) : TNLocatorHelper<LOCATORTYPE>(p) {}
  585. TNDVBSLocatorHelper(const TNLocatorHelper<LOCATORTYPE> &a) : TNLocatorHelper<LOCATORTYPE>(a) {}
  586. TNDVBSLocatorHelper<LOCATORTYPE>& operator=(TNDVBSLocatorHelper<LOCATORTYPE>& rhs) {
  587. TNLocatorHelper<LOCATORTYPE>::operator=(rhs);
  588. return *this;
  589. }
  590. TNDVBSLocatorHelper<LOCATORTYPE>& operator=(TNLocatorHelper<LOCATORTYPE>& rhs) {
  591. TNLocatorHelper<LOCATORTYPE>::operator=(rhs);
  592. return *this;
  593. }
  594. TNDVBSLocatorHelper<LOCATORTYPE>& operator=(LOCATORTYPE& rhs) {
  595. TNLocatorHelper<LOCATORTYPE>::operator=(rhs);
  596. return *this;
  597. }
  598. TNDVBSLocatorHelper<LOCATORTYPE>& operator=(IDVBSLocator* rhs) {
  599. TNLocatorHelper<LOCATORTYPE>::operator=(rhs);
  600. return *this;
  601. }
  602. TNDVBSLocatorHelper<LOCATORTYPE>& operator=(IUnknown* rhs) {
  603. TNLocatorHelper<LOCATORTYPE>::operator=(rhs);
  604. return *this;
  605. }
  606. Polarisation SignalPolarisation() {
  607. _ASSERT(*this);
  608. Polarisation pc;
  609. HRESULT hr = (*this)->get_SignalPolarisation(&pc);
  610. if (FAILED(hr)) {
  611. return -1;
  612. }
  613. return pc;
  614. }
  615. HRESULT SignalPolarisation(Polarisation pc) {
  616. _ASSERT(*this);
  617. return (*this)->put_SignalPolarisation(pc);
  618. }
  619. VARIANT_BOOL WestPosition() {
  620. _ASSERT(*this);
  621. VARIANT_BOOL pc;
  622. HRESULT hr = (*this)->get_WestPosition(&pc);
  623. if (FAILED(hr)) {
  624. return -1;
  625. }
  626. return pc;
  627. }
  628. HRESULT WestPosition(VARIANT_BOOL pc) {
  629. _ASSERT(*this);
  630. return (*this)->put_WestPosition(pc);
  631. }
  632. long OrbitalPosition() {
  633. _ASSERT(*this);
  634. long pc;
  635. HRESULT hr = (*this)->get_OrbitalPosition(&pc);
  636. if (FAILED(hr)) {
  637. return -1;
  638. }
  639. return pc;
  640. }
  641. HRESULT OrbitalPosition(long pc) {
  642. _ASSERT(*this);
  643. return (*this)->put_OrbitalPosition(pc);
  644. }
  645. long Azimuth() {
  646. _ASSERT(*this);
  647. long pc;
  648. HRESULT hr = (*this)->get_Azimuth(&pc);
  649. if (FAILED(hr)) {
  650. return -1;
  651. }
  652. return pc;
  653. }
  654. HRESULT Azimuth(long pc) {
  655. _ASSERT(*this);
  656. return (*this)->put_Azimuth(pc);
  657. }
  658. long Elevation() {
  659. _ASSERT(*this);
  660. long pc;
  661. HRESULT hr = (*this)->get_Elevation(&pc);
  662. if (FAILED(hr)) {
  663. return -1;
  664. }
  665. return pc;
  666. }
  667. HRESULT Elevation(long pc) {
  668. _ASSERT(*this);
  669. return (*this)->put_Elevation(pc);
  670. }
  671. };
  672. typedef TNDVBSLocatorHelper<PQDVBSLocator> TNDVBSLocator;
  673. template<class LOCATORTYPE> class TNDVBTLocatorHelper : public TNLocatorHelper<LOCATORTYPE> {
  674. public:
  675. TNDVBTLocatorHelper() {}
  676. TNDVBTLocatorHelper(const LOCATORTYPE &a) : TNLocatorHelper<LOCATORTYPE>(a) {}
  677. TNDVBTLocatorHelper(IUnknown *p) : TNLocatorHelper<LOCATORTYPE>(p) {}
  678. TNDVBTLocatorHelper(const TNDVBTLocatorHelper<LOCATORTYPE> &a) : TNLocatorHelper<LOCATORTYPE>(a) {}
  679. TNDVBTLocatorHelper(IDVBTLocator *p) : TNLocatorHelper<LOCATORTYPE>(p) {}
  680. TNDVBTLocatorHelper(const TNLocatorHelper<LOCATORTYPE> &a) : TNLocatorHelper<LOCATORTYPE>(a) {}
  681. TNDVBTLocatorHelper<LOCATORTYPE>& operator=(TNDVBTLocatorHelper<LOCATORTYPE>& rhs) {
  682. TNLocatorHelper<LOCATORTYPE>::operator=(rhs);
  683. return *this;
  684. }
  685. TNDVBTLocatorHelper<LOCATORTYPE>& operator=(TNLocatorHelper<LOCATORTYPE>& rhs) {
  686. TNLocatorHelper<LOCATORTYPE>::operator=(rhs);
  687. return *this;
  688. }
  689. TNDVBTLocatorHelper<LOCATORTYPE>& operator=(LOCATORTYPE& rhs) {
  690. TNLocatorHelper<LOCATORTYPE>::operator=(rhs);
  691. return *this;
  692. }
  693. TNDVBTLocatorHelper<LOCATORTYPE>& operator=(IDVBTLocator* rhs) {
  694. TNLocatorHelper<LOCATORTYPE>::operator=(rhs);
  695. return *this;
  696. }
  697. TNDVBTLocatorHelper<LOCATORTYPE>& operator=(IUnknown* rhs) {
  698. TNLocatorHelper<LOCATORTYPE>::operator=(rhs);
  699. return *this;
  700. }
  701. long BandWidth() {
  702. _ASSERT(*this);
  703. long pc;
  704. HRESULT hr = (*this)->get_BandWidth(&pc);
  705. if (FAILED(hr)) {
  706. return -1;
  707. }
  708. return pc;
  709. }
  710. HRESULT BandWidth(long pc) {
  711. _ASSERT(*this);
  712. return (*this)->put_BandWidth(pc);
  713. }
  714. FECMethod LPInnerFec() {
  715. _ASSERT(*this);
  716. FECMethod pc;
  717. HRESULT hr = (*this)->get_LPInnerFec(&pc);
  718. if (FAILED(hr)) {
  719. return -1;
  720. }
  721. return pc;
  722. }
  723. HRESULT LPInnerFec(FECMethod pc) {
  724. _ASSERT(*this);
  725. return (*this)->put_LPInnerFec(pc);
  726. }
  727. BinaryConvolutionCodeRate LPInnerFecRate() {
  728. _ASSERT(*this);
  729. BinaryConvolutionCodeRate pc;
  730. HRESULT hr = (*this)->get_LPInnerFecRate(&pc);
  731. if (FAILED(hr)) {
  732. return -1;
  733. }
  734. return pc;
  735. }
  736. HRESULT LPInnerFecRate(BinaryConvolutionCodeRate pc) {
  737. _ASSERT(*this);
  738. return (*this)->put_LPInnerFecRate(pc);
  739. }
  740. HierarchyAlpha HAlpha() {
  741. _ASSERT(*this);
  742. HierarchyAlpha pc;
  743. HRESULT hr = (*this)->get_HAlpha(&pc);
  744. if (FAILED(hr)) {
  745. return -1;
  746. }
  747. return pc;
  748. }
  749. HRESULT HAlpha(HierarchyAlpha pc) {
  750. _ASSERT(*this);
  751. return (*this)->put_HAlpha(pc);
  752. }
  753. GuardInterval Guard() {
  754. _ASSERT(*this);
  755. GuardInterval pc;
  756. HRESULT hr = (*this)->get_Guard(&pc);
  757. if (FAILED(hr)) {
  758. return -1;
  759. }
  760. return pc;
  761. }
  762. HRESULT Guard(GuardInterval pc) {
  763. _ASSERT(*this);
  764. return (*this)->put_Guard(pc);
  765. }
  766. TransmissionMode Mode() {
  767. _ASSERT(*this);
  768. TransmissionMode pc;
  769. HRESULT hr = (*this)->get_Mode(&pc);
  770. if (FAILED(hr)) {
  771. return -1;
  772. }
  773. return pc;
  774. }
  775. HRESULT Mode(TransmissionMode pc) {
  776. _ASSERT(*this);
  777. return (*this)->put_Mode(pc);
  778. }
  779. VARIANT_BOOL OtherFrequencyInUse() {
  780. _ASSERT(*this);
  781. VARIANT_BOOL pc;
  782. HRESULT hr = (*this)->get_OtherFrequencyInUse(&pc);
  783. if (FAILED(hr)) {
  784. return -1;
  785. }
  786. return pc;
  787. }
  788. HRESULT OtherFrequencyInUse(VARIANT_BOOL pc) {
  789. _ASSERT(*this);
  790. return (*this)->put_OtherFrequencyInUse(pc);
  791. }
  792. };
  793. typedef TNDVBTLocatorHelper<PQDVBTLocator> TNDVBTLocator;
  794. template<class LOCATORTYPE> class TNDVBCLocatorHelper : public TNLocatorHelper<LOCATORTYPE> {
  795. public:
  796. TNDVBCLocatorHelper() {}
  797. TNDVBCLocatorHelper(const LOCATORTYPE &a) : TNLocatorHelper<LOCATORTYPE>(a) {}
  798. TNDVBCLocatorHelper(IUnknown *p) : TNLocatorHelper<LOCATORTYPE>(p) {}
  799. TNDVBCLocatorHelper(const TNDVBCLocatorHelper<LOCATORTYPE> &a) : TNLocatorHelper<LOCATORTYPE>(a) {}
  800. TNDVBCLocatorHelper(IDVBCLocator *p) : TNLocatorHelper<LOCATORTYPE>(p) {}
  801. TNDVBCLocatorHelper(const TNLocatorHelper<LOCATORTYPE> &a) : TNLocatorHelper<LOCATORTYPE>(a) {}
  802. TNDVBCLocatorHelper<LOCATORTYPE>& operator=(TNDVBCLocatorHelper<LOCATORTYPE>& rhs) {
  803. TNLocatorHelper<LOCATORTYPE>::operator=(rhs);
  804. return *this;
  805. }
  806. TNDVBCLocatorHelper<LOCATORTYPE>& operator=(TNLocatorHelper<LOCATORTYPE>& rhs) {
  807. TNLocatorHelper<LOCATORTYPE>::operator=(rhs);
  808. return *this;
  809. }
  810. TNDVBCLocatorHelper<LOCATORTYPE>& operator=(LOCATORTYPE& rhs) {
  811. TNLocatorHelper<LOCATORTYPE>::operator=(rhs);
  812. return *this;
  813. }
  814. TNDVBCLocatorHelper<LOCATORTYPE>& operator=(IDVBCLocator* rhs) {
  815. TNLocatorHelper<LOCATORTYPE>::operator=(rhs);
  816. return *this;
  817. }
  818. TNDVBCLocatorHelper<LOCATORTYPE>& operator=(IUnknown* rhs) {
  819. TNLocatorHelper<LOCATORTYPE>::operator=(rhs);
  820. return *this;
  821. }
  822. };
  823. typedef TNDVBCLocatorHelper<PQDVBCLocator> TNDVBCLocator;
  824. // tune requests
  825. template<class TUNEREQUESTTYPE, class LOCATORTYPE> class TNTuneRequestHelper : public TUNEREQUESTTYPE {
  826. public:
  827. TNTuneRequestHelper() {}
  828. TNTuneRequestHelper(const TUNEREQUESTTYPE &a) : TUNEREQUESTTYPE(a) {}
  829. TNTuneRequestHelper(IUnknown *p) : TUNEREQUESTTYPE(p) {}
  830. TNTuneRequestHelper(const TNTuneRequestHelper<TUNEREQUESTTYPE, LOCATORTYPE> &a) : TUNEREQUESTTYPE(a) {}
  831. TNTuneRequestHelper(ITuneRequest *p) : TUNEREQUESTTYPE(p) {}
  832. TNTuneRequestHelper<TUNEREQUESTTYPE, LOCATORTYPE>& operator=(TNTuneRequestHelper<TUNEREQUESTTYPE, LOCATORTYPE>& rhs) {
  833. TUNEREQUESTTYPE::operator=(rhs);
  834. return *this;
  835. }
  836. TNTuneRequestHelper<TUNEREQUESTTYPE, LOCATORTYPE>& operator=(TUNEREQUESTTYPE& rhs) {
  837. TUNEREQUESTTYPE::operator=(rhs);
  838. return *this;
  839. }
  840. TNTuneRequestHelper<TUNEREQUESTTYPE, LOCATORTYPE>& operator=(ITuneRequest* rhs) {
  841. TUNEREQUESTTYPE::operator=(rhs);
  842. return *this;
  843. }
  844. TNTuneRequestHelper<TUNEREQUESTTYPE, LOCATORTYPE>& operator=(IUnknown* rhs) {
  845. TUNEREQUESTTYPE::operator=(rhs);
  846. return *this;
  847. }
  848. // this function creates a new instance of the base ITuneRequest* and copies
  849. // all the values of the current ITuneRequest and sets this to the new one
  850. // this provides the value semantics needed by the network providers
  851. void Clone() {
  852. PQTuneRequest t;
  853. HRESULT hr = (*this)->Clone(&t);
  854. if (FAILED(hr) || !t) {
  855. Release(); // clone failed, clear ourselves
  856. return;
  857. }
  858. TUNEREQUESTTYPE::operator=(t);
  859. }
  860. PQTuningSpace TuningSpace() {
  861. _ASSERT(*this);
  862. PQTuningSpace ts;
  863. HRESULT hr = (*this)->get_TuningSpace(&ts);
  864. if (FAILED(hr)) {
  865. return PQTuningSpace();
  866. }
  867. return ts;
  868. }
  869. LOCATORTYPE Locator() {
  870. _ASSERT(*this);
  871. PQLocator pc;
  872. HRESULT hr = (*this)->get_Locator(&pc);
  873. if (FAILED(hr)) {
  874. return PQLocator().p;
  875. }
  876. return pc.p;
  877. }
  878. HRESULT Locator(LOCATORTYPE& pc) {
  879. _ASSERT(*this);
  880. return (*this)->put_Locator(pc);
  881. }
  882. };
  883. typedef TNTuneRequestHelper<PQTuneRequest, PQLocator> TNTuneRequest;
  884. template<class TUNEREQUESTTYPE, class LOCATORTYPE> class TNChannelTuneRequestHelper : public TNTuneRequestHelper<TUNEREQUESTTYPE, LOCATORTYPE> {
  885. public:
  886. TNChannelTuneRequestHelper() {}
  887. TNChannelTuneRequestHelper(const TNTuneRequest &a) : TNTuneRequestHelper<TUNEREQUESTTYPE, LOCATORTYPE>(a) {}
  888. TNChannelTuneRequestHelper(IChannelTuneRequest *p) : TNTuneRequestHelper<TUNEREQUESTTYPE, LOCATORTYPE>(p) {}
  889. TNChannelTuneRequestHelper(IUnknown *p) : TNTuneRequestHelper<TUNEREQUESTTYPE, LOCATORTYPE>(p) {}
  890. TNChannelTuneRequestHelper(const TNTuneRequestHelper<TUNEREQUESTTYPE, LOCATORTYPE> &a) : TNTuneRequestHelper<TUNEREQUESTTYPE, LOCATORTYPE>(a) {}
  891. TNChannelTuneRequestHelper(const TNChannelTuneRequestHelper<TUNEREQUESTTYPE, LOCATORTYPE> &a) : TNTuneRequestHelper<TUNEREQUESTTYPE, LOCATORTYPE>(a) {}
  892. TNChannelTuneRequestHelper<TUNEREQUESTTYPE, LOCATORTYPE>& operator=(TNChannelTuneRequestHelper<TUNEREQUESTTYPE, LOCATORTYPE>& rhs) {
  893. TNTuneRequestHelper<TUNEREQUESTTYPE, LOCATORTYPE>::operator=(rhs);
  894. return *this;
  895. }
  896. template<class TR, class LOC> TNChannelTuneRequestHelper<TUNEREQUESTTYPE, LOCATORTYPE>& operator=(TNTuneRequestHelper<TR, LOC>& rhs) {
  897. TNTuneRequestHelper<TUNEREQUESTTYPE, LOCATORTYPE>::operator=(TUNEREQUESTTYPE(rhs));
  898. return *this;
  899. }
  900. TNChannelTuneRequestHelper<TUNEREQUESTTYPE, LOCATORTYPE>& operator=(TUNEREQUESTTYPE& rhs) {
  901. TNTuneRequestHelper<TUNEREQUESTTYPE, LOCATORTYPE>::operator=(rhs);
  902. return *this;
  903. }
  904. TNChannelTuneRequestHelper<TUNEREQUESTTYPE, LOCATORTYPE>& operator=(IChannelTuneRequest* rhs) {
  905. TNTuneRequestHelper<TUNEREQUESTTYPE, LOCATORTYPE>::operator=(rhs);
  906. return *this;
  907. }
  908. TNChannelTuneRequestHelper<TUNEREQUESTTYPE, LOCATORTYPE>& operator=(IUnknown* rhs) {
  909. TUNEREQUESTTYPE::operator=(rhs);
  910. return *this;
  911. }
  912. long Channel() {
  913. _ASSERT(*this);
  914. long c;
  915. HRESULT hr = (*this)->get_Channel(&c);
  916. if (FAILED(hr)) {
  917. return -1;
  918. }
  919. return c;
  920. }
  921. HRESULT Channel(long c) {
  922. _ASSERT(*this);
  923. return (*this)->put_Channel(c);
  924. }
  925. };
  926. typedef TNChannelTuneRequestHelper<PQChannelTuneRequest, PQLocator> TNChannelTuneRequest;
  927. template<class TUNEREQUESTTYPE, class LOCATORTYPE> class TNATSCChannelTuneRequestHelper : public TNChannelTuneRequestHelper<TUNEREQUESTTYPE, LOCATORTYPE> {
  928. public:
  929. TNATSCChannelTuneRequestHelper() {}
  930. TNATSCChannelTuneRequestHelper(const TNTuneRequest &a) : TNChannelTuneRequestHelper<TUNEREQUESTTYPE, LOCATORTYPE>(a) {}
  931. TNATSCChannelTuneRequestHelper(IATSCChannelTuneRequest *p) : TNChannelTuneRequestHelper<TUNEREQUESTTYPE, LOCATORTYPE>(p) {}
  932. TNATSCChannelTuneRequestHelper(IUnknown *p) : TNChannelTuneRequestHelper<TUNEREQUESTTYPE, LOCATORTYPE>(p) {}
  933. TNATSCChannelTuneRequestHelper(const TNChannelTuneRequestHelper<TUNEREQUESTTYPE, LOCATORTYPE> &a) : TNChannelTuneRequestHelper<TUNEREQUESTTYPE, LOCATORTYPE>(a) {}
  934. TNATSCChannelTuneRequestHelper(const TNATSCChannelTuneRequestHelper<TUNEREQUESTTYPE, LOCATORTYPE> &a) : TNChannelTuneRequestHelper<TUNEREQUESTTYPE, LOCATORTYPE>(a) {}
  935. TNATSCChannelTuneRequestHelper<TUNEREQUESTTYPE, LOCATORTYPE>& operator=(TNATSCChannelTuneRequestHelper<TUNEREQUESTTYPE, LOCATORTYPE>& rhs) {
  936. TNChannelTuneRequestHelper<TUNEREQUESTTYPE, LOCATORTYPE>::operator=(rhs);
  937. return *this;
  938. }
  939. template<class TR, class LOC>TNATSCChannelTuneRequestHelper<TUNEREQUESTTYPE, LOCATORTYPE>& operator=(TNTuneRequestHelper<TR, LOC>& rhs) {
  940. TNChannelTuneRequestHelper<TUNEREQUESTTYPE, LOCATORTYPE>::operator=(TR(rhs));
  941. return *this;
  942. }
  943. TNATSCChannelTuneRequestHelper<TUNEREQUESTTYPE, LOCATORTYPE>& operator=(TUNEREQUESTTYPE& rhs) {
  944. TNChannelTuneRequestHelper<TUNEREQUESTTYPE, LOCATORTYPE>::operator=(rhs);
  945. return *this;
  946. }
  947. TNATSCChannelTuneRequestHelper<TUNEREQUESTTYPE, LOCATORTYPE>& operator=(IATSCChannelTuneRequest *rhs) {
  948. TNChannelTuneRequestHelper<TUNEREQUESTTYPE, LOCATORTYPE>::operator=(rhs);
  949. return *this;
  950. }
  951. TNTuneRequestHelper<TUNEREQUESTTYPE, LOCATORTYPE>& operator=(IUnknown* rhs) {
  952. TUNEREQUESTTYPE::operator=(rhs);
  953. return *this;
  954. }
  955. long MinorChannel() {
  956. _ASSERT(*this);
  957. long mc;
  958. HRESULT hr = (*this)->get_MinorChannel(&mc);
  959. if (FAILED(hr)) {
  960. return -1;
  961. }
  962. return mc;
  963. }
  964. HRESULT MinorChannel(long mc) {
  965. _ASSERT(*this);
  966. return (*this)->put_MinorChannel(mc);
  967. }
  968. };
  969. typedef TNATSCChannelTuneRequestHelper<PQATSCChannelTuneRequest, PQATSCLocator> TNATSCChannelTuneRequest;
  970. template<class TUNEREQUESTTYPE, class LOCATORTYPE> class TNDVBTuneRequestHelper : public TNTuneRequestHelper<TUNEREQUESTTYPE, LOCATORTYPE> {
  971. public:
  972. TNDVBTuneRequestHelper() {}
  973. TNDVBTuneRequestHelper(const TNTuneRequest &a) : TNTuneRequestHelper<TUNEREQUESTTYPE, LOCATORTYPE>(a) {}
  974. TNDVBTuneRequestHelper(IDVBTuneRequest *p) : TNTuneRequestHelper<TUNEREQUESTTYPE, LOCATORTYPE>(p) {}
  975. TNDVBTuneRequestHelper(IUnknown *p) : TNTuneRequestHelper<TUNEREQUESTTYPE, LOCATORTYPE>(p) {}
  976. TNDVBTuneRequestHelper(const TNTuneRequestHelper<TUNEREQUESTTYPE, LOCATORTYPE> &a) : TNTuneRequestHelper<TUNEREQUESTTYPE, LOCATORTYPE>(a) {}
  977. TNDVBTuneRequestHelper(const TNDVBTuneRequestHelper<TUNEREQUESTTYPE, LOCATORTYPE> &a) : TNTuneRequestHelper<TUNEREQUESTTYPE, LOCATORTYPE>(a) {}
  978. TNDVBTuneRequestHelper<TUNEREQUESTTYPE, LOCATORTYPE>& operator=(TNDVBTuneRequestHelper<TUNEREQUESTTYPE, LOCATORTYPE>& rhs) {
  979. TNTuneRequestHelper<TUNEREQUESTTYPE, LOCATORTYPE>::operator=(rhs);
  980. return *this;
  981. }
  982. template<class TR, class LOC> TNDVBTuneRequestHelper<TUNEREQUESTTYPE, LOCATORTYPE>& operator=(TNTuneRequestHelper<TR, LOC>& rhs) {
  983. TNTuneRequestHelper<TUNEREQUESTTYPE, LOCATORTYPE>::operator=(TUNEREQUESTTYPE(rhs));
  984. return *this;
  985. }
  986. TNDVBTuneRequestHelper<TUNEREQUESTTYPE, LOCATORTYPE>& operator=(TUNEREQUESTTYPE& rhs) {
  987. TNTuneRequestHelper<TUNEREQUESTTYPE, LOCATORTYPE>::operator=(rhs);
  988. return *this;
  989. }
  990. TNDVBTuneRequestHelper<TUNEREQUESTTYPE, LOCATORTYPE>& operator=(IDVBTuneRequest* rhs) {
  991. TNTuneRequestHelper<TUNEREQUESTTYPE, LOCATORTYPE>::operator=(rhs);
  992. return *this;
  993. }
  994. TNDVBTuneRequestHelper<TUNEREQUESTTYPE, LOCATORTYPE>& operator=(IUnknown* rhs) {
  995. TUNEREQUESTTYPE::operator=(rhs);
  996. return *this;
  997. }
  998. long ONID() {
  999. _ASSERT(*this);
  1000. long c;
  1001. HRESULT hr = (*this)->get_ONID(&c);
  1002. if (FAILED(hr)) {
  1003. return -1;
  1004. }
  1005. return c;
  1006. }
  1007. HRESULT ONID(long c) {
  1008. _ASSERT(*this);
  1009. return (*this)->put_ONID(c);
  1010. }
  1011. long TSID() {
  1012. _ASSERT(*this);
  1013. long c;
  1014. HRESULT hr = (*this)->get_TSID(&c);
  1015. if (FAILED(hr)) {
  1016. return -1;
  1017. }
  1018. return c;
  1019. }
  1020. HRESULT TSID(long c) {
  1021. _ASSERT(*this);
  1022. return (*this)->put_TSID(c);
  1023. }
  1024. long SID() {
  1025. _ASSERT(*this);
  1026. long c;
  1027. HRESULT hr = (*this)->get_SID(&c);
  1028. if (FAILED(hr)) {
  1029. return -1;
  1030. }
  1031. return c;
  1032. }
  1033. HRESULT SID(long c) {
  1034. _ASSERT(*this);
  1035. return (*this)->put_SID(c);
  1036. }
  1037. };
  1038. typedef TNDVBTuneRequestHelper<PQDVBTuneRequest, PQLocator> TNDVBTuneRequest;
  1039. }; // namespace
  1040. #ifndef NO_DEFAULT_BDATUNINGMODEL_NAMESPACE
  1041. using namespace BDATuningModel;
  1042. #endif
  1043. #endif
  1044. // end of file - tune.h