open_panels.hpp 4.76 KB
Newer Older
zorglub's avatar
zorglub committed
1 2 3
/*****************************************************************************
 * open.hpp : Panels for the open dialogs
 ****************************************************************************
4
 * Copyright (C) 2006-2009 the VideoLAN team
Jean-Baptiste Kempf's avatar
Jean-Baptiste Kempf committed
5 6
 * Copyright (C) 2007 Société des arts technologiques
 * Copyright (C) 2007 Savoir-faire Linux
7
 * $Id$
zorglub's avatar
zorglub committed
8 9
 *
 * Authors: Clément Stenac <zorglub@videolan.org>
zorglub's avatar
zorglub committed
10
 *          Jean-Baptiste Kempf <jb@videolan.org>
Jean-Baptiste Kempf's avatar
Jean-Baptiste Kempf committed
11
 *          Pierre-Luc Beaudoin <pierre-luc.beaudoin@savoirfairelinux.com>
zorglub's avatar
zorglub committed
12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30
 *
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation; either version 2 of the License, or
 * (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program; if not, write to the Free Software
 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
 *****************************************************************************/

#ifndef _OPENPANELS_H_
#define _OPENPANELS_H_

Christophe Mutricy's avatar
Christophe Mutricy committed
31 32 33 34
#ifdef HAVE_CONFIG_H
# include "config.h"
#endif

Jean-Baptiste Kempf's avatar
Jean-Baptiste Kempf committed
35
#include "components/preferences_widgets.hpp"
36

37
#include "ui/open_file.h"
38 39
#include "ui/open_disk.h"
#include "ui/open_net.h"
40
#include "ui/open_capture.h"
zorglub's avatar
zorglub committed
41

Jean-Baptiste Kempf's avatar
Jean-Baptiste Kempf committed
42
#include <QFileDialog>
43

44
#include <limits.h>
45

46 47
#define setSpinBoxFreq( spinbox ){ spinbox->setRange ( 0, INT_MAX ); \
    spinbox->setAccelerated( true ); }
48

49 50 51 52 53 54 55 56
enum
{
    NO_PROTO,
    HTTP_PROTO,
    HTTPS_PROTO,
    MMS_PROTO,
    FTP_PROTO,
    RTSP_PROTO,
57
    RTP_PROTO,
58
    UDP_PROTO,
59
    RTMP_PROTO
60 61
};

62 63 64
enum
{
    V4L_DEVICE,
65
    V4L2_DEVICE,
66 67 68 69 70 71 72
    PVR_DEVICE,
    DVB_DEVICE,
    BDA_DEVICE,
    DSHOW_DEVICE,
    SCREEN_DEVICE,
    JACK_DEVICE
};
73

74
class QWidget;
75
class QLineEdit;
76
class QString;
77
class QStringListModel;
78

zorglub's avatar
zorglub committed
79 80 81 82 83 84 85 86
class OpenPanel: public QWidget
{
    Q_OBJECT;
public:
    OpenPanel( QWidget *p, intf_thread_t *_p_intf ) : QWidget( p )
    {
        p_intf = _p_intf;
    }
zorglub's avatar
zorglub committed
87 88 89
    virtual ~OpenPanel() {};
    virtual void clear() = 0;
protected:
zorglub's avatar
zorglub committed
90 91
    intf_thread_t *p_intf;
public slots:
zorglub's avatar
zorglub committed
92 93
    virtual void updateMRL() = 0;
signals:
94
    void mrlUpdated( QStringList, QString );
zorglub's avatar
zorglub committed
95
    void methodChanged( QString method );
zorglub's avatar
zorglub committed
96 97 98 99 100 101 102 103
};

