#ifndef DSTUNER_H_
#define DSTUNER_H_
#include <string>
#include "Tuner_avcap.h"
#include "avcap-export.h"
class IAMTVAudio;
class IAMTVTuner;
class IBaseFilter;
namespace avcap
{
class DS_DeviceDescriptor;
class AVCAP_Export DS_Tuner : public Tuner
{
private:
#pragma warning( disable : 4800 )
enum
{
TUNER_RADIO = 0x00080000,
TUNER_ANALOG_TV = 0x00020000
};
int mIndex;
std::string mName;
int mType;
int mCapabilities;
unsigned int mRangeHigh;
unsigned int mRangeLow;
double mStep;
double mFreq;
private:
DS_DeviceDescriptor* mDSDeviceDescriptor;
public:
DS_Tuner(DS_DeviceDescriptor *dd, int index, const std::string &name,
int type, int caps, unsigned int high, unsigned int low);
virtual ~DS_Tuner();
inline bool isRadioTuner() const
{ return mType & TUNER_RADIO; }
inline bool isTVTuner() const
{ return mType & TUNER_ANALOG_TV; }
int setStereo();
int setMono();
int setSAP();
int setLang1();
int setLang2();
double getFreq() const;
inline double getFreqStep() const
{ return mStep; }
inline double getMinFreq() const
{ return mRangeLow*mStep; }
inline double getMaxFreq() const
{ return mRangeHigh*mStep; }
const std::string getName() const
{ return mName; }
int getSignalStrength() const;
int increaseFreq();
int decreaseFreq();
int setFreq(double f);
private:
int setAudioMode(int mode);
int getAudioMode();
bool getIAMTVTunerInterfaceFromFilter(IBaseFilter *Filter,
IAMTVTuner **Tuner) const;
bool getIAMTVAudioInterfaceFromFilter(IBaseFilter *Filter,
IAMTVAudio **Audio);
};
}
#endif