Main Page   Class Hierarchy   Compound List   File List   Compound Members  

qtvision_v4l.h

00001 // -*- c++ -*-
00002 
00003 /*
00004  *
00005  * Copyright (C) 2002 George Staikos <staikos@kde.org>
00006  * Copyright (C) 2002 Richard Moore <rich@kde.org>
00007  *
00008  * This library is free software; you can redistribute it and/or
00009  * modify it under the terms of the GNU Library General Public
00010  * License as published by the Free Software Foundation; either
00011  * version 2 of the License, or (at your option) any later version.
00012  *
00013  * This library is distributed in the hope that it will be useful,
00014  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00015  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00016  * Library General Public License for more details.
00017  *
00018  * You should have received a copy of the GNU Library General Public License
00019  * along with this library; see the file COPYING.LIB.  If not, write to
00020  * the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
00021  * Boston, MA 02111-1307, USA.
00022  */
00023 
00024 
00025 
00026 #ifndef __QVV4L_PLUGIN_H
00027 #define __QVV4L_PLUGIN_H
00028 
00029 #include <qvsrcplugin.h>
00030 #include <qmutex.h>
00031 #include <qmap.h>
00032 #include <qtimer.h>
00033 
00034 #include "v4lplugincfg.h"
00035 
00036 #include "qvideostream.h"
00037 
00038 class V4LDev;
00039 class V4LGrabber;
00040 class Clipper;
00041 
00045 class QtVisionV4L : public QVSourcePlugin
00046 {
00047     Q_OBJECT
00048 
00049 public:
00050     QtVisionV4L(QtVision *qtv, QWidget *parent = 0, const char* name = 0);
00051     virtual ~QtVisionV4L();
00052 
00056     virtual int brightness();
00057     virtual int colour();
00058     virtual int hue();
00059     virtual int contrast();
00060     virtual int whiteness();
00061     virtual int frequency();
00062     virtual bool muted();
00063     virtual int tunerMode();
00064     virtual bool isTuner();
00065     virtual int signal();
00066     virtual QColor colourKey();
00067 
00068     virtual int probeDevices();
00069 
00070     virtual bool videoPlaying() const;
00071 
00072     virtual bool event(QEvent *e);
00073 
00074     virtual int norm() const;
00075 
00076 public slots:
00080     virtual int setDevice( const QString &dev );
00081 
00085     virtual int setSource( const QString &src );
00086 
00090     virtual void setNorm( int n );
00091 
00095     virtual void setFrequency( int freq );
00096 
00100     virtual void setMuted( bool muted );
00101 
00102     virtual void setBrightness(int val);
00103     virtual void setColour(int val);
00104     virtual void setHue(int val);
00105     virtual void setContrast(int val);
00106     virtual void setWhiteness(int val);
00107 
00108     virtual void viewMoved(int x, int y);
00109     virtual void viewResized(int w, int h);
00110 
00111     virtual int startVideo();
00112     virtual int stopVideo();
00113     
00114     virtual int setVideoDesktop(bool on);
00115     virtual bool canVideoDesktop() const;
00116 
00117     virtual bool canGrabStill() const;
00118     virtual bool grabStill( QPixmap *pix );
00119 
00120     virtual bool needsNorm() const;
00121 
00122     virtual QWidget *configWidget(QWidget*, const char *);
00123     virtual void saveConfig();
00124 
00125 private:
00126     QWidget *_w;
00127     QWidget *_dtReg;
00128     QWidget *_winReg;
00129     int _wReg, _hReg;
00130     V4LDev *dev;
00131     bool _useOverlay;
00132     V4LGrabber *g;
00133     QMutex _devMtx;
00134     QMap<QString,QString> _devNames;
00135     bool _probed;
00136     QVideoStream *_vs;
00137     QString _currentDev;
00138     int _norm;
00139     Clipper *_clipper;
00140     bool _capturing;
00141     V4LPluginCfg *_cfgWidget;
00142     int _qvsMethod;
00143     int _gsn;  // grabber sequence number
00144     bool _dvbs;
00145 
00146     int v4lSetup();
00147 
00148     bool _doRefresh;
00149     QPoint _refresh_ul;
00150     QSize _refresh_sz;
00151     
00152 private slots:
00153     void triggerRepaint();
00154     void updateClipping();
00155     void repaintRegion(QPoint ul, QSize sz);
00156 };
00157 
00158 
00159 class Clipper : public QWidget {
00160 Q_OBJECT
00161 public:
00162     Clipper();
00163     ~Clipper();
00164 
00165     void setWidget(QWidget *w);
00166 signals:
00167     void updateClipping();
00168 
00169 protected:
00170     bool x11Event(XEvent *e);
00171     QWidget *_w;
00172 };
00173 
00174 
00175 #endif
00176 

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