00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023 #ifndef CHANNELSCANNER_H
00024 #define CHANNELSCANNER_H
00025
00026 #include <qdom.h>
00027 #include <qobject.h>
00028
00029 class Channel;
00030 class ChannelStore;
00031 class ChannelScannerRegion;
00032 class QVSourcePlugin;
00033
00039 class ChannelScanner : public QObject
00040 {
00041 Q_OBJECT
00042
00043 public:
00044 ChannelScanner( QObject *parent=0, const char *name=0 );
00045 virtual ~ChannelScanner();
00046
00047 void setDevice( QVSourcePlugin *device );
00048 QVSourcePlugin *device() const { return dev; }
00049
00050 void setStore( ChannelStore *store );
00051 ChannelStore *store() const { return chanStore; }
00052
00056 bool loadRegionFile( const QString &filename );
00057
00061 Channel *channel() const { return chan; }
00062
00063 public slots:
00070 void scan();
00071
00072 signals:
00076 void started();
00077
00081 void progress( int );
00082
00086 void done();
00087
00093 void done( bool success );
00094
00098 void foundChannel();
00099
00100 protected:
00104 bool first();
00105
00110 bool next();
00111
00115 bool last();
00116
00122 bool scanCurrent();
00123
00127 bool regionFirst();
00128
00132 bool regionNext();
00133
00134 protected slots:
00138 void addChannel();
00139
00144 void scanChunk();
00145
00146 private:
00147 QVSourcePlugin *dev;
00148 unsigned long freq;
00149 unsigned long min;
00150 unsigned long max;
00151 unsigned long start;
00152 int adj;
00153
00154 int percentDone;
00155 unsigned long lastProgress;
00156 unsigned long onePercent;
00157 unsigned long oneChunk;
00158
00159 ChannelStore *chanStore;
00160 Channel *chan;
00161 ChannelScannerRegion *region;
00162 };
00163
00164 #endif // CHANNELSCANNER_H