]> git.sesse.net Git - vlc/blob - modules/gui/qt4/dialogs/vlm.hpp
Qt4 - VLM improvements... Classing for the three kind of objects, more property editi...
[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 QDateTimeEdit;
51 class QSpinBox;
52 class VLMAWidget;
53
54 class VLMDialog : public QVLCFrame
55 {
56     Q_OBJECT;
57 public:
58     static VLMDialog * getInstance( intf_thread_t *p_intf )
59     {
60         if( !instance)
61              instance = new VLMDialog( p_intf );
62         return instance;
63     };
64     virtual ~VLMDialog();
65
66 private:
67     VLMDialog( intf_thread_t * );
68     static VLMDialog *instance;
69     Ui::Vlm ui;
70
71     QList<VLMAWidget *> vlmItems;
72     int currentIndex;
73
74     QVBoxLayout *vlmItemLayout;
75     QWidget *vlmItemWidget;
76   
77     QComboBox *mediatype;
78     QDateTimeEdit *time, *date, *repeatTime;
79     QSpinBox *scherepeatnumber, *repeatDays;
80     bool isNameGenuine( QString );
81 public slots:
82     void removeVLMItem( VLMAWidget * );
83     void startModifyVLMItem( VLMAWidget * );
84 private slots:
85     void addVLMItem();
86     void clearWidgets();
87     void saveModifications();
88     void showScheduleWidget( int );
89     void selectVLMItem( int );
90 };
91
92 class VLMAWidget : public QGroupBox 
93 {
94     Q_OBJECT
95     friend class VLMDialog;
96 public:
97     VLMAWidget( QString name, QString input, QString output, bool _enable, VLMDialog *parent );
98 protected:
99     QLabel *nameLabel;
100     QString name;
101     QString input;
102     QString output;
103     bool b_enabled;
104     VLMDialog *parent;
105     virtual void enterEvent( QEvent * );
106     QGridLayout *objLayout;
107 private slots:
108     virtual void modify();
109     virtual void del();
110 };
111
112 class VLMBroadcast : public VLMAWidget
113 {
114     Q_OBJECT
115 public:
116     VLMBroadcast( QString name, QString input, QString output, bool _enable, VLMDialog *parent );
117 private:
118     bool b_looped;
119
120 private slots:
121     void stop();
122     void togglePlayPause();
123     void toggleLoop();
124 };
125
126 class VLMVod : public VLMAWidget
127 {
128 public:
129     VLMVod( QString name, QString input, QString output, bool _enable, VLMDialog *parent );
130 private:
131     QString mux;
132 };
133
134 class VLMSchedule : public VLMAWidget
135 {
136 public:
137     VLMSchedule( QString name, QString input, QString output, bool _enable, VLMDialog *parent );
138 };
139
140 #endif