Debian Codegraph @

samples/qtvidcap/v4lwindow.h

raw
1 #ifndef V4LWINDOW_H
2 #define V4LWINDOW_H
3
4 #include <avm_stl.h>
5 #include <avm_locker.h>
6 #include <avm_output.h>
7
8 #include <qwidget.h>
9 #include <qtimer.h>
10
11 AVM_BEGIN_NAMESPACE;
12 class AvicapRenderer;
13 AVM_END_NAMESPACE;
14
15 class v4lxif;
16 class AviCapDialog;
17 class ClosedCaption;
18 class PicturePropDialog;
19 class ShmRenderer;
20 class TimerTable;
21 class EpgWindow;
22
23 struct CaptureConfig;
24
25 class QPopupMenu;
26 class QLabel;
27
28
29 #define Q_MyCloseEvent QEvent::Type(QEvent::User+2)
30
31 class V4LWindow: public QWidget, public avm::AvmOutputLog
32 {
33 Q_OBJECT;
34
35 friend class AviCapDialog;
36 public:
37 enum Modes { Overlay, Preview, DeinterlacedPreview,AvicapRend,MultiChannel };
38
39 V4LWindow(v4lxif* pDev, QWidget* pParent=0);
40 ~V4LWindow();
41 void setupDevice();
42 void setAutoRecord() { m_bAutoRecord = true; }
43 void unregisterCapDialog() { m_pCapDialog = 0; }
44 void scanXawtv();
45 void get_clips();
46 ClosedCaption* getcc() { return m_pCC; }
47 Modes getMode() const { return m_eMode; }
48 void setMode(Modes m);
49 AviCapDialog *getCaptureDialog() { return m_pCapDialog; }
50 void captureAVI(CaptureConfig *capconf);
51 void startTimer();
52 void lock(bool lock);
53 void avicap_renderer_popup();
54 void avicap_renderer_close();
55 void avicap_renderer_stop();
56 void avicap_renderer_keypress(int sym,int mod);
57 void makePopup();
58 void keyPress(int k,int key);
59 virtual bool event(QEvent* e);
60
61 void multichannel_increase_tiles(bool inc);
62 void multichannel_increase_speed(bool inc);
63
64 public slots:
65 void captureAVI();
66 void captureBMP();
67 void captureJPG();
68 void config();
69 void deinterlaced_preview();
70 void force4x3();
71 void hidePopup();
72 void overlay();
73 void picprop();
74 void timertable();
75 void epgwindow();
76 void fullscreen();
77 void maximize();
78 void avicap_renderer();
79 void avicap_renderer_display();
80 void multichannel();
81 void multichannel_display();
82 void multichannel_stop();
83 void preview();
84 void preview_display();
85 void setXawtv(int);
86 void changeChannel(int);
87 void showsub();
88 void timerStop();
89 void updatesub();
90 void ratioTimerStop();
91
92 protected: // x11 stuff for handling overlay clipping
93 void postResizeEvent(int w, int h);
94 void sendQt(QEvent *e);
95 void setupSubtitles();
96 void setupPicDimensions(int* =0, int* =0);
97 void getOverlaySizeAndOffset(int *pw, int *ph, int* pdx=0, int* pdy=0);
98
99 void avicap_renderer_resize_input(int w,int h);
100
101 virtual bool x11Event( XEvent * );
102 virtual void focusInEvent( QFocusEvent * );
103 virtual void focusOutEvent( QFocusEvent * );
104 virtual void hideEvent( QHideEvent * );
105 virtual void keyPressEvent( QKeyEvent * );
106 virtual void mouseReleaseEvent( QMouseEvent * );
107 virtual void moveEvent( QMoveEvent * );
108 virtual void paintEvent( QPaintEvent * );
109 virtual void resizeEvent( QResizeEvent * );
110 virtual void showEvent( QShowEvent * );
111 void add_clip(int x1, int y1, int x2, int y2);
112 void refresh_timer();
113
114 v4lxif* m_pDev;
115 ShmRenderer* m_pRenderer;
116
117 int wmap;
118 int visibility;
119
120 int conf;
121 int oc_count;
122 struct OVERLAY_CLIP {
123 int x1, y1, x2, y2;
124 } oc[64];
125
126 Modes m_eMode;
127 private:
128 int m_iPainter;
129 avm::PthreadMutex m_Mutex;
130 PicturePropDialog* m_pPicConfig;
131 TimerTable *m_pTimerTable;
132 EpgWindow *m_pEpgWindow;
133 AviCapDialog* m_pCapDialog;
134 ClosedCaption* m_pCC;
135 QPopupMenu* m_pPopup;
136 QLabel* m_pLabel;
137 QTimer m_timer;
138 QTimer m_cctimer;
139 QTimer m_CaptureTimer;
140 QTimer m_avicapTimer;
141 QTimer m_multichannelTimer;
142 QTimer m_RatioTimer;
143 struct xawtvstation {
144 avm::string sname;
145 avm::string input;
146 avm::string channel;
147 int finetune;
148 int key;
149 };
150 avm::string freqtable;
151 avm::vector<xawtvstation> xawtvstations;
152 bool m_bForce4x3;
153 bool m_bSubtitles;
154 bool known_pos;
155 bool m_bAutoRecord;
156 bool m_bMoved;
157 int last_station;
158
159 //avicap/sdl/yuv/fs-renderer
160 avm::AvicapRenderer *fs_renderer;
161 int fsr_width,fsr_height;
162
163 //multichannel
164 int mc_oldw,mc_oldh,mc_curw,mc_curh,mc_grabw,mc_grabh;
165 int mc_startchannel,mc_curchannel,mc_count;
166 int mc_switch,mc_tiles;
167
168 public:
169 avm::string getXawtvStation(int i) { return xawtvstations[i].sname; }
170 int getStations() { return xawtvstations.size(); }
171 };
172
173 #endif // V4LWINDOW_H