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 QVLC_VLM_DIALOG_H_
26 #define QVLC_VLM_DIALOG_H_ 1
37 #include "util/qvlcframe.hpp"
38 #include "util/singleton.hpp"
49 ControlBroadcastPause,
71 class VLMDialog : public QVLCDialog, public Singleton<VLMDialog>
78 VLMWrapper *vlmWrapper;
81 VLMDialog( intf_thread_t * );
86 QList<VLMAWidget *> vlmItems;
89 QVBoxLayout *vlmItemLayout;
90 QWidget *vlmItemWidget;
93 QDateTimeEdit *time, *date, *repeatTime;
94 QSpinBox *scherepeatnumber, *repeatDays;
95 bool isNameGenuine( const QString& );
96 void mediasPopulator();
98 void removeVLMItem( VLMAWidget * );
99 void startModifyVLMItem( VLMAWidget * );
103 void saveModifications();
104 void showScheduleWidget( int );
105 void selectVLMItem( int );
108 bool exportVLMConf();
109 bool importVLMConf();
111 friend class Singleton<VLMDialog>;
117 VLMWrapper( vlm_t * );
118 virtual ~VLMWrapper();
120 static void AddBroadcast( const QString&, const QString&, const QString&,
121 bool b_enabled = true,
122 bool b_loop = false );
123 static void EditBroadcast( const QString&, const QString&, const QString&,
124 bool b_enabled = true,
125 bool b_loop = false );
126 static void EditSchedule( const QString&, const QString&, const QString&,
127 QDateTime _schetime, QDateTime _schedate,
128 int _scherepeatnumber, int _repeatDays,
129 bool b_enabled = true, const QString& mux = "" );
130 static void AddVod( const QString&, const QString&, const QString&,
131 bool b_enabled = true, const QString& mux = "" );
132 static void EditVod( const QString&, const QString&, const QString&,
133 bool b_enabled = true, const QString& mux = "" );
134 static void AddSchedule( const QString&, const QString&, const QString&,
135 QDateTime _schetime, QDateTime _schedate,
136 int _scherepeatnumber, int _repeatDays,
137 bool b_enabled = true, const QString& mux = "" );
139 static void ControlBroadcast( const QString&, int, unsigned int seek = 0 );
140 static void EnableItem( const QString&, bool );
142 /* We don't have yet the accessors in the core, so the following is commented */
143 //unsigned int NbMedia() { if( p_vlm ) return p_vlm->i_media; return 0; }
144 /* vlm_media_t *GetMedia( int i )
145 { if( p_vlm ) return p_vlm->media[i]; return NULL; }*/
151 class VLMAWidget : public QGroupBox
154 friend class VLMDialog;
156 VLMAWidget( const QString& name, const QString& input, const QString& output,
157 bool _enable, VLMDialog *parent, int _type = QVLM_Broadcast );
158 virtual void update() = 0;
167 QGridLayout *objLayout;
169 virtual void modify();
171 virtual void toggleEnabled( bool );
174 class VLMBroadcast : public VLMAWidget
177 friend class VLMDialog;
179 VLMBroadcast( const QString& name, const QString& input, const QString& output,
180 bool _enable, bool _loop, VLMDialog *parent );
185 QToolButton *loopButton, *playButton;
188 void togglePlayPause();
192 class VLMVod : public VLMAWidget
195 friend class VLMDialog;
197 VLMVod( const QString& name, const QString& input, const QString& output,
198 bool _enable, const QString& _mux, VLMDialog *parent );
205 class VLMSchedule : public VLMAWidget
208 friend class VLMDialog;
210 VLMSchedule( const QString& name, const QString& input, const QString& output,
211 QDateTime schetime, QDateTime schedate, int repeatnumber,
212 int repeatdays, bool enabled, VLMDialog *parent );