summaryrefslogtreecommitdiff
path: root/test/qv4l2/qv4l2.h
diff options
context:
space:
mode:
authorMauro Carvalho Chehab <mchehab@infradead.org>2006-06-25 01:18:06 -0300
committerMauro Carvalho Chehab <mchehab@infradead.org>2006-06-25 01:18:06 -0300
commit18928f84d7e9e4c5ee002d2127f28a3ea8daf8db (patch)
tree19e2cd4e514586be67c37c0d8ec3df78a1948d36 /test/qv4l2/qv4l2.h
parent6c9a1ff458d27546b0417368fe92a1442a0a609d (diff)
parent04e2c76f8d845ee90c1e85ee6a170618b22ff933 (diff)
downloadmediapointer-dvb-s2-18928f84d7e9e4c5ee002d2127f28a3ea8daf8db.tar.gz
mediapointer-dvb-s2-18928f84d7e9e4c5ee002d2127f28a3ea8daf8db.tar.bz2
merge: http://linuxtv.org/hg/~manu/v4l-algo
From: Mauro Carvalho Chehab <mchehab@infradead.org> Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
Diffstat (limited to 'test/qv4l2/qv4l2.h')
-rw-r--r--test/qv4l2/qv4l2.h79
1 files changed, 79 insertions, 0 deletions
diff --git a/test/qv4l2/qv4l2.h b/test/qv4l2/qv4l2.h
new file mode 100644
index 000000000..f3ecf7262
--- /dev/null
+++ b/test/qv4l2/qv4l2.h
@@ -0,0 +1,79 @@
+/****************************************************************************
+** $Id: qt/application.h 3.3.6 edited Aug 31 2005 $
+**
+** Copyright (C) 1992-2005 Trolltech AS. All rights reserved.
+**
+** This file is part of an example program for Qt. This example
+** program may be used, distributed and modified without limitation.
+**
+*****************************************************************************/
+
+#ifndef APPLICATION_H
+#define APPLICATION_H
+
+#include <qmainwindow.h>
+#include <qtabwidget.h>
+#include <qsignalmapper.h>
+#include <qgrid.h>
+#include <map>
+#include <vector>
+
+#define __user
+#include <linux/videodev2.h>
+
+class QTextEdit;
+
+typedef std::vector<unsigned> ClassIDVec;
+typedef std::map<unsigned, ClassIDVec> ClassMap;
+typedef std::map<unsigned, struct v4l2_queryctrl> CtrlMap;
+typedef std::map<unsigned, QWidget *> WidgetMap;
+
+enum {
+ CTRL_UPDATE_ON_CHANGE = 0x10,
+ CTRL_DEFAULTS,
+ CTRL_REFRESH,
+ CTRL_UPDATE
+};
+
+class ApplicationWindow: public QMainWindow
+{
+ Q_OBJECT
+
+public:
+ ApplicationWindow();
+ ~ApplicationWindow();
+
+ void setDevice(const QString &device);
+
+protected:
+ void closeEvent( QCloseEvent* );
+
+private slots:
+ void choose();
+ void ctrlAction(int);
+
+ void about();
+
+private:
+ void addTabs();
+ void finishGrid(QWidget *vbox, QGrid *grid, unsigned ctrl_class, bool odd);
+ void addCtrl(QGrid *grid, const struct v4l2_queryctrl &qctrl);
+ void updateCtrl(unsigned id);
+ void refresh(unsigned ctrl_class);
+ void setDefaults(unsigned ctrl_class);
+ int getVal(unsigned id);
+ long long getVal64(unsigned id);
+ void setVal(unsigned id, int v);
+ void setVal64(unsigned id, long long v);
+
+ QString filename;
+ QSignalMapper *sigMapper;
+ QTabWidget *tabs;
+ int fd;
+ CtrlMap ctrlMap;
+ WidgetMap widgetMap;
+ ClassMap classMap;
+};
+
+
+#endif