From 898361db1d687bff759e11052a02cb57797223e8 Mon Sep 17 00:00:00 2001 From: Hans Verkuil Date: Sun, 18 Jun 2006 20:05:09 +0200 Subject: Added qv4l2, a Qt application to interactively set/get controls. From: Hans Verkuil Signed-off-by: Hans Verkuil --- test/qv4l2/qv4l2.h | 79 ++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 79 insertions(+) create mode 100644 test/qv4l2/qv4l2.h (limited to 'test/qv4l2/qv4l2.h') 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 +#include +#include +#include +#include +#include + +#define __user +#include + +class QTextEdit; + +typedef std::vector ClassIDVec; +typedef std::map ClassMap; +typedef std::map CtrlMap; +typedef std::map 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 -- cgit v1.2.3 From 24461bbacbddc49d1b13d6f2da9f66e13e68a680 Mon Sep 17 00:00:00 2001 From: Hans Verkuil Date: Thu, 29 Jun 2006 00:57:21 +0200 Subject: Add support for a/v input/output selection From: Hans Verkuil Add missing audio output enumeration to v4l2-ctl. Add input/output and audio input/output selection to qv4l2. Signed-off-by: Hans Verkuil --- test/qv4l2/qv4l2.h | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'test/qv4l2/qv4l2.h') diff --git a/test/qv4l2/qv4l2.h b/test/qv4l2/qv4l2.h index f3ecf7262..75b423ebf 100644 --- a/test/qv4l2/qv4l2.h +++ b/test/qv4l2/qv4l2.h @@ -51,11 +51,16 @@ protected: 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); -- cgit v1.2.3 From 24b1fd51ad61526a8e259344df1353193148e97b Mon Sep 17 00:00:00 2001 From: Hans Verkuil Date: Thu, 29 Jun 2006 01:06:20 +0200 Subject: Update audio input after changing video input From: Hans Verkuil Changing the video input implies an audio input change. So update the audio input combobox. Signed-off-by: Hans Verkuil --- test/qv4l2/qv4l2.h | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'test/qv4l2/qv4l2.h') diff --git a/test/qv4l2/qv4l2.h b/test/qv4l2/qv4l2.h index 75b423ebf..1b3bc4ed6 100644 --- a/test/qv4l2/qv4l2.h +++ b/test/qv4l2/qv4l2.h @@ -21,7 +21,7 @@ #define __user #include -class QTextEdit; +class QComboBox; typedef std::vector ClassIDVec; typedef std::map ClassMap; @@ -78,6 +78,9 @@ private: CtrlMap ctrlMap; WidgetMap widgetMap; ClassMap classMap; + + // General tab + QComboBox *audioInput; }; -- cgit v1.2.3