Main Page   Class Hierarchy   Compound List   File List   Compound Members  

channelscanner.h

00001 // -*- c++ -*-
00002 
00003 /*
00004  *
00005  * Copyright (C) 2002 Richard Moore <rich@kde.org>
00006  *
00007  * This library is free software; you can redistribute it and/or
00008  * modify it under the terms of the GNU Library General Public
00009  * License as published by the Free Software Foundation; either
00010  * version 2 of the License, or (at your option) any later version.
00011  *
00012  * This library is distributed in the hope that it will be useful,
00013  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00014  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00015  * Library General Public License for more details.
00016  *
00017  * You should have received a copy of the GNU Library General Public License
00018  * along with this library; see the file COPYING.LIB.  If not, write to
00019  * the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
00020  * Boston, MA 02111-1307, USA.
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

Generated at Thu Jan 30 02:56:02 2003 for QtVision by doxygen1.2.9.1 written by Dimitri van Heesch, © 1997-2001