]> git.sesse.net Git - vlc/blob - modules/gui/qt4/dialogs/vlm.hpp
Qt4 - Rewrite of the VLM Dialog. It features a list on the left of the VLM object...
[vlc] / modules / gui / qt4 / dialogs / vlm.hpp
1 /*****************************************************************************
2  * vlm.hpp : VLM Management
3  ****************************************************************************
4  * Copyright ( C ) 2006 the VideoLAN team
5  * $Id: vlm.hpp 21875 2007-09-08 16:01:33Z jb $
6  *
7  * Authors: Jean-François Massol <jf.massol@gmail.com>
8  *          Jean-Baptiste Kempf <jb@videolan.org>
9  *
10  * This program is free software; you can redistribute it and/or modify
11  * it under the terms of the GNU General Public License as published by
12  * the Free Software Foundation; either version 2 of the License, or
13  * ( at your option ) any later version.
14  *
15  * This program is distributed in the hope that it will be useful,
16  * but WITHOUT ANY WARRANTY; without even the implied warranty of
17  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
18  * GNU General Public License for more details.
19  *
20  * You should have received a copy of the GNU General Public License
21  * along with this program; if not, write to the Free Software
22  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
23  *****************************************************************************/
24
25 #ifndef _VLM_DIALOG_H_
26 #define _VLM_DIALOG_H_
27
28 #include <vlc/vlc.h>
29
30 #include "ui/vlm.h"
31 #include "util/qvlcframe.hpp"
32
33 enum{
34     QVLM_Broadcast,
35     QVLM_Schedule,
36     QVLM_VOD
37 };
38
39 class QComboBox;
40 class QVBoxLayout;
41 class QStackedWidget;
42 class QLabel;
43 class QGridLayout;
44 class QLineEdit;
45 class QCheckBox;
46 class QToolButton;
47 class QGroupBox;
48 class QPushButton;
49 class QHBoxLayout;
50 class QDateEdit;
51 class QTimeEdit;
52 class QSpinBox;
53 class VLMObject;
54
55 class VLMDialog : public QVLCFrame
56 {
57     Q_OBJECT;
58 public:
59     static VLMDialog * getInstance( intf_thread_t *p_intf )
60     {
61         if( !instance)
62              instance = new VLMDialog( p_intf );
63         return instance;
64     };
65     virtual ~VLMDialog();
66
67 private:
68     VLMDialog( intf_thread_t * );
69     static VLMDialog *instance;
70     Ui::Vlm ui;
71
72     QList<VLMObject *> vlmItems;
73     int currentIndex;
74
75     QVBoxLayout *vlmItemLayout;
76     QWidget *vlmItemWidget;
77   
78     QComboBox *mediatype;
79     QTimeEdit *time;
80     QDateEdit *date;
81     QSpinBox *scherepeatnumber;
82     bool isNameGenuine( QString );
83 public slots:
84     void removeVLMItem( VLMObject * );
85     void startModifyVLMItem( VLMObject * );
86 private slots:
87     void addVLMItem();
88     void clearWidgets();
89     void saveModifications();
90     void showScheduleWidget( int );
91     void selectVLMItem( int );
92 };
93
94 class VLMObject : public QGroupBox 
95 {
96     Q_OBJECT
97     friend class VLMDialog;
98 public:
99     VLMObject( int type, QString name, QString input, QString output, bool _enable, VLMDialog *parent );
100 private:
101     QString name;
102     QString input;
103     QString output;
104     bool b_looped;
105     bool b_enabled;
106     VLMDialog *parent;
107 protected:
108     virtual void enterEvent( QEvent * );
109 private slots:
110     void modify();
111     void stop();
112     void del();
113     void togglePlayPause();
114     void toggleLoop();
115 };
116
117 #endif