class FileOpenPanel: public OpenPanel
{
    Q_OBJECT;
public:
    FileOpenPanel( QWidget *, intf_thread_t * );
    virtual ~FileOpenPanel();
zorglub's avatar
zorglub committed
104
    virtual void clear() ;
105
    virtual void accept() ;
zorglub's avatar
zorglub committed
106
private:
107
    Ui::OpenFile ui;
zorglub's avatar
zorglub committed
108
public slots:
zorglub's avatar
zorglub committed
109 110
    virtual void updateMRL();
private slots:
111
    void browseFileSub();
112
    void browseFile();
113
    void deleteFile();
114
    void toggleSubtitleFrame( bool );
zorglub's avatar
zorglub committed
115 116
};

117 118 119 120 121 122
class NetOpenPanel: public OpenPanel
{
    Q_OBJECT;
public:
    NetOpenPanel( QWidget *, intf_thread_t * );
    virtual ~NetOpenPanel();
zorglub's avatar
zorglub committed
123
    virtual void clear() ;
124
private:
125
    Ui::OpenNetwork ui;
126
    QStringListModel *mrlList;
127
public slots:
zorglub's avatar
zorglub committed
128 129
    virtual void updateMRL();
private slots:
130
    void updateProtocol( int );
131
    void updateCompleter();
132 133
};

134
class DiscOpenPanel: public OpenPanel
135 136 137
{
    Q_OBJECT;
public:
138 139
    DiscOpenPanel( QWidget *, intf_thread_t * );
    virtual ~DiscOpenPanel();
zorglub's avatar
zorglub committed
140
    virtual void clear() ;
141
    virtual void accept() ;
142 143
private:
    Ui::OpenDisk ui;
144 145
    char *psz_dvddiscpath, *psz_vcddiscpath, *psz_cddadiscpath;
    bool b_firstdvd, b_firstvcd, b_firstcdda;
146
public slots:
zorglub's avatar
zorglub committed
147
    virtual void updateMRL() ;
148 149
private slots:
    void browseDevice();
150
    void updateButtons() ;
151
    void eject();
152 153
};

154 155 156 157 158 159 160 161 162 163

class CaptureOpenPanel: public OpenPanel
{
    Q_OBJECT;
public:
    CaptureOpenPanel( QWidget *, intf_thread_t * );
    virtual ~CaptureOpenPanel();
    virtual void clear() ;
private:
    Ui::OpenCapture ui;
164 165
    bool isInitialized;

166 167
    QString advMRL;
    QDialog *adv;
168
#ifdef WIN32
kenself's avatar
kenself committed
169
    QRadioButton *bdas, *bdat, *bdac, *bdaa;
170 171 172
    QSpinBox *bdaCard, *bdaFreq, *bdaSrate;
    QLabel *bdaSrateLabel, *bdaBandLabel;
    QComboBox *bdaBandBox;
173 174
    StringListConfigControl *vdevDshowW, *adevDshowW;
    QLineEdit *dshowVSizeLine;
175 176
#else
    QRadioButton *dvbs, *dvbt, *dvbc;
Jean-Baptiste Kempf's avatar
Jean-Baptiste Kempf committed
177
    QSpinBox  *v4lFreq, *pvrFreq, *pvrBitr;
178
    QLineEdit *v4lVideoDevice, *v4lAudioDevice;
179
    QLineEdit *v4l2VideoDevice, *v4l2AudioDevice;
180
    QLineEdit *pvrDevice, *pvrRadioDevice;
181
    QComboBox *v4lNormBox, *v4l2StdBox, *pvrNormBox;
182
    QSpinBox *dvbCard, *dvbFreq, *dvbSrate;
Jean-Baptiste Kempf's avatar
Jean-Baptiste Kempf committed
183 184 185
    QSpinBox *jackChannels, *jackCaching;
    QCheckBox *jackPace, *jackConnect;
    QLineEdit *jackPortsSelected;
186
#endif
187
    QSpinBox *screenFPS;
188

189 190
public slots:
    virtual void updateMRL();
191
    void initialize();
192 193
private slots:
    void updateButtons();
194
    void advancedDialog();
195 196
};

zorglub's avatar
zorglub committed
197
#endif