Camstream: CamStream API documentation

Main Page Class Hierarchy Compound List File List Compound Members File Members

# WebCamViewer.h

Go to the documentation of this file.

    00001 #ifndef WEBCAMVIEWER_HPP
    00002 #define WEBCAMVIEWER_HPP
    00003
    00004 #ifdef HAVE_CONFIG_H
    00005 #incude <config.h>
    00006 #endif
    00007
    00008 #include <qpixmap.h>
    00009 #include <qbutton.h>
    00010 #include <qdatetime.h>
    00011 #include <qtimer.h>
    00012 #include <qurloperator.h>
    00013 #include <qvaluelist.h>
    00014
    00015 #include "lib/FTPClient.h"
    00016 #include "VideoDevice.h"
    00017
    00018 #include "gui/SnapshotSettingsDlg.h"
    00019 #include "gui/TimeSnapshot.h"
    00020 #include "gui/VideoSettingsDlg.h"
    00021
    00022 #include "CamWindow.h"
    00023 #include "BasicPanel.h"
    00024 #include "ImagePanelRGB.h"
    00025 #include "ImagePanelYUV.h"
    00026
    00027 class CWebCamViewer: public CCamWindow
    00028 {
    00029    Q_OBJECT
    00030 private:
    00031    enum {
    00032      pbt_controls,
    00033      pbt_config,
    00034      pbt_showsnap,
    00035      pbt_snapshot,
    00036      pbt_timesnap,
    00037      pbt_sound,
    00038      pbt_MAX,
    00039    } PushButtons;
    00040    QPixmap ButtonPix[pbt_MAX];
    00041    QToolButton *pButton[pbt_MAX];
    00042
    00043    CVideoDevice *pVideo;
    00044    CCamPanel *pViewer;
    00045    CBasicPanel *pLastSnapshot;
    00046    QTimer *SizeTimer;
    00047
    00048    SVideoOptions *pVOptions;
    00049    CSnapshotSettingsDlg *pConfiguration;
    00050    CVideoSettingsDlg *pSettings;
    00051
    00052    CTimeSnapDlg *pTimeSnapDlg;
    00053    int SnapInterval, SnapCounter;
    00054    QTimer *pSnapTimer;
    00055    QLabel *pSnapLabel;
    00056
    00058    struct FTPCommandStruct
    00059    {
    00060       int Command;
    00061       QString Param[4];
    00062    };
    00063
    00064    struct {
    00065      CFTPClient *pClient;
    00066      QList<FTPCommandStruct> Commands;
    00067
    00068      QString LocalFile, RemoteFile;
    00069
    00070      QTime StartTime;
    00071      bool ErrorCondition, DelAfter;
    00072    } Upload;
    00073
    00074    void StartFTPUpload(const QString &, bool);
    00075    void StopFTP();
    00076    void TriggerNextFTPCommand();
    00077
    00078 private slots:
    00079    void ClickedConfigurationDlg();
    00080    void ConfigurationDlgClosed();
    00081
    00082    // Settings dialog
    00083    void ClickedSettingsDlg();
    00084    void SettingsDlgClosed();
    00085
    00086    void ClickedShowLastSnapshot();
    00087
    00088    void ClickedTimeSnapDlg();
    00089    void TimeSnapDlgClosed();
    00090
    00091    void ClickedSoundOnOff();
    00092
    00093    void FTPChangeState(int command, int new_state, int result, const QString &server_msg);
    00094    void NextFTPCommand();
    00095
    00096    void StartTimeSnap();
    00097    void StopTimeSnap();
    00098    void TimeSnapTick();
    00099    void TakeSnapshot();
    00100
    00101 protected:
    00102    void RecalcTotalViewSize();
    00103
    00104 protected slots:
    00105    void DeviceChangedSize(const QSize &size);
    00106    void DeviceError(int err_no);
    00107
    00108    void CallAdjustSize();
    00109
    00110 public:
    00111    CWebCamViewer(CVideoDevice *video, const QSize &hint_size, QWidget *parent = 0, const char *name = 0);
    00112    virtual ~CWebCamViewer();
    00113
    00114 virtual void showMaximized();
    00115 };
    00116
    00117 #endif