00001
#ifndef WEBCAMVIEWER_HPP
00002
#define WEBCAMVIEWER_HPP
00003
00004
#ifdef HAVE_CONFIG_H
00005
#include "config.h"
00006
#endif
00007
00008
#include <qpixmap.h>
00009
#include <qbutton.h>
00010
#include <qdatetime.h>
00011
#include <qglobal.h>
00012
#include <qtimer.h>
00013
#include <qurloperator.h>
00014
#include <qvaluelist.h>
00015
#if QT_VERSION >= 0x30000
00016
#include <qprocess.h>
00017
#endif
00018
00019
#include "lib/FTPClient.h"
00020
#include "AudioDevice.h"
00021
#include "AudioDisplayVolume.h"
00022
#include "VideoDevice.h"
00023
00024
#include "gui/AudioSettingsDlg.h"
00025
#include "gui/SnapshotSettingsDlg.h"
00026
#include "gui/TimeSnapshot.h"
00027
00028
#include "CamWindow.h"
00029
#include "BasicPanel.h"
00030
#include "ImagePanelRGB.h"
00031
#include "ImagePanelYUV.h"
00032
00033
class CWebCamViewer:
public CCamWindow
00034 {
00035 Q_OBJECT
00036
private:
00037
enum {
00038 pbt_ctl_size,
00039 pbt_ctl_video,
00040 pbt_ctl_input,
00041 pbt_ctl_tuner,
00042 pbt_mute,
00043 pbt_config,
00044 pbt_showsnap,
00045 pbt_snapshot,
00046 pbt_timesnap,
00047 pbt_snd_config,
00048 pbt_MAX,
00049 } PushButtons;
00050 QToolButton *pButton[pbt_MAX];
00051
00052
CVideoDevice *pVideo;
00053
CCamPanel *pViewer;
00054
CBasicPanel *pLastSnapshot;
00055 QTimer m_SizeTimer;
00056
00057
CVideoOptions *pVOptions;
00058
CSnapshotSettingsDlg *m_pSnapshotSettingsDlg;
00059
00060
int m_SnapInterval, m_SnapCounter;
00061 QTimer *pSnapTimer;
00062 QLabel *pSnapLabel;
00063
00065
struct FTPCommandStruct
00066 {
00067
int Command;
00068 QString Param[4];
00069 };
00070
00071
struct _Upload {
00072
CFTPClient *pClient;
00073 QList<FTPCommandStruct> Commands;
00074
00075 QString LocalFile, RemoteFile;
00076
00077 QTime StartTime;
00078
bool ErrorCondition;
00079 } Upload;
00080
00081
#if QT_VERSION >= 0x30000
00082
struct _Command {
00083 QProcess Process;
00084 QString FileName;
00085
bool Delete;
00086 } m_ExternalCommand;
00087
#endif
00088
00089
void StartFTPUpload(
const QString &local,
const QString &remote,
bool);
00090
void StopFTP();
00091
void TriggerNextFTPCommand();
00092
00093
void StartSubProcess(
const QString &command,
const QString &filename,
bool del_after_use);
00094
00095
private slots:
00096
void ClickedVideoConfig();
00097
void ClickedShowLastSnapshot();
00098
void ClickedTimeSnapDlg();
00099
void ClickedSoundOnOff();
00100
00101
void FTPChangeState(
int command,
int new_state,
int result,
const QString &server_msg);
00102
void NextFTPCommand();
00103
void FTPClosed();
00104
00105
void SubProcessDone();
00106
00107
void StartTimeSnap(
int interval);
00108
void StopTimeSnap();
00109
void TimeSnapTick();
00110
void TakeSnapshot();
00111
00112
00113
void CycleNextChannel();
00114
void CyclePrevChannel();
00115
void NewChannelSelected();
00116
00117
protected:
00118
void RecalcTotalViewSize();
00119
00120
protected slots:
00121
void DeviceChangedSize(
const QSize &size);
00122
void DeviceError(
int err_no);
00123
00124
void CallAdjustSize();
00125
00126
public:
00127
CWebCamViewer(
CVideoDevice *video, QWidget *parent = 0,
const char *name = 0);
00128
virtual ~CWebCamViewer();
00129
00130
virtual void showMaximized();
00131 };
00132
00133
#endif