]> git.sesse.net Git - vlc/blob - modules/gui/qt4/components/open_panels.hpp
Qt4 - Open Capture. Only build what you do have. :D
[vlc] / modules / gui / qt4 / components / open_panels.hpp
1 /*****************************************************************************
2  * open.hpp : Panels for the open dialogs
3  ****************************************************************************
4  * Copyright (C) 2006-2007 the VideoLAN team
5  * Copyright (C) 2007 Société des arts technologiques
6  * Copyright (C) 2007 Savoir-faire Linux
7  * $Id$
8  *
9  * Authors: Clément Stenac <zorglub@videolan.org>
10  *          Jean-Baptiste Kempf <jb@videolan.org>
11  *          Pierre-Luc Beaudoin <pierre-luc.beaudoin@savoirfairelinux.com>
12  *
13  * This program is free software; you can redistribute it and/or modify
14  * it under the terms of the GNU General Public License as published by
15  * the Free Software Foundation; either version 2 of the License, or
16  * (at your option) any later version.
17  *
18  * This program is distributed in the hope that it will be useful,
19  * but WITHOUT ANY WARRANTY; without even the implied warranty of
20  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
21  * GNU General Public License for more details.
22  *
23  * You should have received a copy of the GNU General Public License
24  * along with this program; if not, write to the Free Software
25  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
26  *****************************************************************************/
27
28 #ifndef _OPENPANELS_H_
29 #define _OPENPANELS_H_
30
31 #include <vlc/vlc.h>
32
33 #include <QFileDialog>
34
35 #include "ui/open_file.h"
36 #include "ui/open_disk.h"
37 #include "ui/open_net.h"
38 #include "ui/open_capture.h"
39
40 #ifdef HAVE_LIMITS_H
41 #   include <limits.h>
42 #endif
43
44 #define setSpinBoxFreq( spinbox ){ spinbox->setRange ( 0, INT_MAX ); \
45     spinbox->setAccelerated( true ); }
46
47 enum
48 {
49     V4L_DEVICE,
50     V4L2_DEVICE,
51     PVR_DEVICE,
52     DVB_DEVICE,
53     BDA_DEVICE,
54     DSHOW_DEVICE,
55     SCREEN_DEVICE,
56     JACK_DEVICE
57 };
58
59 class QWidget;
60 class QLineEdit;
61 class QString;
62
63 class OpenPanel: public QWidget
64 {
65     Q_OBJECT;
66 public:
67     OpenPanel( QWidget *p, intf_thread_t *_p_intf ) : QWidget( p )
68     {
69         p_intf = _p_intf;
70     }
71     virtual ~OpenPanel() {};
72     virtual void clear() = 0;
73 protected:
74     intf_thread_t *p_intf;
75 public slots:
76     virtual void updateMRL() = 0;
77 signals:
78     void mrlUpdated( QString );
79     void methodChanged( QString method );
80 };
81
82 class FileOpenBox: public QFileDialog
83 {
84     Q_OBJECT;
85 public:
86     FileOpenBox( QWidget *parent, const QString &caption,
87         const QString &directory, const QString &filter ):
88         QFileDialog( parent, caption, directory, filter ) {}
89 public slots:
90     void accept();
91 };
92
93 class FileOpenPanel: public OpenPanel
94 {
95     Q_OBJECT;
96 public:
97     FileOpenPanel( QWidget *, intf_thread_t * );
98     virtual ~FileOpenPanel();
99     virtual void clear() ;
100     virtual void accept() ;
101 private:
102     Ui::OpenFile ui;
103     QStringList browse( QString );
104     FileOpenBox *dialogBox;
105     QLineEdit *lineFileEdit;
106     QStringList fileCompleteList ;
107 public slots:
108     virtual void updateMRL();
109 private slots:
110     void browseFileSub();
111     void toggleSubtitleFrame();
112 };
113
114 class NetOpenPanel: public OpenPanel
115 {
116     Q_OBJECT;
117 public:
118     NetOpenPanel( QWidget *, intf_thread_t * );
119     virtual ~NetOpenPanel();
120     virtual void clear() ;
121 private:
122     Ui::OpenNetwork ui;
123 public slots:
124     virtual void updateMRL();
125 private slots:
126     void updateProtocol( int );
127 };
128
129 class DiscOpenPanel: public OpenPanel
130 {
131     Q_OBJECT;
132 public:
133     DiscOpenPanel( QWidget *, intf_thread_t * );
134     virtual ~DiscOpenPanel();
135     virtual void clear() ;
136     virtual void accept() ;
137 private:
138     Ui::OpenDisk ui;
139     char *psz_dvddiscpath, *psz_vcddiscpath, *psz_cddadiscpath;
140     bool b_firstdvd, b_firstvcd, b_firstcdda;
141 public slots:
142     virtual void updateMRL() ;
143 private slots:
144     void browseDevice();
145     void updateButtons() ;
146 };
147
148
149 class CaptureOpenPanel: public OpenPanel
150 {
151     Q_OBJECT;
152 public:
153     CaptureOpenPanel( QWidget *, intf_thread_t * );
154     virtual ~CaptureOpenPanel();
155     virtual void clear() ;
156 private:
157     Ui::OpenCapture ui;
158 #ifdef WIN32
159     QRadioButton *bdas, *bdat, *bdac;
160     QSpinBox *bdaCard, *bdaFreq, *bdaSrate;
161     QLabel *bdaSrateLabel, *bdaBandLabel;
162     QComboBox *bdaBandBox;
163 #else
164     QRadioButton *dvbs, *dvbt, *dvbc;
165     QSpinBox  *v4lFreq, *pvrFreq, *pvrBitr;
166     QLineEdit *v4lVideoDevice, *v4lAudioDevice;
167     QLineEdit *v4l2VideoDevice, *v4l2AudioDevice;
168     QLineEdit *pvrDevice, *pvrRadioDevice;
169     QComboBox *v4lNormBox, *v4l2StdBox, *pvrNormBox;
170     QSpinBox *dvbCard, *dvbFreq, *dvbSrate;
171     QSpinBox *jackChannels, *jackCaching;
172     QCheckBox *jackPace, *jackConnect;
173     QLineEdit *jackPortsSelected;
174 #endif
175
176 public slots:
177     virtual void updateMRL();
178 private slots:
179     void updateButtons();
180 };
181
182 #endif