//------------------------------------------------------------------------------ // File: Tune.h // // Desc: Additional infrastructure to extend the tuner.idl. Works nicely // from C++. // // Copyright (c) 1999 - 2001, Microsoft Corporation. All rights reserved. //------------------------------------------------------------------------------ #pragma once #ifndef TUNE_H #define TUNE_H #include namespace BDATuningModel { const long DEFAULT_MIN_CHANNEL = 2; const long DEFAULT_MAX_CHANNEL = 999; const long DEFAULT_MIN_FREQUENCY = 535; //bottom us am const long DEFAULT_MAX_FREQUENCY = 108000; // top us fm const long DEFAULT_ANALOG_TUNER_COUNTRY_CODE = 1; //usa const TunerInputType DEFAULT_ANALOG_TUNER_INPUT_TYPE = TunerInputCable; //usa typedef CComQIPtr PQTuningSpaceContainer; typedef CComQIPtr PQTuningSpace; typedef CComQIPtr PQAnalogRadioTuningSpace; typedef CComQIPtr PQAnalogTVTuningSpace; typedef CComQIPtr PQATSCTuningSpace; typedef CComQIPtr PQTuneRequest; typedef CComQIPtr PQChannelTuneRequest; typedef CComQIPtr PQATSCChannelTuneRequest; typedef CComQIPtr PQLocator; typedef CComQIPtr PQATSCLocator; typedef CComQIPtr PQDVBTuningSpace; typedef CComQIPtr PQDVBTuneRequest; typedef CComQIPtr PQDVBSLocator; typedef CComQIPtr PQDVBTLocator; // tuning space container class TNTuningSpaceContainer : public PQTuningSpaceContainer { TNTuningSpaceContainer() {} TNTuningSpaceContainer(const PQTuningSpaceContainer &a) : PQTuningSpaceContainer(a) {} TNTuningSpaceContainer(ITuningSpace *p) : PQTuningSpaceContainer(p) {} TNTuningSpaceContainer(IUnknown *p) : PQTuningSpaceContainer(p) {} TNTuningSpaceContainer(const TNTuningSpaceContainer &a) : PQTuningSpaceContainer(a) {} TNTuningSpaceContainer& operator=(TNTuningSpaceContainer& rhs) { PQTuningSpaceContainer::operator=(rhs); return *this; } }; // tuning spaces template class TNTuningSpaceHelper : public TUNINGSPACETYPE { public: TNTuningSpaceHelper() {} TNTuningSpaceHelper(const TUNINGSPACETYPE &a) : TUNINGSPACETYPE(a) {} TNTuningSpaceHelper(ITuningSpace *p) : TUNINGSPACETYPE(p) {} TNTuningSpaceHelper(IUnknown *p) : TUNINGSPACETYPE(p) {} TNTuningSpaceHelper(const TNTuningSpaceHelper &a) : TUNINGSPACETYPE(a) {} TNTuningSpaceHelper& operator=(TNTuningSpaceHelper& rhs) { TUNINGSPACETYPE::operator=(rhs); return *this; } TNTuningSpaceHelper& operator=(TUNINGSPACETYPE& rhs) { TUNINGSPACETYPE::operator=(rhs); return *this; } TNTuningSpaceHelper& operator=(IUnknown *rhs) { TUNINGSPACETYPE::operator=(rhs); return *this; } TNTuningSpaceHelper& operator=(ITuningSpace *rhs) { TUNINGSPACETYPE::operator=(rhs); return *this; } bool operator==(TUNINGSPACETYPE& rhs) { CComBSTR rhsname; HRESULT hr = rhs->get_UniqueName(&rhsname); if (FAILED(hr)) { return false; } CComBSTR name; hr = (*this)->get_UniqueName(&name); if (FAILED(hr)) { return false; } return name == rhsname; } bool operator!=(TUNINGSPACETYPE& rhs) { return !operator==(rhs); } PQTuneRequest CreateTuneRequest() { PQTuneRequest p; HRESULT hr = (*this)->CreateTuneRequest(&p); if (FAILED(hr)) { return PQTuneRequest(); } return p; } PQLocator Locator() { _ASSERT(*this); PQLocator ts; HRESULT hr = (*this)->get_DefaultLocator(&ts); if (FAILED(hr)) { return PQLocator(); } return ts; } HRESULT Locator(PQLocator& l) { _ASSERT(*this); return (*this)->put_Locator(l); } void Clone() { PQTuningSpace t; HRESULT hr = (*this)->Clone(&t); if (FAILED(hr) || !t) { Release(); // clone failed, clear ourselves return; } TUNINGSPACETYPE::operator=(t); } }; typedef TNTuningSpaceHelper TNTuningSpace; template class TNAnalogRadioTuningSpaceHelper : public TNTuningSpaceHelper { public: TNAnalogRadioTuningSpaceHelper() {} TNAnalogRadioTuningSpaceHelper(const TUNINGSPACETYPE &a) : TNTuningSpaceHelper(a) {} TNAnalogRadioTuningSpaceHelper(IUnknown *p) : TNTuningSpaceHelper(p) {} TNAnalogRadioTuningSpaceHelper(const TNAnalogRadioTuningSpaceHelper &a) : TNTuningSpaceHelper(a) {} TNAnalogRadioTuningSpaceHelper& operator=(TNAnalogRadioTuningSpaceHelper& rhs) { TNTuningSpaceHelper::operator=(rhs); return *this; } template TNAnalogRadioTuningSpaceHelper& operator=(TNTuningSpaceHelper& rhs) { TNTuningSpaceHelper::operator=(TUNINGSPACETYPE(rhs)); return *this; } TNAnalogRadioTuningSpaceHelper& operator=(TUNINGSPACETYPE& rhs) { TNTuningSpaceHelper::operator=(rhs); return *this; } TNAnalogRadioTuningSpaceHelper& operator=(IUnknown* rhs) { TNTuningSpaceHelper::operator=(rhs); return *this; } long MaxFrequency() { _ASSERT(*this); long freq; HRESULT hr = (*this)->get_MaxFrequency(&freq); if (FAILED(hr)) { freq = DEFAULT_MAX_FREQUENCY; } return freq; } HRESULT MaxFrequency(long freq) { _ASSERT(*this); return (*this)->put_MaxFrequency(freq); } long MinFrequency() { _ASSERT(*this); long freq; HRESULT hr = (*this)->get_MinFrequency(&freq); if (FAILED(hr)) { freq = DEFAULT_MIN_FREQUENCY; } return freq; } HRESULT MinFrequency(long freq) { _ASSERT(*this); return (*this)->put_MinFrequency(freq); } }; typedef TNAnalogRadioTuningSpaceHelper TNAnalogRadioTuningSpace; template class TNAnalogTVTuningSpaceHelper : public TNTuningSpaceHelper { public: TNAnalogTVTuningSpaceHelper() {} TNAnalogTVTuningSpaceHelper(const TUNINGSPACETYPE &a) : TNTuningSpaceHelper(a) {} TNAnalogTVTuningSpaceHelper(IUnknown *p) : TNTuningSpaceHelper(p) {} TNAnalogTVTuningSpaceHelper(const TNAnalogTVTuningSpaceHelper &a) : TNTuningSpaceHelper(a) {} TNAnalogTVTuningSpaceHelper& operator=(TNAnalogTVTuningSpaceHelper& rhs) { TNTuningSpaceHelper::operator=(rhs); return *this; } template TNAnalogTVTuningSpaceHelper& operator=(TNTuningSpaceHelper& rhs) { TNTuningSpaceHelper::operator=(TUNINGSPACETYPE(rhs)); return *this; } TNAnalogTVTuningSpaceHelper& operator=(TUNINGSPACETYPE& rhs) { TNTuningSpaceHelper::operator=(rhs); return *this; } TNAnalogTVTuningSpaceHelper& operator=(IUnknown* rhs) { TNTuningSpaceHelper::operator=(rhs); return *this; } TunerInputType InputType() { _ASSERT(*this); TunerInputType ti; HRESULT hr = (*this)->get_InputType(&ti); if (FAILED(hr)) { ti = DEFAULT_ANALOG_TUNER_INPUT_TYPE; } return ti; } HRESULT InputType(TunerInputType ti) { _ASSERT(*this); return (*this)->put_InputType(&ti); } long CountryCode() { _ASSERT(*this); long cc; HRESULT hr = (*this)->get_CountryCode(&cc); if (FAILED(hr)) { cc = DEFAULT_ANALOG_TUNER_INPUT_TYPE; } return cc; } HRESULT CountryCode(long cc) { _ASSERT(*this); return (*this)->put_CountryCode(cc); } long MinChannel() { _ASSERT(*this); long chan; HRESULT hr = (*this)->get_MinChannel(&chan); if (FAILED(hr)) { chan = DEFAULT_MIN_CHANNEL; } return chan; } HRESULT MinChannel(long chan) { _ASSERT(*this); return (*this)->put_MinChannel(chan); } long MaxChannel() { _ASSERT(*this); long chan; HRESULT hr = (*this)->get_MaxChannel(&chan); if (FAILED(hr)) { chan = DEFAULT_MAX_CHANNEL; } return chan; } HRESULT MaxChannel(long chan) { _ASSERT(*this); return (*this)->put_MaxChannel(chan); } }; typedef TNAnalogTVTuningSpaceHelper TNAnalogTVTuningSpace; template class TNATSCTuningSpaceHelper : public TNAnalogTVTuningSpaceHelper { public: TNATSCTuningSpaceHelper() {} TNATSCTuningSpaceHelper(const TUNINGSPACETYPE &a) : TNAnalogTVTuningSpaceHelper(a) {} TNATSCTuningSpaceHelper(IUnknown *p) : TNAnalogTVTuningSpaceHelper(p) {} TNATSCTuningSpaceHelper(const TNATSCTuningSpaceHelper &a) : TNAnalogTVTuningSpaceHelper(a) {} TNATSCTuningSpaceHelper& operator=(TNATSCTuningSpaceHelper& rhs) { TNAnalogTVTuningSpaceHelper::operator=(rhs); return *this; } template TNATSCTuningSpaceHelper& operator=(TNTuningSpaceHelper& rhs) { TNAnalogTVTuningSpaceHelper::operator=(TUNINGSPACETYPE(rhs)); return *this; } TNATSCTuningSpaceHelper& operator=(TUNINGSPACETYPE& rhs) { TNAnalogTVTuningSpaceHelper::operator=(rhs); return *this; } TNATSCTuningSpaceHelper& operator=(IUnknown* rhs) { TNAnalogTVTuningSpaceHelper::operator=(rhs); return *this; } long MinMinorChannel() { _ASSERT(*this); long chan; HRESULT hr = (*this)->get_MinMinorChannel(&chan); if (FAILED(hr)) { chan = DEFAULT_MIN_CHANNEL; } return chan; } HRESULT MinMinorChannel(long chan) { _ASSERT(*this); return (*this)->put_MinMinorChannel(chan); } long MaxMinorChannel() { _ASSERT(*this); long chan; HRESULT hr = (*this)->get_MaxMinorChannel(&chan); if (FAILED(hr)) { chan = DEFAULT_MAX_CHANNEL; } return chan; } HRESULT MaxMinorChannel(long chan) { _ASSERT(*this); return (*this)->put_MaxMinorChannel(chan); } long MinPhysicalChannel() { _ASSERT(*this); long chan; HRESULT hr = (*this)->get_MinPhysicalChannel(&chan); if (FAILED(hr)) { chan = DEFAULT_MIN_CHANNEL; } return chan; } HRESULT MinPhysicalChannel(long chan) { _ASSERT(*this); return (*this)->put_MinPhysicalChannel(chan); } long MaxPhysicalChannel() { _ASSERT(*this); long chan; HRESULT hr = (*this)->get_MaxPhysicalChannel(&chan); if (FAILED(hr)) { chan = DEFAULT_MAX_CHANNEL; } return chan; } HRESULT MaxPhysicalChannel(long chan) { _ASSERT(*this); return (*this)->put_MaxPhysicalChannel(chan); } }; typedef TNATSCTuningSpaceHelper TNATSCTuningSpace; // dvb tuning space template class TNDVBTuningSpaceHelper : public TNTuningSpaceHelper { public: TNDVBTuningSpaceHelper() {} TNDVBTuningSpaceHelper(const TUNINGSPACETYPE &a) : TNTuningSpaceHelper(a) {} TNDVBTuningSpaceHelper(IUnknown *p) : TNTuningSpaceHelper(p) {} TNDVBTuningSpaceHelper(const TNDVBTuningSpaceHelper &a) : TNTuningSpaceHelper(a) {} TNDVBTuningSpaceHelper& operator=(TNDVBTuningSpaceHelper& rhs) { TNTuningSpaceHelper::operator=(rhs); return *this; } template TNDVBTuningSpaceHelper& operator=(TNTuningSpaceHelper& rhs) { TNTuningSpaceHelper::operator=(TUNINGSPACETYPE(rhs)); return *this; } TNDVBTuningSpaceHelper& operator=(TUNINGSPACETYPE& rhs) { TNTuningSpaceHelper::operator=(rhs); return *this; } TNDVBTuningSpaceHelper& operator=(IUnknown* rhs) { TNTuningSpaceHelper::operator=(rhs); return *this; } DVBSystemType SystemType() const { DVBSystemType st; HRESULT hr = (*this)->get_SystemType(&st); if (FAILED(hr)) { return DVB_Cable; } return st; } HRESULT SystemType(DVBSystemType st) { _ASSERT(*this); return (*this)->put_SystemType(st); } }; typedef TNDVBTuningSpaceHelper TNDVBTuningSpace; // locators template class TNLocatorHelper : public LOCATORTYPE { public: TNLocatorHelper() {} TNLocatorHelper(const LOCATORTYPE &a) : LOCATORTYPE(a) {} TNLocatorHelper(IUnknown *p) : LOCATORTYPE(p) {} TNLocatorHelper(const TNLocatorHelper &a) : LOCATORTYPE(a) {} TNLocatorHelper(ILocator *p) : LOCATORTYPE(p) {} TNLocatorHelper& operator=(TNLocatorHelper& rhs) { LOCATORTYPE::operator=(rhs); return *this; } TNLocatorHelper& operator=(LOCATORTYPE& rhs) { LOCATORTYPE::operator=(rhs); return *this; } TNLocatorHelper& operator=(ILocator* rhs) { LOCATORTYPE::operator=(rhs); return *this; } TNLocatorHelper& operator=(IUnknown* rhs) { LOCATORTYPE::operator=(rhs); return *this; } void Clone() { PQLocator t; HRESULT hr = (*this)->Clone(&t); if (FAILED(hr) || !t) { Release(); // clone failed, clear ourselves return; } LOCATORTYPE::operator=(t); } long CarrierFrequency() { _ASSERT(*this); long f; HRESULT hr = (*this)->get_CarrierFrequency(&f); if (FAILED(hr)) { return -1; } return f; } HRESULT CarrierFrequency(long f) { _ASSERT(*this); return (*this)->put_CarrierFrequency(f); } FECMethod InnerFEC() { _ASSERT(*this); FECMethod f; HRESULT hr = (*this)->get_InnerFEC(&f); if (FAILED(hr)) { return BDA_FEC_METHOD_NOT_SET; } return f; } HRESULT InnerFEC(FECMethod f) { _ASSERT(*this); return (*this)->put_InnerFEC(f); } BinaryConvolutionCodeRate InnerFECRate() { _ASSERT(*this); BinaryConvolutionCodeRate f; HRESULT hr = (*this)->get_InnerFECRate(&f); if (FAILED(hr)) { return BDA_BCC_RATE_NOT_SET; } return f; } HRESULT InnerFECRate(BinaryConvolutionCodeRate f) { _ASSERT(*this); return (*this)->put_InnerFECRate(f); } FECMethod OuterFEC() { _ASSERT(*this); FECMethod f; HRESULT hr = (*this)->get_OuterFEC(&f); if (FAILED(hr)) { return BDA_FEC_METHOD_NOT_SET; } return f; } HRESULT OuterFEC(FECMethod f) { _ASSERT(*this); return (*this)->put_OuterFEC(f); } BinaryConvolutionCodeRate OuterFECRate() { _ASSERT(*this); BinaryConvolutionCodeRate f; HRESULT hr = (*this)->get_OuterFECRate(&f); if (FAILED(hr)) { return BDA_BCC_RATE_NOT_SET; } return f; } HRESULT OuterFECRate(BinaryConvolutionCodeRate f) { _ASSERT(*this); return (*this)->put_OuterFECRate(f); } ModulationType Modulation() { _ASSERT(*this); ModulationType f; HRESULT hr = (*this)->get_Modulation(&f); if (FAILED(hr)) { return BDA_MOD_NOT_SET; } return f; } HRESULT Modulation(ModulationType f) { _ASSERT(*this); return (*this)->put_Modulation(f); } long SymbolRate() { _ASSERT(*this); long f; HRESULT hr = (*this)->get_SymbolRate(&f); if (FAILED(hr)) { return -1; } return f; } HRESULT SymbolRate(long f) { _ASSERT(*this); return (*this)->put_SymbolRate(f); } }; typedef TNLocatorHelper TNLocator; template class TNATSCLocatorHelper : public TNLocatorHelper { public: TNATSCLocatorHelper() {} TNATSCLocatorHelper(const LOCATORTYPE &a) : TNLocatorHelper(a) {} TNATSCLocatorHelper(IUnknown *p) : TNLocatorHelper(p) {} TNATSCLocatorHelper(const TNATSCLocatorHelper &a) : TNLocatorHelper(a) {} TNATSCLocatorHelper(IATSCLocator *p) : TNLocatorHelper(p) {} TNATSCLocatorHelper(const TNLocatorHelper &a) : TNLocatorHelper(a) {} TNATSCLocatorHelper& operator=(TNATSCLocatorHelper& rhs) { TNLocatorHelper::operator=(rhs); return *this; } TNATSCLocatorHelper& operator=(TNLocatorHelper& rhs) { TNLocatorHelper::operator=(rhs); return *this; } TNATSCLocatorHelper& operator=(LOCATORTYPE& rhs) { TNLocatorHelper::operator=(rhs); return *this; } TNATSCLocatorHelper& operator=(IATSCLocator* rhs) { TNLocatorHelper::operator=(rhs); return *this; } TNATSCLocatorHelper& operator=(IUnknown* rhs) { TNLocatorHelper::operator=(rhs); return *this; } long PhysicalChannel() { _ASSERT(*this); long pc; HRESULT hr = (*this)->get_PhysicalChannel(&pc); if (FAILED(hr)) { return -1; } return pc; } HRESULT PhysicalChannel(long pc) { _ASSERT(*this); return (*this)->put_PhysicalChannel(pc); } long TSID() { _ASSERT(*this); long pc; HRESULT hr = (*this)->get_TSID(&pc); if (FAILED(hr)) { return -1; } return pc; } HRESULT TSID(long pc) { _ASSERT(*this); return (*this)->put_TSID(pc); } long ProgramNumber() { _ASSERT(*this); long pc; HRESULT hr = (*this)->get_ProgramNumber(&pc); if (FAILED(hr)) { return -1; } return pc; } HRESULT ProgramNumber(long pc) { _ASSERT(*this); return (*this)->put_ProgramNumber(pc); } }; typedef TNATSCLocatorHelper TNATSCLocator; // tune requests template class TNTuneRequestHelper : public TUNEREQUESTTYPE { public: TNTuneRequestHelper() {} TNTuneRequestHelper(const TUNEREQUESTTYPE &a) : TUNEREQUESTTYPE(a) {} TNTuneRequestHelper(IUnknown *p) : TUNEREQUESTTYPE(p) {} TNTuneRequestHelper(const TNTuneRequestHelper &a) : TUNEREQUESTTYPE(a) {} TNTuneRequestHelper(ITuneRequest *p) : TUNEREQUESTTYPE(p) {} TNTuneRequestHelper& operator=(TNTuneRequestHelper& rhs) { TUNEREQUESTTYPE::operator=(rhs); return *this; } TNTuneRequestHelper& operator=(TUNEREQUESTTYPE& rhs) { TUNEREQUESTTYPE::operator=(rhs); return *this; } TNTuneRequestHelper& operator=(ITuneRequest* rhs) { TUNEREQUESTTYPE::operator=(rhs); return *this; } TNTuneRequestHelper& operator=(IUnknown* rhs) { TUNEREQUESTTYPE::operator=(rhs); return *this; } // this function creates a new instance of the base ITuneRequest* and copies // all the values of the current ITuneRequest and sets this to the new one // this provides the value semantics needed by the network providers void Clone() { PQTuneRequest t; HRESULT hr = (*this)->Clone(&t); if (FAILED(hr) || !t) { Release(); // clone failed, clear ourselves return; } TUNEREQUESTTYPE::operator=(t); } PQTuningSpace TuningSpace() { _ASSERT(*this); PQTuningSpace ts; HRESULT hr = (*this)->get_TuningSpace(&ts); if (FAILED(hr)) { return PQTuningSpace(); } return ts; } LOCATORTYPE Locator() { _ASSERT(*this); PQLocator pc; HRESULT hr = (*this)->get_Locator(&pc); if (FAILED(hr)) { return PQLocator().p; } return pc.p; } HRESULT Locator(LOCATORTYPE& pc) { _ASSERT(*this); return (*this)->put_Locator(pc); } }; typedef TNTuneRequestHelper TNTuneRequest; template class TNChannelTuneRequestHelper : public TNTuneRequestHelper { public: TNChannelTuneRequestHelper() {} TNChannelTuneRequestHelper(const TNTuneRequest &a) : TNTuneRequestHelper(a) {} TNChannelTuneRequestHelper(IChannelTuneRequest *p) : TNTuneRequestHelper(p) {} TNChannelTuneRequestHelper(IUnknown *p) : TNTuneRequestHelper(p) {} TNChannelTuneRequestHelper(const TNTuneRequestHelper &a) : TNTuneRequestHelper(a) {} TNChannelTuneRequestHelper(const TNChannelTuneRequestHelper &a) : TNTuneRequestHelper(a) {} TNChannelTuneRequestHelper& operator=(TNChannelTuneRequestHelper& rhs) { TNTuneRequestHelper::operator=(rhs); return *this; } template TNChannelTuneRequestHelper& operator=(TNTuneRequestHelper& rhs) { TNTuneRequestHelper::operator=(TUNEREQUESTTYPE(rhs)); return *this; } TNChannelTuneRequestHelper& operator=(TUNEREQUESTTYPE& rhs) { TNTuneRequestHelper::operator=(rhs); return *this; } TNChannelTuneRequestHelper& operator=(IChannelTuneRequest* rhs) { TNTuneRequestHelper::operator=(rhs); return *this; } TNChannelTuneRequestHelper& operator=(IUnknown* rhs) { TUNEREQUESTTYPE::operator=(rhs); return *this; } long Channel() { _ASSERT(*this); long c; HRESULT hr = (*this)->get_Channel(&c); if (FAILED(hr)) { return -1; } return c; } HRESULT Channel(long c) { _ASSERT(*this); return (*this)->put_Channel(c); } }; typedef TNChannelTuneRequestHelper TNChannelTuneRequest; template class TNATSCChannelTuneRequestHelper : public TNChannelTuneRequestHelper { public: TNATSCChannelTuneRequestHelper() {} TNATSCChannelTuneRequestHelper(const TNTuneRequest &a) : TNChannelTuneRequestHelper(a) {} TNATSCChannelTuneRequestHelper(IATSCChannelTuneRequest *p) : TNChannelTuneRequestHelper(p) {} TNATSCChannelTuneRequestHelper(IUnknown *p) : TNChannelTuneRequestHelper(p) {} TNATSCChannelTuneRequestHelper(const TNChannelTuneRequestHelper &a) : TNChannelTuneRequestHelper(a) {} TNATSCChannelTuneRequestHelper(const TNATSCChannelTuneRequestHelper &a) : TNChannelTuneRequestHelper(a) {} TNATSCChannelTuneRequestHelper& operator=(TNATSCChannelTuneRequestHelper& rhs) { TNChannelTuneRequestHelper::operator=(rhs); return *this; } templateTNATSCChannelTuneRequestHelper& operator=(TNTuneRequestHelper& rhs) { TNChannelTuneRequestHelper::operator=(TR(rhs)); return *this; } TNATSCChannelTuneRequestHelper& operator=(TUNEREQUESTTYPE& rhs) { TNChannelTuneRequestHelper::operator=(rhs); return *this; } TNATSCChannelTuneRequestHelper& operator=(IATSCChannelTuneRequest *rhs) { TNChannelTuneRequestHelper::operator=(rhs); return *this; } TNTuneRequestHelper& operator=(IUnknown* rhs) { TUNEREQUESTTYPE::operator=(rhs); return *this; } long MinorChannel() { _ASSERT(*this); long mc; HRESULT hr = (*this)->get_MinorChannel(&mc); if (FAILED(hr)) { return -1; } return mc; } HRESULT MinorChannel(long mc) { _ASSERT(*this); return (*this)->put_MinorChannel(mc); } }; typedef TNATSCChannelTuneRequestHelper TNATSCChannelTuneRequest; template class TNDVBTuneRequestHelper : public TNTuneRequestHelper { public: TNDVBTuneRequestHelper() {} TNDVBTuneRequestHelper(const TNTuneRequest &a) : TNTuneRequestHelper(a) {} TNDVBTuneRequestHelper(IDVBTuneRequest *p) : TNTuneRequestHelper(p) {} TNDVBTuneRequestHelper(IUnknown *p) : TNTuneRequestHelper(p) {} TNDVBTuneRequestHelper(const TNTuneRequestHelper &a) : TNTuneRequestHelper(a) {} TNDVBTuneRequestHelper(const TNDVBTuneRequestHelper &a) : TNTuneRequestHelper(a) {} TNDVBTuneRequestHelper& operator=(TNDVBTuneRequestHelper& rhs) { TNTuneRequestHelper::operator=(rhs); return *this; } template TNDVBTuneRequestHelper& operator=(TNTuneRequestHelper& rhs) { TNTuneRequestHelper::operator=(TUNEREQUESTTYPE(rhs)); return *this; } TNDVBTuneRequestHelper& operator=(TUNEREQUESTTYPE& rhs) { TNTuneRequestHelper::operator=(rhs); return *this; } TNDVBTuneRequestHelper& operator=(IDVBTuneRequest* rhs) { TNTuneRequestHelper::operator=(rhs); return *this; } TNDVBTuneRequestHelper& operator=(IUnknown* rhs) { TUNEREQUESTTYPE::operator=(rhs); return *this; } long ONID() { _ASSERT(*this); long c; HRESULT hr = (*this)->get_ONID(&c); if (FAILED(hr)) { return -1; } return c; } HRESULT ONID(long c) { _ASSERT(*this); return (*this)->put_ONID(c); } long TSID() { _ASSERT(*this); long c; HRESULT hr = (*this)->get_TSID(&c); if (FAILED(hr)) { return -1; } return c; } HRESULT TSID(long c) { _ASSERT(*this); return (*this)->put_TSID(c); } long SID() { _ASSERT(*this); long c; HRESULT hr = (*this)->get_SID(&c); if (FAILED(hr)) { return -1; } return c; } HRESULT SID(long c) { _ASSERT(*this); return (*this)->put_SID(c); } }; typedef TNDVBTuneRequestHelper TNDVBTuneRequest; }; // namespace #ifndef NO_DEFAULT_BDATUNINGMODEL_NAMESPACE using namespace BDATuningModel; #endif #endif // end of file - tune.h