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_
37 #include "util/qvlcframe.hpp"
48 ControlBroadcastPause,
70 class VLMDialog : public QVLCDialog
74 static VLMDialog * getInstance( intf_thread_t *p_intf )
77 instance = new VLMDialog( (QWidget *)p_intf->p_sys->p_mi, p_intf );
83 VLMWrapper *vlmWrapper;
86 VLMDialog( QWidget *, intf_thread_t * );
87 static VLMDialog *instance;
90 QList<VLMAWidget *> vlmItems;
93 QVBoxLayout *vlmItemLayout;
94 QWidget *vlmItemWidget;
97 QDateTimeEdit *time, *date, *repeatTime;
98 QSpinBox *scherepeatnumber, *repeatDays;
99 bool isNameGenuine( const QString& );
100 void mediasPopulator();
102 void removeVLMItem( VLMAWidget * );
103 void startModifyVLMItem( VLMAWidget * );
107 void saveModifications();
108 void showScheduleWidget( int );
109 void selectVLMItem( int );
112 bool exportVLMConf();
113 bool importVLMConf();
119 VLMWrapper( vlm_t * );
120 virtual ~VLMWrapper();
122 static void AddBroadcast( const QString&, const QString&, const QString&,
123 bool b_enabled = true,
124 bool b_loop = false );
125 static void EditBroadcast( const QString&, const QString&, const QString&,
126 bool b_enabled = true,
127 bool b_loop = false );
128 static void EditSchedule( const QString&, const QString&, const QString&,
129 QDateTime _schetime, QDateTime _schedate,
130 int _scherepeatnumber, int _repeatDays,
131 bool b_enabled = true, const QString& mux = "" );
132 static void AddVod( const QString&, const QString&, const QString&,
133 bool b_enabled = true, const QString& mux = "" );
134 static void EditVod( const QString&, const QString&, const QString&,
135 bool b_enabled = true, const QString& mux = "" );
136 static void AddSchedule( const QString&, const QString&, const QString&,
137 QDateTime _schetime, QDateTime _schedate,
138 int _scherepeatnumber, int _repeatDays,
139 bool b_enabled = true, const QString& mux = "" );
141 static void ControlBroadcast( const QString&, int, unsigned int seek = 0 );
142 static void EnableItem( const QString&, bool );
144 /* We don't have yet the accessors in the core, so the following is commented */
145 //unsigned int NbMedia() { if( p_vlm ) return p_vlm->i_media; return 0; }
146 /* vlm_media_t *GetMedia( int i )
147 { if( p_vlm ) return p_vlm->media[i]; return NULL; }*/
153 class VLMAWidget : public QGroupBox
156 friend class VLMDialog;
158 VLMAWidget( const QString& name, const QString& input, const QString& output,
159 bool _enable, VLMDialog *parent, int _type = QVLM_Broadcast );
160 virtual void update() = 0;
169 QGridLayout *objLayout;
171 virtual void modify();
173 virtual void toggleEnabled( bool );
176 class VLMBroadcast : public VLMAWidget
179 friend class VLMDialog;
181 VLMBroadcast( const QString& name, const QString& input, const QString& output,
182 bool _enable, bool _loop, VLMDialog *parent );
187 QToolButton *loopButton, *playButton;
190 void togglePlayPause();
194 class VLMVod : public VLMAWidget
197 friend class VLMDialog;
199 VLMVod( const QString& name, const QString& input, const QString& output,
200 bool _enable, const QString& _mux, VLMDialog *parent );
207 class VLMSchedule : public VLMAWidget
210 friend class VLMDialog;
212 VLMSchedule( const QString& name, const QString& input, const QString& output,
213 QDateTime schetime, QDateTime schedate, int repeatnumber,
214 int repeatdays, bool enabled, VLMDialog *parent );