include/avcap/windows/DS_Tuner.h

Go to the documentation of this file.
00001 /*
00002  * (c) 2005, 2008 Nico Pranke <Nico.Pranke@googlemail.com>, Robin Luedtke <RobinLu@gmx.de> 
00003  *
00004  * This file is part of avcap.
00005  *
00006  * avcap is free software: you can redistribute it and/or modify
00007  * it under the terms of the GNU General Public License as published by
00008  * the Free Software Foundation, either version 3 of the License, or
00009  * (at your option) any later version.
00010  *
00011  * avcap is distributed in the hope that it will be useful,
00012  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00013  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00014  * GNU General Public License for more details.
00015  *
00016  * You should have received a copy of the GNU General Public License
00017  * along with avcap.  If not, see <http://www.gnu.org/licenses/>.
00018  */
00019 
00020 /* avcap is free for non-commercial use.
00021  * To use it in commercial endeavors, please contact Nico Pranke <Nico.Pranke@googlemail.com>.
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, // CAP_RADIO --> see "HelpFunc.h" file
00062                         TUNER_ANALOG_TV = 0x00020000 // CAP_TUNER --> see "HelpFunc.h" file
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_

Generated on Mon Nov 30 11:10:30 2009 for avcap-0.1 by  doxygen 1.5.1