open.hpp 3.21 KB
Newer Older
1 2 3
/*****************************************************************************
 * open.hpp : advanced open dialog
 ****************************************************************************
4
 * Copyright (C) 2006-2007 the VideoLAN team
5
 * $Id$
6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23
 *
 * Authors: Jean-Baptiste Kempf <jb@videolan.org>
 *
 * 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.
 ******************************************************************************/

24 25
#ifndef QVLC_OPEN_DIALOG_H_
#define QVLC_OPEN_DIALOG_H_ 1
26

Christophe Mutricy's avatar
Christophe Mutricy committed
27 28 29 30
#ifdef HAVE_CONFIG_H
# include "config.h"
#endif

31
#include <vlc_common.h>
32
#include <vlc_url.h>
33 34

#include "util/qvlcframe.hpp"
35
#include "ui/open.h"
36
#include "components/open_panels.hpp"
37

38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54
enum {
    OPEN_FILE_TAB,
    OPEN_DISC_TAB,
    OPEN_NETWORK_TAB,
    OPEN_CAPTURE_TAB,
    OPEN_TAB_MAX
};

enum {
    OPEN_AND_PLAY,
    OPEN_AND_ENQUEUE,
    OPEN_AND_STREAM,
    OPEN_AND_SAVE,
    SELECT              /* Special mode to select a MRL (for VLM or similar */
};


55
class QString;
56

57
class OpenDialog : public QVLCDialog
58
{
François Cartegnie's avatar
François Cartegnie committed
59
    Q_OBJECT
60
public:
61
    static OpenDialog * getInstance( QWidget *parent, intf_thread_t *p_intf,
62 63
                                bool b_rawInstance = false, int _action_flag = 0,
                                bool b_selectMode = false, bool b_pl = true );
64

65 66
    static void killInstance()
    {
67
        delete instance;
68 69
        instance = NULL;
    }
70

71
    void showTab( int = OPEN_FILE_TAB );
72
    QString getMRL( bool b = true );
73 74

    QStringList getMRLs( bool b = true );
Rémi Duraffort's avatar
Rémi Duraffort committed
75
    QString getOptions();
76

77
public slots:
78
    void selectSlots();
79
    void play();
80
    void stream( bool b_transode_only = false );
81
    void enqueue( bool b_enqueue = true );
82
    void transcode();
83

84
private:
85
    OpenDialog( QWidget *parent, intf_thread_t *, bool b_selectMode,
86
                int _action_flag = 0, bool b_pl = true );
87
    virtual ~OpenDialog();
88

89 90
    static OpenDialog *instance;
    input_thread_t *p_input;
91

92
    QString optionsMRL;
93
    QString storedMethod;
94
    QStringList itemsMRL;
95

96 97
    Ui::Open ui;
    FileOpenPanel *fileOpenPanel;
98
    NetOpenPanel *netOpenPanel;
99
    DiscOpenPanel *discOpenPanel;
100
    CaptureOpenPanel *captureOpenPanel;
Clément Stenac's avatar
Clément Stenac committed
101

102
    int i_action_flag;
103
    bool b_pl;
104
    QStringList SeparateEntries( const QString& );
105

106
    QPushButton *cancelButton, *selectButton;
107
    QToolButton *playButton;
108

Clément Stenac's avatar
Clément Stenac committed
109
private slots:
110
    void setMenuAction();
111
    void cancel();
112
    void close();
113
    void toggleAdvancedPanel();
114
    void updateMRL( const QStringList&, const QString& );
Clément Stenac's avatar
Clément Stenac committed
115
    void updateMRL();
116
    void newCachingMethod( const QString& );
117
    void signalCurrent( int );
118
    void browseInputSlave();
119 120 121
};

#endif