summaryrefslogtreecommitdiff
path: root/test/qv4l2/qv4l2.h
diff options
context:
space:
mode:
authorPatrick Boettcher <pb@linuxtv.org>2006-07-04 17:58:23 +0200
committerPatrick Boettcher <pb@linuxtv.org>2006-07-04 17:58:23 +0200
commit8fbac88a9c801be025c283275f2eb6585a5cc454 (patch)
treebd82f6b1848d218e56f57805fdc569b9574e8089 /test/qv4l2/qv4l2.h
parentc0b0560a9ed6e97eca6da5f8432c0dbb2fe471ad (diff)
parent54b507ede0a1c5349b47f84af7d3d0b417467e3a (diff)
downloadmediapointer-dvb-s2-8fbac88a9c801be025c283275f2eb6585a5cc454.tar.gz
mediapointer-dvb-s2-8fbac88a9c801be025c283275f2eb6585a5cc454.tar.bz2
sync with master
From: Patrick Boettcher <pb@linuxtv.org> sync with master Signed-off-by: Patrick Boettcher <pb@linuxtv.org>
Diffstat (limited to 'test/qv4l2/qv4l2.h')
-rw-r--r--test/qv4l2/qv4l2.h87
1 files changed, 87 insertions, 0 deletions
diff --git a/test/qv4l2/qv4l2.h b/test/qv4l2/qv4l2.h
new file mode 100644
index 000000000..1b3bc4ed6
--- /dev/null
+++ b/test/qv4l2/qv4l2.h
@@ -0,0 +1,87 @@
+/****************************************************************************
+** $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 QComboBox;
+
+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 inputChanged(int);
+ void outputChanged(int);
+ void inputAudioChanged(int);
+ void outputAudioChanged(int);
+
+ void about();
+
+private:
+ void addTabs();
+ void addGeneralTab();
+ 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;
+
+ // General tab
+ QComboBox *audioInput;
+};
+
+
+#endif