~ubuntu-branches/ubuntu/precise/v4l-utils/precise

« back to all changes in this revision

Viewing changes to utils/qv4l2-qt4/general-tab.h

  • Committer: Bazaar Package Importer
  • Author(s): Gregor Jasny
  • Date: 2010-02-28 19:44:15 UTC
  • Revision ID: james.westby@ubuntu.com-20100228194415-067hdj8rvawj91zw
Tags: upstream-0.7.90
ImportĀ upstreamĀ versionĀ 0.7.90

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/* qv4l2: a control panel controlling v4l2 devices.
 
2
 *
 
3
 * Copyright (C) 2006 Hans Verkuil <hverkuil@xs4all.nl>
 
4
 *
 
5
 * This program is free software; you can redistribute it and/or
 
6
 * modify it under the terms of the GNU General Public License
 
7
 * as published by the Free Software Foundation; either version 2
 
8
 * of the License, or (at your option) any later version.
 
9
 *
 
10
 * This program is distributed in the hope that it will be useful,
 
11
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 
12
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 
13
 * GNU General Public License for more details.
 
14
 *
 
15
 * You should have received a copy of the GNU General Public License
 
16
 * along with this program; if not, write to the Free Software
 
17
 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
 
18
 */
 
19
 
 
20
 
 
21
#ifndef GENERAL_TAB_H
 
22
#define GENERAL_TAB_H
 
23
 
 
24
#include <QSpinBox>
 
25
#include <sys/time.h>
 
26
#include <linux/videodev2.h>
 
27
#include "qv4l2.h"
 
28
#include "v4l2-api.h"
 
29
 
 
30
class QComboBox;
 
31
class QSpinBox;
 
32
 
 
33
class GeneralTab: public QGridLayout, public v4l2
 
34
{
 
35
        Q_OBJECT
 
36
 
 
37
public:
 
38
        GeneralTab(const QString &device, v4l2 &fd, int n, QWidget *parent = 0);
 
39
        virtual ~GeneralTab() {}
 
40
 
 
41
        CapMethod capMethod();
 
42
        int width() const { return m_width; }
 
43
        int height() const { return m_height; }
 
44
 
 
45
private slots:
 
46
        void inputChanged(int);
 
47
        void outputChanged(int);
 
48
        void inputAudioChanged(int);
 
49
        void outputAudioChanged(int);
 
50
        void standardChanged(int);
 
51
        void freqTableChanged(int);
 
52
        void freqChannelChanged(int);
 
53
        void freqChanged(int);
 
54
        void vidCapFormatChanged(int);
 
55
        void frameWidthChanged();
 
56
        void frameHeightChanged();
 
57
        void frameSizeChanged(int);
 
58
        void frameIntervalChanged(int);
 
59
        void vidOutFormatChanged(int);
 
60
 
 
61
private:
 
62
        void updateVideoInput();
 
63
        void updateVideoOutput();
 
64
        void updateAudioInput();
 
65
        void updateAudioOutput();
 
66
        void updateStandard();
 
67
        void updateFreq();
 
68
        void updateFreqChannel();
 
69
        void updateVidCapFormat();
 
70
        void updateFrameSize(unsigned w, unsigned h);
 
71
        void updateFrameInterval(unsigned w, unsigned h);
 
72
        void updateVidOutFormat();
 
73
 
 
74
        void addWidget(QWidget *w, Qt::Alignment align = Qt::AlignLeft);
 
75
        void addLabel(const QString &text, Qt::Alignment align = Qt::AlignRight)
 
76
        {
 
77
                addWidget(new QLabel(text, parentWidget()), align);
 
78
        }
 
79
        void info(const QString &info)
 
80
        {
 
81
                g_mw->info(info);
 
82
        }
 
83
        virtual void error(const QString &error)
 
84
        {
 
85
                g_mw->error(error);
 
86
        }
 
87
 
 
88
        int m_row;
 
89
        int m_col;
 
90
        int m_cols;
 
91
        struct v4l2_tuner m_tuner;
 
92
        struct v4l2_capability m_querycap;
 
93
        __u32 m_pixelformat;
 
94
        __u32 m_width, m_height;
 
95
 
 
96
        // General tab
 
97
        QComboBox *m_videoInput;
 
98
        QComboBox *m_videoOutput;
 
99
        QComboBox *m_audioInput;
 
100
        QComboBox *m_audioOutput;
 
101
        QComboBox *m_tvStandard;
 
102
        QSpinBox  *m_freq;
 
103
        QComboBox *m_freqTable;
 
104
        QComboBox *m_freqChannel;
 
105
        QComboBox *m_vidCapFormats;
 
106
        QComboBox *m_frameSize;
 
107
        QSpinBox *m_frameWidth;
 
108
        QSpinBox *m_frameHeight;
 
109
        QComboBox *m_frameInterval;
 
110
        QComboBox *m_vidOutFormats;
 
111
        QComboBox *m_capMethods;
 
112
        QGridLayout *m_layout;
 
113
};
 
114
 
 
115
#endif