00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025 #ifndef DSTUNER_H_
00026 #define DSTUNER_H_
00027
00028 #include <string>
00029
00030 #include "Tuner_avcap.h"
00031 #include "avcap-export.h"
00032
00033 class IAMTVAudio;
00034 class IAMTVTuner;
00035 class IBaseFilter;
00036
00037 namespace avcap
00038 {
00039 class DS_DeviceDescriptor;
00040
00042
00053 class AVCAP_Export DS_Tuner : public Tuner
00054 {
00055 private:
00056
00057 #pragma warning( disable : 4800 )
00058
00059 enum
00060 {
00061 TUNER_RADIO = 0x00080000,
00062 TUNER_ANALOG_TV = 0x00020000
00063 };
00064
00065 int mIndex;
00066 std::string mName;
00067 int mType;
00068 int mCapabilities;
00069 unsigned int mRangeHigh;
00070 unsigned int mRangeLow;
00071 double mStep;
00072 double mFreq;
00073
00074 private:
00075 DS_DeviceDescriptor* mDSDeviceDescriptor;
00076
00077 public:
00078 DS_Tuner(DS_DeviceDescriptor *dd, int index, const std::string &name,
00079 int type, int caps, unsigned int high, unsigned int low);
00080
00081 virtual ~DS_Tuner();
00082
00083 inline bool isRadioTuner() const
00084 { return mType & TUNER_RADIO; }
00085
00086 inline bool isTVTuner() const
00087 { return mType & TUNER_ANALOG_TV; }
00088
00089 int setStereo();
00090
00091 int setMono();
00092
00093 int setSAP();
00094
00095 int setLang1();
00096
00097 int setLang2();
00098
00099 double getFreq() const;
00100
00101 inline double getFreqStep() const
00102 { return mStep; }
00103
00104 inline double getMinFreq() const
00105 { return mRangeLow*mStep; }
00106
00107 inline double getMaxFreq() const
00108 { return mRangeHigh*mStep; }
00109
00110 const std::string getName() const
00111 { return mName; }
00112
00113 int getSignalStrength() const;
00114
00115 int increaseFreq();
00116
00117 int decreaseFreq();
00118
00119 int setFreq(double f);
00120
00121 private:
00122 int setAudioMode(int mode);
00123
00124 int getAudioMode();
00125
00126 bool getIAMTVTunerInterfaceFromFilter(IBaseFilter *Filter,
00127 IAMTVTuner **Tuner) const;
00128
00129 bool getIAMTVAudioInterfaceFromFilter(IBaseFilter *Filter,
00130 IAMTVAudio **Audio);
00131 };
00132 }
00133
00134 #endif // DSTUNER_H_