1 /*****************************************************************************
2 * vlm.hpp : VLM Management
3 ****************************************************************************
4 * Copyright ( C ) 2006 the VideoLAN team
7 * Authors: Jean-François Massol <jf.massol@gmail.com>
8 * Jean-Baptiste Kempf <jb@videolan.org>
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.
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.
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 *****************************************************************************/
25 #ifndef _VLM_DIALOG_H_
26 #define _VLM_DIALOG_H_
39 #include "util/qvlcframe.hpp"
50 ControlBroadcastPause,
72 class VLMDialog : public QVLCDialog
76 static VLMDialog * getInstance( intf_thread_t *p_intf )
79 instance = new VLMDialog( (QWidget *)p_intf->p_sys->p_mi, p_intf );
84 VLMWrapper *vlmWrapper;
87 VLMDialog( QWidget *, intf_thread_t * );
88 static VLMDialog *instance;
91 QList<VLMAWidget *> vlmItems;
94 QVBoxLayout *vlmItemLayout;
95 QWidget *vlmItemWidget;
98 QDateTimeEdit *time, *date, *repeatTime;
99 QSpinBox *scherepeatnumber, *repeatDays;
100 bool isNameGenuine( QString );
101 void mediasPopulator();
103 void removeVLMItem( VLMAWidget * );
104 void startModifyVLMItem( VLMAWidget * );
108 void saveModifications();
109 void showScheduleWidget( int );
110 void selectVLMItem( int );
113 bool exportVLMConf();
114 bool importVLMConf();
120 VLMWrapper( vlm_t * );
121 virtual ~VLMWrapper();
123 static void AddBroadcast( const QString, const QString, const QString,
124 bool b_enabled = true,
125 bool b_loop = false );
126 static void EditBroadcast( const QString, const QString, const QString,
127 bool b_enabled = true,
128 bool b_loop = false );
129 static void EditSchedule( const QString, const QString, const QString,
130 QDateTime _schetime, QDateTime _schedate,
131 int _scherepeatnumber, int _repeatDays,
132 bool b_enabled = true, QString mux = "" );
133 static void AddVod( const QString, const QString, const QString,
134 bool b_enabled = true, QString mux = "" );
135 static void EditVod( const QString, const QString, const QString,
136 bool b_enabled = true, QString mux = "" );
137 static void AddSchedule( const QString, const QString, const QString,
138 QDateTime _schetime, QDateTime _schedate,
139 int _scherepeatnumber, int _repeatDays,
140 bool b_enabled = true, QString mux = "" );
142 static void ControlBroadcast( const QString, int, unsigned int seek = 0 );
143 static void EnableItem( const QString, bool );
145 /* We don't have yet the accessors in the core, so the following is commented */
146 //unsigned int NbMedia() { if( p_vlm ) return p_vlm->i_media; return 0; }
147 /* vlm_media_t *GetMedia( int i )
148 { if( p_vlm ) return p_vlm->media[i]; return NULL; }*/
154 class VLMAWidget : public QGroupBox
157 friend class VLMDialog;
159 VLMAWidget( QString name, QString input, QString output,
160 bool _enable, VLMDialog *parent, int _type = QVLM_Broadcast );
161 virtual void update() = 0;
170 virtual void enterEvent( QEvent * );
171 QGridLayout *objLayout;
173 virtual void modify();
175 virtual void toggleEnabled( bool );
178 class VLMBroadcast : public VLMAWidget
181 friend class VLMDialog;
183 VLMBroadcast( QString name, QString input, QString output,
184 bool _enable, bool _loop, VLMDialog *parent );
189 QToolButton *loopButton, *playButton;
192 void togglePlayPause();
196 class VLMVod : public VLMAWidget
199 friend class VLMDialog;
201 VLMVod( QString name, QString input, QString output,
202 bool _enable, QString _mux, VLMDialog *parent );
209 class VLMSchedule : public VLMAWidget
212 friend class VLMDialog;
214 VLMSchedule( QString name, QString input, QString output,
215 QDateTime schetime, QDateTime schedate, int repeatnumber,
216 int repeatdays, bool enabled, VLMDialog *parent );